Exemplo n.º 1
0
                 continue;
             }
             $serendipity['POST']['placement'][$pluginname] = $col_assoc[$matches[1]];
             $new_order[] = $pluginname;
         }
     }
     if (is_array($new_order)) {
         foreach ($new_order as $new_order_pos => $order_plugin) {
             serendipity_db_query("UPDATE {$serendipity['dbPrefix']}plugins SET sort_order = " . (int) $new_order_pos . " WHERE name='" . serendipity_db_escape_string($order_plugin) . "'");
         }
     }
 }
 if (isset($_POST['SAVE']) && isset($_POST['serendipity']['placement']) && serendipity_checkFormToken()) {
     foreach ($_POST['serendipity']['placement'] as $plugin_name => $placement) {
         serendipity_plugin_api::update_plugin_placement(addslashes($plugin_name), addslashes($placement));
         serendipity_plugin_api::update_plugin_owner(addslashes($plugin_name), addslashes($_POST['serendipity']['ownership'][$plugin_name]));
     }
 }
 if (isset($serendipity['GET']['install_plugin'])) {
     $authorid = $serendipity['authorid'];
     if (serendipity_checkPermission('adminPluginsMaintainOthers')) {
         $authorid = '0';
     }
     $fetchplugin_data = array('GET' => &$serendipity['GET'], 'install' => true);
     serendipity_plugin_api::hook_event('backend_plugins_fetchplugin', $fetchplugin_data);
     if ($fetchplugin_data['install']) {
         $serendipity['debug']['pluginload'] = array();
         $inst = serendipity_plugin_api::create_plugin_instance($serendipity['GET']['install_plugin'], null, serendipity_plugin_api::is_event_plugin($serendipity['GET']['install_plugin']) ? 'event' : 'right', $authorid, serendipity_db_escape_string($serendipity['GET']['pluginPath']));
         /* Load the new plugin */
         $plugin =& serendipity_plugin_api::load_plugin($inst);
         if (!is_object($plugin)) {
Exemplo n.º 2
0
 if (isset($template_vars['sidebars'])) {
     $sidebars = explode(',', $template_vars['sidebars']);
 } elseif (isset($serendipity['sidebars'])) {
     $sidebars = $serendipity['sidebars'];
 } else {
     $sidebars = array('left', 'hide', 'right');
 }
 foreach ($sidebars as $sidebar) {
     $col_assoc[$sidebar . '_col'] = $sidebar;
 }
 if (isset($_POST['SAVE']) && serendipity_checkFormToken()) {
     $pos = 0;
     foreach ($_POST['serendipity']['plugin'] as $plugin) {
         serendipity_db_query("UPDATE {$serendipity['dbPrefix']}plugins\n                                     SET sort_order = " . $pos . "\n                                   WHERE name='" . serendipity_db_escape_string($plugin['id']) . "'");
         serendipity_plugin_api::update_plugin_placement(addslashes($plugin['id']), addslashes($plugin['placement']));
         serendipity_plugin_api::update_plugin_owner(addslashes($plugin['id']), addslashes($_POST['serendipity']['ownership'][$plugin['name']]));
         $pos++;
     }
 }
 if (isset($serendipity['GET']['install_plugin'])) {
     $authorid = $serendipity['authorid'];
     if (serendipity_checkPermission('adminPluginsMaintainOthers')) {
         $authorid = '0';
     }
     if ($serendipity['ajax']) {
         // we need to catch the spartacus messages to return only them to the ajax call (used by the update all button)
         ob_start();
     }
     $fetchplugin_data = array('GET' => &$serendipity['GET'], 'install' => true);
     serendipity_plugin_api::hook_event('backend_plugins_fetchplugin', $fetchplugin_data);
     // we now have to check that the plugin is not already installed, or stackable, to prevent invalid double instances