';
- 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 = '
';
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
'';
@@ -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
'