Exemplo n.º 1
0
 /**
  * Adds the parent of the current menu item
  *
  * Does nothing when the parent is a top level item (has no
  * controllor or is the \Gems_menu itself).
  *
  * @param string $label Optional alternative label
  * @return \Gems_Menu_MenuList (continuation pattern)
  */
 public function addCurrentParent($label = null)
 {
     $parent = $this->menu->getCurrentParent();
     if ($parent && !$parent->isTopLevel()) {
         $this->addMenuItem($parent, $label);
     }
     return $this;
 }
 /**
  * Action that switches the cron job lock on or off.
  */
 public function cronLockAction()
 {
     // Switch lock
     $this->util->getCronJobLock()->reverse();
     // Redirect
     $request = $this->getRequest();
     $this->_reroute($this->menu->getCurrentParent()->toRouteUrl());
 }
 /**
  * Create the snippets content
  *
  * This is a stub function either override getHtmlOutput() or override render()
  *
  * @param \Zend_View_Abstract $view Just in case it is needed here
  * @return \MUtil_Html_HtmlInterface Something that can be rendered
  */
 public function getHtmlOutput(\Zend_View_Abstract $view)
 {
     $div = \MUtil_Html::create('div');
     if ($this->surveyId && $this->data) {
         $div->h3(sprintf($this->_('Questions in survey %s'), $this->survey->getName()));
         $div->append(parent::getHtmlOutput($view));
     } else {
         $this->addMessage($this->_('Survey not found'));
         if ($this->surveyId) {
             $div->pInfo(sprintf($this->_('Survey %s does not exist.'), $this->surveyId));
         } else {
             $div->pInfo($this->_('Survey not specified.'));
         }
     }
     $item = $this->menu->getCurrentParent();
     if ($item) {
         $div->append($item->toActionLink($this->_('Cancel'), $this->request));
     }
     return $div;
 }