'.sprintf(__('Config file %s, is not writable.'),'conf/dotclear.ini').'

'; } else { $is_writable = true; # Modification du fichier if (!empty($_POST)) { $p_blog_name = trim($_POST['p_blog_name']); $p_blog_desc = trim($_POST['p_blog_desc']); $p_blog_url = trim($_POST['p_blog_url']); $p_app_url = trim($_POST['p_app_url']); $p_img_url = trim($_POST['p_img_url']); $p_blog_rss = trim($_POST['p_blog_rss']); $p_blog_atom = trim($_POST['p_blog_atom']); $p_trackback_uri = trim($_POST['p_trackback_uri']); $p_url_scan = trim($_POST['p_url_scan']); $p_nb_post_per_page = trim($_POST['p_nb_post_per_page']); $p_show_previews = trim($_POST['p_show_previews']); $p_date_format = trim($_POST['p_date_format']); $p_time_format = trim($_POST['p_time_format']); $p_default_lang = trim($_POST['p_default_lang']); $p_theme = trim($_POST['p_theme']); $p_allow_comments = trim($_POST['p_allow_comments']); $p_allow_trackbacks = trim($_POST['p_allow_trackbacks']); $p_comments_pub = trim($_POST['p_comments_pub']); $p_comments_ttl = trim($_POST['p_comments_ttl']); $p_comment_notification = trim($_POST['p_comment_notification']); $p_use_smilies = trim($_POST['p_use_smilies']); $p_short_feeds = trim($_POST['p_short_feeds']); $p_http_cache = trim($_POST['p_http_cache']); $arry_err = array(); if ($p_blog_name == '') { $arry_err[] = __('You must give a blog name'); } if ($p_blog_url == '') { $arry_err[] = __('You must give a blog URL'); } if ($p_img_url == '') { $arry_err[] = __('You must give an images location'); } if ($p_blog_rss == '') { $arry_err[] = __('You must give a RSS location'); } if ($p_blog_atom == '') { $arry_err[] = __('You must give an Atom location'); } if (!preg_match('/^[0-9]+$/',$p_nb_post_per_page) || $p_nb_post_per_page < 1) { $arry_err[] = __('You must give a valid number of entries per page'); } if (count($arry_err) > 0) { $err .= ''; } else { $p_blog_url = preg_replace('|^/+|','',$p_blog_url); $p_blog_url = '/'.$p_blog_url; $p_img_url = preg_replace('|/+$|','',$p_img_url); $p_img_url = preg_replace('|^/+|','',$p_img_url); $p_img_url = '/'.$p_img_url.'/'; $objIni = new iniFile($dc_ini_file); $objIni->editVar('dc_blog_name',$p_blog_name); $objIni->editVar('dc_blog_desc',$p_blog_desc); $objIni->editVar('dc_blog_url',$p_blog_url); $objIni->editVar('dc_app_url',$p_app_url); $objIni->editVar('dc_img_url',$p_img_url); $objIni->editVar('dc_blog_rss',$p_blog_rss); $objIni->editVar('dc_blog_atom',$p_blog_atom); $objIni->editVar('dc_trackback_uri',$p_trackback_uri); $objIni->editVar('dc_url_scan',$p_url_scan); $objIni->editVar('dc_nb_post_per_page',(integer) $p_nb_post_per_page); $objIni->editVar('dc_show_previews',(integer) $p_show_previews); $objIni->editVar('dc_date_format',$p_date_format); $objIni->editVar('dc_time_format',$p_time_format); $objIni->editVar('dc_default_lang',$p_default_lang); $objIni->editVar('dc_theme',$p_theme); $objIni->editVar('dc_allow_comments',(integer) $p_allow_comments); $objIni->editVar('dc_allow_trackbacks',(integer) $p_allow_trackbacks); $objIni->editVar('dc_comments_pub',(integer) $p_comments_pub); $objIni->editVar('dc_comments_ttl',(integer) $p_comments_ttl); $objIni->editVar('dc_comment_notification',(integer) $p_comment_notification); $objIni->editVar('dc_use_smilies',(integer) $p_use_smilies); $objIni->editVar('dc_short_feeds',(integer) $p_short_feeds); $objIni->editVar('dc_http_cache',(integer) $p_http_cache); if ($objIni->saveFile() !== false) { header('Location: '.$url.'&done=1'); exit; } else { $err = __('An error occured while writing the file.'); } } } } /* Affichage -------------------------------------------------------- */ buffer::str('

