diff -N -w -u -r dotclearorig/admin/blog.php dotclearns/admin/blog.php --- dotclearorig/admin/blog.php 2009-08-29 11:25:33.580750000 +0200 +++ dotclearns/admin/blog.php 2009-09-08 19:02:52.281250000 +0200 @@ -38,14 +38,14 @@ # Default settings and override some $core->blogDefaults($cur->blog_id); $blog_settings = new dcSettings($core,$cur->blog_id); - $blog_settings->setNameSpace('system'); - $blog_settings->put('lang',$core->auth->getInfo('user_lang')); - $blog_settings->put('blog_timezone',$core->auth->getInfo('user_tz')); + $blog_settings->addNamespace('system'); + $blog_settings->system->put('lang',$core->auth->getInfo('user_lang')); + $blog_settings->system->put('blog_timezone',$core->auth->getInfo('user_tz')); if (substr($blog_url,-1) == '?') { - $blog_settings->put('url_scan','query_string'); + $blog_settings->system->put('url_scan','query_string'); } else { - $blog_settings->put('url_scan','path_info'); + $blog_settings->system->put('url_scan','path_info'); } # --BEHAVIOR-- adminAfterBlogCreate diff -N -w -u -r dotclearorig/admin/blog_pref.php dotclearns/admin/blog_pref.php --- dotclearorig/admin/blog_pref.php 2009-08-29 11:25:34.424500000 +0200 +++ dotclearns/admin/blog_pref.php 2009-09-08 18:48:52.531250000 +0200 @@ -83,8 +83,8 @@ __('year/title') => '{y}/{t}', __('title') => '{t}' ); -if (!in_array($blog_settings->post_url_format,$post_url_combo)) { - $post_url_combo[html::escapeHTML($blog_settings->post_url_format)] = html::escapeHTML($blog_settings->post_url_format); +if (!in_array($blog_settings->system->post_url_format,$post_url_combo)) { + $post_url_combo[html::escapeHTML($blog_settings->system->post_url_format)] = html::escapeHTML($blog_settings->system->post_url_format); } # Image title combo @@ -94,8 +94,8 @@ __('Title, Country, Date') => 'Title ;; Country ;; Date(%b %Y) ;; separator(, )', __('Title, City, Country, Date') => 'Title ;; City ;; Country ;; Date(%b %Y) ;; separator(, )', ); -if (!in_array($blog_settings->media_img_title_pattern,$img_title_combo)) { - $img_title_combo[html::escapeHTML($blog_settings->media_img_title_pattern)] = html::escapeHTML($blog_settings->media_img_title_pattern); +if (!in_array($blog_settings->system->media_img_title_pattern,$img_title_combo)) { + $img_title_combo[html::escapeHTML($blog_settings->system->media_img_title_pattern)] = html::escapeHTML($blog_settings->system->media_img_title_pattern); } # Robots policy options @@ -159,44 +159,44 @@ } - $blog_settings->setNameSpace('system'); + $blog_settings->addNameSpace('system'); - $blog_settings->put('editor',$_POST['editor']); - $blog_settings->put('copyright_notice',$_POST['copyright_notice']); - $blog_settings->put('post_url_format',$_POST['post_url_format']); - $blog_settings->put('lang',$_POST['lang']); - $blog_settings->put('blog_timezone',$_POST['blog_timezone']); - $blog_settings->put('date_format',$_POST['date_format']); - $blog_settings->put('time_format',$_POST['time_format']); - $blog_settings->put('comments_ttl',abs((integer) $_POST['comments_ttl'])); - $blog_settings->put('trackbacks_ttl',abs((integer) $_POST['trackbacks_ttl'])); - $blog_settings->put('allow_comments',!empty($_POST['allow_comments'])); - $blog_settings->put('allow_trackbacks',!empty($_POST['allow_trackbacks'])); - $blog_settings->put('comments_pub',empty($_POST['comments_pub'])); - $blog_settings->put('trackbacks_pub',empty($_POST['trackbacks_pub'])); - $blog_settings->put('comments_nofollow',!empty($_POST['comments_nofollow'])); - $blog_settings->put('wiki_comments',!empty($_POST['wiki_comments'])); - $blog_settings->put('enable_xmlrpc',!empty($_POST['enable_xmlrpc'])); - - $blog_settings->put('nb_post_per_page',$nb_post_per_page); - $blog_settings->put('use_smilies',!empty($_POST['use_smilies'])); - $blog_settings->put('media_img_t_size',$media_img_t_size); - $blog_settings->put('media_img_s_size',$media_img_s_size); - $blog_settings->put('media_img_m_size',$media_img_m_size); - $blog_settings->put('media_img_title_pattern',$_POST['media_img_title_pattern']); - $blog_settings->put('nb_post_per_feed',$nb_post_per_feed); - $blog_settings->put('nb_comment_per_feed',$nb_comment_per_feed); - $blog_settings->put('short_feed_items',!empty($_POST['short_feed_items'])); + $blog_settings->system->put('editor',$_POST['editor']); + $blog_settings->system->put('copyright_notice',$_POST['copyright_notice']); + $blog_settings->system->put('post_url_format',$_POST['post_url_format']); + $blog_settings->system->put('lang',$_POST['lang']); + $blog_settings->system->put('blog_timezone',$_POST['blog_timezone']); + $blog_settings->system->put('date_format',$_POST['date_format']); + $blog_settings->system->put('time_format',$_POST['time_format']); + $blog_settings->system->put('comments_ttl',abs((integer) $_POST['comments_ttl'])); + $blog_settings->system->put('trackbacks_ttl',abs((integer) $_POST['trackbacks_ttl'])); + $blog_settings->system->put('allow_comments',!empty($_POST['allow_comments'])); + $blog_settings->system->put('allow_trackbacks',!empty($_POST['allow_trackbacks'])); + $blog_settings->system->put('comments_pub',empty($_POST['comments_pub'])); + $blog_settings->system->put('trackbacks_pub',empty($_POST['trackbacks_pub'])); + $blog_settings->system->put('comments_nofollow',!empty($_POST['comments_nofollow'])); + $blog_settings->system->put('wiki_comments',!empty($_POST['wiki_comments'])); + $blog_settings->system->put('enable_xmlrpc',!empty($_POST['enable_xmlrpc'])); + + $blog_settings->system->put('nb_post_per_page',$nb_post_per_page); + $blog_settings->system->put('use_smilies',!empty($_POST['use_smilies'])); + $blog_settings->system->put('media_img_t_size',$media_img_t_size); + $blog_settings->system->put('media_img_s_size',$media_img_s_size); + $blog_settings->system->put('media_img_m_size',$media_img_m_size); + $blog_settings->system->put('media_img_title_pattern',$_POST['media_img_title_pattern']); + $blog_settings->system->put('nb_post_per_feed',$nb_post_per_feed); + $blog_settings->system->put('nb_comment_per_feed',$nb_comment_per_feed); + $blog_settings->system->put('short_feed_items',!empty($_POST['short_feed_items'])); if (isset($_POST['robots_policy'])) { - $blog_settings->put('robots_policy',$_POST['robots_policy']); + $blog_settings->system->put('robots_policy',$_POST['robots_policy']); } # --BEHAVIOR-- adminBeforeBlogSettingsUpdate $core->callBehavior('adminBeforeBlogSettingsUpdate',$blog_settings); if ($core->auth->isSuperAdmin() && in_array($_POST['url_scan'],$url_scan_combo)) { - $blog_settings->put('url_scan',$_POST['url_scan']); + $blog_settings->system->put('url_scan',$_POST['url_scan']); } http::redirect(sprintf($redir,$blog_id)); @@ -259,7 +259,7 @@ form::field('blog_url',30,255,html::escapeHTML($blog_url)).'

'. '

'. + form::combo('url_scan',$url_scan_combo,$blog_settings->system->url_scan).'

'. '

'; @@ -276,29 +276,29 @@ '
'. '
'. '

'. '

'. '

'. '
'. '
'. '

'. '

'. '

'. ' - '.__('more information').'

'. '
'. @@ -311,38 +311,38 @@ '
'. '
'. '

'. '

'. '

'. '

'.__('Leave empty to cancel this feature.').'

'. '

'. '
'. '
'. '

'. '

'. '

'. + form::field('trackbacks_ttl',2,3,$blog_settings->system->trackbacks_ttl)).'

'. '

