本文整理汇总了PHP中Modules::add_required方法的典型用法代码示例。如果您正苦于以下问题:PHP Modules::add_required方法的具体用法?PHP Modules::add_required怎么用?PHP Modules::add_required使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Modules
的用法示例。
在下文中一共展示了Modules::add_required方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array_splice
if(in_array($module, $activemodules)) {
array_splice($activemodules, array_search($module, $activemodules), 1);
}
}
// reorder active modules to be consistent with the module-order
$old_activemodules = $activemodules;
$activemodules = array();
foreach($modules as $module) {
if(in_array($module, $old_activemodules)) {
$activemodules[] = $module;
}
}
$activemodules = Modules::add_required($activemodules);
$old_modules = $modules;
$modules = Modules::refreshAll($old_modules);
$activemodules = Modules::refreshActive($old_modules, $activemodules);
setModuleOrder($modules);
setActiveModules($activemodules);
$menu = array();
foreach($modules as $index => $module) {
$status = in_array($module, $activemodules) ? "on" : "off";
// required modules can not be toggled on and off
$toggle_action = NULL;
示例2: getModuleOrder
require_once WEBROOT . "page_builder/Page.php";
//require WEBROOT . "page_builder/counter.php";
require WEBROOT . "page_builder/page_tools.php";
require WEBROOT . "customize/customize_lib.php";
$page = Page::factory();
$page->module('home');
PageViews::increment('home', $page->platform);
$whats_new_count = Home::$whats_new_count;
$top_item = Home::$whats_new->getTopItemName();
Modules::init($page->branch, $page->certs, $page->platform);
$old_modules = getModuleOrder();
$moduleorder = Modules::refreshAll($old_modules, $page->branch);
setModuleOrder($moduleorder);
$modules = getActiveModules($page->branch);
$modules = Modules::refreshActive($old_modules, $modules, $page->branch);
$modules = Modules::add_required($modules, $page->branch);
setActiveModules($modules);
$all_modules = Modules::$default_order;
//$fh = fopen('/tmp/headers-' . time() . '.txt', 'w');
//fwrite($fh, str_replace('",', "\",\n", json_encode($_SERVER)) . '\n');
//fclose($fh);
$page->prevent_caching('Basic');
$page->prevent_caching('Touch');
$page->cache();
/*
function url($module) {
// we rewrite urls for modules which require certificates
// to make sure the user at least once sees the get certificates page
$url = Modules::url($module);
if( $_COOKIE['mitcertificate'] != 'yes' && Modules::certificate_required($module) ) {
$url = "./certcheck.php?ref=" . urlencode($url) . "&name=" . urlencode(Modules::title($module)) . "&image=" . $module;