Dotclear

source: themes/ductile/_config.php @ 3731:3770620079d4

Revision 3731:3770620079d4, 24.2 KB checked in by franck <carnet.franck.paul@…>, 8 years ago (diff)

Simplify licence block at the beginning of each file

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

Sites map