'.__('Leave empty to cancel this feature.').'

'. '

'. '
'. '
'. @@ -354,33 +354,33 @@ '
'. '
'. '

'. '

'. '

'. '
'. '
'. '

'. '

'. '

'. '

'. '
'. '
'. @@ -393,19 +393,19 @@ '
'. '

'.__('Generated image sizes (in pixels)').'

'. '

'. + form::field('media_img_t_size',3,3,$blog_settings->system->media_img_t_size).'

'. '

'. + form::field('media_img_s_size',3,3,$blog_settings->system->media_img_s_size).'

'. '

'. + form::field('media_img_m_size',3,3,$blog_settings->system->media_img_m_size).'

'. '
'. '
'. '

'. '

'.__('This defines image tag title when you insert it in a post from the media manager. It is retrieved from the picture\'s metadata.').'

'. - '

'.form::combo('media_img_title_pattern',$img_title_combo,html::escapeHTML($blog_settings->media_img_title_pattern)).'

'. + '

'.form::combo('media_img_title_pattern',$img_title_combo,html::escapeHTML($blog_settings->system->media_img_title_pattern)).'

'. '
'. '
'. ''; @@ -416,7 +416,7 @@ foreach ($robots_policy_options as $k => $v) { echo '

'; + form::radio(array('robots_policy'),$k,$blog_settings->system->robots_policy == $k).' '.$v.'

'; } echo ''; @@ -446,7 +446,7 @@ echo '

'.__('XML/RPC interface allows you to edit your blog with an external client.').'

'; - if (!$blog_settings->enable_xmlrpc) + if (!$blog_settings->system->enable_xmlrpc) { echo '

'.__('XML/RPC interface is not active. Change settings to enable it.').'

'; } diff -N -w -u -r dotclearorig/admin/blog_theme.php dotclearns/admin/blog_theme.php --- dotclearorig/admin/blog_theme.php 2009-08-29 11:25:34.299500000 +0200 +++ dotclearns/admin/blog_theme.php 2009-09-08 20:00:20.984375000 +0200 @@ -49,8 +49,8 @@ # Selecting theme if (!empty($_POST['theme']) && !empty($_POST['select']) && empty($_REQUEST['conf'])) { - $core->blog->settings->setNameSpace('system'); - $core->blog->settings->put('theme',$_POST['theme']); + $core->blog->settings->addNamespace('system'); + $core->blog->settings->system->put('theme',$_POST['theme']); $core->blog->triggerBlog(); http::redirect('blog_theme.php?upd=1'); } @@ -139,7 +139,7 @@ $theme_conf_mode = false; if (!empty($_REQUEST['conf'])) { - $theme_conf_file = path::real($core->blog->themes_path.'/'.$core->blog->settings->theme).'/_config.php'; + $theme_conf_file = path::real($core->blog->themes_path.'/'.$core->blog->settings->system->theme).'/_config.php'; if (file_exists($theme_conf_file)) { $theme_conf_mode = true; } @@ -155,7 +155,7 @@ } $radio_id = 'theme_'.html::escapeHTML($id); - $theme_url = http::concatURL($core->blog->url,$core->blog->settings->themes_url.'/'.$id); + $theme_url = http::concatURL($core->blog->url,$core->blog->settings->system->themes_url.'/'.$id); $has_conf = file_exists(path::real($core->blog->themes_path.'/'.$id).'/_config.php'); $has_css = file_exists(path::real($core->blog->themes_path.'/'.$id).'/style.css'); $parent = $core->themes->moduleInfo($id,'parent'); @@ -239,21 +239,21 @@ echo '
'; $themes = $core->themes->getModules(); - if (isset($themes[$core->blog->settings->theme])) { - echo '

'.sprintf(__('You are currently using "%s"'),$themes[$core->blog->settings->theme]['name']).'

'; + if (isset($themes[$core->blog->settings->system->theme])) { + echo '

'.sprintf(__('You are currently using "%s"'),$themes[$core->blog->settings->system->theme]['name']).'

'; } echo '
'. '
'; - if (isset($themes[$core->blog->settings->theme])) { - echo display_theme_details($core->blog->settings->theme,$themes[$core->blog->settings->theme],true); + if (isset($themes[$core->blog->settings->system->theme])) { + echo display_theme_details($core->blog->settings->system->theme,$themes[$core->blog->settings->system->theme],true); } foreach ($themes as $k => $v) { - if ($core->blog->settings->theme == $k) { // Current theme + if ($core->blog->settings->system->theme == $k) { // Current theme continue; } echo display_theme_details($k,$v,false); @@ -325,7 +325,7 @@ } else { - $theme_name = $core->themes->moduleInfo($core->blog->settings->theme,'name'); + $theme_name = $core->themes->moduleInfo($core->blog->settings->system->theme,'name'); echo '

'.html::escapeHTML($core->blog->name). ' › '.__('Blog aspect').' › '.__('Theme configuration').'

