/** * install one plugin * * @return array status */ function Core_adminPluginsInstallOne() { $to_install = $_REQUEST['name']; // { is it already installed? $installed = Core_adminPluginsGetInstalled(); foreach ($installed as $key => $p) { if ($key == $to_install) { return array('ok' => 1, 'message' => __('Plugin already installed')); } } // } // { does it exist? $available = Core_adminPluginsGetAvailable(); $found = 0; foreach ($available as $key => $p) { if ($key == $to_install) { $found = 1; } } if ($found == 0) { return array('ok' => 0, 'message' => __('Plugin not found')); } // } // { install it $plugins = array(); foreach ($installed as $key => $p) { $plugins[$key] = 1; } $plugins[$to_install] = 1; $_REQUEST['plugins'] = $plugins; return Core_adminPluginsSetInstalled(); // } }
} $links = $PLUGINS[$plugin]['admin']['menu']; foreach ($links as $name => $link) { Core_adminMenusAdd($name, $link); } } Core_cacheClear('admin'); } $message = @$_GET['message']; if ($message == 'updated') { echo '<em>plugins updated</em>'; } elseif ($message == 'failed') { echo '<em>' . __('update failed') . '</em><p>' . __('failed to meet the plugin dependencies') . '</p>'; } $installed = Core_adminPluginsGetInstalled(); $available = Core_adminPluginsGetAvailable(); // { start form echo ' <form method="post" action="siteoptions.php?page=plugins"> <div id="tabs"> <ul> <li><a href="#installed">' . __('Installed') . '</a></li> <li><a href="#available">' . __('Available') . '</a></li> </ul>'; // } // { installed echo '<div id="installed"> <table id="installed_plugins" class="display" style="width:100%"> <thead> <tr> <th>' . __('Name') . '</th>