/** * Constructs the form * * @param boolean $hideGroup When true group checkbox is hidden * @return \Gems_Form_TableForm */ public function getForm($hideGroup = false) { $form = new \Gems_Form(); $form->setAttrib('target', '_blank'); if ($hideGroup) { $element = new \Zend_Form_Element_Hidden('group'); } else { $element = new \Zend_Form_Element_Checkbox('group'); $element->setLabel($this->_('Group surveys')); } $element->setValue(1); $form->addElement($element); $element = new \Zend_Form_Element_Select('format'); $element->setLabel($this->_('Output format')); $outputFormats = array('html' => 'HTML'); if ($this->_pdf->hasPdfExport()) { $outputFormats['pdf'] = 'PDF'; $element->setValue('pdf'); } $element->setMultiOptions($outputFormats); $form->addElement($element); $element = new \Zend_Form_Element_Submit('export'); $element->setLabel($this->_('Export'))->setAttrib('class', 'button'); $form->addElement($element); $links = $this->menu->getMenuList(); $links->addParameterSources($this->request, $this->menu->getParameterSource()); $links->addCurrentParent($this->_('Cancel')); if (count($links)) { $element = new \MUtil_Form_Element_Html('menuLinks'); $element->setValue($links); // $element->setOrder(999); $form->addElement($element); } return $form; }
/** * 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) { $menuList = $this->menu->getMenuList(); $menuList->addParameterSources($this->request, $this->menu->getParameterSource()); // \MUtil_Echo::track($this->request->getParams(), $this->menu->getParameterSource()->getArrayCopy()); $this->addButtons($menuList); if ($menuList->render($view)) { return \MUtil_Html::create('div', array('class' => 'buttons', 'renderClosingTag' => true), $menuList); } }
/** * overrule to add your own buttons. * * @return \Gems_Menu_MenuList */ protected function getMenuList() { $links = $this->menu->getMenuList(); $links->addParameterSources($this->request, $this->menu->getParameterSource()); $links->addCurrentParent($this->_('Cancel')); if ($this->menuShowSiblings) { $links->addCurrentSiblings(); } if ($this->menuShowChildren) { $links->addCurrentChildren(); } return $links; }
/** * overrule to add your own buttons. * * @return \Gems_Menu_MenuList */ protected function getMenuList() { $links = $this->menu->getMenuList(); $links->addParameterSources($this->request, $this->menu->getParameterSource()); $source = new \Gems_Menu_ParameterSource(array('gro_id_track' => $this->trackId, 'gro_id_round' => $this->trackEngine->getPreviousRoundId($this->roundId))); $links->append($this->menu->getCurrent()->toActionLink(true, \MUtil_Html::raw($this->_('< Previous')), $source)); $links->addCurrentParent($this->_('Cancel')); $links->addCurrentChildren(); $links->addCurrentSiblings(); $source->offsetSet('gro_id_round', $this->trackEngine->getNextRoundId($this->roundId)); $links->append($this->menu->getCurrent()->toActionLink(true, \MUtil_Html::raw($this->_('Next >')), $source)); return $links; }
public function getHtmlOutput(\Zend_View_Abstract $view) { $html = $this->getHtmlSequence(); $request = $this->request; $html->hr(array('class' => 'noprint')); $params = $request->getParams(); $state = $params; // Use current state for pdf export if (isset($params['fullanswers'])) { unset($params['fullanswers']); } else { $params['fullanswers'] = 1; } $url = array('controller' => $request->getControllerName(), 'action' => $request->getActionName(), 'routereset' => true) + $params; $html->actionLink($url, $this->_('Toggle')); // Now add the menulist all buttons under answer $menuList = $this->menu->getMenuList(); $menuList->addParameterSources($this->menu->getParameterSource())->addCurrentChildren(); $html[] = $menuList; $html->hr(array('class' => 'noprint')); return $html; }
public function indexAction() { $this->html->h2($this->_('Project information')); $data = $this->_getData(); $lock = $this->util->getMaintenanceLock(); if ($lock->isLocked()) { $label = $this->_('Turn Maintenance Mode OFF'); } else { $label = $this->_('Turn Maintenance Mode ON'); } $request = $this->getRequest(); $buttonList = $this->menu->getMenuList(); $buttonList->addParameterSources($request)->addByController($request->getControllerName(), 'maintenance', $label)->addByController($request->getControllerName(), 'cacheclean'); // $this->html->buttonDiv($buttonList); $this->_showTable($this->_('Version information'), $data); $this->html->buttonDiv($buttonList); }
public function indexAction() { $this->html->h2($this->_('Project information')); $versions = $this->loader->getVersions(); $data[$this->_('Project name')] = $this->project->name; $data[$this->_('Project version')] = $versions->getProjectVersion(); $data[$this->_('Gems version')] = $versions->getGemsVersion(); $data[$this->_('Gems build')] = $versions->getBuild(); $data[$this->_('Gems project')] = GEMS_PROJECT_NAME; $data[$this->_('Gems web directory')] = $this->getDirInfo(GEMS_WEB_DIR); $data[$this->_('Gems root directory')] = $this->getDirInfo(GEMS_ROOT_DIR); $data[$this->_('Gems code directory')] = $this->getDirInfo(GEMS_LIBRARY_DIR); $data[$this->_('Gems variable directory')] = $this->getDirInfo(GEMS_ROOT_DIR . '/var'); $data[$this->_('MUtil version')] = \MUtil_Version::get(); $data[$this->_('Zend version')] = \Zend_Version::VERSION; $data[$this->_('Application environment')] = APPLICATION_ENV; $data[$this->_('Application baseuri')] = $this->loader->getUtil()->getCurrentURI(); $data[$this->_('Application directory')] = $this->getDirInfo(APPLICATION_PATH); $data[$this->_('Application encoding')] = APPLICATION_ENCODING; $data[$this->_('PHP version')] = phpversion(); $data[$this->_('Server Hostname')] = php_uname('n'); $data[$this->_('Server OS')] = php_uname('s'); $data[$this->_('Time on server')] = date('r'); $driveVars = array($this->_('Session directory') => \Zend_Session::getOptions('save_path'), $this->_('Temporary files directory') => realpath(getenv('TMP'))); if ($system = getenv('SystemDrive')) { $driveVars[$this->_('System Drive')] = realpath($system); } foreach ($driveVars as $name => $drive) { $data[$name] = $this->getDirInfo($drive); } $lock = $this->util->getMaintenanceLock(); if ($lock->isLocked()) { $label = $this->_('Turn Maintenance Mode OFF'); } else { $label = $this->_('Turn Maintenance Mode ON'); } $request = $this->getRequest(); $buttonList = $this->menu->getMenuList(); $buttonList->addParameterSources($request)->addByController($request->getControllerName(), 'maintenance', $label)->addByController($request->getControllerName(), 'cacheclean'); // $this->html->buttonDiv($buttonList); $this->_showTable($this->_('Version information'), $data); $this->html->buttonDiv($buttonList); }