Ejemplo n.º 1
0
 public function css()
 {
     if (OW::getRequest()->isAjax()) {
         $css = isset($_POST['css']) ? trim($_POST['css']) : '';
         $dto = $this->themeService->findThemeByName(OW::getConfig()->getValue('base', 'selectedTheme'));
         $dto->setCustomCss($css);
         $this->themeService->saveTheme($dto);
         $this->themeService->updateCustomCssFile($dto->getId());
         echo json_encode(array('message' => OW::getLanguage()->text('admin', 'css_edit_success_message')));
     }
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('admin')->getStaticJsUrl() . 'prettify.js');
     OW::getDocument()->addScript(OW::getPluginManager()->getPlugin('admin')->getStaticJsUrl() . 'lang-css.js');
     OW::getDocument()->addStyleSheet(OW::getPluginManager()->getPlugin('admin')->getStaticCssUrl() . 'prettify.css');
     OW::getDocument()->addOnloadScript("prettyPrint();");
     $fileString = file_get_contents(OW::getThemeManager()->getSelectedTheme()->getRootDir() . BOL_ThemeService::CSS_FILE_NAME);
     $this->assign('code', '<pre class="prettyprint lang-css">' . $fileString . '</pre>');
     $this->addForm(new AddCssForm());
 }