| 1 | <?php |
|---|
| 2 | /** |
|---|
| 3 | * @brief blowupConfig, a plugin for Dotclear 2 |
|---|
| 4 | * |
|---|
| 5 | * @package Dotclear |
|---|
| 6 | * @subpackage Plugins |
|---|
| 7 | * |
|---|
| 8 | * @copyright Olivier Meunier & Association Dotclear |
|---|
| 9 | * @copyright GPL-2.0-only |
|---|
| 10 | */ |
|---|
| 11 | |
|---|
| 12 | if (!defined('DC_CONTEXT_ADMIN')) {return;} |
|---|
| 13 | |
|---|
| 14 | require dirname(__FILE__) . '/lib/class.blowup.config.php'; |
|---|
| 15 | |
|---|
| 16 | $can_write_images = blowupConfig::canWriteImages(); |
|---|
| 17 | $can_write_css = blowupConfig::canWriteCss(); |
|---|
| 18 | |
|---|
| 19 | if ($core->error->flag()) { |
|---|
| 20 | $notices = $core->error->toHTML(); |
|---|
| 21 | $core->error->reset(); |
|---|
| 22 | } |
|---|
| 23 | |
|---|
| 24 | $blowup_base = [ |
|---|
| 25 | 'body_bg_c' => null, |
|---|
| 26 | 'body_bg_g' => 'light', |
|---|
| 27 | |
|---|
| 28 | 'body_txt_f' => null, |
|---|
| 29 | 'body_txt_s' => null, |
|---|
| 30 | 'body_txt_c' => null, |
|---|
| 31 | 'body_line_height' => null, |
|---|
| 32 | |
|---|
| 33 | 'top_image' => 'default', |
|---|
| 34 | 'top_height' => null, |
|---|
| 35 | 'uploaded' => null, |
|---|
| 36 | |
|---|
| 37 | 'blog_title_hide' => null, |
|---|
| 38 | 'blog_title_f' => null, |
|---|
| 39 | 'blog_title_s' => null, |
|---|
| 40 | 'blog_title_c' => null, |
|---|
| 41 | 'blog_title_a' => null, |
|---|
| 42 | 'blog_title_p' => null, |
|---|
| 43 | |
|---|
| 44 | 'body_link_c' => null, |
|---|
| 45 | 'body_link_f_c' => null, |
|---|
| 46 | 'body_link_v_c' => null, |
|---|
| 47 | |
|---|
| 48 | 'sidebar_position' => null, |
|---|
| 49 | 'sidebar_text_f' => null, |
|---|
| 50 | 'sidebar_text_s' => null, |
|---|
| 51 | 'sidebar_text_c' => null, |
|---|
| 52 | 'sidebar_title_f' => null, |
|---|
| 53 | 'sidebar_title_s' => null, |
|---|
| 54 | 'sidebar_title_c' => null, |
|---|
| 55 | 'sidebar_title2_f' => null, |
|---|
| 56 | 'sidebar_title2_s' => null, |
|---|
| 57 | 'sidebar_title2_c' => null, |
|---|
| 58 | 'sidebar_line_c' => null, |
|---|
| 59 | 'sidebar_link_c' => null, |
|---|
| 60 | 'sidebar_link_f_c' => null, |
|---|
| 61 | 'sidebar_link_v_c' => null, |
|---|
| 62 | |
|---|
| 63 | 'date_title_f' => null, |
|---|
| 64 | 'date_title_s' => null, |
|---|
| 65 | 'date_title_c' => null, |
|---|
| 66 | |
|---|
| 67 | 'post_title_f' => null, |
|---|
| 68 | 'post_title_s' => null, |
|---|
| 69 | 'post_title_c' => null, |
|---|
| 70 | 'post_comment_bg_c' => null, |
|---|
| 71 | 'post_comment_c' => null, |
|---|
| 72 | 'post_commentmy_bg_c' => null, |
|---|
| 73 | 'post_commentmy_c' => null, |
|---|
| 74 | |
|---|
| 75 | 'prelude_c' => null, |
|---|
| 76 | 'footer_f' => null, |
|---|
| 77 | 'footer_s' => null, |
|---|
| 78 | 'footer_c' => null, |
|---|
| 79 | 'footer_l_c' => null, |
|---|
| 80 | 'footer_bg_c' => null, |
|---|
| 81 | |
|---|
| 82 | 'extra_css' => null |
|---|
| 83 | ]; |
|---|
| 84 | |
|---|
| 85 | $blowup_user = $core->blog->settings->themes->blowup_style; |
|---|
| 86 | |
|---|
| 87 | $blowup_user = @unserialize($blowup_user); |
|---|
| 88 | if (!is_array($blowup_user)) { |
|---|
| 89 | $blowup_user = []; |
|---|
| 90 | } |
|---|
| 91 | |
|---|
| 92 | $blowup_user = array_merge($blowup_base, $blowup_user); |
|---|
| 93 | |
|---|
| 94 | $gradient_types = [ |
|---|
| 95 | __('Light linear gradient') => 'light', |
|---|
| 96 | __('Medium linear gradient') => 'medium', |
|---|
| 97 | __('Dark linear gradient') => 'dark', |
|---|
| 98 | __('Solid color') => 'solid' |
|---|
| 99 | ]; |
|---|
| 100 | |
|---|
| 101 | $top_images = [__('Custom...') => 'custom']; |
|---|
| 102 | $top_images = array_merge($top_images, array_flip(blowupConfig::$top_images)); |
|---|
| 103 | |
|---|
| 104 | if (!empty($_POST)) { |
|---|
| 105 | try |
|---|
| 106 | { |
|---|
| 107 | $blowup_user['body_txt_f'] = $_POST['body_txt_f']; |
|---|
| 108 | $blowup_user['body_txt_s'] = dcThemeConfig::adjustFontSize($_POST['body_txt_s']); |
|---|
| 109 | $blowup_user['body_txt_c'] = dcThemeConfig::adjustColor($_POST['body_txt_c']); |
|---|
| 110 | $blowup_user['body_line_height'] = dcThemeConfig::adjustFontSize($_POST['body_line_height']); |
|---|
| 111 | |
|---|
| 112 | $blowup_user['blog_title_hide'] = (integer) !empty($_POST['blog_title_hide']); |
|---|
| 113 | $update_blog_title = !$blowup_user['blog_title_hide'] && ( |
|---|
| 114 | !empty($_POST['blog_title_f']) || !empty($_POST['blog_title_s']) || |
|---|
| 115 | !empty($_POST['blog_title_c']) || !empty($_POST['blog_title_a']) || |
|---|
| 116 | !empty($_POST['blog_title_p']) |
|---|
| 117 | ); |
|---|
| 118 | |
|---|
| 119 | if ($update_blog_title) { |
|---|
| 120 | $blowup_user['blog_title_f'] = $_POST['blog_title_f']; |
|---|
| 121 | $blowup_user['blog_title_s'] = dcThemeConfig::adjustFontSize($_POST['blog_title_s']); |
|---|
| 122 | $blowup_user['blog_title_c'] = dcThemeConfig::adjustColor($_POST['blog_title_c']); |
|---|
| 123 | $blowup_user['blog_title_a'] = preg_match('/^(left|center|right)$/', $_POST['blog_title_a']) ? $_POST['blog_title_a'] : null; |
|---|
| 124 | $blowup_user['blog_title_p'] = dcThemeConfig::adjustPosition($_POST['blog_title_p']); |
|---|
| 125 | } |
|---|
| 126 | |
|---|
| 127 | $blowup_user['body_link_c'] = dcThemeConfig::adjustColor($_POST['body_link_c']); |
|---|
| 128 | $blowup_user['body_link_f_c'] = dcThemeConfig::adjustColor($_POST['body_link_f_c']); |
|---|
| 129 | $blowup_user['body_link_v_c'] = dcThemeConfig::adjustColor($_POST['body_link_v_c']); |
|---|
| 130 | |
|---|
| 131 | $blowup_user['sidebar_text_f'] = $_POST['sidebar_text_f']; |
|---|
| 132 | $blowup_user['sidebar_text_s'] = dcThemeConfig::adjustFontSize($_POST['sidebar_text_s']); |
|---|
| 133 | $blowup_user['sidebar_text_c'] = dcThemeConfig::adjustColor($_POST['sidebar_text_c']); |
|---|
| 134 | $blowup_user['sidebar_title_f'] = $_POST['sidebar_title_f']; |
|---|
| 135 | $blowup_user['sidebar_title_s'] = dcThemeConfig::adjustFontSize($_POST['sidebar_title_s']); |
|---|
| 136 | $blowup_user['sidebar_title_c'] = dcThemeConfig::adjustColor($_POST['sidebar_title_c']); |
|---|
| 137 | $blowup_user['sidebar_title2_f'] = $_POST['sidebar_title2_f']; |
|---|
| 138 | $blowup_user['sidebar_title2_s'] = dcThemeConfig::adjustFontSize($_POST['sidebar_title2_s']); |
|---|
| 139 | $blowup_user['sidebar_title2_c'] = dcThemeConfig::adjustColor($_POST['sidebar_title2_c']); |
|---|
| 140 | $blowup_user['sidebar_line_c'] = dcThemeConfig::adjustColor($_POST['sidebar_line_c']); |
|---|
| 141 | $blowup_user['sidebar_link_c'] = dcThemeConfig::adjustColor($_POST['sidebar_link_c']); |
|---|
| 142 | $blowup_user['sidebar_link_f_c'] = dcThemeConfig::adjustColor($_POST['sidebar_link_f_c']); |
|---|
| 143 | $blowup_user['sidebar_link_v_c'] = dcThemeConfig::adjustColor($_POST['sidebar_link_v_c']); |
|---|
| 144 | |
|---|
| 145 | $blowup_user['sidebar_position'] = ($_POST['sidebar_position'] == 'left') ? 'left' : null; |
|---|
| 146 | |
|---|
| 147 | $blowup_user['date_title_f'] = $_POST['date_title_f']; |
|---|
| 148 | $blowup_user['date_title_s'] = dcThemeConfig::adjustFontSize($_POST['date_title_s']); |
|---|
| 149 | $blowup_user['date_title_c'] = dcThemeConfig::adjustColor($_POST['date_title_c']); |
|---|
| 150 | |
|---|
| 151 | $blowup_user['post_title_f'] = $_POST['post_title_f']; |
|---|
| 152 | $blowup_user['post_title_s'] = dcThemeConfig::adjustFontSize($_POST['post_title_s']); |
|---|
| 153 | $blowup_user['post_title_c'] = dcThemeConfig::adjustColor($_POST['post_title_c']); |
|---|
| 154 | $blowup_user['post_comment_c'] = dcThemeConfig::adjustColor($_POST['post_comment_c']); |
|---|
| 155 | $blowup_user['post_commentmy_c'] = dcThemeConfig::adjustColor($_POST['post_commentmy_c']); |
|---|
| 156 | |
|---|
| 157 | $blowup_user['footer_f'] = $_POST['footer_f']; |
|---|
| 158 | $blowup_user['footer_s'] = dcThemeConfig::adjustFontSize($_POST['footer_s']); |
|---|
| 159 | $blowup_user['footer_c'] = dcThemeConfig::adjustColor($_POST['footer_c']); |
|---|
| 160 | $blowup_user['footer_l_c'] = dcThemeConfig::adjustColor($_POST['footer_l_c']); |
|---|
| 161 | $blowup_user['footer_bg_c'] = dcThemeConfig::adjustColor($_POST['footer_bg_c']); |
|---|
| 162 | |
|---|
| 163 | $blowup_user['extra_css'] = dcThemeConfig::cleanCSS($_POST['extra_css']); |
|---|
| 164 | |
|---|
| 165 | if ($can_write_images) { |
|---|
| 166 | $uploaded = null; |
|---|
| 167 | if ($blowup_user['uploaded'] && is_file(blowupConfig::imagesPath() . '/' . $blowup_user['uploaded'])) { |
|---|
| 168 | $uploaded = blowupConfig::imagesPath() . '/' . $blowup_user['uploaded']; |
|---|
| 169 | } |
|---|
| 170 | |
|---|
| 171 | if (!empty($_FILES['upfile']) && !empty($_FILES['upfile']['name'])) { |
|---|
| 172 | files::uploadStatus($_FILES['upfile']); |
|---|
| 173 | $uploaded = blowupConfig::uploadImage($_FILES['upfile']); |
|---|
| 174 | $blowup_user['uploaded'] = basename($uploaded); |
|---|
| 175 | } |
|---|
| 176 | |
|---|
| 177 | $blowup_user['top_image'] = in_array($_POST['top_image'], $top_images) ? $_POST['top_image'] : 'default'; |
|---|
| 178 | |
|---|
| 179 | $blowup_user['body_bg_c'] = dcThemeConfig::adjustColor($_POST['body_bg_c']); |
|---|
| 180 | $blowup_user['body_bg_g'] = in_array($_POST['body_bg_g'], $gradient_types) ? $_POST['body_bg_g'] : ''; |
|---|
| 181 | $blowup_user['post_comment_bg_c'] = dcThemeConfig::adjustColor($_POST['post_comment_bg_c']); |
|---|
| 182 | $blowup_user['post_commentmy_bg_c'] = dcThemeConfig::adjustColor($_POST['post_commentmy_bg_c']); |
|---|
| 183 | $blowup_user['prelude_c'] = dcThemeConfig::adjustColor($_POST['prelude_c']); |
|---|
| 184 | blowupConfig::createImages($blowup_user, $uploaded); |
|---|
| 185 | } |
|---|
| 186 | |
|---|
| 187 | if ($can_write_css) { |
|---|
| 188 | blowupConfig::createCss($blowup_user); |
|---|
| 189 | } |
|---|
| 190 | |
|---|
| 191 | $core->blog->settings->addNamespace('themes'); |
|---|
| 192 | $core->blog->settings->themes->put('blowup_style', serialize($blowup_user)); |
|---|
| 193 | $core->blog->triggerBlog(); |
|---|
| 194 | |
|---|
| 195 | dcPage::addSuccessNotice(__('Theme configuration has been successfully updated.')); |
|---|
| 196 | http::redirect($p_url); |
|---|
| 197 | } catch (Exception $e) { |
|---|
| 198 | $core->error->add($e->getMessage()); |
|---|
| 199 | } |
|---|
| 200 | } |
|---|
| 201 | ?> |
|---|
| 202 | <html> |
|---|
| 203 | <head> |
|---|
| 204 | <title><?php echo __('Blowup configuration'); ?></title> |
|---|
| 205 | <?php |
|---|
| 206 | echo dcPage::jsLoad(dcPage::getPF('blowupConfig/js/config.js')); |
|---|
| 207 | echo dcPage::jsVars([ |
|---|
| 208 | 'dotclear.blowup_public_url' => blowupConfig::imagesURL(), |
|---|
| 209 | 'dotclear.msg.predefined_styles' => __('Predefined styles'), |
|---|
| 210 | 'dotclear.msg.apply_code' => __('Apply code'), |
|---|
| 211 | 'dotclear.msg.predefined_style_title' => __('Choose a predefined style') |
|---|
| 212 | ]); |
|---|
| 213 | ?> |
|---|
| 214 | </head> |
|---|
| 215 | |
|---|
| 216 | <body> |
|---|
| 217 | <?php |
|---|
| 218 | echo dcPage::breadcrumb( |
|---|
| 219 | [ |
|---|
| 220 | html::escapeHTML($core->blog->name) => '', |
|---|
| 221 | __('Blog appearance') => $core->adminurl->get('admin.blog.theme'), |
|---|
| 222 | __('Blowup configuration') => '' |
|---|
| 223 | ]) . dcPage::notices(); |
|---|
| 224 | |
|---|
| 225 | echo |
|---|
| 226 | '<p><a class="back" href="' . $core->adminurl->get('admin.blog.theme') . '">' . __('Back to Blog appearance') . '</a></p>'; |
|---|
| 227 | |
|---|
| 228 | if (!$can_write_images) { |
|---|
| 229 | dcPage::message(__('For the following reasons, images cannot be created. You won\'t be able to change some background properties.') . |
|---|
| 230 | $notices, false, true); |
|---|
| 231 | } |
|---|
| 232 | |
|---|
| 233 | echo '<form id="theme_config" action="' . $p_url . '" method="post" enctype="multipart/form-data">'; |
|---|
| 234 | |
|---|
| 235 | echo '<div class="fieldset"><h3>' . __('Customization') . '</h3>' . |
|---|
| 236 | '<h4>' . __('General') . '</h4>'; |
|---|
| 237 | |
|---|
| 238 | if ($can_write_images) { |
|---|
| 239 | echo |
|---|
| 240 | '<p class="field"><label for="body_bg_c">' . __('Background color:') . '</label> ' . |
|---|
| 241 | form::color('body_bg_c', ['default' => $blowup_user['body_bg_c']]) . '</p>' . |
|---|
| 242 | |
|---|
| 243 | '<p class="field"><label for="body_bg_g">' . __('Background color fill:') . '</label> ' . |
|---|
| 244 | form::combo('body_bg_g', $gradient_types, $blowup_user['body_bg_g']) . '</p>'; |
|---|
| 245 | } |
|---|
| 246 | |
|---|
| 247 | echo |
|---|
| 248 | '<p class="field"><label for="body_txt_f">' . __('Main text font:') . '</label> ' . |
|---|
| 249 | form::combo('body_txt_f', blowupConfig::fontsList(), $blowup_user['body_txt_f']) . '</p>' . |
|---|
| 250 | |
|---|
| 251 | '<p class="field"><label for="body_txt_s">' . __('Main text font size:') . '</label> ' . |
|---|
| 252 | form::field('body_txt_s', 7, 7, $blowup_user['body_txt_s']) . '</p>' . |
|---|
| 253 | |
|---|
| 254 | '<p class="field"><label for="body_txt_c">' . __('Main text color:') . '</label> ' . |
|---|
| 255 | form::color('body_txt_c', ['default' => $blowup_user['body_txt_c']]) . '</p>' . |
|---|
| 256 | |
|---|
| 257 | '<p class="field"><label for="body_line_height">' . __('Text line height:') . '</label> ' . |
|---|
| 258 | form::field('body_line_height', 7, 7, $blowup_user['body_line_height']) . '</p>' . |
|---|
| 259 | |
|---|
| 260 | '<h4 class="border-top">' . __('Links') . '</h4>' . |
|---|
| 261 | '<p class="field"><label for="body_link_c">' . __('Links color:') . '</label> ' . |
|---|
| 262 | form::color('body_link_c', ['default' => $blowup_user['body_link_c']]) . '</p>' . |
|---|
| 263 | |
|---|
| 264 | '<p class="field"><label for="body_link_v_c">' . __('Visited links color:') . '</label> ' . |
|---|
| 265 | form::color('body_link_v_c', ['default' => $blowup_user['body_link_v_c']]) . '</p>' . |
|---|
| 266 | |
|---|
| 267 | '<p class="field"><label for="body_link_f_c">' . __('Focus links color:') . '</label> ' . |
|---|
| 268 | form::color('body_link_f_c', ['default' => $blowup_user['body_link_f_c']]) . '</p>' . |
|---|
| 269 | |
|---|
| 270 | '<h4 class="border-top">' . __('Page top') . '</h4>'; |
|---|
| 271 | |
|---|
| 272 | if ($can_write_images) { |
|---|
| 273 | echo |
|---|
| 274 | '<p class="field"><label for="prelude_c">' . __('Prelude color:') . '</label> ' . |
|---|
| 275 | form::color('prelude_c', ['default' => $blowup_user['prelude_c']]) . '</p>'; |
|---|
| 276 | } |
|---|
| 277 | |
|---|
| 278 | echo |
|---|
| 279 | '<p class="field"><label for="blog_title_hide">' . __('Hide main title') . '</label> ' . |
|---|
| 280 | form::checkbox('blog_title_hide', 1, $blowup_user['blog_title_hide']) . '</p>' . |
|---|
| 281 | |
|---|
| 282 | '<p class="field"><label for="blog_title_f">' . __('Main title font:') . '</label> ' . |
|---|
| 283 | form::combo('blog_title_f', blowupConfig::fontsList(), $blowup_user['blog_title_f']) . '</p>' . |
|---|
| 284 | |
|---|
| 285 | '<p class="field"><label for="blog_title_s">' . __('Main title font size:') . '</label> ' . |
|---|
| 286 | form::field('blog_title_s', 7, 7, $blowup_user['blog_title_s']) . '</p>' . |
|---|
| 287 | |
|---|
| 288 | '<p class="field"><label for="blog_title_c">' . __('Main title color:') . '</label> ' . |
|---|
| 289 | form::color('blog_title_c', ['default' => $blowup_user['blog_title_c']]) . '</p>' . |
|---|
| 290 | |
|---|
| 291 | '<p class="field"><label for="blog_title_a">' . __('Main title alignment:') . '</label> ' . |
|---|
| 292 | form::combo('blog_title_a', [__('center') => 'center', __('left') => 'left', __('right') => 'right'], $blowup_user['blog_title_a']) . '</p>' . |
|---|
| 293 | |
|---|
| 294 | '<p class="field"><label for="blog_title_p">' . __('Main title position (x:y)') . '</label> ' . |
|---|
| 295 | form::field('blog_title_p', 7, 7, $blowup_user['blog_title_p']) . '</p>'; |
|---|
| 296 | |
|---|
| 297 | if ($can_write_images) { |
|---|
| 298 | if ($blowup_user['top_image'] == 'custom' && $blowup_user['uploaded']) { |
|---|
| 299 | $preview_image = http::concatURL($core->blog->url, blowupConfig::imagesURL() . '/page-t.png'); |
|---|
| 300 | } else { |
|---|
| 301 | $preview_image = dcPage::getPF('blowupConfig/alpha-img/page-t/' . $blowup_user['top_image'] . '.png'); |
|---|
| 302 | } |
|---|
| 303 | |
|---|
| 304 | echo |
|---|
| 305 | '<h5 class="pretty-title">' . __('Top image') . '</h5>' . |
|---|
| 306 | '<p class="field"><label for="top_image">' . __('Top image') . '</label> ' . |
|---|
| 307 | form::combo('top_image', $top_images, ($blowup_user['top_image'] ?: 'default')) . '</p>' . |
|---|
| 308 | '<p>' . __('Choose "Custom..." to upload your own image.') . '</p>' . |
|---|
| 309 | |
|---|
| 310 | '<p id="uploader"><label for="upfile">' . __('Add your image:') . '</label> ' . |
|---|
| 311 | ' (' . sprintf(__('JPEG or PNG file, 800 pixels wide, maximum size %s'), files::size(DC_MAX_UPLOAD_SIZE)) . ')' . |
|---|
| 312 | '<input type="file" name="upfile" id="upfile" size="35" />' . |
|---|
| 313 | '</p>' . |
|---|
| 314 | |
|---|
| 315 | '<h5>' . __('Preview') . '</h5>' . |
|---|
| 316 | '<div class="grid" style="width:800px;border:1px solid #ccc;">' . |
|---|
| 317 | '<img style="display:block;" src="' . $preview_image . '" alt="" id="image-preview" />' . |
|---|
| 318 | '</div>'; |
|---|
| 319 | } |
|---|
| 320 | |
|---|
| 321 | echo |
|---|
| 322 | '<h4 class="border-top">' . __('Sidebar') . '</h4>' . |
|---|
| 323 | '<p class="field"><label for="sidebar_position">' . __('Sidebar position:') . '</label> ' . |
|---|
| 324 | form::combo('sidebar_position', [__('right') => 'right', __('left') => 'left'], $blowup_user['sidebar_position']) . '</p>' . |
|---|
| 325 | |
|---|
| 326 | '<p class="field"><label for="sidebar_text_f">' . __('Sidebar text font:') . '</label> ' . |
|---|
| 327 | form::combo('sidebar_text_f', blowupConfig::fontsList(), $blowup_user['sidebar_text_f']) . '</p>' . |
|---|
| 328 | |
|---|
| 329 | '<p class="field"><label for="sidebar_text_s">' . __('Sidebar text font size:') . '</label> ' . |
|---|
| 330 | form::field('sidebar_text_s', 7, 7, $blowup_user['sidebar_text_s']) . '</p>' . |
|---|
| 331 | |
|---|
| 332 | '<p class="field"><label for="sidebar_text_c">' . __('Sidebar text color:') . '</label> ' . |
|---|
| 333 | form::color('sidebar_text_c', ['default' => $blowup_user['sidebar_text_c']]) . '</p>' . |
|---|
| 334 | |
|---|
| 335 | '<p class="field"><label for="sidebar_title_f">' . __('Sidebar titles font:') . '</label> ' . |
|---|
| 336 | form::combo('sidebar_title_f', blowupConfig::fontsList(), $blowup_user['sidebar_title_f']) . '</p>' . |
|---|
| 337 | |
|---|
| 338 | '<p class="field"><label for="sidebar_title_s">' . __('Sidebar titles font size:') . '</label> ' . |
|---|
| 339 | form::field('sidebar_title_s', 7, 7, $blowup_user['sidebar_title_s']) . '</p>' . |
|---|
| 340 | |
|---|
| 341 | '<p class="field"><label for="sidebar_title_c">' . __('Sidebar titles color:') . '</label> ' . |
|---|
| 342 | form::color('sidebar_title_c', ['default' => $blowup_user['sidebar_title_c']]) . '</p>' . |
|---|
| 343 | |
|---|
| 344 | '<p class="field"><label for="sidebar_title2_f">' . __('Sidebar 2nd level titles font:') . '</label> ' . |
|---|
| 345 | form::combo('sidebar_title2_f', blowupConfig::fontsList(), $blowup_user['sidebar_title2_f']) . '</p>' . |
|---|
| 346 | |
|---|
| 347 | '<p class="field"><label for="sidebar_title2_s">' . __('Sidebar 2nd level titles font size:') . '</label> ' . |
|---|
| 348 | form::field('sidebar_title2_s', 7, 7, $blowup_user['sidebar_title2_s']) . '</p>' . |
|---|
| 349 | |
|---|
| 350 | '<p class="field"><label for="sidebar_title2_c">' . __('Sidebar 2nd level titles color:') . '</label> ' . |
|---|
| 351 | form::color('sidebar_title2_c', ['default' => $blowup_user['sidebar_title2_c']]) . '</p>' . |
|---|
| 352 | |
|---|
| 353 | '<p class="field"><label for="sidebar_line_c">' . __('Sidebar lines color:') . '</label> ' . |
|---|
| 354 | form::color('sidebar_line_c', ['default' => $blowup_user['sidebar_line_c']]) . '</p>' . |
|---|
| 355 | |
|---|
| 356 | '<p class="field"><label for="sidebar_link_c">' . __('Sidebar links color:') . '</label> ' . |
|---|
| 357 | form::color('sidebar_link_c', ['default' => $blowup_user['sidebar_link_c']]) . '</p>' . |
|---|
| 358 | |
|---|
| 359 | '<p class="field"><label for="sidebar_link_v_c">' . __('Sidebar visited links color:') . '</label> ' . |
|---|
| 360 | form::color('sidebar_link_v_c', ['default' => $blowup_user['sidebar_link_v_c']]) . '</p>' . |
|---|
| 361 | |
|---|
| 362 | '<p class="field"><label for="sidebar_link_f_c">' . __('Sidebar focus links color:') . '</label> ' . |
|---|
| 363 | form::color('sidebar_link_f_c', ['default' => $blowup_user['sidebar_link_f_c']]) . '</p>' . |
|---|
| 364 | |
|---|
| 365 | '<h4 class="border-top">' . __('Entries') . '</h4>' . |
|---|
| 366 | '<p class="field"><label for="date_title_f">' . __('Date title font:') . '</label> ' . |
|---|
| 367 | form::combo('date_title_f', blowupConfig::fontsList(), $blowup_user['date_title_f']) . '</p>' . |
|---|
| 368 | |
|---|
| 369 | '<p class="field"><label for="date_title_s">' . __('Date title font size:') . '</label> ' . |
|---|
| 370 | form::field('date_title_s', 7, 7, $blowup_user['date_title_s']) . '</p>' . |
|---|
| 371 | |
|---|
| 372 | '<p class="field"><label for="date_title_c">' . __('Date title color:') . '</label> ' . |
|---|
| 373 | form::color('date_title_c', ['default' => $blowup_user['date_title_c']]) . '</p>' . |
|---|
| 374 | |
|---|
| 375 | '<p class="field"><label for="post_title_f">' . __('Entry title font:') . '</label> ' . |
|---|
| 376 | form::combo('post_title_f', blowupConfig::fontsList(), $blowup_user['post_title_f']) . '</p>' . |
|---|
| 377 | |
|---|
| 378 | '<p class="field"><label for="post_title_s">' . __('Entry title font size:') . '</label> ' . |
|---|
| 379 | form::field('post_title_s', 7, 7, $blowup_user['post_title_s']) . '</p>' . |
|---|
| 380 | |
|---|
| 381 | '<p class="field"><label for="post_title_c">' . __('Entry title color:') . '</label> ' . |
|---|
| 382 | form::color('post_title_c', ['default' => $blowup_user['post_title_c']]) . '</p>'; |
|---|
| 383 | |
|---|
| 384 | if ($can_write_images) { |
|---|
| 385 | echo |
|---|
| 386 | '<p class="field"><label for="post_comment_bg_c">' . __('Comment background color:') . '</label> ' . |
|---|
| 387 | form::color('post_comment_bg_c', ['default' => $blowup_user['post_comment_bg_c']]) . '</p>'; |
|---|
| 388 | } |
|---|
| 389 | |
|---|
| 390 | echo |
|---|
| 391 | '<p class="field"><label for="post_comment_c">' . __('Comment text color:') . '</label> ' . |
|---|
| 392 | form::color('post_comment_c', ['default' => $blowup_user['post_comment_c']]) . '</p>'; |
|---|
| 393 | |
|---|
| 394 | if ($can_write_images) { |
|---|
| 395 | echo |
|---|
| 396 | '<p class="field"><label for="post_commentmy_bg_c">' . __('My comment background color:') . '</label> ' . |
|---|
| 397 | form::color('post_commentmy_bg_c', ['default' => $blowup_user['post_commentmy_bg_c']]) . '</p>'; |
|---|
| 398 | } |
|---|
| 399 | |
|---|
| 400 | echo |
|---|
| 401 | '<p class="field"><label for="post_commentmy_c">' . __('My comment text color:') . '</label> ' . |
|---|
| 402 | form::color('post_commentmy_c', ['default' => $blowup_user['post_commentmy_c']]) . '</p>' . |
|---|
| 403 | |
|---|
| 404 | '<h4 class="border-top">' . __('Footer') . '</h4>' . |
|---|
| 405 | '<p class="field"><label for="footer_f">' . __('Footer font:') . '</label> ' . |
|---|
| 406 | form::combo('footer_f', blowupConfig::fontsList(), $blowup_user['footer_f']) . '</p>' . |
|---|
| 407 | |
|---|
| 408 | '<p class="field"><label for="footer_s">' . __('Footer font size:') . '</label> ' . |
|---|
| 409 | form::field('footer_s', 7, 7, $blowup_user['footer_s']) . '</p>' . |
|---|
| 410 | |
|---|
| 411 | '<p class="field"><label for="footer_c">' . __('Footer color:') . '</label> ' . |
|---|
| 412 | form::color('footer_c', ['default' => $blowup_user['footer_c']]) . '</p>' . |
|---|
| 413 | |
|---|
| 414 | '<p class="field"><label for="footer_l_c">' . __('Footer links color:') . '</label> ' . |
|---|
| 415 | form::color('footer_l_c', ['default' => $blowup_user['footer_l_c']]) . '</p>' . |
|---|
| 416 | |
|---|
| 417 | '<p class="field"><label for="footer_bg_c">' . __('Footer background color:') . '</label> ' . |
|---|
| 418 | form::color('footer_bg_c', ['default' => $blowup_user['footer_bg_c']]) . '</p>'; |
|---|
| 419 | |
|---|
| 420 | echo |
|---|
| 421 | '<h4 class="border-top">' . __('Additional CSS') . '</h4>' . |
|---|
| 422 | '<p><label for="extra_css">' . __('Any additional CSS styles (must be written using the CSS syntax):') . '</label> ' . |
|---|
| 423 | form::textarea('extra_css', 72, 5, [ |
|---|
| 424 | 'default' => html::escapeHTML($blowup_user['extra_css']), |
|---|
| 425 | 'class' => 'maximal', |
|---|
| 426 | 'extra_html' => 'title="' . __('Additional CSS') . '"' |
|---|
| 427 | ]) . |
|---|
| 428 | '</p>' . |
|---|
| 429 | '</div>'; |
|---|
| 430 | |
|---|
| 431 | // Import / Export configuration |
|---|
| 432 | $tmp_array = []; |
|---|
| 433 | $tmp_exclude = ['uploaded', 'top_height']; |
|---|
| 434 | if ($blowup_user['top_image'] == 'custom') { |
|---|
| 435 | $tmp_exclude[] = 'top_image'; |
|---|
| 436 | } |
|---|
| 437 | foreach ($blowup_user as $k => $v) { |
|---|
| 438 | if (!in_array($k, $tmp_exclude)) { |
|---|
| 439 | $tmp_array[] = $k . ':' . '"' . $v . '"'; |
|---|
| 440 | } |
|---|
| 441 | } |
|---|
| 442 | echo |
|---|
| 443 | '<div class="fieldset">' . |
|---|
| 444 | '<h3 id="bu_export">' . __('Configuration import / export') . '</h3>' . |
|---|
| 445 | '<div id="bu_export_content">' . |
|---|
| 446 | '<p>' . __('You can share your configuration using the following code. To apply a configuration, paste the code, click on "Apply code" and save.') . '</p>' . |
|---|
| 447 | '<p>' . form::textarea('export_code', 72, 5, [ |
|---|
| 448 | 'default' => implode('; ', $tmp_array), |
|---|
| 449 | 'class' => 'maximal', |
|---|
| 450 | 'extra_html' => 'title="' . __('Copy this code:') . '"' |
|---|
| 451 | ]) . '</p>' . |
|---|
| 452 | '</div>' . |
|---|
| 453 | '</div>'; |
|---|
| 454 | |
|---|
| 455 | echo |
|---|
| 456 | '<p class="clear"><input type="submit" value="' . __('Save') . '" />' . |
|---|
| 457 | $core->formNonce() . '</p>' . |
|---|
| 458 | '</form>'; |
|---|
| 459 | |
|---|
| 460 | dcPage::helpBlock('blowupConfig'); |
|---|
| 461 | ?> |
|---|
| 462 | </body> |
|---|
| 463 | </html> |
|---|