From 2543d11277f31fb05abafeb6d41e50ceb29dd60f Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Tue, 22 May 2018 21:01:36 +0200 Subject: [PATCH] Updated compiler to allow dynamic update for language strings. Started adding the field relationship feature requested in gh-287 --- README.md | 14 +- admin/README.txt | 14 +- admin/access.xml | 21 + admin/assets/css/admin_fields_relations.css | 13 + admin/assets/css/admins_fields_relations.css | 13 + admin/controller.php | 1 + admin/controllers/admin_fields_relations.php | 312 ++++++ admin/controllers/admin_view.php | 3 +- admin/controllers/admins_fields_relations.php | 34 + admin/helpers/compiler.php | 90 +- admin/helpers/compiler/a_Get.php | 99 +- admin/helpers/compiler/b_Structure.php | 43 +- admin/helpers/compiler/c_Fields.php | 58 +- admin/helpers/compiler/e_Interpretation.php | 742 +++++++-------- admin/helpers/compiler/f_Infusion.php | 898 +++++++++--------- admin/helpers/componentbuilder.php | 74 +- .../en-GB/en-GB.com_componentbuilder.ini | 103 +- .../en-GB/en-GB.com_componentbuilder.sys.ini | 20 + .../layouts/admin_fields_relations/index.html | 1 + .../admin_fields_relations/publishing.php | 44 + .../admin_fields_relations/publlshing.php | 46 + .../relations_above.php | 27 + .../relations_fullwidth.php | 35 + ...ons_fullwidth.php => fields_fullwidth.php} | 0 ...ds_conditions_left.php => fields_left.php} | 0 ..._conditions_right.php => fields_right.php} | 0 admin/models/admin_fields_relations.php | 878 +++++++++++++++++ admin/models/admin_view.php | 6 +- admin/models/admins_fields_relations.php | 242 +++++ admin/models/ajax.php | 25 + admin/models/componentbuilder.php | 3 + admin/models/fields/joinfields.php | 101 ++ admin/models/fields/listfields.php | 101 ++ admin/models/forms/admin_fields_relations.js | 44 + admin/models/forms/admin_fields_relations.xml | 189 ++++ admin/models/forms/admin_view.js | 3 + admin/models/rules/int.php | 25 + admin/sql/install.mysql.utf8.sql | 33 + admin/sql/uninstall.mysql.utf8.sql | 1 + admin/sql/updates/mysql/2.7.10.sql | 82 ++ admin/tables/admin_fields_relations.php | 324 +++++++ .../admin_fields_relations/submitbutton.js | 35 + .../admin_fields_relations/tmpl/edit.php | 131 +++ .../admin_fields_relations/tmpl/index.html | 1 + .../admin_fields_relations/view.html.php | 190 ++++ admin/views/admin_view/tmpl/edit.php | 8 +- admin/views/admin_views/tmpl/default_body.php | 3 + .../views/admins_fields_relations/index.html | 1 + .../admins_fields_relations/tmpl/default.php | 85 ++ .../tmpl/default_batch_body.php | 18 + .../tmpl/default_batch_footer.php | 23 + .../tmpl/default_body.php | 94 ++ .../tmpl/default_foot.php | 18 + .../tmpl/default_head.php | 47 + .../tmpl/default_toolbar.php | 45 + .../admins_fields_relations/tmpl/index.html | 1 + .../admins_fields_relations/view.html.php | 227 +++++ componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 17 + script.php | 129 ++- site/helpers/componentbuilder.php | 74 +- 61 files changed, 4858 insertions(+), 1057 deletions(-) create mode 100644 admin/assets/css/admin_fields_relations.css create mode 100644 admin/assets/css/admins_fields_relations.css create mode 100644 admin/controllers/admin_fields_relations.php create mode 100644 admin/controllers/admins_fields_relations.php create mode 100644 admin/layouts/admin_fields_relations/index.html create mode 100644 admin/layouts/admin_fields_relations/publishing.php create mode 100644 admin/layouts/admin_fields_relations/publlshing.php create mode 100644 admin/layouts/admin_fields_relations/relations_above.php create mode 100644 admin/layouts/admin_fields_relations/relations_fullwidth.php rename admin/layouts/admin_view/{fields_conditions_fullwidth.php => fields_fullwidth.php} (100%) rename admin/layouts/admin_view/{fields_conditions_left.php => fields_left.php} (100%) rename admin/layouts/admin_view/{fields_conditions_right.php => fields_right.php} (100%) create mode 100644 admin/models/admin_fields_relations.php create mode 100644 admin/models/admins_fields_relations.php create mode 100644 admin/models/fields/joinfields.php create mode 100644 admin/models/fields/listfields.php create mode 100644 admin/models/forms/admin_fields_relations.js create mode 100644 admin/models/forms/admin_fields_relations.xml create mode 100644 admin/models/rules/int.php create mode 100644 admin/sql/updates/mysql/2.7.10.sql create mode 100644 admin/tables/admin_fields_relations.php create mode 100644 admin/views/admin_fields_relations/submitbutton.js create mode 100644 admin/views/admin_fields_relations/tmpl/edit.php create mode 100644 admin/views/admin_fields_relations/tmpl/index.html create mode 100644 admin/views/admin_fields_relations/view.html.php create mode 100644 admin/views/admins_fields_relations/index.html create mode 100644 admin/views/admins_fields_relations/tmpl/default.php create mode 100644 admin/views/admins_fields_relations/tmpl/default_batch_body.php create mode 100644 admin/views/admins_fields_relations/tmpl/default_batch_footer.php create mode 100644 admin/views/admins_fields_relations/tmpl/default_body.php create mode 100644 admin/views/admins_fields_relations/tmpl/default_foot.php create mode 100644 admin/views/admins_fields_relations/tmpl/default_head.php create mode 100644 admin/views/admins_fields_relations/tmpl/default_toolbar.php create mode 100644 admin/views/admins_fields_relations/tmpl/index.html create mode 100644 admin/views/admins_fields_relations/view.html.php diff --git a/README.md b/README.md index fab9ee023..e9bffa865 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.10) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.11) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -125,14 +125,14 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo + *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*: 18th May, 2018 -+ *Version*: 2.7.10 ++ *Last Build*: 22nd May, 2018 ++ *Version*: 2.7.11 + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **181594** -+ *Field count*: **1036** -+ *File count*: **1203** -+ *Folder count*: **193** ++ *Line count*: **185406** ++ *Field count*: **1052** ++ *File count*: **1236** ++ *Folder count*: **197** > This **component** was build with a Joomla [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 fab9ee023..e9bffa865 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.10) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.11) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -125,14 +125,14 @@ Watch the [proposed development workflow](https://vdm.bz/proposed-development-wo + *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*: 18th May, 2018 -+ *Version*: 2.7.10 ++ *Last Build*: 22nd May, 2018 ++ *Version*: 2.7.11 + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **181594** -+ *Field count*: **1036** -+ *File count*: **1203** -+ *Folder count*: **193** ++ *Line count*: **185406** ++ *Field count*: **1052** ++ *File count*: **1236** ++ *Folder count*: **197** > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/access.xml b/admin/access.xml index eea0f6756..a18324667 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -50,6 +50,16 @@ + + + + + + + + + + @@ -561,6 +571,17 @@ +
+ + + + + + + + + +
diff --git a/admin/assets/css/admin_fields_relations.css b/admin/assets/css/admin_fields_relations.css new file mode 100644 index 000000000..e7aab2271 --- /dev/null +++ b/admin/assets/css/admin_fields_relations.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/admins_fields_relations.css b/admin/assets/css/admins_fields_relations.css new file mode 100644 index 000000000..e7aab2271 --- /dev/null +++ b/admin/assets/css/admins_fields_relations.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/controller.php b/admin/controller.php index 1cef30223..c81cc4e70 100644 --- a/admin/controller.php +++ b/admin/controller.php @@ -112,6 +112,7 @@ class ComponentbuilderController extends JControllerLegacy 'help_document' => 'help_documents', 'admin_fields' => 'admins_fields', 'admin_fields_conditions' => 'admins_fields_conditions', + 'admin_fields_relations' => 'admins_fields_relations', 'component_admin_views' => 'components_admin_views', 'component_site_views' => 'components_site_views', 'component_custom_admin_views' => 'components_custom_admin_views', diff --git a/admin/controllers/admin_fields_relations.php b/admin/controllers/admin_fields_relations.php new file mode 100644 index 000000000..93fa84b5a --- /dev/null +++ b/admin/controllers/admin_fields_relations.php @@ -0,0 +1,312 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +// import Joomla controllerform library +jimport('joomla.application.component.controllerform'); + +/** + * Admin_fields_relations Controller + */ +class ComponentbuilderControllerAdmin_fields_relations extends JControllerForm +{ + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + public function __construct($config = array()) + { + $this->view_list = 'Admins_fields_relations'; // safeguard for setting the return view listing to the main view. + parent::__construct($config); + } + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowAdd($data = array()) + { + // Access check. + $access = JFactory::getUser()->authorise('admin_fields_relations.access', 'com_componentbuilder'); + if (!$access) + { + return false; + } + // In the absense of better information, revert to the component permissions. + return JFactory::getUser()->authorise('admin_fields_relations.create', $this->option); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // get user object. + $user = JFactory::getUser(); + // get record id. + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + + + // Access check. + $access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder')); + if (!$access) + { + return false; + } + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('admin_fields_relations.edit', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId); + if (!$permission) + { + if ($user->authorise('admin_fields_relations.edit.own', 'com_componentbuilder.admin_fields_relations.' . $recordId)) + { + // Now test the owner is the user. + $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; + if (empty($ownerId)) + { + // Need to do a lookup from the model. + $record = $this->getModel()->getItem($recordId); + + if (empty($record)) + { + return false; + } + $ownerId = $record->created_by; + } + + // If the owner matches 'me' then allow. + if ($ownerId == $user->id) + { + if ($user->authorise('admin_fields_relations.edit.own', 'com_componentbuilder')) + { + return true; + } + } + } + return false; + } + } + // Since there is no permission, revert to the component permissions. + return $user->authorise('admin_fields_relations.edit', $this->option); + } + + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since 12.2 + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + $tmpl = $this->input->get('tmpl'); + $layout = $this->input->get('layout', 'edit', 'string'); + + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); + + // Setup redirect info. + + $append = ''; + + if ($refid) + { + $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + } + elseif ($ref) + { + $append .= '&ref='.(string)$ref; + } + + if ($tmpl) + { + $append .= '&tmpl=' . $tmpl; + } + + if ($layout) + { + $append .= '&layout=' . $layout; + } + + if ($recordId) + { + $append .= '&' . $urlVar . '=' . $recordId; + } + + return $append; + } + + /** + * Method to run batch operations. + * + * @param object $model The model. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 2.5 + */ + public function batch($model = null) + { + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('Admin_fields_relations', '', array()); + + // Preset the redirect + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_fields_relations' . $this->getRedirectToListAppend(), false)); + + return parent::batch($model); + } + + /** + * Method to cancel an edit. + * + * @param string $key The name of the primary key of the URL variable. + * + * @return boolean True if access level checks pass, false otherwise. + * + * @since 12.2 + */ + public function cancel($key = null) + { + // get the referal details + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + $cancel = parent::cancel($key); + + if ($cancel) + { + if ($this->refid) + { + $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + } + else + { + // Redirect to the items screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + ) + ); + } + return $cancel; + } + + /** + * Method to save a record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). + * + * @return boolean True if successful, false otherwise. + * + * @since 12.2 + */ + public function save($key = null, $urlVar = null) + { + // get the referal details + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } + + $saved = parent::save($key, $urlVar); + + if ($this->refid && $saved) + { + $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref && $saved) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $saved; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param JModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(JModelLegacy $model, $validData = array()) + { + return; + } + +} diff --git a/admin/controllers/admin_view.php b/admin/controllers/admin_view.php index 96117fe30..80e97fbfb 100644 --- a/admin/controllers/admin_view.php +++ b/admin/controllers/admin_view.php @@ -318,7 +318,8 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm // linked tables to update $_tablesArray = array( 'admin_fields', - 'admin_fields_conditions' + 'admin_fields_conditions', + 'admin_fields_relations' ); foreach($_tablesArray as $_updateTable) { diff --git a/admin/controllers/admins_fields_relations.php b/admin/controllers/admins_fields_relations.php new file mode 100644 index 000000000..5f55e6a6d --- /dev/null +++ b/admin/controllers/admins_fields_relations.php @@ -0,0 +1,34 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +// import Joomla controlleradmin library +jimport('joomla.application.component.controlleradmin'); + +/** + * Admins_fields_relations Controller + */ +class ComponentbuilderControllerAdmins_fields_relations extends JControllerAdmin +{ + protected $text_prefix = 'COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'; + /** + * Proxy for getModel. + * @since 2.5 + */ + public function getModel($name = 'Admin_fields_relations', $prefix = 'ComponentbuilderModel', $config = array()) + { + $model = parent::getModel($name, $prefix, array('ignore_request' => true)); + + return $model; + } +} diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 2398a2093..08fa555e6 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -72,7 +72,7 @@ class Compiler extends Infusion // first remove the files and folders $this->removeFolder($this->componentPath . '/site'); // clear form component xml - $xmlPath = $this->componentPath . '/' . $this->fileContentStatic['###component###'] . '.xml'; + $xmlPath = $this->componentPath . '/' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.xml'; $componentXML = ComponentbuilderHelper::getFileContents($xmlPath); $textToSite = ComponentbuilderHelper::getBetween($componentXML, '', ''); $textToSiteLang = ComponentbuilderHelper::getBetween($componentXML, '', ''); @@ -215,16 +215,16 @@ class Compiler extends Infusion { if (JFile::exists($static['path'])) { - $this->fileContentStatic['###FILENAME###'] = $static['name']; + $this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $static['name']; $php = ''; if (ComponentbuilderHelper::checkFileType($static['name'], 'php')) { $php = "hhh . 'BOM' . $this->hhh) !== false) { - list($wast, $code) = explode('###BOM###', $string); + list($wast, $code) = explode($this->hhh . 'BOM' . $this->hhh, $string); $string = $php . $bom . $code; $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); // add to zip array @@ -250,7 +250,7 @@ class Compiler extends Infusion { if (JFile::exists($file['path'])) { - $this->fileContentStatic['###FILENAME###'] = $file['name']; + $this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $file['name']; // do some weird stuff to improve the verion and dates being added to the license $this->fixLicenseValues($file); $php = ''; @@ -259,9 +259,9 @@ class Compiler extends Infusion $php = "hhh . 'BOM' . $this->hhh) !== false) { - list($bin, $code) = explode('###BOM###', $string); + list($bin, $code) = explode($this->hhh . 'BOM' . $this->hhh, $string); $string = $php . $bom . $code; $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); $answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3); @@ -321,7 +321,7 @@ class Compiler extends Infusion { foreach ($data['config'] as $key => $value) { - if ('###VERSION###' === $key) + if ($this->hhh . 'VERSION' . $this->hhh === $key) { // hmm we sould in some way make it known that this version number // is not in relation the the project but to the file only... any ideas? @@ -340,9 +340,9 @@ class Compiler extends Infusion return true; } // else insure to reset to global - $this->fileContentStatic['###CREATIONDATE###'] = $this->fileContentStatic['###CREATIONDATE###GLOBAL']; - $this->fileContentStatic['###BUILDDATE###'] = $this->fileContentStatic['###BUILDDATE###GLOBAL']; - $this->fileContentStatic['###VERSION###'] = $this->fileContentStatic['###VERSION###GLOBAL']; + $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh . 'GLOBAL']; + $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh . 'GLOBAL']; + $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh . 'GLOBAL']; } // set all global numbers @@ -399,7 +399,7 @@ class Compiler extends Infusion private function setReadMe($path) { // set readme data if not set already - if (!isset($this->fileContentStatic['###LINE_COUNT###']) || $this->fileContentStatic['###LINE_COUNT###'] != $this->lineCount) + if (!isset($this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh]) || $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] != $this->lineCount) { $this->buildReadMeData(); } @@ -414,39 +414,39 @@ class Compiler extends Infusion private function buildReadMeData() { // set some defaults - $this->fileContentStatic['###LINE_COUNT###'] = $this->lineCount; - $this->fileContentStatic['###FIELD_COUNT###'] = $this->fieldCount; - $this->fileContentStatic['###FILE_COUNT###'] = $this->fileCount; - $this->fileContentStatic['###FOLDER_COUNT###'] = $this->folderCount; - $this->fileContentStatic['###PAGE_COUNT###'] = $this->pageCount; - $this->fileContentStatic['###folders###'] = $this->folderSeconds; - $this->fileContentStatic['###foldersSeconds###'] = $this->folderSeconds; - $this->fileContentStatic['###files###'] = $this->fileSeconds; - $this->fileContentStatic['###filesSeconds###'] = $this->fileSeconds; - $this->fileContentStatic['###lines###'] = $this->lineSeconds; - $this->fileContentStatic['###linesSeconds###'] = $this->lineSeconds; - $this->fileContentStatic['###seconds###'] = $this->actualSeconds; - $this->fileContentStatic['###actualSeconds###'] = $this->actualSeconds; - $this->fileContentStatic['###totalHours###'] = $this->totalHours; - $this->fileContentStatic['###totalDays###'] = $this->totalDays; - $this->fileContentStatic['###debugging###'] = $this->secondsDebugging; - $this->fileContentStatic['###secondsDebugging###'] = $this->secondsDebugging; - $this->fileContentStatic['###planning###'] = $this->secondsPlanning; - $this->fileContentStatic['###secondsPlanning###'] = $this->secondsPlanning; - $this->fileContentStatic['###mapping###'] = $this->secondsMapping; - $this->fileContentStatic['###secondsMapping###'] = $this->secondsMapping; - $this->fileContentStatic['###office###'] = $this->secondsOffice; - $this->fileContentStatic['###secondsOffice###'] = $this->secondsOffice; - $this->fileContentStatic['###actualTotalHours###'] = $this->actualTotalHours; - $this->fileContentStatic['###actualTotalDays###'] = $this->actualTotalDays; - $this->fileContentStatic['###debuggingHours###'] = $this->debuggingHours; - $this->fileContentStatic['###planningHours###'] = $this->planningHours; - $this->fileContentStatic['###mappingHours###'] = $this->mappingHours; - $this->fileContentStatic['###officeHours###'] = $this->officeHours; - $this->fileContentStatic['###actualHoursSpent###'] = $this->actualHoursSpent; - $this->fileContentStatic['###actualDaysSpent###'] = $this->actualDaysSpent; - $this->fileContentStatic['###projectWeekTime###'] = $this->projectWeekTime; - $this->fileContentStatic['###projectMonthTime###'] = $this->projectMonthTime; + $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] = $this->lineCount; + $this->fileContentStatic[$this->hhh . 'FIELD_COUNT' . $this->hhh] = $this->fieldCount; + $this->fileContentStatic[$this->hhh . 'FILE_COUNT' . $this->hhh] = $this->fileCount; + $this->fileContentStatic[$this->hhh . 'FOLDER_COUNT' . $this->hhh] = $this->folderCount; + $this->fileContentStatic[$this->hhh . 'PAGE_COUNT' . $this->hhh] = $this->pageCount; + $this->fileContentStatic[$this->hhh . 'folders' . $this->hhh] = $this->folderSeconds; + $this->fileContentStatic[$this->hhh . 'foldersSeconds' . $this->hhh] = $this->folderSeconds; + $this->fileContentStatic[$this->hhh . 'files' . $this->hhh] = $this->fileSeconds; + $this->fileContentStatic[$this->hhh . 'filesSeconds' . $this->hhh] = $this->fileSeconds; + $this->fileContentStatic[$this->hhh . 'lines' . $this->hhh] = $this->lineSeconds; + $this->fileContentStatic[$this->hhh . 'linesSeconds' . $this->hhh] = $this->lineSeconds; + $this->fileContentStatic[$this->hhh . 'seconds' . $this->hhh] = $this->actualSeconds; + $this->fileContentStatic[$this->hhh . 'actualSeconds' . $this->hhh] = $this->actualSeconds; + $this->fileContentStatic[$this->hhh . 'totalHours' . $this->hhh] = $this->totalHours; + $this->fileContentStatic[$this->hhh . 'totalDays' . $this->hhh] = $this->totalDays; + $this->fileContentStatic[$this->hhh . 'debugging' . $this->hhh] = $this->secondsDebugging; + $this->fileContentStatic[$this->hhh . 'secondsDebugging' . $this->hhh] = $this->secondsDebugging; + $this->fileContentStatic[$this->hhh . 'planning' . $this->hhh] = $this->secondsPlanning; + $this->fileContentStatic[$this->hhh . 'secondsPlanning' . $this->hhh] = $this->secondsPlanning; + $this->fileContentStatic[$this->hhh . 'mapping' . $this->hhh] = $this->secondsMapping; + $this->fileContentStatic[$this->hhh . 'secondsMapping' . $this->hhh] = $this->secondsMapping; + $this->fileContentStatic[$this->hhh . 'office' . $this->hhh] = $this->secondsOffice; + $this->fileContentStatic[$this->hhh . 'secondsOffice' . $this->hhh] = $this->secondsOffice; + $this->fileContentStatic[$this->hhh . 'actualTotalHours' . $this->hhh] = $this->actualTotalHours; + $this->fileContentStatic[$this->hhh . 'actualTotalDays' . $this->hhh] = $this->actualTotalDays; + $this->fileContentStatic[$this->hhh . 'debuggingHours' . $this->hhh] = $this->debuggingHours; + $this->fileContentStatic[$this->hhh . 'planningHours' . $this->hhh] = $this->planningHours; + $this->fileContentStatic[$this->hhh . 'mappingHours' . $this->hhh] = $this->mappingHours; + $this->fileContentStatic[$this->hhh . 'officeHours' . $this->hhh] = $this->officeHours; + $this->fileContentStatic[$this->hhh . 'actualHoursSpent' . $this->hhh] = $this->actualHoursSpent; + $this->fileContentStatic[$this->hhh . 'actualDaysSpent' . $this->hhh] = $this->actualDaysSpent; + $this->fileContentStatic[$this->hhh . 'projectWeekTime' . $this->hhh] = $this->projectWeekTime; + $this->fileContentStatic[$this->hhh . 'projectMonthTime' . $this->hhh] = $this->projectMonthTime; } private function zipComponent() diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 33c83858a..c3038dcd2 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -18,6 +18,27 @@ defined('_JEXEC') or die('Restricted access'); class Get { + /** + * The hash placeholder + * + * @var string + */ + public $hhh = '#' . '#' . '#'; + + /** + * The open bracket placeholder + * + * @var string + */ + public $bbb = '[' . '[' . '['; + + /** + * The close bracket placeholder + * + * @var string + */ + public $ddd = ']' . ']' . ']'; + /** * The app * @@ -834,12 +855,12 @@ class Get $component = ComponentbuilderHelper::convertRepeatableFields($component, $searchRepeatables, $updater); // set component place holders - $this->placeholders['###component###'] = ComponentbuilderHelper::safeString($component->name_code); - $this->placeholders['###Component###'] = ComponentbuilderHelper::safeString($component->name_code, 'F'); - $this->placeholders['###COMPONENT###'] = ComponentbuilderHelper::safeString($component->name_code, 'U'); - $this->placeholders['[[[component]]]'] = $this->placeholders['###component###']; - $this->placeholders['[[[Component]]]'] = $this->placeholders['###Component###']; - $this->placeholders['[[[COMPONENT]]]'] = $this->placeholders['###COMPONENT###']; + $this->placeholders[$this->hhh . 'component' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code); + $this->placeholders[$this->hhh . 'Component' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code, 'F'); + $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh] = ComponentbuilderHelper::safeString($component->name_code, 'U'); + $this->placeholders[$this->bbb . 'component' . $this->ddd] = $this->placeholders[$this->hhh . 'component' . $this->hhh]; + $this->placeholders[$this->bbb . 'Component' . $this->ddd] = $this->placeholders[$this->hhh . 'Component' . $this->hhh]; + $this->placeholders[$this->bbb . 'COMPONENT' . $this->ddd] = $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh]; // set component sales name $component->sales_name = ComponentbuilderHelper::safeString($component->system_name); @@ -1376,18 +1397,18 @@ class Get $this->customScriptBuilder['token'][$name_single] = false; $this->customScriptBuilder['token'][$name_list] = false; // set some placeholders - $this->placeholders['###view###'] = ComponentbuilderHelper::safeString($name_single); - $this->placeholders['###views###'] = ComponentbuilderHelper::safeString($name_list); - $this->placeholders['###View###'] = ComponentbuilderHelper::safeString($name_single, 'F'); - $this->placeholders['###Views###'] = ComponentbuilderHelper::safeString($name_list, 'F'); - $this->placeholders['###VIEW###'] = ComponentbuilderHelper::safeString($name_single, 'U'); - $this->placeholders['###VIEWS###'] = ComponentbuilderHelper::safeString($name_list, 'U'); - $this->placeholders['[[[view]]]'] = $this->placeholders['###view###']; - $this->placeholders['[[[views]]]'] = $this->placeholders['###views###']; - $this->placeholders['[[[View]]]'] = $this->placeholders['###View###']; - $this->placeholders['[[[Views]]]'] = $this->placeholders['###Views###']; - $this->placeholders['[[[VIEW]]]'] = $this->placeholders['###VIEW###']; - $this->placeholders['[[[VIEWS]]]'] = $this->placeholders['###VIEWS###']; + $this->placeholders[$this->hhh . 'view' . $this->hhh] = ComponentbuilderHelper::safeString($name_single); + $this->placeholders[$this->hhh . 'views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list); + $this->placeholders[$this->hhh . 'View' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'F'); + $this->placeholders[$this->hhh . 'Views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'F'); + $this->placeholders[$this->hhh . 'VIEW' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'U'); + $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'U'); + $this->placeholders[$this->bbb . 'view' . $this->ddd] = $this->placeholders[$this->hhh . 'view' . $this->hhh]; + $this->placeholders[$this->bbb . 'views' . $this->ddd] = $this->placeholders[$this->hhh . 'views' . $this->hhh]; + $this->placeholders[$this->bbb . 'View' . $this->ddd] = $this->placeholders[$this->hhh . 'View' . $this->hhh]; + $this->placeholders[$this->bbb . 'Views' . $this->ddd] = $this->placeholders[$this->hhh . 'Views' . $this->hhh]; + $this->placeholders[$this->bbb . 'VIEW' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEW' . $this->hhh]; + $this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; // add the tables $view->addtables = (isset($view->addtables) && ComponentbuilderHelper::checkJson($view->addtables)) ? json_decode($view->addtables, true) : null; if (ComponentbuilderHelper::checkArray($view->addtables)) @@ -1819,18 +1840,18 @@ class Get } } // clear placeholders - unset($this->placeholders['###view###']); - unset($this->placeholders['###views###']); - unset($this->placeholders['###View###']); - unset($this->placeholders['###Views###']); - unset($this->placeholders['###VIEW###']); - unset($this->placeholders['###VIEWS###']); - unset($this->placeholders['[[[view]]]']); - unset($this->placeholders['[[[views]]]']); - unset($this->placeholders['[[[View]]]']); - unset($this->placeholders['[[[Views]]]']); - unset($this->placeholders['[[[VIEW]]]']); - unset($this->placeholders['[[[VIEWS]]]']); + unset($this->placeholders[$this->hhh . 'view' . $this->hhh]); + unset($this->placeholders[$this->hhh . 'views' . $this->hhh]); + unset($this->placeholders[$this->hhh . 'View' . $this->hhh]); + unset($this->placeholders[$this->hhh . 'Views' . $this->hhh]); + unset($this->placeholders[$this->hhh . 'VIEW' . $this->hhh]); + unset($this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]); + unset($this->placeholders[$this->bbb . 'view' . $this->ddd]); + unset($this->placeholders[$this->bbb . 'views' . $this->ddd]); + unset($this->placeholders[$this->bbb . 'View' . $this->ddd]); + unset($this->placeholders[$this->bbb . 'Views' . $this->ddd]); + unset($this->placeholders[$this->bbb . 'VIEW' . $this->ddd]); + unset($this->placeholders[$this->bbb . 'VIEWS' . $this->ddd]); // store this view to class object $this->_adminViewData[$id] = $view; @@ -3605,7 +3626,7 @@ class Get if (ComponentbuilderHelper::checkArray($langStringTargets)) { // insure string is not broken - $content = str_replace('COM_###COMPONENT###', $this->langPrefix, $content); + $content = str_replace('COM_' . $this->hhh . 'COMPONENT' . $this->hhh, $this->langPrefix, $content); // reset some buckets $langHolders = array(); $langCheck = array(); @@ -3938,9 +3959,9 @@ class Get $data = $this->db->loadObjectList(); // start building the MySql dump $dump = "--"; - $dump .= PHP_EOL . "-- Dumping data for table `#__[[[component]]]_" . $view . "`"; + $dump .= PHP_EOL . "-- Dumping data for table `#__".$this->bbb."component".$this->ddd."_" . $view . "`"; $dump .= PHP_EOL . "--"; - $dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__[[[component]]]_" . $view . "` ("; + $dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__".$this->bbb."component".$this->ddd."_" . $view . "` ("; foreach ($data as $line) { $comaSet = 0; @@ -4442,7 +4463,7 @@ class Get } // check what type of place holders we should load here $placeholderType = (int) $item['comment_type'] . '2'; - if (stripos($item['code'], '[[[view') !== false || stripos($item['code'], '[[[sview') !== false || stripos($item['code'], '[[[arg') !== false) + if (stripos($item['code'], $this->bbb . 'view') !== false || stripos($item['code'], $this->bbb . 'sview') !== false || stripos($item['code'], $this->bbb . 'arg') !== false) { // if view is being set dynamicly then we can't update this code via IDE (TODO) $placeholderType = 3; @@ -4472,7 +4493,7 @@ class Get $number = 0; foreach ($values as $value) { - $this->placeholders['[[[' . $key . $number . ']]]'] = $value; + $this->placeholders[$this->bbb . $key . $number . $this->ddd] = $value; $number++; } } @@ -5043,9 +5064,9 @@ class Get $fileTypes = array('\.php', '\.js'); // set some local placeholders $placeholders = array(); - $placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = '[[[Component]]]Helper::'; - $placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_[[[COMPONENT]]]'; - $placeholders['com_' . $this->componentCodeName] = 'com_[[[component]]]'; + $placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = $this->bbb . 'Component' . $this->ddd . 'Helper::'; + $placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_' . $this->bbb . 'COMPONENT' . $this->ddd; + $placeholders['com_' . $this->componentCodeName] = 'com_' . $this->bbb . 'component' . $this->ddd; foreach ($paths as $target => $path) { // we are changing the working directory to the componet path @@ -5760,7 +5781,7 @@ class Get return round($val1 + $val2); break; // Subtract one number from the other - case 'add': + case 'sub': return round($val1 - $val2); break; } diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index edea8eb5d..976528480 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -490,11 +490,11 @@ class Structure extends Get if ($addLocalFolder) { // check if we sould add it to the media xml list - if (!isset($this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'])) + if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh])) { - $this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] = ''; + $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] = ''; } - $this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t" . $libFolder . ""; + $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t" . $libFolder . ""; } } // if config fields are found load into component config (avoiding dublicates) @@ -755,9 +755,10 @@ class Structure extends Get // do license check $LICENSE = false; $licenseChecker = strtolower($this->componentData->license); - if (strpos($licenseChecker, 'gnu') !== false && strpos($licenseChecker, 'gpl') !== false) + if (strpos($licenseChecker, 'gnu') !== false && strpos($licenseChecker, '2') !== false && + (strpos($licenseChecker, 'gpl') !== false || strpos($licenseChecker, 'general public license') !== false)) { - $LICENSE = true; + $LICENSE = true; // we only add version 2 auto at this time (TODO) } // do README check $README = false; @@ -890,20 +891,20 @@ class Structure extends Get if ($view['settings']->name_list != 'null') { $target = array('admin' => $view['settings']->name_list); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'list', false, $config); } if ($view['settings']->name_single != 'null') { $target = array('admin' => $view['settings']->name_single); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'single', false, $config); } if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) { // setup the front site edit-view files $target = array('site' => $view['settings']->name_single); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'edit', false, $config); } } @@ -927,14 +928,14 @@ class Structure extends Get { // set list view $target = array('site' => $view['settings']->code); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'list', false, $config); } elseif ($view['settings']->main_get->gettype == 1) { // set single view $target = array('site' => $view['settings']->code); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'single', false, $config); } } @@ -950,14 +951,14 @@ class Structure extends Get { // set list view$view $target = array('custom_admin' => $view['settings']->code); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'list', false, $config); } elseif ($view['settings']->main_get->gettype == 1) { // set single view $target = array('custom_admin' => $view['settings']->code); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'single', false, $config); } } @@ -1278,31 +1279,31 @@ class Structure extends Get $newname = ''; } // check if we sould add it to the media xml list - if (!isset($this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'])) + if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh])) { - $this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] = ''; + $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] = ''; } if (count($pathArray) == 1 && $firstFolder === 'media') { - $this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t" . $lastFolder . ""; + $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t" . $lastFolder . ""; } // check if we sould add it to the site xml list - if (!isset($this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'])) + if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh])) { - $this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] = ''; + $this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh] = ''; } if (count($pathArray) == 1 && $firstFolder === 'site') { - $this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] .= PHP_EOL . "\t\t" . $lastFolder . ""; + $this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t" . $lastFolder . ""; } // check if we sould add it to the admin xml list - if (!isset($this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'])) + if (!isset($this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh])) { - $this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] = ''; + $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh] = ''; } if (count($pathArray) == 1 && $firstFolder === 'admin') { - $this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] .= PHP_EOL . "\t\t\t" . $lastFolder . ""; + $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh] .= PHP_EOL . "\t\t\t" . $lastFolder . ""; } // make we have not duplicates $key_pointer = ComponentbuilderHelper::safeString($custom['folder']) . '_f' . $pointer_tracker; diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 725e24791..b7202fd9a 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -384,8 +384,8 @@ class Fields extends Structure $this->accessBuilder[$view_name_single] = $view_name_single; } // main lang prefix - $langView = $this->langPrefix . '_' . $this->placeholders['###VIEW###']; - $langViews = $this->langPrefix . '_' . $this->placeholders['###VIEWS###']; + $langView = $this->langPrefix . '_' . $this->placeholders[$this->hhh . 'VIEW' . $this->hhh]; + $langViews = $this->langPrefix . '_' . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; // set default lang $this->langContent[$this->lang][$langView] = $view['settings']->name_single; $this->langContent[$this->lang][$langViews] = $view['settings']->name_list; @@ -2696,17 +2696,17 @@ class Fields extends Structure ); // make field dynamic $replace = array( - '###TABLE###' => $data['custom']['table'], - '###ID###' => $data['custom']['id'], - '###TEXT###' => $data['custom']['text'], - '###CODE_TEXT###' => $data['code'] . '_' . $data['custom']['text'], - '###CODE###' => $data['code'], - '###component###' => $this->fileContentStatic['###component###'], - '###Component###' => $this->fileContentStatic['###Component###'], - '###view_type###' => $view_name_single . '_' . $data['type'], - '###type###' => $data['type'], - '###view###' => $view_name_single, - '###views###' => $view_name_list + $this->hhh . 'TABLE' . $this->hhh => $data['custom']['table'], + $this->hhh . 'ID' . $this->hhh => $data['custom']['id'], + $this->hhh . 'TEXT' . $this->hhh => $data['custom']['text'], + $this->hhh . 'CODE_TEXT' . $this->hhh => $data['code'] . '_' . $data['custom']['text'], + $this->hhh . 'CODE' . $this->hhh => $data['code'], + $this->hhh . 'component' . $this->hhh => $this->fileContentStatic[$this->hhh . 'component' . $this->hhh], + $this->hhh . 'Component' . $this->hhh => $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], + $this->hhh . 'view_type' . $this->hhh => $view_name_single . '_' . $data['type'], + $this->hhh . 'type' . $this->hhh => $data['type'], + $this->hhh . 'view' . $this->hhh => $view_name_single, + $this->hhh . 'views' . $this->hhh => $view_name_list ); // now load the php script if (isset($data['custom']['php']) && ComponentbuilderHelper::checkArray($data['custom']['php'])) @@ -2780,23 +2780,23 @@ class Fields extends Structure $this->langContent[$this->lang][$groupLangName] = ComponentbuilderHelper::safeString($tempName, 'W'); // build the Group Control $this->setGroupControl[$data['type']] = $groupLangName; - // ###JFORM_GETGROUPS_PHP### <<>> - $this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETGROUPS_PHP###'] = $phpCode; + // JFORM_GETGROUPS_PHP <<>> + $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'JFORM_GETGROUPS_PHP' . $this->hhh] = $phpCode; - // ###JFORM_GETEXCLUDED_PHP### <<>> - $this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETEXCLUDED_PHP###'] = $phpxCode; + // JFORM_GETEXCLUDED_PHP <<>> + $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'JFORM_GETEXCLUDED_PHP' . $this->hhh] = $phpxCode; } else { - // ###JFORM_GETOPTIONS_PHP### <<>> - $this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETOPTIONS_PHP###'] = $phpCode; + // JFORM_GETOPTIONS_PHP <<>> + $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'JFORM_GETOPTIONS_PHP' . $this->hhh] = $phpCode; } - // ###Type### <<>> - $this->fileContentDynamic['customfield_' . $data['type']]['###Type###'] = ComponentbuilderHelper::safeString($data['custom']['type'], 'F'); - // ###type### <<>> - $this->fileContentDynamic['customfield_' . $data['type']]['###type###'] = $data['custom']['type']; - // ###type### <<>> - $this->fileContentDynamic['customfield_' . $data['type']]['###ADD_BUTTON###'] = $this->setAddButtonToListField($data['custom']); + // Type <<>> + $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'Type' . $this->hhh] = ComponentbuilderHelper::safeString($data['custom']['type'], 'F'); + // type <<>> + $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'type' . $this->hhh] = $data['custom']['type']; + // type <<>> + $this->fileContentDynamic['customfield_' . $data['type']][$this->hhh . 'ADD_BUTTON' . $this->hhh] = $this->setAddButtonToListField($data['custom']); } } @@ -2818,15 +2818,15 @@ class Fields extends Structure // check that the component value is set if (!isset($fieldData['component']) || !ComponentbuilderHelper::checkString($fieldData['component'])) { - $fieldData['component'] = "com_" . $this->fileContentStatic['###component###']; + $fieldData['component'] = "com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]; } // check that the componet has the com_ value in it if (strpos($fieldData['component'], 'com_') === false || strpos($fieldData['component'], '=') !== false) { $fieldData['component'] = "com_" . $fieldData['component']; } - // make sure the component is update if ### or [[[ component placeholder is used - if (strpos($fieldData['component'], '###') !== false || strpos($fieldData['component'], '[[[') !== false) // should not be needed... but + // make sure the component is update if # # # or [ [ [ component placeholder is used + if (strpos($fieldData['component'], $this->hhh) !== false || strpos($fieldData['component'], $this->bbb) !== false) // should not be needed... but { $fieldData['component'] = $this->setPlaceholders($fieldData['component'], $this->placeholders); } @@ -2841,7 +2841,7 @@ class Fields extends Structure // set switch to activate easy update $coreLoad = true; // since the view is local to the component use this component name - $component = "com_" . $this->fileContentStatic['###component###']; + $component = "com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]; } else { diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index abaed3ab0..e07c234aa 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -211,14 +211,14 @@ class Interpretation extends Fields if (isset($this->componentData->add_email_helper) && $this->componentData->add_email_helper) { // set email helper in place with component name - $component = $this->fileContentStatic['###component###']; - $Component = $this->fileContentStatic['###Component###']; + $component = $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]; + $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; $target = array('admin' => 'emailer'); $done = $this->buildDynamique($target, 'emailer', $component); if ($done) { - // the text for the file ###BAKING### - $this->fileContentDynamic['emailer_' . $component]['###BAKING###'] = ''; // <<-- to insure it gets updated + // the text for the file BAKING + $this->fileContentDynamic['emailer_' . $component][$this->hhh . 'BAKING' . $this->hhh] = ''; // <<-- to insure it gets updated // return the code need to load the abstract class return PHP_EOL . "JLoader::register('" . $Component . "Email', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/" . $component . "email.php'); "; } @@ -233,23 +233,23 @@ class Interpretation extends Fields { if ($this->componentData->add_license && $this->componentData->license_type == 3) { - if (!isset($this->fileContentStatic['###HELPER_SITE_LICENSE_LOCK###'])) + if (!isset($this->fileContentStatic[$this->hhh . 'HELPER_SITE_LICENSE_LOCK' . $this->hhh])) { $_VDM = '_' . ComponentbuilderHelper::safeString($this->uniquekey(10), 'U'); // add it to the system - $this->fileContentStatic['###HELPER_SITE_LICENSE_LOCK###'] = $this->setHelperLicenseLock($_VDM, 'site'); - $this->fileContentStatic['###HELPER_LICENSE_LOCK###'] = $this->setHelperLicenseLock($_VDM, 'admin'); - $this->fileContentStatic['###LICENSE_LOCKED_INT###'] = $this->setInitLicenseLock($_VDM); - $this->fileContentStatic['###LICENSE_LOCKED_DEFINED###'] = PHP_EOL . PHP_EOL . 'defined(\'' . $_VDM . '\') or die(JText:' . ':_(\'NIE_REG_NIE\'));'; + $this->fileContentStatic[$this->hhh . 'HELPER_SITE_LICENSE_LOCK' . $this->hhh] = $this->setHelperLicenseLock($_VDM, 'site'); + $this->fileContentStatic[$this->hhh . 'HELPER_LICENSE_LOCK' . $this->hhh] = $this->setHelperLicenseLock($_VDM, 'admin'); + $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_INT' . $this->hhh] = $this->setInitLicenseLock($_VDM); + $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_DEFINED' . $this->hhh] = PHP_EOL . PHP_EOL . 'defined(\'' . $_VDM . '\') or die(JText:' . ':_(\'NIE_REG_NIE\'));'; } } else { // don't add it to the system - $this->fileContentStatic['###HELPER_SITE_LICENSE_LOCK###'] = ''; - $this->fileContentStatic['###HELPER_LICENSE_LOCK###'] = ''; - $this->fileContentStatic['###LICENSE_LOCKED_INT###'] = ''; - $this->fileContentStatic['###LICENSE_LOCKED_DEFINED###'] = ''; + $this->fileContentStatic[$this->hhh . 'HELPER_SITE_LICENSE_LOCK' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'HELPER_LICENSE_LOCK' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_INT' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'LICENSE_LOCKED_DEFINED' . $this->hhh] = ''; } } @@ -260,23 +260,23 @@ class Interpretation extends Fields { if ($this->componentData->add_license && $this->componentData->license_type == 3) { - if (!isset($this->fileContentDynamic[$view]['###BOOLMETHOD###'])) + if (!isset($this->fileContentDynamic[$view][$this->hhh . 'BOOLMETHOD' . $this->hhh])) { $boolMethod = 'get' . ComponentbuilderHelper::safeString($this->uniquekey(3, false, 'ddd'), 'W'); $globalbool = 'set' . ComponentbuilderHelper::safeString($this->uniquekey(3), 'W'); // add it to the system - $this->fileContentDynamic[$view]['###LICENSE_LOCKED_SET_BOOL###'] = $this->setBoolLicenseLock($boolMethod, $globalbool); - $this->fileContentDynamic[$view]['###LICENSE_LOCKED_CHECK###'] = $this->checkStatmentLicenseLocked($boolMethod); - $this->fileContentDynamic[$view]['###LICENSE_TABLE_LOCKED_CHECK###'] = $this->checkStatmentLicenseLocked($boolMethod, '$table'); - $this->fileContentDynamic[$view]['###BOOLMETHOD###'] = $boolMethod; + $this->fileContentDynamic[$view][$this->hhh . 'LICENSE_LOCKED_SET_BOOL' . $this->hhh] = $this->setBoolLicenseLock($boolMethod, $globalbool); + $this->fileContentDynamic[$view][$this->hhh . 'LICENSE_LOCKED_CHECK' . $this->hhh] = $this->checkStatmentLicenseLocked($boolMethod); + $this->fileContentDynamic[$view][$this->hhh . 'LICENSE_TABLE_LOCKED_CHECK' . $this->hhh] = $this->checkStatmentLicenseLocked($boolMethod, '$table'); + $this->fileContentDynamic[$view][$this->hhh . 'BOOLMETHOD' . $this->hhh] = $boolMethod; } } else { // don't add it to the system - $this->fileContentDynamic[$view]['###LICENSE_LOCKED_SET_BOOL###'] = ''; - $this->fileContentDynamic[$view]['###LICENSE_LOCKED_CHECK###'] = ''; - $this->fileContentDynamic[$view]['###LICENSE_TABLE_LOCKED_CHECK###'] = ''; + $this->fileContentDynamic[$view][$this->hhh . 'LICENSE_LOCKED_SET_BOOL' . $this->hhh] = ''; + $this->fileContentDynamic[$view][$this->hhh . 'LICENSE_LOCKED_CHECK' . $this->hhh] = ''; + $this->fileContentDynamic[$view][$this->hhh . 'LICENSE_TABLE_LOCKED_CHECK' . $this->hhh] = ''; } } @@ -309,12 +309,12 @@ class Interpretation extends Fields $bool[] = "\t\t\treturn \$this->" . $globalbool . ";"; $bool[] = "\t\t}"; $bool[] = "\t\t//" . $this->setLine(__LINE__) . " Get the global params"; - $bool[] = "\t\t\$params = JComponentHelper::getParams('com_" . $this->fileContentStatic['###component###'] . "', true);"; + $bool[] = "\t\t\$params = JComponentHelper::getParams('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "', true);"; $bool[] = "\t\t\$license_key = \$params->get('license_key', null);"; $bool[] = "\t\tif (\$license_key)"; $bool[] = "\t\t{"; $bool[] = "\t\t\t//" . $this->setLine(__LINE__) . " load the file"; - $bool[] = "\t\t\tJLoader::import( 'vdm', JPATH_ADMINISTRATOR .'/components/com_" . $this->fileContentStatic['###component###'] . "');"; + $bool[] = "\t\t\tJLoader::import( 'vdm', JPATH_ADMINISTRATOR .'/components/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "');"; $bool[] = "\t\t\t\$the = new VDM(\$license_key);"; $bool[] = "\t\t\t\$this->" . $globalbool . " = \$the->_is;"; $bool[] = "\t\t\treturn \$this->" . $globalbool . ";"; @@ -333,12 +333,12 @@ class Interpretation extends Fields $helper[] = "\tpublic static function isGenuine()"; $helper[] = "\t{"; $helper[] = "\t\t//" . $this->setLine(__LINE__) . " Get the global params"; - $helper[] = "\t\t\$params = JComponentHelper::getParams('com_" . $this->fileContentStatic['###component###'] . "', true);"; + $helper[] = "\t\t\$params = JComponentHelper::getParams('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "', true);"; $helper[] = "\t\t\$license_key = \$params->get('license_key', null);"; $helper[] = "\t\tif (\$license_key)"; $helper[] = "\t\t{"; $helper[] = "\t\t\t//" . $this->setLine(__LINE__) . " load the file"; - $helper[] = "\t\t\tJLoader::import( 'vdm', JPATH_ADMINISTRATOR .'/components/com_" . $this->fileContentStatic['###component###'] . "');"; + $helper[] = "\t\t\tJLoader::import( 'vdm', JPATH_ADMINISTRATOR .'/components/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "');"; $helper[] = "\t\t\t\$the = new VDM(\$license_key);"; $helper[] = "\t\t\treturn \$the->_is;"; $helper[] = "\t\t}"; @@ -352,7 +352,7 @@ class Interpretation extends Fields { $init[] = PHP_EOL . "if (!defined('" . $_VDM . "'))"; $init[] = "{"; - $init[] = "\t\$allow = " . $this->fileContentStatic['###Component###'] . "Helper::isGenuine();"; + $init[] = "\t\$allow = " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::isGenuine();"; $init[] = "\tif (\$allow)"; $init[] = "\t{"; $init[] = "\t\tdefine('" . $_VDM . "', 1);"; @@ -553,8 +553,8 @@ class Interpretation extends Fields public function setGetCryptKey() { - // ###ENCRYPT_FILE### - $this->fileContentStatic['###ENCRYPT_FILE###'] = ''; + // ENCRYPT_FILE + $this->fileContentStatic[$this->hhh . 'ENCRYPT_FILE' . $this->hhh] = ''; if ((isset($this->basicEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder)) || (isset($this->mediumEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->mediumEncryptionBuilder)) || (isset($this->whmcsEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->whmcsEncryptionBuilder)) || @@ -565,13 +565,13 @@ class Interpretation extends Fields // set whmcs encrypt file into place $target = array('admin' => 'whmcs'); $done = $this->buildDynamique($target, 'whmcs'); - // the text for the file ###WHMCS_ENCRYPTION_BODY### - $this->fileContentDynamic['whmcs']['###WHMCS_ENCRYPTION_BODY###'] = $this->setWHMCSCryption(); - // ###ENCRYPT_FILE### - $this->fileContentStatic['###WHMCS_ENCRYPT_FILE###'] = PHP_EOL . "\t\t\twhmcs.php"; + // the text for the file WHMCS_ENCRYPTION_BODY + $this->fileContentDynamic['whmcs'][$this->hhh . 'WHMCS_ENCRYPTION_BODY' . $this->hhh] = $this->setWHMCSCryption(); + // ENCRYPT_FILE + $this->fileContentStatic[$this->hhh . 'WHMCS_ENCRYPT_FILE' . $this->hhh] = PHP_EOL . "\t\t\twhmcs.php"; } // get component name - $component = $this->fileContentStatic['###component###']; + $component = $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]; // set the getCryptKey function to the helper class $function = array(); // start building the getCryptKey function/class method @@ -758,11 +758,11 @@ class Interpretation extends Fields if ($this->componentData->add_update_server && $this->componentData->update_server_target != 3) { $updateXML[] = ''; - // ###UPDATE_SERVER_XML### + // UPDATE_SERVER_XML $name = str_replace('.xml', '', substr($this->componentData->update_server_url, strrpos($this->componentData->update_server_url, '/') + 1)); $target = array('admin' => $name); $this->buildDynamique($target, 'update_server'); - $this->fileContentDynamic[$name]['###UPDATE_SERVER_XML###'] = implode(PHP_EOL, $updateXML); + $this->fileContentDynamic[$name][$this->hhh . 'UPDATE_SERVER_XML' . $this->hhh] = implode(PHP_EOL, $updateXML); // set the Update server file name $this->updateServerFileName = $name; @@ -771,20 +771,20 @@ class Interpretation extends Fields // add the update server link to component XML if ($this->componentData->add_update_server && isset($this->componentData->update_server_url) && ComponentbuilderHelper::checkString($this->componentData->update_server_url)) { - // ###UPDATESERVER### + // UPDATESERVER $updateServer = array(); $updateServer[] = PHP_EOL . "\t"; - $updateServer[] = "\t\t" . '' . $this->componentData->update_server_url . ''; + $updateServer[] = "\t\t" . '' . $this->componentData->update_server_url . ''; $updateServer[] = "\t"; // return the array to string $updateServer = implode(PHP_EOL, $updateServer); // add update server details to component XML file - $this->fileContentStatic['###UPDATESERVER###'] = $updateServer; + $this->fileContentStatic[$this->hhh . 'UPDATESERVER' . $this->hhh] = $updateServer; } else { // add update server details to component XML file - $this->fileContentStatic['###UPDATESERVER###'] = ''; + $this->fileContentStatic[$this->hhh . 'UPDATESERVER' . $this->hhh] = ''; } // ensure to update Component version data if (ComponentbuilderHelper::checkArray($this->updateSQLBuilder)) @@ -899,7 +899,7 @@ class Interpretation extends Fields $name = ComponentbuilderHelper::safeString($update['version']); $target = array('admin' => $name); $this->buildDynamique($target, 'sql_update', $update['version']); - $this->fileContentDynamic[$name . '_' . $update['version']]['###UPDATE_VERSION_MYSQL###'] = $update['mysql']; + $this->fileContentDynamic[$name . '_' . $update['version']][$this->hhh . 'UPDATE_VERSION_MYSQL' . $this->hhh] = $update['mysql']; } elseif (isset($update['url']) && ComponentbuilderHelper::checkString($update['url'])) { @@ -910,12 +910,12 @@ class Interpretation extends Fields { // build update xml $updateXML[] = "\t"; - $updateXML[] = "\t\t" . $this->fileContentStatic['###Component_name###'] . ""; - $updateXML[] = "\t\t" . $this->fileContentStatic['###SHORT_DESCRIPTION###'] . ""; - $updateXML[] = "\t\tcom_" . $this->fileContentStatic['###component###'] . ""; + $updateXML[] = "\t\t" . $this->fileContentStatic[$this->hhh . 'Component_name' . $this->hhh] . ""; + $updateXML[] = "\t\t" . $this->fileContentStatic[$this->hhh . 'SHORT_DESCRIPTION' . $this->hhh] . ""; + $updateXML[] = "\t\tcom_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . ""; $updateXML[] = "\t\tcomponent"; $updateXML[] = "\t\t" . $update['version'] . ""; - $updateXML[] = "\t\t" . '' . $this->fileContentStatic['###AUTHORWEBSITE###'] . ''; + $updateXML[] = "\t\t" . '' . $this->fileContentStatic[$this->hhh . 'AUTHORWEBSITE' . $this->hhh] . ''; $updateXML[] = "\t\t"; if (!isset($update['url']) || !ComponentbuilderHelper::checkString($update['url'])) { @@ -926,8 +926,8 @@ class Interpretation extends Fields $updateXML[] = "\t\t"; $updateXML[] = "\t\t\tstable"; $updateXML[] = "\t\t"; - $updateXML[] = "\t\t" . $this->fileContentStatic['###AUTHOR###'] . ""; - $updateXML[] = "\t\t" . $this->fileContentStatic['###AUTHORWEBSITE###'] . ""; + $updateXML[] = "\t\t" . $this->fileContentStatic[$this->hhh . 'AUTHOR' . $this->hhh] . ""; + $updateXML[] = "\t\t" . $this->fileContentStatic[$this->hhh . 'AUTHORWEBSITE' . $this->hhh] . ""; $updateXML[] = "\t\t" . ''; $updateXML[] = "\t"; } @@ -959,12 +959,12 @@ class Interpretation extends Fields $sitedone = $this->buildDynamique($target, 'help'); if ($admindone && $sitedone) { - // ###HELP### - $this->fileContentStatic['###HELP###'] = $this->setHelp(1); - // ###HELP_SITE### - $this->fileContentStatic['###HELP_SITE###'] = $this->setHelp(2); + // HELP + $this->fileContentStatic[$this->hhh . 'HELP' . $this->hhh] = $this->setHelp(1); + // HELP_SITE + $this->fileContentStatic[$this->hhh . 'HELP_SITE' . $this->hhh] = $this->setHelp(2); // to make sure the file is updated TODO - $this->fileContentDynamic['help']['###BLABLA###'] = 'blabla'; + $this->fileContentDynamic['help'][$this->hhh . 'BLABLA' . $this->hhh] = 'blabla'; return true; } } @@ -990,7 +990,7 @@ class Interpretation extends Fields $help[] = "\t\t\$db = JFactory::getDbo();"; $help[] = "\t\t\$query = \$db->getQuery(true);"; $help[] = "\t\t\$query->select(array('a.id','a.groups','a.target','a.type','a.article','a.url'));"; - $help[] = "\t\t\$query->from('#__" . $this->fileContentStatic['###component###'] . "_help_document AS a');"; + $help[] = "\t\t\$query->from('#__" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_help_document AS a');"; $help[] = "\t\t\$query->where('a." . $target . " = '.\$db->quote(\$view));"; $help[] = "\t\t\$query->where('a.location = " . (int) $location . "');"; $help[] = "\t\t\$query->where('a.published = 1');"; @@ -1047,7 +1047,7 @@ class Interpretation extends Fields $help[] = "\tprotected static function loadHelpTextLink(\$id)"; $help[] = "\t{"; $help[] = "\t\t\$token = JSession::getFormToken();"; - $help[] = "\t\treturn 'index.php?option=com_" . $this->fileContentStatic['###component###'] . "&task=help.getText&id=' . (int) \$id . '&token=' . \$token;"; + $help[] = "\t\treturn 'index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&task=help.getText&id=' . (int) \$id . '&token=' . \$token;"; $help[] = "\t}"; // return the help methods return implode(PHP_EOL, $help); @@ -1061,7 +1061,7 @@ class Interpretation extends Fields $exel[] = PHP_EOL . PHP_EOL . "\t/**"; $exel[] = "\t * Prepares the xml document"; $exel[] = "\t */"; - $exel[] = "\tpublic static function xls(\$rows,\$fileName = null,\$title = null,\$subjectTab = null,\$creator = '" . $this->fileContentStatic['###COMPANYNAME###'] . "',\$description = null,\$category = null,\$keywords = null,\$modified = null)"; + $exel[] = "\tpublic static function xls(\$rows,\$fileName = null,\$title = null,\$subjectTab = null,\$creator = '" . $this->fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] . "',\$description = null,\$category = null,\$keywords = null,\$modified = null)"; $exel[] = "\t{"; $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set the user"; $exel[] = "\t\t\$user = JFactory::getUser();"; @@ -1095,7 +1095,7 @@ class Interpretation extends Fields $exel[] = "\t\t"; $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Set document properties"; $exel[] = "\t\t\$objPHPExcel->getProperties()->setCreator(\$creator)"; - $exel[] = "\t\t\t\t\t\t\t\t\t ->setCompany('" . $this->fileContentStatic['###COMPANYNAME###'] . "')"; + $exel[] = "\t\t\t\t\t\t\t\t\t ->setCompany('" . $this->fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] . "')"; $exel[] = "\t\t\t\t\t\t\t\t\t ->setLastModifiedBy(\$modified)"; $exel[] = "\t\t\t\t\t\t\t\t\t ->setTitle(\$title)"; $exel[] = "\t\t\t\t\t\t\t\t\t ->setSubject(\$subjectTab);"; @@ -1391,7 +1391,7 @@ class Interpretation extends Fields if ($done) { // set the lang - $lang = ComponentbuilderHelper::safeString('com_' . $this->fileContentStatic['###component###'] . '_menu_' . $view['settings']->code, 'U'); + $lang = ComponentbuilderHelper::safeString('com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_menu_' . $view['settings']->code, 'U'); $this->langContent['adminsys'][$lang . '_TITLE'] = $view['settings']->name; $this->langContent['adminsys'][$lang . '_OPTION'] = $view['settings']->name; $this->langContent['adminsys'][$lang . '_DESC'] = $view['settings']->description; @@ -1408,8 +1408,8 @@ class Interpretation extends Fields $xml .= PHP_EOL . "\t" . ''; $xml .= PHP_EOL . "\t" . ''; $xml .= PHP_EOL . "\t\t" . '
'; + $xml .= PHP_EOL . "\t\t\t" . 'addrulepath="/administrator/components/com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '/models/rules"'; + $xml .= PHP_EOL . "\t\t\t" . 'addfieldpath="/administrator/components/com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '/models/fields">'; if (isset($this->hasIdRequest[$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->hasIdRequest[$view['settings']->code])) { foreach ($this->hasIdRequest[$view['settings']->code] as $requestFieldXML) @@ -1436,9 +1436,9 @@ class Interpretation extends Fields { $xml .= PHP_EOL . "\t" . ''; $xml .= PHP_EOL . "\t" . ''; - $xml .= PHP_EOL . "\t\t" . '
'; + $xml .= PHP_EOL . "\t\t" . '
'; $xml .= implode("\t\t\t", $params); $xml .= PHP_EOL . "\t\t" . '
'; $xml .= PHP_EOL . "\t" . ''; @@ -1587,7 +1587,7 @@ class Interpretation extends Fields case 9: // COM_COMPONENTBUILDER_DYNAMIC_GET_ARRAY_VALUE - $filter .= PHP_EOL . PHP_EOL . "\t" . $tab . "\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(" . $string . "->" . $field . "))"; + $filter .= PHP_EOL . PHP_EOL . "\t" . $tab . "\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(" . $string . "->" . $field . "))"; $filter .= PHP_EOL . "\t" . $tab . "\t{"; $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " do your thing here"; @@ -1613,11 +1613,11 @@ class Interpretation extends Fields case 10: // COM_COMPONENTBUILDER_DYNAMIC_GET_REPEATABLE_VALUE $filter .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " filter " . $as . " based on repeatable value"; - $filter .= PHP_EOL . "\t" . $tab . "\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkString(" . $string . "->" . $field . "))"; + $filter .= PHP_EOL . "\t" . $tab . "\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkString(" . $string . "->" . $field . "))"; $filter .= PHP_EOL . "\t" . $tab . "\t{"; $filter .= PHP_EOL . "\t\t" . $tab . "\t\$array = json_decode(" . $string . "->" . $field . ",true);"; - $filter .= PHP_EOL . "\t\t" . $tab . "\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$array))"; + $filter .= PHP_EOL . "\t\t" . $tab . "\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$array))"; $filter .= PHP_EOL . "\t\t" . $tab . "\t{"; $filter .= PHP_EOL . "\t\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " do your thing here"; @@ -1680,7 +1680,7 @@ class Interpretation extends Fields { if ('json' === $decode) { - $if = PHP_EOL . "\t" . $tab . "\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkJson(" . $string . "->" . $field . "))" . PHP_EOL . "\t" . $tab . "\t{"; + $if = PHP_EOL . "\t" . $tab . "\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(" . $string . "->" . $field . "))" . PHP_EOL . "\t" . $tab . "\t{"; // json_decode $decoder = $string . "->" . $field . " = json_decode(" . $string . "->" . $field . ", true);"; } @@ -1717,7 +1717,7 @@ class Interpretation extends Fields { $fieldPrepare = ''; $runplugins = false; - $context = 'com_' . $this->fileContentStatic['###component###'] . '.' . $code; + $context = 'com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.' . $code; foreach ($checker as $field => $array) { if (strpos($get['selection']['select'], $field) !== false) @@ -1737,7 +1737,7 @@ class Interpretation extends Fields } } // load dispatcher - $this->JEventDispatcher = array('###DISPATCHER###' => ($runplugins ?: '')); + $this->JEventDispatcher = array($this->hhh . 'DISPATCHER' . $this->hhh => ($runplugins ?: '')); // return content prepare fix return $fieldPrepare; } @@ -1753,7 +1753,7 @@ class Interpretation extends Fields if (2 == $this->uikit || 1 == $this->uikit) { $fieldUikit .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Checking if " . $field . " has uikit components that must be loaded."; - $fieldUikit .= PHP_EOL . "\t" . $tab . "\t\$this->uikitComp = " . $this->fileContentStatic['###Component###'] . "Helper::getUikitComp(" . $string . "->" . $field . ",\$this->uikitComp);"; + $fieldUikit .= PHP_EOL . "\t" . $tab . "\t\$this->uikitComp = " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::getUikitComp(" . $string . "->" . $field . ",\$this->uikitComp);"; } } } @@ -1773,8 +1773,8 @@ class Interpretation extends Fields if ($this->checkJoint($default, $get, $asBucket)) { // build custom join string - $otherJoin = PHP_EOL . "\t###TAB###\t//" . $this->setLine(__LINE__) . " set " . $default['valueName'] . " to the ###STRING### object."; - $otherJoin .= PHP_EOL . "\t###TAB###\t###STRING###->" . $default['valueName'] . " = \$this->get" . $default['methodName'] . "(###STRING###->" . $this->getAsLookup[$get['key']][$get['on_field']] . ");"; + $otherJoin = PHP_EOL . "\t" . $this->hhh . "TAB" . $this->hhh . "\t//" . $this->setLine(__LINE__) . " set " . $default['valueName'] . " to the " . $this->hhh . "STRING" . $this->hhh . " object."; + $otherJoin .= PHP_EOL . "\t" . $this->hhh . "TAB" . $this->hhh . "\t" . $this->hhh . "STRING" . $this->hhh . "->" . $default['valueName'] . " = \$this->get" . $default['methodName'] . "(" . $this->hhh . "STRING" . $this->hhh . "->" . $this->getAsLookup[$get['key']][$get['on_field']] . ");"; // load to other join if (!isset($this->otherJoin[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']])) { @@ -1869,7 +1869,7 @@ class Interpretation extends Fields { $string = PHP_EOL . "\t\t" . $tab . "//" . $this->setLine(__LINE__) . " Check if " . $ter['state_key'] . " is an array with values."; $string .= PHP_EOL . "\t\t" . $tab . "\$array = " . $ter['state_key'] . ";"; - $string .= PHP_EOL . "\t\t" . $tab . "if (isset(\$array) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$array))"; + $string .= PHP_EOL . "\t\t" . $tab . "if (isset(\$array) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$array))"; $string .= PHP_EOL . "\t\t" . $tab . "{"; $string .= PHP_EOL . "\t\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$array) . ')');"; $string .= PHP_EOL . "\t\t" . $tab . "}"; @@ -1882,7 +1882,7 @@ class Interpretation extends Fields { $string = PHP_EOL . "\t\t" . $tab . "//" . $this->setLine(__LINE__) . " Check if " . $ter['state_key'] . " is a string or numeric value."; $string .= PHP_EOL . "\t\t" . $tab . "\$checkValue = " . $ter['state_key'] . ";"; - $string .= PHP_EOL . "\t\t" . $tab . "if (isset(\$checkValue) && " . $this->fileContentStatic['###Component###'] . "Helper::checkString(\$checkValue))"; + $string .= PHP_EOL . "\t\t" . $tab . "if (isset(\$checkValue) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkString(\$checkValue))"; $string .= PHP_EOL . "\t\t" . $tab . "{"; $string .= PHP_EOL . "\t\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . \$db->quote(\$checkValue));"; $string .= PHP_EOL . "\t\t" . $tab . "}"; @@ -2014,7 +2014,7 @@ class Interpretation extends Fields // set the string if ($whe['operator'] === 'IN' || $whe['operator'] === 'NOT IN') { - $string = "if (isset(" . $whe['value_key'] . ") && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(" . $whe['value_key'] . "))"; + $string = "if (isset(" . $whe['value_key'] . ") && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(" . $whe['value_key'] . "))"; $string .= PHP_EOL . "\t" . $tabe . "\t{"; $string .= PHP_EOL . "\t" . $tabe . "\t\t//" . $this->setLine(__LINE__) . " Get where " . $whe['table_key'] . " is " . $whe['value_key']; $string .= PHP_EOL . "\t" . $tabe . "\t\t\$query->where('" . $whe['table_key'] . " " . $whe['operator'] . $value; @@ -2112,10 +2112,10 @@ class Interpretation extends Fields break; } // check that the default and the redirect page is not the same - if (isset($this->fileContentStatic['###SITE_DEFAULT_VIEW###']) && $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] != $view['settings']->code) + if (isset($this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh]) && $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] != $view['settings']->code) { $redirectMessage = "\t\t\t//" . $this->setLine(__LINE__) . " redirect away to the default view if no access allowed."; - $redirectString = "JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] . "')"; + $redirectString = "JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] . "')"; } else { @@ -2123,7 +2123,7 @@ class Interpretation extends Fields $redirectString = 'JURI::root()'; } $accessCheck[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " check if this user has permission to access item"; - $accessCheck[] = "\t\tif (!" . $userString . "->authorise('site." . $view['settings']->code . ".access', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $accessCheck[] = "\t\tif (!" . $userString . "->authorise('site." . $view['settings']->code . ".access', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; $accessCheck[] = "\t\t{"; $accessCheck[] = "\t\t\t\$app = JFactory::getApplication();"; // set lang @@ -2205,9 +2205,9 @@ class Interpretation extends Fields if ('site' === $this->target) { // check that the default and the redirect page is not the same - if (isset($this->fileContentStatic['###SITE_DEFAULT_VIEW###']) && $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] != $code) + if (isset($this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh]) && $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] != $code) { - $redirectString = "JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] . "')"; + $redirectString = "JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] . "')"; } else { @@ -2217,7 +2217,7 @@ class Interpretation extends Fields } else { - $getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app->redirect('index.php?option=com_" . $this->fileContentStatic['###component###'] . "');"; + $getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app->redirect('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "');"; } $getItem .= PHP_EOL . "\t" . $tab . "\t\treturn false;"; } @@ -2227,7 +2227,7 @@ class Interpretation extends Fields } $getItem .= PHP_EOL . "\t" . $tab . "\t}"; // dispatcher placholder - $getItem .= "###DISPATCHER###"; + $getItem .= $this->hhh . "DISPATCHER" . $this->hhh; if (ComponentbuilderHelper::checkArray($get->main_get)) { $asBucket = array(); @@ -2276,7 +2276,7 @@ class Interpretation extends Fields } } // set the scripts - $Component = $this->fileContentStatic['###Component###']; + $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; $script = ''; foreach ($this->cryptionTypes as $cryptionType) { @@ -2312,12 +2312,12 @@ class Interpretation extends Fields $getItem .= PHP_EOL . "\t" . $tab . "\t\$this->_item[\$pk] = \$data;"; } // only update if dispacher placholder is found - if (strpos($getItem, '###DISPATCHER###') !== false) + if (strpos($getItem, $this->hhh . 'DISPATCHER' . $this->hhh) !== false) { // check if the dispather should be added if (!isset($this->JEventDispatcher) || !ComponentbuilderHelper::checkArray($this->JEventDispatcher)) { - $this->JEventDispatcher = array('###DISPATCHER###' => ''); + $this->JEventDispatcher = array($this->hhh . 'DISPATCHER' . $this->hhh => ''); } $getItem = str_replace(array_keys($this->JEventDispatcher), array_values($this->JEventDispatcher), $getItem); } @@ -2342,7 +2342,7 @@ class Interpretation extends Fields $main = ''; if ($view->gettype == 3) { - // ###SITE_GET_ITEM### <<>> + // SITE_GET_ITEM <<>> $main .= PHP_EOL . PHP_EOL . "\t\tif (!isset(\$this->initSet) || !\$this->initSet)"; $main .= PHP_EOL . "\t\t{"; $main .= PHP_EOL . "\t\t\t\$this->user\t\t= JFactory::getUser();"; @@ -2369,13 +2369,13 @@ class Interpretation extends Fields $main .= PHP_EOL . "\t\t\t\$this->initSet\t\t= true;"; $main .= PHP_EOL . "\t\t}"; $main .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the global params"; - $main .= PHP_EOL . "\t\t\$globalParams = JComponentHelper::getParams('com_" . $this->fileContentStatic['###component###'] . "', true);"; + $main .= PHP_EOL . "\t\t\$globalParams = JComponentHelper::getParams('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "', true);"; // set php before listquery if (isset($view->add_php_getlistquery) && $view->add_php_getlistquery == 1 && isset($view->php_getlistquery) && ComponentbuilderHelper::checkString($view->php_getlistquery)) { $main .= $this->setPlaceholders($view->php_getlistquery, $this->placeholders); } - // ###SITE_GET_LIST_QUERY### <<>> + // SITE_GET_LIST_QUERY <<>> $main .= $this->setCustomViewListQuery($view, $view->code, false); // set before items php if (isset($view->add_php_before_getitems) && $view->add_php_before_getitems == 1 && isset($view->php_before_getitems) && ComponentbuilderHelper::checkString($view->php_before_getitems)) @@ -2395,7 +2395,7 @@ class Interpretation extends Fields $main .= PHP_EOL . "\t\t{"; $main .= PHP_EOL . "\t\t\treturn false;"; $main .= PHP_EOL . "\t\t}"; - // ###SITE_GET_ITEMS### <<>> + // SITE_GET_ITEMS <<>> $main .= $this->setCustomViewGetItems($view, $view->code); $main .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " return items"; $main .= PHP_EOL . "\t\treturn \$items;"; @@ -2403,7 +2403,7 @@ class Interpretation extends Fields } // load the main mehtod $methods .= $this->setMainCustomMehtod($main, $view->getcustom, $type); - // ###SITE_CUSTOM_METHODS### <<>> + // SITE_CUSTOM_METHODS <<>> $methods .= $this->setCustomViewCustomItemMethods($view, $view->code); } } @@ -2543,7 +2543,7 @@ class Interpretation extends Fields $method .= PHP_EOL . "\t*/"; $method .= PHP_EOL . "\tpublic function getUikitComp()"; $method .= PHP_EOL . "\t{"; - $method .= PHP_EOL . "\t\tif (isset(\$this->uikitComp) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$this->uikitComp))"; + $method .= PHP_EOL . "\t\tif (isset(\$this->uikitComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$this->uikitComp))"; $method .= PHP_EOL . "\t\t{"; $method .= PHP_EOL . "\t\t\treturn \$this->uikitComp;"; $method .= PHP_EOL . "\t\t}"; @@ -2597,7 +2597,7 @@ class Interpretation extends Fields $methods .= PHP_EOL . "\t*"; $methods .= PHP_EOL . "\t*/"; $methods .= PHP_EOL . "\tpublic function get" . $default['methodName'] . "(\$" . $default['on_field'] . ")"; - $methods .= PHP_EOL . "\t{###CRYPT###"; + $methods .= PHP_EOL . "\t{" . $this->hhh . "CRYPT" . $this->hhh; $methods .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get a db connection."; $methods .= PHP_EOL . "\t\t\$db = JFactory::getDbo();"; $methods .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; @@ -2610,7 +2610,7 @@ class Interpretation extends Fields { $methods .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check if \$" . $default['on_field'] . " is an array with values."; $methods .= PHP_EOL . "\t\t\$array = \$" . $default['on_field'] . ";"; - $methods .= PHP_EOL . "\t\tif (isset(\$array) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$array, true))"; + $methods .= PHP_EOL . "\t\tif (isset(\$array) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$array, true))"; $methods .= PHP_EOL . "\t\t{"; $methods .= PHP_EOL . "\t\t\t\$query->where('" . $get['join_field'] . " " . $get['operator'] . " (' . implode(',', \$array) . ')');"; $methods .= PHP_EOL . "\t\t}"; @@ -2663,7 +2663,7 @@ class Interpretation extends Fields $methods .= PHP_EOL . "\t\tif (\$db->getNumRows())"; $methods .= PHP_EOL . "\t\t{"; // set dispatcher placeholder - $methods .= "###DISPATCHER###"; + $methods .= $this->hhh . "DISPATCHER" . $this->hhh; // set decoding of needed fields if (isset($this->siteFieldData['decode'][$default['code']][$get['key']][$default['as']])) { @@ -2685,7 +2685,7 @@ class Interpretation extends Fields $contentprepareChecker = $this->siteFieldData['textareas'][$default['code']][$get['key']][$default['as']]; } // set joined values - $placeholders = array('###TAB###' => "\t\t", '###STRING###' => '$item'); + $placeholders = array($this->hhh . 'TAB' . $this->hhh => "\t\t", $this->hhh . 'STRING' . $this->hhh => '$item'); $joinedChecker = (isset($this->otherJoin[$this->target][$default['code']][$default['as']]) && ComponentbuilderHelper::checkArray($this->otherJoin[$this->target][$default['code']][$default['as']])) ? $this->otherJoin[$this->target][$default['code']][$default['as']] : ''; if ((isset($decodeChecker) && ComponentbuilderHelper::checkArray($decodeChecker)) || (isset($uikitChecker) && ComponentbuilderHelper::checkArray($uikitChecker)) || @@ -2765,7 +2765,7 @@ class Interpretation extends Fields $methods .= PHP_EOL . "\t}"; // set the script if it was found - $Component = $this->fileContentStatic['###Component###']; + $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; $script = ''; foreach ($this->cryptionTypes as $cryptionType) { @@ -2777,19 +2777,19 @@ class Interpretation extends Fields $script .= PHP_EOL . "\t\t\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);" . PHP_EOL; } } - $methods = str_replace('###CRYPT###', $script, $methods); + $methods = str_replace($this->hhh . 'CRYPT' . $this->hhh, $script, $methods); } // insure the crypt placeholder is removed - $methods = str_replace('###CRYPT###', '', $methods); + $methods = str_replace($this->hhh . 'CRYPT' . $this->hhh, '', $methods); } } // only update if dispacher placholder is found - if (strpos($methods, '###DISPATCHER###') !== false) + if (strpos($methods, $this->hhh . 'DISPATCHER' . $this->hhh) !== false) { // check if the dispather should be added if (!isset($this->JEventDispatcher) || !ComponentbuilderHelper::checkArray($this->JEventDispatcher)) { - $this->JEventDispatcher = array('###DISPATCHER###' => ''); + $this->JEventDispatcher = array($this->hhh . 'DISPATCHER' . $this->hhh => ''); } $methods = str_replace(array_keys($this->JEventDispatcher), array_values($this->JEventDispatcher), $methods); } @@ -2906,14 +2906,14 @@ class Interpretation extends Fields $this->siteDecrypt[$cryptionType][$code] = false; } // set the component name - $Component = $this->fileContentStatic['###Component###']; + $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; // start load the get item if (ComponentbuilderHelper::checkObject($get)) { $getItem .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Insure all item fields are adapted where needed."; $getItem .= PHP_EOL . "\t\tif (" . $Component . "Helper::checkArray(\$items))"; $getItem .= PHP_EOL . "\t\t{"; - $getItem .= "###DISPATCHER###"; + $getItem .= $this->hhh . "DISPATCHER" . $this->hhh; $getItem .= PHP_EOL . "\t\t\tforeach (\$items as \$nr => &\$item)"; $getItem .= PHP_EOL . "\t\t\t{"; $getItem .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Always create a slug for sef URL's"; @@ -2963,12 +2963,12 @@ class Interpretation extends Fields } } // only update if dispacher placholder is found - if (strpos($getItem, '###DISPATCHER###') !== false) + if (strpos($getItem, $this->hhh . 'DISPATCHER' . $this->hhh) !== false) { // check if the dispather should be added if (!isset($this->JEventDispatcher) || !ComponentbuilderHelper::checkArray($this->JEventDispatcher)) { - $this->JEventDispatcher = array('###DISPATCHER###' => ''); + $this->JEventDispatcher = array($this->hhh . 'DISPATCHER' . $this->hhh => ''); } $getItem = str_replace(array_keys($this->JEventDispatcher), array_values($this->JEventDispatcher), $getItem); } @@ -3034,13 +3034,13 @@ class Interpretation extends Fields // add id to list view if (isset($this->customAdminViewListId[$view['settings']->code])) { - // ###HIDDEN_INPUT_VALUES### - $this->fileContentDynamic[$view['settings']->code]['###HIDDEN_INPUT_VALUES###'] = PHP_EOL . "\t" . ''; + // HIDDEN_INPUT_VALUES + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'HIDDEN_INPUT_VALUES' . $this->hhh] = PHP_EOL . "\t" . ''; } else { - // also set the input value ###HIDDEN_INPUT_VALUES### - $this->fileContentDynamic[$view['settings']->code]['###HIDDEN_INPUT_VALUES###'] = ''; + // also set the input value HIDDEN_INPUT_VALUES + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'HIDDEN_INPUT_VALUES' . $this->hhh] = ''; } } // add the custom get methods @@ -3108,48 +3108,48 @@ class Interpretation extends Fields // ensure correct target is set $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); - // set libraries ###'.$TARGET.'_LIBRARIES_LOADER### - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_LIBRARIES_LOADER###'] = $this->setLibrariesLoader($view); + // set libraries $TARGET.'_LIBRARIES_LOADER + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_LIBRARIES_LOADER' . $this->hhh] = $this->setLibrariesLoader($view); - // set uikit ###'.$TARGET.'_UIKIT_LOADER### - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_UIKIT_LOADER###'] = $this->setUikitLoader($view); + // set uikit $TARGET.'_UIKIT_LOADER + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_UIKIT_LOADER' . $this->hhh] = $this->setUikitLoader($view); - // set Google Charts ###'.$TARGET.'_GOOGLECHART_LOADER### - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_GOOGLECHART_LOADER###'] = $this->setGoogleChartLoader($view); + // set Google Charts $TARGET.'_GOOGLECHART_LOADER + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_GOOGLECHART_LOADER' . $this->hhh] = $this->setGoogleChartLoader($view); - // set Footable ###FOOTABLE_LOADER### - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_FOOTABLE_LOADER###'] = $this->setFootableScriptsLoader($view); + // set Footable FOOTABLE_LOADER + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_FOOTABLE_LOADER' . $this->hhh] = $this->setFootableScriptsLoader($view); - // set metadata ###DOCUMENT_METADATA### - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_DOCUMENT_METADATA###'] = $this->setDocumentMetadata($view); + // set metadata DOCUMENT_METADATA + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_DOCUMENT_METADATA' . $this->hhh] = $this->setDocumentMetadata($view); - // set custom php scripting ###DOCUMENT_CUSTOM_PHP### - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_DOCUMENT_CUSTOM_PHP###'] = $this->setDocumentCustomPHP($view); + // set custom php scripting DOCUMENT_CUSTOM_PHP + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_DOCUMENT_CUSTOM_PHP' . $this->hhh] = $this->setDocumentCustomPHP($view); - // set custom css ###DOCUMENT_CUSTOM_CSS### - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_DOCUMENT_CUSTOM_CSS###'] = $this->setDocumentCustomCSS($view); + // set custom css DOCUMENT_CUSTOM_CSS + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_DOCUMENT_CUSTOM_CSS' . $this->hhh] = $this->setDocumentCustomCSS($view); - // set custom javascript ###DOCUMENT_CUSTOM_JS### - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_DOCUMENT_CUSTOM_JS###'] = $this->setDocumentCustomJS($view); + // set custom javascript DOCUMENT_CUSTOM_JS + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_DOCUMENT_CUSTOM_JS' . $this->hhh] = $this->setDocumentCustomJS($view); - // set custom css file ###VIEWCSS### - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_VIEWCSS###'] = $this->setCustomCSS($view); + // set custom css file VIEWCSS + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_VIEWCSS' . $this->hhh] = $this->setCustomCSS($view); - // set the custom buttons ###CUSTOM_BUTTONS### - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_CUSTOM_BUTTONS###'] = $this->setCustomButtons($view); + // set the custom buttons CUSTOM_BUTTONS + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_CUSTOM_BUTTONS' . $this->hhh] = $this->setCustomButtons($view); // only set the custom get form method if site target if ('site' === $this->target) { - // set the custom get form method ###SITE_CUSTOM_GET_FORM_METHOD### - $this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_GET_FORM_METHOD###'] = $this->setCustomGetForm($view); + // set the custom get form method SITE_CUSTOM_GET_FORM_METHOD + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_CUSTOM_GET_FORM_METHOD' . $this->hhh] = $this->setCustomGetForm($view); } // see if we should add get modules to the view.html - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_GET_MODULE###'] = $this->setGetModules($view, $TARGET); + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_GET_MODULE' . $this->hhh] = $this->setGetModules($view, $TARGET); // set a JavaScript file if needed - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_LIBRARIES_LOADER###'] .= $this->setJavaScriptFile($view, $TARGET); + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_LIBRARIES_LOADER' . $this->hhh] .= $this->setJavaScriptFile($view, $TARGET); // fix just incase we missed it somewhere $this->lang = $tmp; @@ -3188,10 +3188,10 @@ class Interpretation extends Fields $addModule[] = "\t\t\t}"; $addModule[] = "\t\t}"; $addModule[] = "\t\t//" . $this->setLine(__LINE__) . " check if modules were found"; - $addModule[] = "\t\tif (\$found && isset(\$this->setModules[\$position]) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$this->setModules[\$position]))"; + $addModule[] = "\t\tif (\$found && isset(\$this->setModules[\$position]) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$this->setModules[\$position]))"; $addModule[] = "\t\t{"; $addModule[] = "\t\t\t//" . $this->setLine(__LINE__) . " set class"; - $addModule[] = "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkString(\$class))"; + $addModule[] = "\t\t\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkString(\$class))"; $addModule[] = "\t\t\t{"; $addModule[] = "\t\t\t\t\$class = ' class=\"'.\$class.'\" ';"; $addModule[] = "\t\t\t}"; @@ -3220,11 +3220,11 @@ class Interpretation extends Fields $addModule[] = "\t\treturn false;"; $addModule[] = "\t}"; - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_GET_MODULE_JIMPORT###'] = PHP_EOL . "jimport('joomla.application.module.helper');"; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_GET_MODULE_JIMPORT' . $this->hhh] = PHP_EOL . "jimport('joomla.application.module.helper');"; return implode(PHP_EOL, $addModule); } - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_GET_MODULE_JIMPORT###'] = ''; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_GET_MODULE_JIMPORT' . $this->hhh] = ''; return ''; } @@ -3261,50 +3261,50 @@ class Interpretation extends Fields { $viewName = ComponentbuilderHelper::safeString($view['settings']->name_single); } - // set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER### - $this->fileContentDynamic[$viewName]['###' . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER###'] = ''; - // set the custom buttons ###CUSTOM_BUTTONS_METHOD### - $this->fileContentDynamic[$viewName]['###' . $TARGET . '_CUSTOM_BUTTONS_METHOD###'] = ''; + // set the custom buttons CUSTOM_BUTTONS_CONTROLLER + $this->fileContentDynamic[$viewName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh] = ''; + // set the custom buttons CUSTOM_BUTTONS_METHOD + $this->fileContentDynamic[$viewName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_METHOD' . $this->hhh] = ''; } elseif (3 == $type) { // set the names $viewName = ComponentbuilderHelper::safeString($view['settings']->name_single); $viewsName = ComponentbuilderHelper::safeString($view['settings']->name_list); - // set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER_LIST### - $this->fileContentDynamic[$viewsName]['###' . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER_LIST###'] = ''; - // set the custom buttons ###CUSTOM_BUTTONS_METHOD_LIST### - $this->fileContentDynamic[$viewsName]['###' . $TARGET . '_CUSTOM_BUTTONS_METHOD_LIST###'] = ''; + // set the custom buttons CUSTOM_BUTTONS_CONTROLLER_LIST + $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh] = ''; + // set the custom buttons CUSTOM_BUTTONS_METHOD_LIST + $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh] = ''; } // if site add buttons to view if ($this->target === 'site') { - // set the custom buttons ###SITE_TOP_BUTTON### - $this->fileContentDynamic[$viewName]['###SITE_TOP_BUTTON###'] = ''; - // set the custom buttons ###SITE_BOTTOM_BUTTON### - $this->fileContentDynamic[$viewName]['###SITE_BOTTOM_BUTTON###'] = ''; + // set the custom buttons SITE_TOP_BUTTON + $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_TOP_BUTTON' . $this->hhh] = ''; + // set the custom buttons SITE_BOTTOM_BUTTON + $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_BOTTOM_BUTTON' . $this->hhh] = ''; // load into place switch ($view['settings']->button_position) { case 1: // set buttons to top right of the view - $this->fileContentDynamic[$viewName]['###SITE_TOP_BUTTON###'] = '
toolbar->render(); ?>
'; + $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_TOP_BUTTON' . $this->hhh] = '
toolbar->render(); ?>
'; break; case 2: // set buttons to top left of the view - $this->fileContentDynamic[$viewName]['###SITE_TOP_BUTTON###'] = 'toolbar->render(); ?>'; + $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_TOP_BUTTON' . $this->hhh] = 'toolbar->render(); ?>'; break; case 3: // set buttons to buttom right of the view - $this->fileContentDynamic[$viewName]['###SITE_BOTTOM_BUTTON###'] = '
toolbar->render(); ?>
'; + $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_BOTTOM_BUTTON' . $this->hhh] = '
toolbar->render(); ?>
'; break; case 4: // set buttons to buttom left of the view - $this->fileContentDynamic[$viewName]['###SITE_BOTTOM_BUTTON###'] = 'toolbar->render(); ?>'; + $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_BOTTOM_BUTTON' . $this->hhh] = 'toolbar->render(); ?>'; break; case 5: // set buttons to buttom left of the view - $this->placeholders['[[[SITE_TOOLBAR]]]'] = 'toolbar->render(); ?>'; + $this->placeholders[$this->bbb . 'SITE_TOOLBAR' . $this->ddd] = 'toolbar->render(); ?>'; break; } } @@ -3349,7 +3349,7 @@ class Interpretation extends Fields { $this->onlyFunctionButton[$viewsName] = array(); } - $this->onlyFunctionButton[$viewsName][] = "\t" . $tab . "if (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $this->onlyFunctionButton[$viewsName][] = "\t" . $tab . "if (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; $this->onlyFunctionButton[$viewsName][] = "\t" . $tab . "{"; $this->onlyFunctionButton[$viewsName][] = "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; $this->onlyFunctionButton[$viewsName][] = "\t" . $tab . "\tJToolBarHelper::custom('" . $viewsName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', false);"; @@ -3357,7 +3357,7 @@ class Interpretation extends Fields } else { - $buttons[] = "\t" . $tab . "\tif (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $buttons[] = "\t" . $tab . "\tif (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; $buttons[] = "\t" . $tab . "\t{"; $buttons[] = "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; $buttons[] = "\t" . $tab . "\t\tJToolBarHelper::custom('" . $viewsName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', false);"; @@ -3372,14 +3372,14 @@ class Interpretation extends Fields // insure the controller and model strings are added if (isset($view['settings']->php_controller_list) && ComponentbuilderHelper::checkString($view['settings']->php_controller_list) && $view['settings']->php_controller_list != '//') { - // set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER### - $this->fileContentDynamic[$viewsName]['###' . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER_LIST###'] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_controller_list, $this->placeholders); + // set the custom buttons CUSTOM_BUTTONS_CONTROLLER + $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_controller_list, $this->placeholders); } // load the model if (isset($view['settings']->php_model_list) && ComponentbuilderHelper::checkString($view['settings']->php_model_list) && $view['settings']->php_model_list != '//') { - // set the custom buttons ###CUSTOM_BUTTONS_METHOD### - $this->fileContentDynamic[$viewsName]['###' . $TARGET . '_CUSTOM_BUTTONS_METHOD_LIST###'] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_model_list, $this->placeholders); + // set the custom buttons CUSTOM_BUTTONS_METHOD + $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_model_list, $this->placeholders); } } else @@ -3387,22 +3387,22 @@ class Interpretation extends Fields // insure the controller and model strings are added if (ComponentbuilderHelper::checkString($view['settings']->php_controller) && $view['settings']->php_controller != '//') { - // set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER### - $this->fileContentDynamic[$viewName]['###' . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER###'] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_controller, $this->placeholders); + // set the custom buttons CUSTOM_BUTTONS_CONTROLLER + $this->fileContentDynamic[$viewName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_controller, $this->placeholders); if ('site' === $this->target) { // add the controller for this view // build the file $target = array($this->target => $viewName); $this->buildDynamique($target, 'custom_form'); - ###GET_FORM_CUSTOM### + // GET_FORM_CUSTOM } } // load the model if (ComponentbuilderHelper::checkString($view['settings']->php_model) && $view['settings']->php_model != '//') { - // set the custom buttons ###CUSTOM_BUTTONS_METHOD### - $this->fileContentDynamic[$viewName]['###' . $TARGET . '_CUSTOM_BUTTONS_METHOD###'] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_model, $this->placeholders); + // set the custom buttons CUSTOM_BUTTONS_METHOD + $this->fileContentDynamic[$viewName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_METHOD' . $this->hhh] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_model, $this->placeholders); } } // return buttons if they were build @@ -3460,19 +3460,19 @@ class Interpretation extends Fields $modified = $this->getLastModifiedDate($view); // add file to view $target = array($this->target => $view['settings']->code); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'javascript_file', false, $config); // set path if ('site' === $this->target) { - $path = '/components/com_' . $this->fileContentStatic['###component###'] . '/assets/js/' . $view['settings']->code . '.js'; + $path = '/components/com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '/assets/js/' . $view['settings']->code . '.js'; } else { - $path = '/administrator/components/com_' . $this->fileContentStatic['###component###'] . '/assets/js/' . $view['settings']->code . '.js'; + $path = '/administrator/components/com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '/assets/js/' . $view['settings']->code . '.js'; } // add script to file - $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_JAVASCRIPT_FILE###'] = $this->setPlaceholders($view['settings']->javascript_file, $this->placeholders); + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_JAVASCRIPT_FILE' . $this->hhh] = $this->setPlaceholders($view['settings']->javascript_file, $this->placeholders); // add script to view return PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add View JavaScript File" . PHP_EOL . "\t\t" . $this->setIncludeLibScript($path); } @@ -3625,9 +3625,9 @@ class Interpretation extends Fields $chart[] = PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " add the google chart builder class."; $chart[] = "\t\trequire_once JPATH_COMPONENT_ADMINISTRATOR.'/helpers/chartbuilder.php';"; $chart[] = "\t\t//" . $this->setLine(__LINE__) . " load the google chart js."; - $chart[] = "\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/js/google.jsapi.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; - $chart[] = "\t\t\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/rgbcolor.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; - $chart[] = "\t\t\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/canvg.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $chart[] = "\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/js/google.jsapi.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $chart[] = "\t\t\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/rgbcolor.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $chart[] = "\t\t\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/canvg.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; return implode(PHP_EOL, $chart); } return ''; @@ -3650,7 +3650,7 @@ class Interpretation extends Fields $setter .= PHP_EOL . "\t\trequire_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );"; } $setter .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Initialize the header checker."; - $setter .= PHP_EOL . "\t\t\$HeaderCheck = new " . $this->fileContentStatic['###component###'] . "HeaderCheck;"; + $setter .= PHP_EOL . "\t\t\$HeaderCheck = new " . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "HeaderCheck;"; // check if this view should get libraries if (isset($this->libManager[$this->target][$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->libManager[$this->target][$view['settings']->code])) { @@ -3831,11 +3831,11 @@ class Interpretation extends Fields switch ($pathInfo['extension']) { case 'js': - return '$this->document->addScript(' . $JURI . '"' . $path . '", (' . $this->fileContentStatic['###Component###'] . 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");'; + return '$this->document->addScript(' . $JURI . '"' . $path . '", (' . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");'; break; case 'css': case 'less': - return '$this->document->addStyleSheet(' . $JURI . '"' . $path . '", (' . $this->fileContentStatic['###Component###'] . 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/css");'; + return '$this->document->addStyleSheet(' . $JURI . '"' . $path . '", (' . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/css");'; break; case 'php': if (strpos($path, 'http') === false) @@ -3852,15 +3852,15 @@ class Interpretation extends Fields { if (strpos($root, '/media/') !== false && strpos($root, '/admin/') === false && strpos($root, '/site/') === false) { - return str_replace('/media/', '/media/com_' . $this->fileContentStatic['###component###'] . '/', $root); + return str_replace('/media/', '/media/com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '/', $root); } elseif (strpos($root, '/media/') === false && strpos($root, '/admin/') !== false && strpos($root, '/site/') === false) { - return str_replace('/admin/', '/administrator/components/com_' . $this->fileContentStatic['###component###'] . '/', $root); + return str_replace('/admin/', '/administrator/components/com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '/', $root); } elseif (strpos($root, '/media/') === false && strpos($root, '/admin/') === false && strpos($root, '/site/') !== false) { - return str_replace('/site/', '/components/com_' . $this->fileContentStatic['###component###'] . '/', $root); + return str_replace('/site/', '/components/com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '/', $root); } return $root; } @@ -3897,12 +3897,12 @@ class Interpretation extends Fields $setter .= PHP_EOL . PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " The uikit css."; $setter .= PHP_EOL . $tabV . "\t\tif ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; $setter .= PHP_EOL . $tabV . "\t\t{"; - $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/css/uikit'.\$style.\$size.'.css', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/css/uikit'.\$style.\$size.'.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $setter .= PHP_EOL . $tabV . "\t\t}"; $setter .= PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " The uikit js."; $setter .= PHP_EOL . $tabV . "\t\tif ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; $setter .= PHP_EOL . $tabV . "\t\t{"; - $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/js/uikit'.\$size.'.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/js/uikit'.\$size.'.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; $setter .= PHP_EOL . $tabV . "\t\t}"; } // load the components need @@ -3922,9 +3922,9 @@ class Interpretation extends Fields { $setter .= PHP_EOL . PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " Get field uikit components needed in this view."; $setter .= PHP_EOL . $tabV . "\t\t\t\$uikitFieldComp = \$this->get('UikitComp');"; - $setter .= PHP_EOL . $tabV . "\t\t\tif (isset(\$uikitFieldComp) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$uikitFieldComp))"; + $setter .= PHP_EOL . $tabV . "\t\t\tif (isset(\$uikitFieldComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitFieldComp))"; $setter .= PHP_EOL . $tabV . "\t\t\t{"; - $setter .= PHP_EOL . $tabV . "\t\t\t\tif (isset(\$uikitComp) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . "\t\t\t\tif (isset(\$uikitComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitComp))"; $setter .= PHP_EOL . $tabV . "\t\t\t\t{"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\$uikitComp = array_merge(\$uikitComp, \$uikitFieldComp);"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\$uikitComp = array_unique(\$uikitComp);"; @@ -3937,26 +3937,26 @@ class Interpretation extends Fields } $setter .= PHP_EOL . $tabV . "\t\t}"; $setter .= PHP_EOL . PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " Load the needed uikit components in this view."; - $setter .= PHP_EOL . $tabV . "\t\tif (\$uikit != 2 && isset(\$uikitComp) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . "\t\tif (\$uikit != 2 && isset(\$uikitComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitComp))"; $setter .= PHP_EOL . $tabV . "\t\t{"; $setter .= PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " load just in case."; $setter .= PHP_EOL . $tabV . "\t\t\tjimport('joomla.filesystem.file');"; $setter .= PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " loading..."; $setter .= PHP_EOL . $tabV . "\t\t\tforeach (\$uikitComp as \$class)"; $setter .= PHP_EOL . $tabV . "\t\t\t{"; - $setter .= PHP_EOL . $tabV . "\t\t\t\tforeach (" . $this->fileContentStatic['###Component###'] . "Helper::\$uk_components[\$class] as \$name)"; + $setter .= PHP_EOL . $tabV . "\t\t\t\tforeach (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::\$uk_components[\$class] as \$name)"; $setter .= PHP_EOL . $tabV . "\t\t\t\t{"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " check if the CSS file exists."; - $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t{"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " load the css."; - $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t}"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " check if the JavaScript file exists."; - $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t{"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " load the js."; - $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/js/components/'.\$name.\$size.'.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/js/components/'.\$name.\$size.'.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t}"; $setter .= PHP_EOL . $tabV . "\t\t\t\t}"; $setter .= PHP_EOL . $tabV . "\t\t\t}"; @@ -3966,26 +3966,26 @@ class Interpretation extends Fields { $setter .= PHP_EOL . PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " Load the needed uikit components in this view."; $setter .= PHP_EOL . $tabV . "\t\t\$uikitComp = \$this->get('UikitComp');"; - $setter .= PHP_EOL . $tabV . "\t\tif (\$uikit != 2 && isset(\$uikitComp) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . "\t\tif (\$uikit != 2 && isset(\$uikitComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitComp))"; $setter .= PHP_EOL . $tabV . "\t\t{"; $setter .= PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " load just in case."; $setter .= PHP_EOL . $tabV . "\t\t\tjimport('joomla.filesystem.file');"; $setter .= PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " loading..."; $setter .= PHP_EOL . $tabV . "\t\t\tforeach (\$uikitComp as \$class)"; $setter .= PHP_EOL . $tabV . "\t\t\t{"; - $setter .= PHP_EOL . $tabV . "\t\t\t\tforeach (" . $this->fileContentStatic['###Component###'] . "Helper::\$uk_components[\$class] as \$name)"; + $setter .= PHP_EOL . $tabV . "\t\t\t\tforeach (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::\$uk_components[\$class] as \$name)"; $setter .= PHP_EOL . $tabV . "\t\t\t\t{"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " check if the CSS file exists."; - $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t{"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " load the css."; - $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t}"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " check if the JavaScript file exists."; - $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t{"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " load the js."; - $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/js/components/'.\$name.\$size.'.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/js/components/'.\$name.\$size.'.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);"; $setter .= PHP_EOL . $tabV . "\t\t\t\t\t}"; $setter .= PHP_EOL . $tabV . "\t\t\t\t}"; $setter .= PHP_EOL . $tabV . "\t\t\t}"; @@ -4005,12 +4005,12 @@ class Interpretation extends Fields $setter .= PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " The uikit css."; $setter .= PHP_EOL . $tabV . "\t\tif ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; $setter .= PHP_EOL . $tabV . "\t\t{"; - $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v3/css/uikit'.\$size.'.css', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v3/css/uikit'.\$size.'.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $setter .= PHP_EOL . $tabV . "\t\t}"; $setter .= PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " The uikit js."; $setter .= PHP_EOL . $tabV . "\t\tif ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; $setter .= PHP_EOL . $tabV . "\t\t{"; - $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v3/js/uikit'.\$size.'.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v3/js/uikit'.\$size.'.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; $setter .= PHP_EOL . $tabV . "\t\t}"; if (2 == $this->uikit) { @@ -4038,9 +4038,9 @@ class Interpretation extends Fields // build body $body = array(); // add limit box - if (strpos($view['settings']->default, '[[[LIMITBOX]]]') !== false) + if (strpos($view['settings']->default, $this->bbb . 'LIMITBOX' . $this->ddd) !== false) { - $this->placeholders['[[[LIMITBOX]]]'] = 'pagination->getLimitBox(); ?>'; + $this->placeholders[$this->bbb . 'LIMITBOX' . $this->ddd] = 'pagination->getLimitBox(); ?>'; } $body[] = $this->setPlaceholders($view['settings']->default, $this->placeholders); $body[] = PHP_EOL . 'items) && isset($this->pagination) && isset($this->pagination->pagesTotal) && $this->pagination->pagesTotal > 1): ?>'; @@ -4048,7 +4048,7 @@ class Interpretation extends Fields $body[] = "\t" . ''; @@ -7323,7 +7323,7 @@ class Interpretation extends Fields $fadein[] = "\t// waiting spinner"; $fadein[] = "\tvar outerDiv = jQuery('body');"; $fadein[] = "\tjQuery('
')"; - $fadein[] = "\t\t.css(\"background\", \"rgba(255, 255, 255, .8) url('components/com_" . $this->fileContentStatic['###component###'] . "/assets/images/import.gif') 50% 15% no-repeat\")"; + $fadein[] = "\t\t.css(\"background\", \"rgba(255, 255, 255, .8) url('components/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/assets/images/import.gif') 50% 15% no-repeat\")"; $fadein[] = "\t\t.css(\"top\", outerDiv.position().top - jQuery(window).scrollTop())"; $fadein[] = "\t\t.css(\"left\", outerDiv.position().left - jQuery(window).scrollLeft())"; $fadein[] = "\t\t.css(\"width\", outerDiv.width())"; @@ -7337,15 +7337,15 @@ class Interpretation extends Fields $fadein[] = "\tjQuery('#loading').show();"; $fadein[] = "\t// when page is ready remove and show"; $fadein[] = "\tjQuery(window).load(function() {"; - $fadein[] = "\t\tjQuery('#" . $this->fileContentStatic['###component###'] . "_loader').fadeIn('fast');"; + $fadein[] = "\t\tjQuery('#" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_loader').fadeIn('fast');"; $fadein[] = "\t\tjQuery('#loading').hide();"; $fadein[] = "\t});"; $fadein[] = ""; - $fadein[] = "
fileContentStatic['###component###'] . "_loader\" style=\"display: none;\">"; + $fadein[] = "
fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_loader\" style=\"display: none;\">"; return implode(PHP_EOL, $fadein); } - return "
fileContentStatic['###component###'] . "_loader\">"; + return "
fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_loader\">"; } /** @@ -7367,13 +7367,13 @@ class Interpretation extends Fields } if (ComponentbuilderHelper::checkString($items)) { - // ###LAYOUTITEMS### <<>> - $this->fileContentDynamic[$viewName_single . '_' . $layoutName]['###LAYOUTITEMS###'] = $items; + // LAYOUTITEMS <<>> + $this->fileContentDynamic[$viewName_single . '_' . $layoutName][$this->hhh . 'LAYOUTITEMS' . $this->hhh] = $items; } else { - // ###LAYOUTITEMS### <<>> - $this->fileContentDynamic[$viewName_single . '_' . $layoutName]['###bogus###'] = 'boom'; + // LAYOUTITEMS <<>> + $this->fileContentDynamic[$viewName_single . '_' . $layoutName][$this->hhh . 'bogus' . $this->hhh] = 'boom'; } } @@ -7408,30 +7408,30 @@ class Interpretation extends Fields $head = $this->setListHeadLinked($single, $list, $addNewButon, $viewName_single); $body = $this->setListBodyLinked($single, $list, $viewName_single); $functionName = ComponentbuilderHelper::safeString($codeName, 'F'); - // ###LAYOUTITEMSTABLE### <<>> - $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName]['###LAYOUTITEMSTABLE###'] = $head . $body; - // ###LAYOUTITEMSHEADER### <<>> - $headerscript = '$edit = "index.php?option=com_' . $this->fileContentStatic['###component###'] . '&view=' . $list . '&task=' . $single . '.edit";'; + // LAYOUTITEMSTABLE <<>> + $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] = $head . $body; + // LAYOUTITEMSHEADER <<>> + $headerscript = '$edit = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $list . '&task=' . $single . '.edit";'; if ($addNewButon > 0) { // add the link for new if ($addNewButon == 1 || $addNewButon == 2) { $headerscript .= PHP_EOL . '$ref = ($id) ? "&ref=' . $viewName_single . '&refid=".$id : "";'; - $headerscript .= PHP_EOL . '$new = "index.php?option=com_' . $this->fileContentStatic['###component###'] . '&view=' . $single . '&layout=edit".$ref;'; + $headerscript .= PHP_EOL . '$new = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $single . '&layout=edit".$ref;'; } // and the link for close and new if ($addNewButon == 2 || $addNewButon == 3) { - $headerscript .= PHP_EOL . '$close_new = "index.php?option=com_' . $this->fileContentStatic['###component###'] . '&view=' . $single . '&layout=edit";'; + $headerscript .= PHP_EOL . '$close_new = "index.php?option=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '&view=' . $single . '&layout=edit";'; } - $headerscript .= PHP_EOL . '$can = ' . $this->fileContentStatic['###Component###'] . 'Helper::getActions(' . "'" . $single . "'" . ');'; + $headerscript .= PHP_EOL . '$can = ' . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::getActions(' . "'" . $single . "'" . ');'; } - $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName]['###LAYOUTITEMSHEADER###'] = $headerscript; - // ###LINKEDVIEWITEMS### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWITEMS###'] .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get Linked view data" . PHP_EOL . "\t\t\$this->" . $codeName . " = \$this->get('" . $functionName . "');"; - // ###LINKEDVIEWTABLESCRIPTS### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWTABLESCRIPTS###'] = $this->setFootableScripts(); + $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh] = $headerscript; + // LINKEDVIEWITEMS <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWITEMS' . $this->hhh] .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get Linked view data" . PHP_EOL . "\t\t\$this->" . $codeName . " = \$this->get('" . $functionName . "');"; + // LINKEDVIEWTABLESCRIPTS <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh] = $this->setFootableScripts(); if (strpos($parentKey, '-R>') !== false || strpos($parentKey, '-A>') !== false) { list($parent_key) = explode('-', $parentKey); @@ -7458,29 +7458,29 @@ class Interpretation extends Fields { $_key = $key; } - // ###LINKEDVIEWGLOBAL### <<>> + // LINKEDVIEWGLOBAL <<>> if (isset($parent_keys) && ComponentbuilderHelper::checkArray($parent_keys)) { $globalKey = array(); foreach ($parent_keys as $parent_key) { $globalKey[$parent_key] = ComponentbuilderHelper::safeString($_key . $this->uniquekey(4)); - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWGLOBAL###'] .= PHP_EOL . "\t\t\$this->" . $globalKey[$parent_key] . " = \$item->" . $parent_key . ";"; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWGLOBAL' . $this->hhh] .= PHP_EOL . "\t\t\$this->" . $globalKey[$parent_key] . " = \$item->" . $parent_key . ";"; } } else { // set the global key $globalKey = ComponentbuilderHelper::safeString($_key . $this->uniquekey(4)); - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWGLOBAL###'] .= PHP_EOL . "\t\t\$this->" . $globalKey . " = \$item->" . $parent_key . ";"; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWGLOBAL' . $this->hhh] .= PHP_EOL . "\t\t\$this->" . $globalKey . " = \$item->" . $parent_key . ";"; } - // ###LINKEDVIEWMETHODS### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWMETHODS###'] .= $this->setListQueryLinked($single, $list, $functionName, $key, $_key, $parentKey, $parent_key, $globalKey); + // LINKEDVIEWMETHODS <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWMETHODS' . $this->hhh] .= $this->setListQueryLinked($single, $list, $functionName, $key, $_key, $parentKey, $parent_key, $globalKey); } else { - $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName]['###LAYOUTITEMSTABLE###'] = 'oops! error.....'; - $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName]['###LAYOUTITEMSHEADER###'] = ''; + $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] = 'oops! error.....'; + $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh] = ''; } } @@ -7493,22 +7493,22 @@ class Interpretation extends Fields if (!isset($this->footableVersion) || 2 == $this->footableVersion) // loading version 2 { $foo = PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add the CSS for Footable."; - $foo .= PHP_EOL . "\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/css/footable.core.min.css', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $foo .= PHP_EOL . "\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/css/footable.core.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $foo .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Use the Metro Style"; $foo .= PHP_EOL . "\t\tif (!isset(\$this->fooTableStyle) || 0 == \$this->fooTableStyle)"; $foo .= PHP_EOL . "\t\t{"; - $foo .= PHP_EOL . "\t\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/css/footable.metro.min.css', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $foo .= PHP_EOL . "\t\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/css/footable.metro.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $foo .= PHP_EOL . "\t\t}"; $foo .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Use the Legacy Style."; $foo .= PHP_EOL . "\t\telseif (isset(\$this->fooTableStyle) && 1 == \$this->fooTableStyle)"; $foo .= PHP_EOL . "\t\t{"; - $foo .= PHP_EOL . "\t\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/css/footable.standalone.min.css', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $foo .= PHP_EOL . "\t\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/css/footable.standalone.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $foo .= PHP_EOL . "\t\t}"; $foo .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add the JavaScript for Footable"; - $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/js/footable.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; - $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/js/footable.sort.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; - $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/js/footable.filter.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; - $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/js/footable.paginate.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/js/footable.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/js/footable.sort.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/js/footable.filter.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v2/js/footable.paginate.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; if ($init) { $foo .= PHP_EOL . PHP_EOL . "\t\t" . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' . "'.footable'" . ').footable(); }); jQuery(' . "'.nav-tabs'" . ').on(' . "'click'" . ', ' . "'li'" . ', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery(' . "'.footable'" . ').trigger(' . "'footable_resize'" . '); }";'; @@ -7520,9 +7520,9 @@ class Interpretation extends Fields $foo = PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add the CSS for Footable"; $foo .= PHP_EOL . "\t\t\$this->document->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');"; - $foo .= PHP_EOL . "\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v3/css/footable.standalone.min.css', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $foo .= PHP_EOL . "\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v3/css/footable.standalone.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $foo .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add the JavaScript for Footable (adding all funtions)"; - $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v3/js/footable.min.js', (" . $this->fileContentStatic['###Component###'] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/footable-v3/js/footable.min.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; if ($init) { $foo .= PHP_EOL . PHP_EOL . "\t\t" . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' . "'.footable'" . ').footable();});});";'; @@ -7543,7 +7543,7 @@ class Interpretation extends Fields if (isset($this->listBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listBuilder[$viewName_list])) { // component helper name - $Helper = $this->fileContentStatic['###Component###'] . 'Helper'; + $Helper = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper'; // make sure the custom links are only added once $firstTimeBeingAdded = true; // setup correct core target @@ -7617,8 +7617,8 @@ class Interpretation extends Fields $otherViews = $this->catCodeBuilder[$viewName_single]['views']; // category and linked $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'escape($item->category_title); ?>'; + $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>"; + $body .= PHP_EOL . "\t\t\t\t" . 'escape($item->category_title); ?>'; $body .= PHP_EOL . "\t\t\t"; $body .= PHP_EOL . "\t\t\t\tescape(\$item->category_title); ?>"; $body .= PHP_EOL . "\t\t\t"; @@ -7665,11 +7665,11 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoadLink && isset($this->permissionBuilder[$coreLink['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$coreLink['core.edit']]) && in_array($item['custom']['view'], $this->permissionBuilder[$coreLink['core.edit']])) { - $accessCheck = "\$user->authorise('" . $coreLink['core.edit'] . "', 'com_" . $this->fileContentStatic['###component###'] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; + $accessCheck = "\$user->authorise('" . $coreLink['core.edit'] . "', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; } else { - $accessCheck = "\$user->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; + $accessCheck = "\$user->authorise('core.edit', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; } } } @@ -7700,9 +7700,9 @@ class Interpretation extends Fields foreach ($this->customAdminViewListLink[$viewName_list] as $customLinkView) { $customAdminView .= PHP_EOL . "\t\t\tget('" . $customLinkView['link'] . ".access')): ?>"; - $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>" >'; + $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . '_' . $customLinkView['NAME'] . "'" . '); ?>" >'; $customAdminView .= PHP_EOL . "\t\t\t"; - $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; + $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; $customAdminView .= PHP_EOL . "\t\t\t"; } $customAdminView .= PHP_EOL . "\t\t\t" . '
'; @@ -7844,7 +7844,7 @@ class Interpretation extends Fields if (isset($this->listBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listBuilder[$viewName_list])) { // component helper name - $Helper = $this->fileContentStatic['###Component###'] . 'Helper'; + $Helper = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper'; $head = ''; // only add new button if set if ($addNewButon > 0) @@ -8014,8 +8014,8 @@ class Interpretation extends Fields { $query .= PHP_EOL . "\t\t\$query->select(\$db->quoteName('c.title','category_title'));"; } - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic['###component###'] . "_" . $viewName_single . " table"; - $query .= PHP_EOL . "\t\t\$query->from(\$db->quoteName('#__" . $this->fileContentStatic['###component###'] . "_" . $viewName_single . "', 'a'));"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . " table"; + $query .= PHP_EOL . "\t\t\$query->from(\$db->quoteName('#__" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . "', 'a'));"; // add the category if ($addCategory) { @@ -8097,7 +8097,7 @@ class Interpretation extends Fields $query .= PHP_EOL . "\t\t\t\$query->where('a.access = ' . (int) \$access);"; $query .= PHP_EOL . "\t\t}"; $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Implement View Level Access"; - $query .= PHP_EOL . "\t\tif (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $query .= PHP_EOL . "\t\tif (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; $query .= PHP_EOL . "\t\t{"; $query .= PHP_EOL . "\t\t\t\$groups = implode(',', \$user->getAuthorisedViewLevels());"; $query .= PHP_EOL . "\t\t\t\$query->where('a.access IN (' . \$groups . ')');"; @@ -8112,23 +8112,23 @@ class Interpretation extends Fields $query .= PHP_EOL . "\t\tif (\$db->getNumRows())"; $query .= PHP_EOL . "\t\t{"; $query .= PHP_EOL . "\t\t\t\$items = \$db->loadObjectList();"; - // ###STORE_METHOD_FIX### <<>> - $query .= $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic['###Component###'], "\t"); - // ###SELECTIONTRANSLATIONFIX### <<>> - $query .= $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic['###Component###'], "\t"); + // STORE_METHOD_FIX <<>> + $query .= $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], "\t"); + // SELECTIONTRANSLATIONFIX <<>> + $query .= $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], "\t"); // filter by child repetable field values if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($key, '-R>') !== false && strpos($key, '-A>') === false) { list($field, $target) = explode('-R>', $key); $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " in this Repetable Field"; - $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$items) && isset(\$this->" . $globalKey . "))"; + $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$items) && isset(\$this->" . $globalKey . "))"; $query .= PHP_EOL . "\t\t\t{"; $query .= PHP_EOL . "\t\t\t\tforeach (\$items as \$nr => &\$item)"; $query .= PHP_EOL . "\t\t\t\t{"; - $query .= PHP_EOL . "\t\t\t\t\tif (isset(\$item->" . $field . ") && " . $this->fileContentStatic['###Component###'] . "Helper::checkJson(\$item->" . $field . "))"; + $query .= PHP_EOL . "\t\t\t\t\tif (isset(\$item->" . $field . ") && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(\$item->" . $field . "))"; $query .= PHP_EOL . "\t\t\t\t\t{"; $query .= PHP_EOL . "\t\t\t\t\t\t\$tmpArray = json_decode(\$item->" . $field . ",true);"; - $query .= PHP_EOL . "\t\t\t\t\t\tif (!isset(\$tmpArray['" . $target . "']) || !" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$tmpArray['" . $target . "']) || !in_array(\$this->" . $globalKey . ", \$tmpArray['" . $target . "']))"; + $query .= PHP_EOL . "\t\t\t\t\t\tif (!isset(\$tmpArray['" . $target . "']) || !" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$tmpArray['" . $target . "']) || !in_array(\$this->" . $globalKey . ", \$tmpArray['" . $target . "']))"; $query .= PHP_EOL . "\t\t\t\t\t\t{"; $query .= PHP_EOL . "\t\t\t\t\t\t\tunset(\$items[\$nr]);"; $query .= PHP_EOL . "\t\t\t\t\t\t\tcontinue;"; @@ -8151,18 +8151,18 @@ class Interpretation extends Fields { $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " Array Field"; $query .= PHP_EOL . "\t\t\t\$" . $globalKey . " = \$this->" . $globalKey . ";"; - $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$items) && \$" . $globalKey . ")"; + $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$items) && \$" . $globalKey . ")"; $query .= PHP_EOL . "\t\t\t{"; $query .= PHP_EOL . "\t\t\t\tforeach (\$items as \$nr => &\$item)"; $query .= PHP_EOL . "\t\t\t\t{"; list($bin, $target) = explode('-A>', $key); if (ComponentbuilderHelper::checkString($target)) { - $query .= PHP_EOL . "\t\t\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkJson(\$item->" . $target . "))"; + $query .= PHP_EOL . "\t\t\t\t\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(\$item->" . $target . "))"; $query .= PHP_EOL . "\t\t\t\t\t{"; $query .= PHP_EOL . "\t\t\t\t\t\t\$item->" . $target . " = json_decode(\$item->" . $target . ", true);"; $query .= PHP_EOL . "\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t\telseif (!isset(\$item->" . $target . ") || !" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$item->" . $target . "))"; + $query .= PHP_EOL . "\t\t\t\t\telseif (!isset(\$item->" . $target . ") || !" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$item->" . $target . "))"; $query .= PHP_EOL . "\t\t\t\t\t{"; $query .= PHP_EOL . "\t\t\t\t\t\tunset(\$items[\$nr]);"; $query .= PHP_EOL . "\t\t\t\t\t\tcontinue;"; @@ -8171,11 +8171,11 @@ class Interpretation extends Fields } else { - $query .= PHP_EOL . "\t\t\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkJson(\$item->" . $_key . "))"; + $query .= PHP_EOL . "\t\t\t\t\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(\$item->" . $_key . "))"; $query .= PHP_EOL . "\t\t\t\t\t{"; $query .= PHP_EOL . "\t\t\t\t\t\t\$item->" . $_key . " = json_decode(\$item->" . $_key . ", true);"; $query .= PHP_EOL . "\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t\telseif (!isset(\$item->" . $_key . ") || !" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$item->" . $_key . "))"; + $query .= PHP_EOL . "\t\t\t\t\telseif (!isset(\$item->" . $_key . ") || !" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$item->" . $_key . "))"; $query .= PHP_EOL . "\t\t\t\t\t{"; $query .= PHP_EOL . "\t\t\t\t\t\tunset(\$items[\$nr]);"; $query .= PHP_EOL . "\t\t\t\t\t\tcontinue;"; @@ -8199,11 +8199,11 @@ class Interpretation extends Fields list($bin, $target) = explode('-R>', $parentKey); $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Filter by " . $_key . " Repetable Field"; $query .= PHP_EOL . "\t\t\t\$" . $globalKey . " = json_decode(\$this->" . $globalKey . ",true);"; - $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$items) && isset(\$" . $globalKey . ") && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$" . $globalKey . "))"; + $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$items) && isset(\$" . $globalKey . ") && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "))"; $query .= PHP_EOL . "\t\t\t{"; $query .= PHP_EOL . "\t\t\t\tforeach (\$items as \$nr => &\$item)"; $query .= PHP_EOL . "\t\t\t\t{"; - $query .= PHP_EOL . "\t\t\t\t\tif (\$item->" . $_key . " && isset(\$" . $globalKey . "['" . $target . "']) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . "\t\t\t\t\tif (\$item->" . $_key . " && isset(\$" . $globalKey . "['" . $target . "']) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; $query .= PHP_EOL . "\t\t\t\t\t{"; $query .= PHP_EOL . "\t\t\t\t\t\tif (!in_array(\$item->" . $_key . ",\$" . $globalKey . "['" . $target . "']))"; $query .= PHP_EOL . "\t\t\t\t\t\t{"; @@ -8228,14 +8228,14 @@ class Interpretation extends Fields { $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " Array Field"; $query .= PHP_EOL . "\t\t\t\$" . $globalKey . " = \$this->" . $globalKey . ";"; - $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$items) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$" . $globalKey . "))"; + $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$items) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "))"; $query .= PHP_EOL . "\t\t\t{"; $query .= PHP_EOL . "\t\t\t\tforeach (\$items as \$nr => &\$item)"; $query .= PHP_EOL . "\t\t\t\t{"; list($bin, $target) = explode('-A>', $parentKey); if (ComponentbuilderHelper::checkString($target)) { - $query .= PHP_EOL . "\t\t\t\t\tif (\$item->" . $_key . " && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . "\t\t\t\t\tif (\$item->" . $_key . " && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; $query .= PHP_EOL . "\t\t\t\t\t{"; $query .= PHP_EOL . "\t\t\t\t\t\tif (!in_array(\$item->" . $_key . ",\$" . $globalKey . "['" . $target . "']))"; } @@ -8269,8 +8269,8 @@ class Interpretation extends Fields $query .= PHP_EOL . "\t\t}"; $query .= PHP_EOL . "\t\treturn false;"; $query .= PHP_EOL . "\t}"; - // ###SELECTIONTRANSLATIONFIXFUNC###<<>> - $query .= $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic['###Component###']); + // SELECTIONTRANSLATIONFIXFUNC<<>> + $query .= $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); // fixe mothod name clash $query = str_replace('selectionTranslation(', 'selectionTranslation' . $functionName . '(', $query); @@ -8327,7 +8327,7 @@ class Interpretation extends Fields $method[] = "\t\tJSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; $method[] = "\t\t//" . $this->setLine(__LINE__) . " check if export is allowed for this user."; $method[] = "\t\t\$user = JFactory::getUser();"; - $method[] = "\t\tif (\$user->authorise('" . $custom_button['link'] . ".access', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $method[] = "\t\tif (\$user->authorise('" . $custom_button['link'] . ".access', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; $method[] = "\t\t{"; $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the input"; $method[] = "\t\t\t\$input = JFactory::getApplication()->input;"; @@ -8336,12 +8336,12 @@ class Interpretation extends Fields $method[] = "\t\t\tJArrayHelper::toInteger(\$pks);"; $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " convert to string"; $method[] = "\t\t\t\$ids = implode('_', \$pks);"; - $method[] = "\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $custom_button['link'] . "&cid='.\$ids, false));"; + $method[] = "\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $custom_button['link'] . "&cid='.\$ids, false));"; $method[] = "\t\t\treturn;"; $method[] = "\t\t}"; $method[] = "\t\t//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; $method[] = "\t\t\$message = JText:" . ":_('" . $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED');"; - $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_list . "', false), \$message, 'error');"; + $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_list . "', false), \$message, 'error');"; $method[] = "\t\treturn;"; $method[] = "\t}"; // add to lang array @@ -8375,7 +8375,7 @@ class Interpretation extends Fields $query .= PHP_EOL . "\tpublic function getExportData(\$pks)"; $query .= PHP_EOL . "\t{"; $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " setup the query"; - $query .= PHP_EOL . "\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$pks))"; + $query .= PHP_EOL . "\t\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$pks))"; $query .= PHP_EOL . "\t\t{"; $query .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Set a value to know this is exporting method."; $query .= PHP_EOL . "\t\t\t\$_export = true;"; @@ -8386,8 +8386,8 @@ class Interpretation extends Fields $query .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Select some fields"; $query .= PHP_EOL . "\t\t\t\$query->select('a.*');"; - $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic['###component###'] . "_" . $viewName_single . " table"; - $query .= PHP_EOL . "\t\t\t\$query->from(\$db->quoteName('#__" . $this->fileContentStatic['###component###'] . "_" . $viewName_single . "', 'a'));"; + $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . " table"; + $query .= PHP_EOL . "\t\t\t\$query->from(\$db->quoteName('#__" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . "', 'a'));"; $query .= PHP_EOL . "\t\t\t\$query->where('a.id IN (' . implode(',',\$pks) . ')');"; // add custom filtering php $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL . "\t"); @@ -8395,7 +8395,7 @@ class Interpretation extends Fields if (isset($this->accessBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName_single])) { $query .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Implement View Level Access"; - $query .= PHP_EOL . "\t\t\tif (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $query .= PHP_EOL . "\t\t\tif (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; $query .= PHP_EOL . "\t\t\t{"; $query .= PHP_EOL . "\t\t\t\t\$groups = implode(',', \$user->getAuthorisedViewLevels());"; $query .= PHP_EOL . "\t\t\t\t\$query->where('a.access IN (' . \$groups . ')');"; @@ -8409,7 +8409,7 @@ class Interpretation extends Fields $query .= PHP_EOL . "\t\t\tif (\$db->getNumRows())"; $query .= PHP_EOL . "\t\t\t{"; $query .= PHP_EOL . "\t\t\t\t\$items = \$db->loadObjectList();"; - $query .= $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic['###Component###'], "\t\t", true); + $query .= $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], "\t\t", true); // add custom php to getitems method after all $query .= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL . PHP_EOL . "\t\t"); $query .= PHP_EOL . "\t\t\t\treturn \$items;"; @@ -8443,7 +8443,7 @@ class Interpretation extends Fields $method[] = "\t\tJSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; $method[] = "\t\t//" . $this->setLine(__LINE__) . " check if export is allowed for this user."; $method[] = "\t\t\$user = JFactory::getUser();"; - $method[] = "\t\tif (\$user->authorise('" . $viewName_single . ".export', 'com_" . $this->fileContentStatic['###component###'] . "') && \$user->authorise('core.export', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $method[] = "\t\tif (\$user->authorise('" . $viewName_single . ".export', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "') && \$user->authorise('core.export', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; $method[] = "\t\t{"; $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the input"; $method[] = "\t\t\t\$input = JFactory::getApplication()->input;"; @@ -8454,16 +8454,16 @@ class Interpretation extends Fields $method[] = "\t\t\t\$model = \$this->getModel('" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "');"; $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " get the data to export"; $method[] = "\t\t\t\$data = \$model->getExportData(\$pks);"; - $method[] = "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$data))"; + $method[] = "\t\t\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$data))"; $method[] = "\t\t\t{"; $method[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " now set the data to the spreadsheet"; $method[] = "\t\t\t\t\$date = JFactory::getDate();"; - $method[] = "\t\t\t\t" . $this->fileContentStatic['###Component###'] . "Helper::xls(\$data,'" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "_'.\$date->format('jS_F_Y'),'" . ComponentbuilderHelper::safeString($viewName_list, 'Ww') . " exported ('.\$date->format('jS F, Y').')','" . ComponentbuilderHelper::safeString($viewName_list, 'w') . "');"; + $method[] = "\t\t\t\t" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::xls(\$data,'" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "_'.\$date->format('jS_F_Y'),'" . ComponentbuilderHelper::safeString($viewName_list, 'Ww') . " exported ('.\$date->format('jS F, Y').')','" . ComponentbuilderHelper::safeString($viewName_list, 'w') . "');"; $method[] = "\t\t\t}"; $method[] = "\t\t}"; $method[] = "\t\t//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; $method[] = "\t\t\$message = JText:" . ":_('" . $this->langPrefix . "_EXPORT_FAILED');"; - $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_list . "', false), \$message, 'error');"; + $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_list . "', false), \$message, 'error');"; $method[] = "\t\treturn;"; $method[] = "\t}"; @@ -8474,13 +8474,13 @@ class Interpretation extends Fields $method[] = "\t\tJSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; $method[] = "\t\t//" . $this->setLine(__LINE__) . " check if import is allowed for this user."; $method[] = "\t\t\$user = JFactory::getUser();"; - $method[] = "\t\tif (\$user->authorise('" . $viewName_single . ".import', 'com_" . $this->fileContentStatic['###component###'] . "') && \$user->authorise('core.import', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $method[] = "\t\tif (\$user->authorise('" . $viewName_single . ".import', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "') && \$user->authorise('core.import', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; $method[] = "\t\t{"; $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the import model"; $method[] = "\t\t\t\$model = \$this->getModel('" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "');"; $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " get the headers to import"; $method[] = "\t\t\t\$headers = \$model->getExImPortHeaders();"; - $method[] = "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkObject(\$headers))"; + $method[] = "\t\t\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkObject(\$headers))"; $method[] = "\t\t\t{"; $method[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Load headers to session."; $method[] = "\t\t\t\t\$session = JFactory::getSession();"; @@ -8499,18 +8499,18 @@ class Interpretation extends Fields // if this view has custom script it must have as custom import (model, veiw, controller) if (isset($this->importCustomScripts[$viewName_list]) && $this->importCustomScripts[$viewName_list]) { - $method[] = "\t\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=import_" . $viewName_list . "', false), \$message);"; + $method[] = "\t\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=import_" . $viewName_list . "', false), \$message);"; } else { - $method[] = "\t\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=import', false), \$message);"; + $method[] = "\t\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=import', false), \$message);"; } $method[] = "\t\t\t\treturn;"; $method[] = "\t\t\t}"; $method[] = "\t\t}"; $method[] = "\t\t//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; $method[] = "\t\t\$message = JText:" . ":_('" . $this->langPrefix . "_IMPORT_FAILED');"; - $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_list . "', false), \$message, 'error');"; + $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_list . "', false), \$message, 'error');"; $method[] = "\t\treturn;"; $method[] = "\t}"; return implode(PHP_EOL, $method); @@ -8568,26 +8568,26 @@ class Interpretation extends Fields $target = array('admin' => 'import_' . $viewName_list); $this->buildDynamique($target, 'customimport'); // load the custom script to the files - // ###IMPORT_EXT_METHOD_CUSTOM### <<>> - $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_EXT_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_ext', 'import_' . $viewName_list, PHP_EOL, null, true); - // ###IMPORT_DISPLAY_METHOD_CUSTOM### <<>> - $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_DISPLAY_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_display', 'import_' . $viewName_list, PHP_EOL, null, true); - // ###IMPORT_SETDATE_METHOD_CUSTOM### <<>> - $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_SETDATE_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_setdata', 'import_' . $viewName_list, PHP_EOL, null, true); - // ###IMPORT_METHOD_CUSTOM### <<>> - $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import', 'import_' . $viewName_list, PHP_EOL, null, true); - // ###IMPORT_SAVE_METHOD_CUSTOM### <<>> - $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_SAVE_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_save', 'import_' . $viewName_list, PHP_EOL, null, true); - // ###IMPORT_DEFAULT_VIEW_CUSTOM### <<>> - $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_DEFAULT_VIEW_CUSTOM###'] = $this->getCustomScriptBuilder('html_import_view', 'import_' . $viewName_list, PHP_EOL, null, true); + // IMPORT_EXT_METHOD_CUSTOM <<>> + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_EXT_METHOD_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('php_import_ext', 'import_' . $viewName_list, PHP_EOL, null, true); + // IMPORT_DISPLAY_METHOD_CUSTOM <<>> + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_DISPLAY_METHOD_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('php_import_display', 'import_' . $viewName_list, PHP_EOL, null, true); + // IMPORT_SETDATE_METHOD_CUSTOM <<>> + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_SETDATE_METHOD_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('php_import_setdata', 'import_' . $viewName_list, PHP_EOL, null, true); + // IMPORT_METHOD_CUSTOM <<>> + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_METHOD_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('php_import', 'import_' . $viewName_list, PHP_EOL, null, true); + // IMPORT_SAVE_METHOD_CUSTOM <<>> + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_SAVE_METHOD_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('php_import_save', 'import_' . $viewName_list, PHP_EOL, null, true); + // IMPORT_DEFAULT_VIEW_CUSTOM <<>> + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_DEFAULT_VIEW_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('html_import_view', 'import_' . $viewName_list, PHP_EOL, null, true); // insure we have the view placeholders setup - $this->fileContentDynamic['import_' . $viewName_list]['###VIEW###'] = 'IMPORT_' . $this->placeholders['###VIEWS###']; - $this->fileContentDynamic['import_' . $viewName_list]['###View###'] = 'Import_' . $this->placeholders['###views###']; - $this->fileContentDynamic['import_' . $viewName_list]['###view###'] = 'import_' . $this->placeholders['###views###']; - $this->fileContentDynamic['import_' . $viewName_list]['###VIEWS###'] = 'IMPORT_' . $this->placeholders['###VIEWS###']; - $this->fileContentDynamic['import_' . $viewName_list]['###Views###'] = 'Import_' . $this->placeholders['###views###']; - $this->fileContentDynamic['import_' . $viewName_list]['###views###'] = 'import_' . $this->placeholders['###views###']; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'VIEW' . $this->hhh] = 'IMPORT_' . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'View' . $this->hhh] = 'Import_' . $this->placeholders[$this->hhh . 'views' . $this->hhh]; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'view' . $this->hhh] = 'import_' . $this->placeholders[$this->hhh . 'views' . $this->hhh]; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'VIEWS' . $this->hhh] = 'IMPORT_' . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'Views' . $this->hhh] = 'Import_' . $this->placeholders[$this->hhh . 'views' . $this->hhh]; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'views' . $this->hhh] = 'import_' . $this->placeholders[$this->hhh . 'views' . $this->hhh]; } public function setListQuery($viewName_single, $viewName_list) @@ -8615,8 +8615,8 @@ class Interpretation extends Fields { $query .= PHP_EOL . "\t\t\$query->select(\$db->quoteName('c.title','category_title'));"; } - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic['###component###'] . "_item table"; - $query .= PHP_EOL . "\t\t\$query->from(\$db->quoteName('#__" . $this->fileContentStatic['###component###'] . "_" . $viewName_single . "', 'a'));"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_item table"; + $query .= PHP_EOL . "\t\t\$query->from(\$db->quoteName('#__" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . "', 'a'));"; // add the category if ($addCategory) { @@ -8647,7 +8647,7 @@ class Interpretation extends Fields $query .= PHP_EOL . "\t\t\t\$query->where('a.access = ' . (int) \$access);"; $query .= PHP_EOL . "\t\t}"; $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Implement View Level Access"; - $query .= PHP_EOL . "\t\tif (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $query .= PHP_EOL . "\t\tif (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; $query .= PHP_EOL . "\t\t{"; $query .= PHP_EOL . "\t\t\t\$groups = implode(',', \$user->getAuthorisedViewLevels());"; $query .= PHP_EOL . "\t\t\t\$query->where('a.access IN (' . \$groups . ')');"; @@ -9865,7 +9865,7 @@ class Interpretation extends Fields { $input[$task['task_name']][] = PHP_EOL . "\t\t\t\t\t\t\$" . $task['value_name'] . "Value = \$jinput->get('" . $task['value_name'] . "', " . $task['input_default'] . ", '" . $task['input_filter'] . "');"; $valueArray[$task['task_name']][] = "\$" . $task['value_name'] . "Value"; - $getModel[$task['task_name']] = PHP_EOL . "\t\t\t\t\t\t\t\$result = \$this->getModel('ajax')->" . $task['method_name'] . "([[[valueArray]]]);"; + $getModel[$task['task_name']] = PHP_EOL . "\t\t\t\t\t\t\t\$result = \$this->getModel('ajax')->" . $task['method_name'] . "(" . $this->bbb . "valueArray" . $this->ddd . ");"; // see user check is needed if (isset($task['user_check']) && 1 == $task['user_check']) @@ -9896,7 +9896,7 @@ class Interpretation extends Fields $values = implode(', ', $valueArray[$task]); $ifvalues = implode(' && ', $valueArray[$task]); // set the values to method - $getMethod = str_replace('[[[valueArray]]]', $values, $getMethod); + $getMethod = str_replace($this->bbb . 'valueArray' . $this->ddd, $values, $getMethod); $cases .= PHP_EOL . "\t\t\t\t\t\tif(" . $ifvalues . $userCheck[$task] . ")"; $cases .= PHP_EOL . "\t\t\t\t\t\t{"; $cases .= $getMethod; @@ -10264,32 +10264,32 @@ class Interpretation extends Fields $otherView = $viewName_single; } // load the category helper details in not already loaded - if (!isset($this->fileContentDynamic['category' . $otherViews]['###view###'])) + if (!isset($this->fileContentDynamic['category' . $otherViews][$this->hhh . 'view' . $this->hhh])) { // lets also set the category helper for this view $target = array('site' => 'category' . $viewName_list); $this->buildDynamique($target, 'category'); // insure the file gets updated - $this->fileContentDynamic['category' . $otherViews]['###view###'] = $otherView; - $this->fileContentDynamic['category' . $otherViews]['###View###'] = ucfirst($otherView); - $this->fileContentDynamic['category' . $otherViews]['###views###'] = $otherViews; - $this->fileContentDynamic['category' . $otherViews]['###Views###'] = ucfirst($otherViews); + $this->fileContentDynamic['category' . $otherViews][$this->hhh . 'view' . $this->hhh] = $otherView; + $this->fileContentDynamic['category' . $otherViews][$this->hhh . 'View' . $this->hhh] = ucfirst($otherView); + $this->fileContentDynamic['category' . $otherViews][$this->hhh . 'views' . $this->hhh] = $otherViews; + $this->fileContentDynamic['category' . $otherViews][$this->hhh . 'Views' . $this->hhh] = ucfirst($otherViews); // set script to global helper file $includeHelper = array(); $includeHelper[] = "\n//" . $this->setLine(__LINE__) . "Insure this view category file is loaded."; - $includeHelper[] = "\$classname = '" . $this->fileContentStatic['###component###'] . ucfirst($viewName_list) . "Categories';"; + $includeHelper[] = "\$classname = '" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . ucfirst($viewName_list) . "Categories';"; $includeHelper[] = "if (!class_exists(\$classname))"; $includeHelper[] = "{"; - $includeHelper[] = "\t\$path = JPATH_SITE . '/components/com_" . $this->fileContentStatic['###component###'] . "/helpers/category" . $viewName_list . ".php';"; + $includeHelper[] = "\t\$path = JPATH_SITE . '/components/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/helpers/category" . $viewName_list . ".php';"; $includeHelper[] = "\tif (is_file(\$path))"; $includeHelper[] = "\t{"; $includeHelper[] = "\t\tinclude_once \$path;"; $includeHelper[] = "\t}"; $includeHelper[] = "}"; - $this->fileContentStatic['###CATEGORY_CLASS_TREES###'] .= implode("\n", $includeHelper); + $this->fileContentStatic[$this->hhh . 'CATEGORY_CLASS_TREES' . $this->hhh] .= implode("\n", $includeHelper); } // return category view string - if (isset($this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###']) && ComponentbuilderHelper::checkString($this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'])) + if (isset($this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh]) && ComponentbuilderHelper::checkString($this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh])) { return "," . PHP_EOL . "\t\t\t" . '"com_' . $component . '.' . $otherViews . '" => "' . $otherView . '"'; } @@ -10621,9 +10621,9 @@ class Interpretation extends Fields $allow[] = "\t\t\treturn false;"; $allow[] = "\t\t}"; // load license locker - if ($this->componentData->add_license && $this->componentData->license_type == 3 && isset($this->fileContentDynamic[$viewName_single]['###BOOLMETHOD###'])) + if ($this->componentData->add_license && $this->componentData->license_type == 3 && isset($this->fileContentDynamic[$viewName_single][$this->hhh . 'BOOLMETHOD' . $this->hhh])) { - $allow[] = $this->checkStatmentLicenseLocked($this->fileContentDynamic[$viewName_single]['###BOOLMETHOD###']); + $allow[] = $this->checkStatmentLicenseLocked($this->fileContentDynamic[$viewName_single][$this->hhh . 'BOOLMETHOD' . $this->hhh]); } // setup correct core target $coreLoad = false; @@ -11433,7 +11433,7 @@ class Interpretation extends Fields $toolBar .= PHP_EOL . "\t\t\t\t\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));"; $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->state->params->get('save_history', 1) && \$this->canDo->get('" . $core['core.edit'] . "') && \$canVersion)"; $toolBar .= PHP_EOL . "\t\t\t\t{"; - $toolBar .= PHP_EOL . "\t\t\t\t\tJToolbarHelper::versions('com_" . $this->fileContentStatic['###component###'] . "." . $viewName . "', \$this->item->id);"; + $toolBar .= PHP_EOL . "\t\t\t\t\tJToolbarHelper::versions('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $viewName . "', \$this->item->id);"; $toolBar .= PHP_EOL . "\t\t\t\t}"; } } @@ -11444,7 +11444,7 @@ class Interpretation extends Fields $toolBar .= PHP_EOL . "\t\t\t\t\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));"; $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->state->params->get('save_history', 1) && \$this->canDo->get('core.edit') && \$canVersion)"; $toolBar .= PHP_EOL . "\t\t\t\t{"; - $toolBar .= PHP_EOL . "\t\t\t\t\tJToolbarHelper::versions('com_" . $this->fileContentStatic['###component###'] . "." . $viewName . "', \$this->item->id);"; + $toolBar .= PHP_EOL . "\t\t\t\t\tJToolbarHelper::versions('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $viewName . "', \$this->item->id);"; $toolBar .= PHP_EOL . "\t\t\t\t}"; } } @@ -11466,8 +11466,8 @@ class Interpretation extends Fields $toolBar .= PHP_EOL . "\t\t}"; $toolBar .= PHP_EOL . "\t\tJToolbarHelper::divider();"; $toolBar .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " set help url for this view if found"; - $toolBar .= PHP_EOL . "\t\t\$help_url = " . $this->fileContentStatic['###Component###'] . "Helper::getHelpUrl('" . $viewName . "');"; - $toolBar .= PHP_EOL . "\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkString(\$help_url))"; + $toolBar .= PHP_EOL . "\t\t\$help_url = " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::getHelpUrl('" . $viewName . "');"; + $toolBar .= PHP_EOL . "\t\tif (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkString(\$help_url))"; $toolBar .= PHP_EOL . "\t\t{"; $toolBar .= PHP_EOL . "\t\t\tJToolbarHelper::help('" . $this->langPrefix . "_HELP_MANAGER', false, \$help_url);"; $toolBar .= PHP_EOL . "\t\t}"; @@ -11907,9 +11907,9 @@ class Interpretation extends Fields if (isset($item['custom']['table'])) { // check if this is a local table - if (strpos($item['custom']['table'], '#__' . $this->fileContentStatic['###component###'] . '_') !== false) + if (strpos($item['custom']['table'], '#__' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_') !== false) { - $keyTableNAme = str_replace('#__' . $this->fileContentStatic['###component###'] . '_', '', $item['custom']['table']); + $keyTableNAme = str_replace('#__' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_', '', $item['custom']['table']); } else { @@ -12346,7 +12346,7 @@ class Interpretation extends Fields $display[] = $tab . "
"; $display[] = $tab . '
'; $display[] = $tab . "\t 'vdm')); ?>"; - $display[] = $tab . "\t\tfileContentStatic['###COMPANYNAME###'] . "', 'vdm'); ?>"; + $display[] = $tab . "\t\tfileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] . "', 'vdm'); ?>"; $display[] = $tab . "\t\t\tloadTemplate('vdm');?>"; $display[] = $tab . "\t\t"; $display[] = $tab . "\t"; @@ -12375,14 +12375,14 @@ class Interpretation extends Fields $display[] = $tab . "\t\t"; $slidecounter++; // build the template file - $target = array('custom_admin' => $this->fileContentStatic['###component###']); + $target = array('custom_admin' => $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]); $this->buildDynamique($target, 'template', $tempName); // set the file data $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); - // ###SITE_TEMPLATE_BODY### <<>> - $this->fileContentDynamic[$this->fileContentStatic['###component###'] . '_' . $tempName]['###CUSTOM_ADMIN_TEMPLATE_BODY###'] = PHP_EOL . $html; - // ###SITE_TEMPLATE_CODE_BODY### <<>> - $this->fileContentDynamic[$this->fileContentStatic['###component###'] . '_' . $tempName]['###CUSTOM_ADMIN_TEMPLATE_CODE_BODY###'] = ''; + // SITE_TEMPLATE_BODY <<>> + $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_' . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_BODY' . $this->hhh] = PHP_EOL . $html; + // SITE_TEMPLATE_CODE_BODY <<>> + $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_' . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_CODE_BODY' . $this->hhh] = ''; } $display[] = $tab . "\t"; $display[] = $tab . "
"; @@ -12931,9 +12931,9 @@ class Interpretation extends Fields $viewName = 'config'; $listViewName = 'configs'; $placeholders = array( - '###component###' => $component, - '###view###' => $viewName, - '###views###' => $listViewName); + $this->hhh . 'component' . $this->hhh => $component, + $this->hhh . 'view' . $this->hhh => $viewName, + $this->hhh . 'views' . $this->hhh => $listViewName); $view = ''; $viewType = 0; // set the custom table key @@ -15159,7 +15159,7 @@ function vdm_dkim() { } } - public function getInbetweenStrings($str, $start = '###', $end = '###') + public function getInbetweenStrings($str, $start = '#' . '#' . '#', $end = '#' . '#' . '#') { $matches = array(); $regex = "/$start([a-zA-Z0-9_]*)$end/"; diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 183e72cd7..2170fe35d 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -67,153 +67,153 @@ class Infusion extends Interpretation { if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) { - // ###COMPONENT### - $this->fileContentStatic['###COMPONENT###'] = $this->placeholders['###COMPONENT###']; + // COMPONENT + $this->fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] = $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh]; - // ###Component### - $this->fileContentStatic['###Component###'] = $this->placeholders['###Component###']; + // Component + $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] = $this->placeholders[$this->hhh . 'Component' . $this->hhh]; - // ###component### - $this->fileContentStatic['###component###'] = $this->placeholders['###component###']; + // component + $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] = $this->placeholders[$this->hhh . 'component' . $this->hhh]; - // ###COMPANYNAME### - $this->fileContentStatic['###COMPANYNAME###'] = trim(JFilterOutput::cleanText($this->componentData->companyname)); + // COMPANYNAME + $this->fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] = trim(JFilterOutput::cleanText($this->componentData->companyname)); - // ###CREATIONDATE### - $this->fileContentStatic['###CREATIONDATE###'] = JFactory::getDate($this->componentData->created)->format('jS F, Y'); - $this->fileContentStatic['###CREATIONDATE###GLOBAL'] = $this->fileContentStatic['###CREATIONDATE###']; + // CREATIONDATE + $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] = JFactory::getDate($this->componentData->created)->format('jS F, Y'); + $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh . 'GLOBAL'] = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh]; - // ###BUILDDATE### - $this->fileContentStatic['###BUILDDATE###'] = JFactory::getDate()->format('jS F, Y'); - $this->fileContentStatic['###BUILDDATE###GLOBAL'] = $this->fileContentStatic['###BUILDDATE###']; + // BUILDDATE + $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] = JFactory::getDate()->format('jS F, Y'); + $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh . 'GLOBAL'] = $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh]; - // ###AUTHOR### - $this->fileContentStatic['###AUTHOR###'] = trim(JFilterOutput::cleanText($this->componentData->author)); + // AUTHOR + $this->fileContentStatic[$this->hhh . 'AUTHOR' . $this->hhh] = trim(JFilterOutput::cleanText($this->componentData->author)); - // ###AUTHOREMAIL### - $this->fileContentStatic['###AUTHOREMAIL###'] = trim($this->componentData->email); + // AUTHOREMAIL + $this->fileContentStatic[$this->hhh . 'AUTHOREMAIL' . $this->hhh] = trim($this->componentData->email); - // ###AUTHORWEBSITE### - $this->fileContentStatic['###AUTHORWEBSITE###'] = trim($this->componentData->website); + // AUTHORWEBSITE + $this->fileContentStatic[$this->hhh . 'AUTHORWEBSITE' . $this->hhh] = trim($this->componentData->website); - // ###COPYRIGHT### - $this->fileContentStatic['###COPYRIGHT###'] = trim($this->componentData->copyright); + // COPYRIGHT + $this->fileContentStatic[$this->hhh . 'COPYRIGHT' . $this->hhh] = trim($this->componentData->copyright); - // ###LICENSE### - $this->fileContentStatic['###LICENSE###'] = trim($this->componentData->license); + // LICENSE + $this->fileContentStatic[$this->hhh . 'LICENSE' . $this->hhh] = trim($this->componentData->license); - // ###VERSION### - $this->fileContentStatic['###VERSION###'] = trim($this->componentData->component_version); + // VERSION + $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = trim($this->componentData->component_version); // set the actual global version - $this->fileContentStatic['###ACTUALVERSION###'] = $this->fileContentStatic['###VERSION###']; + $this->fileContentStatic[$this->hhh . 'ACTUALVERSION' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]; // do some Tweaks to the version based on selected options - if (strpos($this->fileContentStatic['###VERSION###'], '.') !== false) + if (strpos($this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh], '.') !== false) { - $versionArray = explode('.', $this->fileContentStatic['###VERSION###']); + $versionArray = explode('.', $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]); } // load only first two values if (isset($versionArray) && ComponentbuilderHelper::checkArray($versionArray) && $this->componentData->mvc_versiondate == 2) { - $this->fileContentStatic['###VERSION###'] = $versionArray[0] . '.' . $versionArray[1] . '.x'; + $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = $versionArray[0] . '.' . $versionArray[1] . '.x'; } // load only the first value elseif (isset($versionArray) && ComponentbuilderHelper::checkArray($versionArray) && $this->componentData->mvc_versiondate == 3) { - $this->fileContentStatic['###VERSION###'] = $versionArray[0] . '.x.x'; + $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = $versionArray[0] . '.x.x'; } unset($versionArray); // set the global version in case - $this->fileContentStatic['###VERSION###GLOBAL'] = $this->fileContentStatic['###VERSION###']; + $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh . 'GLOBAL'] = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]; - // ###Component_name### - $this->fileContentStatic['###Component_name###'] = JFilterOutput::cleanText($this->componentData->name); + // Component_name + $this->fileContentStatic[$this->hhh . 'Component_name' . $this->hhh] = JFilterOutput::cleanText($this->componentData->name); - // ###SHORT_DISCRIPTION### - $this->fileContentStatic['###SHORT_DESCRIPTION###'] = trim(JFilterOutput::cleanText($this->componentData->short_description)); + // SHORT_DISCRIPTION + $this->fileContentStatic[$this->hhh . 'SHORT_DESCRIPTION' . $this->hhh] = trim(JFilterOutput::cleanText($this->componentData->short_description)); - // ###DESCRIPTION### - $this->fileContentStatic['###DESCRIPTION###'] = trim($this->componentData->description); + // DESCRIPTION + $this->fileContentStatic[$this->hhh . 'DESCRIPTION' . $this->hhh] = trim($this->componentData->description); - // ###COMP_IMAGE_TYPE### - $this->fileContentStatic['###COMP_IMAGE_TYPE###'] = $this->setComponentImageType($this->componentData->image); + // COMP_IMAGE_TYPE + $this->fileContentStatic[$this->hhh . 'COMP_IMAGE_TYPE' . $this->hhh] = $this->setComponentImageType($this->componentData->image); - // ###ACCESS_SECTIONS### - $this->fileContentStatic['###ACCESS_SECTIONS###'] = $this->setAccessSections(); + // ACCESS_SECTIONS + $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh] = $this->setAccessSections(); - // ###CONFIG_FIELDSETS### + // CONFIG_FIELDSETS $keepLang = $this->lang; $this->lang = 'admin'; // start loading the category tree scripts - $this->fileContentStatic['###CATEGORY_CLASS_TREES###'] = ''; + $this->fileContentStatic[$this->hhh . 'CATEGORY_CLASS_TREES' . $this->hhh] = ''; // run the field sets for first time $this->setConfigFieldsets(1); $this->lang = $keepLang; - // ###ADMINJS### - $this->fileContentStatic['###ADMINJS###'] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders); - // ###SITEJS### - $this->fileContentStatic['###SITEJS###'] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders); + // ADMINJS + $this->fileContentStatic[$this->hhh . 'ADMINJS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders); + // SITEJS + $this->fileContentStatic[$this->hhh . 'SITEJS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders); - // ###ADMINCSS### - $this->fileContentStatic['###ADMINCSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css_admin'], $this->placeholders); - // ###SITECSS### - $this->fileContentStatic['###SITECSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css_site'], $this->placeholders); + // ADMINCSS + $this->fileContentStatic[$this->hhh . 'ADMINCSS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_css_admin'], $this->placeholders); + // SITECSS + $this->fileContentStatic[$this->hhh . 'SITECSS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_css_site'], $this->placeholders); - // ###CUSTOM_HELPER_SCRIPT### - $this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders); + // CUSTOM_HELPER_SCRIPT + $this->fileContentStatic[$this->hhh . 'CUSTOM_HELPER_SCRIPT' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders); - // ###BOTH_CUSTOM_HELPER_SCRIPT### - $this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders); + // BOTH_CUSTOM_HELPER_SCRIPT + $this->fileContentStatic[$this->hhh . 'BOTH_CUSTOM_HELPER_SCRIPT' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders); - // ###ADMIN_GLOBAL_EVENT_HELPER### - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = ''; + // ADMIN_GLOBAL_EVENT_HELPER + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] = ''; - // ###ADMIN_GLOBAL_EVENT### - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] = ''; + // ADMIN_GLOBAL_EVENT + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] = ''; // set incase no extra admin files are loaded - $this->fileContentStatic['###EXSTRA_ADMIN_FILES###'] = ''; + $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES' . $this->hhh] = ''; // now load the data for the global event if needed if ($this->componentData->add_admin_event == 1) { - // ###ADMIN_GLOBAL_EVENT### - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] = PHP_EOL . PHP_EOL . '// Triger the Global Admin Event'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] .= PHP_EOL . $this->fileContentStatic['###Component###'] . 'Helper::globalEvent($document);'; - // ###ADMIN_GLOBAL_EVENT_HELPER### - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = PHP_EOL . PHP_EOL . "\t" . '/**'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '* The Global Admin Event Method.'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '**/'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . 'public static function globalEvent($document)'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '{'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders); - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '}'; + // ADMIN_GLOBAL_EVENT + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] = PHP_EOL . PHP_EOL . '// Triger the Global Admin Event'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] .= PHP_EOL . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::globalEvent($document);'; + // ADMIN_GLOBAL_EVENT_HELPER + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] = PHP_EOL . PHP_EOL . "\t" . '/**'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '* The Global Admin Event Method.'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '**/'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . 'public static function globalEvent($document)'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '{'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders); + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '}'; } // now load the readme file if needed if ($this->componentData->addreadme == 1) { - $this->fileContentStatic['###EXSTRA_ADMIN_FILES###'] .= PHP_EOL . "\t\t\tREADME.txt"; + $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES' . $this->hhh] .= PHP_EOL . "\t\t\tREADME.txt"; } - // ###HELPER_CREATEUSER### - $this->fileContentStatic['###HELPER_CREATEUSER###'] = $this->setCreateUserHelperMethod($this->componentData->creatuserhelper); + // HELPER_CREATEUSER + $this->fileContentStatic[$this->hhh . 'HELPER_CREATEUSER' . $this->hhh] = $this->setCreateUserHelperMethod($this->componentData->creatuserhelper); - // ###HELP### - $this->fileContentStatic['###HELP###'] = $this->noHelp(); - // ###HELP_SITE### - $this->fileContentStatic['###HELP_SITE###'] = $this->noHelp(); + // HELP + $this->fileContentStatic[$this->hhh . 'HELP' . $this->hhh] = $this->noHelp(); + // HELP_SITE + $this->fileContentStatic[$this->hhh . 'HELP_SITE' . $this->hhh] = $this->noHelp(); // build route parse switch - $this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] = ''; + $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' . $this->hhh] = ''; // build route views - $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] = ''; + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] = ''; // add the helper emailer if set - $this->fileContentStatic['###HELPER_EMAIL###'] = $this->addEmailHelper(); + $this->fileContentStatic[$this->hhh . 'HELPER_EMAIL' . $this->hhh] = $this->addEmailHelper(); // reset view array $viewarray = array(); @@ -260,97 +260,97 @@ class Infusion extends Interpretation $this->setLockLicensePer($viewName_single, $this->target); $this->setLockLicensePer($viewName_list, $this->target); - // ###FIELDSETS### <<>> - $this->fileContentDynamic[$viewName_single]['###FIELDSETS###'] = $this->setFieldSet($view, $this->fileContentStatic['###component###'], $viewName_single, $viewName_list); + // FIELDSETS <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'FIELDSETS' . $this->hhh] = $this->setFieldSet($view, $this->fileContentStatic[$this->hhh . 'component' . $this->hhh], $viewName_single, $viewName_list); - // ###ACCESSCONTROL### <<>> - $this->fileContentDynamic[$viewName_single]['###ACCESSCONTROL###'] = $this->setFieldSetAccessControl($viewName_single); + // ACCESSCONTROL <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'ACCESSCONTROL' . $this->hhh] = $this->setFieldSetAccessControl($viewName_single); - // ###LINKEDVIEWITEMS### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWITEMS###'] = ''; + // LINKEDVIEWITEMS <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWITEMS' . $this->hhh] = ''; - // ###ADDTOOLBAR### <<>> - $this->fileContentDynamic[$viewName_single]['###ADDTOOLBAR###'] = $this->setAddToolBar($view); + // ADDTOOLBAR <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'ADDTOOLBAR' . $this->hhh] = $this->setAddToolBar($view); // set the script for this view $this->buildTheViewScript($view); - // ###VIEW_SCRIPT### - $this->fileContentDynamic[$viewName_single]['###VIEW_SCRIPT###'] = $this->setViewScript($viewName_single); + // VIEW_SCRIPT + $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEW_SCRIPT' . $this->hhh] = $this->setViewScript($viewName_single); - // ###EDITBODYSCRIPT### - $this->fileContentDynamic[$viewName_single]['###EDITBODYSCRIPT###'] = $this->setEditBodyScript($viewName_single); + // EDITBODYSCRIPT + $this->fileContentDynamic[$viewName_single][$this->hhh . 'EDITBODYSCRIPT' . $this->hhh] = $this->setEditBodyScript($viewName_single); - // ###AJAXTOKE### <<>> - $this->fileContentDynamic[$viewName_single]['###AJAXTOKE###'] = $this->setAjaxToke($viewName_single); + // AJAXTOKE <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'AJAXTOKE' . $this->hhh] = $this->setAjaxToke($viewName_single); - // ###DOCUMENT_CUSTOM_PHP### <<>> + // DOCUMENT_CUSTOM_PHP <<>> if ($phpDocument = $this->getCustomScriptBuilder('php_document', $viewName_single, PHP_EOL, null, true, false)) { - $this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###'] = str_replace('$document->', '$this->document->', $phpDocument); + $this->fileContentDynamic[$viewName_single][$this->hhh . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] = str_replace('$document->', '$this->document->', $phpDocument); // clear some memory unset($phpDocument); } else { - $this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###'] = ''; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] = ''; } - // ###LINKEDVIEWTABLESCRIPTS### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWTABLESCRIPTS###'] = ''; + // LINKEDVIEWTABLESCRIPTS <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh] = ''; - // ###VALIDATEFIX### <<>> - $this->fileContentDynamic[$viewName_single]['###VALIDATIONFIX###'] = $this->setValidationFix($viewName_single, $this->fileContentStatic['###Component###']); + // VALIDATEFIX <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'VALIDATIONFIX' . $this->hhh] = $this->setValidationFix($viewName_single, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); - // ###EDITBODY### <<>> - $this->fileContentDynamic[$viewName_single]['###EDITBODY###'] = $this->setEditBody($view); + // EDITBODY <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'EDITBODY' . $this->hhh] = $this->setEditBody($view); - // ###EDITBODY### <<>> - $this->fileContentDynamic[$viewName_single]['###EDITBODYFADEIN###'] = $this->setFadeInEfect($view); + // EDITBODY <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'EDITBODYFADEIN' . $this->hhh] = $this->setFadeInEfect($view); - // ###JTABLECONSTRUCTOR### <<>> - $this->fileContentDynamic[$viewName_single]['###JTABLECONSTRUCTOR###'] = $this->setJtableConstructor($viewName_single); + // JTABLECONSTRUCTOR <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JTABLECONSTRUCTOR' . $this->hhh] = $this->setJtableConstructor($viewName_single); - // ###JTABLEALIASCATEGORY### <<>> - $this->fileContentDynamic[$viewName_single]['###JTABLEALIASCATEGORY###'] = $this->setJtableAliasCategory($viewName_single); + // JTABLEALIASCATEGORY <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JTABLEALIASCATEGORY' . $this->hhh] = $this->setJtableAliasCategory($viewName_single); - // ###METHOD_GET_ITEM### <<>> - $this->fileContentDynamic[$viewName_single]['###METHOD_GET_ITEM###'] = $this->setMethodGetItem($viewName_single); + // METHOD_GET_ITEM <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'METHOD_GET_ITEM' . $this->hhh] = $this->setMethodGetItem($viewName_single); - // ###LINKEDVIEWGLOBAL### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWGLOBAL###'] = ''; + // LINKEDVIEWGLOBAL <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWGLOBAL' . $this->hhh] = ''; - // ###LINKEDVIEWMETHODS### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWMETHODS###'] = ''; + // LINKEDVIEWMETHODS <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWMETHODS' . $this->hhh] = ''; - // ###JMODELADMIN_BEFORE_DELETE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_DELETE###'] = $this->getCustomScriptBuilder('php_before_delete', $viewName_single, PHP_EOL); + // JMODELADMIN_BEFORE_DELETE <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_BEFORE_DELETE' . $this->hhh] = $this->getCustomScriptBuilder('php_before_delete', $viewName_single, PHP_EOL); - // ###JMODELADMIN_AFTER_DELETE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_DELETE###'] = $this->getCustomScriptBuilder('php_after_delete', $viewName_single, PHP_EOL . PHP_EOL); + // JMODELADMIN_AFTER_DELETE <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_AFTER_DELETE' . $this->hhh] = $this->getCustomScriptBuilder('php_after_delete', $viewName_single, PHP_EOL . PHP_EOL); - // ###JMODELADMIN_BEFORE_DELETE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_PUBLISH###'] = $this->getCustomScriptBuilder('php_before_publish', $viewName_single, PHP_EOL); + // JMODELADMIN_BEFORE_DELETE <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_BEFORE_PUBLISH' . $this->hhh] = $this->getCustomScriptBuilder('php_before_publish', $viewName_single, PHP_EOL); - // ###JMODELADMIN_AFTER_DELETE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_PUBLISH###'] = $this->getCustomScriptBuilder('php_after_publish', $viewName_single, PHP_EOL . PHP_EOL); + // JMODELADMIN_AFTER_DELETE <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_AFTER_PUBLISH' . $this->hhh] = $this->getCustomScriptBuilder('php_after_publish', $viewName_single, PHP_EOL . PHP_EOL); - // ###CHECKBOX_SAVE### <<>> - $this->fileContentDynamic[$viewName_single]['###CHECKBOX_SAVE###'] = $this->setCheckboxSave($viewName_single); + // CHECKBOX_SAVE <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'CHECKBOX_SAVE' . $this->hhh] = $this->setCheckboxSave($viewName_single); - // ###METHOD_ITEM_SAVE### <<>> - $this->fileContentDynamic[$viewName_single]['###METHOD_ITEM_SAVE###'] = $this->setMethodItemSave($viewName_single); + // METHOD_ITEM_SAVE <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'METHOD_ITEM_SAVE' . $this->hhh] = $this->setMethodItemSave($viewName_single); - // ###POSTSAVEHOOK### <<>> - $this->fileContentDynamic[$viewName_single]['###POSTSAVEHOOK###'] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, PHP_EOL . "\t\treturn;", PHP_EOL . PHP_EOL . "\t\treturn;"); + // POSTSAVEHOOK <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'POSTSAVEHOOK' . $this->hhh] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, PHP_EOL . "\t\treturn;", PHP_EOL . PHP_EOL . "\t\treturn;"); - // ###VIEWCSS### <<>> - $this->fileContentDynamic[$viewName_single]['###VIEWCSS###'] = $this->getCustomScriptBuilder('css_view', $viewName_single, '', null, true); + // VIEWCSS <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh] = $this->getCustomScriptBuilder('css_view', $viewName_single, '', null, true); // add css to front end if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) { - $this->fileContentDynamic[$viewName_single]['###SITE_VIEWCSS###'] = $this->fileContentDynamic[$viewName_single]['###VIEWCSS###']; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'SITE_VIEWCSS' . $this->hhh] = $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh]; } } // set the views names @@ -358,8 +358,8 @@ class Infusion extends Interpretation { $this->lang = 'admin'; - // ###ICOMOON### <<>> - $this->fileContentDynamic[$viewName_list]['###ICOMOON###'] = $view['icomoon']; + // ICOMOON <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'ICOMOON' . $this->hhh] = $view['icomoon']; // set the export/import option if (isset($view['port']) && $view['port'] || 1 == $view['settings']->add_custom_import) @@ -380,93 +380,93 @@ class Infusion extends Interpretation // set Autocheckin function if (isset($view['checkin']) && $view['checkin'] == 1) { - // ###AUTOCHECKIN### <<>> - $this->fileContentDynamic[$viewName_list]['###AUTOCHECKIN###'] = $this->setAutoCheckin($viewName_single, $this->fileContentStatic['###component###']); - // ###CHECKINCALL### <<>> - $this->fileContentDynamic[$viewName_list]['###CHECKINCALL###'] = $this->setCheckinCall(); + // AUTOCHECKIN <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'AUTOCHECKIN' . $this->hhh] = $this->setAutoCheckin($viewName_single, $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]); + // CHECKINCALL <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'CHECKINCALL' . $this->hhh] = $this->setCheckinCall(); } else { - // ###AUTOCHECKIN### <<>> - $this->fileContentDynamic[$viewName_list]['###AUTOCHECKIN###'] = ''; - // ###CHECKINCALL### <<>> - $this->fileContentDynamic[$viewName_list]['###CHECKINCALL###'] = ''; + // AUTOCHECKIN <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'AUTOCHECKIN' . $this->hhh] = ''; + // CHECKINCALL <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'CHECKINCALL' . $this->hhh] = ''; } - // ###ADMIN_CUSTOM_BUTTONS_LIST### - $this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_BUTTONS_LIST###'] = $this->setCustomButtons($view, 3, "\t"); - $this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST###'] = $this->setFunctionOnlyButtons($viewName_list); + // ADMIN_CUSTOM_BUTTONS_LIST + $this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_CUSTOM_BUTTONS_LIST' . $this->hhh] = $this->setCustomButtons($view, 3, "\t"); + $this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST' . $this->hhh] = $this->setFunctionOnlyButtons($viewName_list); - // ###GET_ITEMS_METHOD_STRING_FIX### <<>> - $this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_STRING_FIX###'] = $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic['###Component###']); + // GET_ITEMS_METHOD_STRING_FIX <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'GET_ITEMS_METHOD_STRING_FIX' . $this->hhh] = $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); - // ###GET_ITEMS_METHOD_AFTER_ALL### <<>> - $this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_AFTER_ALL###'] = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL); + // GET_ITEMS_METHOD_AFTER_ALL <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'GET_ITEMS_METHOD_AFTER_ALL' . $this->hhh] = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL); - // ###SELECTIONTRANSLATIONFIX### <<>> - $this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIX###'] = $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic['###Component###']); + // SELECTIONTRANSLATIONFIX <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'SELECTIONTRANSLATIONFIX' . $this->hhh] = $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); - // ###SELECTIONTRANSLATIONFIXFUNC### <<>> - $this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIXFUNC###'] = $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic['###Component###']); + // SELECTIONTRANSLATIONFIXFUNC <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'SELECTIONTRANSLATIONFIXFUNC' . $this->hhh] = $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); - // ###FILTER_FIELDS### <<>> - $this->fileContentDynamic[$viewName_list]['###FILTER_FIELDS###'] = $this->setFilterFields($viewName_list); + // FILTER_FIELDS <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'FILTER_FIELDS' . $this->hhh] = $this->setFilterFields($viewName_list); - // ###STOREDID### <<>> - $this->fileContentDynamic[$viewName_list]['###STOREDID###'] = $this->setStoredId($viewName_list); + // STOREDID <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'STOREDID' . $this->hhh] = $this->setStoredId($viewName_list); - // ###POPULATESTATE### <<>> - $this->fileContentDynamic[$viewName_list]['###POPULATESTATE###'] = $this->setPopulateState($viewName_list); + // POPULATESTATE <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'POPULATESTATE' . $this->hhh] = $this->setPopulateState($viewName_list); - // ###SORTFIELDS### <<>> - $this->fileContentDynamic[$viewName_list]['###SORTFIELDS###'] = $this->setSortFields($viewName_list); + // SORTFIELDS <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'SORTFIELDS' . $this->hhh] = $this->setSortFields($viewName_list); - // ###CATEGORYFILTER### <<>> - $this->fileContentDynamic[$viewName_list]['###CATEGORYFILTER###'] = $this->setCategoryFilter($viewName_list); + // CATEGORYFILTER <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'CATEGORYFILTER' . $this->hhh] = $this->setCategoryFilter($viewName_list); - // ###CATEGORY_VIEWS### - if (!isset($this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'])) + // CATEGORY_VIEWS + if (!isset($this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh])) { - $this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'] = ''; + $this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] = ''; } - $this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'] .= $this->setRouterCategoryViews($viewName_single, $viewName_list); + $this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] .= $this->setRouterCategoryViews($viewName_single, $viewName_list); - // ###OTHERFILTERS### <<>> - $this->fileContentDynamic[$viewName_list]['###OTHERFILTERS###'] = $this->setOtherFilter($viewName_list); + // OTHERFILTERS <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'OTHERFILTERS' . $this->hhh] = $this->setOtherFilter($viewName_list); - // ###FILTERFUNCTIONS### <<>> - $this->fileContentDynamic[$viewName_list]['###FILTERFUNCTIONS###'] = $this->setFilterFunctions($viewName_single, $viewName_list); + // FILTERFUNCTIONS <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'FILTERFUNCTIONS' . $this->hhh] = $this->setFilterFunctions($viewName_single, $viewName_list); - // ###LISTQUERY### <<>> - $this->fileContentDynamic[$viewName_list]['###LISTQUERY###'] = $this->setListQuery($viewName_single, $viewName_list); + // LISTQUERY <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTQUERY' . $this->hhh] = $this->setListQuery($viewName_single, $viewName_list); - // ###MODELEXPORTMETHOD### <<>> - $this->fileContentDynamic[$viewName_list]['###MODELEXPORTMETHOD###'] = $this->setModelExportMethod($viewName_single, $viewName_list); + // MODELEXPORTMETHOD <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'MODELEXPORTMETHOD' . $this->hhh] = $this->setModelExportMethod($viewName_single, $viewName_list); - // ###MODELEXIMPORTMETHOD### <<>> - $this->fileContentDynamic[$viewName_list]['###CONTROLLEREXIMPORTMETHOD###'] = $this->setControllerEximportMethod($viewName_single, $viewName_list); + // MODELEXIMPORTMETHOD <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'CONTROLLEREXIMPORTMETHOD' . $this->hhh] = $this->setControllerEximportMethod($viewName_single, $viewName_list); - // ###EXPORTBUTTON### <<>> - $this->fileContentDynamic[$viewName_list]['###EXPORTBUTTON###'] = $this->setExportButton($viewName_single, $viewName_list); + // EXPORTBUTTON <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'EXPORTBUTTON' . $this->hhh] = $this->setExportButton($viewName_single, $viewName_list); - // ###IMPORTBUTTON### <<>> - $this->fileContentDynamic[$viewName_list]['###IMPORTBUTTON###'] = $this->setImportButton($viewName_single, $viewName_list); + // IMPORTBUTTON <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'IMPORTBUTTON' . $this->hhh] = $this->setImportButton($viewName_single, $viewName_list); - // ###LISTHEAD### <<>> - $this->fileContentDynamic[$viewName_list]['###LISTHEAD###'] = $this->setListHead($viewName_single, $viewName_list); + // LISTHEAD <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTHEAD' . $this->hhh] = $this->setListHead($viewName_single, $viewName_list); - // ###LISTBODY### <<>> - $this->fileContentDynamic[$viewName_list]['###LISTBODY###'] = $this->setListBody($viewName_single, $viewName_list); + // LISTBODY <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTBODY' . $this->hhh] = $this->setListBody($viewName_single, $viewName_list); - // ###LISTCOLNR### <<>> - $this->fileContentDynamic[$viewName_list]['###LISTCOLNR###'] = $this->setListColnr($viewName_list); + // LISTCOLNR <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTCOLNR' . $this->hhh] = $this->setListColnr($viewName_list); - // ###JVIEWLISTCANDO### <<>> - $this->fileContentDynamic[$viewName_list]['###JVIEWLISTCANDO###'] = $this->setJviewListCanDo($viewName_single, $viewName_list); + // JVIEWLISTCANDO <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'JVIEWLISTCANDO' . $this->hhh] = $this->setJviewListCanDo($viewName_single, $viewName_list); - // ###VIEWSCSS### <<>> - $this->fileContentDynamic[$viewName_list]['###VIEWSCSS###'] = $this->getCustomScriptBuilder('css_views', $viewName_single, '', null, true); + // VIEWSCSS <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWSCSS' . $this->hhh] = $this->getCustomScriptBuilder('css_views', $viewName_single, '', null, true); - // ###VIEWS_FOOTER_SCRIPT### <<>> + // VIEWS_FOOTER_SCRIPT <<>> $scriptNote = PHP_EOL . '//' . $this->setLine(__LINE__) . ' ' . $viewName_list . ' footer script'; if ($footerScript = $this->getCustomScriptBuilder('views_footer', $viewName_single, '', $scriptNote, true, false, PHP_EOL)) { @@ -480,83 +480,83 @@ class Infusion extends Interpretation // clear some memory unset($minifier); } - $this->fileContentDynamic[$viewName_list]['###VIEWS_FOOTER_SCRIPT###'] = PHP_EOL . '"; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWS_FOOTER_SCRIPT' . $this->hhh] = PHP_EOL . '"; // clear some memory unset($footerScript); } else { - $this->fileContentDynamic[$viewName_list]['###VIEWS_FOOTER_SCRIPT###'] = ''; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWS_FOOTER_SCRIPT' . $this->hhh] = ''; } } // set u fields used in batch - $this->fileContentDynamic[$viewName_single]['###UNIQUEFIELDS###'] = $this->setUniqueFields($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh . 'UNIQUEFIELDS' . $this->hhh] = $this->setUniqueFields($viewName_single); - // ###TITLEALIASFIX### <<>> - $this->fileContentDynamic[$viewName_single]['###TITLEALIASFIX###'] = $this->setAliasTitleFix($viewName_single); + // TITLEALIASFIX <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'TITLEALIASFIX' . $this->hhh] = $this->setAliasTitleFix($viewName_single); - // ###GENERATENEWTITLE### <<>> - $this->fileContentDynamic[$viewName_single]['###GENERATENEWTITLE###'] = $this->setGenerateNewTitle($viewName_single); + // GENERATENEWTITLE <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'GENERATENEWTITLE' . $this->hhh] = $this->setGenerateNewTitle($viewName_single); - // ###GENERATENEWALIAS### <<>> - $this->fileContentDynamic[$viewName_single]['###GENERATENEWALIAS###'] = $this->setGenerateNewAlias($viewName_single); + // GENERATENEWALIAS <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'GENERATENEWALIAS' . $this->hhh] = $this->setGenerateNewAlias($viewName_single); - // ###MODEL_BATCH_COPY### <<>> - $this->fileContentDynamic[$viewName_single]['###MODEL_BATCH_COPY###'] = $this->setBatchCopy($viewName_single); + // MODEL_BATCH_COPY <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'MODEL_BATCH_COPY' . $this->hhh] = $this->setBatchCopy($viewName_single); - // ###MODEL_BATCH_MOVE### <<>> - $this->fileContentDynamic[$viewName_single]['###MODEL_BATCH_MOVE###'] = $this->setBatchMove($viewName_single); + // MODEL_BATCH_MOVE <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'MODEL_BATCH_MOVE' . $this->hhh] = $this->setBatchMove($viewName_single); - // ###BATCH_ONCLICK_CANCEL_SCRIPT### <<>> - $this->fileContentDynamic[$viewName_list]['###BATCH_ONCLICK_CANCEL_SCRIPT###'] = ''; // TODO <-- must still be build - // ###JCONTROLLERFORM_ALLOWADD### <<>> - $this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWADD###'] = $this->setJcontrollerAllowAdd($viewName_single, $viewName_list); + // BATCH_ONCLICK_CANCEL_SCRIPT <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'BATCH_ONCLICK_CANCEL_SCRIPT' . $this->hhh] = ''; // TODO <-- must still be build + // JCONTROLLERFORM_ALLOWADD <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JCONTROLLERFORM_ALLOWADD' . $this->hhh] = $this->setJcontrollerAllowAdd($viewName_single, $viewName_list); - // ###JCONTROLLERFORM_ALLOWEDIT### <<>> - $this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWEDIT###'] = $this->setJcontrollerAllowEdit($viewName_single, $viewName_list); + // JCONTROLLERFORM_ALLOWEDIT <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JCONTROLLERFORM_ALLOWEDIT' . $this->hhh] = $this->setJcontrollerAllowEdit($viewName_single, $viewName_list); - // ###JMODELADMIN_GETFORM### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_GETFORM###'] = $this->setJmodelAdminGetForm($viewName_single, $viewName_list); + // JMODELADMIN_GETFORM <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_GETFORM' . $this->hhh] = $this->setJmodelAdminGetForm($viewName_single, $viewName_list); - // ###JMODELADMIN_ALLOWEDIT### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_ALLOWEDIT###'] = $this->setJmodelAdminAllowEdit($viewName_single, $viewName_list); + // JMODELADMIN_ALLOWEDIT <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_ALLOWEDIT' . $this->hhh] = $this->setJmodelAdminAllowEdit($viewName_single, $viewName_list); - // ###JMODELADMIN_CANDELETE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANDELETE###'] = $this->setJmodelAdminCanDelete($viewName_single, $viewName_list); + // JMODELADMIN_CANDELETE <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_CANDELETE' . $this->hhh] = $this->setJmodelAdminCanDelete($viewName_single, $viewName_list); - // ###JMODELADMIN_CANEDITSTATE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANEDITSTATE###'] = $this->setJmodelAdminCanEditState($viewName_single, $viewName_list); + // JMODELADMIN_CANEDITSTATE <<>> + $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_CANEDITSTATE' . $this->hhh] = $this->setJmodelAdminCanEditState($viewName_single, $viewName_list); // set custom admin view Toolbare buttons - // ###CUSTOM_ADMIN_DYNAMIC_BUTTONS### <<>> - $this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS###'] = $this->setCustomAdminDynamicButton($viewName_list); - // ###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER### <<>> - $this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER###'] = $this->setCustomAdminDynamicButtonController($viewName_list); + // CUSTOM_ADMIN_DYNAMIC_BUTTONS <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'CUSTOM_ADMIN_DYNAMIC_BUTTONS' . $this->hhh] = $this->setCustomAdminDynamicButton($viewName_list); + // CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER <<>> + $this->fileContentDynamic[$viewName_list][$this->hhh . 'CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER' . $this->hhh] = $this->setCustomAdminDynamicButtonController($viewName_list); // set helper router - if (!isset($this->fileContentStatic['###ROUTEHELPER###'])) + if (!isset($this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh])) { - $this->fileContentStatic['###ROUTEHELPER###'] = ''; + $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh] = ''; } - $this->fileContentStatic['###ROUTEHELPER###'] .= $this->setRouterHelp($viewName_single, $viewName_list); + $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh] .= $this->setRouterHelp($viewName_single, $viewName_list); if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) { // add needed router stuff for front edit views - $this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] .= $this->routerParseSwitch($viewName_single, null, false); - $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] .= $this->routerBuildViews($viewName_single); + $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' . $this->hhh] .= $this->routerParseSwitch($viewName_single, null, false); + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] .= $this->routerBuildViews($viewName_single); } - // ###ACCESS_SECTIONS### - if (!isset($this->fileContentStatic['###ACCESS_SECTIONS###'])) + // ACCESS_SECTIONS + if (!isset($this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh])) { - $this->fileContentStatic['###ACCESS_SECTIONS###'] = ''; + $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh] = ''; } - $this->fileContentStatic['###ACCESS_SECTIONS###'] .= $this->setAccessSectionsCategory($viewName_single, $viewName_list); + $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh] .= $this->setAccessSectionsCategory($viewName_single, $viewName_list); - // ###HELPER_EXEL### - $this->fileContentStatic['###HELPER_EXEL###'] = $this->setExelHelperMethods(); + // HELPER_EXEL + $this->fileContentStatic[$this->hhh . 'HELPER_EXEL' . $this->hhh] = $this->setExelHelperMethods(); } // setup custom_admin_views and all needed stuff for the site @@ -569,13 +569,13 @@ class Infusion extends Interpretation foreach ($this->componentData->custom_admin_views as $view) { // for single views - $this->fileContentDynamic[$view['settings']->code]['###SView###'] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code]['###sview###'] = $view['settings']->code; - $this->fileContentDynamic[$view['settings']->code]['###SVIEW###'] = $view['settings']->CODE; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sview' . $this->hhh] = $view['settings']->code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SVIEW' . $this->hhh] = $view['settings']->CODE; // for list views - $this->fileContentDynamic[$view['settings']->code]['###SViews###'] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code]['###sviews###'] = $view['settings']->code; - $this->fileContentDynamic[$view['settings']->code]['###SVIEWS###'] = $view['settings']->CODE; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SVIEWS' . $this->hhh] = $view['settings']->CODE; // add to lang array if (!isset($this->langContent[$this->lang][$this->langPrefix . '_' . $view['settings']->CODE])) { @@ -585,70 +585,70 @@ class Infusion extends Interpretation { $this->langContent[$this->lang][$this->langPrefix . '_' . $view['settings']->CODE . '_DESC'] = $view['settings']->description; } - // ###ICOMOON### <<>> - $this->fileContentDynamic[$view['settings']->code]['###ICOMOON###'] = $view['icomoon']; + // ICOMOON <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'ICOMOON' . $this->hhh] = $view['icomoon']; // set placeholders - $this->placeholders['###SView###'] = $view['settings']->Code; - $this->placeholders['###sview###'] = $view['settings']->code; - $this->placeholders['###SVIEW###'] = $view['settings']->CODE; - $this->placeholders['[[[SView]]]'] = $view['settings']->Code; - $this->placeholders['[[[sview]]]'] = $view['settings']->code; - $this->placeholders['[[[SVIEW]]]'] = $view['settings']->CODE; - $this->placeholders['###SViews###'] = $view['settings']->Code; - $this->placeholders['###sviews###'] = $view['settings']->code; - $this->placeholders['###SVIEWS###'] = $view['settings']->CODE; - $this->placeholders['[[[SViews]]]'] = $view['settings']->Code; - $this->placeholders['[[[sviews]]]'] = $view['settings']->code; - $this->placeholders['[[[SVIEWS]]]'] = $view['settings']->CODE; + $this->placeholders[$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code; + $this->placeholders[$this->hhh . 'sview' . $this->hhh] = $view['settings']->code; + $this->placeholders[$this->hhh . 'SVIEW' . $this->hhh] = $view['settings']->CODE; + $this->placeholders[$this->bbb . 'SView' . $this->ddd] = $view['settings']->Code; + $this->placeholders[$this->bbb . 'sview' . $this->ddd] = $view['settings']->code; + $this->placeholders[$this->bbb . 'SVIEW' . $this->ddd] = $view['settings']->CODE; + $this->placeholders[$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code; + $this->placeholders[$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code; + $this->placeholders[$this->hhh . 'SVIEWS' . $this->hhh] = $view['settings']->CODE; + $this->placeholders[$this->bbb . 'SViews' . $this->ddd] = $view['settings']->Code; + $this->placeholders[$this->bbb . 'sviews' . $this->ddd] = $view['settings']->code; + $this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] = $view['settings']->CODE; // set license per view if needed $this->setLockLicensePer($view['settings']->code, $this->target); if ($view['settings']->main_get->gettype == 1) { - // ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true); + // CUSTOM_ADMIN_BEFORE_GET_ITEM <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BEFORE_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true); - // ###CUSTOM_ADMIN_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEM###'] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t"); + // CUSTOM_ADMIN_GET_ITEM <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_GET_ITEM' . $this->hhh] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t"); - // ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true); + // CUSTOM_ADMIN_AFTER_GET_ITEM <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_AFTER_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true); } elseif ($view['settings']->main_get->gettype == 2) { - // ###CUSTOM_ADMIN_GET_LIST_QUERY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_LIST_QUERY###'] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code); + // CUSTOM_ADMIN_GET_LIST_QUERY <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_GET_LIST_QUERY' . $this->hhh] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code); - // ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###'] = $this->getCustomScriptBuilder($this->target . '_php_getlistquery', $view['settings']->code, PHP_EOL, null, true); + // CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_getlistquery', $view['settings']->code, PHP_EOL, null, true); - // ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true); + // CUSTOM_ADMIN_BEFORE_GET_ITEMS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BEFORE_GET_ITEMS' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true); - // ###CUSTOM_ADMIN_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEMS###'] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code); + // CUSTOM_ADMIN_GET_ITEMS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_GET_ITEMS' . $this->hhh] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code); - // ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true); + // CUSTOM_ADMIN_AFTER_GET_ITEMS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_AFTER_GET_ITEMS' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true); } - // ###CUSTOM_ADMIN_CUSTOM_METHODS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###'] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code); - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###'] .= $this->setCustomViewCustomMethods($view, $view['settings']->code); - // ###CUSTOM_ADMIN_DIPLAY_METHOD### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_DIPLAY_METHOD###'] = $this->setCustomViewDisplayMethod($view); + // CUSTOM_ADMIN_CUSTOM_METHODS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CUSTOM_METHODS' . $this->hhh] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CUSTOM_METHODS' . $this->hhh] .= $this->setCustomViewCustomMethods($view, $view['settings']->code); + // CUSTOM_ADMIN_DIPLAY_METHOD <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_DIPLAY_METHOD' . $this->hhh] = $this->setCustomViewDisplayMethod($view); // set document details $this->setPrepareDocument($view); - // ###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###'] = $this->setCustomViewExtraDisplayMethods($view); - // ###CUSTOM_ADMIN_CODE_BODY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CODE_BODY###'] = $this->setCustomViewCodeBody($view); - // ###CUSTOM_ADMIN_BODY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BODY###'] = $this->setCustomViewBody($view); - // ###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###'] = $this->setCustomViewSubmitButtonScript($view); + // CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS' . $this->hhh] = $this->setCustomViewExtraDisplayMethods($view); + // CUSTOM_ADMIN_CODE_BODY <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CODE_BODY' . $this->hhh] = $this->setCustomViewCodeBody($view); + // CUSTOM_ADMIN_BODY <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BODY' . $this->hhh] = $this->setCustomViewBody($view); + // CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT' . $this->hhh] = $this->setCustomViewSubmitButtonScript($view); // setup the templates $this->setCustomViewTemplateBody($view); @@ -658,61 +658,61 @@ class Infusion extends Interpretation $this->setCustomViewLayouts(); } - // ###VIEWARRAY### - $this->fileContentStatic['###VIEWARRAY###'] = PHP_EOL . implode("," . PHP_EOL, $viewarray); + // VIEWARRAY + $this->fileContentStatic[$this->hhh . 'VIEWARRAY' . $this->hhh] = PHP_EOL . implode("," . PHP_EOL, $viewarray); - // ###CUSTOM_ADMIN_EDIT_VIEW_ARRAY### - $this->fileContentStatic['###SITE_EDIT_VIEW_ARRAY###'] = PHP_EOL . implode("," . PHP_EOL, $site_edit_view_array); + // CUSTOM_ADMIN_EDIT_VIEW_ARRAY + $this->fileContentStatic[$this->hhh . 'SITE_EDIT_VIEW_ARRAY' . $this->hhh] = PHP_EOL . implode("," . PHP_EOL, $site_edit_view_array); - // ###MAINMENUS### - $this->fileContentStatic['###MAINMENUS###'] = $this->setMainMenus(); + // MAINMENUS + $this->fileContentStatic[$this->hhh . 'MAINMENUS' . $this->hhh] = $this->setMainMenus(); - // ###SUBMENU### - $this->fileContentStatic['###SUBMENU###'] = $this->setSubMenus(); + // SUBMENU + $this->fileContentStatic[$this->hhh . 'SUBMENU' . $this->hhh] = $this->setSubMenus(); - // ###GET_CRYPT_KEY### - $this->fileContentStatic['###GET_CRYPT_KEY###'] = $this->setGetCryptKey(); + // GET_CRYPT_KEY + $this->fileContentStatic[$this->hhh . 'GET_CRYPT_KEY' . $this->hhh] = $this->setGetCryptKey(); // set the license locker $this->setLockLicense(); - // ###CONTRIBUTORS### - $this->fileContentStatic['###CONTRIBUTORS###'] = $this->theContributors; + // CONTRIBUTORS + $this->fileContentStatic[$this->hhh . 'CONTRIBUTORS' . $this->hhh] = $this->theContributors; - // ###INSTALL### - $this->fileContentStatic['###INSTALL###'] = $this->setInstall(); + // INSTALL + $this->fileContentStatic[$this->hhh . 'INSTALL' . $this->hhh] = $this->setInstall(); - // ###UNINSTALL### - $this->fileContentStatic['###UNINSTALL###'] = $this->setUninstall(); + // UNINSTALL + $this->fileContentStatic[$this->hhh . 'UNINSTALL' . $this->hhh] = $this->setUninstall(); - // ###UPDATE_VERSION_MYSQL### + // UPDATE_VERSION_MYSQL $this->setVersionController(); // only set these if default dashboard it used if (!ComponentbuilderHelper::checkString($this->dynamicDashboard)) { - // ###DASHBOARDVIEW### - $this->fileContentStatic['###DASHBOARDVIEW###'] = $this->fileContentStatic['###component###']; + // DASHBOARDVIEW + $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]; - // ###DASHBOARDICONS### - $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASHBOARDICONS###'] = $this->setDashboardIcons(); + // DASHBOARDICONS + $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh]][$this->hhh . 'DASHBOARDICONS' . $this->hhh] = $this->setDashboardIcons(); - // ###DASHBOARDICONACCESS### - $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASHBOARDICONACCESS###'] = $this->setDashboardIconAccess(); + // DASHBOARDICONACCESS + $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh]][$this->hhh . 'DASHBOARDICONACCESS' . $this->hhh] = $this->setDashboardIconAccess(); - // ###DASH_MODEL_METHODS### - $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_MODEL_METHODS###'] = $this->setDashboardModelMethods(); + // DASH_MODEL_METHODS + $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh]][$this->hhh . 'DASH_MODEL_METHODS' . $this->hhh] = $this->setDashboardModelMethods(); - // ###DASH_GET_CUSTOM_DATA### - $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_GET_CUSTOM_DATA###'] = $this->setDashboardGetCustomData(); + // DASH_GET_CUSTOM_DATA + $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh]][$this->hhh . 'DASH_GET_CUSTOM_DATA' . $this->hhh] = $this->setDashboardGetCustomData(); - // ###DASH_DISPLAY_DATA### - $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_DISPLAY_DATA###'] = $this->setDashboardDisplayData(); + // DASH_DISPLAY_DATA + $this->fileContentDynamic[$this->fileContentStatic[$this->hhh . 'component' . $this->hhh]][$this->hhh . 'DASH_DISPLAY_DATA' . $this->hhh] = $this->setDashboardDisplayData(); } else { - // ###DASHBOARDVIEW### - $this->fileContentStatic['###DASHBOARDVIEW###'] = $this->dynamicDashboard; + // DASHBOARDVIEW + $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' . $this->hhh] = $this->dynamicDashboard; } // add import @@ -722,7 +722,7 @@ class Infusion extends Interpretation $target = array('admin' => 'import'); $this->buildDynamique($target, 'import'); // set the controller - $this->fileContentDynamic['import']['###BLABLABLA###'] = ''; + $this->fileContentDynamic['import'][$this->hhh . 'BLABLABLA' . $this->hhh] = ''; } // ensure that the ajax model and controller is set if needed @@ -732,10 +732,10 @@ class Infusion extends Interpretation $target = array('admin' => 'ajax'); $this->buildDynamique($target, 'ajax'); // set the controller - $this->fileContentDynamic['ajax']['###REGISTER_AJAX_TASK###'] = $this->setRegisterAjaxTask('admin'); - $this->fileContentDynamic['ajax']['###AJAX_INPUT_RETURN###'] = $this->setAjaxInputReturn('admin'); + $this->fileContentDynamic['ajax'][$this->hhh . 'REGISTER_AJAX_TASK' . $this->hhh] = $this->setRegisterAjaxTask('admin'); + $this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_INPUT_RETURN' . $this->hhh] = $this->setAjaxInputReturn('admin'); // set the module - $this->fileContentDynamic['ajax']['###AJAX_MODEL_METHODS###'] = $this->setAjaxModelMethods('admin'); + $this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_MODEL_METHODS' . $this->hhh] = $this->setAjaxModelMethods('admin'); } // ensure that the site ajax model and controller is set if needed @@ -745,10 +745,10 @@ class Infusion extends Interpretation $target = array('site' => 'ajax'); $this->buildDynamique($target, 'ajax'); // set the controller - $this->fileContentDynamic['ajax']['###REGISTER_SITE_AJAX_TASK###'] = $this->setRegisterAjaxTask('site'); - $this->fileContentDynamic['ajax']['###AJAX_SITE_INPUT_RETURN###'] = $this->setAjaxInputReturn('site'); + $this->fileContentDynamic['ajax'][$this->hhh . 'REGISTER_SITE_AJAX_TASK' . $this->hhh] = $this->setRegisterAjaxTask('site'); + $this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_SITE_INPUT_RETURN' . $this->hhh] = $this->setAjaxInputReturn('site'); // set the module - $this->fileContentDynamic['ajax']['###AJAX_SITE_MODEL_METHODS###'] = $this->setAjaxModelMethods('site'); + $this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_SITE_MODEL_METHODS' . $this->hhh] = $this->setAjaxModelMethods('site'); } // build the validation rules @@ -760,9 +760,9 @@ class Infusion extends Interpretation $target = array('admin' => 'a_rule_zi'); $this->buildDynamique($target, 'rule', $rule); // set the JFormRule Name - $this->fileContentDynamic['a_rule_zi_' . $rule]['###Name###'] = ucfirst($rule); + $this->fileContentDynamic['a_rule_zi_' . $rule][$this->hhh . 'Name' . $this->hhh] = ucfirst($rule); // set the JFormRule PHP - $this->fileContentDynamic['a_rule_zi_' . $rule]['###VALIDATION_RULE_METHODS###'] = PHP_EOL . $_php; + $this->fileContentDynamic['a_rule_zi_' . $rule][$this->hhh . 'VALIDATION_RULE_METHODS' . $this->hhh] = PHP_EOL . $_php; } } @@ -782,7 +782,7 @@ class Infusion extends Interpretation } } - // ###CONFIG_FIELDSETS### + // CONFIG_FIELDSETS $keepLang = $this->lang; $this->lang = 'admin'; // run field sets for second time @@ -798,25 +798,25 @@ class Infusion extends Interpretation foreach ($this->componentData->site_views as $view) { // for list views - $this->fileContentDynamic[$view['settings']->code]['###SViews###'] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code]['###sviews###'] = $view['settings']->code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code; // for single views - $this->fileContentDynamic[$view['settings']->code]['###SView###'] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code]['###sview###'] = $view['settings']->code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sview' . $this->hhh] = $view['settings']->code; // set placeholder - $this->placeholders['###SView###'] = $view['settings']->Code; - $this->placeholders['###sview###'] = $view['settings']->code; - $this->placeholders['###SVIEW###'] = $view['settings']->CODE; - $this->placeholders['[[[SView]]]'] = $view['settings']->Code; - $this->placeholders['[[[sview]]]'] = $view['settings']->code; - $this->placeholders['[[[SVIEW]]]'] = $view['settings']->CODE; - $this->placeholders['###SViews###'] = $view['settings']->Code; - $this->placeholders['###sviews###'] = $view['settings']->code; - $this->placeholders['###SVIEWS###'] = $view['settings']->CODE; - $this->placeholders['[[[SViews]]]'] = $view['settings']->Code; - $this->placeholders['[[[sviews]]]'] = $view['settings']->code; - $this->placeholders['[[[SVIEWS]]]'] = $view['settings']->CODE; + $this->placeholders[$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code; + $this->placeholders[$this->hhh . 'sview' . $this->hhh] = $view['settings']->code; + $this->placeholders[$this->hhh . 'SVIEW' . $this->hhh] = $view['settings']->CODE; + $this->placeholders[$this->bbb . 'SView' . $this->ddd] = $view['settings']->Code; + $this->placeholders[$this->bbb . 'sview' . $this->ddd] = $view['settings']->code; + $this->placeholders[$this->bbb . 'SVIEW' . $this->ddd] = $view['settings']->CODE; + $this->placeholders[$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code; + $this->placeholders[$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code; + $this->placeholders[$this->hhh . 'SVIEWS' . $this->hhh] = $view['settings']->CODE; + $this->placeholders[$this->bbb . 'SViews' . $this->ddd] = $view['settings']->Code; + $this->placeholders[$this->bbb . 'sviews' . $this->ddd] = $view['settings']->code; + $this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] = $view['settings']->CODE; // set license per view if needed $this->setLockLicensePer($view['settings']->code, $this->target); @@ -824,50 +824,50 @@ class Infusion extends Interpretation // set the site default view if (isset($view['default_view']) && $view['default_view'] == 1) { - $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] = $view['settings']->code; + $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] = $view['settings']->code; } // add site menu if (isset($view['menu']) && $view['menu'] == 1) { - // ###SITE_MENU_XML### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_MENU_XML###'] = $this->setCustomViewMenu($view); + // SITE_MENU_XML <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_MENU_XML' . $this->hhh] = $this->setCustomViewMenu($view); } // insure the needed route helper is loaded - $this->fileContentStatic['###ROUTEHELPER###'] .= $this->setRouterHelp($view['settings']->code, $view['settings']->code, true); + $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh] .= $this->setRouterHelp($view['settings']->code, $view['settings']->code, true); // build route details - $this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] .= $this->routerParseSwitch($view['settings']->code, $view); - $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] .= $this->routerBuildViews($view['settings']->code); + $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' . $this->hhh] .= $this->routerParseSwitch($view['settings']->code, $view); + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] .= $this->routerBuildViews($view['settings']->code); if ($view['settings']->main_get->gettype == 1) { - // set user permission access check ###USER_PERMISSION_CHECK_ACCESS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###'] = $this->setUserPermissionCheckAccess($view, 1); + // set user permission access check USER_PERMISSION_CHECK_ACCESS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'USER_PERMISSION_CHECK_ACCESS' . $this->hhh] = $this->setUserPermissionCheckAccess($view, 1); - // ###SITE_BEFORE_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true); + // SITE_BEFORE_GET_ITEM <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BEFORE_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true); - // ###SITE_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEM###'] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t"); + // SITE_GET_ITEM <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_GET_ITEM' . $this->hhh] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t"); - // ###SITE_AFTER_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true); + // SITE_AFTER_GET_ITEM <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_AFTER_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true); } elseif ($view['settings']->main_get->gettype == 2) { - // set user permission access check ###USER_PERMISSION_CHECK_ACCESS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###'] = $this->setUserPermissionCheckAccess($view, 2); - // ###SITE_GET_LIST_QUERY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_GET_LIST_QUERY###'] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code); + // set user permission access check USER_PERMISSION_CHECK_ACCESS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'USER_PERMISSION_CHECK_ACCESS' . $this->hhh] = $this->setUserPermissionCheckAccess($view, 2); + // SITE_GET_LIST_QUERY <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_GET_LIST_QUERY' . $this->hhh] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code); - // ###SITE_BEFORE_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true); + // SITE_BEFORE_GET_ITEMS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BEFORE_GET_ITEMS' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true); - // ###SITE_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEMS###'] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code); + // SITE_GET_ITEMS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_GET_ITEMS' . $this->hhh] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code); - // ###SITE_AFTER_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true); + // SITE_AFTER_GET_ITEMS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_AFTER_GET_ITEMS' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true); } // add to lang array if (!isset($this->langContent['site'][$this->langPrefix . '_' . $view['settings']->CODE])) @@ -878,48 +878,48 @@ class Infusion extends Interpretation { $this->langContent['site'][$this->langPrefix . '_' . $view['settings']->CODE . '_DESC'] = $view['settings']->description; } - // ###SITE_CUSTOM_METHODS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###'] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code); - $this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###'] .= $this->setCustomViewCustomMethods($view, $view['settings']->code); - // ###SITE_DIPLAY_METHOD### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_DIPLAY_METHOD###'] = $this->setCustomViewDisplayMethod($view); + // SITE_CUSTOM_METHODS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_CUSTOM_METHODS' . $this->hhh] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_CUSTOM_METHODS' . $this->hhh] .= $this->setCustomViewCustomMethods($view, $view['settings']->code); + // SITE_DIPLAY_METHOD <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_DIPLAY_METHOD' . $this->hhh] = $this->setCustomViewDisplayMethod($view); // set document details $this->setPrepareDocument($view); - // ###SITE_EXTRA_DIPLAY_METHODS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_EXTRA_DIPLAY_METHODS###'] = $this->setCustomViewExtraDisplayMethods($view); - // ###SITE_CODE_BODY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_CODE_BODY###'] = $this->setCustomViewCodeBody($view); - // ###SITE_BODY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_BODY###'] = $this->setCustomViewBody($view); + // SITE_EXTRA_DIPLAY_METHODS <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_EXTRA_DIPLAY_METHODS' . $this->hhh] = $this->setCustomViewExtraDisplayMethods($view); + // SITE_CODE_BODY <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_CODE_BODY' . $this->hhh] = $this->setCustomViewCodeBody($view); + // SITE_BODY <<>> + $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BODY' . $this->hhh] = $this->setCustomViewBody($view); // setup the templates $this->setCustomViewTemplateBody($view); } // if no default site view was set, the redirect to root - if (!isset($this->fileContentStatic['###SITE_DEFAULT_VIEW###'])) + if (!isset($this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh])) { - $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] = ''; + $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] = ''; } // set site custom script to helper class - // ###SITE_CUSTOM_HELPER_SCRIPT### - $this->fileContentStatic['###SITE_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_site'], $this->placeholders); - // ###SITE_GLOBAL_EVENT_HELPER### - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = ''; - // ###SITE_GLOBAL_EVENT### - $this->fileContentStatic['###SITE_GLOBAL_EVENT###'] = ''; + // SITE_CUSTOM_HELPER_SCRIPT + $this->fileContentStatic[$this->hhh . 'SITE_CUSTOM_HELPER_SCRIPT' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_site'], $this->placeholders); + // SITE_GLOBAL_EVENT_HELPER + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] = ''; + // SITE_GLOBAL_EVENT + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] = ''; // now load the data for the global event if needed if ($this->componentData->add_site_event == 1) { - $this->fileContentStatic['###SITE_GLOBAL_EVENT###'] = PHP_EOL . PHP_EOL . '// Triger the Global Site Event'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT###'] .= PHP_EOL . $this->fileContentStatic['###Component###'] . 'Helper::globalEvent($document);'; - // ###SITE_GLOBAL_EVENT_HELPER### - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = PHP_EOL . PHP_EOL . "\t" . '/**'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '* The Global Site Event Method.'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '**/'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . 'public static function globalEvent($document)'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '{'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders); - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '}'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] = PHP_EOL . PHP_EOL . '// Triger the Global Site Event'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] .= PHP_EOL . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::globalEvent($document);'; + // SITE_GLOBAL_EVENT_HELPER + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] = PHP_EOL . PHP_EOL . "\t" . '/**'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '* The Global Site Event Method.'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '**/'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . 'public static function globalEvent($document)'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '{'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders); + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . "\t" . '}'; } // setup the layouts $this->setCustomViewLayouts(); @@ -930,47 +930,47 @@ class Infusion extends Interpretation $this->removeSiteFolder = true; } - // ###PREINSTALLSCRIPT### - $this->fileContentStatic['###PREINSTALLSCRIPT###'] = $this->getCustomScriptBuilder('php_preflight', 'install', PHP_EOL, null, true); + // PREINSTALLSCRIPT + $this->fileContentStatic[$this->hhh . 'PREINSTALLSCRIPT' . $this->hhh] = $this->getCustomScriptBuilder('php_preflight', 'install', PHP_EOL, null, true); - // ###PREUPDATESCRIPT### - $this->fileContentStatic['###PREUPDATESCRIPT###'] = $this->getCustomScriptBuilder('php_preflight', 'update', PHP_EOL, null, true); + // PREUPDATESCRIPT + $this->fileContentStatic[$this->hhh . 'PREUPDATESCRIPT' . $this->hhh] = $this->getCustomScriptBuilder('php_preflight', 'update', PHP_EOL, null, true); - // ###POSTINSTALLSCRIPT### - $this->fileContentStatic['###POSTINSTALLSCRIPT###'] = $this->setPostInstallScript(); + // POSTINSTALLSCRIPT + $this->fileContentStatic[$this->hhh . 'POSTINSTALLSCRIPT' . $this->hhh] = $this->setPostInstallScript(); - // ###POSTUPDATESCRIPT### - $this->fileContentStatic['###POSTUPDATESCRIPT###'] = $this->setPostUpdateScript(); + // POSTUPDATESCRIPT + $this->fileContentStatic[$this->hhh . 'POSTUPDATESCRIPT' . $this->hhh] = $this->setPostUpdateScript(); - // ###UNINSTALLSCRIPT### - $this->fileContentStatic['###UNINSTALLSCRIPT###'] = $this->setUninstallScript(); + // UNINSTALLSCRIPT + $this->fileContentStatic[$this->hhh . 'UNINSTALLSCRIPT' . $this->hhh] = $this->setUninstallScript(); - // ###MOVEFOLDERSSCRIPT### - $this->fileContentStatic['###MOVEFOLDERSSCRIPT###'] = $this->setMoveFolderScript(); + // MOVEFOLDERSSCRIPT + $this->fileContentStatic[$this->hhh . 'MOVEFOLDERSSCRIPT' . $this->hhh] = $this->setMoveFolderScript(); - // ###MOVEFOLDERSMETHOD### - $this->fileContentStatic['###MOVEFOLDERSMETHOD###'] = $this->setMoveFolderMethod(); + // MOVEFOLDERSMETHOD + $this->fileContentStatic[$this->hhh . 'MOVEFOLDERSMETHOD' . $this->hhh] = $this->setMoveFolderMethod(); - // ###HELPER_UIKIT### - $this->fileContentStatic['###HELPER_UIKIT###'] = $this->setUikitHelperMethods(); + // HELPER_UIKIT + $this->fileContentStatic[$this->hhh . 'HELPER_UIKIT' . $this->hhh] = $this->setUikitHelperMethods(); - // ###CONFIG_FIELDSETS### - $this->fileContentStatic['###CONFIG_FIELDSETS###'] = implode(PHP_EOL, $this->configFieldSets); + // CONFIG_FIELDSETS + $this->fileContentStatic[$this->hhh . 'CONFIG_FIELDSETS' . $this->hhh] = implode(PHP_EOL, $this->configFieldSets); // check if this has been set - if (!isset($this->fileContentStatic['###ROUTER_BUILD_VIEWS###']) || !ComponentbuilderHelper::checkString($this->fileContentStatic['###ROUTER_BUILD_VIEWS###'])) + if (!isset($this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh]) || !ComponentbuilderHelper::checkString($this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh])) { - $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] = 0; + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] = 0; } else { - $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] = '(' . $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] . ')'; + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] = '(' . $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] . ')'; } - // ###README### + // README if ($this->componentData->addreadme) { - $this->fileContentStatic['###README###'] = $this->componentData->readme; + $this->fileContentStatic[$this->hhh . 'README' . $this->hhh] = $this->componentData->readme; } return true; } @@ -989,7 +989,7 @@ class Infusion extends Interpretation // just to be safe, lets clear previous view placeholders $this->clearFromPlaceHolders('view'); - // ###VIEW### <<>> + // VIEW <<>> if (isset($view->name_single)) { // set main keys @@ -998,15 +998,15 @@ class Infusion extends Interpretation $viewName_f = ComponentbuilderHelper::safeString($view->name_single, 'F'); // set some place holder for the views - $this->placeholders['###view###'] = $viewName_single; - $this->placeholders['###View###'] = $viewName_f; - $this->placeholders['###VIEW###'] = $viewName_u; - $this->placeholders['[[[view]]]'] = $viewName_single; - $this->placeholders['[[[View]]]'] = $viewName_f; - $this->placeholders['[[[VIEW]]]'] = $viewName_u; + $this->placeholders[$this->hhh . 'view' . $this->hhh] = $viewName_single; + $this->placeholders[$this->hhh . 'View' . $this->hhh] = $viewName_f; + $this->placeholders[$this->hhh . 'VIEW' . $this->hhh] = $viewName_u; + $this->placeholders[$this->bbb . 'view' . $this->ddd] = $viewName_single; + $this->placeholders[$this->bbb . 'View' . $this->ddd] = $viewName_f; + $this->placeholders[$this->bbb . 'VIEW' . $this->ddd] = $viewName_u; } - // ###VIEWS### <<>> + // VIEWS <<>> if (isset($view->name_list)) { $viewName_list = ComponentbuilderHelper::safeString($view->name_list); @@ -1014,41 +1014,41 @@ class Infusion extends Interpretation $viewsName_f = ComponentbuilderHelper::safeString($view->name_list, 'F'); // set some place holder for the views - $this->placeholders['###views###'] = $viewName_list; - $this->placeholders['###Views###'] = $viewsName_f; - $this->placeholders['###VIEWS###'] = $viewsName_u; - $this->placeholders['[[[views]]]'] = $viewName_list; - $this->placeholders['[[[Views]]]'] = $viewsName_f; - $this->placeholders['[[[VIEWS]]]'] = $viewsName_u; + $this->placeholders[$this->hhh . 'views' . $this->hhh] = $viewName_list; + $this->placeholders[$this->hhh . 'Views' . $this->hhh] = $viewsName_f; + $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] = $viewsName_u; + $this->placeholders[$this->bbb . 'views' . $this->ddd] = $viewName_list; + $this->placeholders[$this->bbb . 'Views' . $this->ddd] = $viewsName_f; + $this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] = $viewsName_u; } - // ###view### <<>> + // view <<>> if (isset($viewName_single)) { - $this->fileContentDynamic[$viewName_single]['###view###'] = $viewName_single; - $this->fileContentDynamic[$viewName_single]['###VIEW###'] = $viewName_u; - $this->fileContentDynamic[$viewName_single]['###View###'] = $viewName_f; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'view' . $this->hhh] = $viewName_single; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEW' . $this->hhh] = $viewName_u; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'View' . $this->hhh] = $viewName_f; if (isset($viewName_list)) { - $this->fileContentDynamic[$viewName_list]['###view###'] = $viewName_single; - $this->fileContentDynamic[$viewName_list]['###VIEW###'] = $viewName_u; - $this->fileContentDynamic[$viewName_list]['###View###'] = $viewName_f; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'view' . $this->hhh] = $viewName_single; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEW' . $this->hhh] = $viewName_u; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'View' . $this->hhh] = $viewName_f; } } - // ###views### <<>> + // views <<>> if (isset($viewName_list)) { - $this->fileContentDynamic[$viewName_list]['###views###'] = $viewName_list; - $this->fileContentDynamic[$viewName_list]['###VIEWS###'] = $viewsName_u; - $this->fileContentDynamic[$viewName_list]['###Views###'] = $viewsName_f; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'views' . $this->hhh] = $viewName_list; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWS' . $this->hhh] = $viewsName_u; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'Views' . $this->hhh] = $viewsName_f; if (isset($viewName_single)) { - $this->fileContentDynamic[$viewName_single]['###views###'] = $viewName_list; - $this->fileContentDynamic[$viewName_single]['###VIEWS###'] = $viewsName_u; - $this->fileContentDynamic[$viewName_single]['###Views###'] = $viewsName_f; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'views' . $this->hhh] = $viewName_list; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWS' . $this->hhh] = $viewsName_u; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'Views' . $this->hhh] = $viewsName_f; } } } @@ -1179,14 +1179,14 @@ class Infusion extends Interpretation $replace = array(); if (isset($langXML['admin']) && ComponentbuilderHelper::checkArray($langXML['admin'])) { - $replace['###ADMIN_LANGUAGES###'] = implode(PHP_EOL . "\t\t\t", $langXML['admin']); + $replace[$this->hhh . 'ADMIN_LANGUAGES' . $this->hhh] = implode(PHP_EOL . "\t\t\t", $langXML['admin']); } if (!$this->removeSiteFolder && isset($langXML['site']) && ComponentbuilderHelper::checkArray($langXML['site'])) { - $replace['###SITE_LANGUAGES###'] = implode(PHP_EOL . "\t\t", $langXML['site']); + $replace[$this->hhh . 'SITE_LANGUAGES' . $this->hhh] = implode(PHP_EOL . "\t\t", $langXML['site']); } // build xml path - $xmlPath = $this->componentPath . '/' . $this->fileContentStatic['###component###'] . '.xml'; + $xmlPath = $this->componentPath . '/' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.xml'; // get the content in xml $componentXML = ComponentbuilderHelper::getFileContents($xmlPath); // update the xml content diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 7068e8932..4b2dcaaaf 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -3085,15 +3085,15 @@ abstract class ComponentbuilderHelper } /** - * Move File to Server - * - * @param string $localPath The local path to the file - * @param string $fileName The the actual file name - * @param int $serverID The server local id to use - * @param int $protocol The server protocol to use - * @param string $permission The permission validation area - * - * @return bool true on success + * Move File to Server + * + * @param string $localPath The local path to the file + * @param string $fileName The the actual file name + * @param int $serverID The server local id to use + * @param int $protocol The server protocol to use + * @param string $permission The permission validation area + * + * @return bool true on success **/ public static function moveToServer($localPath, $fileName, $serverID, $protocol = null, $permission = 'core.export') { @@ -3128,23 +3128,23 @@ abstract class ComponentbuilderHelper } /** - * the SFTP objects + * the SFTP objects **/ protected static $sftp = array(); /** - * the FTP objects + * the FTP objects **/ protected static $ftp = array(); /** - * get the server object - * - * @param int $serverID The server local id to use - * @param int $protocol The server protocol to use - * @param string $permission The permission validation area - * - * @return object on success server object + * get the server object + * + * @param int $serverID The server local id to use + * @param int $protocol The server protocol to use + * @param string $permission The permission validation area + * + * @return object on success server object **/ public static function getServer($serverID, $protocol = null, $permission = 'core.export') { @@ -3167,12 +3167,12 @@ abstract class ComponentbuilderHelper } /** - * get the sftp object - * - * @param int $serverID The server local id to use - * @param string $permission The permission validation area - * - * @return object on success with sftp power + * get the sftp object + * + * @param int $serverID The server local id to use + * @param string $permission The permission validation area + * + * @return object on success with sftp power **/ public static function getSftp($serverID, $permission = 'core.export') { @@ -3326,12 +3326,12 @@ abstract class ComponentbuilderHelper } /** - * get the JClientFtp object - * - * @param int $serverID The server local id to use - * @param string $permission The permission validation area - * - * @return object on success with ftp power + * get the JClientFtp object + * + * @param int $serverID The server local id to use + * @param string $permission The permission validation area + * + * @return object on success with ftp power **/ public static function getFtp($serverID, $permission) { @@ -3417,13 +3417,13 @@ abstract class ComponentbuilderHelper } /** - * get the server details - * - * @param int $serverID The server local id to use - * @param int $protocol The server protocol to use - * @param string $permission The permission validation area - * - * @return object on success with server details + * get the server details + * + * @param int $serverID The server local id to use + * @param int $protocol The server protocol to use + * @param string $permission The permission validation area + * + * @return object on success with server details **/ public static function getServerDetails($serverID, $protocol = 2, $permission = 'core.export') { diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index b73c76453..ec882ac9e 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -94,6 +94,46 @@ COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNFEATURED="%s Admins Fields unfeatur COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNFEATURED_1="%s Admin Fields unfeatured." COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNPUBLISHED="%s Admins Fields unpublished." COM_COMPONENTBUILDER_ADMINS_FIELDS_N_ITEMS_UNPUBLISHED_1="%s Admin Fields unpublished." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS="Admins Fields Relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS="Admins Fields Relations Access" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC="Allows the users in this group to access access admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_OPTIONS="Batch process the selected Admins Fields Relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_TIP="All changes will be applied to all selected Admins Fields Relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE="Admins Fields Relations Batch Use" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE="Admins Fields Relations Create" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC="Allows the users in this group to create create admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE="Admins Fields Relations Delete" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC="Allows the users in this group to delete delete admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT="Admins Fields Relations Edit" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY="Admins Fields Relations Edit Created By" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE="Admins Fields Relations Edit Created Date" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC="Allows the users in this group to edit the admin fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN="Admins Fields Relations Edit Own" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC="Allows the users in this group to edit edit own admins fields relations created by them" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE="Admins Fields Relations Edit State" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC="Allows the users in this group to update the state of the admin fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION="Admins Fields Relations Edit Version" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_ARCHIVED="%s Admins Fields Relations archived." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_ARCHIVED_1="%s Admin Fields Relations archived." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_CHECKED_IN_0="No Admin Fields Relations successfully checked in." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_CHECKED_IN_1="%d Admin Fields Relations successfully checked in." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_CHECKED_IN_MORE="%d Admins Fields Relations successfully checked in." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_DELETED="%s Admins Fields Relations deleted." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_DELETED_1="%s Admin Fields Relations deleted." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_FEATURED="%s Admins Fields Relations featured." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_FEATURED_1="%s Admin Fields Relations featured." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_PUBLISHED="%s Admins Fields Relations published." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_PUBLISHED_1="%s Admin Fields Relations published." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_TRASHED="%s Admins Fields Relations trashed." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_TRASHED_1="%s Admin Fields Relations trashed." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNFEATURED="%s Admins Fields Relations unfeatured." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNFEATURED_1="%s Admin Fields Relations unfeatured." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNPUBLISHED="%s Admins Fields Relations unpublished." +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_N_ITEMS_UNPUBLISHED_1="%s Admin Fields Relations unpublished." COM_COMPONENTBUILDER_ADMIN_BEHAVIOUR="Admin Behaviour" COM_COMPONENTBUILDER_ADMIN_FIELDS="Admin Fields" COM_COMPONENTBUILDER_ADMIN_FIELDS_ABOVE_TABS="Above Tabs" @@ -110,7 +150,7 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_ALIGNMENT_LABEL="Alignment" COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS="Admin Fields Conditions" COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ACTIVE_ONLY_FOUR_TEXT_FIELD="Active (only 4 text_field)" COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS="Addconditions" -COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_DESCRIPTION="Conditional setup for the above fields." +COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_DESCRIPTION="Conditional setup for the fields behaviour." COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_LABEL="Conditions" COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW="Admin View" COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW_DESCRIPTION="Select an admin view" @@ -148,7 +188,7 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_BY_LABEL="Modified By" COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_DATE_DESC="The date this Admin Fields Conditions was modified." COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_DATE_LABEL="Modified Date" COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NEW="A New Admin Fields Conditions" -COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NOTE_ON_CONDITIONS_DESCRIPTION="Here you can add conditional field settings" +COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NOTE_ON_CONDITIONS_DESCRIPTION="Here you can add conditional settings" COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NOTE_ON_CONDITIONS_LABEL="Condition Implementation" COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_PERMISSION="Permissions" @@ -206,6 +246,47 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION="Permissions" COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_DESCRIPTION="What permission to use." COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_LABEL="Permissions" COM_COMPONENTBUILDER_ADMIN_FIELDS_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS="Admin Fields Relations" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS="Addrelations" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS_DESCRIPTION="Relations setup for the the field combination." +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADDRELATIONS_LABEL="Relations" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW="Admin View" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_DESCRIPTION="Select an admin view" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_LABEL="View" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CONCATENATE="Concatenate" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_BY_DESC="The user that created this Admin Fields Relations." +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_BY_LABEL="Created By" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_DATE_DESC="The date this Admin Fields Relations was created." +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_DATE_LABEL="Created Date" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CUSTOM_CODE="Custom Code" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT="Editing the Admin Fields Relations" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ERROR_UNIQUE_ALIAS="Another Admin Fields Relations has the same alias." +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ID="Id" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS="Joinfields" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS_DESCRIPTION="Select the target join fields." +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS_LABEL="Join Field" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOIN_TYPE_LABEL="Join Type" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD="Listfield" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_DESCRIPTION="Select the target list field." +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_LISTFIELD_LABEL="List Field" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_DESC="The last user that modified this Admin Fields Relations." +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_BY_LABEL="Modified By" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_DATE_DESC="The date this Admin Fields Relations was modified." +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODIFIED_DATE_LABEL="Modified Date" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW="A New Admin Fields Relations" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NOTE_ON_RELATIONS_DESCRIPTION="

