Esempio n. 1
0
 /**
  * @return $this
  * @throws Core\ACL\Exception\AccessForbiddenException
  */
 public function preDispatch()
 {
     $path = $this->request->getArea() . '/' . $this->request->getFullPathWithoutArea();
     if ($this->acl->hasPermission($path) === false) {
         throw new Core\ACL\Exception\AccessForbiddenException();
     }
     $this->view->assign(['PHP_SELF' => $this->appPath->getPhpSelf(), 'ROOT_DIR' => $this->appPath->getWebRoot(), 'HOST_NAME' => $this->request->getHttpHost(), 'ROOT_DIR_ABSOLUTE' => $this->request->getScheme() . '://' . $this->request->getHttpHost() . $this->appPath->getWebRoot(), 'DESIGN_PATH' => $this->appPath->getDesignPathWeb(), 'DESIGN_PATH_ABSOLUTE' => $this->appPath->getDesignPathAbsolute(), 'LANG_DIRECTION' => $this->translator->getDirection(), 'LANG' => $this->translator->getShortIsoCode()]);
     return $this;
 }
Esempio n. 2
0
 /**
  * Configures the CKEditor instance
  *
  * @return string
  */
 private function configure()
 {
     $this->config['entities'] = false;
     $this->config['extraPlugins'] = 'divarea,oembed,codemirror';
     $this->config['allowedContent'] = true;
     $this->config['language'] = $this->translator->getShortIsoCode();
     $this->config['codemirror'] = ['theme' => 'default', 'lineNumbers' => true, 'lineWrapping' => true, 'matchBrackets' => true, 'autoCloseTags' => true, 'autoCloseBrackets' => true, 'enableSearchTools' => true, 'enableCodeFolding' => true, 'enableCodeFormatting' => true, 'autoFormatOnStart' => true, 'autoFormatOnUncomment' => true, 'highlightActiveLine' => true, 'highlightMatches' => true, 'showFormatButton' => false, 'showCommentButton' => false, 'showUncommentButton' => false];
     // Full toolbar
     if (!isset($this->config['toolbar']) || $this->config['toolbar'] !== 'Basic') {
         $this->configureFullToolbar();
     } else {
         // basic toolbar
         $this->configureBasicToolbar();
     }
     return json_encode($this->config);
 }