Author: Tijs Verkoyen (tijs@sumocoders.be)
Author: Dave Lens (dave.lens@wijs.be)
Inheritance: extends KernelLoader
Esempio n. 1
0
 /**
  * @param KernelInterface $kernel
  * @param string          $module The module to use.
  * @param string          $action The action to use.
  * @param string          $data   The data that should be available.
  */
 public function __construct(KernelInterface $kernel, $module, $action, $data = null)
 {
     parent::__construct($kernel);
     // get objects from the reference so they are accessible
     $this->header = $this->getContainer()->get('header');
     $this->URL = $this->getContainer()->get('url');
     // set properties
     $this->setModule($module);
     $this->setAction($action);
     $this->setData($data);
 }
Esempio n. 2
0
 /**
  * @param KernelInterface $kernel
  * @param string          $module The module to load.
  * @param string          $action The action to load.
  * @param mixed           $data   The data that was passed from the database.
  */
 public function __construct(KernelInterface $kernel, $module, $action, $data = null)
 {
     parent::__construct($kernel);
     // set properties
     $this->setModule($module);
     $this->setAction($action);
     if ($data !== null) {
         $this->setData($data);
     }
     // load the config file for the required module
     $this->loadConfig();
 }
Esempio n. 3
0
 /**
  * @param KernelInterface $kernel
  * @param string          $module The module to load.
  * @param string          $action The action to load.
  * @param mixed           $data   The data that was passed from the database.
  */
 public function __construct(KernelInterface $kernel, $module, $action, $data = null)
 {
     parent::__construct($kernel);
     // set properties
     $this->setModule($module);
     $this->setAction($action);
     if ($data !== null) {
         $this->setData($data);
     }
     // load the config file for the required module
     $this->loadConfig();
     // is the requested action possible? If not we throw an exception.
     // We don't redirect because that could trigger a redirect loop
     if (!in_array($this->getAction(), $this->config->getPossibleActions())) {
         $this->setAction($this->config->getDefaultAction());
     }
 }
Esempio n. 4
0
 /**
  * @param KernelInterface $kernel
  */
 public function __construct(KernelInterface $kernel)
 {
     parent::__construct($kernel);
     // store in reference
     $this->getContainer()->set('breadcrumb', $this);
     // get more information for the homepage
     $homeInfo = Navigation::getPageInfo(1);
     // add homepage as first item (with correct element)
     $this->addElement($homeInfo['navigation_title'], Navigation::getURL(1));
     // get other pages
     $pages = $this->URL->getPages();
     // init vars
     $items = array();
     $errorURL = Navigation::getUrl(404);
     // loop pages
     while (!empty($pages)) {
         // init vars
         $URL = implode('/', $pages);
         $menuId = Navigation::getPageId($URL);
         $pageInfo = Navigation::getPageInfo($menuId);
         // do we know something about the page
         if ($pageInfo !== false && isset($pageInfo['navigation_title'])) {
             // only add pages that aren't direct actions
             if ($pageInfo['tree_type'] != 'direct_action') {
                 // get URL
                 $pageURL = Navigation::getUrl($menuId);
                 // if this is the error-page, so we won't show an URL.
                 if ($pageURL == $errorURL) {
                     $pageURL = null;
                 }
                 // add to the items
                 $items[] = array('title' => $pageInfo['navigation_title'], 'url' => $pageURL);
             }
         }
         // remove element
         array_pop($pages);
     }
     // reverse so everything is in place
     krsort($items);
     // loop and add elements
     foreach ($items as $row) {
         $this->addElement($row['title'], $row['url']);
     }
 }
Esempio n. 5
0
 /**
  * @param KernelInterface $kernel
  */
 public function __construct(KernelInterface $kernel)
 {
     parent::__construct($kernel);
     $this->getContainer()->set('footer', $this);
 }
Esempio n. 6
0
 /**
  * @param KernelInterface $kernel
  */
 public function __construct(KernelInterface $kernel)
 {
     parent::__construct($kernel);
     // set selected ids
     $this->setSelectedPageIds();
 }
Esempio n. 7
0
 /**
  * @param KernelInterface $kernel
  */
 public function __construct(KernelInterface $kernel)
 {
     parent::__construct($kernel);
     $this->getContainer()->set('header', $this);
     // add some default CSS files
     $this->addCSS('/src/Frontend/Core/Layout/Css/screen.css');
     // debug stylesheet
     if ($this->getContainer()->getParameter('kernel.debug')) {
         $this->addCSS('/src/Frontend/Core/Layout/Css/debug.css');
     }
     // add default javascript-files
     $this->addJS('/src/Frontend/Core/Js/jquery/jquery.js', false, null, self::PRIORITY_GROUP_GLOBAL);
     $this->addJS('/src/Frontend/Core/Js/jquery/jquery.frontend.js', true, null, self::PRIORITY_GROUP_GLOBAL);
     $this->addJS('/src/Frontend/Core/Js/utils.js', true, null, self::PRIORITY_GROUP_GLOBAL);
     $this->addJS('/src/Frontend/Core/Js/frontend.js', false, null, self::PRIORITY_GROUP_GLOBAL);
 }