*/ /** * stAddThisBackend actions. * * @author Krzysztof Bebło * * @package stAddThisPlugin * @subpackage actions */ class stAddThisBackendActions extends sfActions { /** * Zapisuje konfiguracje modulu */ public function executeIndex() { $this->config = stConfig::getInstance($this->getContext()); if ($this->getRequest()->getMethod() == sfRequest::POST) { $this->config->setFromRequest('addthis'); $this->config->save(); $this->setFlash('notice', 'Twoje zmiany zostały zapisane'); } } /** * Informuje o nieudanym wysłaniu polecenia sklepu */ public function handleErrorIndex() { $this->config = stConfig::getInstance($this->getContext()); $this->config->setFromRequest('addthis'); $this->labels = $this->getLabels(); return sfView::SUCCESS; } public function validateIndex() { if ($this->getRequest()->getMethod() == sfRequest::POST) { stAuthUsersListener::checkModificationCredentials($this, $this->getRequest(), $this->getModuleName()); } return true; } protected function getLabels() { return array( 'addthis{user}' => 'Nazwa użytkownika', ); } }