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 '