Dotclear

source: themes/ductile/_config.php @ 2003:32293b4d2aa1

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

Sites map