Dotclear

Changeset 2393:662f66a598e3 for themes


Ignore:
Timestamp:
10/16/13 22:00:38 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.6
Message:

Load contextual help if possible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • themes/ductile/_config.php

    r2335 r2393  
    2323 
    2424$standalone_config = (boolean) $core->themes->moduleInfo($core->blog->settings->system->theme,'standalone_config'); 
     25 
     26// Load contextual help 
     27if (file_exists(dirname(__FILE__).'/locales/'.$_lang.'/resources.php')) { 
     28     require dirname(__FILE__).'/locales/'.$_lang.'/resources.php'; 
     29} 
    2530 
    2631$list_types = array( 
     
    110115{ 
    111116     global $font_families; 
    112       
     117 
    113118     return isset($font_families[$c]) ? '<span style="position:absolute;top:0;left:32em;">'.$font_families[$c].'</span>' : ''; 
    114119} 
     
    140145{ 
    141146     // Compute contrast ratio between two colors 
    142       
     147 
    143148     $color = adjustColor($color); 
    144149     if (($color == '') || (strlen($color) != 7)) return 0; 
    145150     $background = adjustColor($background); 
    146151     if (($background == '') || (strlen($background) != 7)) return 0; 
    147       
     152 
    148153     $l1 = (0.2126 * pow(hexdec(substr($color,1,2))/255,2.2)) + 
    149154          (0.7152 * pow(hexdec(substr($color,3,2))/255,2.2)) + 
     
    197202 
    198203     $large = ((($s > 1.5) && ($bold == false)) || (($s > 1.2) && ($bold == true))); 
    199       
     204 
    200205     // Check ratio 
    201206     if ($ratio > 7) { 
     
    216221          $ratio = computeContrastRatio($color,$background); 
    217222          $level = contrastRatioLevel($ratio,$size,$bold); 
    218           return  
     223          return 
    219224               '<span style="position:absolute;top:0;left:23em;">'. 
    220225               sprintf(__('ratio %.1f'),$ratio). 
     
    366371                    $ductile_stickers = $new_ductile_stickers; 
    367372               } 
    368                 
     373 
    369374               for ($i = 0; $i < count($_POST['list_type']); $i++) { 
    370375                    $ductile_lists[$_POST['list_ctx'][$i]] = $_POST['list_type'][$i]; 
    371376               } 
    372                 
     377 
    373378               for ($i = 0; $i < count($_POST['count_nb']); $i++) { 
    374379                    $ductile_counts[$_POST['count_ctx'][$i]] = $_POST['count_nb'][$i]; 
    375380               } 
    376                 
     381 
    377382          } 
    378            
     383 
    379384          # CSS 
    380385          if ($conf_tab == 'css') { 
     
    392397               $ductile_user['blog_title_s'] = adjustFontSize($_POST['blog_title_s']); 
    393398               $ductile_user['blog_title_c'] = adjustColor($_POST['blog_title_c']); 
    394            
     399 
    395400               $ductile_user['post_title_w'] = (integer) !empty($_POST['post_title_w']); 
    396401               $ductile_user['post_title_s'] = adjustFontSize($_POST['post_title_s']); 
    397402               $ductile_user['post_title_c'] = adjustColor($_POST['post_title_c']); 
    398            
     403 
    399404               $ductile_user['post_link_w'] = (integer) !empty($_POST['post_link_w']); 
    400405               $ductile_user['post_link_v_c'] = adjustColor($_POST['post_link_v_c']); 
    401406               $ductile_user['post_link_f_c'] = adjustColor($_POST['post_link_f_c']); 
    402            
     407 
    403408               $ductile_user['post_simple_title_c'] = adjustColor($_POST['post_simple_title_c']); 
    404            
     409 
    405410               $ductile_user['blog_title_w_m'] = (integer) !empty($_POST['blog_title_w_m']); 
    406411               $ductile_user['blog_title_s_m'] = adjustFontSize($_POST['blog_title_s_m']); 
    407412               $ductile_user['blog_title_c_m'] = adjustColor($_POST['blog_title_c_m']); 
    408            
     413 
    409414               $ductile_user['post_title_w_m'] = (integer) !empty($_POST['post_title_w_m']); 
    410415               $ductile_user['post_title_s_m'] = adjustFontSize($_POST['post_title_s_m']); 
    411416               $ductile_user['post_title_c_m'] = adjustColor($_POST['post_title_c_m']); 
    412417          } 
    413            
     418 
    414419          $core->blog->settings->addNamespace('themes'); 
    415420          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_style',serialize($ductile_user)); 
     
    423428          // Template cache reset 
    424429          $core->emptyTemplatesCache(); 
    425            
     430 
    426431          dcPage::message(__('Theme configuration upgraded.'),true,true); 
    427432     } 
     
    454459echo '<h4 class="border-top pretty-title">'.__('Stickers').'</h4>'; 
    455460 
    456 echo  
     461echo 
    457462'<div class="table-outer">'. 
    458463'<table class="dragable">'.'<caption>'.__('Stickers (footer)').'</caption>'. 
     
    469474foreach ($ductile_stickers as $i => $v) { 
    470475     $count++; 
    471      echo  
     476     echo 
    472477     '<tr class="line" id="l_'.$i.'">'. 
    473478     '<td class="handle minimal">'.form::field(array('order['.$i.']'),2,3,$count,'position','',false). 
     
    494499'<tbody>'; 
    495500foreach ($ductile_lists as $k => $v) { 
    496      echo  
     501     echo 
    497502          '<tr>'. 
    498503          '<td scope="row">'.$contexts[$k].'</td>'. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map