function _initRequest() { $this->_request =& new $this->_request_class($this->source); $this->_request->setSubmitGroup($this->_submitGroup); $this->_attachActions($this->_request); if (!$this->_request->execute()) { return false; } if ($affected_qty = $this->_request->getAffectedQty()) { $message = sprintf(AMP_TEXT_LIST_ACTION_SUCCESS, ucfirst(AMP_PastParticiple($this->_request->getPerformedAction())), $affected_qty); } else { $message = sprintf(AMP_TEXT_LIST_ACTION_FAIL, AMP_PastParticiple($this->_request->getPerformedAction())); } $this->setMessage($message, 'AMP_LIST_REQUEST_RESULT'); $this->_after_request(); }
function execute() { $this->_initComponents("search"); $this->search->Build(true); if ($action = $this->search->submitted()) { $this->doAction($action); } else { $this->_setSearchFormDefaults(); } $this->_initComponents("list"); if ($list_action = $this->list->submitted()) { if ($qty = $this->list->doAction($list_action)) { return $this->setMessage($qty . " items " . AMP_PastParticiple($list_action) . " successfully"); } return $this->setMessage("Nothing was " . AMP_PastParticiple($list_action), $qty === FALSE); } if (!$action) { $this->doAction($this->default_action); } }
function do_request() { if (!$this->_request->execute()) { return false; } if (!AMP_DISPLAYMODE_DEBUG) { ampredirect(AMP_url_update($_SERVER['REQUEST_URI'])); } if ($affected_qty = $this->_request->getAffectedQty()) { $this->message(sprintf(AMP_TEXT_LIST_ACTION_SUCCESS, ucfirst(AMP_PastParticiple($this->_request->getPerformedAction())), $affected_qty)); AMP_flush_common_cache(); } else { $this->message(sprintf(AMP_TEXT_LIST_ACTION_FAIL, AMP_PastParticiple($this->_request->getPerformedAction()))); } $this->_after_request(); }
function AMP_past_participle($word) { return AMP_PastParticiple($word); }