|
|
|
@ -3,13 +3,12 @@ |
|
|
|
|
|
|
|
|
|
namespace Chamilo\CourseBundle\Controller; |
|
|
|
|
|
|
|
|
|
use Chamilo\CoreBundle\Controller\BaseController; |
|
|
|
|
use Chamilo\CourseBundle\Manager\SettingsManager; |
|
|
|
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; |
|
|
|
|
use Sylius\Bundle\SettingsBundle\Form\Factory\SettingsFormFactoryInterface; |
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
|
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
|
|
|
use Symfony\Component\HttpFoundation\Response; |
|
|
|
|
use Symfony\Component\Translation\TranslatorInterface; |
|
|
|
|
use Symfony\Component\Validator\Exception\ValidatorException; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -17,7 +16,7 @@ use Symfony\Component\Validator\Exception\ValidatorException; |
|
|
|
|
* |
|
|
|
|
* @author Paweł Jędrzejewski <pawel@sylius.org> |
|
|
|
|
*/ |
|
|
|
|
class SettingsController extends AbstractController |
|
|
|
|
class SettingsController extends BaseController |
|
|
|
|
{ |
|
|
|
|
/** |
|
|
|
|
* Edit configuration with given namespace. |
|
|
|
@ -46,13 +45,13 @@ class SettingsController extends AbstractController |
|
|
|
|
try { |
|
|
|
|
$manager->setCourse($course); |
|
|
|
|
$manager->saveSettings($namespace, $form->getData()); |
|
|
|
|
$message = $this->getTranslator()->trans( |
|
|
|
|
$message = $this->trans( |
|
|
|
|
'sylius.settings.update', |
|
|
|
|
[], |
|
|
|
|
'flashes' |
|
|
|
|
); |
|
|
|
|
} catch (ValidatorException $exception) { |
|
|
|
|
$message = $this->getTranslator()->trans( |
|
|
|
|
$message = $this->trans( |
|
|
|
|
$exception->getMessage(), |
|
|
|
|
[], |
|
|
|
|
'validators' |
|
|
|
@ -105,14 +104,4 @@ class SettingsController extends AbstractController |
|
|
|
|
{ |
|
|
|
|
return $this->get('chamilo_course.settings.form_factory'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Get translator. |
|
|
|
|
* |
|
|
|
|
* @return TranslatorInterface |
|
|
|
|
*/ |
|
|
|
|
protected function getTranslator() |
|
|
|
|
{ |
|
|
|
|
return $this->get('translator'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|