Example #1
0
 /**
  * Return a session to be used by this wizard
  *
  * @return  SessionNamespace
  */
 public function getSession()
 {
     if ($this->parent) {
         return $this->parent->getSession();
     }
     return Session::getSession()->getNamespace(get_class($this));
 }
Example #2
0
 /**
  * @see Wizard::addButtons()
  */
 protected function addButtons(Form $page)
 {
     parent::addButtons($page);
     $pages = $this->getPages();
     $index = array_search($page, $pages, true);
     if ($index === 0) {
         // Used t() here as "Start" is too generic and already translated in the icinga domain
         $page->getElement(static::BTN_NEXT)->setLabel(t('Start', 'setup.welcome.btn.next'));
     } elseif ($index === count($pages) - 1) {
         $page->getElement(static::BTN_NEXT)->setLabel(mt('monitoring', 'Setup the monitoring module for Icinga Web 2', 'setup.summary.btn.finish'));
     }
 }
Example #3
0
 /**
  * Add buttons to the given page based on its position in the page-chain
  *
  * @param   Form    $page   The page to add the buttons to
  */
 protected function addButtons(Form $page)
 {
     parent::addButtons($page);
     $pages = $this->getPages();
     $index = array_search($page, $pages, true);
     if ($index === 0) {
         // Used t() here as "Start" is too generic and already translated in the icinga domain
         $page->getElement(static::BTN_NEXT)->setLabel(t('Start', 'setup.welcome.btn.next'));
     } elseif ($index === count($pages) - 1) {
         $page->getElement(static::BTN_NEXT)->setLabel(mt('monitoring', 'Setup the monitoring module for Icinga Web 2', 'setup.summary.btn.finish'));
     }
     if ($page->getName() === 'setup_monitoring_ido') {
         $page->addElement('submit', 'backend_validation', array('ignore' => true, 'label' => t('Validate Configuration'), 'data-progress-label' => t('Validation In Progress'), 'decorators' => array('ViewHelper')));
         $page->getDisplayGroup('buttons')->addElement($page->getElement('backend_validation'));
     }
 }
Example #4
0
 /**
  * Clear the session being used by this wizard and drop the setup token
  */
 public function clearSession()
 {
     parent::clearSession();
     $tokenPath = Config::resolvePath('setup.token');
     if (file_exists($tokenPath)) {
         @unlink($tokenPath);
     }
 }