本文整理匯總了PHP中plugins::sort_fs_plugins方法的典型用法代碼示例。如果您正苦於以下問題:PHP plugins::sort_fs_plugins方法的具體用法?PHP plugins::sort_fs_plugins怎麽用?PHP plugins::sort_fs_plugins使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類plugins
的用法示例。
在下文中一共展示了plugins::sort_fs_plugins方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ws_plugins_getList
/**
* API method
* Returns the list of all plugins
* @param mixed[] $params
*/
function ws_plugins_getList($params, $service)
{
include_once PHPWG_ROOT_PATH . 'admin/include/plugins.class.php';
$plugins = new plugins();
$plugins->sort_fs_plugins('name');
$plugin_list = array();
foreach ($plugins->fs_plugins as $plugin_id => $fs_plugin) {
if (isset($plugins->db_plugins_by_id[$plugin_id])) {
$state = $plugins->db_plugins_by_id[$plugin_id]['state'];
} else {
$state = 'uninstalled';
}
$plugin_list[] = array('id' => $plugin_id, 'name' => $fs_plugin['name'], 'version' => $fs_plugin['version'], 'state' => $state, 'description' => $fs_plugin['description']);
}
return $plugin_list;
}
示例2: array
//--------------------------------------------------------Incompatible Plugins
if (isset($_GET['incompatible_plugins'])) {
$incompatible_plugins = array();
foreach ($plugins->get_incompatible_plugins() as $plugin => $version) {
if ($plugin == '~~expire~~') {
continue;
}
$incompatible_plugins[] = $plugin;
}
echo json_encode($incompatible_plugins);
exit;
}
// +-----------------------------------------------------------------------+
// | start template output |
// +-----------------------------------------------------------------------+
$plugins->sort_fs_plugins('name');
$merged_extensions = $plugins->get_merged_extensions();
$merged_plugins = false;
$tpl_plugins = array();
$active_plugins = 0;
foreach ($plugins->fs_plugins as $plugin_id => $fs_plugin) {
if (isset($_SESSION['incompatible_plugins'][$plugin_id]) and $fs_plugin['version'] != $_SESSION['incompatible_plugins'][$plugin_id]) {
// Incompatible plugins must be reinitilized
unset($_SESSION['incompatible_plugins']);
}
$tpl_plugin = array('ID' => $plugin_id, 'NAME' => $fs_plugin['name'], 'VISIT_URL' => $fs_plugin['uri'], 'VERSION' => $fs_plugin['version'], 'DESC' => $fs_plugin['description'], 'AUTHOR' => $fs_plugin['author'], 'AUTHOR_URL' => @$fs_plugin['author uri'], 'U_ACTION' => sprintf($action_url, $plugin_id));
if (isset($plugins->db_plugins_by_id[$plugin_id])) {
$tpl_plugin['STATE'] = $plugins->db_plugins_by_id[$plugin_id]['state'];
} else {
$tpl_plugin['STATE'] = 'inactive';
}