本文整理汇总了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';
}