本文整理汇总了PHP中Menu::makeMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::makeMenu方法的具体用法?PHP Menu::makeMenu怎么用?PHP Menu::makeMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu::makeMenu方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="../../_css/ie.css" media="screen"/>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen"/>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800,300' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700' rel='stylesheet' type='text/css'>
<script src="http://www.apple.com/library/quicktime/scripts/ac_quicktime.js" language="JavaScript" type="text/javascript"></script>
<script src="http://www.apple.com/library/quicktime/scripts/qtp_library.js" language="JavaScript" type="text/javascript"></script>
<script src="../../js/modernizr.2.0.6.js"></script>
</head>
<body>
<header>
<nav>
<span class="menu-social">
<?php
$social->makeMenu();
?>
</span>
<span class="menu-info">
<?php
$super_menu->makeMenu();
?>
</span>
<span class="menu-main">
<?php
$menu->makeMenu();
?>
</span>
</nav>
</header>
<div class="panel">
示例2:
border:1px solid;
display:block;
margin: 10px auto;
padding:50px;
width:800px;
}
</style>
</head>
<body>
<div class="div_border">
<div class="mrmenu_hor">
<?php
//This is the actual menu, can be placed anywhere you like!
$menu->makeMenu();
?>
</div>
</div>
<div class="div_border">
<p>This is a vertical menu example, the css is pasted directly from <a href="http://www.dynamicdrive.com/style/csslibrary/item/nested_side_bar_menu/">dynamicdrive</a>:</p>
<p> </p>
<style type="text/css">
/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */
.sidebarmenu ul{
margin: 0;
padding: 0;
示例3: load
//.........这里部分代码省略.........
//if($result == false){
// verifica as informações iniciais, como estrutura de diretórios e outros
$resultCheckStruct = $settings->checkStruct();
if ($resultCheckStruct == false) {
// anexa evento
$resultEvents = Events::Attach('error[app_not_found]', array('value' => '', 'action' => ''));
if (!$resultEvents) {
$html = '<h1>Suite</h1>';
$html .= '<h3>Application not found</h3>';
$html .= '<p>';
$html .= '<strong>Name:</strong> ' . Globals::get('path/app/name');
$html .= '<br><strong>Path:</strong> ' . Globals::get('path/app/path');
$html .= '</p>';
echo $html;
exit;
}
}
//}
}
// captura a lista de plugins
$pluginsList = $plugins->getList();
// redefine ordem dos plugins
$pluginsList = $plugins->reDefinePlugins($pluginsList);
// cria um objeto com todos os plugins
$pluginsObj = $plugins->getPlugins($pluginsList);
Globals::set("plugins")->inner('list', $pluginsList);
Globals::set("plugins")->inner('action', $pluginsObj);
// redireciona a página se foi setado um preixo para a url
$http->checkPrefixUrl($settings, $path);
// executa caso o plugin for chamado diretamente via url ou código
$plugins->callDirect($http, $path);
//captura todos os controllers e as options
$controllersList = $controller->getControllers();
$appListArray = Functions::scanOnlyDir(Globals::get('path/app/appbase/path'));
Globals::set('app')->list = $appListArray;
Globals::set('app')->options = array('master' => $controller->getOptionMaster(), 'modules' => $controllersList);
$controllersManagerList = $controller->getControllers(Globals::get()->path->manager->modules->path);
Globals::set('manager')->options = array('master' => $controller->getOptionMaster(Globals::get('path/manager/modules/path')), 'modules' => $controllersManagerList);
//Globals::set('manager')->access = "";
// verifica dependencias de plugins no controler Master
$resultDependenceMaster = $plugins->checkDependence('_control');
$resultDependenceMasterObj = json_decode($resultDependenceMaster);
Globals::set('plugins')->dependence = array("_control" => $resultDependenceMasterObj->data[0]);
$lastaction = Globals::get('http/controllers/lastaction');
// verifica dependencias de plugins no controler Master
$resultDependenceModules = $plugins->checkDependence($lastaction);
$resultDependenceModulesObj = json_decode($resultDependenceModules);
Globals::set('plugins')->inner('dependence')->add(array($lastaction => $resultDependenceModulesObj->data[0]));
//Globals::set('plugins')->dependence = array("_control"=>$resultDependenceMasterObj->data[0]);
if (Globals::get('app/run') == '!') {
$result = Functions::checkModeAdmin();
if ($result == false) {
$queryurl = Globals::get('http/query');
$queryurl = substr($queryurl, 4);
header("location: " . Globals::get('path/manager/link') . "/manager/access&destin=" . $queryurl);
return;
} else {
// verifica dependencia da aplicação
//$plugins->checkDependence('_control');
}
// verifica se esta online no Manager ------------------------------
$result = Functions::checkOnline(false);
if ($result == true) {
// cria um menu baseado nos controllers -----------------------
$controllerArray = Globals::get('manager/options/modules');
//$controller->getControllers('');
/*echo '<pre>';
print_r($controllerArray);
echo '</pre>';*/
$menu = Menu::makeMenu($controllerArray, Globals::get('path/manager/modules/path'), true);
Globals::set('manager')->menu = $menu;
// registra a versão atual
Globals::set("suite")->inner('update', array('status' => 'updated', 'version' => $suite['version'], 'link' => '', 'html' => ''));
$resultCheckUpdateStatus = Functions::checkUpdateStatus($suite['version']);
if ($resultCheckUpdateStatus != false) {
$pathUpdate = Globals::get('path/manager/libs/url') . 'update.php';
Globals::set("suite")->inner('update', array('status' => 'outdated', 'version' => $resultCheckUpdateStatus->version, 'link' => $resultCheckUpdateStatus->link == '[auto]' ? $pathUpdate : $resultCheckUpdateStatus->link));
$alertHtml = Globals::get("alert/html");
$alertHtml .= Functions::requireToVar(Globals::get('path/controller/path') . '_html/update.php');
Globals::set("alert")->inner('html', $alertHtml);
}
}
} else {
$controllerArray = Globals::get('app/options/modules');
//$controller->getControllers('',Globals::get('path/app/path'));
$menu = Menu::makeMenu($controllerArray, Globals::get('path/app/modules/path'), false);
Globals::set('app')->menu = $menu;
if ($resultDependenceModulesObj->status == 'found') {
// anexa evento
Events::Attach('plugin[founddependence]', array('value' => $resultDependenceMaster, 'action' => $lastaction));
}
if ($resultDependenceMasterObj->status == 'found') {
// anexa evento
Events::Attach('plugin[founddependence]', array('value' => $resultDependenceMaster, 'action' => ''));
}
}
if ($getSettings->mode == "page") {
$this->pageMake();
}
}
示例4: makeMenu
public static function makeMenu($controllerArray, $replace = null, $manager = false, $nivel = -1)
{
// if(count((array)$controllerArray)<=1)
// return false;
$path = Globals::get('path');
$nivel++;
$html = '';
$html .= '<ul data-nivel="' . $nivel . '">';
foreach ($controllerArray as $key => $value) {
$menu_title = null;
$menu_separator = null;
$menu_layoutreset = null;
$nocontrol = false;
$targetAjust = null;
$name = isset($value->name) ? $value->name : $key;
$pathControl = isset($value->controller) ? $value->controller : $key;
$inner = isset($value->inner) ? $value->inner : null;
$title = isset($value->title) ? $value->title : null;
$target = isset($value->target) ? $value->target : null;
$action = isset($value->action) ? $value->action : null;
$visible = isset($value->visible) ? $value->visible : true;
$enabled = isset($value->enabled) ? $value->enabled : true;
$parent = isset($value->parent) ? $value->parent : null;
$menu = isset($value->menu) ? $value->menu : null;
if (is_object($menu)) {
$menu_title = isset($menu->title) ? $menu->title : null;
$menu_layoutreset = isset($menu->layoutreset) ? $menu->layoutreset : false;
$menu_separator = isset($menu->separator) ? $menu->separator : null;
}
if ($replace != null) {
$pathControl = str_replace($replace, '', $pathControl);
}
if ($manager == true) {
$location = $path->app->link . '!';
$locationPath = $path->manager->path;
$urllink = $location . '/' . $pathControl;
$pathlink = $locationPath . '' . $pathControl;
$datapath = '!/' . $pathControl;
} else {
$location = $path->app->link;
$locationPath = $path->app->modules->path;
$urllink = $location . '' . $pathControl;
$pathlink = $locationPath . '' . $pathControl;
$datapath = $pathControl;
}
$status = "";
$controlName = explode('/', $pathControl);
$controlName = end($controlName);
$controlPath = $pathlink . '/' . ucfirst($controlName) . '_control.php';
if ($target != null) {
$targetAjust = $target;
if (substr($targetAjust, 0, 1) != "/") {
$targetAjust = dirname($parent) . '/' . $target;
}
$urllink = $location . '/' . $targetAjust;
}
$httplocation = Globals::get()->http->controllers->destination;
if (strpos($httplocation, $pathControl) !== false) {
$status = "active";
}
// força action do options.json do controller ----------------------------------------------------
$destinationControl = Globals::get()->http->controllers->destination;
$forceurl = $destinationControl;
if ($destinationControl == '!') {
$destinationControl = "home";
}
// remove a barra para não dar erro
//$destinationControl = str_replace('!/', '!', $destinationControl);
//echo $datapath.'='.$destinationControl.'<br>';
if ($datapath == $destinationControl . '/') {
//if( strpos($datapath,$destinationControl) !== false){
//if( strpos($location,$destinationControl) !== false){
$status = "active";
}
if (file_exists($replace . $pathControl . '' . ucfirst($key) . '_control.php')) {
$nocontrol = false;
} else {
$nocontrol = true;
}
if ($targetAjust || $action) {
$nocontrol = false;
}
if ($enabled == false) {
$nocontrol = true;
}
if ($visible == true) {
//$nocontrol = true;
$datamenu_separator = "";
if ($menu_separator != null) {
$datamenu_separator = "data-menuseparator='" . $menu_separator . "'";
}
$html .= '<li data-status="' . $status . '" data-rel="itemli" data-path="' . $datapath . '" ' . $datamenu_separator . ' >';
if ($nocontrol == true) {
$link = '';
} else {
$link = 'href="' . $urllink . '"';
}
// ajusta caso seja um link externo
if (strpos($action, "http://") !== false || strpos($action, "https://") !== false) {
$link = 'href="' . $action . '" ';
//.........这里部分代码省略.........