Changeset 3874:ab8368569446 for plugins/blowupConfig
- Timestamp:
- 09/14/18 12:16:17 (7 years ago)
- Branch:
- default
- Location:
- plugins/blowupConfig
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/blowupConfig/_define.php
r3731 r3874 17 17 "Olivier Meunier", // Author 18 18 '1.2', // Version 19 array(19 [ 20 20 'permissions' => 'admin', 21 21 'type' => 'plugin' 22 )22 ] 23 23 ); -
plugins/blowupConfig/_public.php
r3731 r3874 17 17 18 18 require dirname(__FILE__) . '/lib/class.blowup.config.php'; 19 $core->addBehavior('publicHeadContent', array('tplBlowupTheme', 'publicHeadContent'));19 $core->addBehavior('publicHeadContent', ['tplBlowupTheme', 'publicHeadContent']); 20 20 21 21 class tplBlowUpTheme -
plugins/blowupConfig/index.php
r3731 r3874 22 22 } 23 23 24 $blowup_base = array(24 $blowup_base = [ 25 25 'body_bg_c' => null, 26 26 'body_bg_g' => 'light', … … 81 81 82 82 'extra_css' => null 83 );83 ]; 84 84 85 85 $blowup_user = $core->blog->settings->themes->blowup_style; … … 87 87 $blowup_user = @unserialize($blowup_user); 88 88 if (!is_array($blowup_user)) { 89 $blowup_user = array();89 $blowup_user = []; 90 90 } 91 91 92 92 $blowup_user = array_merge($blowup_base, $blowup_user); 93 93 94 $gradient_types = array(94 $gradient_types = [ 95 95 __('Light linear gradient') => 'light', 96 96 __('Medium linear gradient') => 'medium', 97 97 __('Dark linear gradient') => 'dark', 98 98 __('Solid color') => 'solid' 99 );100 101 $top_images = array(__('Custom...') => 'custom');99 ]; 100 101 $top_images = [__('Custom...') => 'custom']; 102 102 $top_images = array_merge($top_images, array_flip(blowupConfig::$top_images)); 103 103 … … 205 205 <?php 206 206 echo dcPage::jsLoad(dcPage::getPF('blowupConfig/js/config.js')); 207 echo dcPage::jsVars( array(207 echo dcPage::jsVars([ 208 208 'dotclear.blowup_public_url' => blowupConfig::imagesURL(), 209 209 'dotclear.msg.predefined_styles' => __('Predefined styles'), 210 210 'dotclear.msg.apply_code' => __('Apply code'), 211 211 'dotclear.msg.predefined_style_title' => __('Choose a predefined style') 212 ));212 ]); 213 213 ?> 214 214 </head> … … 217 217 <?php 218 218 echo dcPage::breadcrumb( 219 array(219 [ 220 220 html::escapeHTML($core->blog->name) => '', 221 221 __('Blog appearance') => $core->adminurl->get('admin.blog.theme'), 222 222 __('Blowup configuration') => '' 223 )) . dcPage::notices();223 ]) . dcPage::notices(); 224 224 225 225 echo … … 239 239 echo 240 240 '<p class="field"><label for="body_bg_c">' . __('Background color:') . '</label> ' . 241 form::color('body_bg_c', array('default' => $blowup_user['body_bg_c'])) . '</p>' .241 form::color('body_bg_c', ['default' => $blowup_user['body_bg_c']]) . '</p>' . 242 242 243 243 '<p class="field"><label for="body_bg_g">' . __('Background color fill:') . '</label> ' . … … 253 253 254 254 '<p class="field"><label for="body_txt_c">' . __('Main text color:') . '</label> ' . 255 form::color('body_txt_c', array('default' => $blowup_user['body_txt_c'])) . '</p>' .255 form::color('body_txt_c', ['default' => $blowup_user['body_txt_c']]) . '</p>' . 256 256 257 257 '<p class="field"><label for="body_line_height">' . __('Text line height:') . '</label> ' . … … 260 260 '<h4 class="border-top">' . __('Links') . '</h4>' . 261 261 '<p class="field"><label for="body_link_c">' . __('Links color:') . '</label> ' . 262 form::color('body_link_c', array('default' => $blowup_user['body_link_c'])) . '</p>' .262 form::color('body_link_c', ['default' => $blowup_user['body_link_c']]) . '</p>' . 263 263 264 264 '<p class="field"><label for="body_link_v_c">' . __('Visited links color:') . '</label> ' . 265 form::color('body_link_v_c', array('default' => $blowup_user['body_link_v_c'])) . '</p>' .265 form::color('body_link_v_c', ['default' => $blowup_user['body_link_v_c']]) . '</p>' . 266 266 267 267 '<p class="field"><label for="body_link_f_c">' . __('Focus links color:') . '</label> ' . 268 form::color('body_link_f_c', array('default' => $blowup_user['body_link_f_c'])) . '</p>' .268 form::color('body_link_f_c', ['default' => $blowup_user['body_link_f_c']]) . '</p>' . 269 269 270 270 '<h4 class="border-top">' . __('Page top') . '</h4>'; … … 273 273 echo 274 274 '<p class="field"><label for="prelude_c">' . __('Prelude color:') . '</label> ' . 275 form::color('prelude_c', array('default' => $blowup_user['prelude_c'])) . '</p>';275 form::color('prelude_c', ['default' => $blowup_user['prelude_c']]) . '</p>'; 276 276 } 277 277 … … 287 287 288 288 '<p class="field"><label for="blog_title_c">' . __('Main title color:') . '</label> ' . 289 form::color('blog_title_c', array('default' => $blowup_user['blog_title_c'])) . '</p>' .289 form::color('blog_title_c', ['default' => $blowup_user['blog_title_c']]) . '</p>' . 290 290 291 291 '<p class="field"><label for="blog_title_a">' . __('Main title alignment:') . '</label> ' . 292 form::combo('blog_title_a', array(__('center') => 'center', __('left') => 'left', __('right') => 'right'), $blowup_user['blog_title_a']) . '</p>' .292 form::combo('blog_title_a', [__('center') => 'center', __('left') => 'left', __('right') => 'right'], $blowup_user['blog_title_a']) . '</p>' . 293 293 294 294 '<p class="field"><label for="blog_title_p">' . __('Main title position (x:y)') . '</label> ' . … … 322 322 '<h4 class="border-top">' . __('Sidebar') . '</h4>' . 323 323 '<p class="field"><label for="sidebar_position">' . __('Sidebar position:') . '</label> ' . 324 form::combo('sidebar_position', array(__('right') => 'right', __('left') => 'left'), $blowup_user['sidebar_position']) . '</p>' .324 form::combo('sidebar_position', [__('right') => 'right', __('left') => 'left'], $blowup_user['sidebar_position']) . '</p>' . 325 325 326 326 '<p class="field"><label for="sidebar_text_f">' . __('Sidebar text font:') . '</label> ' . … … 331 331 332 332 '<p class="field"><label for="sidebar_text_c">' . __('Sidebar text color:') . '</label> ' . 333 form::color('sidebar_text_c', array('default' => $blowup_user['sidebar_text_c'])) . '</p>' .333 form::color('sidebar_text_c', ['default' => $blowup_user['sidebar_text_c']]) . '</p>' . 334 334 335 335 '<p class="field"><label for="sidebar_title_f">' . __('Sidebar titles font:') . '</label> ' . … … 340 340 341 341 '<p class="field"><label for="sidebar_title_c">' . __('Sidebar titles color:') . '</label> ' . 342 form::color('sidebar_title_c', array('default' => $blowup_user['sidebar_title_c'])) . '</p>' .342 form::color('sidebar_title_c', ['default' => $blowup_user['sidebar_title_c']]) . '</p>' . 343 343 344 344 '<p class="field"><label for="sidebar_title2_f">' . __('Sidebar 2nd level titles font:') . '</label> ' . … … 349 349 350 350 '<p class="field"><label for="sidebar_title2_c">' . __('Sidebar 2nd level titles color:') . '</label> ' . 351 form::color('sidebar_title2_c', array('default' => $blowup_user['sidebar_title2_c'])) . '</p>' .351 form::color('sidebar_title2_c', ['default' => $blowup_user['sidebar_title2_c']]) . '</p>' . 352 352 353 353 '<p class="field"><label for="sidebar_line_c">' . __('Sidebar lines color:') . '</label> ' . 354 form::color('sidebar_line_c', array('default' => $blowup_user['sidebar_line_c'])) . '</p>' .354 form::color('sidebar_line_c', ['default' => $blowup_user['sidebar_line_c']]) . '</p>' . 355 355 356 356 '<p class="field"><label for="sidebar_link_c">' . __('Sidebar links color:') . '</label> ' . 357 form::color('sidebar_link_c', array('default' => $blowup_user['sidebar_link_c'])) . '</p>' .357 form::color('sidebar_link_c', ['default' => $blowup_user['sidebar_link_c']]) . '</p>' . 358 358 359 359 '<p class="field"><label for="sidebar_link_v_c">' . __('Sidebar visited links color:') . '</label> ' . 360 form::color('sidebar_link_v_c', array('default' => $blowup_user['sidebar_link_v_c'])) . '</p>' .360 form::color('sidebar_link_v_c', ['default' => $blowup_user['sidebar_link_v_c']]) . '</p>' . 361 361 362 362 '<p class="field"><label for="sidebar_link_f_c">' . __('Sidebar focus links color:') . '</label> ' . 363 form::color('sidebar_link_f_c', array('default' => $blowup_user['sidebar_link_f_c'])) . '</p>' .363 form::color('sidebar_link_f_c', ['default' => $blowup_user['sidebar_link_f_c']]) . '</p>' . 364 364 365 365 '<h4 class="border-top">' . __('Entries') . '</h4>' . … … 371 371 372 372 '<p class="field"><label for="date_title_c">' . __('Date title color:') . '</label> ' . 373 form::color('date_title_c', array('default' => $blowup_user['date_title_c'])) . '</p>' .373 form::color('date_title_c', ['default' => $blowup_user['date_title_c']]) . '</p>' . 374 374 375 375 '<p class="field"><label for="post_title_f">' . __('Entry title font:') . '</label> ' . … … 380 380 381 381 '<p class="field"><label for="post_title_c">' . __('Entry title color:') . '</label> ' . 382 form::color('post_title_c', array('default' => $blowup_user['post_title_c'])) . '</p>';382 form::color('post_title_c', ['default' => $blowup_user['post_title_c']]) . '</p>'; 383 383 384 384 if ($can_write_images) { 385 385 echo 386 386 '<p class="field"><label for="post_comment_bg_c">' . __('Comment background color:') . '</label> ' . 387 form::color('post_comment_bg_c', array('default' => $blowup_user['post_comment_bg_c'])) . '</p>';387 form::color('post_comment_bg_c', ['default' => $blowup_user['post_comment_bg_c']]) . '</p>'; 388 388 } 389 389 390 390 echo 391 391 '<p class="field"><label for="post_comment_c">' . __('Comment text color:') . '</label> ' . 392 form::color('post_comment_c', array('default' => $blowup_user['post_comment_c'])) . '</p>';392 form::color('post_comment_c', ['default' => $blowup_user['post_comment_c']]) . '</p>'; 393 393 394 394 if ($can_write_images) { 395 395 echo 396 396 '<p class="field"><label for="post_commentmy_bg_c">' . __('My comment background color:') . '</label> ' . 397 form::color('post_commentmy_bg_c', array('default' => $blowup_user['post_commentmy_bg_c'])) . '</p>';397 form::color('post_commentmy_bg_c', ['default' => $blowup_user['post_commentmy_bg_c']]) . '</p>'; 398 398 } 399 399 400 400 echo 401 401 '<p class="field"><label for="post_commentmy_c">' . __('My comment text color:') . '</label> ' . 402 form::color('post_commentmy_c', array('default' => $blowup_user['post_commentmy_c'])) . '</p>' .402 form::color('post_commentmy_c', ['default' => $blowup_user['post_commentmy_c']]) . '</p>' . 403 403 404 404 '<h4 class="border-top">' . __('Footer') . '</h4>' . … … 410 410 411 411 '<p class="field"><label for="footer_c">' . __('Footer color:') . '</label> ' . 412 form::color('footer_c', array('default' => $blowup_user['footer_c'])) . '</p>' .412 form::color('footer_c', ['default' => $blowup_user['footer_c']]) . '</p>' . 413 413 414 414 '<p class="field"><label for="footer_l_c">' . __('Footer links color:') . '</label> ' . 415 form::color('footer_l_c', array('default' => $blowup_user['footer_l_c'])) . '</p>' .415 form::color('footer_l_c', ['default' => $blowup_user['footer_l_c']]) . '</p>' . 416 416 417 417 '<p class="field"><label for="footer_bg_c">' . __('Footer background color:') . '</label> ' . 418 form::color('footer_bg_c', array('default' => $blowup_user['footer_bg_c'])) . '</p>';418 form::color('footer_bg_c', ['default' => $blowup_user['footer_bg_c']]) . '</p>'; 419 419 420 420 echo 421 421 '<h4 class="border-top">' . __('Additional CSS') . '</h4>' . 422 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, array(423 form::textarea('extra_css', 72, 5, [ 424 424 'default' => html::escapeHTML($blowup_user['extra_css']), 425 425 'class' => 'maximal', 426 426 'extra_html' => 'title="' . __('Additional CSS') . '"' 427 )) .427 ]) . 428 428 '</p>' . 429 429 '</div>'; 430 430 431 431 // Import / Export configuration 432 $tmp_array = array();433 $tmp_exclude = array('uploaded', 'top_height');432 $tmp_array = []; 433 $tmp_exclude = ['uploaded', 'top_height']; 434 434 if ($blowup_user['top_image'] == 'custom') { 435 435 $tmp_exclude[] = 'top_image'; … … 445 445 '<div id="bu_export_content">' . 446 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, array(447 '<p>' . form::textarea('export_code', 72, 5, [ 448 448 'default' => implode('; ', $tmp_array), 449 449 'class' => 'maximal', 450 450 'extra_html' => 'title="' . __('Copy this code:') . '"' 451 )) . '</p>' .451 ]) . '</p>' . 452 452 '</div>' . 453 453 '</div>'; -
plugins/blowupConfig/lib/class.blowup.config.php
r3731 r3874 17 17 protected static $img_folder = 'blowup-images'; 18 18 19 protected static $fonts = array(20 'sans-serif' => array(19 protected static $fonts = [ 20 'sans-serif' => [ 21 21 'ss1' => 'Arial, Helvetica, sans-serif', 22 22 'ss2' => 'Verdana,Geneva, Arial, Helvetica, sans-serif', … … 24 24 'ss4' => '"Trebuchet MS", Helvetica, sans-serif', 25 25 'ss5' => 'Impact, Charcoal, sans-serif' 26 ),27 28 'serif' => array(26 ], 27 28 'serif' => [ 29 29 's1' => 'Times, "Times New Roman", serif', 30 30 's2' => 'Georgia, serif', 31 31 's3' => 'Baskerville, "Palatino Linotype", serif' 32 ),33 34 'monospace' => array(32 ], 33 34 'monospace' => [ 35 35 'm1' => '"Andale Mono", "Courier New", monospace', 36 36 'm2' => '"Courier New", Courier, mono, monospace' 37 )38 );39 40 protected static $fonts_combo = array();41 protected static $fonts_list = array();42 43 public static $top_images = array(37 ] 38 ]; 39 40 protected static $fonts_combo = []; 41 protected static $fonts_list = []; 42 43 public static $top_images = [ 44 44 'default' => 'Default', 45 45 'blank' => 'Blank', … … 58 58 'roadrunner-2' => 'Road Runner 2', 59 59 'typo' => 'Typo' 60 );60 ]; 61 61 62 62 public static function fontsList() … … 65 65 self::$fonts_combo[__('default')] = ''; 66 66 foreach (self::$fonts as $family => $g) { 67 $fonts = array();67 $fonts = []; 68 68 foreach ($g as $code => $font) { 69 69 $fonts[str_replace('"', '', $font)] = $code; … … 157 157 } 158 158 159 $css = array();159 $css = []; 160 160 161 161 /* Sidebar position … … 199 199 dcThemeConfig::prop($css, '#top h1 span', 'text-indent', '-5000px'); 200 200 dcThemeConfig::prop($css, '#top h1', 'top', '0px'); 201 $css['#top h1 a'] = array(201 $css['#top h1 a'] = [ 202 202 'display' => 'block', 203 203 'height' => $s['top_height'] ? ($s['top_height'] - 10) . 'px' : '120px', 204 204 'width' => '800px' 205 );205 ]; 206 206 } 207 207 dcThemeConfig::prop($css, '#top', 'height', $s['top_height']); … … 325 325 } 326 326 327 $body_fill = array(327 $body_fill = [ 328 328 'light' => dirname(__FILE__) . '/../alpha-img/gradient-l.png', 329 329 'medium' => dirname(__FILE__) . '/../alpha-img/gradient-m.png', 330 330 'dark' => dirname(__FILE__) . '/../alpha-img/gradient-d.png' 331 );331 ]; 332 332 333 333 $body_g = isset($body_fill[$gradient]) ? $body_fill[$gradient] : false;
Note: See TracChangeset
for help on using the changeset viewer.