Jarves\Admin\AdminAssets::addLanguageResources PHP Метод

addLanguageResources() публичный Метод

    public function addLanguageResources()
    {
        $response = $this->pageStack->getPageResponse();
        $prefix = substr($this->jarves->getAdminPrefix(), 1);
        $response->addJsFile($prefix . '/admin/ui/languages');
        $response->addJsFile($prefix . '/admin/ui/language?lang=en&javascript=1');
        $response->addJsFile($prefix . '/admin/ui/language-plural?lang=en');
    }

Usage Example

Пример #1
0
 /**
  * @ApiDoc(
  *  section="Administration",
  *  description="Show the login page of the administration"
  * )
  *
  * @Rest\Get("%jarves_admin_prefix%")
  * @param Request $request
  *
  * @return \Jarves\PageResponse
  */
 public function showLoginAction(Request $request)
 {
     /** @var PageStack $pageStack */
     $pageStack = $this->get('jarves.page_stack');
     /** @var Jarves $jarves */
     $jarves = $this->get('jarves');
     /** @var ACL $acl */
     $acl = $this->get('jarves.acl');
     /** @var JarvesConfig $jarvesConfig */
     $jarvesConfig = $this->get('jarves.config');
     $adminAssets = new AdminAssets($jarves, $pageStack, $acl);
     $adminAssets->addMainResources();
     $adminAssets->addLanguageResources();
     $adminAssets->addSessionScripts();
     $response = $pageStack->getPageResponse();
     $response->addJs("\n        tinymce.baseURL =  _path+'bundles/jarves/tinymce',\n        window.addEvent('domready', function(){\n            jarves.adminInterface = new jarves.AdminInterface();\n        });\n");
     $response->setResourceCompression(false);
     $response->setDomainHandling(false);
     $response->setRenderFrontPage(false);
     $response->setTitle($jarvesConfig->getSystemConfig()->getSystemTitle() . ' | Jarves Administration');
     $response->prepare($request);
     return $response;
 }