*/ /** * Klasa stPolcardBackendActions * * @package stPolcardPlugin * @subpackage actions */ class stPolcardBackendActions extends stActions { /** * Wyświetla konfigurację modułu */ public function executeIndex() { $this->config = stConfig::getInstance($this->getModuleName()); if ($this->getRequest()->getMethod() == sfRequest::POST) { $this->config->setFromRequest('config'); $this->config->save(); $this->setFlash('notice', 'Twoje zmiany zostały zapisane'); } $this->labels = $this->getLabels(); } public function validateIndex() { if ($this->getRequest()->getMethod() == sfRequest::POST) { stAuthUsersListener::checkModificationCredentials($this, $this->getRequest(), $this->getModuleName()); } return true; } public function getLabels() { return array( 'config{pos_id}' => $this->getContext()->getI18n()->__('Identyfikator sprzedaży'), 'config{shared_key}' => $this->getContext()->getI18n()->__('Klucz współdzielony'), ); } /** * Akcja w przypadku błędu w uzupełnianiu pó */ public function handleErrorIndex() { $this->config = stConfig::getInstance($this->getModuleName()); $this->labels = $this->getLabels(); return sfView::SUCCESS; } }