73 lines
2.1 KiB
PHP
73 lines
2.1 KiB
PHP
<?php
|
|
/**
|
|
* SOTESHOP/stAddThisPlugin
|
|
*
|
|
* Ten plik należy do aplikacji stAddThisPlugin opartej na licencji (Open License SOTE) Otwarta Licencja SOTE.
|
|
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
|
|
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
|
|
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
|
|
*
|
|
* @package stAddThisPlugin
|
|
* @subpackage actions
|
|
* @copyright SOTE (www.sote.pl)
|
|
* @license http://www.sote.pl/license/open (Open License SOTE) Otwarta Licencja SOTE
|
|
* @version $Id: actions.class.php 1390 2009-10-12 15:38:28Z michal $
|
|
* @author Krzysztof Bebło <krzysztof.beblo@sote.pl>
|
|
*/
|
|
|
|
/**
|
|
* stAddThisBackend actions.
|
|
*
|
|
* @author Krzysztof Bebło <krzysztof.beblo@sote.pl>
|
|
*
|
|
* @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',
|
|
);
|
|
}
|
|
|
|
}
|