Exemple #1
0
<!--[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">
Exemple #2
0
	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>&nbsp;</p>
    <style type="text/css">
		/*Credits: Dynamic Drive CSS Library */
		/*URL: http://www.dynamicdrive.com/style/ */
		
		.sidebarmenu ul{
		margin: 0;
		padding: 0;
Exemple #3
0
 public function load($options = null)
 {
     $suite = Globals::set()->suite = $this->optionsGlobals;
     Globals::$visibleall = true;
     // cria o container com as classes
     Globals::setPrivate('app')->container = array('settings' => function () {
         require_once 'Settings.php';
         return new Settings();
     }, 'http' => function () {
         require_once 'Http.php';
         return new Http();
     }, 'controller' => function () {
         require_once 'Controller.php';
         return new Controller();
     }, 'view' => function () {
         require_once 'View.php';
         return new View();
     }, 'path' => function () {
         require_once 'Path.php';
         return new Path();
     }, 'plugins' => function () {
         require_once 'Plugins.php';
         return new Plugins();
     });
     $settings = Globals::getPrivate("app")->container->settings;
     $this->settings = $settings = $settings();
     // inicializa a classe Http
     $http = Globals::getPrivate("app")->container->http;
     $this->http = $http = $http();
     // inicializa a classe controller
     $controller = Globals::getPrivate("app")->container->controller;
     $this->controller = $controller = $controller();
     // inicializa a classe controller
     $path = Globals::getPrivate("app")->container->path;
     $this->path = $path = $path();
     // inicializa a classe controller
     $controller = Globals::getPrivate("app")->container->controller;
     $this->controller = $controller = $controller();
     // inicializa a classe controller
     $plugins = Globals::getPrivate("app")->container->plugins;
     $this->plugins = $plugins = $plugins();
     // registra as definições iniciais
     $settings->registerSettings($options);
     // ajusta as definições iniciais
     $settings->define();
     // define requisição/Resposta HTTP
     $http->setAdapterSettings($settings);
     $getResponse = $http->getResponse();
     Globals::set()->http = $getResponse;
     // define settings definido no load
     $getSettings = $settings->getSettings();
     Globals::set()->settings = $getSettings;
     // define os caminhos atuais
     $path->setPath($settings);
     $getPath = $path->getPath();
     Globals::set()->path = $getPath;
     //define e carrega o diretório dos arquivos observadores
     Events::setPaths(array(Globals::get('path/manager/path'), Globals::get('path/app/path')));
     Events::loadObserver();
     // define application base
     $getControllers = Globals::get('http/controllers');
     if ($getControllers->list[0] == '!') {
         Globals::set('app')->run = "!";
     } else {
         Globals::set('app')->run = "#" . Globals::get('path/app/name');
         //$getPath->name;
     }
     if (Globals::get('app/run') == '!') {
         $HTTP_SUITE_PAR = isset($_SERVER['HTTP_SUITE_PAR']) ? $_SERVER['HTTP_SUITE_PAR'] : null;
     } else {
         $resultCheckFirstAccess = $settings->checkFirstAccess();
         if ($resultCheckFirstAccess == true) {
             $resultEvents = Events::Attach('info[welcome]', array('value' => '', 'action' => ''));
             if (!$resultEvents) {
                 $html = '<h1>Suite</h1>';
                 $html .= '<h3>First Access</h3>';
                 $html .= '<p>';
                 $html .= '</p>';
                 echo $html;
                 exit;
             }
         }
         // verifica se a requisião atual é de origem do próprio Suite
         //$result = Functions::checkRequestBySuite();
         //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();
     }
 }
Exemple #4
0
 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 . '" ';
                 $link .= ' ' . (isset($targetAjust) ? 'target="' . $targetAjust . '"' : "");
             }
             if (strpos($target, "http://") !== false) {
                 $link = 'href="' . $target . '" ';
             }
             //
             if (isset($title)) {
                 $name = $title;
             }
             if ($menu_title != null) {
                 if ($menu_layoutreset === true) {
                     $html .= '<a ' . $link . '  data-rel="reset"  >' . $menu_title . '';
                 } else {
                     $html .= '<a ' . $link . ' data-rel="item"  >' . $menu_title . '';
                 }
             } else {
                 $html .= '<a ' . $link . '   data-rel="item" >' . ucfirst($name) . '';
             }
             // ajusta caso aja submenus
             if (isset($inner)) {
                 $html .= '<label data-rel="dropdown" >‣</label></a>';
                 $html .= Menu::makeMenu($inner, $replace, $manager, $nivel);
             } else {
                 $html .= '<label data-rel="dropdown" ></label></a>';
             }
             $html .= '';
             $html .= '</li>';
         }
     }
     $html .= '</ul>';
     return $html;
 }