'.__('DotClear configuration').'

'); if($err != '') { buffer::str('

'.__('Error(s)').' :

'.$err.'
'); } if ($is_writable) { # Liste des thèmes $themes = new plugins(dirname(__FILE__).'/../../../themes/','theme'); $themes->getPlugins(true); $themes_list = $themes->getPluginsList(); array_walk($themes_list,create_function('&$v','$v=$v["label"];')); $themes_list = array_flip($themes_list); # Liste des modes de scan $scan_modes = array( 'Query string' => 'query_string', 'Path info' => 'path_info' ); if (!empty($_GET['done'])) { buffer::str( '

'.__('Configuration file successfully updated.').'

' ); } buffer::str( '
'. '
'. ''.__('Base configuration').''. '

'. form::field('p_blog_name',40,'',htmlspecialchars(dc_blog_name)).'

'. '

'. form::field('p_blog_desc',40,'',htmlspecialchars(dc_blog_desc)).'

'. '

'. form::field('p_blog_url',40,'',htmlspecialchars(dc_blog_url)).'

'. '

'. form::field('p_nb_post_per_page',3,'',dc_nb_post_per_page).'

'. '

'. form::combo('p_default_lang',l10n::getISOcodes(1),dc_default_lang).'

'. '

'. form::combo('p_theme',$themes_list,dc_theme).'

'. '

'. form::combo('p_allow_comments',array(__('yes')=>1,__('no')=>0),(integer) dc_allow_comments). '

'. '

'. form::combo('p_allow_trackbacks',array(__('yes')=>1,__('no')=>0),(integer) dc_allow_trackbacks). '

'. '

'. form::combo('p_comments_pub',array(__('yes')=>1,__('no')=>0),(integer) dc_comments_pub). '

'. '
'. '
'.__('Advanced configuration').''. '

'. form::field('p_app_url',40,'',htmlspecialchars(dc_app_url)).'

'. '

'. form::field('p_img_url',40,'',htmlspecialchars(dc_img_url)).'

'. '

'. form::field('p_blog_rss',40,'',htmlspecialchars(dc_blog_rss)).'

'. '

'. form::field('p_blog_atom',40,'',htmlspecialchars(dc_blog_atom)).'

'. '

'. form::field('p_trackback_uri',40,'',htmlspecialchars(dc_trackback_uri)).'

'. '

'. form::combo('p_url_scan',$scan_modes,dc_url_scan). '

'. '

'. form::combo('p_show_previews',array(__('yes')=>1,__('no')=>0),(integer) dc_show_previews). '

'. '

'. form::field('p_date_format',40,'',htmlspecialchars(dc_date_format)).'

'. '

'. form::field('p_time_format',40,'',htmlspecialchars(dc_time_format)).'

'. '

'. form::field('p_comments_ttl',3,'',(string) dc_comments_ttl).'

'. '

'. form::combo('p_use_smilies',array(__('yes')=>1,__('no')=>0),(integer) dc_use_smilies). '

'. '

'. form::combo('p_comment_notification',array(__('yes')=>1,__('no')=>0),(integer) dc_comment_notification). '

'. '

'. form::combo('p_short_feeds',array(__('yes')=>1,__('no')=>0),(integer) dc_short_feeds). '

'. '

'. form::combo('p_http_cache',array(__('yes')=>1,__('no')=>0),(integer) dc_http_cache). '

'. '
'. '

'. '
' ); } ?>