Esempio n. 1
0
 /**
  * VLoží položku menu, pouze pokud má práva na danou sekci
  * @param \Esports\Navigation\NavigationNode $node
  * @param $label
  * @param $url
  */
 private function add(\Esports\Navigation\NavigationNode $node, $label, $url)
 {
     $action = 'default';
     if ($this->isUrlWithAction($url)) {
         $array = array_filter(explode(':', $url), 'strlen');
         $action = end($array);
         $checkAbleUrl = join(':', array_slice($array, 0, count($array) - 1));
     } else {
         $checkAbleUrl = join(':', array_filter(explode(':', $url), 'strlen'));
     }
     if ($this->rightChecker->isAllowed($checkAbleUrl, $action)) {
         $node->add($label, $url);
     }
 }
 public function add($label, $url, $params = [])
 {
     $node = parent::add($label, $url);
     $node->params = $params;
     return $node;
 }