create ajax modal for lang edition
This commit is contained in:
@@ -22,8 +22,11 @@
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Controller\Admin;
|
||||
|
||||
use Thelia\Core\Security\AccessManager;
|
||||
use Thelia\Core\Security\Resource\AdminResources;
|
||||
use Thelia\Form\Lang\LangUpdateForm;
|
||||
use Thelia\Model\LangQuery;
|
||||
|
||||
|
||||
/**
|
||||
@@ -38,6 +41,30 @@ class LangController extends BaseAdminController
|
||||
{
|
||||
if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE, AccessManager::VIEW)) return $response;
|
||||
|
||||
return $this->render('lang');
|
||||
return $this->render('languages');
|
||||
}
|
||||
|
||||
public function updateAction($lang_id)
|
||||
{
|
||||
if (null !== $response = $this->checkAuth(AdminResources::LANGUAGE, AccessManager::UPDATE)) return $response;
|
||||
|
||||
$this->checkXmlHttpRequest();
|
||||
|
||||
$lang = LangQuery::create()->findPk($lang_id);
|
||||
|
||||
$langForm = new LangUpdateForm($this->getRequest(), 'form', array(
|
||||
'id' => $lang->getId(),
|
||||
'title' => $lang->getTitle(),
|
||||
'code' => $lang->getCode(),
|
||||
'locale' => $lang->getLocale(),
|
||||
'date_format' => $lang->getDateFormat(),
|
||||
'time_format' => $lang->getTimeFormat()
|
||||
));
|
||||
|
||||
$this->getParserContext()->addForm($langForm);
|
||||
|
||||
return $this->render('ajax/language-update-modal', array(
|
||||
'lang_id' => $lang_id
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user