Changeset 387:023783060913
- Timestamp:
- 06/18/11 14:24:58 (14 years ago)
- Branch:
- themes
- Location:
- themes/ductile
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
themes/ductile/_config.php
r378 r387 28 28 ); 29 29 30 function adjustFontSize($s) 31 { 32 if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex)?$/',$s,$m)) { 33 if (empty($m[2])) { 34 $m[2] = 'em'; 35 } 36 return $m[1].$m[2]; 37 } 38 39 return null; 40 } 41 30 42 function adjustColor($c) 31 43 { … … 52 64 53 65 $ductile_base = array( 54 'body_link_w' => null,55 'body_link_v_c' => null,56 'body_link_f_c' => null,57 66 'body_font' => null, 58 'alternate_font' => null 67 'alternate_font' => null, 68 'blog_title_w' => null, 69 'blog_title_s' => null, 70 'blog_title_c' => null, 71 'post_title_w' => null, 72 'post_title_s' => null, 73 'post_title_c' => null, 74 'post_link_w' => null, 75 'post_link_v_c' => null, 76 'post_link_f_c' => null, 77 'blog_title_w_m' => null, 78 'blog_title_s_m' => null, 79 'blog_title_c_m' => null, 80 'post_title_w_m' => null, 81 'post_title_s_m' => null, 82 'post_title_c_m' => null 59 83 ); 60 84 … … 71 95 try 72 96 { 73 $ductile_user['body_link_w'] = (integer) !empty($_POST['body_link_w']);74 75 $ductile_user['body_link_v_c'] = adjustColor($_POST['body_link_v_c']);76 $ductile_user['body_link_f_c'] = adjustColor($_POST['body_link_f_c']);77 78 97 $ductile_user['body_font'] = $_POST['body_font']; 79 98 $ductile_user['alternate_font'] = $_POST['alternate_font']; 99 100 $ductile_user['blog_title_w'] = (integer) !empty($_POST['blog_title_w']); 101 $ductile_user['blog_title_s'] = adjustFontSize($_POST['blog_title_s']); 102 $ductile_user['blog_title_c'] = adjustColor($_POST['blog_title_c']); 103 104 $ductile_user['post_title_w'] = (integer) !empty($_POST['post_title_w']); 105 $ductile_user['post_title_s'] = adjustFontSize($_POST['post_title_s']); 106 $ductile_user['post_title_c'] = adjustColor($_POST['post_title_c']); 107 108 $ductile_user['post_link_w'] = (integer) !empty($_POST['post_link_w']); 109 $ductile_user['post_link_v_c'] = adjustColor($_POST['post_link_v_c']); 110 $ductile_user['post_link_f_c'] = adjustColor($_POST['post_link_f_c']); 111 112 $ductile_user['blog_title_w_m'] = (integer) !empty($_POST['blog_title_w_m']); 113 $ductile_user['blog_title_s_m'] = adjustFontSize($_POST['blog_title_s_m']); 114 $ductile_user['blog_title_c_m'] = adjustColor($_POST['blog_title_c_m']); 115 116 $ductile_user['post_title_w_m'] = (integer) !empty($_POST['post_title_w_m']); 117 $ductile_user['post_title_s_m'] = adjustFontSize($_POST['post_title_s_m']); 118 $ductile_user['post_title_c_m'] = adjustColor($_POST['post_title_c_m']); 80 119 81 120 $core->blog->settings->addNamespace('themes'); … … 94 133 } 95 134 135 echo '<h3>'.__('General settings').'</h3>'; 136 96 137 echo '<fieldset><legend>'.__('Fonts').'</legend>'. 97 138 '<p class="field"><label for="body_font">'.__('Main font:').' '. … … 102 143 '</fieldset>'; 103 144 145 echo '<div class="two-cols">'; 146 echo '<div class="col">'; 147 148 echo '<fieldset><legend>'.__('Blog title').'</legend>'. 149 '<p class="field"><label for="blog_title_w">'.__('Blog title in bold:').' '. 150 form::checkbox('blog_title_w',1,$ductile_user['blog_title_w']).'</label>'.'</p>'. 151 152 '<p class="field"><label for="blog_title_s">'.__('Blog title font size:').'</label> '. 153 form::field('blog_title_s',7,7,$ductile_user['blog_title_s']).' '.__('(in em by default)').'</p>'. 154 155 '<p class="field"><label for="blog_title_c">'.__('Blog title color:').'</label> '. 156 form::field('blog_title_c',7,7,$ductile_user['blog_title_c'],'colorpicker').'</p>'. 157 '</fieldset>'; 158 159 echo '</div>'; 160 echo '<div class="col">'; 161 162 echo '<fieldset><legend>'.__('Post title').'</legend>'. 163 '<p class="field"><label for="post_title_w">'.__('Post title in bold:').' '. 164 form::checkbox('post_title_w',1,$ductile_user['post_title_w']).'</label>'.'</p>'. 165 166 '<p class="field"><label for="post_title_s">'.__('Post title font size:').'</label> '. 167 form::field('post_title_s',7,7,$ductile_user['post_title_s']).' '.__('(in em by default)').'</p>'. 168 169 '<p class="field"><label for="post_title_c">'.__('Post title color:').'</label> '. 170 form::field('post_title_c',7,7,$ductile_user['post_title_c'],'colorpicker').'</p>'. 171 '</fieldset>'; 172 173 echo '</div>'; 174 echo '</div>'; 175 104 176 echo '<fieldset><legend>'.__('Inside posts links').'</legend>'. 105 '<p class="field"><label for=" body_link_w">'.__('Links in bold:').' '.106 form::checkbox(' body_link_w',1,$ductile_user['body_link_w']).'</label>'.'</p>'.107 108 '<p class="field"><label for=" body_link_v_c">'.__('Normal and visited links color:').'</label> '.109 form::field(' body_link_v_c',7,7,$ductile_user['body_link_v_c'],'colorpicker').'</p>'.177 '<p class="field"><label for="post_link_w">'.__('Links in bold:').' '. 178 form::checkbox('post_link_w',1,$ductile_user['post_link_w']).'</label>'.'</p>'. 179 180 '<p class="field"><label for="post_link_v_c">'.__('Normal and visited links color:').'</label> '. 181 form::field('post_link_v_c',7,7,$ductile_user['post_link_v_c'],'colorpicker').'</p>'. 110 182 111 183 '<p class="field"><label for="body_link_f_c">'.__('Active, hover and focus links color:').'</label> '. 112 form::field('body_link_f_c',7,7,$ductile_user['body_link_f_c'],'colorpicker').'</p>'. 113 '</fieldset>'; 184 form::field('post_link_f_c',7,7,$ductile_user['post_link_f_c'],'colorpicker').'</p>'. 185 '</fieldset>'; 186 187 echo '<h3>'.__('Mobile specific settings').'</h3>'; 188 189 echo '<div class="two-cols">'; 190 echo '<div class="col">'; 191 192 echo '<fieldset><legend>'.__('Blog title').'</legend>'. 193 '<p class="field"><label for="blog_title_w_m">'.__('Blog title in bold:').' '. 194 form::checkbox('blog_title_w_m',1,$ductile_user['blog_title_w_m']).'</label>'.'</p>'. 195 196 '<p class="field"><label for="blog_title_s_m">'.__('Blog title font size:').'</label> '. 197 form::field('blog_title_s_m',7,7,$ductile_user['blog_title_s_m']).' '.__('(in em by default)').'</p>'. 198 199 '<p class="field"><label for="blog_title_c_m">'.__('Blog title color:').'</label> '. 200 form::field('blog_title_c_m',7,7,$ductile_user['blog_title_c_m'],'colorpicker').'</p>'. 201 '</fieldset>'; 202 203 echo '</div>'; 204 echo '<div class="col">'; 205 206 echo '<fieldset><legend>'.__('Post title').'</legend>'. 207 '<p class="field"><label for="post_title_w_m">'.__('Post title in bold:').' '. 208 form::checkbox('post_title_w_m',1,$ductile_user['post_title_w_m']).'</label>'.'</p>'. 209 210 '<p class="field"><label for="post_title_s_m">'.__('Post title font size:').'</label> '. 211 form::field('post_title_s_m',7,7,$ductile_user['post_title_s_m']).' '.__('(in em by default)').'</p>'. 212 213 '<p class="field"><label for="post_title_c_m">'.__('Post title color:').'</label> '. 214 form::field('post_title_c_m',7,7,$ductile_user['post_title_c_m'],'colorpicker').'</p>'. 215 '</fieldset>'; 216 217 echo '</div>'; 218 echo '</div>'; 114 219 115 220 ?> -
themes/ductile/_public.php
r378 r387 44 44 45 45 # Main font 46 $ main_font_selectors = 'body, #supranav li a span, #comments.me, a.comment-number';47 if (isset($s['body_font'])) self::prop($css,$ main_font_selectors,'font-family',self::fontDef($s['body_font']));46 $selectors = 'body, #supranav li a span, #comments.me, a.comment-number'; 47 if (isset($s['body_font'])) self::prop($css,$selectors,'font-family',self::fontDef($s['body_font'])); 48 48 49 49 # Secondary font 50 $ alternate_font_selectors = '#blogdesc, #supranav, #content-info, #subcategories, #comments-feed, #sidebar h2, #sidebar h3, #footer p';51 if (isset($s['alternate_font'])) self::prop($css,$ alternate_font_selectors,'font-family',self::fontDef($s['alternate_font']));50 $selectors = '#blogdesc, #supranav, #content-info, #subcategories, #comments-feed, #sidebar h2, #sidebar h3, #footer p'; 51 if (isset($s['alternate_font'])) self::prop($css,$selectors,'font-family',self::fontDef($s['alternate_font'])); 52 52 53 53 # Inside posts links font weight 54 $ links = '.post-excerpt a, .post-content a';55 if (isset($s[' body_link_w'])) self::prop($css,$links,'font-weight',($s['body_link_w'] ? 'bold' : 'normal'));54 $selectors = '.post-excerpt a, .post-content a'; 55 if (isset($s['post_link_w'])) self::prop($css,$selectors,'font-weight',($s['post_link_w'] ? 'bold' : 'normal')); 56 56 57 57 # Inside posts links colors (normal, visited) 58 $ links_selectors = '.post-excerpt a:link, .post-excerpt a:visited, .post-content a:link, .post-content a:visited';59 if (isset($s[' body_link_v_c'])) self::prop($css,$links_selectors,'color',$s['body_link_v_c']);58 $selectors = '.post-excerpt a:link, .post-excerpt a:visited, .post-content a:link, .post-content a:visited'; 59 if (isset($s['post_link_v_c'])) self::prop($css,$selectors,'color',$s['post_link_v_c']); 60 60 61 61 # Inside posts links colors (hover, active, focus) 62 $ links_alternate_selectors = '.post-excerpt a:hover, .post-excerpt a:active, .post-excerpt a:focus, .post-content a:hover, .post-content a:active, .post-content a:focus';63 if (isset($s[' body_link_f_c'])) self::prop($css,$links_alternate_selectors,'color',$s['body_link_f_c']);62 $selectors = '.post-excerpt a:hover, .post-excerpt a:active, .post-excerpt a:focus, .post-content a:hover, .post-content a:active, .post-content a:focus'; 63 if (isset($s['post_link_f_c'])) self::prop($css,$selectors,'color',$s['post_link_f_c']); 64 64 65 65 # Style directives … … 73 73 } 74 74 75 # Large screens 76 $css_large = array(); 77 78 # Blog title font weight 79 $selectors = 'h1, h1 a:link, h1 a:visited, h1 a:hover, h1 a:visited, h1 a:focus'; 80 if (isset($s['blog_title_w'])) self::prop($css_large,$selectors,'font-weight',($s['blog_title_w'] ? 'bold' : 'normal')); 81 82 # Blog title font size 83 $selectors = 'h1'; 84 if (isset($s['blog_title_s'])) self::prop($css_large,$selectors,'font-size',$s['blog_title_s']); 85 86 # Blog title color 87 $selectors = 'h1 a:link, h1 a:visited, h1 a:hover, h1 a:visited, h1 a:focus'; 88 if (isset($s['blog_title_c'])) self::prop($css_large,$selectors,'color',$s['blog_title_c']); 89 90 # Post title font weight 91 $selectors = 'h2.post-title, h2.post-title a:link, h2.post-title a:visited, h2.post-title a:hover, h2.post-title a:visited, h2.post-title a:focus'; 92 if (isset($s['post_title_w'])) self::prop($css_large,$selectors,'font-weight',($s['post_title_w'] ? 'bold' : 'normal')); 93 94 # Post title font size 95 $selectors = 'h2.post-title'; 96 if (isset($s['post_title_s'])) self::prop($css_large,$selectors,'font-size',$s['post_title_s']); 97 98 # Post title color 99 $selectors = 'h2.post-title a:link, h2.post-title a:visited, h2.post-title a:hover, h2.post-title a:visited, h2.post-title a:focus'; 100 if (isset($s['post_title_c'])) self::prop($css_large,$selectors,'color',$s['post_title_c']); 101 102 # Style directives for large screens 103 if (count($css_large)) { 104 $res .= '@media only screen and (min-width: 481px) {'."\n"; 105 foreach ($css_large as $selector => $values) { 106 $res .= $selector." {\n"; 107 foreach ($values as $k => $v) { 108 $res .= $k.':'.$v.";\n"; 109 } 110 $res .= "}\n"; 111 } 112 $res .= "}\n"; 113 } 114 115 # Small screens 116 $css_small = array(); 117 118 # Blog title font weight 119 $selectors = 'h1, h1 a:link, h1 a:visited, h1 a:hover, h1 a:visited, h1 a:focus'; 120 if (isset($s['blog_title_w_m'])) self::prop($css_small,$selectors,'font-weight',($s['blog_title_w_m'] ? 'bold' : 'normal')); 121 122 # Blog title font size 123 $selectors = 'h1'; 124 if (isset($s['blog_title_s_m'])) self::prop($css_small,$selectors,'font-size',$s['blog_title_s_m']); 125 126 # Blog title color 127 $selectors = 'h1 a:link, h1 a:visited, h1 a:hover, h1 a:visited, h1 a:focus'; 128 if (isset($s['blog_title_c_m'])) self::prop($css_small,$selectors,'color',$s['blog_title_c_m']); 129 130 # Post title font weight 131 $selectors = 'h2.post-title, h2.post-title a:link, h2.post-title a:visited, h2.post-title a:hover, h2.post-title a:visited, h2.post-title a:focus'; 132 if (isset($s['post_title_w_m'])) self::prop($css_small,$selectors,'font-weight',($s['post_title_w_m'] ? 'bold' : 'normal')); 133 134 # Post title font size 135 $selectors = 'h2.post-title'; 136 if (isset($s['post_title_s_m'])) self::prop($css_small,$selectors,'font-size',$s['post_title_s_m']); 137 138 # Post title color 139 $selectors = 'h2.post-title a:link, h2.post-title a:visited, h2.post-title a:hover, h2.post-title a:visited, h2.post-title a:focus'; 140 if (isset($s['post_title_c_m'])) self::prop($css_small,$selectors,'color',$s['post_title_c_m']); 141 142 # Style directives for small screens 143 if (count($css_small)) { 144 $res .= '@media only screen and (max-width: 480px) {'."\n"; 145 foreach ($css_small as $selector => $values) { 146 $res .= $selector." {\n"; 147 foreach ($values as $k => $v) { 148 $res .= $k.':'.$v.";\n"; 149 } 150 $res .= "}\n"; 151 } 152 $res .= "}\n"; 153 } 154 75 155 return $res; 76 156 } -
themes/ductile/locales/fr/main.po
r378 r387 1 1 msgid "Style sheet upgraded." 2 2 msgstr "Feuille de style mise à jour." 3 4 msgid "General settings" 5 msgstr "Paramètres généraux" 6 7 msgid "Mobile specific settings" 8 msgstr "Paramètres spécifiques pour les mobiles" 9 10 msgid "Blog title" 11 msgstr "Titre du blog" 12 13 msgid "Blog title in bold:" 14 msgstr "Titre du blog en gras :" 15 16 msgid "Blog title font size:" 17 msgstr "Taille de police du titre du blog :" 18 19 msgid "(in em by default)" 20 msgstr "(en em par défaut)" 21 22 msgid "Blog title color:" 23 msgstr "Couleur du titre du blog :" 24 25 msgid "Post title" 26 msgstr "Titre des billets" 27 28 msgid "Post title in bold:" 29 msgstr "Titre des billets en gras :" 30 31 msgid "Post title font size:" 32 msgstr "Taille de police du titre des billets :" 33 34 msgid "Post title color:" 35 msgstr "Couleur du titre des billets :" 3 36 4 37 msgid "Links in bold:"
Note: See TracChangeset
for help on using the changeset viewer.