Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function accept()
 {
     if (!isset($this->options['access']) or !$this->options['access']) {
         return true;
     }
     return $this['user']->hasAccess(parent::current()->getAccess());
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function accept()
 {
     $item = parent::current();
     if ($active = $item->getAttribute('active') and is_string($active)) {
         $active = (bool) preg_match('#^' . str_replace('*', '.*', $active) . '$#', $this->route);
         $item->setAttribute('active', $active);
         if ($active) {
             while ($item->getParentId() && ($item = $item->getMenu()->getItem($item->getParentId()))) {
                 $item->setAttribute('active', $active);
             }
         }
     }
     return true;
 }
Exemplo n.º 3
0
 /**
  * Constructor.
  *
  * @param FilterManager $filters
  */
 public function __construct(FilterManager $filters = null)
 {
     $this->filters = $filters ?: new FilterManager();
     FilterIterator::setApplication($this->getApplication());
 }
Exemplo n.º 4
0
 /**
  * Constructor.
  *
  * @param \Iterator $iterator
  * @param array     $options
  */
 public function __construct(\Iterator $iterator, array $options = [])
 {
     parent::__construct($iterator);
     $this->options = $options;
 }