'. diff -N -w -u -r dotclearorig/admin/install/index.php dotclearns/admin/install/index.php --- dotclearorig/admin/install/index.php 2009-08-29 11:25:34.377625000 +0200 +++ dotclearns/admin/install/index.php 2009-09-08 20:00:55.531250000 +0200 @@ -147,11 +147,11 @@ $core->blogDefaults($cur->blog_id); $blog_settings = new dcSettings($core,'default'); - $blog_settings->setNameSpace('system'); - $blog_settings->put('blog_timezone',$default_tz); - $blog_settings->put('lang',$dlang); - $blog_settings->put('public_url',$root_url.'/public'); - $blog_settings->put('themes_url',$root_url.'/themes'); + $blog_settings->addNamespace('system'); + $blog_settings->system->put('blog_timezone',$default_tz); + $blog_settings->system->put('lang',$dlang); + $blog_settings->system->put('public_url',$root_url.'/public'); + $blog_settings->system->put('themes_url',$root_url.'/themes'); # Add Dotclear version $cur = $core->con->openCursor($core->prefix.'version'); diff -N -w -u -r dotclearorig/admin/media_item.php dotclearns/admin/media_item.php --- dotclearorig/admin/media_item.php 2009-08-29 11:25:33.612000000 +0200 +++ dotclearns/admin/media_item.php 2009-09-08 20:02:04.234375000 +0200 @@ -194,7 +194,7 @@ if ($file->media_type == 'image') { $media_type = 'image'; - $media_desc = dcGetImageTitle($file,$core->blog->settings->media_img_title_pattern); + $media_desc = dcGetImageTitle($file,$core->blog->settings->system->media_img_title_pattern); if ($media_desc == $file->basename) { $media_desc = ''; } @@ -390,7 +390,7 @@ if ($file->media_image) { # We look for thumbnails too - $media_root = $core->blog->host.path::clean($core->blog->settings->public_url).'/'; + $media_root = $core->blog->host.path::clean($core->blog->settings->system->public_url).'/'; foreach ($file->media_thumb as $v) { $v = preg_replace('/^'.preg_quote($media_root,'/').'/','',$v); $params['sql'] .= "OR post_content_xhtml LIKE '%".$core->con->escape($v)."%' "; diff -N -w -u -r dotclearorig/admin/post.php dotclearns/admin/post.php --- dotclearorig/admin/post.php 2009-08-29 11:25:33.565125000 +0200 +++ dotclearns/admin/post.php 2009-08-29 14:55:44.690125000 +0200 @@ -29,8 +29,8 @@ $post_notes = ''; $post_status = $core->auth->getInfo('user_post_status'); $post_selected = false; -$post_open_comment = $core->blog->settings->allow_comments; -$post_open_tb = $core->blog->settings->allow_trackbacks; +$post_open_comment = $core->blog->settings->system->allow_comments; +$post_open_tb = $core->blog->settings->system->allow_trackbacks; $post_media = array(); diff -N -w -u -r dotclearorig/admin/services.php dotclearns/admin/services.php --- dotclearorig/admin/services.php 2009-08-29 11:25:34.283875000 +0200 +++ dotclearns/admin/services.php 2009-09-08 20:02:27.828125000 +0200 @@ -146,8 +146,8 @@ $cur->post_format = !empty($post['post_format']) ? $post['post_format'] : 'xhtml'; $cur->post_lang = !empty($post['post_lang']) ? $post['post_lang'] : ''; $cur->post_status = !empty($post['post_status']) ? (integer) $post['post_status'] : 0; - $cur->post_open_comment = (integer) $core->blog->settings->allow_comments; - $cur->post_open_tb = (integer) $core->blog->settings->allow_trackbacks; + $cur->post_open_comment = (integer) $core->blog->settings->system->allow_comments; + $cur->post_open_tb = (integer) $core->blog->settings->system->allow_trackbacks; # --BEHAVIOR-- adminBeforePostCreate $core->callBehavior('adminBeforePostCreate',$cur); diff -N -w -u -r dotclearorig/inc/admin/lib.pager.php dotclearns/inc/admin/lib.pager.php --- dotclearorig/inc/admin/lib.pager.php 2009-08-29 11:25:31.424500000 +0200 +++ dotclearns/inc/admin/lib.pager.php 2009-09-08 18:40:32.125000000 +0200 @@ -298,8 +298,8 @@ $comment_url = 'comment.php?id='.$this->rs->comment_id; $comment_dt = - dt::dt2str($this->core->blog->settings->date_format.' - '. - $this->core->blog->settings->time_format,$this->rs->comment_dt); + dt::dt2str($this->core->blog->settings->system->date_format.' - '. + $this->core->blog->settings->system->time_format,$this->rs->comment_dt); $img = '%1$s'; switch ($this->rs->comment_status) { diff -N -w -u -r dotclearorig/inc/core/class.dc.blog.php dotclearns/inc/core/class.dc.blog.php --- dotclearorig/inc/core/class.dc.blog.php 2009-08-29 11:25:30.268250000 +0200 +++ dotclearns/inc/core/class.dc.blog.php 2009-08-29 20:06:39.440125000 +0200 @@ -70,8 +70,8 @@ $this->settings = new dcSettings($this->core,$this->id); - $this->themes_path = path::fullFromRoot($this->settings->themes_path,DC_ROOT); - $this->public_path = path::fullFromRoot($this->settings->public_path,DC_ROOT); + $this->themes_path = path::fullFromRoot($this->settings->system->themes_path,DC_ROOT); + $this->public_path = path::fullFromRoot($this->settings->system->public_path,DC_ROOT); $this->post_status['-2'] = __('pending'); $this->post_status['-1'] = __('scheduled'); @@ -1586,7 +1586,7 @@ $url = str_replace( array_keys($url_patterns), array_values($url_patterns), - $this->settings->post_url_format + $this->settings->system->post_url_format ); } else @@ -1827,9 +1827,9 @@ $cur->comment_id = (integer) $rs->f(0) + 1; $cur->comment_upddt = date('Y-m-d H:i:s'); - $offset = dt::getTimeOffset($this->settings->blog_timezone); + $offset = dt::getTimeOffset($this->settings->system->blog_timezone); $cur->comment_dt = date('Y-m-d H:i:s',time() + $offset); - $cur->comment_tz = $this->settings->blog_timezone; + $cur->comment_tz = $this->settings->system->blog_timezone; $this->getCommentCursor($cur); @@ -1991,7 +1991,7 @@ } if ($cur->comment_status === null) { - $cur->comment_status = (integer) $this->settings->comments_pub; + $cur->comment_status = (integer) $this->settings->system->comments_pub; } # Words list diff -N -w -u -r dotclearorig/inc/core/class.dc.core.php dotclearns/inc/core/class.dc.core.php --- dotclearorig/inc/core/class.dc.core.php 2009-08-29 11:25:30.283875000 +0200 +++ dotclearns/inc/core/class.dc.core.php 2009-09-08 20:21:25.734375000 +0200 @@ -1051,7 +1051,7 @@ */ public function HTMLfilter($str) { - if ($this->blog instanceof dcBlog && !$this->blog->settings->enable_html_filter) { + if ($this->blog instanceof dcBlog && !$this->blog->settings->system->enable_html_filter) { return $str; } @@ -1330,10 +1330,10 @@ } $settings = new dcSettings($this,null); - $settings->setNameSpace('system'); + $settings->addNamespace('system'); foreach ($defaults as $v) { - $settings->put($v[0],$v[2],$v[1],$v[3],false,true); + $settings->system->put($v[0],$v[2],$v[1],$v[3],false,true); } } diff -N -w -u -r dotclearorig/inc/core/class.dc.media.php dotclearns/inc/core/class.dc.media.php --- dotclearorig/inc/core/class.dc.media.php 2009-08-29 11:25:30.143250000 +0200 +++ dotclearns/inc/core/class.dc.media.php 2009-08-29 14:26:33.987000000 +0200 @@ -63,7 +63,7 @@ $this->table = $this->core->prefix.'media'; $this->table_ref = $this->core->prefix.'post_media'; $root = $this->core->blog->public_path; - $root_url = $this->core->blog->host.path::clean($this->core->blog->settings->public_url); + $root_url = $this->core->blog->host.path::clean($this->core->blog->settings->system->public_url); if (!is_dir($root)) { throw new Exception(sprintf(__('Directory %s does not exist.'),$root)); @@ -74,12 +74,12 @@ parent::__construct($root,$root_url); $this->chdir(''); - $this->path = $this->core->blog->settings->public_path; + $this->path = $this->core->blog->settings->system->public_path; $this->addExclusion(DC_RC_PATH); $this->addExclusion(dirname(__FILE__).'/../'); - $this->exclude_pattern = $core->blog->settings->media_exclusion; + $this->exclude_pattern = $core->blog->settings->system->media_exclusion; # Event handlers $this->addFileHandler('image/jpeg','create',array($this,'imageThumbCreate')); @@ -97,9 +97,9 @@ $this->addFileHandler('image/jpeg','create',array($this,'imageMetaCreate')); # Thumbnails sizes - $this->thumb_sizes['m'][0] = abs($core->blog->settings->media_img_m_size); - $this->thumb_sizes['s'][0] = abs($core->blog->settings->media_img_s_size); - $this->thumb_sizes['t'][0] = abs($core->blog->settings->media_img_t_size); + $this->thumb_sizes['m'][0] = abs($core->blog->settings->system->media_img_m_size); + $this->thumb_sizes['s'][0] = abs($core->blog->settings->system->media_img_s_size); + $this->thumb_sizes['t'][0] = abs($core->blog->settings->system->media_img_t_size); } /** diff -N -w -u -r dotclearorig/inc/core/class.dc.rs.extensions.php dotclearns/inc/core/class.dc.rs.extensions.php --- dotclearorig/inc/core/class.dc.rs.extensions.php 2009-08-29 11:25:30.237000000 +0200 +++ dotclearns/inc/core/class.dc.rs.extensions.php 2009-08-29 14:30:39.893250000 +0200 @@ -124,10 +124,10 @@ public static function commentsActive(&$rs) { return - $rs->core->blog->settings->allow_comments + $rs->core->blog->settings->system->allow_comments && $rs->post_open_comment - && ($rs->core->blog->settings->comments_ttl == 0 || - time()-($rs->core->blog->settings->comments_ttl*86400) < $rs->getTS()); + && ($rs->core->blog->settings->system->comments_ttl == 0 || + time()-($rs->core->blog->settings->system->comments_ttl*86400) < $rs->getTS()); } /** @@ -139,10 +139,10 @@ public static function trackbacksActive(&$rs) { return - $rs->core->blog->settings->allow_trackbacks + $rs->core->blog->settings->system->allow_trackbacks && $rs->post_open_tb - && ($rs->core->blog->settings->trackbacks_ttl == 0 || - time()-($rs->core->blog->settings->trackbacks_ttl*86400) < $rs->getTS()); + && ($rs->core->blog->settings->system->trackbacks_ttl == 0 || + time()-($rs->core->blog->settings->system->trackbacks_ttl*86400) < $rs->getTS()); } /** @@ -248,7 +248,7 @@ if ($format) { return dt::dt2str($format,$rs->post_dt); } else { - return dt::dt2str($rs->core->blog->settings->date_format,$rs->post_dt); + return dt::dt2str($rs->core->blog->settings->system->date_format,$rs->post_dt); } } @@ -265,7 +265,7 @@ if ($format) { return dt::dt2str($format,$rs->post_dt); } else { - return dt::dt2str($rs->core->blog->settings->time_format,$rs->post_dt); + return dt::dt2str($rs->core->blog->settings->system->time_format,$rs->post_dt); } } @@ -451,7 +451,7 @@ if ($format) { return dt::dt2str($format,$rs->comment_dt); } else { - return dt::dt2str($rs->core->blog->settings->date_format,$rs->comment_dt); + return dt::dt2str($rs->core->blog->settings->system->date_format,$rs->comment_dt); } } @@ -468,7 +468,7 @@ if ($format) { return dt::dt2str($format,$rs->comment_dt); } else { - return dt::dt2str($rs->core->blog->settings->time_format,$rs->comment_dt); + return dt::dt2str($rs->core->blog->settings->system->time_format,$rs->comment_dt); } } @@ -517,7 +517,7 @@ { $res = $rs->comment_content; - if ($rs->core->blog->settings->comments_nofollow) { + if ($rs->core->blog->settings->system->comments_nofollow) { $res = preg_replace_callback('##ms',array('self','noFollowURL'),$res); } @@ -578,7 +578,7 @@ } $nofollow = ''; - if ($rs->core->blog->settings->comments_nofollow) { + if ($rs->core->blog->settings->system->comments_nofollow) { $nofollow = ' rel="nofollow"'; } diff -N -w -u -r dotclearorig/inc/core/class.dc.trackback.php dotclearns/inc/core/class.dc.trackback.php --- dotclearorig/inc/core/class.dc.trackback.php 2009-08-29 11:25:30.252625000 +0200 +++ dotclearns/inc/core/class.dc.trackback.php 2009-09-08 20:03:44.500000000 +0200 @@ -239,7 +239,7 @@ $cur->comment_content = (string) $comment; $cur->post_id = $post_id; $cur->comment_trackback = 1; - $cur->comment_status = $this->core->blog->settings->trackbacks_pub ? 1 : -1; + $cur->comment_status = $this->core->blog->settings->system->trackbacks_pub ? 1 : -1; $cur->comment_ip = http::realIP(); try diff -N -w -u -r dotclearorig/inc/core/class.dc.xmlrpc.php dotclearns/inc/core/class.dc.xmlrpc.php --- dotclearorig/inc/core/class.dc.xmlrpc.php 2009-08-29 11:25:30.174500000 +0200 +++ dotclearns/inc/core/class.dc.xmlrpc.php 2009-09-08 20:04:09.312500000 +0200 @@ -286,7 +286,7 @@ throw new Exception('Blog does not exist.'); } - if (!$this->core->blog->settings->enable_xmlrpc || + if (!$this->core->blog->settings->system->enable_xmlrpc || !$this->core->auth->check('usage,contentadmin',$this->core->blog->id)) { $this->core->blog = null; throw new Exception('Not enough permissions on this blog.'); @@ -411,7 +411,7 @@ $cur->post_position = (integer) $struct['wp_page_order']; } - $this->core->blog->settings->post_url_format = '{t}'; + $this->core->blog->settings->system->post_url_format = '{t}'; $post_id = $this->core->blog->addPost($cur); } @@ -514,7 +514,7 @@ $cur->post_position = (integer) $struct['wp_page_order']; } - $this->core->blog->settings->post_url_format = '{t}'; + $this->core->blog->settings->system->post_url_format = '{t}'; $this->core->blog->updPost($post_id,$cur); } @@ -847,8 +847,8 @@ private function translateWpOptions($options=array()) { $timezone = 0; - if ($this->core->blog->settings->blog_timezone) { - $timezone = dt::getTimeOffset($this->core->blog->settings->blog_timezone)/3600; + if ($this->core->blog->settings->system->blog_timezone) { + $timezone = dt::getTimeOffset($this->core->blog->settings->system->blog_timezone)/3600; } $res = array ( @@ -885,12 +885,12 @@ 'date_format' => array ( 'desc' => 'Date Format', 'readonly' => false, - 'value' => $this->core->blog->settings->date_format + 'value' => $this->core->blog->settings->system->date_format ), 'time_format' => array ( 'desc' => 'Time Format', 'readonly' => false, - 'value' => $this->core->blog->settings->time_format + 'value' => $this->core->blog->settings->system->time_format ) ); @@ -1543,7 +1543,7 @@ $blog_changes = false; $cur = $this->core->con->openCursor($this->core->prefix.'blog'); - $this->core->blog->settings->setNameSpace('system'); + $this->core->blog->settings->addNamespace('system'); foreach ($options as $name => $value) { @@ -1564,11 +1564,11 @@ $done[] = $name; break; case 'date_format': - $this->core->blog->settings->put('date_format',$value); + $this->core->blog->settings->system->put('date_format',$value); $done[] = $name; break; case 'time_format': - $this->core->blog->settings->put('time_format',$value); + $this->core->blog->settings->system->put('time_format',$value); $done[] = $name; break; } diff -N -w -u -r dotclearorig/inc/prepend.php dotclearns/inc/prepend.php --- dotclearorig/inc/prepend.php 2009-08-29 11:25:31.533875000 +0200 +++ dotclearns/inc/prepend.php 2009-08-29 13:30:23.752625000 +0200 @@ -10,7 +10,7 @@ # # -- END LICENSE BLOCK ------------------------------------ -/*== DC_DEBUG == +//*== DC_DEBUG == ini_set('display_errors',true); error_reporting(E_ALL | E_STRICT); define('DC_DEBUG',true); @@ -44,6 +44,7 @@ $__autoload['dcModules'] = dirname(__FILE__).'/core/class.dc.modules.php'; $__autoload['dcThemes'] = dirname(__FILE__).'/core/class.dc.themes.php'; $__autoload['dcRestServer'] = dirname(__FILE__).'/core/class.dc.rest.php'; +$__autoload['dcNamespace'] = dirname(__FILE__).'/core/class.dc.namespace.php'; $__autoload['dcSettings'] = dirname(__FILE__).'/core/class.dc.settings.php'; $__autoload['dcTrackback'] = dirname(__FILE__).'/core/class.dc.trackback.php'; $__autoload['dcUpdate'] = dirname(__FILE__).'/core/class.dc.update.php'; diff -N -w -u -r dotclearorig/inc/public/class.dc.template.php dotclearns/inc/public/class.dc.template.php --- dotclearorig/inc/public/class.dc.template.php 2009-08-29 11:25:31.643250000 +0200 +++ dotclearns/inc/public/class.dc.template.php 2009-08-29 14:16:53.408875000 +0200 @@ -19,8 +19,8 @@ { parent::__construct($cache_dir,$self_name); - $this->remove_php = !$core->blog->settings->tpl_allow_php; - $this->use_cache = $core->blog->settings->tpl_use_cache; + $this->remove_php = !$core->blog->settings->system->tpl_allow_php; + $this->use_cache = $core->blog->settings->system->tpl_use_cache; $this->tag_block = '|>)(.*?)'; $this->tag_value = '{{tpl:(%s)(\s(.*?))?}}'; @@ -737,7 +737,7 @@ public function BlogCopyrightNotice($attr) { $f = $this->getFilters($attr); - return 'blog->settings->copyright_notice').'; ?>'; + return 'blog->settings->system->copyright_notice').'; ?>'; } /*dtd @@ -755,7 +755,7 @@ public function BlogEditor($attr) { $f = $this->getFilters($attr); - return 'blog->settings->editor').'; ?>'; + return 'blog->settings->system->editor').'; ?>'; } /*dtd @@ -800,7 +800,7 @@ public function BlogLanguage($attr) { $f = $this->getFilters($attr); - return 'blog->settings->lang').'; ?>'; + return 'blog->settings->system->lang').'; ?>'; } /*dtd @@ -809,7 +809,7 @@ public function BlogThemeURL($attr) { $f = $this->getFilters($attr); - return 'blog->settings->themes_url."/".$core->blog->settings->theme').'; ?>'; + return 'blog->settings->system->themes_url."/".$core->blog->settings->system->theme').'; ?>'; } /*dtd @@ -818,7 +818,7 @@ public function BlogPublicURL($attr) { $f = $this->getFilters($attr); - return 'blog->settings->public_url').'; ?>'; + return 'blog->settings->system->public_url').'; ?>'; } /*dtd @@ -844,9 +844,9 @@ $f = $this->getFilters($attr); if ($rfc822) { - return 'blog->upddt,\$core->blog->settings->blog_timezone)").'; ?>'; + return 'blog->upddt,\$core->blog->settings->system->blog_timezone)").'; ?>'; } elseif ($iso8601) { - return 'blog->upddt,\$core->blog->settings->blog_timezone)").'; ?>'; + return 'blog->upddt,\$core->blog->settings->system->blog_timezone)").'; ?>'; } else { return 'blog->upddt)").'; ?>'; } @@ -897,7 +897,7 @@ public function BlogMetaRobots($attr) { $robots = isset($attr['robots']) ? addslashes($attr['robots']) : ''; - return "blog->settings->robots_policy,'".$robots."'); ?>"; + return "blog->settings->system->robots_policy,'".$robots."'); ?>"; } /* Categories ----------------------------------------- */ @@ -1630,7 +1630,7 @@ 'posts->post_lang) { '. 'echo '.sprintf($f,'$_ctx->posts->post_lang').'; '. '} else {'. - 'echo '.sprintf($f,'$core->blog->settings->lang').'; '. + 'echo '.sprintf($f,'$core->blog->settings->system->lang').'; '. '} ?>'; } @@ -2591,7 +2591,7 @@ public function PingNoFollow($attr) { return - 'blog->settings->comments_nofollow) { '. + 'blog->settings->system->comments_nofollow) { '. 'echo \' rel="nofollow"\';'. '} ?>'; } @@ -2773,7 +2773,7 @@ } if (isset($attr['blog_lang'])) { - $if[] = "\$core->blog->settings->lang == '".addslashes($attr['blog_lang'])."'"; + $if[] = "\$core->blog->settings->system->lang == '".addslashes($attr['blog_lang'])."'"; } if (isset($attr['current_tpl'])) { @@ -2814,17 +2814,17 @@ if (isset($attr['comments_active'])) { $sign = (boolean) $attr['comments_active'] ? '' : '!'; - $if[] = $sign.'$core->blog->settings->allow_comments'; + $if[] = $sign.'$core->blog->settings->system->allow_comments'; } if (isset($attr['pings_active'])) { $sign = (boolean) $attr['pings_active'] ? '' : '!'; - $if[] = $sign.'$core->blog->settings->allow_trackbacks'; + $if[] = $sign.'$core->blog->settings->system->allow_trackbacks'; } if (isset($attr['wiki_comments'])) { $sign = (boolean) $attr['wiki_comments'] ? '' : '!'; - $if[] = $sign.'$core->blog->settings->wiki_comments'; + $if[] = $sign.'$core->blog->settings->system->wiki_comments'; } if (isset($attr['search_count']) && diff -N -w -u -r dotclearorig/inc/public/lib.tpl.context.php dotclearns/inc/public/lib.tpl.context.php --- dotclearorig/inc/public/lib.tpl.context.php 2009-08-29 11:25:31.565125000 +0200 +++ dotclearns/inc/public/lib.tpl.context.php 2009-09-08 20:05:00.468750000 +0200 @@ -294,7 +294,7 @@ } $path[] = 'default'; $definition = $blog->themes_path.'/%s/smilies/smilies.txt'; - $base_url = $blog->settings->themes_url.'/%s/smilies/'; + $base_url = $blog->settings->system->themes_url.'/%s/smilies/'; $res = array(); @@ -346,7 +346,7 @@ global $core, $_ctx; - $p_url = $core->blog->settings->public_url; + $p_url = $core->blog->settings->system->public_url; $p_site = preg_replace('#^(.+?//.+?)/(.*)$#','$1',$core->blog->url); $p_root = $core->blog->public_path; diff -N -w -u -r dotclearorig/inc/public/lib.urlhandlers.php dotclearns/inc/public/lib.urlhandlers.php --- dotclearorig/inc/public/lib.urlhandlers.php 2009-08-29 11:25:31.612000000 +0200 +++ dotclearns/inc/public/lib.urlhandlers.php 2009-08-29 14:28:01.049500000 +0200 @@ -40,7 +40,7 @@ $core =& $GLOBALS['core']; if ($_ctx->nb_entry_per_page === null) { - $_ctx->nb_entry_per_page = $core->blog->settings->nb_post_per_page; + $_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_page; } $tpl_file = $core->tpl->getFilePath($tpl); @@ -275,7 +275,7 @@ if ($content != '') { - if ($core->blog->settings->wiki_comments) { + if ($core->blog->settings->system->wiki_comments) { $core->initWikiComment(); } else { $core->initWikiSimpleComment(); @@ -306,7 +306,7 @@ $cur->comment_email = html::clean($mail); $cur->comment_content = $content; $cur->post_id = $_ctx->posts->post_id; - $cur->comment_status = $core->blog->settings->comments_pub ? 1 : -1; + $cur->comment_status = $core->blog->settings->system->comments_pub ? 1 : -1; $cur->comment_ip = http::realIP(); $redir = $_ctx->posts->getURL(); @@ -448,10 +448,10 @@ $tpl = $type; if ($comments) { $tpl .= '-comments'; - $_ctx->nb_comment_per_page = $core->blog->settings->nb_comment_per_feed; + $_ctx->nb_comment_per_page = $core->blog->settings->system->nb_comment_per_feed; } else { - $_ctx->nb_entry_per_page = $core->blog->settings->nb_post_per_feed; - $_ctx->short_feed_items = $core->blog->settings->short_feed_items; + $_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_feed; + $_ctx->short_feed_items = $core->blog->settings->system->short_feed_items; } $tpl .= '.xml'; @@ -461,7 +461,7 @@ $_ctx->feed_subtitle = $subtitle; - header('X-Robots-Tag: '.context::robotsPolicy($core->blog->settings->robots_policy,'')); + header('X-Robots-Tag: '.context::robotsPolicy($core->blog->settings->system->robots_policy,'')); self::serveDocument($tpl,$mime); if (!$comments && !$cat_url) { $core->blog->publishScheduledEntries(); @@ -494,7 +494,7 @@ " http://www.dotclear.net/\n". ' '.html::escapeHTML($core->blog->url)."\n"; - if ($core->blog->settings->enable_xmlrpc) + if ($core->blog->settings->system->enable_xmlrpc) { $u = sprintf(DC_XMLRPC_URL,$core->blog->url,$core->blog->id); diff -N -w -u -r dotclearorig/inc/public/prepend.php dotclearns/inc/public/prepend.php --- dotclearorig/inc/public/prepend.php 2009-08-29 11:25:31.580750000 +0200 +++ dotclearns/inc/public/prepend.php 2009-08-29 14:52:58.033875000 +0200 @@ -49,7 +49,7 @@ } # Loading locales -$_lang = $core->blog->settings->lang; +$_lang = $core->blog->settings->system->lang; $_lang = preg_match('/^[a-z]{2}(-[a-z]{2})?$/',$_lang) ? $_lang : 'en'; if (l10n::set(dirname(__FILE__).'/../../locales/'.$_lang.'/date') === false && $_lang != 'en') { @@ -67,17 +67,17 @@ # Defining theme if not defined if (!isset($__theme)) { - $__theme = $core->blog->settings->theme; + $__theme = $core->blog->settings->system->theme; } if (!$core->themes->moduleExists($__theme)) { - $__theme = $core->blog->settings->theme = 'default'; + $__theme = $core->blog->settings->system->theme = 'default'; } $__parent_theme = $core->themes->moduleInfo($__theme,'parent'); if ($__parent_theme) { if (!$core->themes->moduleExists($__parent_theme)) { - $__theme = $core->blog->settings->theme = 'default'; + $__theme = $core->blog->settings->system->theme = 'default'; $__parent_theme = null; } } @@ -87,7 +87,7 @@ __error(__('Default theme not found.') ,__('This either means you removed your default theme or set a wrong theme '. 'path in your blog configuration. Please check theme_path value in '. - 'about:config module or reinstall default theme.') + 'about:config module or reinstall default theme. ('.$__theme.')') ,50); } @@ -115,7 +115,7 @@ dirname(__FILE__).'/default-templates', $core->tpl->getPath()); -$core->url->mode = $core->blog->settings->url_scan; +$core->url->mode = $core->blog->settings->system->url_scan; try { # --BEHAVIOR-- publicBeforeDocument diff -N -w -u -r dotclearorig/inc/public/rs.extension.php dotclearns/inc/public/rs.extension.php --- dotclearorig/inc/public/rs.extension.php 2009-08-29 11:25:31.627625000 +0200 +++ dotclearns/inc/public/rs.extension.php 2009-08-29 14:29:15.174500000 +0200 @@ -45,7 +45,7 @@ return $c; } - if ($rs->core->blog->settings->use_smilies) + if ($rs->core->blog->settings->system->use_smilies) { return self::smilies(parent::getContent($rs,$absolute_urls),$rs->core->blog); } @@ -55,7 +55,7 @@ public static function getExcerpt(&$rs,$absolute_urls=false) { - if ($rs->core->blog->settings->use_smilies) + if ($rs->core->blog->settings->system->use_smilies) { return self::smilies(parent::getExcerpt($rs,$absolute_urls),$rs->core->blog); } @@ -76,7 +76,7 @@ { public static function getContent(&$rs,$absolute_urls=false) { - if ($rs->core->blog->settings->use_smilies) + if ($rs->core->blog->settings->system->use_smilies) { $c = parent::getContent($rs,$absolute_urls); diff -N -w -u -r dotclearorig/plugins/aboutConfig/index.php dotclearns/plugins/aboutConfig/index.php --- dotclearorig/plugins/aboutConfig/index.php 2009-08-29 11:25:37.580750000 +0200 +++ dotclearns/plugins/aboutConfig/index.php 2009-09-08 20:05:41.734375000 +0200 @@ -18,10 +18,10 @@ { foreach ($_POST['s'] as $ns => $s) { - $core->blog->settings->setNameSpace($ns); + $core->blog->settings->addNamespace($ns); foreach ($s as $k => $v) { - $core->blog->settings->put($k,$v); + $core->blog->settings->$ns->put($k,$v); } $core->blog->triggerBlog(); @@ -42,10 +42,10 @@ { foreach ($_POST['gs'] as $ns => $s) { - $core->blog->settings->setNameSpace($ns); + $core->blog->settings->addNamespace($ns); foreach ($s as $k => $v) { - $core->blog->settings->put($k,$v,null,null,true,true); + $core->blog->settings->$ns->put($k,$v,null,null,true,true); } $core->blog->triggerBlog(); @@ -115,8 +115,10 @@ blog->settings->dumpSettings() as $k => $v) { - $settings[$v['ns']][$k] = $v; +foreach ($core->blog->settings->dumpNamespaces() as $ns => $namespace) { + foreach ($namespace->dumpSettings() as $k => $v) { + $settings[$ns][$k] = $v; + } } ksort($settings); @@ -151,8 +153,10 @@ blog->settings->dumpGlobalSettings() as $k => $v) { - $settings[$v['ns']][$k] = $v; +foreach ($core->blog->settings->dumpNamespaces() as $ns => $namespace) { + foreach ($namespace->dumpGlobalSettings() as $k => $v) { + $settings[$ns][$k] = $v; + } } ksort($settings); diff -N -w -u -r dotclearorig/plugins/akismet/class.dc.filter.akismet.php dotclearns/plugins/akismet/class.dc.filter.akismet.php --- dotclearorig/plugins/akismet/class.dc.filter.akismet.php 2009-08-29 11:25:37.518250000 +0200 +++ dotclearns/plugins/akismet/class.dc.filter.akismet.php 2009-09-08 19:56:56.281250000 +0200 @@ -39,11 +39,11 @@ { $blog =& $this->core->blog; - if (!$blog->settings->ak_key) { + if (!$blog->settings->akismet->ak_key) { return false; } - return new akismet($blog->url,$blog->settings->ak_key); + return new akismet($blog->url,$blog->settings->akismet->ak_key); } public function isSpam($type,$author,$email,$site,$ip,$content,$post_id,&$status) @@ -103,7 +103,7 @@ { $blog =& $this->core->blog; - $ak_key = $blog->settings->ak_key; + $ak_key = $blog->settings->akismet->ak_key; $ak_verified = null; if (isset($_POST['ak_key'])) @@ -112,8 +112,8 @@ { $ak_key = $_POST['ak_key']; - $blog->settings->setNameSpace('akismet'); - $blog->settings->put('ak_key',$ak_key,'string'); + $blog->settings->addNamespace('akismet'); + $blog->settings->akismet->put('ak_key',$ak_key,'string'); http::redirect($url.'&up=1'); } @@ -123,10 +123,10 @@ } } - if ($blog->settings->ak_key) + if ($blog->settings->akismet->ak_key) { try { - $ak = new akismet($blog->url,$blog->settings->ak_key); + $ak = new akismet($blog->url,$blog->settings->akismet->ak_key); $ak_verified = $ak->verify(); } catch (Exception $e) { $this->core->error->add($e->getMessage()); diff -N -w -u -r dotclearorig/plugins/antispam/_admin.php dotclearns/plugins/antispam/_admin.php --- dotclearorig/plugins/antispam/_admin.php 2009-08-29 11:25:37.080750000 +0200 +++ dotclearns/plugins/antispam/_admin.php 2009-09-08 20:07:57.625000000 +0200 @@ -32,10 +32,11 @@ { public static function adminBlogPreferencesForm(&$core,&$settings) { + $ttl = $settings instanceof dcSettings ? 0 : $settings->antispam->antispam_moderation_ttl; echo '
Antispam'. '

