Dotclear

source: themes/ductile/_config.php @ 1008:b822eec98d46

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

Missing = between for and " in some label tags

RevLine 
[345]1<?php
2# -- BEGIN LICENSE BLOCK ---------------------------------------
[631]3# This file is part of Ductile, a theme for Dotclear
[345]4#
[631]5# Copyright (c) 2011 - Association Dotclear
[345]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
[421]13l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/admin');
[357]14
[832]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}
[604]20$img_path = dirname(__FILE__).'/img/';
21
[657]22$tpl_path = dirname(__FILE__).'/tpl/';
23
[611]24$standalone_config = (boolean) $core->themes->moduleInfo($core->blog->settings->system->theme,'standalone_config');
25
[563]26$list_types = array(
27     __('Title') => 'title',
28     __('Short') => 'short',
29     __('Full') => 'full'
30);
[657]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
[563]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'),
[564]54     'archive' => __('Month archive entries')
[563]55);
56
[376]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
[387]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
[656]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
[357]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
[653]135function computeContrastRatio($color,$background)
[649]136{
137     // Compute contrast ratio between two colors
138     
[653]139     $color = adjustColor($color);
140     if (($color == '') || (strlen($color) != 7)) return 0;
141     $background = adjustColor($background);
142     if (($background == '') || (strlen($background) != 7)) return 0;
[649]143     
[653]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));
[649]151
152     if ($l1 > $l2) {
[653]153          $ratio = ($l1 + 0.05) / ($l2 + 0.05);
[649]154     } else {
[653]155          $ratio = ($l2 + 0.05) / ($l1 + 0.05);
[649]156     }
[653]157     return $ratio;
[649]158}
159
[653]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 
[655]215               '<span style="position:absolute;top:0;left:23em;">'.
216               sprintf(__('ratio %.1f'),$ratio).
217               ($level != '' ? ' '.sprintf(__('(%s)'),$level) : '').
218               '</span>';
[649]219     }
220     return '';
221}
222
[357]223$ductile_base = array(
[389]224     // HTML
225     'subtitle_hidden' => null,
[810]226     'logo_src' => null,
[389]227     // CSS
[376]228     'body_font' => null,
[387]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,
[515]244     'post_title_c_m' => null,
245     'post_simple_title_c' => null
[357]246);
247
[563]248$ductile_lists_base = array(
[646]249     'default' => 'short',
250     'default-page' => 'short',
251     'category' => 'short',
252     'tag' => 'short',
253     'search' => 'short',
[667]254     'archive' => 'short'
[563]255);
256
[583]257$ductile_counts_base = array(
258     'default' => null,
259     'category' => null,
260     'tag' => null,
261     'search' => null
262);
263
[605]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
[614]286// If no stickers defined, add feed Atom one
287if (!is_array($ductile_stickers)) {
288     $ductile_stickers = array(array(
289          'label' => __('Subscribe'),
[776]290          'url' => $core->blog->url.
291               $core->url->getURLFor('feed','atom'),
[614]292          'image' => 'sticker-feed.png'
293          ));
294}
295
[605]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
[390]319$conf_tab = isset($_POST['conf_tab']) ? $_POST['conf_tab'] : 'html';
320
[357]321if (!empty($_POST))
322{
323     try
324     {
[389]325          # HTML
[390]326          if ($conf_tab == 'html') {
327               $ductile_user['subtitle_hidden'] = (integer) !empty($_POST['subtitle_hidden']);
[810]328               $ductile_user['logo_src'] = $_POST['logo_src'];
[605]329
[604]330               $ductile_stickers = array();
[605]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']
[604]352                         );
353                    }
[605]354                    $ductile_stickers = $new_ductile_stickers;
[419]355               }
[605]356               
[563]357               for ($i = 0; $i < count($_POST['list_type']); $i++) {
358                    $ductile_lists[$_POST['list_ctx'][$i]] = $_POST['list_type'][$i];
359               }
360               
[583]361               for ($i = 0; $i < count($_POST['count_nb']); $i++) {
362                    $ductile_counts[$_POST['count_ctx'][$i]] = $_POST['count_nb'][$i];
363               }
364               
[390]365          }
[389]366         
367          # CSS
[390]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']);
[389]375         
[390]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']);
[387]379         
[390]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']);
[387]383         
[515]384               $ductile_user['post_simple_title_c'] = adjustColor($_POST['post_simple_title_c']);
385         
[390]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']);
[387]389         
[390]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          }
[376]394         
[357]395          $core->blog->settings->addNamespace('themes');
[394]396          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_style',serialize($ductile_user));
[419]397          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_stickers',serialize($ductile_stickers));
[563]398          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_lists',serialize($ductile_lists));
[583]399          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_counts',serialize($ductile_counts));
[572]400
401          // Blog refresh
[357]402          $core->blog->triggerBlog();
403
[572]404          // Template cache reset
405          $core->emptyTemplatesCache();
406         
[357]407          echo
408          '<div class="message"><p>'.
[389]409          __('Theme configuration upgraded.').
[357]410          '</p></div>';
411     }
412     catch (Exception $e)
413     {
414          $core->error->add($e->getMessage());
415     }
416}
417
[613]418// Legacy mode
419if (!$standalone_config) echo '</form>';
420
[389]421# HTML Tab
422
[390]423echo '<div class="multi-part" id="themes-list'.($conf_tab == 'html' ? '' : '-html').'" title="'.__('Content').'">';
424
425echo '<form id="theme_config" action="blog_theme.php?conf=1" method="post" enctype="multipart/form-data">';
[389]426
427echo '<fieldset><legend>'.__('Header').'</legend>'.
428'<p class="field"><label for="subtitle_hidden">'.__('Hide blog description:').' '.
[612]429form::checkbox('subtitle_hidden',1,$ductile_user['subtitle_hidden']).'</label>'.'</p>';
430if ($core->plugins->moduleExists('simpleMenu'))
431{
432     echo '<p>'.sprintf(__('To configure the top menu go to the <a href="%s">Simple Menu administration page</a>.'),'plugin.php?p=simpleMenu').'</p>';
433}
[1008]434echo '<p class="field"><label for="logo_src">'.__('Logo URL:').' '.
[810]435     form::field('logo_src',40,255,$ductile_user['logo_src']).'</label>'.'</p>';
[612]436echo '</fieldset>';
[389]437
[425]438echo '<fieldset><legend>'.__('Stickers').'</legend>';
[419]439
[605]440echo '<table class="dragable">'.'<caption>'.__('Stickers (footer)').'</caption>'.
[419]441'<thead>'.
442'<tr>'.
[605]443'<th scope="col">'.'</th>'.
[604]444'<th scope="col">'.__('Image').'</th>'.
[419]445'<th scope="col">'.__('Label').'</th>'.
446'<th scope="col">'.__('URL').'</th>'.
447'</tr>'.
448'</thead>'.
[605]449'<tbody id="stickerslist">';
450$count = 0;
451foreach ($ductile_stickers as $i => $v) {
452     $count++;
[604]453     echo 
[605]454     '<tr class="line" id="l_'.$i.'">'.
455     '<td class="handle minimal">'.form::field(array('order['.$i.']'),2,3,$count,'position','',false).
456          form::hidden(array('dynorder[]','dynorder-'.$i),$i).'</td>'.
457     '<td>'.form::hidden(array('sticker_image[]'),$v['image']).'<img src="'.$img_url.$v['image'].'" /> '.'</td>'.
458     '<td scope="raw">'.form::field(array('sticker_label[]','dsl-'.$i),20,255,$v['label']).'</td>'.
459     '<td>'.form::field(array('sticker_url[]','dsu-'.$i),40,255,$v['url']).'</td>'.
[604]460     '</tr>';
461}
462echo
[419]463'</tbody>'.
464'</table>';
465
[425]466echo '</fieldset>';
[419]467
[583]468echo '<fieldset><legend>'.__('Entries list types and limits').'</legend>';
[563]469
470echo '<table id="entrieslist">'.'<caption>'.__('Entries lists').'</caption>'.
471'<thead>'.
472'<tr>'.
473'<th scope="col">'.__('Context').'</th>'.
474'<th scope="col">'.__('Entries list type').'</th>'.
[583]475'<th scope="col">'.__('Number of entries').'</th>'.
[563]476'</tr>'.
477'</thead>'.
478'<tbody>';
479foreach ($ductile_lists as $k => $v) {
480     echo 
481          '<tr>'.
482          '<td scope="raw">'.$contexts[$k].'</td>'.
[583]483          '<td>'.form::hidden(array('list_ctx[]'),$k).form::combo(array('list_type[]'),$list_types,$v).'</td>';
484     if (array_key_exists($k,$ductile_counts)) {
485          echo '<td>'.form::hidden(array('count_ctx[]'),$k).form::field(array('count_nb[]'),2,3,$ductile_counts[$k]).'</td>';
486     } else {
487          echo '<td></td>';
488     }
489     echo
[563]490          '</tr>';
491}
492echo
493'</tbody>'.
494'</table>';
495
496echo '</fieldset>';
497
[390]498echo '<input type="hidden" name="conf_tab" value="html">';
[605]499echo '<p class="clear">'.form::hidden('ds_order','').'<input type="submit" value="'.__('Save').'" />'.$core->formNonce().'</p>';
[390]500echo '</form>';
501
[389]502echo '</div>'; // Close tab
503
504# CSS tab
505
[390]506echo '<div class="multi-part" id="themes-list'.($conf_tab == 'css' ? '' : '-css').'" title="'.__('Presentation').'">';
507
508echo '<form id="theme_config" action="blog_theme.php?conf=1" method="post" enctype="multipart/form-data">';
[389]509
[387]510echo '<h3>'.__('General settings').'</h3>';
511
[376]512echo '<fieldset><legend>'.__('Fonts').'</legend>'.
[388]513'<p class="field"><label for="body_font">'.__('Main:').' '.
[656]514form::combo('body_font',$fonts,$ductile_user['body_font']).'</label>'.
515(!empty($ductile_user['body_font']) ? ' '.fontDef($ductile_user['body_font']) : '').
516'</p>'.
[376]517
[388]518'<p class="field"><label for="alternate_font">'.__('Secondary:').' '.
[656]519form::combo('alternate_font',$fonts,$ductile_user['alternate_font']).'</label>'.
520(!empty($ductile_user['alternate_font']) ? ' '.fontDef($ductile_user['alternate_font']) : '').
521'</p>'.
[376]522'</fieldset>';
523
[387]524echo '<div class="two-cols">';
525echo '<div class="col">';
526
527echo '<fieldset><legend>'.__('Blog title').'</legend>'.
[388]528'<p class="field"><label for="blog_title_w">'.__('In bold:').' '.
[387]529form::checkbox('blog_title_w',1,$ductile_user['blog_title_w']).'</label>'.'</p>'.
530
[395]531'<p class="field"><label for="blog_title_s">'.__('Font size (in em by default):').'</label> '.
532form::field('blog_title_s',7,7,$ductile_user['blog_title_s']).'</p>'.
[387]533
[389]534'<p class="field picker"><label for="blog_title_c">'.__('Color:').'</label> '.
[653]535form::field('blog_title_c',7,7,$ductile_user['blog_title_c'],'colorpicker').
536contrastRatio($ductile_user['blog_title_c'],'#ffffff',
537     (!empty($ductile_user['blog_title_s']) ? $ductile_user['blog_title_s'] : '2em'),
538     $ductile_user['blog_title_w']).
539'</p>'.
[387]540'</fieldset>';
541
542echo '</div>';
543echo '<div class="col">';
544
545echo '<fieldset><legend>'.__('Post title').'</legend>'.
[388]546'<p class="field"><label for="post_title_w">'.__('In bold:').' '.
[387]547form::checkbox('post_title_w',1,$ductile_user['post_title_w']).'</label>'.'</p>'.
548
[395]549'<p class="field"><label for="post_title_s">'.__('Font size (in em by default):').'</label> '.
550form::field('post_title_s',7,7,$ductile_user['post_title_s']).'</p>'.
[387]551
[389]552'<p class="field picker"><label for="post_title_c">'.__('Color:').'</label> '.
[653]553form::field('post_title_c',7,7,$ductile_user['post_title_c'],'colorpicker').
554contrastRatio($ductile_user['post_title_c'],'#ffffff',
555     (!empty($ductile_user['post_title_s']) ? $ductile_user['post_title_s'] : '2.5em'),
556     $ductile_user['post_title_w']).
557'</p>'.
[387]558'</fieldset>';
559
560echo '</div>';
561echo '</div>';
562
[515]563echo '<fieldset><legend>'.__('Titles without link').'</legend>'.
564
565'<p class="field picker"><label for="post_simple_title_c">'.__('Color:').'</label> '.
[653]566form::field('post_simple_title_c',7,7,$ductile_user['post_simple_title_c'],'colorpicker').
567contrastRatio($ductile_user['post_simple_title_c'],'#ffffff',
568     '1.1em',  // H5 minimum size
569     false).
570'</p>'.
[515]571'</fieldset>';
572
[378]573echo '<fieldset><legend>'.__('Inside posts links').'</legend>'.
[388]574'<p class="field"><label for="post_link_w">'.__('In bold:').' '.
[387]575form::checkbox('post_link_w',1,$ductile_user['post_link_w']).'</label>'.'</p>'.
[357]576
[389]577'<p class="field picker"><label for="post_link_v_c">'.__('Normal and visited links color:').'</label> '.
[653]578form::field('post_link_v_c',7,7,$ductile_user['post_link_v_c'],'colorpicker').
579contrastRatio($ductile_user['post_link_v_c'],'#ffffff',
580     '1em',
581     $ductile_user['post_link_w']).
582'</p>'.
[357]583
[648]584'<p class="field picker"><label for="post_link_f_c">'.__('Active, hover and focus links color:').'</label> '.
[653]585form::field('post_link_f_c',7,7,$ductile_user['post_link_f_c'],'colorpicker').
586contrastRatio($ductile_user['post_link_f_c'],'#ebebee',
587     '1em',
588     $ductile_user['post_link_w']).
589'</p>'.
[357]590'</fieldset>';
591
[387]592echo '<h3>'.__('Mobile specific settings').'</h3>';
593
594echo '<div class="two-cols">';
595echo '<div class="col">';
596
597echo '<fieldset><legend>'.__('Blog title').'</legend>'.
[388]598'<p class="field"><label for="blog_title_w_m">'.__('In bold:').' '.
[387]599form::checkbox('blog_title_w_m',1,$ductile_user['blog_title_w_m']).'</label>'.'</p>'.
600
[395]601'<p class="field"><label for="blog_title_s_m">'.__('Font size (in em by default):').'</label> '.
602form::field('blog_title_s_m',7,7,$ductile_user['blog_title_s_m']).'</p>'.
[387]603
[389]604'<p class="field picker"><label for="blog_title_c_m">'.__('Color:').'</label> '.
[653]605form::field('blog_title_c_m',7,7,$ductile_user['blog_title_c_m'],'colorpicker').
606contrastRatio($ductile_user['blog_title_c_m'],'#d7d7dc',
607     (!empty($ductile_user['blog_title_s_m']) ? $ductile_user['blog_title_s_m'] : '1.8em'),
608     $ductile_user['blog_title_w_m']).
609'</p>'.
[387]610'</fieldset>';
611
612echo '</div>';
613echo '<div class="col">';
614
615echo '<fieldset><legend>'.__('Post title').'</legend>'.
[388]616'<p class="field"><label for="post_title_w_m">'.__('In bold:').' '.
[387]617form::checkbox('post_title_w_m',1,$ductile_user['post_title_w_m']).'</label>'.'</p>'.
618
[395]619'<p class="field"><label for="post_title_s_m">'.__('Font size (in em by default):').'</label> '.
620form::field('post_title_s_m',7,7,$ductile_user['post_title_s_m']).'</p>'.
[387]621
[389]622'<p class="field picker"><label for="post_title_c_m">'.__('Color:').'</label> '.
[653]623form::field('post_title_c_m',7,7,$ductile_user['post_title_c_m'],'colorpicker').
624contrastRatio($ductile_user['post_title_c_m'],'#ffffff',
625     (!empty($ductile_user['post_title_s_m']) ? $ductile_user['post_title_s_m'] : '1.5em'),
626     $ductile_user['post_title_w_m']).
627'</p>'.
[387]628'</fieldset>';
629
630echo '</div>';
631echo '</div>';
632
[390]633echo '<input type="hidden" name="conf_tab" value="css">';
634echo '<p class="clear"><input type="submit" value="'.__('Save').'" />'.$core->formNonce().'</p>';
635echo '</form>';
636
[389]637echo '</div>'; // Close tab
638
[634]639dcPage::helpBlock('ductile');
640
[613]641// Legacy mode
642if (!$standalone_config) echo '<form style="display:none">';
[622]643?>
Note: See TracBrowser for help on using the repository browser.

Sites map