protected function checkfreshinstall() { $root = sfBreadNavPeer::getRoot($this->scope); if (!$root) { $this->freshinstall = true; } $c = new Criteria(); //if config set to ownermenu only show users menus if (sfConfig::get('app_sfBreadNav_UserMenus', false)) { $c->add(sfBreadNavApplicationPeer::USER_ID, sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'sfGuardSecurityUser')); } $menu = sfBreadNavApplicationPeer::doCount($c); if ($menu == 0) { $this->nomenu = true; } }
class myMenuOutput extends RecursiveIteratorIterator { function __construct($m) { parent::__construct($m, self::SELF_FIRST); } function beginChildren() { echo str_repeat("\t", $this->getDepth()); } function endChildren() { echo str_repeat("\t", $this->getDepth() - 1); } } $root = sfBreadNavPeer::getRoot($scope); $menu = sfBreadNavPeer::retrieveTree($scope); $menu = new myMenuOutput($menu); function bool2string($bool) { if (!is_null($bool)) { return 'On'; } return ' '; } ?> <br/> <table style='border-spacing: 0px 0px; border-style: none; border-collapse: collapse;' id="breadnavtreetable"> <tr class='odd'><strong><td>PAGE NAME</td><td>MODULE</td><td>ACTION</td><td>CREDENTIAL</td><td>CATCH ALL</td></strong></tr> <tr class='even'>