'. '
'; @@ -43,9 +44,8 @@ public static function adminBeforeBlogSettingsUpdate(&$settings) { - $settings->setNameSpace('antispam'); - $settings->put('antispam_moderation_ttl',(integer)$_POST['antispam_moderation_ttl']); - $settings->setNameSpace('system'); + $settings->addNamespace('antispam'); + $settings->antispam->put('antispam_moderation_ttl',(integer)$_POST['antispam_moderation_ttl']); } } ?> diff -N -w -u -r dotclearorig/plugins/antispam/filters/class.dc.filter.iplookup.php dotclearns/plugins/antispam/filters/class.dc.filter.iplookup.php --- dotclearorig/plugins/antispam/filters/class.dc.filter.iplookup.php 2009-08-29 11:25:37.049500000 +0200 +++ dotclearns/plugins/antispam/filters/class.dc.filter.iplookup.php 2009-09-08 19:57:40.656250000 +0200 @@ -67,8 +67,8 @@ if (isset($_POST['bls'])) { try { - $this->core->blog->settings->setNameSpace('antispam'); - $this->core->blog->settings->put('antispam_dnsbls',$_POST['bls'],'string','Antispam DNSBL servers',true,false); + $this->core->blog->settings->addNamespace('antispam'); + $this->core->blog->settings->antispam->put('antispam_dnsbls',$_POST['bls'],'string','Antispam DNSBL servers',true,false); http::redirect($url.'&upd=1'); } catch (Exception $e) { $core->error->add($e->getMessage()); @@ -94,10 +94,10 @@ private function getServers() { - $bls = $this->core->blog->settings->antispam_dnsbls; + $bls = $this->core->blog->settings->antispam->antispam_dnsbls; if ($bls === null) { - $this->core->blog->settings->setNameSpace('antispam'); - $this->core->blog->settings->put('antispam_dnsbls',$this->default_bls,'string','Antispam DNSBL servers',true,false); + $this->core->blog->settings->addNamespace('antispam'); + $this->core->blog->settings->antispam->put('antispam_dnsbls',$this->default_bls,'string','Antispam DNSBL servers',true,false); return $this->default_bls; } diff -N -w -u -r dotclearorig/plugins/antispam/inc/class.dc.spamfilters.php dotclearns/plugins/antispam/inc/class.dc.spamfilters.php --- dotclearorig/plugins/antispam/inc/class.dc.spamfilters.php 2009-08-29 11:25:36.862000000 +0200 +++ dotclearns/plugins/antispam/inc/class.dc.spamfilters.php 2009-09-08 20:06:29.750000000 +0200 @@ -122,17 +122,17 @@ public function saveFilterOpts($opts,$global=false) { - $this->core->blog->settings->setNameSpace('antispam'); + $this->core->blog->settings->addNamespace('antispam'); if ($global) { - $this->core->blog->settings->drop('antispam_filters'); + $this->core->blog->settings->antispam->drop('antispam_filters'); } - $this->core->blog->settings->put('antispam_filters',serialize($opts),'string','Antispam Filters',true,$global); + $this->core->blog->settings->antispam->put('antispam_filters',serialize($opts),'string','Antispam Filters',true,$global); } private function setFilterOpts() { - if ($this->core->blog->settings->antispam_filters !== null) { - $this->filters_opt = @unserialize($this->core->blog->settings->antispam_filters); + if ($this->core->blog->settings->antispam->antispam_filters !== null) { + $this->filters_opt = @unserialize($this->core->blog->settings->antispam->antispam_filters); } # Create default options if needed diff -N -w -u -r dotclearorig/plugins/antispam/inc/lib.dc.antispam.php dotclearns/plugins/antispam/inc/lib.dc.antispam.php --- dotclearorig/plugins/antispam/inc/lib.dc.antispam.php 2009-08-29 11:25:36.877625000 +0200 +++ dotclearns/plugins/antispam/inc/lib.dc.antispam.php 2009-09-08 20:07:27.406250000 +0200 @@ -161,17 +161,17 @@ $init = false; // settings - $core->blog->settings->setNameSpace('antispam'); + $core->blog->settings->addNamespace('antispam'); - $dateLastPurge = $core->blog->settings->antispam_date_last_purge; + $dateLastPurge = $core->blog->settings->antispam->antispam_date_last_purge; if ($dateLastPurge === null) { $init = true; - $core->blog->settings->put('antispam_date_last_purge',$defaultDateLastPurge,'integer','Antispam Date Last Purge (unix timestamp)',true,false); + $core->blog->settings->antispam->put('antispam_date_last_purge',$defaultDateLastPurge,'integer','Antispam Date Last Purge (unix timestamp)',true,false); $dateLastPurge = $defaultDateLastPurge; } - $moderationTTL = $core->blog->settings->antispam_moderation_ttl; + $moderationTTL = $core->blog->settings->antispam->antispam_moderation_ttl; if ($moderationTTL === null) { - $core->blog->settings->put('antispam_moderation_ttl',$defaultModerationTTL,'integer','Antispam Moderation TTL (days)',true,false); + $core->blog->settings->antispam->put('antispam_moderation_ttl',$defaultModerationTTL,'integer','Antispam Moderation TTL (days)',true,false); $moderationTTL = $defaultModerationTTL; } @@ -184,7 +184,7 @@ if ((time()-$dateLastPurge) > (86400)) { // update dateLastPurge if (!$init) { - $core->blog->settings->put('antispam_date_last_purge',time(),null,null,true,false); + $core->blog->settings->antispam->put('antispam_date_last_purge',time(),null,null,true,false); } $date = date('Y-m-d H:i:s', time() - $moderationTTL*86400); dcAntispam::delAllSpam($core, $date); diff -N -w -u -r dotclearorig/plugins/antispam/index.php dotclearns/plugins/antispam/index.php --- dotclearorig/plugins/antispam/index.php 2009-08-29 11:25:37.080750000 +0200 +++ dotclearns/plugins/antispam/index.php 2009-09-08 18:51:59.234375000 +0200 @@ -121,7 +121,7 @@ # Information $spam_count = dcAntispam::countSpam($core); $published_count = dcAntispam::countPublishedComments($core); - $moderationTTL = $core->blog->settings->antispam_moderation_ttl; + $moderationTTL = $core->blog->settings->antispam->antispam_moderation_ttl; echo ''. diff -N -w -u -r dotclearorig/plugins/blowupConfig/_public.php dotclearns/plugins/blowupConfig/_public.php --- dotclearorig/plugins/blowupConfig/_public.php 2009-08-29 11:25:37.987000000 +0200 +++ dotclearns/plugins/blowupConfig/_public.php 2009-08-29 14:45:36.252625000 +0200 @@ -11,7 +11,7 @@ # -- END LICENSE BLOCK ------------------------------------ if (!defined('DC_RC_PATH')) { return; } -if ($core->blog->settings->theme != 'default') { +if ($core->blog->settings->system->theme != 'default') { return; } @@ -27,7 +27,7 @@ public static function blowUpStyleHelper() { - $s = $GLOBALS['core']->blog->settings->blowup_style; + $s = $GLOBALS['core']->blog->settings->themes->blowup_style; if ($s === null) { return; diff -N -w -u -r dotclearorig/plugins/blowupConfig/index.php dotclearns/plugins/blowupConfig/index.php --- dotclearorig/plugins/blowupConfig/index.php 2009-08-29 11:25:38.002625000 +0200 +++ dotclearns/plugins/blowupConfig/index.php 2009-09-08 19:58:28.546875000 +0200 @@ -74,11 +74,11 @@ 'footer_bg_c' => null, ); -$blowup_user = $core->blog->settings->blowup_style; +$blowup_user = $core->blog->settings->themes->blowup_style; if ($blowup_user === null) { - $core->blog->settings->setNamespace('themes'); - $core->blog->settings->put('blowup_style','','string','Blow Up custom style',true); + $core->blog->settings->addNamespace('themes'); + $core->blog->settings->themes->put('blowup_style','','string','Blow Up custom style',true); } $blowup_user = @unserialize($blowup_user); @@ -184,8 +184,8 @@ blowupConfig::createImages($blowup_user,$uploaded); } - $core->blog->settings->setNamespace('themes'); - $core->blog->settings->put('blowup_style',serialize($blowup_user)); + $core->blog->settings->addNamespace('themes'); + $core->blog->settings->themes->put('blowup_style',serialize($blowup_user)); $core->blog->triggerBlog(); http::redirect($p_url.'&upd=1'); diff -N -w -u -r dotclearorig/plugins/blowupConfig/lib/class.blowup.config.php dotclearns/plugins/blowupConfig/lib/class.blowup.config.php --- dotclearorig/plugins/blowupConfig/lib/class.blowup.config.php 2009-08-29 11:25:37.940125000 +0200 +++ dotclearns/plugins/blowupConfig/lib/class.blowup.config.php 2009-09-08 20:08:27.406250000 +0200 @@ -142,7 +142,7 @@ public static function imagesURL() { global $core; - return $core->blog->settings->public_url.'/blowup-images'; + return $core->blog->settings->system->public_url.'/blowup-images'; } public static function canWriteImages($create=false) diff -N -w -u -r dotclearorig/plugins/pages/_public.php dotclearns/plugins/pages/_public.php --- dotclearorig/plugins/pages/_public.php 2009-08-29 11:25:36.549500000 +0200 +++ dotclearns/plugins/pages/_public.php 2009-09-08 20:09:50.625000000 +0200 @@ -105,7 +105,7 @@ if ($content != '') { - if ($core->blog->settings->wiki_comments) { + if ($core->blog->settings->system->wiki_comments) { $core->initWikiComment(); } else { $core->initWikiSimpleComment(); @@ -133,7 +133,7 @@ $cur->comment_email = html::clean($mail); $cur->comment_content = $content; $cur->post_id = $_ctx->posts->post_id; - $cur->comment_status = $core->blog->settings->comments_pub ? 1 : -1; + $cur->comment_status = $core->blog->settings->system->comments_pub ? 1 : -1; $cur->comment_ip = http::realIP(); $redir = $_ctx->posts->getURL(); diff -N -w -u -r dotclearorig/plugins/pages/page.php dotclearns/plugins/pages/page.php --- dotclearorig/plugins/pages/page.php 2009-08-29 11:25:36.518250000 +0200 +++ dotclearns/plugins/pages/page.php 2009-09-08 20:09:31.109375000 +0200 @@ -177,7 +177,7 @@ $cur = $core->con->openCursor($core->prefix.'post'); # Magic tweak :) - $core->blog->settings->post_url_format = $page_url_format; + $core->blog->settings->system->post_url_format = $page_url_format; $cur->post_type = 'page'; $cur->post_title = $post_title; diff -N -w -u -r dotclearorig/plugins/pings/index.php dotclearns/plugins/pings/index.php --- dotclearorig/plugins/pings/index.php 2009-08-29 11:25:36.815125000 +0200 +++ dotclearns/plugins/pings/index.php 2009-09-08 19:11:17.156250000 +0200 @@ -16,20 +16,20 @@ try { # Create settings if they don't exist - if ($core->blog->settings->pings_active === null) + if ($core->blog->settings->pings->pings_active === null) { $default_pings_uris = array( 'Ping-o-Matic!' => 'http://rpc.pingomatic.com/', 'Google Blog Search' => 'http://blogsearch.google.com/ping/RPC2' ); - $core->blog->settings->setNameSpace('pings'); - $core->blog->settings->put('pings_active',1,'boolean','Activate pings plugin',true,true); - $core->blog->settings->put('pings_uris',serialize($default_pings_uris),'string','Pings services URIs',true,true); + $core->blog->settings->addNamespace('pings'); + $core->blog->settings->pings->put('pings_active',1,'boolean','Activate pings plugin',true,true); + $core->blog->settings->pings->put('pings_uris',serialize($default_pings_uris),'string','Pings services URIs',true,true); http::redirect($p_url); } - $pings_uris = @unserialize($core->blog->settings->pings_uris); + $pings_uris = @unserialize($core->blog->settings->pings->pings_uris); if (!$pings_uris) { $pings_uris = array(); } @@ -46,9 +46,9 @@ } } - $core->blog->settings->setNameSpace('pings'); - $core->blog->settings->put('pings_active',!empty($_POST['pings_active']),null,null,true,true); - $core->blog->settings->put('pings_uris',serialize($pings_uris),null,null,true,true); + $core->blog->settings->addNamespace('pings'); + $core->blog->settings->pings->put('pings_active',!empty($_POST['pings_active']),null,null,true,true); + $core->blog->settings->pings->put('pings_uris',serialize($pings_uris),null,null,true,true); http::redirect($p_url.'&up=1'); } } @@ -72,7 +72,7 @@ echo ''. -'

