diff --git a/bl-kernel/abstract/dblist.class.php b/bl-kernel/abstract/dblist.class.php
index 76bba0bf..9268079c 100644
--- a/bl-kernel/abstract/dblist.class.php
+++ b/bl-kernel/abstract/dblist.class.php
@@ -44,7 +44,7 @@ class dbList extends dbJSON
return $list;
}
- if (count($list) < $amountOfItems) {
+ if (count($list) < $amountOfItems) {
return $list;
}
@@ -99,12 +99,12 @@ class dbList extends dbJSON
public function edit($args)
{
- if (isset($this->db[$args['newKey']])) {
- Log::set(__METHOD__.LOG_SEP.'The new key already exists. Key: '.$args['newKey']);
- //this not allow to edit existing category
- //return false;
+ if ( isset($this->db[$args['newKey']]) && ($args['newKey']!==$args['oldKey']) ) {
+ Log::set(__METHOD__.LOG_SEP.'The new key already exists. Key: '.$args['newKey'], LOG_TYPE_WARN);
+ return false;
}
+
$this->db[$args['newKey']]['name'] = $args['name'];
$this->db[$args['newKey']]['template'] = isset($args['template'])?$args['template']:'';
$this->db[$args['newKey']]['list'] = $this->db[$args['oldKey']]['list'];
diff --git a/bl-kernel/admin/themes/booty/login.php b/bl-kernel/admin/themes/booty/login.php
index 1b214766..16525e28 100644
--- a/bl-kernel/admin/themes/booty/login.php
+++ b/bl-kernel/admin/themes/booty/login.php
@@ -12,10 +12,9 @@
diff --git a/bl-kernel/admin/views/edit-content.php b/bl-kernel/admin/views/edit-content.php
index f81f640c..c67861d4 100644
--- a/bl-kernel/admin/views/edit-content.php
+++ b/bl-kernel/admin/views/edit-content.php
@@ -74,7 +74,7 @@
-
+
@@ -175,9 +175,10 @@
));
?>
+
@@ -281,9 +287,11 @@
});
});
-
+
+
+
-
-
diff --git a/bl-kernel/admin/views/new-content.php b/bl-kernel/admin/views/new-content.php
index 3477e1fc..dc2c7b9c 100644
--- a/bl-kernel/admin/views/new-content.php
+++ b/bl-kernel/admin/views/new-content.php
@@ -68,13 +68,7 @@
-
-
-
+
@@ -196,9 +190,21 @@
'label'=>'Template',
'placeholder'=>''
));
- ?>
+ ?>
+
+
diff --git a/bl-kernel/boot/variables.php b/bl-kernel/boot/variables.php
index f92696d0..4efc9d2b 100644
--- a/bl-kernel/boot/variables.php
+++ b/bl-kernel/boot/variables.php
@@ -5,8 +5,11 @@
If you are going to change some variable from here is recommended do it before the installation
*/
-// Log separator
+// Log
define('LOG_SEP', ' | ');
+define('LOG_TYPE_INFO', '[INFO]');
+define('LOG_TYPE_WARN', '[WARN]');
+define('LOG_TYPE_ERROR', '[ERROR]');
// Protecting against Symlink attacks
define('CHECK_SYMBOLIC_LINKS', TRUE);
diff --git a/bl-kernel/dbpages.class.php b/bl-kernel/dbpages.class.php
index c16e6b49..3811aef8 100644
--- a/bl-kernel/dbpages.class.php
+++ b/bl-kernel/dbpages.class.php
@@ -91,7 +91,8 @@ class dbPages extends dbJSON
$args['status'] = 'scheduled';
}
- // Set type of the page
+ // Set type of the page
+ // may be not needed
if ($args['status']=='static') {
$args['type'] = 'static';
}
@@ -346,7 +347,8 @@ class dbPages extends dbJSON
{
$tmp = $this->db;
foreach ($tmp as $key=>$fields) {
- if ($fields['status']!='published' || $fields['type'] != "") {
+// do not want sticky and static pages here
+ if ($fields['status']!='published' || !empty($fields['type'])) {
unset($tmp[$key]);
}
}
diff --git a/bl-kernel/helpers/log.class.php b/bl-kernel/helpers/log.class.php
index db4fe992..c589ba17 100644
--- a/bl-kernel/helpers/log.class.php
+++ b/bl-kernel/helpers/log.class.php
@@ -2,18 +2,20 @@
class Log {
- public static function set($text, $type=0)
+ public static function set($text, $type=LOG_TYPE_INFO)
{
+ $messageType = 0;
+
if (is_array($text) ) {
- error_log('------------------------', $type);
- error_log('Array', $type);
- error_log('------------------------', $type);
+ error_log('------------------------', $messageType);
+ error_log('Array', $messageType);
+ error_log('------------------------', $messageType);
foreach ($text as $key=>$value) {
- error_log($key.'=>'.$value, $type);
+ error_log($key.'=>'.$value, $messageType);
}
- error_log('------------------------', $type);
+ error_log('------------------------', $messageType);
}
- error_log('('.BLUDIT_VERSION.') ('.$_SERVER['REQUEST_URI'].') '.$text, $type);
+ error_log($type.' ['.BLUDIT_VERSION.'] ['.$_SERVER['REQUEST_URI'].'] '.$text, $messageType);
}
}
diff --git a/bl-kernel/helpers/text.class.php b/bl-kernel/helpers/text.class.php
index cf9478a8..3b491130 100644
--- a/bl-kernel/helpers/text.class.php
+++ b/bl-kernel/helpers/text.class.php
@@ -147,11 +147,10 @@ class Text {
}
$string = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $string);
- $string = trim($string, '-');
$string = self::lowercase($string);
$string = preg_replace("/[\/_|+ -]+/", $separator, $string);
- //trim separator
- $string = trim($string, $separator);
+ $string = trim($string, '-');
+
return $string;
}
diff --git a/bl-kernel/page.class.php b/bl-kernel/page.class.php
index 0abbcf1d..775ee16b 100644
--- a/bl-kernel/page.class.php
+++ b/bl-kernel/page.class.php
@@ -408,7 +408,7 @@ class Page {
return $this->getValue('status');
}
- public function type()
+ public function type()
{
return $this->getValue('type');
}