Revisions
-
diogoca revised this gist
Jul 20, 2013 . 1 changed file with 17 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,23 +3,24 @@ * @authors Kanstantsin A Kamkou (2ka.by); Jeroen Herczeg */ $html = array(); $html[] =' <ul class="nav">'; foreach ($this->container as $page) { // visibility of the page if (!$page->isVisible() || !$this->navigation()->accept($page)) { continue; } // Gerando Href relativo $href = str_replace($this->baseUrl(), '', $page->getHref()); // dropdown $dropdown = !empty($page->pages); // header $html[] = '<li' . ($dropdown ? ' class="dropdown"' : '') . '>'; $html[] = '<a href="' . ($dropdown ? '#' : $href) . '" ' . 'class="dropdown-toggle" data-toggle="dropdown">'; $html[] = $page->getLabel(); @@ -37,16 +38,16 @@ foreach ($this->container as $page) { $html[] = '<ul class="dropdown-menu">'; foreach ($page->pages as $subpage) { // visibility of the sub-page if (!$subpage->isVisible() || !$this->navigation()->accept($subpage)) { continue; } // Gerando Href relativo $href = str_replace($this->baseUrl(), '', $subpage->getHref()); $html[] = '<li' . ($subpage->isActive() ? ' class="active"' : '') . '>'; $html[] = '<a href="' . $href . '">'; if ($subpage->get('icon')) { $html[] = '<i class="icon-' . $subpage->get('icon') . '"></i>'; @@ -55,15 +56,16 @@ foreach ($this->container as $page) { $html[] = $subpage->getLabel(); $html[] = "</a>"; $html[] = "</li>"; if ($subpage->get('divider')) { $html[] = '<li class="divider"></li> '; } } $html[] = "</ul>"; $html[] = "</li>"; } $html[] = '</ul>'; echo join(PHP_EOL, $html); -
diogoca revised this gist
Jul 20, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,7 +38,7 @@ foreach ($this->container as $page) { foreach ($page->pages as $subpage) { // ACL visibility of the sub-page if ($page->isVisible() || !$this->navigation()->accept($subpage)) { continue; } if ($subpage->getLabel() == 'divider') { -
diogoca revised this gist
Jul 20, 2013 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,8 +9,8 @@ $html[] =' <div class="container">'; $html[] =' <ul class="nav">'; foreach ($this->container as $page) { // ACL - visibility of the page if (!$page->isVisible() || !$this->navigation()->accept($page)) { continue; } @@ -37,8 +37,8 @@ foreach ($this->container as $page) { $html[] = '<ul class="dropdown-menu">'; foreach ($page->pages as $subpage) { // ACL visibility of the sub-page if (!$page->isVisible() || !$this->navigation()->accept($page)) { continue; } if ($subpage->getLabel() == 'divider') { -
jeroenherczeg revised this gist
Jun 19, 2012 . 1 changed file with 20 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initNavigation() { // make sure the layout is loaded $this->bootstrap('layout'); // get the view of the layout $layout = $this->getResource('layout'); $view = $layout->getView(); //load the navigation xml $config = new Zend_Config_Xml(APPLICATION_PATH.'/configs/navigation.xml','nav'); // pass the navigation xml to the zend_navigation component $nav = new Zend_Navigation($config); // pass the zend_navigation component to the view of the layout $view->navigation($nav); } } -
jeroenherczeg revised this gist
Jun 19, 2012 . 1 changed file with 35 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ <?xml version="1.0" encoding="UTF-8"?> <configdata> <nav> <dashboard> <label>Dashboard</label> <uri>/</uri> </dashboard> <myprofile> <label>My Profile</label> <uri></uri> <pages> <editprofile> <label>Edit my profile</label> <uri>/user/profile</uri> </editprofile> <changepassword> <label>Change my password</label> <uri>/user/password</uri> </changepassword> <divider> <label>divider</label> <uri></uri> </divider> <logout> <label>Log out</label> <uri>/index/logout</uri> </logout> </pages> </myprofile> <admin> <label>Administration</label> <uri>/admin</uri> </admin> </nav> </configdata> -
jeroenherczeg revised this gist
Jun 19, 2012 . 3 changed files with 23 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,12 @@ <?php /** * @authors Kanstantsin A Kamkou (2ka.by); Jeroen Herczeg */ $html = array(); $html[] ='<div class="navbar navbar-fixed-top">'; $html[] =' <div class="navbar-inner">'; $html[] =' <div class="container">'; $html[] =' <ul class="nav">'; foreach ($this->container as $page) { // visibility of the page @@ -37,7 +41,10 @@ foreach ($this->container as $page) { if (!$subpage->isVisible()) { continue; } if ($subpage->getLabel() == 'divider') { $html[] = '<li class="divider"></li>'; continue; } $html[] = '<li' . ($subpage->isActive() ? ' class="active"' : '') . '>'; $html[] = '<a href="' . $subpage->getHref() . '">'; @@ -55,5 +62,8 @@ foreach ($this->container as $page) { } $html[] = '</ul>'; $html[] = '</div>'; $html[] = '</div>'; $html[] = '</div>'; echo join(PHP_EOL, $html); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ $this->navigation()->menu()->setPartial('partials/horizontal.phtml'); echo $this->navigation()->menu()->render(); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ <?php /** * @authors Kanstantsin A Kamkou (2ka.by); Jeroen Herczeg */ $html = array('<ul class="nav nav-list">'); @@ -23,7 +23,10 @@ foreach ($this->container as $page) { if (!$subpage->isVisible()) { continue; } if ($subpage->getLabel() == 'divider') { $html[] = '<li class="divider"></li>'; continue; } $html[] = '<li' . ($subpage->isActive() ? ' class="active"' : '') . '>'; $html[] = '<a href="' . $subpage->getHref() . '">'; @@ -39,5 +42,8 @@ foreach ($this->container as $page) { } $html[] = '</ul>'; $html[] = '</div>'; $html[] = '</div>'; $html[] = '</div>'; echo join(PHP_EOL, $html); -
kkamkou revised this gist
Feb 24, 2012 . 2 changed files with 18 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,11 @@ $html = array('<ul class="nav">'); foreach ($this->container as $page) { // visibility of the page if (!$page->isVisible()) { continue; } // dropdown $dropdown = !empty($page->pages); @@ -28,6 +33,11 @@ foreach ($this->container as $page) { $html[] = '<ul class="dropdown-menu">'; foreach ($page->pages as $subpage) { // visibility of the sub-page if (!$subpage->isVisible()) { continue; } $html[] = '<li' . ($subpage->isActive() ? ' class="active"' : '') . '>'; $html[] = '<a href="' . $subpage->getHref() . '">'; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,8 +6,9 @@ $html = array('<ul class="nav nav-list">'); foreach ($this->container as $page) { // show only the current branch and the visible item if (!$page->isVisible() || ($this->menu()->getOnlyActiveBranch() && !$page->isActive(true))) { continue; } @@ -18,6 +19,11 @@ foreach ($this->container as $page) { if (!empty($page->pages)) { foreach ($page->pages as $subpage) { // visibility of the sub-page if (!$subpage->isVisible()) { continue; } $html[] = '<li' . ($subpage->isActive() ? ' class="active"' : '') . '>'; $html[] = '<a href="' . $subpage->getHref() . '">'; -
kkamkou revised this gist
Feb 23, 2012 . 2 changed files with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes.File renamed without changes. -
kkamkou revised this gist
Feb 23, 2012 . 2 changed files with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ <?php /** * @author Kanstantsin A Kamkou (2ka.by) */ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ <?php /** * @author Kanstantsin A Kamkou (2ka.by) */ $html = array('<ul class="nav nav-list">'); foreach ($this->container as $page) { @@ -34,4 +34,4 @@ foreach ($this->container as $page) { $html[] = '</ul>'; echo join(PHP_EOL, $html); -
kkamkou created this gist
Feb 23, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ /** * @author Kanstantsin A Kamkou (2ka.by) */ $html = array('<ul class="nav">'); foreach ($this->container as $page) { // dropdown $dropdown = !empty($page->pages); // header $html[] = '<li' . ($dropdown ? ' class="dropdown"' : '') . '>'; $html[] = '<a href="' . ($dropdown ? '#' : $page->getHref()) . '" ' . 'class="dropdown-toggle" data-toggle="dropdown">'; $html[] = $page->getLabel(); if ($dropdown) { $html[] = '<b class="caret"></b>'; } $html[] = '</a>'; if (!$dropdown) { $html[] = '</li>'; continue; } $html[] = '<ul class="dropdown-menu">'; foreach ($page->pages as $subpage) { $html[] = '<li' . ($subpage->isActive() ? ' class="active"' : '') . '>'; $html[] = '<a href="' . $subpage->getHref() . '">'; if ($subpage->get('icon')) { $html[] = '<i class="icon-' . $subpage->get('icon') . '"></i>'; } $html[] = $subpage->getLabel(); $html[] = "</a>"; $html[] = "</li>"; } $html[] = "</ul>"; $html[] = "</li>"; } $html[] = '</ul>'; echo join(PHP_EOL, $html); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ /** * @author Kanstantsin A Kamkou (2ka.by) */ $html = array('<ul class="nav nav-list">'); foreach ($this->container as $page) { // show only the current branch if ($this->menu()->getOnlyActiveBranch() && !$page->isActive(true)) { continue; } // header $html[] = '<li class="nav-header">'; $html[] = $page->getLabel(); $html[] = "</li>"; if (!empty($page->pages)) { foreach ($page->pages as $subpage) { $html[] = '<li' . ($subpage->isActive() ? ' class="active"' : '') . '>'; $html[] = '<a href="' . $subpage->getHref() . '">'; if ($subpage->get('icon')) { $html[] = '<i class="icon-' . $subpage->get('icon') . '"></i>'; } $html[] = $subpage->getLabel(); $html[] = "</a>"; $html[] = "</li>"; } } } $html[] = '</ul>'; echo join(PHP_EOL, $html);