1: <?php
2: /**
3: * "Clones" the currrent Zenphoto installation to a new location using symlinks. The <i>zp-core</i>, <i>themes</i>, <i>user plugins</i>
4: * folders and the root <i>index.php</i> file are symlinked. Setup will create the other needed folders.
5: *
6: * The <i>Clone installation</i> button will take you to the cloning page where you can select a folder destination
7: * for the cloned installation. Upon successful cloning there will be a link to <var>setup</var> for the new
8: * installation. (This presumes the <var>setup</var> files are present. If not you will be told which files
9: * need to be reloaded.)
10: *
11: * <b>Note:</b> If the destination already has a Zenphoto installation these files and folders will be removed by the cloning
12: * process!
13: *
14: * The <i>Delete setup scripts</i> button will remove the <var>setup</var> files from the current installation. This is
15: * the same function provided by <i>Setup</i> after a successful install. It is provided here because you will likely not want to
16: * remove the setup scripts until you have cloned and installed all desired destinations.
17: *
18: * @author Stephen Billard (sbillard)
19: * @package plugins
20: * @subpackage admin
21: */
22:
23: $plugin_is_filter = 5|ADMIN_PLUGIN;
24: $plugin_description = gettext('Allows multiple Zenphoto installations to share a single set of Zenphoto script files.');
25: $plugin_author = "Stephen Billard (sbillard)";
26: $plugin_disable = (SYMLINK)?(zpFunctions::hasPrimaryScripts())?false:gettext('Only the primary installation may clone offspring installations.'):gettext('Your server does not support symbolic linking.');
27:
28: require_once(SERVERPATH.'/'.ZENFOLDER.'/reconfigure.php');
29: if (!$plugin_disable) {
30: zp_register_filter('admin_utilities_buttons', 'cloneZenphoto::button');
31: }
32:
33: class cloneZenphoto {
34:
35: static function button($buttons) {
36: $buttons[] = array(
37: 'category'=>gettext('Admin'),
38: 'enable'=>true,
39: 'button_text'=>gettext('Clone installation'),
40: 'formname'=>'cloneZenphoto',
41: 'action'=>PLUGIN_FOLDER.'/cloneZenphoto/cloneTab.php',
42: 'icon'=>'images/folder.png',
43: 'title'=>gettext('Create a new installation using links to the current install files.'),
44: 'alt'=>gettext('Clone'),
45: 'hidden'=>'',
46: 'rights'=> ADMIN_RIGHTS
47: );
48: return $buttons;
49: }
50:
51: }
52: ?>