Here you are able to combine/join multiple fields into one for display in the list view of the admin area.

You are able to add calculations, or even model the values into one result.

" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NOTE_ON_RELATIONS_LABEL="Relations Implementation" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ORDERING_LABEL="Ordering" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PERMISSION="Permissions" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_RELATIONS="Relations" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Admin Fields Relations to customise the alias." +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_DESCRIPTION="Glue/Code" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_HINT="Glue/Code" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_SET_LABEL="Set" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_STATUS="Status" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VERSION_DESC="A count of the number of times this Admin Fields Relations has been revised." +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VERSION_LABEL="Revision" COM_COMPONENTBUILDER_ADMIN_FIELDS_RIGHT_IN_TAB="Right in Tab" COM_COMPONENTBUILDER_ADMIN_FIELDS_RIGHT_OF_TABS="Right of Tabs" COM_COMPONENTBUILDER_ADMIN_FIELDS_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Admin Fields to customise the alias." @@ -472,7 +553,7 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_EYE_CLOSE="Eye Close" COM_COMPONENTBUILDER_ADMIN_VIEW_EYE_OPEN="Eye Open" COM_COMPONENTBUILDER_ADMIN_VIEW_FEATURED="Featured" COM_COMPONENTBUILDER_ADMIN_VIEW_FEED="Feed" -COM_COMPONENTBUILDER_ADMIN_VIEW_FIELDS_CONDITIONS="Fields & Conditions" +COM_COMPONENTBUILDER_ADMIN_VIEW_FIELDS="Fields" COM_COMPONENTBUILDER_ADMIN_VIEW_FILE="File" COM_COMPONENTBUILDER_ADMIN_VIEW_FILE_ADD="File Add" COM_COMPONENTBUILDER_ADMIN_VIEW_FILE_CHECK="File Check" @@ -615,7 +696,15 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ALIAS_BUILDER_DEFAULT_LABEL="Default Alias COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_DESCRIPTION="

