auth->makePermissions([ dcAuth::PERMISSION_CONTENT_ADMIN, ])); $s = dcCore::app()->blog->settings->get('themes'); if (isset($_POST['morecss'])) { try { // Save CSS $css = base64_encode($_POST['morecss']); $s->put('morecss', $css); $s->put('morecss_active', !empty($_POST['morecss_active'])); // Minify it $css_min = preg_replace('` {2,}`', ' ', $_POST['morecss']); $css_min = preg_replace('/(\/\*[\s\S]*?\*\/)/', '', $css_min); $css_min = preg_replace('/(\t|\r|\n)/', '', $css_min); $css_min = str_replace([' { ', ' {', '{ '], '{', $css_min); $css_min = str_replace([' } ', ' }', '} '], '}', $css_min); $css_min = str_replace([' : ', ' :', ': '], ':', $css_min); $css_min = str_replace([' ; ', ' ;', '; '], ';', $css_min); $css_min = str_replace([' , ', ' ,', ', '], ',', $css_min); $s->put('morecss_min', base64_encode($css_min)); dcAdminNotices::addSuccessNotice( __('Configuration successfully updated.') ); dcCore::app()->adminurl->redirect( 'admin.plugin.' . basename(__DIR__) ); } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } } echo ' ' . __('Style sheet') . ''; if (dcCore::app()->auth->user_prefs->interface->colorsyntax) { echo dcPage::jsJson('dotclear_colorsyntax', ['colorsyntax' => dcCore::app()->auth->user_prefs->interface->colorsyntax]) . dcPage::jsLoadCodeMirror(dcCore::app()->auth->user_prefs->interface->colorsyntax_theme); } echo ' ' . dcPage::breadcrumb([ html::escapeHTML(dcCore::app()->blog->name) => '', __('Style sheet') => '', ]) . dcPage::notices() . '

' . form::textarea('morecss', 72, 25, [ 'default' => html::escapeHTML((string) base64_decode((string) $s->get('morecss'))), 'class' => 'maximal', ]) . '

' . form::hidden('p', 'moreCSS') . dcCore::app()->formNonce() . '

'; if (dcCore::app()->auth->user_prefs->interface->colorsyntax) { echo dcPage::jsJson('theme_editor_mode', ['mode' => 'css']) . dcPage::jsModuleLoad('themeEditor/js/mode.js') . dcPage::jsRunCodeMirror('editor', 'morecss', 'dotclear', dcCore::app()->auth->user_prefs->interface->colorsyntax_theme); } echo ' ';