本文整理汇总了PHP中Gdn_ApplicationManager::availableApplications方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn_ApplicationManager::availableApplications方法的具体用法?PHP Gdn_ApplicationManager::availableApplications怎么用?PHP Gdn_ApplicationManager::availableApplications使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn_ApplicationManager
的用法示例。
在下文中一共展示了Gdn_ApplicationManager::availableApplications方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAddons
/**
*
*
* @param bool $Enabled
* @return array
*/
public function getAddons($Enabled = false)
{
$Addons = array();
// Get the core.
self::_addAddon(array('AddonKey' => 'vanilla', 'AddonType' => 'core', 'Version' => APPLICATION_VERSION, 'Folder' => '/'), $Addons);
// Get a list of all of the applications.
$ApplicationManager = new Gdn_ApplicationManager();
if ($Enabled) {
$Applications = $ApplicationManager->availableApplications();
} else {
$Applications = $ApplicationManager->enabledApplications();
}
foreach ($Applications as $Key => $Info) {
// Exclude core applications.
if (in_array(strtolower($Key), array('conversations', 'dashboard', 'skeleton', 'vanilla'))) {
continue;
}
$Addon = array('AddonKey' => $Key, 'AddonType' => 'application', 'Version' => val('Version', $Info, '0.0'), 'Folder' => '/applications/' . GetValue('Folder', $Info, strtolower($Key)));
self::_AddAddon($Addon, $Addons);
}
// Get a list of all of the plugins.
$PluginManager = Gdn::pluginManager();
if ($Enabled) {
$Plugins = $PluginManager->enabledPlugins();
} else {
$Plugins = $PluginManager->availablePlugins();
}
foreach ($Plugins as $Key => $Info) {
// Exclude core plugins.
if (in_array(strtolower($Key), array())) {
continue;
}
$Addon = array('AddonKey' => $Key, 'AddonType' => 'plugin', 'Version' => val('Version', $Info, '0.0'), 'Folder' => '/applications/' . GetValue('Folder', $Info, $Key));
self::_addAddon($Addon, $Addons);
}
// Get a list of all the themes.
$ThemeManager = new Gdn_ThemeManager();
if ($Enabled) {
$Themes = $ThemeManager->enabledThemeInfo(true);
} else {
$Themes = $ThemeManager->availableThemes();
}
foreach ($Themes as $Key => $Info) {
// Exclude core themes.
if (in_array(strtolower($Key), array('default'))) {
continue;
}
$Addon = array('AddonKey' => $Key, 'AddonType' => 'theme', 'Version' => val('Version', $Info, '0.0'), 'Folder' => '/themes/' . GetValue('Folder', $Info, $Key));
self::_addAddon($Addon, $Addons);
}
// Get a list of all locales.
$LocaleModel = new LocaleModel();
if ($Enabled) {
$Locales = $LocaleModel->enabledLocalePacks(true);
} else {
$Locales = $LocaleModel->availableLocalePacks();
}
foreach ($Locales as $Key => $Info) {
// Exclude core themes.
if (in_array(strtolower($Key), array('skeleton'))) {
continue;
}
$Addon = array('AddonKey' => $Key, 'AddonType' => 'locale', 'Version' => val('Version', $Info, '0.0'), 'Folder' => '/locales/' . GetValue('Folder', $Info, $Key));
self::_addAddon($Addon, $Addons);
}
return $Addons;
}