本文整理匯總了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;
}