| 1 | <?php | 
|---|
| 2 | # -- BEGIN LICENSE BLOCK --------------------------------------- | 
|---|
| 3 | # | 
|---|
| 4 | # This file is part of Dotclear 2. | 
|---|
| 5 | # | 
|---|
| 6 | # Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear | 
|---|
| 7 | # Licensed under the GPL version 2.0 license. | 
|---|
| 8 | # See LICENSE file or | 
|---|
| 9 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | 
|---|
| 10 | # | 
|---|
| 11 | # -- END LICENSE BLOCK ----------------------------------------- | 
|---|
| 12 | if (!defined('DC_CONTEXT_ADMIN')) { return; } | 
|---|
| 13 |  | 
|---|
| 14 | l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/admin'); | 
|---|
| 15 |  | 
|---|
| 16 | $img_url = $core->blog->settings->system->themes_url.'/'.$core->blog->settings->system->theme.'/img/'; | 
|---|
| 17 | $img_path = dirname(__FILE__).'/img/'; | 
|---|
| 18 |  | 
|---|
| 19 | $standalone_config = (boolean) $core->themes->moduleInfo($core->blog->settings->system->theme,'standalone_config'); | 
|---|
| 20 |  | 
|---|
| 21 | $list_types = array( | 
|---|
| 22 |      __('Title') => 'title', | 
|---|
| 23 |      __('Short') => 'short', | 
|---|
| 24 |      __('Full') => 'full' | 
|---|
| 25 | ); | 
|---|
| 26 |  | 
|---|
| 27 | $contexts = array( | 
|---|
| 28 |      'default' => __('Home (first page)'), | 
|---|
| 29 |      'default-page' => __('Home (other pages)'), | 
|---|
| 30 |      'category' => __('Entries for a category'), | 
|---|
| 31 |      'tag' => __('Entries for a tag'), | 
|---|
| 32 |      'search' => __('Search result entries'), | 
|---|
| 33 |      'archive' => __('Month archive entries') | 
|---|
| 34 | ); | 
|---|
| 35 |  | 
|---|
| 36 | $fonts = array( | 
|---|
| 37 |      __('default') => '', | 
|---|
| 38 |      __('Ductile primary') => 'Ductile body', | 
|---|
| 39 |      __('Ductile secondary') => 'Ductile alternate', | 
|---|
| 40 |      __('Times New Roman') => 'Times New Roman', | 
|---|
| 41 |      __('Georgia') => 'Georgia', | 
|---|
| 42 |      __('Garamond') => 'Garamond', | 
|---|
| 43 |      __('Helvetica/Arial') => 'Helvetica/Arial', | 
|---|
| 44 |      __('Verdana') => 'Verdana', | 
|---|
| 45 |      __('Trebuchet MS') => 'Trebuchet MS', | 
|---|
| 46 |      __('Impact') => 'Impact', | 
|---|
| 47 |      __('Monospace') => 'Monospace' | 
|---|
| 48 | ); | 
|---|
| 49 |  | 
|---|
| 50 | function adjustFontSize($s) | 
|---|
| 51 | { | 
|---|
| 52 |      if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex)?$/',$s,$m)) { | 
|---|
| 53 |           if (empty($m[2])) { | 
|---|
| 54 |                $m[2] = 'em'; | 
|---|
| 55 |           } | 
|---|
| 56 |           return $m[1].$m[2]; | 
|---|
| 57 |      } | 
|---|
| 58 |  | 
|---|
| 59 |      return null; | 
|---|
| 60 | } | 
|---|
| 61 |  | 
|---|
| 62 | function adjustColor($c) | 
|---|
| 63 | { | 
|---|
| 64 |      if ($c === '') { | 
|---|
| 65 |           return ''; | 
|---|
| 66 |      } | 
|---|
| 67 |  | 
|---|
| 68 |      $c = strtoupper($c); | 
|---|
| 69 |  | 
|---|
| 70 |      if (preg_match('/^[A-F0-9]{3,6}$/',$c)) { | 
|---|
| 71 |           $c = '#'.$c; | 
|---|
| 72 |      } | 
|---|
| 73 |  | 
|---|
| 74 |      if (preg_match('/^#[A-F0-9]{6}$/',$c)) { | 
|---|
| 75 |           return $c; | 
|---|
| 76 |      } | 
|---|
| 77 |  | 
|---|
| 78 |      if (preg_match('/^#[A-F0-9]{3,}$/',$c)) { | 
|---|
| 79 |           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); | 
|---|
| 80 |      } | 
|---|
| 81 |  | 
|---|
| 82 |      return ''; | 
|---|
| 83 | } | 
|---|
| 84 |  | 
|---|
| 85 | $ductile_base = array( | 
|---|
| 86 |      // HTML | 
|---|
| 87 |      'subtitle_hidden' => null, | 
|---|
| 88 |      // CSS | 
|---|
| 89 |      'body_font' => null, | 
|---|
| 90 |      'alternate_font' => null, | 
|---|
| 91 |      'blog_title_w' => null, | 
|---|
| 92 |      'blog_title_s' => null, | 
|---|
| 93 |      'blog_title_c' => null, | 
|---|
| 94 |      'post_title_w' => null, | 
|---|
| 95 |      'post_title_s' => null, | 
|---|
| 96 |      'post_title_c' => null, | 
|---|
| 97 |      'post_link_w' => null, | 
|---|
| 98 |      'post_link_v_c' => null, | 
|---|
| 99 |      'post_link_f_c' => null, | 
|---|
| 100 |      'blog_title_w_m' => null, | 
|---|
| 101 |      'blog_title_s_m' => null, | 
|---|
| 102 |      'blog_title_c_m' => null, | 
|---|
| 103 |      'post_title_w_m' => null, | 
|---|
| 104 |      'post_title_s_m' => null, | 
|---|
| 105 |      'post_title_c_m' => null, | 
|---|
| 106 |      'post_simple_title_c' => null | 
|---|
| 107 | ); | 
|---|
| 108 |  | 
|---|
| 109 | $ductile_lists_base = array( | 
|---|
| 110 |      'default' => null, | 
|---|
| 111 |      'default-page' => null, | 
|---|
| 112 |      'category' => null, | 
|---|
| 113 |      'tag' => null, | 
|---|
| 114 |      'search' => null, | 
|---|
| 115 |      'archive' => null | 
|---|
| 116 | ); | 
|---|
| 117 |  | 
|---|
| 118 | $ductile_counts_base = array( | 
|---|
| 119 |      'default' => null, | 
|---|
| 120 |      'category' => null, | 
|---|
| 121 |      'tag' => null, | 
|---|
| 122 |      'search' => null | 
|---|
| 123 | ); | 
|---|
| 124 |  | 
|---|
| 125 | $ductile_user = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_style'); | 
|---|
| 126 | $ductile_user = @unserialize($ductile_user); | 
|---|
| 127 | if (!is_array($ductile_user)) { | 
|---|
| 128 |      $ductile_user = array(); | 
|---|
| 129 | } | 
|---|
| 130 | $ductile_user = array_merge($ductile_base,$ductile_user); | 
|---|
| 131 |  | 
|---|
| 132 | $ductile_lists = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_lists'); | 
|---|
| 133 | $ductile_lists = @unserialize($ductile_lists); | 
|---|
| 134 | if (!is_array($ductile_lists)) { | 
|---|
| 135 |      $ductile_lists = $ductile_lists_base; | 
|---|
| 136 | } | 
|---|
| 137 |  | 
|---|
| 138 | $ductile_counts = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_entries_counts'); | 
|---|
| 139 | $ductile_counts = @unserialize($ductile_counts); | 
|---|
| 140 | if (!is_array($ductile_counts)) { | 
|---|
| 141 |      $ductile_counts = $ductile_counts_base; | 
|---|
| 142 | } | 
|---|
| 143 |  | 
|---|
| 144 | $ductile_stickers = $core->blog->settings->themes->get($core->blog->settings->system->theme.'_stickers'); | 
|---|
| 145 | $ductile_stickers = @unserialize($ductile_stickers); | 
|---|
| 146 |  | 
|---|
| 147 | $ductile_stickers_full = array(); | 
|---|
| 148 | // Get all sticker images already used | 
|---|
| 149 | if (is_array($ductile_stickers)) { | 
|---|
| 150 |      foreach ($ductile_stickers as $v) { | 
|---|
| 151 |           $ductile_stickers_full[] = $v['image']; | 
|---|
| 152 |      } | 
|---|
| 153 | } | 
|---|
| 154 | // Get all sticker-*.png in img folder of theme | 
|---|
| 155 | $ductile_stickers_images = files::scandir($img_path); | 
|---|
| 156 | if (is_array($ductile_stickers_images)) { | 
|---|
| 157 |      foreach ($ductile_stickers_images as $v) { | 
|---|
| 158 |           if (preg_match('/^sticker\-(.*)\.png$/',$v)) { | 
|---|
| 159 |                if (!in_array($v,$ductile_stickers_full)) { | 
|---|
| 160 |                     // image not already used | 
|---|
| 161 |                     $ductile_stickers[] = array( | 
|---|
| 162 |                          'label' => null, | 
|---|
| 163 |                          'url' => null, | 
|---|
| 164 |                          'image' => $v); | 
|---|
| 165 |                } | 
|---|
| 166 |           } | 
|---|
| 167 |      } | 
|---|
| 168 | } | 
|---|
| 169 |  | 
|---|
| 170 | $conf_tab = isset($_POST['conf_tab']) ? $_POST['conf_tab'] : 'html'; | 
|---|
| 171 |  | 
|---|
| 172 | if (!empty($_POST)) | 
|---|
| 173 | { | 
|---|
| 174 |      try | 
|---|
| 175 |      { | 
|---|
| 176 |           # HTML | 
|---|
| 177 |           if ($conf_tab == 'html') { | 
|---|
| 178 |                $ductile_user['subtitle_hidden'] = (integer) !empty($_POST['subtitle_hidden']); | 
|---|
| 179 |  | 
|---|
| 180 |                $ductile_stickers = array(); | 
|---|
| 181 |                for ($i = 0; $i < count($_POST['sticker_image']); $i++) { | 
|---|
| 182 |                     $ductile_stickers[] = array( | 
|---|
| 183 |                          'label' => $_POST['sticker_label'][$i], | 
|---|
| 184 |                          'url' => $_POST['sticker_url'][$i], | 
|---|
| 185 |                          'image' => $_POST['sticker_image'][$i] | 
|---|
| 186 |                     ); | 
|---|
| 187 |                } | 
|---|
| 188 |  | 
|---|
| 189 |                $order = array(); | 
|---|
| 190 |                if (empty($_POST['ds_order']) && !empty($_POST['order'])) { | 
|---|
| 191 |                     $order = $_POST['order']; | 
|---|
| 192 |                     asort($order); | 
|---|
| 193 |                     $order = array_keys($order); | 
|---|
| 194 |                } | 
|---|
| 195 |                if (!empty($order)) { | 
|---|
| 196 |                     $new_ductile_stickers = array(); | 
|---|
| 197 |                     foreach ($order as $i => $k) { | 
|---|
| 198 |                          $new_ductile_stickers[] = array( | 
|---|
| 199 |                               'label' => $ductile_stickers[$k]['label'], | 
|---|
| 200 |                               'url' => $ductile_stickers[$k]['url'], | 
|---|
| 201 |                               'image' => $ductile_stickers[$k]['image'] | 
|---|
| 202 |                          ); | 
|---|
| 203 |                     } | 
|---|
| 204 |                     $ductile_stickers = $new_ductile_stickers; | 
|---|
| 205 |                } | 
|---|
| 206 |                 | 
|---|
| 207 |                for ($i = 0; $i < count($_POST['list_type']); $i++) { | 
|---|
| 208 |                     $ductile_lists[$_POST['list_ctx'][$i]] = $_POST['list_type'][$i]; | 
|---|
| 209 |                } | 
|---|
| 210 |                 | 
|---|
| 211 |                for ($i = 0; $i < count($_POST['count_nb']); $i++) { | 
|---|
| 212 |                     $ductile_counts[$_POST['count_ctx'][$i]] = $_POST['count_nb'][$i]; | 
|---|
| 213 |                } | 
|---|
| 214 |                 | 
|---|
| 215 |           } | 
|---|
| 216 |            | 
|---|
| 217 |           # CSS | 
|---|
| 218 |           if ($conf_tab == 'css') { | 
|---|
| 219 |                $ductile_user['body_font'] = $_POST['body_font']; | 
|---|
| 220 |                $ductile_user['alternate_font'] = $_POST['alternate_font']; | 
|---|
| 221 |  | 
|---|
| 222 |                $ductile_user['blog_title_w'] = (integer) !empty($_POST['blog_title_w']); | 
|---|
| 223 |                $ductile_user['blog_title_s'] = adjustFontSize($_POST['blog_title_s']); | 
|---|
| 224 |                $ductile_user['blog_title_c'] = adjustColor($_POST['blog_title_c']); | 
|---|
| 225 |            | 
|---|
| 226 |                $ductile_user['post_title_w'] = (integer) !empty($_POST['post_title_w']); | 
|---|
| 227 |                $ductile_user['post_title_s'] = adjustFontSize($_POST['post_title_s']); | 
|---|
| 228 |                $ductile_user['post_title_c'] = adjustColor($_POST['post_title_c']); | 
|---|
| 229 |            | 
|---|
| 230 |                $ductile_user['post_link_w'] = (integer) !empty($_POST['post_link_w']); | 
|---|
| 231 |                $ductile_user['post_link_v_c'] = adjustColor($_POST['post_link_v_c']); | 
|---|
| 232 |                $ductile_user['post_link_f_c'] = adjustColor($_POST['post_link_f_c']); | 
|---|
| 233 |            | 
|---|
| 234 |                $ductile_user['post_simple_title_c'] = adjustColor($_POST['post_simple_title_c']); | 
|---|
| 235 |            | 
|---|
| 236 |                $ductile_user['blog_title_w_m'] = (integer) !empty($_POST['blog_title_w_m']); | 
|---|
| 237 |                $ductile_user['blog_title_s_m'] = adjustFontSize($_POST['blog_title_s_m']); | 
|---|
| 238 |                $ductile_user['blog_title_c_m'] = adjustColor($_POST['blog_title_c_m']); | 
|---|
| 239 |            | 
|---|
| 240 |                $ductile_user['post_title_w_m'] = (integer) !empty($_POST['post_title_w_m']); | 
|---|
| 241 |                $ductile_user['post_title_s_m'] = adjustFontSize($_POST['post_title_s_m']); | 
|---|
| 242 |                $ductile_user['post_title_c_m'] = adjustColor($_POST['post_title_c_m']); | 
|---|
| 243 |           } | 
|---|
| 244 |            | 
|---|
| 245 |           $core->blog->settings->addNamespace('themes'); | 
|---|
| 246 |           $core->blog->settings->themes->put($core->blog->settings->system->theme.'_style',serialize($ductile_user)); | 
|---|
| 247 |           $core->blog->settings->themes->put($core->blog->settings->system->theme.'_stickers',serialize($ductile_stickers)); | 
|---|
| 248 |           $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_lists',serialize($ductile_lists)); | 
|---|
| 249 |           $core->blog->settings->themes->put($core->blog->settings->system->theme.'_entries_counts',serialize($ductile_counts)); | 
|---|
| 250 |  | 
|---|
| 251 |           // Blog refresh | 
|---|
| 252 |           $core->blog->triggerBlog(); | 
|---|
| 253 |  | 
|---|
| 254 |           // Template cache reset | 
|---|
| 255 |           $core->emptyTemplatesCache(); | 
|---|
| 256 |            | 
|---|
| 257 |           echo | 
|---|
| 258 |           '<div class="message"><p>'. | 
|---|
| 259 |           __('Theme configuration upgraded.'). | 
|---|
| 260 |           '</p></div>'; | 
|---|
| 261 |      } | 
|---|
| 262 |      catch (Exception $e) | 
|---|
| 263 |      { | 
|---|
| 264 |           $core->error->add($e->getMessage()); | 
|---|
| 265 |      } | 
|---|
| 266 | } | 
|---|
| 267 |  | 
|---|
| 268 | // Legacy mode | 
|---|
| 269 | if (!$standalone_config) echo '</form>'; | 
|---|
| 270 |  | 
|---|
| 271 | # HTML Tab | 
|---|
| 272 |  | 
|---|
| 273 | echo '<div class="multi-part" id="themes-list'.($conf_tab == 'html' ? '' : '-html').'" title="'.__('Content').'">'; | 
|---|
| 274 |  | 
|---|
| 275 | echo '<form id="theme_config" action="blog_theme.php?conf=1" method="post" enctype="multipart/form-data">'; | 
|---|
| 276 |  | 
|---|
| 277 | echo '<fieldset><legend>'.__('Header').'</legend>'. | 
|---|
| 278 | '<p class="field"><label for="subtitle_hidden">'.__('Hide blog description:').' '. | 
|---|
| 279 | form::checkbox('subtitle_hidden',1,$ductile_user['subtitle_hidden']).'</label>'.'</p>'; | 
|---|
| 280 | if ($core->plugins->moduleExists('simpleMenu')) | 
|---|
| 281 | { | 
|---|
| 282 |      echo '<p>'.sprintf(__('To configure the top menu go to the <a href="%s">Simple Menu administration page</a>.'),'plugin.php?p=simpleMenu').'</p>'; | 
|---|
| 283 | } | 
|---|
| 284 | echo '</fieldset>'; | 
|---|
| 285 |  | 
|---|
| 286 | echo '<fieldset><legend>'.__('Stickers').'</legend>'; | 
|---|
| 287 |  | 
|---|
| 288 | echo '<table class="dragable">'.'<caption>'.__('Stickers (footer)').'</caption>'. | 
|---|
| 289 | '<thead>'. | 
|---|
| 290 | '<tr>'. | 
|---|
| 291 | '<th scope="col">'.'</th>'. | 
|---|
| 292 | '<th scope="col">'.__('Image').'</th>'. | 
|---|
| 293 | '<th scope="col">'.__('Label').'</th>'. | 
|---|
| 294 | '<th scope="col">'.__('URL').'</th>'. | 
|---|
| 295 | '</tr>'. | 
|---|
| 296 | '</thead>'. | 
|---|
| 297 | '<tbody id="stickerslist">'; | 
|---|
| 298 | $count = 0; | 
|---|
| 299 | foreach ($ductile_stickers as $i => $v) { | 
|---|
| 300 |      $count++; | 
|---|
| 301 |      echo  | 
|---|
| 302 |      '<tr class="line" id="l_'.$i.'">'. | 
|---|
| 303 |      '<td class="handle minimal">'.form::field(array('order['.$i.']'),2,3,$count,'position','',false). | 
|---|
| 304 |           form::hidden(array('dynorder[]','dynorder-'.$i),$i).'</td>'. | 
|---|
| 305 |      '<td>'.form::hidden(array('sticker_image[]'),$v['image']).'<img src="'.$img_url.$v['image'].'" /> '.'</td>'. | 
|---|
| 306 |      '<td scope="raw">'.form::field(array('sticker_label[]','dsl-'.$i),20,255,$v['label']).'</td>'. | 
|---|
| 307 |      '<td>'.form::field(array('sticker_url[]','dsu-'.$i),40,255,$v['url']).'</td>'. | 
|---|
| 308 |      '</tr>'; | 
|---|
| 309 | } | 
|---|
| 310 | echo | 
|---|
| 311 | '</tbody>'. | 
|---|
| 312 | '</table>'; | 
|---|
| 313 |  | 
|---|
| 314 | echo '</fieldset>'; | 
|---|
| 315 |  | 
|---|
| 316 | echo '<fieldset><legend>'.__('Entries list types and limits').'</legend>'; | 
|---|
| 317 |  | 
|---|
| 318 | echo '<table id="entrieslist">'.'<caption>'.__('Entries lists').'</caption>'. | 
|---|
| 319 | '<thead>'. | 
|---|
| 320 | '<tr>'. | 
|---|
| 321 | '<th scope="col">'.__('Context').'</th>'. | 
|---|
| 322 | '<th scope="col">'.__('Entries list type').'</th>'. | 
|---|
| 323 | '<th scope="col">'.__('Number of entries').'</th>'. | 
|---|
| 324 | '</tr>'. | 
|---|
| 325 | '</thead>'. | 
|---|
| 326 | '<tbody>'; | 
|---|
| 327 | foreach ($ductile_lists as $k => $v) { | 
|---|
| 328 |      echo  | 
|---|
| 329 |           '<tr>'. | 
|---|
| 330 |           '<td scope="raw">'.$contexts[$k].'</td>'. | 
|---|
| 331 |           '<td>'.form::hidden(array('list_ctx[]'),$k).form::combo(array('list_type[]'),$list_types,$v).'</td>'; | 
|---|
| 332 |      if (array_key_exists($k,$ductile_counts)) { | 
|---|
| 333 |           echo '<td>'.form::hidden(array('count_ctx[]'),$k).form::field(array('count_nb[]'),2,3,$ductile_counts[$k]).'</td>'; | 
|---|
| 334 |      } else { | 
|---|
| 335 |           echo '<td></td>'; | 
|---|
| 336 |      } | 
|---|
| 337 |      echo | 
|---|
| 338 |           '</tr>'; | 
|---|
| 339 | } | 
|---|
| 340 | echo | 
|---|
| 341 | '</tbody>'. | 
|---|
| 342 | '</table>'; | 
|---|
| 343 |  | 
|---|
| 344 | echo '</fieldset>'; | 
|---|
| 345 |  | 
|---|
| 346 | echo '<input type="hidden" name="conf_tab" value="html">'; | 
|---|
| 347 | echo '<p class="clear">'.form::hidden('ds_order','').'<input type="submit" value="'.__('Save').'" />'.$core->formNonce().'</p>'; | 
|---|
| 348 | echo '</form>'; | 
|---|
| 349 |  | 
|---|
| 350 | echo '</div>'; // Close tab | 
|---|
| 351 |  | 
|---|
| 352 | # CSS tab | 
|---|
| 353 |  | 
|---|
| 354 | echo '<div class="multi-part" id="themes-list'.($conf_tab == 'css' ? '' : '-css').'" title="'.__('Presentation').'">'; | 
|---|
| 355 |  | 
|---|
| 356 | echo '<form id="theme_config" action="blog_theme.php?conf=1" method="post" enctype="multipart/form-data">'; | 
|---|
| 357 |  | 
|---|
| 358 | echo '<h3>'.__('General settings').'</h3>'; | 
|---|
| 359 |  | 
|---|
| 360 | echo '<fieldset><legend>'.__('Fonts').'</legend>'. | 
|---|
| 361 | '<p class="field"><label for="body_font">'.__('Main:').' '. | 
|---|
| 362 | form::combo('body_font',$fonts,$ductile_user['body_font']).'</label></p>'. | 
|---|
| 363 |  | 
|---|
| 364 | '<p class="field"><label for="alternate_font">'.__('Secondary:').' '. | 
|---|
| 365 | form::combo('alternate_font',$fonts,$ductile_user['alternate_font']).'</label></p>'. | 
|---|
| 366 | '</fieldset>'; | 
|---|
| 367 |  | 
|---|
| 368 | echo '<div class="two-cols">'; | 
|---|
| 369 | echo '<div class="col">'; | 
|---|
| 370 |  | 
|---|
| 371 | echo '<fieldset><legend>'.__('Blog title').'</legend>'. | 
|---|
| 372 | '<p class="field"><label for="blog_title_w">'.__('In bold:').' '. | 
|---|
| 373 | form::checkbox('blog_title_w',1,$ductile_user['blog_title_w']).'</label>'.'</p>'. | 
|---|
| 374 |  | 
|---|
| 375 | '<p class="field"><label for="blog_title_s">'.__('Font size (in em by default):').'</label> '. | 
|---|
| 376 | form::field('blog_title_s',7,7,$ductile_user['blog_title_s']).'</p>'. | 
|---|
| 377 |  | 
|---|
| 378 | '<p class="field picker"><label for="blog_title_c">'.__('Color:').'</label> '. | 
|---|
| 379 | form::field('blog_title_c',7,7,$ductile_user['blog_title_c'],'colorpicker').'</p>'. | 
|---|
| 380 | '</fieldset>'; | 
|---|
| 381 |  | 
|---|
| 382 | echo '</div>'; | 
|---|
| 383 | echo '<div class="col">'; | 
|---|
| 384 |  | 
|---|
| 385 | echo '<fieldset><legend>'.__('Post title').'</legend>'. | 
|---|
| 386 | '<p class="field"><label for="post_title_w">'.__('In bold:').' '. | 
|---|
| 387 | form::checkbox('post_title_w',1,$ductile_user['post_title_w']).'</label>'.'</p>'. | 
|---|
| 388 |  | 
|---|
| 389 | '<p class="field"><label for="post_title_s">'.__('Font size (in em by default):').'</label> '. | 
|---|
| 390 | form::field('post_title_s',7,7,$ductile_user['post_title_s']).'</p>'. | 
|---|
| 391 |  | 
|---|
| 392 | '<p class="field picker"><label for="post_title_c">'.__('Color:').'</label> '. | 
|---|
| 393 | form::field('post_title_c',7,7,$ductile_user['post_title_c'],'colorpicker').'</p>'. | 
|---|
| 394 | '</fieldset>'; | 
|---|
| 395 |  | 
|---|
| 396 | echo '</div>'; | 
|---|
| 397 | echo '</div>'; | 
|---|
| 398 |  | 
|---|
| 399 | echo '<fieldset><legend>'.__('Titles without link').'</legend>'. | 
|---|
| 400 |  | 
|---|
| 401 | '<p class="field picker"><label for="post_simple_title_c">'.__('Color:').'</label> '. | 
|---|
| 402 | form::field('post_simple_title_c',7,7,$ductile_user['post_simple_title_c'],'colorpicker').'</p>'. | 
|---|
| 403 | '</fieldset>'; | 
|---|
| 404 |  | 
|---|
| 405 | echo '<fieldset><legend>'.__('Inside posts links').'</legend>'. | 
|---|
| 406 | '<p class="field"><label for="post_link_w">'.__('In bold:').' '. | 
|---|
| 407 | form::checkbox('post_link_w',1,$ductile_user['post_link_w']).'</label>'.'</p>'. | 
|---|
| 408 |  | 
|---|
| 409 | '<p class="field picker"><label for="post_link_v_c">'.__('Normal and visited links color:').'</label> '. | 
|---|
| 410 | form::field('post_link_v_c',7,7,$ductile_user['post_link_v_c'],'colorpicker').'</p>'. | 
|---|
| 411 |  | 
|---|
| 412 | '<p class="field picker"><label for="body_link_f_c">'.__('Active, hover and focus links color:').'</label> '. | 
|---|
| 413 | form::field('post_link_f_c',7,7,$ductile_user['post_link_f_c'],'colorpicker').'</p>'. | 
|---|
| 414 | '</fieldset>'; | 
|---|
| 415 |  | 
|---|
| 416 | echo '<h3>'.__('Mobile specific settings').'</h3>'; | 
|---|
| 417 |  | 
|---|
| 418 | echo '<div class="two-cols">'; | 
|---|
| 419 | echo '<div class="col">'; | 
|---|
| 420 |  | 
|---|
| 421 | echo '<fieldset><legend>'.__('Blog title').'</legend>'. | 
|---|
| 422 | '<p class="field"><label for="blog_title_w_m">'.__('In bold:').' '. | 
|---|
| 423 | form::checkbox('blog_title_w_m',1,$ductile_user['blog_title_w_m']).'</label>'.'</p>'. | 
|---|
| 424 |  | 
|---|
| 425 | '<p class="field"><label for="blog_title_s_m">'.__('Font size (in em by default):').'</label> '. | 
|---|
| 426 | form::field('blog_title_s_m',7,7,$ductile_user['blog_title_s_m']).'</p>'. | 
|---|
| 427 |  | 
|---|
| 428 | '<p class="field picker"><label for="blog_title_c_m">'.__('Color:').'</label> '. | 
|---|
| 429 | form::field('blog_title_c_m',7,7,$ductile_user['blog_title_c_m'],'colorpicker').'</p>'. | 
|---|
| 430 | '</fieldset>'; | 
|---|
| 431 |  | 
|---|
| 432 | echo '</div>'; | 
|---|
| 433 | echo '<div class="col">'; | 
|---|
| 434 |  | 
|---|
| 435 | echo '<fieldset><legend>'.__('Post title').'</legend>'. | 
|---|
| 436 | '<p class="field"><label for="post_title_w_m">'.__('In bold:').' '. | 
|---|
| 437 | form::checkbox('post_title_w_m',1,$ductile_user['post_title_w_m']).'</label>'.'</p>'. | 
|---|
| 438 |  | 
|---|
| 439 | '<p class="field"><label for="post_title_s_m">'.__('Font size (in em by default):').'</label> '. | 
|---|
| 440 | form::field('post_title_s_m',7,7,$ductile_user['post_title_s_m']).'</p>'. | 
|---|
| 441 |  | 
|---|
| 442 | '<p class="field picker"><label for="post_title_c_m">'.__('Color:').'</label> '. | 
|---|
| 443 | form::field('post_title_c_m',7,7,$ductile_user['post_title_c_m'],'colorpicker').'</p>'. | 
|---|
| 444 | '</fieldset>'; | 
|---|
| 445 |  | 
|---|
| 446 | echo '</div>'; | 
|---|
| 447 | echo '</div>'; | 
|---|
| 448 |  | 
|---|
| 449 | echo '<input type="hidden" name="conf_tab" value="css">'; | 
|---|
| 450 | echo '<p class="clear"><input type="submit" value="'.__('Save').'" />'.$core->formNonce().'</p>'; | 
|---|
| 451 | echo '</form>'; | 
|---|
| 452 |  | 
|---|
| 453 | echo '</div>'; // Close tab | 
|---|
| 454 |  | 
|---|
| 455 | // Legacy mode | 
|---|
| 456 | if (!$standalone_config) echo '<form style="display:none">'; | 
|---|
| 457 |  | 
|---|
| 458 | // Need some more Js | 
|---|
| 459 | $core->auth->user_prefs->addWorkspace('accessibility');  | 
|---|
| 460 | $user_dm_nodragdrop = $core->auth->user_prefs->accessibility->nodragdrop; | 
|---|
| 461 | echo dcPage::jsToolMan(); | 
|---|
| 462 |  | 
|---|
| 463 | ?> | 
|---|
| 464 | <?php if (!$user_dm_nodragdrop) : ?> | 
|---|
| 465 | <script type="text/javascript"> | 
|---|
| 466 | //<![CDATA[ | 
|---|
| 467 |  | 
|---|
| 468 | var dragsort = ToolMan.dragsort(); | 
|---|
| 469 | $(function() { | 
|---|
| 470 |      dragsort.makeTableSortable($("#stickerslist").get(0), | 
|---|
| 471 |      dotclear.sortable.setHandle,dotclear.sortable.saveOrder); | 
|---|
| 472 | }); | 
|---|
| 473 |  | 
|---|
| 474 | dotclear.sortable = { | 
|---|
| 475 |      setHandle: function(item) { | 
|---|
| 476 |           var handle = $(item).find('td.handle').get(0); | 
|---|
| 477 |           while (handle.firstChild) { | 
|---|
| 478 |                handle.removeChild(handle.firstChild); | 
|---|
| 479 |           } | 
|---|
| 480 |  | 
|---|
| 481 |           item.toolManDragGroup.setHandle(handle); | 
|---|
| 482 |           handle.className = handle.className+' handler'; | 
|---|
| 483 |      }, | 
|---|
| 484 |  | 
|---|
| 485 |      saveOrder: function(item) { | 
|---|
| 486 |           var group = item.toolManDragGroup; | 
|---|
| 487 |           var order = document.getElementById('ds_order'); | 
|---|
| 488 |           group.register('dragend', function() { | 
|---|
| 489 |                order.value = ''; | 
|---|
| 490 |                items = item.parentNode.getElementsByTagName('tr'); | 
|---|
| 491 |  | 
|---|
| 492 |                for (var i=0; i<items.length; i++) { | 
|---|
| 493 |                     order.value += items[i].id.substr(2)+','; | 
|---|
| 494 |                } | 
|---|
| 495 |           }); | 
|---|
| 496 |      } | 
|---|
| 497 | }; | 
|---|
| 498 | //]]> | 
|---|
| 499 | </script> | 
|---|
| 500 | <?php endif; ?> | 
|---|