当前位置: 首页>>代码示例>>PHP>>正文


PHP serendipity_plugin_api::update_plugin_placement方法代码示例

本文整理汇总了PHP中serendipity_plugin_api::update_plugin_placement方法的典型用法代码示例。如果您正苦于以下问题:PHP serendipity_plugin_api::update_plugin_placement方法的具体用法?PHP serendipity_plugin_api::update_plugin_placement怎么用?PHP serendipity_plugin_api::update_plugin_placement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在serendipity_plugin_api的用法示例。


在下文中一共展示了serendipity_plugin_api::update_plugin_placement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

             if (empty($pluginname)) {
                 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);
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:31,代码来源:plugins.inc.php

示例2: array

 $col_assoc = array('event_col' => 'event', 'eventh_col' => 'eventh');
 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);
开发者ID:vonnordmann,项目名称:Serendipity,代码行数:31,代码来源:plugins.inc.php


注:本文中的serendipity_plugin_api::update_plugin_placement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。