'; foreach ($pings_uris as $n => $u) diff -N -w -u -r dotclearorig/plugins/pings/lib.pings.php dotclearns/plugins/pings/lib.pings.php --- dotclearorig/plugins/pings/lib.pings.php 2009-08-29 11:25:36.768250000 +0200 +++ dotclearns/plugins/pings/lib.pings.php 2009-09-08 20:10:46.093750000 +0200 @@ -37,11 +37,11 @@ public static function pingsForm(&$post) { $core =& $GLOBALS['core']; - if (!$core->blog->settings->pings_active) { + if (!$core->blog->settings->pings->pings_active) { return; } - $pings_uris = @unserialize($core->blog->settings->pings_uris); + $pings_uris = @unserialize($core->blog->settings->pings->pings_uris); if (empty($pings_uris) || !is_array($pings_uris)) { return; } @@ -69,11 +69,11 @@ } $core =& $GLOBALS['core']; - if (!$core->blog->settings->pings_active) { + if (!$core->blog->settings->pings->pings_active) { return; } - $pings_uris = @unserialize($core->blog->settings->pings_uris); + $pings_uris = @unserialize($core->blog->settings->pings->pings_uris); if (empty($pings_uris) || !is_array($pings_uris)) { return; } diff -N -w -u -r dotclearorig/plugins/themeEditor/class.themeEditor.php dotclearns/plugins/themeEditor/class.themeEditor.php --- dotclearorig/plugins/themeEditor/class.themeEditor.php 2009-08-29 11:25:37.205750000 +0200 +++ dotclearns/plugins/themeEditor/class.themeEditor.php 2009-09-08 20:15:14.171875000 +0200 @@ -27,9 +27,9 @@ { $this->core =& $core; $this->default_theme = path::real($this->core->blog->themes_path.'/default'); - $this->user_theme = path::real($this->core->blog->themes_path.'/'.$this->core->blog->settings->theme); + $this->user_theme = path::real($this->core->blog->themes_path.'/'.$this->core->blog->settings->system->theme); if (null !== $this->core->themes) { - $parent_theme = $this->core->themes->moduleInfo($this->core->blog->settings->theme,'parent'); + $parent_theme = $this->core->themes->moduleInfo($this->core->blog->settings->system->theme,'parent'); if ($parent_theme) { $this->parent_theme = path::real($this->core->blog->themes_path.'/'.$parent_theme); } diff -N -w -u -r dotclearorig/plugins/themeEditor/index.php dotclearns/plugins/themeEditor/index.php --- dotclearorig/plugins/themeEditor/index.php 2009-08-29 11:25:37.205750000 +0200 +++ dotclearns/plugins/themeEditor/index.php 2009-09-08 20:11:19.390625000 +0200 @@ -18,7 +18,7 @@ # Loading themes $core->themes = new dcThemes($core); $core->themes->loadModules($core->blog->themes_path,null); -$T = $core->themes->getModules($core->blog->settings->theme); +$T = $core->themes->getModules($core->blog->settings->system->theme); $o = new dcThemeEditor($core); try @@ -72,7 +72,7 @@

