From da21429d0755417d438085e43781e6a6d5406039 Mon Sep 17 00:00:00 2001 From: Dimo Belov Date: Wed, 11 Jul 2018 01:10:45 +0300 Subject: [PATCH] Some changes for last version --- bl-kernel/abstract/dblist.class.php | 10 ++++---- bl-kernel/admin/themes/booty/login.php | 5 ++-- bl-kernel/admin/views/edit-content.php | 35 +++++++++++++------------- bl-kernel/admin/views/new-content.php | 22 ++++++++++------ bl-kernel/boot/variables.php | 5 +++- bl-kernel/dbpages.class.php | 6 +++-- bl-kernel/helpers/log.class.php | 16 ++++++------ bl-kernel/helpers/text.class.php | 5 ++-- bl-kernel/page.class.php | 2 +- 9 files changed, 59 insertions(+), 47 deletions(-) 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 @@
-
- -
- - - g('Cancel') ?> -
+ @@ -196,9 +190,21 @@ 'label'=>'Template', 'placeholder'=>'' )); - ?> + ?> + +
+ + + + g('Cancel') ?> + +