本文整理汇总了PHP中serendipity_plugin_api::update_plugin_owner方法的典型用法代码示例。如果您正苦于以下问题:PHP serendipity_plugin_api::update_plugin_owner方法的具体用法?PHP serendipity_plugin_api::update_plugin_owner怎么用?PHP serendipity_plugin_api::update_plugin_owner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类serendipity_plugin_api
的用法示例。
在下文中一共展示了serendipity_plugin_api::update_plugin_owner方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
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)) {
示例2: explode
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