summaryrefslogtreecommitdiffstats
path: root/admin/post
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-05-30 21:03:03 +0200
committerThomas Lange <code@nerdmind.de>2017-05-30 21:03:03 +0200
commitfd6af01e313f441189c4cd69668766d2ded7ced3 (patch)
tree0a0ae7cb2dd19c2a52b0799c37bb53b0e5e9e892 /admin/post
parent1f1de386b09e48a02fccd62aa82ff319533969cc (diff)
downloadblog-2.2.tar.gz
blog-2.2.tar.xz
blog-2.2.zip
Several changes have been made in this commit, which together with the previous commits result in version 2.2 [changed template parameters]:v2.2
+ Implemented [core]: A new method called "getAll" has been added to the "Attribute" class which now returns all attributes as key->value array. The first parameter can be an array with attribute names which shall be excluded from returning. + Optimization [core]: The function "generateItemData" has been renamed to "generateItemTemplateData" and has been restructured to use the new implemented method "getAll" from the "Attribute" class. + Optimization [core]: The function "generateNaviTemplate" has been added and the functions "generatePageNaviTemplate", "generatePostNaviTemplate" and "generateUserNaviTemplate" have been restructured to make use of the new "generateNaviTemplate" function to reduce duplicate code. + Optimization [core]: Several files within the admin directory has been optimized to use the new "getAll" method of the "Attribute" class. + Optimization [core]: Several code optimizations have been made to the "HTTP" class. + Optimization [admin template]: All occurences of $PAGE['ID'], $POST['ID'] and $USER['ID'] have been replaced with $PAGE['ATTR']['ID'], $POST['ATTR']['ID'] and $USER['ATTR']['ID'] to make it more consistent. You now have to use ['ATTR']['ID'] instead of ['ID'] in your templates to get the ID of an item! Template upgrade to version 2.2 (only for customized templates): SEARCH: ['ID'] REPLACE: ['ATTR']['ID']
Diffstat (limited to 'admin/post')
-rw-r--r--admin/post/delete.php7
-rw-r--r--admin/post/insert.php11
-rw-r--r--admin/post/update.php11
3 files changed, 3 insertions, 26 deletions
diff --git a/admin/post/delete.php b/admin/post/delete.php
index a5151ff..80f3a70 100644
--- a/admin/post/delete.php
+++ b/admin/post/delete.php
@@ -36,12 +36,7 @@ try {
$FormTemplate->set('FORM', [
'TYPE' => 'DELETE',
'INFO' => $messages ?? [],
- 'DATA' => [
- 'ID' => $Attribute->get('id'),
- 'BODY' => $Attribute->get('body'),
- 'TIME_INSERT' => $Attribute->get('time_insert'),
- 'TIME_UPDATE' => $Attribute->get('time_update'),
- ],
+ 'DATA' => array_change_key_case($Attribute->getAll(), CASE_UPPER),
'TOKEN' => Application::getSecurityToken()
]);
diff --git a/admin/post/insert.php b/admin/post/insert.php
index 4587a87..8e08fb3 100644
--- a/admin/post/insert.php
+++ b/admin/post/insert.php
@@ -56,16 +56,7 @@ try {
$FormTemplate->set('FORM', [
'TYPE' => 'INSERT',
'INFO' => $messages ?? [],
- 'DATA' => [
- 'ID' => $Attribute->get('id'),
- 'USER' => $Attribute->get('user'),
- 'SLUG' => $Attribute->get('slug'),
- 'NAME' => $Attribute->get('name'),
- 'BODY' => $Attribute->get('body'),
- 'ARGV' => $Attribute->get('argv'),
- 'TIME_INSERT' => $Attribute->get('time_insert'),
- 'TIME_UPDATE' => $Attribute->get('time_update'),
- ],
+ 'DATA' => array_change_key_case($Attribute->getAll(), CASE_UPPER),
'USER_LIST' => $userAttributes ?? [],
'TOKEN' => Application::getSecurityToken()
]);
diff --git a/admin/post/update.php b/admin/post/update.php
index 7e3610f..af26835 100644
--- a/admin/post/update.php
+++ b/admin/post/update.php
@@ -58,16 +58,7 @@ try {
$FormTemplate->set('FORM', [
'TYPE' => 'UPDATE',
'INFO' => $messages ?? [],
- 'DATA' => [
- 'ID' => $Attribute->get('id'),
- 'USER' => $Attribute->get('user'),
- 'SLUG' => $Attribute->get('slug'),
- 'NAME' => $Attribute->get('name'),
- 'BODY' => $Attribute->get('body'),
- 'ARGV' => $Attribute->get('argv'),
- 'TIME_INSERT' => $Attribute->get('time_insert'),
- 'TIME_UPDATE' => $Attribute->get('time_update'),
- ],
+ 'DATA' => array_change_key_case($Attribute->getAll(), CASE_UPPER),
'USER_LIST' => $userAttributes ?? [],
'TOKEN' => Application::getSecurityToken()
]);