Beispiel #1
0
 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new Menu();
     }
     return self::$instance;
 }
Beispiel #2
0
 public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 function render()
 {
     $menu = Menu::instance();
     $this->_view['all_menu'] = $menu->getAll();
     $this->_view['current'] = $menu->getCurrentMainMenu();
     return $this->_fetchView(dirname(__FILE__) . '/navmain_view.php');
 }
Beispiel #4
0
 public static function me()
 {
     if (is_null(self::$instance)) {
         self::$instance = new Menu();
     }
     return self::$instance;
 }
Beispiel #5
0
 public function render()
 {
     $menu = Menu::instance('submenu')->render();
     if (empty($menu)) {
         return '';
     }
     return View::factory('widgets/submenu')->set(array('menu' => $menu))->render();
 }
Beispiel #6
0
 function render($return = false)
 {
     $context = $this->context->parent();
     $menu = Menu::instance();
     $this->view['all_menu'] = $menu->getAll();
     $this->view['current'] = $menu->getCurrentMainMenu($context);
     return $this->_renderBlock('navmain', $return);
 }
Beispiel #7
0
 function render()
 {
     $menu = Menu::instance();
     $this->_view['menu'] = $menu;
     $this->_view['main'] = $menu->getCurrentMainMenu();
     $this->_view['current'] = $menu->getCurrentSubMenu($this->_view['main']['items']);
     return $this->_fetchView(dirname(__FILE__) . '/submenu_view.php');
 }
Beispiel #8
0
 function render($return = false)
 {
     $context = $this->context->parent();
     $menu = Menu::instance();
     $this->view['menu'] = $menu;
     $this->view['main'] = $menu->getCurrentMainMenu($context);
     $this->view['current'] = $menu->getCurrentSubMenu($context, $this->view['main']['items']);
     return $this->_renderBlock('submenu', $return);
 }
Beispiel #9
0
 public function run()
 {
     $menu = Menu::instance();
     $manager = Manager::instance();
     $settings = Settings::instance();
     $attachment_edit = AttachmentEdit::instance();
     $menu->set_manager($manager);
     $menu->set_settings($settings);
     $menu->init_pages();
     add_action('wpod', array($menu, 'add_components'));
     add_action('admin_enqueue_scripts', array($attachment_edit, 'enqueue_scripts'), 10, 1);
     add_action('attachment_submitbox_misc_actions', array($attachment_edit, 'attachment_submitbox_misc_actions'), 100, 0);
     add_filter('map_meta_cap', array($this, 'map_meta_cap'), 10, 4);
 }
Beispiel #10
0
 function test2()
 {
     return Menu::instance('test2');
 }
Beispiel #11
0
 public function render($only_children = FALSE)
 {
     $this->rendered = TRUE;
     if ($only_children === TRUE) {
         $output = '';
         foreach ($this->children as $child) {
             $output .= Menu::instance()->get($child);
         }
         return $output;
     }
     $class = $this->active === TRUE ? 'active' : '';
     if (empty($this->children)) {
         return '<li class="' . $class . '">' . html::anchor($this->uri, html::specialchars($this->title), array('class' => $class)) . '</li>';
     }
     $output = '<li class="' . $class . '">' . html::anchor($this->uri, html::specialchars($this->title), array('class' => $class));
     $output .= '<ul>';
     foreach ($this->children as $child) {
         $output .= Menu::instance()->get($child)->render();
     }
     $output .= '</ul></li>';
     return $output;
 }
Beispiel #12
0
	</head>
	<body>
		<?php 
Event::run('s7n.theme.page_top');
?>
		<div id="header">
			<div class="widthfix">
				<div class="logo">
					<h1><?php 
echo html::anchor('/', config::get('s7n.site_title'));
?>
</h1>
				</div>
				<div class="clear"></div>
				<?php 
echo Menu::instance();
?>
			</div>
		</div>
		<div id="content">
			<div id="article">
				<div class="entry">
					<?php 
echo $content;
?>
				</div>
			</div>
			<div id="sidebar">
				<?php 
echo Widget::factory('Submenu');
?>
Beispiel #13
0
<?php

$leftMenu = Menu::instance('admin-menu');
$rightMenu = Menu::instance('admin-menu-right');
/**
 * @see https://github.com/pingpong-labs/menus
 * 
 * @example adding additional menu.
 *
 * $leftMenu->url('your-url', 'The Title');
 * 
 * $leftMenu->route('your-route', 'The Title');
 */
Beispiel #14
0
<?php

$leftMenu = Menu::instance('admin-menu');
$rightMenu = Menu::instance('admin-menu-right');
$shopMenu = Menu::instance('shop-menu');
/**
 * @see https://github.com/pingpong-labs/menus
 * 
 * @example adding additional menu.
 *
 * $leftMenu->url('your-url', 'The Title');
 * 
 * $leftMenu->route('your-route', 'The Title');
 */
Beispiel #15
0
<?php

$menu = Menu::instance('sidebar');
$menu->dropdown('Settings', function ($sub) {
    $sub->url('administrator/settings', 'General', 1, ['icon' => 'fa fa-circle-o']);
}, 6, ['icon' => 'fa fa-wrench']);
Beispiel #16
0
			</div>
		</header>
		<div class="container">
			<div class="row">
				<?php 
$gridCols = 12;
?>
				<?php 
if (Auth::instance()->logged_in('admin')) {
    ?>
					<?php 
    $gridCols = 10;
    ?>
					<div id="sidebar-left" class="col-lg-2 col-sm-1 ">
						<?php 
    echo Menu::instance('menu', 'menu');
    ?>
					</div>
				<?php 
}
?>
				<div id="id_content" <?php 
if (!Auth::instance()->logged_in('admin')) {
    ?>
style="width:100%"<?php 
}
?>
 class="col-lg-<?php 
echo $gridCols;
?>
 col-sm-11 ">