-blog->settings->theme == 'default') { ?> +blog->settings->system->theme == 'default') { ?>

diff -N -w -u -r dotclearorig/plugins/widgets/_public.php dotclearns/plugins/widgets/_public.php --- dotclearorig/plugins/widgets/_public.php 2009-08-29 11:25:37.768250000 +0200 +++ dotclearns/plugins/widgets/_public.php 2009-09-08 20:12:39.671875000 +0200 @@ -32,7 +32,7 @@ public static function widgetsHandler($type) { $wtype = 'widgets_'.$type; - $widgets = $GLOBALS['core']->blog->settings->{$wtype}; + $widgets = $GLOBALS['core']->blog->settings->widgets->{$wtype}; if (!$widgets) { // If widgets value is empty, get defaults $widgets = self::defaultWidgets($type); diff -N -w -u -r dotclearorig/plugins/widgets/_widgets_functions.php dotclearns/plugins/widgets/_widgets_functions.php --- dotclearorig/plugins/widgets/_widgets_functions.php 2009-08-29 11:25:37.768250000 +0200 +++ dotclearns/plugins/widgets/_widgets_functions.php 2009-08-29 14:32:33.877625000 +0200 @@ -200,7 +200,7 @@ 'title="'.sprintf($p_title,($type == 'atom' ? 'Atom' : 'RSS')).'" class="feed">'. __('Entries feed').''; - if ($core->blog->settings->allow_comments || $core->blog->settings->allow_trackbacks) + if ($core->blog->settings->system->allow_comments || $core->blog->settings->system->allow_trackbacks) { $res .= '
  • blog->settings->widgets_nav) { - $widgets_nav = dcWidgets::load($core->blog->settings->widgets_nav); +if ($core->blog->settings->widgets->widgets_nav) { + $widgets_nav = dcWidgets::load($core->blog->settings->widgets->widgets_nav); } $widgets_extra = null; -if ($core->blog->settings->widgets_extra) { - $widgets_extra = dcWidgets::load($core->blog->settings->widgets_extra); +if ($core->blog->settings->widgets->widgets_extra) { + $widgets_extra = dcWidgets::load($core->blog->settings->widgets->widgets_extra); } $append_combo = array( @@ -64,9 +64,9 @@ } try { - $core->blog->settings->setNameSpace('widgets'); - $core->blog->settings->put('widgets_nav',$widgets_nav->store()); - $core->blog->settings->put('widgets_extra',$widgets_extra->store()); + $core->blog->settings->addNamespace('widgets'); + $core->blog->settings->widgets->put('widgets_nav',$widgets_nav->store()); + $core->blog->settings->widgets->put('widgets_extra',$widgets_extra->store()); $core->blog->triggerBlog(); http::redirect($p_url); } catch (Exception $e) { @@ -104,9 +104,9 @@ $widgets_nav = dcWidgets::loadArray($_POST['w']['nav'],$__widgets); $widgets_extra = dcWidgets::loadArray($_POST['w']['extra'],$__widgets); - $core->blog->settings->setNameSpace('widgets'); - $core->blog->settings->put('widgets_nav',$widgets_nav->store()); - $core->blog->settings->put('widgets_extra',$widgets_extra->store()); + $core->blog->settings->addNamespace('widgets'); + $core->blog->settings->widgets->put('widgets_nav',$widgets_nav->store()); + $core->blog->settings->widgets->put('widgets_extra',$widgets_extra->store()); $core->blog->triggerBlog(); http::redirect($p_url); @@ -120,9 +120,9 @@ { try { - $core->blog->settings->setNameSpace('widgets'); - $core->blog->settings->put('widgets_nav',''); - $core->blog->settings->put('widgets_extra',''); + $core->blog->settings->addNamespace('widgets'); + $core->blog->settings->widgets->put('widgets_nav',''); + $core->blog->settings->widgets->put('widgets_extra',''); $core->blog->triggerBlog(); http::redirect($p_url); diff -N -w -u -r dotclearorig/themes/customCSS/_public.php dotclearns/themes/customCSS/_public.php --- dotclearorig/themes/customCSS/_public.php 2009-08-29 11:25:36.080750000 +0200 +++ dotclearns/themes/customCSS/_public.php 2009-09-08 20:12:08.125000000 +0200 @@ -19,7 +19,7 @@ { echo '\n"; } }