本文整理匯總了PHP中CAppUI::getActiveModules方法的典型用法代碼示例。如果您正苦於以下問題:PHP CAppUI::getActiveModules方法的具體用法?PHP CAppUI::getActiveModules怎麽用?PHP CAppUI::getActiveModules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CAppUI
的用法示例。
在下文中一共展示了CAppUI::getActiveModules方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadExtras
public function loadExtras(array $storage, CAppUI $AppUI, $m, $type = 'tabs')
{
//Set up extra $type
if (!isset($storage['all_' . $type][$m])) {
// For some reason on some systems if you don't set this up
// first you get recursive pointers to the all_$type array, creating
// phantom tabs.
if (!isset($storage['all_' . $type])) {
$storage['all_' . $type] = array();
}
$storage['all_' . $type][$m] = array();
$all_items =& $storage['all_' . $type][$m];
foreach ($AppUI->getActiveModules() as $dir => $module) {
if (!canAccess($dir)) {
continue;
}
$modules_tabs = $AppUI->readFiles(W2P_BASE_DIR . '/modules/' . $dir . '/', '^' . $m . '_tab.*\\.php');
foreach ($modules_tabs as $tab) {
// Get the name as the subextension
// cut the module_tab. and the .php parts of the filename
// (begining and end)
$nameparts = explode('.', $tab);
$filename = substr($tab, 0, -4);
if (count($nameparts) > 3) {
$file = $nameparts[1];
if (!isset($all_items[$file])) {
$all_items[$file] = array();
}
$tabArray =& $all_items[$file];
$name = $nameparts[2];
} else {
$tabArray =& $all_items;
$name = $nameparts[1];
}
$tabArray[] = array('name' => ucfirst(str_replace('_', ' ', $name)), 'file' => W2P_BASE_DIR . '/modules/' . $dir . '/' . $filename, 'module' => $dir);
}
}
} else {
$all_items =& $storage['all_' . $type][$m];
}
}