/** * Use findmenuitem for the abort action so we get the right id appended * * @param \MUtil_Model_Bridge_VerticalTableBridge $bridge * @param \MUtil_Model_ModelAbstract $model */ protected function setShowTableFooter(\MUtil_Model_Bridge_VerticalTableBridge $bridge, \MUtil_Model_ModelAbstract $model) { $footer = $bridge->tfrow(); $footer[] = $this->getQuestion(); $footer[] = ' '; $footer->actionLink(array($this->confirmParameter => 1), $this->_('Yes')); $footer[] = ' '; $footer->actionLink($this->findMenuItem($this->request->getControllerName(), $this->abortAction)->toHRefAttribute($this->request), $this->_('No')); }
/** * Set the footer of the browse table. * * Overrule this function to set the header differently, without * having to recode the core table building code. * * @param \MUtil_Model_Bridge_VerticalTableBridge $bridge * @param \MUtil_Model_ModelAbstract $model * @return void */ protected function setShowTableFooter(\MUtil_Model_Bridge_VerticalTableBridge $bridge, \MUtil_Model_ModelAbstract $model) { $footer = $bridge->tfrow(); $footer[] = $this->getQuestion(); $footer[] = ' '; $footer->actionLink(array($this->confirmParameter => 1), $this->_('Yes')); $footer[] = ' '; $footer->actionLink(array($this->request->getActionKey() => $this->abortAction), $this->_('No')); }
/** * Set the footer of the browse table. * * Overrule this function to set the header differently, without * having to recode the core table building code. * * @param \MUtil_Model_Bridge_VerticalTableBridge $bridge * @param \MUtil_Model_ModelAbstract $model * @return void */ protected function setShowTableFooter(\MUtil_Model_Bridge_VerticalTableBridge $bridge, \MUtil_Model_ModelAbstract $model) { $fparams = array('class' => 'centerAlign'); $row = $bridge->getRow(); if (isset($row[$this->filterWhen]) && $row[$this->filterWhen]) { $count = $this->db->fetchOne("SELECT COUNT(*) FROM gems__appointments WHERE " . $this->getWhere()); if ($count) { $footer = $bridge->tfrow($fparams); $footer[] = sprintf($this->plural('This will delete %d appointment. Are you sure?', 'This will delete %d appointments. Are you sure?', $count), $count); $footer[] = ' '; $footer->actionLink(array($this->confirmParameter => 1), $this->_('Yes')); $footer[] = ' '; $footer->actionLink(array($this->request->getActionKey() => $this->abortAction), $this->_('No')); } else { $this->addMessage($this->_('Clean up not needed!')); $bridge->tfrow($this->_('No clean up needed, no appointments exist.'), $fparams); } } else { $this->addMessage($this->_('Clean up filter disabled!')); $bridge->tfrow($this->_('No clean up possible.'), array('class' => 'centerAlign')); } if ($this->displayMenu) { if (!$this->menuList) { $this->menuList = $this->menu->getCurrentMenuList($this->request, $this->_('Cancel')); $this->menuList->addCurrentSiblings(); } if ($this->menuList instanceof \Gems_Menu_MenuList) { $this->menuList->addParameterSources($bridge); } $bridge->tfrow($this->menuList, $fparams); } }
/** * * @param \MUtil_Model_Bridge_VerticalTableBridge $bridge * @return void */ protected function addButtons(\MUtil_Model_Bridge_VerticalTableBridge $bridge) { if ($this->showButtons) { if ($this->buttons) { $bridge->tfrow($this->buttons, array('class' => 'centerAlign')); } else { $menuList = $this->menu->getCurrentMenuList($this->request, $this->_('Cancel')); $menuList->addParameterSources($bridge); $bridge->tfrow($menuList, array('class' => 'centerAlign')); } } }