'', __('Ductile primary') => 'Ductile body', __('Ductile secondary') => 'Ductile alternate', __('Times New Roman') => 'Times New Roman', __('Georgia') => 'Georgia', __('Garamond') => 'Garamond', __('Helvetica/Arial') => 'Helvetica/Arial', __('Verdana') => 'Verdana', __('Trebuchet MS') => 'Trebuchet MS', __('Impact') => 'Impact', __('Monospace') => 'Monospace' ); function adjustFontSize($s) { if (preg_match('/^([0-9.]+)\s*(%|pt|px|em|ex)?$/',$s,$m)) { if (empty($m[2])) { $m[2] = 'em'; } return $m[1].$m[2]; } return null; } function adjustColor($c) { if ($c === '') { return ''; } $c = strtoupper($c); if (preg_match('/^[A-F0-9]{3,6}$/',$c)) { $c = '#'.$c; } if (preg_match('/^#[A-F0-9]{6}$/',$c)) { return $c; } if (preg_match('/^#[A-F0-9]{3,}$/',$c)) { 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); } return ''; } $ductile_base = array( 'body_font' => null, 'alternate_font' => null, 'blog_title_w' => null, 'blog_title_s' => null, 'blog_title_c' => null, 'post_title_w' => null, 'post_title_s' => null, 'post_title_c' => null, 'post_link_w' => null, 'post_link_v_c' => null, 'post_link_f_c' => null, 'blog_title_w_m' => null, 'blog_title_s_m' => null, 'blog_title_c_m' => null, 'post_title_w_m' => null, 'post_title_s_m' => null, 'post_title_c_m' => null ); $ductile_user = $core->blog->settings->themes->ductile_style; $ductile_user = @unserialize($ductile_user); if (!is_array($ductile_user)) { $ductile_user = array(); } $ductile_user = array_merge($ductile_base,$ductile_user); if (!empty($_POST)) { try { $ductile_user['body_font'] = $_POST['body_font']; $ductile_user['alternate_font'] = $_POST['alternate_font']; $ductile_user['blog_title_w'] = (integer) !empty($_POST['blog_title_w']); $ductile_user['blog_title_s'] = adjustFontSize($_POST['blog_title_s']); $ductile_user['blog_title_c'] = adjustColor($_POST['blog_title_c']); $ductile_user['post_title_w'] = (integer) !empty($_POST['post_title_w']); $ductile_user['post_title_s'] = adjustFontSize($_POST['post_title_s']); $ductile_user['post_title_c'] = adjustColor($_POST['post_title_c']); $ductile_user['post_link_w'] = (integer) !empty($_POST['post_link_w']); $ductile_user['post_link_v_c'] = adjustColor($_POST['post_link_v_c']); $ductile_user['post_link_f_c'] = adjustColor($_POST['post_link_f_c']); $ductile_user['blog_title_w_m'] = (integer) !empty($_POST['blog_title_w_m']); $ductile_user['blog_title_s_m'] = adjustFontSize($_POST['blog_title_s_m']); $ductile_user['blog_title_c_m'] = adjustColor($_POST['blog_title_c_m']); $ductile_user['post_title_w_m'] = (integer) !empty($_POST['post_title_w_m']); $ductile_user['post_title_s_m'] = adjustFontSize($_POST['post_title_s_m']); $ductile_user['post_title_c_m'] = adjustColor($_POST['post_title_c_m']); $core->blog->settings->addNamespace('themes'); $core->blog->settings->themes->put('ductile_style',serialize($ductile_user)); $core->blog->triggerBlog(); echo '

'. __('Style sheet upgraded.'). '

'; } catch (Exception $e) { $core->error->add($e->getMessage()); } } echo '

'.__('General settings').'

'; echo '
'.__('Fonts').''. '

'. '

'. '
'; echo '
'; echo '
'; echo '
'.__('Blog title').''. '

'.'

'. '

'. form::field('blog_title_s',7,7,$ductile_user['blog_title_s']).' '.__('(in em by default)').'

'. '

'. form::field('blog_title_c',7,7,$ductile_user['blog_title_c'],'colorpicker').'

'. '
'; echo '
'; echo '
'; echo '
'.__('Post title').''. '

'.'

'. '

'. form::field('post_title_s',7,7,$ductile_user['post_title_s']).' '.__('(in em by default)').'

'. '

'. form::field('post_title_c',7,7,$ductile_user['post_title_c'],'colorpicker').'

'. '
'; echo '
'; echo '
'; echo '
'.__('Inside posts links').''. '

'.'

'. '

'. form::field('post_link_v_c',7,7,$ductile_user['post_link_v_c'],'colorpicker').'

'. '

'. form::field('post_link_f_c',7,7,$ductile_user['post_link_f_c'],'colorpicker').'

'. '
'; echo '

'.__('Mobile specific settings').'

'; echo '
'; echo '
'; echo '
'.__('Blog title').''. '

'.'

'. '

'. form::field('blog_title_s_m',7,7,$ductile_user['blog_title_s_m']).' '.__('(in em by default)').'

'. '

'. form::field('blog_title_c_m',7,7,$ductile_user['blog_title_c_m'],'colorpicker').'

'. '
'; echo '
'; echo '
'; echo '
'.__('Post title').''. '

'.'

'. '

'. form::field('post_title_s_m',7,7,$ductile_user['post_title_s_m']).' '.__('(in em by default)').'

'. '

'. form::field('post_title_c_m',7,7,$ductile_user['post_title_c_m'],'colorpicker').'

'. '
'; echo '
'; echo '
'; ?>