From: <gem...@li...> - 2012-07-05 14:01:44
|
Revision: 817 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=817&view=rev Author: matijsdejong Date: 2012-07-05 14:01:32 +0000 (Thu, 05 Jul 2012) Log Message: ----------- RoleAction dit not allow empty inheritance GemsEscort->_layoutCrumbs() now uses html objects Modified Paths: -------------- trunk/library/classes/Gems/Default/RoleAction.php trunk/library/classes/GemsEscort.php Modified: trunk/library/classes/Gems/Default/RoleAction.php =================================================================== --- trunk/library/classes/Gems/Default/RoleAction.php 2012-07-05 12:33:00 UTC (rev 816) +++ trunk/library/classes/Gems/Default/RoleAction.php 2012-07-05 14:01:32 UTC (rev 817) @@ -84,7 +84,7 @@ $allPrivileges = $this->getUsedPrivileges(); $rolePrivileges = $this->escort->acl->getRolePrivileges(); - $inheritedPrivileges = $rolePrivileges[$data['grl_name']][MUtil_Acl::INHERITED][Zend_Acl::TYPE_ALLOW]; + $inheritedPrivileges = (array) $rolePrivileges[$data['grl_name']][MUtil_Acl::INHERITED][Zend_Acl::TYPE_ALLOW]; $privileges = array_diff_key($allPrivileges, array_flip($inheritedPrivileges)); $inheritedPrivileges = array_intersect_key($allPrivileges, array_flip($inheritedPrivileges)); Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2012-07-05 12:33:00 UTC (rev 816) +++ trunk/library/classes/GemsEscort.php 2012-07-05 14:01:32 UTC (rev 817) @@ -588,11 +588,23 @@ // Must be called after _layoutNavigation() if ($this->menu && $this->menu->isVisible()) { - $div = MUtil_Html::create()->div($args + array('id' => 'crumbs')); - //$div->raw($this->view->navigation()->breadcrumbs()); - $div->raw($this->view->navigation()->breadcrumbs()->setLinkLast(false)->setMinDepth(0)->render()); + $path = $this->menu->getActivePath($this->request); + $last = array_pop($path); - return $div; + // Only display when there is a path of more than one step + if ($path) { + $div = MUtil_Html::create()->div($args + array('id' => 'crumbs')); + $content = $div->seq(); + $content->setGlue(MUtil_Html::raw($this->_(' > '))); + + foreach ($path as $menuItem) { + $content->a($menuItem->toHRefAttribute($this->request), $menuItem->get('label')); + } + + $content->append($last->get('label')); + + return $div; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |