Dotclear

source: themes/ductile/_config.php @ 1011:c8f32ed1ca5c

Revision 1011:c8f32ed1ca5c, 21.0 KB checked in by franck <carnet.franck.paul@…>, 13 years ago (diff)

Remerge default branche and lasts commits

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
15if (preg_match('#^http(s)?://#',$core->blog->settings->system->themes_url)) {
16     $img_url = http::concatURL($core->blog->settings->system->themes_url,'/'.$core->blog->settings->system->theme.'/img/');
17} else {
18     $img_url = http::concatURL($core->blog->url,$core->blog->settings->system->themes_url.'/'.$core->blog->settings->system->theme.'/img/');
19}
20$img_path = dirname(__FILE__).'/img/';
21
22$tpl_path = dirname(__FILE__).'/tpl/';
23
24$standalone_config = (boolean) $core->themes->moduleInfo($core->blog->settings->system->theme,'standalone_config');
25
26$list_types = array(
27     __('Title') => 'title',
28     __('Short') => 'short',
29     __('Full') => 'full'
30);
31// Get all _entry-*.html in tpl folder of theme
32$list_types_templates = files::scandir($tpl_path);
33if (is_array($list_types_templates)) {
34     foreach ($list_types_templates as $v) {
35          if (preg_match('/^_entry\-(.*)\.html$/',$v,$m)) {
36               if (isset($m[1])) {
37                    if (!in_array($m[1],$list_types)) {
38                         // template not already in full list
39                         $list_types[__($m[1])] = $m[1];
40                    }
41               }
42          }
43     }
44}
45
46
47
48$contexts = array(
49     'default' => __('Home (first page)'),
50     'default-page' => __('Home (other pages)'),
51     'category' => __('Entries for a category'),
52     'tag' => __('Entries for a tag'),
53     'search' => __('Search result entries'),
54     'archive' => __('Month archive entries')
55);
56
57$fonts = array(
58     __('default') => '',
59     __('Ductile primary') => 'Ductile body',
60     __('Ductile secondary') => 'Ductile alternate',
61     __('Times New Roman') => 'Times New Roman',
62     __('Georgia') => 'Georgia',
63     __('Garamond') => 'Garamond',
64     __('Helvetica/Arial') => 'Helvetica/Arial',
65     __('Verdana') => 'Verdana',
66     __('Trebuchet MS') => 'Trebuchet MS',
67     __('Impact') => 'Impact',
68     __('Monospace') => 'Monospace'
69);
70
71function adjustFontSize($s)
72{
73     if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex)?$/',$s,$m)) {
74          if (empty($m[2])) {
75               $m[2] = 'em';
76          }
77          return $m[1].$m[2];
78     }
79
80     return null;
81}
82
83$font_families = array(
84     // Theme standard
85     'Ductile body' => '"Century Schoolbook", "Century Schoolbook L", Georgia, serif',
86     'Ductile alternate' => '"Franklin gothic medium", "arial narrow", "DejaVu Sans Condensed", "helvetica neue", helvetica, sans-serif',
87
88     // Serif families
89     'Times New Roman' => 'Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif',
90     'Georgia' => 'Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif',
91     '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',
92
93     // Sans-serif families
94     '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',
95     'Verdana' => 'Corbel, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", "Bitstream Vera Sans", "Liberation Sans", Verdana, "Verdana Ref", sans-serif',
96     'Trebuchet MS' => '"Segoe UI", Candara, "Bitstream Vera Sans", "DejaVu Sans", "Bitstream Vera Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans-serif',
97
98     // Cursive families
99     'Impact' => 'Impact, Haettenschweiler, "Franklin Gothic Bold", Charcoal, "Helvetica Inserat", "Bitstream Vera Sans Bold", "Arial Black", sans-serif',
100
101     // Monospace families
102     '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'
103);
104
105function fontDef($c)
106{
107     global $font_families;
108     
109     return isset($font_families[$c]) ? '<span style="position:absolute;top:0;left:32em;">'.$font_families[$c].'</span>' : '';
110}
111
112function adjustColor($c)
113{
114     if ($c === '') {
115          return '';
116     }
117
118     $c = strtoupper($c);
119
120     if (preg_match('/^[A-F0-9]{3,6}$/',$c)) {
121          $c = '#'.$c;
122     }
123
124     if (preg_match('/^#[A-F0-9]{6}$/',$c)) {
125          return $c;
126     }
127
128     if (preg_match('/^#[A-F0-9]{3,}$/',$c)) {
129          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);
130     }
131
132     return '';
133}
134
135function computeContrastRatio($color,$background)
136{
137     // Compute contrast ratio between two colors
138     
139     $color = adjustColor($color);
140     if (($color == '') || (strlen($color) != 7)) return 0;
141     $background = adjustColor($background);
142     if (($background == '') || (strlen($background) != 7)) return 0;
143     
144     $l1 = (0.2126 * pow(hexdec(substr($color,1,2))/255,2.2)) +
145          (0.7152 * pow(hexdec(substr($color,3,2))/255,2.2)) +
146          (0.0722 * pow(hexdec(substr($color,5,2))/255,2.2));
147
148     $l2 = (0.2126 * pow(hexdec(substr($background,1,2))/255,2.2)) +
149          (0.7152 * pow(hexdec(substr($background,3,2))/255,2.2)) +
150          (0.0722 * pow(hexdec(substr($background,5,2))/255,2.2));
151
152     if ($l1 > $l2) {
153          $ratio = ($l1 + 0.05) / ($l2 + 0.05);
154     } else {
155          $ratio = ($l2 + 0.05) / ($l1 + 0.05);
156     }
157     return $ratio;
158}
159
160function contrastRatioLevel($ratio,$size,$bold)
161{
162     if ($size == '') {
163          return '';
164     }
165
166     // Eval font size in em (assume base font size in pixels equal to 16)
167     if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex)?$/',$size,$m)) {
168          if (empty($m[2])) {
169               $m[2] = 'em';
170          }
171     } else {
172          return '';
173     }
174     switch ($m[2]) {
175          case '%':
176               $s = (float) $m[1] / 100;
177               break;
178          case 'pt':
179               $s = (float) $m[1] / 12;
180               break;
181          case 'px':
182               $s = (float) $m[1] / 16;
183               break;
184          case 'em':
185               $s = (float) $m[1];
186               break;
187          case 'ex':
188               $s = (float) $m[1] / 2;
189               break;
190          default:
191               return '';
192     }
193
194     $large = ((($s > 1.5) && ($bold == false)) || (($s > 1.2) && ($bold == true)));
195     
196     // Check ratio
197     if ($ratio > 7) {
198          return 'AAA';
199     } elseif (($ratio > 4.5) && $large) {
200          return 'AAA';
201     } elseif ($ratio > 4.5) {
202          return 'AA';
203     } elseif (($ratio > 3) && $large) {
204          return 'AA';
205     }
206     return '';
207}
208
209function contrastRatio($color,$background,$size='',$bold=false)
210{
211     if (($color != '') && ($background != '')) {
212          $ratio = computeContrastRatio($color,$background);
213          $level = contrastRatioLevel($ratio,$size,$bold);
214          return 
215               '<span style="position:absolute;top:0;left:23em;">'.
216               sprintf(__('ratio %.1f'),$ratio).
217               ($level != '' ? ' '.sprintf(__('(%s)'),$level) : '').
218               '</span>';
219     }
220     return '';
221}
222
223$ductile_base = array(
224     // HTML
225     'subtitle_hidden' => null,
226     'logo_src' => null,
227     // CSS
228     'body_font' => null,
229     'alternate_font' => null,
230     'blog_title_w' => null,
231     'blog_title_s' => null,
232     'blog_title_c' => null,
233     'post_title_w' => null,
234     'post_title_s' => null,
235     'post_title_c' => null,
236     'post_link_w' => null,
237     'post_link_v_c' => null,
238     'post_link_f_c' => null,
239     'blog_title_w_m' => null,
240     'blog_title_s_m' => null,
241     'blog_title_c_m' => null,
242     'post_title_w_m' => null,
243     'post_title_s_m' => null,
244     'post_title_c_m' => null,
245     'post_simple_title_c' => null
246);
247
248$ductile_lists_base = array(
249     'default' => 'short',
250     'default-page' => 'short',
251     'category' => 'short',
252     'tag' => 'short',
253     'search' => 'short',
254     'archive' => 'short'
255);
256
257$ductile_counts_base = array(
258     'default' => null,
259     'category' => null,
260     'tag' => null,
261     'search' => null
262);
263
264$ductile_user = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_style');
265$ductile_user = @unserialize($ductile_user);
266if (!is_array($ductile_user)) {
267     $ductile_user = array();
268}
269$ductile_user = array_merge($ductile_base,$ductile_user);
270
271$ductile_lists = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_lists');
272$ductile_lists = @unserialize($ductile_lists);
273if (!is_array($ductile_lists)) {
274     $ductile_lists = $ductile_lists_base;
275}
276
277$ductile_counts = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_counts');
278$ductile_counts = @unserialize($ductile_counts);
279if (!is_array($ductile_counts)) {
280     $ductile_counts = $ductile_counts_base;
281}
282
283$ductile_stickers = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_stickers');
284$ductile_stickers = @unserialize($ductile_stickers);
285
286// If no stickers defined, add feed Atom one
287if (!is_array($ductile_stickers)) {
288     $ductile_stickers = array(array(
289          'label' => __('Subscribe'),
290          'url' => $core->blog->url.
291               $core->url->getURLFor('feed','atom'),
292          'image' => 'sticker-feed.png'
293          ));
294}
295
296$ductile_stickers_full = array();
297// Get all sticker images already used
298if (is_array($ductile_stickers)) {
299     foreach ($ductile_stickers as $v) {
300          $ductile_stickers_full[] = $v['image'];
301     }
302}
303// Get all sticker-*.png in img folder of theme
304$ductile_stickers_images = files::scandir($img_path);
305if (is_array($ductile_stickers_images)) {
306     foreach ($ductile_stickers_images as $v) {
307          if (preg_match('/^sticker\-(.*)\.png$/',$v)) {
308               if (!in_array($v,$ductile_stickers_full)) {
309                    // image not already used
310                    $ductile_stickers[] = array(
311                         'label' => null,
312                         'url' => null,
313                         'image' => $v);
314               }
315          }
316     }
317}
318
319$conf_tab = isset($_POST['conf_tab']) ? $_POST['conf_tab'] : 'html';
320
321if (!empty($_POST))
322{
323     try
324     {
325          # HTML
326          if ($conf_tab == 'html') {
327               $ductile_user['subtitle_hidden'] = (integer) !empty($_POST['subtitle_hidden']);
328               $ductile_user['logo_src'] = $_POST['logo_src'];
329
330               $ductile_stickers = array();
331               for ($i = 0; $i < count($_POST['sticker_image']); $i++) {
332                    $ductile_stickers[] = array(
333                         'label' => $_POST['sticker_label'][$i],
334                         'url' => $_POST['sticker_url'][$i],
335                         'image' => $_POST['sticker_image'][$i]
336                    );
337               }
338
339               $order = array();
340               if (empty($_POST['ds_order']) && !empty($_POST['order'])) {
341                    $order = $_POST['order'];
342                    asort($order);
343                    $order = array_keys($order);
344               }
345               if (!empty($order)) {
346                    $new_ductile_stickers = array();
347                    foreach ($order as $i => $k) {
348                         $new_ductile_stickers[] = array(
349                              'label' => $ductile_stickers[$k]['label'],
350                              'url' => $ductile_stickers[$k]['url'],
351                              'image' => $ductile_stickers[$k]['image']
352                         );
353                    }
354                    $ductile_stickers = $new_ductile_stickers;
355               }
356               
357               for ($i = 0; $i < count($_POST['list_type']); $i++) {
358                    $ductile_lists[$_POST['list_ctx'][$i]] = $_POST['list_type'][$i];
359               }
360               
361               for ($i = 0; $i < count($_POST['count_nb']); $i++) {
362                    $ductile_counts[$_POST['count_ctx'][$i]] = $_POST['count_nb'][$i];
363               }
364               
365          }
366         
367          # CSS
368          if ($conf_tab == 'css') {
369               $ductile_user['body_font'] = $_POST['body_font'];
370               $ductile_user['alternate_font'] = $_POST['alternate_font'];
371
372               $ductile_user['blog_title_w'] = (integer) !empty($_POST['blog_title_w']);
373               $ductile_user['blog_title_s'] = adjustFontSize($_POST['blog_title_s']);
374               $ductile_user['blog_title_c'] = adjustColor($_POST['blog_title_c']);
375         
376               $ductile_user['post_title_w'] = (integer) !empty($_POST['post_title_w']);
377               $ductile_user['post_title_s'] = adjustFontSize($_POST['post_title_s']);
378               $ductile_user['post_title_c'] = adjustColor($_POST['post_title_c']);
379         
380               $ductile_user['post_link_w'] = (integer) !empty($_POST['post_link_w']);
381               $ductile_user['post_link_v_c'] = adjustColor($_POST['post_link_v_c']);
382               $ductile_user['post_link_f_c'] = adjustColor($_POST['post_link_f_c']);
383         
384               $ductile_user['post_simple_title_c'] = adjustColor($_POST['post_simple_title_c']);
385         
386               $ductile_user['blog_title_w_m'] = (integer) !empty($_POST['blog_title_w_m']);
387               $ductile_user['blog_title_s_m'] = adjustFontSize($_POST['blog_title_s_m']);
388               $ductile_user['blog_title_c_m'] = adjustColor($_POST['blog_title_c_m']);
389         
390               $ductile_user['post_title_w_m'] = (integer) !empty($_POST['post_title_w_m']);
391               $ductile_user['post_title_s_m'] = adjustFontSize($_POST['post_title_s_m']);
392               $ductile_user['post_title_c_m'] = adjustColor($_POST['post_title_c_m']);
393          }
394         
395          $core->blog->settings->addNamespace('themes');
396          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_style',serialize($ductile_user));
397          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_stickers',serialize($ductile_stickers));
398          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_lists',serialize($ductile_lists));
399          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_counts',serialize($ductile_counts));
400
401          // Blog refresh
402          $core->blog->triggerBlog();
403
404          // Template cache reset
405          $core->emptyTemplatesCache();
406         
407          dcPage::message(__('Theme configuration upgraded.'),true,true);
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