Dotclear

source: themes/ductile/_config.php @ 656:897d6fcceb43

Revision 656:897d6fcceb43, 20.2 KB checked in by Franck <carnet.franck.paul@…>, 14 years ago (diff)

Affichage de la famille de police sélectionnée

Line 
1<?php
2# -- BEGIN LICENSE BLOCK ---------------------------------------
3# This file is part of Ductile, a theme for Dotclear
4#
5# Copyright (c) 2011 - Association Dotclear
6# Licensed under the GPL version 2.0 license.
7# See LICENSE file or
8# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
9#
10# -- END LICENSE BLOCK -----------------------------------------
11if (!defined('DC_CONTEXT_ADMIN')) { return; }
12
13l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/admin');
14
15$img_url = $core->blog->settings->system->themes_url.'/'.$core->blog->settings->system->theme.'/img/';
16$img_url = http::concatURL($core->blog->url,$img_url);
17$img_path = dirname(__FILE__).'/img/';
18
19$standalone_config = (boolean) $core->themes->moduleInfo($core->blog->settings->system->theme,'standalone_config');
20
21$list_types = array(
22     __('Title') => 'title',
23     __('Short') => 'short',
24     __('Full') => 'full'
25);
26
27$contexts = array(
28     'default' => __('Home (first page)'),
29     'default-page' => __('Home (other pages)'),
30     'category' => __('Entries for a category'),
31     'tag' => __('Entries for a tag'),
32     'search' => __('Search result entries'),
33     'archive' => __('Month archive entries')
34);
35
36$fonts = array(
37     __('default') => '',
38     __('Ductile primary') => 'Ductile body',
39     __('Ductile secondary') => 'Ductile alternate',
40     __('Times New Roman') => 'Times New Roman',
41     __('Georgia') => 'Georgia',
42     __('Garamond') => 'Garamond',
43     __('Helvetica/Arial') => 'Helvetica/Arial',
44     __('Verdana') => 'Verdana',
45     __('Trebuchet MS') => 'Trebuchet MS',
46     __('Impact') => 'Impact',
47     __('Monospace') => 'Monospace'
48);
49
50function adjustFontSize($s)
51{
52     if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex)?$/',$s,$m)) {
53          if (empty($m[2])) {
54               $m[2] = 'em';
55          }
56          return $m[1].$m[2];
57     }
58
59     return null;
60}
61
62$font_families = array(
63     // Theme standard
64     'Ductile body' => '"Century Schoolbook", "Century Schoolbook L", Georgia, serif',
65     'Ductile alternate' => '"Franklin gothic medium", "arial narrow", "DejaVu Sans Condensed", "helvetica neue", helvetica, sans-serif',
66
67     // Serif families
68     'Times New Roman' => 'Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif',
69     'Georgia' => 'Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif',
70     'Garamond' => '"Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif',
71
72     // Sans-serif families
73     'Helvetica/Arial' => 'Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif',
74     'Verdana' => 'Corbel, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", "Bitstream Vera Sans", "Liberation Sans", Verdana, "Verdana Ref", sans-serif',
75     'Trebuchet MS' => '"Segoe UI", Candara, "Bitstream Vera Sans", "DejaVu Sans", "Bitstream Vera Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans-serif',
76
77     // Cursive families
78     'Impact' => 'Impact, Haettenschweiler, "Franklin Gothic Bold", Charcoal, "Helvetica Inserat", "Bitstream Vera Sans Bold", "Arial Black", sans-serif',
79
80     // Monospace families
81     'Monospace' => 'Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace'
82);
83
84function fontDef($c)
85{
86     global $font_families;
87     
88     return isset($font_families[$c]) ? '<span style="position:absolute;top:0;left:32em;">'.$font_families[$c].'</span>' : '';
89}
90
91function adjustColor($c)
92{
93     if ($c === '') {
94          return '';
95     }
96
97     $c = strtoupper($c);
98
99     if (preg_match('/^[A-F0-9]{3,6}$/',$c)) {
100          $c = '#'.$c;
101     }
102
103     if (preg_match('/^#[A-F0-9]{6}$/',$c)) {
104          return $c;
105     }
106
107     if (preg_match('/^#[A-F0-9]{3,}$/',$c)) {
108          return '#'.substr($c,1,1).substr($c,1,1).substr($c,2,1).substr($c,2,1).substr($c,3,1).substr($c,3,1);
109     }
110
111     return '';
112}
113
114function computeContrastRatio($color,$background)
115{
116     // Compute contrast ratio between two colors
117     
118     $color = adjustColor($color);
119     if (($color == '') || (strlen($color) != 7)) return 0;
120     $background = adjustColor($background);
121     if (($background == '') || (strlen($background) != 7)) return 0;
122     
123     $l1 = (0.2126 * pow(hexdec(substr($color,1,2))/255,2.2)) +
124          (0.7152 * pow(hexdec(substr($color,3,2))/255,2.2)) +
125          (0.0722 * pow(hexdec(substr($color,5,2))/255,2.2));
126
127     $l2 = (0.2126 * pow(hexdec(substr($background,1,2))/255,2.2)) +
128          (0.7152 * pow(hexdec(substr($background,3,2))/255,2.2)) +
129          (0.0722 * pow(hexdec(substr($background,5,2))/255,2.2));
130
131     if ($l1 > $l2) {
132          $ratio = ($l1 + 0.05) / ($l2 + 0.05);
133     } else {
134          $ratio = ($l2 + 0.05) / ($l1 + 0.05);
135     }
136     return $ratio;
137}
138
139function contrastRatioLevel($ratio,$size,$bold)
140{
141     if ($size == '') {
142          return '';
143     }
144
145     // Eval font size in em (assume base font size in pixels equal to 16)
146     if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex)?$/',$size,$m)) {
147          if (empty($m[2])) {
148               $m[2] = 'em';
149          }
150     } else {
151          return '';
152     }
153     switch ($m[2]) {
154          case '%':
155               $s = (float) $m[1] / 100;
156               break;
157          case 'pt':
158               $s = (float) $m[1] / 12;
159               break;
160          case 'px':
161               $s = (float) $m[1] / 16;
162               break;
163          case 'em':
164               $s = (float) $m[1];
165               break;
166          case 'ex':
167               $s = (float) $m[1] / 2;
168               break;
169          default:
170               return '';
171     }
172
173     $large = ((($s > 1.5) && ($bold == false)) || (($s > 1.2) && ($bold == true)));
174     
175     // Check ratio
176     if ($ratio > 7) {
177          return 'AAA';
178     } elseif (($ratio > 4.5) && $large) {
179          return 'AAA';
180     } elseif ($ratio > 4.5) {
181          return 'AA';
182     } elseif (($ratio > 3) && $large) {
183          return 'AA';
184     }
185     return '';
186}
187
188function contrastRatio($color,$background,$size='',$bold=false)
189{
190     if (($color != '') && ($background != '')) {
191          $ratio = computeContrastRatio($color,$background);
192          $level = contrastRatioLevel($ratio,$size,$bold);
193          return 
194               '<span style="position:absolute;top:0;left:23em;">'.
195               sprintf(__('ratio %.1f'),$ratio).
196               ($level != '' ? ' '.sprintf(__('(%s)'),$level) : '').
197               '</span>';
198     }
199     return '';
200}
201
202$ductile_base = array(
203     // HTML
204     'subtitle_hidden' => null,
205     // CSS
206     'body_font' => null,
207     'alternate_font' => null,
208     'blog_title_w' => null,
209     'blog_title_s' => null,
210     'blog_title_c' => null,
211     'post_title_w' => null,
212     'post_title_s' => null,
213     'post_title_c' => null,
214     'post_link_w' => null,
215     'post_link_v_c' => null,
216     'post_link_f_c' => null,
217     'blog_title_w_m' => null,
218     'blog_title_s_m' => null,
219     'blog_title_c_m' => null,
220     'post_title_w_m' => null,
221     'post_title_s_m' => null,
222     'post_title_c_m' => null,
223     'post_simple_title_c' => null
224);
225
226$ductile_lists_base = array(
227     'default' => 'short',
228     'default-page' => 'short',
229     'category' => 'short',
230     'tag' => 'short',
231     'search' => 'short',
232     'archive' => 'title'
233);
234
235$ductile_counts_base = array(
236     'default' => null,
237     'category' => null,
238     'tag' => null,
239     'search' => null
240);
241
242$ductile_user = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_style');
243$ductile_user = @unserialize($ductile_user);
244if (!is_array($ductile_user)) {
245     $ductile_user = array();
246}
247$ductile_user = array_merge($ductile_base,$ductile_user);
248
249$ductile_lists = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_lists');
250$ductile_lists = @unserialize($ductile_lists);
251if (!is_array($ductile_lists)) {
252     $ductile_lists = $ductile_lists_base;
253}
254
255$ductile_counts = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_counts');
256$ductile_counts = @unserialize($ductile_counts);
257if (!is_array($ductile_counts)) {
258     $ductile_counts = $ductile_counts_base;
259}
260
261$ductile_stickers = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_stickers');
262$ductile_stickers = @unserialize($ductile_stickers);
263
264// If no stickers defined, add feed Atom one
265if (!is_array($ductile_stickers)) {
266     $ductile_stickers = array(array(
267          'label' => __('Subscribe'),
268          'url' => $core->blog->url.$core->url->getBase('feed').'/atom',
269          'image' => 'sticker-feed.png'
270          ));
271}
272
273$ductile_stickers_full = array();
274// Get all sticker images already used
275if (is_array($ductile_stickers)) {
276     foreach ($ductile_stickers as $v) {
277          $ductile_stickers_full[] = $v['image'];
278     }
279}
280// Get all sticker-*.png in img folder of theme
281$ductile_stickers_images = files::scandir($img_path);
282if (is_array($ductile_stickers_images)) {
283     foreach ($ductile_stickers_images as $v) {
284          if (preg_match('/^sticker\-(.*)\.png$/',$v)) {
285               if (!in_array($v,$ductile_stickers_full)) {
286                    // image not already used
287                    $ductile_stickers[] = array(
288                         'label' => null,
289                         'url' => null,
290                         'image' => $v);
291               }
292          }
293     }
294}
295
296$conf_tab = isset($_POST['conf_tab']) ? $_POST['conf_tab'] : 'html';
297
298if (!empty($_POST))
299{
300     try
301     {
302          # HTML
303          if ($conf_tab == 'html') {
304               $ductile_user['subtitle_hidden'] = (integer) !empty($_POST['subtitle_hidden']);
305
306               $ductile_stickers = array();
307               for ($i = 0; $i < count($_POST['sticker_image']); $i++) {
308                    $ductile_stickers[] = array(
309                         'label' => $_POST['sticker_label'][$i],
310                         'url' => $_POST['sticker_url'][$i],
311                         'image' => $_POST['sticker_image'][$i]
312                    );
313               }
314
315               $order = array();
316               if (empty($_POST['ds_order']) && !empty($_POST['order'])) {
317                    $order = $_POST['order'];
318                    asort($order);
319                    $order = array_keys($order);
320               }
321               if (!empty($order)) {
322                    $new_ductile_stickers = array();
323                    foreach ($order as $i => $k) {
324                         $new_ductile_stickers[] = array(
325                              'label' => $ductile_stickers[$k]['label'],
326                              'url' => $ductile_stickers[$k]['url'],
327                              'image' => $ductile_stickers[$k]['image']
328                         );
329                    }
330                    $ductile_stickers = $new_ductile_stickers;
331               }
332               
333               for ($i = 0; $i < count($_POST['list_type']); $i++) {
334                    $ductile_lists[$_POST['list_ctx'][$i]] = $_POST['list_type'][$i];
335               }
336               
337               for ($i = 0; $i < count($_POST['count_nb']); $i++) {
338                    $ductile_counts[$_POST['count_ctx'][$i]] = $_POST['count_nb'][$i];
339               }
340               
341          }
342         
343          # CSS
344          if ($conf_tab == 'css') {
345               $ductile_user['body_font'] = $_POST['body_font'];
346               $ductile_user['alternate_font'] = $_POST['alternate_font'];
347
348               $ductile_user['blog_title_w'] = (integer) !empty($_POST['blog_title_w']);
349               $ductile_user['blog_title_s'] = adjustFontSize($_POST['blog_title_s']);
350               $ductile_user['blog_title_c'] = adjustColor($_POST['blog_title_c']);
351         
352               $ductile_user['post_title_w'] = (integer) !empty($_POST['post_title_w']);
353               $ductile_user['post_title_s'] = adjustFontSize($_POST['post_title_s']);
354               $ductile_user['post_title_c'] = adjustColor($_POST['post_title_c']);
355         
356               $ductile_user['post_link_w'] = (integer) !empty($_POST['post_link_w']);
357               $ductile_user['post_link_v_c'] = adjustColor($_POST['post_link_v_c']);
358               $ductile_user['post_link_f_c'] = adjustColor($_POST['post_link_f_c']);
359         
360               $ductile_user['post_simple_title_c'] = adjustColor($_POST['post_simple_title_c']);
361         
362               $ductile_user['blog_title_w_m'] = (integer) !empty($_POST['blog_title_w_m']);
363               $ductile_user['blog_title_s_m'] = adjustFontSize($_POST['blog_title_s_m']);
364               $ductile_user['blog_title_c_m'] = adjustColor($_POST['blog_title_c_m']);
365         
366               $ductile_user['post_title_w_m'] = (integer) !empty($_POST['post_title_w_m']);
367               $ductile_user['post_title_s_m'] = adjustFontSize($_POST['post_title_s_m']);
368               $ductile_user['post_title_c_m'] = adjustColor($_POST['post_title_c_m']);
369          }
370         
371          $core->blog->settings->addNamespace('themes');
372          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_style',serialize($ductile_user));
373          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_stickers',serialize($ductile_stickers));
374          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_lists',serialize($ductile_lists));
375          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_counts',serialize($ductile_counts));
376
377          // Blog refresh
378          $core->blog->triggerBlog();
379
380          // Template cache reset
381          $core->emptyTemplatesCache();
382         
383          echo
384          '<div class="message"><p>'.
385          __('Theme configuration upgraded.').
386          '</p></div>';
387     }
388     catch (Exception $e)
389     {
390          $core->error->add($e->getMessage());
391     }
392}
393
394// Legacy mode
395if (!$standalone_config) echo '</form>';
396
397# HTML Tab
398
399echo '<div class="multi-part" id="themes-list'.($conf_tab == 'html' ? '' : '-html').'" title="'.__('Content').'">';
400
401echo '<form id="theme_config" action="blog_theme.php?conf=1" method="post" enctype="multipart/form-data">';
402
403echo '<fieldset><legend>'.__('Header').'</legend>'.
404'<p class="field"><label for="subtitle_hidden">'.__('Hide blog description:').' '.
405form::checkbox('subtitle_hidden',1,$ductile_user['subtitle_hidden']).'</label>'.'</p>';
406if ($core->plugins->moduleExists('simpleMenu'))
407{
408     echo '<p>'.sprintf(__('To configure the top menu go to the <a href="%s">Simple Menu administration page</a>.'),'plugin.php?p=simpleMenu').'</p>';
409}
410echo '</fieldset>';
411
412echo '<fieldset><legend>'.__('Stickers').'</legend>';
413
414echo '<table class="dragable">'.'<caption>'.__('Stickers (footer)').'</caption>'.
415'<thead>'.
416'<tr>'.
417'<th scope="col">'.'</th>'.
418'<th scope="col">'.__('Image').'</th>'.
419'<th scope="col">'.__('Label').'</th>'.
420'<th scope="col">'.__('URL').'</th>'.
421'</tr>'.
422'</thead>'.
423'<tbody id="stickerslist">';
424$count = 0;
425foreach ($ductile_stickers as $i => $v) {
426     $count++;
427     echo 
428     '<tr class="line" id="l_'.$i.'">'.
429     '<td class="handle minimal">'.form::field(array('order['.$i.']'),2,3,$count,'position','',false).
430          form::hidden(array('dynorder[]','dynorder-'.$i),$i).'</td>'.
431     '<td>'.form::hidden(array('sticker_image[]'),$v['image']).'<img src="'.$img_url.$v['image'].'" /> '.'</td>'.
432     '<td scope="raw">'.form::field(array('sticker_label[]','dsl-'.$i),20,255,$v['label']).'</td>'.
433     '<td>'.form::field(array('sticker_url[]','dsu-'.$i),40,255,$v['url']).'</td>'.
434     '</tr>';
435}
436echo
437'</tbody>'.
438'</table>';
439
440echo '</fieldset>';
441
442echo '<fieldset><legend>'.__('Entries list types and limits').'</legend>';
443
444echo '<table id="entrieslist">'.'<caption>'.__('Entries lists').'</caption>'.
445'<thead>'.
446'<tr>'.
447'<th scope="col">'.__('Context').'</th>'.
448'<th scope="col">'.__('Entries list type').'</th>'.
449'<th scope="col">'.__('Number of entries').'</th>'.
450'</tr>'.
451'</thead>'.
452'<tbody>';
453foreach ($ductile_lists as $k => $v) {
454     echo 
455          '<tr>'.
456          '<td scope="raw">'.$contexts[$k].'</td>'.
457          '<td>'.form::hidden(array('list_ctx[]'),$k).form::combo(array('list_type[]'),$list_types,$v).'</td>';
458     if (array_key_exists($k,$ductile_counts)) {
459          echo '<td>'.form::hidden(array('count_ctx[]'),$k).form::field(array('count_nb[]'),2,3,$ductile_counts[$k]).'</td>';
460     } else {
461          echo '<td></td>';
462     }
463     echo
464          '</tr>';
465}
466echo
467'</tbody>'.
468'</table>';
469
470echo '</fieldset>';
471
472echo '<input type="hidden" name="conf_tab" value="html">';
473echo '<p class="clear">'.form::hidden('ds_order','').'<input type="submit" value="'.__('Save').'" />'.$core->formNonce().'</p>';
474echo '</form>';
475
476echo '</div>'; // Close tab
477
478# CSS tab
479
480echo '<div class="multi-part" id="themes-list'.($conf_tab == 'css' ? '' : '-css').'" title="'.__('Presentation').'">';
481
482echo '<form id="theme_config" action="blog_theme.php?conf=1" method="post" enctype="multipart/form-data">';
483
484echo '<h3>'.__('General settings').'</h3>';
485
486echo '<fieldset><legend>'.__('Fonts').'</legend>'.
487'<p class="field"><label for="body_font">'.__('Main:').' '.
488form::combo('body_font',$fonts,$ductile_user['body_font']).'</label>'.
489(!empty($ductile_user['body_font']) ? ' '.fontDef($ductile_user['body_font']) : '').
490'</p>'.
491
492'<p class="field"><label for="alternate_font">'.__('Secondary:').' '.
493form::combo('alternate_font',$fonts,$ductile_user['alternate_font']).'</label>'.
494(!empty($ductile_user['alternate_font']) ? ' '.fontDef($ductile_user['alternate_font']) : '').
495'</p>'.
496'</fieldset>';
497
498echo '<div class="two-cols">';
499echo '<div class="col">';
500
501echo '<fieldset><legend>'.__('Blog title').'</legend>'.
502'<p class="field"><label for="blog_title_w">'.__('In bold:').' '.
503form::checkbox('blog_title_w',1,$ductile_user['blog_title_w']).'</label>'.'</p>'.
504
505'<p class="field"><label for="blog_title_s">'.__('Font size (in em by default):').'</label> '.
506form::field('blog_title_s',7,7,$ductile_user['blog_title_s']).'</p>'.
507
508'<p class="field picker"><label for="blog_title_c">'.__('Color:').'</label> '.
509form::field('blog_title_c',7,7,$ductile_user['blog_title_c'],'colorpicker').
510contrastRatio($ductile_user['blog_title_c'],'#ffffff',
511     (!empty($ductile_user['blog_title_s']) ? $ductile_user['blog_title_s'] : '2em'),
512     $ductile_user['blog_title_w']).
513'</p>'.
514'</fieldset>';
515
516echo '</div>';
517echo '<div class="col">';
518
519echo '<fieldset><legend>'.__('Post title').'</legend>'.
520'<p class="field"><label for="post_title_w">'.__('In bold:').' '.
521form::checkbox('post_title_w',1,$ductile_user['post_title_w']).'</label>'.'</p>'.
522
523'<p class="field"><label for="post_title_s">'.__('Font size (in em by default):').'</label> '.
524form::field('post_title_s',7,7,$ductile_user['post_title_s']).'</p>'.
525
526'<p class="field picker"><label for="post_title_c">'.__('Color:').'</label> '.
527form::field('post_title_c',7,7,$ductile_user['post_title_c'],'colorpicker').
528contrastRatio($ductile_user['post_title_c'],'#ffffff',
529     (!empty($ductile_user['post_title_s']) ? $ductile_user['post_title_s'] : '2.5em'),
530     $ductile_user['post_title_w']).
531'</p>'.
532'</fieldset>';
533
534echo '</div>';
535echo '</div>';
536
537echo '<fieldset><legend>'.__('Titles without link').'</legend>'.
538
539'<p class="field picker"><label for="post_simple_title_c">'.__('Color:').'</label> '.
540form::field('post_simple_title_c',7,7,$ductile_user['post_simple_title_c'],'colorpicker').
541contrastRatio($ductile_user['post_simple_title_c'],'#ffffff',
542     '1.1em',  // H5 minimum size
543     false).
544'</p>'.
545'</fieldset>';
546
547echo '<fieldset><legend>'.__('Inside posts links').'</legend>'.
548'<p class="field"><label for="post_link_w">'.__('In bold:').' '.
549form::checkbox('post_link_w',1,$ductile_user['post_link_w']).'</label>'.'</p>'.
550
551'<p class="field picker"><label for="post_link_v_c">'.__('Normal and visited links color:').'</label> '.
552form::field('post_link_v_c',7,7,$ductile_user['post_link_v_c'],'colorpicker').
553contrastRatio($ductile_user['post_link_v_c'],'#ffffff',
554     '1em',
555     $ductile_user['post_link_w']).
556'</p>'.
557
558'<p class="field picker"><label for="post_link_f_c">'.__('Active, hover and focus links color:').'</label> '.
559form::field('post_link_f_c',7,7,$ductile_user['post_link_f_c'],'colorpicker').
560contrastRatio($ductile_user['post_link_f_c'],'#ebebee',
561     '1em',
562     $ductile_user['post_link_w']).
563'</p>'.
564'</fieldset>';
565
566echo '<h3>'.__('Mobile specific settings').'</h3>';
567
568echo '<div class="two-cols">';
569echo '<div class="col">';
570
571echo '<fieldset><legend>'.__('Blog title').'</legend>'.
572'<p class="field"><label for="blog_title_w_m">'.__('In bold:').' '.
573form::checkbox('blog_title_w_m',1,$ductile_user['blog_title_w_m']).'</label>'.'</p>'.
574
575'<p class="field"><label for="blog_title_s_m">'.__('Font size (in em by default):').'</label> '.
576form::field('blog_title_s_m',7,7,$ductile_user['blog_title_s_m']).'</p>'.
577
578'<p class="field picker"><label for="blog_title_c_m">'.__('Color:').'</label> '.
579form::field('blog_title_c_m',7,7,$ductile_user['blog_title_c_m'],'colorpicker').
580contrastRatio($ductile_user['blog_title_c_m'],'#d7d7dc',
581     (!empty($ductile_user['blog_title_s_m']) ? $ductile_user['blog_title_s_m'] : '1.8em'),
582     $ductile_user['blog_title_w_m']).
583'</p>'.
584'</fieldset>';
585
586echo '</div>';
587echo '<div class="col">';
588
589echo '<fieldset><legend>'.__('Post title').'</legend>'.
590'<p class="field"><label for="post_title_w_m">'.__('In bold:').' '.
591form::checkbox('post_title_w_m',1,$ductile_user['post_title_w_m']).'</label>'.'</p>'.
592
593'<p class="field"><label for="post_title_s_m">'.__('Font size (in em by default):').'</label> '.
594form::field('post_title_s_m',7,7,$ductile_user['post_title_s_m']).'</p>'.
595
596'<p class="field picker"><label for="post_title_c_m">'.__('Color:').'</label> '.
597form::field('post_title_c_m',7,7,$ductile_user['post_title_c_m'],'colorpicker').
598contrastRatio($ductile_user['post_title_c_m'],'#ffffff',
599     (!empty($ductile_user['post_title_s_m']) ? $ductile_user['post_title_s_m'] : '1.5em'),
600     $ductile_user['post_title_w_m']).
601'</p>'.
602'</fieldset>';
603
604echo '</div>';
605echo '</div>';
606
607echo '<input type="hidden" name="conf_tab" value="css">';
608echo '<p class="clear"><input type="submit" value="'.__('Save').'" />'.$core->formNonce().'</p>';
609echo '</form>';
610
611echo '</div>'; // Close tab
612
613dcPage::helpBlock('ductile');
614
615// Legacy mode
616if (!$standalone_config) echo '<form style="display:none">';
617?>
Note: See TracBrowser for help on using the repository browser.

Sites map