Please do not change this area unless you would like to add special import to this view that goes beyond the default import concept that Component Builder already does automatic if this view is set to have import & export in the component area where this view is linked to the component.

" COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_LABEL="Beginners notice." COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_BUTTONS_DESCRIPTION="Some Shortcut Buttons
" -COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_DISPLAY_DESCRIPTION="

Linked Fields

Display of the fields will load here!

Field Conditions

Display of the fields conditions will load here!
" +COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_DISPLAY_DESCRIPTION="
+

Linked Fields

+
Display of the fields will load here!
+
+

Field Relations

+
Display of the fields relations will load here!
+
+

Field Conditions

+
Display of the fields conditions will load here!
" COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_NOTICE_DESCRIPTION="
Welcome to the new improved fields and conditions layout.

We had to remove the repeatable fields layouts since Joomla has depreciated it. With this new improved layout we trust your experience will be better then ever before.

You can still watch the tutorials, and though it was made during the time repeatable fields were still being used, the various concepts and layouts still look mostly the same.

" COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_NOTICE_LABEL="Fields & Conditions" COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_LINKED_TO_NOTICE_DESCRIPTION="
Searching the database.
" @@ -2210,6 +2299,7 @@ COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_MESSAGE="Error! Please add some t COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE="Version Update" COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE_DESCRIPTION="Add Version Updates Here!" COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE_LABEL="Version Updates" +COM_COMPONENTBUILDER_CONCATENATE="Concatenate" COM_COMPONENTBUILDER_CONDITIONS="Conditions" COM_COMPONENTBUILDER_CONFIG_ACTIVE="Active" COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_DESCRIPTION="Would you like to add a prefix to the Joomla menu name of your components" @@ -3640,6 +3730,7 @@ COM_COMPONENTBUILDER_EDIT_S="Edit %s" COM_COMPONENTBUILDER_EDIT_S_FOR_THIS_S="Edit %s for this %s" COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS="Edit the admin fields" COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_CONDITIONS="Edit the admin fields conditions" +COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_RELATIONS="Edit the admin fields relations" COM_COMPONENTBUILDER_EDIT_VERSIONS="Edit Version" COM_COMPONENTBUILDER_EDIT_VERSIONS_DESC=" Allows users in this group to edit versions." COM_COMPONENTBUILDER_EMAIL="Email" @@ -4090,6 +4181,7 @@ COM_COMPONENTBUILDER_GET_SNIPPETS_TEMPLATES_BUTTON_ACCESS_DESC=" Allows the user COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY="Get the snippet from gitHub and install it locally" COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION="Get the snippet from gitHub and update the local version" COM_COMPONENTBUILDER_GLOBAL="Global" +COM_COMPONENTBUILDER_GLUECODE="Glue/Code" COM_COMPONENTBUILDER_GREAT_THIS_FUNCTION_NAME_WILL_WORK="Great, this function name will work!" COM_COMPONENTBUILDER_GREAT_THIS_VALIDATION_RULE_NAME_S_WILL_WORK="Great, this validation rule name (%s) will work!" COM_COMPONENTBUILDER_HAS_METADATA="Has Metadata" @@ -4279,6 +4371,8 @@ COM_COMPONENTBUILDER_JCB_COMMUNITY_PACKAGES="JCB Community Packages" COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS="JCB Community Snippets" COM_COMPONENTBUILDER_JCB_PACKAGE_IMPORT="JCB Package Import" COM_COMPONENTBUILDER_JCB_PACKAGE_INFO_PATH_DOES_NOT_WORK_WE_ADVICE_YOU_BNOT_TO_CONTINUEB_WITH_THE_IMPORT_OF_THE_SELECTED_PACKAGE="JCB Package info path does not work, we advice you not to continue with the import of the selected package!" +COM_COMPONENTBUILDER_JOIN_FIELDS="Join Fields" +COM_COMPONENTBUILDER_JOIN_TYPE="Join Type" COM_COMPONENTBUILDER_JOOMLA_COMPONENT="Joomla Component" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS="Joomla Components" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS="Joomla Components Access" @@ -5412,6 +5506,7 @@ COM_COMPONENTBUILDER_LICENSE_S="License: %s" COM_COMPONENTBUILDER_LINK="Link" COM_COMPONENTBUILDER_LINK_LOCAL_DYNAMIC="Link & Local (dynamic)" COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR="Link to the contributor" +COM_COMPONENTBUILDER_LIST_FIELD="List Field" COM_COMPONENTBUILDER_LOADING="loading" COM_COMPONENTBUILDER_LOCAL="Local" COM_COMPONENTBUILDER_LOCAL_GET="Local (get)" diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini index 356a5dbdc..686db9838 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini @@ -39,6 +39,26 @@ COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE="Admins Fields Edit State" COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_STATE_DESC="Allows the users in this group to update the state of the admin fields" COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION="Admins Fields Edit Version" COM_COMPONENTBUILDER_ADMINS_FIELDS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version admins fields" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS="Admins Fields Relations Access" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_ACCESS_DESC="Allows the users in this group to access access admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE="Admins Fields Relations Batch Use" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE="Admins Fields Relations Create" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_CREATE_DESC="Allows the users in this group to create create admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE="Admins Fields Relations Delete" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_DELETE_DESC="Allows the users in this group to delete delete admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT="Admins Fields Relations Edit" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY="Admins Fields Relations Edit Created By" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE="Admins Fields Relations Edit Created Date" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created admins fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_DESC="Allows the users in this group to edit the admin fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN="Admins Fields Relations Edit Own" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_OWN_DESC="Allows the users in this group to edit edit own admins fields relations created by them" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE="Admins Fields Relations Edit State" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_STATE_DESC="Allows the users in this group to update the state of the admin fields relations" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION="Admins Fields Relations Edit Version" +COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version admins fields relations" COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS="Admin Views Access" COM_COMPONENTBUILDER_ADMIN_VIEWS_ACCESS_DESC="Allows the users in this group to access access admin views" COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_USE="Admin Views Batch Use" diff --git a/admin/layouts/admin_fields_relations/index.html b/admin/layouts/admin_fields_relations/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/layouts/admin_fields_relations/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/layouts/admin_fields_relations/publishing.php b/admin/layouts/admin_fields_relations/publishing.php new file mode 100644 index 000000000..fbd856376 --- /dev/null +++ b/admin/layouts/admin_fields_relations/publishing.php @@ -0,0 +1,44 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +$app = JFactory::getApplication(); +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'created', + 'created_by', + 'modified', + 'modified_by' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +foreach ($fields as $field) +{ + $field = is_array($field) ? $field : array($field); + foreach ($field as $f) + { + if ($form->getField($f)) + { + if (in_array($f, $hiddenFields)) + { + $form->setFieldAttribute($f, 'type', 'hidden'); + } + + echo $form->renderField($f); + break; + } + } +} diff --git a/admin/layouts/admin_fields_relations/publlshing.php b/admin/layouts/admin_fields_relations/publlshing.php new file mode 100644 index 000000000..37b1fd658 --- /dev/null +++ b/admin/layouts/admin_fields_relations/publlshing.php @@ -0,0 +1,46 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +$app = JFactory::getApplication(); +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'published', + 'ordering', + 'access', + 'version', + 'hits', + 'id' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +foreach ($fields as $field) +{ + $field = is_array($field) ? $field : array($field); + foreach ($field as $f) + { + if ($form->getField($f)) + { + if (in_array($f, $hiddenFields)) + { + $form->setFieldAttribute($f, 'type', 'hidden'); + } + + echo $form->renderField($f); + break; + } + } +} diff --git a/admin/layouts/admin_fields_relations/relations_above.php b/admin/layouts/admin_fields_relations/relations_above.php new file mode 100644 index 000000000..bef00dee1 --- /dev/null +++ b/admin/layouts/admin_fields_relations/relations_above.php @@ -0,0 +1,27 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +$form = $displayData->getForm(); + +$fields = array( + 'admin_view' +); + +?> +
+ renderField($field); + } ?> +
diff --git a/admin/layouts/admin_fields_relations/relations_fullwidth.php b/admin/layouts/admin_fields_relations/relations_fullwidth.php new file mode 100644 index 000000000..2a6eff36f --- /dev/null +++ b/admin/layouts/admin_fields_relations/relations_fullwidth.php @@ -0,0 +1,35 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'note_on_relations', + 'addrelations' +); + +?> +
+ +
+
+ getLabel($field); ?> +
+
+ getInput($field); ?> +
+
+ +
diff --git a/admin/layouts/admin_view/fields_conditions_fullwidth.php b/admin/layouts/admin_view/fields_fullwidth.php similarity index 100% rename from admin/layouts/admin_view/fields_conditions_fullwidth.php rename to admin/layouts/admin_view/fields_fullwidth.php diff --git a/admin/layouts/admin_view/fields_conditions_left.php b/admin/layouts/admin_view/fields_left.php similarity index 100% rename from admin/layouts/admin_view/fields_conditions_left.php rename to admin/layouts/admin_view/fields_left.php diff --git a/admin/layouts/admin_view/fields_conditions_right.php b/admin/layouts/admin_view/fields_right.php similarity index 100% rename from admin/layouts/admin_view/fields_conditions_right.php rename to admin/layouts/admin_view/fields_right.php diff --git a/admin/models/admin_fields_relations.php b/admin/models/admin_fields_relations.php new file mode 100644 index 000000000..df334222b --- /dev/null +++ b/admin/models/admin_fields_relations.php @@ -0,0 +1,878 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +use Joomla\Registry\Registry; + +// import Joomla modelform library +jimport('joomla.application.component.modeladmin'); + +/** + * Componentbuilder Admin_fields_relations Model + */ +class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin +{ + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_componentbuilder.admin_fields_relations'; + + /** + * Returns a Table object, always creating it + * + * @param type $type The table type to instantiate + * @param string $prefix A prefix for the table class name. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JTable A database object + * + * @since 1.6 + */ + public function getTable($type = 'admin_fields_relations', $prefix = 'ComponentbuilderTable', $config = array()) + { + return JTable::getInstance($type, $prefix, $config); + } + + /** + * Method to get a single record. + * + * @param integer $pk The id of the primary key. + * + * @return mixed Object on success, false on failure. + * + * @since 1.6 + */ + public function getItem($pk = null) + { + if ($item = parent::getItem($pk)) + { + if (!empty($item->params) && !is_array($item->params)) + { + // Convert the params field to an array. + $registry = new Registry; + $registry->loadString($item->params); + $item->params = $registry->toArray(); + } + + if (!empty($item->metadata)) + { + // Convert the metadata field to an array. + $registry = new Registry; + $registry->loadString($item->metadata); + $item->metadata = $registry->toArray(); + } + + if (!empty($item->addrelations)) + { + // Convert the addrelations field to an array. + $addrelations = new Registry; + $addrelations->loadString($item->addrelations); + $item->addrelations = $addrelations->toArray(); + } + + // check what type of conditions array we have here (should be subform... but just incase) + // This could happen due to huge data sets + if (isset($item->addconditions) && isset($item->addconditions['target_field'])) + { + $bucket = array(); + foreach($item->addconditions as $option => $values) + { + foreach($values as $nr => $value) + { + $bucket['addconditions'.$nr][$option] = $value; + } + } + $item->addconditions = $bucket; + // update the fields + $conditionsUpdate = new stdClass(); + $conditionsUpdate->id = (int) $item->id; + $conditionsUpdate->addconditions = json_encode($bucket); + $this->_db->updateObject('#__componentbuilder_admin_fields_conditions', $conditionsUpdate, 'id'); + } + + if (!empty($item->id)) + { + $item->tags = new JHelperTags; + $item->tags->getTagIds($item->id, 'com_componentbuilder.admin_fields_relations'); + } + } + + return $item; + } + + /** + * Method to get the record form. + * + * @param array $data Data for the form. + * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * + * @return mixed A JForm object on success, false on failure + * + * @since 1.6 + */ + public function getForm($data = array(), $loadData = true) + { + // Get the form. + $form = $this->loadForm('com_componentbuilder.admin_fields_relations', 'admin_fields_relations', array('control' => 'jform', 'load_data' => $loadData)); + + if (empty($form)) + { + return false; + } + + $jinput = JFactory::getApplication()->input; + + // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. + if ($jinput->get('a_id')) + { + $id = $jinput->get('a_id', 0, 'INT'); + } + // The back end uses id so we use that the rest of the time and set it to 0 by default. + else + { + $id = $jinput->get('id', 0, 'INT'); + } + + $user = JFactory::getUser(); + + // Check for existing item. + // Modify the form based on Edit State access controls. + if ($id != 0 && (!$user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder.admin_fields_relations.' . (int) $id)) + || ($id == 0 && !$user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('ordering', 'disabled', 'true'); + $form->setFieldAttribute('published', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('ordering', 'filter', 'unset'); + $form->setFieldAttribute('published', 'filter', 'unset'); + } + // If this is a new item insure the greated by is set. + if (0 == $id) + { + // Set the created_by to this user + $form->setValue('created_by', null, $user->id); + } + // Modify the form based on Edit Creaded By access controls. + if ($id != 0 && (!$user->authorise('admin_fields_relations.edit.created_by', 'com_componentbuilder.admin_fields_relations.' . (int) $id)) + || ($id == 0 && !$user->authorise('admin_fields_relations.edit.created_by', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('created_by', 'disabled', 'true'); + // Disable fields for display. + $form->setFieldAttribute('created_by', 'readonly', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created_by', 'filter', 'unset'); + } + // Modify the form based on Edit Creaded Date access controls. + if ($id != 0 && (!$user->authorise('admin_fields_relations.edit.created', 'com_componentbuilder.admin_fields_relations.' . (int) $id)) + || ($id == 0 && !$user->authorise('admin_fields_relations.edit.created', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('created', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created', 'filter', 'unset'); + } + // Only load these values if no id is found + if (0 == $id) + { + // Set redirected field name + $redirectedField = $jinput->get('ref', null, 'STRING'); + // Set redirected field value + $redirectedValue = $jinput->get('refid', 0, 'INT'); + if (0 != $redirectedValue && $redirectedField) + { + // Now set the local-redirected field default value + $form->setValue($redirectedField, null, $redirectedValue); + } + } + + return $form; + } + + /** + * Method to get the script that have to be included on the form + * + * @return string script files + */ + public function getScript() + { + return 'administrator/components/com_componentbuilder/models/forms/admin_fields_relations.js'; + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canDelete($record) + { + if (!empty($record->id)) + { + if ($record->published != -2) + { + return; + } + + $user = JFactory::getUser(); + // The record has been set. Check the record permissions. + return $user->authorise('admin_fields_relations.delete', 'com_componentbuilder.admin_fields_relations.' . (int) $record->id); + } + return false; + } + + /** + * Method to test whether a record can have its state edited. + * + * @param object $record A record object. + * + * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canEditState($record) + { + $user = JFactory::getUser(); + $recordId = (!empty($record->id)) ? $record->id : 0; + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder.admin_fields_relations.' . (int) $recordId); + if (!$permission && !is_null($permission)) + { + return false; + } + } + // In the absense of better information, revert to the component permissions. + return $user->authorise('admin_fields_relations.edit.state', 'com_componentbuilder'); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * @since 2.5 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // Check specific edit permission then general edit permission. + $user = JFactory::getUser(); + + return $user->authorise('admin_fields_relations.edit', 'com_componentbuilder.admin_fields_relations.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('admin_fields_relations.edit', 'com_componentbuilder'); + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param JTable $table A JTable object. + * + * @return void + * + * @since 1.6 + */ + protected function prepareTable($table) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if (isset($table->name)) + { + $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); + } + + if (isset($table->alias) && empty($table->alias)) + { + $table->generateAlias(); + } + + if (empty($table->id)) + { + $table->created = $date->toSql(); + // set the user + if ($table->created_by == 0 || empty($table->created_by)) + { + $table->created_by = $user->id; + } + // Set ordering to the last item if not set + if (empty($table->ordering)) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__componentbuilder_admin_fields_relations')); + $db->setQuery($query); + $max = $db->loadResult(); + + $table->ordering = $max + 1; + } + } + else + { + $table->modified = $date->toSql(); + $table->modified_by = $user->id; + } + + if (!empty($table->id)) + { + // Increment the items version number. + $table->version++; + } + } + + /** + * Method to get the data that should be injected in the form. + * + * @return mixed The data for the form. + * + * @since 1.6 + */ + protected function loadFormData() + { + // Check the session for previously entered form data. + $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.admin_fields_relations.data', array()); + + if (empty($data)) + { + $data = $this->getItem(); + } + + return $data; + } + + /** + * Method to get the unique fields of this table. + * + * @return mixed An array of field names, boolean false if none is set. + * + * @since 3.0 + */ + protected function getUniqeFields() + { + return false; + } + + /** + * Method to delete one or more records. + * + * @param array &$pks An array of record primary keys. + * + * @return boolean True if successful, false if an error occurs. + * + * @since 12.2 + */ + public function delete(&$pks) + { + if (!parent::delete($pks)) + { + return false; + } + + return true; + } + + /** + * Method to change the published state of one or more records. + * + * @param array &$pks A list of the primary keys to change. + * @param integer $value The value of the published state. + * + * @return boolean True on success. + * + * @since 12.2 + */ + public function publish(&$pks, $value = 1) + { + if (!parent::publish($pks, $value)) + { + return false; + } + + return true; + } + + /** + * Method to perform batch operations on an item or a set of items. + * + * @param array $commands An array of commands to perform. + * @param array $pks An array of item ids. + * @param array $contexts An array of item contexts. + * + * @return boolean Returns true on success, false on failure. + * + * @since 12.2 + */ + public function batch($commands, $pks, $contexts) + { + // Sanitize ids. + $pks = array_unique($pks); + JArrayHelper::toInteger($pks); + + // Remove any values of zero. + if (array_search(0, $pks, true)) + { + unset($pks[array_search(0, $pks, true)]); + } + + if (empty($pks)) + { + $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new JUcmType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c'); + + if ($cmd == 'c') + { + $result = $this->batchCopy($commands, $pks, $contexts); + + if (is_array($result)) + { + foreach ($result as $old => $new) + { + $contexts[$new] = $contexts[$old]; + } + $pks = array_values($result); + } + else + { + return false; + } + } + elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts)) + { + return false; + } + + $done = true; + } + + if (!$done) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + } + + /** + * Batch copy items to a new category or current. + * + * @param integer $values The new values. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return mixed An array of new IDs on success, boolean false on failure. + * + * @since 12.2 + */ + protected function batchCopy($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations'); + } + + if (!$this->canDo->get('admin_fields_relations.create') && !$this->canDo->get('admin_fields_relations.batch')) + { + return false; + } + + // get list of uniqe fields + $uniqeFields = $this->getUniqeFields(); + // remove move_copy from array + unset($values['move_copy']); + + // make sure published is set + if (!isset($values['published'])) + { + $values['published'] = 0; + } + elseif (isset($values['published']) && !$this->canDo->get('admin_fields_relations.edit.state')) + { + $values['published'] = 0; + } + + $newIds = array(); + // Parent exists so let's proceed + while (!empty($pks)) + { + // Pop the first ID off the stack + $pk = array_shift($pks); + + $this->table->reset(); + + // only allow copy if user may edit this item. + if (!$this->user->authorise('admin_fields_relations.edit', $contexts[$pk])) + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // Only for strings + if (ComponentbuilderHelper::checkString($this->table->admin_view) && !is_numeric($this->table->admin_view)) + { + $this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view); + } + + // insert all set values + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + if (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + // update all uniqe fields + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField); + } + } + + // Reset the ID because we are making a copy + $this->table->id = 0; + + // TODO: Deal with ordering? + // $this->table->ordering = 1; + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + + // Get the new item ID + $newId = $this->table->get('id'); + + // Add the new ID to the array + $newIds[$pk] = $newId; + } + + // Clean the cache + $this->cleanCache(); + + return $newIds; + } + + /** + * Batch move items to a new category + * + * @param integer $value The new category ID. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 12.2 + */ + protected function batchMove($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations'); + } + + if (!$this->canDo->get('admin_fields_relations.edit') && !$this->canDo->get('admin_fields_relations.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // make sure published only updates if user has the permission. + if (isset($values['published']) && !$this->canDo->get('admin_fields_relations.edit.state')) + { + unset($values['published']); + } + // remove move_copy from array + unset($values['move_copy']); + + // Parent exists so we proceed + foreach ($pks as $pk) + { + if (!$this->user->authorise('admin_fields_relations.edit', $contexts[$pk])) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // insert all set values. + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + // Do special action for access. + if ('access' === $key && strlen($value) > 0) + { + $this->table->$key = $value; + } + elseif (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + } + + // Clean the cache + $this->cleanCache(); + + return true; + } + + /** + * Method to save the form data. + * + * @param array $data The form data. + * + * @return boolean True on success. + * + * @since 1.6 + */ + public function save($data) + { + $input = JFactory::getApplication()->input; + $filter = JFilterInput::getInstance(); + + // set the metadata to the Item Data + if (isset($data['metadata']) && isset($data['metadata']['author'])) + { + $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); + + $metadata = new JRegistry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + } + + // Set the addrelations items to data. + if (isset($data['addrelations']) && is_array($data['addrelations'])) + { + $addrelations = new JRegistry; + $addrelations->loadArray($data['addrelations']); + $data['addrelations'] = (string) $addrelations; + } + elseif (!isset($data['addrelations'])) + { + // Set the empty addrelations to data + $data['addrelations'] = ''; + } + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new JRegistry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + } + + // Alter the uniqe field for save as copy + if ($input->get('task') === 'save2copy') + { + // Automatic handling of other uniqe fields + $uniqeFields = $this->getUniqeFields(); + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]); + } + } + } + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * + * @since 3.0 + */ + protected function generateUniqe($field,$value) + { + + // set field value uniqe + $table = $this->getTable(); + + while ($table->load(array($field => $value))) + { + $value = JString::increment($value); + } + + return $value; + } + + /** + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ + protected function _generateNewTitle($title) + { + + // Alter the title + $table = $this->getTable(); + + while ($table->load(array('title' => $title))) + { + $title = JString::increment($title); + } + + return $title; + } +} diff --git a/admin/models/admin_view.php b/admin/models/admin_view.php index de8ee95f3..5a2de0e14 100644 --- a/admin/models/admin_view.php +++ b/admin/models/admin_view.php @@ -729,7 +729,8 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin { $_tablesArray = array( 'admin_fields', - 'admin_fields_conditions' + 'admin_fields_conditions', + 'admin_fields_relations' ); foreach($_tablesArray as $_updateTable) { @@ -769,7 +770,8 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin { $_tablesArray = array( 'admin_fields', - 'admin_fields_conditions' + 'admin_fields_conditions', + 'admin_fields_relations' ); foreach($_tablesArray as $_updateTable) { diff --git a/admin/models/admins_fields_relations.php b/admin/models/admins_fields_relations.php new file mode 100644 index 000000000..6f9815861 --- /dev/null +++ b/admin/models/admins_fields_relations.php @@ -0,0 +1,242 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +// import the Joomla modellist library +jimport('joomla.application.component.modellist'); + +/** + * Admins_fields_relations Model + */ +class ComponentbuilderModelAdmins_fields_relations extends JModelList +{ + public function __construct($config = array()) + { + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( + 'a.id','id', + 'a.published','published', + 'a.ordering','ordering', + 'a.created_by','created_by', + 'a.modified_by','modified_by' + ); + } + + parent::__construct($config); + } + + /** + * Method to auto-populate the model state. + * + * @return void + */ + protected function populateState($ordering = null, $direction = null) + { + $app = JFactory::getApplication(); + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + } + + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + // List state information. + parent::populateState($ordering, $direction); + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getItems() + { + // check in items + $this->checkInNow(); + + // load parent items + $items = parent::getItems(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + // get user object. + $user = JFactory::getUser(); + foreach ($items as $nr => &$item) + { + $access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $item->id) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + } + } + + // return items + return $items; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + */ + protected function getListQuery() + { + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_item table + $query->from($db->quoteName('#__componentbuilder_admin_fields_relations', 'a')); + + // From the componentbuilder_admin_view table. + $query->select($db->quoteName('g.system_name','admin_view_system_name')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_admin_view', 'g') . ' ON (' . $db->quoteName('a.admin_view') . ' = ' . $db->quoteName('g.id') . ')'); + + // Filter by published state + $published = $this->getState('filter.published'); + if (is_numeric($published)) + { + $query->where('a.published = ' . (int) $published); + } + elseif ($published === '') + { + $query->where('(a.published = 0 OR a.published = 1)'); + } + + // Join over the asset groups. + $query->select('ag.title AS access_level'); + $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + // Filter by access level. + if ($access = $this->getState('filter.access')) + { + $query->where('a.access = ' . (int) $access); + } + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + + // Add the list ordering clause. + $orderCol = $this->state->get('list.ordering', 'a.id'); + $orderDirn = $this->state->get('list.direction', 'asc'); + if ($orderCol != '') + { + $query->order($db->escape($orderCol . ' ' . $orderDirn)); + } + + return $query; + } + + /** + * Method to get a store id based on model configuration state. + * + * @return string A store id. + * + */ + protected function getStoreId($id = '') + { + // Compile the store id. + $id .= ':' . $this->getState('filter.id'); + $id .= ':' . $this->getState('filter.search'); + $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.ordering'); + $id .= ':' . $this->getState('filter.created_by'); + $id .= ':' . $this->getState('filter.modified_by'); + + return parent::getStoreId($id); + } + + /** + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ + protected function checkInNow() + { + // Get set check in time + $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); + + if ($time) + { + + // Get a db connection. + $db = JFactory::getDbo(); + // reset query + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->quoteName('#__componentbuilder_admin_fields_relations')); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + // Get Yesterdays date + $date = JFactory::getDate()->modify($time)->toSql(); + // reset query + $query = $db->getQuery(true); + + // Fields to update. + $fields = array( + $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', + $db->quoteName('checked_out') . '=0' + ); + + // Conditions for which records should be updated. + $conditions = array( + $db->quoteName('checked_out') . '!=0', + $db->quoteName('checked_out_time') . '<\''.$date.'\'' + ); + + // Check table + $query->update($db->quoteName('#__componentbuilder_admin_fields_relations'))->set($fields)->where($conditions); + + $db->setQuery($query); + + $db->execute(); + } + } + + return false; + } +} diff --git a/admin/models/ajax.php b/admin/models/ajax.php index ccfaf58b3..ba5222381 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -238,6 +238,7 @@ class ComponentbuilderModelAjax extends JModelList 'library_files_folders_urls' => 'libraries_files_folders_urls', 'admin_fields' => 'admins_fields', 'admin_fields_conditions' => 'admins_fields_conditions', + 'admin_fields_relations' => 'admins_fields_relations', 'validation_rule' => 'validation_rules', 'field' => 'fields', 'component_admin_views' => 'components_admin_views' , @@ -410,6 +411,9 @@ class ComponentbuilderModelAjax extends JModelList 'type' => 'setURLType', // Admin View 'field' => 'setItemNames', + 'listfield' => 'setItemNames', + 'joinfields' => 'setItemNames', + 'join_type' => 'setJoinType', 'list' => 'setAdminBehaviour', 'title' => 'setYesNo', 'alias' => 'setYesNo', @@ -456,6 +460,10 @@ class ComponentbuilderModelAjax extends JModelList 'update' => JText::_('COM_COMPONENTBUILDER_UPDATE'), // Admin View (fields) 'field' => JText::_('COM_COMPONENTBUILDER_FIELD'), + 'listfield' => JText::_('COM_COMPONENTBUILDER_LIST_FIELD'), + 'joinfields' => JText::_('COM_COMPONENTBUILDER_JOIN_FIELDS'), + 'set' => JText::_('COM_COMPONENTBUILDER_GLUECODE'), + 'join_type' => JText::_('COM_COMPONENTBUILDER_JOIN_TYPE'), 'list' => JText::_('COM_COMPONENTBUILDER_ADMIN_BEHAVIOUR'), 'order_list' => JText::_('COM_COMPONENTBUILDER_ORDER_IN_LIST_VIEWS'), 'title' => JText::_('COM_COMPONENTBUILDER_TITLE'), @@ -625,6 +633,7 @@ class ComponentbuilderModelAjax extends JModelList 'library_files_folders_urls' => array('addurls','addfiles','addfolders'), 'admin_fields' => 'addfields', 'admin_fields_conditions' => 'addconditions', + 'admin_fields_relations' => 'addrelations', 'component_admin_views' => 'addadmin_views', 'component_site_views' => 'addsite_views', 'component_custom_admin_views' => 'addcustom_admin_views'); @@ -755,6 +764,8 @@ class ComponentbuilderModelAjax extends JModelList 'field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')), 'target_field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')), 'match_field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')), + 'listfield' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')), + 'joinfields' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field', 'type' => array('table' => 'fieldtype', 'field' => 'id', 'key' => 'fieldtype', 'get' => 'name')), // joomla component view 'siteview' => array('table' => 'site_view', 'tables' => 'site_views', 'id' => 'id', 'name' => 'name', 'text' => 'Site View'), 'customadminview' => array('table' => 'custom_admin_view', 'tables' => 'custom_admin_views', 'id' => 'id', 'name' => 'system_name', 'text' => 'Custom Admin View'), @@ -832,6 +843,20 @@ class ComponentbuilderModelAjax extends JModelList return JText::_('COM_COMPONENTBUILDER_NO_ITEM_FOUND'); } + protected function setJoinType($header, $value) + { + switch ($value) + { + case 1: + return JText::_('COM_COMPONENTBUILDER_CONCATENATE'); + break; + case 2: + return JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE'); + break; + } + return JText::_('COM_COMPONENTBUILDER_NOT_SET'); + } + protected function setURLType($header, $value) { switch ($value) diff --git a/admin/models/componentbuilder.php b/admin/models/componentbuilder.php index a1cd27129..e3e37590c 100644 --- a/admin/models/componentbuilder.php +++ b/admin/models/componentbuilder.php @@ -131,6 +131,9 @@ class ComponentbuilderModelComponentbuilder extends JModelList 'admin_fields_conditions.create' => 'admin_fields_conditions.create', 'admins_fields_conditions.access' => 'admin_fields_conditions.access', 'admin_fields_conditions.access' => 'admin_fields_conditions.access', + 'admin_fields_relations.create' => 'admin_fields_relations.create', + 'admins_fields_relations.access' => 'admin_fields_relations.access', + 'admin_fields_relations.access' => 'admin_fields_relations.access', 'component_admin_views.create' => 'component_admin_views.create', 'components_admin_views.access' => 'component_admin_views.access', 'component_admin_views.access' => 'component_admin_views.access', diff --git a/admin/models/fields/joinfields.php b/admin/models/fields/joinfields.php new file mode 100644 index 000000000..69e2531c9 --- /dev/null +++ b/admin/models/fields/joinfields.php @@ -0,0 +1,101 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +// import the list field type +jimport('joomla.form.helper'); +JFormHelper::loadFieldClass('list'); + +/** + * Joinfields Form Field class for the Componentbuilder component + */ +class JFormFieldJoinfields extends JFormFieldList +{ + /** + * The joinfields field type. + * + * @var string + */ + public $type = 'joinfields'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of JHtml options. + */ + public function getOptions() + { + // load the db opbject + $db = JFactory::getDBO(); + // get the input from url + $jinput = JFactory::getApplication()->input; + // get the id + $ID = $jinput->getInt('id', 0); + // rest the fields ids + $fieldIds = array(); + if (is_numeric($ID) && $ID >= 1) + { + // get the admin view ID + $adminView = ComponentbuilderHelper::getVar('admin_fields_relations', (int) $ID, 'id', 'admin_view'); + } + else + { + // get the admin view ID + $adminView = $jinput->getInt('refid', 0); + } + if (is_numeric($adminView) && $adminView >= 1) + { + // get all the fields linked to the admin view + if ($addFields = ComponentbuilderHelper::getVar('admin_fields', (int) $adminView, 'admin_view', 'addfields')) + { + if (ComponentbuilderHelper::checkJson($addFields)) + { + $addFields = json_decode($addFields, true); + if (ComponentbuilderHelper::checkArray($addFields)) + { + foreach($addFields as $addField) + { + if (isset($addField['field']) && (!isset($addField['list']) || ($addField['list'] != 1 && $addField['list'] != 2))) + { + $fieldIds[] = (int) $addField['field']; + } + } + } + } + } + // filter by fields linked + if (ComponentbuilderHelper::checkArray($fieldIds)) + { + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name'),array('id','name'))); + $query->from($db->quoteName('#__componentbuilder_field', 'a')); + $query->where($db->quoteName('a.published') . ' >= 1'); + // only load these fields + $query->where($db->quoteName('a.id') . ' IN (' . implode(',', $fieldIds) . ')'); + $query->order('a.name ASC'); + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + if ($items) + { + foreach($items as $item) + { + $options[] = JHtml::_('select.option', $item->id, $item->name); + } + } + return $options; + } + } + return false; + } +} diff --git a/admin/models/fields/listfields.php b/admin/models/fields/listfields.php new file mode 100644 index 000000000..a11859641 --- /dev/null +++ b/admin/models/fields/listfields.php @@ -0,0 +1,101 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +// import the list field type +jimport('joomla.form.helper'); +JFormHelper::loadFieldClass('list'); + +/** + * Listfields Form Field class for the Componentbuilder component + */ +class JFormFieldListfields extends JFormFieldList +{ + /** + * The listfields field type. + * + * @var string + */ + public $type = 'listfields'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of JHtml options. + */ + public function getOptions() + { + // load the db opbject + $db = JFactory::getDBO(); + // get the input from url + $jinput = JFactory::getApplication()->input; + // get the id + $ID = $jinput->getInt('id', 0); + // rest the fields ids + $fieldIds = array(); + if (is_numeric($ID) && $ID >= 1) + { + // get the admin view ID + $adminView = ComponentbuilderHelper::getVar('admin_fields_relations', (int) $ID, 'id', 'admin_view'); + } + else + { + // get the admin view ID + $adminView = $jinput->getInt('refid', 0); + } + if (is_numeric($adminView) && $adminView >= 1) + { + // get all the fields linked to the admin view + if ($addFields = ComponentbuilderHelper::getVar('admin_fields', (int) $adminView, 'admin_view', 'addfields')) + { + if (ComponentbuilderHelper::checkJson($addFields)) + { + $addFields = json_decode($addFields, true); + if (ComponentbuilderHelper::checkArray($addFields)) + { + foreach($addFields as $addField) + { + if (isset($addField['field']) && isset($addField['list']) && $addField['list'] == 1) + { + $fieldIds[] = (int) $addField['field']; + } + } + } + } + } + // filter by fields linked + if (ComponentbuilderHelper::checkArray($fieldIds)) + { + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name'),array('id','name'))); + $query->from($db->quoteName('#__componentbuilder_field', 'a')); + $query->where($db->quoteName('a.published') . ' >= 1'); + // only load these fields + $query->where($db->quoteName('a.id') . ' IN (' . implode(',', $fieldIds) . ')'); + $query->order('a.name ASC'); + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + if ($items) + { + foreach($items as $item) + { + $options[] = JHtml::_('select.option', $item->id, $item->name); + } + } + return $options; + } + } + return false; + } +} diff --git a/admin/models/forms/admin_fields_relations.js b/admin/models/forms/admin_fields_relations.js new file mode 100644 index 000000000..4b31cfb80 --- /dev/null +++ b/admin/models/forms/admin_fields_relations.js @@ -0,0 +1,44 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + + + + +function getFieldSelectOptions_server(fieldId){ + var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json"; + if(token.length > 0 && fieldId > 0){ + var request = 'token='+token+'&id='+fieldId; + } + return jQuery.ajax({ + type: 'GET', + url: getUrl, + dataType: 'jsonp', + data: request, + jsonp: 'callback' + }); +} + +function getFieldSelectOptions(fieldKey){ + // first check if the field is set + if(jQuery("#jform_addconditions__addconditions"+fieldKey+"__match_field").length) { + var fieldId = jQuery("#jform_addconditions__addconditions"+fieldKey+"__match_field option:selected").val(); + getFieldSelectOptions_server(fieldId).done(function(result) { + if(result){ + jQuery('textarea#jform_addconditions__addconditions'+fieldKey+'__match_options').val(result); + } + else + { + jQuery('textarea#jform_addconditions__addconditions'+fieldKey+'__match_options').val(''); + } + }); + } +} + + diff --git a/admin/models/forms/admin_fields_relations.xml b/admin/models/forms/admin_fields_relations.xml new file mode 100644 index 000000000..64c8c7433 --- /dev/null +++ b/admin/models/forms/admin_fields_relations.xml @@ -0,0 +1,189 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+ \ No newline at end of file diff --git a/admin/models/forms/admin_view.js b/admin/models/forms/admin_view.js index 0b2467249..907b9adbe 100644 --- a/admin/models/forms/admin_view.js +++ b/admin/models/forms/admin_view.js @@ -1196,10 +1196,13 @@ jQuery(document).ready(function() // now load the fields getAjaxDisplay('admin_fields'); getAjaxDisplay('admin_fields_conditions'); + getAjaxDisplay('admin_fields_relations'); // set button addButtonID('admin_fields_conditions','create_edit_buttons', 1); // <-- second // set button to create more fields addButton('field','create_edit_buttons'); // <-- third + // set button + addButtonID('admin_fields_relations','create_edit_buttons', 1); // <-- forth }); function checkAliasField() { diff --git a/admin/models/rules/int.php b/admin/models/rules/int.php new file mode 100644 index 000000000..ac3397fc1 --- /dev/null +++ b/admin/models/rules/int.php @@ -0,0 +1,25 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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('JPATH_PLATFORM') or die; + +use Joomla\CMS\Form\Form; +use Joomla\CMS\Form\FormRule; +use Joomla\Registry\Registry; + +/** + * Form Rule (Int) class for the Joomla Platform. + */ +class JFormRuleInt extends FormRule +{ + +} diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index b905feafd..c7e43921c 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -956,6 +956,32 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_fields_conditions` ( KEY `idx_admin_view` (`admin_view`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_fields_relations` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `addrelations` MEDIUMTEXT NOT NULL, + `admin_view` INT(11) NOT NULL DEFAULT 0, + `params` text NOT NULL DEFAULT '', + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_admin_view` (`admin_view`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_admin_views` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', @@ -1644,6 +1670,13 @@ INSERT INTO `#__componentbuilder_admin_fields` (`id`, `addfields`, `admin_view`, INSERT INTO `#__componentbuilder_admin_fields_conditions` (`id`, `addconditions`, `admin_view`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES (111, '{\"addconditions0\":{\"target_field\":[\"1011\",\"100\",\"158\",\"196\",\"280\"],\"target_behavior\":\"1\",\"target_relation\":\"0\",\"match_field\":\"682\",\"match_behavior\":\"1\",\"match_options\":\"1|Yes\"}}', 109, 1, '2017-10-12 21:36:00', '0000-00-00 00:00:00', 2, '', ''); +-- +-- Dumping data for table `#__componentbuilder_admin_fields_relations` +-- + +INSERT INTO `#__componentbuilder_admin_fields_relations` (`id`, `addrelations`, `admin_view`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES +(1, '{\"addrelations0\":{\"listfield\":\"201\",\"joinfields\":[\"279\"],\"join_type\":\"1\",\"set\":\" \"}}', 14, 1, '2018-05-22 01:20:34', '2018-05-22 01:37:07', 2, '', 1); + -- -- Dumping data for table `#__componentbuilder_component_admin_views` -- diff --git a/admin/sql/uninstall.mysql.utf8.sql b/admin/sql/uninstall.mysql.utf8.sql index 4824505af..71675f12a 100644 --- a/admin/sql/uninstall.mysql.utf8.sql +++ b/admin/sql/uninstall.mysql.utf8.sql @@ -17,6 +17,7 @@ DROP TABLE IF EXISTS `#__componentbuilder_server`; DROP TABLE IF EXISTS `#__componentbuilder_help_document`; DROP TABLE IF EXISTS `#__componentbuilder_admin_fields`; DROP TABLE IF EXISTS `#__componentbuilder_admin_fields_conditions`; +DROP TABLE IF EXISTS `#__componentbuilder_admin_fields_relations`; DROP TABLE IF EXISTS `#__componentbuilder_component_admin_views`; DROP TABLE IF EXISTS `#__componentbuilder_component_site_views`; DROP TABLE IF EXISTS `#__componentbuilder_component_custom_admin_views`; diff --git a/admin/sql/updates/mysql/2.7.10.sql b/admin/sql/updates/mysql/2.7.10.sql new file mode 100644 index 000000000..ce249cf68 --- /dev/null +++ b/admin/sql/updates/mysql/2.7.10.sql @@ -0,0 +1,82 @@ +CREATE TABLE IF NOT EXISTS `#__componentbuilder_field` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `add_css_view` TINYINT(1) NOT NULL DEFAULT 0, + `add_css_views` TINYINT(1) NOT NULL DEFAULT 0, + `add_javascript_view_footer` TINYINT(1) NOT NULL DEFAULT 0, + `add_javascript_views_footer` TINYINT(1) NOT NULL DEFAULT 0, + `catid` INT(11) NOT NULL DEFAULT 0, + `css_view` TEXT NOT NULL, + `css_views` TEXT NOT NULL, + `datadefault` CHAR(64) NOT NULL DEFAULT '', + `datadefault_other` CHAR(64) NOT NULL DEFAULT '', + `datalenght` CHAR(64) NOT NULL DEFAULT '', + `datalenght_other` CHAR(64) NOT NULL DEFAULT '', + `datatype` CHAR(64) NOT NULL DEFAULT '', + `fieldtype` INT(11) NOT NULL DEFAULT 0, + `indexes` CHAR(64) NOT NULL DEFAULT '', + `javascript_view_footer` TEXT NOT NULL, + `javascript_views_footer` TEXT NOT NULL, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `null_switch` CHAR(64) NOT NULL DEFAULT '', + `store` INT(11) NOT NULL DEFAULT 0, + `xml` TEXT NOT NULL, + `params` text NOT NULL DEFAULT '', + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`), + KEY `idx_fieldtype` (`fieldtype`), + KEY `idx_datatype` (`datatype`), + KEY `idx_indexes` (`indexes`), + KEY `idx_null_switch` (`null_switch`), + KEY `idx_catid` (`catid`), + KEY `idx_add_css_views` (`add_css_views`), + KEY `idx_add_css_view` (`add_css_view`), + KEY `idx_datalenght` (`datalenght`), + KEY `idx_add_javascript_views_footer` (`add_javascript_views_footer`), + KEY `idx_datadefault_other` (`datadefault_other`), + KEY `idx_datadefault` (`datadefault`), + KEY `idx_datalenght_other` (`datalenght_other`), + KEY `idx_add_javascript_view_footer` (`add_javascript_view_footer`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_fields_relations` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `addrelations` MEDIUMTEXT NOT NULL, + `admin_view` INT(11) NOT NULL DEFAULT 0, + `params` text NOT NULL DEFAULT '', + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_admin_view` (`admin_view`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; diff --git a/admin/tables/admin_fields_relations.php b/admin/tables/admin_fields_relations.php new file mode 100644 index 000000000..1fc51d34c --- /dev/null +++ b/admin/tables/admin_fields_relations.php @@ -0,0 +1,324 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +use Joomla\Registry\Registry; + +// import Joomla table library +jimport('joomla.database.table'); + +/** + * Admins_fields_relations Table class + */ +class ComponentbuilderTableAdmin_fields_relations extends JTable +{ + /** + * Ensure the params and metadata in json encoded in the bind method + * + * @var array + * @since 3.3 + */ + protected $_jsonEncode = array('params', 'metadata'); + + /** + * Constructor + * + * @param object Database connector object + */ + function __construct(&$db) + { + parent::__construct('#__componentbuilder_admin_fields_relations', 'id', $db); + + // Adding History Options + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.admin_fields_relations')); + } + + public function bind($array, $ignore = '') + { + + if (isset($array['params']) && is_array($array['params'])) + { + $registry = new JRegistry; + $registry->loadArray($array['params']); + $array['params'] = (string) $registry; + } + + if (isset($array['metadata']) && is_array($array['metadata'])) + { + $registry = new JRegistry; + $registry->loadArray($array['metadata']); + $array['metadata'] = (string) $registry; + } + + // Bind the rules. + if (isset($array['rules']) && is_array($array['rules'])) + { + $rules = new JAccessRules($array['rules']); + $this->setRules($rules); + } + return parent::bind($array, $ignore); + } + + /** + * Overload the store method for the Admin_fields_relations table. + * + * @param boolean Toggle whether null values should be updated. + * @return boolean True on success, false on failure. + * @since 1.6 + */ + public function store($updateNulls = false) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if ($this->id) + { + // Existing item + $this->modified = $date->toSql(); + $this->modified_by = $user->get('id'); + } + else + { + // New admin_fields_relations. A admin_fields_relations created and created_by field can be set by the user, + // so we don't touch either of these if they are set. + if (!(int) $this->created) + { + $this->created = $date->toSql(); + } + if (empty($this->created_by)) + { + $this->created_by = $user->get('id'); + } + } + + if (isset($this->alias)) + { + // Verify that the alias is unique + $table = JTable::getInstance('admin_fields_relations', 'ComponentbuilderTable'); + + if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->setError(JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ERROR_UNIQUE_ALIAS')); + return false; + } + } + + if (isset($this->url)) + { + // Convert IDN urls to punycode + $this->url = JStringPunycode::urlToPunycode($this->url); + } + if (isset($this->website)) + { + // Convert IDN urls to punycode + $this->website = JStringPunycode::urlToPunycode($this->website); + } + + return parent::store($updateNulls); + } + + /** + * Overloaded check method to ensure data integrity. + * + * @return boolean True on success. + */ + public function check() + { + if (isset($this->alias)) + { + // Generate a valid alias + $this->generateAlias(); + + $table = JTable::getInstance('admin_fields_relations', 'componentbuilderTable'); + + while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->alias = JString::increment($this->alias, 'dash'); + } + } + + /* + * Clean up keywords -- eliminate extra spaces between phrases + * and cr (\r) and lf (\n) characters from string. + * Only process if not empty. + */ + if (!empty($this->metakey)) + { + // Array of characters to remove. + $bad_characters = array("\n", "\r", "\"", "<", ">"); + + // Remove bad characters. + $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); + + // Create array using commas as delimiter. + $keys = explode(',', $after_clean); + $clean_keys = array(); + + foreach ($keys as $key) + { + // Ignore blank keywords. + if (trim($key)) + { + $clean_keys[] = trim($key); + } + } + + // Put array back together delimited by ", " + $this->metakey = implode(", ", $clean_keys); + } + + // Clean up description -- eliminate quotes and <> brackets + if (!empty($this->metadesc)) + { + // Only process if not empty + $bad_characters = array("\"", "<", ">"); + $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); + } + + // If we don't have any access rules set at this point just use an empty JAccessRules class + if (!$this->getRules()) + { + $rules = $this->getDefaultAssetValues('com_componentbuilder.admin_fields_relations.'.$this->id); + $this->setRules($rules); + } + + // Set ordering + if ($this->published < 0) + { + // Set ordering to 0 if state is archived or trashed + $this->ordering = 0; + } + + return true; + } + + /** + * Gets the default asset values for a component. + * + * @param $string $component The component asset name to search for + * + * @return JAccessRules The JAccessRules object for the asset + */ + protected function getDefaultAssetValues($component, $try = true) + { + // 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(); + if ($db->loadRowList()) + { + // asset alread set so use saved rules + $assetId = (int) $db->loadResult(); + return JAccess::getAssetRules($assetId); + } + // try again + elseif ($try) + { + $try = explode('.',$component); + $result = $this->getDefaultAssetValues($try[0], false); + if ($result instanceof JAccessRules) + { + if (isset($try[1])) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($try[1] !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + else + { + // 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; + $rules->mergeCollection($_result); + + return $rules; + } + } + return $result; + } + } + return JAccess::getAssetRules(0); + } + + /** + * Method to compute the default name of the asset. + * The default name is in the form 'table_name.id' + * where id is the value of the primary key of the table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetName() + { + $k = $this->_tbl_key; + return 'com_componentbuilder.admin_fields_relations.'.(int) $this->$k; + } + + /** + * Method to return the title to use for the asset table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetTitle() + { + if (isset($this->title)) + { + return $this->title; + } + return ''; + } + + /** + * Get the parent asset id for the record + * + * @return int + * @since 2.5 + */ + protected function _getAssetParentId(JTable $table = NULL, $id = NULL) + { + $asset = JTable::getInstance('Asset'); + $asset->loadByName('com_componentbuilder'); + + return $asset->id; + } + + /** + * This view does not actually have an alias + * + * @return bool + */ + public function generateAlias() + { + return false; + } + +} diff --git a/admin/views/admin_fields_relations/submitbutton.js b/admin/views/admin_fields_relations/submitbutton.js new file mode 100644 index 000000000..4a4e0e483 --- /dev/null +++ b/admin/views/admin_fields_relations/submitbutton.js @@ -0,0 +1,35 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +Joomla.submitbutton = function(task) +{ + if (task == ''){ + return false; + } else { + var isValid=true; + var action = task.split('.'); + if (action[1] != 'cancel' && action[1] != 'close'){ + var forms = $$('form.form-validate'); + for (var i=0;i + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); +$componentParams = JComponentHelper::getParams('com_componentbuilder'); +?> + + + +
+ + diff --git a/admin/views/admin_fields_relations/tmpl/index.html b/admin/views/admin_fields_relations/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/admin_fields_relations/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/admin_fields_relations/view.html.php b/admin/views/admin_fields_relations/view.html.php new file mode 100644 index 000000000..376f517df --- /dev/null +++ b/admin/views/admin_fields_relations/view.html.php @@ -0,0 +1,190 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +// import Joomla view library +jimport('joomla.application.component.view'); + +/** + * Admin_fields_relations View class + */ +class ComponentbuilderViewAdmin_fields_relations extends JViewLegacy +{ + /** + * display method of View + * @return void + */ + public function display($tpl = null) + { + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->script = $this->get('Script'); + $this->state = $this->get('State'); + // get action permissions + $this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations',$this->item); + // get input + $jinput = JFactory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $this->referral = ''; + if ($this->refid) + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JFactory::getApplication()->input->set('hidemainmenu', true); + $user = JFactory::getUser(); + $userId = $user->id; + $isNew = $this->item->id == 0; + + JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT'), 'pencil-2 article-add'); + // Built the actions for new and existing records. + if ($this->refid || $this->ref) + { + if ($this->canDo->get('admin_fields_relations.create') && $isNew) + { + // We can create the record. + JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE'); + } + elseif ($this->canDo->get('admin_fields_relations.edit')) + { + // We can save the record. + JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE'); + } + if ($isNew) + { + // Do not creat but cancel. + JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + // We can close it. + JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CLOSE'); + } + } + else + { + if ($isNew) + { + // For new records, check the create permission. + if ($this->canDo->get('admin_fields_relations.create')) + { + JToolBarHelper::apply('admin_fields_relations.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE'); + JToolBarHelper::custom('admin_fields_relations.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + }; + JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + if ($this->canDo->get('admin_fields_relations.edit')) + { + // We can save the new record + JToolBarHelper::apply('admin_fields_relations.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE'); + // We can save this record, but check the create permission to see + // if we can return to make a new one. + if ($this->canDo->get('admin_fields_relations.create')) + { + JToolBarHelper::custom('admin_fields_relations.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + } + } + $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('admin_fields_relations.version')); + if ($this->state->params->get('save_history', 1) && $this->canDo->get('admin_fields_relations.edit') && $canVersion) + { + JToolbarHelper::versions('com_componentbuilder.admin_fields_relations', $this->item->id); + } + if ($this->canDo->get('admin_fields_relations.create')) + { + JToolBarHelper::custom('admin_fields_relations.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + } + JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CLOSE'); + } + } + JToolbarHelper::divider(); + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('admin_fields_relations'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 30) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + $isNew = ($this->item->id < 1); + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admin_fields_relations.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + // Add Ajax Token + $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); + $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_fields_relations/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + JText::script('view not acceptable. Error'); + } +} diff --git a/admin/views/admin_view/tmpl/edit.php b/admin/views/admin_view/tmpl/edit.php index 3f7147e1f..09cd2ae85 100644 --- a/admin/views/admin_view/tmpl/edit.php +++ b/admin/views/admin_view/tmpl/edit.php @@ -75,18 +75,18 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
- +
- +
- +
- +
diff --git a/admin/views/admin_views/tmpl/default_body.php b/admin/views/admin_views/tmpl/default_body.php index 7e1a2249b..6c4017f8a 100644 --- a/admin/views/admin_views/tmpl/default_body.php +++ b/admin/views/admin_views/tmpl/default_body.php @@ -76,6 +76,9 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view. get('admin_view.edit') && $admin_field_id = ComponentbuilderHelper::getVar('admin_fields', $item->id, 'admin_view', 'id')): ?> + get('admin_view.edit') && $admin_relation_id = ComponentbuilderHelper::getVar('admin_fields_relations', $item->id, 'admin_view', 'id')): ?> + + get('admin_view.edit') && $admin_condition_id = ComponentbuilderHelper::getVar('admin_fields_conditions', $item->id, 'admin_view', 'id')): ?> diff --git a/admin/views/admins_fields_relations/index.html b/admin/views/admins_fields_relations/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/admins_fields_relations/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default.php b/admin/views/admins_fields_relations/tmpl/default.php new file mode 100644 index 000000000..8f1ec763e --- /dev/null +++ b/admin/views/admins_fields_relations/tmpl/default.php @@ -0,0 +1,85 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +// load tooltip behavior +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); +JHtml::_('formbehavior.chosen', 'select'); + +if ($this->saveOrder) +{ + $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_fields_relations.saveOrderAjax&tmpl=component'; + JHtml::_('sortablelist.sortable', 'admin_fields_relationsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); +} + +?> + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_batch_body.php b/admin/views/admins_fields_relations/tmpl/default_batch_body.php new file mode 100644 index 000000000..d51b3c2ee --- /dev/null +++ b/admin/views/admins_fields_relations/tmpl/default_batch_body.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +?> + +

+batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_batch_footer.php b/admin/views/admins_fields_relations/tmpl/default_batch_footer.php new file mode 100644 index 000000000..77ee93959 --- /dev/null +++ b/admin/views/admins_fields_relations/tmpl/default_batch_footer.php @@ -0,0 +1,23 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +?> + + + + \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_body.php b/admin/views/admins_fields_relations/tmpl/default_body.php new file mode 100644 index 000000000..2cfc53c2d --- /dev/null +++ b/admin/views/admins_fields_relations/tmpl/default_body.php @@ -0,0 +1,94 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +$edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task=admin_fields_relations.edit"; + +?> +items as $i => $item): ?> + user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; + $userChkOut = JFactory::getUser($item->checked_out); + $canDo = ComponentbuilderHelper::getActions('admin_fields_relations',$item,'admins_fields_relations'); + ?> + + + get('admin_fields_relations.edit.state')): ?> + saveOrder) + { + $iconClass = ' inactive'; + } + else + { + $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + } + ?> + + + + saveOrder) : ?> + + + + ⋮ + + + + get('admin_fields_relations.edit')): ?> + checked_out) : ?> + + id); ?> + + □ + + + id); ?> + + + □ + + + + get('admin_fields_relations.edit')): ?> +
+ escape($item->admin_view_system_name); ?> + checked_out): ?> + name, $item->checked_out_time, 'admins_fields_relations.', $canCheckin); ?> + +
+ +
escape($item->admin_view_system_name); ?>
+ + + + get('admin_fields_relations.edit.state')) : ?> + checked_out) : ?> + + published, $i, 'admins_fields_relations.', true, 'cb'); ?> + + published, $i, 'admins_fields_relations.', false, 'cb'); ?> + + + published, $i, 'admins_fields_relations.', true, 'cb'); ?> + + + published, $i, 'admins_fields_relations.', false, 'cb'); ?> + + + + id; ?> + + + \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_foot.php b/admin/views/admins_fields_relations/tmpl/default_foot.php new file mode 100644 index 000000000..eabe4e658 --- /dev/null +++ b/admin/views/admins_fields_relations/tmpl/default_foot.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +?> + + pagination->getListFooter(); ?> + \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_head.php b/admin/views/admins_fields_relations/tmpl/default_head.php new file mode 100644 index 000000000..e33d9b665 --- /dev/null +++ b/admin/views/admins_fields_relations/tmpl/default_head.php @@ -0,0 +1,47 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +?> + + canEdit&& $this->canState): ?> + + ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + + + + + + + ▾ + + + ■ + + + + + + canState): ?> + + listDirn, $this->listOrder); ?> + + + + + + + + listDirn, $this->listOrder); ?> + + \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_toolbar.php b/admin/views/admins_fields_relations/tmpl/default_toolbar.php new file mode 100644 index 000000000..33b28a85e --- /dev/null +++ b/admin/views/admins_fields_relations/tmpl/default_toolbar.php @@ -0,0 +1,45 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +?> +
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/index.html b/admin/views/admins_fields_relations/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/admins_fields_relations/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/admins_fields_relations/view.html.php b/admin/views/admins_fields_relations/view.html.php new file mode 100644 index 000000000..28a73f9e4 --- /dev/null +++ b/admin/views/admins_fields_relations/view.html.php @@ -0,0 +1,227 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2018 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'); + +// import Joomla view library +jimport('joomla.application.component.view'); + +/** + * Componentbuilder View class for the Admins_fields_relations + */ +class ComponentbuilderViewAdmins_fields_relations extends JViewLegacy +{ + /** + * Admins_fields_relations view display method + * @return void + */ + function display($tpl = null) + { + if ($this->getLayout() !== 'modal') + { + // Include helper submenu + ComponentbuilderHelper::addSubmenu('admins_fields_relations'); + } + + // Assign data to the view + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->user = JFactory::getUser(); + $this->listOrder = $this->escape($this->state->get('list.ordering')); + $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->saveOrder = $this->listOrder == 'ordering'; + // get global action permissions + $this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations'); + $this->canEdit = $this->canDo->get('admin_fields_relations.edit'); + $this->canState = $this->canDo->get('admin_fields_relations.edit.state'); + $this->canCreate = $this->canDo->get('admin_fields_relations.create'); + $this->canDelete = $this->canDo->get('admin_fields_relations.delete'); + $this->canBatch = $this->canDo->get('core.batch'); + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + $this->sidebar = JHtmlSidebar::render(); + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'), 'joomla'); + JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_fields_relations'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + + if ($this->canCreate) + { + JToolBarHelper::addNew('admin_fields_relations.add'); + } + + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) + { + if ($this->canEdit) + { + JToolBarHelper::editList('admin_fields_relations.edit'); + } + + if ($this->canState) + { + JToolBarHelper::publishList('admins_fields_relations.publish'); + JToolBarHelper::unpublishList('admins_fields_relations.unpublish'); + JToolBarHelper::archiveList('admins_fields_relations.archive'); + + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('admins_fields_relations.checkin'); + } + } + + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } + + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'admins_fields_relations.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('admins_fields_relations.trash'); + } + } + + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_relations'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } + + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_fields_relations.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 50) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Returns an array of fields the table can be sorted by + * + * @return array Array containing the field name to sort by as the key and display text as value + */ + protected function getSortFields() + { + return array( + 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.id' => JText::_('JGRID_HEADING_ID') + ); + } +} diff --git a/componentbuilder.xml b/componentbuilder.xml index 2eaeece45..79b0655ef 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 18th May, 2018 + 22nd May, 2018 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 2.7.10 + 2.7.11 Component Builder (v.2.7.10) +

Component Builder (v.2.7.11)

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 864e05836..61cb3bb73 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -390,4 +390,21 @@ http://www.joomlacomponentbuilder.com + + Component Builder + Builds Complex Joomla Components + com_componentbuilder + component + 2.7.11 + http://www.joomlacomponentbuilder.com + + http://domain.com/demo.zip + + + stable + + Llewellyn van der Merwe + http://www.joomlacomponentbuilder.com + + \ No newline at end of file diff --git a/script.php b/script.php index cea3d705c..137737966 100644 --- a/script.php +++ b/script.php @@ -1850,6 +1850,92 @@ class com_componentbuilderInstallerScript } } + // Create a new query object. + $query = $db->getQuery(true); + // Select id from content type table + $query->select($db->quoteName('type_id')); + $query->from($db->quoteName('#__content_types')); + // Where Admin_fields_relations alias is found + $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields_relations') ); + $db->setQuery($query); + // Execute query to see if alias is found + $db->execute(); + $admin_fields_relations_found = $db->getNumRows(); + // Now check if there were any rows + if ($admin_fields_relations_found) + { + // Since there are load the needed admin_fields_relations type ids + $admin_fields_relations_ids = $db->loadColumn(); + // Remove Admin_fields_relations from the content type table + $admin_fields_relations_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields_relations') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__content_types')); + $query->where($admin_fields_relations_condition); + $db->setQuery($query); + // Execute the query to remove Admin_fields_relations items + $admin_fields_relations_done = $db->execute(); + if ($admin_fields_relations_done); + { + // If succesfully remove Admin_fields_relations add queued success message. + $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__content_type table')); + } + + // Remove Admin_fields_relations items from the contentitem tag map table + $admin_fields_relations_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields_relations') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__contentitem_tag_map')); + $query->where($admin_fields_relations_condition); + $db->setQuery($query); + // Execute the query to remove Admin_fields_relations items + $admin_fields_relations_done = $db->execute(); + if ($admin_fields_relations_done); + { + // If succesfully remove Admin_fields_relations add queued success message. + $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__contentitem_tag_map table')); + } + + // Remove Admin_fields_relations items from the ucm content table + $admin_fields_relations_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.admin_fields_relations') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_content')); + $query->where($admin_fields_relations_condition); + $db->setQuery($query); + // Execute the query to remove Admin_fields_relations items + $admin_fields_relations_done = $db->execute(); + if ($admin_fields_relations_done); + { + // If succesfully remove Admin_fields_relations add queued success message. + $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__ucm_content table')); + } + + // Make sure that all the Admin_fields_relations items are cleared from DB + foreach ($admin_fields_relations_ids as $admin_fields_relations_id) + { + // Remove Admin_fields_relations items from the ucm base table + $admin_fields_relations_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $admin_fields_relations_id); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_base')); + $query->where($admin_fields_relations_condition); + $db->setQuery($query); + // Execute the query to remove Admin_fields_relations items + $db->execute(); + + // Remove Admin_fields_relations items from the ucm history table + $admin_fields_relations_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $admin_fields_relations_id); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_history')); + $query->where($admin_fields_relations_condition); + $db->setQuery($query); + // Execute the query to remove Admin_fields_relations items + $db->execute(); + } + } + // Create a new query object. $query = $db->getQuery(true); // Select id from content type table @@ -3529,6 +3615,18 @@ class com_componentbuilderInstallerScript // Set the object into the content types table. $admin_fields_conditions_Inserted = $db->insertObject('#__content_types', $admin_fields_conditions); + // Create the admin_fields_relations content type object. + $admin_fields_relations = new stdClass(); + $admin_fields_relations->type_title = 'Componentbuilder Admin_fields_relations'; + $admin_fields_relations->type_alias = 'com_componentbuilder.admin_fields_relations'; + $admin_fields_relations->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_relations","key": "id","type": "Admin_fields_relations","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; + $admin_fields_relations->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; + $admin_fields_relations->router = 'ComponentbuilderHelperRoute::getAdmin_fields_relationsRoute'; + $admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + + // Set the object into the content types table. + $admin_fields_relations_Inserted = $db->insertObject('#__content_types', $admin_fields_relations); + // Create the component_admin_views content type object. $component_admin_views = new stdClass(); $component_admin_views->type_title = 'Componentbuilder Component_admin_views'; @@ -4308,6 +4406,35 @@ class com_componentbuilderInstallerScript $admin_fields_conditions_Inserted = $db->insertObject('#__content_types', $admin_fields_conditions); } + // Create the admin_fields_relations content type object. + $admin_fields_relations = new stdClass(); + $admin_fields_relations->type_title = 'Componentbuilder Admin_fields_relations'; + $admin_fields_relations->type_alias = 'com_componentbuilder.admin_fields_relations'; + $admin_fields_relations->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_relations","key": "id","type": "Admin_fields_relations","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; + $admin_fields_relations->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; + $admin_fields_relations->router = 'ComponentbuilderHelperRoute::getAdmin_fields_relationsRoute'; + $admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + + // Check if admin_fields_relations type is already in content_type DB. + $admin_fields_relations_id = null; + $query = $db->getQuery(true); + $query->select($db->quoteName(array('type_id'))); + $query->from($db->quoteName('#__content_types')); + $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($admin_fields_relations->type_alias)); + $db->setQuery($query); + $db->execute(); + + // Set the object into the content types table. + if ($db->getNumRows()) + { + $admin_fields_relations->type_id = $db->loadResult(); + $admin_fields_relations_Updated = $db->updateObject('#__content_types', $admin_fields_relations, 'type_id'); + } + else + { + $admin_fields_relations_Inserted = $db->insertObject('#__content_types', $admin_fields_relations); + } + // Create the component_admin_views content type object. $component_admin_views = new stdClass(); $component_admin_views->type_title = 'Componentbuilder Component_admin_views'; @@ -4864,7 +4991,7 @@ class com_componentbuilderInstallerScript echo ' -

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

'; +

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

'; } } diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index f17bd76d8..92d7b475a 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -3085,15 +3085,15 @@ abstract class ComponentbuilderHelper } /** - * Move File to Server - * - * @param string $localPath The local path to the file - * @param string $fileName The the actual file name - * @param int $serverID The server local id to use - * @param int $protocol The server protocol to use - * @param string $permission The permission validation area - * - * @return bool true on success + * Move File to Server + * + * @param string $localPath The local path to the file + * @param string $fileName The the actual file name + * @param int $serverID The server local id to use + * @param int $protocol The server protocol to use + * @param string $permission The permission validation area + * + * @return bool true on success **/ public static function moveToServer($localPath, $fileName, $serverID, $protocol = null, $permission = 'core.export') { @@ -3128,23 +3128,23 @@ abstract class ComponentbuilderHelper } /** - * the SFTP objects + * the SFTP objects **/ protected static $sftp = array(); /** - * the FTP objects + * the FTP objects **/ protected static $ftp = array(); /** - * get the server object - * - * @param int $serverID The server local id to use - * @param int $protocol The server protocol to use - * @param string $permission The permission validation area - * - * @return object on success server object + * get the server object + * + * @param int $serverID The server local id to use + * @param int $protocol The server protocol to use + * @param string $permission The permission validation area + * + * @return object on success server object **/ public static function getServer($serverID, $protocol = null, $permission = 'core.export') { @@ -3167,12 +3167,12 @@ abstract class ComponentbuilderHelper } /** - * get the sftp object - * - * @param int $serverID The server local id to use - * @param string $permission The permission validation area - * - * @return object on success with sftp power + * get the sftp object + * + * @param int $serverID The server local id to use + * @param string $permission The permission validation area + * + * @return object on success with sftp power **/ public static function getSftp($serverID, $permission = 'core.export') { @@ -3326,12 +3326,12 @@ abstract class ComponentbuilderHelper } /** - * get the JClientFtp object - * - * @param int $serverID The server local id to use - * @param string $permission The permission validation area - * - * @return object on success with ftp power + * get the JClientFtp object + * + * @param int $serverID The server local id to use + * @param string $permission The permission validation area + * + * @return object on success with ftp power **/ public static function getFtp($serverID, $permission) { @@ -3417,13 +3417,13 @@ abstract class ComponentbuilderHelper } /** - * get the server details - * - * @param int $serverID The server local id to use - * @param int $protocol The server protocol to use - * @param string $permission The permission validation area - * - * @return object on success with server details + * get the server details + * + * @param int $serverID The server local id to use + * @param int $protocol The server protocol to use + * @param string $permission The permission validation area + * + * @return object on success with server details **/ public static function getServerDetails($serverID, $protocol = 2, $permission = 'core.export') {