From 18946f8ef6dc1c6f58980b5f5b181bac2ecbe65a Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 26 Oct 2017 23:11:52 +0200 Subject: [PATCH] fixed copy error and undeclared variable in ajax.php --- README.md | 2 +- admin/README.txt | 2 +- admin/assets/css/admin_view.css | 2 +- admin/assets/css/admin_views.css | 2 +- admin/controllers/admin_view.php | 2 +- admin/controllers/admin_views.php | 2 +- admin/helpers/compiler/a_Get.php | 2 +- admin/helpers/componentbuilder.php | 42 +++---------------- admin/models/admin_view.php | 2 +- admin/models/admin_views.php | 2 +- admin/models/ajax.php | 6 +-- admin/models/forms/admin_view.js | 2 +- admin/tables/admin_view.php | 2 +- admin/views/admin_view/submitbutton.js | 2 +- admin/views/admin_view/tmpl/edit.php | 2 +- admin/views/admin_view/view.html.php | 2 +- admin/views/admin_views/tmpl/default.php | 2 +- .../admin_views/tmpl/default_batch_body.php | 2 +- .../admin_views/tmpl/default_batch_footer.php | 2 +- admin/views/admin_views/tmpl/default_body.php | 2 +- admin/views/admin_views/tmpl/default_foot.php | 2 +- admin/views/admin_views/tmpl/default_head.php | 2 +- .../admin_views/tmpl/default_toolbar.php | 2 +- admin/views/admin_views/view.html.php | 2 +- site/helpers/componentbuilder.php | 5 ++- 25 files changed, 33 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index d40000d37..625d4074f 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ Component Builder is mapped as a component in itself on my local development env + *Version*: 2.5.9 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **160841** ++ *Line count*: **160810** + *File count*: **1000** + *Folder count*: **165** diff --git a/admin/README.txt b/admin/README.txt index d40000d37..625d4074f 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -114,7 +114,7 @@ Component Builder is mapped as a component in itself on my local development env + *Version*: 2.5.9 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **160841** ++ *Line count*: **160810** + *File count*: **1000** + *Folder count*: **165** diff --git a/admin/assets/css/admin_view.css b/admin/assets/css/admin_view.css index d933a38a2..c9b2cd6ca 100644 --- a/admin/assets/css/admin_view.css +++ b/admin/assets/css/admin_view.css @@ -9,7 +9,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/assets/css/admin_views.css b/admin/assets/css/admin_views.css index b099ee6b5..ad004e0cf 100644 --- a/admin/assets/css/admin_views.css +++ b/admin/assets/css/admin_views.css @@ -9,7 +9,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/controllers/admin_view.php b/admin/controllers/admin_view.php index 4f9a2f732..9c9dba366 100644 --- a/admin/controllers/admin_view.php +++ b/admin/controllers/admin_view.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/controllers/admin_views.php b/admin/controllers/admin_views.php index 849fc1c88..ed7df7471 100644 --- a/admin/controllers/admin_views.php +++ b/admin/controllers/admin_views.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index c9fb1a420..059e72455 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -1270,7 +1270,7 @@ class Get // if Details tab is not set, then set it here if (!isset($view->tabs[1])) { - $view->tabs[1] = 'details'; + $view->tabs[1] = 'Details'; } // always make sure that publishing is lowercase if (($removeKey = array_search('publishing', array_map('strtolower', $view->tabs))) !== false) diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 38d21ad47..9769751e2 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -42,7 +42,7 @@ abstract class ComponentbuilderHelper } /** - * Copy Any Item + * Copy Any Item (only use for direct database copying) * * @param int $id The item to copy * @param string $table The table and model to copy from and with @@ -95,41 +95,8 @@ abstract class ComponentbuilderHelper unset($data['asset_id']); unset($data['checked_out']); unset($data['checked_out_time']); - // get the form - $form = $model->getForm($data, false); - // make sure we have the form - if (!$form) - { - $app->enqueueMessage($model->getError(), 'error'); - - return false; - } - - // Test whether the data is valid. - $validData = $model->validate($form, $data); - - // Check for validation errors. - if ($validData === false) - { - // Get the validation messages. - $errors = $model->getErrors(); - - // Push up to three validation messages out to the user. - for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) - { - if ($errors[$i] instanceof \Exception) - { - $app->enqueueMessage($errors[$i]->getMessage(), 'warning'); - } - else - { - $app->enqueueMessage($errors[$i], 'warning'); - } - } - return false; - } // Attempt to save the data. - if ($model->save($validData)) + if ($model->save($data)) { return true; } @@ -411,7 +378,8 @@ abstract class ComponentbuilderHelper return $indenter->indent($html); } - public static function checkFileType($file, $sufix) { + public static function checkFileType($file, $sufix) + { // now check if the file ends with the sufix return $sufix === "" || ($sufix == substr(strrchr($file, "."), -strlen($sufix))); } @@ -513,7 +481,7 @@ abstract class ComponentbuilderHelper 'chromestyle','contenttype','databaseconnection','editors','email','file', 'filelist','folderlist','groupedlist','hidden','file','headertag','helpsite', 'imagelist','integer','language','list','media','menu','note','password', - 'plugins','range','radio','repeatable','rules','sessionhandler','spacer','sql','tag', + 'plugins','range','radio','repeatable','rules','subform','sessionhandler','spacer','sql','tag', 'tel','menuitem','modulelayout','meter','moduleorder','moduleposition','moduletag', 'templatestyle','text','textarea','timezone','url','user','usergroup' ), diff --git a/admin/models/admin_view.php b/admin/models/admin_view.php index b390697f8..e5d51f116 100644 --- a/admin/models/admin_view.php +++ b/admin/models/admin_view.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/models/admin_views.php b/admin/models/admin_views.php index 7fd5f3575..851ec8933 100644 --- a/admin/models/admin_views.php +++ b/admin/models/admin_views.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 3abb785b6..d287e4fe5 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -617,7 +617,7 @@ class ComponentbuilderModelAjax extends JModelList $this->customadminviewNames[$view] = JText::_('COM_COMPONENTBUILDER_NO_CUSTOM_ADMIN_VIEW_FOUND'); } } - $bucket[] = $this->customadminviewNames[$view] . $this->addEditLink($value, 'custom_admin_view', 'custom_admin_views'); + $bucket[] = $this->customadminviewNames[$view] . $this->addEditLink($view, 'custom_admin_view', 'custom_admin_views'); } } elseif (is_numeric($value)) @@ -655,7 +655,7 @@ class ComponentbuilderModelAjax extends JModelList $this->adminviewNames[$view] = JText::_('COM_COMPONENTBUILDER_NO_ADMIN_VIEW_FOUND'); } } - $bucket[] = $this->adminviewNames[$view] . $this->addEditLink($value, 'admin_view', 'admin_views'); + $bucket[] = $this->adminviewNames[$view] . $this->addEditLink($view, 'admin_view', 'admin_views'); } } elseif (is_numeric($value)) @@ -693,7 +693,7 @@ class ComponentbuilderModelAjax extends JModelList $this->siteviewNames[$view] = JText::_('COM_COMPONENTBUILDER_NO_SITE_VIEW_FOUND'); } } - $bucket[] = $this->siteviewNames[$view] . $this->addEditLink($value, 'site_view', 'site_views'); + $bucket[] = $this->siteviewNames[$view] . $this->addEditLink($view, 'site_view', 'site_views'); } } elseif (is_numeric($value)) diff --git a/admin/models/forms/admin_view.js b/admin/models/forms/admin_view.js index 9f86c3652..0ed9c9b51 100644 --- a/admin/models/forms/admin_view.js +++ b/admin/models/forms/admin_view.js @@ -9,7 +9,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/tables/admin_view.php b/admin/tables/admin_view.php index bd5503bbb..6f99df01e 100644 --- a/admin/tables/admin_view.php +++ b/admin/tables/admin_view.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/views/admin_view/submitbutton.js b/admin/views/admin_view/submitbutton.js index 140ed5889..d04398ac0 100644 --- a/admin/views/admin_view/submitbutton.js +++ b/admin/views/admin_view/submitbutton.js @@ -9,7 +9,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/views/admin_view/tmpl/edit.php b/admin/views/admin_view/tmpl/edit.php index 8acfc5c7c..781be2d5b 100644 --- a/admin/views/admin_view/tmpl/edit.php +++ b/admin/views/admin_view/tmpl/edit.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/views/admin_view/view.html.php b/admin/views/admin_view/view.html.php index 56779b096..6b8739121 100644 --- a/admin/views/admin_view/view.html.php +++ b/admin/views/admin_view/view.html.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/views/admin_views/tmpl/default.php b/admin/views/admin_views/tmpl/default.php index 681c41b4b..f11eee2fa 100644 --- a/admin/views/admin_views/tmpl/default.php +++ b/admin/views/admin_views/tmpl/default.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/views/admin_views/tmpl/default_batch_body.php b/admin/views/admin_views/tmpl/default_batch_body.php index 7a502b31d..61d886f42 100644 --- a/admin/views/admin_views/tmpl/default_batch_body.php +++ b/admin/views/admin_views/tmpl/default_batch_body.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/views/admin_views/tmpl/default_batch_footer.php b/admin/views/admin_views/tmpl/default_batch_footer.php index c2db418d7..88befeffc 100644 --- a/admin/views/admin_views/tmpl/default_batch_footer.php +++ b/admin/views/admin_views/tmpl/default_batch_footer.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/views/admin_views/tmpl/default_body.php b/admin/views/admin_views/tmpl/default_body.php index 9c4959906..c8d29c869 100644 --- a/admin/views/admin_views/tmpl/default_body.php +++ b/admin/views/admin_views/tmpl/default_body.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/views/admin_views/tmpl/default_foot.php b/admin/views/admin_views/tmpl/default_foot.php index b2c7c59ed..3bd4b861a 100644 --- a/admin/views/admin_views/tmpl/default_foot.php +++ b/admin/views/admin_views/tmpl/default_foot.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/views/admin_views/tmpl/default_head.php b/admin/views/admin_views/tmpl/default_head.php index 4040ef8fd..f13a60366 100644 --- a/admin/views/admin_views/tmpl/default_head.php +++ b/admin/views/admin_views/tmpl/default_head.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/views/admin_views/tmpl/default_toolbar.php b/admin/views/admin_views/tmpl/default_toolbar.php index 91e1131f7..4d7546df4 100644 --- a/admin/views/admin_views/tmpl/default_toolbar.php +++ b/admin/views/admin_views/tmpl/default_toolbar.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/admin/views/admin_views/view.html.php b/admin/views/admin_views/view.html.php index 5401f1067..9a9e661c9 100644 --- a/admin/views/admin_views/view.html.php +++ b/admin/views/admin_views/view.html.php @@ -10,7 +10,7 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 228 of this MVC + @version @update number 229 of this MVC @build 26th October, 2017 @created 30th April, 2015 @package Component Builder diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index 041919ab7..ea5af159c 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -305,7 +305,8 @@ abstract class ComponentbuilderHelper return $indenter->indent($html); } - public static function checkFileType($file, $sufix) { + public static function checkFileType($file, $sufix) + { // now check if the file ends with the sufix return $sufix === "" || ($sufix == substr(strrchr($file, "."), -strlen($sufix))); } @@ -407,7 +408,7 @@ abstract class ComponentbuilderHelper 'chromestyle','contenttype','databaseconnection','editors','email','file', 'filelist','folderlist','groupedlist','hidden','file','headertag','helpsite', 'imagelist','integer','language','list','media','menu','note','password', - 'plugins','range','radio','repeatable','rules','sessionhandler','spacer','sql','tag', + 'plugins','range','radio','repeatable','rules','subform','sessionhandler','spacer','sql','tag', 'tel','menuitem','modulelayout','meter','moduleorder','moduleposition','moduletag', 'templatestyle','text','textarea','timezone','url','user','usergroup' ),