setAction() public method

Sets the action of the NavigationItem.
public setAction ( string $action )
$action string The action of the NavigationItem
Example #1
0
 public function __construct(WebspaceManagerInterface $webspaceManager, SecurityCheckerInterface $securityChecker, SessionManagerInterface $sessionManager, $title)
 {
     $this->webspaceManager = $webspaceManager;
     $this->securityChecker = $securityChecker;
     $this->sessionManager = $sessionManager;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('navigation.webspaces');
     $rootNavigationItem->addChild($section);
     /** @var Webspace $webspace */
     foreach ($this->webspaceManager->getWebspaceCollection() as $webspace) {
         if ($this->securityChecker->hasPermission(self::SECURITY_CONTEXT_PREFIX . $webspace->getKey(), 'view')) {
             $webspaceItem = new NavigationItem($webspace->getName());
             $webspaceItem->setIcon('bullseye');
             $indexUuid = $this->sessionManager->getContentNode($webspace->getKey())->getIdentifier();
             $indexPageItem = new NavigationItem('navigation.webspaces.index-page');
             $indexPageItem->setAction('content/contents/' . $webspace->getKey() . '/edit:' . $indexUuid . '/details');
             $webspaceItem->addChild($indexPageItem);
             $contentItem = new NavigationItem('navigation.webspaces.content');
             $contentItem->setAction('content/contents/' . $webspace->getKey());
             $webspaceItem->addChild($contentItem);
             $section->addChild($webspaceItem);
         }
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #2
0
 public function __construct(WebspaceManagerInterface $webspaceManager, SecurityCheckerInterface $securityChecker, SessionManagerInterface $sessionManager, $title)
 {
     $this->webspaceManager = $webspaceManager;
     $this->securityChecker = $securityChecker;
     $this->sessionManager = $sessionManager;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('navigation.webspaces');
     $section->setPosition(10);
     $rootNavigationItem->addChild($section);
     $position = 10;
     /** @var Webspace $webspace */
     foreach ($this->webspaceManager->getWebspaceCollection() as $webspace) {
         if ($this->securityChecker->hasPermission(self::SECURITY_CONTEXT_PREFIX . $webspace->getKey(), PermissionTypes::VIEW)) {
             $webspaceItem = new NavigationItem($webspace->getName());
             $webspaceItem->setPosition($position++);
             $webspaceItem->setIcon('bullseye');
             $indexUuid = $this->sessionManager->getContentNode($webspace->getKey())->getIdentifier();
             $indexPageItem = new NavigationItem('navigation.webspaces.index-page');
             $indexPageItem->setPosition(10);
             $indexPageItem->setAction('content/contents/' . $webspace->getKey() . '/edit:' . $indexUuid . '/content');
             $webspaceItem->addChild($indexPageItem);
             $contentItem = new NavigationItem('navigation.webspaces.content');
             $contentItem->setPosition(20);
             $contentItem->setAction('content/contents/' . $webspace->getKey());
             $webspaceItem->addChild($contentItem);
             $webspaceSettingsItem = new NavigationItem('navigation.webspaces.settings');
             $webspaceSettingsItem->setPosition(30);
             $webspaceSettingsItem->setAction(sprintf('content/webspace/settings:%s/general', $webspace->getKey()));
             $webspaceItem->addChild($webspaceSettingsItem);
             $section->addChild($webspaceItem);
         }
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #3
0
 public function __construct(SecurityCheckerInterface $securityChecker, $title)
 {
     $this->securityChecker = $securityChecker;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('navigation.modules');
     $section->setPosition(20);
     $contacts = new NavigationItem('navigation.contacts');
     $contacts->setPosition(30);
     $contacts->setIcon('user');
     if ($this->securityChecker->hasPermission('sulu.contact.people', PermissionTypes::VIEW)) {
         $people = new NavigationItem('navigation.contacts.people');
         $people->setPosition(10);
         $people->setIcon('users');
         $people->setAction('contacts/contacts');
         $contacts->addChild($people);
     }
     if ($this->securityChecker->hasPermission('sulu.contact.organizations', PermissionTypes::VIEW)) {
         $companies = new NavigationItem('navigation.contacts.companies');
         $companies->setPosition(20);
         $companies->setIcon('building');
         $companies->setAction('contacts/accounts');
         $contacts->addChild($companies);
     }
     if ($contacts->hasChildren()) {
         $rootNavigationItem->addChild($section);
         $section->addChild($contacts);
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #4
0
 public function __construct($title)
 {
     $rootNavigationItem = new NavigationItem($title);
     $global = new NavigationItem('navigation.modules', $rootNavigationItem);
     $news = new NavigationItem('navigation.news', $global);
     $news->setAction('example/news');
     $news->setIcon('pencil-square-o');
     $news->setPosition(25);
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
 public function __construct($title)
 {
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('navigation.webspaces');
     $global = new NavigationItem('navigation.global-content');
     $section->addChild($global);
     $news = new NavigationItem('navigation.news');
     $news->setAction('news');
     $global->addChild($news);
     $rootNavigationItem->addChild($section);
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #6
0
 public function __construct($title)
 {
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('');
     $settings = new NavigationItem('navigation.settings');
     $settings->setIcon('gear');
     $roles = new NavigationItem('navigation.settings.cache', $settings);
     $roles->setAction('settings/cache');
     $roles->setIcon('hdd-o');
     $section->addChild($settings);
     $rootNavigationItem->addChild($section);
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
 public function __construct($title)
 {
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('');
     $sales = new NavigationItem('navigation.sales');
     $sales->setIcon('shopping-cart');
     $section->addChild($sales);
     $shipping = new NavigationItem('navigation.sales.shipping');
     $shipping->setAction('sales/shippings');
     $shipping->setPosition(20);
     $sales->addChild($shipping);
     $rootNavigationItem->addChild($section);
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #8
0
 public function __construct($title)
 {
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('');
     $settings = new NavigationItem('navigation.settings');
     $settings->setIcon('cogwheels');
     $translate = new NavigationItem('navigation.settings.translate');
     $translate->setAction('settings/translate');
     $translate->setIcon('book-open');
     $settings->addChild($translate);
     $section->addChild($settings);
     $rootNavigationItem->addChild($section);
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #9
0
 /**
  * @param SecurityCheckerInterface $securityChecker
  * @param string                   $title
  */
 public function __construct(SecurityCheckerInterface $securityChecker, $title)
 {
     $this->securityChecker = $securityChecker;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('');
     if ($this->securityChecker->hasPermission('sulu.event.events', 'view')) {
         $shop = new NavigationItem('sulu.navigation.events');
         $shop->setIcon('calendar');
         $shop->setAction('events');
         $section->addChild($shop);
         $rootNavigationItem->addChild($section);
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #10
0
 public function __construct(SecurityCheckerInterface $securityChecker, $title)
 {
     $this->securityChecker = $securityChecker;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('navigation.modules');
     $section->setPosition(20);
     if ($this->securityChecker->hasPermission('sulu.media.collections', PermissionTypes::VIEW)) {
         $media = new NavigationItem('navigation.media');
         $media->setPosition(20);
         $media->setIcon('image');
         $media->setAction('media/collections');
         $section->addChild($media);
         $rootNavigationItem->addChild($section);
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #11
0
 public function __construct(SecurityCheckerInterface $securityChecker, $title)
 {
     $this->securityChecker = $securityChecker;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('');
     $settings = new NavigationItem('navigation.settings');
     $settings->setIcon('cog');
     if ($this->securityChecker->hasPermission('sulu.settings.categories', 'view')) {
         $categories = new NavigationItem('navigation.settings.categories', $settings);
         $categories->setAction('settings/categories');
     }
     if ($settings->hasChildren()) {
         $section->addChild($settings);
         $rootNavigationItem->addChild($section);
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #12
0
 public function __construct(SecurityCheckerInterface $securityChecker, WebspaceManagerInterface $webspaceManager, $defaultEnabled, $title)
 {
     $this->securityChecker = $securityChecker;
     $this->webspaceManager = $webspaceManager;
     $this->defaultEnabled = $defaultEnabled;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('navigation.modules');
     $section->setPosition(20);
     if ($this->securityChecker->hasPermission('sulu.global.snippets', 'view')) {
         $snippet = new NavigationItem('navigation.snippets');
         $snippet->setPosition(10);
         $snippet->setIcon('sticky-note-o');
         $snippet->setAction('snippet/snippets');
         $section->addChild($snippet);
         $rootNavigationItem->addChild($section);
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #13
0
 public function __construct(SecurityCheckerInterface $securityChecker, $title)
 {
     $this->securityChecker = $securityChecker;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('');
     $sales = new NavigationItem('navigation.sales');
     $sales->setPosition(20);
     $sales->setIcon('shopping-cart');
     if ($this->securityChecker->hasPermission('sulu.sales_order.orders', 'view')) {
         $order = new NavigationItem('navigation.sales.order', $sales);
         $order->setAction('sales/orders');
         $order->setPosition(10);
     }
     if ($sales->hasChildren()) {
         $section->addChild($sales);
         $rootNavigationItem->addChild($section);
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #14
0
 public function __construct(SecurityCheckerInterface $securityChecker, $title)
 {
     $this->securityChecker = $securityChecker;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('navigation.webspaces');
     $global = new NavigationItem('navigation.global-content');
     $global->setIcon('globe');
     $section->addChild($global);
     if ($this->securityChecker->hasPermission('sulu.global.snippets', 'view')) {
         $snippet = new NavigationItem('navigation.snippets');
         $snippet->setIcon('bullseye');
         $snippet->setAction('snippet/snippets');
         $global->addChild($snippet);
     }
     if ($global->hasChildren()) {
         $rootNavigationItem->addChild($section);
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #15
0
 public function __construct(WebspaceManagerInterface $webspaceManager, SecurityCheckerInterface $securityChecker, $title)
 {
     $this->webspaceManager = $webspaceManager;
     $this->securityChecker = $securityChecker;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('navigation.modules');
     $section->setPosition(20);
     if ($this->checkLivePermissionForAllWebspaces()) {
         $settings = new NavigationItem('navigation.settings');
         $settings->setPosition(40);
         $settings->setIcon('gear');
         $cache = new NavigationItem('navigation.settings.cache', $settings);
         $cache->setPosition(50);
         $cache->setAction('settings/cache');
         $cache->setIcon('hdd-o');
         $section->addChild($settings);
         $rootNavigationItem->addChild($section);
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #16
0
 public function __construct(SecurityCheckerInterface $securityChecker, $title)
 {
     $this->securityChecker = $securityChecker;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('navigation.modules');
     $section->setPosition(20);
     $settings = new NavigationItem('navigation.settings');
     $settings->setPosition(40);
     $settings->setIcon('gear');
     if ($this->securityChecker->hasPermission('sulu.security.roles', PermissionTypes::VIEW)) {
         $roles = new NavigationItem('security.roles.title', $settings);
         $roles->setPosition(10);
         $roles->setAction('settings/roles');
         $roles->setIcon('gear');
     }
     if ($settings->hasChildren()) {
         $section->addChild($settings);
         $rootNavigationItem->addChild($section);
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #17
0
 public function __construct(WebspaceManagerInterface $webspaceManager, SecurityCheckerInterface $securityChecker, $title)
 {
     $this->webspaceManager = $webspaceManager;
     $this->securityChecker = $securityChecker;
     $rootNavigationItem = new NavigationItem($title);
     $section = new NavigationItem('navigation.webspaces');
     $rootNavigationItem->addChild($section);
     /** @var Webspace $webspace */
     foreach ($this->webspaceManager->getWebspaceCollection() as $webspace) {
         if ($this->securityChecker->hasPermission($this->securityContextPrefix . $webspace->getKey(), 'view')) {
             $webspaceItem = new NavigationItem($webspace->getName());
             $webspaceItem->setIcon('bullseye');
             $indexPageItem = new NavigationItem('navigation.webspaces.index-page');
             $indexPageItem->setAction('content/contents/' . $webspace->getKey() . '/edit:index/details');
             $webspaceItem->addChild($indexPageItem);
             $contentItem = new NavigationItem('navigation.webspaces.content');
             $contentItem->setAction('content/contents/' . $webspace->getKey());
             $webspaceItem->addChild($contentItem);
             $section->addChild($webspaceItem);
         }
     }
     $this->setNavigation(new Navigation($rootNavigationItem));
 }
Example #18
0
 public function testAction()
 {
     $this->navigationItem->setAction('/test/action');
     $this->assertEquals('/test/action', $this->navigationItem->getAction());
 }