Dotclear

source: themes/ductile/_config.php @ 810:143528f926c6

Revision 810:143528f926c6, 20.8 KB checked in by franck <carnet.franck.paul@…>, 13 years ago (diff)

Ductile theme 1.1 : Add optional logo URL in configuration. A media selector should be nice but I don't know how to implement it, until now.

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

Sites map