Dotclear

source: themes/ductile/_config.php @ 776:4ce635c0ca26

Revision 776:4ce635c0ca26, 20.6 KB checked in by Dsls <dsls@…>, 14 years ago (diff)

Last updates to getURLFor : removed blog url from function

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
[604]15$img_url = $core->blog->settings->system->themes_url.'/'.$core->blog->settings->system->theme.'/img/';
[627]16$img_url = http::concatURL($core->blog->url,$img_url);
[604]17$img_path = dirname(__FILE__).'/img/';
18
[657]19$tpl_path = dirname(__FILE__).'/tpl/';
20
[611]21$standalone_config = (boolean) $core->themes->moduleInfo($core->blog->settings->system->theme,'standalone_config');
22
[563]23$list_types = array(
24     __('Title') => 'title',
25     __('Short') => 'short',
26     __('Full') => 'full'
27);
[657]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
[563]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'),
[564]51     'archive' => __('Month archive entries')
[563]52);
53
[376]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
[387]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
[656]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
[357]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
[653]132function computeContrastRatio($color,$background)
[649]133{
134     // Compute contrast ratio between two colors
135     
[653]136     $color = adjustColor($color);
137     if (($color == '') || (strlen($color) != 7)) return 0;
138     $background = adjustColor($background);
139     if (($background == '') || (strlen($background) != 7)) return 0;
[649]140     
[653]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));
[649]148
149     if ($l1 > $l2) {
[653]150          $ratio = ($l1 + 0.05) / ($l2 + 0.05);
[649]151     } else {
[653]152          $ratio = ($l2 + 0.05) / ($l1 + 0.05);
[649]153     }
[653]154     return $ratio;
[649]155}
156
[653]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 
[655]212               '<span style="position:absolute;top:0;left:23em;">'.
213               sprintf(__('ratio %.1f'),$ratio).
214               ($level != '' ? ' '.sprintf(__('(%s)'),$level) : '').
215               '</span>';
[649]216     }
217     return '';
218}
219
[357]220$ductile_base = array(
[389]221     // HTML
222     'subtitle_hidden' => null,
223     // CSS
[376]224     'body_font' => null,
[387]225     'alternate_font' => null,
226     'blog_title_w' => null,
227     'blog_title_s' => null,
228     'blog_title_c' => null,
229     'post_title_w' => null,
230     'post_title_s' => null,
231     'post_title_c' => null,
232     'post_link_w' => null,
233     'post_link_v_c' => null,
234     'post_link_f_c' => null,
235     'blog_title_w_m' => null,
236     'blog_title_s_m' => null,
237     'blog_title_c_m' => null,
238     'post_title_w_m' => null,
239     'post_title_s_m' => null,
[515]240     'post_title_c_m' => null,
241     'post_simple_title_c' => null
[357]242);
243
[563]244$ductile_lists_base = array(
[646]245     'default' => 'short',
246     'default-page' => 'short',
247     'category' => 'short',
248     'tag' => 'short',
249     'search' => 'short',
[667]250     'archive' => 'short'
[563]251);
252
[583]253$ductile_counts_base = array(
254     'default' => null,
255     'category' => null,
256     'tag' => null,
257     'search' => null
258);
259
[605]260$ductile_user = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_style');
261$ductile_user = @unserialize($ductile_user);
262if (!is_array($ductile_user)) {
263     $ductile_user = array();
264}
265$ductile_user = array_merge($ductile_base,$ductile_user);
266
267$ductile_lists = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_lists');
268$ductile_lists = @unserialize($ductile_lists);
269if (!is_array($ductile_lists)) {
270     $ductile_lists = $ductile_lists_base;
271}
272
273$ductile_counts = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_counts');
274$ductile_counts = @unserialize($ductile_counts);
275if (!is_array($ductile_counts)) {
276     $ductile_counts = $ductile_counts_base;
277}
278
279$ductile_stickers = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_stickers');
280$ductile_stickers = @unserialize($ductile_stickers);
281
[614]282// If no stickers defined, add feed Atom one
283if (!is_array($ductile_stickers)) {
284     $ductile_stickers = array(array(
285          'label' => __('Subscribe'),
[776]286          'url' => $core->blog->url.
287               $core->url->getURLFor('feed','atom'),
[614]288          'image' => 'sticker-feed.png'
289          ));
290}
291
[605]292$ductile_stickers_full = array();
293// Get all sticker images already used
294if (is_array($ductile_stickers)) {
295     foreach ($ductile_stickers as $v) {
296          $ductile_stickers_full[] = $v['image'];
297     }
298}
299// Get all sticker-*.png in img folder of theme
300$ductile_stickers_images = files::scandir($img_path);
301if (is_array($ductile_stickers_images)) {
302     foreach ($ductile_stickers_images as $v) {
303          if (preg_match('/^sticker\-(.*)\.png$/',$v)) {
304               if (!in_array($v,$ductile_stickers_full)) {
305                    // image not already used
306                    $ductile_stickers[] = array(
307                         'label' => null,
308                         'url' => null,
309                         'image' => $v);
310               }
311          }
312     }
313}
314
[390]315$conf_tab = isset($_POST['conf_tab']) ? $_POST['conf_tab'] : 'html';
316
[357]317if (!empty($_POST))
318{
319     try
320     {
[389]321          # HTML
[390]322          if ($conf_tab == 'html') {
323               $ductile_user['subtitle_hidden'] = (integer) !empty($_POST['subtitle_hidden']);
[605]324
[604]325               $ductile_stickers = array();
[605]326               for ($i = 0; $i < count($_POST['sticker_image']); $i++) {
327                    $ductile_stickers[] = array(
328                         'label' => $_POST['sticker_label'][$i],
329                         'url' => $_POST['sticker_url'][$i],
330                         'image' => $_POST['sticker_image'][$i]
331                    );
332               }
333
334               $order = array();
335               if (empty($_POST['ds_order']) && !empty($_POST['order'])) {
336                    $order = $_POST['order'];
337                    asort($order);
338                    $order = array_keys($order);
339               }
340               if (!empty($order)) {
341                    $new_ductile_stickers = array();
342                    foreach ($order as $i => $k) {
343                         $new_ductile_stickers[] = array(
344                              'label' => $ductile_stickers[$k]['label'],
345                              'url' => $ductile_stickers[$k]['url'],
346                              'image' => $ductile_stickers[$k]['image']
[604]347                         );
348                    }
[605]349                    $ductile_stickers = $new_ductile_stickers;
[419]350               }
[605]351               
[563]352               for ($i = 0; $i < count($_POST['list_type']); $i++) {
353                    $ductile_lists[$_POST['list_ctx'][$i]] = $_POST['list_type'][$i];
354               }
355               
[583]356               for ($i = 0; $i < count($_POST['count_nb']); $i++) {
357                    $ductile_counts[$_POST['count_ctx'][$i]] = $_POST['count_nb'][$i];
358               }
359               
[390]360          }
[389]361         
362          # CSS
[390]363          if ($conf_tab == 'css') {
364               $ductile_user['body_font'] = $_POST['body_font'];
365               $ductile_user['alternate_font'] = $_POST['alternate_font'];
366
367               $ductile_user['blog_title_w'] = (integer) !empty($_POST['blog_title_w']);
368               $ductile_user['blog_title_s'] = adjustFontSize($_POST['blog_title_s']);
369               $ductile_user['blog_title_c'] = adjustColor($_POST['blog_title_c']);
[389]370         
[390]371               $ductile_user['post_title_w'] = (integer) !empty($_POST['post_title_w']);
372               $ductile_user['post_title_s'] = adjustFontSize($_POST['post_title_s']);
373               $ductile_user['post_title_c'] = adjustColor($_POST['post_title_c']);
[387]374         
[390]375               $ductile_user['post_link_w'] = (integer) !empty($_POST['post_link_w']);
376               $ductile_user['post_link_v_c'] = adjustColor($_POST['post_link_v_c']);
377               $ductile_user['post_link_f_c'] = adjustColor($_POST['post_link_f_c']);
[387]378         
[515]379               $ductile_user['post_simple_title_c'] = adjustColor($_POST['post_simple_title_c']);
380         
[390]381               $ductile_user['blog_title_w_m'] = (integer) !empty($_POST['blog_title_w_m']);
382               $ductile_user['blog_title_s_m'] = adjustFontSize($_POST['blog_title_s_m']);
383               $ductile_user['blog_title_c_m'] = adjustColor($_POST['blog_title_c_m']);
[387]384         
[390]385               $ductile_user['post_title_w_m'] = (integer) !empty($_POST['post_title_w_m']);
386               $ductile_user['post_title_s_m'] = adjustFontSize($_POST['post_title_s_m']);
387               $ductile_user['post_title_c_m'] = adjustColor($_POST['post_title_c_m']);
388          }
[376]389         
[357]390          $core->blog->settings->addNamespace('themes');
[394]391          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_style',serialize($ductile_user));
[419]392          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_stickers',serialize($ductile_stickers));
[563]393          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_lists',serialize($ductile_lists));
[583]394          $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_counts',serialize($ductile_counts));
[572]395
396          // Blog refresh
[357]397          $core->blog->triggerBlog();
398
[572]399          // Template cache reset
400          $core->emptyTemplatesCache();
401         
[357]402          echo
403          '<div class="message"><p>'.
[389]404          __('Theme configuration upgraded.').
[357]405          '</p></div>';
406     }
407     catch (Exception $e)
408     {
409          $core->error->add($e->getMessage());
410     }
411}
412
[613]413// Legacy mode
414if (!$standalone_config) echo '</form>';
415
[389]416# HTML Tab
417
[390]418echo '<div class="multi-part" id="themes-list'.($conf_tab == 'html' ? '' : '-html').'" title="'.__('Content').'">';
419
420echo '<form id="theme_config" action="blog_theme.php?conf=1" method="post" enctype="multipart/form-data">';
[389]421
422echo '<fieldset><legend>'.__('Header').'</legend>'.
423'<p class="field"><label for="subtitle_hidden">'.__('Hide blog description:').' '.
[612]424form::checkbox('subtitle_hidden',1,$ductile_user['subtitle_hidden']).'</label>'.'</p>';
425if ($core->plugins->moduleExists('simpleMenu'))
426{
427     echo '<p>'.sprintf(__('To configure the top menu go to the <a href="%s">Simple Menu administration page</a>.'),'plugin.php?p=simpleMenu').'</p>';
428}
429echo '</fieldset>';
[389]430
[425]431echo '<fieldset><legend>'.__('Stickers').'</legend>';
[419]432
[605]433echo '<table class="dragable">'.'<caption>'.__('Stickers (footer)').'</caption>'.
[419]434'<thead>'.
435'<tr>'.
[605]436'<th scope="col">'.'</th>'.
[604]437'<th scope="col">'.__('Image').'</th>'.
[419]438'<th scope="col">'.__('Label').'</th>'.
439'<th scope="col">'.__('URL').'</th>'.
440'</tr>'.
441'</thead>'.
[605]442'<tbody id="stickerslist">';
443$count = 0;
444foreach ($ductile_stickers as $i => $v) {
445     $count++;
[604]446     echo 
[605]447     '<tr class="line" id="l_'.$i.'">'.
448     '<td class="handle minimal">'.form::field(array('order['.$i.']'),2,3,$count,'position','',false).
449          form::hidden(array('dynorder[]','dynorder-'.$i),$i).'</td>'.
450     '<td>'.form::hidden(array('sticker_image[]'),$v['image']).'<img src="'.$img_url.$v['image'].'" /> '.'</td>'.
451     '<td scope="raw">'.form::field(array('sticker_label[]','dsl-'.$i),20,255,$v['label']).'</td>'.
452     '<td>'.form::field(array('sticker_url[]','dsu-'.$i),40,255,$v['url']).'</td>'.
[604]453     '</tr>';
454}
455echo
[419]456'</tbody>'.
457'</table>';
458
[425]459echo '</fieldset>';
[419]460
[583]461echo '<fieldset><legend>'.__('Entries list types and limits').'</legend>';
[563]462
463echo '<table id="entrieslist">'.'<caption>'.__('Entries lists').'</caption>'.
464'<thead>'.
465'<tr>'.
466'<th scope="col">'.__('Context').'</th>'.
467'<th scope="col">'.__('Entries list type').'</th>'.
[583]468'<th scope="col">'.__('Number of entries').'</th>'.
[563]469'</tr>'.
470'</thead>'.
471'<tbody>';
472foreach ($ductile_lists as $k => $v) {
473     echo 
474          '<tr>'.
475          '<td scope="raw">'.$contexts[$k].'</td>'.
[583]476          '<td>'.form::hidden(array('list_ctx[]'),$k).form::combo(array('list_type[]'),$list_types,$v).'</td>';
477     if (array_key_exists($k,$ductile_counts)) {
478          echo '<td>'.form::hidden(array('count_ctx[]'),$k).form::field(array('count_nb[]'),2,3,$ductile_counts[$k]).'</td>';
479     } else {
480          echo '<td></td>';
481     }
482     echo
[563]483          '</tr>';
484}
485echo
486'</tbody>'.
487'</table>';
488
489echo '</fieldset>';
490
[390]491echo '<input type="hidden" name="conf_tab" value="html">';
[605]492echo '<p class="clear">'.form::hidden('ds_order','').'<input type="submit" value="'.__('Save').'" />'.$core->formNonce().'</p>';
[390]493echo '</form>';
494
[389]495echo '</div>'; // Close tab
496
497# CSS tab
498
[390]499echo '<div class="multi-part" id="themes-list'.($conf_tab == 'css' ? '' : '-css').'" title="'.__('Presentation').'">';
500
501echo '<form id="theme_config" action="blog_theme.php?conf=1" method="post" enctype="multipart/form-data">';
[389]502
[387]503echo '<h3>'.__('General settings').'</h3>';
504
[376]505echo '<fieldset><legend>'.__('Fonts').'</legend>'.
[388]506'<p class="field"><label for="body_font">'.__('Main:').' '.
[656]507form::combo('body_font',$fonts,$ductile_user['body_font']).'</label>'.
508(!empty($ductile_user['body_font']) ? ' '.fontDef($ductile_user['body_font']) : '').
509'</p>'.
[376]510
[388]511'<p class="field"><label for="alternate_font">'.__('Secondary:').' '.
[656]512form::combo('alternate_font',$fonts,$ductile_user['alternate_font']).'</label>'.
513(!empty($ductile_user['alternate_font']) ? ' '.fontDef($ductile_user['alternate_font']) : '').
514'</p>'.
[376]515'</fieldset>';
516
[387]517echo '<div class="two-cols">';
518echo '<div class="col">';
519
520echo '<fieldset><legend>'.__('Blog title').'</legend>'.
[388]521'<p class="field"><label for="blog_title_w">'.__('In bold:').' '.
[387]522form::checkbox('blog_title_w',1,$ductile_user['blog_title_w']).'</label>'.'</p>'.
523
[395]524'<p class="field"><label for="blog_title_s">'.__('Font size (in em by default):').'</label> '.
525form::field('blog_title_s',7,7,$ductile_user['blog_title_s']).'</p>'.
[387]526
[389]527'<p class="field picker"><label for="blog_title_c">'.__('Color:').'</label> '.
[653]528form::field('blog_title_c',7,7,$ductile_user['blog_title_c'],'colorpicker').
529contrastRatio($ductile_user['blog_title_c'],'#ffffff',
530     (!empty($ductile_user['blog_title_s']) ? $ductile_user['blog_title_s'] : '2em'),
531     $ductile_user['blog_title_w']).
532'</p>'.
[387]533'</fieldset>';
534
535echo '</div>';
536echo '<div class="col">';
537
538echo '<fieldset><legend>'.__('Post title').'</legend>'.
[388]539'<p class="field"><label for="post_title_w">'.__('In bold:').' '.
[387]540form::checkbox('post_title_w',1,$ductile_user['post_title_w']).'</label>'.'</p>'.
541
[395]542'<p class="field"><label for="post_title_s">'.__('Font size (in em by default):').'</label> '.
543form::field('post_title_s',7,7,$ductile_user['post_title_s']).'</p>'.
[387]544
[389]545'<p class="field picker"><label for="post_title_c">'.__('Color:').'</label> '.
[653]546form::field('post_title_c',7,7,$ductile_user['post_title_c'],'colorpicker').
547contrastRatio($ductile_user['post_title_c'],'#ffffff',
548     (!empty($ductile_user['post_title_s']) ? $ductile_user['post_title_s'] : '2.5em'),
549     $ductile_user['post_title_w']).
550'</p>'.
[387]551'</fieldset>';
552
553echo '</div>';
554echo '</div>';
555
[515]556echo '<fieldset><legend>'.__('Titles without link').'</legend>'.
557
558'<p class="field picker"><label for="post_simple_title_c">'.__('Color:').'</label> '.
[653]559form::field('post_simple_title_c',7,7,$ductile_user['post_simple_title_c'],'colorpicker').
560contrastRatio($ductile_user['post_simple_title_c'],'#ffffff',
561     '1.1em',  // H5 minimum size
562     false).
563'</p>'.
[515]564'</fieldset>';
565
[378]566echo '<fieldset><legend>'.__('Inside posts links').'</legend>'.
[388]567'<p class="field"><label for="post_link_w">'.__('In bold:').' '.
[387]568form::checkbox('post_link_w',1,$ductile_user['post_link_w']).'</label>'.'</p>'.
[357]569
[389]570'<p class="field picker"><label for="post_link_v_c">'.__('Normal and visited links color:').'</label> '.
[653]571form::field('post_link_v_c',7,7,$ductile_user['post_link_v_c'],'colorpicker').
572contrastRatio($ductile_user['post_link_v_c'],'#ffffff',
573     '1em',
574     $ductile_user['post_link_w']).
575'</p>'.
[357]576
[648]577'<p class="field picker"><label for="post_link_f_c">'.__('Active, hover and focus links color:').'</label> '.
[653]578form::field('post_link_f_c',7,7,$ductile_user['post_link_f_c'],'colorpicker').
579contrastRatio($ductile_user['post_link_f_c'],'#ebebee',
580     '1em',
581     $ductile_user['post_link_w']).
582'</p>'.
[357]583'</fieldset>';
584
[387]585echo '<h3>'.__('Mobile specific settings').'</h3>';
586
587echo '<div class="two-cols">';
588echo '<div class="col">';
589
590echo '<fieldset><legend>'.__('Blog title').'</legend>'.
[388]591'<p class="field"><label for="blog_title_w_m">'.__('In bold:').' '.
[387]592form::checkbox('blog_title_w_m',1,$ductile_user['blog_title_w_m']).'</label>'.'</p>'.
593
[395]594'<p class="field"><label for="blog_title_s_m">'.__('Font size (in em by default):').'</label> '.
595form::field('blog_title_s_m',7,7,$ductile_user['blog_title_s_m']).'</p>'.
[387]596
[389]597'<p class="field picker"><label for="blog_title_c_m">'.__('Color:').'</label> '.
[653]598form::field('blog_title_c_m',7,7,$ductile_user['blog_title_c_m'],'colorpicker').
599contrastRatio($ductile_user['blog_title_c_m'],'#d7d7dc',
600     (!empty($ductile_user['blog_title_s_m']) ? $ductile_user['blog_title_s_m'] : '1.8em'),
601     $ductile_user['blog_title_w_m']).
602'</p>'.
[387]603'</fieldset>';
604
605echo '</div>';
606echo '<div class="col">';
607
608echo '<fieldset><legend>'.__('Post title').'</legend>'.
[388]609'<p class="field"><label for="post_title_w_m">'.__('In bold:').' '.
[387]610form::checkbox('post_title_w_m',1,$ductile_user['post_title_w_m']).'</label>'.'</p>'.
611
[395]612'<p class="field"><label for="post_title_s_m">'.__('Font size (in em by default):').'</label> '.
613form::field('post_title_s_m',7,7,$ductile_user['post_title_s_m']).'</p>'.
[387]614
[389]615'<p class="field picker"><label for="post_title_c_m">'.__('Color:').'</label> '.
[653]616form::field('post_title_c_m',7,7,$ductile_user['post_title_c_m'],'colorpicker').
617contrastRatio($ductile_user['post_title_c_m'],'#ffffff',
618     (!empty($ductile_user['post_title_s_m']) ? $ductile_user['post_title_s_m'] : '1.5em'),
619     $ductile_user['post_title_w_m']).
620'</p>'.
[387]621'</fieldset>';
622
623echo '</div>';
624echo '</div>';
625
[390]626echo '<input type="hidden" name="conf_tab" value="css">';
627echo '<p class="clear"><input type="submit" value="'.__('Save').'" />'.$core->formNonce().'</p>';
628echo '</form>';
629
[389]630echo '</div>'; // Close tab
631
[634]632dcPage::helpBlock('ductile');
633
[613]634// Legacy mode
635if (!$standalone_config) echo '<form style="display:none">';
[622]636?>
Note: See TracBrowser for help on using the repository browser.

Sites map