From 6a38523843bccd8fccc425ffd81bf44a4107d27d Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 21 Jan 2022 16:41:54 +0200 Subject: [PATCH 01/12] Adds the option to overide the assignment in item dynamic custom gets. --- README.md | 2 +- admin/README.txt | 2 +- admin/helpers/compiler/e_Interpretation.php | 39 +++++++++++++------ .../dashboard_fullwidth.php | 4 +- admin/models/component_dashboard.php | 4 +- admin/models/componentbuilder.php | 12 +++--- admin/views/compiler/view.html.php | 4 +- componentbuilder.xml | 2 +- 8 files changed, 42 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 2fd4b4522..8b519c5e9 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 15th January, 2022 ++ *Last Build*: 21st January, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt diff --git a/admin/README.txt b/admin/README.txt index 2fd4b4522..8b519c5e9 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -143,7 +143,7 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 15th January, 2022 ++ *Last Build*: 21st January, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 515e6b16e..b47180df8 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -3700,17 +3700,8 @@ class Interpretation extends Fields { $getItem .= $this->setCustomViewGroup($get->group, $code, $tab); } - // get ready to get query - $getItem .= PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "//" - . $this->setLine(__LINE__) - . " Reset the query using our newly populated query object."; - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) - . "\$db->setQuery(\$query);"; - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" - . $this->setLine(__LINE__) - . " Load the results as a stdClass object."; - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) - . "\$data = \$db->loadObject();"; + // db set query data placeholder + $getItem .= $this->hhh . "DB_SET_QUERY_DATA" . $this->hhh; // set after item php if (isset($get->add_php_after_getitem) && $get->add_php_after_getitem == 1 @@ -3721,6 +3712,30 @@ class Interpretation extends Fields $get->php_after_getitem, $this->placeholders ); } + // check the getItem string to see if we should still add set query to data + if (strpos($getItem, '$data =') === false) + { + // get ready to get query + $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] = + PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "//" + . $this->setLine(__LINE__) + . " Reset the query using our newly populated query object."; + $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] .= + PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + . "\$db->setQuery(\$query);"; + $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] .= + PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" + . $this->setLine(__LINE__) + . " Load the results as a stdClass object."; + $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] .= + PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + . "\$data = \$db->loadObject();"; + // add the db set query to data + $getItem = str_replace( + array_keys($setQuery), + array_values($setQuery), $getItem + ); + } $getItem .= PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "if (empty(\$data))"; $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; @@ -3778,7 +3793,7 @@ class Interpretation extends Fields . "return false;"; } $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; - // dispatcher placholder + // dispatcher placeholder $getItem .= $this->hhh . "DISPATCHER" . $this->hhh; if (ComponentbuilderHelper::checkArray($get->main_get)) { diff --git a/admin/layouts/component_dashboard/dashboard_fullwidth.php b/admin/layouts/component_dashboard/dashboard_fullwidth.php index 49bfd713b..5a4a6f0c1 100644 --- a/admin/layouts/component_dashboard/dashboard_fullwidth.php +++ b/admin/layouts/component_dashboard/dashboard_fullwidth.php @@ -28,8 +28,8 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( 'note_php_dashboard_note', - 'dashboard_tab', - 'php_dashboard_methods' + 'php_dashboard_methods', + 'dashboard_tab' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); diff --git a/admin/models/component_dashboard.php b/admin/models/component_dashboard.php index d7e2372d8..4ca14076a 100644 --- a/admin/models/component_dashboard.php +++ b/admin/models/component_dashboard.php @@ -31,8 +31,8 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin 'dashboard' => array( 'fullwidth' => array( 'note_php_dashboard_note', - 'dashboard_tab', - 'php_dashboard_methods' + 'php_dashboard_methods', + 'dashboard_tab' ), 'above' => array( 'joomla_component' diff --git a/admin/models/componentbuilder.php b/admin/models/componentbuilder.php index 25f89450e..5d86c665c 100644 --- a/admin/models/componentbuilder.php +++ b/admin/models/componentbuilder.php @@ -423,7 +423,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList .append("

" + issue.title + "

") .append("\"@" ") .append("" + issue.user.login + " '.JText::_('COM_COMPONENTBUILDER_OPENED_THIS').' '.JText::_('COM_COMPONENTBUILDER_ISSUE').'-" + issue.number + " (" + timeago + ") ") - .append(marked(issue.body)) + .append(marked.parse(issue.body)) .append("'.JText::_('COM_COMPONENTBUILDER_RESPOND_TO_THIS_ISSUE_ON_GITHUB').'...
"); }); }); @@ -436,7 +436,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList .append("

" + issue.title + "

") .append("\"@" ") .append("" + issue.user.login + " '.JText::_('COM_COMPONENTBUILDER_OPENED').' '.JText::_('COM_COMPONENTBUILDER_ISSUE').'-" + issue.number + " (" + timeago + ")") - .append(marked(issue.body)) + .append(marked.parse(issue.body)) .append("'.JText::_('COM_COMPONENTBUILDER_REVIEW_THIS_ISSUE_ON_GITHUB').'...
"); }); }); @@ -475,7 +475,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList .append(activeNotice) .append("\"@" ") .append("" + tagrelease.author.login + " '.JText::_('COM_COMPONENTBUILDER_RELEASED_THIS').' " + tagrelease.tag_name+ " (" + timeago + ")") - .append(marked(tagrelease.body)) + .append(marked.parse(tagrelease.body)) .append(" " + tagrelease.assets[0].name + " (" + tagrelease.assets[0].download_count + ") ") .append("| '.JText::_('COM_COMPONENTBUILDER_OPEN_ON_GITHUB').'...
"); }); @@ -503,7 +503,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList jQuery(document).ready(function () { jQuery.get(gewiki) .success(function(wiki) { - jQuery("#wiki-md").html(marked(wiki)); + jQuery("#wiki-md").html(marked.parse(wiki)); }) .error(function(jqXHR, textStatus, errorThrown) { jQuery("#wiki-md").html("'.JText::_('COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_LATTER').'"); @@ -527,7 +527,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList jQuery.get(noticeboard) .success(function(board) { if (board.length > 5) { - jQuery("#noticeboard-md").html(marked(board)); + jQuery("#noticeboard-md").html(marked.parse(board)); getIS(1,board).done(function(result) { if (result){ jQuery("#cpanel_tabTabs a").each(function() { @@ -599,7 +599,7 @@ jQuery(document).ready( function($) { jQuery.get(proboard) .success(function(board) { if (board.length > 5) { - jQuery("#proboard-md").html(marked(board)); + jQuery("#proboard-md").html(marked.parse(board)); } else { jQuery("#proboard-md").html("'.JText::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER').'"); } diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index db7d52ec6..1712a2639 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -310,7 +310,7 @@ class ComponentbuilderViewCompiler extends JViewLegacy jQuery.get(noticeboard) .success(function(board) { if (board.length > 5) { - jQuery(\".noticeboard-md\").html(marked(board)); + jQuery(\".noticeboard-md\").html(marked.parse(board)); getIS(1,board).done(function(result) { if (result){ jQuery(\".vdm-new-notice\").show(); @@ -327,7 +327,7 @@ class ComponentbuilderViewCompiler extends JViewLegacy jQuery.get(proboard) .success(function(board) { if (board.length > 5) { - jQuery(\".proboard-md\").html(marked(board)); + jQuery(\".proboard-md\").html(marked.parse(board)); } else { jQuery(\".proboard-md\").html(all_is_good); } diff --git a/componentbuilder.xml b/componentbuilder.xml index 01a31a84d..142f1cb3d 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 15th January, 2022 + 21st January, 2022 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com -- 2.40.1 From 758c0f38cf6e0891c0fc9129d7092daf376cf6fa Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 2 Feb 2022 13:45:15 +0200 Subject: [PATCH 02/12] Adds better options with custom get.Improved the auto checkin method. --- README.md | 4 +-- admin/README.txt | 4 +-- admin/helpers/compiler/e_Interpretation.php | 32 +++++++++++++------ admin/models/admin_views.php | 14 ++++---- admin/models/admins_custom_tabs.php | 14 ++++---- admin/models/admins_fields.php | 14 ++++---- admin/models/admins_fields_conditions.php | 14 ++++---- admin/models/admins_fields_relations.php | 14 ++++---- admin/models/class_extendings.php | 14 ++++---- admin/models/class_methods.php | 14 ++++---- admin/models/class_properties.php | 14 ++++---- admin/models/components_admin_views.php | 14 ++++---- admin/models/components_config.php | 14 ++++---- .../models/components_custom_admin_menus.php | 14 ++++---- .../models/components_custom_admin_views.php | 14 ++++---- admin/models/components_dashboard.php | 14 ++++---- admin/models/components_files_folders.php | 14 ++++---- admin/models/components_modules.php | 14 ++++---- admin/models/components_mysql_tweaks.php | 14 ++++---- admin/models/components_placeholders.php | 14 ++++---- admin/models/components_plugins.php | 14 ++++---- admin/models/components_site_views.php | 14 ++++---- admin/models/components_updates.php | 14 ++++---- admin/models/custom_admin_views.php | 14 ++++---- admin/models/custom_codes.php | 14 ++++---- admin/models/dynamic_gets.php | 14 ++++---- admin/models/fields.php | 14 ++++---- admin/models/fieldtypes.php | 14 ++++---- admin/models/help_documents.php | 14 ++++---- admin/models/joomla_components.php | 14 ++++---- admin/models/joomla_modules.php | 14 ++++---- .../joomla_modules_files_folders_urls.php | 14 ++++---- admin/models/joomla_modules_updates.php | 14 ++++---- admin/models/joomla_plugin_groups.php | 14 ++++---- admin/models/joomla_plugins.php | 14 ++++---- .../joomla_plugins_files_folders_urls.php | 14 ++++---- admin/models/joomla_plugins_updates.php | 14 ++++---- admin/models/language_translations.php | 14 ++++---- admin/models/languages.php | 14 ++++---- admin/models/layouts.php | 14 ++++---- admin/models/libraries.php | 14 ++++---- admin/models/libraries_config.php | 14 ++++---- admin/models/libraries_files_folders_urls.php | 14 ++++---- admin/models/placeholders.php | 14 ++++---- admin/models/servers.php | 14 ++++---- admin/models/site_views.php | 14 ++++---- admin/models/snippet_types.php | 14 ++++---- admin/models/snippets.php | 14 ++++---- admin/models/templates.php | 14 ++++---- admin/models/validation_rules.php | 14 ++++---- componentbuilder.xml | 2 +- 51 files changed, 403 insertions(+), 297 deletions(-) diff --git a/README.md b/README.md index 8b519c5e9..b7f8e89b1 100644 --- a/README.md +++ b/README.md @@ -143,11 +143,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 21st January, 2022 ++ *Last Build*: 2nd February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286035** ++ *Line count*: **286129** + *Field count*: **1572** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/README.txt b/admin/README.txt index 8b519c5e9..b7f8e89b1 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -143,11 +143,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 21st January, 2022 ++ *Last Build*: 2nd February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286035** ++ *Line count*: **286129** + *Field count*: **1572** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index b47180df8..b879cebe8 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -3731,11 +3731,17 @@ class Interpretation extends Fields PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$data = \$db->loadObject();"; // add the db set query to data - $getItem = str_replace( - array_keys($setQuery), - array_values($setQuery), $getItem - ); } + else + { + // remove our placeholder + $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] = ''; + } + // add the db set query to data + $getItem = str_replace( + array_keys($setQuery), + array_values($setQuery), $getItem + ); $getItem .= PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "if (empty(\$data))"; $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; @@ -21699,7 +21705,7 @@ class Interpretation extends Fields public function setCheckinCall() { $call = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) - . " check in items"; + . " Check in items"; $call .= PHP_EOL . $this->_t(2) . "\$this->checkInNow();" . PHP_EOL; return $call; @@ -21728,22 +21734,28 @@ class Interpretation extends Fields ) . " Get a db connection."; $checkin .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDbo();"; $checkin .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) - . " reset query"; + . " Reset query."; $checkin .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; $checkin .= PHP_EOL . $this->_t(3) . "\$query->select('*');"; $checkin .= PHP_EOL . $this->_t(3) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $view . "'));"; - $checkin .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; + $checkin .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Only select items that are checked out."; + $checkin .= PHP_EOL . $this->_t(3) + . "\$query->where(\$db->quoteName('checked_out') . '!=0');"; + $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Query only to see if we have a rows"; + $checkin .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query, 0, 1);"; $checkin .= PHP_EOL . $this->_t(3) . "\$db->execute();"; $checkin .= PHP_EOL . $this->_t(3) . "if (\$db->getNumRows())"; $checkin .= PHP_EOL . $this->_t(3) . "{"; $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) - . " Get Yesterdays date"; + . " Get Yesterdays date."; $checkin .= PHP_EOL . $this->_t(4) . "\$date = JFactory::getDate()->modify(\$time)->toSql();"; $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) - . " reset query"; + . " Reset query."; $checkin .= PHP_EOL . $this->_t(4) . "\$query = \$db->getQuery(true);"; $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine( __LINE__ @@ -21765,7 +21777,7 @@ class Interpretation extends Fields $checkin .= PHP_EOL . $this->_t(4) . ");"; $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine( __LINE__ - ) . " Check table"; + ) . " Check table."; $checkin .= PHP_EOL . $this->_t(4) . "\$query->update(\$db->quoteName('#__" . $component . "_" . $view . "'))->set(\$fields)->where(\$conditions); "; diff --git a/admin/models/admin_views.php b/admin/models/admin_views.php index 7d1d56bf9..94314a6df 100644 --- a/admin/models/admin_views.php +++ b/admin/models/admin_views.php @@ -203,7 +203,7 @@ class ComponentbuilderModelAdmin_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -817,17 +817,19 @@ class ComponentbuilderModelAdmin_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_admin_view')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -842,7 +844,7 @@ class ComponentbuilderModelAdmin_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_admin_view'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/admins_custom_tabs.php b/admin/models/admins_custom_tabs.php index ae1ee5152..2cd0de01a 100644 --- a/admin/models/admins_custom_tabs.php +++ b/admin/models/admins_custom_tabs.php @@ -94,7 +94,7 @@ class ComponentbuilderModelAdmins_custom_tabs extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelAdmins_custom_tabs extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_admin_custom_tabs')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelAdmins_custom_tabs extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_admin_custom_tabs'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/admins_fields.php b/admin/models/admins_fields.php index 3827615f4..4630c9cd8 100644 --- a/admin/models/admins_fields.php +++ b/admin/models/admins_fields.php @@ -94,7 +94,7 @@ class ComponentbuilderModelAdmins_fields extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelAdmins_fields extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_admin_fields')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelAdmins_fields extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_admin_fields'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/admins_fields_conditions.php b/admin/models/admins_fields_conditions.php index 26dd6cf54..f588062a1 100644 --- a/admin/models/admins_fields_conditions.php +++ b/admin/models/admins_fields_conditions.php @@ -94,7 +94,7 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_admin_fields_conditions')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_admin_fields_conditions'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/admins_fields_relations.php b/admin/models/admins_fields_relations.php index d6a54b264..16491c625 100644 --- a/admin/models/admins_fields_relations.php +++ b/admin/models/admins_fields_relations.php @@ -94,7 +94,7 @@ class ComponentbuilderModelAdmins_fields_relations extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelAdmins_fields_relations extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_admin_fields_relations')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelAdmins_fields_relations extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_admin_fields_relations'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/class_extendings.php b/admin/models/class_extendings.php index 68251a878..4beb12da9 100644 --- a/admin/models/class_extendings.php +++ b/admin/models/class_extendings.php @@ -110,7 +110,7 @@ class ComponentbuilderModelClass_extendings extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -323,17 +323,19 @@ class ComponentbuilderModelClass_extendings extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_class_extends')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -348,7 +350,7 @@ class ComponentbuilderModelClass_extendings extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_class_extends'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/class_methods.php b/admin/models/class_methods.php index 646fc1b6d..6b3e5e79f 100644 --- a/admin/models/class_methods.php +++ b/admin/models/class_methods.php @@ -118,7 +118,7 @@ class ComponentbuilderModelClass_methods extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -502,17 +502,19 @@ class ComponentbuilderModelClass_methods extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_class_method')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -527,7 +529,7 @@ class ComponentbuilderModelClass_methods extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_class_method'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/class_properties.php b/admin/models/class_properties.php index cebbe41f7..5b1288dd8 100644 --- a/admin/models/class_properties.php +++ b/admin/models/class_properties.php @@ -118,7 +118,7 @@ class ComponentbuilderModelClass_properties extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -498,17 +498,19 @@ class ComponentbuilderModelClass_properties extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_class_property')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -523,7 +525,7 @@ class ComponentbuilderModelClass_properties extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_class_property'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_admin_views.php b/admin/models/components_admin_views.php index 555516d82..75ec3e4bf 100644 --- a/admin/models/components_admin_views.php +++ b/admin/models/components_admin_views.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_admin_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_admin_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_admin_views')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_admin_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_admin_views'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_config.php b/admin/models/components_config.php index 81e03d419..e100e49c2 100644 --- a/admin/models/components_config.php +++ b/admin/models/components_config.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_config extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_config extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_config')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_config extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_config'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_custom_admin_menus.php b/admin/models/components_custom_admin_menus.php index c1ac0ed32..a05d26f6b 100644 --- a/admin/models/components_custom_admin_menus.php +++ b/admin/models/components_custom_admin_menus.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_custom_admin_menus')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_custom_admin_menus'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_custom_admin_views.php b/admin/models/components_custom_admin_views.php index 34617a0b8..38f60715a 100644 --- a/admin/models/components_custom_admin_views.php +++ b/admin/models/components_custom_admin_views.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_custom_admin_views')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_custom_admin_views'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_dashboard.php b/admin/models/components_dashboard.php index a79fa23d6..473551471 100644 --- a/admin/models/components_dashboard.php +++ b/admin/models/components_dashboard.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_dashboard extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_dashboard extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_dashboard')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_dashboard extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_dashboard'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_files_folders.php b/admin/models/components_files_folders.php index b7cadc84d..bd53f0406 100644 --- a/admin/models/components_files_folders.php +++ b/admin/models/components_files_folders.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_files_folders extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_files_folders extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_files_folders')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_files_folders extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_files_folders'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_modules.php b/admin/models/components_modules.php index 2112cb012..e035eb096 100644 --- a/admin/models/components_modules.php +++ b/admin/models/components_modules.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_modules extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_modules extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_modules')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_modules extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_modules'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_mysql_tweaks.php b/admin/models/components_mysql_tweaks.php index 55049c4cb..655fa1622 100644 --- a/admin/models/components_mysql_tweaks.php +++ b/admin/models/components_mysql_tweaks.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_mysql_tweaks')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_mysql_tweaks'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_placeholders.php b/admin/models/components_placeholders.php index 969cb62c8..98fdabbf6 100644 --- a/admin/models/components_placeholders.php +++ b/admin/models/components_placeholders.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_placeholders extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_placeholders extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_placeholders')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_placeholders extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_placeholders'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_plugins.php b/admin/models/components_plugins.php index ca59efe78..3bfafdba9 100644 --- a/admin/models/components_plugins.php +++ b/admin/models/components_plugins.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_plugins extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_plugins extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_plugins')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_plugins extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_plugins'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_site_views.php b/admin/models/components_site_views.php index 98a98b476..27426721d 100644 --- a/admin/models/components_site_views.php +++ b/admin/models/components_site_views.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_site_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_site_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_site_views')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_site_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_site_views'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_updates.php b/admin/models/components_updates.php index 4f481267c..caa6a7680 100644 --- a/admin/models/components_updates.php +++ b/admin/models/components_updates.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_updates extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_updates extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_updates')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_updates extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_updates'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/custom_admin_views.php b/admin/models/custom_admin_views.php index 34f2a8d0b..b0b77d966 100644 --- a/admin/models/custom_admin_views.php +++ b/admin/models/custom_admin_views.php @@ -187,7 +187,7 @@ class ComponentbuilderModelCustom_admin_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -672,17 +672,19 @@ class ComponentbuilderModelCustom_admin_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_custom_admin_view')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -697,7 +699,7 @@ class ComponentbuilderModelCustom_admin_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_custom_admin_view'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/custom_codes.php b/admin/models/custom_codes.php index 160bb9b85..fbd8a0d5e 100644 --- a/admin/models/custom_codes.php +++ b/admin/models/custom_codes.php @@ -134,7 +134,7 @@ class ComponentbuilderModelCustom_codes extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -590,17 +590,19 @@ class ComponentbuilderModelCustom_codes extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_custom_code')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -615,7 +617,7 @@ class ComponentbuilderModelCustom_codes extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_custom_code'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/dynamic_gets.php b/admin/models/dynamic_gets.php index cbbf55d4d..a04f7cb53 100644 --- a/admin/models/dynamic_gets.php +++ b/admin/models/dynamic_gets.php @@ -118,7 +118,7 @@ class ComponentbuilderModelDynamic_gets extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -503,17 +503,19 @@ class ComponentbuilderModelDynamic_gets extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_dynamic_get')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -528,7 +530,7 @@ class ComponentbuilderModelDynamic_gets extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_dynamic_get'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/fields.php b/admin/models/fields.php index 756eb2e9a..dc32a6bbc 100644 --- a/admin/models/fields.php +++ b/admin/models/fields.php @@ -214,7 +214,7 @@ class ComponentbuilderModelFields extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -858,17 +858,19 @@ class ComponentbuilderModelFields extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_field')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -883,7 +885,7 @@ class ComponentbuilderModelFields extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_field'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/fieldtypes.php b/admin/models/fieldtypes.php index 29e633d43..e6129fb03 100644 --- a/admin/models/fieldtypes.php +++ b/admin/models/fieldtypes.php @@ -126,7 +126,7 @@ class ComponentbuilderModelFieldtypes extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -467,17 +467,19 @@ class ComponentbuilderModelFieldtypes extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_fieldtype')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -492,7 +494,7 @@ class ComponentbuilderModelFieldtypes extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_fieldtype'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/help_documents.php b/admin/models/help_documents.php index 9fde9ba09..0300518c1 100644 --- a/admin/models/help_documents.php +++ b/admin/models/help_documents.php @@ -133,7 +133,7 @@ class ComponentbuilderModelHelp_documents extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -506,17 +506,19 @@ class ComponentbuilderModelHelp_documents extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_help_document')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -531,7 +533,7 @@ class ComponentbuilderModelHelp_documents extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_help_document'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index b3767b912..503acd031 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -2304,7 +2304,7 @@ class ComponentbuilderModelJoomla_components extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -2756,17 +2756,19 @@ class ComponentbuilderModelJoomla_components extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_component')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -2781,7 +2783,7 @@ class ComponentbuilderModelJoomla_components extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_component'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_modules.php b/admin/models/joomla_modules.php index 4702cc60a..73a407fc9 100644 --- a/admin/models/joomla_modules.php +++ b/admin/models/joomla_modules.php @@ -118,7 +118,7 @@ class ComponentbuilderModelJoomla_modules extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -329,17 +329,19 @@ class ComponentbuilderModelJoomla_modules extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_module')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -354,7 +356,7 @@ class ComponentbuilderModelJoomla_modules extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_module'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_modules_files_folders_urls.php b/admin/models/joomla_modules_files_folders_urls.php index 383a8f533..6f883c835 100644 --- a/admin/models/joomla_modules_files_folders_urls.php +++ b/admin/models/joomla_modules_files_folders_urls.php @@ -94,7 +94,7 @@ class ComponentbuilderModelJoomla_modules_files_folders_urls extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelJoomla_modules_files_folders_urls extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_module_files_folders_urls')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelJoomla_modules_files_folders_urls extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_module_files_folders_urls'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_modules_updates.php b/admin/models/joomla_modules_updates.php index d2c0a4edb..ece517811 100644 --- a/admin/models/joomla_modules_updates.php +++ b/admin/models/joomla_modules_updates.php @@ -94,7 +94,7 @@ class ComponentbuilderModelJoomla_modules_updates extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelJoomla_modules_updates extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_module_updates')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelJoomla_modules_updates extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_module_updates'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_plugin_groups.php b/admin/models/joomla_plugin_groups.php index 96574dc18..db1b680d2 100644 --- a/admin/models/joomla_plugin_groups.php +++ b/admin/models/joomla_plugin_groups.php @@ -110,7 +110,7 @@ class ComponentbuilderModelJoomla_plugin_groups extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -269,17 +269,19 @@ class ComponentbuilderModelJoomla_plugin_groups extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_plugin_group')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -294,7 +296,7 @@ class ComponentbuilderModelJoomla_plugin_groups extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_plugin_group'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_plugins.php b/admin/models/joomla_plugins.php index d9d0a2be0..7260d50cc 100644 --- a/admin/models/joomla_plugins.php +++ b/admin/models/joomla_plugins.php @@ -288,7 +288,7 @@ class ComponentbuilderModelJoomla_plugins extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -490,17 +490,19 @@ class ComponentbuilderModelJoomla_plugins extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_plugin')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -515,7 +517,7 @@ class ComponentbuilderModelJoomla_plugins extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_plugin'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_plugins_files_folders_urls.php b/admin/models/joomla_plugins_files_folders_urls.php index 1764069d7..141d3e495 100644 --- a/admin/models/joomla_plugins_files_folders_urls.php +++ b/admin/models/joomla_plugins_files_folders_urls.php @@ -94,7 +94,7 @@ class ComponentbuilderModelJoomla_plugins_files_folders_urls extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelJoomla_plugins_files_folders_urls extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_plugin_files_folders_urls')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelJoomla_plugins_files_folders_urls extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_plugin_files_folders_urls'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_plugins_updates.php b/admin/models/joomla_plugins_updates.php index 6c17342da..404c898af 100644 --- a/admin/models/joomla_plugins_updates.php +++ b/admin/models/joomla_plugins_updates.php @@ -94,7 +94,7 @@ class ComponentbuilderModelJoomla_plugins_updates extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelJoomla_plugins_updates extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_plugin_updates')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelJoomla_plugins_updates extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_plugin_updates'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/language_translations.php b/admin/models/language_translations.php index 7f5afe643..2cf9fa98e 100644 --- a/admin/models/language_translations.php +++ b/admin/models/language_translations.php @@ -189,7 +189,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -676,17 +676,19 @@ class ComponentbuilderModelLanguage_translations extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_language_translation')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -701,7 +703,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_language_translation'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/languages.php b/admin/models/languages.php index 8707b47ca..2c2040c90 100644 --- a/admin/models/languages.php +++ b/admin/models/languages.php @@ -233,7 +233,7 @@ class ComponentbuilderModelLanguages extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -514,17 +514,19 @@ class ComponentbuilderModelLanguages extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_language')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -539,7 +541,7 @@ class ComponentbuilderModelLanguages extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_language'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/layouts.php b/admin/models/layouts.php index 4261763b9..f40249259 100644 --- a/admin/models/layouts.php +++ b/admin/models/layouts.php @@ -126,7 +126,7 @@ class ComponentbuilderModelLayouts extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -485,17 +485,19 @@ class ComponentbuilderModelLayouts extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_layout')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -510,7 +512,7 @@ class ComponentbuilderModelLayouts extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_layout'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/libraries.php b/admin/models/libraries.php index c487d2de2..c338037a9 100644 --- a/admin/models/libraries.php +++ b/admin/models/libraries.php @@ -134,7 +134,7 @@ class ComponentbuilderModelLibraries extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -418,17 +418,19 @@ class ComponentbuilderModelLibraries extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_library')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -443,7 +445,7 @@ class ComponentbuilderModelLibraries extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_library'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/libraries_config.php b/admin/models/libraries_config.php index 6b19a4c25..39142cb2d 100644 --- a/admin/models/libraries_config.php +++ b/admin/models/libraries_config.php @@ -94,7 +94,7 @@ class ComponentbuilderModelLibraries_config extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelLibraries_config extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_library_config')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelLibraries_config extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_library_config'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/libraries_files_folders_urls.php b/admin/models/libraries_files_folders_urls.php index a761ceaf0..6564426d2 100644 --- a/admin/models/libraries_files_folders_urls.php +++ b/admin/models/libraries_files_folders_urls.php @@ -94,7 +94,7 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_library_files_folders_urls')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_library_files_folders_urls'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/placeholders.php b/admin/models/placeholders.php index 272cd6b86..63c5119e2 100644 --- a/admin/models/placeholders.php +++ b/admin/models/placeholders.php @@ -110,7 +110,7 @@ class ComponentbuilderModelPlaceholders extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -395,17 +395,19 @@ class ComponentbuilderModelPlaceholders extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_placeholder')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -420,7 +422,7 @@ class ComponentbuilderModelPlaceholders extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_placeholder'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/servers.php b/admin/models/servers.php index 969a9977d..e6cad44db 100644 --- a/admin/models/servers.php +++ b/admin/models/servers.php @@ -110,7 +110,7 @@ class ComponentbuilderModelServers extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -510,17 +510,19 @@ class ComponentbuilderModelServers extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_server')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -535,7 +537,7 @@ class ComponentbuilderModelServers extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_server'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/site_views.php b/admin/models/site_views.php index e8eedda05..ce75c8edd 100644 --- a/admin/models/site_views.php +++ b/admin/models/site_views.php @@ -195,7 +195,7 @@ class ComponentbuilderModelSite_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -681,17 +681,19 @@ class ComponentbuilderModelSite_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_site_view')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -706,7 +708,7 @@ class ComponentbuilderModelSite_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_site_view'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/snippet_types.php b/admin/models/snippet_types.php index e56e28eac..08b26f9c7 100644 --- a/admin/models/snippet_types.php +++ b/admin/models/snippet_types.php @@ -110,7 +110,7 @@ class ComponentbuilderModelSnippet_types extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -269,17 +269,19 @@ class ComponentbuilderModelSnippet_types extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_snippet_type')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -294,7 +296,7 @@ class ComponentbuilderModelSnippet_types extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_snippet_type'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/snippets.php b/admin/models/snippets.php index b30063c79..9a8f86e45 100644 --- a/admin/models/snippets.php +++ b/admin/models/snippets.php @@ -248,7 +248,7 @@ class ComponentbuilderModelSnippets extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -576,17 +576,19 @@ class ComponentbuilderModelSnippets extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_snippet')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -601,7 +603,7 @@ class ComponentbuilderModelSnippets extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_snippet'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/templates.php b/admin/models/templates.php index 39ede6229..684ab27ab 100644 --- a/admin/models/templates.php +++ b/admin/models/templates.php @@ -126,7 +126,7 @@ class ComponentbuilderModelTemplates extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -485,17 +485,19 @@ class ComponentbuilderModelTemplates extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_template')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -510,7 +512,7 @@ class ComponentbuilderModelTemplates extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_template'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/validation_rules.php b/admin/models/validation_rules.php index 8e0fc82b3..ead2271b9 100644 --- a/admin/models/validation_rules.php +++ b/admin/models/validation_rules.php @@ -110,7 +110,7 @@ class ComponentbuilderModelValidation_rules extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -393,17 +393,19 @@ class ComponentbuilderModelValidation_rules extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_validation_rule')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -418,7 +420,7 @@ class ComponentbuilderModelValidation_rules extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_validation_rule'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/componentbuilder.xml b/componentbuilder.xml index 142f1cb3d..fd6c9fc35 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 21st January, 2022 + 2nd February, 2022 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com -- 2.40.1 From e8b0bf8ede1fea0cd0673b1cb4f26dd25be405ba Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 2 Feb 2022 15:38:36 +0200 Subject: [PATCH 03/12] Change the short hand echo to long, because of JED checker. --- .../en-GB/en-GB.com_componentbuilder.ini | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 5625683e4..40b556b65 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -3950,10 +3950,10 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NEW_TAB="New Tab" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NEW_TAB_2="New Tab 2" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NEXT="Next" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO="No" -COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
-<?= JText::sprintf('Hello %s', $this->user->name) ?>
+COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?php echo JText::_('Text'); ?>
+<?php echo JText::sprintf('Hello %s', $this->user->name); ?>
Just get UPPERCASE language string:
-<?= JustTEXT::_('Text') ?>" +<?php echo JustTEXT::_('Text'); ?>" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_ADD_PHP_LANGUAGE_STRING_LABEL="Add PHP Language String" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_LIBRARIES_SELECTION_DESCRIPTION="All libraries you select will dynamically be added to the header of the page according to the settings of the selected library. Each library will also get its respective buttons added to the component global options if it has any set. Please take a look at the libraries for more details." COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_LIBRARIES_SELECTION_LABEL="Select libraries you would like to use in your code" @@ -6439,10 +6439,10 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_NAME_MESSAGE="Error! Please add name here." COM_COMPONENTBUILDER_JOOMLA_MODULE_NEW="A New Joomla Module" COM_COMPONENTBUILDER_JOOMLA_MODULE_NO="No" COM_COMPONENTBUILDER_JOOMLA_MODULE_NONE="None" -COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
-<?= JText::sprintf('Hello %s', $this->user->name) ?>
+COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?php echo JText::_('Text'); ?>
+<?php echo JText::sprintf('Hello %s', $this->user->name); ?>
Just get UPPERCASE language string:
-<?= JustTEXT::_('Text') ?>" +<?php echo JustTEXT::_('Text'); ?>" COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_ADD_PHP_LANGUAGE_STRING_LABEL="Add PHP Language String" COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_LIBRARIES_OPTIONS_DESCRIPTION="

All libraries added to modules are added to the component media folder for now

So over here you are able to manually add HTML code to your model default tmpl.

" @@ -7285,10 +7285,10 @@ COM_COMPONENTBUILDER_LAYOUT_NAME_LABEL="Name" COM_COMPONENTBUILDER_LAYOUT_NAME_MESSAGE="Error! Please add name here." COM_COMPONENTBUILDER_LAYOUT_NEW="A New Layout" COM_COMPONENTBUILDER_LAYOUT_NO="No" -COM_COMPONENTBUILDER_LAYOUT_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
-<?= JText::sprintf('Hello %s', $this->user->name) ?>
+COM_COMPONENTBUILDER_LAYOUT_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?php echo JText::_('Text'); ?>
+<?php echo JText::sprintf('Hello %s', $this->user->name); ?>
Just get UPPERCASE language string:
-<?= JustTEXT::_('Text') ?>" +<?php echo JustTEXT::_('Text'); ?>" COM_COMPONENTBUILDER_LAYOUT_NOTE_ADD_PHP_LANGUAGE_STRING_LABEL="Add PHP Language String" COM_COMPONENTBUILDER_LAYOUT_NOTE_LIBRARIES_SELECTION_DESCRIPTION="All libraries you select will dynamically be added to the header of the page according to the settings of the selected library. Each library will also get its respective buttons added to the component global options if it has any set. Please take a look at the libraries for more details." COM_COMPONENTBUILDER_LAYOUT_NOTE_LIBRARIES_SELECTION_LABEL="Select libraries you would like to use in your code" @@ -8381,10 +8381,10 @@ COM_COMPONENTBUILDER_SITE_VIEW_NEW_TAB_2="New Tab 2" COM_COMPONENTBUILDER_SITE_VIEW_NEXT="Next" COM_COMPONENTBUILDER_SITE_VIEW_NO="No" COM_COMPONENTBUILDER_SITE_VIEW_NONE="None" -COM_COMPONENTBUILDER_SITE_VIEW_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
-<?= JText::sprintf('Hello %s', $this->user->name) ?>
+COM_COMPONENTBUILDER_SITE_VIEW_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?php echo JText::_('Text'); ?>
+<?php echo JText::sprintf('Hello %s', $this->user->name); ?>
Just get UPPERCASE language string:
-<?= JustTEXT::_('Text') ?>" +<?php echo JustTEXT::_('Text'); ?>" COM_COMPONENTBUILDER_SITE_VIEW_NOTE_ADD_PHP_LANGUAGE_STRING_LABEL="Add PHP Language String" COM_COMPONENTBUILDER_SITE_VIEW_NOTE_CUSTOM_TOOLBAR_PLACEHOLDER_DESCRIPTION="Use this placeholder in the body [[[SITE_TOOLBAR]]] to add the custom position of the toolbar." COM_COMPONENTBUILDER_SITE_VIEW_NOTE_LIBRARIES_SELECTION_DESCRIPTION="All libraries you select will dynamically be added to the header of the page according to the settings of the selected library. Each library will also get its respective buttons added to the component global options if it has any set. Please take a look at the libraries for more details." @@ -8855,10 +8855,10 @@ COM_COMPONENTBUILDER_TEMPLATE_NAME_LABEL="Name" COM_COMPONENTBUILDER_TEMPLATE_NAME_MESSAGE="Error! Please add name here." COM_COMPONENTBUILDER_TEMPLATE_NEW="A New Template" COM_COMPONENTBUILDER_TEMPLATE_NO="No" -COM_COMPONENTBUILDER_TEMPLATE_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
-<?= JText::sprintf('Hello %s', $this->user->name) ?>
+COM_COMPONENTBUILDER_TEMPLATE_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?php echo JText::_('Text'); ?>
+<?php echo JText::sprintf('Hello %s', $this->user->name); ?>
Just get UPPERCASE language string:
-<?= JustTEXT::_('Text') ?>" +<?php echo JustTEXT::_('Text'); ?>" COM_COMPONENTBUILDER_TEMPLATE_NOTE_ADD_PHP_LANGUAGE_STRING_LABEL="Add PHP Language String" COM_COMPONENTBUILDER_TEMPLATE_NOTE_LIBRARIES_SELECTION_DESCRIPTION="All libraries you select will dynamically be added to the header of the page according to the settings of the selected library. Each library will also get its respective buttons added to the component global options if it has any set. Please take a look at the libraries for more details." COM_COMPONENTBUILDER_TEMPLATE_NOTE_LIBRARIES_SELECTION_LABEL="Select libraries you would like to use in your code" -- 2.40.1 From 2ce36117d470eaa18d4e56aa4f17bef2ba365c46 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 4 Feb 2022 12:50:24 +0200 Subject: [PATCH 04/12] Adds option to add more field paths or rule paths to both module or plugin forms. --- README.md | 6 +- admin/README.txt | 6 +- admin/helpers/compiler/a_Get.php | 52 +++++++++ admin/helpers/compiler/e_Interpretation.php | 109 +++++++++++++----- .../en-GB/en-GB.com_componentbuilder.ini | 12 ++ admin/models/forms/joomla_module.xml | 54 +++++++++ admin/models/forms/joomla_plugin.xml | 54 +++++++++ componentbuilder.xml | 2 +- 8 files changed, 259 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index b7f8e89b1..641e5097e 100644 --- a/README.md +++ b/README.md @@ -143,12 +143,12 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 2nd February, 2022 ++ *Last Build*: 4th February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286129** -+ *Field count*: **1572** ++ *Line count*: **286249** ++ *Field count*: **1580** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/README.txt b/admin/README.txt index b7f8e89b1..641e5097e 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -143,12 +143,12 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 2nd February, 2022 ++ *Last Build*: 4th February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286129** -+ *Field count*: **1572** ++ *Line count*: **286249** ++ *Field count*: **1580** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index da9328e2d..487f5267b 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -9389,6 +9389,8 @@ class Get $module->form_files = array(); $module->fieldsets_label = array(); $module->fieldsets_paths = array(); + $module->add_rule_path = array(); + $module->add_field_path = array(); // set global fields rule to default component path $module->fields_rules_paths = 1; // set the fields data @@ -9463,6 +9465,30 @@ class Get // set where to path is pointing $module->fieldsets_paths[$unique] = $form['fields_rules_paths']; + // check for extra rule paths + if (isset($form['addrulepath']) + && ComponentbuilderHelper::checkArray($form['addrulepath'])) + { + foreach ($form['addrulepath'] as $add_rule_path) + { + if (ComponentbuilderHelper::checkString($add_rule_path['path'])) + { + $module->add_rule_path[$unique][] = $add_rule_path['path']; + } + } + } + // check for extra field paths + if (isset($form['addfieldpath']) + && ComponentbuilderHelper::checkArray($form['addfieldpath'])) + { + foreach ($form['addfieldpath'] as $add_field_path) + { + if (ComponentbuilderHelper::checkString($add_field_path['path'])) + { + $module->add_field_path[$unique][] = $add_field_path['path']; + } + } + } // add the label if set to lang if (isset($form['label']) && ComponentbuilderHelper::checkString( @@ -10297,6 +10323,8 @@ class Get $plugin->form_files = array(); $plugin->fieldsets_label = array(); $plugin->fieldsets_paths = array(); + $plugin->add_rule_path = array(); + $plugin->add_field_path = array(); // set global fields rule to default component path $plugin->fields_rules_paths = 1; // set the fields data @@ -10380,6 +10408,30 @@ class Get $plugin->fieldsets_label[$unique] = $this->setLang($form['label']); } + // check for extra rule paths + if (isset($form['addrulepath']) + && ComponentbuilderHelper::checkArray($form['addrulepath'])) + { + foreach ($form['addrulepath'] as $add_rule_path) + { + if (ComponentbuilderHelper::checkString($add_rule_path['path'])) + { + $plugin->add_rule_path[$unique][] = $add_rule_path['path']; + } + } + } + // check for extra field paths + if (isset($form['addfieldpath']) + && ComponentbuilderHelper::checkArray($form['addfieldpath'])) + { + foreach ($form['addfieldpath'] as $add_field_path) + { + if (ComponentbuilderHelper::checkString($add_field_path['path'])) + { + $plugin->add_field_path[$unique][] = $add_field_path['path']; + } + } + } // build the fields $form['fields'] = array_map( function ($field) use ($key, $unique) { diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index b879cebe8..646d2816c 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -28572,31 +28572,57 @@ function vdm_dkim() { && $module->fieldsets_paths[$field_name . $fieldset] == 2) { - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . '
target == 2) { - $xml .= PHP_EOL . $this->_t(2) - . 'addrulepath="/administrator/modules/' - . $module->file_name - . '/rules"'; - $xml .= PHP_EOL . $this->_t(2) - . 'addfieldpath="/administrator/modules/' - . $module->file_name - . '/fields"'; + $module->add_rule_path[$field_name . $fieldset][] = + '/administrator/modules/' + . $module->file_name . '/rules'; + + $module->add_field_path[$field_name . $fieldset][] = + '/administrator/modules/' + . $module->file_name . '/fields'; } else { - $xml .= PHP_EOL . $this->_t(2) - . 'addrulepath="/modules/' . $module->file_name - . '/rules"'; - $xml .= PHP_EOL . $this->_t(2) - . 'addfieldpath="/modules/' . $module->file_name - . '/fields"'; + $module->add_rule_path[$field_name . $fieldset][] = + '/modules/' . $module->file_name + . '/rules'; + + $module->add_field_path[$field_name . $fieldset][] = + '/modules/' . $module->file_name + . '/fields'; } + } + // add path to module rules and custom fields + if (isset($module->add_rule_path[$field_name . $fieldset]) + || isset($module->add_field_path[$field_name . $fieldset])) + { + + $xml .= PHP_EOL . $this->_t(1) . ''; + + $xml .= PHP_EOL . $this->_t(1) . '
add_rule_path[$field_name . $fieldset])) + { + foreach ($module->add_rule_path[$field_name . $fieldset] as $path) + { + $xml .= PHP_EOL . $this->_t(2) + . 'addrulepath="' . $path . '"'; + } + } + + if (isset($module->add_field_path[$field_name . $fieldset])) + { + foreach ($module->add_field_path[$field_name . $fieldset] as $path) + { + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="' . $path . '"'; + } + } + $xml .= PHP_EOL . $this->_t(1) . '>'; } else @@ -28931,26 +28957,51 @@ function vdm_dkim() { $label = $plugin->fieldsets_label[$field_name . $fieldset]; } + // add path to plugin rules and custom fields if (isset($plugin->fieldsets_paths[$field_name . $fieldset]) && $plugin->fieldsets_paths[$field_name . $fieldset] == 2) + { + $plugin->add_rule_path[$field_name . $fieldset][] = + '/plugins/' . strtolower($plugin->group + ) . '/' . strtolower($plugin->code_name) + . '/rules'; + + $plugin->add_field_path[$field_name . $fieldset][] = + '/plugins/' . strtolower($plugin->group + ) . '/' . strtolower($plugin->code_name) + . '/fields'; + } + // add path to plugin rules and custom fields + if (isset($plugin->add_rule_path[$field_name . $fieldset]) + || isset($plugin->add_field_path[$field_name . $fieldset])) { $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) . '
_t(2) - . 'addrulepath="/plugins/' . strtolower( - $plugin->group - ) . '/' . strtolower($plugin->code_name) - . '/rules"'; - $xml .= PHP_EOL . $this->_t(2) - . 'addfieldpath="/plugins/' . strtolower( - $plugin->group - ) . '/' . strtolower($plugin->code_name) - . '/fields"'; + + if (isset($plugin->add_rule_path[$field_name . $fieldset])) + { + foreach ($plugin->add_rule_path[$field_name . $fieldset] as $path) + { + $xml .= PHP_EOL . $this->_t(2) + . 'addrulepath="' . $path . '"'; + } + } + + if (isset($plugin->add_field_path[$field_name . $fieldset])) + { + foreach ($plugin->add_field_path[$field_name . $fieldset] as $path) + { + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="' . $path . '"'; + } + } + $xml .= PHP_EOL . $this->_t(1) . '>'; } else diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 40b556b65..edf9bec16 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -6237,7 +6237,11 @@ COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_N_ITEMS_UNFEATURED_1="%s Joomla Modu COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_N_ITEMS_UNPUBLISHED="%s Joomla Modules Updates unpublished." COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_N_ITEMS_UNPUBLISHED_1="%s Joomla Module Updates unpublished." COM_COMPONENTBUILDER_JOOMLA_MODULE_ABSTRACT_CLASS="abstract class" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDFIELDPATH_DESCRIPTION="Set extra field paths" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDFIELDPATH_LABEL="Extra Field Paths" COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDREADME_LABEL="Add README" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDRULEPATH_DESCRIPTION="Set extra rule paths" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDRULEPATH_LABEL="Extra Rule Paths" COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_CLASS_HELPER_DESCRIPTION="You can add a helper class to your module." COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_CLASS_HELPER_HEADER_DESCRIPTION="You can add your own custom helper header script." COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_CLASS_HELPER_HEADER_LABEL="Add Class Helper Header" @@ -6462,6 +6466,8 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_UPDATE_SERVER_NOTE_ZIP_LABEL="The ZIP Op COM_COMPONENTBUILDER_JOOMLA_MODULE_NOT_REQUIRED="Not Required" COM_COMPONENTBUILDER_JOOMLA_MODULE_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_JOOMLA_MODULE_OTHER="Other" +COM_COMPONENTBUILDER_JOOMLA_MODULE_PATH_LABEL="Path" +COM_COMPONENTBUILDER_JOOMLA_MODULE_PATH_MESSAGE="Error! Please add extra field path here." COM_COMPONENTBUILDER_JOOMLA_MODULE_PERMISSION="Permissions" COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_METHOD_UNINSTALL_DESCRIPTION="PHP script that should run during uninstall." COM_COMPONENTBUILDER_JOOMLA_MODULE_PHP_METHOD_UNINSTALL_LABEL="PHP Method (uninstall)" @@ -6680,7 +6686,11 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_N_ITEMS_UNFEATURED="%s Joomla Plugin COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_N_ITEMS_UNFEATURED_1="%s Joomla Plugin Updates unfeatured." COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_N_ITEMS_UNPUBLISHED="%s Joomla Plugins Updates unpublished." COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_N_ITEMS_UNPUBLISHED_1="%s Joomla Plugin Updates unpublished." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDFIELDPATH_DESCRIPTION="Set extra field paths" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDFIELDPATH_LABEL="Extra Field Paths" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDREADME_LABEL="Add README" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDRULEPATH_DESCRIPTION="Set extra rule paths" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDRULEPATH_LABEL="Extra Rule Paths" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_HEAD_DESCRIPTION="You can add your own custom header script, combined with the default header script that make the extended class work." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_HEAD_LABEL="Add Custom Class Header" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_METHOD_UNINSTALL_LABEL="Add PHP Method (uninstall)" @@ -6935,6 +6945,8 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_UPDATE_SERVER_NOTE_ZIP_LABEL="The ZIP Op COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOT_REQUIRED="Not Required" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_OTHER="Other" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PATH_LABEL="Path" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PATH_MESSAGE="Error! Please add extra field path here." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PERMISSION="Permissions" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_METHOD_UNINSTALL_DESCRIPTION="PHP script that should run during uninstall." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PHP_METHOD_UNINSTALL_LABEL="PHP Method (uninstall)" diff --git a/admin/models/forms/joomla_module.xml b/admin/models/forms/joomla_module.xml index 160b6db62..012447170 100644 --- a/admin/models/forms/joomla_module.xml +++ b/admin/models/forms/joomla_module.xml @@ -688,6 +688,60 @@ /> + + + + + + diff --git a/admin/models/forms/joomla_plugin.xml b/admin/models/forms/joomla_plugin.xml index 725a494d4..43893074e 100644 --- a/admin/models/forms/joomla_plugin.xml +++ b/admin/models/forms/joomla_plugin.xml @@ -567,6 +567,60 @@ /> + + + + + + diff --git a/componentbuilder.xml b/componentbuilder.xml index fd6c9fc35..53e07a584 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 2nd February, 2022 + 4th February, 2022 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com -- 2.40.1 From 8219d5ed453ca8310190a9f21b0d5b2dc34039a4 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 4 Feb 2022 19:21:10 +0200 Subject: [PATCH 05/12] Fix option to add field paths or rule paths to both module or plugin external forms. --- README.md | 2 +- admin/README.txt | 2 +- admin/helpers/compiler/a_Get.php | 8 +- admin/helpers/compiler/b_Structure.php | 168 +++++++++++------- admin/helpers/compiler/e_Interpretation.php | 109 ++++++------ .../en-GB/en-GB.com_componentbuilder.ini | 16 +- admin/models/forms/joomla_module.xml | 112 ++++++------ admin/models/forms/joomla_plugin.xml | 112 ++++++------ 8 files changed, 292 insertions(+), 237 deletions(-) diff --git a/README.md b/README.md index 641e5097e..e35a5cde9 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ TODO + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286249** ++ *Line count*: **286257** + *Field count*: **1580** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/README.txt b/admin/README.txt index 641e5097e..e35a5cde9 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -147,7 +147,7 @@ TODO + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286249** ++ *Line count*: **286257** + *Field count*: **1580** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 487f5267b..fb0608da7 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -9473,7 +9473,7 @@ class Get { if (ComponentbuilderHelper::checkString($add_rule_path['path'])) { - $module->add_rule_path[$unique][] = $add_rule_path['path']; + $module->add_rule_path[$unique] = $add_rule_path['path']; } } } @@ -9485,7 +9485,7 @@ class Get { if (ComponentbuilderHelper::checkString($add_field_path['path'])) { - $module->add_field_path[$unique][] = $add_field_path['path']; + $module->add_field_path[$unique] = $add_field_path['path']; } } } @@ -10416,7 +10416,7 @@ class Get { if (ComponentbuilderHelper::checkString($add_rule_path['path'])) { - $plugin->add_rule_path[$unique][] = $add_rule_path['path']; + $plugin->add_rule_path[$unique] = $add_rule_path['path']; } } } @@ -10428,7 +10428,7 @@ class Get { if (ComponentbuilderHelper::checkString($add_field_path['path'])) { - $plugin->add_field_path[$unique][] = $add_field_path['path']; + $plugin->add_field_path[$unique] = $add_field_path['path']; } } } diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 79532517f..dfde9137c 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -946,44 +946,78 @@ class Structure extends Get { // default to the field set name $label = $fieldset; - if (isset( - $module->fieldsets_label[$file - . $field_name . $fieldset] - )) + if (isset($module->fieldsets_label[$file . $field_name . $fieldset])) { - $label = $module->fieldsets_label[$file - . $field_name . $fieldset]; + $label = $module->fieldsets_label[$file . $field_name . $fieldset]; } // add path to module rules and custom fields - if (isset( - $module->fieldsets_paths[$file - . $field_name . $fieldset] - ) - && $module->fieldsets_paths[$file - . $field_name . $fieldset] == 2) + if (isset($module->fieldsets_paths[$file . $field_name . $fieldset]) + && ($module->fieldsets_paths[$file . $field_name . $fieldset] == 2 + || $module->fieldsets_paths[$file . $field_name . $fieldset] == 3)) { + if ($module->target == 2) + { + if (!isset($module->add_rule_path[$file . $field_name . $fieldset])) + { + $module->add_rule_path[$file . $field_name . $fieldset] = + '/administrator/modules/' + . $module->file_name . '/rules'; + } + + if (!isset($module->add_field_path[$file . $field_name . $fieldset])) + { + $module->add_field_path[$file . $field_name . $fieldset] = + '/administrator/modules/' + . $module->file_name . '/fields'; + } + } + else + { + if (!isset($module->add_rule_path[$file . $field_name . $fieldset])) + { + $module->add_rule_path[$file . $field_name . $fieldset] = + '/modules/' . $module->file_name + . '/rules'; + } + + if (!isset($module->add_field_path[$file . $field_name . $fieldset])) + { + $module->add_field_path[$file . $field_name . $fieldset] = + '/modules/' . $module->file_name + . '/fields'; + } + } + } + // add path to module rules and custom fields + if (isset($module->add_rule_path[$file . $field_name . $fieldset]) + || isset($module->add_field_path[$file . $field_name . $fieldset])) + { + $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) - . '
_t(2) - . 'addrulepath="/modules/' - . strtolower($module->code_name) - . '/rules"'; - $xml .= PHP_EOL . $this->_t(2) - . 'addfieldpath="/modules/' - . strtolower($module->code_name) - . '/fields"'; + . $this->setLine(__LINE__) . ' default paths of ' + . $fieldset . ' fieldset points to the module -->'; + + $xml .= PHP_EOL . $this->_t(1) . '
add_rule_path[$file . $field_name . $fieldset])) + { + $xml .= PHP_EOL . $this->_t(2) + . 'addrulepath="' . $module->add_rule_path[$file . $field_name . $fieldset] . '"'; + } + + if (isset($module->add_field_path[$file . $field_name . $fieldset])) + { + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="' . $module->add_field_path[$file . $field_name . $fieldset] . '"'; + } + $xml .= PHP_EOL . $this->_t(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) - . '
'; + $xml .= PHP_EOL . $this->_t(1) . '
'; } // check if we have an inner field set if (ComponentbuilderHelper::checkString( @@ -1321,46 +1355,60 @@ class Structure extends Get { // default to the field set name $label = $fieldset; - if (isset( - $plugin->fieldsets_label[$file - . $field_name . $fieldset] - )) + if (isset($plugin->fieldsets_label[$file . $field_name . $fieldset])) { - $label = $plugin->fieldsets_label[$file - . $field_name . $fieldset]; + $label = $plugin->fieldsets_label[$file . $field_name . $fieldset]; } // add path to plugin rules and custom fields - if (isset( - $plugin->fieldsets_paths[$file - . $field_name . $fieldset] - ) - && $plugin->fieldsets_paths[$file - . $field_name . $fieldset] == 2) + if (isset($plugin->fieldsets_paths[$file . $field_name . $fieldset]) + && ($plugin->fieldsets_paths[$file . $field_name . $fieldset] == 2 + || $plugin->fieldsets_paths[$file . $field_name . $fieldset] == 3)) + { + if (!isset($plugin->add_rule_path[$file . $field_name . $fieldset])) + { + $plugin->add_rule_path[$file . $field_name . $fieldset] = + '/plugins/' . strtolower($plugin->group + ) . '/' . strtolower($plugin->code_name) + . '/rules'; + } + + if (!isset($plugin->add_field_path[$file . $field_name . $fieldset])) + { + $plugin->add_field_path[$file . $field_name . $fieldset] = + '/plugins/' . strtolower($plugin->group + ) . '/' . strtolower($plugin->code_name) + . '/fields'; + } + } + // add path to plugin rules and custom fields + if (isset($plugin->add_rule_path[$file . $field_name . $fieldset]) + || isset($plugin->add_field_path[$file . $field_name . $fieldset])) { $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) - . '
_t(2) - . 'addrulepath="/plugins/' - . strtolower($plugin->group) . '/' - . strtolower($plugin->code_name) - . '/rules"'; - $xml .= PHP_EOL . $this->_t(2) - . 'addfieldpath="/plugins/' - . strtolower($plugin->group) . '/' - . strtolower($plugin->code_name) - . '/fields"'; + . $this->setLine(__LINE__) . ' default paths of ' + . $fieldset . ' fieldset points to the plugin -->'; + + $xml .= PHP_EOL . $this->_t(1) . '
add_rule_path[$file . $field_name . $fieldset])) + { + $xml .= PHP_EOL . $this->_t(2) + . 'addrulepath="' . $plugin->add_rule_path[$file . $field_name . $fieldset] . '"'; + } + + if (isset($plugin->add_field_path[$file . $field_name . $fieldset])) + { + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="' . $plugin->add_field_path[$file . $field_name . $fieldset] . '"'; + } + $xml .= PHP_EOL . $this->_t(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) - . '
'; + $xml .= PHP_EOL . $this->_t(1) . '
'; } // check if we have an inner field set if (ComponentbuilderHelper::checkString( diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 646d2816c..3beeb62c3 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -28560,37 +28560,46 @@ function vdm_dkim() { { // default to the field set name $label = $fieldset; - if (isset( - $module->fieldsets_label[$field_name . $fieldset] - )) + if (isset($module->fieldsets_label[$field_name . $fieldset])) { - $label = $module->fieldsets_label[$field_name - . $fieldset]; + $label = $module->fieldsets_label[$field_name . $fieldset]; } // add path to module rules and custom fields if (isset($module->fieldsets_paths[$field_name . $fieldset]) - && $module->fieldsets_paths[$field_name . $fieldset] - == 2) + && ($module->fieldsets_paths[$field_name . $fieldset] == 2 + || $module->fieldsets_paths[$field_name . $fieldset] == 3)) { if ($module->target == 2) { - $module->add_rule_path[$field_name . $fieldset][] = - '/administrator/modules/' - . $module->file_name . '/rules'; + if (!isset($module->add_rule_path[$field_name . $fieldset])) + { + $module->add_rule_path[$field_name . $fieldset] = + '/administrator/modules/' + . $module->file_name . '/rules'; + } - $module->add_field_path[$field_name . $fieldset][] = - '/administrator/modules/' - . $module->file_name . '/fields'; + if (!isset($module->add_field_path[$field_name . $fieldset])) + { + $module->add_field_path[$field_name . $fieldset] = + '/administrator/modules/' + . $module->file_name . '/fields'; + } } else { - $module->add_rule_path[$field_name . $fieldset][] = - '/modules/' . $module->file_name - . '/rules'; + if (!isset($module->add_rule_path[$field_name . $fieldset])) + { + $module->add_rule_path[$field_name . $fieldset] = + '/modules/' . $module->file_name + . '/rules'; + } - $module->add_field_path[$field_name . $fieldset][] = - '/modules/' . $module->file_name - . '/fields'; + if (!isset($module->add_field_path[$field_name . $fieldset])) + { + $module->add_field_path[$field_name . $fieldset] = + '/modules/' . $module->file_name + . '/fields'; + } } } // add path to module rules and custom fields @@ -28607,20 +28616,14 @@ function vdm_dkim() { if (isset($module->add_rule_path[$field_name . $fieldset])) { - foreach ($module->add_rule_path[$field_name . $fieldset] as $path) - { - $xml .= PHP_EOL . $this->_t(2) - . 'addrulepath="' . $path . '"'; - } + $xml .= PHP_EOL . $this->_t(2) + . 'addrulepath="' . $module->add_rule_path[$field_name . $fieldset] . '"'; } if (isset($module->add_field_path[$field_name . $fieldset])) { - foreach ($module->add_field_path[$field_name . $fieldset] as $path) - { - $xml .= PHP_EOL . $this->_t(2) - . 'addfieldpath="' . $path . '"'; - } + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="' . $module->add_field_path[$field_name . $fieldset] . '"'; } $xml .= PHP_EOL . $this->_t(1) . '>'; @@ -28950,28 +28953,30 @@ function vdm_dkim() { { // default to the field set name $label = $fieldset; - if (isset( - $plugin->fieldsets_label[$field_name . $fieldset] - )) + if (isset($plugin->fieldsets_label[$field_name . $fieldset])) { - $label = $plugin->fieldsets_label[$field_name - . $fieldset]; + $label = $plugin->fieldsets_label[$field_name . $fieldset]; } - // add path to plugin rules and custom fields if (isset($plugin->fieldsets_paths[$field_name . $fieldset]) - && $plugin->fieldsets_paths[$field_name . $fieldset] - == 2) + && ($plugin->fieldsets_paths[$field_name . $fieldset] == 2 + || $plugin->fieldsets_paths[$field_name . $fieldset] == 3)) { - $plugin->add_rule_path[$field_name . $fieldset][] = - '/plugins/' . strtolower($plugin->group - ) . '/' . strtolower($plugin->code_name) - . '/rules'; + if (!isset($plugin->add_rule_path[$field_name . $fieldset])) + { + $plugin->add_rule_path[$field_name . $fieldset] = + '/plugins/' . strtolower($plugin->group + ) . '/' . strtolower($plugin->code_name) + . '/rules'; + } - $plugin->add_field_path[$field_name . $fieldset][] = - '/plugins/' . strtolower($plugin->group - ) . '/' . strtolower($plugin->code_name) - . '/fields'; + if (!isset($plugin->add_field_path[$field_name . $fieldset])) + { + $plugin->add_field_path[$field_name . $fieldset] = + '/plugins/' . strtolower($plugin->group + ) . '/' . strtolower($plugin->code_name) + . '/fields'; + } } // add path to plugin rules and custom fields if (isset($plugin->add_rule_path[$field_name . $fieldset]) @@ -28986,20 +28991,14 @@ function vdm_dkim() { if (isset($plugin->add_rule_path[$field_name . $fieldset])) { - foreach ($plugin->add_rule_path[$field_name . $fieldset] as $path) - { - $xml .= PHP_EOL . $this->_t(2) - . 'addrulepath="' . $path . '"'; - } + $xml .= PHP_EOL . $this->_t(2) + . 'addrulepath="' . $plugin->add_rule_path[$field_name . $fieldset] . '"'; } if (isset($plugin->add_field_path[$field_name . $fieldset])) { - foreach ($plugin->add_field_path[$field_name . $fieldset] as $path) - { - $xml .= PHP_EOL . $this->_t(2) - . 'addfieldpath="' . $path . '"'; - } + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="' . $plugin->add_field_path[$field_name . $fieldset] . '"'; } $xml .= PHP_EOL . $this->_t(1) . '>'; diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index edf9bec16..eff098d0c 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -6237,11 +6237,11 @@ COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_N_ITEMS_UNFEATURED_1="%s Joomla Modu COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_N_ITEMS_UNPUBLISHED="%s Joomla Modules Updates unpublished." COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_N_ITEMS_UNPUBLISHED_1="%s Joomla Module Updates unpublished." COM_COMPONENTBUILDER_JOOMLA_MODULE_ABSTRACT_CLASS="abstract class" -COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDFIELDPATH_DESCRIPTION="Set extra field paths" -COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDFIELDPATH_LABEL="Extra Field Paths" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDFIELDPATH_DESCRIPTION="Set other field path" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDFIELDPATH_LABEL="Other Field Path" COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDREADME_LABEL="Add README" -COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDRULEPATH_DESCRIPTION="Set extra rule paths" -COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDRULEPATH_LABEL="Extra Rule Paths" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDRULEPATH_DESCRIPTION="Set other rule path" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADDRULEPATH_LABEL="Other Rule Path" COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_CLASS_HELPER_DESCRIPTION="You can add a helper class to your module." COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_CLASS_HELPER_HEADER_DESCRIPTION="You can add your own custom helper header script." COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_CLASS_HELPER_HEADER_LABEL="Add Class Helper Header" @@ -6686,11 +6686,11 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_N_ITEMS_UNFEATURED="%s Joomla Plugin COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_N_ITEMS_UNFEATURED_1="%s Joomla Plugin Updates unfeatured." COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_N_ITEMS_UNPUBLISHED="%s Joomla Plugins Updates unpublished." COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_N_ITEMS_UNPUBLISHED_1="%s Joomla Plugin Updates unpublished." -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDFIELDPATH_DESCRIPTION="Set extra field paths" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDFIELDPATH_LABEL="Extra Field Paths" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDFIELDPATH_DESCRIPTION="Set other field path" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDFIELDPATH_LABEL="Other Field Path" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDREADME_LABEL="Add README" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDRULEPATH_DESCRIPTION="Set extra rule paths" -COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDRULEPATH_LABEL="Extra Rule Paths" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDRULEPATH_DESCRIPTION="Set other rule path" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADDRULEPATH_LABEL="Other Rule Path" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_HEAD_DESCRIPTION="You can add your own custom header script, combined with the default header script that make the extended class work." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_HEAD_LABEL="Add Custom Class Header" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ADD_PHP_METHOD_UNINSTALL_LABEL="Add PHP Method (uninstall)" diff --git a/admin/models/forms/joomla_module.xml b/admin/models/forms/joomla_module.xml index 012447170..e4e0579a1 100644 --- a/admin/models/forms/joomla_module.xml +++ b/admin/models/forms/joomla_module.xml @@ -647,6 +647,64 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_COMPONENT + + + + + + + + - - - - - - diff --git a/admin/models/forms/joomla_plugin.xml b/admin/models/forms/joomla_plugin.xml index 43893074e..4b587a0a3 100644 --- a/admin/models/forms/joomla_plugin.xml +++ b/admin/models/forms/joomla_plugin.xml @@ -526,6 +526,64 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_COMPONENT + + + + + + + + - - - - - - -- 2.40.1 From c8893d8c9463128c57a67ca4f429a2d0566ad708 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sat, 5 Feb 2022 23:24:51 +0200 Subject: [PATCH 06/12] Fixed the layout display listing in other template and layouts. --- README.md | 4 ++-- admin/README.txt | 4 ++-- admin/models/ajax.php | 54 +++++++++++++++++++++++-------------------- componentbuilder.xml | 2 +- 4 files changed, 34 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index e35a5cde9..8d7cb514a 100644 --- a/README.md +++ b/README.md @@ -143,11 +143,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 4th February, 2022 ++ *Last Build*: 5th February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286257** ++ *Line count*: **286261** + *Field count*: **1580** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/README.txt b/admin/README.txt index e35a5cde9..8d7cb514a 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -143,11 +143,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 4th February, 2022 ++ *Last Build*: 5th February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286257** ++ *Line count*: **286261** + *Field count*: **1580** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 78657fe19..5d9ddab42 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -1803,10 +1803,10 @@ class ComponentbuilderModelAjax extends JModelList $db = JFactory::getDbo(); // Create a new query object. $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.id','a.alias','a.template','b.name','a.dynamic_get'))); + $query->select($db->quoteName(array('a.id', 'a.alias', 'a.template', 'b.name', 'a.dynamic_get'))); $query->from($db->quoteName('#__componentbuilder_template', 'a')); $query->join('LEFT', $db->quoteName('#__componentbuilder_dynamic_get', 'b') . ' ON (' . $db->quoteName('b.id') . ' = ' . $db->quoteName('a.dynamic_get') . ')'); - $query->where($db->quoteName('a.id') . ' != '.(int) $id); + $query->where($db->quoteName('a.id') . ' != '. (int) $id); $query->where($db->quoteName('a.published') . ' = 1'); // Reset the query using our newly populated query object. $db->setQuery($query); @@ -1839,10 +1839,10 @@ class ComponentbuilderModelAjax extends JModelList $templateString[] = "".$result->name." ".$editget."<?php echo \$this->loadTemplate('".ComponentbuilderHelper::safeString($result->alias)."'); ?> ".$edit.""; } // build the table - $table = '

'.JText::_('COM_COMPONENTBUILDER_TEMPLATE_CODE_SNIPPETS').'

'; - $table .= ''; - $table .= ''; - $table .= ''.implode("",$templateString)."
'.JText::_('COM_COMPONENTBUILDER_TO_ADD_SIMPLY_COPY_AND_PAST_THE_SNIPPET_INTO_YOUR_CODE').'
'.JText::_('COM_COMPONENTBUILDER_NAME_OF_DYNAMICGET').''.JText::_('COM_COMPONENTBUILDER_SNIPPET').'
"; + $table = '

' . JText::_('COM_COMPONENTBUILDER_TEMPLATE_CODE_SNIPPETS') . '

'; + $table .= ''; + $table .= ''; + $table .= '' . implode("", $templateString) . "
' . JText::_('COM_COMPONENTBUILDER_TO_ADD_SIMPLY_COPY_AND_PAST_THE_SNIPPET_INTO_YOUR_CODE') . '
' . JText::_('COM_COMPONENTBUILDER_NAME_OF_DYNAMICGET') . '' . JText::_('COM_COMPONENTBUILDER_SNIPPET') . '
"; } return $table; } @@ -1892,34 +1892,38 @@ class ComponentbuilderModelAjax extends JModelList switch ($result->gettype) { case 1: - // single - $layoutString[] = "".$result->name." ".$editget."<?php echo JLayoutHelper::render('".ComponentbuilderHelper::safeString($result->alias)."', \$this->item); ?> ".$edit.""; + // single + $layoutString[] = "" . $result->name . " " . $editget . "<?php echo JLayoutHelper::render('" . ComponentbuilderHelper::safeString($result->alias) . "', \$this->item); ?> " . $edit . ""; break; case 2: - // list - $layoutString[] = "".$result->name." ".$editget."<?php echo JLayoutHelper::render('".ComponentbuilderHelper::safeString($result->alias)."', \$this->items); ?> ".$edit.""; + // list + $layoutString[] = "" . $result->name . " " . $editget . "<?php echo JLayoutHelper::render('" . ComponentbuilderHelper::safeString($result->alias) . "', \$this->items); ?> " . $edit . ""; break; case 3: case 4: - // custom - $result->getcustom = ComponentbuilderHelper::safeString($result->getcustom); - if (substr($result->getcustom, 0, strlen('get')) == 'get') - { - $varName = substr($result->getcustom, strlen('get')); - } - else - { - $varName = $result->getcustom; - } - $layoutString[] = "".$result->name." ".$editget."<?php echo JLayoutHelper::render('".ComponentbuilderHelper::safeString($result->alias)."', \$this->".$varName."); ?> ".$edit.""; + // custom + $result->getcustom = ComponentbuilderHelper::safeString($result->getcustom); + if (substr($result->getcustom, 0, strlen('get')) == 'get') + { + $varName = substr($result->getcustom, strlen('get')); + } + else + { + $varName = $result->getcustom; + } + $layoutString[] = "" . $result->name . " " . $editget . "<?php echo JLayoutHelper::render('" . ComponentbuilderHelper::safeString($result->alias) . "', \$this->" . $varName . "); ?> " . $edit . ""; + break; + default: + // no get + $layoutString[] = "" . JText::_('COM_COMPONENTBUILDER_NONE_SELECTED') . "<?php echo JLayoutHelper::render('" . ComponentbuilderHelper::safeString($result->alias) . "', [?]); ?> " . $edit . ""; break; } } // build the table - $table = '

'.JText::_('COM_COMPONENTBUILDER_LAYOUT_CODE_SNIPPETS').'

'; - $table .= ''; - $table .= ''; - $table .= ''.implode("",$layoutString)."
'.JText::_('COM_COMPONENTBUILDER_TO_ADD_SIMPLY_COPY_AND_PAST_THE_SNIPPET_INTO_YOUR_CODE').'
'.JText::_('COM_COMPONENTBUILDER_NAME_OF_DYNAMICGET').''.JText::_('COM_COMPONENTBUILDER_SNIPPET').'
"; + $table = '

' . JText::_('COM_COMPONENTBUILDER_LAYOUT_CODE_SNIPPETS') . '

'; + $table .= ''; + $table .= ''; + $table .= '' . implode("",$layoutString) . "
' . JText::_('COM_COMPONENTBUILDER_TO_ADD_SIMPLY_COPY_AND_PAST_THE_SNIPPET_INTO_YOUR_CODE') . '
' . JText::_('COM_COMPONENTBUILDER_NAME_OF_DYNAMICGET') . '' . JText::_('COM_COMPONENTBUILDER_SNIPPET') . '
"; } return $table; } diff --git a/componentbuilder.xml b/componentbuilder.xml index 53e07a584..6013ea882 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 4th February, 2022 + 5th February, 2022 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com -- 2.40.1 From 94c934c436abf4569124254ea4dc9a731b3bd2c9 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 9 Feb 2022 23:19:08 +0200 Subject: [PATCH 07/12] Improve help to allow the help url to be global in the view. --- README.md | 2 +- admin/README.txt | 2 +- admin/helpers/compiler/e_Interpretation.php | 6 +++--- admin/views/admin_custom_tabs/view.html.php | 6 +++--- admin/views/admin_fields/view.html.php | 6 +++--- admin/views/admin_fields_conditions/view.html.php | 6 +++--- admin/views/admin_fields_relations/view.html.php | 6 +++--- admin/views/admin_view/view.html.php | 6 +++--- admin/views/class_extends/view.html.php | 6 +++--- admin/views/class_method/view.html.php | 6 +++--- admin/views/class_property/view.html.php | 6 +++--- admin/views/component_admin_views/view.html.php | 6 +++--- admin/views/component_config/view.html.php | 6 +++--- admin/views/component_custom_admin_menus/view.html.php | 6 +++--- admin/views/component_custom_admin_views/view.html.php | 6 +++--- admin/views/component_dashboard/view.html.php | 6 +++--- admin/views/component_files_folders/view.html.php | 6 +++--- admin/views/component_modules/view.html.php | 6 +++--- admin/views/component_mysql_tweaks/view.html.php | 6 +++--- admin/views/component_placeholders/view.html.php | 6 +++--- admin/views/component_plugins/view.html.php | 6 +++--- admin/views/component_site_views/view.html.php | 6 +++--- admin/views/component_updates/view.html.php | 6 +++--- admin/views/custom_admin_view/view.html.php | 6 +++--- admin/views/custom_code/view.html.php | 6 +++--- admin/views/dynamic_get/view.html.php | 6 +++--- admin/views/field/view.html.php | 6 +++--- admin/views/fieldtype/view.html.php | 6 +++--- admin/views/help_document/view.html.php | 6 +++--- admin/views/joomla_component/view.html.php | 6 +++--- admin/views/joomla_module/view.html.php | 6 +++--- admin/views/joomla_module_files_folders_urls/view.html.php | 6 +++--- admin/views/joomla_module_updates/view.html.php | 6 +++--- admin/views/joomla_plugin/view.html.php | 6 +++--- admin/views/joomla_plugin_files_folders_urls/view.html.php | 6 +++--- admin/views/joomla_plugin_group/view.html.php | 6 +++--- admin/views/joomla_plugin_updates/view.html.php | 6 +++--- admin/views/language/view.html.php | 6 +++--- admin/views/language_translation/view.html.php | 6 +++--- admin/views/layout/view.html.php | 6 +++--- admin/views/library/view.html.php | 6 +++--- admin/views/library_config/view.html.php | 6 +++--- admin/views/library_files_folders_urls/view.html.php | 6 +++--- admin/views/placeholder/view.html.php | 6 +++--- admin/views/server/view.html.php | 6 +++--- admin/views/site_view/view.html.php | 6 +++--- admin/views/snippet/view.html.php | 6 +++--- admin/views/snippet_type/view.html.php | 6 +++--- admin/views/template/view.html.php | 6 +++--- admin/views/validation_rule/view.html.php | 6 +++--- componentbuilder.xml | 2 +- 51 files changed, 147 insertions(+), 147 deletions(-) diff --git a/README.md b/README.md index 8d7cb514a..fe59c63ee 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 5th February, 2022 ++ *Last Build*: 9th February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt diff --git a/admin/README.txt b/admin/README.txt index 8d7cb514a..fe59c63ee 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -143,7 +143,7 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 5th February, 2022 ++ *Last Build*: 9th February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 3beeb62c3..7f5aa532d 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -21444,16 +21444,16 @@ class Interpretation extends Fields $toolBar .= PHP_EOL . $this->_t(2) . "JToolbarHelper::divider();"; $toolBar .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " set help url for this view if found"; - $toolBar .= PHP_EOL . $this->_t(2) . "\$help_url = " + $toolBar .= PHP_EOL . $this->_t(2) . "\$this->help_url = " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::getHelpUrl('" . $nameSingleCode . "');"; $toolBar .= PHP_EOL . $this->_t(2) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' - . $this->hhh] . "Helper::checkString(\$help_url))"; + . $this->hhh] . "Helper::checkString(\$this->help_url))"; $toolBar .= PHP_EOL . $this->_t(2) . "{"; $toolBar .= PHP_EOL . $this->_t(3) . "JToolbarHelper::help('" - . $this->langPrefix . "_HELP_MANAGER', false, \$help_url);"; + . $this->langPrefix . "_HELP_MANAGER', false, \$this->help_url);"; $toolBar .= PHP_EOL . $this->_t(2) . "}"; } diff --git a/admin/views/admin_custom_tabs/view.html.php b/admin/views/admin_custom_tabs/view.html.php index 1470f8143..7a8cbc4db 100644 --- a/admin/views/admin_custom_tabs/view.html.php +++ b/admin/views/admin_custom_tabs/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewAdmin_custom_tabs extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admin_custom_tabs'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('admin_custom_tabs'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/admin_fields/view.html.php b/admin/views/admin_fields/view.html.php index 7bee7b0a6..aa2f62426 100644 --- a/admin/views/admin_fields/view.html.php +++ b/admin/views/admin_fields/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewAdmin_fields extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admin_fields'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('admin_fields'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/admin_fields_conditions/view.html.php b/admin/views/admin_fields_conditions/view.html.php index e5eeeb989..d23c4f0aa 100644 --- a/admin/views/admin_fields_conditions/view.html.php +++ b/admin/views/admin_fields_conditions/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewAdmin_fields_conditions extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admin_fields_conditions'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('admin_fields_conditions'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/admin_fields_relations/view.html.php b/admin/views/admin_fields_relations/view.html.php index a3d11866a..a5663f78f 100644 --- a/admin/views/admin_fields_relations/view.html.php +++ b/admin/views/admin_fields_relations/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewAdmin_fields_relations extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admin_fields_relations'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('admin_fields_relations'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/admin_view/view.html.php b/admin/views/admin_view/view.html.php index 0ab507005..d673c6735 100644 --- a/admin/views/admin_view/view.html.php +++ b/admin/views/admin_view/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewAdmin_view extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admin_view'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('admin_view'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/class_extends/view.html.php b/admin/views/class_extends/view.html.php index bfc6fde5a..aa432667b 100644 --- a/admin/views/class_extends/view.html.php +++ b/admin/views/class_extends/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewClass_extends extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('class_extends'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('class_extends'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/class_method/view.html.php b/admin/views/class_method/view.html.php index 83174bd37..20873dbbc 100644 --- a/admin/views/class_method/view.html.php +++ b/admin/views/class_method/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewClass_method extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('class_method'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('class_method'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/class_property/view.html.php b/admin/views/class_property/view.html.php index bd53bfd77..9248f770a 100644 --- a/admin/views/class_property/view.html.php +++ b/admin/views/class_property/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewClass_property extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('class_property'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('class_property'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_admin_views/view.html.php b/admin/views/component_admin_views/view.html.php index c1c6672cc..b1bc6a80c 100644 --- a/admin/views/component_admin_views/view.html.php +++ b/admin/views/component_admin_views/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_admin_views extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_admin_views'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_admin_views'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_config/view.html.php b/admin/views/component_config/view.html.php index d587a749a..956a7eaa1 100644 --- a/admin/views/component_config/view.html.php +++ b/admin/views/component_config/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_config extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_config'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_config'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_custom_admin_menus/view.html.php b/admin/views/component_custom_admin_menus/view.html.php index 73fc4ae83..45ecc11cb 100644 --- a/admin/views/component_custom_admin_menus/view.html.php +++ b/admin/views/component_custom_admin_menus/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_custom_admin_menus extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_custom_admin_menus'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_custom_admin_menus'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_custom_admin_views/view.html.php b/admin/views/component_custom_admin_views/view.html.php index 4a0ffa64a..a22b00644 100644 --- a/admin/views/component_custom_admin_views/view.html.php +++ b/admin/views/component_custom_admin_views/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_custom_admin_views extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_custom_admin_views'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_custom_admin_views'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_dashboard/view.html.php b/admin/views/component_dashboard/view.html.php index fde6f2f25..c6b9a5618 100644 --- a/admin/views/component_dashboard/view.html.php +++ b/admin/views/component_dashboard/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_dashboard extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_dashboard'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_dashboard'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_files_folders/view.html.php b/admin/views/component_files_folders/view.html.php index da593a5cd..ffe48dad0 100644 --- a/admin/views/component_files_folders/view.html.php +++ b/admin/views/component_files_folders/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_files_folders extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_files_folders'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_files_folders'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_modules/view.html.php b/admin/views/component_modules/view.html.php index c9e8adbc8..414bee80f 100644 --- a/admin/views/component_modules/view.html.php +++ b/admin/views/component_modules/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_modules extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_modules'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_modules'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_mysql_tweaks/view.html.php b/admin/views/component_mysql_tweaks/view.html.php index 988764990..3a7f557bb 100644 --- a/admin/views/component_mysql_tweaks/view.html.php +++ b/admin/views/component_mysql_tweaks/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_mysql_tweaks extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_mysql_tweaks'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_mysql_tweaks'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_placeholders/view.html.php b/admin/views/component_placeholders/view.html.php index 847047c13..cdbfa52f6 100644 --- a/admin/views/component_placeholders/view.html.php +++ b/admin/views/component_placeholders/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_placeholders extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_placeholders'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_placeholders'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_plugins/view.html.php b/admin/views/component_plugins/view.html.php index 679bfc45c..801d3852a 100644 --- a/admin/views/component_plugins/view.html.php +++ b/admin/views/component_plugins/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_plugins extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_plugins'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_plugins'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_site_views/view.html.php b/admin/views/component_site_views/view.html.php index 1c5c31508..5e68385dd 100644 --- a/admin/views/component_site_views/view.html.php +++ b/admin/views/component_site_views/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_site_views extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_site_views'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_site_views'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/component_updates/view.html.php b/admin/views/component_updates/view.html.php index 04855c151..b2d4e7020 100644 --- a/admin/views/component_updates/view.html.php +++ b/admin/views/component_updates/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewComponent_updates extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('component_updates'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('component_updates'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/custom_admin_view/view.html.php b/admin/views/custom_admin_view/view.html.php index 64f222bad..909b43c8d 100644 --- a/admin/views/custom_admin_view/view.html.php +++ b/admin/views/custom_admin_view/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewCustom_admin_view extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('custom_admin_view'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('custom_admin_view'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/custom_code/view.html.php b/admin/views/custom_code/view.html.php index 4097c6469..86622d143 100644 --- a/admin/views/custom_code/view.html.php +++ b/admin/views/custom_code/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewCustom_code extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('custom_code'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('custom_code'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/dynamic_get/view.html.php b/admin/views/dynamic_get/view.html.php index 19cf405c7..1aa339f9f 100644 --- a/admin/views/dynamic_get/view.html.php +++ b/admin/views/dynamic_get/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewDynamic_get extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('dynamic_get'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('dynamic_get'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/field/view.html.php b/admin/views/field/view.html.php index 68fe2a49b..1499d2e07 100644 --- a/admin/views/field/view.html.php +++ b/admin/views/field/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewField extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('field'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('field'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/fieldtype/view.html.php b/admin/views/fieldtype/view.html.php index 993adb10b..c7ff7b428 100644 --- a/admin/views/fieldtype/view.html.php +++ b/admin/views/fieldtype/view.html.php @@ -153,10 +153,10 @@ class ComponentbuilderViewFieldtype extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('fieldtype'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('fieldtype'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/help_document/view.html.php b/admin/views/help_document/view.html.php index 810ee0295..70747b5ae 100644 --- a/admin/views/help_document/view.html.php +++ b/admin/views/help_document/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewHelp_document extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('help_document'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('help_document'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/joomla_component/view.html.php b/admin/views/joomla_component/view.html.php index e8a26f9c2..74141674c 100644 --- a/admin/views/joomla_component/view.html.php +++ b/admin/views/joomla_component/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewJoomla_component extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_component'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_component'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/joomla_module/view.html.php b/admin/views/joomla_module/view.html.php index d1564a860..240d90634 100644 --- a/admin/views/joomla_module/view.html.php +++ b/admin/views/joomla_module/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewJoomla_module extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_module'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_module'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/joomla_module_files_folders_urls/view.html.php b/admin/views/joomla_module_files_folders_urls/view.html.php index 7c63be884..e9be94ebf 100644 --- a/admin/views/joomla_module_files_folders_urls/view.html.php +++ b/admin/views/joomla_module_files_folders_urls/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewJoomla_module_files_folders_urls extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_module_files_folders_urls'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_module_files_folders_urls'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/joomla_module_updates/view.html.php b/admin/views/joomla_module_updates/view.html.php index 711e72e2c..d4ec249c7 100644 --- a/admin/views/joomla_module_updates/view.html.php +++ b/admin/views/joomla_module_updates/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewJoomla_module_updates extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_module_updates'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_module_updates'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/joomla_plugin/view.html.php b/admin/views/joomla_plugin/view.html.php index 334f1ac8d..773da7ca3 100644 --- a/admin/views/joomla_plugin/view.html.php +++ b/admin/views/joomla_plugin/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewJoomla_plugin extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/joomla_plugin_files_folders_urls/view.html.php b/admin/views/joomla_plugin_files_folders_urls/view.html.php index cfca9a0a8..3209b6e6d 100644 --- a/admin/views/joomla_plugin_files_folders_urls/view.html.php +++ b/admin/views/joomla_plugin_files_folders_urls/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewJoomla_plugin_files_folders_urls extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_files_folders_urls'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_files_folders_urls'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/joomla_plugin_group/view.html.php b/admin/views/joomla_plugin_group/view.html.php index d62533675..b4ad2b452 100644 --- a/admin/views/joomla_plugin_group/view.html.php +++ b/admin/views/joomla_plugin_group/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewJoomla_plugin_group extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_group'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_group'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/joomla_plugin_updates/view.html.php b/admin/views/joomla_plugin_updates/view.html.php index 480368a43..2b6082e26 100644 --- a/admin/views/joomla_plugin_updates/view.html.php +++ b/admin/views/joomla_plugin_updates/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewJoomla_plugin_updates extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_updates'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_updates'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/language/view.html.php b/admin/views/language/view.html.php index f5acb5adb..f4f85f4e1 100644 --- a/admin/views/language/view.html.php +++ b/admin/views/language/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewLanguage extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('language'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('language'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/language_translation/view.html.php b/admin/views/language_translation/view.html.php index 95bf1a9c5..7e22642a3 100644 --- a/admin/views/language_translation/view.html.php +++ b/admin/views/language_translation/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewLanguage_translation extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('language_translation'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('language_translation'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/layout/view.html.php b/admin/views/layout/view.html.php index 0a7dbae78..7c730c0e9 100644 --- a/admin/views/layout/view.html.php +++ b/admin/views/layout/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewLayout extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('layout'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('layout'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/library/view.html.php b/admin/views/library/view.html.php index 713cf69c1..8f112390d 100644 --- a/admin/views/library/view.html.php +++ b/admin/views/library/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewLibrary extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('library'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('library'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/library_config/view.html.php b/admin/views/library_config/view.html.php index 2b81ea337..23e7ed569 100644 --- a/admin/views/library_config/view.html.php +++ b/admin/views/library_config/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewLibrary_config extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('library_config'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('library_config'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/library_files_folders_urls/view.html.php b/admin/views/library_files_folders_urls/view.html.php index 6d0c97d78..92e372ae6 100644 --- a/admin/views/library_files_folders_urls/view.html.php +++ b/admin/views/library_files_folders_urls/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewLibrary_files_folders_urls extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('library_files_folders_urls'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('library_files_folders_urls'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/placeholder/view.html.php b/admin/views/placeholder/view.html.php index fd2251c68..02d723b54 100644 --- a/admin/views/placeholder/view.html.php +++ b/admin/views/placeholder/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewPlaceholder extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('placeholder'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('placeholder'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/server/view.html.php b/admin/views/server/view.html.php index 77872b738..8ea315579 100644 --- a/admin/views/server/view.html.php +++ b/admin/views/server/view.html.php @@ -153,10 +153,10 @@ class ComponentbuilderViewServer extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('server'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('server'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/site_view/view.html.php b/admin/views/site_view/view.html.php index 6af297408..95d028d3c 100644 --- a/admin/views/site_view/view.html.php +++ b/admin/views/site_view/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewSite_view extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('site_view'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('site_view'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/snippet/view.html.php b/admin/views/snippet/view.html.php index 459c0b248..420f84c63 100644 --- a/admin/views/snippet/view.html.php +++ b/admin/views/snippet/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewSnippet extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('snippet'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('snippet'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/snippet_type/view.html.php b/admin/views/snippet_type/view.html.php index a77d759e1..bfb531347 100644 --- a/admin/views/snippet_type/view.html.php +++ b/admin/views/snippet_type/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewSnippet_type extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('snippet_type'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('snippet_type'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/template/view.html.php b/admin/views/template/view.html.php index 85b2d28af..1628c6670 100644 --- a/admin/views/template/view.html.php +++ b/admin/views/template/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewTemplate extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('template'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('template'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/admin/views/validation_rule/view.html.php b/admin/views/validation_rule/view.html.php index b36fa9b8c..9f8f8ed82 100644 --- a/admin/views/validation_rule/view.html.php +++ b/admin/views/validation_rule/view.html.php @@ -150,10 +150,10 @@ class ComponentbuilderViewValidation_rule extends JViewLegacy } JToolbarHelper::divider(); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('validation_rule'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('validation_rule'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } diff --git a/componentbuilder.xml b/componentbuilder.xml index 6013ea882..eb4150402 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 5th February, 2022 + 9th February, 2022 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com -- 2.40.1 From dd3335771ccd99b15802fc699d4577c3048bb5ac Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sun, 13 Feb 2022 00:28:17 +0200 Subject: [PATCH 08/12] Improve help to allow the help url to be global in all the views. Fixed the zip wrapper to include .htaccess files for library folders. --- README.md | 2 +- admin/README.txt | 2 +- admin/compiler/joomla_3/DASHJViewLagacy.php | 6 +++--- admin/compiler/joomla_3/JViewLegacy_custom_admin.php | 6 +++--- admin/compiler/joomla_3/JViewLegacy_import.php | 6 +++--- admin/compiler/joomla_3/JViewLegacy_import_custom.php | 6 +++--- admin/compiler/joomla_3/JViewLegacy_list.php | 6 +++--- admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php | 6 +++--- admin/compiler/joomla_3/JViewLegacy_list_site.php | 6 +++--- admin/compiler/joomla_3/JViewLegacy_site.php | 6 +++--- admin/helpers/componentbuilder.php | 4 ++-- admin/views/admin_views/view.html.php | 6 +++--- admin/views/admins_custom_tabs/view.html.php | 6 +++--- admin/views/admins_fields/view.html.php | 6 +++--- admin/views/admins_fields_conditions/view.html.php | 6 +++--- admin/views/admins_fields_relations/view.html.php | 6 +++--- admin/views/class_extendings/view.html.php | 6 +++--- admin/views/class_methods/view.html.php | 6 +++--- admin/views/class_properties/view.html.php | 6 +++--- admin/views/compiler/view.html.php | 6 +++--- admin/views/componentbuilder/view.html.php | 6 +++--- admin/views/components_admin_views/view.html.php | 6 +++--- admin/views/components_config/view.html.php | 6 +++--- admin/views/components_custom_admin_menus/view.html.php | 6 +++--- admin/views/components_custom_admin_views/view.html.php | 6 +++--- admin/views/components_dashboard/view.html.php | 6 +++--- admin/views/components_files_folders/view.html.php | 6 +++--- admin/views/components_modules/view.html.php | 6 +++--- admin/views/components_mysql_tweaks/view.html.php | 6 +++--- admin/views/components_placeholders/view.html.php | 6 +++--- admin/views/components_plugins/view.html.php | 6 +++--- admin/views/components_site_views/view.html.php | 6 +++--- admin/views/components_updates/view.html.php | 6 +++--- admin/views/custom_admin_views/view.html.php | 6 +++--- admin/views/custom_codes/view.html.php | 6 +++--- admin/views/dynamic_gets/view.html.php | 6 +++--- admin/views/fields/view.html.php | 6 +++--- admin/views/fieldtypes/view.html.php | 6 +++--- admin/views/get_snippets/view.html.php | 6 +++--- admin/views/help_documents/view.html.php | 6 +++--- admin/views/import/view.html.php | 6 +++--- admin/views/import_joomla_components/view.html.php | 6 +++--- admin/views/import_language_translations/view.html.php | 6 +++--- admin/views/joomla_components/view.html.php | 6 +++--- admin/views/joomla_modules/view.html.php | 6 +++--- admin/views/joomla_modules_files_folders_urls/view.html.php | 6 +++--- admin/views/joomla_modules_updates/view.html.php | 6 +++--- admin/views/joomla_plugin_groups/view.html.php | 6 +++--- admin/views/joomla_plugins/view.html.php | 6 +++--- admin/views/joomla_plugins_files_folders_urls/view.html.php | 6 +++--- admin/views/joomla_plugins_updates/view.html.php | 6 +++--- admin/views/language_translations/view.html.php | 6 +++--- admin/views/languages/view.html.php | 6 +++--- admin/views/layouts/view.html.php | 6 +++--- admin/views/libraries/view.html.php | 6 +++--- admin/views/libraries_config/view.html.php | 6 +++--- admin/views/libraries_files_folders_urls/view.html.php | 6 +++--- admin/views/placeholders/view.html.php | 6 +++--- admin/views/servers/view.html.php | 6 +++--- admin/views/site_views/view.html.php | 6 +++--- admin/views/snippet_types/view.html.php | 6 +++--- admin/views/snippets/view.html.php | 6 +++--- admin/views/templates/view.html.php | 6 +++--- admin/views/validation_rules/view.html.php | 6 +++--- componentbuilder.xml | 2 +- site/helpers/componentbuilder.php | 4 ++-- site/views/api/view.html.php | 6 +++--- 67 files changed, 193 insertions(+), 193 deletions(-) diff --git a/README.md b/README.md index fe59c63ee..bb2aaa1a6 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 9th February, 2022 ++ *Last Build*: 12th February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt diff --git a/admin/README.txt b/admin/README.txt index fe59c63ee..bb2aaa1a6 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -143,7 +143,7 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 9th February, 2022 ++ *Last Build*: 12th February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt diff --git a/admin/compiler/joomla_3/DASHJViewLagacy.php b/admin/compiler/joomla_3/DASHJViewLagacy.php index f8570c57e..c9a759f75 100644 --- a/admin/compiler/joomla_3/DASHJViewLagacy.php +++ b/admin/compiler/joomla_3/DASHJViewLagacy.php @@ -62,10 +62,10 @@ class ###Component###View###Component### extends JViewLegacy JToolBarHelper::title(JText::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2'); // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('###component###'); - if (###Component###Helper::checkString($help_url)) + $this->help_url = ###Component###Helper::getHelpUrl('###component###'); + if (###Component###Helper::checkString($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } if ($canDo->get('core.admin') || $canDo->get('core.options')) diff --git a/admin/compiler/joomla_3/JViewLegacy_custom_admin.php b/admin/compiler/joomla_3/JViewLegacy_custom_admin.php index d0fe52b18..8f3201187 100644 --- a/admin/compiler/joomla_3/JViewLegacy_custom_admin.php +++ b/admin/compiler/joomla_3/JViewLegacy_custom_admin.php @@ -63,10 +63,10 @@ class ###Component###View###SView### extends JViewLegacy JToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('###sviews###'); - if (###Component###Helper::checkString($help_url)) + $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); + if (###Component###Helper::checkString($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/compiler/joomla_3/JViewLegacy_import.php b/admin/compiler/joomla_3/JViewLegacy_import.php index 853c4cb75..3371eace3 100644 --- a/admin/compiler/joomla_3/JViewLegacy_import.php +++ b/admin/compiler/joomla_3/JViewLegacy_import.php @@ -89,10 +89,10 @@ class ###Component###ViewImport extends JViewLegacy } // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('import'); - if (###Component###Helper::checkString($help_url)) + $this->help_url = ###Component###Helper::getHelpUrl('import'); + if (###Component###Helper::checkString($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/compiler/joomla_3/JViewLegacy_import_custom.php b/admin/compiler/joomla_3/JViewLegacy_import_custom.php index e540e6e31..f8b56738c 100644 --- a/admin/compiler/joomla_3/JViewLegacy_import_custom.php +++ b/admin/compiler/joomla_3/JViewLegacy_import_custom.php @@ -37,10 +37,10 @@ class ###Component###View###View### extends JViewLegacy } // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('###view###'); - if (###Component###Helper::checkString($help_url)) + $this->help_url = ###Component###Helper::getHelpUrl('###view###'); + if (###Component###Helper::checkString($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/compiler/joomla_3/JViewLegacy_list.php b/admin/compiler/joomla_3/JViewLegacy_list.php index 2f2718e14..2b457fe14 100644 --- a/admin/compiler/joomla_3/JViewLegacy_list.php +++ b/admin/compiler/joomla_3/JViewLegacy_list.php @@ -129,10 +129,10 @@ class ###Component###View###Views### extends JViewLegacy }###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST######IMPORTBUTTON### // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('###views###'); - if (###Component###Helper::checkString($help_url)) + $this->help_url = ###Component###Helper::getHelpUrl('###views###'); + if (###Component###Helper::checkString($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php b/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php index f128fab13..f56863a6c 100644 --- a/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php +++ b/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php @@ -53,10 +53,10 @@ class ###Component###View###SViews### extends JViewLegacy JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('###sviews###'); - if (###Component###Helper::checkString($help_url)) + $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); + if (###Component###Helper::checkString($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/compiler/joomla_3/JViewLegacy_list_site.php b/admin/compiler/joomla_3/JViewLegacy_list_site.php index db213620c..7a2410c70 100644 --- a/admin/compiler/joomla_3/JViewLegacy_list_site.php +++ b/admin/compiler/joomla_3/JViewLegacy_list_site.php @@ -49,10 +49,10 @@ class ###Component###View###SViews### extends JViewLegacy {###SITE_CUSTOM_BUTTONS### // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('###sviews###'); - if (###Component###Helper::checkString($help_url)) + $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); + if (###Component###Helper::checkString($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // now initiate the toolbar $this->toolbar = JToolbar::getInstance(); diff --git a/admin/compiler/joomla_3/JViewLegacy_site.php b/admin/compiler/joomla_3/JViewLegacy_site.php index 27473368a..7a7b1e978 100644 --- a/admin/compiler/joomla_3/JViewLegacy_site.php +++ b/admin/compiler/joomla_3/JViewLegacy_site.php @@ -49,10 +49,10 @@ class ###Component###View###SView### extends JViewLegacy {###SITE_CUSTOM_BUTTONS### // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('###sview###'); - if (###Component###Helper::checkString($help_url)) + $this->help_url = ###Component###Helper::getHelpUrl('###sview###'); + if (###Component###Helper::checkString($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // now initiate the toolbar $this->toolbar = JToolbar::getInstance(); diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 462a4bc60..99c85408c 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -2823,8 +2823,8 @@ abstract class ComponentbuilderHelper // delete an existing zip file (or use an exclusion parameter in Folder::files() File::delete($filepath); - // get a list of files in the current directory tree - $files = Folder::files('.', '', true, true); + // get a list of files in the current directory tree (also the hidden files) + $files = Folder::files('.', '', true, true, array('.svn', 'CVS', '.DS_Store', '__MACOSX'), array('.*~')); $zipArray = array(); // setup the zip array foreach ($files as $file) diff --git a/admin/views/admin_views/view.html.php b/admin/views/admin_views/view.html.php index 7bb4e7d98..9fff10040 100644 --- a/admin/views/admin_views/view.html.php +++ b/admin/views/admin_views/view.html.php @@ -152,10 +152,10 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admin_views'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('admin_views'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/admins_custom_tabs/view.html.php b/admin/views/admins_custom_tabs/view.html.php index b2eb1441b..72148c519 100644 --- a/admin/views/admins_custom_tabs/view.html.php +++ b/admin/views/admins_custom_tabs/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewAdmins_custom_tabs extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admins_custom_tabs'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('admins_custom_tabs'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/admins_fields/view.html.php b/admin/views/admins_fields/view.html.php index 0f9578493..c2b73967c 100644 --- a/admin/views/admins_fields/view.html.php +++ b/admin/views/admins_fields/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admins_fields'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('admins_fields'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/admins_fields_conditions/view.html.php b/admin/views/admins_fields_conditions/view.html.php index ba4554bdd..fe4de943a 100644 --- a/admin/views/admins_fields_conditions/view.html.php +++ b/admin/views/admins_fields_conditions/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_conditions'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_conditions'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/admins_fields_relations/view.html.php b/admin/views/admins_fields_relations/view.html.php index 7c6043483..8a175ff8b 100644 --- a/admin/views/admins_fields_relations/view.html.php +++ b/admin/views/admins_fields_relations/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewAdmins_fields_relations extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_relations'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_relations'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/class_extendings/view.html.php b/admin/views/class_extendings/view.html.php index 171cb0c7f..427b9fd60 100644 --- a/admin/views/class_extendings/view.html.php +++ b/admin/views/class_extendings/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewClass_extendings extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('class_extendings'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('class_extendings'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/class_methods/view.html.php b/admin/views/class_methods/view.html.php index 849778bee..dc003c06c 100644 --- a/admin/views/class_methods/view.html.php +++ b/admin/views/class_methods/view.html.php @@ -147,10 +147,10 @@ class ComponentbuilderViewClass_methods extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('class_methods'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('class_methods'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/class_properties/view.html.php b/admin/views/class_properties/view.html.php index 775d7b801..1a24ea13d 100644 --- a/admin/views/class_properties/view.html.php +++ b/admin/views/class_properties/view.html.php @@ -147,10 +147,10 @@ class ComponentbuilderViewClass_properties extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('class_properties'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('class_properties'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index 1712a2639..207134b80 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -391,10 +391,10 @@ class ComponentbuilderViewCompiler extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('compiler'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('compiler'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/componentbuilder/view.html.php b/admin/views/componentbuilder/view.html.php index 9f0d6f782..ad7ebe547 100644 --- a/admin/views/componentbuilder/view.html.php +++ b/admin/views/componentbuilder/view.html.php @@ -63,10 +63,10 @@ class ComponentbuilderViewComponentbuilder extends JViewLegacy JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_DASHBOARD'), 'grid-2'); // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('componentbuilder'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('componentbuilder'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } if ($canDo->get('core.admin') || $canDo->get('core.options')) diff --git a/admin/views/components_admin_views/view.html.php b/admin/views/components_admin_views/view.html.php index b9aeba7f5..f5d8ab210 100644 --- a/admin/views/components_admin_views/view.html.php +++ b/admin/views/components_admin_views/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_admin_views'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_admin_views'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/components_config/view.html.php b/admin/views/components_config/view.html.php index 8694b1266..5be830841 100644 --- a/admin/views/components_config/view.html.php +++ b/admin/views/components_config/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_config extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_config'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_config'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/components_custom_admin_menus/view.html.php b/admin/views/components_custom_admin_menus/view.html.php index 06de1e62d..3eced497b 100644 --- a/admin/views/components_custom_admin_menus/view.html.php +++ b/admin/views/components_custom_admin_menus/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_menus'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_menus'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/components_custom_admin_views/view.html.php b/admin/views/components_custom_admin_views/view.html.php index 1cd822d6c..035146151 100644 --- a/admin/views/components_custom_admin_views/view.html.php +++ b/admin/views/components_custom_admin_views/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_views'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_views'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/components_dashboard/view.html.php b/admin/views/components_dashboard/view.html.php index c44238252..4b2e649a1 100644 --- a/admin/views/components_dashboard/view.html.php +++ b/admin/views/components_dashboard/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_dashboard'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_dashboard'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/components_files_folders/view.html.php b/admin/views/components_files_folders/view.html.php index 0dcbaed1b..b9c7207f6 100644 --- a/admin/views/components_files_folders/view.html.php +++ b/admin/views/components_files_folders/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_files_folders'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_files_folders'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/components_modules/view.html.php b/admin/views/components_modules/view.html.php index 5a988c10b..995deedb2 100644 --- a/admin/views/components_modules/view.html.php +++ b/admin/views/components_modules/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_modules extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_modules'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_modules'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/components_mysql_tweaks/view.html.php b/admin/views/components_mysql_tweaks/view.html.php index 3bf7d6d47..70c6a83bf 100644 --- a/admin/views/components_mysql_tweaks/view.html.php +++ b/admin/views/components_mysql_tweaks/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_mysql_tweaks'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_mysql_tweaks'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/components_placeholders/view.html.php b/admin/views/components_placeholders/view.html.php index fc78018d7..0124abac5 100644 --- a/admin/views/components_placeholders/view.html.php +++ b/admin/views/components_placeholders/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_placeholders extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_placeholders'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_placeholders'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/components_plugins/view.html.php b/admin/views/components_plugins/view.html.php index 6262169ad..5a2a02fb8 100644 --- a/admin/views/components_plugins/view.html.php +++ b/admin/views/components_plugins/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_plugins extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_plugins'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_plugins'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/components_site_views/view.html.php b/admin/views/components_site_views/view.html.php index fd8b1caf1..c34214081 100644 --- a/admin/views/components_site_views/view.html.php +++ b/admin/views/components_site_views/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_site_views'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_site_views'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/components_updates/view.html.php b/admin/views/components_updates/view.html.php index bdfd15ce5..6221a98ce 100644 --- a/admin/views/components_updates/view.html.php +++ b/admin/views/components_updates/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_updates'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('components_updates'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/custom_admin_views/view.html.php b/admin/views/custom_admin_views/view.html.php index e7816d21f..269d6f029 100644 --- a/admin/views/custom_admin_views/view.html.php +++ b/admin/views/custom_admin_views/view.html.php @@ -152,10 +152,10 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('custom_admin_views'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('custom_admin_views'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/custom_codes/view.html.php b/admin/views/custom_codes/view.html.php index 69cd9495f..8a8cc386b 100644 --- a/admin/views/custom_codes/view.html.php +++ b/admin/views/custom_codes/view.html.php @@ -152,10 +152,10 @@ class ComponentbuilderViewCustom_codes extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('custom_codes'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('custom_codes'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/dynamic_gets/view.html.php b/admin/views/dynamic_gets/view.html.php index 6594bbe06..30cbd2c66 100644 --- a/admin/views/dynamic_gets/view.html.php +++ b/admin/views/dynamic_gets/view.html.php @@ -152,10 +152,10 @@ class ComponentbuilderViewDynamic_gets extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('dynamic_gets'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('dynamic_gets'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/fields/view.html.php b/admin/views/fields/view.html.php index a0becc03f..59d86d9a6 100644 --- a/admin/views/fields/view.html.php +++ b/admin/views/fields/view.html.php @@ -152,10 +152,10 @@ class ComponentbuilderViewFields extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('fields'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('fields'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/fieldtypes/view.html.php b/admin/views/fieldtypes/view.html.php index 1031fefbb..364fbb89b 100644 --- a/admin/views/fieldtypes/view.html.php +++ b/admin/views/fieldtypes/view.html.php @@ -147,10 +147,10 @@ class ComponentbuilderViewFieldtypes extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('fieldtypes'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('fieldtypes'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/get_snippets/view.html.php b/admin/views/get_snippets/view.html.php index 0012f51b1..9d237e45b 100644 --- a/admin/views/get_snippets/view.html.php +++ b/admin/views/get_snippets/view.html.php @@ -289,10 +289,10 @@ class ComponentbuilderViewGet_snippets extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('get_snippets'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('get_snippets'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/help_documents/view.html.php b/admin/views/help_documents/view.html.php index dd1d4f629..94e4aa451 100644 --- a/admin/views/help_documents/view.html.php +++ b/admin/views/help_documents/view.html.php @@ -147,10 +147,10 @@ class ComponentbuilderViewHelp_documents extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('help_documents'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('help_documents'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/import/view.html.php b/admin/views/import/view.html.php index f3cf8eb6e..1be5fdd2a 100644 --- a/admin/views/import/view.html.php +++ b/admin/views/import/view.html.php @@ -85,10 +85,10 @@ class ComponentbuilderViewImport extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('import'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('import'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/views/import_joomla_components/view.html.php b/admin/views/import_joomla_components/view.html.php index f7c6a6cbe..7df5f96e1 100644 --- a/admin/views/import_joomla_components/view.html.php +++ b/admin/views/import_joomla_components/view.html.php @@ -450,10 +450,10 @@ class ComponentbuilderViewImport_joomla_components extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('import_joomla_components'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('import_joomla_components'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/views/import_language_translations/view.html.php b/admin/views/import_language_translations/view.html.php index 159a0de7f..8fa95880c 100644 --- a/admin/views/import_language_translations/view.html.php +++ b/admin/views/import_language_translations/view.html.php @@ -84,10 +84,10 @@ class ComponentbuilderViewImport_language_translations extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('import_language_translations'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('import_language_translations'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/views/joomla_components/view.html.php b/admin/views/joomla_components/view.html.php index 3515b4b24..66a02279e 100644 --- a/admin/views/joomla_components/view.html.php +++ b/admin/views/joomla_components/view.html.php @@ -177,10 +177,10 @@ class ComponentbuilderViewJoomla_components extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_components'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_components'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/joomla_modules/view.html.php b/admin/views/joomla_modules/view.html.php index 1dfd74f4f..fe9db733c 100644 --- a/admin/views/joomla_modules/view.html.php +++ b/admin/views/joomla_modules/view.html.php @@ -147,10 +147,10 @@ class ComponentbuilderViewJoomla_modules extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_modules'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_modules'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/joomla_modules_files_folders_urls/view.html.php b/admin/views/joomla_modules_files_folders_urls/view.html.php index 8fb825779..50af7e3b1 100644 --- a/admin/views/joomla_modules_files_folders_urls/view.html.php +++ b/admin/views/joomla_modules_files_folders_urls/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewJoomla_modules_files_folders_urls extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_modules_files_folders_urls'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_modules_files_folders_urls'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/joomla_modules_updates/view.html.php b/admin/views/joomla_modules_updates/view.html.php index a8ce2ff75..585e582af 100644 --- a/admin/views/joomla_modules_updates/view.html.php +++ b/admin/views/joomla_modules_updates/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewJoomla_modules_updates extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_modules_updates'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_modules_updates'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/joomla_plugin_groups/view.html.php b/admin/views/joomla_plugin_groups/view.html.php index 1f6bf61a5..4c7d73810 100644 --- a/admin/views/joomla_plugin_groups/view.html.php +++ b/admin/views/joomla_plugin_groups/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewJoomla_plugin_groups extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_groups'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_groups'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/joomla_plugins/view.html.php b/admin/views/joomla_plugins/view.html.php index 44baeaa08..9bd98efe2 100644 --- a/admin/views/joomla_plugins/view.html.php +++ b/admin/views/joomla_plugins/view.html.php @@ -157,10 +157,10 @@ class ComponentbuilderViewJoomla_plugins extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugins'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugins'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/joomla_plugins_files_folders_urls/view.html.php b/admin/views/joomla_plugins_files_folders_urls/view.html.php index bdd7c9dfb..cb7d8df4e 100644 --- a/admin/views/joomla_plugins_files_folders_urls/view.html.php +++ b/admin/views/joomla_plugins_files_folders_urls/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewJoomla_plugins_files_folders_urls extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugins_files_folders_urls'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugins_files_folders_urls'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/joomla_plugins_updates/view.html.php b/admin/views/joomla_plugins_updates/view.html.php index 0fa952223..ddfe60e81 100644 --- a/admin/views/joomla_plugins_updates/view.html.php +++ b/admin/views/joomla_plugins_updates/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewJoomla_plugins_updates extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugins_updates'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugins_updates'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/language_translations/view.html.php b/admin/views/language_translations/view.html.php index e0387a387..100146b15 100644 --- a/admin/views/language_translations/view.html.php +++ b/admin/views/language_translations/view.html.php @@ -147,10 +147,10 @@ class ComponentbuilderViewLanguage_translations extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('language_translations'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('language_translations'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/languages/view.html.php b/admin/views/languages/view.html.php index e4bbad60c..84fe993e7 100644 --- a/admin/views/languages/view.html.php +++ b/admin/views/languages/view.html.php @@ -152,10 +152,10 @@ class ComponentbuilderViewLanguages extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('languages'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('languages'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/layouts/view.html.php b/admin/views/layouts/view.html.php index f0a16681e..f334157da 100644 --- a/admin/views/layouts/view.html.php +++ b/admin/views/layouts/view.html.php @@ -152,10 +152,10 @@ class ComponentbuilderViewLayouts extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('layouts'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('layouts'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/libraries/view.html.php b/admin/views/libraries/view.html.php index be0c92ec7..19fbe74d8 100644 --- a/admin/views/libraries/view.html.php +++ b/admin/views/libraries/view.html.php @@ -142,10 +142,10 @@ class ComponentbuilderViewLibraries extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('libraries'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('libraries'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/libraries_config/view.html.php b/admin/views/libraries_config/view.html.php index e937fcf33..4404f192b 100644 --- a/admin/views/libraries_config/view.html.php +++ b/admin/views/libraries_config/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewLibraries_config extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('libraries_config'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('libraries_config'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/libraries_files_folders_urls/view.html.php b/admin/views/libraries_files_folders_urls/view.html.php index 8ca23bc1e..414e83dd5 100644 --- a/admin/views/libraries_files_folders_urls/view.html.php +++ b/admin/views/libraries_files_folders_urls/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewLibraries_files_folders_urls extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('libraries_files_folders_urls'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('libraries_files_folders_urls'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/placeholders/view.html.php b/admin/views/placeholders/view.html.php index 2f18d3837..2248343b1 100644 --- a/admin/views/placeholders/view.html.php +++ b/admin/views/placeholders/view.html.php @@ -147,10 +147,10 @@ class ComponentbuilderViewPlaceholders extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('placeholders'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('placeholders'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/servers/view.html.php b/admin/views/servers/view.html.php index edf56826d..edcabb67d 100644 --- a/admin/views/servers/view.html.php +++ b/admin/views/servers/view.html.php @@ -147,10 +147,10 @@ class ComponentbuilderViewServers extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('servers'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('servers'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/site_views/view.html.php b/admin/views/site_views/view.html.php index 578b67025..4ee3f95b9 100644 --- a/admin/views/site_views/view.html.php +++ b/admin/views/site_views/view.html.php @@ -152,10 +152,10 @@ class ComponentbuilderViewSite_views extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('site_views'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('site_views'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/snippet_types/view.html.php b/admin/views/snippet_types/view.html.php index 7f57cde84..0af44fd8f 100644 --- a/admin/views/snippet_types/view.html.php +++ b/admin/views/snippet_types/view.html.php @@ -137,10 +137,10 @@ class ComponentbuilderViewSnippet_types extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('snippet_types'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('snippet_types'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/snippets/view.html.php b/admin/views/snippets/view.html.php index dad361636..d6ce5bd0f 100644 --- a/admin/views/snippets/view.html.php +++ b/admin/views/snippets/view.html.php @@ -157,10 +157,10 @@ class ComponentbuilderViewSnippets extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('snippets'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('snippets'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/templates/view.html.php b/admin/views/templates/view.html.php index 98c83156a..9e4a9ac87 100644 --- a/admin/views/templates/view.html.php +++ b/admin/views/templates/view.html.php @@ -152,10 +152,10 @@ class ComponentbuilderViewTemplates extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('templates'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('templates'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/admin/views/validation_rules/view.html.php b/admin/views/validation_rules/view.html.php index 7b781a7c6..a0101e371 100644 --- a/admin/views/validation_rules/view.html.php +++ b/admin/views/validation_rules/view.html.php @@ -152,10 +152,10 @@ class ComponentbuilderViewValidation_rules extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('validation_rules'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('validation_rules'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button diff --git a/componentbuilder.xml b/componentbuilder.xml index eb4150402..21174f21d 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 9th February, 2022 + 12th February, 2022 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index 4078aa9ed..fb6062b96 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -2820,8 +2820,8 @@ abstract class ComponentbuilderHelper // delete an existing zip file (or use an exclusion parameter in Folder::files() File::delete($filepath); - // get a list of files in the current directory tree - $files = Folder::files('.', '', true, true); + // get a list of files in the current directory tree (also the hidden files) + $files = Folder::files('.', '', true, true, array('.svn', 'CVS', '.DS_Store', '__MACOSX'), array('.*~')); $zipArray = array(); // setup the zip array foreach ($files as $file) diff --git a/site/views/api/view.html.php b/site/views/api/view.html.php index 06e459df6..d5dd20094 100644 --- a/site/views/api/view.html.php +++ b/site/views/api/view.html.php @@ -88,10 +88,10 @@ class ComponentbuilderViewApi extends JViewLegacy { // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('api'); - if (ComponentbuilderHelper::checkString($help_url)) + $this->help_url = ComponentbuilderHelper::getHelpUrl('api'); + if (ComponentbuilderHelper::checkString($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // now initiate the toolbar $this->toolbar = JToolbar::getInstance(); -- 2.40.1 From 278f70c8a65f4d966aa548b58883c2db0a8fa106 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 10 Mar 2022 01:46:45 +0200 Subject: [PATCH 09/12] Adds new utilities abstract classes as helper methods. Moves the helper class autoloader above the class. Adds option to override the settings.json file. --- README.md | 8 +- admin/README.txt | 8 +- admin/compiler/joomla_3/Helper.php | 5 +- admin/compiler/joomla_3/Helper_site.php | 5 +- admin/compiler/joomla_3/JCB_Helper.php | 760 ++++++++ admin/compiler/joomla_3/JCB_Helper_site.php | 749 ++++++++ admin/compiler/joomla_3/component_admin.php | 2 +- admin/compiler/joomla_3/component_site.php | 2 +- .../joomla_3/settings_componentbuilder.json | 784 ++++++++ admin/helpers/compiler.php | 105 +- admin/helpers/compiler/a_Get.php | 867 ++++----- admin/helpers/compiler/b_Structure.php | 225 ++- admin/helpers/compiler/c_Fields.php | 385 ++-- admin/helpers/compiler/e_Interpretation.php | 1683 ++++++++--------- admin/helpers/compiler/f_Infusion.php | 73 +- admin/helpers/componentbuilder.php | 870 +-------- admin/models/componentbuilder.php | 2 +- componentbuilder.xml | 2 +- libraries/jcb_powers/.htaccess | 9 + libraries/jcb_powers/VDM.Joomla/index.html | 1 + .../jcb_powers/VDM.Joomla/src/Utilities.php | 346 ++++ .../VDM.Joomla/src/Utilities/ArrayHelper.php | 74 + .../VDM.Joomla/src/Utilities/GetHelper.php | 159 ++ .../VDM.Joomla/src/Utilities/JsonHelper.php | 89 + .../VDM.Joomla/src/Utilities/MathHelper.php | 100 + .../VDM.Joomla/src/Utilities/ObjectHelper.php | 39 + .../Utilities/String/ClassfunctionHelper.php | 44 + .../src/Utilities/String/FieldHelper.php | 97 + .../src/Utilities/String/NamespaceHelper.php | 56 + .../src/Utilities/String/PluginHelper.php | 106 ++ .../src/Utilities/String/TypeHelper.php | 75 + .../src/Utilities/String/index.html | 1 + .../VDM.Joomla/src/Utilities/StringHelper.php | 379 ++++ .../VDM.Joomla/src/Utilities/index.html | 1 + libraries/jcb_powers/htaccess.txt | 9 + libraries/jcb_powers/index.html | 1 + libraries/jcb_powers/web.config | 7 + site/helpers/componentbuilder.php | 873 +-------- 38 files changed, 5696 insertions(+), 3305 deletions(-) create mode 100644 admin/compiler/joomla_3/JCB_Helper.php create mode 100644 admin/compiler/joomla_3/JCB_Helper_site.php create mode 100644 admin/compiler/joomla_3/settings_componentbuilder.json create mode 100644 libraries/jcb_powers/.htaccess create mode 100644 libraries/jcb_powers/VDM.Joomla/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/ArrayHelper.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/JsonHelper.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/MathHelper.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/ObjectHelper.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/String/ClassfunctionHelper.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/String/FieldHelper.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/String/NamespaceHelper.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/String/PluginHelper.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/String/TypeHelper.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/String/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Utilities/index.html create mode 100644 libraries/jcb_powers/htaccess.txt create mode 100644 libraries/jcb_powers/index.html create mode 100644 libraries/jcb_powers/web.config diff --git a/README.md b/README.md index bb2aaa1a6..03eb9bcaa 100644 --- a/README.md +++ b/README.md @@ -143,14 +143,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 12th February, 2022 ++ *Last Build*: 9th March, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286261** ++ *Line count*: **286315** + *Field count*: **1580** -+ *File count*: **1829** -+ *Folder count*: **256** ++ *File count*: **1848** ++ *Folder count*: **260** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index bb2aaa1a6..03eb9bcaa 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -143,14 +143,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 12th February, 2022 ++ *Last Build*: 9th March, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286261** ++ *Line count*: **286315** + *Field count*: **1580** -+ *File count*: **1829** -+ *Folder count*: **256** ++ *File count*: **1848** ++ *Folder count*: **260** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php index 0cfa0cee0..12ed53087 100644 --- a/admin/compiler/joomla_3/Helper.php +++ b/admin/compiler/joomla_3/Helper.php @@ -15,7 +15,7 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER### ###ADMIN_HELPER_CLASS_HEADER### @@ -36,7 +36,7 @@ abstract class ###Component###Helper * * @var string */ - public static $langTag;###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT######ADMIN_POWER_EVENT_HELPER### + public static $langTag;###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### /** * Load the Composer Vendors @@ -1339,3 +1339,4 @@ abstract class ###Component###Helper return implode($key); }###GET_CRYPT_KEY### } + diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php index 950ff4d8b..d9069328c 100644 --- a/admin/compiler/joomla_3/Helper_site.php +++ b/admin/compiler/joomla_3/Helper_site.php @@ -15,7 +15,7 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access');###SITE_POWER_HELPER### ###SITE_HELPER_CLASS_HEADER### @@ -36,7 +36,7 @@ abstract class ###Component###Helper * * @var string */ - public static $langTag;###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT######SITE_POWER_EVENT_HELPER### + public static $langTag;###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### /** * Load the Composer Vendors @@ -1331,3 +1331,4 @@ abstract class ###Component###Helper return implode($key); }###GET_CRYPT_KEY### } + diff --git a/admin/compiler/joomla_3/JCB_Helper.php b/admin/compiler/joomla_3/JCB_Helper.php new file mode 100644 index 000000000..58f2b6458 --- /dev/null +++ b/admin/compiler/joomla_3/JCB_Helper.php @@ -0,0 +1,760 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER### + +###ADMIN_HELPER_CLASS_HEADER### + +/** + * ###Component### component helper. + */ +abstract class ###Component###Helper +{ + /** + * Adding the utilities trait to this class + * + * @deprecated 4.0 - Check the trait methods for details, a legacy implementation + */ + use Utilities; + + /** + * Composer Switch + * + * @var array + */ + protected static $composer = array();###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### + + /** + * Load the Composer Vendors + */ + public static function composerAutoload($target) + { + // insure we load the composer vendor only once + if (!isset(self::$composer[$target])) + { + // get the function name + $functionName = self::safeString('compose' . $target); + // check if method exist + if (method_exists(__CLASS__, $functionName)) + { + return self::{$functionName}(); + } + return false; + } + return self::$composer[$target]; + } + + /** + * Load the Component xml manifest. + */ + public static function manifest() + { + $manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml"; + return simplexml_load_file($manifestUrl); + } + + /** + * Joomla version object + */ + protected static $JVersion; + + /** + * set/get Joomla version + */ + public static function jVersion() + { + // check if set + if (!self::checkObject(self::$JVersion)) + { + self::$JVersion = new JVersion(); + } + return self::$JVersion; + } + + /** + * Load the Contributors details. + */ + public static function getContributors() + { + // get params + $params = JComponentHelper::getParams('com_###component###'); + // start contributors array + $contributors = array(); + // get all Contributors (max 20) + $searchArray = range('0','20'); + foreach($searchArray as $nr) + { + if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3)) + { + // set link based of selected option + if($params->get("useContributor".$nr) == 1) + { + $link_front = ''; + $link_back = ''; + } + elseif($params->get("useContributor".$nr) == 2) + { + $link_front = ''; + $link_back = ''; + } + else + { + $link_front = ''; + $link_back = ''; + } + $contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back; + } + } + return $contributors; + }###HELP### + + /** + * Configure the Linkbar. + */ + public static function addSubmenu($submenu) + { + // load user for access menus + $user = JFactory::getUser(); + // load the submenus to sidebar + ###SUBMENU### + }###HELPER_CREATEUSER######HELPER_UIKIT######HELPER_EXEL### + + public static function isPublished($id,$type) + { + if ($type == 'raw') + { + $type = 'item'; + } + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + $query->select(array('a.published')); + $query->from('#__###component###_'.$type.' AS a'); + $query->where('a.id = '. (int) $id); + $query->where('a.published = 1'); + $db->setQuery($query); + $db->execute(); + $found = $db->getNumRows(); + if($found) + { + return true; + } + return false; + } + + public static function getGroupName($id) + { + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select(array('a.title')); + $query->from('#__usergroups AS a'); + $query->where('a.id = '. (int) $id); + $db->setQuery($query); + $db->execute(); + $found = $db->getNumRows(); + if($found) + { + return $db->loadResult(); + } + return $id; + } + + /** + * Get the action permissions + * + * @param string $view The related view name + * @param int $record The item to act upon + * @param string $views The related list view name + * @param mixed $target Only get this permission (like edit, create, delete) + * @param string $component The target component + * @param object $user The user whose permissions we are loading + * + * @return object The JObject of permission/authorised actions + * + */ + public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') + { + // load the user if not given + if (!self::checkObject($user)) + { + // get the user object + $user = JFactory::getUser(); + } + // load the JObject + $result = new JObject; + // make view name safe (just incase) + $view = self::safeString($view); + if (self::checkString($views)) + { + $views = self::safeString($views); + } + // get all actions from component + $actions = JAccess::getActionsFromFile( + JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', + "/access/section[@name='component']/" + ); + // if non found then return empty JObject + if (empty($actions)) + { + return $result; + } + // get created by if not found + if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) + { + $record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); + } + // set actions only set in component settings + $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); + // check if we have a target + $checkTarget = false; + if ($target) + { + // convert to an array + if (self::checkString($target)) + { + $target = array($target); + } + // check if we are good to go + if (self::checkArray($target)) + { + $checkTarget = true; + } + } + // loop the actions and set the permissions + foreach ($actions as $action) + { + // check target action filter + if ($checkTarget && self::filterActions($view, $action->name, $target)) + { + continue; + } + // set to use component default + $fallback = true; + // reset permission per/action + $permission = false; + $catpermission = false; + // set area + $area = 'comp'; + // check if the record has an ID and the action is item related (not a component action) + if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && + (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) + { + // we are in item + $area = 'item'; + // The record has been set. Check the record permissions. + $permission = $user->authorise($action->name, 'com_' . $component . '.' . $view . '.' . (int) $record->id); + // if no permission found, check edit own + if (!$permission) + { + // With edit, if the created_by matches current user then dig deeper. + if (($action->name === 'core.edit' || $action->name === $view . '.edit') && $record->created_by > 0 && ($record->created_by == $user->id)) + { + // the correct target + $coreCheck = (array) explode('.', $action->name); + // check that we have both local and global access + if ($user->authorise($coreCheck[0] . '.edit.own', 'com_' . $component . '.' . $view . '.' . (int) $record->id) && + $user->authorise($coreCheck[0] . '.edit.own', 'com_' . $component)) + { + // allow edit + $result->set($action->name, true); + // set not to use global default + // because we already validated it + $fallback = false; + } + else + { + // do not allow edit + $result->set($action->name, false); + $fallback = false; + } + } + } + elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) + { + // we are in item + $area = 'category'; + // set the core check + $coreCheck = explode('.', $action->name); + $core = $coreCheck[0]; + // make sure we use the core. action check for the categories + if (strpos($action->name, $view) !== false && strpos($action->name, 'core.') === false ) + { + $coreCheck[0] = 'core'; + $categoryCheck = implode('.', $coreCheck); + } + else + { + $categoryCheck = $action->name; + } + // The record has a category. Check the category permissions. + $catpermission = $user->authorise($categoryCheck, 'com_' . $component . '.' . $views . '.category.' . (int) $record->catid); + if (!$catpermission && !is_null($catpermission)) + { + // With edit, if the created_by matches current user then dig deeper. + if (($action->name === 'core.edit' || $action->name === $view . '.edit') && $record->created_by > 0 && ($record->created_by == $user->id)) + { + // check that we have both local and global access + if ($user->authorise('core.edit.own', 'com_' . $component . '.' . $views . '.category.' . (int) $record->catid) && + $user->authorise($core . '.edit.own', 'com_' . $component)) + { + // allow edit + $result->set($action->name, true); + // set not to use global default + // because we already validated it + $fallback = false; + } + else + { + // do not allow edit + $result->set($action->name, false); + $fallback = false; + } + } + } + } + } + // if allowed then fallback on component global settings + if ($fallback) + { + // if item/category blocks access then don't fall back on global + if ((($area === 'item') && !$permission) || (($area === 'category') && !$catpermission)) + { + // do not allow + $result->set($action->name, false); + } + // Finally remember the global settings have the final say. (even if item allow) + // The local item permissions can block, but it can't open and override of global permissions. + // Since items are created by users and global permissions is set by system admin. + else + { + $result->set($action->name, $user->authorise($action->name, 'com_' . $component)); + } + } + } + return $result; + } + + /** + * Filter the action permissions + * + * @param string $action The action to check + * @param array $targets The array of target actions + * + * @return boolean true if action should be filtered out + * + */ + protected static function filterActions(&$view, &$action, &$targets) + { + foreach ($targets as $target) + { + if (strpos($action, $view . '.' . $target) !== false || + strpos($action, 'core.' . $target) !== false) + { + return false; + break; + } + } + return true; + } + + /** + * Get any component's model + */ + public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array()) + { + // fix the name + $name = self::safeString($name); + // full path to models + $fullPathModels = $path . '/models'; + // load the model file + JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); + // make sure the table path is loaded + if (!isset($config['table_path']) || !self::checkString($config['table_path'])) + { + // This is the JCB default path to tables in Joomla 3.x + $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; + } + // get instance + $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); + // if model not found (strange) + if ($model == false) + { + jimport('joomla.filesystem.file'); + // get file path + $filePath = $path . '/' . $name . '.php'; + $fullPathModel = $fullPathModels . '/' . $name . '.php'; + // check if it exists + if (File::exists($filePath)) + { + // get the file + require_once $filePath; + } + elseif (File::exists($fullPathModel)) + { + // get the file + require_once $fullPathModel; + } + // build class names + $modelClass = $Component . 'Model' . $name; + if (class_exists($modelClass)) + { + // initialize the model + return new $modelClass($config); + } + } + return $model; + } + + /** + * Add to asset Table + */ + public static function setAsset($id, $table, $inherit = true) + { + $parent = JTable::getInstance('Asset'); + $parent->loadByName('com_###component###'); + + $parentId = $parent->id; + $name = 'com_###component###.'.$table.'.'.$id; + $title = ''; + + $asset = JTable::getInstance('Asset'); + $asset->loadByName($name); + + // Check for an error. + $error = $asset->getError(); + + if ($error) + { + return false; + } + else + { + // Specify how a new or moved node asset is inserted into the tree. + if ($asset->parent_id != $parentId) + { + $asset->setLocation($parentId, 'last-child'); + } + + // Prepare the asset to be stored. + $asset->parent_id = $parentId; + $asset->name = $name; + $asset->title = $title; + // get the default asset rules + $rules = self::getDefaultAssetRules('com_###component###', $table, $inherit); + if ($rules instanceof JAccessRules) + { + $asset->rules = (string) $rules; + } + + if (!$asset->check() || !$asset->store()) + { + JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + return false; + } + else + { + // Create an asset_id or heal one that is corrupted. + $object = new stdClass(); + + // Must be a valid primary key value. + $object->id = $id; + $object->asset_id = (int) $asset->id; + + // Update their asset_id to link to the asset table. + return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); + } + } + return false; + } + + /** + * Gets the default asset Rules for a component/view. + */ + protected static function getDefaultAssetRules($component, $view, $inherit = true) + { + // if new or inherited + $assetId = 0; + // Only get the actual item rules if not inheriting + if (!$inherit) + { + // Need to find the asset id by the name of the component. + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + // check that there is a value + if ($db->getNumRows()) + { + // asset already set so use saved rules + $assetId = (int) $db->loadResult(); + } + } + // get asset rules + $result = JAccess::getAssetRules($assetId); + if ($result instanceof JAccessRules) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($view !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + elseif ($inherit) + { + // clear the value since we inherit + $rule = array(); + } + } + // check if there are any view values remaining + if (count((array) $_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the JAccessRules object for the asset rules. + $rules = new JAccessRules($_result); + // return filtered rules + return $rules; + } + } + return $result; + } + + /** + * xmlAppend + * + * @param SimpleXMLElement $xml The XML element reference in which to inject a comment + * @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement + * + * @return null + * + */ + public static function xmlAppend(&$xml, $node) + { + if (!$node) + { + // element was not returned + return; + } + switch (get_class($node)) + { + case 'stdClass': + if (property_exists($node, 'comment')) + { + self::xmlComment($xml, $node->comment); + } + if (property_exists($node, 'fieldXML')) + { + self::xmlAppend($xml, $node->fieldXML); + } + break; + case 'SimpleXMLElement': + $domXML = dom_import_simplexml($xml); + $domNode = dom_import_simplexml($node); + $domXML->appendChild($domXML->ownerDocument->importNode($domNode, true)); + $xml = simplexml_import_dom($domXML); + break; + } + } + + /** + * xmlComment + * + * @param SimpleXMLElement $xml The XML element reference in which to inject a comment + * @param string $comment The comment to inject + * + * @return null + * + */ + public static function xmlComment(&$xml, $comment) + { + $domXML = dom_import_simplexml($xml); + $domComment = new DOMComment($comment); + $nodeTarget = $domXML->ownerDocument->importNode($domComment, true); + $domXML->appendChild($nodeTarget); + $xml = simplexml_import_dom($domXML); + } + + /** + * xmlAddAttributes + * + * @param SimpleXMLElement $xml The XML element reference in which to inject a comment + * @param array $attributes The attributes to apply to the XML element + * + * @return null + * + */ + public static function xmlAddAttributes(&$xml, $attributes = array()) + { + foreach ($attributes as $key => $value) + { + $xml->addAttribute($key, $value); + } + } + + /** + * xmlAddOptions + * + * @param SimpleXMLElement $xml The XML element reference in which to inject a comment + * @param array $options The options to apply to the XML element + * + * @return void + * + */ + public static function xmlAddOptions(&$xml, $options = array()) + { + foreach ($options as $key => $value) + { + $addOption = $xml->addChild('option'); + $addOption->addAttribute('value', $key); + $addOption[] = $value; + } + } + + /** + * get the field object + * + * @param array $attributes The array of attributes + * @param string $default The default of the field + * @param array $options The options to apply to the XML element + * + * @return object + * + */ + public static function getFieldObject(&$attributes, $default = '', $options = null) + { + // make sure we have attributes and a type value + if (self::checkArray($attributes) && isset($attributes['type'])) + { + // make sure the form helper class is loaded + if (!method_exists('JFormHelper', 'loadFieldType')) + { + jimport('joomla.form.form'); + } + // get field type + $field = JFormHelper::loadFieldType($attributes['type'], true); + // get field xml + $XML = self::getFieldXML($attributes, $options); + // setup the field + $field->setup($XML, $default); + // return the field object + return $field; + } + return false; + } + + /** + * get the field xml + * + * @param array $attributes The array of attributes + * @param array $options The options to apply to the XML element + * + * @return object + * + */ + public static function getFieldXML(&$attributes, $options = null) + { + // make sure we have attributes and a type value + if (self::checkArray($attributes)) + { + // start field xml + $XML = new SimpleXMLElement(''); + // load the attributes + self::xmlAddAttributes($XML, $attributes); + // check if we have options + if (self::checkArray($options)) + { + // load the options + self::xmlAddOptions($XML, $options); + } + // return the field xml + return $XML; + } + return false; + } + + /** + * Render Bool Button + * + * @param array $args All the args for the button + * 0) name + * 1) additional (options class) // not used at this time + * 2) default + * 3) yes (name) + * 4) no (name) + * + * @return string The input html of the button + * + */ + public static function renderBoolButton() + { + $args = func_get_args(); + // check if there is additional button class + $additional = isset($args[1]) ? (string) $args[1] : ''; // not used at this time + // button attributes + $buttonAttributes = array( + 'type' => 'radio', + 'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button', + 'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway + 'class' => 'btn-group', + 'filter' => 'INT', + 'default' => isset($args[2]) ? (int) $args[2] : 0); + // set the button options + $buttonOptions = array( + '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', + '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); + // return the input + return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; + } + + /** + * Check if we are connected + * Thanks https://stackoverflow.com/a/4860432/1429677 + * + * @returns bool true on success + */ + public static function isConnected() + { + // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? + $connected = @fsockopen("www.example.com", 80); + // website, port (try 80 or 443) + if ($connected) + { + //action when connected + $is_conn = true; + fclose($connected); + } + else + { + //action in connection failure + $is_conn = false; + } + return $is_conn; + } + + // typo sorry! + public static function sorten($string, $length = 40, $addTip = true) + { + return self::shorten($string, $length, $addTip); + }###HELPER_LICENSE_LOCK######GET_CRYPT_KEY### +} diff --git a/admin/compiler/joomla_3/JCB_Helper_site.php b/admin/compiler/joomla_3/JCB_Helper_site.php new file mode 100644 index 000000000..3190e5b48 --- /dev/null +++ b/admin/compiler/joomla_3/JCB_Helper_site.php @@ -0,0 +1,749 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die('Restricted access');###SITE_POWER_HELPER### + +###SITE_HELPER_CLASS_HEADER### + +/** + * ###Component### component helper + */ +abstract class ###Component###Helper +{ + /** + * Adding the utilities trait to this class + * + * @deprecated 4.0 - Check the trait methods for details, a legacy implementation + */ + use Utilities; + + /** + * Composer Switch + * + * @var array + */ + protected static $composer = array();###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### + + /** + * Load the Composer Vendors + */ + public static function composerAutoload($target) + { + // insure we load the composer vendor only once + if (!isset(self::$composer[$target])) + { + // get the function name + $functionName = self::safeString('compose' . $target); + // check if method exist + if (method_exists(__CLASS__, $functionName)) + { + return self::{$functionName}(); + } + return false; + } + return self::$composer[$target]; + } + + /** + * Load the Component xml manifest. + */ + public static function manifest() + { + $manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml"; + return simplexml_load_file($manifestUrl); + } + + /** + * Joomla version object + */ + protected static $JVersion; + + /** + * set/get Joomla version + */ + public static function jVersion() + { + // check if set + if (!self::checkObject(self::$JVersion)) + { + self::$JVersion = new JVersion(); + } + return self::$JVersion; + } + + /** + * Load the Contributors details. + */ + public static function getContributors() + { + // get params + $params = JComponentHelper::getParams('com_###component###'); + // start contributors array + $contributors = array(); + // get all Contributors (max 20) + $searchArray = range('0','20'); + foreach($searchArray as $nr) + { + if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 2 || $params->get("showContributor".$nr) == 3)) + { + // set link based of selected option + if($params->get("useContributor".$nr) == 1) + { + $link_front = ''; + $link_back = ''; + } + elseif($params->get("useContributor".$nr) == 2) + { + $link_front = ''; + $link_back = ''; + } + else + { + $link_front = ''; + $link_back = ''; + } + $contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back; + } + } + return $contributors; + }###HELP_SITE### + + /** + * Get any component's model + */ + public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array()) + { + // fix the name + $name = self::safeString($name); + // full path to models + $fullPathModels = $path . '/models'; + // load the model file + JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); + // make sure the table path is loaded + if (!isset($config['table_path']) || !self::checkString($config['table_path'])) + { + // This is the JCB default path to tables in Joomla 3.x + $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; + } + // get instance + $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); + // if model not found (strange) + if ($model == false) + { + jimport('joomla.filesystem.file'); + // get file path + $filePath = $path . '/' . $name . '.php'; + $fullPathModel = $fullPathModels . '/' . $name . '.php'; + // check if it exists + if (File::exists($filePath)) + { + // get the file + require_once $filePath; + } + elseif (File::exists($fullPathModel)) + { + // get the file + require_once $fullPathModel; + } + // build class names + $modelClass = $Component . 'Model' . $name; + if (class_exists($modelClass)) + { + // initialize the model + return new $modelClass($config); + } + } + return $model; + } + + /** + * Add to asset Table + */ + public static function setAsset($id, $table, $inherit = true) + { + $parent = JTable::getInstance('Asset'); + $parent->loadByName('com_###component###'); + + $parentId = $parent->id; + $name = 'com_###component###.'.$table.'.'.$id; + $title = ''; + + $asset = JTable::getInstance('Asset'); + $asset->loadByName($name); + + // Check for an error. + $error = $asset->getError(); + + if ($error) + { + return false; + } + else + { + // Specify how a new or moved node asset is inserted into the tree. + if ($asset->parent_id != $parentId) + { + $asset->setLocation($parentId, 'last-child'); + } + + // Prepare the asset to be stored. + $asset->parent_id = $parentId; + $asset->name = $name; + $asset->title = $title; + // get the default asset rules + $rules = self::getDefaultAssetRules('com_###component###', $table, $inherit); + if ($rules instanceof JAccessRules) + { + $asset->rules = (string) $rules; + } + + if (!$asset->check() || !$asset->store()) + { + JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + return false; + } + else + { + // Create an asset_id or heal one that is corrupted. + $object = new stdClass(); + + // Must be a valid primary key value. + $object->id = $id; + $object->asset_id = (int) $asset->id; + + // Update their asset_id to link to the asset table. + return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); + } + } + return false; + } + + /** + * Gets the default asset Rules for a component/view. + */ + protected static function getDefaultAssetRules($component, $view, $inherit = true) + { + // if new or inherited + $assetId = 0; + // Only get the actual item rules if not inheriting + if (!$inherit) + { + // Need to find the asset id by the name of the component. + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + // check that there is a value + if ($db->getNumRows()) + { + // asset already set so use saved rules + $assetId = (int) $db->loadResult(); + } + } + // get asset rules + $result = JAccess::getAssetRules($assetId); + if ($result instanceof JAccessRules) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($view !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + elseif ($inherit) + { + // clear the value since we inherit + $rule = array(); + } + } + // check if there are any view values remaining + if (count((array) $_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the JAccessRules object for the asset rules. + $rules = new JAccessRules($_result); + // return filtered rules + return $rules; + } + } + return $result; + } + + /** + * xmlAppend + * + * @param SimpleXMLElement $xml The XML element reference in which to inject a comment + * @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement + * + * @return null + * + */ + public static function xmlAppend(&$xml, $node) + { + if (!$node) + { + // element was not returned + return; + } + switch (get_class($node)) + { + case 'stdClass': + if (property_exists($node, 'comment')) + { + self::xmlComment($xml, $node->comment); + } + if (property_exists($node, 'fieldXML')) + { + self::xmlAppend($xml, $node->fieldXML); + } + break; + case 'SimpleXMLElement': + $domXML = dom_import_simplexml($xml); + $domNode = dom_import_simplexml($node); + $domXML->appendChild($domXML->ownerDocument->importNode($domNode, true)); + $xml = simplexml_import_dom($domXML); + break; + } + } + + /** + * xmlComment + * + * @param SimpleXMLElement $xml The XML element reference in which to inject a comment + * @param string $comment The comment to inject + * + * @return null + * + */ + public static function xmlComment(&$xml, $comment) + { + $domXML = dom_import_simplexml($xml); + $domComment = new DOMComment($comment); + $nodeTarget = $domXML->ownerDocument->importNode($domComment, true); + $domXML->appendChild($nodeTarget); + $xml = simplexml_import_dom($domXML); + } + + /** + * xmlAddAttributes + * + * @param SimpleXMLElement $xml The XML element reference in which to inject a comment + * @param array $attributes The attributes to apply to the XML element + * + * @return null + * + */ + public static function xmlAddAttributes(&$xml, $attributes = array()) + { + foreach ($attributes as $key => $value) + { + $xml->addAttribute($key, $value); + } + } + + /** + * xmlAddOptions + * + * @param SimpleXMLElement $xml The XML element reference in which to inject a comment + * @param array $options The options to apply to the XML element + * + * @return void + * + */ + public static function xmlAddOptions(&$xml, $options = array()) + { + foreach ($options as $key => $value) + { + $addOption = $xml->addChild('option'); + $addOption->addAttribute('value', $key); + $addOption[] = $value; + } + } + + /** + * get the field object + * + * @param array $attributes The array of attributes + * @param string $default The default of the field + * @param array $options The options to apply to the XML element + * + * @return object + * + */ + public static function getFieldObject(&$attributes, $default = '', $options = null) + { + // make sure we have attributes and a type value + if (self::checkArray($attributes) && isset($attributes['type'])) + { + // make sure the form helper class is loaded + if (!method_exists('JFormHelper', 'loadFieldType')) + { + jimport('joomla.form.form'); + } + // get field type + $field = JFormHelper::loadFieldType($attributes['type'], true); + // get field xml + $XML = self::getFieldXML($attributes, $options); + // setup the field + $field->setup($XML, $default); + // return the field object + return $field; + } + return false; + } + + /** + * get the field xml + * + * @param array $attributes The array of attributes + * @param array $options The options to apply to the XML element + * + * @return object + * + */ + public static function getFieldXML(&$attributes, $options = null) + { + // make sure we have attributes and a type value + if (self::checkArray($attributes)) + { + // start field xml + $XML = new SimpleXMLElement(''); + // load the attributes + self::xmlAddAttributes($XML, $attributes); + // check if we have options + if (self::checkArray($options)) + { + // load the options + self::xmlAddOptions($XML, $options); + } + // return the field xml + return $XML; + } + return false; + } + + /** + * Render Bool Button + * + * @param array $args All the args for the button + * 0) name + * 1) additional (options class) // not used at this time + * 2) default + * 3) yes (name) + * 4) no (name) + * + * @return string The input html of the button + * + */ + public static function renderBoolButton() + { + $args = func_get_args(); + // check if there is additional button class + $additional = isset($args[1]) ? (string) $args[1] : ''; // not used at this time + // button attributes + $buttonAttributes = array( + 'type' => 'radio', + 'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button', + 'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway + 'class' => 'btn-group', + 'filter' => 'INT', + 'default' => isset($args[2]) ? (int) $args[2] : 0); + // set the button options + $buttonOptions = array( + '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', + '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); + // return the input + return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; + }###HELPER_UIKIT######HELPER_CREATEUSER### + + public static function isPublished($id,$type) + { + if ($type == 'raw') + { + $type = 'item'; + } + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + $query->select(array('a.published')); + $query->from('#__###component###_'.$type.' AS a'); + $query->where('a.id = '. (int) $id); + $query->where('a.published = 1'); + $db->setQuery($query); + $db->execute(); + $found = $db->getNumRows(); + if($found) + { + return true; + } + return false; + } + + public static function getGroupName($id) + { + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select(array('a.title')); + $query->from('#__usergroups AS a'); + $query->where('a.id = '. (int) $id); + $db->setQuery($query); + $db->execute(); + $found = $db->getNumRows(); + if($found) + { + return $db->loadResult(); + } + return $id; + } + + /** + * Get the action permissions + * + * @param string $view The related view name + * @param int $record The item to act upon + * @param string $views The related list view name + * @param mixed $target Only get this permission (like edit, create, delete) + * @param string $component The target component + * @param object $user The user whose permissions we are loading + * + * @return object The JObject of permission/authorised actions + * + */ + public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') + { + // load the user if not given + if (!self::checkObject($user)) + { + // get the user object + $user = JFactory::getUser(); + } + // load the JObject + $result = new JObject; + // make view name safe (just incase) + $view = self::safeString($view); + if (self::checkString($views)) + { + $views = self::safeString($views); + } + // get all actions from component + $actions = JAccess::getActionsFromFile( + JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', + "/access/section[@name='component']/" + ); + // if non found then return empty JObject + if (empty($actions)) + { + return $result; + } + // get created by if not found + if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) + { + $record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); + } + // set actions only set in component settings + $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); + // check if we have a target + $checkTarget = false; + if ($target) + { + // convert to an array + if (self::checkString($target)) + { + $target = array($target); + } + // check if we are good to go + if (self::checkArray($target)) + { + $checkTarget = true; + } + } + // loop the actions and set the permissions + foreach ($actions as $action) + { + // check target action filter + if ($checkTarget && self::filterActions($view, $action->name, $target)) + { + continue; + } + // set to use component default + $fallback = true; + // reset permission per/action + $permission = false; + $catpermission = false; + // set area + $area = 'comp'; + // check if the record has an ID and the action is item related (not a component action) + if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && + (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) + { + // we are in item + $area = 'item'; + // The record has been set. Check the record permissions. + $permission = $user->authorise($action->name, 'com_' . $component . '.' . $view . '.' . (int) $record->id); + // if no permission found, check edit own + if (!$permission) + { + // With edit, if the created_by matches current user then dig deeper. + if (($action->name === 'core.edit' || $action->name === $view . '.edit') && $record->created_by > 0 && ($record->created_by == $user->id)) + { + // the correct target + $coreCheck = (array) explode('.', $action->name); + // check that we have both local and global access + if ($user->authorise($coreCheck[0] . '.edit.own', 'com_' . $component . '.' . $view . '.' . (int) $record->id) && + $user->authorise($coreCheck[0] . '.edit.own', 'com_' . $component)) + { + // allow edit + $result->set($action->name, true); + // set not to use global default + // because we already validated it + $fallback = false; + } + else + { + // do not allow edit + $result->set($action->name, false); + $fallback = false; + } + } + } + elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) + { + // we are in item + $area = 'category'; + // set the core check + $coreCheck = explode('.', $action->name); + $core = $coreCheck[0]; + // make sure we use the core. action check for the categories + if (strpos($action->name, $view) !== false && strpos($action->name, 'core.') === false ) + { + $coreCheck[0] = 'core'; + $categoryCheck = implode('.', $coreCheck); + } + else + { + $categoryCheck = $action->name; + } + // The record has a category. Check the category permissions. + $catpermission = $user->authorise($categoryCheck, 'com_' . $component . '.' . $views . '.category.' . (int) $record->catid); + if (!$catpermission && !is_null($catpermission)) + { + // With edit, if the created_by matches current user then dig deeper. + if (($action->name === 'core.edit' || $action->name === $view . '.edit') && $record->created_by > 0 && ($record->created_by == $user->id)) + { + // check that we have both local and global access + if ($user->authorise('core.edit.own', 'com_' . $component . '.' . $views . '.category.' . (int) $record->catid) && + $user->authorise($core . '.edit.own', 'com_' . $component)) + { + // allow edit + $result->set($action->name, true); + // set not to use global default + // because we already validated it + $fallback = false; + } + else + { + // do not allow edit + $result->set($action->name, false); + $fallback = false; + } + } + } + } + } + // if allowed then fallback on component global settings + if ($fallback) + { + // if item/category blocks access then don't fall back on global + if ((($area === 'item') && !$permission) || (($area === 'category') && !$catpermission)) + { + // do not allow + $result->set($action->name, false); + } + // Finally remember the global settings have the final say. (even if item allow) + // The local item permissions can block, but it can't open and override of global permissions. + // Since items are created by users and global permissions is set by system admin. + else + { + $result->set($action->name, $user->authorise($action->name, 'com_' . $component)); + } + } + } + return $result; + } + + /** + * Filter the action permissions + * + * @param string $action The action to check + * @param array $targets The array of target actions + * + * @return boolean true if action should be filtered out + * + */ + protected static function filterActions(&$view, &$action, &$targets) + { + foreach ($targets as $target) + { + if (strpos($action, $view . '.' . $target) !== false || + strpos($action, 'core.' . $target) !== false) + { + return false; + break; + } + } + return true; + } + + /** + * Check if we are connected + * Thanks https://stackoverflow.com/a/4860432/1429677 + * + * @returns bool true on success + */ + public static function isConnected() + { + // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? + $connected = @fsockopen("www.example.com", 80); + // website, port (try 80 or 443) + if ($connected) + { + //action when connected + $is_conn = true; + fclose($connected); + } + else + { + //action in connection failure + $is_conn = false; + } + return $is_conn; + } + + // typo sorry! + public static function sorten($string, $length = 40, $addTip = true) + { + return self::shorten($string, $length, $addTip); + }###HELPER_SITE_LICENSE_LOCK######GET_CRYPT_KEY### +} diff --git a/admin/compiler/joomla_3/component_admin.php b/admin/compiler/joomla_3/component_admin.php index 374678e29..622b1bde0 100644 --- a/admin/compiler/joomla_3/component_admin.php +++ b/admin/compiler/joomla_3/component_admin.php @@ -32,7 +32,7 @@ $document->addScript('components/com_###component###/assets/js/admin.js'); // require helper files JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php');###HELPER_EMAIL### -JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');###LICENSE_LOCKED_INT######ADMIN_GLOBAL_EVENT######ADMIN_POWER_EVENT### +JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');###LICENSE_LOCKED_INT######ADMIN_GLOBAL_EVENT### // Get an instance of the controller prefixed by ###Component### $controller = JControllerLegacy::getInstance('###Component###'); diff --git a/admin/compiler/joomla_3/component_site.php b/admin/compiler/joomla_3/component_site.php index 86d4616ec..451f984fd 100644 --- a/admin/compiler/joomla_3/component_site.php +++ b/admin/compiler/joomla_3/component_site.php @@ -26,7 +26,7 @@ $document->addScript('components/com_###component###/assets/js/site.js'); // Require helper files JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php');###HELPER_EMAIL### -JLoader::register('###Component###HelperRoute', __DIR__ . '/helpers/route.php');###LICENSE_LOCKED_INT######SITE_GLOBAL_EVENT######SITE_POWER_EVENT### +JLoader::register('###Component###HelperRoute', __DIR__ . '/helpers/route.php');###LICENSE_LOCKED_INT######SITE_GLOBAL_EVENT### // Get an instance of the controller prefixed by ###Component### $controller = JControllerLegacy::getInstance('###Component###'); diff --git a/admin/compiler/joomla_3/settings_componentbuilder.json b/admin/compiler/joomla_3/settings_componentbuilder.json new file mode 100644 index 000000000..f62c27ad6 --- /dev/null +++ b/admin/compiler/joomla_3/settings_componentbuilder.json @@ -0,0 +1,784 @@ +{ + "create": { + "admin": { + "assets": { + "css": "css", + "images": { + "icons": "icons" + }, + "js": "js" + }, + "controllers": "controllers", + "helpers": { + "html": "html" + }, + "language": { + "en-GB": "en-GB" + }, + "layouts": "layouts", + "models": { + "fields": "fields", + "forms": "forms", + "rules": "rules" + }, + "sql": { + "updates": { + "mysql": "mysql" + } + }, + "tables": "tables", + "views": "views" + }, + "site": { + "assets": { + "css": "css", + "images": "images", + "js": "js" + }, + "controllers": "controllers", + "helpers": "helpers", + "language": { + "en-GB": "en-GB" + }, + "layouts": "layouts", + "models": "models", + "views": "views" + }, + "media": { + "css": "css", + "images": "images", + "js": "js" + } + }, + "move": { + "static": { + "access.xml": { + "naam": "access.xml", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "config.xml": { + "naam": "config.xml", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "JControllerLegacy.php": { + "naam": "JControllerLegacy.php", + "path": "c0mp0n3nt/admin", + "rename": "new", + "newName": "controller.php", + "type": "file" + }, + "component.xml": { + "naam": "component.xml", + "path": "c0mp0n3nt/", + "rename": "component", + "type": "file" + }, + "component_admin.php": { + "naam": "component_admin.php", + "path": "c0mp0n3nt/admin", + "rename": "component_admin", + "type": "file" + }, + "admin.css": { + "naam": "admin.css", + "path": "c0mp0n3nt/admin/assets/css", + "rename": false, + "type": "file" + }, + "admin.js": { + "naam": "admin.js", + "path": "c0mp0n3nt/admin/assets/js", + "rename": false, + "type": "file" + }, + "site.css": { + "naam": "site.css", + "path": "c0mp0n3nt/site/assets/css", + "rename": false, + "type": "file" + }, + "site.js": { + "naam": "site.js", + "path": "c0mp0n3nt/site/assets/js", + "rename": false, + "type": "file" + }, + "batch_.php": { + "naam": "batch_.php", + "path": "c0mp0n3nt/admin/helpers/html", + "rename": false, + "type": "file" + }, + "batchselection.php": { + "naam": "batchselection.php", + "path": "c0mp0n3nt/admin/layouts", + "rename": false, + "type": "file" + }, + "component_site.php": { + "naam": "component_site.php", + "path": "c0mp0n3nt/site", + "rename": "component_site", + "type": "file" + }, + "router.php": { + "naam": "router.php", + "path": "c0mp0n3nt/site", + "rename": false, + "type": "file" + }, + "routeHelper.php": { + "naam": "routeHelper.php", + "path": "c0mp0n3nt/site/helpers", + "rename": "new", + "newName": "route.php", + "type": "file" + }, + "JControllerLegacySITE.php": { + "naam": "JControllerLegacySITE.php", + "path": "c0mp0n3nt/site", + "rename": "new", + "newName": "controller.php", + "type": "file" + }, + "Helper.php": { + "naam": "JCB_Helper.php", + "path": "c0mp0n3nt/admin/helpers", + "rename": "JCB_Helper", + "type": "file" + }, + "Helper_site.php": { + "naam": "JCB_Helper_site.php", + "path": "c0mp0n3nt/site/helpers", + "rename": "JCB_Helper_site", + "type": "file" + }, + "Helper_category.php": { + "naam": "Helper_category.php", + "path": "c0mp0n3nt/site/helpers", + "rename": "new", + "newName": "category.php", + "type": "file" + }, + "script.php": { + "naam": "script.php", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "install.mysql.utf8.sql": { + "naam": "install.mysql.utf8.sql", + "path": "c0mp0n3nt/admin/sql", + "rename": false, + "type": "file" + }, + "uninstall.mysql.utf8.sql": { + "naam": "uninstall.mysql.utf8.sql", + "path": "c0mp0n3nt/admin/sql", + "rename": false, + "type": "file" + }, + "headercheck_admin.php": { + "naam": "headercheck_admin.php", + "path": "c0mp0n3nt/admin/helpers", + "rename": "new", + "newName": "headercheck.php", + "type": "file" + }, + "LICENSE.txt": { + "naam": "LICENSE.txt", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "README.txt": { + "naam": "README.txt", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "README.md": { + "naam": "README.md", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "headercheck.php": { + "naam": "headercheck.php", + "path": "c0mp0n3nt/site/helpers", + "rename": false, + "type": "file" + }, + "import.gif": { + "naam": "import.gif", + "path": "c0mp0n3nt/admin/assets/images", + "rename": false, + "type": "file" + } + }, + "dynamic": { + "admin": { + "whmcs.php": { + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "whmcs" + }, + "Helper_email.php": { + "path": "c0mp0n3nt/admin/helpers", + "rename": "Helper_", + "type": "emailer" + }, + "DASHJControllerAdmin.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "DASHJControllerAdmin", + "type": "dashboard" + }, + "DASHJModelList.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "DASHJModelList", + "type": "dashboard" + }, + "DASHJViewLagacy.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "dashboard" + }, + "default_vdm.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "dashboard" + }, + "default_main.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "dashboard" + }, + "DASHdefault.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "dashboard" + }, + "dashboard.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": false, + "type": "dashboard" + }, + "filter_forms.xml": { + "path": "c0mp0n3nt/admin/models/forms", + "rename": "filter_forms", + "type": "filter" + }, + "module_forms.xml": { + "path": "c0mp0n3nt/admin/models/forms", + "rename": "module_forms", + "type": "single" + }, + "module_forms.js": { + "path": "c0mp0n3nt/media/js", + "rename": "module_forms", + "type": "single" + }, + "edit.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "single" + }, + "JModelAdmin.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "JModelAdmin", + "type": "single" + }, + "JControllerForm.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "JControllerForm", + "type": "single" + }, + "JTable.php": { + "path": "c0mp0n3nt/admin/tables", + "rename": "JTable", + "type": "single" + }, + "submitbutton.js": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": false, + "type": "single" + }, + "JViewLegacy_edit.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "single" + }, + "view.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "view", + "type": "single" + }, + "JControllerAdmin.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "JControllerAdmin", + "type": "list" + }, + "JModelList.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "JModelList", + "type": "list" + }, + "views.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "views", + "type": "list" + }, + "JViewLegacy_list.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "list" + }, + "default.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_batch_body.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_batch_footer.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_toolbar.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_head.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_body.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_foot.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "JFormRule.php": { + "path": "c0mp0n3nt/admin/models/rules", + "rename": "JFormRule", + "type": "rule" + }, + "layout_admin.php": { + "path": "c0mp0n3nt/admin/layouts", + "rename": "layout_admin", + "type": "layout" + }, + "layoutoverride.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layoutoverride", + "type": "layoutoverride" + }, + "layoutitems.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layoutitems", + "type": "layoutitems" + }, + "layoutfull.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layoutfull", + "type": "layoutfull" + }, + "layoutlinkedview.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layoutlinkedview", + "type": "layoutlinkedview" + }, + "layouttitle.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layouttitle", + "type": "layouttitle" + }, + "layoutpublished.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layoutpublished", + "type": "layoutpublished" + }, + "layoutmetadata.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layoutmetadata", + "type": "layoutmetadata" + }, + "JFormFieldCustom.php": { + "path": "c0mp0n3nt/admin/models/fields", + "rename": "JFormFieldCustom", + "type": "fieldcustom" + }, + "JFormFieldList.php": { + "path": "c0mp0n3nt/admin/models/fields", + "rename": "JFormFieldList", + "type": "fieldlist" + }, + "JFormFieldRadio.php": { + "path": "c0mp0n3nt/admin/models/fields", + "rename": "JFormFieldRadio", + "type": "fieldradio" + }, + "JFormFieldCheckboxes.php": { + "path": "c0mp0n3nt/admin/models/fields", + "rename": "JFormFieldCheckboxes", + "type": "fieldcheckboxes" + }, + "JFormFieldUser.php": { + "path": "c0mp0n3nt/admin/models/fields", + "rename": "JFormFieldUser", + "type": "fielduser" + }, + "JControllerLegacyAjax.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "new", + "newName": "ajax.json.php", + "type": "ajax" + }, + "JModelListAjax.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "new", + "newName": "ajax.php", + "type": "ajax" + }, + "JControllerLegacy_import.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "new", + "newName": "import.php", + "type": "import" + }, + "JModelLegacy_import.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "new", + "newName": "import.php", + "type": "import" + }, + "JViewLegacy_import.php": { + "path": "c0mp0n3nt/admin/views/import", + "rename": "new", + "newName": "view.html.php", + "type": "import" + }, + "default_import.php": { + "path": "c0mp0n3nt/admin/views/import/tmpl", + "rename": "new", + "newName": "default.php", + "type": "import" + }, + "JControllerLegacy_import_custom.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "JControllerLegacy_import_custom", + "type": "customimport" + }, + "JModelLegacy_import_custom.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "JModelLegacy_import_custom", + "type": "customimport" + }, + "JViewLegacy_import_custom.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "customimport" + }, + "default_import_custom.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "customimport" + }, + "JControllerLegacyHelp.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "new", + "newName": "help.php", + "type": "help" + }, + "1.0.0.sql": { + "path": "c0mp0n3nt/admin/sql/updates/mysql", + "rename": "1.0.0", + "type": "sql_update" + }, + "update_server.xml": { + "path": "c0mp0n3nt/", + "rename": "update_server", + "type": "update_server" + }, + "viewFile.js": { + "path": "c0mp0n3nt/admin/assets/js", + "rename": "viewFile", + "type": "javascript_file" + } + }, + "site": { + "JViewLegacy_list_site.php": { + "path": "c0mp0n3nt/site/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "list" + }, + "JModelList_site.php": { + "path": "c0mp0n3nt/site/models", + "rename": "JModelList_site", + "type": "list" + }, + "views_site.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "views_site", + "type": "list" + }, + "default_list_site.php": { + "path": "c0mp0n3nt/site/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "list" + }, + "JViewLegacy_site.php": { + "path": "c0mp0n3nt/site/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "single" + }, + "view_site.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "view_site", + "type": "single" + }, + "JModelItem_site.php": { + "path": "c0mp0n3nt/site/models", + "rename": "JModelItem_site", + "type": "single" + }, + "default_site.php": { + "path": "c0mp0n3nt/site/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "single" + }, + "default_site_template.php": { + "path": "c0mp0n3nt/site/views/VIEW/tmpl", + "rename": "site_template", + "type": "template" + }, + "layout_site.php": { + "path": "c0mp0n3nt/site/layouts", + "rename": "layout_site", + "type": "layout" + }, + "layoutoverride.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layoutoverride", + "type": "layoutoverride" + }, + "layoutitems.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layoutitems", + "type": "layoutitems" + }, + "layoutfull.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layoutfull", + "type": "layoutfull" + }, + "layoutlinkedview.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layoutlinkedview", + "type": "layoutlinkedview" + }, + "layouttitle.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layouttitle", + "type": "layouttitle" + }, + "layoutpublished.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layoutpublished", + "type": "layoutpublished" + }, + "layoutmetadata.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layoutmetadata", + "type": "layoutmetadata" + }, + "default.xml": { + "path": "c0mp0n3nt/site/views/VIEW/tmpl", + "rename": false, + "type": "menu" + }, + "edit.xml": { + "path": "c0mp0n3nt/site/views/VIEW/tmpl", + "rename": false, + "type": "admin_menu" + }, + "module_forms.xml": { + "path": "c0mp0n3nt/site/models/forms", + "rename": "module_forms", + "type": "edit" + }, + "module_forms.js": { + "path": "c0mp0n3nt/site/models/forms", + "rename": "module_forms", + "type": "edit" + }, + "edit_site.php": { + "path": "c0mp0n3nt/site/views/VIEW/tmpl", + "rename": "new", + "newName": "edit.php", + "type": "edit" + }, + "JModelAdmin_site.php": { + "path": "c0mp0n3nt/site/models", + "rename": "JModelAdmin_site", + "type": "edit" + }, + "JControllerForm_site.php": { + "path": "c0mp0n3nt/site/controllers", + "rename": "JControllerForm_site", + "type": "edit" + }, + "submitbutton.js": { + "path": "c0mp0n3nt/site/views/VIEW", + "rename": false, + "type": "edit" + }, + "JViewLegacy_edit_site.php": { + "path": "c0mp0n3nt/site/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "edit" + }, + "view_site_edit.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "view_site_edit", + "type": "edit" + }, + "JControllerLegacyAjaxSite.php": { + "path": "c0mp0n3nt/site/controllers", + "rename": "new", + "newName": "ajax.json.php", + "type": "ajax" + }, + "JModelListAjaxSite.php": { + "path": "c0mp0n3nt/site/models", + "rename": "new", + "newName": "ajax.php", + "type": "ajax" + }, + "JControllerLegacyHelp_site.php": { + "path": "c0mp0n3nt/site/controllers", + "rename": "new", + "newName": "help.php", + "type": "help" + }, + "JControllerForm_custom_site.php": { + "path": "c0mp0n3nt/site/controllers", + "rename": "JControllerForm_custom_site", + "type": "custom_form" + }, + "submitbutton_site.js": { + "path": "c0mp0n3nt/site/views/VIEW", + "rename": "new", + "newName": "submitbutton.js", + "type": "custom_form" + }, + "Helper_category_view.php": { + "path": "c0mp0n3nt/site/helpers", + "rename": "Helper_category_view", + "type": "category" + }, + "viewFileSite.js": { + "path": "c0mp0n3nt/site/assets/js", + "rename": "viewFileSite", + "type": "javascript_file" + } + }, + "custom_admin": { + "JViewLegacy_list_custom_admin.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "list" + }, + "JModelList_custom_admin.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "JModelList_custom_admin", + "type": "list" + }, + "default_list_custom_admin.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "list" + }, + "JControllerAdmin_custom_admin.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "JControllerAdmin_custom_admin", + "type": "list" + }, + "views_custom_admin.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "views_custom_admin", + "type": "list" + }, + "view_custom_admin.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "view_custom_admin", + "type": "single" + }, + "JViewLegacy_custom_admin.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "single" + }, + "JModelItem_custom_admin.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "JModelItem_custom_admin", + "type": "single" + }, + "default_custom_admin.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "single" + }, + "JControllerLegacy_custom_admin.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "JControllerLegacy_custom_admin", + "type": "single" + }, + "default_custom_admin_template.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": "custom_admin_template", + "type": "template" + }, + "layout_custom_admin.php": { + "path": "c0mp0n3nt/admin/layouts", + "rename": "layout_custom_admin", + "type": "layout" + }, + "viewFileCustomAdmin.js": { + "path": "c0mp0n3nt/admin/assets/js", + "rename": "viewFileCustomAdmin", + "type": "javascript_file" + } + } + } + } +} \ No newline at end of file diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 06c4e9d02..c2e6a9d6c 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -15,6 +15,11 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Filesystem\File; use Joomla\CMS\Filesystem\Folder; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\MathHelper; + // Use the component builder autoloader ComponentbuilderHelper::autoLoader(); @@ -145,10 +150,10 @@ class Compiler extends Infusion // set the lang data now $this->setLangFileData(); // set the language notice if it was set - if (ComponentbuilderHelper::checkArray($this->langNot) - || ComponentbuilderHelper::checkArray($this->langSet)) + if (ArrayHelper::check($this->langNot) + || ArrayHelper::check($this->langSet)) { - if (ComponentbuilderHelper::checkArray($this->langNot)) + if (ArrayHelper::check($this->langNot)) { $this->app->enqueueMessage( JText::_('

Language Warning

'), 'Warning' @@ -184,7 +189,7 @@ class Compiler extends Infusion ); } // show languages that were added - if (ComponentbuilderHelper::checkArray($this->langSet)) + if (ArrayHelper::check($this->langSet)) { $this->app->enqueueMessage( JText::_('

Language Notice

'), 'Notice' @@ -275,9 +280,9 @@ class Compiler extends Infusion // if there are plugins zip them $this->zipPlugins(); // do lang mismatch check - if (ComponentbuilderHelper::checkArray($this->langMismatch)) + if (ArrayHelper::check($this->langMismatch)) { - if (ComponentbuilderHelper::checkArray($this->langMatch)) + if (ArrayHelper::check($this->langMatch)) { $mismatch = array_diff( array_unique($this->langMismatch), @@ -290,7 +295,7 @@ class Compiler extends Infusion } // set a notice if we have a mismatch if (isset($mismatch) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $mismatch )) { @@ -317,7 +322,7 @@ class Compiler extends Infusion foreach ($mismatch as $string) { $constant = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString($string, 'U'); + . StringHelper::safe($string, 'U'); $this->app->enqueueMessage( JText::sprintf( 'The Joomla.JText._('%s') language constant for %s does not have a corresponding JText::script('%s') decalaration, please add it.', @@ -328,7 +333,7 @@ class Compiler extends Infusion } } // check if we should add a EXTERNALCODE notice - if (ComponentbuilderHelper::checkArray($this->externalCodeString)) + if (ArrayHelper::check($this->externalCodeString)) { // number of external code strings $externalCount = count($this->externalCodeString); @@ -385,9 +390,9 @@ class Compiler extends Infusion protected function updateFiles() { if (isset($this->newFiles['static']) - && ComponentbuilderHelper::checkArray($this->newFiles['static']) + && ArrayHelper::check($this->newFiles['static']) && isset($this->newFiles['dynamic']) - && ComponentbuilderHelper::checkArray($this->newFiles['dynamic'])) + && ArrayHelper::check($this->newFiles['dynamic'])) { // get the bom file $bom = ComponentbuilderHelper::getFileContents($this->bomPath); @@ -405,7 +410,7 @@ class Compiler extends Infusion foreach ($this->newFiles['dynamic'] as $view => $files) { if (isset($this->fileContentDynamic[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->fileContentDynamic[$view] )) { @@ -429,13 +434,13 @@ class Compiler extends Infusion // free up some memory unset($this->newFiles['dynamic']); // do modules if found - if (ComponentbuilderHelper::checkArray($this->joomlaModules)) + if (ArrayHelper::check($this->joomlaModules)) { foreach ($this->joomlaModules as $module) { - if (ComponentbuilderHelper::checkObject($module) + if (ObjectHelper::check($module) && isset($this->newFiles[$module->key]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->newFiles[$module->key] )) { @@ -445,7 +450,7 @@ class Compiler extends Infusion { // check the config fields if (isset($module->config_fields) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $module->config_fields )) { @@ -467,7 +472,7 @@ class Compiler extends Infusion } // check the fieldsets if (isset($module->form_files) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $module->form_files )) { @@ -510,13 +515,13 @@ class Compiler extends Infusion } } // do plugins if found - if (ComponentbuilderHelper::checkArray($this->joomlaPlugins)) + if (ArrayHelper::check($this->joomlaPlugins)) { foreach ($this->joomlaPlugins as $plugin) { - if (ComponentbuilderHelper::checkObject($plugin) + if (ObjectHelper::check($plugin) && isset($this->newFiles[$plugin->key]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->newFiles[$plugin->key] )) { @@ -526,7 +531,7 @@ class Compiler extends Infusion { // check the config fields if (isset($plugin->config_fields) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $plugin->config_fields )) { @@ -548,7 +553,7 @@ class Compiler extends Infusion } // check the fieldsets if (isset($plugin->form_files) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $plugin->form_files )) { @@ -591,13 +596,13 @@ class Compiler extends Infusion } } // do powers if found - if (ComponentbuilderHelper::checkArray($this->powers)) + if (ArrayHelper::check($this->powers)) { foreach ($this->powers as $power) { - if (ComponentbuilderHelper::checkObject($power) + if (ObjectHelper::check($power) && isset($this->newFiles[$power->key]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->newFiles[$power->key] )) { @@ -720,11 +725,11 @@ class Compiler extends Infusion } } // move the modules update server to host - if (ComponentbuilderHelper::checkArray($this->joomlaModules)) + if (ArrayHelper::check($this->joomlaModules)) { foreach ($this->joomlaModules as $module) { - if (ComponentbuilderHelper::checkObject($module) + if (ObjectHelper::check($module) && isset($module->add_update_server) && $module->add_update_server == 1 && isset($module->update_server_target) @@ -735,7 +740,7 @@ class Compiler extends Infusion && isset($module->update_server_xml_path) && File::exists($module->update_server_xml_path) && isset($module->update_server_xml_file_name) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $module->update_server_xml_file_name )) { @@ -753,11 +758,11 @@ class Compiler extends Infusion } } // move the plugins update server to host - if (ComponentbuilderHelper::checkArray($this->joomlaPlugins)) + if (ArrayHelper::check($this->joomlaPlugins)) { foreach ($this->joomlaPlugins as $plugin) { - if (ComponentbuilderHelper::checkObject($plugin) + if (ObjectHelper::check($plugin) && isset($plugin->add_update_server) && $plugin->add_update_server == 1 && isset($plugin->update_server_target) @@ -768,7 +773,7 @@ class Compiler extends Infusion && isset($plugin->update_server_xml_path) && File::exists($plugin->update_server_xml_path) && isset($plugin->update_server_xml_file_name) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $plugin->update_server_xml_file_name )) { @@ -791,7 +796,7 @@ class Compiler extends Infusion { // check if these files have its own config data) if (isset($data['config']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $data['config'] ) && $this->componentData->mvc_versiondate == 1) @@ -981,7 +986,7 @@ class Compiler extends Infusion { // move it to the repo folder if set if (isset($this->repoPath) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->repoPath )) { @@ -1007,11 +1012,11 @@ class Compiler extends Infusion ); // move the modules to local folder repos - if (ComponentbuilderHelper::checkArray($this->joomlaModules)) + if (ArrayHelper::check($this->joomlaModules)) { foreach ($this->joomlaModules as $module) { - if (ComponentbuilderHelper::checkObject($module) + if (ObjectHelper::check($module) && isset($module->file_name)) { $module_context = 'module.' . $module->file_name . '.' @@ -1044,11 +1049,11 @@ class Compiler extends Infusion } } // move the plugins to local folder repos - if (ComponentbuilderHelper::checkArray($this->joomlaPlugins)) + if (ArrayHelper::check($this->joomlaPlugins)) { foreach ($this->joomlaPlugins as $plugin) { - if (ComponentbuilderHelper::checkObject($plugin) + if (ObjectHelper::check($plugin) && isset($plugin->file_name)) { $plugin_context = 'plugin.' . $plugin->file_name . '.' @@ -1162,15 +1167,15 @@ class Compiler extends Infusion private function zipModules() { - if (ComponentbuilderHelper::checkArray($this->joomlaModules)) + if (ArrayHelper::check($this->joomlaModules)) { foreach ($this->joomlaModules as $module) { - if (ComponentbuilderHelper::checkObject($module) + if (ObjectHelper::check($module) && isset($module->zip_name) - && ComponentbuilderHelper::checkString($module->zip_name) + && StringHelper::check($module->zip_name) && isset($module->folder_path) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $module->folder_path )) { @@ -1256,15 +1261,15 @@ class Compiler extends Infusion private function zipPlugins() { - if (ComponentbuilderHelper::checkArray($this->joomlaPlugins)) + if (ArrayHelper::check($this->joomlaPlugins)) { foreach ($this->joomlaPlugins as $plugin) { - if (ComponentbuilderHelper::checkObject($plugin) + if (ObjectHelper::check($plugin) && isset($plugin->zip_name) - && ComponentbuilderHelper::checkString($plugin->zip_name) + && StringHelper::check($plugin->zip_name) && isset($plugin->folder_path) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $plugin->folder_path )) { @@ -1359,9 +1364,9 @@ class Compiler extends Infusion $fingerPrint = array(); if (isset($target['hashtarget'][0]) && $target['hashtarget'][0] > 3 && isset($target['path']) - && ComponentbuilderHelper::checkString($target['path']) + && StringHelper::check($target['path']) && isset($target['hashtarget'][1]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $target['hashtarget'][1] )) { @@ -1400,7 +1405,7 @@ class Compiler extends Infusion ); if (!$found) { - $bites = (int) ComponentbuilderHelper::bcmath( + $bites = (int) MathHelper::bc( 'add', $lineBites[$lineNumber], $bites ); } @@ -1590,14 +1595,14 @@ class Compiler extends Infusion // Add the data fwrite($fpFile, $data); // truncate file at the end of the data that was added - $remove = ComponentbuilderHelper::bcmath( + $remove = MathHelper::bc( 'add', $position, mb_strlen($data, '8bit') ); ftruncate($fpFile, $remove); // check if this was a replacement of data if ($replace) { - $position = ComponentbuilderHelper::bcmath( + $position = MathHelper::bc( 'add', $position, $replace ); } diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index fb0608da7..d724a73bf 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -15,6 +15,16 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Filesystem\File; use Joomla\CMS\Filesystem\Folder; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\String\FieldHelper; +use VDM\Joomla\Utilities\String\TypeHelper; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Utilities\String\NamespaceHelper; +use VDM\Joomla\Utilities\String\PluginHelper; /** * Get class as the main compilers class @@ -981,16 +991,16 @@ class Get // set the component ID $this->componentID = (int) $config['component']; // set this components code name - if ($name_code = ComponentbuilderHelper::getVar( + if ($name_code = GetHelper::var( 'joomla_component', $this->componentID, 'id', 'name_code' )) { // set lang prefix - $this->langPrefix = 'COM_' . ComponentbuilderHelper::safeString( + $this->langPrefix = 'COM_' . StringHelper::safe( $name_code, 'U' ); // set component code name - $this->componentCodeName = ComponentbuilderHelper::safeString( + $this->componentCodeName = StringHelper::safe( $name_code ); // set component context @@ -1005,12 +1015,12 @@ class Get 'assets_table_fix', 1 ); $this->addAssetsTableFix = (($add_assets_table_fix - = (int) ComponentbuilderHelper::getVar( + = (int) GetHelper::var( 'joomla_component', $this->componentID, 'id', 'assets_table_fix' )) == 3) ? $global : $add_assets_table_fix; // set if language strings line breaks should be removed - $global = ((int) ComponentbuilderHelper::getVar( + $global = ((int) GetHelper::var( 'joomla_component', $this->componentID, 'id', 'remove_line_breaks' ) == 1) ? true : false; @@ -1020,7 +1030,7 @@ class Get : (((int) $config['remove_line_breaks'] == 1) ? true : $global); // set if placeholders should be added to customcode - $global = ((int) ComponentbuilderHelper::getVar( + $global = ((int) GetHelper::var( 'joomla_component', $this->componentID, 'id', 'add_placeholders' ) == 1) ? true : false; @@ -1028,7 +1038,7 @@ class Get ? false : (((int) $config['placeholders'] == 1) ? true : $global); // set if line numbers should be added to comments - $global = ((int) ComponentbuilderHelper::getVar( + $global = ((int) GetHelper::var( 'joomla_component', $this->componentID, 'id', 'debug_linenr' ) == 1) ? true : false; @@ -1068,8 +1078,8 @@ class Get } // update the version if (!isset($this->componentData->old_component_version) - && (ComponentbuilderHelper::checkArray($this->addSQL) - || ComponentbuilderHelper::checkArray( + && (ArrayHelper::check($this->addSQL) + || ArrayHelper::check( $this->updateSQL ))) { @@ -1207,11 +1217,11 @@ class Get $bucket[$this->hhh . 'component' . $this->hhh] = $this->componentCodeName; $bucket[$this->hhh . 'Component' . $this->hhh] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $this->componentCodeName, 'F' ); $bucket[$this->hhh . 'COMPONENT' . $this->hhh] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $this->componentCodeName, 'U' ); $bucket[$this->bbb . 'component' . $this->ddd] = $bucket[$this->hhh @@ -1224,14 +1234,14 @@ class Get $bucket[$this->bbb . 'LANG_PREFIX' . $this->ddd] = $bucket[$this->hhh . 'LANG_PREFIX' . $this->hhh]; // get the current components overides - if (($_placeholders = ComponentbuilderHelper::getVar( + if (($_placeholders = GetHelper::var( 'component_placeholders', $this->componentID, 'joomla_component', 'addplaceholders' )) !== false - && ComponentbuilderHelper::checkJson($_placeholders)) + && JsonHelper::check($_placeholders)) { $_placeholders = json_decode($_placeholders, true); - if (ComponentbuilderHelper::checkArray($_placeholders)) + if (ArrayHelper::check($_placeholders)) { foreach ($_placeholders as $row) { @@ -1391,18 +1401,18 @@ class Get ); // load the global placeholders - if (ComponentbuilderHelper::checkArray($this->globalPlaceholders)) + if (ArrayHelper::check($this->globalPlaceholders)) { $this->placeholders = $this->globalPlaceholders; } // set component sales name - $component->sales_name = ComponentbuilderHelper::safeString( + $component->sales_name = StringHelper::safe( $component->system_name ); // set the component name_code - $component->name_code = ComponentbuilderHelper::safeString( + $component->name_code = StringHelper::safe( $component->name_code ); @@ -1422,15 +1432,15 @@ class Get $component->{'add' . $addTarget} = (isset( $component->{'add' . $addTarget} ) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $component->{'add' . $addTarget} )) ? json_decode($component->{'add' . $addTarget}, true) : null; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $component->{'add' . $addTarget} )) { if (isset($component->{$targetHere}) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $component->{$targetHere} )) { @@ -1455,19 +1465,19 @@ class Get // set whmcs links if needed if (1 == $component->add_license && (!isset($component->whmcs_buy_link) - || !ComponentbuilderHelper::checkString( + || !StringHelper::check( $component->whmcs_buy_link ))) { // update with the whmcs url if (isset($component->whmcs_url) - && ComponentbuilderHelper::checkString($component->whmcs_url)) + && StringHelper::check($component->whmcs_url)) { $component->whmcs_buy_link = $component->whmcs_url; } // use the company website elseif (isset($component->website) - && ComponentbuilderHelper::checkString($component->website)) + && StringHelper::check($component->website)) { $component->whmcs_buy_link = $component->website; $component->whmcs_url = rtrim($component->website, '/') @@ -1499,9 +1509,9 @@ class Get // set the addcustommenus data $component->addcustommenus = (isset($component->addcustommenus) - && ComponentbuilderHelper::checkJson($component->addcustommenus)) + && JsonHelper::check($component->addcustommenus)) ? json_decode($component->addcustommenus, true) : null; - if (ComponentbuilderHelper::checkArray($component->addcustommenus)) + if (ArrayHelper::check($component->addcustommenus)) { $component->custommenus = array_values($component->addcustommenus); } @@ -1509,9 +1519,9 @@ class Get // set the sql_tweak data $component->sql_tweak = (isset($component->sql_tweak) - && ComponentbuilderHelper::checkJson($component->sql_tweak)) + && JsonHelper::check($component->sql_tweak)) ? json_decode($component->sql_tweak, true) : null; - if (ComponentbuilderHelper::checkArray($component->sql_tweak)) + if (ArrayHelper::check($component->sql_tweak)) { // build the tweak settings $this->setSqlTweaking( @@ -1519,8 +1529,8 @@ class Get function ($array) { return array_map( function ($value) { - if (!ComponentbuilderHelper::checkArray($value) - && !ComponentbuilderHelper::checkObject( + if (!ArrayHelper::check($value) + && !ObjectHelper::check( $value ) && strval($value) === strval( @@ -1541,9 +1551,9 @@ class Get // set the admin_view data $component->addadmin_views = (isset($component->addadmin_views) - && ComponentbuilderHelper::checkJson($component->addadmin_views)) + && JsonHelper::check($component->addadmin_views)) ? json_decode($component->addadmin_views, true) : null; - if (ComponentbuilderHelper::checkArray($component->addadmin_views)) + if (ArrayHelper::check($component->addadmin_views)) { $this->lang = 'admin'; $this->target = 'admin'; @@ -1571,8 +1581,8 @@ class Get function ($array) { $array = array_map( function ($value) { - if (!ComponentbuilderHelper::checkArray($value) - && !ComponentbuilderHelper::checkObject($value) + if (!ArrayHelper::check($value) + && !ObjectHelper::check($value) && strval($value) === strval(intval($value))) { return (int) $value; @@ -1635,9 +1645,9 @@ class Get } // set the site_view data $component->addsite_views = (isset($component->addsite_views) - && ComponentbuilderHelper::checkJson($component->addsite_views)) + && JsonHelper::check($component->addsite_views)) ? json_decode($component->addsite_views, true) : null; - if (ComponentbuilderHelper::checkArray($component->addsite_views)) + if (ArrayHelper::check($component->addsite_views)) { $this->lang = 'site'; $this->target = 'site'; @@ -1652,8 +1662,8 @@ class Get return array_map( function ($value) { - if (!ComponentbuilderHelper::checkArray($value) - && !ComponentbuilderHelper::checkObject($value) + if (!ArrayHelper::check($value) + && !ObjectHelper::check($value) && strval($value) === strval(intval($value))) { return (int) $value; @@ -1671,10 +1681,10 @@ class Get // set the custom_admin_views data $component->addcustom_admin_views = (isset($component->addcustom_admin_views) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $component->addcustom_admin_views )) ? json_decode($component->addcustom_admin_views, true) : null; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $component->addcustom_admin_views )) { @@ -1691,8 +1701,8 @@ class Get return array_map( function ($value) { - if (!ComponentbuilderHelper::checkArray($value) - && !ComponentbuilderHelper::checkObject($value) + if (!ArrayHelper::check($value) + && !ObjectHelper::check($value) && strval($value) === strval(intval($value))) { return (int) $value; @@ -1709,9 +1719,9 @@ class Get // set the config data $component->addconfig = (isset($component->addconfig) - && ComponentbuilderHelper::checkJson($component->addconfig)) + && JsonHelper::check($component->addconfig)) ? json_decode($component->addconfig, true) : null; - if (ComponentbuilderHelper::checkArray($component->addconfig)) + if (ArrayHelper::check($component->addconfig)) { $component->config = array_map( function ($field) { @@ -1740,9 +1750,9 @@ class Get // set the addcustommenus data $component->addcontributors = (isset($component->addcontributors) - && ComponentbuilderHelper::checkJson($component->addcontributors)) + && JsonHelper::check($component->addcontributors)) ? json_decode($component->addcontributors, true) : null; - if (ComponentbuilderHelper::checkArray($component->addcontributors)) + if (ArrayHelper::check($component->addcontributors)) { $this->addContributors = true; $component->contributors = array_values( @@ -1753,9 +1763,9 @@ class Get // set the addcustommenus data $component->version_update = (isset($component->version_update) - && ComponentbuilderHelper::checkJson($component->version_update)) + && JsonHelper::check($component->version_update)) ? json_decode($component->version_update, true) : null; - if (ComponentbuilderHelper::checkArray($component->version_update)) + if (ArrayHelper::check($component->version_update)) { $component->version_update = array_values( $component->version_update @@ -1771,11 +1781,11 @@ class Get ); if ($old_component || $old_admin_views) { - if (ComponentbuilderHelper::checkObject($old_admin_views)) + if (ObjectHelper::check($old_admin_views)) { // add new views if found if (isset($old_admin_views->addadmin_views) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $old_admin_views->addadmin_views )) { @@ -1785,7 +1795,7 @@ class Get ); } // check if a new version was manualy set - if (ComponentbuilderHelper::checkObject($old_component)) + if (ObjectHelper::check($old_component)) { $old_component_version = preg_replace( '/[^0-9.]+/', '', $old_component->component_version @@ -1836,7 +1846,7 @@ class Get if (isset($component->{'add_css_' . $area}) && $component->{'add_css_' . $area} == 1 && isset($component->{'css_' . $area}) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $component->{'css_' . $area} )) { @@ -1868,7 +1878,7 @@ class Get ) && $component->{'add_' . $scriptMethod . '_' . $scriptType} == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $component->{$scriptMethod . '_' . $scriptType} )) { @@ -1891,7 +1901,7 @@ class Get } // add_php_helper if ($component->add_php_helper_admin == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $component->php_helper_admin )) { @@ -1915,7 +1925,7 @@ class Get unset($component->php_helper); // add_admin_event if ($component->add_admin_event == 1 - && ComponentbuilderHelper::checkString($component->php_admin_event)) + && StringHelper::check($component->php_admin_event)) { $this->lang = 'admin'; // update GUI mapper field @@ -1935,7 +1945,7 @@ class Get unset($component->php_admin_event); // add_php_helper_both if ($component->add_php_helper_both == 1 - && ComponentbuilderHelper::checkString($component->php_helper_both)) + && StringHelper::check($component->php_helper_both)) { $this->lang = 'both'; // update GUI mapper field @@ -1956,7 +1966,7 @@ class Get } // add_php_helper_site if ($component->add_php_helper_site == 1 - && ComponentbuilderHelper::checkString($component->php_helper_site)) + && StringHelper::check($component->php_helper_site)) { $this->lang = 'site'; // update GUI mapper field @@ -1978,7 +1988,7 @@ class Get unset($component->php_helper); // add_site_event if ($component->add_site_event == 1 - && ComponentbuilderHelper::checkString($component->php_site_event)) + && StringHelper::check($component->php_site_event)) { $this->lang = 'site'; // update GUI mapper field @@ -2016,7 +2026,7 @@ class Get } unset($component->sql_uninstall); // bom - if (ComponentbuilderHelper::checkString($component->bom)) + if (StringHelper::check($component->bom)) { $this->bomPath = $this->compilerPath . '/' . $component->bom; } @@ -2042,9 +2052,9 @@ class Get $this->lang = 'admin'; // dashboard methods $component->dashboard_tab = (isset($component->dashboard_tab) - && ComponentbuilderHelper::checkJson($component->dashboard_tab)) + && JsonHelper::check($component->dashboard_tab)) ? json_decode($component->dashboard_tab, true) : null; - if (ComponentbuilderHelper::checkArray($component->dashboard_tab)) + if (ArrayHelper::check($component->dashboard_tab)) { $component->dashboard_tab = array_map( function ($array) { @@ -2060,7 +2070,7 @@ class Get } // add the php of the dashboard if set if (isset($component->php_dashboard_methods) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $component->php_dashboard_methods )) { @@ -2095,7 +2105,7 @@ class Get { // get the server protocol $component->{$server . '_protocol'} - = ComponentbuilderHelper::getVar( + = GetHelper::var( 'server', (int) $component->{$server}, 'id', 'protocol' ); } @@ -2112,7 +2122,7 @@ class Get } // set the ignore folders for repo if found if (isset($component->toignore) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $component->toignore )) { @@ -2134,9 +2144,9 @@ class Get } // get all modules $component->addjoomla_modules = (isset($component->addjoomla_modules) - && ComponentbuilderHelper::checkJson($component->addjoomla_modules)) + && JsonHelper::check($component->addjoomla_modules)) ? json_decode($component->addjoomla_modules, true) : null; - if (ComponentbuilderHelper::checkArray($component->addjoomla_modules)) + if (ArrayHelper::check($component->addjoomla_modules)) { $joomla_modules = array_map( function ($array) use (&$component) { @@ -2155,9 +2165,9 @@ class Get unset($component->addjoomla_modules); // get all plugins $component->addjoomla_plugins = (isset($component->addjoomla_plugins) - && ComponentbuilderHelper::checkJson($component->addjoomla_plugins)) + && JsonHelper::check($component->addjoomla_plugins)) ? json_decode($component->addjoomla_plugins, true) : null; - if (ComponentbuilderHelper::checkArray($component->addjoomla_plugins)) + if (ArrayHelper::check($component->addjoomla_plugins)) { $joomla_plugins = array_map( function ($array) use (&$component) { @@ -2312,7 +2322,7 @@ class Get $view->name_single_code = 'oops_hmm_' . $id; if (isset($view->name_single) && $view->name_single != 'null') { - $view->name_single_code = ComponentbuilderHelper::safeString( + $view->name_single_code = StringHelper::safe( $view->name_single ); } @@ -2321,7 +2331,7 @@ class Get $view->name_list_code = 'oops_hmmm_' . $id; if (isset($view->name_list) && $view->name_list != 'null') { - $view->name_list_code = ComponentbuilderHelper::safeString( + $view->name_list_code = StringHelper::safe( $view->name_list ); } @@ -2381,19 +2391,19 @@ class Get $this->placeholders[$this->hhh . 'views' . $this->hhh] = $view->name_list_code; $this->placeholders[$this->hhh . 'View' . $this->hhh] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $view->name_single, 'F' ); $this->placeholders[$this->hhh . 'Views' . $this->hhh] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $view->name_list, 'F' ); $this->placeholders[$this->hhh . 'VIEW' . $this->hhh] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $view->name_single, 'U' ); $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $view->name_list, 'U' ); $this->placeholders[$this->bbb . 'view' . $this->ddd] @@ -2417,9 +2427,9 @@ class Get // add the tables $view->addtables = (isset($view->addtables) - && ComponentbuilderHelper::checkJson($view->addtables)) + && JsonHelper::check($view->addtables)) ? json_decode($view->addtables, true) : null; - if (ComponentbuilderHelper::checkArray($view->addtables)) + if (ArrayHelper::check($view->addtables)) { $view->tables = array_values($view->addtables); } @@ -2429,9 +2439,9 @@ class Get $this->customTabs[$view->name_single_code] = null; $view->customtabs = (isset($view->customtabs) - && ComponentbuilderHelper::checkJson($view->customtabs)) + && JsonHelper::check($view->customtabs)) ? json_decode($view->customtabs, true) : null; - if (ComponentbuilderHelper::checkArray($view->customtabs)) + if (ArrayHelper::check($view->customtabs)) { // setup custom tabs to global data sets $this->customTabs[$view->name_single_code] = array_map( @@ -2445,21 +2455,21 @@ class Get ); // set the tab name $tab['name'] = (isset($tab['name']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $tab['name'] )) ? $tab['name'] : 'Tab'; // set lang $tab['lang'] = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $tab['view'], 'U' - ) . '_' . ComponentbuilderHelper::safeString( + ) . '_' . StringHelper::safe( $tab['name'], 'U' ); $this->setLangContent( 'both', $tab['lang'], $tab['name'] ); // set code name - $tab['code'] = ComponentbuilderHelper::safeString( + $tab['code'] = StringHelper::safe( $tab['name'] ); // check if the permissions for the tab should be added @@ -2537,7 +2547,7 @@ class Get ); // set the sort key $tab['sortKey'] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $tab['lang_permission_title'] ); } @@ -2551,9 +2561,9 @@ class Get // add the local tabs $view->addtabs = (isset($view->addtabs) - && ComponentbuilderHelper::checkJson($view->addtabs)) + && JsonHelper::check($view->addtabs)) ? json_decode($view->addtabs, true) : null; - if (ComponentbuilderHelper::checkArray($view->addtabs)) + if (ArrayHelper::check($view->addtabs)) { $nr = 1; foreach ($view->addtabs as $tab) @@ -2579,9 +2589,9 @@ class Get unset($view->addtabs); // add permissions $view->addpermissions = (isset($view->addpermissions) - && ComponentbuilderHelper::checkJson($view->addpermissions)) + && JsonHelper::check($view->addpermissions)) ? json_decode($view->addpermissions, true) : null; - if (ComponentbuilderHelper::checkArray($view->addpermissions)) + if (ArrayHelper::check($view->addpermissions)) { $view->permissions = array_values($view->addpermissions); } @@ -2590,9 +2600,9 @@ class Get $view->fields = array(); // set fields $view->addfields = (isset($view->addfields) - && ComponentbuilderHelper::checkJson($view->addfields)) + && JsonHelper::check($view->addfields)) ? json_decode($view->addfields, true) : null; - if (ComponentbuilderHelper::checkArray($view->addfields)) + if (ArrayHelper::check($view->addfields)) { $ignoreFields = array(); // load the field data @@ -2628,7 +2638,7 @@ class Get { // add new fields were added if (isset($old_view->addfields) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $old_view->addfields )) { @@ -2674,7 +2684,7 @@ class Get ); // check if the field changed since the last compilation (default fields never change and are always added) if (!isset($ignoreFields[$field['field']]) - && ComponentbuilderHelper::checkObject( + && ObjectHelper::check( $field['settings']->history )) { @@ -2702,7 +2712,7 @@ class Get } // check if the name changed if (isset($field['settings']->history->xml) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $field['settings']->history->xml )) { @@ -2773,10 +2783,10 @@ class Get if ($old_view = $this->getHistoryWatch('admin_view', $id)) { // check if the view name changed - if (ComponentbuilderHelper::checkString($old_view->name_single)) + if (StringHelper::check($old_view->name_single)) { $this->setUpdateSQL( - ComponentbuilderHelper::safeString( + StringHelper::safe( $old_view->name_single ), $view->name_single_code, 'table_name', $view->name_single_code @@ -2799,7 +2809,7 @@ class Get } // check if there is no history on table engine, and it changed from the default/global elseif (isset($view->{'mysql_table_' . $_mysqlTableKey}) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view->{'mysql_table_' . $_mysqlTableKey} ) && !is_numeric( @@ -2818,18 +2828,18 @@ class Get } // set the conditions $view->addconditions = (isset($view->addconditions) - && ComponentbuilderHelper::checkJson($view->addconditions)) + && JsonHelper::check($view->addconditions)) ? json_decode($view->addconditions, true) : null; - if (ComponentbuilderHelper::checkArray($view->addconditions)) + if (ArrayHelper::check($view->addconditions)) { $view->conditions = array(); $ne = 0; foreach ($view->addconditions as $nr => $conditionValue) { - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $conditionValue['target_field'] ) - && ComponentbuilderHelper::checkArray($view->fields)) + && ArrayHelper::check($view->fields)) { foreach ( $conditionValue['target_field'] as $fieldKey => @@ -2855,7 +2865,7 @@ class Get 'filter="', '"' ); $filter - = ComponentbuilderHelper::checkString( + = StringHelper::check( $filter ) ? $filter : 'none'; // set the field name @@ -2877,7 +2887,7 @@ class Get } // load match field - if (ComponentbuilderHelper::checkArray($view->fields) + if (ArrayHelper::check($view->fields) && isset($conditionValue['match_field'])) { foreach ($view->fields as $fieldValue) @@ -2925,9 +2935,9 @@ class Get $this->listHeadOverRide[$view->name_list_code] = array(); // set the relations $view->addrelations = (isset($view->addrelations) - && ComponentbuilderHelper::checkJson($view->addrelations)) + && JsonHelper::check($view->addrelations)) ? json_decode($view->addrelations, true) : null; - if (ComponentbuilderHelper::checkArray($view->addrelations)) + if (ArrayHelper::check($view->addrelations)) { foreach ($view->addrelations as $nr => $relationsValue) { @@ -2943,7 +2953,7 @@ class Get { // do a dynamic update on the set values if (isset($relationsValue['set']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $relationsValue['set'] )) { @@ -2953,7 +2963,7 @@ class Get } // check that the arrays are set if (!isset($this->fieldRelations[$view->name_list_code][(int) $relationsValue['listfield']]) - || !ComponentbuilderHelper::checkArray( + || !ArrayHelper::check( $this->fieldRelations[$view->name_list_code][(int) $relationsValue['listfield']] )) { @@ -2965,7 +2975,7 @@ class Get = $relationsValue; // load the list joints if (isset($relationsValue['joinfields']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $relationsValue['joinfields'] )) { @@ -2977,7 +2987,7 @@ class Get } // set header over-ride if (isset($relationsValue['column_name']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $relationsValue['column_name'] )) { @@ -2988,10 +2998,10 @@ class Get if ('default' !== $check_column_name) { $column_name_lang = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $view->name_list_code, 'U' ) . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $relationsValue['column_name'], 'U' ); $this->setLangContent( @@ -3011,9 +3021,9 @@ class Get $this->linkedAdminViews[$view->name_single_code] = null; $view->addlinked_views = (isset($view->addlinked_views) - && ComponentbuilderHelper::checkJson($view->addlinked_views)) + && JsonHelper::check($view->addlinked_views)) ? json_decode($view->addlinked_views, true) : null; - if (ComponentbuilderHelper::checkArray($view->addlinked_views)) + if (ArrayHelper::check($view->addlinked_views)) { // setup linked views to global data sets $this->linkedAdminViews[$view->name_single_code] = array_values( @@ -3040,7 +3050,7 @@ class Get { if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1 - && ComponentbuilderHelper::checkString($view->$scripter)) + && StringHelper::check($view->$scripter)) { $scripter_target = str_replace( 'javascript_', '', $scripter @@ -3079,7 +3089,7 @@ class Get { if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1 - && ComponentbuilderHelper::checkString($view->{$scripter})) + && StringHelper::check($view->{$scripter})) { $this->setCustomScriptBuilder( $view->{$scripter}, @@ -3143,7 +3153,7 @@ class Get foreach ($button_code_array as $button_code_field) { if (isset($view->{$button_code_field}) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view->{$button_code_field} )) { @@ -3165,9 +3175,9 @@ class Get } // set the button array $view->custom_button = (isset($view->custom_button) - && ComponentbuilderHelper::checkJson($view->custom_button)) + && JsonHelper::check($view->custom_button)) ? json_decode($view->custom_button, true) : null; - if (ComponentbuilderHelper::checkArray($view->custom_button)) + if (ArrayHelper::check($view->custom_button)) { $view->custom_buttons = array_values($view->custom_button); } @@ -3234,9 +3244,9 @@ class Get } // check if controller input as been set $view->ajax_input = (isset($view->ajax_input) - && ComponentbuilderHelper::checkJson($view->ajax_input)) + && JsonHelper::check($view->ajax_input)) ? json_decode($view->ajax_input, true) : null; - if (ComponentbuilderHelper::checkArray($view->ajax_input)) + if (ArrayHelper::check($view->ajax_input)) { if ($addAjaxSite) { @@ -3248,7 +3258,7 @@ class Get $this->addAjax = true; unset($view->ajax_input); } - if (ComponentbuilderHelper::checkString($view->php_ajaxmethod)) + if (StringHelper::check($view->php_ajaxmethod)) { // make sure we are still in PHP $guiMapper['type'] = 'php'; @@ -3284,7 +3294,7 @@ class Get && isset($view->alias_builder_type) && 2 == $view->alias_builder_type && isset($view->alias_builder) - && ComponentbuilderHelper::checkJson($view->alias_builder)) + && JsonHelper::check($view->alias_builder)) { // get the aliasFields $alias_fields = (array) json_decode($view->alias_builder, true); @@ -3301,7 +3311,7 @@ class Get } ); // check if all is well - if (ComponentbuilderHelper::checkArray($alias_fields)) + if (ArrayHelper::check($alias_fields)) { // load the field names $this->customAliasBuilder[$view->name_single_code] @@ -3350,7 +3360,7 @@ class Get ) { if (isset($view->{'mysql_table_' . $_mysqlTableKey}) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view->{'mysql_table_' . $_mysqlTableKey} ) && !is_numeric($view->{'mysql_table_' . $_mysqlTableKey})) @@ -3426,10 +3436,10 @@ class Get $view = $this->db->loadObject(); // fix alias to use in code $view->code = $this->uniqueCode( - ComponentbuilderHelper::safeString($view->codename) + StringHelper::safe($view->codename) ); - $view->Code = ComponentbuilderHelper::safeString($view->code, 'F'); - $view->CODE = ComponentbuilderHelper::safeString($view->code, 'U'); + $view->Code = StringHelper::safe($view->code, 'F'); + $view->CODE = StringHelper::safe($view->code, 'U'); // Trigger Event: jcb_ce_onBeforeModelCustomViewData $this->triggerEvent( 'jcb_ce_onBeforeModelCustomViewData', @@ -3477,7 +3487,7 @@ class Get ); // load context if not set if (!isset($view->context) - || !ComponentbuilderHelper::checkString( + || !StringHelper::check( $view->context )) { @@ -3486,7 +3496,7 @@ class Get else { // always make sure context is a safe string - $view->context = ComponentbuilderHelper::safeString($view->context); + $view->context = StringHelper::safe($view->context); } // load the library if (!isset($this->libManager[$this->target])) @@ -3498,12 +3508,12 @@ class Get $this->libManager[$this->target][$view->code] = array(); } // make sure json become array - if (ComponentbuilderHelper::checkJson($view->libraries)) + if (JsonHelper::check($view->libraries)) { $view->libraries = json_decode($view->libraries, true); } // if we have an array add it - if (ComponentbuilderHelper::checkArray($view->libraries)) + if (ArrayHelper::check($view->libraries)) { foreach ($view->libraries as $library) { @@ -3585,7 +3595,7 @@ class Get { if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1 - && ComponentbuilderHelper::checkString($view->$scripter)) + && StringHelper::check($view->$scripter)) { // css does not get placholders yet if (strpos($scripter, 'css') === false) @@ -3676,9 +3686,9 @@ class Get $setAjax = false; // check if controller input as been set $view->ajax_input = (isset($view->ajax_input) - && ComponentbuilderHelper::checkJson($view->ajax_input)) + && JsonHelper::check($view->ajax_input)) ? json_decode($view->ajax_input, true) : null; - if (ComponentbuilderHelper::checkArray($view->ajax_input)) + if (ArrayHelper::check($view->ajax_input)) { $this->customScriptBuilder[$target]['ajax_controller'][$view->code] = array_values($view->ajax_input); @@ -3686,7 +3696,7 @@ class Get } unset($view->ajax_input); // load the ajax class mathods (if set) - if (ComponentbuilderHelper::checkString($view->php_ajaxmethod)) + if (StringHelper::check($view->php_ajaxmethod)) { // set field $guiMapper['field'] = 'php_ajaxmethod'; @@ -3726,7 +3736,7 @@ class Get foreach ($button_code_array as $button_code_field) { if (isset($view->{$button_code_field}) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view->{$button_code_field} )) { @@ -3742,9 +3752,9 @@ class Get } // set the button array $view->custom_button = (isset($view->custom_button) - && ComponentbuilderHelper::checkJson($view->custom_button)) + && JsonHelper::check($view->custom_button)) ? json_decode($view->custom_button, true) : null; - if (ComponentbuilderHelper::checkArray($view->custom_button)) + if (ArrayHelper::check($view->custom_button)) { $view->custom_buttons = array_values($view->custom_button); } @@ -3843,10 +3853,10 @@ class Get $validationRule = ComponentbuilderHelper::getBetween( $field->xml, 'validate="', '"' ); - if (ComponentbuilderHelper::checkString($validationRule)) + if (StringHelper::check($validationRule)) { // make sure it is lowercase - $validationRule = ComponentbuilderHelper::safeString( + $validationRule = StringHelper::safe( $validationRule ); // link this field to this validation @@ -3867,7 +3877,7 @@ class Get { // get the class methods for this rule if it exists if ($this->validationRules[$validationRule] - = ComponentbuilderHelper::getVar( + = GetHelper::var( 'validation_rule', $validationRule, 'name', 'php' )) @@ -3885,7 +3895,7 @@ class Get array( 'table' => 'validation_rule', 'field' => 'php', - 'id' => ComponentbuilderHelper::getVar( + 'id' => GetHelper::var( 'validation_rule', $validationRule, 'name', 'id' ), @@ -3909,9 +3919,9 @@ class Get // load the type values form type params $field->properties = (isset($field->properties) - && ComponentbuilderHelper::checkJson($field->properties)) + && JsonHelper::check($field->properties)) ? json_decode($field->properties, true) : null; - if (ComponentbuilderHelper::checkArray($field->properties)) + if (ArrayHelper::check($field->properties)) { $field->properties = array_values($field->properties); } @@ -3938,15 +3948,15 @@ class Get } // check if we have better encryption elseif (6 == $field->store - && ComponentbuilderHelper::checkString( + && StringHelper::check( $field->on_get_model_field ) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $field->on_save_model_field )) { // add only if string lenght found - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $field->initiator_on_save_model )) { @@ -3963,7 +3973,7 @@ class Get ) ); } - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $field->initiator_on_save_model )) { @@ -4019,12 +4029,12 @@ class Get if ($id > 0 && isset($this->_fieldData[$id])) { // check if we should load scripts for single view - if (ComponentbuilderHelper::checkString($name_single) + if (StringHelper::check($name_single) && !isset($this->customFieldScript[$name_single][$id])) { // add_javascript_view_footer if ($this->_fieldData[$id]->add_javascript_view_footer == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->_fieldData[$id]->javascript_view_footer )) { @@ -4102,12 +4112,12 @@ class Get } } // check if we should load scripts for list views - if (ComponentbuilderHelper::checkString($name_list) + if (StringHelper::check($name_list) && !isset($this->customFieldScript[$name_list][$id])) { // add_javascript_views_footer if ($this->_fieldData[$id]->add_javascript_views_footer == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->_fieldData[$id]->javascript_views_footer )) { @@ -4240,7 +4250,7 @@ class Get } // check if value is array if (isset($field['permission']) - && !ComponentbuilderHelper::checkArray( + && !ArrayHelper::check( $field['permission'] ) && is_numeric($field['permission']) @@ -4334,7 +4344,7 @@ class Get return 'c.title'; } // set the custom code - elseif (ComponentbuilderHelper::checkArray( + elseif (ArrayHelper::check( $field['custom'] )) { @@ -4369,11 +4379,11 @@ class Get } // check that we have the poperties if (isset($field['settings']) - && ComponentbuilderHelper::checkObject( + && ObjectHelper::check( $field['settings'] ) && isset($field['settings']->properties) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $field['settings']->properties )) { @@ -4385,14 +4395,14 @@ class Get $field['settings']->type_name = 'Custom'; } // set the type name - $type_name = ComponentbuilderHelper::safeTypeName( + $type_name = TypeHelper::safe( $field['settings']->type_name ); // if custom (we must use the xml value) if (strtolower($type_name) === 'custom' || strtolower($type_name) === 'customuser') { - $type = ComponentbuilderHelper::safeTypeName( + $type = TypeHelper::safe( ComponentbuilderHelper::getBetween( $field['settings']->xml, 'type="', '"' ) @@ -4408,18 +4418,18 @@ class Get { // force the default value if (isset($property['example']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $property['example'] )) { - $type = ComponentbuilderHelper::safeTypeName( + $type = TypeHelper::safe( $property['example'] ); } // fall back on the xml settings (not ideal) else { - $type = ComponentbuilderHelper::safeTypeName( + $type = TypeHelper::safe( ComponentbuilderHelper::getBetween( $field['settings']->xml, 'type="', '"' ) @@ -4431,7 +4441,7 @@ class Get } } // check if the value is set - if (isset($type) && ComponentbuilderHelper::checkString($type)) + if (isset($type) && StringHelper::check($type)) { return $type; } @@ -4459,7 +4469,7 @@ class Get public function getFieldName(&$field, $listViewName = null, $amicably = '') { // return the unique name if already set - if (ComponentbuilderHelper::checkString($listViewName) + if (StringHelper::check($listViewName) && isset($field['hash']) && isset( $this->uniqueFieldNames[$listViewName . $amicably @@ -4476,13 +4486,13 @@ class Get return 'error'; } // set the type name - $type_name = ComponentbuilderHelper::safeTypeName( + $type_name = TypeHelper::safe( $field['settings']->type_name ); // set the name of the field - $name = ComponentbuilderHelper::safeFieldName($field['settings']->name); + $name = FieldHelper::safe($field['settings']->name); // check that we have the properties - if (ComponentbuilderHelper::checkArray($field['settings']->properties)) + if (ArrayHelper::check($field['settings']->properties)) { foreach ($field['settings']->properties as $property) { @@ -4508,7 +4518,7 @@ class Get $name = 'catid'; } // if list view name is set - if (ComponentbuilderHelper::checkString($listViewName)) + if (StringHelper::check($listViewName)) { // check if we should use another Text Name as this views name $otherName = $this->setPlaceholders( @@ -4527,23 +4537,23 @@ class Get ), $this->placeholders ); // This is to link other view category - if (ComponentbuilderHelper::checkString($otherName) - && ComponentbuilderHelper::checkString( + if (StringHelper::check($otherName) + && StringHelper::check( $otherViews ) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $otherView )) { // set other category details $this->catOtherName[$listViewName] = array( - 'name' => ComponentbuilderHelper::safeFieldName( + 'name' => FieldHelper::safe( $otherName ), - 'views' => ComponentbuilderHelper::safeString( + 'views' => StringHelper::safe( $otherViews ), - 'view' => ComponentbuilderHelper::safeString( + 'view' => StringHelper::safe( $otherView ) ); @@ -4563,7 +4573,7 @@ class Get else { // get value from xml - $xml = ComponentbuilderHelper::safeFieldName( + $xml = FieldHelper::safe( $this->setPlaceholders( ComponentbuilderHelper::getBetween( $field['settings']->xml, 'name="', '"' @@ -4571,7 +4581,7 @@ class Get ) ); // check if a value was found - if (ComponentbuilderHelper::checkString($xml)) + if (StringHelper::check($xml)) { $name = $xml; } @@ -4582,7 +4592,7 @@ class Get } } // return the value unique - if (ComponentbuilderHelper::checkString($listViewName) + if (StringHelper::check($listViewName) && isset($field['hash'])) { $this->uniqueFieldNames[$listViewName . $amicably . $field['hash']] @@ -4643,7 +4653,7 @@ class Get { $counter = 1; // set the unique name - $uniqueName = ComponentbuilderHelper::safeFieldName( + $uniqueName = FieldHelper::safe( $name . '_' . $counter ); while (isset($this->uniqueNames[$view]['names'][$uniqueName])) @@ -4651,7 +4661,7 @@ class Get // increment the number $counter++; // try again - $uniqueName = ComponentbuilderHelper::safeFieldName( + $uniqueName = FieldHelper::safe( $name . '_' . $counter ); } @@ -4677,10 +4687,10 @@ class Get */ public function setGetData($ids, $view_code, $context) { - if (ComponentbuilderHelper::checkArray($ids)) + if (ArrayHelper::check($ids)) { $ids = implode(',', $ids); - if (ComponentbuilderHelper::checkString($ids)) + if (StringHelper::check($ids)) { // Create a new query object. $query = $this->db->getQuery(true); @@ -4712,7 +4722,7 @@ class Get $guiMapper['id'] = (int) $result->id; // add calculations if set if ($result->addcalculation == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $result->php_calculation )) { @@ -4730,7 +4740,7 @@ class Get if (isset($result->add_php_router_parse) && $result->add_php_router_parse == 1 && isset($result->php_router_parse) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $result->php_router_parse )) { @@ -4761,7 +4771,7 @@ class Get if (isset($result->{'add_' . $script}) && $result->{'add_' . $script} == 1 && isset($result->{$script}) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $result->{$script} )) { @@ -4810,7 +4820,7 @@ class Get } } // set the getmethod code name - $result->key = ComponentbuilderHelper::safeString( + $result->key = StringHelper::safe( $view_code . ' ' . $result->name . ' ' . $result->id ); // reset buckets @@ -4873,7 +4883,7 @@ class Get = ComponentbuilderHelper::getBetween( $customQueryString, '$query->from(', ')' ); - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $_searchQuery ) && strpos($_searchQuery, '#__') !== false) @@ -4882,7 +4892,7 @@ class Get = ComponentbuilderHelper::getBetween( $_searchQuery, '#__', "'" ); - if (!ComponentbuilderHelper::checkString( + if (!StringHelper::check( $_queryName )) { @@ -4894,7 +4904,7 @@ class Get } // set to blank if not found if (!isset($_queryName) - || !ComponentbuilderHelper::checkString( + || !StringHelper::check( $_queryName )) { @@ -4920,7 +4930,7 @@ class Get $result->join_view_table = json_decode( $result->join_view_table, true ); - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $result->join_view_table )) { @@ -4957,7 +4967,7 @@ class Get $result->join_view_table as $nr => &$option ) { - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $option['selection'] )) { @@ -5019,7 +5029,7 @@ class Get $result->join_db_table = json_decode( $result->join_db_table, true ); - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $result->join_db_table )) { @@ -5057,7 +5067,7 @@ class Get $result->join_db_table as $nr => &$option1 ) { - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $option1['selection'] )) { @@ -5119,7 +5129,7 @@ class Get $result->filter = json_decode( $result->filter, true ); - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $result->filter )) { @@ -5145,7 +5155,7 @@ class Get } // set where details $result->where = json_decode($result->where, true); - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $result->where )) { @@ -5168,7 +5178,7 @@ class Get } // set order details $result->order = json_decode($result->order, true); - if (!ComponentbuilderHelper::checkArray( + if (!ArrayHelper::check( $result->order )) { @@ -5176,7 +5186,7 @@ class Get } // set grouping $result->group = json_decode($result->group, true); - if (!ComponentbuilderHelper::checkArray( + if (!ArrayHelper::check( $result->group )) { @@ -5186,7 +5196,7 @@ class Get $result->global = json_decode( $result->global, true ); - if (!ComponentbuilderHelper::checkArray( + if (!ArrayHelper::check( $result->global )) { @@ -5206,7 +5216,7 @@ class Get } // load the events if any is set if ($result->gettype == 1 - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $result->plugin_events )) { @@ -5257,7 +5267,7 @@ class Get ) { // only load if we have a string - if (!ComponentbuilderHelper::checkString($script)) + if (!StringHelper::check($script)) { return false; } @@ -5308,7 +5318,7 @@ class Get $script = $this->setDynamicValues($script); } // check if we still have a string - if (ComponentbuilderHelper::checkString($script)) + if (StringHelper::check($script)) { // now load the placeholder snippet if needed if ($base64 || $dynamic) @@ -5387,7 +5397,7 @@ class Get $script = ''; // check if there is any custom script if (isset($this->customScriptBuilder[$first][$second]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->customScriptBuilder[$first][$second] )) { @@ -5409,7 +5419,7 @@ class Get } } // if not found return default - if (!ComponentbuilderHelper::checkString($script) && $default) + if (!StringHelper::check($script) && $default) { return $default; } @@ -5427,7 +5437,7 @@ class Get */ public function setSqlTweaking($settings) { - if (ComponentbuilderHelper::checkArray($settings)) + if (ArrayHelper::check($settings)) { foreach ($settings as $setting) { @@ -5474,12 +5484,12 @@ class Get } } } - if (ComponentbuilderHelper::checkArray($id_array_new)) + if (ArrayHelper::check($id_array_new)) { $id_array = array_merge($id_array_new, $id_array); } // final fixing to array - if (ComponentbuilderHelper::checkArray($id_array)) + if (ArrayHelper::check($id_array)) { // uniqe $id_array = array_unique($id_array, SORT_NUMERIC); @@ -5518,8 +5528,8 @@ class Get ) { // check if there were new items added - if (ComponentbuilderHelper::checkArray($new) - && ComponentbuilderHelper::checkArray($old)) + if (ArrayHelper::check($new) + && ArrayHelper::check($old)) { // check if this is old repeatable field if (isset($new[$type])) @@ -5528,7 +5538,7 @@ class Get { $newItem = true; // check if this is an id to ignore - if (ComponentbuilderHelper::checkArray($ignore) + if (ArrayHelper::check($ignore) && in_array( $item, $ignore )) @@ -5538,7 +5548,7 @@ class Get } // check if this is old repeatable field elseif (isset($old[$type]) - && ComponentbuilderHelper::checkArray($old[$type])) + && ArrayHelper::check($old[$type])) { if (!in_array($item, $old[$type])) { @@ -5589,7 +5599,7 @@ class Get // search to see if this is a new value $newItem = true; // check if this is an id to ignore - if (ComponentbuilderHelper::checkArray($ignore) + if (ArrayHelper::check($ignore) && in_array($item[$type], $ignore)) { // don't add ignored ids @@ -5597,7 +5607,7 @@ class Get } // check if this is old repeatable field elseif (isset($old[$type]) - && ComponentbuilderHelper::checkArray($old[$type])) + && ArrayHelper::check($old[$type])) { if (in_array($item[$type], $old[$type])) { @@ -5639,14 +5649,14 @@ class Get } } elseif ($key - && ((ComponentbuilderHelper::checkString($new) - && ComponentbuilderHelper::checkString($old)) + && ((StringHelper::check($new) + && StringHelper::check($old)) || (is_numeric($new) && is_numeric($old))) && $new !== $old) { // the string changed, lets add to SQL update if (!isset($this->updateSQL[$type]) - || !ComponentbuilderHelper::checkArray($this->updateSQL[$type])) + || !ArrayHelper::check($this->updateSQL[$type])) { $this->updateSQL[$type] = array(); } @@ -5668,7 +5678,7 @@ class Get { // we have a new item, lets add to SQL if (!isset($this->addSQL[$type]) - || !ComponentbuilderHelper::checkArray( + || !ArrayHelper::check( $this->addSQL[$type] )) { @@ -5678,7 +5688,7 @@ class Get if ($key) { if (!isset($this->addSQL[$type][$key]) - || !ComponentbuilderHelper::checkArray( + || !ArrayHelper::check( $this->addSQL[$type][$key] )) { @@ -5691,7 +5701,7 @@ class Get // convert adminview id to name if ('adminview' === $type) { - $this->addSQL[$type][] = ComponentbuilderHelper::safeString( + $this->addSQL[$type][] = StringHelper::safe( $this->getAdminViewData($item)->name_single ); } @@ -5802,7 +5812,7 @@ class Get protected function setHistoryWatch($object, $action) { // check the note - if (ComponentbuilderHelper::checkJson($object->version_note)) + if (JsonHelper::check($object->version_note)) { $version_note = json_decode($object->version_note, true); } @@ -5846,7 +5856,7 @@ class Get } // check if we need to still keep this locked if (isset($version_note['component']) - && ComponentbuilderHelper::checkArray($version_note['component'])) + && ArrayHelper::check($version_note['component'])) { // insure component ids are only added once per item $version_note['component'] = array_unique( @@ -5885,7 +5895,7 @@ class Get // to check inside the templates $again = array(); // check if template keys were passed - if (!ComponentbuilderHelper::checkArray($templates)) + if (!ArrayHelper::check($templates)) { // set the Template data $temp1 = ComponentbuilderHelper::getAllBetween( @@ -5894,25 +5904,25 @@ class Get $temp2 = ComponentbuilderHelper::getAllBetween( $default, '$this->loadTemplate("', '")' ); - if (ComponentbuilderHelper::checkArray($temp1) - && ComponentbuilderHelper::checkArray($temp2)) + if (ArrayHelper::check($temp1) + && ArrayHelper::check($temp2)) { $templates = array_merge($temp1, $temp2); } else { - if (ComponentbuilderHelper::checkArray($temp1)) + if (ArrayHelper::check($temp1)) { $templates = $temp1; } - elseif (ComponentbuilderHelper::checkArray($temp2)) + elseif (ArrayHelper::check($temp2)) { $templates = $temp2; } } } // check if we found templates - if (ComponentbuilderHelper::checkArray($templates, true)) + if (ArrayHelper::check($templates, true)) { foreach ($templates as $template) { @@ -5924,7 +5934,7 @@ class Get $data = $this->getDataWithAlias( $template, 'template', $view ); - if (ComponentbuilderHelper::checkArray($data)) + if (ArrayHelper::check($data)) { // load it to the template data array $this->templateData[$this->target][$view][$template] @@ -5944,7 +5954,7 @@ class Get } } // check if layout keys were passed - if (!ComponentbuilderHelper::checkArray($layouts)) + if (!ArrayHelper::check($layouts)) { // set the Layout data $lay1 = ComponentbuilderHelper::getAllBetween( @@ -5953,25 +5963,25 @@ class Get $lay2 = ComponentbuilderHelper::getAllBetween( $default, 'JLayoutHelper::render("', '",' ); - if (ComponentbuilderHelper::checkArray($lay1) - && ComponentbuilderHelper::checkArray($lay2)) + if (ArrayHelper::check($lay1) + && ArrayHelper::check($lay2)) { $layouts = array_merge($lay1, $lay2); } else { - if (ComponentbuilderHelper::checkArray($lay1)) + if (ArrayHelper::check($lay1)) { $layouts = $lay1; } - elseif (ComponentbuilderHelper::checkArray($lay2)) + elseif (ArrayHelper::check($lay2)) { $layouts = $lay2; } } } // check if we found layouts - if (ComponentbuilderHelper::checkArray($layouts, true)) + if (ArrayHelper::check($layouts, true)) { // get the other target if both $_target = null; @@ -5982,7 +5992,7 @@ class Get foreach ($layouts as $layout) { if (!isset($this->layoutData[$this->target]) - || !ComponentbuilderHelper::checkArray( + || !ArrayHelper::check( $this->layoutData[$this->target] ) || !array_key_exists( @@ -5990,7 +6000,7 @@ class Get )) { $data = $this->getDataWithAlias($layout, 'layout', $view); - if (ComponentbuilderHelper::checkArray($data)) + if (ArrayHelper::check($data)) { // load it to the layout data array $this->layoutData[$this->target][$layout] = $data; @@ -6013,7 +6023,7 @@ class Get } } // check again - if (ComponentbuilderHelper::checkArray($again)) + if (ArrayHelper::check($again)) { foreach ($again as $go) { @@ -6074,7 +6084,7 @@ class Get // we load this layout $php_view = ''; if ($row->add_php_view == 1 - && ComponentbuilderHelper::checkString($row->php_view)) + && StringHelper::check($row->php_view)) { $php_view = $this->setGuiCodePlaceholder( $this->setDynamicValues(base64_decode($row->php_view)), @@ -6106,12 +6116,12 @@ class Get $this->libManager[$_target][$view] = array(); } // make sure json become array - if (ComponentbuilderHelper::checkJson($row->libraries)) + if (JsonHelper::check($row->libraries)) { $row->libraries = json_decode($row->libraries, true); } // if we have an array add it - if (ComponentbuilderHelper::checkArray($row->libraries)) + if (ArrayHelper::check($row->libraries)) { foreach ($row->libraries as $library) { @@ -6234,12 +6244,12 @@ class Get $this->db->setQuery($query); $rows = $this->db->loadObjectList(); // check if we have an array - if (ComponentbuilderHelper::checkArray($rows)) + if (ArrayHelper::check($rows)) { foreach ($rows as $row) { // build the key - $k_ey = ComponentbuilderHelper::safeString($row->alias); + $k_ey = StringHelper::safe($row->alias); $key = preg_replace("/[^A-Za-z]/", '', $k_ey); // set the keys $this->dataWithAliasKeys[$table][$row->alias] = $row->id; @@ -6371,7 +6381,7 @@ class Get 6 => array('footableVersion' => 3, 'footable' => true)); if (isset($buildin[$library->id]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $buildin[$library->id] )) { @@ -6404,16 +6414,16 @@ class Get $library->{'add' . $addTarget} = (isset( $library->{'add' . $addTarget} ) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $library->{'add' . $addTarget} )) ? json_decode($library->{'add' . $addTarget}, true) : null; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $library->{'add' . $addTarget} )) { if (isset($library->{$targetHere}) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $library->{$targetHere} )) { @@ -6436,10 +6446,10 @@ class Get { // set the config data $library->addconfig = (isset($library->addconfig) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $library->addconfig )) ? json_decode($library->addconfig, true) : null; - if (ComponentbuilderHelper::checkArray($library->addconfig)) + if (ArrayHelper::check($library->addconfig)) { $library->config = array_map( function ($array) { @@ -6459,7 +6469,7 @@ class Get { // set Needed PHP if (isset($library->php_setdocument) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $library->php_setdocument )) { @@ -6480,10 +6490,10 @@ class Get { // set the addconditions data $library->addconditions = (isset($library->addconditions) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $library->addconditions )) ? json_decode($library->addconditions, true) : null; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $library->addconditions )) { @@ -6534,7 +6544,7 @@ class Get } ); // check if we should continue - if (ComponentbuilderHelper::checkArray($langStringTargets)) + if (ArrayHelper::check($langStringTargets)) { // insure string is not broken $content = $this->setPlaceholders($content, $this->placeholders); @@ -6554,15 +6564,15 @@ class Get $content, 'Joomla' . '.JText._("', '"' ); // combine into one array - $jsTEXT = ComponentbuilderHelper::mergeArrays($jsTEXT); + $jsTEXT = ArrayHelper::merge($jsTEXT); // we need to add a check to insure these JavaScript lang matchup - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $jsTEXT )) //<-- not really needed hmmm { // load the JS text to mismatch array $langCheck[] = $jsTEXT; - $this->langMismatch = ComponentbuilderHelper::mergeArrays( + $this->langMismatch = ArrayHelper::merge( array($jsTEXT, $this->langMismatch) ); } @@ -6577,13 +6587,13 @@ class Get $content, 'JText:' . ':script("', '"' ); // combine into one array - $scTEXT = ComponentbuilderHelper::mergeArrays($scTEXT); + $scTEXT = ArrayHelper::merge($scTEXT); // we need to add a check to insure these JavaScript lang matchup - if (ComponentbuilderHelper::checkArray($scTEXT)) + if (ArrayHelper::check($scTEXT)) { // load the Script text to match array $langCheck[] = $scTEXT; - $this->langMatch = ComponentbuilderHelper::mergeArrays( + $this->langMatch = ArrayHelper::merge( array($scTEXT, $this->langMatch) ); } @@ -6598,7 +6608,7 @@ class Get $content, 'JustTEXT:' . ':_("', '")' ); // merge lang only - $langOnly = ComponentbuilderHelper::mergeArrays($langOnly); + $langOnly = ArrayHelper::merge($langOnly); } // set language data foreach ($langStringTargets as $langStringTarget) @@ -6618,8 +6628,8 @@ class Get ); } // the normal loading of the language strings - $langCheck = ComponentbuilderHelper::mergeArrays($langCheck); - if (ComponentbuilderHelper::checkArray( + $langCheck = ArrayHelper::merge($langCheck); + if (ArrayHelper::check( $langCheck )) //<-- not really needed hmmm { @@ -6646,7 +6656,7 @@ class Get } } // the uppercase loading only (for arrays and other tricks) - if (ComponentbuilderHelper::checkArray($langOnly)) + if (ArrayHelper::check($langOnly)) { foreach ($langOnly as $string) { @@ -6661,7 +6671,7 @@ class Get } } // only continue if we have value to replace - if (ComponentbuilderHelper::checkArray($langHolders)) + if (ArrayHelper::check($langHolders)) { $content = $this->setPlaceholders($content, $langHolders); } @@ -6681,13 +6691,13 @@ class Get public function setLang($string) { // this is there to insure we dont break already added Language strings - if (ComponentbuilderHelper::safeString($string, 'U', '_', false, false) + if (StringHelper::safe($string, 'U', '_', false, false) === $string) { return false; } // build lang key - $keyLang = $this->langPrefix . '_' . ComponentbuilderHelper::safeString( + $keyLang = $this->langPrefix . '_' . StringHelper::safe( $string, 'U' ); // set the language string @@ -6714,7 +6724,7 @@ class Get $as, $row_type, $type ) { - if (ComponentbuilderHelper::checkString($string)) + if (StringHelper::check($string)) { if ('db' === $type) { @@ -6754,7 +6764,7 @@ class Get $lines = explode(PHP_EOL, $string); } // only continue if lines are available - if (ComponentbuilderHelper::checkArray($lines)) + if (ArrayHelper::check($lines)) { $gets = array(); $keys = array(); @@ -6787,10 +6797,10 @@ class Get $key = $view . '_' . trim($key); } // continue only if we have get - if (ComponentbuilderHelper::checkString($get)) + if (StringHelper::check($get)) { $gets[] = $this->db->quote($get); - if (ComponentbuilderHelper::checkString($key)) + if (StringHelper::check($key)) { $this->getAsLookup[$method_key][$get] = $key; $keys[] @@ -6810,7 +6820,7 @@ class Get ); } // make sure we have the view name - if (ComponentbuilderHelper::checkString($view)) + if (StringHelper::check($view)) { // prep the field name $field = str_replace($as . '.', '', $get); @@ -6827,8 +6837,8 @@ class Get } } } - if (ComponentbuilderHelper::checkArray($gets) - && ComponentbuilderHelper::checkArray($keys)) + if (ArrayHelper::check($gets) + && ArrayHelper::check($keys)) { // single joined selection needs the prefix to the values to avoid conflict in the names // so we must still add then AS @@ -6879,7 +6889,7 @@ class Get $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); $this->db->setQuery($query); - return ComponentbuilderHelper::safeString($this->db->loadResult()); + return StringHelper::safe($this->db->loadResult()); } /** @@ -6895,7 +6905,7 @@ class Get public function buildSqlDump($tables, $view, $view_id) { // first build a query statment to get all the data (insure it must be added - check the tweaking) - if (ComponentbuilderHelper::checkArray($tables) + if (ArrayHelper::check($tables) && (!isset($this->sqlTweak[$view_id]['remove']) || !$this->sqlTweak[$view_id]['remove'])) { @@ -6914,7 +6924,7 @@ class Get if (strpos($table['sourcemap'], PHP_EOL) !== false) { $fields = explode(PHP_EOL, $table['sourcemap']); - if (ComponentbuilderHelper::checkArray($fields)) + if (ArrayHelper::check($fields)) { // reset array buckets $sourceArray = array(); @@ -6932,10 +6942,10 @@ class Get $targetArray[] = trim($target); } } - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $sourceArray ) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $targetArray )) { @@ -6969,7 +6979,7 @@ class Get if (strpos($table['sourcemap'], PHP_EOL) !== false) { $fields = explode(PHP_EOL, $table['sourcemap']); - if (ComponentbuilderHelper::checkArray($fields)) + if (ArrayHelper::check($fields)) { // reset array buckets $sourceArray = array(); @@ -7004,10 +7014,10 @@ class Get ); } } - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $sourceArray ) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $targetArray )) { @@ -7119,12 +7129,12 @@ class Get public function mysql_escape($value) { // if array then return maped - if (ComponentbuilderHelper::checkArray($value)) + if (ArrayHelper::check($value)) { return array_map(__METHOD__, $value); } // if string make sure it is correctly escaped - if (ComponentbuilderHelper::checkString($value) && !is_numeric($value)) + if (StringHelper::check($value) && !is_numeric($value)) { return $this->db->quote($value); } @@ -7267,7 +7277,7 @@ class Get */ public function setDynamicValues($string, $debug = 0) { - if (ComponentbuilderHelper::checkString($string)) + if (StringHelper::check($string)) { $string = $this->setLangStrings( $this->setCustomCodeData( @@ -7309,7 +7319,7 @@ class Get $found = ComponentbuilderHelper::getAllBetween( $string, '[EXTERNA' . 'LCODE=', ']' ); - if (ComponentbuilderHelper::checkArray($found)) + if (ArrayHelper::check($found)) { // build local bucket foreach ($found as $target) @@ -7365,7 +7375,7 @@ class Get } } // now update local string if bucket has values - if (ComponentbuilderHelper::checkArray($bucket)) + if (ArrayHelper::check($bucket)) { $string = $this->setPlaceholders($string, $bucket); } @@ -7423,14 +7433,14 @@ class Get ); } // did we get any value - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $this->externalCodeString[$target_key] )) { // check for changes $live_hash = md5($this->externalCodeString[$target_key]); // check if it exists local - if ($hash = ComponentbuilderHelper::getVar( + if ($hash = GetHelper::var( 'external_code', $target_key, 'target', 'hash' )) { @@ -7562,7 +7572,7 @@ class Get // get the cutting sequence $cutter = (array) explode('|', $sequence); // we only continue if we have more rows than we have to cut - if (array_sum($cutter) < ComponentbuilderHelper::checkArray($rows)) + if (array_sum($cutter) < ArrayHelper::check($rows)) { // remove the rows at the bottom if needed if (isset($cutter[1]) && $cutter[1] > 0) @@ -7621,7 +7631,7 @@ class Get $found = ComponentbuilderHelper::getAllBetween( $string, '[CUSTO' . 'MCODE=', ']' ); - if (ComponentbuilderHelper::checkArray($found)) + if (ArrayHelper::check($found)) { foreach ($found as $key) { @@ -7636,7 +7646,7 @@ class Get { $id = (int) $key; } - elseif (ComponentbuilderHelper::checkString($key) + elseif (StringHelper::check($key) && strpos( $key, '+' ) === false) @@ -7644,7 +7654,7 @@ class Get $getFuncName = trim($key); if (!isset($this->functionNameMemory[$getFuncName])) { - if (!$found_local = ComponentbuilderHelper::getVar( + if (!$found_local = GetHelper::var( 'custom_code', $getFuncName, 'function_name', 'id' )) @@ -7656,7 +7666,7 @@ class Get } $id = (int) $this->functionNameMemory[$getFuncName]; } - elseif (ComponentbuilderHelper::checkString($key) + elseif (StringHelper::check($key) && strpos( $key, '+' ) !== false) @@ -7667,13 +7677,13 @@ class Get { $id = (int) $array[0]; } - elseif (ComponentbuilderHelper::checkString($array[0])) + elseif (StringHelper::check($array[0])) { $getFuncName = trim($array[0]); if (!isset($this->functionNameMemory[$getFuncName])) { if (!$found_local - = ComponentbuilderHelper::getVar( + = GetHelper::var( 'custom_code', $getFuncName, 'function_name', 'id' )) @@ -7712,7 +7722,7 @@ class Get }, (array) explode(',', $array[1]) ); } - elseif (ComponentbuilderHelper::checkString( + elseif (StringHelper::check( $array[1] )) { @@ -7747,7 +7757,7 @@ class Get var_dump($bucket); } // check if any custom code placeholders where found - if (ComponentbuilderHelper::checkArray($bucket)) + if (ArrayHelper::check($bucket)) { $_tmpLang = $this->lang; // insure we add the langs to both site and admin @@ -7824,7 +7834,7 @@ class Get { // check if there is args for this code if (isset($this->customCodeData[$item['id']]['args']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customCodeData[$item['id']]['args'] )) { @@ -7899,7 +7909,7 @@ class Get { // aways fist reset these $this->clearFromPlaceHolders($key); - if (ComponentbuilderHelper::checkArray($values)) + if (ArrayHelper::check($values)) { $number = 0; foreach ($values as $value) @@ -7956,7 +7966,7 @@ class Get '#__componentbuilder_language_translation', 'a' ) ); - if (ComponentbuilderHelper::checkArray($values)) + if (ArrayHelper::check($values)) { $query->select( $this->db->quoteName( @@ -8007,12 +8017,12 @@ class Get // to keep or remove $remove = false; // build the translations - if (ComponentbuilderHelper::checkString($string) + if (StringHelper::check($string) && isset($this->multiLangString[$string])) { // make sure we have converted the string to array if (isset($this->multiLangString[$string]['translation']) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $this->multiLangString[$string]['translation'] )) { @@ -8023,7 +8033,7 @@ class Get } // if we have an array continue if (isset($this->multiLangString[$string]['translation']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->multiLangString[$string]['translation'] )) { @@ -8059,14 +8069,14 @@ class Get } } // do the database management - if (ComponentbuilderHelper::checkString($string) + if (StringHelper::check($string) && ($key = array_search($string, $strings)) !== false) { if (isset($this->multiLangString[$string])) { // update the existing placeholder in db $id = $this->multiLangString[$string]['id']; - if (ComponentbuilderHelper::checkJson( + if (JsonHelper::check( $this->multiLangString[$string][$target] )) { @@ -8323,7 +8333,7 @@ class Get $today = JFactory::getDate()->toSql(); foreach ($otherStrings as $item) { - if (ComponentbuilderHelper::checkJson($item[$target])) + if (JsonHelper::check($item[$target])) { $targets = (array) json_decode($item[$target], true); // if component is not found ignore this string, and do nothing @@ -8333,7 +8343,7 @@ class Get // first remove the component from the string unset($targets[$key]); // check if there are more components - if (ComponentbuilderHelper::checkArray($targets)) + if (ArrayHelper::check($targets)) { // just update the string to unlink the current component $this->setUpdateExistingLangStrings( @@ -8356,7 +8366,7 @@ class Get { // just one linked extension type is enough to stop the search if ($action_with_string - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $item[$other_target] )) { @@ -8364,7 +8374,7 @@ class Get $item[$other_target], true ); // check if linked to other extensions - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $other_targets )) { @@ -8375,14 +8385,14 @@ class Get } // check we should just archive or remove string if ($action_with_string - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $item['translation'] )) { $translation = json_decode( $item['translation'], true ); - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $translation )) { @@ -8468,7 +8478,7 @@ class Get $query->from( $this->db->quoteName('#__componentbuilder_custom_code', 'a') ); - if (ComponentbuilderHelper::checkArray($ids)) + if (ArrayHelper::check($ids)) { if ($idArray = $this->checkCustomCodeMemory($ids)) { @@ -8593,7 +8603,7 @@ class Get */ protected function getPowers($ids) { - if (ComponentbuilderHelper::checkArray($ids, true)) + if (ArrayHelper::check($ids, true)) { foreach ($ids as $id) { @@ -8662,11 +8672,11 @@ class Get $this->placeholders ); // now set the code_name and class name - $power->code_name = $power->class_name = ComponentbuilderHelper::safeClassFunctionName( + $power->code_name = $power->class_name = ClassfunctionHelper::safe( $power->name ); // set official name - $power->official_name = ComponentbuilderHelper::safeString( + $power->official_name = StringHelper::safe( $power->name, 'W' ); // set namespace @@ -8694,9 +8704,9 @@ class Get // setup the path array $path_array = (array) explode('\\', $power->namespace); // make sure all sub folders in src dir is set and remove all characters that will not work in folders naming - $power->namespace = ComponentbuilderHelper::safeNamespace(str_replace('.', '\\', $power->namespace)); + $power->namespace = NamespaceHelper::safe(str_replace('.', '\\', $power->namespace)); // make sure it has two or more - if (ComponentbuilderHelper::checkArray($path_array) <= 1) + if (ArrayHelper::check($path_array) <= 1) { // we raise an error message $this->app->enqueueMessage( @@ -8750,10 +8760,10 @@ class Get } // make sure the arrays are namespace safe $path_array = array_map(function ($val) { - return ComponentbuilderHelper::safeNamespace($val); + return NamespaceHelper::safe($val); }, $path_array); $namespace_array = array_map(function ($val) { - return ComponentbuilderHelper::safeNamespace($val); + return NamespaceHelper::safe($val); }, $namespace_array); // set the actual class namespace $power->_namespace = implode('\\', $namespace_array); @@ -8763,11 +8773,11 @@ class Get $prefix_folder = implode('.', $path_array); // make sub folders if still found $sub_folder = ''; - if (ComponentbuilderHelper::checkArray($src_array)) + if (ArrayHelper::check($src_array)) { // make sure the arrays are namespace safe $sub_folder = '/' . implode('/', array_map(function ($val) { - return ComponentbuilderHelper::safeNamespace($val); + return NamespaceHelper::safe($val); }, $src_array)); } // now we set the paths @@ -8779,7 +8789,7 @@ class Get $use = array(); // check if we have use selection $power->use_selection = (isset($power->use_selection) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $power->use_selection )) ? json_decode($power->use_selection, true) : null; if ($power->use_selection) @@ -8790,7 +8800,7 @@ class Get } // check if we have load selection $power->load_selection = (isset($power->load_selection) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $power->load_selection )) ? json_decode($power->load_selection, true) : null; if ($power->load_selection) @@ -8805,7 +8815,7 @@ class Get $power->implement_names = array(); // does this implement $power->implements = (isset($power->implements) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $power->implements )) ? json_decode($power->implements, true) : null; if ($power->implements) @@ -8813,7 +8823,7 @@ class Get foreach ($power->implements as $implement) { if ($implement == -1 - && ComponentbuilderHelper::checkString($power->implements_custom)) + && StringHelper::check($power->implements_custom)) { $power->implement_names[] = $this->setPlaceholders( $this->setDynamicValues($power->implements_custom), @@ -8840,7 +8850,7 @@ class Get $power->extends_name = null; // we first check for custom extending options if ($power->extends == -1 - && ComponentbuilderHelper::checkString($power->extends_custom)) + && StringHelper::check($power->extends_custom)) { $power->extends_name = $this->setPlaceholders( $this->setDynamicValues($power->extends_custom), @@ -8881,7 +8891,7 @@ class Get ) . PHP_EOL; } // now add all the extra use statements - if (ComponentbuilderHelper::checkArray($use)) + if (ArrayHelper::check($use)) { foreach (array_unique($use) as $u) { @@ -8897,12 +8907,12 @@ class Get } } // now set the description - $power->description = (ComponentbuilderHelper::checkString($power->description)) ? $this->setPlaceholders( + $power->description = (StringHelper::check($power->description)) ? $this->setPlaceholders( $this->setDynamicValues($power->description), $this->placeholders ) : ''; // add the main code if set - if (ComponentbuilderHelper::checkString($power->main_class_code)) + if (StringHelper::check($power->main_class_code)) { // set GUI mapper field $guiMapper['field'] = 'main_class_code'; @@ -8977,7 +8987,7 @@ class Get ); // set safe class function name $module->code_name - = ComponentbuilderHelper::safeClassFunctionName( + = ClassfunctionHelper::safe( $module->name ); // set module folder name @@ -9011,15 +9021,15 @@ class Get */ protected function getModuleIDs() { - if (($addjoomla_modules = ComponentbuilderHelper::getVar( + if (($addjoomla_modules = GetHelper::var( 'component_modules', $this->componentID, 'joomla_component', 'addjoomla_modules' )) !== false) { - $addjoomla_modules = (ComponentbuilderHelper::checkJson( + $addjoomla_modules = (JsonHelper::check( $addjoomla_modules )) ? json_decode($addjoomla_modules, true) : null; - if (ComponentbuilderHelper::checkArray($addjoomla_modules)) + if (ArrayHelper::check($addjoomla_modules)) { $joomla_modules = array_filter( array_values($addjoomla_modules), @@ -9034,7 +9044,7 @@ class Get } ); // if we have values we return IDs - if (ComponentbuilderHelper::checkArray($joomla_modules)) + if (ArrayHelper::check($joomla_modules)) { return array_map( function ($array) { @@ -9144,11 +9154,11 @@ class Get ); // set safe class function name $module->code_name - = ComponentbuilderHelper::safeClassFunctionName( + = ClassfunctionHelper::safe( $module->name ); // set official name - $module->official_name = ComponentbuilderHelper::safeString( + $module->official_name = StringHelper::safe( $module->name, 'W' ); // set langPrefix @@ -9197,7 +9207,7 @@ class Get ); // set description (TODO) add description field to module if (!isset($module->description) - || !ComponentbuilderHelper::checkString( + || !StringHelper::check( $module->description )) { @@ -9246,9 +9256,9 @@ class Get } // get the custom_get $module->custom_get = (isset($module->custom_get) - && ComponentbuilderHelper::checkJson($module->custom_get)) + && JsonHelper::check($module->custom_get)) ? json_decode($module->custom_get, true) : null; - if (ComponentbuilderHelper::checkArray($module->custom_get)) + if (ArrayHelper::check($module->custom_get)) { $module->custom_get = $this->setGetData( $module->custom_get, $module->key, $module->key @@ -9260,12 +9270,12 @@ class Get } // set helper class details if ($module->add_class_helper >= 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $module->class_helper_code )) { if ($module->add_class_helper_header == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $module->class_helper_header )) { @@ -9318,7 +9328,7 @@ class Get } // base64 Decode mod_code if (isset($module->mod_code) - && ComponentbuilderHelper::checkString($module->mod_code)) + && StringHelper::check($module->mod_code)) { // set GUI mapper field $guiMapper['field'] = 'mod_code'; @@ -9344,7 +9354,7 @@ class Get } // base64 Decode default header if (isset($module->default_header) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $module->default_header )) { @@ -9365,7 +9375,7 @@ class Get } // base64 Decode default if (isset($module->default) - && ComponentbuilderHelper::checkString($module->default)) + && StringHelper::check($module->default)) { // set GUI mapper field $guiMapper['field'] = 'default'; @@ -9395,9 +9405,9 @@ class Get $module->fields_rules_paths = 1; // set the fields data $module->fields = (isset($module->fields) - && ComponentbuilderHelper::checkJson($module->fields)) + && JsonHelper::check($module->fields)) ? json_decode($module->fields, true) : null; - if (ComponentbuilderHelper::checkArray($module->fields)) + if (ArrayHelper::check($module->fields)) { // ket global key $key = $module->key; @@ -9407,7 +9417,7 @@ class Get foreach ($module->fields as $n => &$form) { if (isset($form['fields']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $form['fields'] )) { @@ -9418,7 +9428,7 @@ class Get ) { if (!isset($form[$dynamic_field]) - || !ComponentbuilderHelper::checkString( + || !StringHelper::check( $form[$dynamic_field] )) { @@ -9436,7 +9446,7 @@ class Get else { $form[$dynamic_field] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $form[$dynamic_field] ); } @@ -9467,11 +9477,11 @@ class Get = $form['fields_rules_paths']; // check for extra rule paths if (isset($form['addrulepath']) - && ComponentbuilderHelper::checkArray($form['addrulepath'])) + && ArrayHelper::check($form['addrulepath'])) { foreach ($form['addrulepath'] as $add_rule_path) { - if (ComponentbuilderHelper::checkString($add_rule_path['path'])) + if (StringHelper::check($add_rule_path['path'])) { $module->add_rule_path[$unique] = $add_rule_path['path']; } @@ -9479,11 +9489,11 @@ class Get } // check for extra field paths if (isset($form['addfieldpath']) - && ComponentbuilderHelper::checkArray($form['addfieldpath'])) + && ArrayHelper::check($form['addfieldpath'])) { foreach ($form['addfieldpath'] as $add_field_path) { - if (ComponentbuilderHelper::checkString($add_field_path['path'])) + if (StringHelper::check($add_field_path['path'])) { $module->add_field_path[$unique] = $add_field_path['path']; } @@ -9491,7 +9501,7 @@ class Get } // add the label if set to lang if (isset($form['label']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $form['label'] )) { @@ -9509,7 +9519,7 @@ class Get $field, $key, $key, $unique ); // update the default if set - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $field['custom_value'] ) && isset($field['settings'])) @@ -9624,16 +9634,16 @@ class Get $module->{'add' . $addTarget} = (isset( $module->{'add' . $addTarget} ) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $module->{'add' . $addTarget} )) ? json_decode($module->{'add' . $addTarget}, true) : null; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $module->{'add' . $addTarget} )) { if (isset($module->{$targetHere}) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $module->{$targetHere} )) { @@ -9662,12 +9672,12 @@ class Get = array(); } // make sure json become array - if (ComponentbuilderHelper::checkJson($module->libraries)) + if (JsonHelper::check($module->libraries)) { $module->libraries = json_decode($module->libraries, true); } // if we have an array add it - if (ComponentbuilderHelper::checkArray($module->libraries)) + if (ArrayHelper::check($module->libraries)) { foreach ($module->libraries as $library) { @@ -9709,7 +9719,7 @@ class Get ) && $module->{'add_' . $scriptMethod . '_' . $scriptType} == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $module->{$scriptMethod . '_' . $scriptType} )) { @@ -9741,7 +9751,7 @@ class Get } // add_sql if ($module->add_sql == 1 - && ComponentbuilderHelper::checkString($module->sql)) + && StringHelper::check($module->sql)) { $module->sql = $this->setPlaceholders( $this->setDynamicValues(base64_decode($module->sql)), @@ -9755,7 +9765,7 @@ class Get } // add_sql_uninstall if ($module->add_sql_uninstall == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $module->sql_uninstall )) { @@ -9772,7 +9782,7 @@ class Get } // update the URL of the update_server if set if ($module->add_update_server == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $module->update_server_url )) { @@ -9793,7 +9803,7 @@ class Get { // get the server protocol $module->{$server . '_protocol'} - = ComponentbuilderHelper::getVar( + = GetHelper::var( 'server', (int) $module->{$server}, 'id', 'protocol' ); } @@ -9924,15 +9934,15 @@ class Get */ protected function getPluginIDs() { - if (($addjoomla_plugins = ComponentbuilderHelper::getVar( + if (($addjoomla_plugins = GetHelper::var( 'component_plugins', $this->componentID, 'joomla_component', 'addjoomla_plugins' )) !== false) { - $addjoomla_plugins = (ComponentbuilderHelper::checkJson( + $addjoomla_plugins = (JsonHelper::check( $addjoomla_plugins )) ? json_decode($addjoomla_plugins, true) : null; - if (ComponentbuilderHelper::checkArray($addjoomla_plugins)) + if (ArrayHelper::check($addjoomla_plugins)) { $joomla_plugins = array_filter( array_values($addjoomla_plugins), @@ -9947,7 +9957,7 @@ class Get } ); // if we have values we return IDs - if (ComponentbuilderHelper::checkArray($joomla_plugins)) + if (ArrayHelper::check($joomla_plugins)) { return array_map( function ($array) { @@ -10008,7 +10018,7 @@ class Get ); // update the name if it has dynamic values $plugin->code_name - = ComponentbuilderHelper::safeClassFunctionName( + = ClassfunctionHelper::safe( $plugin->name ); // set plugin folder name @@ -10136,7 +10146,7 @@ class Get ); // update the name if it has dynamic values $plugin->code_name - = ComponentbuilderHelper::safeClassFunctionName( + = ClassfunctionHelper::safe( $plugin->name ); // set official name @@ -10144,20 +10154,31 @@ class Get $plugin->group . ' - ' . $plugin->name ); // set langPrefix - $this->langPrefix = 'PLG_' . strtoupper($plugin->group) . '_' - . strtoupper($plugin->code_name); + $this->langPrefix + = PluginHelper::safeLangPrefix( + $plugin->code_name, + $plugin->group + ); // set lang prefix $plugin->lang_prefix = $this->langPrefix; // set plugin class name - $plugin->class_name = 'Plg' . ucfirst($plugin->group) . ucfirst( - $plugin->code_name - ); + $plugin->class_name + = PluginHelper::safeClassName( + $plugin->code_name, + $plugin->group + ); // set plugin install class name - $plugin->installer_class_name = 'plg' . ucfirst($plugin->group) - . ucfirst($plugin->code_name) . 'InstallerScript'; + $plugin->installer_class_name + = PluginHelper::safeInstallClassName( + $plugin->code_name, + $plugin->group + ); // set plugin folder name - $plugin->folder_name = 'plg_' . strtolower($plugin->group) . '_' - . strtolower($plugin->code_name); + $plugin->folder_name + = PluginHelper::safeFolderName( + $plugin->code_name, + $plugin->group + ); // set the zip name $plugin->zip_name = $plugin->folder_name . '_v' . str_replace( '.', '_', $plugin->plugin_version @@ -10203,7 +10224,7 @@ class Get $this->placeholders[$this->hhh . 'DESCRIPTION' . $this->hhh] = ''; if (!isset($plugin->description) - || !ComponentbuilderHelper::checkString( + || !StringHelper::check( $plugin->description )) { @@ -10329,9 +10350,9 @@ class Get $plugin->fields_rules_paths = 1; // set the fields data $plugin->fields = (isset($plugin->fields) - && ComponentbuilderHelper::checkJson($plugin->fields)) + && JsonHelper::check($plugin->fields)) ? json_decode($plugin->fields, true) : null; - if (ComponentbuilderHelper::checkArray($plugin->fields)) + if (ArrayHelper::check($plugin->fields)) { // ket global key $key = $plugin->key; @@ -10341,7 +10362,7 @@ class Get foreach ($plugin->fields as $n => &$form) { if (isset($form['fields']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $form['fields'] )) { @@ -10352,7 +10373,7 @@ class Get ) { if (!isset($form[$dynamic_field]) - || !ComponentbuilderHelper::checkString( + || !StringHelper::check( $form[$dynamic_field] )) { @@ -10370,7 +10391,7 @@ class Get else { $form[$dynamic_field] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $form[$dynamic_field] ); } @@ -10401,7 +10422,7 @@ class Get = $form['fields_rules_paths']; // add the label if set to lang if (isset($form['label']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $form['label'] )) { @@ -10410,11 +10431,11 @@ class Get } // check for extra rule paths if (isset($form['addrulepath']) - && ComponentbuilderHelper::checkArray($form['addrulepath'])) + && ArrayHelper::check($form['addrulepath'])) { foreach ($form['addrulepath'] as $add_rule_path) { - if (ComponentbuilderHelper::checkString($add_rule_path['path'])) + if (StringHelper::check($add_rule_path['path'])) { $plugin->add_rule_path[$unique] = $add_rule_path['path']; } @@ -10422,11 +10443,11 @@ class Get } // check for extra field paths if (isset($form['addfieldpath']) - && ComponentbuilderHelper::checkArray($form['addfieldpath'])) + && ArrayHelper::check($form['addfieldpath'])) { foreach ($form['addfieldpath'] as $add_field_path) { - if (ComponentbuilderHelper::checkString($add_field_path['path'])) + if (StringHelper::check($add_field_path['path'])) { $plugin->add_field_path[$unique] = $add_field_path['path']; } @@ -10443,7 +10464,7 @@ class Get $field, $key, $key, $unique ); // update the default if set - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $field['custom_value'] ) && isset($field['settings'])) @@ -10558,16 +10579,16 @@ class Get $plugin->{'add' . $addTarget} = (isset( $plugin->{'add' . $addTarget} ) - && ComponentbuilderHelper::checkJson( + && JsonHelper::check( $plugin->{'add' . $addTarget} )) ? json_decode($plugin->{'add' . $addTarget}, true) : null; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $plugin->{'add' . $addTarget} )) { if (isset($plugin->{$targetHere}) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $plugin->{$targetHere} )) { @@ -10602,7 +10623,7 @@ class Get ) && $plugin->{'add_' . $scriptMethod . '_' . $scriptType} == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $plugin->{$scriptMethod . '_' . $scriptType} )) { @@ -10634,7 +10655,7 @@ class Get } // add_sql if ($plugin->add_sql == 1 - && ComponentbuilderHelper::checkString($plugin->sql)) + && StringHelper::check($plugin->sql)) { $plugin->sql = $this->setPlaceholders( $this->setDynamicValues(base64_decode($plugin->sql)), @@ -10648,7 +10669,7 @@ class Get } // add_sql_uninstall if ($plugin->add_sql_uninstall == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $plugin->sql_uninstall )) { @@ -10665,7 +10686,7 @@ class Get } // update the URL of the update_server if set if ($plugin->add_update_server == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $plugin->update_server_url )) { @@ -10686,7 +10707,7 @@ class Get { // get the server protocol $plugin->{$server . '_protocol'} - = ComponentbuilderHelper::getVar( + = GetHelper::var( 'server', (int) $plugin->{$server}, 'id', 'protocol' ); } @@ -10808,7 +10829,7 @@ class Get } } // check if any ids left to fetch - if (ComponentbuilderHelper::checkArray($ids)) + if (ArrayHelper::check($ids)) { return $ids; } @@ -10915,12 +10936,12 @@ class Get $placeholders = array_flip( $this->globalPlaceholders ); - $placeholders[ComponentbuilderHelper::safeString( + $placeholders[StringHelper::safe( $this->componentCodeName, 'F' ) . 'Helper::'] = $this->bbb . 'Component' . $this->ddd . 'Helper::'; - $placeholders['COM_' . ComponentbuilderHelper::safeString( + $placeholders['COM_' . StringHelper::safe( $this->componentCodeName, 'U' )] = 'COM_' . $this->bbb @@ -10939,7 +10960,7 @@ class Get // get a list of files in the current directory tree (only PHP, JS and XML for now) $files = Folder::files('.', $type, true, true); // check if files found - if (ComponentbuilderHelper::checkArray($files)) + if (ArrayHelper::check($files)) { foreach ($files as $file) { @@ -10948,14 +10969,14 @@ class Get $this->customCodePlaceholders, $placeholders, $today ); // insert new code - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $this->newCustomCode )) { $this->setNewCustomCode(100); } // update existing custom code - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $this->existingCustomCode )) { @@ -10968,12 +10989,12 @@ class Get // change back to Joomla working directory chdir($joomla); // make sure all code is stored - if (ComponentbuilderHelper::checkArray($this->newCustomCode)) + if (ArrayHelper::check($this->newCustomCode)) { $this->setNewCustomCode(); } // update existing custom code - if (ComponentbuilderHelper::checkArray($this->existingCustomCode)) + if (ArrayHelper::check($this->existingCustomCode)) { $this->setExistingCustomCode(); } @@ -11500,28 +11521,28 @@ class Get */ public function setGuiCodePlaceholder($string, $config) { - if (ComponentbuilderHelper::checkString($string)) + if (StringHelper::check($string)) { if ($this->addPlaceholders && $this->canAddGuiCodePlaceholder( $string ) - && ComponentbuilderHelper::checkArray($config) + && ArrayHelper::check($config) && isset($config['table']) - && ComponentbuilderHelper::checkString($config['table']) + && StringHelper::check($config['table']) && isset($config['field']) - && ComponentbuilderHelper::checkString($config['field']) + && StringHelper::check($config['field']) && isset($config['type']) - && ComponentbuilderHelper::checkString($config['type']) + && StringHelper::check($config['type']) && isset($config['id']) && is_numeric($config['id'])) { // if we have a key we must get the ID if (isset($config['key']) - && ComponentbuilderHelper::checkString($config['key']) + && StringHelper::check($config['key']) && $config['key'] !== 'id') { - if (($id = ComponentbuilderHelper::getVar( + if (($id = GetHelper::var( $config['table'], $config['id'], $config['key'], 'id' )) !== false @@ -11632,8 +11653,8 @@ class Get $file_conent, '' ); - if (($guiCode = ComponentbuilderHelper::mergeArrays($guiCode)) !== false - && ComponentbuilderHelper::checkArray($guiCode, true)) + if (($guiCode = ArrayHelper::merge($guiCode)) !== false + && ArrayHelper::check($guiCode, true)) { foreach ($guiCode as $code) { @@ -11649,9 +11670,9 @@ class Get // set the ID $id = (int) $query[2]; // make the field name save - $field = ComponentbuilderHelper::safeFieldName($query[1]); + $field = FieldHelper::safe($query[1]); // make the table name save - $table = ComponentbuilderHelper::safeString($query[0]); + $table = StringHelper::safe($query[0]); // reverse placeholder as much as we can $code = $this->reversePlaceholders( $code, $placeholders, $target, $id, $field, $table @@ -11689,7 +11710,7 @@ class Get case 1: // beginning of code $i = trim($check[1]); - if (ComponentbuilderHelper::checkString($i)) + if (StringHelper::check($i)) { return $check[1]; } @@ -11697,7 +11718,7 @@ class Get case 2: // end of code $i = trim($check[0]); - if (ComponentbuilderHelper::checkString($i)) + if (StringHelper::check($i)) { return $check[0]; } @@ -11761,7 +11782,7 @@ class Get preg_match_all('!\d+!', $string, $numbers); // return the first number if (isset($numbers[0]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $numbers[0] )) { @@ -11791,7 +11812,7 @@ class Get // get local code if set if ($id > 0 && $code = base64_decode( - ComponentbuilderHelper::getVar($table, $id, 'id', $field) + GetHelper::var($table, $id, 'id', $field) )) { $string = $this->setReverseLangPlaceholders( @@ -11828,7 +11849,7 @@ class Get } ); // check if we should continue - if (ComponentbuilderHelper::checkArray($langStringTargets)) + if (ArrayHelper::check($langStringTargets)) { // start lang holder $langHolders = array(); @@ -11886,15 +11907,15 @@ class Get ); } // merge arrays - $langArray = ComponentbuilderHelper::mergeArrays($langCheck); + $langArray = ArrayHelper::merge($langCheck); // continue only if strings were found - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $langArray )) //<-- not really needed hmmm { foreach ($langArray as $lang) { - $_keyLang = ComponentbuilderHelper::safeString($lang, 'U'); + $_keyLang = StringHelper::safe($lang, 'U'); // this is there to insure we dont break already added Language strings if ($_keyLang === $lang) { @@ -11948,7 +11969,7 @@ class Get public function setPlaceholders($data, &$placeholder, $action = 1) { // make sure the placeholders is an array - if (!ComponentbuilderHelper::checkArray($placeholder)) + if (!ArrayHelper::check($placeholder)) { // This is an error, (TODO) actualy we need to add a kind of log here to know that this happened return $data; @@ -11991,7 +12012,7 @@ class Get } } // only replace if the data has these placeholder values - if (ComponentbuilderHelper::checkArray($replace)) + if (ArrayHelper::check($replace)) { return str_replace( array_keys($replace), array_values($replace), $data @@ -12143,7 +12164,7 @@ class Get unset($localPaths[$key]); } } - if (ComponentbuilderHelper::checkArray($localPaths)) + if (ArrayHelper::check($localPaths)) { return $localPaths; } diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index dfde9137c..80795cb82 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -15,6 +15,10 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Filesystem\File; use Joomla\CMS\Filesystem\Folder; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; + /** * Structure class @@ -485,7 +489,7 @@ class Structure extends Get */ private function buildPowers() { - if (ComponentbuilderHelper::checkArray($this->powers)) + if (ArrayHelper::check($this->powers)) { // Trigger Event: jcb_ce_onBeforeSetModules $this->triggerEvent( @@ -496,9 +500,9 @@ class Structure extends Get $htaccess = array(); foreach ($this->powers as $power) { - if (ComponentbuilderHelper::checkObject($power) + if (ObjectHelper::check($power) && isset($power->path) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $power->path )) { @@ -594,7 +598,7 @@ class Structure extends Get */ private function buildModules() { - if (ComponentbuilderHelper::checkArray($this->joomlaModules)) + if (ArrayHelper::check($this->joomlaModules)) { // Trigger Event: jcb_ce_onBeforeSetModules $this->triggerEvent( @@ -603,9 +607,9 @@ class Structure extends Get ); foreach ($this->joomlaModules as $module) { - if (ComponentbuilderHelper::checkObject($module) + if (ObjectHelper::check($module) && isset($module->folder_name) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $module->folder_name )) { @@ -764,7 +768,7 @@ class Structure extends Get if (($css = $this->getCustomScriptBuilder( 'css_view', $module->key )) !== null - && ComponentbuilderHelper::checkString($css)) + && StringHelper::check($css)) { // make sure this script does not have PHP if (strpos($css, 'getCustomScriptBuilder( 'view_footer', $module->key )) !== null - && ComponentbuilderHelper::checkString($javascript)) + && StringHelper::check($javascript)) { // make sure this script does not have PHP if (strpos($javascript, 'form_files) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $module->form_files )) { @@ -1020,7 +1024,7 @@ class Structure extends Get . $fieldset . '" label="' . $label . '">'; } // check if we have an inner field set - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $field_name_inner )) { @@ -1032,7 +1036,7 @@ class Structure extends Get $xml .= $this->hhh . 'FIELDSET_' . $file . $field_name . $fieldset . $this->hhh; // check if we have an inner field set - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $field_name_inner )) { @@ -1091,7 +1095,7 @@ class Structure extends Get ); // check if this lib has files if (isset($module->files) - && ComponentbuilderHelper::checkArray($module->files)) + && ArrayHelper::check($module->files)) { // add to component files foreach ($module->files as $file) @@ -1104,7 +1108,7 @@ class Structure extends Get } // check if this lib has folders if (isset($module->folders) - && ComponentbuilderHelper::checkArray($module->folders)) + && ArrayHelper::check($module->folders)) { // add to component folders foreach ($module->folders as $folder) @@ -1117,7 +1121,7 @@ class Structure extends Get } // check if this module has urls if (isset($module->urls) - && ComponentbuilderHelper::checkArray($module->urls)) + && ArrayHelper::check($module->urls)) { // add to component urls foreach ($module->urls as $n => &$url) @@ -1125,7 +1129,7 @@ class Structure extends Get // should we add the local folder if (isset($url['type']) && $url['type'] > 1 && isset($url['url']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $url['url'] )) { @@ -1175,7 +1179,7 @@ class Structure extends Get */ private function buildPlugins() { - if (ComponentbuilderHelper::checkArray($this->joomlaPlugins)) + if (ArrayHelper::check($this->joomlaPlugins)) { // Trigger Event: jcb_ce_onBeforeSetPlugins $this->triggerEvent( @@ -1184,9 +1188,9 @@ class Structure extends Get ); foreach ($this->joomlaPlugins as $plugin) { - if (ComponentbuilderHelper::checkObject($plugin) + if (ObjectHelper::check($plugin) && isset($plugin->folder_name) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $plugin->folder_name )) { @@ -1273,7 +1277,7 @@ class Structure extends Get } // set forms folder if needed if (isset($plugin->form_files) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $plugin->form_files )) { @@ -1411,7 +1415,7 @@ class Structure extends Get . $fieldset . '" label="' . $label . '">'; } // check if we have an inner field set - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $field_name_inner )) { @@ -1423,7 +1427,7 @@ class Structure extends Get $xml .= $this->hhh . 'FIELDSET_' . $file . $field_name . $fieldset . $this->hhh; // check if we have an inner field set - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $field_name_inner )) { @@ -1482,7 +1486,7 @@ class Structure extends Get ); // check if this lib has files if (isset($plugin->files) - && ComponentbuilderHelper::checkArray($plugin->files)) + && ArrayHelper::check($plugin->files)) { // add to component files foreach ($plugin->files as $file) @@ -1495,7 +1499,7 @@ class Structure extends Get } // check if this lib has folders if (isset($plugin->folders) - && ComponentbuilderHelper::checkArray($plugin->folders)) + && ArrayHelper::check($plugin->folders)) { // add to component folders foreach ($plugin->folders as $folder) @@ -1508,7 +1512,7 @@ class Structure extends Get } // check if this plugin has urls if (isset($plugin->urls) - && ComponentbuilderHelper::checkArray($plugin->urls)) + && ArrayHelper::check($plugin->urls)) { // add to component urls foreach ($plugin->urls as $n => &$url) @@ -1516,7 +1520,7 @@ class Structure extends Get // should we add the local folder if (isset($url['type']) && $url['type'] > 1 && isset($url['url']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $url['url'] )) { @@ -1591,7 +1595,7 @@ class Structure extends Get */ private function setLibraries() { - if (ComponentbuilderHelper::checkArray($this->libraries)) + if (ArrayHelper::check($this->libraries)) { // Trigger Event: jcb_ce_onBeforeSetLibraries $this->triggerEvent( @@ -1610,11 +1614,11 @@ class Structure extends Get $this->createFolder($this->componentPath . '/media'); foreach ($this->libraries as $id => &$library) { - if (ComponentbuilderHelper::checkObject($library)) + if (ObjectHelper::check($library)) { // check if this lib has files if (isset($library->files) - && ComponentbuilderHelper::checkArray($library->files)) + && ArrayHelper::check($library->files)) { // add to component files foreach ($library->files as $file) @@ -1624,7 +1628,7 @@ class Structure extends Get } // check if this lib has folders if (isset($library->folders) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $library->folders )) { @@ -1636,13 +1640,13 @@ class Structure extends Get } // check if this lib has urls if (isset($library->urls) - && ComponentbuilderHelper::checkArray($library->urls)) + && ArrayHelper::check($library->urls)) { // build media folder path $libFolder = strtolower( preg_replace( '/\s+/', '-', - ComponentbuilderHelper::safeString( + StringHelper::safe( $library->name, 'filename', ' ', false ) ) @@ -1655,7 +1659,7 @@ class Structure extends Get { if (isset($url['type']) && $url['type'] > 1 && isset($url['url']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $url['url'] )) { @@ -1712,7 +1716,7 @@ class Structure extends Get // if config fields are found load into component config (avoiding duplicates) if (isset($library->how) && $library->how > 1 && isset($library->config) - && ComponentbuilderHelper::checkArray($library->config)) + && ArrayHelper::check($library->config)) { foreach ($library->config as $cofig) { @@ -1723,7 +1727,7 @@ class Structure extends Get } ); // set the config data if not found - if (!ComponentbuilderHelper::checkArray($found)) + if (!ArrayHelper::check($found)) { $this->componentData->config[] = $cofig; } @@ -1746,7 +1750,7 @@ class Structure extends Get if (isset($this->componentData->dashboard_type) && 2 == $this->componentData->dashboard_type && isset($this->componentData->dashboard) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->componentData->dashboard ) && strpos($this->componentData->dashboard, '_') !== false) @@ -1756,7 +1760,7 @@ class Structure extends Get if (count((array) $getter) == 2 && is_numeric($getter[1])) { // the pointers - $t = ComponentbuilderHelper::safeString($getter[0], 'U'); + $t = StringHelper::safe($getter[0], 'U'); $id = (int) $getter[1]; // the dynamic stuff $targets = array('A' => 'admin_views', @@ -1769,12 +1773,12 @@ class Structure extends Get if (isset($targets[$t]) && $id > 0) { // set the type name - $type_names = ComponentbuilderHelper::safeString( + $type_names = StringHelper::safe( $targets[$t], 'w' ); // set the dynamic dash if (isset($this->componentData->{$targets[$t]}) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->{$targets[$t]} )) { @@ -1792,7 +1796,7 @@ class Structure extends Get } ); // set dashboard - if (ComponentbuilderHelper::checkArray($dashboard)) + if (ArrayHelper::check($dashboard)) { $dashboard = array_values($dashboard)[0]; } @@ -1801,7 +1805,7 @@ class Structure extends Get && isset($dashboard['settings']->{$keys[$t]})) { $this->dynamicDashboard - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $dashboard['settings']->{$keys[$t]} ); $this->dynamicDashboardType @@ -1866,7 +1870,7 @@ class Structure extends Get ); } // if default was changed to dynamic dashboard the remove default tab and methods - if (ComponentbuilderHelper::checkString($this->dynamicDashboard)) + if (StringHelper::check($this->dynamicDashboard)) { // dynamic dashboard is used $this->componentData->dashboard_tab = ''; @@ -1894,7 +1898,7 @@ class Structure extends Get */ private function setFolders() { - if (ComponentbuilderHelper::checkObject( + if (ObjectHelper::check( $this->joomlaVersionData->create )) { @@ -1910,14 +1914,14 @@ class Structure extends Get foreach ($this->joomlaVersionData->create as $main => $folders) { $this->createFolder($this->componentPath . '/' . $main); - if (ComponentbuilderHelper::checkObject($folders)) + if (ObjectHelper::check($folders)) { foreach ($folders as $sub => $subFolders) { $this->createFolder( $this->componentPath . '/' . $main . '/' . $sub ); - if (ComponentbuilderHelper::checkObject($subFolders)) + if (ObjectHelper::check($subFolders)) { foreach ($subFolders as $sub_2 => $subFolders_2) { @@ -1925,7 +1929,7 @@ class Structure extends Get $this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 ); - if (ComponentbuilderHelper::checkObject( + if (ObjectHelper::check( $subFolders_2 )) { @@ -1938,7 +1942,7 @@ class Structure extends Get . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 ); - if (ComponentbuilderHelper::checkObject( + if (ObjectHelper::check( $subFolders_3 )) { @@ -1953,7 +1957,7 @@ class Structure extends Get . $sub_2 . '/' . $sub_3 . '/' . $sub_4 ); - if (ComponentbuilderHelper::checkObject( + if (ObjectHelper::check( $subFolders_4 )) { @@ -1971,7 +1975,7 @@ class Structure extends Get . $sub_4 . '/' . $sub_5 ); - if (ComponentbuilderHelper::checkObject( + if (ObjectHelper::check( $subFolders_5 )) { @@ -1998,7 +2002,7 @@ class Structure extends Get . '/' . $sub_6 ); - if (ComponentbuilderHelper::checkObject( + if (ObjectHelper::check( $subFolders_6 )) { @@ -2059,7 +2063,7 @@ class Structure extends Get */ private function setStatic() { - if (ComponentbuilderHelper::checkObject( + if (ObjectHelper::check( $this->joomlaVersionData->move->static )) { @@ -2248,7 +2252,7 @@ class Structure extends Get // TODO <-- this may not be the best way, will keep an eye on this. // We basicly only want to check if a folder is added that is not in the stdFolders array if (isset($checker[0]) - && ComponentbuilderHelper::checkString($checker[0]) + && StringHelper::check($checker[0]) && !in_array($checker[0], $this->stdFolders)) { // check if we should add the dynamic folder moving script to the installer script @@ -2270,7 +2274,7 @@ class Structure extends Get } } elseif (count((array) $checker) == 2 - && ComponentbuilderHelper::checkString($checker[0])) + && StringHelper::check($checker[0])) { $add_to_extra = false; // set the target @@ -2302,7 +2306,7 @@ class Structure extends Get } // set the xml file $this->fileContentStatic[$this->hhh . 'EXSTRA_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $checker[0], 'U' ) . '_' . $eNAME . $this->hhh] .= PHP_EOL . $eTab . "<" . $ename . ">" @@ -2329,15 +2333,15 @@ class Structure extends Get $back = false; $front = false; if ((isset($this->joomlaVersionData->move->dynamic) - && ComponentbuilderHelper::checkObject( + && ObjectHelper::check( $this->joomlaVersionData->move->dynamic )) && (isset($this->componentData->admin_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->admin_views ))) { - if (!ComponentbuilderHelper::checkString($this->dynamicDashboard)) + if (!StringHelper::check($this->dynamicDashboard)) { // setup dashboard $target = array('admin' => $this->componentData->name_code); @@ -2346,7 +2350,7 @@ class Structure extends Get // now the rest of the views foreach ($this->componentData->admin_views as $nr => $view) { - if (ComponentbuilderHelper::checkObject($view['settings'])) + if (ObjectHelper::check($view['settings'])) { $created = $this->getCreatedDate($view); $modified = $this->getLastModifiedDate($view); @@ -2405,11 +2409,11 @@ class Structure extends Get $back = true; } if ((isset($this->joomlaVersionData->move->dynamic) - && ComponentbuilderHelper::checkObject( + && ObjectHelper::check( $this->joomlaVersionData->move->dynamic )) && (isset($this->componentData->site_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->site_views ))) { @@ -2446,11 +2450,11 @@ class Structure extends Get $front = true; } if ((isset($this->joomlaVersionData->move->dynamic) - && ComponentbuilderHelper::checkObject( + && ObjectHelper::check( $this->joomlaVersionData->move->dynamic )) && (isset($this->componentData->custom_admin_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->custom_admin_views ))) { @@ -2592,7 +2596,7 @@ class Structure extends Get ) ) ); - if (ComponentbuilderHelper::checkArray($ids)) + if (ArrayHelper::check($ids)) { foreach ($ids as $id) { @@ -2617,7 +2621,7 @@ class Structure extends Get public function getCreatedDate($view) { if (isset($view['settings']->created) - && ComponentbuilderHelper::checkString($view['settings']->created)) + && StringHelper::check($view['settings']->created)) { // first set the main date $date = strtotime($view['settings']->created); @@ -2643,7 +2647,7 @@ class Structure extends Get { // first set the main date if (isset($view['settings']->modified) - && ComponentbuilderHelper::checkString($view['settings']->modified) + && StringHelper::check($view['settings']->modified) && '0000-00-00 00:00:00' !== $view['settings']->modified) { $date = strtotime($view['settings']->modified); @@ -2661,18 +2665,18 @@ class Structure extends Get if (!isset($this->lastModifiedDate[$id])) { if (isset($view['settings']->fields) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $view['settings']->fields )) { foreach ($view['settings']->fields as $field) { if (isset($field['settings']) - && ComponentbuilderHelper::checkObject( + && ObjectHelper::check( $field['settings'] ) && isset($field['settings']->modified) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $field['settings']->modified ) && '0000-00-00 00:00:00' @@ -2697,7 +2701,7 @@ class Structure extends Get if (!isset($this->lastModifiedDate[$id])) { if (isset($view['settings']->main_get->modified) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view['settings']->main_get->modified ) && '0000-00-00 00:00:00' @@ -2720,7 +2724,7 @@ class Structure extends Get if (!isset($this->lastModifiedDate[$id])) { if (isset($view['settings']->main_get->modified) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view['settings']->main_get->modified ) && '0000-00-00 00:00:00' @@ -2770,13 +2774,13 @@ class Structure extends Get // did we build the files (any number) $build_status = false; // check that we have the target values - if (ComponentbuilderHelper::checkArray($target)) + if (ArrayHelper::check($target)) { // search the target foreach ($target as $main => $name) { // make sure it is lower case - $name = ComponentbuilderHelper::safeString($name); + $name = StringHelper::safe($name); // setup the files foreach ( $this->joomlaVersionData->move->dynamic->{$main} as $item => @@ -2861,7 +2865,7 @@ class Structure extends Get $newFIle = array('path' => $path . '/' . $new, 'name' => $new, 'view' => $name, 'zip' => $zipPath . '/' . $new); - if (ComponentbuilderHelper::checkArray($config)) + if (ArrayHelper::check($config)) { $newFIle['config'] = $config; } @@ -2885,15 +2889,28 @@ class Structure extends Get */ private function setJoomlaVersionData() { + // option to load other settings + $custom_settings = $this->templatePath . '/settings_' . $this->componentCodeName . '.json'; // set the version data - $versionData = json_decode( - ComponentbuilderHelper::getFileContents( - $this->templatePath . '/settings.json' - ) - ); + if (File::exists($custom_settings)) + { + $version_data = json_decode( + ComponentbuilderHelper::getFileContents( + $custom_settings + ) + ); + } + else + { + $version_data = json_decode( + ComponentbuilderHelper::getFileContents( + $this->templatePath . '/settings.json' + ) + ); + } // add custom folders if ((isset($this->componentData->folders) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->folders )) || $this->addEximport @@ -2965,7 +2982,7 @@ class Structure extends Get ); // fix custom path if (isset($custom['path']) - && ComponentbuilderHelper::checkString($custom['path'])) + && StringHelper::check($custom['path'])) { $custom['path'] = trim($custom['path'], '/'); } @@ -3017,31 +3034,31 @@ class Structure extends Get $newname = ''; } // insure we have no duplicates - $key_pointer = ComponentbuilderHelper::safeString( + $key_pointer = StringHelper::safe( $custom['folder'] ) . '_f' . $pointer_tracker; $pointer_tracker++; // fix custom path $custom['path'] = ltrim($custom['path'], '/'); // set new folder to object - $versionData->move->static->{$key_pointer} = new stdClass(); - $versionData->move->static->{$key_pointer}->naam + $version_data->move->static->{$key_pointer} = new stdClass(); + $version_data->move->static->{$key_pointer}->naam = str_replace( '//', '/', $custom['folder'] ); - $versionData->move->static->{$key_pointer}->path + $version_data->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; - $versionData->move->static->{$key_pointer}->rename = $rename; - $versionData->move->static->{$key_pointer}->newName = $newname; - $versionData->move->static->{$key_pointer}->type = 'folder'; - $versionData->move->static->{$key_pointer}->custom + $version_data->move->static->{$key_pointer}->rename = $rename; + $version_data->move->static->{$key_pointer}->newName = $newname; + $version_data->move->static->{$key_pointer}->type = 'folder'; + $version_data->move->static->{$key_pointer}->custom = $customPath; // set the target if type and id is found if (isset($custom['target_id']) && isset($custom['target_type'])) { - $versionData->move->static->{$key_pointer}->_target + $version_data->move->static->{$key_pointer}->_target = array('key' => $custom['target_id'] . '_' . $custom['target_type'], 'type' => $custom['target_type']); @@ -3052,7 +3069,7 @@ class Structure extends Get } // add custom files if ((isset($this->componentData->files) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->files )) || $this->googlechart) @@ -3106,13 +3123,13 @@ class Structure extends Get $customPath = 'full'; } // make sure we have not duplicates - $key_pointer = ComponentbuilderHelper::safeString( + $key_pointer = StringHelper::safe( $custom['file'] ) . '_g' . $pointer_tracker; $pointer_tracker++; // set new file to object - $versionData->move->static->{$key_pointer} = new stdClass(); - $versionData->move->static->{$key_pointer}->naam = str_replace( + $version_data->move->static->{$key_pointer} = new stdClass(); + $version_data->move->static->{$key_pointer}->naam = str_replace( '//', '/', $custom['file'] ); // update the dynamic component name placholders in file names @@ -3125,11 +3142,11 @@ class Structure extends Get { $pathInfo['dirname'] = trim($pathInfo['dirname'], '/'); // set the info - $versionData->move->static->{$key_pointer}->path + $version_data->move->static->{$key_pointer}->path = $_target_type . '/' . $pathInfo['dirname']; - $versionData->move->static->{$key_pointer}->rename = 'new'; - $versionData->move->static->{$key_pointer}->newName + $version_data->move->static->{$key_pointer}->rename = 'new'; + $version_data->move->static->{$key_pointer}->newName = $pathInfo['basename']; } elseif ('full' === $customPath) @@ -3139,11 +3156,11 @@ class Structure extends Get // get file array $fileArray = (array) explode('/', $custom['file']); // set the info - $versionData->move->static->{$key_pointer}->path + $version_data->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; - $versionData->move->static->{$key_pointer}->rename = 'new'; - $versionData->move->static->{$key_pointer}->newName = end( + $version_data->move->static->{$key_pointer}->rename = 'new'; + $version_data->move->static->{$key_pointer}->newName = end( $fileArray ); } @@ -3152,19 +3169,19 @@ class Structure extends Get // fix custom path $custom['path'] = ltrim($custom['path'], '/'); // set the info - $versionData->move->static->{$key_pointer}->path + $version_data->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; - $versionData->move->static->{$key_pointer}->rename = false; + $version_data->move->static->{$key_pointer}->rename = false; } - $versionData->move->static->{$key_pointer}->type = 'file'; - $versionData->move->static->{$key_pointer}->custom + $version_data->move->static->{$key_pointer}->type = 'file'; + $version_data->move->static->{$key_pointer}->custom = $customPath; // set the target if type and id is found if (isset($custom['target_id']) && isset($custom['target_type'])) { - $versionData->move->static->{$key_pointer}->_target + $version_data->move->static->{$key_pointer}->_target = array('key' => $custom['target_id'] . '_' . $custom['target_type'], 'type' => $custom['target_type']); @@ -3185,7 +3202,7 @@ class Structure extends Get unset($custom); } - return $versionData; + return $version_data; } /** diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 2b9b19c40..3d61c55f9 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -13,6 +13,11 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\String\FieldHelper; + /** * Compiler class */ @@ -396,7 +401,7 @@ class Fields extends Structure ) { // setup the fieldset of this view if (isset($view['settings']->fields) - && ComponentbuilderHelper::checkArray($view['settings']->fields)) + && ArrayHelper::check($view['settings']->fields)) { // add metadata to the view if (isset($view['metadata']) && $view['metadata']) @@ -764,7 +769,7 @@ class Fields extends Structure } // check if view has access if (isset($this->accessBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$nameSingleCode] ) && !isset($this->fieldsNames[$nameSingleCode]['access'])) @@ -830,7 +835,7 @@ class Fields extends Structure } // check if metadata is added to this view if (isset($this->metadataBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->metadataBuilder[$nameSingleCode] )) { @@ -907,7 +912,7 @@ class Fields extends Structure ); } // load the dynamic fields now - if (ComponentbuilderHelper::checkString($dynamicFields)) + if (StringHelper::check($dynamicFields)) { $fieldSet[] = $this->_t(2) . "" . $dynamicFields; @@ -916,7 +921,7 @@ class Fields extends Structure $fieldSet[] = $this->_t(1) . "
"; // check if metadata is added to this view if (isset($this->metadataBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->metadataBuilder[$nameSingleCode] )) { @@ -1192,7 +1197,7 @@ class Fields extends Structure } // check if view has access if (isset($this->accessBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$nameSingleCode] ) && !isset($this->fieldsNames[$nameSingleCode]['access'])) @@ -1262,7 +1267,7 @@ class Fields extends Structure } // check if metadata is added to this view if (isset($this->metadataBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->metadataBuilder[$nameSingleCode] )) { @@ -1362,7 +1367,7 @@ class Fields extends Structure } // check if metadata is added to this view if (isset($this->metadataBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->metadataBuilder[$nameSingleCode] )) { @@ -1496,7 +1501,7 @@ class Fields extends Structure } // check if the view has permissions if (isset($view['settings']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $view['settings']->permissions, true )) { @@ -1521,7 +1526,7 @@ class Fields extends Structure } // check if the fields has permissions if (isset($view['settings']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $view['settings']->fields, true )) { @@ -1530,7 +1535,7 @@ class Fields extends Structure // if a field has any permissions // the a view has permissions if (isset($field['permission']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $field['permission'], true )) { @@ -1592,7 +1597,7 @@ class Fields extends Structure } // make sure we have settings if (isset($field['settings']) - && ComponentbuilderHelper::checkObject( + && ObjectHelper::check( $field['settings'] )) { @@ -1609,7 +1614,7 @@ class Fields extends Structure $langView, $nameListCode, $nameSingleCode, $placeholders ); // check if values were set - if (ComponentbuilderHelper::checkArray($fieldAttributes)) + if (ArrayHelper::check($fieldAttributes)) { // set the array of field names $this->setFieldsNames( @@ -1689,7 +1694,7 @@ class Fields extends Structure } } elseif (isset($fieldAttributes['custom']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $fieldAttributes['custom'] )) { @@ -1772,7 +1777,7 @@ class Fields extends Structure $fieldset = array(); } // loop over the fields to build - if (ComponentbuilderHelper::checkArray($fields)) + if (ArrayHelper::check($fields)) { foreach ($fields as $field) { @@ -1784,7 +1789,7 @@ class Fields extends Structure ); // make sure the xml is set and a string if (isset($xmlField) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $xmlField )) { @@ -1933,7 +1938,7 @@ class Fields extends Structure // now add to the field set $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1) . ""; $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1) @@ -1971,7 +1976,7 @@ class Fields extends Structure if (count((array) $valueKeyArray) == 2) { $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $valueKeyArray[0], true ); // add to lang array @@ -1995,7 +2000,7 @@ class Fields extends Structure if (count((array) $valueKeyArray) == 3) { $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $valueKeyArray[1], true ); // add to lang array @@ -2019,7 +2024,7 @@ class Fields extends Structure else { $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $valueKeyArray[1], true ); // add to lang array @@ -2045,7 +2050,7 @@ class Fields extends Structure { // text is also the value $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $option, true ); // add to lang array @@ -2076,7 +2081,7 @@ class Fields extends Structure // check if this is a group loader if ('group' === $key_ && isset($groups_[$_id]) && isset($grouped_[$key_][$_id]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $grouped_[$key_][$_id] )) { @@ -2093,7 +2098,7 @@ class Fields extends Structure . $this->_t(2) . ''; } elseif (isset($grouped_[$key_][$_id]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $grouped_[$key_][$_id] )) { @@ -2112,7 +2117,7 @@ class Fields extends Structure // has other value then text list($v, $t) = explode('|', $option); $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $t, true ); // add to lang array @@ -2131,7 +2136,7 @@ class Fields extends Structure { // text is also the value $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $option, true ); // add to lang array @@ -2156,7 +2161,7 @@ class Fields extends Structure // has other value then text list($v, $t) = explode('|', $value); $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $t, true ); // add to lang array @@ -2172,7 +2177,7 @@ class Fields extends Structure { // text is also the value $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $value, true ); // add to lang array @@ -2191,7 +2196,7 @@ class Fields extends Structure } } // if options were found - if (ComponentbuilderHelper::checkString($optionSet)) + if (StringHelper::check($optionSet)) { $field .= '>'; $field .= PHP_EOL . $this->_t(3) . $taber . ""; $field .= PHP_EOL . $this->_t(2) . $taber . " $value) @@ -2239,7 +2244,7 @@ class Fields extends Structure // now add to the field set $field .= PHP_EOL . $this->_t(2) . ""; $field .= PHP_EOL . $this->_t(2) . " $value) @@ -2260,7 +2265,7 @@ class Fields extends Structure $field .= PHP_EOL . $this->_t(2) . ""; $field .= PHP_EOL . $this->_t(2) . "setLangContent( $this->lang, $r_listLangName, - ComponentbuilderHelper::safeString( + StringHelper::safe( $r_name, 'W' ) ); // if label was set use instead - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $r_langLabel )) { @@ -2427,7 +2432,7 @@ class Fields extends Structure // now add to the field set $field .= PHP_EOL . $this->_t(2) . $taber . ""; $field .= PHP_EOL . $this->_t(2) . $taber . "setLangContent( $this->lang, $r_listLangName, - ComponentbuilderHelper::safeString( + StringHelper::safe( $r_name, 'W' ) ); // if label was set use instead - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $r_langLabel )) { @@ -2619,7 +2624,7 @@ class Fields extends Structure . $this->setLine( __LINE__ ) . " " . ucfirst($name) . " Field. Type: " - . ComponentbuilderHelper::safeString($typeName, 'F') + . StringHelper::safe($typeName, 'F') . ". (custom) -->"; $field .= PHP_EOL . $this->_t(2) . $taber . "_t(2) . ''; } elseif (isset($grouped_[$key_][$_id]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $grouped_[$key_][$_id] )) { @@ -2796,7 +2801,7 @@ class Fields extends Structure // has other value then text list($v, $t) = explode('|', $option); $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $t, true ); // add to lang array @@ -2815,7 +2820,7 @@ class Fields extends Structure { // text is also the value $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $option, true ); // add to lang array @@ -2840,7 +2845,7 @@ class Fields extends Structure // has other value then text list($v, $t) = explode('|', $value); $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $t, true ); // add to lang array @@ -2856,7 +2861,7 @@ class Fields extends Structure { // text is also the value $langValue = $langView . '_' - . ComponentbuilderHelper::safeFieldName( + . FieldHelper::safe( $value, true ); // add to lang array @@ -2875,7 +2880,7 @@ class Fields extends Structure } } // if options were found - if (ComponentbuilderHelper::checkString($optionSet)) + if (StringHelper::check($optionSet)) { $field .= '>'; $field .= PHP_EOL . $this->_t(3) . $taber . "') !== false && strpos($field, $menuSetter) === false - && !ComponentbuilderHelper::checkString($target)) + && !StringHelper::check($target)) { // we add the global option $field = str_replace( @@ -2434,7 +2438,7 @@ class Interpretation extends Fields ) { $query = ''; - if (ComponentbuilderHelper::checkArray($gets)) + if (ArrayHelper::check($gets)) { $mainAsArray = array(); $check = 'zzz'; @@ -2449,7 +2453,7 @@ class Interpretation extends Fields $this->customViewQueryChecker[$this->target][$checker] = true; if (isset($the_get['selection']['type']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $the_get['selection']['type'] )) { @@ -2475,16 +2479,16 @@ class Interpretation extends Fields // load the from selection if (($nr == 0 && (!isset($the_get['join_field']) - || !ComponentbuilderHelper::checkString( + || !StringHelper::check( $the_get['join_field'] )) && (isset($the_get['selection']['type']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $the_get['selection']['type'] ))) || ($type === 'custom' && (isset($the_get['selection']['type']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $the_get['selection']['type'] )))) { @@ -2493,11 +2497,11 @@ class Interpretation extends Fields . ');'; } elseif (isset($the_get['join_field']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $the_get['join_field'] ) && isset($the_get['selection']['type']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $the_get['selection']['type'] )) { @@ -2519,7 +2523,7 @@ class Interpretation extends Fields )) !== false) { if (isset($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']] ) && !in_array($check, $mainAsArray)) @@ -2552,7 +2556,7 @@ class Interpretation extends Fields { $filter = ''; // check if filter is set for this field - if (ComponentbuilderHelper::checkArray($filters)) + if (ArrayHelper::check($filters)) { foreach ($filters as $field => $ter) { @@ -2794,7 +2798,7 @@ class Interpretation extends Fields // check if we should load this again if (strpos($get['selection']['select'], $field) !== false && !isset($this->loadTracker[$key]) - && ComponentbuilderHelper::checkArray($array['decode'])) + && ArrayHelper::check($array['decode'])) { // set the key $this->loadTracker[$key] = $key; @@ -2880,7 +2884,7 @@ class Interpretation extends Fields } } // check if we have found the details - if (ComponentbuilderHelper::checkString($if)) + if (StringHelper::check($if)) { // build decoder string $fieldDecode .= PHP_EOL . $this->_t(1) . $tab @@ -2890,7 +2894,7 @@ class Interpretation extends Fields . "//" . $this->setLine(__LINE__) . " Decode " . $field; } - if (ComponentbuilderHelper::checkString($decoder)) + if (StringHelper::check($decoder)) { // build decoder string $fieldDecode .= PHP_EOL . $this->_t(1) . $tab @@ -3028,7 +3032,7 @@ class Interpretation extends Fields $tab = '' ) { - if (ComponentbuilderHelper::checkArray($gets)) + if (ArrayHelper::check($gets)) { $customJoin = ''; foreach ($gets as $get) @@ -3089,7 +3093,7 @@ class Interpretation extends Fields { // check if this function is not linked to the main call list($aJoin) = explode('.', $get['on_field']); - if (ComponentbuilderHelper::checkArray($asBucket) + if (ArrayHelper::check($asBucket) && in_array( $aJoin, $asBucket )) @@ -3098,7 +3102,7 @@ class Interpretation extends Fields } // default fallback elseif (isset($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']] )) { @@ -3111,7 +3115,7 @@ class Interpretation extends Fields public function setCustomViewFilter(&$filter, &$code, $tab = '') { $filters = ''; - if (ComponentbuilderHelper::checkArray($filter)) + if (ArrayHelper::check($filter)) { foreach ($filter as $ter) { @@ -3149,7 +3153,7 @@ class Interpretation extends Fields // COM_COMPONENTBUILDER_DYNAMIC_GET_USER_GROUPS $decodeChecker = $this->siteFieldData['decode'][$code][$ter['key']][$as][$field]; - if (ComponentbuilderHelper::checkArray($decodeChecker) + if (ArrayHelper::check($decodeChecker) || $ter['state_key'] === 'array') { // set needed fields to filter after query @@ -3286,12 +3290,12 @@ class Interpretation extends Fields break; } // only add if the filter is set - if (ComponentbuilderHelper::checkString($string)) + if (StringHelper::check($string)) { // sort where if ($as === 'a' || (isset($this->siteMainGet[$this->target][$code][$as]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->siteMainGet[$this->target][$code][$as] ))) { @@ -3312,7 +3316,7 @@ class Interpretation extends Fields public function setCustomViewGroup(&$group, &$code, $tab = '') { $grouping = ''; - if (ComponentbuilderHelper::checkArray($group)) + if (ArrayHelper::check($group)) { foreach ($group as $gr) { @@ -3324,7 +3328,7 @@ class Interpretation extends Fields // sort where if ($as === 'a' || (isset($this->siteMainGet[$this->target][$code][$as]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->siteMainGet[$this->target][$code][$as] ))) { @@ -3345,7 +3349,7 @@ class Interpretation extends Fields public function setCustomViewOrder(&$order, &$code, $tab = '') { $ordering = ''; - if (ComponentbuilderHelper::checkArray($order)) + if (ArrayHelper::check($order)) { foreach ($order as $or) { @@ -3367,7 +3371,7 @@ class Interpretation extends Fields // sort where if ($as === 'a' || (isset($this->siteMainGet[$this->target][$code][$as]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->siteMainGet[$this->target][$code][$as] ))) { @@ -3388,7 +3392,7 @@ class Interpretation extends Fields public function setCustomViewWhere(&$where, &$code, $tab = '') { $wheres = ''; - if (ComponentbuilderHelper::checkArray($where)) + if (ArrayHelper::check($where)) { foreach ($where as $whe) { @@ -3428,12 +3432,12 @@ class Interpretation extends Fields $value = " " . $whe['value_key'] . "');"; } } - elseif (ComponentbuilderHelper::checkString($whe['value_key'])) + elseif (StringHelper::check($whe['value_key'])) { $value = " " . $whe['value_key'] . "');"; } // only load if there is a value - if (ComponentbuilderHelper::checkString($value)) + if (StringHelper::check($value)) { $tabe = ''; if ($as === 'a') @@ -3479,7 +3483,7 @@ class Interpretation extends Fields // sort where if ($as === 'a' || (isset($this->siteMainGet[$this->target][$code][$as]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->siteMainGet[$this->target][$code][$as] ))) { @@ -3501,7 +3505,7 @@ class Interpretation extends Fields public function setCustomViewGlobals(&$global, $string, $as, $tab = '') { $globals = ''; - if (ComponentbuilderHelper::checkArray($global)) + if (ArrayHelper::check($global)) { $as = array_unique($as); foreach ($global as $glo) @@ -3524,7 +3528,7 @@ class Interpretation extends Fields break; } // only add if the filter is set - if (ComponentbuilderHelper::checkString($value)) + if (StringHelper::check($value)) { $globals .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) @@ -3611,7 +3615,7 @@ class Interpretation extends Fields . "\$app = JFactory::getApplication();"; // set lang $langKeyWord = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( 'Not authorised to view ' . $view['settings']->code . '!', 'U' ); @@ -3646,7 +3650,7 @@ class Interpretation extends Fields $type = 'main' ) { - if (ComponentbuilderHelper::checkObject($get)) + if (ObjectHelper::check($get)) { // set the site decription switches foreach ($this->cryptionTypes as $cryptionType) @@ -3659,7 +3663,7 @@ class Interpretation extends Fields if (isset($get->add_php_before_getitem) && $get->add_php_before_getitem == 1 && isset($get->php_before_getitem) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $get->php_before_getitem )) { @@ -3706,7 +3710,7 @@ class Interpretation extends Fields if (isset($get->add_php_after_getitem) && $get->add_php_after_getitem == 1 && isset($get->php_after_getitem) - && ComponentbuilderHelper::checkString($get->php_after_getitem)) + && StringHelper::check($get->php_after_getitem)) { $getItem .= $this->setPlaceholders( $get->php_after_getitem, $this->placeholders @@ -3750,7 +3754,7 @@ class Interpretation extends Fields $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "\$app = JFactory::getApplication();"; $langKeyWoord = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( 'Not found or access denied', 'U' ); $this->setLangContent( @@ -3801,7 +3805,7 @@ class Interpretation extends Fields $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; // dispatcher placeholder $getItem .= $this->hhh . "DISPATCHER" . $this->hhh; - if (ComponentbuilderHelper::checkArray($get->main_get)) + if (ArrayHelper::check($get->main_get)) { $asBucket = array(); foreach ($get->main_get as $main_get) @@ -3812,7 +3816,7 @@ class Interpretation extends Fields { $decodeChecker = $this->siteFieldData['decode'][$code][$main_get['key']][$main_get['as']]; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $decodeChecker )) { @@ -3828,7 +3832,7 @@ class Interpretation extends Fields { $decodeFilter = $this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']]; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $decodeFilter )) { @@ -3844,7 +3848,7 @@ class Interpretation extends Fields { $contentprepareChecker = $this->siteFieldData['textareas'][$code][$main_get['key']][$main_get['as']]; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $contentprepareChecker )) { @@ -3860,7 +3864,7 @@ class Interpretation extends Fields { $uikitChecker = $this->siteFieldData['uikit'][$code][$main_get['key']][$main_get['as']]; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $uikitChecker )) { @@ -3969,7 +3973,7 @@ class Interpretation extends Fields { // check if the dispather should be added if (!isset($this->JEventDispatcher) - || !ComponentbuilderHelper::checkArray( + || !ArrayHelper::check( $this->JEventDispatcher )) { @@ -3993,21 +3997,21 @@ class Interpretation extends Fields { $methods = ''; // then set the needed custom methods - if (ComponentbuilderHelper::checkArray($main_view) + if (ArrayHelper::check($main_view) && isset($main_view['settings']) - && ComponentbuilderHelper::checkObject($main_view['settings']) + && ObjectHelper::check($main_view['settings']) && isset($main_view['settings']->custom_get)) { $_dynamic_get = $main_view['settings']->custom_get; } - elseif (ComponentbuilderHelper::checkObject($main_view) + elseif (ObjectHelper::check($main_view) && isset($main_view->custom_get)) { $_dynamic_get = $main_view->custom_get; } // check if we have an array if (isset($_dynamic_get) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $_dynamic_get )) { @@ -4015,11 +4019,11 @@ class Interpretation extends Fields foreach ($_dynamic_get as $view) { // fix alias to use in code - $view->code = ComponentbuilderHelper::safeString($code); - $view->Code = ComponentbuilderHelper::safeString( + $view->code = StringHelper::safe($code); + $view->Code = StringHelper::safe( $view->code, 'F' ); - $view->CODE = ComponentbuilderHelper::safeString( + $view->CODE = StringHelper::safe( $view->code, 'U' ); $main = ''; @@ -4077,7 +4081,7 @@ class Interpretation extends Fields if (isset($view->add_php_getlistquery) && $view->add_php_getlistquery == 1 && isset($view->php_getlistquery) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view->php_getlistquery )) { @@ -4093,7 +4097,7 @@ class Interpretation extends Fields if (isset($view->add_php_before_getitems) && $view->add_php_before_getitems == 1 && isset($view->php_before_getitems) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view->php_before_getitems )) { @@ -4113,7 +4117,7 @@ class Interpretation extends Fields if (isset($view->add_php_after_getitems) && $view->add_php_after_getitems == 1 && isset($view->php_after_getitems) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view->php_after_getitems )) { @@ -4146,7 +4150,7 @@ class Interpretation extends Fields } } // load uikit get method - if (ComponentbuilderHelper::checkArray($main_view) + if (ArrayHelper::check($main_view) && isset($main_view['settings'])) { $methods .= $this->setUikitGetMethod(); @@ -4314,7 +4318,7 @@ class Interpretation extends Fields public function setMainCustomMehtod(&$body, $nAme, $type) { $method = ''; - if (ComponentbuilderHelper::checkString($body)) + if (StringHelper::check($body)) { // build custom method $method .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; @@ -4337,10 +4341,10 @@ class Interpretation extends Fields $methods = ''; $this->JEventDispatcher = ''; // first set the needed item/s methods - if (ComponentbuilderHelper::checkObject($main_get)) + if (ObjectHelper::check($main_get)) { if (isset($main_get->custom_get) - && ComponentbuilderHelper::checkArray($main_get->custom_get)) + && ArrayHelper::check($main_get->custom_get)) { foreach ($main_get->custom_get as $get) { @@ -4432,12 +4436,12 @@ class Interpretation extends Fields // check if other queries should be loaded $queryChecker = (isset($this->otherQuery[$this->target][$default['code']][$default['as']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->otherQuery[$this->target][$default['code']][$default['as']] )) ? $this->otherQuery[$this->target][$default['code']][$default['as']] : ''; - if (ComponentbuilderHelper::checkArray($queryChecker)) + if (ArrayHelper::check($queryChecker)) { foreach ($queryChecker as $query) { @@ -4446,7 +4450,7 @@ class Interpretation extends Fields } // add any other filter that was set if (isset($this->otherFilter[$this->target][$default['code']][$default['as']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->otherFilter[$this->target][$default['code']][$default['as']] )) { @@ -4460,7 +4464,7 @@ class Interpretation extends Fields } // add any other where that was set if (isset($this->otherWhere[$this->target][$default['code']][$default['as']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->otherWhere[$this->target][$default['code']][$default['as']] )) { @@ -4474,7 +4478,7 @@ class Interpretation extends Fields } // add any other order that was set if (isset($this->otherOrder[$this->target][$default['code']][$default['as']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->otherOrder[$this->target][$default['code']][$default['as']] )) { @@ -4488,7 +4492,7 @@ class Interpretation extends Fields } // add any other grouping that was set if (isset($this->otherGroup[$this->target][$default['code']][$default['as']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->otherGroup[$this->target][$default['code']][$default['as']] )) { @@ -4545,34 +4549,34 @@ class Interpretation extends Fields . $this->hhh => '$item'); $joinedChecker = (isset($this->otherJoin[$this->target][$default['code']][$default['as']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->otherJoin[$this->target][$default['code']][$default['as']] )) ? $this->otherJoin[$this->target][$default['code']][$default['as']] : ''; if ((isset($decodeChecker) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $decodeChecker )) || (isset($uikitChecker) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $uikitChecker )) || (isset($decodeFilter) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $decodeFilter )) || (isset($contentprepareChecker) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $contentprepareChecker )) - || ComponentbuilderHelper::checkArray( + || ArrayHelper::check( $joinedChecker )) { $decoder = ''; if (isset($decodeChecker) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $decodeChecker )) { @@ -4584,7 +4588,7 @@ class Interpretation extends Fields } $decoder_filter = ''; if (isset($decodeFilter) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $decodeFilter )) { @@ -4596,7 +4600,7 @@ class Interpretation extends Fields } $contentprepare = ''; if (isset($contentprepareChecker) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $contentprepareChecker )) { @@ -4608,7 +4612,7 @@ class Interpretation extends Fields } $uikit = ''; if (isset($uikitChecker) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $uikitChecker )) { @@ -4618,7 +4622,7 @@ class Interpretation extends Fields ); } $joine = ''; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $joinedChecker )) { @@ -4629,15 +4633,15 @@ class Interpretation extends Fields ); } } - if (ComponentbuilderHelper::checkString($decoder) - || ComponentbuilderHelper::checkString( + if (StringHelper::check($decoder) + || StringHelper::check( $contentprepare ) - || ComponentbuilderHelper::checkString($uikit) - || ComponentbuilderHelper::checkString( + || StringHelper::check($uikit) + || StringHelper::check( $decoder_filter ) - || ComponentbuilderHelper::checkString($joine)) + || StringHelper::check($joine)) { $methods .= PHP_EOL . $this->_t(3) . "\$items = \$db->loadObjectList();"; @@ -4647,29 +4651,29 @@ class Interpretation extends Fields $methods .= PHP_EOL . $this->_t(3) . "foreach (\$items as \$nr => &\$item)"; $methods .= PHP_EOL . $this->_t(3) . "{"; - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $decoder )) { $methods .= $decoder; } - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $decoder_filter )) { $methods .= $decoder_filter; } - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $contentprepare )) { $methods .= $contentprepare; } - if (ComponentbuilderHelper::checkString($uikit)) + if (StringHelper::check($uikit)) { $methods .= $uikit; } - if (ComponentbuilderHelper::checkString($joine)) + if (StringHelper::check($joine)) { $methods .= $joine; } @@ -4747,7 +4751,7 @@ class Interpretation extends Fields } } // insure the crypt placeholder is removed - if (ComponentbuilderHelper::checkString($methods)) + if (StringHelper::check($methods)) { $methods = str_replace( $this->hhh . 'CRYPT' . $this->hhh, '', $methods @@ -4760,7 +4764,7 @@ class Interpretation extends Fields { // check if the dispather should be added if (!isset($this->JEventDispatcher) - || !ComponentbuilderHelper::checkArray($this->JEventDispatcher)) + || !ArrayHelper::check($this->JEventDispatcher)) { $this->JEventDispatcher = array($this->hhh . 'DISPATCHER' . $this->hhh => ''); @@ -4771,7 +4775,7 @@ class Interpretation extends Fields ); } // insure the crypt placeholder is removed - if (ComponentbuilderHelper::checkString($methods)) + if (StringHelper::check($methods)) { return $methods . PHP_EOL; } @@ -4784,32 +4788,32 @@ class Interpretation extends Fields if (isset($get['key']) && isset($get['as'])) { $key = substr( - ComponentbuilderHelper::safeString( + StringHelper::safe( preg_replace('/[0-9]+/', '', md5($get['key'])), 'F' ), 0, 4 ); $method['on_field'] = (isset($get['on_field'])) ? $this->removeAsDot($get['on_field']) : null; $method['join_field'] = (isset($get['join_field'])) - ? ComponentbuilderHelper::safeString( + ? StringHelper::safe( $this->removeAsDot($get['join_field']) ) : null; $method['Join_field'] = (isset($method['join_field'])) - ? ComponentbuilderHelper::safeString($method['join_field'], 'F') + ? StringHelper::safe($method['join_field'], 'F') : null; - $method['name'] = ComponentbuilderHelper::safeString( + $method['name'] = StringHelper::safe( $get['selection']['name'], 'F' ); - $method['code'] = ComponentbuilderHelper::safeString($code); - $method['AS'] = ComponentbuilderHelper::safeString( + $method['code'] = StringHelper::safe($code); + $method['AS'] = StringHelper::safe( $get['as'], 'U' ); - $method['as'] = ComponentbuilderHelper::safeString( + $method['as'] = StringHelper::safe( $get['as'] ); $method['valueName'] = $method['on_field'] . $method['Join_field'] . $method['name'] . $method['AS']; - $method['methodName'] = ComponentbuilderHelper::safeString( + $method['methodName'] = StringHelper::safe( $method['on_field'], 'F' ) . $method['Join_field'] . $method['name'] . $key . '_' . $method['AS']; @@ -4823,7 +4827,7 @@ class Interpretation extends Fields public function setCustomViewListQuery(&$get, $code, $return = true) { - if (ComponentbuilderHelper::checkObject($get)) + if (ObjectHelper::check($get)) { if ($get->pagination == 1) { @@ -4910,7 +4914,7 @@ class Interpretation extends Fields $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; // start load the get item - if (ComponentbuilderHelper::checkObject($get)) + if (ObjectHelper::check($get)) { $getItem .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) @@ -4927,7 +4931,7 @@ class Interpretation extends Fields $getItem .= PHP_EOL . $this->_t(4) . "\$item->slug = (isset(\$item->alias) && isset(\$item->id)) ? \$item->id.':'.\$item->alias : \$item->id;"; if (isset($get->main_get) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $get->main_get )) { @@ -4938,7 +4942,7 @@ class Interpretation extends Fields { $decodeChecker = $this->siteFieldData['decode'][$code][$main_get['key']][$main_get['as']]; - if (ComponentbuilderHelper::checkArray($decodeChecker)) + if (ArrayHelper::check($decodeChecker)) { // set decoding of needed fields $getItem .= $this->setCustomViewFieldDecode( @@ -4952,7 +4956,7 @@ class Interpretation extends Fields { $decodeFilter = $this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']]; - if (ComponentbuilderHelper::checkArray($decodeFilter)) + if (ArrayHelper::check($decodeFilter)) { $getItem .= $this->setCustomViewFieldDecodeFilter( $main_get, $decodeFilter, "\$item", @@ -4964,7 +4968,7 @@ class Interpretation extends Fields { $contentprepareChecker = $this->siteFieldData['textareas'][$code][$main_get['key']][$main_get['as']]; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $contentprepareChecker )) { @@ -4979,7 +4983,7 @@ class Interpretation extends Fields { $uikitChecker = $this->siteFieldData['uikit'][$code][$main_get['key']][$main_get['as']]; - if (ComponentbuilderHelper::checkArray($uikitChecker)) + if (ArrayHelper::check($uikitChecker)) { // set uikit checkers on needed fields $getItem .= $this->setCustomViewFieldUikitChecker( @@ -4997,7 +5001,7 @@ class Interpretation extends Fields { // check if the dispather should be added if (!isset($this->JEventDispatcher) - || !ComponentbuilderHelper::checkArray( + || !ArrayHelper::check( $this->JEventDispatcher )) { @@ -5023,7 +5027,7 @@ class Interpretation extends Fields $get->php_calculation = (array) explode( PHP_EOL, $get->php_calculation ); - if (ComponentbuilderHelper::checkArray($get->php_calculation)) + if (ArrayHelper::check($get->php_calculation)) { $_tmp = PHP_EOL . $this->_t(4) . implode( PHP_EOL . $this->_t(4), $get->php_calculation @@ -5135,12 +5139,12 @@ class Interpretation extends Fields { $method = ''; if (isset($view['settings']->main_get) - && ComponentbuilderHelper::checkObject($view['settings']->main_get)) + && ObjectHelper::check($view['settings']->main_get)) { // add events if needed if ($view['settings']->main_get->gettype == 1 - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $view['settings']->main_get->plugin_events )) { @@ -5177,7 +5181,7 @@ class Interpretation extends Fields } // add the custom get methods if (isset($view['settings']->custom_get) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $view['settings']->custom_get )) { @@ -5187,7 +5191,7 @@ class Interpretation extends Fields 'get', '', $custom_get->getcustom ); $method .= PHP_EOL . $this->_t(2) . "\$this->" - . ComponentbuilderHelper::safeString($custom_get_name) + . StringHelper::safe($custom_get_name) . " = \$this->get('" . $custom_get_name . "');"; } } @@ -5197,7 +5201,7 @@ class Interpretation extends Fields $view['settings']->php_jview_display = (array) explode( PHP_EOL, $view['settings']->php_jview_display ); - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $view['settings']->php_jview_display )) { @@ -5249,7 +5253,7 @@ class Interpretation extends Fields $method .= PHP_EOL . $this->_t(2) . "}"; // add events if needed if ($view['settings']->main_get->gettype == 1 - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $view['settings']->main_get->plugin_events )) { @@ -5326,7 +5330,7 @@ class Interpretation extends Fields } // ensure correct target is set - $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); + $TARGET = StringHelper::safe($this->target, 'U'); // set libraries $TARGET.'_LIBRARIES_LOADER $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET @@ -5511,7 +5515,7 @@ class Interpretation extends Fields $view['settings']->php_document = (array) explode( PHP_EOL, $view['settings']->php_document ); - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $view['settings']->php_document )) { @@ -5531,7 +5535,7 @@ class Interpretation extends Fields // do not validate selection $validateSelection = 'false'; // ensure correct target is set - $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); + $TARGET = StringHelper::safe($this->target, 'U'); if (1 == $type || 2 == $type) { if (1 == $type) @@ -5641,7 +5645,7 @@ class Interpretation extends Fields $this->onlyFunctionButton = array(); $functionNames = array(); if (isset($view['settings']->custom_buttons) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $view['settings']->custom_buttons )) { @@ -5649,10 +5653,10 @@ class Interpretation extends Fields { // Load to lang $keyLang = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $custom_button['name'], 'U' ); - $keyCode = ComponentbuilderHelper::safeString( + $keyCode = StringHelper::safe( $custom_button['name'] ); $this->setLangContent( @@ -5770,7 +5774,7 @@ class Interpretation extends Fields { // insure the controller and model strings are added if (isset($view['settings']->php_controller_list) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view['settings']->php_controller_list ) && $view['settings']->php_controller_list != '//') @@ -5786,7 +5790,7 @@ class Interpretation extends Fields } // load the model if (isset($view['settings']->php_model_list) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view['settings']->php_model_list ) && $view['settings']->php_model_list != '//') @@ -5804,7 +5808,7 @@ class Interpretation extends Fields else { // insure the controller and model strings are added - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $view['settings']->php_controller ) && $view['settings']->php_controller != '//') @@ -5827,7 +5831,7 @@ class Interpretation extends Fields } } // load the model - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $view['settings']->php_model ) && $view['settings']->php_model != '//') @@ -5843,18 +5847,18 @@ class Interpretation extends Fields } } // return buttons if they were build - if (ComponentbuilderHelper::checkArray($buttons)) + if (ArrayHelper::check($buttons)) { // just to check if the submission script is manually added if (!isset($view['settings']->php_document) - || (ComponentbuilderHelper::checkArray( + || (ArrayHelper::check( $view['settings']->php_document ) && strpos( implode(' ', $view['settings']->php_document), '/submitbutton.js' ) === false) - || (ComponentbuilderHelper::checkString( + || (StringHelper::check( $view['settings']->php_document ) && strpos( @@ -5901,7 +5905,7 @@ class Interpretation extends Fields { // return buttons if they were build if (isset($this->onlyFunctionButton[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->onlyFunctionButton[$nameListCode] )) { @@ -5917,7 +5921,7 @@ class Interpretation extends Fields { if ($view['settings']->add_css == 1) { - if (ComponentbuilderHelper::checkString($view['settings']->css)) + if (StringHelper::check($view['settings']->css)) { return $this->setPlaceholders( $view['settings']->css, $this->placeholders @@ -5935,7 +5939,7 @@ class Interpretation extends Fields $view['settings']->css_document = (array) explode( PHP_EOL, $view['settings']->css_document ); - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $view['settings']->css_document )) { @@ -5962,7 +5966,7 @@ class Interpretation extends Fields public function setJavaScriptFile(&$view, $TARGET) { if ($view['settings']->add_javascript_file == 1 - && ComponentbuilderHelper::checkString( + && StringHelper::check( $view['settings']->javascript_file )) { @@ -6013,7 +6017,7 @@ class Interpretation extends Fields $view['settings']->js_document = (array) explode( PHP_EOL, $view['settings']->js_document ); - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $view['settings']->js_document )) { @@ -6062,7 +6066,7 @@ class Interpretation extends Fields // if we do then it posibly can be that the metadata is loaded via that method // and we can load the full metadata structure with its vars if (isset($view['settings']->custom_get) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $view['settings']->custom_get )) { @@ -6276,18 +6280,18 @@ class Interpretation extends Fields } // check if this view should get libraries if (isset($this->libManager[$this->target][$code]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->libManager[$this->target][$code] )) { foreach ($this->libManager[$this->target][$code] as $id => $true) { if (isset($this->libraries[$id]) - && ComponentbuilderHelper::checkObject( + && ObjectHelper::check( $this->libraries[$id] ) && isset($this->libraries[$id]->document) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->libraries[$id]->document )) { @@ -6299,7 +6303,7 @@ class Interpretation extends Fields ); } elseif (isset($this->libraries[$id]) - && ComponentbuilderHelper::checkObject( + && ObjectHelper::check( $this->libraries[$id] ) && isset($this->libraries[$id]->how)) @@ -6321,7 +6325,7 @@ class Interpretation extends Fields { if (2 == $this->libraries[$id]->how && isset($this->libraries[$id]->conditions) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->libraries[$id]->conditions )) { @@ -6337,7 +6341,7 @@ class Interpretation extends Fields } // check if the document was build if (isset($this->libraries[$id]->document) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->libraries[$id]->document )) { @@ -6366,7 +6370,7 @@ class Interpretation extends Fields $this->libwarning[$id] = true; } // if there was any code added to document then set globaly - if (ComponentbuilderHelper::checkString($document)) + if (StringHelper::check($document)) { $this->libraries[$id]->document = $document; } @@ -6377,7 +6381,7 @@ class Interpretation extends Fields $scripts = array(); // load the urls if found if (isset($this->libraries[$id]->urls) - && ComponentbuilderHelper::checkArray($this->libraries[$id]->urls)) + && ArrayHelper::check($this->libraries[$id]->urls)) { // set all the files foreach ($this->libraries[$id]->urls as $url) @@ -6411,7 +6415,7 @@ class Interpretation extends Fields } // load the local files if found if (isset($this->libraries[$id]->files) - && ComponentbuilderHelper::checkArray($this->libraries[$id]->files)) + && ArrayHelper::check($this->libraries[$id]->files)) { // set all the files foreach ($this->libraries[$id]->files as $file) @@ -6440,7 +6444,7 @@ class Interpretation extends Fields } // load the local folders if found if (isset($this->libraries[$id]->folders) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->libraries[$id]->folders )) { @@ -6487,7 +6491,7 @@ class Interpretation extends Fields } } // if there was any code added to document then set globaly - if ($buildDoc && ComponentbuilderHelper::checkArray($scripts)) + if ($buildDoc && ArrayHelper::check($scripts)) { $this->libraries[$id]->document = $this->_t(2) . "//" . $this->setLine(__LINE__) . " always load these files." @@ -6498,7 +6502,7 @@ class Interpretation extends Fields // success return true; } - elseif (ComponentbuilderHelper::checkArray($scripts)) + elseif (ArrayHelper::check($scripts)) { return $scripts; } @@ -6656,7 +6660,7 @@ class Interpretation extends Fields // load the components need if ((2 == $this->uikit || 1 == $this->uikit) && isset($this->uikitComp[$view['settings']->code]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->uikitComp[$view['settings']->code] )) { @@ -6677,7 +6681,7 @@ class Interpretation extends Fields } // check content for more needed components if (isset($this->siteFieldData['uikit'][$view['settings']->code]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->siteFieldData['uikit'][$view['settings']->code] )) { @@ -6779,7 +6783,7 @@ class Interpretation extends Fields } elseif ((2 == $this->uikit || 1 == $this->uikit) && isset($this->siteFieldData['uikit'][$view['settings']->code]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->siteFieldData['uikit'][$view['settings']->code] )) { @@ -6920,7 +6924,7 @@ class Interpretation extends Fields public function setCustomViewBody(&$view) { - if (ComponentbuilderHelper::checkString($view['settings']->default)) + if (StringHelper::check($view['settings']->default)) { if ($view['settings']->main_get->gettype == 2 && $view['settings']->main_get->pagination == 1) @@ -7131,7 +7135,7 @@ class Interpretation extends Fields public function setCustomViewSubmitButtonScript(&$view) { - if (ComponentbuilderHelper::checkString($view['settings']->default)) + if (StringHelper::check($view['settings']->default)) { // add the script only if there is none set if (strpos( @@ -7170,7 +7174,7 @@ class Interpretation extends Fields $view['settings']->php_view = (array) explode( PHP_EOL, $view['settings']->php_view ); - if (ComponentbuilderHelper::checkArray($view['settings']->php_view)) + if (ArrayHelper::check($view['settings']->php_view)) { $_tmp = PHP_EOL . PHP_EOL . implode( PHP_EOL, $view['settings']->php_view @@ -7186,7 +7190,7 @@ class Interpretation extends Fields public function setCustomViewTemplateBody(&$view) { if (isset($this->templateData[$this->target][$view['settings']->code]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->templateData[$this->target][$view['settings']->code] )) { @@ -7207,7 +7211,7 @@ class Interpretation extends Fields . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'template', $template, $config); // set the file data - $TARGET = ComponentbuilderHelper::safeString( + $TARGET = StringHelper::safe( $this->target, 'U' ); // SITE_TEMPLATE_BODY <<>> @@ -7228,10 +7232,10 @@ class Interpretation extends Fields public function setCustomViewTemplateCode(&$php) { - if (ComponentbuilderHelper::checkString($php)) + if (StringHelper::check($php)) { $php_view = (array) explode(PHP_EOL, $php); - if (ComponentbuilderHelper::checkArray($php_view)) + if (ArrayHelper::check($php_view)) { $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); @@ -7245,7 +7249,7 @@ class Interpretation extends Fields public function setCustomViewLayouts() { if (isset($this->layoutData[$this->target]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->layoutData[$this->target] )) { @@ -7255,12 +7259,12 @@ class Interpretation extends Fields $target = array($this->target => $layout); $this->buildDynamique($target, 'layout'); // set the file data - $TARGET = ComponentbuilderHelper::safeString( + $TARGET = StringHelper::safe( $this->target, 'U' ); // SITE_LAYOUT_CODE <<>> $php_view = (array) explode(PHP_EOL, $data['php_view']); - if (ComponentbuilderHelper::checkArray($php_view)) + if (ArrayHelper::check($php_view)) { $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); $this->fileContentDynamic[$layout][$this->hhh . $TARGET @@ -7299,7 +7303,7 @@ class Interpretation extends Fields foreach ($files as $view => $file) { if (isset($file['path']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $file )) { @@ -7313,11 +7317,11 @@ class Interpretation extends Fields ); } } - elseif (ComponentbuilderHelper::checkArray($file)) + elseif (ArrayHelper::check($file)) { foreach ($file as $nr => $doc) { - if (ComponentbuilderHelper::checkArray($doc)) + if (ArrayHelper::check($doc)) { if (File::exists($doc['path'])) { @@ -7371,7 +7375,7 @@ class Interpretation extends Fields . $this->hhh]; // go from base64 to string if (isset($this->base64Builder[$view]) - && ComponentbuilderHelper::checkArray($this->base64Builder[$view])) + && ArrayHelper::check($this->base64Builder[$view])) { foreach ($this->base64Builder[$view] as $baseString) { @@ -7391,7 +7395,7 @@ class Interpretation extends Fields foreach ($this->cryptionTypes as $cryptionType) { if (isset($this->{$cryptionType . 'FieldModeling'}[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->{$cryptionType . 'FieldModeling'}[$view] )) { @@ -7467,7 +7471,7 @@ class Interpretation extends Fields } // go from json to array if (isset($this->jsonItemBuilder[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->jsonItemBuilder[$view] )) { @@ -7490,7 +7494,7 @@ class Interpretation extends Fields } // go from json to string if (isset($this->jsonStringBuilder[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->jsonStringBuilder[$view] )) { @@ -7504,7 +7508,7 @@ class Interpretation extends Fields __LINE__ ) . " JSON Decode " . $jsonString . "."; if (isset($this->jsonItemBuilderArray[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->jsonItemBuilderArray[$view] ) && in_array( @@ -7550,7 +7554,7 @@ class Interpretation extends Fields { $script = ''; if (isset($this->checkboxBuilder[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->checkboxBuilder[$view] )) { @@ -7584,7 +7588,7 @@ class Interpretation extends Fields ); // turn array into JSON string if (isset($this->jsonItemBuilder[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->jsonItemBuilder[$view] )) { @@ -7606,7 +7610,7 @@ class Interpretation extends Fields $script .= PHP_EOL . $this->_t(2) . "}"; if (isset($this->permissionFields[$view]) && isset($this->permissionFields[$view][$jsonItem]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionFields[$view][$jsonItem] )) { @@ -7650,7 +7654,7 @@ class Interpretation extends Fields } // turn string into json string if (isset($this->jsonStringBuilder[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->jsonStringBuilder[$view] )) { @@ -7670,7 +7674,7 @@ class Interpretation extends Fields } // turn string into base 64 string if (isset($this->base64Builder[$view]) - && ComponentbuilderHelper::checkArray($this->base64Builder[$view])) + && ArrayHelper::check($this->base64Builder[$view])) { foreach ($this->base64Builder[$view] as $baseString) { @@ -7689,7 +7693,7 @@ class Interpretation extends Fields foreach ($this->cryptionTypes as $cryptionType) { if (isset($this->{$cryptionType . 'FieldModeling'}[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->{$cryptionType . 'FieldModeling'}[$view] )) { @@ -7779,7 +7783,7 @@ class Interpretation extends Fields $component = $this->componentCodeName; // add the tags observer if (isset($this->tagsBuilder[$view]) - && ComponentbuilderHelper::checkString($this->tagsBuilder[$view])) + && StringHelper::check($this->tagsBuilder[$view])) { $oserver .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Adding Tag Options"; @@ -7789,7 +7793,7 @@ class Interpretation extends Fields } // add the history/version observer if (isset($this->historyBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->historyBuilder[$view] )) { @@ -7820,7 +7824,7 @@ class Interpretation extends Fields { $script = ''; if (isset($this->componentData->admin_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->admin_views )) { @@ -7832,21 +7836,21 @@ class Interpretation extends Fields foreach ($this->componentData->admin_views as $viewData) { // set main keys - $view = ComponentbuilderHelper::safeString( + $view = StringHelper::safe( $viewData['settings']->name_single ); // set list view keys - $views = ComponentbuilderHelper::safeString( + $views = StringHelper::safe( $viewData['settings']->name_list ); // get this views content type data $dbStuff[$view] = $this->getContentType($view, $component); // get the correct views name $checkViews = (isset($this->catCodeBuilder[$view]['views']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->catCodeBuilder[$view]['views'] )) ? $this->catCodeBuilder[$view]['views'] : $views; - if (ComponentbuilderHelper::checkArray($dbStuff[$view]) + if (ArrayHelper::check($dbStuff[$view]) && array_key_exists($view, $this->catCodeBuilder) && ($checkViews == $views)) { @@ -7856,14 +7860,14 @@ class Interpretation extends Fields ); } elseif (!isset($dbStuff[$view]) - || !ComponentbuilderHelper::checkArray($dbStuff[$view])) + || !ArrayHelper::check($dbStuff[$view])) { // remove if not array unset($dbStuff[$view]); } } // build the db insert query - if (ComponentbuilderHelper::checkArray($dbStuff)) + if (ArrayHelper::check($dbStuff)) { $taabb = ''; if ($action === 'update') @@ -7876,9 +7880,9 @@ class Interpretation extends Fields . "\$db = JFactory::getDbo();"; foreach ($dbStuff as $name => $tables) { - if (ComponentbuilderHelper::checkArray($tables)) + if (ArrayHelper::check($tables)) { - $code = ComponentbuilderHelper::safeString($name); + $code = StringHelper::safe($name); $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create the " . $name . " content type object."; @@ -7956,11 +7960,11 @@ class Interpretation extends Fields // add the assets table update for permissions rules if (isset($this->assetsRules) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->assetsRules )) { - if (ComponentbuilderHelper::checkString($script)) + if (StringHelper::check($script)) { $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( __LINE__ @@ -7970,7 +7974,7 @@ class Interpretation extends Fields { $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( __LINE__ - ) . " Install the global extenstion assets permission."; + ) . " Install the global extension assets permission."; $script .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDbo();"; } @@ -7999,9 +8003,9 @@ class Interpretation extends Fields } // add the global params for the component global settings if (isset($this->extensionsParams) - && ComponentbuilderHelper::checkArray($this->extensionsParams)) + && ArrayHelper::check($this->extensionsParams)) { - if (ComponentbuilderHelper::checkString($script)) + if (StringHelper::check($script)) { $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( __LINE__ @@ -8044,7 +8048,7 @@ class Interpretation extends Fields // add the Intelligent Fix script if needed $script .= $this->getAssetsTableIntelligentInstall(); // add the component install notice - if (ComponentbuilderHelper::checkString($script)) + if (StringHelper::check($script)) { $script .= PHP_EOL . $this->_t(3) . 'echo \'';"; } - if (ComponentbuilderHelper::checkString($script)) + if (StringHelper::check($script)) { return $script; } @@ -8107,7 +8111,7 @@ class Interpretation extends Fields // reset script $script = ''; if (isset($this->uninstallScriptBuilder) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->uninstallScriptBuilder )) { @@ -8127,7 +8131,7 @@ class Interpretation extends Fields ) { // set a var value - $view = ComponentbuilderHelper::safeString($viewsCodeName); + $view = StringHelper::safe($viewsCodeName); // check if it has field relations if (isset($this->uninstallScriptFields) @@ -8714,8 +8718,8 @@ class Interpretation extends Fields $script[] = $messageA; $script[] = $this->_t($tab) . $this->_t(2) . "}"; // only ad this if there is a B part - if (ComponentbuilderHelper::checkString($codeB) - || ComponentbuilderHelper::checkString($messageB)) + if (StringHelper::check($codeB) + || StringHelper::check($messageB)) { $script[] = $this->_t($tab) . $this->_t(2) . "else"; $script[] = $this->_t($tab) . $this->_t(2) . "{"; @@ -8813,11 +8817,11 @@ class Interpretation extends Fields { // add if history is to be kept or if tags is added if ((isset($this->historyBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->historyBuilder[$view] )) || (isset($this->tagsBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->tagsBuilder[$view] ))) { @@ -8835,28 +8839,28 @@ class Interpretation extends Fields '{"sourceColumn": "' . $category . '","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},' : ''; - $Component = ComponentbuilderHelper::safeString( + $Component = StringHelper::safe( $component, 'F' ); - $View = ComponentbuilderHelper::safeString($view, 'F'); + $View = StringHelper::safe($view, 'F'); $maintext = (isset($this->maintextBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->maintextBuilder[$view] )) ? $this->maintextBuilder[$view] : 'null'; $hiddenFields = (isset($this->hiddenFieldsBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->hiddenFieldsBuilder[$view] )) ? $this->hiddenFieldsBuilder[$view] : ''; $dynamicfields = (isset($this->dynamicfieldsBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->dynamicfieldsBuilder[$view] )) ? $this->dynamicfieldsBuilder[$view] : ''; $intFields = (isset($this->intFieldsBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->intFieldsBuilder[$view] )) ? $this->intFieldsBuilder[$view] : ''; $customfieldlinks = (isset($this->customFieldLinksBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->customFieldLinksBuilder[$view] )) ? $this->customFieldLinksBuilder[$view] : ''; // build uninstall script for content types @@ -8865,7 +8869,7 @@ class Interpretation extends Fields $this->uninstallScriptContent[$view] = $view; // check if this view has metadata if (isset($this->metadataBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->metadataBuilder[$view] )) { @@ -8881,7 +8885,7 @@ class Interpretation extends Fields } // check if view has access if (isset($this->accessBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$view] )) { @@ -8946,8 +8950,8 @@ class Interpretation extends Fields // get the other view $otherView = $this->catCodeBuilder[$view]['view']; $category = $this->catCodeBuilder[$view]['code']; - $Component = ComponentbuilderHelper::safeString($component, 'F'); - $View = ComponentbuilderHelper::safeString($view, 'F'); + $Component = StringHelper::safe($component, 'F'); + $View = StringHelper::safe($view, 'F'); // build uninstall script for content types $this->uninstallScriptBuilder[$View . ' ' . $category] = 'com_' . $component . '.' . $otherView . '.category'; @@ -8955,7 +8959,7 @@ class Interpretation extends Fields . $category; // set the title $array['type_title'] = $Component . ' ' . $View . ' ' - . ComponentbuilderHelper::safeString($category, 'F'); + . StringHelper::safe($category, 'F'); // set the alias $array['type_alias'] = 'com_' . $component . '.' . $otherView . '.category'; @@ -8980,7 +8984,7 @@ class Interpretation extends Fields { // add if tags is added, also for all front item views if (((isset($this->tagsBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->tagsBuilder[$nameSingleCode] )) || $front) @@ -8989,7 +8993,7 @@ class Interpretation extends Fields // insure we load a view only once $this->setRouterHelpDone[] = $nameSingleCode; // build view route helper - $View = ComponentbuilderHelper::safeString( + $View = StringHelper::safe( $nameSingleCode, 'F' ); $routeHelper = array(); @@ -9088,7 +9092,7 @@ class Interpretation extends Fields $routerSwitch = array(); $isCategory = ''; $viewTable = false; - if ($viewArray && ComponentbuilderHelper::checkArray($viewArray) + if ($viewArray && ArrayHelper::check($viewArray) && isset($viewArray['settings']) && isset($viewArray['settings']->main_get)) { @@ -9096,7 +9100,7 @@ class Interpretation extends Fields if (isset($viewArray['settings']->main_get->add_php_router_parse) && $viewArray['settings']->main_get->add_php_router_parse == 1 && isset($viewArray['settings']->main_get->php_router_parse) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $viewArray['settings']->main_get->php_router_parse )) { @@ -9120,7 +9124,7 @@ class Interpretation extends Fields } // get the main table name elseif (isset($viewArray['settings']->main_get->main_get) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $viewArray['settings']->main_get->main_get )) { @@ -9129,11 +9133,11 @@ class Interpretation extends Fields if (isset($get['as']) && $get['as'] === 'a') { if (isset($get['selection']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $get['selection'] ) && isset($get['selection']['select_gets']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $get['selection']['select_gets'] )) { @@ -9214,7 +9218,7 @@ class Interpretation extends Fields $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] ) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] )) @@ -9232,7 +9236,7 @@ class Interpretation extends Fields // set needed defaults $category = false; $batchmove = array(); - $VIEW = ComponentbuilderHelper::safeString($nameSingleCode, 'U'); + $VIEW = StringHelper::safe($nameSingleCode, 'U'); // component helper name $Helper = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper'; @@ -9287,7 +9291,7 @@ class Interpretation extends Fields if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit']] ) && in_array( @@ -9314,7 +9318,7 @@ class Interpretation extends Fields . " make sure published only updates if user has the permission."; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit.state']] ) && in_array( @@ -9368,7 +9372,7 @@ class Interpretation extends Fields $batchmove[] = $this->_t(2) . "{"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit']] ) && in_array( @@ -9480,7 +9484,7 @@ class Interpretation extends Fields $alias = false; $category = false; $batchcopy = array(); - $VIEW = ComponentbuilderHelper::safeString($nameSingleCode, 'U'); + $VIEW = StringHelper::safe($nameSingleCode, 'U'); // component helper name $Helper = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper'; @@ -9566,7 +9570,7 @@ class Interpretation extends Fields $batchcopy[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.create']] ) && in_array( @@ -9603,7 +9607,7 @@ class Interpretation extends Fields $batchcopy[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit.state']] ) && in_array( @@ -9663,7 +9667,7 @@ class Interpretation extends Fields . " only allow copy if user may edit this item."; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit']] ) && in_array( @@ -9879,7 +9883,7 @@ class Interpretation extends Fields // set needed defaults $setCategory = false; $alias = $this->aliasBuilder[$nameSingleCode]; - $VIEW = ComponentbuilderHelper::safeString( + $VIEW = StringHelper::safe( $nameSingleCode, 'U' ); if (array_key_exists($nameSingleCode, $this->catCodeBuilder)) @@ -10212,7 +10216,7 @@ class Interpretation extends Fields // reset the bucket $titleData = array(); // load the dynamic title builder - if (isset($titles) && ComponentbuilderHelper::checkArray($titles)) + if (isset($titles) && ArrayHelper::check($titles)) { foreach ($titles as $title) { @@ -10274,7 +10278,7 @@ class Interpretation extends Fields public function setInstall() { if (isset($this->queryBuilder) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->queryBuilder )) { @@ -10371,7 +10375,7 @@ class Interpretation extends Fields // check if this a new field that should be added via SQL update if (isset($this->addSQL['field']) && isset($this->addSQL['field'][$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->addSQL['field'][$view] ) && in_array($data['ID'], $this->addSQL['field'][$view])) @@ -10493,7 +10497,7 @@ class Interpretation extends Fields } // check if view has access if (isset($this->accessBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$view] ) && !isset($this->fieldsNames[$view]['access'])) @@ -10509,7 +10513,7 @@ class Interpretation extends Fields } // check if metadata is added to this view if (isset($this->metadataBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->metadataBuilder[$view] )) { @@ -10537,7 +10541,7 @@ class Interpretation extends Fields // check if a key was set for any of the default fields then we should not set it again $check_keys_set = array(); if (isset($this->dbUniqueKeys[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->dbUniqueKeys[$view] )) { @@ -10549,7 +10553,7 @@ class Interpretation extends Fields } } if (isset($this->dbKeys[$view]) - && ComponentbuilderHelper::checkArray($this->dbKeys[$view])) + && ArrayHelper::check($this->dbKeys[$view])) { foreach ($this->dbKeys[$view] as $nr => $key) { @@ -10561,7 +10565,7 @@ class Interpretation extends Fields // check if view has access if (!isset($check_keys_set['access']) && isset($this->accessBuilder[$view]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$view] )) { @@ -10600,7 +10604,7 @@ class Interpretation extends Fields ) { if (isset($this->mysqlTableSetting[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->mysqlTableSetting[$view] ) && isset($this->mysqlTableSetting[$view][$_mysqlTableKey])) @@ -10615,7 +10619,7 @@ class Interpretation extends Fields } } // add a little fix for the row_format - if (ComponentbuilderHelper::checkString($easy['row_format'])) + if (StringHelper::check($easy['row_format'])) { $easy['row_format'] = ' ROW_FORMAT=' . $easy['row_format']; } @@ -10627,7 +10631,7 @@ class Interpretation extends Fields // check if this is a new table that should be added via update SQL if (isset($this->addSQL['adminview']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->addSQL['adminview'] ) && in_array($view, $this->addSQL['adminview'])) @@ -10638,7 +10642,7 @@ class Interpretation extends Fields = $db_; } // check if the table row_format has changed - if (ComponentbuilderHelper::checkString($easy['row_format']) + if (StringHelper::check($easy['row_format']) && isset($this->updateSQL['table_row_format']) && isset($this->updateSQL['table_row_format'][$view])) { @@ -10678,7 +10682,7 @@ class Interpretation extends Fields } // add custom sql dump to the file if (isset($this->customScriptBuilder['sql']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customScriptBuilder['sql'] )) { @@ -10781,7 +10785,7 @@ class Interpretation extends Fields { $db = ''; if (isset($this->queryBuilder) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->queryBuilder )) { @@ -10792,7 +10796,7 @@ class Interpretation extends Fields } // add custom sql uninstall dump to the file if (isset($this->customScriptBuilder['sql_uninstall']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->customScriptBuilder['sql_uninstall'] )) { @@ -11092,7 +11096,7 @@ class Interpretation extends Fields } // check if the both array is set if (isset($this->langContent['both']) - && ComponentbuilderHelper::checkArray($this->langContent['both'])) + && ArrayHelper::check($this->langContent['both'])) { foreach ($this->langContent['both'] as $keylang => $langval) { @@ -11101,7 +11105,7 @@ class Interpretation extends Fields } // check if the both admin array is set if (isset($this->langContent['bothadmin']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->langContent['bothadmin'] )) { @@ -11111,7 +11115,7 @@ class Interpretation extends Fields } } if (isset($this->langContent['admin']) - && ComponentbuilderHelper::checkArray($this->langContent['admin'])) + && ArrayHelper::check($this->langContent['admin'])) { // Trigger Event: jcb_ce_onAfterBuildAdminLang $this->triggerEvent( @@ -11187,7 +11191,7 @@ class Interpretation extends Fields // check if the both array is set if (isset($this->langContent['both']) - && ComponentbuilderHelper::checkArray($this->langContent['both'])) + && ArrayHelper::check($this->langContent['both'])) { foreach ($this->langContent['both'] as $keylang => $langval) { @@ -11196,7 +11200,7 @@ class Interpretation extends Fields } // check if the both site array is set if (isset($this->langContent['bothsite']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->langContent['bothsite'] )) { @@ -11206,7 +11210,7 @@ class Interpretation extends Fields } } if (isset($this->langContent['site']) - && ComponentbuilderHelper::checkArray($this->langContent['site'])) + && ArrayHelper::check($this->langContent['site'])) { // Trigger Event: jcb_ce_onAfterBuildSiteLang $this->triggerEvent( @@ -11251,7 +11255,7 @@ class Interpretation extends Fields // check if the both site array is set if (isset($this->langContent['bothsite']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->langContent['bothsite'] )) { @@ -11261,7 +11265,7 @@ class Interpretation extends Fields } } if (isset($this->langContent['sitesys']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->langContent['sitesys'] )) { @@ -11297,7 +11301,7 @@ class Interpretation extends Fields ); // check if the both admin array is set if (isset($this->langContent['bothadmin']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->langContent['bothadmin'] )) { @@ -11307,7 +11311,7 @@ class Interpretation extends Fields } } if (isset($this->langContent['adminsys']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->langContent['adminsys'] )) { @@ -11334,7 +11338,7 @@ class Interpretation extends Fields public function setCustomAdminViewListLink($view, $nameListCode) { if (isset($this->componentData->custom_admin_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->custom_admin_views )) { @@ -11343,7 +11347,7 @@ class Interpretation extends Fields ) { if (isset($custom_admin_view['adminviews']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $custom_admin_view['adminviews'] )) { @@ -11354,7 +11358,7 @@ class Interpretation extends Fields { // set the needed keys $setId = false; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $custom_admin_view['settings']->main_get->filter )) { @@ -11413,7 +11417,7 @@ class Interpretation extends Fields public function setListBody($nameSingleCode, $nameListCode) { if (isset($this->listBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->listBuilder[$nameListCode] )) { @@ -11451,7 +11455,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit.state']] ) && in_array( @@ -11497,7 +11501,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit']] ) && in_array( @@ -11576,7 +11580,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit.state']] ) && in_array( @@ -11674,7 +11678,7 @@ class Interpretation extends Fields && $this->fieldRelations[$nameListCode][(int) $item['id']][2]['join_type'] == 2 && isset($this->fieldRelations[$nameListCode][(int) $item['id']][2]['set']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->fieldRelations[$nameListCode][(int) $item['id']][2]['set'] )); // load the main list view field @@ -11691,7 +11695,7 @@ class Interpretation extends Fields } // now load the relations if (isset($this->fieldRelations[$nameListCode][(int) $item['id']][2]['joinfields']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->fieldRelations[$nameListCode][(int) $item['id']][2]['joinfields'] )) { @@ -11735,7 +11739,7 @@ class Interpretation extends Fields ) . PHP_EOL . $this->_t(3) . ""; } elseif (isset($this->fieldRelations[$nameListCode][(int) $item['id']]['set']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->fieldRelations[$nameListCode][(int) $item['id']][2]['set'] )) { @@ -11787,7 +11791,7 @@ class Interpretation extends Fields ); // add default links $defaultLink = true; - if (ComponentbuilderHelper::checkString($refview) + if (StringHelper::check($refview) && isset($item['custom']) && isset($item['custom']['view']) && $refview === $item['custom']['view']) @@ -11796,7 +11800,7 @@ class Interpretation extends Fields } // is this a linked item if (($item['link'] - || (ComponentbuilderHelper::checkArray( + || (ArrayHelper::check( $item['custom'] ) && $item['custom']['extends'] === 'user')) @@ -11895,7 +11899,7 @@ class Interpretation extends Fields $customAdminViewButton = ''; // check if custom links should be added to this list views if (isset($this->customAdminViewListLink[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customAdminViewListLink[$nameListCode] )) { @@ -11953,11 +11957,11 @@ class Interpretation extends Fields { // first update the code id needed if (isset($item['custom']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $item['custom'] ) && isset($item['custom']['table']) - && ComponentbuilderHelper::checkString($item['custom']['table'])) + && StringHelper::check($item['custom']['table'])) { $item['id_code'] = $item['code']; if (!$item['multiple']) @@ -11977,7 +11981,7 @@ class Interpretation extends Fields } // check if custom user elseif (isset($item['custom']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $item['custom'] ) && $item['custom']['extends'] === 'user' @@ -11988,7 +11992,7 @@ class Interpretation extends Fields } // check if translated value is used elseif (isset($this->selectionTranslationFixBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->selectionTranslationFixBuilder[$nameListCode] ) && array_key_exists( @@ -11999,7 +12003,7 @@ class Interpretation extends Fields return 'JText:' . ':_($item->' . $item['code'] . ')'; } elseif (isset($item['custom']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $item['custom'] ) && $item['custom']['text'] === 'user') @@ -12060,7 +12064,7 @@ class Interpretation extends Fields . $item['code'] . ' ?>'; } elseif (isset($item['custom']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $item['custom'] ) && $item['custom']['extends'] != 'user' @@ -12074,7 +12078,7 @@ class Interpretation extends Fields . $ref; } elseif (isset($item['custom']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $item['custom'] ) && $item['custom']['extends'] === 'user' @@ -12126,7 +12130,7 @@ class Interpretation extends Fields return $user . "->authorise('core.edit', 'com_users')"; } elseif (isset($item['custom']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $item['custom'] ) && $item['custom']['extends'] != 'user' @@ -12144,7 +12148,7 @@ class Interpretation extends Fields if ($coreLoadLink && (isset($coreLink['core.edit']) && isset($this->permissionBuilder[$coreLink['core.edit']])) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$coreLink['core.edit']] ) && in_array( @@ -12164,7 +12168,7 @@ class Interpretation extends Fields . ".' . (int)\$item->" . $item['id_code'] . ")"; } elseif (isset($item['custom']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $item['custom'] ) && $item['custom']['extends'] === 'user' @@ -12177,7 +12181,7 @@ class Interpretation extends Fields // check if the item has custom permissions. elseif ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit']] ) && in_array( @@ -12404,7 +12408,7 @@ class Interpretation extends Fields public function setListHead($nameSingleCode, $nameListCode) { if (isset($this->listBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->listBuilder[$nameListCode] )) { @@ -12422,7 +12426,7 @@ class Interpretation extends Fields } // main lang prefix $langView = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString($nameSingleCode, 'U'); + . StringHelper::safe($nameSingleCode, 'U'); // set status lang $statusLangName = $langView . '_STATUS'; // set id lang @@ -12471,7 +12475,7 @@ class Interpretation extends Fields { // check if we have an over-ride if (isset($this->listHeadOverRide[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->listHeadOverRide[$nameListCode] ) && isset($this->listHeadOverRide[$nameListCode][$item['id']])) @@ -12497,7 +12501,7 @@ class Interpretation extends Fields . "', \$this->listDirn, \$this->listOrder); ?>"; } // set the custom code - elseif (ComponentbuilderHelper::checkArray( + elseif (ArrayHelper::check( $item['custom'] )) { @@ -12588,7 +12592,7 @@ class Interpretation extends Fields { // check if the load build is set for this view if (isset($this->layoutBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->layoutBuilder[$nameSingleCode] )) { @@ -12620,7 +12624,7 @@ class Interpretation extends Fields } // add the layout key $layoutArray[] = PHP_EOL . $this->_t(2) . "'" - . ComponentbuilderHelper::safeString($layout) + . StringHelper::safe($layout) . "' => array(" . implode(',', $alignmentArray) . PHP_EOL . $this->_t(2) . ")"; } @@ -12647,10 +12651,10 @@ class Interpretation extends Fields $nameSingleCode = $view['settings']->name_single_code; // main lang prefix $langView = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString($nameSingleCode, 'U'); + . StringHelper::safe($nameSingleCode, 'U'); // check if the load build is set for this view if (isset($this->layoutBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->layoutBuilder[$nameSingleCode] )) { @@ -12686,7 +12690,7 @@ class Interpretation extends Fields } // start building body $body = PHP_EOL . '
'; - if (ComponentbuilderHelper::checkString($span)) + if (StringHelper::check($span)) { $body .= PHP_EOL . $this->_t(1) . '
'; } @@ -12718,7 +12722,7 @@ class Interpretation extends Fields } // if this is a linked view set permissions $closeIT = false; - if (ComponentbuilderHelper::checkArray($linkedViewIdentifier) + if (ArrayHelper::check($linkedViewIdentifier) && in_array($tabCodeName, $linkedViewIdentifier)) { // get view name @@ -12726,7 +12730,7 @@ class Interpretation extends Fields $tabCodeName, $linkedViewIdentifier ); $linkedViewData = $this->getAdminViewData($linkedViewId); - $linkedCodeName = ComponentbuilderHelper::safeString( + $linkedCodeName = StringHelper::safe( $linkedViewData->name_single ); // setup correct core target @@ -12739,7 +12743,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoadLinked && isset($coreLinked['core.access']) && isset($this->permissionBuilder['global'][$coreLinked['core.access']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$coreLinked['core.access']] ) && in_array( @@ -12822,7 +12826,7 @@ class Interpretation extends Fields . ""; $body .= PHP_EOL . $this->_t(1) . "
"; // close divs - if (ComponentbuilderHelper::checkString($span)) + if (StringHelper::check($span)) { $body .= PHP_EOL . $this->_t(1) . "
"; } @@ -12874,7 +12878,7 @@ class Interpretation extends Fields $linkedTab = array(); // check if the view has linked admin view if (isset($this->linkedAdminViews[$nameSingleCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->linkedAdminViews[$nameSingleCode] )) { @@ -12888,8 +12892,8 @@ class Interpretation extends Fields // add the linked view $linkedTab[$linkedView['adminview']] = $linkedView['tab']; // set the keys if values are set - if (ComponentbuilderHelper::checkString($linkedView['key']) - && ComponentbuilderHelper::checkString( + if (StringHelper::check($linkedView['key']) + && StringHelper::check( $linkedView['parentkey'] )) { @@ -12952,11 +12956,11 @@ class Interpretation extends Fields $tabWidth = 12; $lrCounter = 0; // set tab lang - $tabLangName = $langView . '_' . ComponentbuilderHelper::safeString( + $tabLangName = $langView . '_' . StringHelper::safe( $tabName, 'U' ); // set tab code name - $tabCodeName = ComponentbuilderHelper::safeString($tabName); + $tabCodeName = StringHelper::safe($tabName); /// set the values to use in search latter $searchTabs[$tabCodeName] = $tabNr; // add to lang array @@ -12964,7 +12968,7 @@ class Interpretation extends Fields // check if linked view belongs to this tab $buildLayout = true; $linkedViewId = ''; - if (ComponentbuilderHelper::checkArray($linkedTab)) + if (ArrayHelper::check($linkedTab)) { if (($linkedViewId = array_search($tabNr, $linkedTab)) !== false) @@ -13104,7 +13108,7 @@ class Interpretation extends Fields // set identifiers $linkedViewIdentifier[$linkedViewId] = $tabCodeName; //set function name - $codeName = ComponentbuilderHelper::safeString( + $codeName = StringHelper::safe( $this->uniquekey(3) . $tabCodeName ); // set as items layout @@ -13256,7 +13260,7 @@ class Interpretation extends Fields } } // set switch to trigger notice if custom fields added to right - if (ComponentbuilderHelper::checkArray($items['right'])) + if (ArrayHelper::check($items['right'])) { $fieldsAddedRight = true; } @@ -13280,7 +13284,7 @@ class Interpretation extends Fields } elseif ($defaultField === 'access' && isset($this->accessBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$nameSingleCode] )) { @@ -13291,7 +13295,7 @@ class Interpretation extends Fields } // check if metadata is added to this view if (isset($this->metadataBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->metadataBuilder[$nameSingleCode] )) { @@ -13299,18 +13303,18 @@ class Interpretation extends Fields $tabCodeNameLeft = 'publishing'; $tabCodeNameRight = 'metadata'; // the default publishing tiems - if (ComponentbuilderHelper::checkArray($items['left']) - || ComponentbuilderHelper::checkArray($items['right'])) + if (ArrayHelper::check($items['left']) + || ArrayHelper::check($items['right'])) { $items_one = ''; // load the items into one side - if (ComponentbuilderHelper::checkArray($items['left'])) + if (ArrayHelper::check($items['left'])) { $items_one .= "'" . implode( "'," . PHP_EOL . $this->_t(1) . "'", $items['left'] ) . "'"; } - if (ComponentbuilderHelper::checkArray($items['right'])) + if (ArrayHelper::check($items['right'])) { // there is already fields just add these if (strlen($items_one) > 3) @@ -13366,11 +13370,11 @@ class Interpretation extends Fields $tabCodeNameLeft = 'publishing'; $tabCodeNameRight = 'publlshing'; // the default publishing tiems - if (ComponentbuilderHelper::checkArray($items['left']) - || ComponentbuilderHelper::checkArray($items['right'])) + if (ArrayHelper::check($items['left']) + || ArrayHelper::check($items['right'])) { // load left items that remain - if (ComponentbuilderHelper::checkArray($items['left'])) + if (ArrayHelper::check($items['left'])) { // load all items $items_one = "'" . implode( @@ -13384,7 +13388,7 @@ class Interpretation extends Fields $items_one = true; } // load right items that remain - if (ComponentbuilderHelper::checkArray($items['right'])) + if (ArrayHelper::check($items['right'])) { // load all items $items_two = "'" . implode( @@ -13431,7 +13435,7 @@ class Interpretation extends Fields { if ($coreLoad && isset($core[$core_permission]) && isset($this->permissionBuilder['global'][$core[$core_permission]]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core[$core_permission]] ) && in_array( @@ -13457,7 +13461,7 @@ class Interpretation extends Fields { if ($coreLoad && isset($core[$core_permission]) && isset($this->permissionBuilder['global'][$core[$core_permission]]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core[$core_permission]] ) && in_array( @@ -13575,20 +13579,20 @@ class Interpretation extends Fields { // check if this view is having custom tabs if (isset($this->customTabs[$name_single]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customTabs[$name_single] )) { $html = array(); foreach ($this->customTabs[$name_single] as $customTab) { - if (ComponentbuilderHelper::checkArray($customTab) + if (ArrayHelper::check($customTab) && isset($customTab['html'])) { if ($customTab['tab'] == $nr && $customTab['position'] == $target && isset($customTab['html']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $customTab['html'] )) { @@ -13597,7 +13601,7 @@ class Interpretation extends Fields } } // return if found - if (ComponentbuilderHelper::checkArray($html)) + if (ArrayHelper::check($html)) { return PHP_EOL . implode(PHP_EOL, $html); } @@ -13671,7 +13675,7 @@ class Interpretation extends Fields $target = array('site' => $nameSingleCode); $this->buildDynamique($target, $type, $layoutName); } - if (ComponentbuilderHelper::checkString($items)) + if (StringHelper::check($items)) { // LAYOUTITEMS <<>> $this->fileContentDynamic[$nameSingleCode . '_' @@ -13710,7 +13714,7 @@ class Interpretation extends Fields $this->buildDynamique($target, 'layoutoverride', $layoutName); } // make sure items is an empty string (should not be needed.. but) - if (!ComponentbuilderHelper::checkString($items)) + if (!StringHelper::check($items)) { $items = ''; } @@ -13719,7 +13723,7 @@ class Interpretation extends Fields $placeholder[$this->hhh . 'LAYOUTITEMS' . $this->hhh] = $items; // OVERRIDE_LAYOUT_CODE <<>> $php_view = (array) explode(PHP_EOL, $data['php_view']); - if (ComponentbuilderHelper::checkArray($php_view)) + if (ArrayHelper::check($php_view)) { $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); $this->fileContentDynamic[$nameSingleCode . '_' @@ -13900,8 +13904,8 @@ class Interpretation extends Fields break; } } - if (ComponentbuilderHelper::checkString($name_single_code) - && ComponentbuilderHelper::checkString($name_list_code)) + if (StringHelper::check($name_single_code) + && StringHelper::check($name_list_code)) { $head = $this->setListHeadLinked( $name_single_code, $name_list_code, $addNewButon, @@ -13910,7 +13914,7 @@ class Interpretation extends Fields $body = $this->setListBodyLinked( $name_single_code, $name_list_code, $nameSingleCode ); - $functionName = ComponentbuilderHelper::safeString($codeName, 'F'); + $functionName = StringHelper::safe($codeName, 'F'); // LAYOUTITEMSTABLE <<>> $this->fileContentDynamic[$nameSingleCode . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] @@ -14031,7 +14035,7 @@ class Interpretation extends Fields } // LINKEDVIEWGLOBAL <<>> if (isset($parent_keys) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $parent_keys )) { @@ -14039,7 +14043,7 @@ class Interpretation extends Fields foreach ($parent_keys as $parent_key) { $globalKey[$parent_key] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $_key . $this->uniquekey(4) ); $this->fileContentDynamic[$nameSingleCode][$this->hhh @@ -14052,7 +14056,7 @@ class Interpretation extends Fields else { // set the global key - $globalKey = ComponentbuilderHelper::safeString( + $globalKey = StringHelper::safe( $_key . $this->uniquekey(4) ); $this->fileContentDynamic[$nameSingleCode][$this->hhh @@ -14223,7 +14227,7 @@ class Interpretation extends Fields ) { if (isset($this->listBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->listBuilder[$nameListCode] )) { @@ -14417,7 +14421,7 @@ class Interpretation extends Fields ) { if (isset($this->listBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->listBuilder[$nameListCode] )) { @@ -14438,7 +14442,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.create']] ) && in_array( @@ -14511,7 +14515,7 @@ class Interpretation extends Fields $head .= PHP_EOL . ""; // main lang prefix $langView = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString($nameSingleCode, 'U'); + . StringHelper::safe($nameSingleCode, 'U'); // set status lang $statusLangName = $langView . '_STATUS'; // set id lang @@ -14533,7 +14537,7 @@ class Interpretation extends Fields { // check if we have an over-ride if (isset($this->listHeadOverRide[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->listHeadOverRide[$nameListCode] ) && isset($this->listHeadOverRide[$nameListCode][$item['id']])) @@ -14624,7 +14628,7 @@ class Interpretation extends Fields { // check if this view has category added if (isset($this->categoryBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->categoryBuilder[$nameListCode] )) { @@ -14683,7 +14687,7 @@ class Interpretation extends Fields ); // add the custom fields query $query .= $this->setCustomQuery($nameListCode, $nameSingleCode); - if (ComponentbuilderHelper::checkString($globalKey) && $key + if (StringHelper::check($globalKey) && $key && strpos( $key, '-R>' ) === false @@ -14730,7 +14734,7 @@ class Interpretation extends Fields $ORarray = array($key); } // make sure we have an array - if (!ComponentbuilderHelper::checkArray($globalKey)) + if (!ArrayHelper::check($globalKey)) { $globalKey = array($globalKey); } @@ -14773,7 +14777,7 @@ class Interpretation extends Fields } } if (isset($this->accessBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$nameSingleCode] )) { @@ -14890,7 +14894,7 @@ class Interpretation extends Fields $this->_t(1) ); // filter by child repetable field values - if (ComponentbuilderHelper::checkString($globalKey) && $key + if (StringHelper::check($globalKey) && $key && strpos( $key, '-R>' ) !== false @@ -14937,7 +14941,7 @@ class Interpretation extends Fields $query .= PHP_EOL . $this->_t(3) . "}"; } // filter by child array field values - if (ComponentbuilderHelper::checkString($globalKey) && $key + if (StringHelper::check($globalKey) && $key && strpos( $key, '-R>' ) === false @@ -14957,7 +14961,7 @@ class Interpretation extends Fields . "foreach (\$items as \$nr => &\$item)"; $query .= PHP_EOL . $this->_t(4) . "{"; list($bin, $target) = explode('-A>', $key); - if (ComponentbuilderHelper::checkString($target)) + if (StringHelper::check($target)) { $query .= PHP_EOL . $this->_t(5) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' @@ -15010,7 +15014,7 @@ class Interpretation extends Fields $query .= PHP_EOL . $this->_t(3) . "}"; } // filter by parent repetable field values - if (ComponentbuilderHelper::checkString($globalKey) && $key + if (StringHelper::check($globalKey) && $key && strpos( $parentKey, '-R>' ) !== false @@ -15058,7 +15062,7 @@ class Interpretation extends Fields $query .= PHP_EOL . $this->_t(3) . "}"; } // filter by parent array field values - if (ComponentbuilderHelper::checkString($globalKey) && $key + if (StringHelper::check($globalKey) && $key && strpos( $parentKey, '-R>' ) === false @@ -15079,7 +15083,7 @@ class Interpretation extends Fields . "foreach (\$items as \$nr => &\$item)"; $query .= PHP_EOL . $this->_t(4) . "{"; list($bin, $target) = explode('-A>', $parentKey); - if (ComponentbuilderHelper::checkString($target)) + if (StringHelper::check($target)) { $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key . " && " . $this->fileContentStatic[$this->hhh . 'Component' @@ -15147,7 +15151,7 @@ class Interpretation extends Fields { $buttons = ''; if (isset($this->customAdminDynamicButtons[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customAdminDynamicButtons[$nameListCode] )) { @@ -15160,7 +15164,7 @@ class Interpretation extends Fields // Load to lang $keyLang = $this->langPrefix . '_' . $custom_button['NAME']; $this->setLangContent( - $this->lang, $keyLang, ComponentbuilderHelper::safeString( + $this->lang, $keyLang, StringHelper::safe( $custom_button['name'], 'Ww' ) ); @@ -15172,13 +15176,13 @@ class Interpretation extends Fields . " add " . $custom_button['name'] . " button."; $buttons[] = $this->_t(3) . "JToolBarHelper::custom('" . $nameListCode . ".redirectTo" - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $custom_button['link'], 'F' ) . "', '" . $custom_button['icon'] . "', '', '" . $keyLang . "', true);"; $buttons[] = $this->_t(2) . "}"; } - if (ComponentbuilderHelper::checkArray($buttons)) + if (ArrayHelper::check($buttons)) { return implode(PHP_EOL, $buttons); } @@ -15196,7 +15200,7 @@ class Interpretation extends Fields { $method = ''; if (isset($this->customAdminDynamicButtons[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customAdminDynamicButtons[$nameListCode] )) { @@ -15209,7 +15213,7 @@ class Interpretation extends Fields // add the custom redirect method $method[] = PHP_EOL . PHP_EOL . $this->_t(1) . "public function redirectTo" - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $custom_button['link'], 'F' ) . "()"; $method[] = $this->_t(1) . "{"; @@ -15402,7 +15406,7 @@ class Interpretation extends Fields } // if values were returned add the area if (isset($custom_query) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $custom_query )) { @@ -15417,7 +15421,7 @@ class Interpretation extends Fields } // add access levels if the view has access set if (isset($this->accessBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$nameSingleCode] )) { @@ -15494,7 +15498,7 @@ class Interpretation extends Fields } // add translations if (isset($query_translations) - && ComponentbuilderHelper::checkString($query_translations)) + && StringHelper::check($query_translations)) { $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( __LINE__ @@ -15582,7 +15586,7 @@ class Interpretation extends Fields $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the model"; $method[] = $this->_t(3) . "\$model = \$this->getModel('" - . ComponentbuilderHelper::safeString($nameListCode, 'F') + . StringHelper::safe($nameListCode, 'F') . "');"; $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the data to export"; @@ -15597,11 +15601,11 @@ class Interpretation extends Fields $method[] = $this->_t(4) . "\$date = JFactory::getDate();"; $method[] = $this->_t(4) . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::xls(\$data,'" - . ComponentbuilderHelper::safeString($nameListCode, 'F') + . StringHelper::safe($nameListCode, 'F') . "_'.\$date->format('jS_F_Y'),'" - . ComponentbuilderHelper::safeString($nameListCode, 'Ww') + . StringHelper::safe($nameListCode, 'Ww') . " exported ('.\$date->format('jS F, Y').')','" - . ComponentbuilderHelper::safeString($nameListCode, 'w') + . StringHelper::safe($nameListCode, 'w') . "');"; $method[] = $this->_t(3) . "}"; $method[] = $this->_t(2) . "}"; @@ -15636,7 +15640,7 @@ class Interpretation extends Fields $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the import model"; $method[] = $this->_t(3) . "\$model = \$this->getModel('" - . ComponentbuilderHelper::safeString($nameListCode, 'F') + . StringHelper::safe($nameListCode, 'F') . "');"; $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the headers to import"; @@ -15662,7 +15666,7 @@ class Interpretation extends Fields // add to lang array $selectImportFileNote = $this->langPrefix . "_IMPORT_SELECT_FILE_FOR_" - . ComponentbuilderHelper::safeString($nameListCode, 'U'); + . StringHelper::safe($nameListCode, 'U'); $this->setLangContent( $this->lang, $selectImportFileNote, 'Select the file to import data to ' . $nameListCode . '.' @@ -15713,7 +15717,7 @@ class Interpretation extends Fields { // main lang prefix $langExport = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Export Data', 'U'); + . StringHelper::safe('Export Data', 'U'); // add to lang array $this->setLangContent($this->lang, $langExport, 'Export Data'); $button = array(); @@ -15740,7 +15744,7 @@ class Interpretation extends Fields { // main lang prefix $langImport = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Import Data', 'U'); + . StringHelper::safe('Import Data', 'U'); // add to lang array $this->setLangContent($this->lang, $langImport, 'Import Data'); $button = array(); @@ -15844,7 +15848,7 @@ class Interpretation extends Fields { // check if this view has category added if (isset($this->categoryBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->categoryBuilder[$nameListCode] )) { @@ -15910,7 +15914,7 @@ class Interpretation extends Fields . "\$query->where('(a.published = 0 OR a.published = 1)');"; $query .= PHP_EOL . $this->_t(2) . "}"; if (isset($this->accessBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$nameSingleCode] )) { @@ -16084,7 +16088,7 @@ class Interpretation extends Fields public function setSearchQuery($nameListCode) { if (isset($this->searchBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->searchBuilder[$nameListCode] )) { @@ -16096,7 +16100,7 @@ class Interpretation extends Fields if ($nr == 0) { $search .= "a." . $array['code'] . " LIKE '.\$search.'"; - if (ComponentbuilderHelper::checkArray($array['custom']) + if (ArrayHelper::check($array['custom']) && 1 == $array['list']) { $search .= " OR " . $array['custom']['db'] . "." @@ -16106,7 +16110,7 @@ class Interpretation extends Fields else { $search .= " OR a." . $array['code'] . " LIKE '.\$search.'"; - if (ComponentbuilderHelper::checkArray($array['custom']) + if (ArrayHelper::check($array['custom']) && 1 == $array['list']) { $search .= " OR " . $array['custom']['db'] . "." @@ -16150,7 +16154,7 @@ class Interpretation extends Fields ) { if (isset($this->customBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customBuilder[$nameListCode] )) { @@ -16159,7 +16163,7 @@ class Interpretation extends Fields { // only load this if table is set if ((isset($this->customBuilderList[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customBuilderList[$nameListCode] ) && in_array( @@ -16167,20 +16171,20 @@ class Interpretation extends Fields $this->customBuilderList[$nameListCode] ) && isset($filter['custom']['table']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $filter['custom']['table'] ) && $filter['method'] == 0) || ($just_text && isset($filter['custom']['table']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $filter['custom']['table'] ) && $filter['method'] == 0)) { $query .= PHP_EOL . PHP_EOL . $this->_t(2) . $tab . "//" . $this->setLine(__LINE__) . " From the " - . ComponentbuilderHelper::safeString( - ComponentbuilderHelper::safeString( + . StringHelper::safe( + StringHelper::safe( $filter['custom']['table'], 'w' ) ) . " table."; @@ -16232,7 +16236,7 @@ class Interpretation extends Fields public function setFilterQuery($nameListCode) { if (isset($this->filterBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->filterBuilder[$nameListCode] )) { @@ -16406,7 +16410,7 @@ class Interpretation extends Fields $nameSingleCode = $viewArray['settings']->name_single_code; // add conditions to this view if (isset($viewArray['settings']->conditions) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $viewArray['settings']->conditions )) { @@ -16419,7 +16423,7 @@ class Interpretation extends Fields foreach ($viewArray['settings']->conditions as $condition) { if (isset($condition['match_name']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $condition['match_name'] )) { @@ -16441,7 +16445,7 @@ class Interpretation extends Fields $viewArray['settings']->conditions, $condition, $nameSingleCode ); - if (ComponentbuilderHelper::checkArray($relations)) + if (ArrayHelper::check($relations)) { // set behavior and default array $behaviors[$matchName] = $targetBehavior; @@ -16483,7 +16487,7 @@ class Interpretation extends Fields foreach ($relations as $relation) { - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $relation['match_name'] )) { @@ -16564,7 +16568,7 @@ class Interpretation extends Fields $validation = ''; $isSet = ''; $listener = ''; - if (ComponentbuilderHelper::checkArray($functions)) + if (ArrayHelper::check($functions)) { // now build the initial script $initial .= "//" . $this->setLine(__LINE__) . " Initial Script" @@ -16593,7 +16597,7 @@ class Interpretation extends Fields ); if (isset($this->setScriptMediaSwitch) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->setScriptMediaSwitch ) && in_array( @@ -16605,7 +16609,7 @@ class Interpretation extends Fields else { if (isset($this->setScriptUserSwitch) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->setScriptUserSwitch ) && in_array( @@ -16635,7 +16639,7 @@ class Interpretation extends Fields } } } - if (ComponentbuilderHelper::checkString($modal)) + if (StringHelper::check($modal)) { $listener .= PHP_EOL . "window.SqueezeBox.initialize({"; $listener .= PHP_EOL . $this->_t(1) . "onClose:function(){"; @@ -16666,7 +16670,7 @@ class Interpretation extends Fields $fucounter = 0; foreach ($f_matchKeys as $fu_matchKey) { - if (ComponentbuilderHelper::checkString($fu_matchKey)) + if (StringHelper::check($fu_matchKey)) { if ($fucounter == 0) { @@ -16717,7 +16721,7 @@ class Interpretation extends Fields . " set the function logic"; $map .= PHP_EOL . $this->_t(1) . "if ("; $if = $ifValue[$a_matchKey]; - if (ComponentbuilderHelper::checkString($if)) + if (StringHelper::check($if)) { $map .= $if; } @@ -16760,7 +16764,7 @@ class Interpretation extends Fields foreach ($f_matchKeys as $f_matchKey) { $if = $ifValue[$f_matchKey]; - if (ComponentbuilderHelper::checkString($if)) + if (StringHelper::check($if)) { if ($ifcounter == 0) { @@ -16784,7 +16788,7 @@ class Interpretation extends Fields foreach ($controls as $target => $action) { $func .= $action['behavior']; - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $action[$targetBehavior] )) { @@ -16802,7 +16806,7 @@ class Interpretation extends Fields foreach ($controls as $target => $action) { $func .= $action['default']; - if (ComponentbuilderHelper::checkString( + if (StringHelper::check( $action[$targetDefault] )) { @@ -16815,7 +16819,7 @@ class Interpretation extends Fields } // add the needed validation to file if (isset($this->validationFixBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->validationFixBuilder[$nameSingleCode] )) { @@ -16901,7 +16905,7 @@ class Interpretation extends Fields ); // add custom script to footer if (isset($this->customScriptBuilder['view_footer'][$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->customScriptBuilder['view_footer'][$nameSingleCode] )) { @@ -16927,7 +16931,7 @@ class Interpretation extends Fields 'views_file', $nameSingleCode, PHP_EOL . PHP_EOL, null, true, false )) !== false - && ComponentbuilderHelper::checkString($list_fileScript)) + && StringHelper::check($list_fileScript)) { // get dates $_created = $this->getCreatedDate($viewArray); @@ -16961,7 +16965,7 @@ class Interpretation extends Fields } // minfy the script if ($this->minify && isset($list_fileScript) - && ComponentbuilderHelper::checkString($list_fileScript)) + && StringHelper::check($list_fileScript)) { // minify the fielScript javscript $minifier = new JS; @@ -16970,7 +16974,7 @@ class Interpretation extends Fields } // minfy the script if ($this->minify && isset($fileScript) - && ComponentbuilderHelper::checkString($fileScript)) + && StringHelper::check($fileScript)) { // minify the fielScript javscript $minifier = new JS; @@ -16979,7 +16983,7 @@ class Interpretation extends Fields } // minfy the script if ($this->minify && isset($footerScript) - && ComponentbuilderHelper::checkString($footerScript)) + && StringHelper::check($footerScript)) { // minify the footerScript javscript $minifier = new JS; @@ -16988,7 +16992,7 @@ class Interpretation extends Fields } // make sure there is script to add if (isset($list_fileScript) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $list_fileScript )) { @@ -16998,12 +17002,12 @@ class Interpretation extends Fields } // make sure there is script to add if (isset($fileScript) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $fileScript )) { // add the head script if set - if (isset($head) && ComponentbuilderHelper::checkString($head)) + if (isset($head) && StringHelper::check($head)) { $fileScript = "// Some Global Values" . PHP_EOL . $head . PHP_EOL . $fileScript; @@ -17014,7 +17018,7 @@ class Interpretation extends Fields } // make sure to add custom footer script if php was found in it, since we canot minfy it with php if (isset($customFooterScript) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $customFooterScript )) { @@ -17026,7 +17030,7 @@ class Interpretation extends Fields } // make sure there is script to add if (isset($footerScript) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $footerScript )) { @@ -17061,7 +17065,7 @@ class Interpretation extends Fields } // make sure that the function is loaded only once - if (ComponentbuilderHelper::checkArray($funcsets)) + if (ArrayHelper::check($funcsets)) { $initial .= PHP_EOL . $this->_t(1) . $function . "("; $initial .= implode(',', $funcsets); @@ -17078,7 +17082,7 @@ class Interpretation extends Fields // convert to name array foreach ($condition['target_field'] as $targetField) { - if (ComponentbuilderHelper::checkArray($targetField) + if (ArrayHelper::check($targetField) && isset($targetField['name'])) { $currentTargets[] = $targetField['name']; @@ -17093,13 +17097,13 @@ class Interpretation extends Fields if ($relation['match_field'] !== $condition['match_field'] && $relation['target_relation']) // Made this change to see if it improves the expected result (TODO) { - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $relation['target_field'] )) { foreach ($relation['target_field'] as $target) { - if (ComponentbuilderHelper::checkArray($target) + if (ArrayHelper::check($target) && $this->checkRelationControl( $target['name'], $relation['match_name'], $condition['match_name'], $view @@ -17131,12 +17135,12 @@ class Interpretation extends Fields ) { if (isset($this->targetRelationControl[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->targetRelationControl[$view] )) { if (isset($this->targetRelationControl[$view][$targetName]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->targetRelationControl[$view][$targetName] )) { @@ -17158,7 +17162,7 @@ class Interpretation extends Fields } } elseif (!isset($this->targetRelationControl[$view]) - || !ComponentbuilderHelper::checkArray( + || !ArrayHelper::check( $this->targetRelationControl[$view] )) { @@ -17173,14 +17177,14 @@ class Interpretation extends Fields ) { $bucket = array(); - if (ComponentbuilderHelper::checkArray($targets) + if (ArrayHelper::check($targets) && !in_array( $uniqueVar, $this->targetControlsScriptChecker )) { foreach ($targets as $target) { - if (ComponentbuilderHelper::checkArray($target)) + if (ArrayHelper::check($target)) { // set the required var if ($target['required'] === 'yes') @@ -17371,7 +17375,7 @@ class Interpretation extends Fields || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { - if (ComponentbuilderHelper::checkArray($options)) + if (ArrayHelper::check($options)) { foreach ($options as $option) { @@ -17382,7 +17386,7 @@ class Interpretation extends Fields $option = "'" . $option . "'"; } } - if (ComponentbuilderHelper::checkString($string)) + if (StringHelper::check($string)) { $string .= ' || ' . $value . ' == ' . $option; } @@ -17404,7 +17408,7 @@ class Interpretation extends Fields || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { - if (ComponentbuilderHelper::checkArray($options)) + if (ArrayHelper::check($options)) { foreach ($options as $option) { @@ -17415,7 +17419,7 @@ class Interpretation extends Fields $option = "'" . $option . "'"; } } - if (ComponentbuilderHelper::checkString($string)) + if (StringHelper::check($string)) { $string .= ' || ' . $value . ' != ' . $option; } @@ -17437,7 +17441,7 @@ class Interpretation extends Fields || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { - if (ComponentbuilderHelper::checkArray($options)) + if (ArrayHelper::check($options)) { foreach ($options as $option) { @@ -17448,7 +17452,7 @@ class Interpretation extends Fields $option = "'" . $option . "'"; } } - if (ComponentbuilderHelper::checkString($string)) + if (StringHelper::check($string)) { $string .= ' || ' . $value . ' == ' . $option; } @@ -17462,7 +17466,7 @@ class Interpretation extends Fields { $userFix = ''; if (isset($this->setScriptUserSwitch) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->setScriptUserSwitch ) && in_array($type, $this->setScriptUserSwitch)) @@ -17492,13 +17496,13 @@ class Interpretation extends Fields // only 4 text_field if (ComponentbuilderHelper::fieldCheck($type, 'text')) { - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $options['keywords'] )) { foreach ($options['keywords'] as $keyword) { - if (ComponentbuilderHelper::checkString($string)) + if (StringHelper::check($string)) { $string .= ' && ' . $value . '.indexOf("' . $keyword . '") >= 0'; @@ -17510,7 +17514,7 @@ class Interpretation extends Fields } } } - if (!ComponentbuilderHelper::checkString($string)) + if (!StringHelper::check($string)) { $string .= $value . ' == "error"'; } @@ -17520,13 +17524,13 @@ class Interpretation extends Fields // only 4 text_field if (ComponentbuilderHelper::fieldCheck($type, 'text')) { - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $options['keywords'] )) { foreach ($options['keywords'] as $keyword) { - if (ComponentbuilderHelper::checkString($string)) + if (StringHelper::check($string)) { $string .= ' || ' . $value . '.indexOf("' . $keyword . '") >= 0'; @@ -17538,7 +17542,7 @@ class Interpretation extends Fields } } } - if (!ComponentbuilderHelper::checkString($string)) + if (!StringHelper::check($string)) { $string .= $value . ' == "error"'; } @@ -17548,16 +17552,16 @@ class Interpretation extends Fields // only 4 text_field if (ComponentbuilderHelper::fieldCheck($type, 'text')) { - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $options['keywords'] )) { foreach ($options['keywords'] as $keyword) { - $keyword = ComponentbuilderHelper::safeString( + $keyword = StringHelper::safe( $keyword, 'w' ); - if (ComponentbuilderHelper::checkString($string)) + if (StringHelper::check($string)) { $string .= ' && ' . $value . '.toLowerCase().indexOf("' . $keyword @@ -17570,7 +17574,7 @@ class Interpretation extends Fields } } } - if (!ComponentbuilderHelper::checkString($string)) + if (!StringHelper::check($string)) { $string .= $value . ' == "error"'; } @@ -17580,16 +17584,16 @@ class Interpretation extends Fields // only 4 text_field if (ComponentbuilderHelper::fieldCheck($type, 'text')) { - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $options['keywords'] )) { foreach ($options['keywords'] as $keyword) { - $keyword = ComponentbuilderHelper::safeString( + $keyword = StringHelper::safe( $keyword, 'w' ); - if (ComponentbuilderHelper::checkString($string)) + if (StringHelper::check($string)) { $string .= ' || ' . $value . '.toLowerCase().indexOf("' . $keyword @@ -17602,7 +17606,7 @@ class Interpretation extends Fields } } } - if (!ComponentbuilderHelper::checkString($string)) + if (!StringHelper::check($string)) { $string .= $value . ' == "error"'; } @@ -17612,7 +17616,7 @@ class Interpretation extends Fields // only 4 text_field if (ComponentbuilderHelper::fieldCheck($type, 'text')) { - if (ComponentbuilderHelper::checkArray($options)) + if (ArrayHelper::check($options)) { if ($options['length']) { @@ -17620,7 +17624,7 @@ class Interpretation extends Fields . (int) $options['length']; } } - if (!ComponentbuilderHelper::checkString($string)) + if (!StringHelper::check($string)) { $string .= $value . '.length >= 5'; } @@ -17630,7 +17634,7 @@ class Interpretation extends Fields // only 4 text_field if (ComponentbuilderHelper::fieldCheck($type, 'text')) { - if (ComponentbuilderHelper::checkArray($options)) + if (ArrayHelper::check($options)) { if ($options['length']) { @@ -17638,7 +17642,7 @@ class Interpretation extends Fields . (int) $options['length']; } } - if (!ComponentbuilderHelper::checkString($string)) + if (!StringHelper::check($string)) { $string .= $value . '.length <= 5'; } @@ -17648,7 +17652,7 @@ class Interpretation extends Fields // only 4 text_field if (ComponentbuilderHelper::fieldCheck($type, 'text')) { - if (ComponentbuilderHelper::checkArray($options)) + if (ArrayHelper::check($options)) { if ($options['length']) { @@ -17656,14 +17660,14 @@ class Interpretation extends Fields . (int) $options['length']; } } - if (!ComponentbuilderHelper::checkString($string)) + if (!StringHelper::check($string)) { $string .= $value . '.length == 5'; } } break; } - if (!ComponentbuilderHelper::checkString($string)) + if (!StringHelper::check($string)) { $string = 0; } @@ -17674,7 +17678,7 @@ class Interpretation extends Fields public function getOptionsScript($type, $options) { $buket = array(); - if (ComponentbuilderHelper::checkString($options)) + if (StringHelper::check($options)) { if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') @@ -17683,7 +17687,7 @@ class Interpretation extends Fields $optionsArray = array_map( 'trim', (array) explode(PHP_EOL, $options) ); - if (!ComponentbuilderHelper::checkArray($optionsArray)) + if (!ArrayHelper::check($optionsArray)) { $optionsArray[] = $optionsArray; } @@ -17708,7 +17712,7 @@ class Interpretation extends Fields $keywords = ComponentbuilderHelper::getBetween( $options, 'keywords="', '"' ); - if (ComponentbuilderHelper::checkString($keywords)) + if (StringHelper::check($keywords)) { if (strpos($keywords, ',') !== false) { @@ -17729,7 +17733,7 @@ class Interpretation extends Fields $length = ComponentbuilderHelper::getBetween( $options, 'length="', '"' ); - if (ComponentbuilderHelper::checkString($length)) + if (StringHelper::check($length)) { $buket['length'] = $length; } @@ -17771,7 +17775,7 @@ class Interpretation extends Fields . ' input[type=\'radio\']:checked").val();'; } elseif (isset($this->setScriptUserSwitch) - && ComponentbuilderHelper::checkArray($this->setScriptUserSwitch) + && ArrayHelper::check($this->setScriptUserSwitch) && in_array($type, $this->setScriptUserSwitch)) { // this is only since 3.3.4 @@ -17834,7 +17838,7 @@ class Interpretation extends Fields { $fix = ''; if (isset($this->validationFixBuilder[$view]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->validationFixBuilder[$view] )) { @@ -17916,7 +17920,7 @@ class Interpretation extends Fields { $tasks = ''; if (isset($this->customScriptBuilder[$target]['ajax_controller']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customScriptBuilder[$target]['ajax_controller'] )) { @@ -17930,7 +17934,7 @@ class Interpretation extends Fields $taskArray[$task['task_name']] = $task['task_name']; } } - if (ComponentbuilderHelper::checkArray($taskArray)) + if (ArrayHelper::check($taskArray)) { foreach ($taskArray as $name) { @@ -17947,7 +17951,7 @@ class Interpretation extends Fields { $cases = ''; if (isset($this->customScriptBuilder[$target]['ajax_controller']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customScriptBuilder[$target]['ajax_controller'] )) { @@ -17991,7 +17995,7 @@ class Interpretation extends Fields } } } - if (ComponentbuilderHelper::checkArray($getModel)) + if (ArrayHelper::check($getModel)) { foreach ($getModel as $task => $getMethod) { @@ -18011,7 +18015,7 @@ class Interpretation extends Fields ); // check if we have some values to check if (isset($ifArray[$task]) - && ComponentbuilderHelper::checkArray($ifArray[$task])) + && ArrayHelper::check($ifArray[$task])) { // set if string $ifvalues = implode(' && ', $ifArray[$task]); @@ -18080,7 +18084,7 @@ class Interpretation extends Fields { $methods = ''; if (isset($this->customScriptBuilder[$target]['ajax_model']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customScriptBuilder[$target]['ajax_model'] )) { @@ -18113,7 +18117,7 @@ class Interpretation extends Fields { // the old filter type uses these functions if (isset($this->filterBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->filterBuilder[$nameListCode] )) { @@ -18131,7 +18135,7 @@ class Interpretation extends Fields foreach ($this->filterBuilder[$nameListCode] as $filter) { if ($filter['type'] != 'category' - && ComponentbuilderHelper::checkArray($filter['custom']) + && ArrayHelper::check($filter['custom']) && $filter['custom']['extends'] === 'user') { // add if this is a function path @@ -18139,7 +18143,7 @@ class Interpretation extends Fields { $function[] = PHP_EOL . $this->_t(1) . "protected function getThe" . $filter['function'] - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $filter['custom']['text'], 'F' ) . "Selections()"; $function[] = $this->_t(1) . "{"; @@ -18210,7 +18214,7 @@ class Interpretation extends Fields /* else { - $function[] = PHP_EOL.$this->_t(1) . "protected function getThe".$filter['function'].ComponentbuilderHelper::safeString($filter['custom']['text'],'F')."Selections()"; + $function[] = PHP_EOL.$this->_t(1) . "protected function getThe".$filter['function'].StringHelper::safe($filter['custom']['text'],'F')."Selections()"; $function[] = $this->_t(1) . "{"; $function[] = $this->_t(2) . "//".$this->setLine(__LINE__)." Get a db connection."; $function[] = $this->_t(2) . "\$db = JFactory::getDbo();"; @@ -18248,11 +18252,11 @@ class Interpretation extends Fields } */ } elseif ($filter['type'] != 'category' - && !ComponentbuilderHelper::checkArray($filter['custom'])) + && !ArrayHelper::check($filter['custom'])) { $translation = false; if (isset($this->selectionTranslationFixBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->selectionTranslationFixBuilder[$nameListCode] ) && array_key_exists( @@ -18441,7 +18445,7 @@ class Interpretation extends Fields // and give a notice that this will cause an issue elseif (!$funtion_path && $filter['type'] != 'category' && $filter['multi'] == 2 - && ComponentbuilderHelper::checkArray($filter['custom'])) + && ArrayHelper::check($filter['custom'])) { // get the field code $field_code = $this->getCustomFieldCode( @@ -18478,7 +18482,7 @@ class Interpretation extends Fields } // divert the code to a file if this is not a funtion path if (!$funtion_path - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $function )) { @@ -18491,7 +18495,7 @@ class Interpretation extends Fields } } // if this is a function path, return the function if set - if ($funtion_path && ComponentbuilderHelper::checkArray($function)) + if ($funtion_path && ArrayHelper::check($function)) { // return the function return PHP_EOL . implode(PHP_EOL, $function); @@ -18516,7 +18520,7 @@ class Interpretation extends Fields $fields[] = $this->_t(1) . "protected function getUniqueFields()"; $fields[] = $this->_t(1) . "{"; if (isset($this->dbUniqueKeys[$view]) - && ComponentbuilderHelper::checkArray($this->dbUniqueKeys[$view])) + && ArrayHelper::check($this->dbUniqueKeys[$view])) { // if guid should also be added if (isset($this->dbUniqueGuid[$view])) @@ -18572,7 +18576,7 @@ class Interpretation extends Fields if (isset($this->adminFilterType[$nameListCode]) && $this->adminFilterType[$nameListCode] == 1 && isset($this->filterBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->filterBuilder[$nameListCode] )) { @@ -18583,17 +18587,17 @@ class Interpretation extends Fields foreach ($this->filterBuilder[$nameListCode] as $filter) { if ($filter['type'] != 'category' - && ComponentbuilderHelper::checkArray($filter['custom']) + && ArrayHelper::check($filter['custom']) && $filter['custom']['extends'] !== 'user') { - $CodeName = ComponentbuilderHelper::safeString( + $CodeName = StringHelper::safe( $filter['code'] . ' ' . $filter['custom']['text'], 'W' ); $codeName = $filter['code'] - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $filter['custom']['text'], 'F' ); - $type = ComponentbuilderHelper::safeString( + $type = StringHelper::safe( $filter['custom']['type'], 'F' ); $fieldFilters[] = PHP_EOL . $this->_t(2) . "//" @@ -18646,15 +18650,15 @@ class Interpretation extends Fields } elseif ($filter['type'] != 'category') { - $Codename = ComponentbuilderHelper::safeString( + $Codename = StringHelper::safe( $filter['code'], 'W' ); if (isset($filter['custom']) - && ComponentbuilderHelper::checkArray($filter['custom']) + && ArrayHelper::check($filter['custom']) && $filter['custom']['extends'] === 'user') { $functionName = "\$this->getThe" . $filter['function'] - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $filter['custom']['text'], 'F' ) . "Selections();"; } @@ -18714,7 +18718,7 @@ class Interpretation extends Fields } } // did we find filters - if (ComponentbuilderHelper::checkArray($fieldFilters)) + if (ArrayHelper::check($fieldFilters)) { // return the filter return PHP_EOL . implode(PHP_EOL, $fieldFilters); @@ -18758,7 +18762,7 @@ class Interpretation extends Fields $filter[] = $this->_t(2) . "}"; // check if view has access if (isset($this->accessBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$nameSingleCode] ) && !isset($this->fieldsNames[$nameSingleCode]['access'])) @@ -18789,7 +18793,7 @@ class Interpretation extends Fields if (isset($this->adminFilterType[$nameListCode]) && $this->adminFilterType[$nameListCode] == 1 && isset($this->categoryBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->categoryBuilder[$nameListCode] ) && isset($this->categoryBuilder[$nameListCode]['extension']) @@ -18830,7 +18834,7 @@ class Interpretation extends Fields $this->setCategoryBatchHelper($fieldBatch, $nameListCode); // check if we have other batch options to add if (isset($this->filterBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->filterBuilder[$nameListCode] )) { @@ -18849,14 +18853,14 @@ class Interpretation extends Fields foreach ($this->filterBuilder[$nameListCode] as $filter) { if ($filter['type'] != 'category' - && ComponentbuilderHelper::checkArray($filter['custom']) + && ArrayHelper::check($filter['custom']) && $filter['custom']['extends'] !== 'user') { - $CodeName = ComponentbuilderHelper::safeString( + $CodeName = StringHelper::safe( $filter['code'] . ' ' . $filter['custom']['text'], 'W' ); $codeName = $filter['code'] - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $filter['custom']['text'], 'F' ); $fieldBatch[] = PHP_EOL . $this->_t(2) @@ -18869,7 +18873,7 @@ class Interpretation extends Fields // add the get values here if ($get_values) { - $type = ComponentbuilderHelper::safeString( + $type = StringHelper::safe( $filter['custom']['type'], 'F' ); $fieldBatch[] = $this->_t(3) . "//" @@ -18914,7 +18918,7 @@ class Interpretation extends Fields } elseif ($filter['type'] != 'category') { - $CodeName = ComponentbuilderHelper::safeString( + $CodeName = StringHelper::safe( $filter['code'], 'W' ); @@ -18971,7 +18975,7 @@ class Interpretation extends Fields } } // did we find batch options - if (ComponentbuilderHelper::checkArray($fieldBatch)) + if (ArrayHelper::check($fieldBatch)) { // return the batch return PHP_EOL . implode(PHP_EOL, $fieldBatch); @@ -18992,7 +18996,7 @@ class Interpretation extends Fields protected function setDefaultBatchHelper(&$batch, &$nameSingleCode) { // set component name - $COPMONENT = ComponentbuilderHelper::safeString( + $COPMONENT = StringHelper::safe( $this->componentData->name_code, 'U' ); // set batch @@ -19012,7 +19016,7 @@ class Interpretation extends Fields $batch[] = $this->_t(2) . "}"; // check if view has access if (isset($this->accessBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$nameSingleCode] ) && !isset($this->fieldsNames[$nameSingleCode]['access'])) @@ -19046,13 +19050,13 @@ class Interpretation extends Fields protected function setCategoryBatchHelper(&$batch, &$nameListCode) { if (isset($this->categoryBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->categoryBuilder[$nameListCode] ) && isset($this->categoryBuilder[$nameListCode]['extension'])) { // set component name - $COPMONENT = ComponentbuilderHelper::safeString( + $COPMONENT = StringHelper::safe( $this->componentData->name_code, 'U' ); // set filter @@ -19077,7 +19081,7 @@ class Interpretation extends Fields public function setRouterCategoryViews($nameSingleCode, $nameListCode) { if (isset($this->categoryBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->categoryBuilder[$nameListCode] )) { @@ -19085,7 +19089,7 @@ class Interpretation extends Fields $_extension = $this->categoryBuilder[$nameListCode]['extension']; $_extension = explode('.', $_extension); // set component name - if (ComponentbuilderHelper::checkArray($_extension)) + if (ArrayHelper::check($_extension)) { $component = str_replace('com_', '', $_extension[0]); } @@ -19095,7 +19099,7 @@ class Interpretation extends Fields } // check if category has another name if (isset($this->catOtherName[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->catOtherName[$nameListCode] )) { @@ -19158,7 +19162,7 @@ class Interpretation extends Fields $this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] ) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] )) @@ -19195,11 +19199,11 @@ class Interpretation extends Fields $coreLoad = true; } // check if item has category - if (0) //isset($this->categoryBuilder[$nameListCode]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$nameListCode])) <-- remove category from check + if (0) //isset($this->categoryBuilder[$nameListCode]) && ArrayHelper::check($this->categoryBuilder[$nameListCode])) <-- remove category from check { // check if category has another name if ($coreLoad && isset($this->catOtherName[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->catOtherName[$nameListCode] )) { @@ -19218,7 +19222,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.access']] ) && in_array( @@ -19252,7 +19256,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.create']] ) && in_array( @@ -19287,7 +19291,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.access']] ) && in_array( @@ -19309,7 +19313,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.create']] ) && in_array( @@ -19352,13 +19356,13 @@ class Interpretation extends Fields $coreLoad = true; } if (isset($this->categoryBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->categoryBuilder[$nameListCode] )) { // check if category has another name if ($coreLoad && isset($this->catOtherName[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->catOtherName[$nameListCode] )) { @@ -19383,7 +19387,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.access']] ) && in_array( @@ -19411,7 +19415,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit']] ) && in_array( @@ -19433,7 +19437,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit.own']] ) && in_array( @@ -19474,7 +19478,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit.own']] ) && in_array( @@ -19511,7 +19515,7 @@ class Interpretation extends Fields $allow[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit']] ) && in_array( @@ -19547,7 +19551,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder[$core['core.access']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.access']] ) && in_array( @@ -19575,7 +19579,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit']] ) && in_array( @@ -19599,7 +19603,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit.own']] ) && in_array( @@ -19642,7 +19646,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit.own']] ) && in_array( @@ -19669,7 +19673,7 @@ class Interpretation extends Fields $allow[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit']] ) && in_array( @@ -19745,11 +19749,11 @@ class Interpretation extends Fields $core = $this->permissionCore[$nameSingleCode]; $coreLoad = true; } - if (0) //isset($this->categoryBuilder[$nameListCode]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$nameListCode])) <-- remove category from check + if (0) //isset($this->categoryBuilder[$nameListCode]) && ArrayHelper::check($this->categoryBuilder[$nameListCode])) <-- remove category from check { // check if category has another name if ($coreLoad && isset($this->catOtherName[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->catOtherName[$nameListCode] )) { @@ -19826,7 +19830,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit.state']] ) && in_array( @@ -19906,7 +19910,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit.state']] ) && in_array( @@ -19962,7 +19966,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.created_by']) && isset($this->permissionBuilder[$core['core.edit.created_by']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit.created_by']] ) && in_array( @@ -20002,7 +20006,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.created']) && isset($this->permissionBuilder[$core['core.edit.created']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit.created']] ) && in_array( @@ -20035,7 +20039,7 @@ class Interpretation extends Fields // check if the item has access permissions. if ($coreLoad && isset($core['core.edit.access']) && isset($this->permissionBuilder[$core['core.edit.access']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit.access']] ) && in_array( @@ -20063,7 +20067,7 @@ class Interpretation extends Fields } // handel the fields permissions if (isset($this->permissionFields[$nameSingleCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionFields[$nameSingleCode] )) { @@ -20152,7 +20156,7 @@ class Interpretation extends Fields { $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit " - . ComponentbuilderHelper::safeString($fieldName, 'W') + . StringHelper::safe($fieldName, 'W') . " access controls."; $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $nameSingleCode . ".edit." . $fieldName . "', 'com_" @@ -20203,7 +20207,7 @@ class Interpretation extends Fields { $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the from the form based on " - . ComponentbuilderHelper::safeString($fieldName, 'W') + . StringHelper::safe($fieldName, 'W') . " access controls."; $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $nameSingleCode . ".access." . $fieldName . "', 'com_" @@ -20226,7 +20230,7 @@ class Interpretation extends Fields { $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on View " - . ComponentbuilderHelper::safeString($fieldName, 'W') + . StringHelper::safe($fieldName, 'W') . " access controls."; $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $nameSingleCode . ".view." . $fieldName . "', 'com_" @@ -20245,7 +20249,7 @@ class Interpretation extends Fields { $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on View " - . ComponentbuilderHelper::safeString($fieldName, 'W') + . StringHelper::safe($fieldName, 'W') . " access controls."; $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $nameSingleCode . ".view." . $fieldName . "', 'com_" @@ -20313,7 +20317,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit']] ) && in_array( @@ -20335,7 +20339,7 @@ class Interpretation extends Fields { $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check specific edit permission then general edit permission."; - if (ComponentbuilderHelper::checkString($customAllow)) + if (StringHelper::check($customAllow)) { $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; } @@ -20362,11 +20366,11 @@ class Interpretation extends Fields $core = $this->permissionCore[$nameSingleCode]; $coreLoad = true; } - if (0) //isset($this->categoryBuilder[$nameListCode]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$nameListCode])) <-- remove category from check + if (0) //isset($this->categoryBuilder[$nameListCode]) && ArrayHelper::check($this->categoryBuilder[$nameListCode])) <-- remove category from check { // check if category has another name if ($coreLoad && isset($this->catOtherName[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->catOtherName[$nameListCode] )) { @@ -20393,7 +20397,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($this->permissionBuilder[$core['core.delete']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.delete']] ) && in_array( @@ -20438,7 +20442,7 @@ class Interpretation extends Fields if ($coreLoad && (isset($core['core.delete']) && isset($this->permissionBuilder[$core['core.delete']])) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.delete']] ) && in_array( @@ -20486,11 +20490,11 @@ class Interpretation extends Fields $core = $this->permissionCore[$nameSingleCode]; $coreLoad = true; } - if (0) // isset($this->categoryBuilder[$nameListCode]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$nameListCode])) <-- remove category from check + if (0) // isset($this->categoryBuilder[$nameListCode]) && ArrayHelper::check($this->categoryBuilder[$nameListCode])) <-- remove category from check { // check if category has another name if (isset($this->catOtherName[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->catOtherName[$nameListCode] )) { @@ -20512,7 +20516,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit.state']] ) && in_array( @@ -20554,7 +20558,7 @@ class Interpretation extends Fields $allow[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit.state']] ) && in_array( @@ -20589,7 +20593,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.edit.state']] ) && in_array( @@ -20616,7 +20620,7 @@ class Interpretation extends Fields $allow[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit.state']] ) && in_array( @@ -20657,7 +20661,7 @@ class Interpretation extends Fields // check if the item has permissions for edit. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit']] ) && in_array( @@ -20677,7 +20681,7 @@ class Interpretation extends Fields // check if the item has permissions for edit state. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit.state']] ) && in_array( @@ -20696,7 +20700,7 @@ class Interpretation extends Fields // check if the item has permissions for create. if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.create']] ) && in_array( @@ -20715,7 +20719,7 @@ class Interpretation extends Fields // check if the item has permissions for delete. if ($coreLoad && isset($core['core.delete']) && isset($this->permissionBuilder['global'][$core['core.delete']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.delete']] ) && in_array( @@ -20734,7 +20738,7 @@ class Interpretation extends Fields // check if the item has permissions for batch. if ($coreLoad && isset($core['core.batch']) && isset($this->permissionBuilder['global']['global'][$core['core.batch']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global']['global'][$core['core.batch']] ) && in_array( @@ -20818,7 +20822,7 @@ class Interpretation extends Fields $fields = "'a.id','id'"; $fields .= "," . PHP_EOL . $this->_t(4) . "'a.published','published'"; if (isset($this->accessBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$nameSingleCode] )) { @@ -20831,7 +20835,7 @@ class Interpretation extends Fields // add the rest of the set filters if (isset($this->filterBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->filterBuilder[$nameListCode] )) { @@ -20848,7 +20852,7 @@ class Interpretation extends Fields } // add the rest of the set filters if (isset($this->sortBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->sortBuilder[$nameListCode] )) { @@ -20894,15 +20898,15 @@ class Interpretation extends Fields else { // check if custom field is set - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $filter['custom'] ) && isset($filter['custom']['db']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $filter['custom']['db'] ) && isset($filter['custom']['text']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $filter['custom']['text'] )) { @@ -20953,7 +20957,7 @@ class Interpretation extends Fields } // add if view calls for it, and not already added if (isset($this->accessBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->accessBuilder[$nameSingleCode] ) && !isset($this->fieldsNames[$nameSingleCode]['access'])) @@ -20988,7 +20992,7 @@ class Interpretation extends Fields } // add the rest of the set filters if (isset($this->filterBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->filterBuilder[$nameListCode] )) { @@ -21005,7 +21009,7 @@ class Interpretation extends Fields } // add the rest of the set filters if (isset($this->sortBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->sortBuilder[$nameListCode] )) { @@ -21152,7 +21156,7 @@ class Interpretation extends Fields { // set lang strings $viewNameLang_readonly = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $view['settings']->name_single . ' readonly', 'U' ); // load to lang @@ -21174,11 +21178,11 @@ class Interpretation extends Fields { // set lang strings $viewNameLang_new = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $view['settings']->name_single . ' New', 'U' ); $viewNameLang_edit = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $view['settings']->name_single . ' Edit', 'U' ); // load to lang @@ -21210,7 +21214,7 @@ class Interpretation extends Fields $toolBar .= PHP_EOL . $this->_t(2) . "{"; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.create']] ) && in_array( @@ -21234,7 +21238,7 @@ class Interpretation extends Fields $toolBar .= PHP_EOL . $this->_t(3) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit']] ) && in_array( @@ -21280,7 +21284,7 @@ class Interpretation extends Fields . " For new records, check the create permission."; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.create']] ) && in_array( @@ -21312,7 +21316,7 @@ class Interpretation extends Fields $toolBar .= PHP_EOL . $this->_t(3) . "{"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit']] ) && in_array( @@ -21341,7 +21345,7 @@ class Interpretation extends Fields . " if we can return to make a new one."; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.create']] ) && in_array( @@ -21365,7 +21369,7 @@ class Interpretation extends Fields $toolBar .= PHP_EOL . $this->_t(4) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.edit']] ) && in_array( @@ -21374,7 +21378,7 @@ class Interpretation extends Fields )) { if ($coreLoad && isset($this->historyBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->historyBuilder[$nameSingleCode] )) { @@ -21395,7 +21399,7 @@ class Interpretation extends Fields else { if ($coreLoad && isset($this->historyBuilder[$nameSingleCode]) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->historyBuilder[$nameSingleCode] )) { @@ -21414,7 +21418,7 @@ class Interpretation extends Fields } if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.create']] ) && in_array( @@ -21490,7 +21494,7 @@ class Interpretation extends Fields $state .= $this->setDefaultPopulateState($nameSingleCode, $new_filter); // add the filters if (isset($this->filterBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->filterBuilder[$nameListCode] )) { @@ -21507,7 +21511,7 @@ class Interpretation extends Fields } // add the rest of the set filters if (isset($this->sortBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->sortBuilder[$nameListCode] )) { @@ -21662,7 +21666,7 @@ class Interpretation extends Fields // add the rest of the set filters if (isset($this->sortBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->sortBuilder[$nameListCode] )) { @@ -21676,7 +21680,7 @@ class Interpretation extends Fields . "'category_title' => JText:" . ":_('" . $filter['lang'] . "')"; } - elseif (ComponentbuilderHelper::checkArray( + elseif (ArrayHelper::check( $filter['custom'] )) { @@ -21813,11 +21817,11 @@ class Interpretation extends Fields $core = $this->permissionCore[$nameSingleCode]; $coreLoad = true; } - $component = ComponentbuilderHelper::safeString($Component); + $component = StringHelper::safe($Component); // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder[$core['core.access']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder[$core['core.access']] ) && in_array( @@ -21889,7 +21893,7 @@ class Interpretation extends Fields } // load the relations before modeling if (isset($this->fieldRelations[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->fieldRelations[$nameListCode] )) { @@ -21910,7 +21914,7 @@ class Interpretation extends Fields } // open the values if (isset($this->{$methodName}[$nameSingleCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->{$methodName}[$nameSingleCode] )) { @@ -22248,7 +22252,7 @@ class Interpretation extends Fields } } /* // set translation (TODO) would be nice to cut down on double loops.. - if (!$export && isset($this->selectionTranslationFixBuilder[$nameListCode]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$nameListCode])) + if (!$export && isset($this->selectionTranslationFixBuilder[$nameListCode]) && ArrayHelper::check($this->selectionTranslationFixBuilder[$nameListCode])) { foreach ($this->selectionTranslationFixBuilder[$nameListCode] as $name => $values) { @@ -22258,7 +22262,7 @@ class Interpretation extends Fields } */ // load the relations after modeling if (isset($this->fieldRelations[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->fieldRelations[$nameListCode] )) { @@ -22276,8 +22280,8 @@ class Interpretation extends Fields } } // close the foreach if needed - if (ComponentbuilderHelper::checkString($fix) - || ComponentbuilderHelper::checkString($fix_access) + if (StringHelper::check($fix) + || StringHelper::check($fix_access) || $export || $all) { @@ -22311,7 +22315,7 @@ class Interpretation extends Fields // add the permissional removal of values the user has not right to view or access if ($this->strictFieldExportPermissions && isset($this->permissionFields[$nameSingleCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionFields[$nameSingleCode] )) { @@ -22544,6 +22548,7 @@ class Interpretation extends Fields $headers[] = 'use Joomla\Registry\Registry;'; $headers[] = 'use Joomla\String\StringHelper;'; $headers[] = 'use Joomla\Utilities\ArrayHelper;'; + // $headers[] = 'use VDM\Joomla\Utilities;'; // load the internal custom headers $this->setHelperClassHeader($headers, $codeName); break; @@ -22582,7 +22587,7 @@ class Interpretation extends Fields // load the file class if uikit is being loaded if ((2 == $this->uikit || 1 == $this->uikit) && isset($this->uikitComp[$codeName]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->uikitComp[$codeName] )) { @@ -22601,7 +22606,7 @@ class Interpretation extends Fields &$headers) ); // check if headers were added - if (ComponentbuilderHelper::checkArray($headers)) + if (ArrayHelper::check($headers)) { // return the headers return $this->setPlaceholders(implode(PHP_EOL, $headers), $this->placeholders); @@ -22647,7 +22652,7 @@ class Interpretation extends Fields // add category switch $add_category = false; if (isset($this->categoryBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->categoryBuilder[$nameListCode] ) && isset($this->categoryBuilder[$nameListCode]['extension']) @@ -22666,7 +22671,7 @@ class Interpretation extends Fields } // check if this view have filters if (isset($this->filterBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->filterBuilder[$nameListCode] )) { @@ -22727,7 +22732,7 @@ class Interpretation extends Fields // set the language strings for selection $filter_name_select = 'Select Access'; $filter_name_select_lang = $this->langPrefix . '_FILTER_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $filter_name_select, 'U' ); // and to translation @@ -22753,7 +22758,7 @@ class Interpretation extends Fields . $item['code']; // load joint field names if (isset($item['joinfields']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $item['joinfields'] )) { @@ -22796,7 +22801,7 @@ class Interpretation extends Fields // add the fix if this view has the need for it $fix = ''; if (isset($this->selectionTranslationFixBuilder[$views]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->selectionTranslationFixBuilder[$views] )) { @@ -22834,7 +22839,7 @@ class Interpretation extends Fields // add the fix if this view has the need for it $fix = ''; if (isset($this->selectionTranslationFixBuilder[$views]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->selectionTranslationFixBuilder[$views] )) { @@ -22852,7 +22857,7 @@ class Interpretation extends Fields $values ) { - if (ComponentbuilderHelper::checkArray($values)) + if (ArrayHelper::check($values)) { $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( __LINE__ @@ -22866,7 +22871,7 @@ class Interpretation extends Fields foreach ($values as $value => $translang) { // only add quotes to strings - if (ComponentbuilderHelper::checkString($value)) + if (StringHelper::check($value)) { $key = "'" . $value . "'"; } @@ -22955,7 +22960,7 @@ class Interpretation extends Fields public function setDashboardIconAccess() { if (isset($this->permissionDashboard) - && ComponentbuilderHelper::checkArray($this->permissionDashboard)) + && ArrayHelper::check($this->permissionDashboard)) { $this->permissionDashboard = array_unique( $this->permissionDashboard @@ -22974,7 +22979,7 @@ class Interpretation extends Fields public function setDashboardIcons() { if (isset($this->componentData->admin_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->admin_views )) { @@ -22983,10 +22988,10 @@ class Interpretation extends Fields $catArray = array(); foreach ($this->componentData->admin_views as $view) { - $name_single = ComponentbuilderHelper::safeString( + $name_single = StringHelper::safe( $view['settings']->name_single ); - $name_list = ComponentbuilderHelper::safeString( + $name_list = StringHelper::safe( $view['settings']->name_list ); @@ -23018,11 +23023,11 @@ class Interpretation extends Fields } // build lang $langName = 'Add ' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $view['settings']->name_single, 'W' ) . '

'; $langKey = $this->langPrefix . '_DASHBOARD_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $view['settings']->name_single, 'U' ) . '_ADD'; // add to lang @@ -23055,11 +23060,11 @@ class Interpretation extends Fields $icons .= ", '" . $type . $name_list . "'"; } // build lang - $langName = ComponentbuilderHelper::safeString( + $langName = StringHelper::safe( $view['settings']->name_list, 'W' ) . '

'; $langKey = $this->langPrefix . '_DASHBOARD_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $view['settings']->name_list, 'U' ); // add to lang @@ -23068,7 +23073,7 @@ class Interpretation extends Fields } // dashboard link to category on dashboard is build here if (isset($this->categoryBuilder[$name_list]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->categoryBuilder[$name_list] )) { @@ -23076,14 +23081,14 @@ class Interpretation extends Fields // check if category has another name if (isset($this->catOtherName[$name_list]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->catOtherName[$name_list] )) { $otherViews = $this->catOtherName[$name_list]['views']; $otherNames = $this->catOtherName[$name_list]['name']; // build lang - $langName = ComponentbuilderHelper::safeString( + $langName = StringHelper::safe( $otherNames, 'W' ); } @@ -23092,7 +23097,7 @@ class Interpretation extends Fields $otherViews = $name_list; // build lang $langName = 'Categories For
' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $otherViews, 'W' ); } @@ -23107,9 +23112,9 @@ class Interpretation extends Fields // add to lang $langKey = $this->langPrefix . '_DASHBOARD_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $otherViews, 'U' - ) . '_' . ComponentbuilderHelper::safeString( + ) . '_' . StringHelper::safe( $catCode, 'U' ); $this->setLangContent($this->lang, $langKey, $langName); @@ -23147,7 +23152,7 @@ class Interpretation extends Fields } } if (isset($this->lastCustomDashboardIcon) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->lastCustomDashboardIcon )) { @@ -23158,7 +23163,7 @@ class Interpretation extends Fields unset($this->lastCustomDashboardIcon); } if (isset($this->iconBuilder) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->iconBuilder )) { @@ -23201,7 +23206,7 @@ class Interpretation extends Fields public function setDashboardModelMethods() { if (isset($this->componentData->php_dashboard_methods) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->componentData->php_dashboard_methods )) { @@ -23225,7 +23230,7 @@ class Interpretation extends Fields public function setDashboardGetCustomData() { if (isset($this->DashboardGetCustomData) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->DashboardGetCustomData )) { @@ -23234,7 +23239,7 @@ class Interpretation extends Fields // set dashboard gets foreach ($this->DashboardGetCustomData as $get) { - $string = ComponentbuilderHelper::safeString($get); + $string = StringHelper::safe($get); $gets[] = "\$this->" . $string . " = \$this->get('" . $get . "');"; } @@ -23258,7 +23263,7 @@ class Interpretation extends Fields $loadTabs = false; // check if we have custom tabs if (isset($this->componentData->dashboard_tab) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->dashboard_tab )) { @@ -23326,7 +23331,7 @@ class Interpretation extends Fields // load the new tabs foreach ($builder as $tabname => $accordians) { - $alias = ComponentbuilderHelper::safeString($tabname); + $alias = StringHelper::safe($tabname); $display[] = PHP_EOL . $this->_t(2) . " $html) { - $ac_alias = ComponentbuilderHelper::safeString( + $ac_alias = StringHelper::safe( $accordianname ); - $counterName = ComponentbuilderHelper::safeString( + $counterName = StringHelper::safe( $slidecounter ); $tempName = $alias . '_' . $ac_alias; @@ -23361,7 +23366,7 @@ class Interpretation extends Fields $target = array('custom_admin' => $this->componentCodeName); $this->buildDynamique($target, 'template', $tempName); // set the file data - $TARGET = ComponentbuilderHelper::safeString( + $TARGET = StringHelper::safe( $this->target, 'U' ); // SITE_TEMPLATE_BODY <<>> @@ -23397,7 +23402,7 @@ class Interpretation extends Fields { $icon = ''; if (isset($this->componentData->custom_admin_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->custom_admin_views )) { @@ -23473,17 +23478,17 @@ class Interpretation extends Fields } // see if we should have custom menus if (isset($this->componentData->custommenus) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->custommenus )) { foreach ($this->componentData->custommenus as $nr => $menu) { $nr = $nr + 100; - $nameList = ComponentbuilderHelper::safeString( + $nameList = StringHelper::safe( $menu['name_code'] ); - $nameUpper = ComponentbuilderHelper::safeString( + $nameUpper = StringHelper::safe( $menu['name_code'], 'U' ); if (isset($menu['dashboard_list']) @@ -23511,7 +23516,7 @@ class Interpretation extends Fields // if this is a link build the icon values with pipe if (isset($menu['link']) - && ComponentbuilderHelper::checkString($menu['link'])) + && StringHelper::check($menu['link'])) { // set icon if ($counter == 0) @@ -23567,7 +23572,7 @@ class Interpretation extends Fields // if this is a link build the icon values with pipe if (isset($menu['link']) - && ComponentbuilderHelper::checkString($menu['link'])) + && StringHelper::check($menu['link'])) { // set icon $this->lastCustomDashboardIcon[$nr] = ", '" . $type @@ -23589,7 +23594,7 @@ class Interpretation extends Fields public function setSubMenus() { if (isset($this->componentData->admin_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->admin_views )) { @@ -23599,7 +23604,7 @@ class Interpretation extends Fields // set the code name $codeName = $this->componentCodeName; // set default dashboard - if (!ComponentbuilderHelper::checkString($this->dynamicDashboard)) + if (!StringHelper::check($this->dynamicDashboard)) { $menus .= "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_DASHBOARD'), 'index.php?option=com_" . $codeName @@ -23619,7 +23624,7 @@ class Interpretation extends Fields ); $nameSingleCode = $view['settings']->name_single_code; $nameListCode = $view['settings']->name_list_code; - $nameUpper = ComponentbuilderHelper::safeString( + $nameUpper = StringHelper::safe( $view['settings']->name_list, 'U' ); // check if view is set to be in the sub-menu @@ -23636,7 +23641,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.access']] ) && in_array( @@ -23664,7 +23669,7 @@ class Interpretation extends Fields ); // check if category has another name if (isset($this->catOtherName[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->catOtherName[$nameListCode] )) { @@ -23679,7 +23684,7 @@ class Interpretation extends Fields // then check if view has category, if true add sub-menu for it if ($view['settings']->add_category_submenu == 1 && isset($this->categoryBuilder[$nameListCode]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->categoryBuilder[$nameListCode] ) && !in_array($otherViews, $catArray)) @@ -23711,7 +23716,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.access']] ) && in_array( @@ -23722,7 +23727,7 @@ class Interpretation extends Fields $menus .= PHP_EOL . $this->_t(2) . "}"; } } - // set the Joomla cutstom fields options + // set the Joomla custom fields options if (isset($view['joomla_fields']) && $view['joomla_fields'] == 1) { @@ -23759,7 +23764,7 @@ class Interpretation extends Fields } } if (isset($this->lastCustomSubMenu) - && ComponentbuilderHelper::checkArray($this->lastCustomSubMenu)) + && ArrayHelper::check($this->lastCustomSubMenu)) { foreach ($this->lastCustomSubMenu as $menu) { @@ -23779,7 +23784,7 @@ class Interpretation extends Fields // see if we should have custom menus $custom = ''; if (isset($this->componentData->custom_admin_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->custom_admin_views )) { @@ -23797,7 +23802,7 @@ class Interpretation extends Fields } } if (isset($this->componentData->custommenus) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->custommenus )) { @@ -23822,9 +23827,9 @@ class Interpretation extends Fields if ($type === 'customMenu') { $name = $menu['name']; - $nameSingle = ComponentbuilderHelper::safeString($menu['name']); - $nameList = ComponentbuilderHelper::safeString($menu['name']); - $nameUpper = ComponentbuilderHelper::safeString( + $nameSingle = StringHelper::safe($menu['name']); + $nameList = StringHelper::safe($menu['name']); + $nameUpper = StringHelper::safe( $menu['name'], 'U' ); } @@ -23851,7 +23856,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.access']] ) && in_array( @@ -23883,7 +23888,7 @@ class Interpretation extends Fields $tab = $this->_t(1); } if (isset($menu['link']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $menu['link'] )) { @@ -23919,7 +23924,7 @@ class Interpretation extends Fields { // setup access defaults $tab = ""; - $nameSingle = ComponentbuilderHelper::safeString($name); + $nameSingle = StringHelper::safe($name); $coreLoad = false; if (isset($this->permissionCore[$nameSingle])) { @@ -23930,7 +23935,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->permissionBuilder['global'][$core['core.access']] ) && in_array( @@ -23956,7 +23961,7 @@ class Interpretation extends Fields $tab = $this->_t(1); } if (isset($menu['link']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $menu['link'] )) { @@ -23991,7 +23996,7 @@ class Interpretation extends Fields public function setMainMenus() { if (isset($this->componentData->admin_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->admin_views )) { @@ -24011,7 +24016,7 @@ class Interpretation extends Fields // set main menu prefix switch $addPrefix = $this->componentData->add_menu_prefix; if ($addPrefix == 1 && isset($this->componentData->menu_prefix) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->componentData->menu_prefix )) { @@ -24048,10 +24053,10 @@ class Interpretation extends Fields $menus .= $this->addCustomMainMenu($view, $codeName, $lang); if (isset($view['mainmenu']) && $view['mainmenu'] == 1) { - $nameList = ComponentbuilderHelper::safeString( + $nameList = StringHelper::safe( $view['settings']->name_list ); - $nameUpper = ComponentbuilderHelper::safeString( + $nameUpper = StringHelper::safe( $view['settings']->name_list, 'U' ); $menus .= PHP_EOL . $this->_t(3) . '
componentData->config) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->config )) { @@ -24292,11 +24297,11 @@ class Interpretation extends Fields $placeholders[$this->hhh . 'component' . $this->hhh] = $this->componentCodeName; $placeholders[$this->hhh . 'Component' . $this->hhh] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $this->componentData->name_code, 'F' ); $placeholders[$this->hhh . 'COMPONENT' . $this->hhh] - = ComponentbuilderHelper::safeString( + = StringHelper::safe( $this->componentData->name_code, 'U' ); $placeholders[$this->hhh . 'view' . $this->hhh] @@ -24316,7 +24321,7 @@ class Interpretation extends Fields $placeholders[$this->bbb . 'views' . $this->ddd] = $nameListCode; // load the global placeholders - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $this->globalPlaceholders )) { @@ -24352,14 +24357,14 @@ class Interpretation extends Fields // make sure the xml is set and a string if (isset($xmlField) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $xmlField )) { $this->configFieldSetsCustomField[$field['tabname']][] = $xmlField; // set global params to db on install - $fieldName = ComponentbuilderHelper::safeString( + $fieldName = StringHelper::safe( $this->setPlaceholders( ComponentbuilderHelper::getBetween( $xmlField, 'name="', '"' @@ -24372,7 +24377,7 @@ class Interpretation extends Fields ), $placeholders ); if (isset($field['custom_value']) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $field['custom_value'] )) { @@ -24392,7 +24397,7 @@ class Interpretation extends Fields . '":"' . $field['custom_value'] . '"'; } } - elseif (ComponentbuilderHelper::checkString( + elseif (StringHelper::check( $fieldDefault )) { @@ -24442,7 +24447,7 @@ class Interpretation extends Fields $front_end = array(); // do quick build of front-end views if (isset($this->componentData->site_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->site_views )) { @@ -24456,16 +24461,16 @@ class Interpretation extends Fields // add frontend view stuff including menus if (isset($this->configFieldSetsCustomField) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->configFieldSetsCustomField )) { foreach ($this->configFieldSetsCustomField as $tab => &$tabFields) { - $tabCode = ComponentbuilderHelper::safeString($tab) + $tabCode = StringHelper::safe($tab) . '_custom_config'; - $tabUpper = ComponentbuilderHelper::safeString($tab, 'U'); - $tabLower = ComponentbuilderHelper::safeString($tab); + $tabUpper = StringHelper::safe($tab, 'U'); + $tabLower = StringHelper::safe($tab); // load the request id setters for menu views $viewRequest = 'name="' . $tabLower . '_request_id'; foreach ($tabFields as $et => $id_field) @@ -24557,7 +24562,7 @@ class Interpretation extends Fields protected function setRequestValues($view, $field, $search, $target, $store) { $key = ComponentbuilderHelper::getBetween($field, $search, '"'); - if (!ComponentbuilderHelper::checkString($key)) + if (!StringHelper::check($key)) { // is not having special var $key = $target; @@ -24583,16 +24588,16 @@ class Interpretation extends Fields { // add custom new global fields set if (isset($this->configFieldSetsCustomField) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->configFieldSetsCustomField )) { foreach ($this->configFieldSetsCustomField as $tab => $tabFields) { - $tabCode = ComponentbuilderHelper::safeString($tab) + $tabCode = StringHelper::safe($tab) . '_custom_config'; - $tabUpper = ComponentbuilderHelper::safeString($tab, 'U'); - $tabLower = ComponentbuilderHelper::safeString($tab); + $tabUpper = StringHelper::safe($tab, 'U'); + $tabLower = StringHelper::safe($tab); // remove display targeted fields $bucket = array(); foreach ($tabFields as $tabField) @@ -24600,7 +24605,7 @@ class Interpretation extends Fields $display = ComponentbuilderHelper::getBetween( $tabField, 'display="', '"' ); - if (!ComponentbuilderHelper::checkString($display) + if (!StringHelper::check($display) || $display === 'config') { // remove this display since it is not used in Joomla @@ -24610,7 +24615,7 @@ class Interpretation extends Fields } } // only add the tab if it has values - if (ComponentbuilderHelper::checkArray($bucket)) + if (ArrayHelper::check($bucket)) { // setup lang $this->setLangContent( @@ -24637,7 +24642,7 @@ class Interpretation extends Fields { // start loading Group control params if needed if (isset($this->setGroupControl) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->setGroupControl )) { @@ -24677,7 +24682,7 @@ class Interpretation extends Fields } // add custom Target Groups fields if (isset($this->configFieldSetsCustomField['Target Groups']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->configFieldSetsCustomField['Target Groups'] )) { @@ -24820,7 +24825,7 @@ class Interpretation extends Fields } // add custom global fields if (isset($this->configFieldSetsCustomField['Global']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->configFieldSetsCustomField['Global'] )) { @@ -24879,7 +24884,7 @@ class Interpretation extends Fields $langCont = $lang . '_CONTRIBUTOR'; if (isset($this->addContributors) && $this->addContributors && isset($this->componentData->contributors) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->contributors )) { @@ -24890,7 +24895,7 @@ class Interpretation extends Fields // make sure we dont use 0 $counter++; // get the word for this number - $COUNTER = ComponentbuilderHelper::safeString($counter, 'U'); + $COUNTER = StringHelper::safe($counter, 'U'); // set the dynamic values $cbTitle = htmlspecialchars( $contributor['title'], ENT_XML1, 'UTF-8' @@ -24999,7 +25004,7 @@ class Interpretation extends Fields . $contributor['name'] . ' <' . $contributor['website'] . '>'; // setup lang - $Counter = ComponentbuilderHelper::safeString($counter, 'Ww'); + $Counter = StringHelper::safe($counter, 'Ww'); $this->setLangContent( $this->lang, $langCont . '_' . $COUNTER, "Contributor " . $Counter @@ -25035,7 +25040,7 @@ class Interpretation extends Fields $moreContributerFields = range($min, $max, 1); foreach ($moreContributerFields as $counter) { - $COUNTER = ComponentbuilderHelper::safeString($counter, 'U'); + $COUNTER = StringHelper::safe($counter, 'U'); $this->configFieldSets[] = $this->_t(2) . '"; // setup lang - $Counter = ComponentbuilderHelper::safeString($counter, 'Ww'); + $Counter = StringHelper::safe($counter, 'Ww'); $this->setLangContent( $this->lang, $langCont . '_' . $COUNTER, "Contributor " . $Counter @@ -25415,7 +25420,7 @@ for developing fast and powerful web interfaces. For more info visit configFieldSetsCustomField['Uikit Settings']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->configFieldSetsCustomField['Uikit Settings'] )) { @@ -25449,7 +25454,7 @@ for developing fast and powerful web interfaces. For more info visit "; // add custom Mail Configurations if (isset($this->configFieldSetsCustomField['Mail Configuration']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->configFieldSetsCustomField['Mail Configuration'] )) { @@ -25917,7 +25922,7 @@ for developing fast and powerful web interfaces. For more info visit "; // add custom DKIM fields if (isset($this->configFieldSetsCustomField['DKIM']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->configFieldSetsCustomField['DKIM'] )) { @@ -26650,7 +26655,7 @@ function vdm_dkim() { // add custom Encryption Settings fields if (isset($this->configFieldSetsCustomField['Chart Settings']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->configFieldSetsCustomField['Chart Settings'] )) { @@ -26796,7 +26801,7 @@ function vdm_dkim() { || (isset($this->mediumEncryption) && $this->mediumEncryption) || $this->componentData->add_license || (isset($this->configFieldSetsCustomField['Encryption Settings']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->configFieldSetsCustomField['Encryption Settings'] ))) { @@ -27086,7 +27091,7 @@ function vdm_dkim() { { // add custom Encryption Settings fields if (isset($this->configFieldSetsCustomField[$dynamicAddField]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->configFieldSetsCustomField[$dynamicAddField] )) { @@ -27188,9 +27193,9 @@ function vdm_dkim() { if ($this->addEximport) { $exportTitle = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Export Data', 'U'); + . StringHelper::safe('Export Data', 'U'); $exportDesc = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Export Data', 'U') + . StringHelper::safe('Export Data', 'U') . '_DESC'; $this->setLangContent('bothadmin', $exportTitle, 'Export Data'); $this->setLangContent( @@ -27203,9 +27208,9 @@ function vdm_dkim() { // the size needs increase $this->accessSize++; $importTitle = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Import Data', 'U'); + . StringHelper::safe('Import Data', 'U'); $importDesc = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Import Data', 'U') + . StringHelper::safe('Import Data', 'U') . '_DESC'; $this->setLangContent('bothadmin', $importTitle, 'Import Data'); $this->setLangContent( @@ -27220,9 +27225,9 @@ function vdm_dkim() { } // version permission $batchTitle = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Use Batch', 'U'); + . StringHelper::safe('Use Batch', 'U'); $batchDesc = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Use Batch', 'U') . '_DESC'; + . StringHelper::safe('Use Batch', 'U') . '_DESC'; $this->setLangContent('bothadmin', $batchTitle, 'Use Batch'); $this->setLangContent( 'bothadmin', $batchDesc, @@ -27233,9 +27238,9 @@ function vdm_dkim() { . '" description="' . $batchDesc . '" />'; // version permission $importTitle = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Edit Versions', 'U'); + . StringHelper::safe('Edit Versions', 'U'); $importDesc = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Edit Versions', 'U') + . StringHelper::safe('Edit Versions', 'U') . '_DESC'; $this->setLangContent('bothadmin', $importTitle, 'Edit Version'); $this->setLangContent( @@ -27266,9 +27271,9 @@ function vdm_dkim() { } // new custom created by permissions $created_byTitle = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Edit Created By', 'U'); + . StringHelper::safe('Edit Created By', 'U'); $created_byDesc = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Edit Created By', 'U') + . StringHelper::safe('Edit Created By', 'U') . '_DESC'; $this->setLangContent('bothadmin', $created_byTitle, 'Edit Created By'); $this->setLangContent( @@ -27280,9 +27285,9 @@ function vdm_dkim() { . '" description="' . $created_byDesc . '" />'; // new custom created date permissions $createdTitle = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Edit Created Date', 'U'); + . StringHelper::safe('Edit Created Date', 'U'); $createdDesc = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString('Edit Created Date', 'U') + . StringHelper::safe('Edit Created Date', 'U') . '_DESC'; $this->setLangContent('bothadmin', $createdTitle, 'Edit Created Date'); $this->setLangContent( @@ -27298,7 +27303,7 @@ function vdm_dkim() { 'dashboard_add'); // set the custom admin views permissions if (isset($this->componentData->custom_admin_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->custom_admin_views )) { @@ -27310,14 +27315,14 @@ function vdm_dkim() { $customAdminName = $custom_admin_view['settings']->name; $customAdminCode = $custom_admin_view['settings']->code; $customAdminTitle = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $customAdminName . ' Access', 'U' ); $customAdminDesc = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $customAdminName . ' Access', 'U' ) . '_DESC'; - $sortKey = ComponentbuilderHelper::safeString( + $sortKey = StringHelper::safe( $customAdminName . ' Access' ); $this->setLangContent( @@ -27326,7 +27331,7 @@ function vdm_dkim() { $this->setLangContent( 'bothadmin', $customAdminDesc, ' Allows the users in this group to access ' - . ComponentbuilderHelper::safeString($customAdminName, 'w') + . StringHelper::safe($customAdminName, 'w') . '.' ); $this->componentGlobal[$sortKey] = $this->_t(2) @@ -27357,7 +27362,7 @@ function vdm_dkim() { . $menuController; $menucontrollerView['implementation'] = '2'; if (isset($custom_admin_view['settings']->permissions) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $custom_admin_view['settings']->permissions )) { @@ -27384,7 +27389,7 @@ function vdm_dkim() { } // set the site views permissions if (isset($this->componentData->site_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->site_views )) { @@ -27394,14 +27399,14 @@ function vdm_dkim() { $siteName = $site_view['settings']->name; $siteCode = $site_view['settings']->code; $siteTitle = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $siteName . ' Access Site', 'U' ); $siteDesc = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $siteName . ' Access Site', 'U' ) . '_DESC'; - $sortKey = ComponentbuilderHelper::safeString( + $sortKey = StringHelper::safe( $siteName . ' Access Site' ); if (isset($site_view['access']) && $site_view['access'] == 1) @@ -27412,7 +27417,7 @@ function vdm_dkim() { $this->setLangContent( 'bothadmin', $siteDesc, ' Allows the users in this group to access site ' - . ComponentbuilderHelper::safeString($siteName, 'w') + . StringHelper::safe($siteName, 'w') . '.' ); $this->componentGlobal[$sortKey] = $this->_t(2) @@ -27436,22 +27441,22 @@ function vdm_dkim() { } } if (isset($this->componentData->admin_views) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->componentData->admin_views )) { foreach ($this->componentData->admin_views as $view) { // set view name - $nameView = ComponentbuilderHelper::safeString( + $nameView = StringHelper::safe( $view['settings']->name_single ); - $nameViews = ComponentbuilderHelper::safeString( + $nameViews = StringHelper::safe( $view['settings']->name_list ); // add custom tab permissions if found if (isset($this->customTabs[$nameView]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->customTabs[$nameView] )) { @@ -27495,7 +27500,7 @@ function vdm_dkim() { . $menuController; $menucontrollerView['implementation'] = '2'; if (isset($view['settings']->permissions) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $view['settings']->permissions )) { @@ -27514,7 +27519,7 @@ function vdm_dkim() { } } // check if there are fields - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $view['settings']->fields )) { @@ -27526,11 +27531,11 @@ function vdm_dkim() { { // see if field require permissions to be set if (isset($field['permission']) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $field['permission'] )) { - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $field['settings']->properties )) { @@ -27555,7 +27560,7 @@ function vdm_dkim() { $fieldView['implementation'] = '3'; // check if persmissions was already set if (isset($view['settings']->permissions) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $view['settings']->permissions )) { @@ -27578,7 +27583,7 @@ function vdm_dkim() { { // make sure the array is set if (!isset($this->permissionFields[$nameView]) - || !ComponentbuilderHelper::checkArray( + || !ArrayHelper::check( $this->permissionFields[$nameView] )) { @@ -27586,7 +27591,7 @@ function vdm_dkim() { = array(); } if (!isset($this->permissionFields[$nameView][$fieldName]) - || !ComponentbuilderHelper::checkArray( + || !ArrayHelper::check( $this->permissionFields[$nameView][$fieldName] )) { @@ -27615,7 +27620,7 @@ function vdm_dkim() { ); // set the views permissions now - if (ComponentbuilderHelper::checkArray($this->permissionViews)) + if (ArrayHelper::check($this->permissionViews)) { foreach ($this->permissionViews as $viewsCodeName => $actions) { @@ -27653,10 +27658,10 @@ function vdm_dkim() { { // get the worse case column size required (can be worse I know) // access/action size x 20 characters x 8 groups - $character_length = (int) ComponentbuilderHelper::bcmath( + $character_length = (int) MathHelper::bc( 'mul', $this->accessSize, 20, 0 ); - $this->accessWorseCase = (int) ComponentbuilderHelper::bcmath( + $this->accessWorseCase = (int) MathHelper::bc( 'mul', $character_length, 8, 0 ); } @@ -27672,25 +27677,25 @@ function vdm_dkim() { { // add the custom permissions to use the buttons of this view if (isset($settings->custom_buttons) - && ComponentbuilderHelper::checkArray($settings->custom_buttons)) + && ArrayHelper::check($settings->custom_buttons)) { foreach ($settings->custom_buttons as $custom_buttons) { $customButtonName = $custom_buttons['name']; - $customButtonCode = ComponentbuilderHelper::safeString( + $customButtonCode = StringHelper::safe( $customButtonName ); $customButtonTitle = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $nameView . ' ' . $customButtonName . ' Button Access', 'U' ); $customButtonDesc = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $nameView . ' ' . $customButtonName . ' Button Access', 'U' ) . '_DESC'; - $sortButtonKey = ComponentbuilderHelper::safeString( + $sortButtonKey = StringHelper::safe( $nameView . ' ' . $customButtonName . ' Button Access' ); $this->setLangContent( @@ -27700,7 +27705,7 @@ function vdm_dkim() { $this->setLangContent( 'bothadmin', $customButtonDesc, ' Allows the users in this group to access the ' - . ComponentbuilderHelper::safeString($customButtonName, 'w') + . StringHelper::safe($customButtonName, 'w') . ' button.' ); $this->componentGlobal[$sortButtonKey] = $this->_t(2) @@ -27718,7 +27723,7 @@ function vdm_dkim() { ) { if (isset($view['settings']->permissions) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $view['settings']->permissions ) || (isset($view['port']) && $view['port']) @@ -27730,7 +27735,7 @@ function vdm_dkim() { // export $exportView['action'] = 'view.export'; $exportView['implementation'] = '2'; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $view['settings']->permissions )) { @@ -27744,7 +27749,7 @@ function vdm_dkim() { // import $importView['action'] = 'view.import'; $importView['implementation'] = '2'; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $view['settings']->permissions )) { @@ -27762,7 +27767,7 @@ function vdm_dkim() { // set version control $versionView['action'] = 'view.version'; $versionView['implementation'] = '3'; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $view['settings']->permissions )) { @@ -27780,7 +27785,7 @@ function vdm_dkim() { // set batch control $batchView['action'] = 'view.batch'; $batchView['implementation'] = '2'; - if (ComponentbuilderHelper::checkArray( + if (ArrayHelper::check( $view['settings']->permissions )) { @@ -27826,19 +27831,19 @@ function vdm_dkim() { // build the names if ($type === 'admin') { - $W_NameList = ComponentbuilderHelper::safeString( + $W_NameList = StringHelper::safe( $view['settings']->name_list, 'W' ); - $w_NameList = ComponentbuilderHelper::safeString( + $w_NameList = StringHelper::safe( $customName . ' ' . $view['settings']->name_list, 'w' ); - $w_NameSingle = ComponentbuilderHelper::safeString( + $w_NameSingle = StringHelper::safe( $view['settings']->name_single, 'w' ); } elseif ($type === 'customAdmin') { - $W_NameList = ComponentbuilderHelper::safeString( + $W_NameList = StringHelper::safe( $view['settings']->name, 'W' ); $w_NameList = $view['settings']->name; @@ -27846,7 +27851,7 @@ function vdm_dkim() { } // set title (only if not set already) if (!isset($permission['title']) - || !ComponentbuilderHelper::checkString( + || !StringHelper::check( $permission['title'] )) { @@ -27911,7 +27916,7 @@ function vdm_dkim() { default: // set edit title $permission['title'] = $W_NameList . ' ' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $customName, 'W' ); break; @@ -27919,7 +27924,7 @@ function vdm_dkim() { } // set description (only if not set already) if (!isset($permission['description']) - || !ComponentbuilderHelper::checkString( + || !StringHelper::check( $permission['description'] )) { @@ -28008,7 +28013,7 @@ function vdm_dkim() { // set edit description $permission['description'] = ' Allows the users in this group to ' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $customName, 'w' ) . ' of ' . $w_NameSingle; break; @@ -28024,12 +28029,12 @@ function vdm_dkim() { ); $this->permissionCore[$nameView][$coreTarget] = $action; // set array sort name - $sortKey = ComponentbuilderHelper::safeString( + $sortKey = StringHelper::safe( $permission['title'] ); // set title $title = $this->langPrefix . '_' - . ComponentbuilderHelper::safeString( + . StringHelper::safe( $permission['title'], 'U' ); // load the actions @@ -28224,7 +28229,7 @@ function vdm_dkim() { { $setter = ''; if (isset($this->libManager[$module->key][$module->code_name]) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $this->libManager[$module->key][$module->code_name] )) { @@ -28237,18 +28242,18 @@ function vdm_dkim() { ) { if (isset($this->libraries[$id]) - && ComponentbuilderHelper::checkObject( + && ObjectHelper::check( $this->libraries[$id] ) && isset($this->libraries[$id]->document) - && ComponentbuilderHelper::checkString( + && StringHelper::check( $this->libraries[$id]->document )) { $setter .= PHP_EOL . $this->libraries[$id]->document; } elseif (isset($this->libraries[$id]) - && ComponentbuilderHelper::checkObject( + && ObjectHelper::check( $this->libraries[$id] ) && isset($this->libraries[$id]->how)) @@ -28258,7 +28263,7 @@ function vdm_dkim() { } } // check if we have string - if (ComponentbuilderHelper::checkString($setter)) + if (StringHelper::check($setter)) { return $this->setPlaceholders( $this->setPlaceholders( str_replace( @@ -28289,7 +28294,7 @@ function vdm_dkim() { // build the config fields $config_fields = array(); if (isset($module->config_fields) - && ComponentbuilderHelper::checkArray( + && ArrayHelper::check( $module->config_fields )) { @@ -28313,7 +28318,7 @@ function vdm_dkim() { } // make sure the xml is set and a string if (isset($xmlFields) - && ComponentbuilderHelper::checkString($xmlFields)) + && StringHelper::check($xmlFields)) { $config_fields[$field_name . $fieldset] = $xmlFields; } @@ -28367,7 +28372,7 @@ function vdm_dkim() { &$this->langTag) ); // now we insert the values into the files - if (ComponentbuilderHelper::checkArray($this->languages['modules'])) + if (ArrayHelper::check($this->languages['modules'])) { foreach ($this->languages['modules'] as $tag => $areas) { @@ -28464,7 +28469,7 @@ function vdm_dkim() { $xml .= PHP_EOL . $this->_t(1) . ''; } // should the language xml be added - if (ComponentbuilderHelper::checkArray($addLang)) + if (ArrayHelper::check($addLang)) { $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . '' ); @@ -11899,10 +11915,10 @@ class Get // set language data foreach ($langStringTargets as $langStringTarget) { - $langCheck[] = ComponentbuilderHelper::getAllBetween( + $langCheck[] = GetHelper::allBetween( $string, $langStringTarget . "'", "'" ); - $langCheck[] = ComponentbuilderHelper::getAllBetween( + $langCheck[] = GetHelper::allBetween( $string, $langStringTarget . "'", "'" ); } diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 80795cb82..e218382cb 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -18,6 +18,8 @@ use Joomla\CMS\Filesystem\Folder; use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\FileHelper; /** @@ -1136,7 +1138,7 @@ class Structure extends Get // set file name $fileName = basename($url['url']); // get the file contents - $data = ComponentbuilderHelper::getFileContents( + $data = FileHelper::getContent( $url['url'] ); // build sub path @@ -1527,7 +1529,7 @@ class Structure extends Get // set file name $fileName = basename($url['url']); // get the file contents - $data = ComponentbuilderHelper::getFileContents( + $data = FileHelper::getContent( $url['url'] ); // build sub path @@ -1672,7 +1674,7 @@ class Structure extends Get // set file name $fileName = basename($url['url']); // get the file contents - $data = ComponentbuilderHelper::getFileContents( + $data = FileHelper::getContent( $url['url'] ); // build sub path @@ -1887,7 +1889,7 @@ class Structure extends Get */ public function writeFile($path, $data) { - return ComponentbuilderHelper::writeFile($path, $data); + return FileHelper::write($path, $data); } /** @@ -2591,7 +2593,7 @@ class Structure extends Get 'trim', explode( ',', - ComponentbuilderHelper::getBetween( + GetHelper::between( $multi_field['settings']->xml, 'fields="', '"' ) ) @@ -2895,7 +2897,7 @@ class Structure extends Get if (File::exists($custom_settings)) { $version_data = json_decode( - ComponentbuilderHelper::getFileContents( + FileHelper::getContent( $custom_settings ) ); @@ -2903,7 +2905,7 @@ class Structure extends Get else { $version_data = json_decode( - ComponentbuilderHelper::getFileContents( + FileHelper::getContent( $this->templatePath . '/settings.json' ) ); diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 3d61c55f9..3a4787e77 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -16,6 +16,7 @@ defined('_JEXEC') or die('Restricted access'); use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\String\FieldHelper; /** @@ -4167,7 +4168,7 @@ class Fields extends Structure elseif ($property['name'] === 'validate') { // check if we have validate (validation rule set) - $xmlValue = ComponentbuilderHelper::getBetween( + $xmlValue = GetHelper::between( $field['settings']->xml, 'validate="', '"' ); if (StringHelper::check($xmlValue)) @@ -4183,7 +4184,7 @@ class Fields extends Structure { // get value & replace the placeholders $xmlValue = $this->setPlaceholders( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, $property['name'] . '="', '"' ), $placeholders @@ -4208,7 +4209,7 @@ class Fields extends Structure $fieldAttributes['custom'][$phpKey][$phpLine] = $this->setDynamicValues( ComponentbuilderHelper::openValidBase64( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, $property['name'] . '="', '"' ) @@ -4221,7 +4222,7 @@ class Fields extends Structure { // load the php for the custom field file $fieldAttributes['custom']['prime_php'] - = (int) ComponentbuilderHelper::getBetween( + = (int) GetHelper::between( $field['settings']->xml, $property['name'] . '="', '"' ); } @@ -4229,7 +4230,7 @@ class Fields extends Structure { // load the class that is being extended $fieldAttributes['custom']['extends'] - = ComponentbuilderHelper::getBetween( + = GetHelper::between( $field['settings']->xml, 'extends="', '"' ); } @@ -4239,7 +4240,7 @@ class Fields extends Structure $fieldAttributes['custom']['view'] = StringHelper::safe( $this->setPlaceholders( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, 'view="', '"' ), $placeholders ) @@ -4251,7 +4252,7 @@ class Fields extends Structure $fieldAttributes['custom']['views'] = StringHelper::safe( $this->setPlaceholders( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, 'views="', '"' ), $placeholders ) @@ -4262,7 +4263,7 @@ class Fields extends Structure // load the component name & replace the placeholders $fieldAttributes['custom']['component'] = $this->setPlaceholders( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, 'component="', '"' ), $placeholders ); @@ -4272,7 +4273,7 @@ class Fields extends Structure // load the main table that is queried & replace the placeholders $fieldAttributes['custom']['table'] = $this->setPlaceholders( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, 'table="', '"' ), $placeholders ); @@ -4282,7 +4283,7 @@ class Fields extends Structure // load the text key $fieldAttributes['custom']['text'] = StringHelper::safe( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, 'value_field="', '"' ) ); @@ -4292,7 +4293,7 @@ class Fields extends Structure // load the id key $fieldAttributes['custom']['id'] = StringHelper::safe( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, 'key_field="', '"' ) ); @@ -4309,7 +4310,7 @@ class Fields extends Structure { // load the button string value if found $xmlValue = (string) StringHelper::safe( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, 'button="', '"' ) ); @@ -4338,7 +4339,7 @@ class Fields extends Structure } elseif ($property['name'] === 'multiple') { - $xmlValue = (string) ComponentbuilderHelper::getBetween( + $xmlValue = (string) GetHelper::between( $field['settings']->xml, $property['name'] . '="', '"' ); // add the multipal @@ -4352,7 +4353,7 @@ class Fields extends Structure && ($typeName === 'note' || $typeName === 'spacer')) { - $xmlValue = ComponentbuilderHelper::getBetween( + $xmlValue = GetHelper::between( $field['settings']->xml, 'class="', '"' ); // add the type class @@ -4372,7 +4373,7 @@ class Fields extends Structure { // set the rest of the fields $xmlValue = (string) $this->setPlaceholders( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, $property['name'] . '="', '"' ), $placeholders @@ -4473,7 +4474,7 @@ class Fields extends Structure // validate that the default field is set elseif ($property['name'] === 'default' && ($xmlValidateValue - = ComponentbuilderHelper::getBetween( + = GetHelper::between( $field['settings']->xml, 'default="', '"', 'none-set' )) !== 'none-set') { @@ -4511,7 +4512,7 @@ class Fields extends Structure if (isset($fieldAttributes['name'])) { // check if we have class value for the list view of this field - $listclass = ComponentbuilderHelper::getBetween( + $listclass = GetHelper::between( $field['settings']->xml, 'listclass="', '"' ); if (StringHelper::check($listclass)) @@ -4520,7 +4521,7 @@ class Fields extends Structure = $listclass; } // check if we find reason to remove this field from being escaped - $escaped = ComponentbuilderHelper::getBetween( + $escaped = GetHelper::between( $field['settings']->xml, 'escape="', '"' ); if (StringHelper::check($escaped)) @@ -4529,7 +4530,7 @@ class Fields extends Structure = $fieldAttributes['name']; } // check if we have display switch for dynamic placement - $display = ComponentbuilderHelper::getBetween( + $display = GetHelper::between( $field['settings']->xml, 'display="', '"' ); if (StringHelper::check($display)) @@ -4540,7 +4541,7 @@ class Fields extends Structure if (!isset($fieldAttributes['validate'])) { // check if we have validate (validation rule set) - $validationRule = ComponentbuilderHelper::getBetween( + $validationRule = GetHelper::between( $field['settings']->xml, 'validate="', '"' ); if (StringHelper::check($validationRule)) @@ -4753,7 +4754,7 @@ class Fields extends Structure { // get it from the field xml string $listFieldName = (string) $this->setPlaceholders( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, 'label="', '"' ), $this->placeholders @@ -4954,7 +4955,7 @@ class Fields extends Structure } // get the xml extension name $_extension = $this->setPlaceholders( - ComponentbuilderHelper::getBetween( + GetHelper::between( $field['settings']->xml, 'extension="', '"' ), $this->placeholders ); diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index e6a1f4be3..a63ea7b2c 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -18,6 +18,8 @@ use Joomla\CMS\Filesystem\Folder; use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Utilities\MathHelper; /** @@ -2389,7 +2391,7 @@ class Interpretation extends Fields foreach ($params as $field) { // some switch to see if it should be added to front end params - $target = ComponentbuilderHelper::getBetween( + $target = GetHelper::between( $field, 'display="', '"' ); if (!StringHelper::check($target) @@ -5548,12 +5550,10 @@ class Interpretation extends Fields } // set the custom buttons CUSTOM_BUTTONS_CONTROLLER $this->fileContentDynamic[$viewCodeName][$this->hhh . $TARGET - . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh] - = ''; + . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh] = ''; // set the custom buttons CUSTOM_BUTTONS_METHOD $this->fileContentDynamic[$viewCodeName][$this->hhh . $TARGET - . '_CUSTOM_BUTTONS_METHOD' . $this->hhh] - = ''; + . '_CUSTOM_BUTTONS_METHOD' . $this->hhh] = ''; } elseif (3 == $type) { @@ -6456,7 +6456,7 @@ class Interpretation extends Fields $path = '/' . trim($folder['path'], '/'); if (isset($folder['rename']) && 1 == $folder['rename']) { - if ($_paths = ComponentbuilderHelper::getAllFilePaths( + if ($_paths = FileHelper::getPaths( $this->componentPath . $path )) { @@ -6466,7 +6466,7 @@ class Interpretation extends Fields else { $path = $path . '/' . trim($folder['folder'], '/'); - if ($_paths = ComponentbuilderHelper::getAllFilePaths( + if ($_paths = FileHelper::getPaths( $this->componentPath . $path )) { @@ -7309,7 +7309,7 @@ class Interpretation extends Fields { if (File::exists($file['path'])) { - $string = ComponentbuilderHelper::getFileContents( + $string = FileHelper::getContent( $file['path'] ); $buket['static'][] = $this->getInbetweenStrings( @@ -7326,7 +7326,7 @@ class Interpretation extends Fields if (File::exists($doc['path'])) { $string - = ComponentbuilderHelper::getFileContents( + = FileHelper::getContent( $doc['path'] ); $buket[$view][] = $this->getInbetweenStrings( @@ -17709,7 +17709,7 @@ class Interpretation extends Fields elseif (ComponentbuilderHelper::fieldCheck($type, 'text')) { // check to get the key words if set - $keywords = ComponentbuilderHelper::getBetween( + $keywords = GetHelper::between( $options, 'keywords="', '"' ); if (StringHelper::check($keywords)) @@ -17730,7 +17730,7 @@ class Interpretation extends Fields } } // check to ket string length if set - $length = ComponentbuilderHelper::getBetween( + $length = GetHelper::between( $options, 'length="', '"' ); if (StringHelper::check($length)) @@ -23212,7 +23212,7 @@ class Interpretation extends Fields { // get all the mothods that should load date to the view $this->DashboardGetCustomData - = ComponentbuilderHelper::getAllBetween( + = GetHelper::allBetween( $this->componentData->php_dashboard_methods, 'public function get', '()' ); @@ -24274,10 +24274,10 @@ class Interpretation extends Fields if (1 == $timer) // this is before the admin views are build { // start loading Global params - $autorName = ComponentbuilderHelper::htmlEscape( + $autorName = StringHelper::html( $this->componentData->author ); - $autorEmail = ComponentbuilderHelper::htmlEscape( + $autorEmail = StringHelper::html( $this->componentData->email ); $this->extensionsParams[] = '"autorName":"' . $autorName @@ -24366,13 +24366,13 @@ class Interpretation extends Fields // set global params to db on install $fieldName = StringHelper::safe( $this->setPlaceholders( - ComponentbuilderHelper::getBetween( + GetHelper::between( $xmlField, 'name="', '"' ), $placeholders ) ); $fieldDefault = $this->setPlaceholders( - ComponentbuilderHelper::getBetween( + GetHelper::between( $xmlField, 'default="', '"' ), $placeholders ); @@ -24486,7 +24486,7 @@ class Interpretation extends Fields elseif (strpos($id_field, '_request_id') !== false) { // not loaded to a tab "view" name - $_viewRequest = ComponentbuilderHelper::getBetween( + $_viewRequest = GetHelper::between( $id_field, 'name="', '_request_id' ); $searchIdKe = 'name="' . $_viewRequest @@ -24514,7 +24514,7 @@ class Interpretation extends Fields elseif (strpos($catid_field, '_request_catid') !== false) { // not loaded to a tab "view" name - $_viewRequestC = ComponentbuilderHelper::getBetween( + $_viewRequestC = GetHelper::between( $catid_field, 'name="', '_request_catid' ); $searchCatidKe = 'name="' . $_viewRequestC @@ -24539,7 +24539,7 @@ class Interpretation extends Fields elseif (strpos($field, '_menu"') !== false) { // not loaded to a tab "view" name - $_tabLower = ComponentbuilderHelper::getBetween( + $_tabLower = GetHelper::between( $field, 'name="', '_menu"' ); // set the values needed to insure route is done correclty @@ -24561,7 +24561,7 @@ class Interpretation extends Fields protected function setRequestValues($view, $field, $search, $target, $store) { - $key = ComponentbuilderHelper::getBetween($field, $search, '"'); + $key = GetHelper::between($field, $search, '"'); if (!StringHelper::check($key)) { // is not having special var @@ -24602,7 +24602,7 @@ class Interpretation extends Fields $bucket = array(); foreach ($tabFields as $tabField) { - $display = ComponentbuilderHelper::getBetween( + $display = GetHelper::between( $tabField, 'display="', '"' ); if (!StringHelper::check($display) @@ -24908,7 +24908,7 @@ class Interpretation extends Fields ); $cbWebsite = htmlspecialchars( $contributor['website'], ENT_XML1, 'UTF-8' - ); // ComponentbuilderHelper::htmlEscape($contributor['website']); + ); // StringHelper::html($contributor['website']); // load to the $fieldsets $this->configFieldSets[] = $this->_t(2) . ' COM_COMPONENTBUILDER - 12th March, 2022 + 4th April, 2022 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 2.12.15 + 2.12.16 Component Builder (v.2.12.15) +

Component Builder (v.2.12.16)

The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index 8a3e5eac1..1aec446ae 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -1041,10 +1041,10 @@ Builds Complex Joomla Components com_componentbuilder component - 2.12.15 + 2.12.16 http://www.joomlacomponentbuilder.com - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.12.15/JCB_v2.12.15.zip + https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.12.16/JCB_v2.12.16.zip stable diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities.php index b9d779352..7656d7c77 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities.php @@ -555,6 +555,44 @@ trait Utilities { return FileHelper::write($path, $data); } + + /** + * get all the file paths in folder and sub folders + * + * @param string $folder The local path to parse + * @param array $fileTypes The type of files to get + * + * @return void + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::getPaths($folder, $fileTypes , $recurse, $full); + */ + public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true) + { + return FileHelper::getPaths($folder, $fileTypes , $recurse, $full); + } + + /** + * Get the file path or url + * + * @param string $type The (url/path) type to return + * @param string $target The Params Target name (if set) + * @param string $fileType The kind of filename to generate (if not set no file name is generated) + * @param string $key The key to adjust the filename (if not set ignored) + * @param string $default The default path if not set in Params (fallback path) + * @param bool $createIfNotSet The switch to create the folder if not found + * + * @return string On success the path or url is returned based on the type requested + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::getPath($type, $target, $fileType, $key, $default, $createIfNotSet); + */ + public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = '', $createIfNotSet = true) + { + return FileHelper::getPath($type, $target, $fileType, $key, $default, $createIfNotSet); + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php index 74100c8af..afa3bb290 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php @@ -13,11 +13,13 @@ namespace VDM\Joomla\Utilities; +use Joomla\CMS\Uri\Uri; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Filesystem\Path; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Filesystem\Folder; +use Joomla\CMS\Component\ComponentHelper; use Joomla\Archive\Archive; @@ -37,6 +39,15 @@ abstract class FileHelper */ protected static $curlError = false; + /** + * The component params + * + * @var object + * + * @since 3.0.9 + */ + protected static $params = false; + /** * The zipper method * @@ -176,6 +187,141 @@ abstract class FileHelper } return $klaar; } + + /** + * get all the file paths in folder and sub folders + * + * @param string $folder The local path to parse + * @param array $fileTypes The type of files to get + * + * @return void + * + * @since 3.0.9 + */ + public static function getPaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true) + { + if (Folder::exists($folder)) + { + // we must first store the current woking directory + $joomla = getcwd(); + // we are changing the working directory to the component path + chdir($folder); + + // make sure we have file type filter + if (ArrayHelper::check($fileTypes)) + { + // get the files + foreach ($fileTypes as $type) + { + // get a list of files in the current directory tree + $files[] = Folder::files('.', $type, $recurse, $full); + } + } + elseif (StringHelper::check($fileTypes)) + { + // get a list of files in the current directory tree + $files[] = Folder::files('.', $fileTypes, $recurse, $full); + } + else + { + // get a list of files in the current directory tree + $files[] = Folder::files('.', '.', $recurse, $full); + } + + // change back to Joomla working directory + chdir($joomla); + + // return array of files + return array_map( function($file) { return str_replace('./', '/', $file); }, (array) ArrayHelper::merge($files)); + } + return false; + } + + /** + * Get the file path or url + * + * @param string $type The (url/path) type to return + * @param string $target The Params Target name (if set) + * @param string $fileType The kind of filename to generate (if not set no file name is generated) + * @param string $key The key to adjust the filename (if not set ignored) + * @param string $default The default path if not set in Params (fallback path) + * @param bool $createIfNotSet The switch to create the folder if not found + * + * @return string On success the path or url is returned based on the type requested + * + * @since 3.0.9 + */ + public static function getPath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = '', $createIfNotSet = true) + { + // make sure to always have a string/path + if(!StringHelper::check($default)) + { + $default = JPATH_SITE . '/images/'; + } + + // get the global settings + if (!ObjectHelper::check(self::$params)) + { + self::$params = ComponentHelper::getParams('com_componentbuilder'); + } + $filePath = self::$params->get($target, $default); + + // check the file path (revert to default only of not a hidden file path) + if ('hiddenfilepath' !== $target && strpos($filePath, JPATH_SITE) === false) + { + $filePath = $default; + } + + // create the folder if it does not exist + if ($createIfNotSet && !Folder::exists($filePath)) + { + Folder::create($filePath); + } + + // setup the file name + $fileName = ''; + + // Get basic key + $basickey = 'Th!s_iS_n0t_sAfe_buT_b3tter_then_n0thiug'; + if (method_exists('ComponentbuilderHelper', "getCryptKey")) + { + $basickey = ComponentbuilderHelper::getCryptKey('basic', $basickey); + } + + // check the key + if (!StringHelper::check($key)) + { + $key = 'vDm'; + } + + // set the file name + if (StringHelper::check($fileType)) + { + // set the name + $fileName = trim(md5($type . $target . $basickey . $key) . '.' . trim($fileType, '.')); + } + else + { + $fileName = trim(md5($type . $target . $basickey . $key)) . '.txt'; + } + + // return the url + if ('url' === $type) + { + if (strpos($filePath, JPATH_SITE) !== false) + { + $filePath = trim( str_replace( JPATH_SITE, '', $filePath), '/'); + + return Uri::root() . $filePath . '/' . $fileName; + } + + // since the path is behind the root folder of the site, return only the root url (may be used to build the link) + return Uri::root(); + } + + // sanitize the path + return '/' . trim( $filePath, '/' ) . '/' . $fileName; + } } diff --git a/script.php b/script.php index 5c939a7cd..0dbd6ab6a 100644 --- a/script.php +++ b/script.php @@ -9254,7 +9254,7 @@ class com_componentbuilderInstallerScript echo ' -

Upgrade to Version 2.12.15 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 2.12.16 Was Successful! Let us know if anything is not working as expected.

'; // Set db if not set already. if (!isset($db)) diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index a1adbdcf1..780cae1ff 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -1025,51 +1025,6 @@ abstract class ComponentbuilderHelper } } - /** - * get all the file paths in folder and sub folders - * - * @param string $folder The local path to parse - * @param array $fileTypes The type of files to get - * - * @return void - * - */ - public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true) - { - if (Folder::exists($folder)) - { - // we must first store the current woking directory - $joomla = getcwd(); - // we are changing the working directory to the component path - chdir($folder); - // make sure we have file type filter - if (self::checkArray($fileTypes)) - { - // get the files - foreach ($fileTypes as $type) - { - // get a list of files in the current directory tree - $files[] = Folder::files('.', $type, $recurse, $full); - } - } - elseif (self::checkString($fileTypes)) - { - // get a list of files in the current directory tree - $files[] = Folder::files('.', $fileTypes, $recurse, $full); - } - else - { - // get a list of files in the current directory tree - $files[] = Folder::files('.', '.', $recurse, $full); - } - // change back to Joomla working directory - chdir($joomla); - // return array of files - return array_map( function($file) { return str_replace('./', '/', $file); }, (array) self::mergeArrays($files)); - } - return false; - } - /** * get all component IDs */ @@ -3785,81 +3740,6 @@ abstract class ComponentbuilderHelper return $exists; } - /** - * Get the file path or url - * - * @param string $type The (url/path) type to return - * @param string $target The Params Target name (if set) - * @param string $fileType The kind of filename to generate (if not set no file name is generated) - * @param string $key The key to adjust the filename (if not set ignored) - * @param string $default The default path if not set in Params (fallback path) - * @param bool $createIfNotSet The switch to create the folder if not found - * - * @return string On success the path or url is returned based on the type requested - * - */ - public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = '', $createIfNotSet = true) - { - // make sure to always have a string/path - if(!self::checkString($default)) - { - $default = JPATH_SITE . '/images/'; - } - // get the global settings - if (!self::checkObject(self::$params)) - { - self::$params = JComponentHelper::getParams('com_componentbuilder'); - } - $filePath = self::$params->get($target, $default); - // check the file path (revert to default only of not a hidden file path) - if ('hiddenfilepath' !== $target && strpos($filePath, JPATH_SITE) === false) - { - $filePath = $default; - } - // create the folder if it does not exist - if ($createIfNotSet && !Folder::exists($filePath)) - { - Folder::create($filePath); - } - // setup the file name - $fileName = ''; - // Get basic key - $basickey = 'Th!s_iS_n0t_sAfe_buT_b3tter_then_n0thiug'; - if (method_exists(get_called_class(), "getCryptKey")) - { - $basickey = self::getCryptKey('basic', $basickey); - } - // check the key - if (!self::checkString($key)) - { - $key = 'vDm'; - } - // set the file name - if (self::checkString($fileType)) - { - // set the name - $fileName = trim(md5($type.$target.$basickey.$key) . '.' . trim($fileType, '.')); - } - else - { - $fileName = trim(md5($type.$target.$basickey.$key)) . '.txt'; - } - // return the url - if ('url' === $type) - { - if (strpos($filePath, JPATH_SITE) !== false) - { - $filePath = trim( str_replace( JPATH_SITE, '', $filePath), '/'); - return JURI::root() . $filePath . '/' . $fileName; - } - // since the path is behind the root folder of the site, return only the root url (may be used to build the link) - return JURI::root(); - } - // sanitize the path - return '/' . trim( $filePath, '/' ) . '/' . $fileName; - } - - /** * Get the file path or url * -- 2.40.1