diff --git a/README.md b/README.md index fab9ee023..57d06d7cf 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.8.0) 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*: 30th May, 2018 ++ *Version*: 2.8.0 + *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*: **185584** ++ *Field count*: **1054** ++ *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..57d06d7cf 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.8.0) 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*: 30th May, 2018 ++ *Version*: 2.8.0 + *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*: **185584** ++ *Field count*: **1054** ++ *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..00d61bc96 --- /dev/null +++ b/admin/assets/css/admin_fields_relations.css @@ -0,0 +1,16 @@ +/** + * @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 */ + + +.codefield { +width: 500px; +} 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/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php index c8cea1c53..f49a9d300 100644 --- a/admin/compiler/joomla_3/Helper.php +++ b/admin/compiler/joomla_3/Helper.php @@ -647,7 +647,7 @@ abstract class ###Component###Helper } } // check if there are any view values remaining - if (count($_result)) + if (count((array)$_result)) { $_result = json_encode($_result); $_result = array($_result); @@ -841,7 +841,7 @@ abstract class ###Component###Helper **/ public static function checkArray($array, $removeEmptyString = false) { - if (isset($array) && is_array($array) && count($array) > 0) + if (isset($array) && is_array($array) && count((array)$array) > 0) { // also make sure the empty strings are removed if ($removeEmptyString) @@ -944,7 +944,7 @@ abstract class ###Component###Helper { $initial = strlen($string); $words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE); - $words_count = count($words); + $words_count = count((array)$words); $word_length = 0; $last_word = 0; diff --git a/admin/compiler/joomla_3/Helper_email.php b/admin/compiler/joomla_3/Helper_email.php index a0399c52b..370b827a2 100644 --- a/admin/compiler/joomla_3/Helper_email.php +++ b/admin/compiler/joomla_3/Helper_email.php @@ -232,7 +232,7 @@ abstract class ###Component###Email if (is_array($mailreply)) { $mail->ClearReplyTos(); - $numReplyTo = count($mailreply); + $numReplyTo = count((array)$mailreply); for ($i=0; $i < $numReplyTo; $i++) { $mail->addReplyTo($mailreply[$i], $replyname[$i]); diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php index 277a746c2..0e81e73de 100644 --- a/admin/compiler/joomla_3/Helper_site.php +++ b/admin/compiler/joomla_3/Helper_site.php @@ -293,7 +293,7 @@ abstract class ###Component###Helper } } // check if there are any view values remaining - if (count($_result)) + if (count((array)$_result)) { $_result = json_encode($_result); $_result = array($_result); @@ -833,7 +833,7 @@ abstract class ###Component###Helper **/ public static function checkArray($array, $removeEmptyString = false) { - if (isset($array) && is_array($array) && count($array) > 0) + if (isset($array) && is_array($array) && count((array)$array) > 0) { // also make sure the empty strings are removed if ($removeEmptyString) @@ -936,7 +936,7 @@ abstract class ###Component###Helper { $initial = strlen($string); $words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE); - $words_count = count($words); + $words_count = count((array)$words); $word_length = 0; $last_word = 0; diff --git a/admin/config.xml b/admin/config.xml index efaaa8bab..b05392b0d 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -325,7 +325,7 @@ COM_COMPONENTBUILDER_CONFIG_ON - + - + + /> + /> + /> + /> + /> - + - + + /> + /> + /> - + + /> + /> + /> + /> + /> + /> - + + /> '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.php b/admin/controllers/admin_fields.php index e4ea5afbf..8f36355f0 100644 --- a/admin/controllers/admin_fields.php +++ b/admin/controllers/admin_fields.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerAdmin_fields extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/admin_fields_conditions.php b/admin/controllers/admin_fields_conditions.php index 25070ba01..8e8fd0bab 100644 --- a/admin/controllers/admin_fields_conditions.php +++ b/admin/controllers/admin_fields_conditions.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerAdmin_fields_conditions extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/admin_fields_relations.php b/admin/controllers/admin_fields_relations.php new file mode 100644 index 000000000..4bac598b1 --- /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..cef4e30dc 100644 --- a/admin/controllers/admin_view.php +++ b/admin/controllers/admin_view.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. @@ -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/controllers/ajax.json.php b/admin/controllers/ajax.json.php index 3a217365a..9d871d3b7 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -53,6 +53,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy $this->registerTask('checkRuleName', 'ajax'); $this->registerTask('fieldOptions', 'ajax'); $this->registerTask('getFieldPropertyDesc', 'ajax'); + $this->registerTask('getCodeGlueOptions', 'ajax'); $this->registerTask('snippetDetails', 'ajax'); $this->registerTask('setSnippetGithub', 'ajax'); $this->registerTask('getSnippets', 'ajax'); @@ -1032,6 +1033,47 @@ class ComponentbuilderControllerAjax extends JControllerLegacy } } break; + case 'getCodeGlueOptions': + try + { + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $listfieldValue = $jinput->get('listfield', NULL, 'INT'); + $joinfieldsValue = $jinput->get('joinfields', NULL, 'STRING'); + $typeValue = $jinput->get('type', NULL, 'INT'); + $areaValue = $jinput->get('area', NULL, 'INT'); + if($listfieldValue && $joinfieldsValue && $typeValue && $areaValue && $user->id != 0) + { + $result = $this->getModel('ajax')->getCodeGlueOptions($listfieldValue, $joinfieldsValue, $typeValue, $areaValue); + } + else + { + $result = false; + } + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback."(".json_encode($e).");"; + } + else + { + echo "(".json_encode($e).");"; + } + } + break; case 'snippetDetails': try { diff --git a/admin/controllers/component_admin_views.php b/admin/controllers/component_admin_views.php index 42c6e217b..4266e67d9 100644 --- a/admin/controllers/component_admin_views.php +++ b/admin/controllers/component_admin_views.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_admin_views extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/component_config.php b/admin/controllers/component_config.php index b103484ec..51fe78f28 100644 --- a/admin/controllers/component_config.php +++ b/admin/controllers/component_config.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_config extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/component_custom_admin_menus.php b/admin/controllers/component_custom_admin_menus.php index ad5bd0fcf..172e2cf68 100644 --- a/admin/controllers/component_custom_admin_menus.php +++ b/admin/controllers/component_custom_admin_menus.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/component_custom_admin_views.php b/admin/controllers/component_custom_admin_views.php index 21a76b9f1..9372160c5 100644 --- a/admin/controllers/component_custom_admin_views.php +++ b/admin/controllers/component_custom_admin_views.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/component_dashboard.php b/admin/controllers/component_dashboard.php index 31b8a06a5..14a88a2f7 100644 --- a/admin/controllers/component_dashboard.php +++ b/admin/controllers/component_dashboard.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_dashboard extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/component_files_folders.php b/admin/controllers/component_files_folders.php index 18c4c9c00..325831bae 100644 --- a/admin/controllers/component_files_folders.php +++ b/admin/controllers/component_files_folders.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_files_folders extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/component_mysql_tweaks.php b/admin/controllers/component_mysql_tweaks.php index 1913e38ba..fbb09c64b 100644 --- a/admin/controllers/component_mysql_tweaks.php +++ b/admin/controllers/component_mysql_tweaks.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/component_site_views.php b/admin/controllers/component_site_views.php index d0d8f354f..107968ace 100644 --- a/admin/controllers/component_site_views.php +++ b/admin/controllers/component_site_views.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_site_views extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/component_updates.php b/admin/controllers/component_updates.php index e4b0ef752..32f148775 100644 --- a/admin/controllers/component_updates.php +++ b/admin/controllers/component_updates.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerComponent_updates extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/custom_admin_view.php b/admin/controllers/custom_admin_view.php index 353d74857..b792bd388 100644 --- a/admin/controllers/custom_admin_view.php +++ b/admin/controllers/custom_admin_view.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerCustom_admin_view extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/custom_code.php b/admin/controllers/custom_code.php index 8f2d90e48..19c277779 100644 --- a/admin/controllers/custom_code.php +++ b/admin/controllers/custom_code.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerCustom_code extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/dynamic_get.php b/admin/controllers/dynamic_get.php index 3f25d6985..0397d17f7 100644 --- a/admin/controllers/dynamic_get.php +++ b/admin/controllers/dynamic_get.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerDynamic_get extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/field.php b/admin/controllers/field.php index a8d10bc76..a6056d8b4 100644 --- a/admin/controllers/field.php +++ b/admin/controllers/field.php @@ -68,9 +68,9 @@ class ComponentbuilderControllerField extends JControllerForm */ protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/fieldtype.php b/admin/controllers/fieldtype.php index 64dbf0c7f..bde8f4b3d 100644 --- a/admin/controllers/fieldtype.php +++ b/admin/controllers/fieldtype.php @@ -68,9 +68,9 @@ class ComponentbuilderControllerFieldtype extends JControllerForm */ protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/help_document.php b/admin/controllers/help_document.php index 034b2ccaf..cd78cad2d 100644 --- a/admin/controllers/help_document.php +++ b/admin/controllers/help_document.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerHelp_document extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/joomla_component.php b/admin/controllers/joomla_component.php index 80abf0beb..fbebe0efc 100644 --- a/admin/controllers/joomla_component.php +++ b/admin/controllers/joomla_component.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/language.php b/admin/controllers/language.php index ece4d40cb..0796119e7 100644 --- a/admin/controllers/language.php +++ b/admin/controllers/language.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerLanguage extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/language_translation.php b/admin/controllers/language_translation.php index 22b501e07..5d0ba8668 100644 --- a/admin/controllers/language_translation.php +++ b/admin/controllers/language_translation.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerLanguage_translation extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/layout.php b/admin/controllers/layout.php index f72bbedc8..fb33821ea 100644 --- a/admin/controllers/layout.php +++ b/admin/controllers/layout.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerLayout extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/library.php b/admin/controllers/library.php index fb25371d4..39e898f97 100644 --- a/admin/controllers/library.php +++ b/admin/controllers/library.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerLibrary extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/library_config.php b/admin/controllers/library_config.php index 7b3a81bf2..c77e02521 100644 --- a/admin/controllers/library_config.php +++ b/admin/controllers/library_config.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerLibrary_config extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/library_files_folders_urls.php b/admin/controllers/library_files_folders_urls.php index 7e74527d2..2734776cc 100644 --- a/admin/controllers/library_files_folders_urls.php +++ b/admin/controllers/library_files_folders_urls.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends JControllerFo protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/server.php b/admin/controllers/server.php index d5e53effc..0b73ab6b5 100644 --- a/admin/controllers/server.php +++ b/admin/controllers/server.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerServer extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/site_view.php b/admin/controllers/site_view.php index a092a4e42..5310ae3c3 100644 --- a/admin/controllers/site_view.php +++ b/admin/controllers/site_view.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerSite_view extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/snippet.php b/admin/controllers/snippet.php index cb4221acc..449d3bdb2 100644 --- a/admin/controllers/snippet.php +++ b/admin/controllers/snippet.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerSnippet extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/snippet_type.php b/admin/controllers/snippet_type.php index 16948f20e..515e78e50 100644 --- a/admin/controllers/snippet_type.php +++ b/admin/controllers/snippet_type.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerSnippet_type extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/template.php b/admin/controllers/template.php index c41455554..0368951b2 100644 --- a/admin/controllers/template.php +++ b/admin/controllers/template.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerTemplate extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/controllers/validation_rule.php b/admin/controllers/validation_rule.php index a64758e6a..3ab742f8e 100644 --- a/admin/controllers/validation_rule.php +++ b/admin/controllers/validation_rule.php @@ -69,9 +69,9 @@ class ComponentbuilderControllerValidation_rule extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 2398a2093..9b791efce 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -25,7 +25,6 @@ class Compiler extends Infusion * * @var string */ - private $tempPath; /* @@ -72,7 +71,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, '', ''); @@ -155,7 +154,7 @@ class Compiler extends Infusion foreach ($mismatch as $string) { $constant = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($string, 'U'); - $this->app->enqueueMessage(JText::sprintf('The Joomla.JText._(\'%s\') language constant for %s does not have a corresponding JText::script(\'%s\') decalaration, please add it.', $constant, $string, $string), 'Warning'); + $this->app->enqueueMessage(JText::sprintf('The Joomla.JText._('%s') language constant for %s does not have a corresponding JText::script('%s') decalaration, please add it.', $constant, $string, $string), 'Warning'); } $this->app->enqueueMessage('
', 'Warning'); } @@ -200,9 +199,9 @@ class Compiler extends Infusion /** * Set the dynamic data to the created fils - * + * * @return bool true on success - * + * */ protected function updateFiles() { @@ -215,28 +214,7 @@ class Compiler extends Infusion { if (JFile::exists($static['path'])) { - $this->fileContentStatic['###FILENAME###'] = $static['name']; - $php = ''; - if (ComponentbuilderHelper::checkFileType($static['name'], 'php')) - { - $php = "setPlaceholders($string, $this->fileContentStatic, 3); - // add to zip array - $this->writeFile($static['path'], $answer); - } - else - { - $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); - // add to zip array - $this->writeFile($static['path'], $answer); - } - $this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL); + $this->setFileContent($static['name'], $static['path'], $bom); } } // now we do the dynamic files @@ -250,32 +228,7 @@ class Compiler extends Infusion { if (JFile::exists($file['path'])) { - $this->fileContentStatic['###FILENAME###'] = $file['name']; - // do some weird stuff to improve the verion and dates being added to the license - $this->fixLicenseValues($file); - $php = ''; - if (ComponentbuilderHelper::checkFileType($file['name'], 'php')) - { - $php = "setPlaceholders($string, $this->fileContentStatic, 3); - $answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3); - // add to zip array - $this->writeFile($file['path'], $answer); - } - else - { - $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); - $answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3); - // add to zip array - $this->writeFile($file['path'], $answer); - } - $this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL); + $this->setFileContent($file['name'], $file['path'], $bom, $file['view']); } } } @@ -291,10 +244,47 @@ class Compiler extends Infusion } /** - * move the local update server xml file to a remote ftp server - * + * set the file content + * * @return void - * + * + */ + protected function setFileContent(&$name, &$path, &$bom, $view = null) + { + // set the file name + $this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $name; + // check if the file should get PHP opening + $php = ''; + if (ComponentbuilderHelper::checkFileType($name, 'php')) + { + $php = "hhh . 'BOM' . $this->hhh) !== false) + { + list($wast, $code) = explode($this->hhh . 'BOM' . $this->hhh, $string); + $string = $php . $bom . $code; + } + // set the answer + $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); + // set the dynamic answer + if ($view) + { + $answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3); + } + // add answer back to file + $this->writeFile($path, $answer); + // count the file lines + $this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL); + } + + /** + * move the local update server xml file to a remote ftp server + * + * @return void + * */ protected function setUpdateServer() { @@ -321,7 +311,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 +330,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 +389,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 +404,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..3798a291d 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 * @@ -466,6 +487,27 @@ class Get */ public $catOtherName = array(); + /** + * The field relations values + * + * @var array + */ + public $fieldRelations = array(); + + /** + * The list join fields + * + * @var array + */ + public $listJoinBuilder = array(); + + /** + * The list head over ride + * + * @var array + */ + public $listHeadOverRide = array(); + /** * The linked admin view tabs * @@ -620,7 +662,21 @@ class Get */ public $setTidyWarning = false; - /* * * + /** + * Tab/spacer bucket (to speed-up the build) + * + * @var array + */ + public $tabSpacerBucket = array(); + + /** + * Set tab/spacer + * + * @var string + */ + public $tabSpacer = "\t"; + + /** * Constructor */ @@ -710,6 +766,26 @@ class Get return false; } + /** + * Set the tab/space + * + * @param int $nr The number of tag/space + * + * @return string + * + */ + public function _t($nr) + { + // check if we already have the string + if (!isset($this->tabSpacerBucket[$nr])) + { + // get the string + $this->tabSpacerBucket[$nr] = str_repeat($this->tabSpacer, (int) $nr); + } + // return stored string + return $this->tabSpacerBucket[$nr]; + } + /** * Set the line number in comments * @@ -834,12 +910,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); @@ -1319,18 +1395,21 @@ class Get 'b.addfields', 'b.id', 'c.addconditions', - 'c.id' + 'c.id', + 'r.addrelations' ), array( 'addfields', 'addfields_id', 'addconditions', - 'addconditions_id' + 'addconditions_id', + 'addrelations' ) ) ); $query->from('#__componentbuilder_admin_view AS a'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields', 'b') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('b.admin_view') . ')'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields_conditions', 'c') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('c.admin_view') . ')'); + $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields_relations', 'r') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('r.admin_view') . ')'); $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); // Reset the query using our newly populated query object. @@ -1376,18 +1455,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)) @@ -1603,7 +1682,7 @@ class Get $conditionValue['match_type'] = $type; $conditionValue['match_xml'] = $fieldValue['settings']->xml; // if custom field load field being extended - if (!ComponentbuilderHelper::typeField($type)) + if (!ComponentbuilderHelper::fieldCheck($type)) { $conditionValue['match_extends'] = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml, 'extends="', '"'); } @@ -1621,6 +1700,53 @@ class Get } } unset($view->addconditions); + + // prep the buckets + $this->fieldRelations[$name_list] = array(); + $this->listJoinBuilder[$name_list] = array(); + $this->listHeadOverRide[$name_list] = array(); + // set the relations + $view->addrelations = (isset($view->addrelations) && ComponentbuilderHelper::checkJson($view->addrelations)) ? json_decode($view->addrelations, true) : null; + if (ComponentbuilderHelper::checkArray($view->addrelations)) + { + foreach ($view->addrelations as $nr => $relationsValue) + { + // only add if list view field is selected and joind fields are set + if (isset($relationsValue['listfield']) && + is_numeric($relationsValue['listfield']) && + $relationsValue['listfield'] > 0 && + isset($relationsValue['joinfields']) && + ComponentbuilderHelper::checkArray($relationsValue['joinfields'])) + { + // do a dynamic update on the set values + if (isset($relationsValue['set']) && ComponentbuilderHelper::checkString($relationsValue['set'])) + { + $relationsValue['set'] = $this->setDynamicValues($relationsValue['set']); + } + // load the field relations + $this->fieldRelations[$name_list][(int) $relationsValue['listfield']] = $relationsValue; + // load the list joints + foreach ($relationsValue['joinfields'] as $join) + { + $this->listJoinBuilder[$name_list][(int) $join] = (int) $join; + } + // set header over-ride + if (isset($relationsValue['column_name']) && ComponentbuilderHelper::checkString($relationsValue['column_name'])) + { + $check_column_name = trim(strtolower($relationsValue['column_name'])); + // confirm it should really make the over ride + if ('default' !== $check_column_name) + { + $column_name_lang = ComponentbuilderHelper::safeString($name_list, 'U') . '_' . ComponentbuilderHelper::safeString($relationsValue['column_name'], 'U'); + $this->langContent['admin'][$column_name_lang] = trim($relationsValue['column_name']); + $this->listHeadOverRide[$name_list][(int) $relationsValue['listfield']] = $column_name_lang; + } + } + } + } + } + unset($view->addrelations); + // set linked views $this->linkedAdminViews[$name_single] = null; $view->addlinked_views = (isset($view->addlinked_views) && ComponentbuilderHelper::checkJson($view->addlinked_views)) ? json_decode($view->addlinked_views, true) : null; @@ -1819,18 +1945,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 +3731,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(); @@ -3809,7 +3935,7 @@ class Get } if (ComponentbuilderHelper::checkArray($gets) && ComponentbuilderHelper::checkArray($keys)) { - $querySelect = '$query->select($db->quoteName(' . PHP_EOL . "\t\t\t" . 'array(' . implode(',', $gets) . '),' . PHP_EOL . "\t\t\t" . 'array(' . implode(',', $keys) . ')));'; + $querySelect = '$query->select($db->quoteName(' . PHP_EOL . $this->_t(3) . 'array(' . implode(',', $gets) . '),' . PHP_EOL . $this->_t(3) . 'array(' . implode(',', $keys) . ')));'; $queryFrom = '$db->quoteName(' . $this->db->quote($table) . ', ' . $this->db->quote($as) . ')'; // return the select query return array('select' => $querySelect, 'from' => $queryFrom, 'name' => $queryName, 'table' => $table, 'type' => $type, 'select_gets' => $gets, 'select_keys' => $keys); @@ -3938,9 +4064,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 +4568,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 +4598,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 +5169,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 +5886,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..8b1b4a720 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 . $this->_t(2) . "" . $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 . $this->_t(2) . "" . $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 . $this->_t(2) . "" . $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 . $this->_t(3) . "" . $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..f01c17726 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; @@ -457,7 +457,7 @@ class Fields extends Structure $readOnly = false; if ($view['settings']->type == 2) { - $readOnly = "\t\t\t" . 'readonly="true"' . PHP_EOL . "\t\t\t" . 'disabled="true"'; + $readOnly = $this->_t(3) . 'readonly="true"' . PHP_EOL . $this->_t(3) . 'disabled="true"'; } // start adding dynamc fields $dynamicFields = ''; @@ -471,157 +471,157 @@ class Fields extends Structure // set the default fields $fieldSet = array(); $fieldSet[] = '
'; - $fieldSet[] = "\t\t"; - $fieldSet[] = "\t\t"; + $fieldSet[] = $this->_t(2) . ""; + $fieldSet[] = $this->_t(2) . ""; // if id is not set if (!isset($this->fieldsNames[$view_name_single]['id'])) { - $fieldSet[] = "\t\t_t(2) . "_t(3) . "name=" . '"id"'; + $fieldSet[] = $this->_t(3) . 'type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"'; + $fieldSet[] = $this->_t(3) . 'description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"'; + $fieldSet[] = $this->_t(3) . 'readonly="true"'; + $fieldSet[] = $this->_t(2) . "/>"; // count the static field created $this->fieldCount++; } // if created is not set if (!isset($this->fieldsNames[$view_name_single]['created'])) { - $fieldSet[] = "\t\t"; - $fieldSet[] = "\t\t_t(2) . ""; + $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"created"'; + $fieldSet[] = $this->_t(3) . "type=" . '"calendar"'; + $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView . '_CREATED_DATE_LABEL"'; + $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView . '_CREATED_DATE_DESC"'; + $fieldSet[] = $this->_t(3) . "size=" . '"22"'; if ($readOnly) { $fieldSet[] = $readOnly; } - $fieldSet[] = "\t\t\tformat=" . '"%Y-%m-%d %H:%M:%S"'; - $fieldSet[] = "\t\t\tfilter=" . '"user_utc"'; - $fieldSet[] = "\t\t/>"; + $fieldSet[] = $this->_t(3) . "format=" . '"%Y-%m-%d %H:%M:%S"'; + $fieldSet[] = $this->_t(3) . "filter=" . '"user_utc"'; + $fieldSet[] = $this->_t(2) . "/>"; // count the static field created $this->fieldCount++; } // if created_by is not set if (!isset($this->fieldsNames[$view_name_single]['created_by'])) { - $fieldSet[] = "\t\t"; - $fieldSet[] = "\t\t_t(2) . ""; + $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"created_by"'; + $fieldSet[] = $this->_t(3) . "type=" . '"user"'; + $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView . '_CREATED_BY_LABEL"'; if ($readOnly) { $fieldSet[] = $readOnly; } - $fieldSet[] = "\t\t\tdescription=" . '"' . $langView . '_CREATED_BY_DESC"'; - $fieldSet[] = "\t\t/>"; + $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView . '_CREATED_BY_DESC"'; + $fieldSet[] = $this->_t(2) . "/>"; // count the static field created $this->fieldCount++; } // if published is not set if (!isset($this->fieldsNames[$view_name_single]['published'])) { - $fieldSet[] = "\t\t"; - $fieldSet[] = "\t\t_t(2) . ""; + $fieldSet[] = $this->_t(2) . "_t(3) . "description=" . '"JFIELD_PUBLISHED_DESC" class="chzn-color-state"'; if ($readOnly) { $fieldSet[] = $readOnly; } - $fieldSet[] = "\t\t\tfilter=" . '"intval" size="1" default="1" >'; - $fieldSet[] = "\t\t\t"; - $fieldSet[] = "\t\t\t"; - $fieldSet[] = "\t\t\t"; - $fieldSet[] = "\t\t\t"; - $fieldSet[] = "\t\t"; + $fieldSet[] = $this->_t(3) . "filter=" . '"intval" size="1" default="1" >'; + $fieldSet[] = $this->_t(3) . ""; + $fieldSet[] = $this->_t(3) . ""; + $fieldSet[] = $this->_t(3) . ""; + $fieldSet[] = $this->_t(3) . ""; + $fieldSet[] = $this->_t(2) . ""; // count the static field created $this->fieldCount++; } // if modified is not set if (!isset($this->fieldsNames[$view_name_single]['modified'])) { - $fieldSet[] = "\t\t"; - $fieldSet[] = "\t\t" . ''; + $fieldSet[] = $this->_t(2) . ""; + $fieldSet[] = $this->_t(2) . '_t(3) . 'label="' . $langView . '_MODIFIED_DATE_LABEL" description="' . $langView . '_MODIFIED_DATE_DESC"'; + $fieldSet[] = $this->_t(3) . 'size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />'; // count the static field created $this->fieldCount++; } // if modified_by is not set if (!isset($this->fieldsNames[$view_name_single]['modified_by'])) { - $fieldSet[] = "\t\t"; - $fieldSet[] = "\t\t" . '_t(2) . ""; + $fieldSet[] = $this->_t(2) . '_t(3) . 'label="' . $langView . '_MODIFIED_BY_LABEL"'; + $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView . '_MODIFIED_BY_DESC"'; + $fieldSet[] = $this->_t(3) . 'class="readonly"'; + $fieldSet[] = $this->_t(3) . 'readonly="true"'; + $fieldSet[] = $this->_t(3) . 'filter="unset"'; + $fieldSet[] = $this->_t(2) . "/>"; // count the static field created $this->fieldCount++; } // check if view has access if (isset($this->accessBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view_name_single]) && !isset($this->fieldsNames[$view_name_single]['access'])) { - $fieldSet[] = "\t\t"; - $fieldSet[] = "\t\t" . '_t(2) . ""; + $fieldSet[] = $this->_t(2) . '_t(3) . 'type="accesslevel"'; + $fieldSet[] = $this->_t(3) . 'label="JFIELD_ACCESS_LABEL"'; + $fieldSet[] = $this->_t(3) . 'description="JFIELD_ACCESS_DESC"'; + $fieldSet[] = $this->_t(3) . 'default="1"'; if ($readOnly) { $fieldSet[] = $readOnly; } - $fieldSet[] = "\t\t\t" . 'required="false"'; - $fieldSet[] = "\t\t/>"; + $fieldSet[] = $this->_t(3) . 'required="false"'; + $fieldSet[] = $this->_t(2) . "/>"; // count the static field created $this->fieldCount++; } // if ordering is not set if (!isset($this->fieldsNames[$view_name_single]['ordering'])) { - $fieldSet[] = "\t\t"; - $fieldSet[] = "\t\t_t(2) . ""; + $fieldSet[] = $this->_t(2) . "_t(3) . 'name="ordering"'; + $fieldSet[] = $this->_t(3) . 'type="number"'; + $fieldSet[] = $this->_t(3) . 'class="inputbox validate-ordering"'; + $fieldSet[] = $this->_t(3) . 'label="' . $langView . '_ORDERING_LABEL' . '"'; + $fieldSet[] = $this->_t(3) . 'description=""'; + $fieldSet[] = $this->_t(3) . 'default="0"'; + $fieldSet[] = $this->_t(3) . 'size="6"'; if ($readOnly) { $fieldSet[] = $readOnly; } - $fieldSet[] = "\t\t\t" . 'required="false"'; - $fieldSet[] = "\t\t/>"; + $fieldSet[] = $this->_t(3) . 'required="false"'; + $fieldSet[] = $this->_t(2) . "/>"; // count the static field created $this->fieldCount++; } // if version is not set if (!isset($this->fieldsNames[$view_name_single]['version'])) { - $fieldSet[] = "\t\t"; - $fieldSet[] = "\t\t_t(2) . ""; + $fieldSet[] = $this->_t(2) . "_t(3) . 'name="version"'; + $fieldSet[] = $this->_t(3) . 'type="text"'; + $fieldSet[] = $this->_t(3) . 'class="readonly"'; + $fieldSet[] = $this->_t(3) . 'label="' . $langView . '_VERSION_LABEL"'; + $fieldSet[] = $this->_t(3) . 'description="' . $langView . '_VERSION_DESC"'; + $fieldSet[] = $this->_t(3) . 'size="6"'; + $fieldSet[] = $this->_t(3) . 'readonly="true"'; + $fieldSet[] = $this->_t(3) . 'filter="unset"'; + $fieldSet[] = $this->_t(2) . "/>"; // count the static field created $this->fieldCount++; } @@ -629,77 +629,77 @@ class Fields extends Structure if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single])) { // metakey - $fieldSet[] = "\t\t"; - $fieldSet[] = "\t\t_t(2) . ""; + $fieldSet[] = $this->_t(2) . "_t(3) . 'name="metakey"'; + $fieldSet[] = $this->_t(3) . 'type="textarea"'; + $fieldSet[] = $this->_t(3) . 'label="JFIELD_META_KEYWORDS_LABEL"'; + $fieldSet[] = $this->_t(3) . 'description="JFIELD_META_KEYWORDS_DESC"'; + $fieldSet[] = $this->_t(3) . 'rows="3"'; + $fieldSet[] = $this->_t(3) . 'cols="30"'; + $fieldSet[] = $this->_t(2) . "/>"; // count the static field created $this->fieldCount++; // metadesc - $fieldSet[] = "\t\t"; - $fieldSet[] = "\t\t_t(2) . ""; + $fieldSet[] = $this->_t(2) . "_t(3) . 'name="metadesc"'; + $fieldSet[] = $this->_t(3) . 'type="textarea"'; + $fieldSet[] = $this->_t(3) . 'label="JFIELD_META_DESCRIPTION_LABEL"'; + $fieldSet[] = $this->_t(3) . 'description="JFIELD_META_DESCRIPTION_DESC"'; + $fieldSet[] = $this->_t(3) . 'rows="3"'; + $fieldSet[] = $this->_t(3) . 'cols="30"'; + $fieldSet[] = $this->_t(2) . "/>"; // count the static field created $this->fieldCount++; } // load the dynamic fields now if (ComponentbuilderHelper::checkString($dynamicFields)) { - $fieldSet[] = "\t\t" . $dynamicFields; + $fieldSet[] = $this->_t(2) . "" . $dynamicFields; } // close fieldset - $fieldSet[] = "\t
"; + $fieldSet[] = $this->_t(1) . ""; // check if metadata is added to this view if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single])) { - $fieldSet[] = PHP_EOL . "\t"; - $fieldSet[] = "\t'; - $fieldSet[] = "\t\t" . '
'; + $fieldSet[] = PHP_EOL . $this->_t(1) . ""; + $fieldSet[] = $this->_t(1) . "'; + $fieldSet[] = $this->_t(2) . '
_t(3) . 'label="JGLOBAL_FIELDSET_METADATA_OPTIONS">'; // robots - $fieldSet[] = "\t\t\t"; - $fieldSet[] = "\t\t\t" . ''; - $fieldSet[] = "\t\t\t\t" . ''; - $fieldSet[] = "\t\t\t\t" . ''; - $fieldSet[] = "\t\t\t\t" . ''; - $fieldSet[] = "\t\t\t\t" . ''; - $fieldSet[] = "\t\t\t\t" . ''; - $fieldSet[] = "\t\t\t" . ''; + $fieldSet[] = $this->_t(3) . ""; + $fieldSet[] = $this->_t(3) . '_t(4) . 'type="list"'; + $fieldSet[] = $this->_t(4) . 'label="JFIELD_METADATA_ROBOTS_LABEL"'; + $fieldSet[] = $this->_t(4) . 'description="JFIELD_METADATA_ROBOTS_DESC" >'; + $fieldSet[] = $this->_t(4) . ''; + $fieldSet[] = $this->_t(4) . ''; + $fieldSet[] = $this->_t(4) . ''; + $fieldSet[] = $this->_t(4) . ''; + $fieldSet[] = $this->_t(4) . ''; + $fieldSet[] = $this->_t(3) . ''; // count the static field created $this->fieldCount++; // author - $fieldSet[] = "\t\t\t"; - $fieldSet[] = "\t\t\t" . '_t(3) . ""; + $fieldSet[] = $this->_t(3) . '_t(4) . 'type="text"'; + $fieldSet[] = $this->_t(4) . 'label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"'; + $fieldSet[] = $this->_t(4) . 'size="20"'; + $fieldSet[] = $this->_t(3) . "/>"; // count the static field created $this->fieldCount++; // rights - $fieldSet[] = "\t\t\t"; - $fieldSet[] = "\t\t\t" . '_t(3) . ""; + $fieldSet[] = $this->_t(3) . '_t(4) . 'description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"'; + $fieldSet[] = $this->_t(4) . 'cols="30" rows="2"'; + $fieldSet[] = $this->_t(3) . "/>"; // count the static field created $this->fieldCount++; - $fieldSet[] = "\t\t
"; - $fieldSet[] = "\t"; + $fieldSet[] = $this->_t(2) . "
"; + $fieldSet[] = $this->_t(1) . ""; } // retunr the set return implode(PHP_EOL, $fieldSet); @@ -1075,7 +1075,7 @@ class Fields extends Structure // set the array of field names $this->setFieldsNames($view_name_single, $fieldAttributes['name']); - if ($this->defaultField($typeName, 'option')) + if (ComponentbuilderHelper::fieldCheck($typeName, 'option')) { //reset options array $optionArray = array(); @@ -1087,7 +1087,7 @@ class Fields extends Structure $this->setBuilders($langLabel, $langView, $view_name_single, $view_name_list, $name, $view, $field, $typeName, $multiple, false, $optionArray); } } - elseif ($this->defaultField($typeName, 'plain')) + elseif (ComponentbuilderHelper::fieldCheck($typeName, 'plain')) { if ($build) { @@ -1097,7 +1097,7 @@ class Fields extends Structure // now add to the field set $dynamicField = $this->setField('plain', $fieldAttributes, $name, $typeName, $langView, $view_name_single, $view_name_list, $placeholders, $optionArray); } - elseif ($this->defaultField($typeName, 'spacer')) + elseif (ComponentbuilderHelper::fieldCheck($typeName, 'spacer')) { if ($build) { @@ -1117,7 +1117,7 @@ class Fields extends Structure // now add to the field set $dynamicField = $this->setField('spacer', $fieldAttributes, $name, $typeName, $langView, $view_name_single, $view_name_list, $placeholders, $optionArray); } - elseif ($this->defaultField($typeName, 'special')) + elseif (ComponentbuilderHelper::fieldCheck($typeName, 'special')) { // set the repeatable field or subform field if ($typeName === 'repeatable' || $typeName === 'subform') @@ -1212,14 +1212,14 @@ class Fields extends Structure if ($setType === 'option') { // now add to the field set - $field .= PHP_EOL . "\t" . $taber . "\t"; - $field .= PHP_EOL . "\t" . $taber . "\t_t(1) . $taber . $this->_t(1) . ""; + $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1) . " $value) { if ($property != 'option') { - $field .= PHP_EOL . "\t\t" . $taber . "\t" . $property . '="' . $value . '"'; + $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . $property . '="' . $value . '"'; } elseif ($property === 'option') { @@ -1238,7 +1238,7 @@ class Fields extends Structure // add to lang array $this->langContent[$this->lang][$langValue] = $t; // no add to option set - $optionSet .= PHP_EOL . "\t" . $taber . "\t\t" . ''; + $optionSet .= PHP_EOL . $this->_t(1) . $taber . $this->_t(2) . ''; $optionArray[$v] = $langValue; } else @@ -1248,7 +1248,7 @@ class Fields extends Structure // add to lang array $this->langContent[$this->lang][$langValue] = $option; // no add to option set - $optionSet .= PHP_EOL . "\t\t" . $taber . "\t" . ''; + $optionSet .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . ''; $optionArray[$option] = $langValue; } } @@ -1264,7 +1264,7 @@ class Fields extends Structure // add to lang array $this->langContent[$this->lang][$langValue] = $t; // no add to option set - $optionSet .= PHP_EOL . "\t\t" . $taber . "\t" . ''; + $optionSet .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . ''; $optionArray[$v] = $langValue; } else @@ -1274,7 +1274,7 @@ class Fields extends Structure // add to lang array $this->langContent[$this->lang][$langValue] = $value; // no add to option set - $optionSet .= PHP_EOL . "\t\t" . $taber . "\t" . ''; + $optionSet .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . ''; $optionArray[$value] = $langValue; } } @@ -1283,41 +1283,41 @@ class Fields extends Structure if (ComponentbuilderHelper::checkString($optionSet)) { $field .= '>'; - $field .= PHP_EOL . "\t\t\t" . $taber . ""; + $field .= PHP_EOL . $this->_t(3) . $taber . ""; $field .= $optionSet; - $field .= PHP_EOL . "\t\t" . $taber . "
"; + $field .= PHP_EOL . $this->_t(2) . $taber . "
"; } elseif ($typeName === 'sql') { $optionArray = false; - $field .= PHP_EOL . "\t\t" . $taber . "/>"; + $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; } else { $optionArray = false; - $field .= PHP_EOL . "\t\t\t" . $taber . ""; - $field .= PHP_EOL . "\t\t" . $taber . "/>"; + $field .= PHP_EOL . $this->_t(3) . $taber . ""; + $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; } } elseif ($setType === 'plain') { // now add to the field set - $field .= PHP_EOL . "\t\t" . $taber . ""; - $field .= PHP_EOL . "\t\t" . $taber . "_t(2) . $taber . ""; + $field .= PHP_EOL . $this->_t(2) . $taber . " $value) { if ($property != 'option') { - $field .= PHP_EOL . "\t\t" . $taber . "\t" . $property . '="' . $value . '"'; + $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . $property . '="' . $value . '"'; } } - $field .= PHP_EOL . "\t\t" . $taber . "/>"; + $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; } elseif ($setType === 'spacer') { // now add to the field set - $field .= PHP_EOL . "\t\t"; - $field .= PHP_EOL . "\t\t_t(2) . ""; + $field .= PHP_EOL . $this->_t(2) . " $value) { if ($property != 'option') @@ -1333,19 +1333,19 @@ class Fields extends Structure if ($typeName === 'repeatable') { // now add to the field set - $field .= PHP_EOL . "\t\t"; - $field .= PHP_EOL . "\t\t_t(2) . ""; + $field .= PHP_EOL . $this->_t(2) . " $value) { if ($property != 'fields') { - $field .= PHP_EOL . "\t\t\t" . $property . '="' . $value . '"'; + $field .= PHP_EOL . $this->_t(3) . $property . '="' . $value . '"'; } } $field .= ">"; - $field .= PHP_EOL . "\t\t\t" . ''; - $field .= PHP_EOL . "\t\t\t\t" . '"; + $field .= PHP_EOL . $this->_t(3) . ""; + $field .= PHP_EOL . $this->_t(2) . "
"; } // set the subform fields (it is a repeatable without the modal) elseif ($typeName === 'subform') { // now add to the field set - $field .= PHP_EOL . "\t\t"; - $field .= PHP_EOL . "\t\t_t(2) . ""; + $field .= PHP_EOL . $this->_t(2) . " $value) { if ($property != 'fields') { - $field .= PHP_EOL . "\t\t\t" . $property . '="' . $value . '"'; + $field .= PHP_EOL . $this->_t(3) . $property . '="' . $value . '"'; } } $field .= ">"; - $field .= PHP_EOL . "\t\t\t" . '"; - $field .= PHP_EOL . "\t\t
"; + $field .= PHP_EOL . $this->_t(3) . ""; + $field .= PHP_EOL . $this->_t(2) . "
"; } } elseif ($setType === 'custom') { // now add to the field set - $field .= PHP_EOL . "\t\t" . $taber . ""; - $field .= PHP_EOL . "\t\t" . $taber . "_t(2) . $taber . ""; + $field .= PHP_EOL . $this->_t(2) . $taber . " $value) { if ($property != 'option') { - $field .= PHP_EOL . "\t\t" . $taber . "\t" . $property . '="' . $value . '"'; + $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . $property . '="' . $value . '"'; } } - $field .= PHP_EOL . "\t\t" . $taber . "/>"; + $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; // incase the field is in the config and has not been set if ('config' === $view_name_single && 'configs' === $view_name_list) { @@ -1715,12 +1715,12 @@ class Fields extends Structure { //reset options array $r_optionArray = array(); - if ($this->defaultField($r_typeName, 'option')) + if (ComponentbuilderHelper::fieldCheck($r_typeName, 'option')) { // now add to the field set ComponentbuilderHelper::xmlAppend($fieldSetXML, $this->setField('option', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray)); } - elseif ($this->defaultField($r_typeName, 'plain')) + elseif (ComponentbuilderHelper::fieldCheck($r_typeName, 'plain')) { // now add to the field set ComponentbuilderHelper::xmlAppend($fieldSetXML, $this->setField('plain', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray)); @@ -1812,12 +1812,12 @@ class Fields extends Structure { //reset options array $r_optionArray = array(); - if ($this->defaultField($r_typeName, 'option')) + if (ComponentbuilderHelper::fieldCheck($r_typeName, 'option')) { // now add to the field set ComponentbuilderHelper::xmlAppend($form, $this->setField('option', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray)); } - elseif ($this->defaultField($r_typeName, 'plain')) + elseif (ComponentbuilderHelper::fieldCheck($r_typeName, 'plain')) { // now add to the field set ComponentbuilderHelper::xmlAppend($form, $this->setField('plain', $r_fieldValues, $r_name, $r_typeName, $langView, $view_name_single, $view_name_list, $placeholders, $r_optionArray)); @@ -2049,7 +2049,7 @@ class Fields extends Structure $fieldAttributes = array(); $setCustom = false; // setup joomla default fields - if (!$this->defaultField($typeName)) + if (!ComponentbuilderHelper::fieldCheck($typeName)) { $fieldAttributes['custom'] = array(); $setCustom = true; @@ -2399,6 +2399,10 @@ class Fields extends Structure $this->dbKeys[$view_name_single][] = $name; } } + // set list switch + $listSwitch = (isset($field['list']) && $field['list'] == 1); + // set list join + $listJoin = (isset($this->listJoinBuilder[$view_name_list][(int) $field['field']])); // add history to this view if (isset($view['history']) && $view['history']) { @@ -2443,10 +2447,34 @@ class Fields extends Structure } } // build the list values - if ((isset($field['list']) && $field['list'] == 1) && $typeName != 'repeatable' && $typeName != 'subform') + if (($listSwitch || $listJoin) && $typeName != 'repeatable' && $typeName != 'subform') { // load to list builder - $this->listBuilder[$view_name_list][] = array( + if ($listSwitch) + { + $this->listBuilder[$view_name_list][] = array( + 'id' => (int) $field['field'], + 'type' => $typeName, + 'code' => $name, + 'lang' => $listLangName, + 'title' => (isset($field['title']) && $field['title']) ? true : false, + 'alias' => (isset($field['alias']) && $field['alias']) ? true : false, + 'link' => (isset($field['link']) && $field['link']) ? true : false, + 'sort' => (isset($field['sort']) && $field['sort']) ? true : false, + 'custom' => $custom, + 'multiple' => $multiple, + 'options' => $options); + } + // build custom builder list + if ($listSwitch || $listJoin) + { + $this->customBuilderList[$view_name_list][] = $name; + } + } + // load the list join builder + if ($listJoin) + { + $this->listJoinBuilder[$view_name_list][(int) $field['field']] = array( 'type' => $typeName, 'code' => $name, 'lang' => $listLangName, @@ -2457,8 +2485,13 @@ class Fields extends Structure 'custom' => $custom, 'multiple' => $multiple, 'options' => $options); - - $this->customBuilderList[$view_name_list][] = $name; + } + // update the field relations + if (isset($this->fieldRelations[$view_name_list]) && isset($this->fieldRelations[$view_name_list][(int) $field['field']])) + { + $this->fieldRelations[$view_name_list][(int) $field['field']]['type'] = $typeName; + $this->fieldRelations[$view_name_list][(int) $field['field']]['code'] = $name; + $this->fieldRelations[$view_name_list][(int) $field['field']]['custom'] = $custom; } // set the hidden field of this view if ($typeName === 'hidden') @@ -2601,7 +2634,7 @@ class Fields extends Structure } // load the json list display fix - if ((isset($field['list']) && $field['list'] == 1) && $typeName != 'repeatable' && $typeName != 'subform') + if (($listSwitch || $listJoin) && $typeName != 'repeatable' && $typeName != 'subform') { if (ComponentbuilderHelper::checkArray($options)) { @@ -2636,12 +2669,12 @@ class Fields extends Structure // check if field should be added to uikit $this->buildSiteFieldData($view_name_single, $name, 'uikit', $typeName); // load the selection translation fix - if (ComponentbuilderHelper::checkArray($options) && (isset($field['list']) && $field['list'] == 1) && $typeName != 'repeatable' && $typeName != 'subform') + if (ComponentbuilderHelper::checkArray($options) && ($listSwitch || $listJoin) && $typeName != 'repeatable' && $typeName != 'subform') { $this->selectionTranslationFixBuilder[$view_name_list][$name] = $options; } // build the sort values - if ($dbSwitch && (isset($field['sort']) && $field['sort'] == 1) && (isset($field['list']) && $field['list'] == 1) && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform')) + if ($dbSwitch && (isset($field['sort']) && $field['sort'] == 1) && ($listSwitch || $listJoin) && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform')) { $this->sortBuilder[$view_name_list][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'custom' => $custom, 'options' => $options); } @@ -2652,7 +2685,7 @@ class Fields extends Structure $this->searchBuilder[$view_name_list][] = array('type' => $typeName, 'code' => $name, 'custom' => $custom, 'list' => $_list); } // build the filter values - if ($dbSwitch && (isset($field['filter']) && $field['filter'] == 1) && (isset($field['list']) && $field['list'] == 1) && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform')) + if ($dbSwitch && (isset($field['filter']) && $field['filter'] == 1) && ($listSwitch || $listJoin) && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform')) { $this->filterBuilder[$view_name_list][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'database' => $view_name_single, 'function' => ComponentbuilderHelper::safeString($name, 'F'), 'custom' => $custom, 'options' => $options); } @@ -2691,22 +2724,22 @@ class Fields extends Structure $this->buildDynamique($target, 'field' . $data['custom']['extends'], $data['custom']['type']); // set tab and break replacements $tabBreak = array( - '\t' => "\t", + '\t' => $this->_t(1), '\n' => PHP_EOL ); // 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'])) @@ -2723,7 +2756,7 @@ class Fields extends Structure } else { - $phpCode .= PHP_EOL . "\t\t" . $this->setPlaceholders($code, $tabBreak); + $phpCode .= PHP_EOL . $this->_t(2) . $this->setPlaceholders($code, $tabBreak); } } } @@ -2757,7 +2790,7 @@ class Fields extends Structure } else { - $phpxCode .= PHP_EOL . "\t\t" . $this->setPlaceholders($code, $tabBreak); + $phpxCode .= PHP_EOL . $this->_t(2) . $this->setPlaceholders($code, $tabBreak); } } } @@ -2780,23 +2813,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 +2851,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 +2874,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 { @@ -2856,195 +2889,143 @@ class Fields extends Structure } // start building the add buttons/s $addButton = array(); - $addButton[] = PHP_EOL . PHP_EOL . "\t/**"; - $addButton[] = "\t * Override to add new button"; - $addButton[] = "\t *"; - $addButton[] = "\t * @return string The field input markup."; - $addButton[] = "\t *"; - $addButton[] = "\t * @since 3.2"; - $addButton[] = "\t */"; - $addButton[] = "\tprotected function getInput()"; - $addButton[] = "\t{"; - $addButton[] = "\t\t//" . $this->setLine(__LINE__) . " see if we should add buttons"; - $addButton[] = "\t\t\$setButton = \$this->getAttribute('button');"; - $addButton[] = "\t\t//" . $this->setLine(__LINE__) . " get html"; - $addButton[] = "\t\t\$html = parent::getInput();"; - $addButton[] = "\t\t//" . $this->setLine(__LINE__) . " if true set button"; - $addButton[] = "\t\tif (\$setButton === 'true')"; - $addButton[] = "\t\t{"; - $addButton[] = "\t\t\t\$button = array();"; - $addButton[] = "\t\t\t\$script = array();"; - $addButton[] = "\t\t\t\$buttonName = \$this->getAttribute('name');"; - $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " get the input from url"; - $addButton[] = "\t\t\t\$app = JFactory::getApplication();"; - $addButton[] = "\t\t\t\$jinput = \$app->input;"; - $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " get the view name & id"; - $addButton[] = "\t\t\t\$values = \$jinput->getArray(array("; - $addButton[] = "\t\t\t\t'id' => 'int',"; - $addButton[] = "\t\t\t\t'view' => 'word'"; - $addButton[] = "\t\t\t));"; - $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " check if new item"; - $addButton[] = "\t\t\t\$ref = '';"; - $addButton[] = "\t\t\t\$refJ = '';"; + $addButton[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $addButton[] = $this->_t(1) . " * Override to add new button"; + $addButton[] = $this->_t(1) . " *"; + $addButton[] = $this->_t(1) . " * @return string The field input markup."; + $addButton[] = $this->_t(1) . " *"; + $addButton[] = $this->_t(1) . " * @since 3.2"; + $addButton[] = $this->_t(1) . " */"; + $addButton[] = $this->_t(1) . "protected function getInput()"; + $addButton[] = $this->_t(1) . "{"; + $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " see if we should add buttons"; + $addButton[] = $this->_t(2) . "\$setButton = \$this->getAttribute('button');"; + $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get html"; + $addButton[] = $this->_t(2) . "\$html = parent::getInput();"; + $addButton[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " if true set button"; + $addButton[] = $this->_t(2) . "if (\$setButton === 'true')"; + $addButton[] = $this->_t(2) . "{"; + $addButton[] = $this->_t(3) . "\$button = array();"; + $addButton[] = $this->_t(3) . "\$script = array();"; + $addButton[] = $this->_t(3) . "\$buttonName = \$this->getAttribute('name');"; + $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the input from url"; + $addButton[] = $this->_t(3) . "\$app = JFactory::getApplication();"; + $addButton[] = $this->_t(3) . "\$jinput = \$app->input;"; + $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the view name & id"; + $addButton[] = $this->_t(3) . "\$values = \$jinput->getArray(array("; + $addButton[] = $this->_t(4) . "'id' => 'int',"; + $addButton[] = $this->_t(4) . "'view' => 'word'"; + $addButton[] = $this->_t(3) . "));"; + $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " check if new item"; + $addButton[] = $this->_t(3) . "\$ref = '';"; + $addButton[] = $this->_t(3) . "\$refJ = '';"; if ($refLoad) { - $addButton[] = "\t\t\tif (!is_null(\$values['id']) && strlen(\$values['view']))"; - $addButton[] = "\t\t\t{"; - $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " only load referal if not new item."; - $addButton[] = "\t\t\t\t\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; - $addButton[] = "\t\t\t\t\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; - $addButton[] = "\t\t\t}"; + $addButton[] = $this->_t(3) . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; + $addButton[] = $this->_t(3) . "{"; + $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " only load referal if not new item."; + $addButton[] = $this->_t(4) . "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; + $addButton[] = $this->_t(4) . "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; + $addButton[] = $this->_t(3) . "}"; } else { - $addButton[] = "\t\t\tif (!is_null(\$values['id']) && strlen(\$values['view']))"; - $addButton[] = "\t\t\t{"; - $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " get the return value."; - $addButton[] = "\t\t\t\t\$_uri = (string) JUri::getInstance();"; - $addButton[] = "\t\t\t\t\$_return = urlencode(base64_encode(\$_uri));"; - $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " load return value."; - $addButton[] = "\t\t\t\t\$ref = '&return=' . \$_return;"; - $addButton[] = "\t\t\t\t\$refJ = '&return=' . \$_return;"; - $addButton[] = "\t\t\t}"; + $addButton[] = $this->_t(3) . "if (!is_null(\$values['id']) && strlen(\$values['view']))"; + $addButton[] = $this->_t(3) . "{"; + $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " get the return value."; + $addButton[] = $this->_t(4) . "\$_uri = (string) JUri::getInstance();"; + $addButton[] = $this->_t(4) . "\$_return = urlencode(base64_encode(\$_uri));"; + $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " load return value."; + $addButton[] = $this->_t(4) . "\$ref = '&return=' . \$_return;"; + $addButton[] = $this->_t(4) . "\$refJ = '&return=' . \$_return;"; + $addButton[] = $this->_t(3) . "}"; } - $addButton[] = "\t\t\t\$user = JFactory::getUser();"; - $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " only add if user allowed to create " . $fieldData['view']; + $addButton[] = $this->_t(3) . "\$user = JFactory::getUser();"; + $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " only add if user allowed to create " . $fieldData['view']; // check if the item has permissions. if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($fieldData['view'], $this->permissionBuilder['global'][$core['core.create']])) { - $addButton[] = "\t\t\tif (\$user->authorise('" . $core['core.create'] . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; + $addButton[] = $this->_t(3) . "if (\$user->authorise('" . $core['core.create'] . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; } else { - $addButton[] = "\t\t\tif (\$user->authorise('core.create', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; + $addButton[] = $this->_t(3) . "if (\$user->authorise('core.create', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; } - $addButton[] = "\t\t\t{"; - $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " build Create button"; - $addButton[] = "\t\t\t\t\$buttonNamee = trim(\$buttonName);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);"; - $addButton[] = "\t\t\t\t\$buttonNamee = ucfirst(strtolower(\$buttonNamee));"; - $addButton[] = "\t\t\t\t\$button[] = 'langPrefix . "_CREATE_NEW_S', \$buttonNamee).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\""; - $addButton[] = "\t\t\t\t\thref=\"index.php?option=" . $fieldData['component'] . "&view=" . $fieldData['view'] . "&layout=edit'.\$ref.'\" >"; - $addButton[] = "\t\t\t\t\t';"; - $addButton[] = "\t\t\t}"; - $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " only add if user allowed to edit " . $fieldData['view']; + $addButton[] = $this->_t(3) . "{"; + $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " build Create button"; + $addButton[] = $this->_t(4) . "\$buttonNamee = trim(\$buttonName);"; + $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);"; + $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);"; + $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);"; + $addButton[] = $this->_t(4) . "\$buttonNamee = ucfirst(strtolower(\$buttonNamee));"; + $addButton[] = $this->_t(4) . "\$button[] = 'langPrefix . "_CREATE_NEW_S', \$buttonNamee).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\""; + $addButton[] = $this->_t(5) . "href=\"index.php?option=" . $fieldData['component'] . "&view=" . $fieldData['view'] . "&layout=edit'.\$ref.'\" >"; + $addButton[] = $this->_t(5) . "';"; + $addButton[] = $this->_t(3) . "}"; + $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " only add if user allowed to edit " . $fieldData['view']; // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($fieldData['view'], $this->permissionBuilder['global'][$core['core.edit']])) { - $addButton[] = "\t\t\tif ((\$buttonName === '" . $fieldData['view'] . "' || \$buttonName === '" . $fieldData['views'] . "') && \$user->authorise('" . $core['core.edit'] . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; + $addButton[] = $this->_t(3) . "if ((\$buttonName === '" . $fieldData['view'] . "' || \$buttonName === '" . $fieldData['views'] . "') && \$user->authorise('" . $core['core.edit'] . "', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; } else { - $addButton[] = "\t\t\tif ((\$buttonName === '" . $fieldData['view'] . "' || \$buttonName === '" . $fieldData['views'] . "') && \$user->authorise('core.edit', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; + $addButton[] = $this->_t(3) . "if ((\$buttonName === '" . $fieldData['view'] . "' || \$buttonName === '" . $fieldData['views'] . "') && \$user->authorise('core.edit', '" . $component . "') && \$app->isAdmin()) // TODO for now only in admin area."; } - $addButton[] = "\t\t\t{"; - $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " build edit button"; - $addButton[] = "\t\t\t\t\$buttonNamee = trim(\$buttonName);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);"; - $addButton[] = "\t\t\t\t\$buttonNamee = ucfirst(strtolower(\$buttonNamee));"; - $addButton[] = "\t\t\t\t\$button[] = 'langPrefix . "_EDIT_S', \$buttonNamee).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >"; - $addButton[] = "\t\t\t\t\t';"; - $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " build script"; - $addButton[] = "\t\t\t\t\$script[] = \""; - $addButton[] = "\t\t\t\t\tjQuery(document).ready(function() {"; - $addButton[] = "\t\t\t\t\t\tjQuery('#adminForm').on('change', '#jform_\".\$buttonName.\"',function (e) {"; - $addButton[] = "\t\t\t\t\t\t\te.preventDefault();"; - $addButton[] = "\t\t\t\t\t\t\tvar \".\$buttonName.\"Value = jQuery('#jform_\".\$buttonName.\"').val();"; - $addButton[] = "\t\t\t\t\t\t\t\".\$buttonName.\"Button(\".\$buttonName.\"Value);"; - $addButton[] = "\t\t\t\t\t\t});"; - $addButton[] = "\t\t\t\t\t\tvar \".\$buttonName.\"Value = jQuery('#jform_\".\$buttonName.\"').val();"; - $addButton[] = "\t\t\t\t\t\t\".\$buttonName.\"Button(\".\$buttonName.\"Value);"; - $addButton[] = "\t\t\t\t\t});"; - $addButton[] = "\t\t\t\t\tfunction \".\$buttonName.\"Button(value) {"; - $addButton[] = "\t\t\t\t\t\tif (value > 0) {"; // TODO not ideal since value may not be an (int) - $addButton[] = "\t\t\t\t\t\t\t// hide the create button"; - $addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Create').hide();"; - $addButton[] = "\t\t\t\t\t\t\t// show edit button"; - $addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Edit').show();"; - $addButton[] = "\t\t\t\t\t\t\tvar url = 'index.php?option=" . $fieldData['component'] . "&view=" . $fieldData['views'] . "&task=" . $fieldData['view'] . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID - $addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Edit').attr('href', url);"; - $addButton[] = "\t\t\t\t\t\t} else {"; - $addButton[] = "\t\t\t\t\t\t\t// show the create button"; - $addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Create').show();"; - $addButton[] = "\t\t\t\t\t\t\t// hide edit button"; - $addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Edit').hide();"; - $addButton[] = "\t\t\t\t\t\t}"; - $addButton[] = "\t\t\t\t\t}\";"; - $addButton[] = "\t\t\t}"; - $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " check if button was created for " . $fieldData['view'] . " field."; - $addButton[] = "\t\t\tif (is_array(\$button) && count(\$button) > 0)"; - $addButton[] = "\t\t\t{"; - $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Load the needed script."; - $addButton[] = "\t\t\t\t\$document = JFactory::getDocument();"; - $addButton[] = "\t\t\t\t\$document->addScriptDeclaration(implode(' ',\$script));"; - $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " return the button attached to input field."; - $addButton[] = "\t\t\t\treturn '
' .\$html . implode('',\$button).'
';"; - $addButton[] = "\t\t\t}"; - $addButton[] = "\t\t}"; - $addButton[] = "\t\treturn \$html;"; - $addButton[] = "\t}"; + $addButton[] = $this->_t(3) . "{"; + $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " build edit button"; + $addButton[] = $this->_t(4) . "\$buttonNamee = trim(\$buttonName);"; + $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);"; + $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);"; + $addButton[] = $this->_t(4) . "\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);"; + $addButton[] = $this->_t(4) . "\$buttonNamee = ucfirst(strtolower(\$buttonNamee));"; + $addButton[] = $this->_t(4) . "\$button[] = 'langPrefix . "_EDIT_S', \$buttonNamee).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >"; + $addButton[] = $this->_t(5) . "';"; + $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " build script"; + $addButton[] = $this->_t(4) . "\$script[] = \""; + $addButton[] = $this->_t(5) . "jQuery(document).ready(function() {"; + $addButton[] = $this->_t(6) . "jQuery('#adminForm').on('change', '#jform_\".\$buttonName.\"',function (e) {"; + $addButton[] = $this->_t(7) . "e.preventDefault();"; + $addButton[] = $this->_t(7) . "var \".\$buttonName.\"Value = jQuery('#jform_\".\$buttonName.\"').val();"; + $addButton[] = $this->_t(7) . "\".\$buttonName.\"Button(\".\$buttonName.\"Value);"; + $addButton[] = $this->_t(6) . "});"; + $addButton[] = $this->_t(6) . "var \".\$buttonName.\"Value = jQuery('#jform_\".\$buttonName.\"').val();"; + $addButton[] = $this->_t(6) . "\".\$buttonName.\"Button(\".\$buttonName.\"Value);"; + $addButton[] = $this->_t(5) . "});"; + $addButton[] = $this->_t(5) . "function \".\$buttonName.\"Button(value) {"; + $addButton[] = $this->_t(6) . "if (value > 0) {"; // TODO not ideal since value may not be an (int) + $addButton[] = $this->_t(7) . "// hide the create button"; + $addButton[] = $this->_t(7) . "jQuery('#\".\$buttonName.\"Create').hide();"; + $addButton[] = $this->_t(7) . "// show edit button"; + $addButton[] = $this->_t(7) . "jQuery('#\".\$buttonName.\"Edit').show();"; + $addButton[] = $this->_t(7) . "var url = 'index.php?option=" . $fieldData['component'] . "&view=" . $fieldData['views'] . "&task=" . $fieldData['view'] . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID + $addButton[] = $this->_t(7) . "jQuery('#\".\$buttonName.\"Edit').attr('href', url);"; + $addButton[] = $this->_t(6) . "} else {"; + $addButton[] = $this->_t(7) . "// show the create button"; + $addButton[] = $this->_t(7) . "jQuery('#\".\$buttonName.\"Create').show();"; + $addButton[] = $this->_t(7) . "// hide edit button"; + $addButton[] = $this->_t(7) . "jQuery('#\".\$buttonName.\"Edit').hide();"; + $addButton[] = $this->_t(6) . "}"; + $addButton[] = $this->_t(5) . "}\";"; + $addButton[] = $this->_t(3) . "}"; + $addButton[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " check if button was created for " . $fieldData['view'] . " field."; + $addButton[] = $this->_t(3) . "if (is_array(\$button) && count(\$button) > 0)"; + $addButton[] = $this->_t(3) . "{"; + $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Load the needed script."; + $addButton[] = $this->_t(4) . "\$document = JFactory::getDocument();"; + $addButton[] = $this->_t(4) . "\$document->addScriptDeclaration(implode(' ',\$script));"; + $addButton[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " return the button attached to input field."; + $addButton[] = $this->_t(4) . "return '
' .\$html . implode('',\$button).'
';"; + $addButton[] = $this->_t(3) . "}"; + $addButton[] = $this->_t(2) . "}"; + $addButton[] = $this->_t(2) . "return \$html;"; + $addButton[] = $this->_t(1) . "}"; return implode(PHP_EOL, $addButton); } return ''; } - /** - * default Fields - * - * @param string $type The field type - * @param boolean $option The field grouping - * - * @return boolean if the field was found - * - */ - public function defaultField($type, $option = 'default') - { - // list of default fields - // https://docs.joomla.org/Form_field - $defaults = array( - 'default' => array( - 'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox', - 'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor', - 'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file', - 'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite', - 'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password', - 'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag', - 'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag', - 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup' - ), - 'plain' => array( - 'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color', - 'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors', - 'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite', - 'hidden', 'imagelist', 'integer', 'language', 'media', 'menu', - 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', - 'sessionhandler', 'tag', 'tel', 'text', 'textarea', - 'timezone', 'url', 'user', 'usergroup' - ), - 'spacer' => array( - 'note', 'spacer' - ), - 'option' => array( - 'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql' - ), - 'special' => array( - 'contentlanguage', 'groupedlist', 'moduleposition', 'plugin', - 'repeatable', 'templatestyle', 'subform' - ) - ); - - if (in_array($type, $defaults[$option])) - { - return true; - } - return false; - } - /** * xmlPrettyPrint * diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index abaed3ab0..5dee21f97 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -20,154 +20,154 @@ class Interpretation extends Fields /** * The contributors - * + * * @var string */ public $theContributors = ''; /** * The unistall builder - * + * * @var array */ public $uninstallBuilder = array(); /** * The update SQL builder - * + * * @var array */ public $updateSQLBuilder = array(); /** * The List Column Builder - * + * * @var array */ public $listColnrBuilder = array(); /** * The permissions Builder - * + * * @var array */ public $permissionBuilder = array(); /** * The dashboard permissions builder - * + * * @var array */ public $permissionDashboard = array(); /** * The permissions core - * + * * @var array */ public $permissionCore = array(); /** * The customs field builder - * + * * @var array */ public $customFieldBuilder = array(); /** * The category builder - * + * * @var array */ public $buildCategories = array(); /** * The icon builder - * + * * @var array */ public $iconBuilder = array(); /** * The validation fix builder - * + * * @var array */ public $validationFixBuilder = array(); /** * The edit body script builder - * + * * @var array */ public $editBodyViewScriptBuilder = array(); /** * The target relation control - * + * * @var array */ public $targetRelationControl = array(); /** * The target control script checker - * + * * @var array */ public $targetControlsScriptChecker = array(); /** * The router helper - * + * * @var array */ public $setRouterHelpDone = array(); /** * The other where - * + * * @var array */ public $otherWhere = array(); /** * The dashboard get custom data - * + * * @var array */ public $DashboardGetCustomData = array(); /** * The custom admin added - * + * * @var array */ public $customAdminAdded = array(); /** * The extensions params - * + * * @var array */ protected $extensionsParams = array(); /** * The asset rules - * + * * @var array */ public $assetsRules = array(); /** * View Has Category Request - * + * * @var array */ protected $hasCatIdRequest = array(); /** * View Has Id Request - * + * * @var array */ protected $hasIdRequest = array(); @@ -188,11 +188,11 @@ class Interpretation extends Fields /** * Set the line number in comments - * + * * @param int $nr The line number - * + * * @return void - * + * */ private function setLine($nr) { @@ -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,90 +260,90 @@ 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] = ''; } } public function checkStatmentLicenseLocked($boolMethod, $thIIS = '$this') { - $statment[] = PHP_EOL . "\t\tif (!" . $thIIS . "->" . $boolMethod . "())"; - $statment[] = "\t\t{"; - $statment[] = "\t\t\t\$app = JFactory::getApplication();"; - $statment[] = "\t\t\t\$app->enqueueMessage(JText:" . ":_('NIE_REG_NIE'), 'error');"; - $statment[] = "\t\t\t\$app->redirect('index.php');"; - $statment[] = "\t\t\treturn false;"; - $statment[] = "\t\t}"; + $statment[] = PHP_EOL . $this->_t(2) . "if (!" . $thIIS . "->" . $boolMethod . "())"; + $statment[] = $this->_t(2) . "{"; + $statment[] = $this->_t(3) . "\$app = JFactory::getApplication();"; + $statment[] = $this->_t(3) . "\$app->enqueueMessage(JText:" . ":_('NIE_REG_NIE'), 'error');"; + $statment[] = $this->_t(3) . "\$app->redirect('index.php');"; + $statment[] = $this->_t(3) . "return false;"; + $statment[] = $this->_t(2) . "}"; // return the genuine mentod statement return implode(PHP_EOL, $statment); } public function setBoolLicenseLock($boolMethod, $globalbool) { - $bool[] = PHP_EOL . PHP_EOL . "\t/**"; - $bool[] = "\t* The private bool."; - $bool[] = "\t**/"; - $bool[] = "\tprivate $" . $globalbool . ";"; - $bool[] = PHP_EOL . "\t/**"; - $bool[] = "\t* Check if this install has a license."; - $bool[] = "\t**/"; - $bool[] = "\tpublic function " . $boolMethod . "()"; - $bool[] = "\t{"; - $bool[] = "\t\tif(!empty(\$this->" . $globalbool . "))"; - $bool[] = "\t\t{"; - $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\$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\t\$the = new VDM(\$license_key);"; - $bool[] = "\t\t\t\$this->" . $globalbool . " = \$the->_is;"; - $bool[] = "\t\t\treturn \$this->" . $globalbool . ";"; - $bool[] = "\t\t}"; - $bool[] = "\t\treturn false;"; - $bool[] = "\t}"; + $bool[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $bool[] = $this->_t(1) . " * The private bool."; + $bool[] = $this->_t(1) . " **/"; + $bool[] = $this->_t(1) . "private $" . $globalbool . ";"; + $bool[] = PHP_EOL . $this->_t(1) . "/**"; + $bool[] = $this->_t(1) . " * Check if this install has a license."; + $bool[] = $this->_t(1) . " **/"; + $bool[] = $this->_t(1) . "public function " . $boolMethod . "()"; + $bool[] = $this->_t(1) . "{"; + $bool[] = $this->_t(2) . "if(!empty(\$this->" . $globalbool . "))"; + $bool[] = $this->_t(2) . "{"; + $bool[] = $this->_t(3) . "return \$this->" . $globalbool . ";"; + $bool[] = $this->_t(2) . "}"; + $bool[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the global params"; + $bool[] = $this->_t(2) . "\$params = JComponentHelper::getParams('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "', true);"; + $bool[] = $this->_t(2) . "\$license_key = \$params->get('license_key', null);"; + $bool[] = $this->_t(2) . "if (\$license_key)"; + $bool[] = $this->_t(2) . "{"; + $bool[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " load the file"; + $bool[] = $this->_t(3) . "JLoader::import( 'vdm', JPATH_ADMINISTRATOR .'/components/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "');"; + $bool[] = $this->_t(3) . "\$the = new VDM(\$license_key);"; + $bool[] = $this->_t(3) . "\$this->" . $globalbool . " = \$the->_is;"; + $bool[] = $this->_t(3) . "return \$this->" . $globalbool . ";"; + $bool[] = $this->_t(2) . "}"; + $bool[] = $this->_t(2) . "return false;"; + $bool[] = $this->_t(1) . "}"; // return the genuine mentod statement return implode(PHP_EOL, $bool); } public function setHelperLicenseLock($_VDM, $target) { - $helper[] = PHP_EOL . PHP_EOL . "\t/**"; - $helper[] = "\t* Check if this install has a license."; - $helper[] = "\t**/"; - $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\$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\t\$the = new VDM(\$license_key);"; - $helper[] = "\t\t\treturn \$the->_is;"; - $helper[] = "\t\t}"; - $helper[] = "\t\treturn false;"; - $helper[] = "\t}"; + $helper[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $helper[] = $this->_t(1) . " * Check if this install has a license."; + $helper[] = $this->_t(1) . " **/"; + $helper[] = $this->_t(1) . "public static function isGenuine()"; + $helper[] = $this->_t(1) . "{"; + $helper[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the global params"; + $helper[] = $this->_t(2) . "\$params = JComponentHelper::getParams('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "', true);"; + $helper[] = $this->_t(2) . "\$license_key = \$params->get('license_key', null);"; + $helper[] = $this->_t(2) . "if (\$license_key)"; + $helper[] = $this->_t(2) . "{"; + $helper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " load the file"; + $helper[] = $this->_t(3) . "JLoader::import( 'vdm', JPATH_ADMINISTRATOR .'/components/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "');"; + $helper[] = $this->_t(3) . "\$the = new VDM(\$license_key);"; + $helper[] = $this->_t(3) . "return \$the->_is;"; + $helper[] = $this->_t(2) . "}"; + $helper[] = $this->_t(2) . "return false;"; + $helper[] = $this->_t(1) . "}"; // return the genuine mentod statement return implode(PHP_EOL, $helper); } @@ -352,11 +352,11 @@ class Interpretation extends Fields { $init[] = PHP_EOL . "if (!defined('" . $_VDM . "'))"; $init[] = "{"; - $init[] = "\t\$allow = " . $this->fileContentStatic['###Component###'] . "Helper::isGenuine();"; - $init[] = "\tif (\$allow)"; - $init[] = "\t{"; - $init[] = "\t\tdefine('" . $_VDM . "', 1);"; - $init[] = "\t}"; + $init[] = $this->_t(1) . "\$allow = " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::isGenuine();"; + $init[] = $this->_t(1) . "if (\$allow)"; + $init[] = $this->_t(1) . "{"; + $init[] = $this->_t(2) . "define('" . $_VDM . "', 1);"; + $init[] = $this->_t(1) . "}"; $init[] = "}"; // return the initializing statement return implode(PHP_EOL, $init); @@ -387,161 +387,159 @@ class Interpretation extends Fields $encrypt[] = "**/"; $encrypt[] = PHP_EOL . "class WHMCS"; $encrypt[] = "{"; - $encrypt[] = "\tpublic \$_key = false;"; - $encrypt[] = "\tpublic \$_is = false;"; - $encrypt[] = "\t"; - $encrypt[] = "\tpublic function __construct(\$Vk5smi0wjnjb)"; - $encrypt[] = "\t{"; - $encrypt[] = "\t\t// get the session"; - $encrypt[] = "\t\t\$session = JFactory::getSession();"; - $encrypt[] = "\t\t\$V2uekt2wcgwk = \$session->get(\$Vk5smi0wjnjb, null);"; - $encrypt[] = "\t\t\$h4sgrGsqq = \$this->get(\$Vk5smi0wjnjb,\$V2uekt2wcgwk);"; - $encrypt[] = "\t\tif (isset(\$h4sgrGsqq['nuut']) && \$h4sgrGsqq['nuut'] && (isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['eiegrendel']) && strlen(\$h4sgrGsqq['eiegrendel']) > 300)"; - $encrypt[] = "\t\t{"; - $encrypt[] = "\t\t\t\$session->set(\$Vk5smi0wjnjb, \$h4sgrGsqq['eiegrendel']);"; - $encrypt[] = "\t\t}"; - $encrypt[] = "\t\tif ((isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['md5hash']) && strlen(\$h4sgrGsqq['md5hash']) == 32 && isset(\$h4sgrGsqq['customfields']) && strlen(\$h4sgrGsqq['customfields']) > 4)"; - $encrypt[] = "\t\t{"; - $encrypt[] = "\t\t\t\$this->_key = md5(\$h4sgrGsqq['customfields']);"; - $encrypt[] = "\t\t}"; - $encrypt[] = "\t\tif ((isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['md5hash']) && strlen(\$h4sgrGsqq['md5hash']) == 32 )"; - $encrypt[] = "\t\t{"; - $encrypt[] = "\t\t\t\$this->_is = true;"; - $encrypt[] = "\t\t}"; - $encrypt[] = "\t}"; - $encrypt[] = "\t"; - $encrypt[] = "\tprivate function get(\$Vk5smi0wjnjb,\$V2uekt2wcgwk)"; - $encrypt[] = "\t{"; - $encrypt[] = "\t\t\$Viioj50xuqu2 = unserialize(base64_decode('" . $theKey . "'));"; - $encrypt[] = "\t\t\$Visqfrd1caus = time() . md5(mt_rand(1000000000, 9999999999) . \$Vk5smi0wjnjb);"; - $encrypt[] = "\t\t\$Vo4tezfgcf3e = date(\"Ymd\");"; - $encrypt[] = "\t\t\$Vozblwvfym2f = \$_SERVER['SERVER_NAME'];"; - $encrypt[] = "\t\t\$Vozblwvfym2fdie = isset(\$_SERVER['SERVER_ADDR']) ? \$_SERVER['SERVER_ADDR'] : \$_SERVER['LOCAL_ADDR'];"; - $encrypt[] = "\t\t\$V343jp03dxco = dirname(__FILE__);"; - $encrypt[] = "\t\t\$Vc2rayehw4f0 = unserialize(base64_decode('czozNjoibW9kdWxlcy9zZXJ2ZXJzL2xpY2Vuc2luZy92ZXJpZnkucGhwIjs='));"; - $encrypt[] = "\t\t\$Vlpolphukogz = false;"; - $encrypt[] = "\t\tif (\$V2uekt2wcgwk) {"; - $encrypt[] = "\t\t\t\$V2uekt2wcgwk = str_replace(\"" . '".PHP_EOL."' . "\", '', \$V2uekt2wcgwk);"; - $encrypt[] = "\t\t\t\$Vm5cxjdc43g4 = substr(\$V2uekt2wcgwk, 0, strlen(\$V2uekt2wcgwk) - 32);"; - $encrypt[] = "\t\t\t\$Vbgx0efeu2sy = substr(\$V2uekt2wcgwk, strlen(\$V2uekt2wcgwk) - 32);"; - $encrypt[] = "\t\t\tif (\$Vbgx0efeu2sy == md5(\$Vm5cxjdc43g4 . \$Viioj50xuqu2['geheim'])) {"; - $encrypt[] = "\t\t\t\t\$Vm5cxjdc43g4 = strrev(\$Vm5cxjdc43g4);"; - $encrypt[] = "\t\t\t\t\$Vbgx0efeu2sy = substr(\$Vm5cxjdc43g4, 0, 32);"; - $encrypt[] = "\t\t\t\t\$Vm5cxjdc43g4 = substr(\$Vm5cxjdc43g4, 32);"; - $encrypt[] = "\t\t\t\t\$Vm5cxjdc43g4 = base64_decode(\$Vm5cxjdc43g4);"; - $encrypt[] = "\t\t\t\t\$Vm5cxjdc43g4finding = unserialize(\$Vm5cxjdc43g4);"; - $encrypt[] = "\t\t\t\t\$V3qqz0p00fbq = \$Vm5cxjdc43g4finding['dan'];"; - $encrypt[] = "\t\t\t\tif (\$Vbgx0efeu2sy == md5(\$V3qqz0p00fbq . \$Viioj50xuqu2['geheim'])) {"; - $encrypt[] = "\t\t\t\t\t\$Vbfbwv2y4kre = date(\"Ymd\", mktime(0, 0, 0, date(\"m\"), date(\"d\") - \$Viioj50xuqu2['onthou'], date(\"Y\")));"; - $encrypt[] = "\t\t\t\t\tif (\$V3qqz0p00fbq > \$Vbfbwv2y4kre) {"; - $encrypt[] = "\t\t\t\t\t\t\$Vlpolphukogz = true;"; - $encrypt[] = "\t\t\t\t\t\t\$Vwasqoybpyed = \$Vm5cxjdc43g4finding;"; - $encrypt[] = "\t\t\t\t\t\t\$Vcixw3trerrt = explode(',', \$Vwasqoybpyed['validdomain']);"; - $encrypt[] = "\t\t\t\t\t\tif (!in_array(\$_SERVER['SERVER_NAME'], \$Vcixw3trerrt)) {"; - $encrypt[] = "\t\t\t\t\t\t\t\$Vlpolphukogz = false;"; - $encrypt[] = "\t\t\t\t\t\t\t\$Vm5cxjdc43g4finding['status'] = \"sleg\";"; - $encrypt[] = "\t\t\t\t\t\t\t\$Vwasqoybpyed = array();"; - $encrypt[] = "\t\t\t\t\t\t}"; - $encrypt[] = "\t\t\t\t\t\t\$Vkni3xyhkqzv = explode(',', \$Vwasqoybpyed['validip']);"; - $encrypt[] = "\t\t\t\t\t\tif (!in_array(\$Vozblwvfym2fdie, \$Vkni3xyhkqzv)) {"; - $encrypt[] = "\t\t\t\t\t\t\t\$Vlpolphukogz = false;"; - $encrypt[] = "\t\t\t\t\t\t\t\$Vm5cxjdc43g4finding['status'] = \"sleg\";"; - $encrypt[] = "\t\t\t\t\t\t\t\$Vwasqoybpyed = array();"; - $encrypt[] = "\t\t\t\t\t\t}"; - $encrypt[] = "\t\t\t\t\t\t\$Vckfvnepoaxj = explode(',', \$Vwasqoybpyed['validdirectory']);"; - $encrypt[] = "\t\t\t\t\t\tif (!in_array(\$V343jp03dxco, \$Vckfvnepoaxj)) {"; - $encrypt[] = "\t\t\t\t\t\t\t\$Vlpolphukogz = false;"; - $encrypt[] = "\t\t\t\t\t\t\t\$Vm5cxjdc43g4finding['status'] = \"sleg\";"; - $encrypt[] = "\t\t\t\t\t\t\t\$Vwasqoybpyed = array();"; - $encrypt[] = "\t\t\t\t\t\t}"; - $encrypt[] = "\t\t\t\t\t}"; - $encrypt[] = "\t\t\t\t}"; - $encrypt[] = "\t\t\t}"; - $encrypt[] = "\t\t}"; - $encrypt[] = "\t\tif (!\$Vlpolphukogz) {"; - $encrypt[] = "\t\t\t\$V1u0c4dl3ehp = array("; - $encrypt[] = "\t\t\t\t'licensekey' => \$Vk5smi0wjnjb,"; - $encrypt[] = "\t\t\t\t'domain' => \$Vozblwvfym2f,"; - $encrypt[] = "\t\t\t\t'ip' => \$Vozblwvfym2fdie,"; - $encrypt[] = "\t\t\t\t'dir' => \$V343jp03dxco,"; - $encrypt[] = "\t\t\t);"; - $encrypt[] = "\t\t\tif (\$Visqfrd1caus) \$V1u0c4dl3ehp['check_token'] = \$Visqfrd1caus;"; - $encrypt[] = "\t\t\t\$Vdsjeyjmpq2o = '';"; - $encrypt[] = "\t\t\tforeach (\$V1u0c4dl3ehp AS \$V2sgyscukmgi=>\$V1u00zkzmb1d) {"; - $encrypt[] = "\t\t\t\t\$Vdsjeyjmpq2o .= \$V2sgyscukmgi.'='.urlencode(\$V1u00zkzmb1d).'&';"; - $encrypt[] = "\t\t\t}"; - $encrypt[] = "\t\t\tif (function_exists('curl_exec')) {"; - $encrypt[] = "\t\t\t\t\$Vdathuqgjyf0 = curl_init();"; - $encrypt[] = "\t\t\t\tcurl_setopt(\$Vdathuqgjyf0, CURLOPT_URL, \$Viioj50xuqu2['kasier'] . \$Vc2rayehw4f0);"; - $encrypt[] = "\t\t\t\tcurl_setopt(\$Vdathuqgjyf0, CURLOPT_POST, 1);"; - $encrypt[] = "\t\t\t\tcurl_setopt(\$Vdathuqgjyf0, CURLOPT_POSTFIELDS, \$Vdsjeyjmpq2o);"; - $encrypt[] = "\t\t\t\tcurl_setopt(\$Vdathuqgjyf0, CURLOPT_TIMEOUT, 30);"; - $encrypt[] = "\t\t\t\tcurl_setopt(\$Vdathuqgjyf0, CURLOPT_RETURNTRANSFER, 1);"; - $encrypt[] = "\t\t\t\t\$Vqojefyeohg5 = curl_exec(\$Vdathuqgjyf0);"; - $encrypt[] = "\t\t\t\tcurl_close(\$Vdathuqgjyf0);"; - $encrypt[] = "\t\t\t} else {"; - $encrypt[] = "\t\t\t\t\$Vrpmu4bvnmkp = fsockopen(\$Viioj50xuqu2['kasier'], 80, \$Vc0t5kmpwkwk, \$Va3g41fnofhu, 5);"; - $encrypt[] = "\t\t\t\tif (\$Vrpmu4bvnmkp) {"; - $encrypt[] = "\t\t\t\t\t\$Vznkm0a0me1y = \"\r" . PHP_EOL . "\";"; - $encrypt[] = "\t\t\t\t\t\$V2sgyscukmgiop = \"POST \".\$Viioj50xuqu2['kasier'] . \$Vc2rayehw4f0 . \" HTTP/1.0\" . \$Vznkm0a0me1y;"; - $encrypt[] = "\t\t\t\t\t\$V2sgyscukmgiop .= \"Host: \".\$Viioj50xuqu2['kasier'] . \$Vznkm0a0me1y;"; - $encrypt[] = "\t\t\t\t\t\$V2sgyscukmgiop .= \"Content-type: application/x-www-form-urlencoded\" . \$Vznkm0a0me1y;"; - $encrypt[] = "\t\t\t\t\t\$V2sgyscukmgiop .= \"Content-length: \".@strlen(\$Vdsjeyjmpq2o) . \$Vznkm0a0me1y;"; - $encrypt[] = "\t\t\t\t\t\$V2sgyscukmgiop .= \"Connection: close\" . \$Vznkm0a0me1y . \$Vznkm0a0me1y;"; - $encrypt[] = "\t\t\t\t\t\$V2sgyscukmgiop .= \$Vdsjeyjmpq2o;"; - $encrypt[] = "\t\t\t\t\t\$Vqojefyeohg5 = '';"; - $encrypt[] = "\t\t\t\t\t@stream_set_timeout(\$Vrpmu4bvnmkp, 20);"; - $encrypt[] = "\t\t\t\t\t@fputs(\$Vrpmu4bvnmkp, \$V2sgyscukmgiop);"; - $encrypt[] = "\t\t\t\t\t\$V2czq24pjexf = @socket_get_status(\$Vrpmu4bvnmkp);"; - $encrypt[] = "\t\t\t\t\twhile (!@feof(\$Vrpmu4bvnmkp)&&\$V2czq24pjexf) {"; - $encrypt[] = "\t\t\t\t\t\t\$Vqojefyeohg5 .= @fgets(\$Vrpmu4bvnmkp, 1024);"; - $encrypt[] = "\t\t\t\t\t\t\$V2czq24pjexf = @socket_get_status(\$Vrpmu4bvnmkp);"; - $encrypt[] = "\t\t\t\t\t}"; - $encrypt[] = "\t\t\t\t\t@fclose (\$Vqojefyeohg5);"; - $encrypt[] = "\t\t\t\t}"; - $encrypt[] = "\t\t\t}"; - $encrypt[] = "\t\t\tif (!\$Vqojefyeohg5) {"; - $encrypt[] = "\t\t\t\t\$Vbfbwv2y4kre = date(\"Ymd\", mktime(0, 0, 0, date(\"m\"), date(\"d\") - \$Viioj50xuqu2['onthou'], date(\"Y\")));"; - $encrypt[] = "\t\t\t\tif (isset(\$V3qqz0p00fbq) && \$V3qqz0p00fbq > \$Vbfbwv2y4kre) {"; - $encrypt[] = "\t\t\t\t\t\$Vwasqoybpyed = \$Vm5cxjdc43g4finding;"; - $encrypt[] = "\t\t\t\t} else {"; - $encrypt[] = "\t\t\t\t\t\$Vwasqoybpyed = array();"; - $encrypt[] = "\t\t\t\t\t\$Vwasqoybpyed['status'] = \"sleg\";"; - $encrypt[] = "\t\t\t\t\t\$Vwasqoybpyed['description'] = \"Remote Check Failed\";"; - $encrypt[] = "\t\t\t\t\treturn \$Vwasqoybpyed;"; - $encrypt[] = "\t\t\t\t}"; - $encrypt[] = "\t\t\t} else {"; - $encrypt[] = "\t\t\t\tpreg_match_all('" . '/<(.*?)>([^<]+)<\/\\1>/i' . "', \$Vqojefyeohg5, \$V1ot20wob03f);"; - $encrypt[] = "\t\t\t\t\$Vwasqoybpyed = array();"; - $encrypt[] = "\t\t\t\tforeach (\$V1ot20wob03f[1] AS \$V2sgyscukmgi=>\$V1u00zkzmb1d) {"; - $encrypt[] = "\t\t\t\t\t\$Vwasqoybpyed[\$V1u00zkzmb1d] = \$V1ot20wob03f[2][\$V2sgyscukmgi];"; - $encrypt[] = "\t\t\t\t}"; - $encrypt[] = "\t\t\t}"; - $encrypt[] = "\t\t\tif (!is_array(\$Vwasqoybpyed)) {"; - $encrypt[] = "\t\t\t\tdie(\"Invalid License Server Response\");"; - $encrypt[] = "\t\t\t}"; - $encrypt[] = "\t\t\tif (isset(\$Vwasqoybpyed['md5hash']) && \$Vwasqoybpyed['md5hash']) {"; - $encrypt[] = "\t\t\t\tif (\$Vwasqoybpyed['md5hash'] != md5(\$Viioj50xuqu2['geheim'] . \$Visqfrd1caus)) {"; - $encrypt[] = "\t\t\t\t\t\$Vwasqoybpyed['status'] = \"sleg\";"; - $encrypt[] = "\t\t\t\t\t\$Vwasqoybpyed['description'] = \"MD5 Checksum Verification Failed\";"; - $encrypt[] = "\t\t\t\t\treturn \$Vwasqoybpyed;"; - $encrypt[] = "\t\t\t\t}"; - $encrypt[] = "\t\t\t}"; - $encrypt[] = "\t\t\tif (isset(\$Vwasqoybpyed['status']) && \$Vwasqoybpyed['status'] == \"Active\") {"; - $encrypt[] = "\t\t\t\t\$Vwasqoybpyed['dan'] = \$Vo4tezfgcf3e;"; - $encrypt[] = "\t\t\t\t\$Vqojefyeohg5ing = serialize(\$Vwasqoybpyed);"; - $encrypt[] = "\t\t\t\t\$Vqojefyeohg5ing = base64_encode(\$Vqojefyeohg5ing);"; - $encrypt[] = "\t\t\t\t\$Vqojefyeohg5ing = md5(\$Vo4tezfgcf3e . \$Viioj50xuqu2['geheim']) . \$Vqojefyeohg5ing;"; - $encrypt[] = "\t\t\t\t\$Vqojefyeohg5ing = strrev(\$Vqojefyeohg5ing);"; - $encrypt[] = "\t\t\t\t\$Vqojefyeohg5ing = \$Vqojefyeohg5ing . md5(\$Vqojefyeohg5ing . \$Viioj50xuqu2['geheim']);"; - $encrypt[] = "\t\t\t\t\$Vqojefyeohg5ing = wordwrap(\$Vqojefyeohg5ing, 80, \"" . '".PHP_EOL."' . "\", true);"; - $encrypt[] = "\t\t\t\t\$Vwasqoybpyed['eiegrendel'] = \$Vqojefyeohg5ing;"; - $encrypt[] = "\t\t\t}"; - $encrypt[] = "\t\t\t\$Vwasqoybpyed['nuut'] = true;"; - $encrypt[] = "\t\t}"; - $encrypt[] = "\t\tunset(\$V1u0c4dl3ehp,\$Vqojefyeohg5,\$V1ot20wob03f,\$Viioj50xuqu2['kasier'],\$Viioj50xuqu2['geheim'],\$Vo4tezfgcf3e,\$Vozblwvfym2fdie,\$Viioj50xuqu2['onthou'],\$Vbgx0efeu2sy);"; - $encrypt[] = "\t\treturn \$Vwasqoybpyed;"; - $encrypt[] = "\t}"; + $encrypt[] = $this->_t(1) . "public \$_key = false;"; + $encrypt[] = $this->_t(1) . "public \$_is = false;"; + $encrypt[] = PHP_EOL . $this->_t(1) . "public function __construct(\$Vk5smi0wjnjb)"; + $encrypt[] = $this->_t(1) . "{"; + $encrypt[] = $this->_t(2) . "// get the session"; + $encrypt[] = $this->_t(2) . "\$session = JFactory::getSession();"; + $encrypt[] = $this->_t(2) . "\$V2uekt2wcgwk = \$session->get(\$Vk5smi0wjnjb, null);"; + $encrypt[] = $this->_t(2) . "\$h4sgrGsqq = \$this->get(\$Vk5smi0wjnjb,\$V2uekt2wcgwk);"; + $encrypt[] = $this->_t(2) . "if (isset(\$h4sgrGsqq['nuut']) && \$h4sgrGsqq['nuut'] && (isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['eiegrendel']) && strlen(\$h4sgrGsqq['eiegrendel']) > 300)"; + $encrypt[] = $this->_t(2) . "{"; + $encrypt[] = $this->_t(3) . "\$session->set(\$Vk5smi0wjnjb, \$h4sgrGsqq['eiegrendel']);"; + $encrypt[] = $this->_t(2) . "}"; + $encrypt[] = $this->_t(2) . "if ((isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['md5hash']) && strlen(\$h4sgrGsqq['md5hash']) == 32 && isset(\$h4sgrGsqq['customfields']) && strlen(\$h4sgrGsqq['customfields']) > 4)"; + $encrypt[] = $this->_t(2) . "{"; + $encrypt[] = $this->_t(3) . "\$this->_key = md5(\$h4sgrGsqq['customfields']);"; + $encrypt[] = $this->_t(2) . "}"; + $encrypt[] = $this->_t(2) . "if ((isset(\$h4sgrGsqq['status']) && 'Active' === \$h4sgrGsqq['status']) && isset(\$h4sgrGsqq['md5hash']) && strlen(\$h4sgrGsqq['md5hash']) == 32 )"; + $encrypt[] = $this->_t(2) . "{"; + $encrypt[] = $this->_t(3) . "\$this->_is = true;"; + $encrypt[] = $this->_t(2) . "}"; + $encrypt[] = $this->_t(1) . "}"; + $encrypt[] = PHP_EOL . $this->_t(1) . "private function get(\$Vk5smi0wjnjb,\$V2uekt2wcgwk)"; + $encrypt[] = $this->_t(1) . "{"; + $encrypt[] = $this->_t(2) . "\$Viioj50xuqu2 = unserialize(base64_decode('" . $theKey . "'));"; + $encrypt[] = $this->_t(2) . "\$Visqfrd1caus = time() . md5(mt_rand(1000000000, 9999999999) . \$Vk5smi0wjnjb);"; + $encrypt[] = $this->_t(2) . "\$Vo4tezfgcf3e = date(\"Ymd\");"; + $encrypt[] = $this->_t(2) . "\$Vozblwvfym2f = \$_SERVER['SERVER_NAME'];"; + $encrypt[] = $this->_t(2) . "\$Vozblwvfym2fdie = isset(\$_SERVER['SERVER_ADDR']) ? \$_SERVER['SERVER_ADDR'] : \$_SERVER['LOCAL_ADDR'];"; + $encrypt[] = $this->_t(2) . "\$V343jp03dxco = dirname(__FILE__);"; + $encrypt[] = $this->_t(2) . "\$Vc2rayehw4f0 = unserialize(base64_decode('czozNjoibW9kdWxlcy9zZXJ2ZXJzL2xpY2Vuc2luZy92ZXJpZnkucGhwIjs='));"; + $encrypt[] = $this->_t(2) . "\$Vlpolphukogz = false;"; + $encrypt[] = $this->_t(2) . "if (\$V2uekt2wcgwk) {"; + $encrypt[] = $this->_t(3) . "\$V2uekt2wcgwk = str_replace(\"" . '".PHP_EOL."' . "\", '', \$V2uekt2wcgwk);"; + $encrypt[] = $this->_t(3) . "\$Vm5cxjdc43g4 = substr(\$V2uekt2wcgwk, 0, strlen(\$V2uekt2wcgwk) - 32);"; + $encrypt[] = $this->_t(3) . "\$Vbgx0efeu2sy = substr(\$V2uekt2wcgwk, strlen(\$V2uekt2wcgwk) - 32);"; + $encrypt[] = $this->_t(3) . "if (\$Vbgx0efeu2sy == md5(\$Vm5cxjdc43g4 . \$Viioj50xuqu2['geheim'])) {"; + $encrypt[] = $this->_t(4) . "\$Vm5cxjdc43g4 = strrev(\$Vm5cxjdc43g4);"; + $encrypt[] = $this->_t(4) . "\$Vbgx0efeu2sy = substr(\$Vm5cxjdc43g4, 0, 32);"; + $encrypt[] = $this->_t(4) . "\$Vm5cxjdc43g4 = substr(\$Vm5cxjdc43g4, 32);"; + $encrypt[] = $this->_t(4) . "\$Vm5cxjdc43g4 = base64_decode(\$Vm5cxjdc43g4);"; + $encrypt[] = $this->_t(4) . "\$Vm5cxjdc43g4finding = unserialize(\$Vm5cxjdc43g4);"; + $encrypt[] = $this->_t(4) . "\$V3qqz0p00fbq = \$Vm5cxjdc43g4finding['dan'];"; + $encrypt[] = $this->_t(4) . "if (\$Vbgx0efeu2sy == md5(\$V3qqz0p00fbq . \$Viioj50xuqu2['geheim'])) {"; + $encrypt[] = $this->_t(5) . "\$Vbfbwv2y4kre = date(\"Ymd\", mktime(0, 0, 0, date(\"m\"), date(\"d\") - \$Viioj50xuqu2['onthou'], date(\"Y\")));"; + $encrypt[] = $this->_t(5) . "if (\$V3qqz0p00fbq > \$Vbfbwv2y4kre) {"; + $encrypt[] = $this->_t(6) . "\$Vlpolphukogz = true;"; + $encrypt[] = $this->_t(6) . "\$Vwasqoybpyed = \$Vm5cxjdc43g4finding;"; + $encrypt[] = $this->_t(6) . "\$Vcixw3trerrt = explode(',', \$Vwasqoybpyed['validdomain']);"; + $encrypt[] = $this->_t(6) . "if (!in_array(\$_SERVER['SERVER_NAME'], \$Vcixw3trerrt)) {"; + $encrypt[] = $this->_t(7) . "\$Vlpolphukogz = false;"; + $encrypt[] = $this->_t(7) . "\$Vm5cxjdc43g4finding['status'] = \"sleg\";"; + $encrypt[] = $this->_t(7) . "\$Vwasqoybpyed = array();"; + $encrypt[] = $this->_t(6) . "}"; + $encrypt[] = $this->_t(6) . "\$Vkni3xyhkqzv = explode(',', \$Vwasqoybpyed['validip']);"; + $encrypt[] = $this->_t(6) . "if (!in_array(\$Vozblwvfym2fdie, \$Vkni3xyhkqzv)) {"; + $encrypt[] = $this->_t(7) . "\$Vlpolphukogz = false;"; + $encrypt[] = $this->_t(7) . "\$Vm5cxjdc43g4finding['status'] = \"sleg\";"; + $encrypt[] = $this->_t(7) . "\$Vwasqoybpyed = array();"; + $encrypt[] = $this->_t(6) . "}"; + $encrypt[] = $this->_t(6) . "\$Vckfvnepoaxj = explode(',', \$Vwasqoybpyed['validdirectory']);"; + $encrypt[] = $this->_t(6) . "if (!in_array(\$V343jp03dxco, \$Vckfvnepoaxj)) {"; + $encrypt[] = $this->_t(7) . "\$Vlpolphukogz = false;"; + $encrypt[] = $this->_t(7) . "\$Vm5cxjdc43g4finding['status'] = \"sleg\";"; + $encrypt[] = $this->_t(7) . "\$Vwasqoybpyed = array();"; + $encrypt[] = $this->_t(6) . "}"; + $encrypt[] = $this->_t(5) . "}"; + $encrypt[] = $this->_t(4) . "}"; + $encrypt[] = $this->_t(3) . "}"; + $encrypt[] = $this->_t(2) . "}"; + $encrypt[] = $this->_t(2) . "if (!\$Vlpolphukogz) {"; + $encrypt[] = $this->_t(3) . "\$V1u0c4dl3ehp = array("; + $encrypt[] = $this->_t(4) . "'licensekey' => \$Vk5smi0wjnjb,"; + $encrypt[] = $this->_t(4) . "'domain' => \$Vozblwvfym2f,"; + $encrypt[] = $this->_t(4) . "'ip' => \$Vozblwvfym2fdie,"; + $encrypt[] = $this->_t(4) . "'dir' => \$V343jp03dxco,"; + $encrypt[] = $this->_t(3) . ");"; + $encrypt[] = $this->_t(3) . "if (\$Visqfrd1caus) \$V1u0c4dl3ehp['check_token'] = \$Visqfrd1caus;"; + $encrypt[] = $this->_t(3) . "\$Vdsjeyjmpq2o = '';"; + $encrypt[] = $this->_t(3) . "foreach (\$V1u0c4dl3ehp AS \$V2sgyscukmgi=>\$V1u00zkzmb1d) {"; + $encrypt[] = $this->_t(4) . "\$Vdsjeyjmpq2o .= \$V2sgyscukmgi.'='.urlencode(\$V1u00zkzmb1d).'&';"; + $encrypt[] = $this->_t(3) . "}"; + $encrypt[] = $this->_t(3) . "if (function_exists('curl_exec')) {"; + $encrypt[] = $this->_t(4) . "\$Vdathuqgjyf0 = curl_init();"; + $encrypt[] = $this->_t(4) . "curl_setopt(\$Vdathuqgjyf0, CURLOPT_URL, \$Viioj50xuqu2['kasier'] . \$Vc2rayehw4f0);"; + $encrypt[] = $this->_t(4) . "curl_setopt(\$Vdathuqgjyf0, CURLOPT_POST, 1);"; + $encrypt[] = $this->_t(4) . "curl_setopt(\$Vdathuqgjyf0, CURLOPT_POSTFIELDS, \$Vdsjeyjmpq2o);"; + $encrypt[] = $this->_t(4) . "curl_setopt(\$Vdathuqgjyf0, CURLOPT_TIMEOUT, 30);"; + $encrypt[] = $this->_t(4) . "curl_setopt(\$Vdathuqgjyf0, CURLOPT_RETURNTRANSFER, 1);"; + $encrypt[] = $this->_t(4) . "\$Vqojefyeohg5 = curl_exec(\$Vdathuqgjyf0);"; + $encrypt[] = $this->_t(4) . "curl_close(\$Vdathuqgjyf0);"; + $encrypt[] = $this->_t(3) . "} else {"; + $encrypt[] = $this->_t(4) . "\$Vrpmu4bvnmkp = fsockopen(\$Viioj50xuqu2['kasier'], 80, \$Vc0t5kmpwkwk, \$Va3g41fnofhu, 5);"; + $encrypt[] = $this->_t(4) . "if (\$Vrpmu4bvnmkp) {"; + $encrypt[] = $this->_t(5) . "\$Vznkm0a0me1y = \"\r" . PHP_EOL . "\";"; + $encrypt[] = $this->_t(5) . "\$V2sgyscukmgiop = \"POST \".\$Viioj50xuqu2['kasier'] . \$Vc2rayehw4f0 . \" HTTP/1.0\" . \$Vznkm0a0me1y;"; + $encrypt[] = $this->_t(5) . "\$V2sgyscukmgiop .= \"Host: \".\$Viioj50xuqu2['kasier'] . \$Vznkm0a0me1y;"; + $encrypt[] = $this->_t(5) . "\$V2sgyscukmgiop .= \"Content-type: application/x-www-form-urlencoded\" . \$Vznkm0a0me1y;"; + $encrypt[] = $this->_t(5) . "\$V2sgyscukmgiop .= \"Content-length: \".@strlen(\$Vdsjeyjmpq2o) . \$Vznkm0a0me1y;"; + $encrypt[] = $this->_t(5) . "\$V2sgyscukmgiop .= \"Connection: close\" . \$Vznkm0a0me1y . \$Vznkm0a0me1y;"; + $encrypt[] = $this->_t(5) . "\$V2sgyscukmgiop .= \$Vdsjeyjmpq2o;"; + $encrypt[] = $this->_t(5) . "\$Vqojefyeohg5 = '';"; + $encrypt[] = $this->_t(5) . "@stream_set_timeout(\$Vrpmu4bvnmkp, 20);"; + $encrypt[] = $this->_t(5) . "@fputs(\$Vrpmu4bvnmkp, \$V2sgyscukmgiop);"; + $encrypt[] = $this->_t(5) . "\$V2czq24pjexf = @socket_get_status(\$Vrpmu4bvnmkp);"; + $encrypt[] = $this->_t(5) . "while (!@feof(\$Vrpmu4bvnmkp)&&\$V2czq24pjexf) {"; + $encrypt[] = $this->_t(6) . "\$Vqojefyeohg5 .= @fgets(\$Vrpmu4bvnmkp, 1024);"; + $encrypt[] = $this->_t(6) . "\$V2czq24pjexf = @socket_get_status(\$Vrpmu4bvnmkp);"; + $encrypt[] = $this->_t(5) . "}"; + $encrypt[] = $this->_t(5) . "@fclose (\$Vqojefyeohg5);"; + $encrypt[] = $this->_t(4) . "}"; + $encrypt[] = $this->_t(3) . "}"; + $encrypt[] = $this->_t(3) . "if (!\$Vqojefyeohg5) {"; + $encrypt[] = $this->_t(4) . "\$Vbfbwv2y4kre = date(\"Ymd\", mktime(0, 0, 0, date(\"m\"), date(\"d\") - \$Viioj50xuqu2['onthou'], date(\"Y\")));"; + $encrypt[] = $this->_t(4) . "if (isset(\$V3qqz0p00fbq) && \$V3qqz0p00fbq > \$Vbfbwv2y4kre) {"; + $encrypt[] = $this->_t(5) . "\$Vwasqoybpyed = \$Vm5cxjdc43g4finding;"; + $encrypt[] = $this->_t(4) . "} else {"; + $encrypt[] = $this->_t(5) . "\$Vwasqoybpyed = array();"; + $encrypt[] = $this->_t(5) . "\$Vwasqoybpyed['status'] = \"sleg\";"; + $encrypt[] = $this->_t(5) . "\$Vwasqoybpyed['description'] = \"Remote Check Failed\";"; + $encrypt[] = $this->_t(5) . "return \$Vwasqoybpyed;"; + $encrypt[] = $this->_t(4) . "}"; + $encrypt[] = $this->_t(3) . "} else {"; + $encrypt[] = $this->_t(4) . "preg_match_all('" . '/<(.*?)>([^<]+)<\/\\1>/i' . "', \$Vqojefyeohg5, \$V1ot20wob03f);"; + $encrypt[] = $this->_t(4) . "\$Vwasqoybpyed = array();"; + $encrypt[] = $this->_t(4) . "foreach (\$V1ot20wob03f[1] AS \$V2sgyscukmgi=>\$V1u00zkzmb1d) {"; + $encrypt[] = $this->_t(5) . "\$Vwasqoybpyed[\$V1u00zkzmb1d] = \$V1ot20wob03f[2][\$V2sgyscukmgi];"; + $encrypt[] = $this->_t(4) . "}"; + $encrypt[] = $this->_t(3) . "}"; + $encrypt[] = $this->_t(3) . "if (!is_array(\$Vwasqoybpyed)) {"; + $encrypt[] = $this->_t(4) . "die(\"Invalid License Server Response\");"; + $encrypt[] = $this->_t(3) . "}"; + $encrypt[] = $this->_t(3) . "if (isset(\$Vwasqoybpyed['md5hash']) && \$Vwasqoybpyed['md5hash']) {"; + $encrypt[] = $this->_t(4) . "if (\$Vwasqoybpyed['md5hash'] != md5(\$Viioj50xuqu2['geheim'] . \$Visqfrd1caus)) {"; + $encrypt[] = $this->_t(5) . "\$Vwasqoybpyed['status'] = \"sleg\";"; + $encrypt[] = $this->_t(5) . "\$Vwasqoybpyed['description'] = \"MD5 Checksum Verification Failed\";"; + $encrypt[] = $this->_t(5) . "return \$Vwasqoybpyed;"; + $encrypt[] = $this->_t(4) . "}"; + $encrypt[] = $this->_t(3) . "}"; + $encrypt[] = $this->_t(3) . "if (isset(\$Vwasqoybpyed['status']) && \$Vwasqoybpyed['status'] == \"Active\") {"; + $encrypt[] = $this->_t(4) . "\$Vwasqoybpyed['dan'] = \$Vo4tezfgcf3e;"; + $encrypt[] = $this->_t(4) . "\$Vqojefyeohg5ing = serialize(\$Vwasqoybpyed);"; + $encrypt[] = $this->_t(4) . "\$Vqojefyeohg5ing = base64_encode(\$Vqojefyeohg5ing);"; + $encrypt[] = $this->_t(4) . "\$Vqojefyeohg5ing = md5(\$Vo4tezfgcf3e . \$Viioj50xuqu2['geheim']) . \$Vqojefyeohg5ing;"; + $encrypt[] = $this->_t(4) . "\$Vqojefyeohg5ing = strrev(\$Vqojefyeohg5ing);"; + $encrypt[] = $this->_t(4) . "\$Vqojefyeohg5ing = \$Vqojefyeohg5ing . md5(\$Vqojefyeohg5ing . \$Viioj50xuqu2['geheim']);"; + $encrypt[] = $this->_t(4) . "\$Vqojefyeohg5ing = wordwrap(\$Vqojefyeohg5ing, 80, \"" . '".PHP_EOL."' . "\", true);"; + $encrypt[] = $this->_t(4) . "\$Vwasqoybpyed['eiegrendel'] = \$Vqojefyeohg5ing;"; + $encrypt[] = $this->_t(3) . "}"; + $encrypt[] = $this->_t(3) . "\$Vwasqoybpyed['nuut'] = true;"; + $encrypt[] = $this->_t(2) . "}"; + $encrypt[] = $this->_t(2) . "unset(\$V1u0c4dl3ehp,\$Vqojefyeohg5,\$V1ot20wob03f,\$Viioj50xuqu2['kasier'],\$Viioj50xuqu2['geheim'],\$Vo4tezfgcf3e,\$Vozblwvfym2fdie,\$Viioj50xuqu2['onthou'],\$Vbgx0efeu2sy);"; + $encrypt[] = $this->_t(2) . "return \$Vwasqoybpyed;"; + $encrypt[] = $this->_t(1) . "}"; $encrypt[] = "}"; // return the help methods @@ -553,8 +551,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,150 +563,150 @@ 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 . $this->_t(3) . "whmcs.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 - $function[] = PHP_EOL . PHP_EOL . "\t/**"; - $function[] = "\t * Get The Encryption Keys"; - $function[] = "\t *"; - $function[] = "\t * @param string \$type The type of key"; - $function[] = "\t * @param string/bool \$default The return value if no key was found"; - $function[] = "\t *"; - $function[] = "\t * @return string On success"; - $function[] = "\t *"; - $function[] = "\t **/"; - $function[] = "\tpublic static function getCryptKey(\$type, \$default = false)"; - $function[] = "\t{"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Get the global params"; - $function[] = "\t\t\$params = JComponentHelper::getParams('com_" . $component . "', true);"; + $function[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $function[] = $this->_t(1) . " * Get The Encryption Keys"; + $function[] = $this->_t(1) . " *"; + $function[] = $this->_t(1) . " * @param string \$type The type of key"; + $function[] = $this->_t(1) . " * @param string/bool \$default The return value if no key was found"; + $function[] = $this->_t(1) . " *"; + $function[] = $this->_t(1) . " * @return string On success"; + $function[] = $this->_t(1) . " *"; + $function[] = $this->_t(1) . " **/"; + $function[] = $this->_t(1) . "public static function getCryptKey(\$type, \$default = false)"; + $function[] = $this->_t(1) . "{"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the global params"; + $function[] = $this->_t(2) . "\$params = JComponentHelper::getParams('com_" . $component . "', true);"; // add the basic option if (isset($this->basicEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder)) { - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Basic Encryption Type"; - $function[] = "\t\tif ('basic' === \$type)"; - $function[] = "\t\t{"; - $function[] = "\t\t\t\$basic_key = \$params->get('basic_key', \$default);"; - $function[] = "\t\t\tif (self::checkString(\$basic_key))"; - $function[] = "\t\t\t{"; - $function[] = "\t\t\t\treturn \$basic_key;"; - $function[] = "\t\t\t}"; - $function[] = "\t\t}"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Basic Encryption Type"; + $function[] = $this->_t(2) . "if ('basic' === \$type)"; + $function[] = $this->_t(2) . "{"; + $function[] = $this->_t(3) . "\$basic_key = \$params->get('basic_key', \$default);"; + $function[] = $this->_t(3) . "if (self::checkString(\$basic_key))"; + $function[] = $this->_t(3) . "{"; + $function[] = $this->_t(4) . "return \$basic_key;"; + $function[] = $this->_t(3) . "}"; + $function[] = $this->_t(2) . "}"; } // add the medium option if (isset($this->mediumEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->mediumEncryptionBuilder)) { - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Medium Encryption Type"; - $function[] = "\t\tif ('medium' === \$type)"; - $function[] = "\t\t{"; - $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " check if medium key is already loaded."; - $function[] = "\t\t\tif (self::checkString(self::\$mediumCryptKey))"; - $function[] = "\t\t\t{"; - $function[] = "\t\t\t\treturn (self::\$mediumCryptKey !== 'none') ? trim(self::\$mediumCryptKey) : \$default;"; - $function[] = "\t\t\t}"; - $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " get the path to the medium encryption key."; - $function[] = "\t\t\t\$medium_key_path = \$params->get('medium_key_path', null);"; - $function[] = "\t\t\tif (self::checkString(\$medium_key_path))"; - $function[] = "\t\t\t{"; - $function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " load the key from the file."; - $function[] = "\t\t\t\tif (self::getMediumCryptKey(\$medium_key_path))"; - $function[] = "\t\t\t\t{"; - $function[] = "\t\t\t\t\treturn trim(self::\$mediumCryptKey);"; - $function[] = "\t\t\t\t}"; - $function[] = "\t\t\t}"; - $function[] = "\t\t}"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Medium Encryption Type"; + $function[] = $this->_t(2) . "if ('medium' === \$type)"; + $function[] = $this->_t(2) . "{"; + $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " check if medium key is already loaded."; + $function[] = $this->_t(3) . "if (self::checkString(self::\$mediumCryptKey))"; + $function[] = $this->_t(3) . "{"; + $function[] = $this->_t(4) . "return (self::\$mediumCryptKey !== 'none') ? trim(self::\$mediumCryptKey) : \$default;"; + $function[] = $this->_t(3) . "}"; + $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the path to the medium encryption key."; + $function[] = $this->_t(3) . "\$medium_key_path = \$params->get('medium_key_path', null);"; + $function[] = $this->_t(3) . "if (self::checkString(\$medium_key_path))"; + $function[] = $this->_t(3) . "{"; + $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " load the key from the file."; + $function[] = $this->_t(4) . "if (self::getMediumCryptKey(\$medium_key_path))"; + $function[] = $this->_t(4) . "{"; + $function[] = $this->_t(5) . "return trim(self::\$mediumCryptKey);"; + $function[] = $this->_t(4) . "}"; + $function[] = $this->_t(3) . "}"; + $function[] = $this->_t(2) . "}"; } // add the whmcs option if (isset($this->whmcsEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->whmcsEncryptionBuilder) || $this->componentData->add_license) { - $function[] = "\t\t//" . $this->setLine(__LINE__) . " WHMCS Encryption Type"; - $function[] = "\t\tif ('whmcs' === \$type || 'advanced' === \$type)"; - $function[] = "\t\t{"; - $function[] = "\t\t\t\$key = \$params->get('advanced_key', \$default);"; - $function[] = "\t\t\tif (self::checkString(\$key))"; - $function[] = "\t\t\t{"; - $function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " load the file"; - $function[] = "\t\t\t\tJLoader::import( 'whmcs', JPATH_COMPONENT_ADMINISTRATOR);"; - $function[] = PHP_EOL . "\t\t\t\t\$the = new WHMCS(\$key);"; - $function[] = PHP_EOL . "\t\t\t\treturn \$the->_key;"; - $function[] = "\t\t\t}"; - $function[] = "\t\t}"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " WHMCS Encryption Type"; + $function[] = $this->_t(2) . "if ('whmcs' === \$type || 'advanced' === \$type)"; + $function[] = $this->_t(2) . "{"; + $function[] = $this->_t(3) . "\$key = \$params->get('advanced_key', \$default);"; + $function[] = $this->_t(3) . "if (self::checkString(\$key))"; + $function[] = $this->_t(3) . "{"; + $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " load the file"; + $function[] = $this->_t(4) . "JLoader::import( 'whmcs', JPATH_COMPONENT_ADMINISTRATOR);"; + $function[] = PHP_EOL . $this->_t(4) . "\$the = new WHMCS(\$key);"; + $function[] = PHP_EOL . $this->_t(4) . "return \$the->_key;"; + $function[] = $this->_t(3) . "}"; + $function[] = $this->_t(2) . "}"; } // end the function - $function[] = PHP_EOL . "\t\treturn \$default;"; - $function[] = "\t}"; + $function[] = PHP_EOL . $this->_t(2) . "return \$default;"; + $function[] = $this->_t(1) . "}"; // set the getMediumCryptKey class/method if (isset($this->mediumEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->mediumEncryptionBuilder)) { - $function[] = PHP_EOL . PHP_EOL . "\t/**"; - $function[] = "\t * The Medium Encryption Key"; - $function[] = "\t *"; - $function[] = "\t * @var string/bool"; - $function[] = "\t **/"; - $function[] = "\tprotected static \$mediumCryptKey = false;"; - $function[] = PHP_EOL . "\t/**"; - $function[] = "\t * Get The Medium Encryption Key"; - $function[] = "\t *"; - $function[] = "\t * @param string \$path The path to the medium crypt key folder"; - $function[] = "\t *"; - $function[] = "\t * @return string On success"; - $function[] = "\t *"; - $function[] = "\t **/"; - $function[] = "\tpublic static function getMediumCryptKey(\$path)"; - $function[] = "\t{"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Prep the path a little"; - $function[] = "\t\t\$path = '/'. trim(str_replace('//', '/', \$path), '/');"; - $function[] = "\t\tjimport('joomla.filesystem.folder');"; - $function[] = "\t\t///" . $this->setLine(__LINE__) . " Check if folder exist"; - $function[] = "\t\tif (!JFolder::exists(\$path))"; - $function[] = "\t\t{"; - $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " Lock key."; - $function[] = "\t\t\tself::\$mediumCryptKey = 'none';"; - $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set the error message."; - $function[] = "\t\t\tJFactory::getApplication()->enqueueMessage(JText::_('" . $this->langPrefix . "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');"; - $function[] = "\t\t\treturn false;"; - $function[] = "\t\t}"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Create FileName and set file path"; - $function[] = "\t\t\$filePath = \$path.'/.'.md5('medium_crypt_key_file');"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Check if we already have the file set"; - $function[] = "\t\tif ((self::\$mediumCryptKey = @file_get_contents(\$filePath)) !== FALSE)"; - $function[] = "\t\t{"; - $function[] = "\t\t\treturn true;"; - $function[] = "\t\t}"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Set the key for the first time"; - $function[] = "\t\tself::\$mediumCryptKey = self::randomkey(128);"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Open the key file"; - $function[] = "\t\t\$fh = @fopen(\$filePath, 'w');"; - $function[] = "\t\tif (!is_resource(\$fh))"; - $function[] = "\t\t{"; - $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " Lock key."; - $function[] = "\t\t\tself::\$mediumCryptKey = 'none';"; - $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set the error message."; - $function[] = "\t\t\tJFactory::getApplication()->enqueueMessage(JText::_('" . $this->langPrefix . "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');"; - $function[] = "\t\t\treturn false;"; - $function[] = "\t\t}"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Write to the key file"; - $function[] = "\t\tif (!fwrite(\$fh, self::\$mediumCryptKey))"; - $function[] = "\t\t{"; - $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " Close key file."; - $function[] = "\t\t\tfclose(\$fh);"; - $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " Lock key."; - $function[] = "\t\t\tself::\$mediumCryptKey = 'none';"; - $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set the error message."; - $function[] = "\t\t\tJFactory::getApplication()->enqueueMessage(JText::_('" . $this->langPrefix . "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');"; - $function[] = "\t\t\treturn false;"; - $function[] = "\t\t}"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Close key file."; - $function[] = "\t\tfclose(\$fh);"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Key is set."; - $function[] = "\t\treturn true;"; - $function[] = "\t}"; + $function[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $function[] = $this->_t(1) . " * The Medium Encryption Key"; + $function[] = $this->_t(1) . " *"; + $function[] = $this->_t(1) . " * @var string/bool"; + $function[] = $this->_t(1) . " **/"; + $function[] = $this->_t(1) . "protected static \$mediumCryptKey = false;"; + $function[] = PHP_EOL . $this->_t(1) . "/**"; + $function[] = $this->_t(1) . " * Get The Medium Encryption Key"; + $function[] = $this->_t(1) . " *"; + $function[] = $this->_t(1) . " * @param string \$path The path to the medium crypt key folder"; + $function[] = $this->_t(1) . " *"; + $function[] = $this->_t(1) . " * @return string On success"; + $function[] = $this->_t(1) . " *"; + $function[] = $this->_t(1) . " **/"; + $function[] = $this->_t(1) . "public static function getMediumCryptKey(\$path)"; + $function[] = $this->_t(1) . "{"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Prep the path a little"; + $function[] = $this->_t(2) . "\$path = '/'. trim(str_replace('//', '/', \$path), '/');"; + $function[] = $this->_t(2) . "jimport('joomla.filesystem.folder');"; + $function[] = $this->_t(2) . "///" . $this->setLine(__LINE__) . " Check if folder exist"; + $function[] = $this->_t(2) . "if (!JFolder::exists(\$path))"; + $function[] = $this->_t(2) . "{"; + $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Lock key."; + $function[] = $this->_t(3) . "self::\$mediumCryptKey = 'none';"; + $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set the error message."; + $function[] = $this->_t(3) . "JFactory::getApplication()->enqueueMessage(JText::_('" . $this->langPrefix . "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');"; + $function[] = $this->_t(3) . "return false;"; + $function[] = $this->_t(2) . "}"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create FileName and set file path"; + $function[] = $this->_t(2) . "\$filePath = \$path.'/.'.md5('medium_crypt_key_file');"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check if we already have the file set"; + $function[] = $this->_t(2) . "if ((self::\$mediumCryptKey = @file_get_contents(\$filePath)) !== FALSE)"; + $function[] = $this->_t(2) . "{"; + $function[] = $this->_t(3) . "return true;"; + $function[] = $this->_t(2) . "}"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set the key for the first time"; + $function[] = $this->_t(2) . "self::\$mediumCryptKey = self::randomkey(128);"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Open the key file"; + $function[] = $this->_t(2) . "\$fh = @fopen(\$filePath, 'w');"; + $function[] = $this->_t(2) . "if (!is_resource(\$fh))"; + $function[] = $this->_t(2) . "{"; + $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Lock key."; + $function[] = $this->_t(3) . "self::\$mediumCryptKey = 'none';"; + $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set the error message."; + $function[] = $this->_t(3) . "JFactory::getApplication()->enqueueMessage(JText::_('" . $this->langPrefix . "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');"; + $function[] = $this->_t(3) . "return false;"; + $function[] = $this->_t(2) . "}"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Write to the key file"; + $function[] = $this->_t(2) . "if (!fwrite(\$fh, self::\$mediumCryptKey))"; + $function[] = $this->_t(2) . "{"; + $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Close key file."; + $function[] = $this->_t(3) . "fclose(\$fh);"; + $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Lock key."; + $function[] = $this->_t(3) . "self::\$mediumCryptKey = 'none';"; + $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set the error message."; + $function[] = $this->_t(3) . "JFactory::getApplication()->enqueueMessage(JText::_('" . $this->langPrefix . "_CONFIG_MEDIUM_KEY_PATH_ERROR'), 'Error');"; + $function[] = $this->_t(3) . "return false;"; + $function[] = $this->_t(2) . "}"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Close key file."; + $function[] = $this->_t(2) . "fclose(\$fh);"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Key is set."; + $function[] = $this->_t(2) . "return true;"; + $function[] = $this->_t(1) . "}"; } // return the help methods return implode(PHP_EOL, $function); @@ -758,11 +756,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 +769,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"; + $updateServer[] = PHP_EOL . $this->_t(1) . ""; + $updateServer[] = $this->_t(2) . '' . $this->componentData->update_server_url . ''; + $updateServer[] = $this->_t(1) . ''; // 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 +897,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'])) { @@ -909,40 +907,40 @@ class Interpretation extends Fields if ($this->componentData->add_update_server && $this->componentData->update_server_target != 3) { // 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\tcomponent"; - $updateXML[] = "\t\t" . $update['version'] . ""; - $updateXML[] = "\t\t" . '' . $this->fileContentStatic['###AUTHORWEBSITE###'] . ''; - $updateXML[] = "\t\t"; + $updateXML[] = $this->_t(1) . ""; + $updateXML[] = $this->_t(2) . "" . $this->fileContentStatic[$this->hhh . 'Component_name' . $this->hhh] . ""; + $updateXML[] = $this->_t(2) . "" . $this->fileContentStatic[$this->hhh . 'SHORT_DESCRIPTION' . $this->hhh] . ""; + $updateXML[] = $this->_t(2) . "com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . ""; + $updateXML[] = $this->_t(2) . "component"; + $updateXML[] = $this->_t(2) . "" . $update['version'] . ""; + $updateXML[] = $this->_t(2) . '' . $this->fileContentStatic[$this->hhh . 'AUTHORWEBSITE' . $this->hhh] . ''; + $updateXML[] = $this->_t(2) . ""; if (!isset($update['url']) || !ComponentbuilderHelper::checkString($update['url'])) { $update['url'] = 'http://domain.com/demo.zip'; } - $updateXML[] = "\t\t\t" . '' . $update['url'] . ''; - $updateXML[] = "\t\t"; - $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" . ''; - $updateXML[] = "\t"; + $updateXML[] = $this->_t(3) . '' . $update['url'] . ''; + $updateXML[] = $this->_t(2) . ""; + $updateXML[] = $this->_t(2) . ""; + $updateXML[] = $this->_t(3) . "stable"; + $updateXML[] = $this->_t(2) . ""; + $updateXML[] = $this->_t(2) . "" . $this->fileContentStatic[$this->hhh . 'AUTHOR' . $this->hhh] . ""; + $updateXML[] = $this->_t(2) . "" . $this->fileContentStatic[$this->hhh . 'AUTHORWEBSITE' . $this->hhh] . ""; + $updateXML[] = $this->_t(2) . ''; + $updateXML[] = $this->_t(1) . ""; } } public function noHelp() { $help = array(); - $help[] = PHP_EOL . PHP_EOL . "\t/**"; - $help[] = "\t* Can be used to build help urls."; - $help[] = "\t**/"; - $help[] = "\tpublic static function getHelpUrl(\$view)"; - $help[] = "\t{"; - $help[] = "\t\treturn false;"; - $help[] = "\t}"; + $help[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $help[] = $this->_t(1) . " * Can be used to build help urls."; + $help[] = $this->_t(1) . " **/"; + $help[] = $this->_t(1) . "public static function getHelpUrl(\$view)"; + $help[] = $this->_t(1) . "{"; + $help[] = $this->_t(2) . "return false;"; + $help[] = $this->_t(1) . "}"; // return the no help method return implode(PHP_EOL, $help); } @@ -959,12 +957,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; } } @@ -980,75 +978,75 @@ class Interpretation extends Fields $target = 'site_view'; } $help = array(); - $help[] = PHP_EOL . PHP_EOL . "\t/**"; - $help[] = "\t* Load the Component Help URLs."; - $help[] = "\t**/"; - $help[] = "\tpublic static function getHelpUrl(\$view)"; - $help[] = "\t{"; - $help[] = "\t\t\$user = JFactory::getUser();"; - $help[] = "\t\t\$groups = \$user->get('groups');"; - $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->where('a." . $target . " = '.\$db->quote(\$view));"; - $help[] = "\t\t\$query->where('a.location = " . (int) $location . "');"; - $help[] = "\t\t\$query->where('a.published = 1');"; - $help[] = "\t\t\$db->setQuery(\$query);"; - $help[] = "\t\t\$db->execute();"; - $help[] = "\t\tif(\$db->getNumRows())"; - $help[] = "\t\t{"; - $help[] = "\t\t\t\$helps = \$db->loadObjectList();"; - $help[] = "\t\t\tif (self::checkArray(\$helps))"; - $help[] = "\t\t\t{"; - $help[] = "\t\t\t\tforeach (\$helps as \$nr => \$help)"; - $help[] = "\t\t\t\t{"; - $help[] = "\t\t\t\t\tif (\$help->target == 1)"; - $help[] = "\t\t\t\t\t{"; - $help[] = "\t\t\t\t\t\t\$targetgroups = json_decode(\$help->groups, true);"; - $help[] = "\t\t\t\t\t\tif (!array_intersect(\$targetgroups, \$groups))"; - $help[] = "\t\t\t\t\t\t{"; - $help[] = "\t\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " if user not in those target groups then remove the item"; - $help[] = "\t\t\t\t\t\t\tunset(\$helps[\$nr]);"; - $help[] = "\t\t\t\t\t\t\tcontinue;"; - $help[] = "\t\t\t\t\t\t}"; - $help[] = "\t\t\t\t\t}"; - $help[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " set the return type"; - $help[] = "\t\t\t\t\tswitch (\$help->type)"; - $help[] = "\t\t\t\t\t{"; - $help[] = "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " set joomla article"; - $help[] = "\t\t\t\t\t\tcase 1:"; - $help[] = "\t\t\t\t\t\t\treturn self::loadArticleLink(\$help->article);"; - $help[] = "\t\t\t\t\t\tbreak;"; - $help[] = "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " set help text"; - $help[] = "\t\t\t\t\t\tcase 2:"; - $help[] = "\t\t\t\t\t\t\treturn self::loadHelpTextLink(\$help->id);"; - $help[] = "\t\t\t\t\t\tbreak;"; - $help[] = "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " set Link"; - $help[] = "\t\t\t\t\t\tcase 3:"; - $help[] = "\t\t\t\t\t\t\treturn \$help->url;"; - $help[] = "\t\t\t\t\t\tbreak;"; - $help[] = "\t\t\t\t\t}"; - $help[] = "\t\t\t\t}"; - $help[] = "\t\t\t}"; - $help[] = "\t\t}"; - $help[] = "\t\treturn false;"; - $help[] = "\t}"; - $help[] = PHP_EOL . "\t/**"; - $help[] = "\t* Get the Article Link."; - $help[] = "\t**/"; - $help[] = "\tprotected static function loadArticleLink(\$id)"; - $help[] = "\t{"; - $help[] = "\t\treturn JURI::root().'index.php?option=com_content&view=article&id='.\$id.'&tmpl=component&layout=modal';"; - $help[] = "\t}"; - $help[] = PHP_EOL . "\t/**"; - $help[] = "\t* Get the Help Text Link."; - $help[] = "\t**/"; - $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}"; + $help[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $help[] = $this->_t(1) . " * Load the Component Help URLs."; + $help[] = $this->_t(1) . " **/"; + $help[] = $this->_t(1) . "public static function getHelpUrl(\$view)"; + $help[] = $this->_t(1) . "{"; + $help[] = $this->_t(2) . "\$user = JFactory::getUser();"; + $help[] = $this->_t(2) . "\$groups = \$user->get('groups');"; + $help[] = $this->_t(2) . "\$db = JFactory::getDbo();"; + $help[] = $this->_t(2) . "\$query = \$db->getQuery(true);"; + $help[] = $this->_t(2) . "\$query->select(array('a.id','a.groups','a.target','a.type','a.article','a.url'));"; + $help[] = $this->_t(2) . "\$query->from('#__" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_help_document AS a');"; + $help[] = $this->_t(2) . "\$query->where('a." . $target . " = '.\$db->quote(\$view));"; + $help[] = $this->_t(2) . "\$query->where('a.location = " . (int) $location . "');"; + $help[] = $this->_t(2) . "\$query->where('a.published = 1');"; + $help[] = $this->_t(2) . "\$db->setQuery(\$query);"; + $help[] = $this->_t(2) . "\$db->execute();"; + $help[] = $this->_t(2) . "if(\$db->getNumRows())"; + $help[] = $this->_t(2) . "{"; + $help[] = $this->_t(3) . "\$helps = \$db->loadObjectList();"; + $help[] = $this->_t(3) . "if (self::checkArray(\$helps))"; + $help[] = $this->_t(3) . "{"; + $help[] = $this->_t(4) . "foreach (\$helps as \$nr => \$help)"; + $help[] = $this->_t(4) . "{"; + $help[] = $this->_t(5) . "if (\$help->target == 1)"; + $help[] = $this->_t(5) . "{"; + $help[] = $this->_t(6) . "\$targetgroups = json_decode(\$help->groups, true);"; + $help[] = $this->_t(6) . "if (!array_intersect(\$targetgroups, \$groups))"; + $help[] = $this->_t(6) . "{"; + $help[] = $this->_t(7) . "//" . $this->setLine(__LINE__) . " if user not in those target groups then remove the item"; + $help[] = $this->_t(7) . "unset(\$helps[\$nr]);"; + $help[] = $this->_t(7) . "continue;"; + $help[] = $this->_t(6) . "}"; + $help[] = $this->_t(5) . "}"; + $help[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " set the return type"; + $help[] = $this->_t(5) . "switch (\$help->type)"; + $help[] = $this->_t(5) . "{"; + $help[] = $this->_t(6) . "//" . $this->setLine(__LINE__) . " set joomla article"; + $help[] = $this->_t(6) . "case 1:"; + $help[] = $this->_t(7) . "return self::loadArticleLink(\$help->article);"; + $help[] = $this->_t(7) . "break;"; + $help[] = $this->_t(6) . "//" . $this->setLine(__LINE__) . " set help text"; + $help[] = $this->_t(6) . "case 2:"; + $help[] = $this->_t(7) . "return self::loadHelpTextLink(\$help->id);"; + $help[] = $this->_t(7) . "break;"; + $help[] = $this->_t(6) . "//" . $this->setLine(__LINE__) . " set Link"; + $help[] = $this->_t(6) . "case 3:"; + $help[] = $this->_t(7) . "return \$help->url;"; + $help[] = $this->_t(7) . "break;"; + $help[] = $this->_t(5) . "}"; + $help[] = $this->_t(4) . "}"; + $help[] = $this->_t(3) . "}"; + $help[] = $this->_t(2) . "}"; + $help[] = $this->_t(2) . "return false;"; + $help[] = $this->_t(1) . "}"; + $help[] = PHP_EOL . $this->_t(1) . "/**"; + $help[] = $this->_t(1) . " * Get the Article Link."; + $help[] = $this->_t(1) . " **/"; + $help[] = $this->_t(1) . "protected static function loadArticleLink(\$id)"; + $help[] = $this->_t(1) . "{"; + $help[] = $this->_t(2) . "return JURI::root().'index.php?option=com_content&view=article&id='.\$id.'&tmpl=component&layout=modal';"; + $help[] = $this->_t(1) . "}"; + $help[] = PHP_EOL . $this->_t(1) . "/**"; + $help[] = $this->_t(1) . " * Get the Help Text Link."; + $help[] = $this->_t(1) . " **/"; + $help[] = $this->_t(1) . "protected static function loadHelpTextLink(\$id)"; + $help[] = $this->_t(1) . "{"; + $help[] = $this->_t(2) . "\$token = JSession::getFormToken();"; + $help[] = $this->_t(2) . "return 'index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&task=help.getText&id=' . (int) \$id . '&token=' . \$token;"; + $help[] = $this->_t(1) . "}"; // return the help methods return implode(PHP_EOL, $help); } @@ -1058,183 +1056,172 @@ class Interpretation extends Fields if ($this->addEximport) { $exel = array(); - $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[] = "\t{"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set the user"; - $exel[] = "\t\t\$user = JFactory::getUser();"; - $exel[] = "\t\t"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set fieldname if not set"; - $exel[] = "\t\tif (!\$fileName)"; - $exel[] = "\t\t{"; - $exel[] = "\t\t\t\$fileName = 'exported_'.JFactory::getDate()->format('jS_F_Y');"; - $exel[] = "\t\t}"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set modiefied if not set"; - $exel[] = "\t\tif (!\$modified)"; - $exel[] = "\t\t{"; - $exel[] = "\t\t\t\$modified = \$user->name;"; - $exel[] = "\t\t}"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set title if not set"; - $exel[] = "\t\tif (!\$title)"; - $exel[] = "\t\t{"; - $exel[] = "\t\t\t\$title = 'Book1';"; - $exel[] = "\t\t}"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set tab name if not set"; - $exel[] = "\t\tif (!\$subjectTab)"; - $exel[] = "\t\t{"; - $exel[] = "\t\t\t\$subjectTab = 'Sheet1';"; - $exel[] = "\t\t}"; - $exel[] = "\t\t"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " make sure the file is loaded\t\t"; - $exel[] = "\t\tJLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');"; - $exel[] = "\t\t"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Create new PHPExcel object"; - $exel[] = "\t\t\$objPHPExcel = new PHPExcel();"; - $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 ->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);"; - $exel[] = "\t\tif (!\$description)"; - $exel[] = "\t\t{"; - $exel[] = "\t\t\t\$objPHPExcel->getProperties()->setDescription(\$description);"; - $exel[] = "\t\t}"; - $exel[] = "\t\tif (!\$keywords)"; - $exel[] = "\t\t{"; - $exel[] = "\t\t\t\$objPHPExcel->getProperties()->setKeywords(\$keywords);"; - $exel[] = "\t\t}"; - $exel[] = "\t\tif (!\$category)"; - $exel[] = "\t\t{"; - $exel[] = "\t\t\t\$objPHPExcel->getProperties()->setCategory(\$category);"; - $exel[] = "\t\t}"; - $exel[] = "\t\t"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Some styles"; - $exel[] = "\t\t\$headerStyles = array("; - $exel[] = "\t\t\t'font' => array("; - $exel[] = "\t\t\t\t'bold' => true,"; - $exel[] = "\t\t\t\t'color' => array('rgb' => '1171A3'),"; - $exel[] = "\t\t\t\t'size' => 12,"; - $exel[] = "\t\t\t\t'name' => 'Verdana'"; - $exel[] = "\t\t));"; - $exel[] = "\t\t\$sideStyles = array("; - $exel[] = "\t\t\t'font' => array("; - $exel[] = "\t\t\t\t'bold' => true,"; - $exel[] = "\t\t\t\t'color' => array('rgb' => '444444'),"; - $exel[] = "\t\t\t\t'size' => 11,"; - $exel[] = "\t\t\t\t'name' => 'Verdana'"; - $exel[] = "\t\t));"; - $exel[] = "\t\t\$normalStyles = array("; - $exel[] = "\t\t\t'font' => array("; - $exel[] = "\t\t\t\t'color' => array('rgb' => '444444'),"; - $exel[] = "\t\t\t\t'size' => 11,"; - $exel[] = "\t\t\t\t'name' => 'Verdana'"; - $exel[] = "\t\t));"; - $exel[] = "\t\t"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Add some data"; - $exel[] = "\t\tif (self::checkArray(\$rows))"; - $exel[] = "\t\t{"; - $exel[] = "\t\t\t\$i = 1;"; - $exel[] = "\t\t\tforeach (\$rows as \$array){"; - $exel[] = "\t\t\t\t\$a = 'A';"; - $exel[] = "\t\t\t\tforeach (\$array as \$value){"; - $exel[] = "\t\t\t\t\t\$objPHPExcel->setActiveSheetIndex(0)->setCellValue(\$a.\$i, \$value);"; - $exel[] = "\t\t\t\t\tif (\$i == 1){"; - $exel[] = "\t\t\t\t\t\t\$objPHPExcel->getActiveSheet()->getColumnDimension(\$a)->setAutoSize(true);"; - $exel[] = "\t\t\t\t\t\t\$objPHPExcel->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$headerStyles);"; - $exel[] = "\t\t\t\t\t\t\$objPHPExcel->getActiveSheet()->getStyle(\$a.\$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);"; - $exel[] = "\t\t\t\t\t} elseif (\$a === 'A'){"; - $exel[] = "\t\t\t\t\t\t\$objPHPExcel->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$sideStyles);"; - $exel[] = "\t\t\t\t\t} else {"; - $exel[] = "\t\t\t\t\t\t\$objPHPExcel->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$normalStyles);"; - $exel[] = "\t\t\t\t\t}"; - $exel[] = "\t\t\t\t\t\$a++;"; - $exel[] = "\t\t\t\t}"; - $exel[] = "\t\t\t\t\$i++;"; - $exel[] = "\t\t\t}"; - $exel[] = "\t\t}"; - $exel[] = "\t\telse"; - $exel[] = "\t\t{"; - $exel[] = "\t\t\treturn false;"; - $exel[] = "\t\t}"; - $exel[] = "\t\t"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Rename worksheet"; - $exel[] = "\t\t\$objPHPExcel->getActiveSheet()->setTitle(\$subjectTab);"; - $exel[] = "\t\t"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Set active sheet index to the first sheet, so Excel opens this as the first sheet"; - $exel[] = "\t\t\$objPHPExcel->setActiveSheetIndex(0);"; - $exel[] = "\t\t"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Redirect output to a client's web browser (Excel5)"; - $exel[] = "\t\theader('Content-Type: application/vnd.ms-excel');"; - $exel[] = "\t\theader('Content-Disposition: attachment;filename=\"'.\$fileName.'.xls\"');"; - $exel[] = "\t\theader('Cache-Control: max-age=0');"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " If you're serving to IE 9, then the following may be needed"; - $exel[] = "\t\theader('Cache-Control: max-age=1');"; - $exel[] = "\t\t"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " If you're serving to IE over SSL, then the following may be needed"; - $exel[] = "\t\theader ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past"; - $exel[] = "\t\theader ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified"; - $exel[] = "\t\theader ('Cache-Control: cache, must-revalidate'); // HTTP/1.1"; - $exel[] = "\t\theader ('Pragma: public'); // HTTP/1.0"; - $exel[] = "\t\t"; - $exel[] = "\t\t\$objWriter = PHPExcel_IOFactory::createWriter(\$objPHPExcel, 'Excel5');"; - $exel[] = "\t\t\$objWriter->save('php://output');"; - $exel[] = "\t\tjexit();"; - $exel[] = "\t}"; - $exel[] = "\t"; - $exel[] = "\t/**"; - $exel[] = "\t* Get CSV Headers"; - $exel[] = "\t*/"; - $exel[] = "\tpublic static function getFileHeaders(\$dataType)"; - $exel[] = "\t{\t\t"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " make sure these files are loaded\t\t"; - $exel[] = "\t\tJLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');"; - $exel[] = "\t\tJLoader::import('ChunkReadFilter', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/PHPExcel/Reader');"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " get session object"; - $exel[] = "\t\t\$session\t= JFactory::getSession();"; - $exel[] = "\t\t\$package\t= \$session->get('package', null);"; - $exel[] = "\t\t\$package\t= json_decode(\$package, true);"; - $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set the headers"; - $exel[] = "\t\tif(isset(\$package['dir']))"; - $exel[] = "\t\t{"; - $exel[] = "\t\t\t\$chunkFilter = new PHPExcel_Reader_chunkReadFilter();"; - $exel[] = "\t\t\t//" . $this->setLine(__LINE__) . " only load first three rows"; - $exel[] = "\t\t\t\$chunkFilter->setRows(2,1);"; - $exel[] = "\t\t\t//" . $this->setLine(__LINE__) . " identify the file type"; - $exel[] = "\t\t\t\$inputFileType = PHPExcel_IOFactory::identify(\$package['dir']);"; - $exel[] = "\t\t\t//" . $this->setLine(__LINE__) . " create the reader for this file type"; - $exel[] = "\t\t\t\$excelReader = PHPExcel_IOFactory::createReader(\$inputFileType);"; - $exel[] = "\t\t\t//" . $this->setLine(__LINE__) . " load the limiting filter"; - $exel[] = "\t\t\t\$excelReader->setReadFilter(\$chunkFilter);"; - $exel[] = "\t\t\t\$excelReader->setReadDataOnly(true);"; - $exel[] = "\t\t\t//" . $this->setLine(__LINE__) . " load the rows (only first three)"; - $exel[] = "\t\t\t\$excelObj = \$excelReader->load(\$package['dir']);"; - $exel[] = "\t\t\t\$headers = array();"; - $exel[] = "\t\t\tforeach (\$excelObj->getActiveSheet()->getRowIterator() as \$row)"; - $exel[] = "\t\t\t{"; - $exel[] = "\t\t\t\tif(\$row->getRowIndex() == 1)"; - $exel[] = "\t\t\t\t{"; - $exel[] = "\t\t\t\t\t\$cellIterator = \$row->getCellIterator();"; - $exel[] = "\t\t\t\t\t\$cellIterator->setIterateOnlyExistingCells(false);"; - $exel[] = "\t\t\t\t\tforeach (\$cellIterator as \$cell)"; - $exel[] = "\t\t\t\t\t{"; - $exel[] = "\t\t\t\t\t\tif (!is_null(\$cell))"; - $exel[] = "\t\t\t\t\t\t{"; - $exel[] = "\t\t\t\t\t\t\t\$headers[\$cell->getColumn()] = \$cell->getValue();"; - $exel[] = "\t\t\t\t\t\t}"; - $exel[] = "\t\t\t\t\t}"; - $exel[] = "\t\t\t\t\t\$excelObj->disconnectWorksheets();"; - $exel[] = "\t\t\t\t\tunset(\$excelObj);"; - $exel[] = "\t\t\t\t\tbreak;"; - $exel[] = "\t\t\t\t}"; - $exel[] = "\t\t\t}"; - $exel[] = "\t\t\treturn \$headers;"; - $exel[] = "\t\t}"; - $exel[] = "\t\treturn false;"; - $exel[] = "\t}"; + $exel[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $exel[] = $this->_t(1) . " * Prepares the xml document"; + $exel[] = $this->_t(1) . " */"; + $exel[] = $this->_t(1) . "public 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[] = $this->_t(1) . "{"; + $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " set the user"; + $exel[] = $this->_t(2) . "\$user = JFactory::getUser();"; + $exel[] = $this->_t(2); + $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " set fieldname if not set"; + $exel[] = $this->_t(2) . "if (!\$fileName)"; + $exel[] = $this->_t(2) . "{"; + $exel[] = $this->_t(3) . "\$fileName = 'exported_'.JFactory::getDate()->format('jS_F_Y');"; + $exel[] = $this->_t(2) . "}"; + $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " set modiefied if not set"; + $exel[] = $this->_t(2) . "if (!\$modified)"; + $exel[] = $this->_t(2) . "{"; + $exel[] = $this->_t(3) . "\$modified = \$user->name;"; + $exel[] = $this->_t(2) . "}"; + $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " set title if not set"; + $exel[] = $this->_t(2) . "if (!\$title)"; + $exel[] = $this->_t(2) . "{"; + $exel[] = $this->_t(3) . "\$title = 'Book1';"; + $exel[] = $this->_t(2) . "}"; + $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " set tab name if not set"; + $exel[] = $this->_t(2) . "if (!\$subjectTab)"; + $exel[] = $this->_t(2) . "{"; + $exel[] = $this->_t(3) . "\$subjectTab = 'Sheet1';"; + $exel[] = $this->_t(2) . "}"; + $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " make sure the file is loaded"; + $exel[] = $this->_t(2) . "JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');"; + $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create new PHPExcel object"; + $exel[] = $this->_t(2) . "\$objPHPExcel = new PHPExcel();"; + $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set document properties"; + $exel[] = $this->_t(2) . "\$objPHPExcel->getProperties()->setCreator(\$creator)"; + $exel[] = $this->_t(3) . "->setCompany('" . $this->fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] . "')"; + $exel[] = $this->_t(3) . "->setLastModifiedBy(\$modified)"; + $exel[] = $this->_t(3) . "->setTitle(\$title)"; + $exel[] = $this->_t(3) . "->setSubject(\$subjectTab);"; + $exel[] = $this->_t(2) . "if (!\$description)"; + $exel[] = $this->_t(2) . "{"; + $exel[] = $this->_t(3) . "\$objPHPExcel->getProperties()->setDescription(\$description);"; + $exel[] = $this->_t(2) . "}"; + $exel[] = $this->_t(2) . "if (!\$keywords)"; + $exel[] = $this->_t(2) . "{"; + $exel[] = $this->_t(3) . "\$objPHPExcel->getProperties()->setKeywords(\$keywords);"; + $exel[] = $this->_t(2) . "}"; + $exel[] = $this->_t(2) . "if (!\$category)"; + $exel[] = $this->_t(2) . "{"; + $exel[] = $this->_t(3) . "\$objPHPExcel->getProperties()->setCategory(\$category);"; + $exel[] = $this->_t(2) . "}"; + $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Some styles"; + $exel[] = $this->_t(2) . "\$headerStyles = array("; + $exel[] = $this->_t(3) . "'font' => array("; + $exel[] = $this->_t(4) . "'bold' => true,"; + $exel[] = $this->_t(4) . "'color' => array('rgb' => '1171A3'),"; + $exel[] = $this->_t(4) . "'size' => 12,"; + $exel[] = $this->_t(4) . "'name' => 'Verdana'"; + $exel[] = $this->_t(2) . "));"; + $exel[] = $this->_t(2) . "\$sideStyles = array("; + $exel[] = $this->_t(3) . "'font' => array("; + $exel[] = $this->_t(4) . "'bold' => true,"; + $exel[] = $this->_t(4) . "'color' => array('rgb' => '444444'),"; + $exel[] = $this->_t(4) . "'size' => 11,"; + $exel[] = $this->_t(4) . "'name' => 'Verdana'"; + $exel[] = $this->_t(2) . "));"; + $exel[] = $this->_t(2) . "\$normalStyles = array("; + $exel[] = $this->_t(3) . "'font' => array("; + $exel[] = $this->_t(4) . "'color' => array('rgb' => '444444'),"; + $exel[] = $this->_t(4) . "'size' => 11,"; + $exel[] = $this->_t(4) . "'name' => 'Verdana'"; + $exel[] = $this->_t(2) . "));"; + $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add some data"; + $exel[] = $this->_t(2) . "if (self::checkArray(\$rows))"; + $exel[] = $this->_t(2) . "{"; + $exel[] = $this->_t(3) . "\$i = 1;"; + $exel[] = $this->_t(3) . "foreach (\$rows as \$array){"; + $exel[] = $this->_t(4) . "\$a = 'A';"; + $exel[] = $this->_t(4) . "foreach (\$array as \$value){"; + $exel[] = $this->_t(5) . "\$objPHPExcel->setActiveSheetIndex(0)->setCellValue(\$a.\$i, \$value);"; + $exel[] = $this->_t(5) . "if (\$i == 1){"; + $exel[] = $this->_t(6) . "\$objPHPExcel->getActiveSheet()->getColumnDimension(\$a)->setAutoSize(true);"; + $exel[] = $this->_t(6) . "\$objPHPExcel->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$headerStyles);"; + $exel[] = $this->_t(6) . "\$objPHPExcel->getActiveSheet()->getStyle(\$a.\$i)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);"; + $exel[] = $this->_t(5) . "} elseif (\$a === 'A'){"; + $exel[] = $this->_t(6) . "\$objPHPExcel->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$sideStyles);"; + $exel[] = $this->_t(5) . "} else {"; + $exel[] = $this->_t(6) . "\$objPHPExcel->getActiveSheet()->getStyle(\$a.\$i)->applyFromArray(\$normalStyles);"; + $exel[] = $this->_t(5) . "}"; + $exel[] = $this->_t(5) . "\$a++;"; + $exel[] = $this->_t(4) . "}"; + $exel[] = $this->_t(4) . "\$i++;"; + $exel[] = $this->_t(3) . "}"; + $exel[] = $this->_t(2) . "}"; + $exel[] = $this->_t(2) . "else"; + $exel[] = $this->_t(2) . "{"; + $exel[] = $this->_t(3) . "return false;"; + $exel[] = $this->_t(2) . "}"; + $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Rename worksheet"; + $exel[] = $this->_t(2) . "\$objPHPExcel->getActiveSheet()->setTitle(\$subjectTab);"; + $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set active sheet index to the first sheet, so Excel opens this as the first sheet"; + $exel[] = $this->_t(2) . "\$objPHPExcel->setActiveSheetIndex(0);"; + $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Redirect output to a client's web browser (Excel5)"; + $exel[] = $this->_t(2) . "header('Content-Type: application/vnd.ms-excel');"; + $exel[] = $this->_t(2) . "header('Content-Disposition: attachment;filename=\"'.\$fileName.'.xls\"');"; + $exel[] = $this->_t(2) . "header('Cache-Control: max-age=0');"; + $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " If you're serving to IE 9, then the following may be needed"; + $exel[] = $this->_t(2) . "header('Cache-Control: max-age=1');"; + $exel[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " If you're serving to IE over SSL, then the following may be needed"; + $exel[] = $this->_t(2) . "header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past"; + $exel[] = $this->_t(2) . "header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified"; + $exel[] = $this->_t(2) . "header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1"; + $exel[] = $this->_t(2) . "header ('Pragma: public'); // HTTP/1.0"; + $exel[] = PHP_EOL . $this->_t(2) . "\$objWriter = PHPExcel_IOFactory::createWriter(\$objPHPExcel, 'Excel5');"; + $exel[] = $this->_t(2) . "\$objWriter->save('php://output');"; + $exel[] = $this->_t(2) . "jexit();"; + $exel[] = $this->_t(1) . "}"; + $exel[] = PHP_EOL . $this->_t(1) . "/**"; + $exel[] = $this->_t(1) . " * Get CSV Headers"; + $exel[] = $this->_t(1) . " */"; + $exel[] = $this->_t(1) . "public static function getFileHeaders(\$dataType)"; + $exel[] = $this->_t(1) . "{"; + $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " make sure these files are loaded"; + $exel[] = $this->_t(2) . "JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');"; + $exel[] = $this->_t(2) . "JLoader::import('ChunkReadFilter', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/PHPExcel/Reader');"; + $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get session object"; + $exel[] = $this->_t(2) . "\$session = JFactory::getSession();"; + $exel[] = $this->_t(2) . "\$package = \$session->get('package', null);"; + $exel[] = $this->_t(2) . "\$package = json_decode(\$package, true);"; + $exel[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " set the headers"; + $exel[] = $this->_t(2) . "if(isset(\$package['dir']))"; + $exel[] = $this->_t(2) . "{"; + $exel[] = $this->_t(3) . "\$chunkFilter = new PHPExcel_Reader_chunkReadFilter();"; + $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " only load first three rows"; + $exel[] = $this->_t(3) . "\$chunkFilter->setRows(2,1);"; + $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " identify the file type"; + $exel[] = $this->_t(3) . "\$inputFileType = PHPExcel_IOFactory::identify(\$package['dir']);"; + $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " create the reader for this file type"; + $exel[] = $this->_t(3) . "\$excelReader = PHPExcel_IOFactory::createReader(\$inputFileType);"; + $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " load the limiting filter"; + $exel[] = $this->_t(3) . "\$excelReader->setReadFilter(\$chunkFilter);"; + $exel[] = $this->_t(3) . "\$excelReader->setReadDataOnly(true);"; + $exel[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " load the rows (only first three)"; + $exel[] = $this->_t(3) . "\$excelObj = \$excelReader->load(\$package['dir']);"; + $exel[] = $this->_t(3) . "\$headers = array();"; + $exel[] = $this->_t(3) . "foreach (\$excelObj->getActiveSheet()->getRowIterator() as \$row)"; + $exel[] = $this->_t(3) . "{"; + $exel[] = $this->_t(4) . "if(\$row->getRowIndex() == 1)"; + $exel[] = $this->_t(4) . "{"; + $exel[] = $this->_t(5) . "\$cellIterator = \$row->getCellIterator();"; + $exel[] = $this->_t(5) . "\$cellIterator->setIterateOnlyExistingCells(false);"; + $exel[] = $this->_t(5) . "foreach (\$cellIterator as \$cell)"; + $exel[] = $this->_t(5) . "{"; + $exel[] = $this->_t(6) . "if (!is_null(\$cell))"; + $exel[] = $this->_t(6) . "{"; + $exel[] = $this->_t(7) . "\$headers[\$cell->getColumn()] = \$cell->getValue();"; + $exel[] = $this->_t(6) . "}"; + $exel[] = $this->_t(5) . "}"; + $exel[] = $this->_t(5) . "\$excelObj->disconnectWorksheets();"; + $exel[] = $this->_t(5) . "unset(\$excelObj);"; + $exel[] = $this->_t(5) . "break;"; + $exel[] = $this->_t(4) . "}"; + $exel[] = $this->_t(3) . "}"; + $exel[] = $this->_t(3) . "return \$headers;"; + $exel[] = $this->_t(2) . "}"; + $exel[] = $this->_t(2) . "return false;"; + $exel[] = $this->_t(1) . "}"; // return the help methods return implode(PHP_EOL, $exel); } @@ -1246,135 +1233,135 @@ class Interpretation extends Fields if ($add) { $method = array(); - $method[] = PHP_EOL . PHP_EOL . "\t/**"; - $method[] = "\t* Greate user and update given table"; - $method[] = "\t*/"; - $method[] = "\tpublic static function createUser(\$new)"; - $method[] = "\t{"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " load the user component language files if there is an error."; - $method[] = "\t\t\$lang = JFactory::getLanguage();"; - $method[] = "\t\t\$extension = 'com_users';"; - $method[] = "\t\t\$base_dir = JPATH_SITE;"; - $method[] = "\t\t\$language_tag = '" . $this->langTag . "';"; - $method[] = "\t\t\$reload = true;"; - $method[] = "\t\t\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " load the user regestration model"; - $method[] = "\t\t\$model = self::getModel('registration', JPATH_ROOT. '/components/com_users', 'Users');"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " make sure no activation is needed"; - $method[] = "\t\t\$useractivation = self::setParams('com_users','useractivation',0);"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " make sure password is send"; - $method[] = "\t\t\$sendpassword = self::setParams('com_users','sendpassword',1);"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " Check if password was set"; - $method[] = "\t\tif (isset(\$new['password']) && isset(\$new['password2']) && self::checkString(\$new['password']) && self::checkString(\$new['password2']))"; - $method[] = "\t\t{"; - $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Use the users passwords"; - $method[] = "\t\t\t\$password = \$new['password'];"; - $method[] = "\t\t\t\$password2 = \$new['password2'];"; - $method[] = "\t\t}"; - $method[] = "\t\telse"; - $method[] = "\t\t{"; - $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set random password"; - $method[] = "\t\t\t\$password = self::randomkey(8);"; - $method[] = "\t\t\t\$password2 = \$password;"; - $method[] = "\t\t}"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " set username if not set"; - $method[] = "\t\tif (!isset(\$new['username']) || !self::checkString(\$new['username']))"; - $method[] = "\t\t{"; - $method[] = "\t\t\t\$new['username'] = self::safeString(\$new['name']);"; - $method[] = "\t\t}"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " linup new user data"; - $method[] = "\t\t\$data = array("; - $method[] = "\t\t\t'username' => \$new['username'],"; - $method[] = "\t\t\t'name' => \$new['name'],"; - $method[] = "\t\t\t'email1' => \$new['email'],"; - $method[] = "\t\t\t'password1' => \$password, // First password field"; - $method[] = "\t\t\t'password2' => \$password2, // Confirm password field"; - $method[] = "\t\t\t'block' => 0 );"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " register the new user"; - $method[] = "\t\t\$userId = \$model->register(\$data);"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " set activation back to default"; - $method[] = "\t\tself::setParams('com_users','useractivation',\$useractivation);"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " set send password back to default"; - $method[] = "\t\tself::setParams('com_users','sendpassword',\$sendpassword);"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " if user is created"; - $method[] = "\t\tif (\$userId > 0)"; - $method[] = "\t\t{"; - $method[] = "\t\t\treturn \$userId;"; - $method[] = "\t\t}"; - $method[] = "\t\treturn \$model->getError();"; - $method[] = "\t}"; + $method[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $method[] = $this->_t(1) . " * Greate user and update given table"; + $method[] = $this->_t(1) . " */"; + $method[] = $this->_t(1) . "public static function createUser(\$new)"; + $method[] = $this->_t(1) . "{"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the user component language files if there is an error."; + $method[] = $this->_t(2) . "\$lang = JFactory::getLanguage();"; + $method[] = $this->_t(2) . "\$extension = 'com_users';"; + $method[] = $this->_t(2) . "\$base_dir = JPATH_SITE;"; + $method[] = $this->_t(2) . "\$language_tag = '" . $this->langTag . "';"; + $method[] = $this->_t(2) . "\$reload = true;"; + $method[] = $this->_t(2) . "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the user regestration model"; + $method[] = $this->_t(2) . "\$model = self::getModel('registration', JPATH_ROOT. '/components/com_users', 'Users');"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " make sure no activation is needed"; + $method[] = $this->_t(2) . "\$useractivation = self::setParams('com_users','useractivation',0);"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " make sure password is send"; + $method[] = $this->_t(2) . "\$sendpassword = self::setParams('com_users','sendpassword',1);"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check if password was set"; + $method[] = $this->_t(2) . "if (isset(\$new['password']) && isset(\$new['password2']) && self::checkString(\$new['password']) && self::checkString(\$new['password2']))"; + $method[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Use the users passwords"; + $method[] = $this->_t(3) . "\$password = \$new['password'];"; + $method[] = $this->_t(3) . "\$password2 = \$new['password2'];"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "else"; + $method[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set random password"; + $method[] = $this->_t(3) . "\$password = self::randomkey(8);"; + $method[] = $this->_t(3) . "\$password2 = \$password;"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " set username if not set"; + $method[] = $this->_t(2) . "if (!isset(\$new['username']) || !self::checkString(\$new['username']))"; + $method[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "\$new['username'] = self::safeString(\$new['name']);"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " linup new user data"; + $method[] = $this->_t(2) . "\$data = array("; + $method[] = $this->_t(3) . "'username' => \$new['username'],"; + $method[] = $this->_t(3) . "'name' => \$new['name'],"; + $method[] = $this->_t(3) . "'email1' => \$new['email'],"; + $method[] = $this->_t(3) . "'password1' => \$password, // First password field"; + $method[] = $this->_t(3) . "'password2' => \$password2, // Confirm password field"; + $method[] = $this->_t(3) . "'block' => 0 );"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " register the new user"; + $method[] = $this->_t(2) . "\$userId = \$model->register(\$data);"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " set activation back to default"; + $method[] = $this->_t(2) . "self::setParams('com_users','useractivation',\$useractivation);"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " set send password back to default"; + $method[] = $this->_t(2) . "self::setParams('com_users','sendpassword',\$sendpassword);"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " if user is created"; + $method[] = $this->_t(2) . "if (\$userId > 0)"; + $method[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "return \$userId;"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "return \$model->getError();"; + $method[] = $this->_t(1) . "}"; - $method[] = PHP_EOL . "\tprotected static function setParams(\$component,\$target,\$value)"; - $method[] = "\t{"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " Get the params and set the new values"; - $method[] = "\t\t\$params = JComponentHelper::getParams(\$component);"; - $method[] = "\t\t\$was = \$params->get(\$target, null);"; - $method[] = "\t\tif (\$was != \$value)"; - $method[] = "\t\t{"; - $method[] = "\t\t\t\$params->set(\$target, \$value);"; - $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get a new database query instance"; - $method[] = "\t\t\t\$db = JFactory::getDBO();"; - $method[] = "\t\t\t\$query = \$db->getQuery(true);"; - $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Build the query"; - $method[] = "\t\t\t\$query->update('#__extensions AS a');"; - $method[] = "\t\t\t\$query->set('a.params = ' . \$db->quote((string)\$params));"; - $method[] = "\t\t\t\$query->where('a.element = ' . \$db->quote((string)\$component));"; - $method[] = "\t\t\t"; - $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Execute the query"; - $method[] = "\t\t\t\$db->setQuery(\$query);"; - $method[] = "\t\t\t\$db->query();"; - $method[] = "\t\t}"; - $method[] = "\t\treturn \$was;"; - $method[] = "\t}"; + $method[] = PHP_EOL . $this->_t(1) . "protected static function setParams(\$component,\$target,\$value)"; + $method[] = $this->_t(1) . "{"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the params and set the new values"; + $method[] = $this->_t(2) . "\$params = JComponentHelper::getParams(\$component);"; + $method[] = $this->_t(2) . "\$was = \$params->get(\$target, null);"; + $method[] = $this->_t(2) . "if (\$was != \$value)"; + $method[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "\$params->set(\$target, \$value);"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get a new database query instance"; + $method[] = $this->_t(3) . "\$db = JFactory::getDBO();"; + $method[] = $this->_t(3) . "\$query = \$db->getQuery(true);"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Build the query"; + $method[] = $this->_t(3) . "\$query->update('#__extensions AS a');"; + $method[] = $this->_t(3) . "\$query->set('a.params = ' . \$db->quote((string)\$params));"; + $method[] = $this->_t(3) . "\$query->where('a.element = ' . \$db->quote((string)\$component));"; + $method[] = $this->_t(3); + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Execute the query"; + $method[] = $this->_t(3) . "\$db->setQuery(\$query);"; + $method[] = $this->_t(3) . "\$db->query();"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "return \$was;"; + $method[] = $this->_t(1) . "}"; - $method[] = PHP_EOL . "\t/**"; - $method[] = "\t* Update user values"; - $method[] = "\t*/"; - $method[] = "\tpublic static function updateUser(\$new)"; - $method[] = "\t{"; - $method[] = "\t\t// load the user component language files if there is an error."; - $method[] = "\t\t\$lang = JFactory::getLanguage();"; - $method[] = "\t\t\$extension = 'com_users';"; - $method[] = "\t\t\$base_dir = JPATH_ADMINISTRATOR;"; - $method[] = "\t\t\$language_tag = '" . $this->langTag . "';"; - $method[] = "\t\t\$reload = true;"; - $method[] = "\t\t\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);"; - $method[] = "\t\t// load the user model"; - $method[] = "\t\t\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/com_users', 'Users');"; - $method[] = "\t\t// Check if password was set"; - $method[] = "\t\tif (isset(\$new['password']) && isset(\$new['password2']) && self::checkString(\$new['password']) && self::checkString(\$new['password2']))"; - $method[] = "\t\t{"; - $method[] = "\t\t\t// Use the users passwords"; - $method[] = "\t\t\t\$password = \$new['password'];"; - $method[] = "\t\t\t\$password2 = \$new['password2'];"; - $method[] = "\t\t}"; - $method[] = "\t\t// set username"; - $method[] = "\t\tif (isset(\$new['username']) && self::checkString(\$new['username']))"; - $method[] = "\t\t{"; - $method[] = "\t\t\t\$new['username'] = self::safeString(\$new['username']);"; - $method[] = "\t\t}"; - $method[] = "\t\telse"; - $method[] = "\t\t{"; - $method[] = "\t\t\t\$new['username'] = self::safeString(\$new['name']);\t\t\t"; - $method[] = "\t\t}"; - $method[] = "\t\t// linup update user data"; - $method[] = "\t\t\$data = array("; - $method[] = "\t\t\t'id' => \$new['id'],"; - $method[] = "\t\t\t'username' => \$new['username'],"; - $method[] = "\t\t\t'name' => \$new['name'],"; - $method[] = "\t\t\t'email' => \$new['email'],"; - $method[] = "\t\t\t'password1' => \$password, // First password field"; - $method[] = "\t\t\t'password2' => \$password2, // Confirm password field"; - $method[] = "\t\t\t'block' => 0 );"; - $method[] = "\t\t// register the new user"; - $method[] = "\t\t\$done = \$model->save(\$data);"; - $method[] = "\t\t// if user is updated"; - $method[] = "\t\tif (\$done)"; - $method[] = "\t\t{"; - $method[] = "\t\t\treturn \$new['id'];"; - $method[] = "\t\t}"; - $method[] = "\t\treturn \$model->getError();"; - $method[] = "\t}"; + $method[] = PHP_EOL . $this->_t(1) . "/**"; + $method[] = $this->_t(1) . " * Update user values"; + $method[] = $this->_t(1) . " */"; + $method[] = $this->_t(1) . "public static function updateUser(\$new)"; + $method[] = $this->_t(1) . "{"; + $method[] = $this->_t(2) . "// load the user component language files if there is an error."; + $method[] = $this->_t(2) . "\$lang = JFactory::getLanguage();"; + $method[] = $this->_t(2) . "\$extension = 'com_users';"; + $method[] = $this->_t(2) . "\$base_dir = JPATH_ADMINISTRATOR;"; + $method[] = $this->_t(2) . "\$language_tag = '" . $this->langTag . "';"; + $method[] = $this->_t(2) . "\$reload = true;"; + $method[] = $this->_t(2) . "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);"; + $method[] = $this->_t(2) . "// load the user model"; + $method[] = $this->_t(2) . "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/com_users', 'Users');"; + $method[] = $this->_t(2) . "// Check if password was set"; + $method[] = $this->_t(2) . "if (isset(\$new['password']) && isset(\$new['password2']) && self::checkString(\$new['password']) && self::checkString(\$new['password2']))"; + $method[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "// Use the users passwords"; + $method[] = $this->_t(3) . "\$password = \$new['password'];"; + $method[] = $this->_t(3) . "\$password2 = \$new['password2'];"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "// set username"; + $method[] = $this->_t(2) . "if (isset(\$new['username']) && self::checkString(\$new['username']))"; + $method[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "\$new['username'] = self::safeString(\$new['username']);"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "else"; + $method[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "\$new['username'] = self::safeString(\$new['name']);"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "// linup update user data"; + $method[] = $this->_t(2) . "\$data = array("; + $method[] = $this->_t(3) . "'id' => \$new['id'],"; + $method[] = $this->_t(3) . "'username' => \$new['username'],"; + $method[] = $this->_t(3) . "'name' => \$new['name'],"; + $method[] = $this->_t(3) . "'email' => \$new['email'],"; + $method[] = $this->_t(3) . "'password1' => \$password, // First password field"; + $method[] = $this->_t(3) . "'password2' => \$password2, // Confirm password field"; + $method[] = $this->_t(3) . "'block' => 0 );"; + $method[] = $this->_t(2) . "// register the new user"; + $method[] = $this->_t(2) . "\$done = \$model->save(\$data);"; + $method[] = $this->_t(2) . "// if user is updated"; + $method[] = $this->_t(2) . "if (\$done)"; + $method[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "return \$new['id'];"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "return \$model->getError();"; + $method[] = $this->_t(1) . "}"; // return the help method return implode(PHP_EOL, $method); @@ -1391,41 +1378,41 @@ 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; //start loading xml $xml = ''; $xml .= PHP_EOL . ''; - $xml .= PHP_EOL . "\t" . ''; - $xml .= PHP_EOL . "\t\t" . ''; - $xml .= PHP_EOL . "\t\t\t" . ''; - $xml .= PHP_EOL . "\t\t" . ''; - $xml .= PHP_EOL . "\t" . ''; + $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(2) . ''; + $xml .= PHP_EOL . $this->_t(3) . ''; + $xml .= PHP_EOL . $this->_t(2) . ''; + $xml .= PHP_EOL . $this->_t(1) . ''; if (isset($this->hasIdRequest[$view['settings']->code]) || isset($this->hasCatIdRequest[$view['settings']->code])) { - $xml .= PHP_EOL . "\t" . ''; - $xml .= PHP_EOL . "\t" . ''; - $xml .= PHP_EOL . "\t\t" . '
'; + $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(2) . '
_t(3) . 'addrulepath="/administrator/components/com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '/models/rules"'; + $xml .= PHP_EOL . $this->_t(3) . '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) { - $xml .= PHP_EOL . "\t\t\t" . $requestFieldXML; + $xml .= PHP_EOL . $this->_t(3) . $requestFieldXML; } } if (isset($this->hasCatIdRequest[$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->hasCatIdRequest[$view['settings']->code])) { foreach ($this->hasCatIdRequest[$view['settings']->code] as $requestFieldXML) { - $xml .= PHP_EOL . "\t\t\t" . $requestFieldXML; + $xml .= PHP_EOL . $this->_t(3) . $requestFieldXML; } } - $xml .= PHP_EOL . "\t\t" . '
'; - $xml .= PHP_EOL . "\t" . '
'; + $xml .= PHP_EOL . $this->_t(2) . '
'; + $xml .= PHP_EOL . $this->_t(1) . '
'; } if (isset($this->frontEndParams) && isset($this->frontEndParams[$view['settings']->name])) { @@ -1434,14 +1421,14 @@ class Interpretation extends Fields // now load the fields if (ComponentbuilderHelper::checkArray($params)) { - $xml .= PHP_EOL . "\t" . ''; - $xml .= PHP_EOL . "\t" . ''; - $xml .= PHP_EOL . "\t\t" . '
'; - $xml .= implode("\t\t\t", $params); - $xml .= PHP_EOL . "\t\t" . '
'; - $xml .= PHP_EOL . "\t" . '
'; + $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(2) . '
_t(3) . 'addrulepath="/administrator/components/com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '/models/rules"'; + $xml .= PHP_EOL . $this->_t(3) . 'addfieldpath="/administrator/components/com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '/models/fields">'; + $xml .= implode($this->_t(3), $params); + $xml .= PHP_EOL . $this->_t(2) . '
'; + $xml .= PHP_EOL . $this->_t(1) . '
'; } } $xml .= PHP_EOL . '
'; @@ -1465,7 +1452,7 @@ class Interpretation extends Fields if (strpos($field, 'Option Set. -->') !== false && strpos($field, $menuSetter) === false && !ComponentbuilderHelper::checkString($target)) { // we add the global option - $field = str_replace('Option Set. -->', $this->setLine(__LINE__) . ' Global & Option Set. -->' . PHP_EOL . "\t\t\t" . '', $field); + $field = str_replace('Option Set. -->', $this->setLine(__LINE__) . ' Global & Option Set. -->' . PHP_EOL . $this->_t(3) . '', $field); // update the default to be global $field = preg_replace('/default=".+"/', 'default=""', $field); // update the default to be filter @@ -1497,26 +1484,26 @@ class Interpretation extends Fields $checker = md5(serialize($the_get) . $code); if (!isset($this->customViewQueryChecker[$this->target]) || !in_array($checker, $this->customViewQueryChecker[$this->target])) { - // load this unuiqe key + // load this unuiqe key $this->customViewQueryChecker[$this->target][] = $checker; if (ComponentbuilderHelper::checkString($the_get['selection']['type'])) { - $getItem = PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get from " . $the_get['selection']['table'] . " as " . $the_get['as']; + $getItem = PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get from " . $the_get['selection']['table'] . " as " . $the_get['as']; } else { - $getItem = PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get data"; + $getItem = PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get data"; } // set the selection - $getItem .= PHP_EOL . "\t" . $tab . "\t" . $the_get['selection']['select']; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . $the_get['selection']['select']; if (($nr == 0 && (!isset($the_get['join_field']) || !ComponentbuilderHelper::checkString($the_get['join_field'])) && (isset($the_get['selection']['type']) && ComponentbuilderHelper::checkString($the_get['selection']['type']))) || ($type === 'custom' && (isset($the_get['selection']['type']) && ComponentbuilderHelper::checkString($the_get['selection']['type'])))) { - $getItem .= PHP_EOL . "\t" . $tab . "\t" . '$query->from(' . $the_get['selection']['from'] . ');'; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . '$query->from(' . $the_get['selection']['from'] . ');'; } elseif (isset($the_get['join_field']) && ComponentbuilderHelper::checkString($the_get['join_field']) && isset($the_get['selection']['type']) && ComponentbuilderHelper::checkString($the_get['selection']['type'])) { - $getItem .= PHP_EOL . "\t" . $tab . "\t\$query->join('" . $the_get['type']; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$query->join('" . $the_get['type']; $getItem .= "', (" . $the_get['selection']['from']; $getItem .= ") . ' ON (' . \$db->quoteName('" . $the_get['on_field']; $getItem .= "') . ' " . $the_get['operator']; @@ -1566,97 +1553,97 @@ class Interpretation extends Fields { case 4: // COM_COMPONENTBUILDER_DYNAMIC_GET_USER_GROUPS - $filter .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " filter " . $as . " based on user groups"; - $filter .= PHP_EOL . "\t" . $tab . "\t\$remove = (count(array_intersect((array) \$this->groups, (array) " . $string . "->" . $field . "))) ? false : true;"; - $filter .= PHP_EOL . "\t" . $tab . "\tif (\$remove)"; - $filter .= PHP_EOL . "\t" . $tab . "\t{"; + $filter .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " filter " . $as . " based on user groups"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$remove = (count(array_intersect((array) \$this->groups, (array) " . $string . "->" . $field . "))) ? false : true;"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (\$remove)"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; if ($removeString == $string) { - $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Remove " . $string . " if user not in groups"; - $filter .= PHP_EOL . "\t" . $tab . "\t\t" . $string . " = null;"; - $filter .= PHP_EOL . "\t" . $tab . "\t\treturn false;"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Remove " . $string . " if user not in groups"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . $string . " = null;"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "return false;"; } else { - $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Unset " . $string . " if user not in groups"; - $filter .= PHP_EOL . "\t" . $tab . "\t\tunset(" . $removeString . ");"; - $filter .= PHP_EOL . "\t" . $tab . "\t\tcontinue;"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Unset " . $string . " if user not in groups"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "unset(" . $removeString . ");"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "continue;"; } - $filter .= PHP_EOL . "\t" . $tab . "\t}"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; break; 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 . "\t" . $tab . "\t{"; + $filter .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(" . $string . "->" . $field . "))"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; - $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " do your thing here"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " do your thing here"; - $filter .= PHP_EOL . "\t" . $tab . "\t}"; - $filter .= PHP_EOL . "\t" . $tab . "\telse"; - $filter .= PHP_EOL . "\t" . $tab . "\t{"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "else"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; if ($removeString == $string) { - $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Remove " . $string . " if not array."; - $filter .= PHP_EOL . "\t" . $tab . "\t\t" . $string . " = null;"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Remove " . $string . " if not array."; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . $string . " = null;"; } else { - $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Unset " . $string . " if not array."; - $filter .= PHP_EOL . "\t" . $tab . "\t\tunset(" . $removeString . ");"; - $filter .= PHP_EOL . "\t" . $tab . "\t\tcontinue;"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Unset " . $string . " if not array."; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "unset(" . $removeString . ");"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "continue;"; } - $filter .= PHP_EOL . "\t" . $tab . "\t}"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; break; 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 . "\t{"; + $filter .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " filter " . $as . " based on repeatable value"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkString(" . $string . "->" . $field . "))"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; - $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 . "\t{"; + $filter .= PHP_EOL . $this->_t(2) . $tab . $this->_t(1) . "\$array = json_decode(" . $string . "->" . $field . ",true);"; + $filter .= PHP_EOL . $this->_t(2) . $tab . $this->_t(1) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$array))"; + $filter .= PHP_EOL . $this->_t(2) . $tab . $this->_t(1) . "{"; - $filter .= PHP_EOL . "\t\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " do your thing here"; + $filter .= PHP_EOL . $this->_t(2) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " do your thing here"; - $filter .= PHP_EOL . "\t\t" . $tab . "\t}"; - $filter .= PHP_EOL . "\t" . $tab . "\t\telse"; - $filter .= PHP_EOL . "\t" . $tab . "\t\t{"; + $filter .= PHP_EOL . $this->_t(2) . $tab . $this->_t(1) . "}"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "else"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "{"; if ($removeString == $string) { - $filter .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $string . " if not array."; - $filter .= PHP_EOL . "\t" . $tab . "\t\t\t" . $string . " = null;"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Remove " . $string . " if not array."; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . $string . " = null;"; } else { - $filter .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " Unset " . $string . " if not array."; - $filter .= PHP_EOL . "\t" . $tab . "\t\t\tunset(" . $removeString . ");"; - $filter .= PHP_EOL . "\t" . $tab . "\t\t\tcontinue;"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Unset " . $string . " if not array."; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "unset(" . $removeString . ");"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "continue;"; } - $filter .= PHP_EOL . "\t" . $tab . "\t\t}"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "}"; - $filter .= PHP_EOL . "\t" . $tab . "\t}"; - $filter .= PHP_EOL . "\t" . $tab . "\telse"; - $filter .= PHP_EOL . "\t" . $tab . "\t{"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "else"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; if ($removeString == $string) { - $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Remove " . $string . " if not string."; - $filter .= PHP_EOL . "\t" . $tab . "\t\t" . $string . " = null;"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Remove " . $string . " if not string."; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . $string . " = null;"; } else { - $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Unset " . $string . " if not string."; - $filter .= PHP_EOL . "\t" . $tab . "\t\tunset(" . $removeString . ");"; - $filter .= PHP_EOL . "\t" . $tab . "\t\tcontinue;"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Unset " . $string . " if not string."; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "unset(" . $removeString . ");"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "continue;"; } - $filter .= PHP_EOL . "\t" . $tab . "\t}"; + $filter .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; break; } } @@ -1680,13 +1667,13 @@ 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 . $this->_t(1) . $tab . $this->_t(1) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(" . $string . "->" . $field . "))" . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; // json_decode $decoder = $string . "->" . $field . " = json_decode(" . $string . "->" . $field . ", true);"; } elseif ('base64' === $decode) { - $if = PHP_EOL . "\t" . $tab . "\tif (!empty(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ")))" . PHP_EOL . "\t" . $tab . "\t{"; + $if = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (!empty(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ")))" . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; // base64_decode $decoder = $string . "->" . $field . " = base64_decode(" . $string . "->" . $field . ");"; } @@ -1696,7 +1683,7 @@ class Interpretation extends Fields { if ($cryptionType . '_encryption' === $decode) { - $if = PHP_EOL . "\t" . $tab . "\tif (!empty(" . $string . "->" . $field . ") && \$" . $cryptionType . "key && !is_numeric(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ", true)))" . PHP_EOL . "\t" . $tab . "\t{"; + $if = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (!empty(" . $string . "->" . $field . ") && \$" . $cryptionType . "key && !is_numeric(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ", true)))" . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; // set decryption $decoder = $string . "->" . $field . " = rtrim(\$" . $cryptionType . "->decryptString(" . $string . "->" . $field . "), " . '"\0"' . ");"; $this->siteDecrypt[$cryptionType][$code] = true; @@ -1705,8 +1692,8 @@ class Interpretation extends Fields } // build decoder string - $fieldDecode .= $if . PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Decode " . $field; - $fieldDecode .= PHP_EOL . "\t" . $tab . "\t\t" . $decoder . PHP_EOL . "\t" . $tab . "\t}"; + $fieldDecode .= $if . PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Decode " . $field; + $fieldDecode .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . $decoder . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; } } } @@ -1717,7 +1704,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) @@ -1725,19 +1712,19 @@ class Interpretation extends Fields // build decoder string if (!$runplugins) { - $runplugins = PHP_EOL . $tab . "\t//" . $this->setLine(__LINE__) . " Load the JEvent Dispatcher"; - $runplugins .= PHP_EOL . $tab . "\tJPluginHelper::importPlugin('content');"; - $runplugins .= PHP_EOL . $tab . "\t" . '$this->_dispatcher = JEventDispatcher::getInstance();'; + $runplugins = PHP_EOL . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Load the JEvent Dispatcher"; + $runplugins .= PHP_EOL . $tab . $this->_t(1) . "JPluginHelper::importPlugin('content');"; + $runplugins .= PHP_EOL . $tab . $this->_t(1) . '$this->_dispatcher = JEventDispatcher::getInstance();'; } - $fieldPrepare .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Make sure the content prepare plugins fire on " . $field; - $fieldPrepare .= PHP_EOL . "\t" . $tab . "\t\$_" . $field . " = new stdClass();"; - $fieldPrepare .= PHP_EOL . "\t" . $tab . "\t\$_" . $field . '->text =& ' . $string . '->' . $field . '; //' . $this->setLine(__LINE__) . ' value must be in text'; - $fieldPrepare .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Since all values are now in text (Joomla Limitation), we also add the field name (" . $field . ") to context"; - $fieldPrepare .= PHP_EOL . "\t" . $tab . "\t" . '$this->_dispatcher->trigger("onContentPrepare", array(\'' . $context . '.' . $field . '\', &$_' . $field . ', &$this->params, 0));'; // we can improve the params later (TODO) + $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Make sure the content prepare plugins fire on " . $field; + $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$_" . $field . " = new stdClass();"; + $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$_" . $field . '->text =& ' . $string . '->' . $field . '; //' . $this->setLine(__LINE__) . ' value must be in text'; + $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Since all values are now in text (Joomla Limitation), we also add the field name (" . $field . ") to context"; + $fieldPrepare .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . '$this->_dispatcher->trigger("onContentPrepare", array(\'' . $context . '.' . $field . '\', &$_' . $field . ', &$this->params, 0));'; // we can improve the params later (TODO) } } // load dispatcher - $this->JEventDispatcher = array('###DISPATCHER###' => ($runplugins ?: '')); + $this->JEventDispatcher = array($this->hhh . 'DISPATCHER' . $this->hhh => ($runplugins ?: '')); // return content prepare fix return $fieldPrepare; } @@ -1752,8 +1739,8 @@ class Interpretation extends Fields // only load for uikit version 2 (TODO) we may need to add another check here 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 . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Checking if " . $field . " has uikit components that must be loaded."; + $fieldUikit .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$this->uikitComp = " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::getUikitComp(" . $string . "->" . $field . ",\$this->uikitComp);"; } } } @@ -1773,8 +1760,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 . $this->_t(1) . $this->hhh . "TAB" . $this->hhh . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set " . $default['valueName'] . " to the " . $this->hhh . "STRING" . $this->hhh . " object."; + $otherJoin .= PHP_EOL . $this->_t(1) . $this->hhh . "TAB" . $this->hhh . $this->_t(1) . $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']])) { @@ -1785,8 +1772,8 @@ class Interpretation extends Fields else { // build custom join string - $customJoin .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set " . $default['valueName'] . " to the " . $string . " object."; - $customJoin .= PHP_EOL . "\t" . $tab . "\t" . $string . "->" . $default['valueName'] . " = \$this->get" . $default['methodName'] . "(" . $string . "->" . $this->getAsLookup[$get['key']][$get['on_field']] . ");"; + $customJoin .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set " . $default['valueName'] . " to the " . $string . " object."; + $customJoin .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . $string . "->" . $default['valueName'] . " = \$this->get" . $default['methodName'] . "(" . $string . "->" . $this->getAsLookup[$get['key']][$get['on_field']] . ");"; } } return $customJoin; @@ -1796,7 +1783,7 @@ class Interpretation extends Fields public function checkJoint(&$default, &$get, &$asBucket) { - // check if this function is not linked to the main call + // check if this function is not linked to the main call list($aJoin) = explode('.', $get['on_field']); if (ComponentbuilderHelper::checkArray($asBucket) && in_array($aJoin, $asBucket)) { @@ -1828,15 +1815,15 @@ class Interpretation extends Fields { case 1: // COM_COMPONENTBUILDER_DYNAMIC_GET_ID - $string = PHP_EOL . "\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . (int) \$pk);"; + $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . (int) \$pk);"; break; case 2: // COM_COMPONENTBUILDER_DYNAMIC_GET_USER - $string = PHP_EOL . "\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . (int) \$this->userId);"; + $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . (int) \$this->userId);"; break; case 3: // COM_COMPONENTBUILDER_DYNAMIC_GET_ACCESS_LEVEL - $string = PHP_EOL . "\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$this->levels) . ')');"; + $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$this->levels) . ')');"; break; case 4: // COM_COMPONENTBUILDER_DYNAMIC_GET_USER_GROUPS @@ -1848,52 +1835,52 @@ class Interpretation extends Fields } else { - $string = PHP_EOL . "\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$this->groups) . ')');"; + $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$this->groups) . ')');"; } break; case 5: // COM_COMPONENTBUILDER_DYNAMIC_GET_CATEGORIES - $string = PHP_EOL . "\t\t" . $tab . "//" . $this->setLine(__LINE__) . " (TODO) The dynamic category filter is not ready."; + $string = PHP_EOL . $this->_t(2) . $tab . "//" . $this->setLine(__LINE__) . " (TODO) The dynamic category filter is not ready."; break; case 6: // COM_COMPONENTBUILDER_DYNAMIC_GET_TAGS - $string = PHP_EOL . "\t\t" . $tab . "//" . $this->setLine(__LINE__) . " (TODO) The dynamic tags filter is not ready."; + $string = PHP_EOL . $this->_t(2) . $tab . "//" . $this->setLine(__LINE__) . " (TODO) The dynamic tags filter is not ready."; break; case 7: // COM_COMPONENTBUILDER_DYNAMIC_GET_DATE - $string = PHP_EOL . "\t\t" . $tab . "//" . $this->setLine(__LINE__) . " (TODO) The dynamic date filter is not ready."; + $string = PHP_EOL . $this->_t(2) . $tab . "//" . $this->setLine(__LINE__) . " (TODO) The dynamic date filter is not ready."; break; case 8: // COM_COMPONENTBUILDER_DYNAMIC_GET_FUNCTIONVAR if ($ter['operator'] === 'IN' || $ter['operator'] === 'NOT IN') { - $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 . "{"; - $string .= PHP_EOL . "\t\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$array) . ')');"; - $string .= PHP_EOL . "\t\t" . $tab . "}"; - $string .= PHP_EOL . "\t\t" . $tab . "else"; - $string .= PHP_EOL . "\t\t" . $tab . "{"; - $string .= PHP_EOL . "\t\t" . $tab . "\treturn false;"; - $string .= PHP_EOL . "\t\t" . $tab . "}"; + $string = PHP_EOL . $this->_t(2) . $tab . "//" . $this->setLine(__LINE__) . " Check if " . $ter['state_key'] . " is an array with values."; + $string .= PHP_EOL . $this->_t(2) . $tab . "\$array = " . $ter['state_key'] . ";"; + $string .= PHP_EOL . $this->_t(2) . $tab . "if (isset(\$array) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$array))"; + $string .= PHP_EOL . $this->_t(2) . $tab . "{"; + $string .= PHP_EOL . $this->_t(2) . $tab . $this->_t(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$array) . ')');"; + $string .= PHP_EOL . $this->_t(2) . $tab . "}"; + $string .= PHP_EOL . $this->_t(2) . $tab . "else"; + $string .= PHP_EOL . $this->_t(2) . $tab . "{"; + $string .= PHP_EOL . $this->_t(2) . $tab . $this->_t(1) . "return false;"; + $string .= PHP_EOL . $this->_t(2) . $tab . "}"; } else { - $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 . "{"; - $string .= PHP_EOL . "\t\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . \$db->quote(\$checkValue));"; - $string .= PHP_EOL . "\t\t" . $tab . "}"; - $string .= PHP_EOL . "\t\t" . $tab . "elseif (is_numeric(\$checkValue))"; - $string .= PHP_EOL . "\t\t" . $tab . "{"; - $string .= PHP_EOL . "\t\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . \$checkValue);"; - $string .= PHP_EOL . "\t\t" . $tab . "}"; - $string .= PHP_EOL . "\t\t" . $tab . "else"; - $string .= PHP_EOL . "\t\t" . $tab . "{"; - $string .= PHP_EOL . "\t\t" . $tab . "\treturn false;"; - $string .= PHP_EOL . "\t\t" . $tab . "}"; + $string = PHP_EOL . $this->_t(2) . $tab . "//" . $this->setLine(__LINE__) . " Check if " . $ter['state_key'] . " is a string or numeric value."; + $string .= PHP_EOL . $this->_t(2) . $tab . "\$checkValue = " . $ter['state_key'] . ";"; + $string .= PHP_EOL . $this->_t(2) . $tab . "if (isset(\$checkValue) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkString(\$checkValue))"; + $string .= PHP_EOL . $this->_t(2) . $tab . "{"; + $string .= PHP_EOL . $this->_t(2) . $tab . $this->_t(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . \$db->quote(\$checkValue));"; + $string .= PHP_EOL . $this->_t(2) . $tab . "}"; + $string .= PHP_EOL . $this->_t(2) . $tab . "elseif (is_numeric(\$checkValue))"; + $string .= PHP_EOL . $this->_t(2) . $tab . "{"; + $string .= PHP_EOL . $this->_t(2) . $tab . $this->_t(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . \$checkValue);"; + $string .= PHP_EOL . $this->_t(2) . $tab . "}"; + $string .= PHP_EOL . $this->_t(2) . $tab . "else"; + $string .= PHP_EOL . $this->_t(2) . $tab . "{"; + $string .= PHP_EOL . $this->_t(2) . $tab . $this->_t(1) . "return false;"; + $string .= PHP_EOL . $this->_t(2) . $tab . "}"; } break; case 9: @@ -1916,7 +1903,7 @@ class Interpretation extends Fields list($dump, $as) = array_map('trim', explode('(', $as)); $field = trim(str_replace(')', '', $field)); } - $string = PHP_EOL . "\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " " . $ter['state_key'] . "');"; + $string = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " " . $ter['state_key'] . "');"; break; } // only add if the filter is set @@ -1951,11 +1938,11 @@ class Interpretation extends Fields // sort where if ($as === 'a' || (isset($this->siteMainGet[$this->target][$code][$as]) && ComponentbuilderHelper::checkString($this->siteMainGet[$this->target][$code][$as]))) { - $ordering .= PHP_EOL . "\t" . $tab . "\t" . $string; + $ordering .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . $string; } else { - $this->otherOrder[$this->target][$code][$as][$field] = PHP_EOL . "\t\t" . $string; + $this->otherOrder[$this->target][$code][$as][$field] = PHP_EOL . $this->_t(2) . $string; } } } @@ -2014,29 +2001,29 @@ 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 .= 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; - $string .= PHP_EOL . "\t" . $tabe . "\t}"; - $string .= PHP_EOL . "\t" . $tabe . "\telse"; - $string .= PHP_EOL . "\t" . $tabe . "\t{"; - $string .= PHP_EOL . "\t" . $tabe . "\t\treturn false;"; - $string .= PHP_EOL . "\t" . $tabe . "\t}"; + $string = "if (isset(" . $whe['value_key'] . ") && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(" . $whe['value_key'] . "))"; + $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) . "{"; + $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get where " . $whe['table_key'] . " is " . $whe['value_key']; + $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(2) . "\$query->where('" . $whe['table_key'] . " " . $whe['operator'] . $value; + $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) . "}"; + $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) . "else"; + $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) . "{"; + $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(2) . "return false;"; + $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) . "}"; } else { $string = "//" . $this->setLine(__LINE__) . " Get where " . $whe['table_key'] . " is " . $whe['value_key']; - $string .= PHP_EOL . "\t" . $tabe . "\t\$query->where('" . $whe['table_key'] . " " . $whe['operator'] . $value; + $string .= PHP_EOL . $this->_t(1) . $tabe . $this->_t(1) . "\$query->where('" . $whe['table_key'] . " " . $whe['operator'] . $value; } // sort where if ($as === 'a' || (isset($this->siteMainGet[$this->target][$code][$as]) && ComponentbuilderHelper::checkString($this->siteMainGet[$this->target][$code][$as]))) { - $wheres .= PHP_EOL . "\t" . $tab . "\t" . $string; + $wheres .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . $string; } elseif ($as !== 'a') { - $this->otherWhere[$this->target][$code][$as][$field] = PHP_EOL . "\t\t" . $string; + $this->otherWhere[$this->target][$code][$as][$field] = PHP_EOL . $this->_t(2) . $string; } } } @@ -2068,7 +2055,7 @@ class Interpretation extends Fields // only add if the filter is set if (ComponentbuilderHelper::checkString($value)) { - $globals .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set the global " . $glo['name'] . " value." . PHP_EOL . "\t" . $tab . "\t" . $value; + $globals .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set the global " . $glo['name'] . " value." . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . $value; } } } @@ -2112,31 +2099,31 @@ 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###'] . "')"; + $redirectMessage = $this->_t(3) . "//" . $this->setLine(__LINE__) . " redirect away to the default view if no access allowed."; + $redirectString = "JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] . "')"; } else { - $redirectMessage = "\t\t\t//" . $this->setLine(__LINE__) . " redirect away to the home page if no access allowed."; + $redirectMessage = $this->_t(3) . "//" . $this->setLine(__LINE__) . " redirect away to the home page if no access allowed."; $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\t{"; - $accessCheck[] = "\t\t\t\$app = JFactory::getApplication();"; + $accessCheck[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if this user has permission to access item"; + $accessCheck[] = $this->_t(2) . "if (!" . $userString . "->authorise('site." . $view['settings']->code . ".access', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; + $accessCheck[] = $this->_t(2) . "{"; + $accessCheck[] = $this->_t(3) . "\$app = JFactory::getApplication();"; // set lang $langKeyWord = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Not authorised to view ' . $view['settings']->code . '!', 'U'); if (!isset($this->langContent['site'][$langKeyWord])) { $this->langContent['site'][$langKeyWord] = 'Not authorised to view ' . $view['settings']->code . '!'; } - $accessCheck[] = "\t\t\t\$app->enqueueMessage(JText:" . ":_('" . $langKeyWord . "'), 'error');"; + $accessCheck[] = $this->_t(3) . "\$app->enqueueMessage(JText:" . ":_('" . $langKeyWord . "'), 'error');"; $accessCheck[] = $redirectMessage; - $accessCheck[] = "\t\t\t\$app->redirect(" . $redirectString . ");"; - $accessCheck[] = "\t\t\treturn false;"; - $accessCheck[] = "\t\t}"; + $accessCheck[] = $this->_t(3) . "\$app->redirect(" . $redirectString . ");"; + $accessCheck[] = $this->_t(3) . "return false;"; + $accessCheck[] = $this->_t(2) . "}"; // return the access check return implode(PHP_EOL, $accessCheck); @@ -2168,10 +2155,10 @@ class Interpretation extends Fields $getItem .= $this->setPlaceholders($get->php_before_getitem, $this->placeholders); } // start loadin the get Item - $getItem .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get a db connection."; - $getItem .= PHP_EOL . "\t" . $tab . "\t\$db = JFactory::getDbo();"; - $getItem .= PHP_EOL . PHP_EOL . $tab . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $getItem .= PHP_EOL . "\t" . $tab . "\t\$query = \$db->getQuery(true);"; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get a db connection."; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$db = JFactory::getDbo();"; + $getItem .= PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$query = \$db->getQuery(true);"; // set main get query $getItem .= $this->setCustomViewQuery($get->main_get, $code, $tab); // setup filters @@ -2181,53 +2168,53 @@ class Interpretation extends Fields // setup ordering $getItem .= $this->setCustomViewOrder($get->order, $code, $tab); // get ready to get query - $getItem .= PHP_EOL . PHP_EOL . $tab . "\t\t//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; - $getItem .= PHP_EOL . "\t" . $tab . "\t\$db->setQuery(\$query);"; - $getItem .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Load the results as a stdClass object."; - $getItem .= PHP_EOL . "\t" . $tab . "\t\$data = \$db->loadObject();"; + $getItem .= PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$db->setQuery(\$query);"; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Load the results as a stdClass object."; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$data = \$db->loadObject();"; // set after item php if (isset($get->add_php_after_getitem) && $get->add_php_after_getitem == 1 && isset($get->php_after_getitem) && ComponentbuilderHelper::checkString($get->php_after_getitem)) { $getItem .= $this->setPlaceholders($get->php_after_getitem, $this->placeholders); } - $getItem .= PHP_EOL . PHP_EOL . $tab . "\t\tif (empty(\$data))"; - $getItem .= PHP_EOL . "\t" . $tab . "\t{"; + $getItem .= PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "if (empty(\$data))"; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; if ($type === 'main') { - $getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app = JFactory::getApplication();"; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "\$app = JFactory::getApplication();"; $langKeyWoord = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Not found or access denied', 'U'); if (!isset($this->langContent[$this->lang][$langKeyWoord])) { $this->langContent[$this->lang][$langKeyWoord] = 'Not found, or access denied.'; } - $getItem .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " If no data is found redirect to default page and show warning."; - $getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app->enqueueMessage(JText:" . ":_('" . $langKeyWoord . "'), 'warning');"; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " If no data is found redirect to default page and show warning."; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "\$app->enqueueMessage(JText:" . ":_('" . $langKeyWoord . "'), 'warning');"; 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 { $redirectString = 'JURI::root()'; } - $getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app->redirect(" . $redirectString . ");"; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "\$app->redirect(" . $redirectString . ");"; } else { - $getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app->redirect('index.php?option=com_" . $this->fileContentStatic['###component###'] . "');"; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "\$app->redirect('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "');"; } - $getItem .= PHP_EOL . "\t" . $tab . "\t\treturn false;"; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "return false;"; } else { - $getItem .= PHP_EOL . "\t" . $tab . "\t\treturn false;"; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "return false;"; } - $getItem .= PHP_EOL . "\t" . $tab . "\t}"; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; // dispatcher placholder - $getItem .= "###DISPATCHER###"; + $getItem .= $this->hhh . "DISPATCHER" . $this->hhh; if (ComponentbuilderHelper::checkArray($get->main_get)) { $asBucket = array(); @@ -2276,16 +2263,16 @@ 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) { if (isset($this->siteDecrypt[$cryptionType][$code]) && $this->siteDecrypt[$cryptionType][$code]) { - $script .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . "\t" . $tab . "\t\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the encryption object."; - $script .= PHP_EOL . "\t" . $tab . "\t\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + $script .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; } } $getItem = $script . $getItem; @@ -2297,33 +2284,33 @@ class Interpretation extends Fields if ($get->addcalculation == 1) { $get->php_calculation = (array) explode(PHP_EOL, $this->setPlaceholders($get->php_calculation, $this->placeholders)); - $getItem .= PHP_EOL . "\t" . $tab . "\t" . implode(PHP_EOL . "\t" . $tab . "\t", $get->php_calculation); + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . implode(PHP_EOL . $this->_t(1) . $tab . $this->_t(1), $get->php_calculation); } if ($type === 'custom') { // return the object - $getItem .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " return data object."; - $getItem .= PHP_EOL . "\t" . $tab . "\treturn \$data;"; + $getItem .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " return data object."; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "return \$data;"; } else { // set the object - $getItem .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set data object to item."; - $getItem .= PHP_EOL . "\t" . $tab . "\t\$this->_item[\$pk] = \$data;"; + $getItem .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set data object to item."; + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$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); } return $getItem; } - return PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . "add your custom code here."; + return PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . "add your custom code here."; } public function setCustomViewCustomMethods($main_view, $code) @@ -2342,40 +2329,40 @@ class Interpretation extends Fields $main = ''; if ($view->gettype == 3) { - // ###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();"; - $main .= PHP_EOL . "\t\t\t\$this->userId\t\t= \$this->user->get('id');"; - $main .= PHP_EOL . "\t\t\t\$this->guest\t\t= \$this->user->get('guest');"; - $main .= PHP_EOL . "\t\t\t\$this->groups\t\t= \$this->user->get('groups');"; - $main .= PHP_EOL . "\t\t\t\$this->authorisedGroups\t= \$this->user->getAuthorisedGroups();"; - $main .= PHP_EOL . "\t\t\t\$this->levels\t\t= \$this->user->getAuthorisedViewLevels();"; - $main .= PHP_EOL . "\t\t\t\$this->initSet\t\t= true;"; - $main .= PHP_EOL . "\t\t}"; + // SITE_GET_ITEM <<>> + $main .= PHP_EOL . PHP_EOL . $this->_t(2) . "if (!isset(\$this->initSet) || !\$this->initSet)"; + $main .= PHP_EOL . $this->_t(2) . "{"; + $main .= PHP_EOL . $this->_t(3) . "\$this->user = JFactory::getUser();"; + $main .= PHP_EOL . $this->_t(3) . "\$this->userId = \$this->user->get('id');"; + $main .= PHP_EOL . $this->_t(3) . "\$this->guest = \$this->user->get('guest');"; + $main .= PHP_EOL . $this->_t(3) . "\$this->groups = \$this->user->get('groups');"; + $main .= PHP_EOL . $this->_t(3) . "\$this->authorisedGroups = \$this->user->getAuthorisedGroups();"; + $main .= PHP_EOL . $this->_t(3) . "\$this->levels = \$this->user->getAuthorisedViewLevels();"; + $main .= PHP_EOL . $this->_t(3) . "\$this->initSet = true;"; + $main .= PHP_EOL . $this->_t(2) . "}"; $main .= $this->setCustomViewGetItem($view, $view->code, '', 'custom'); $type = 'mixed item data object on success, false on failure.'; } elseif ($view->gettype == 4) { - $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();"; - $main .= PHP_EOL . "\t\t\t\$this->userId\t\t= \$this->user->get('id');"; - $main .= PHP_EOL . "\t\t\t\$this->guest\t\t= \$this->user->get('guest');"; - $main .= PHP_EOL . "\t\t\t\$this->groups\t\t= \$this->user->get('groups');"; - $main .= PHP_EOL . "\t\t\t\$this->authorisedGroups\t= \$this->user->getAuthorisedGroups();"; - $main .= PHP_EOL . "\t\t\t\$this->levels\t\t= \$this->user->getAuthorisedViewLevels();"; - $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 . PHP_EOL . $this->_t(2) . "if (!isset(\$this->initSet) || !\$this->initSet)"; + $main .= PHP_EOL . $this->_t(2) . "{"; + $main .= PHP_EOL . $this->_t(3) . "\$this->user = JFactory::getUser();"; + $main .= PHP_EOL . $this->_t(3) . "\$this->userId = \$this->user->get('id');"; + $main .= PHP_EOL . $this->_t(3) . "\$this->guest = \$this->user->get('guest');"; + $main .= PHP_EOL . $this->_t(3) . "\$this->groups = \$this->user->get('groups');"; + $main .= PHP_EOL . $this->_t(3) . "\$this->authorisedGroups = \$this->user->getAuthorisedGroups();"; + $main .= PHP_EOL . $this->_t(3) . "\$this->levels = \$this->user->getAuthorisedViewLevels();"; + $main .= PHP_EOL . $this->_t(3) . "\$this->initSet = true;"; + $main .= PHP_EOL . $this->_t(2) . "}"; + $main .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the global params"; + $main .= PHP_EOL . $this->_t(2) . "\$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)) @@ -2383,27 +2370,27 @@ class Interpretation extends Fields $main .= $this->setPlaceholders($view->php_before_getitems, $this->placeholders); } // load the object list - $main .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; - $main .= PHP_EOL . "\t\t\$db->setQuery(\$query);"; - $main .= PHP_EOL . "\t\t\$items = \$db->loadObjectList();"; + $main .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; + $main .= PHP_EOL . $this->_t(2) . "\$db->setQuery(\$query);"; + $main .= PHP_EOL . $this->_t(2) . "\$items = \$db->loadObjectList();"; // set after items php if (isset($view->add_php_after_getitems) && $view->add_php_after_getitems == 1 && isset($view->php_after_getitems) && ComponentbuilderHelper::checkString($view->php_after_getitems)) { $main .= $this->setPlaceholders($view->php_after_getitems, $this->placeholders); } - $main .= PHP_EOL . PHP_EOL . "\t\tif (empty(\$items))"; - $main .= PHP_EOL . "\t\t{"; - $main .= PHP_EOL . "\t\t\treturn false;"; - $main .= PHP_EOL . "\t\t}"; - // ###SITE_GET_ITEMS### <<>> + $main .= PHP_EOL . PHP_EOL . $this->_t(2) . "if (empty(\$items))"; + $main .= PHP_EOL . $this->_t(2) . "{"; + $main .= PHP_EOL . $this->_t(3) . "return false;"; + $main .= PHP_EOL . $this->_t(2) . "}"; + // 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;"; + $main .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " return items"; + $main .= PHP_EOL . $this->_t(2) . "return \$items;"; $type = 'mixed An array of objects on success, false on failure.'; } // load the main mehtod $methods .= $this->setMainCustomMehtod($main, $view->getcustom, $type); - // ###SITE_CUSTOM_METHODS### <<>> + // SITE_CUSTOM_METHODS <<>> $methods .= $this->setCustomViewCustomItemMethods($view, $view->code); } } @@ -2420,107 +2407,106 @@ class Interpretation extends Fields { // build uikit get method $ukit = array(); - $ukit[] = PHP_EOL . PHP_EOL . "\t/**"; - $ukit[] = "\t* \tUIKIT Component Classes"; - $ukit[] = "\t**/"; - $ukit[] = "\tpublic static \$uk_components = array("; - $ukit[] = "\t\t\t'data-uk-grid' => array("; - $ukit[] = "\t\t\t\t'grid' ),"; - $ukit[] = "\t\t\t'uk-accordion' => array("; - $ukit[] = "\t\t\t\t'accordion' ),"; - $ukit[] = "\t\t\t'uk-autocomplete' => array("; - $ukit[] = "\t\t\t\t'autocomplete' ),"; - $ukit[] = "\t\t\t'data-uk-datepicker' => array("; - $ukit[] = "\t\t\t\t'datepicker' ),"; - $ukit[] = "\t\t\t'uk-form-password' => array("; - $ukit[] = "\t\t\t\t'form-password' ),"; - $ukit[] = "\t\t\t'uk-form-select' => array("; - $ukit[] = "\t\t\t\t'form-select' ),"; - $ukit[] = "\t\t\t'data-uk-htmleditor' => array("; - $ukit[] = "\t\t\t\t'htmleditor' ),"; - $ukit[] = "\t\t\t'data-uk-lightbox' => array("; - $ukit[] = "\t\t\t\t'lightbox' ),"; - $ukit[] = "\t\t\t'uk-nestable' => array("; - $ukit[] = "\t\t\t\t'nestable' ),"; - $ukit[] = "\t\t\t'UIkit.notify' => array("; - $ukit[] = "\t\t\t\t'notify' ),"; - $ukit[] = "\t\t\t'data-uk-parallax' => array("; - $ukit[] = "\t\t\t\t'parallax' ),"; - $ukit[] = "\t\t\t'uk-search' => array("; - $ukit[] = "\t\t\t\t'search' ),"; - $ukit[] = "\t\t\t'uk-slider' => array("; - $ukit[] = "\t\t\t\t'slider' ),"; - $ukit[] = "\t\t\t'uk-slideset' => array("; - $ukit[] = "\t\t\t\t'slideset' ),"; - $ukit[] = "\t\t\t'uk-slideshow' => array("; - $ukit[] = "\t\t\t\t'slideshow',"; - $ukit[] = "\t\t\t\t'slideshow-fx' ),"; - $ukit[] = "\t\t\t'uk-sortable' => array("; - $ukit[] = "\t\t\t\t'sortable' ),"; - $ukit[] = "\t\t\t'data-uk-sticky' => array("; - $ukit[] = "\t\t\t\t'sticky' ),"; - $ukit[] = "\t\t\t'data-uk-timepicker' => array("; - $ukit[] = "\t\t\t\t'timepicker' ),"; - $ukit[] = "\t\t\t'data-uk-tooltip' => array("; - $ukit[] = "\t\t\t\t'tooltip' ),"; - $ukit[] = "\t\t\t'uk-placeholder' => array("; - $ukit[] = "\t\t\t\t'placeholder' ),"; - $ukit[] = "\t\t\t'uk-dotnav' => array("; - $ukit[] = "\t\t\t\t'dotnav' ),"; - $ukit[] = "\t\t\t'uk-slidenav' => array("; - $ukit[] = "\t\t\t\t'slidenav' ),"; - $ukit[] = "\t\t\t'uk-form' => array("; - $ukit[] = "\t\t\t\t'form-advanced' ),"; - $ukit[] = "\t\t\t'uk-progress' => array("; - $ukit[] = "\t\t\t\t'progress' ),"; - $ukit[] = "\t\t\t'upload-drop' => array("; - $ukit[] = "\t\t\t\t'upload', 'form-file' )"; - $ukit[] = "\t\t\t);"; - $ukit[] = "\t"; - $ukit[] = "\t/**"; - $ukit[] = "\t* \tAdd UIKIT Components"; - $ukit[] = "\t**/"; - $ukit[] = "\tpublic static \$uikit = false;"; + $ukit[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $ukit[] = $this->_t(1) . " * UIKIT Component Classes"; + $ukit[] = $this->_t(1) . " **/"; + $ukit[] = $this->_t(1) . "public static \$uk_components = array("; + $ukit[] = $this->_t(3) . "'data-uk-grid' => array("; + $ukit[] = $this->_t(4) . "'grid' ),"; + $ukit[] = $this->_t(3) . "'uk-accordion' => array("; + $ukit[] = $this->_t(4) . "'accordion' ),"; + $ukit[] = $this->_t(3) . "'uk-autocomplete' => array("; + $ukit[] = $this->_t(4) . "'autocomplete' ),"; + $ukit[] = $this->_t(3) . "'data-uk-datepicker' => array("; + $ukit[] = $this->_t(4) . "'datepicker' ),"; + $ukit[] = $this->_t(3) . "'uk-form-password' => array("; + $ukit[] = $this->_t(4) . "'form-password' ),"; + $ukit[] = $this->_t(3) . "'uk-form-select' => array("; + $ukit[] = $this->_t(4) . "'form-select' ),"; + $ukit[] = $this->_t(3) . "'data-uk-htmleditor' => array("; + $ukit[] = $this->_t(4) . "'htmleditor' ),"; + $ukit[] = $this->_t(3) . "'data-uk-lightbox' => array("; + $ukit[] = $this->_t(4) . "'lightbox' ),"; + $ukit[] = $this->_t(3) . "'uk-nestable' => array("; + $ukit[] = $this->_t(4) . "'nestable' ),"; + $ukit[] = $this->_t(3) . "'UIkit.notify' => array("; + $ukit[] = $this->_t(4) . "'notify' ),"; + $ukit[] = $this->_t(3) . "'data-uk-parallax' => array("; + $ukit[] = $this->_t(4) . "'parallax' ),"; + $ukit[] = $this->_t(3) . "'uk-search' => array("; + $ukit[] = $this->_t(4) . "'search' ),"; + $ukit[] = $this->_t(3) . "'uk-slider' => array("; + $ukit[] = $this->_t(4) . "'slider' ),"; + $ukit[] = $this->_t(3) . "'uk-slideset' => array("; + $ukit[] = $this->_t(4) . "'slideset' ),"; + $ukit[] = $this->_t(3) . "'uk-slideshow' => array("; + $ukit[] = $this->_t(4) . "'slideshow',"; + $ukit[] = $this->_t(4) . "'slideshow-fx' ),"; + $ukit[] = $this->_t(3) . "'uk-sortable' => array("; + $ukit[] = $this->_t(4) . "'sortable' ),"; + $ukit[] = $this->_t(3) . "'data-uk-sticky' => array("; + $ukit[] = $this->_t(4) . "'sticky' ),"; + $ukit[] = $this->_t(3) . "'data-uk-timepicker' => array("; + $ukit[] = $this->_t(4) . "'timepicker' ),"; + $ukit[] = $this->_t(3) . "'data-uk-tooltip' => array("; + $ukit[] = $this->_t(4) . "'tooltip' ),"; + $ukit[] = $this->_t(3) . "'uk-placeholder' => array("; + $ukit[] = $this->_t(4) . "'placeholder' ),"; + $ukit[] = $this->_t(3) . "'uk-dotnav' => array("; + $ukit[] = $this->_t(4) . "'dotnav' ),"; + $ukit[] = $this->_t(3) . "'uk-slidenav' => array("; + $ukit[] = $this->_t(4) . "'slidenav' ),"; + $ukit[] = $this->_t(3) . "'uk-form' => array("; + $ukit[] = $this->_t(4) . "'form-advanced' ),"; + $ukit[] = $this->_t(3) . "'uk-progress' => array("; + $ukit[] = $this->_t(4) . "'progress' ),"; + $ukit[] = $this->_t(3) . "'upload-drop' => array("; + $ukit[] = $this->_t(4) . "'upload', 'form-file' )"; + $ukit[] = $this->_t(3) . ");"; + $ukit[] = PHP_EOL . $this->_t(1) . "/**"; + $ukit[] = $this->_t(1) . " * Add UIKIT Components"; + $ukit[] = $this->_t(1) . " **/"; + $ukit[] = $this->_t(1) . "public static \$uikit = false;"; $ukit[] = ""; - $ukit[] = "\t/**"; - $ukit[] = "\t* \tGet UIKIT Components"; - $ukit[] = "\t**/"; - $ukit[] = "\tpublic static function getUikitComp(\$content,\$classes = array())"; - $ukit[] = "\t{"; - $ukit[] = "\t\tif (strpos(\$content,'class=\"uk-') !== false)"; - $ukit[] = "\t\t{"; - $ukit[] = "\t\t\t//" . $this->setLine(__LINE__) . " reset"; - $ukit[] = "\t\t\t\$temp = array();"; - $ukit[] = "\t\t\tforeach (self::\$uk_components as \$looking => \$add)"; - $ukit[] = "\t\t\t{"; - $ukit[] = "\t\t\t\tif (strpos(\$content,\$looking) !== false)"; - $ukit[] = "\t\t\t\t{"; - $ukit[] = "\t\t\t\t\t\$temp[] = \$looking;"; - $ukit[] = "\t\t\t\t}"; - $ukit[] = "\t\t\t}"; - $ukit[] = "\t\t\t//" . $this->setLine(__LINE__) . " make sure uikit is loaded to config"; - $ukit[] = "\t\t\tif (strpos(\$content,'class=\"uk-') !== false)"; - $ukit[] = "\t\t\t{"; - $ukit[] = "\t\t\t\tself::\$uikit = true;"; - $ukit[] = "\t\t\t}"; - $ukit[] = "\t\t\t//" . $this->setLine(__LINE__) . " sorter"; - $ukit[] = "\t\t\tif (self::checkArray(\$temp))"; - $ukit[] = "\t\t\t{"; - $ukit[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " merger"; - $ukit[] = "\t\t\t\tif (self::checkArray(\$classes))"; - $ukit[] = "\t\t\t\t{"; - $ukit[] = "\t\t\t\t\t\$newTemp = array_merge(\$temp,\$classes);"; - $ukit[] = "\t\t\t\t\t\$temp = array_unique(\$newTemp);"; - $ukit[] = "\t\t\t\t}"; - $ukit[] = "\t\t\t\treturn \$temp;"; - $ukit[] = "\t\t\t}"; - $ukit[] = "\t\t}\t"; - $ukit[] = "\t\tif (self::checkArray(\$classes))"; - $ukit[] = "\t\t{"; - $ukit[] = "\t\t\treturn \$classes;"; - $ukit[] = "\t\t}"; - $ukit[] = "\t\treturn false;"; - $ukit[] = "\t}"; + $ukit[] = $this->_t(1) . "/**"; + $ukit[] = $this->_t(1) . " * Get UIKIT Components"; + $ukit[] = $this->_t(1) . " **/"; + $ukit[] = $this->_t(1) . "public static function getUikitComp(\$content,\$classes = array())"; + $ukit[] = $this->_t(1) . "{"; + $ukit[] = $this->_t(2) . "if (strpos(\$content,'class=\"uk-') !== false)"; + $ukit[] = $this->_t(2) . "{"; + $ukit[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " reset"; + $ukit[] = $this->_t(3) . "\$temp = array();"; + $ukit[] = $this->_t(3) . "foreach (self::\$uk_components as \$looking => \$add)"; + $ukit[] = $this->_t(3) . "{"; + $ukit[] = $this->_t(4) . "if (strpos(\$content,\$looking) !== false)"; + $ukit[] = $this->_t(4) . "{"; + $ukit[] = $this->_t(5) . "\$temp[] = \$looking;"; + $ukit[] = $this->_t(4) . "}"; + $ukit[] = $this->_t(3) . "}"; + $ukit[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " make sure uikit is loaded to config"; + $ukit[] = $this->_t(3) . "if (strpos(\$content,'class=\"uk-') !== false)"; + $ukit[] = $this->_t(3) . "{"; + $ukit[] = $this->_t(4) . "self::\$uikit = true;"; + $ukit[] = $this->_t(3) . "}"; + $ukit[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " sorter"; + $ukit[] = $this->_t(3) . "if (self::checkArray(\$temp))"; + $ukit[] = $this->_t(3) . "{"; + $ukit[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " merger"; + $ukit[] = $this->_t(4) . "if (self::checkArray(\$classes))"; + $ukit[] = $this->_t(4) . "{"; + $ukit[] = $this->_t(5) . "\$newTemp = array_merge(\$temp,\$classes);"; + $ukit[] = $this->_t(5) . "\$temp = array_unique(\$newTemp);"; + $ukit[] = $this->_t(4) . "}"; + $ukit[] = $this->_t(4) . "return \$temp;"; + $ukit[] = $this->_t(3) . "}"; + $ukit[] = $this->_t(2) . "}"; + $ukit[] = $this->_t(2) . "if (self::checkArray(\$classes))"; + $ukit[] = $this->_t(2) . "{"; + $ukit[] = $this->_t(3) . "return \$classes;"; + $ukit[] = $this->_t(2) . "}"; + $ukit[] = $this->_t(2) . "return false;"; + $ukit[] = $this->_t(1) . "}"; // return the help methods return implode(PHP_EOL, $ukit); @@ -2535,20 +2521,20 @@ class Interpretation extends Fields if (2 == $this->uikit || 1 == $this->uikit) { // build uikit get method - $method .= PHP_EOL . PHP_EOL . "\t/**"; - $method .= PHP_EOL . "\t* Get the uikit needed components"; - $method .= PHP_EOL . "\t*"; - $method .= PHP_EOL . "\t* @return mixed An array of objects on success."; - $method .= PHP_EOL . "\t*"; - $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\t{"; - $method .= PHP_EOL . "\t\t\treturn \$this->uikitComp;"; - $method .= PHP_EOL . "\t\t}"; - $method .= PHP_EOL . "\t\treturn false;"; - $method .= PHP_EOL . "\t}"; + $method .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $method .= PHP_EOL . $this->_t(1) . " * Get the uikit needed components"; + $method .= PHP_EOL . $this->_t(1) . " *"; + $method .= PHP_EOL . $this->_t(1) . " * @return mixed An array of objects on success."; + $method .= PHP_EOL . $this->_t(1) . " *"; + $method .= PHP_EOL . $this->_t(1) . " */"; + $method .= PHP_EOL . $this->_t(1) . "public function getUikitComp()"; + $method .= PHP_EOL . $this->_t(1) . "{"; + $method .= PHP_EOL . $this->_t(2) . "if (isset(\$this->uikitComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$this->uikitComp))"; + $method .= PHP_EOL . $this->_t(2) . "{"; + $method .= PHP_EOL . $this->_t(3) . "return \$this->uikitComp;"; + $method .= PHP_EOL . $this->_t(2) . "}"; + $method .= PHP_EOL . $this->_t(2) . "return false;"; + $method .= PHP_EOL . $this->_t(1) . "}"; } return $method; } @@ -2559,15 +2545,15 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkString($body)) { // build custom method - $method .= PHP_EOL . PHP_EOL . "\t/**"; - $method .= PHP_EOL . "\t* Custom Method"; - $method .= PHP_EOL . "\t*"; - $method .= PHP_EOL . "\t* @return " . $type; - $method .= PHP_EOL . "\t*"; - $method .= PHP_EOL . "\t*/"; - $method .= PHP_EOL . "\tpublic function " . $nAme . "()"; - $method .= PHP_EOL . "\t{" . $body; - $method .= PHP_EOL . "\t}"; + $method .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $method .= PHP_EOL . $this->_t(1) . " * Custom Method"; + $method .= PHP_EOL . $this->_t(1) . " *"; + $method .= PHP_EOL . $this->_t(1) . " * @return " . $type; + $method .= PHP_EOL . $this->_t(1) . " *"; + $method .= PHP_EOL . $this->_t(1) . " */"; + $method .= PHP_EOL . $this->_t(1) . "public function " . $nAme . "()"; + $method .= PHP_EOL . $this->_t(1) . "{" . $body; + $method .= PHP_EOL . $this->_t(1) . "}"; } return $method; } @@ -2590,38 +2576,38 @@ class Interpretation extends Fields // set the method defaults $default = $this->setCustomViewMethodDefaults($get, $code); // build custom method - $methods .= PHP_EOL . PHP_EOL . "\t/**"; - $methods .= PHP_EOL . "\t* Method to get an array of " . $default['name'] . " Objects."; - $methods .= PHP_EOL . "\t*"; - $methods .= PHP_EOL . "\t* @return mixed An array of " . $default['name'] . " Objects on success, false on failure."; - $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\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."; - $methods .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; - $methods .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get from " . $get['selection']['table'] . " as " . $default['as']; - $methods .= PHP_EOL . "\t\t" . $get['selection']['select']; - $methods .= PHP_EOL . "\t\t" . '$query->from(' . $get['selection']['from'] . ');'; + $methods .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $methods .= PHP_EOL . $this->_t(1) . " * Method to get an array of " . $default['name'] . " Objects."; + $methods .= PHP_EOL . $this->_t(1) . " *"; + $methods .= PHP_EOL . $this->_t(1) . " * @return mixed An array of " . $default['name'] . " Objects on success, false on failure."; + $methods .= PHP_EOL . $this->_t(1) . " *"; + $methods .= PHP_EOL . $this->_t(1) . " */"; + $methods .= PHP_EOL . $this->_t(1) . "public function get" . $default['methodName'] . "(\$" . $default['on_field'] . ")"; + $methods .= PHP_EOL . $this->_t(1) . "{" . $this->hhh . "CRYPT" . $this->hhh; + $methods .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get a db connection."; + $methods .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDbo();"; + $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $methods .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);"; + $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get from " . $get['selection']['table'] . " as " . $default['as']; + $methods .= PHP_EOL . $this->_t(2) . $get['selection']['select']; + $methods .= PHP_EOL . $this->_t(2) . '$query->from(' . $get['selection']['from'] . ');'; // set the string if ($get['operator'] === 'IN' || $get['operator'] === 'NOT IN') { - $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\t{"; - $methods .= PHP_EOL . "\t\t\t\$query->where('" . $get['join_field'] . " " . $get['operator'] . " (' . implode(',', \$array) . ')');"; - $methods .= PHP_EOL . "\t\t}"; - $methods .= PHP_EOL . "\t\telse"; - $methods .= PHP_EOL . "\t\t{"; - $methods .= PHP_EOL . "\t\t\treturn false;"; - $methods .= PHP_EOL . "\t\t}"; + $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check if \$" . $default['on_field'] . " is an array with values."; + $methods .= PHP_EOL . $this->_t(2) . "\$array = \$" . $default['on_field'] . ";"; + $methods .= PHP_EOL . $this->_t(2) . "if (isset(\$array) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$array, true))"; + $methods .= PHP_EOL . $this->_t(2) . "{"; + $methods .= PHP_EOL . $this->_t(3) . "\$query->where('" . $get['join_field'] . " " . $get['operator'] . " (' . implode(',', \$array) . ')');"; + $methods .= PHP_EOL . $this->_t(2) . "}"; + $methods .= PHP_EOL . $this->_t(2) . "else"; + $methods .= PHP_EOL . $this->_t(2) . "{"; + $methods .= PHP_EOL . $this->_t(3) . "return false;"; + $methods .= PHP_EOL . $this->_t(2) . "}"; } else { - $methods .= PHP_EOL . "\t\t\$query->where('" . $get['join_field'] . " " . $get['operator'] . " ' . \$db->quote(\$" . $default['on_field'] . "));"; + $methods .= PHP_EOL . $this->_t(2) . "\$query->where('" . $get['join_field'] . " " . $get['operator'] . " ' . \$db->quote(\$" . $default['on_field'] . "));"; } // check if other queries should be loaded $queryChecker = (isset($this->otherQuery[$this->target][$default['code']][$default['as']]) && ComponentbuilderHelper::checkArray($this->otherQuery[$this->target][$default['code']][$default['as']])) ? $this->otherQuery[$this->target][$default['code']][$default['as']] : ''; @@ -2656,14 +2642,14 @@ class Interpretation extends Fields $methods .= $string; } } - $methods .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; - $methods .= PHP_EOL . "\t\t\$db->setQuery(\$query);"; - $methods .= PHP_EOL . "\t\t\$db->execute();"; - $methods .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " check if there was data returned"; - $methods .= PHP_EOL . "\t\tif (\$db->getNumRows())"; - $methods .= PHP_EOL . "\t\t{"; + $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; + $methods .= PHP_EOL . $this->_t(2) . "\$db->setQuery(\$query);"; + $methods .= PHP_EOL . $this->_t(2) . "\$db->execute();"; + $methods .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if there was data returned"; + $methods .= PHP_EOL . $this->_t(2) . "if (\$db->getNumRows())"; + $methods .= PHP_EOL . $this->_t(2) . "{"; // 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 +2671,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 => $this->_t(2), $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)) || @@ -2697,22 +2683,22 @@ class Interpretation extends Fields if (isset($decodeChecker) && ComponentbuilderHelper::checkArray($decodeChecker)) { // also filter fields if needed - $decoder = $this->setCustomViewFieldDecode($get, $decodeChecker, '$item', $default['code'], "\t\t"); + $decoder = $this->setCustomViewFieldDecode($get, $decodeChecker, '$item', $default['code'], $this->_t(2)); } $decoder_filter = ''; if (isset($decodeFilter) && ComponentbuilderHelper::checkArray($decodeFilter)) { - $decoder_filter = $this->setCustomViewFieldDecodeFilter($get, $decodeFilter, '$item', '$items[$nr]', $default['code'], "\t\t"); + $decoder_filter = $this->setCustomViewFieldDecodeFilter($get, $decodeFilter, '$item', '$items[$nr]', $default['code'], $this->_t(2)); } $contentprepare = ''; if (isset($contentprepareChecker) && ComponentbuilderHelper::checkArray($contentprepareChecker)) { - $contentprepare = $this->setCustomViewFieldonContentPrepareChecker($get, $contentprepareChecker, '$item', $default['code'], "\t\t"); + $contentprepare = $this->setCustomViewFieldonContentPrepareChecker($get, $contentprepareChecker, '$item', $default['code'], $this->_t(2)); } $uikit = ''; if (isset($uikitChecker) && ComponentbuilderHelper::checkArray($uikitChecker)) { - $uikit = $this->setCustomViewFieldUikitChecker($get, $uikitChecker, '$item', $default['code'], "\t\t"); + $uikit = $this->setCustomViewFieldUikitChecker($get, $uikitChecker, '$item', $default['code'], $this->_t(2)); } $joine = ''; if (ComponentbuilderHelper::checkArray($joinedChecker)) @@ -2724,10 +2710,10 @@ class Interpretation extends Fields } if (ComponentbuilderHelper::checkString($decoder) || ComponentbuilderHelper::checkString($contentprepare) || ComponentbuilderHelper::checkString($uikit) || ComponentbuilderHelper::checkString($decoder_filter) || ComponentbuilderHelper::checkString($joine)) { - $methods .= PHP_EOL . "\t\t\t\$items = \$db->loadObjectList();"; - $methods .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Convert the parameter fields into objects."; - $methods .= PHP_EOL . "\t\t\tforeach (\$items as \$nr => &\$item)"; - $methods .= PHP_EOL . "\t\t\t{"; + $methods .= PHP_EOL . $this->_t(3) . "\$items = \$db->loadObjectList();"; + $methods .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Convert the parameter fields into objects."; + $methods .= PHP_EOL . $this->_t(3) . "foreach (\$items as \$nr => &\$item)"; + $methods .= PHP_EOL . $this->_t(3) . "{"; if (ComponentbuilderHelper::checkString($decoder)) { $methods .= $decoder; @@ -2748,48 +2734,48 @@ class Interpretation extends Fields { $methods .= $joine; } - $methods .= PHP_EOL . "\t\t\t}"; - $methods .= PHP_EOL . "\t\t\treturn \$items;"; + $methods .= PHP_EOL . $this->_t(3) . "}"; + $methods .= PHP_EOL . $this->_t(3) . "return \$items;"; } else { - $methods .= PHP_EOL . "\t\t\treturn \$db->loadObjectList();"; + $methods .= PHP_EOL . $this->_t(3) . "return \$db->loadObjectList();"; } } else { - $methods .= PHP_EOL . "\t\t\treturn \$db->loadObjectList();"; + $methods .= PHP_EOL . $this->_t(3) . "return \$db->loadObjectList();"; } - $methods .= PHP_EOL . "\t\t}"; - $methods .= PHP_EOL . "\t\treturn false;"; - $methods .= PHP_EOL . "\t}"; + $methods .= PHP_EOL . $this->_t(2) . "}"; + $methods .= PHP_EOL . $this->_t(2) . "return false;"; + $methods .= PHP_EOL . $this->_t(1) . "}"; // 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) { if (isset($this->siteDecrypt[$cryptionType][$code]) && $this->siteDecrypt[$cryptionType][$code]) { - $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . "\t\t\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the encryption object."; - $script .= PHP_EOL . "\t\t\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);" . PHP_EOL; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; + $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . $this->_t(2) . "\$" . $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); } @@ -2814,7 +2800,7 @@ class Interpretation extends Fields /** * get the a script from the custom script builder - * + * * @param string $first The first key * @param string $second The second key * @param string $prefix The prefix to add in front of the script if found @@ -2824,7 +2810,7 @@ class Interpretation extends Fields * @param string $sufix The sufix to add after the script if found * * @return mix The string/script if found or the default value if not found - * + * */ public function getCustomScriptBuilder($first, $second, $prefix = '', $note = null, $unset = null, $default = null, $sufix = '') { @@ -2860,19 +2846,19 @@ class Interpretation extends Fields { if ($get->pagination == 1) { - $getItem = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get a db connection."; + $getItem = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get a db connection."; } else { - $getItem = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Make sure all records load, since no pagination allowed."; - $getItem .= PHP_EOL . "\t\t\$this->setState('list.limit', 0);"; - $getItem .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get a db connection."; + $getItem = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Make sure all records load, since no pagination allowed."; + $getItem .= PHP_EOL . $this->_t(2) . "\$this->setState('list.limit', 0);"; + $getItem .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get a db connection."; } - $getItem .= PHP_EOL . "\t\t\$db = JFactory::getDbo();"; - $getItem .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $getItem .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; + $getItem .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDbo();"; + $getItem .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $getItem .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);"; // check if there is any custom script - $getItem .= $this->getCustomScriptBuilder($this->target . '_php_getlistquery', $code, '', PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filtering.", true); + $getItem .= $this->getCustomScriptBuilder($this->target . '_php_getlistquery', $code, '', PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filtering.", true); // set main get query $getItem .= $this->setCustomViewQuery($get->main_get, $code); // setup filters @@ -2884,12 +2870,12 @@ class Interpretation extends Fields if ($return) { // return the query object - $getItem .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " return the query object" . PHP_EOL . "\t\treturn \$query;"; + $getItem .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " return the query object" . PHP_EOL . $this->_t(2) . "return \$query;"; } return $getItem; } - return PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . "add your custom code here."; + return PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . "add your custom code here."; } /** @@ -2906,18 +2892,18 @@ 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 .= 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"; - $getItem .= PHP_EOL . "\t\t\t\t\$item->slug = (isset(\$item->alias) && isset(\$item->id)) ? \$item->id.':'.\$item->alias : \$item->id;"; + $getItem .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Insure all item fields are adapted where needed."; + $getItem .= PHP_EOL . $this->_t(2) . "if (" . $Component . "Helper::checkArray(\$items))"; + $getItem .= PHP_EOL . $this->_t(2) . "{"; + $getItem .= $this->hhh . "DISPATCHER" . $this->hhh; + $getItem .= PHP_EOL . $this->_t(3) . "foreach (\$items as \$nr => &\$item)"; + $getItem .= PHP_EOL . $this->_t(3) . "{"; + $getItem .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Always create a slug for sef URL's"; + $getItem .= PHP_EOL . $this->_t(4) . "\$item->slug = (isset(\$item->alias) && isset(\$item->id)) ? \$item->id.':'.\$item->alias : \$item->id;"; if (isset($get->main_get) && ComponentbuilderHelper::checkArray($get->main_get)) { $asBucket = array(); @@ -2929,7 +2915,7 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($decodeChecker)) { // set decoding of needed fields - $getItem .= $this->setCustomViewFieldDecode($main_get, $decodeChecker, "\$item", $code, "\t\t"); + $getItem .= $this->setCustomViewFieldDecode($main_get, $decodeChecker, "\$item", $code, $this->_t(2)); } } // also filter fields if needed @@ -2938,7 +2924,7 @@ class Interpretation extends Fields $decodeFilter = $this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']]; if (ComponentbuilderHelper::checkArray($decodeFilter)) { - $getItem .= $this->setCustomViewFieldDecodeFilter($main_get, $decodeFilter, "\$item", '$items[$nr]', $code, "\t\t"); + $getItem .= $this->setCustomViewFieldDecodeFilter($main_get, $decodeFilter, "\$item", '$items[$nr]', $code, $this->_t(2)); } } if (isset($this->siteFieldData['textareas'][$code][$main_get['key']][$main_get['as']])) @@ -2947,7 +2933,7 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($contentprepareChecker)) { // set contentprepare checkers on needed fields - $getItem .= $this->setCustomViewFieldonContentPrepareChecker($main_get, $contentprepareChecker, "\$item", $code, "\t\t"); + $getItem .= $this->setCustomViewFieldonContentPrepareChecker($main_get, $contentprepareChecker, "\$item", $code, $this->_t(2)); } } if (isset($this->siteFieldData['uikit'][$code][$main_get['key']][$main_get['as']])) @@ -2956,38 +2942,38 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($uikitChecker)) { // set uikit checkers on needed fields - $getItem .= $this->setCustomViewFieldUikitChecker($main_get, $uikitChecker, "\$item", $code, "\t\t"); + $getItem .= $this->setCustomViewFieldUikitChecker($main_get, $uikitChecker, "\$item", $code, $this->_t(2)); } } $asBucket[] = $main_get['as']; } } // 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); } // setup Globals - $getItem .= $this->setCustomViewGlobals($get->global, '$item', $asBucket, "\t\t"); + $getItem .= $this->setCustomViewGlobals($get->global, '$item', $asBucket, $this->_t(2)); // setup the custom gets that returns multipal values - $getItem .= $this->setCustomViewCustomJoin($get->custom_get, "\$item", $code, $asBucket, "\t\t"); + $getItem .= $this->setCustomViewCustomJoin($get->custom_get, "\$item", $code, $asBucket, $this->_t(2)); // set calculations if ($get->addcalculation == 1) { $get->php_calculation = (array) explode(PHP_EOL, $get->php_calculation); if (ComponentbuilderHelper::checkArray($get->php_calculation)) { - $_tmp = PHP_EOL . "\t\t\t\t" . implode(PHP_EOL . "\t\t\t\t", $get->php_calculation); + $_tmp = PHP_EOL . $this->_t(4) . implode(PHP_EOL . $this->_t(4), $get->php_calculation); $getItem .= $this->setPlaceholders($_tmp, $this->placeholders); } } - $getItem .= PHP_EOL . "\t\t\t}"; - $getItem .= PHP_EOL . "\t\t}"; + $getItem .= PHP_EOL . $this->_t(3) . "}"; + $getItem .= PHP_EOL . $this->_t(2) . "}"; // remove empty foreach if (strlen($getItem) <= 100) { @@ -3001,10 +2987,10 @@ class Interpretation extends Fields { if ($this->siteDecrypt[$cryptionType][$code]) { - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . "\t\t\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the encryption object."; - $script .= PHP_EOL . "\t\t\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; + $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; } } return $script . $getItem; @@ -3018,29 +3004,29 @@ class Interpretation extends Fields if ($view['settings']->main_get->gettype == 1) { // for single views - $method .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Initialise variables."; - $method .= PHP_EOL . "\t\t\$this->item = \$this->get('Item');"; + $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Initialise variables."; + $method .= PHP_EOL . $this->_t(2) . "\$this->item = \$this->get('Item');"; } elseif ($view['settings']->main_get->gettype == 2) { // for list views - $method .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Initialise variables."; - $method .= PHP_EOL . "\t\t\$this->items = \$this->get('Items');"; + $method .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Initialise variables."; + $method .= PHP_EOL . $this->_t(2) . "\$this->items = \$this->get('Items');"; // only add if pagination is requered if ($view['settings']->main_get->pagination == 1) { - $method .= PHP_EOL . "\t\t\$this->pagination = \$this->get('Pagination');"; + $method .= PHP_EOL . $this->_t(2) . "\$this->pagination = \$this->get('Pagination');"; } // 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 . $this->_t(1) . ''; } 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 @@ -3049,7 +3035,7 @@ class Interpretation extends Fields foreach ($view['settings']->custom_get as $custom_get) { $custom_get_name = str_replace('get', '', $custom_get->getcustom); - $method .= PHP_EOL . "\t\t\$this->" . ComponentbuilderHelper::safeString($custom_get_name) . " = \$this->get('" . $custom_get_name . "');"; + $method .= PHP_EOL . $this->_t(2) . "\$this->" . ComponentbuilderHelper::safeString($custom_get_name) . " = \$this->get('" . $custom_get_name . "');"; } } // add custom script @@ -3058,36 +3044,36 @@ class Interpretation extends Fields $view['settings']->php_jview_display = (array) explode(PHP_EOL, $view['settings']->php_jview_display); if (ComponentbuilderHelper::checkArray($view['settings']->php_jview_display)) { - $_tmp = PHP_EOL . "\t\t" . implode(PHP_EOL . "\t\t", $view['settings']->php_jview_display); + $_tmp = PHP_EOL . $this->_t(2) . implode(PHP_EOL . $this->_t(2), $view['settings']->php_jview_display); $method .= $this->setPlaceholders($_tmp, $this->placeholders); } } if ('site' === $this->target) { - $method .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the toolbar"; - $method .= PHP_EOL . "\t\t\$this->addToolBar();"; - $method .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " set the document"; - $method .= PHP_EOL . "\t\t\$this->_prepareDocument();"; + $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set the toolbar"; + $method .= PHP_EOL . $this->_t(2) . "\$this->addToolBar();"; + $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " set the document"; + $method .= PHP_EOL . $this->_t(2) . "\$this->_prepareDocument();"; } elseif ('custom_admin' === $this->target) { - $method .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " We don't need toolbar in the modal window."; - $method .= PHP_EOL . "\t\tif (\$this->getLayout() !== 'modal')"; - $method .= PHP_EOL . "\t\t{"; - $method .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " add the tool bar"; - $method .= PHP_EOL . "\t\t\t\$this->addToolBar();"; - $method .= PHP_EOL . "\t\t}"; - $method .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " set the document"; - $method .= PHP_EOL . "\t\t\$this->setDocument();"; + $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " We don't need toolbar in the modal window."; + $method .= PHP_EOL . $this->_t(2) . "if (\$this->getLayout() !== 'modal')"; + $method .= PHP_EOL . $this->_t(2) . "{"; + $method .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " add the tool bar"; + $method .= PHP_EOL . $this->_t(3) . "\$this->addToolBar();"; + $method .= PHP_EOL . $this->_t(2) . "}"; + $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " set the document"; + $method .= PHP_EOL . $this->_t(2) . "\$this->setDocument();"; } - $method .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check for errors."; - $method .= PHP_EOL . "\t\tif (count(\$errors = \$this->get('Errors')))"; - $method .= PHP_EOL . "\t\t{"; - $method .= PHP_EOL . "\t\t\tthrow new Exception(implode(" . '"\n", $errors), 500);'; - $method .= PHP_EOL . "\t\t}"; + $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for errors."; + $method .= PHP_EOL . $this->_t(2) . "if (count(\$errors = \$this->get('Errors')))"; + $method .= PHP_EOL . $this->_t(2) . "{"; + $method .= PHP_EOL . $this->_t(3) . "throw new Exception(implode(" . '"\n", $errors), 500);'; + $method .= PHP_EOL . $this->_t(2) . "}"; - $method .= PHP_EOL . PHP_EOL . "\t\tparent::display(\$tpl);"; + $method .= PHP_EOL . PHP_EOL . $this->_t(2) . "parent::display(\$tpl);"; } return $method; } @@ -3108,48 +3094,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; @@ -3160,71 +3146,71 @@ class Interpretation extends Fields if (isset($this->getModule[$this->target][$view['settings']->code]) && $this->getModule[$this->target][$view['settings']->code]) { $addModule = array(); - $addModule[] = PHP_EOL . PHP_EOL . "\t/**"; - $addModule[] = "\t * Get the modules published in a position"; - $addModule[] = "\t */"; - $addModule[] = "\tpublic function getModules(\$position, \$seperator = '', \$class = '')"; - $addModule[] = "\t{"; - $addModule[] = "\t\t//" . $this->setLine(__LINE__) . " set default"; - $addModule[] = "\t\t\$found = false;"; - $addModule[] = "\t\t//" . $this->setLine(__LINE__) . " check if we aleady have these modules loaded"; - $addModule[] = "\t\tif (isset(\$this->setModules[\$position]))"; - $addModule[] = "\t\t{"; - $addModule[] = "\t\t\t\$found = true;"; - $addModule[] = "\t\t}"; - $addModule[] = "\t\telse"; - $addModule[] = "\t\t{"; - $addModule[] = "\t\t\t//" . $this->setLine(__LINE__) . " this is where you want to load your module position"; - $addModule[] = "\t\t\t\$modules = JModuleHelper::getModules(\$position);"; - $addModule[] = "\t\t\tif (\$modules)"; - $addModule[] = "\t\t\t{"; - $addModule[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " set the place holder"; - $addModule[] = "\t\t\t\t\$this->setModules[\$position] = array();"; - $addModule[] = "\t\t\t\tforeach(\$modules as \$module)"; - $addModule[] = "\t\t\t\t{"; - $addModule[] = "\t\t\t\t\t\$this->setModules[\$position][] = JModuleHelper::renderModule(\$module);"; - $addModule[] = "\t\t\t\t}"; - $addModule[] = "\t\t\t\t\$found = true;"; - $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\t{"; - $addModule[] = "\t\t\t//" . $this->setLine(__LINE__) . " set class"; - $addModule[] = "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkString(\$class))"; - $addModule[] = "\t\t\t{"; - $addModule[] = "\t\t\t\t\$class = ' class=\"'.\$class.'\" ';"; - $addModule[] = "\t\t\t}"; - $addModule[] = "\t\t\t//" . $this->setLine(__LINE__) . " set seperating return values"; - $addModule[] = "\t\t\tswitch(\$seperator)"; - $addModule[] = "\t\t\t{"; - $addModule[] = "\t\t\t\tcase 'none':"; - $addModule[] = "\t\t\t\t\treturn implode('', \$this->setModules[\$position]);"; - $addModule[] = "\t\t\t\t\tbreak;"; - $addModule[] = "\t\t\t\tcase 'div':"; - $addModule[] = "\t\t\t\t\treturn ''.implode('', \$this->setModules[\$position]).'';"; - $addModule[] = "\t\t\t\t\tbreak;"; - $addModule[] = "\t\t\t\tcase 'list':"; - $addModule[] = "\t\t\t\t\treturn '
  • '.implode('
  • ', \$this->setModules[\$position]).'
  • ';"; - $addModule[] = "\t\t\t\t\tbreak;"; - $addModule[] = "\t\t\t\tcase 'array':"; - $addModule[] = "\t\t\t\tcase 'Array':"; - $addModule[] = "\t\t\t\t\treturn \$this->setModules[\$position];"; - $addModule[] = "\t\t\t\t\tbreak;"; - $addModule[] = "\t\t\t\tdefault:"; - $addModule[] = "\t\t\t\t\treturn implode('
    ', \$this->setModules[\$position]);"; - $addModule[] = "\t\t\t\t\tbreak;"; - $addModule[] = "\t\t\t\t"; - $addModule[] = "\t\t\t}"; - $addModule[] = "\t\t}"; - $addModule[] = "\t\treturn false;"; - $addModule[] = "\t}"; + $addModule[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $addModule[] = $this->_t(1) . " * Get the modules published in a position"; + $addModule[] = $this->_t(1) . " */"; + $addModule[] = $this->_t(1) . "public function getModules(\$position, \$seperator = '', \$class = '')"; + $addModule[] = $this->_t(1) . "{"; + $addModule[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " set default"; + $addModule[] = $this->_t(2) . "\$found = false;"; + $addModule[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if we aleady have these modules loaded"; + $addModule[] = $this->_t(2) . "if (isset(\$this->setModules[\$position]))"; + $addModule[] = $this->_t(2) . "{"; + $addModule[] = $this->_t(3) . "\$found = true;"; + $addModule[] = $this->_t(2) . "}"; + $addModule[] = $this->_t(2) . "else"; + $addModule[] = $this->_t(2) . "{"; + $addModule[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " this is where you want to load your module position"; + $addModule[] = $this->_t(3) . "\$modules = JModuleHelper::getModules(\$position);"; + $addModule[] = $this->_t(3) . "if (\$modules)"; + $addModule[] = $this->_t(3) . "{"; + $addModule[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " set the place holder"; + $addModule[] = $this->_t(4) . "\$this->setModules[\$position] = array();"; + $addModule[] = $this->_t(4) . "foreach(\$modules as \$module)"; + $addModule[] = $this->_t(4) . "{"; + $addModule[] = $this->_t(5) . "\$this->setModules[\$position][] = JModuleHelper::renderModule(\$module);"; + $addModule[] = $this->_t(4) . "}"; + $addModule[] = $this->_t(4) . "\$found = true;"; + $addModule[] = $this->_t(3) . "}"; + $addModule[] = $this->_t(2) . "}"; + $addModule[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if modules were found"; + $addModule[] = $this->_t(2) . "if (\$found && isset(\$this->setModules[\$position]) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$this->setModules[\$position]))"; + $addModule[] = $this->_t(2) . "{"; + $addModule[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " set class"; + $addModule[] = $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkString(\$class))"; + $addModule[] = $this->_t(3) . "{"; + $addModule[] = $this->_t(4) . "\$class = ' class=\"'.\$class.'\" ';"; + $addModule[] = $this->_t(3) . "}"; + $addModule[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " set seperating return values"; + $addModule[] = $this->_t(3) . "switch(\$seperator)"; + $addModule[] = $this->_t(3) . "{"; + $addModule[] = $this->_t(4) . "case 'none':"; + $addModule[] = $this->_t(5) . "return implode('', \$this->setModules[\$position]);"; + $addModule[] = $this->_t(5) . "break;"; + $addModule[] = $this->_t(4) . "case 'div':"; + $addModule[] = $this->_t(5) . "return ''.implode('', \$this->setModules[\$position]).'';"; + $addModule[] = $this->_t(5) . "break;"; + $addModule[] = $this->_t(4) . "case 'list':"; + $addModule[] = $this->_t(5) . "return '
  • '.implode('
  • ', \$this->setModules[\$position]).'
  • ';"; + $addModule[] = $this->_t(5) . "break;"; + $addModule[] = $this->_t(4) . "case 'array':"; + $addModule[] = $this->_t(4) . "case 'Array':"; + $addModule[] = $this->_t(5) . "return \$this->setModules[\$position];"; + $addModule[] = $this->_t(5) . "break;"; + $addModule[] = $this->_t(4) . "default:"; + $addModule[] = $this->_t(5) . "return implode('
    ', \$this->setModules[\$position]);"; + $addModule[] = $this->_t(5) . "break;"; + $addModule[] = $this->_t(4); + $addModule[] = $this->_t(3) . "}"; + $addModule[] = $this->_t(2) . "}"; + $addModule[] = $this->_t(2) . "return false;"; + $addModule[] = $this->_t(1) . "}"; - $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 ''; } @@ -3240,7 +3226,7 @@ class Interpretation extends Fields $view['settings']->php_document = (array) explode(PHP_EOL, $view['settings']->php_document); if (ComponentbuilderHelper::checkArray($view['settings']->php_document)) { - $_tmp = PHP_EOL . "\t\t" . implode(PHP_EOL . "\t\t", $view['settings']->php_document); + $_tmp = PHP_EOL . $this->_t(2) . implode(PHP_EOL . $this->_t(2), $view['settings']->php_document); return $this->setPlaceholders($_tmp, $this->placeholders); } } @@ -3261,50 +3247,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; } } @@ -3328,16 +3314,16 @@ class Interpretation extends Fields // add cpanel button TODO does not work well on site with permissions if ($custom_button['target'] == 2) { - $buttons[] = "\t" . $tab . "\tif (\$this->user->authorise('" . $viewName . "." . $keyCode . "'))"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "if (\$this->user->authorise('" . $viewName . "." . $keyCode . "'))"; } else { - $buttons[] = "\t" . $tab . "\tif (\$this->canDo->get('" . $viewName . "." . $keyCode . "'))"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "if (\$this->canDo->get('" . $viewName . "." . $keyCode . "'))"; } - $buttons[] = "\t" . $tab . "\t{"; - $buttons[] = "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; - $buttons[] = "\t" . $tab . "\t\tJToolBarHelper::custom('" . $viewName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', false);"; - $buttons[] = "\t" . $tab . "\t}"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "{"; + $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; + $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "JToolBarHelper::custom('" . $viewName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', false);"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "}"; } // load the list button elseif (3 == $type && $custom_button['target'] != 1) @@ -3349,19 +3335,19 @@ 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 . "{"; - $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);"; - $this->onlyFunctionButton[$viewsName][] = "\t" . $tab . "}"; + $this->onlyFunctionButton[$viewsName][] = $this->_t(1) . $tab . "if (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; + $this->onlyFunctionButton[$viewsName][] = $this->_t(1) . $tab . "{"; + $this->onlyFunctionButton[$viewsName][] = $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; + $this->onlyFunctionButton[$viewsName][] = $this->_t(1) . $tab . $this->_t(1) . "JToolBarHelper::custom('" . $viewsName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', false);"; + $this->onlyFunctionButton[$viewsName][] = $this->_t(1) . $tab . "}"; } else { - $buttons[] = "\t" . $tab . "\tif (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->fileContentStatic['###component###'] . "'))"; - $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);"; - $buttons[] = "\t" . $tab . "\t}"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "if (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "{"; + $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; + $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "JToolBarHelper::custom('" . $viewsName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', false);"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "}"; } } } @@ -3372,14 +3358,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 +3373,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 @@ -3443,9 +3429,9 @@ class Interpretation extends Fields $view['settings']->css_document = (array) explode(PHP_EOL, $view['settings']->css_document); if (ComponentbuilderHelper::checkArray($view['settings']->css_document)) { - $script = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the Custom CSS script to view" . PHP_EOL . "\t\t" . '$this->document->addStyleDeclaration("'; - $cssDocument = PHP_EOL . "\t\t\t" . str_replace('"', '\"', implode(PHP_EOL . "\t\t\t", $view['settings']->css_document)); - return $script . $this->setPlaceholders($cssDocument, $this->placeholders) . PHP_EOL . "\t\t" . '");'; + $script = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set the Custom CSS script to view" . PHP_EOL . $this->_t(2) . '$this->document->addStyleDeclaration("'; + $cssDocument = PHP_EOL . $this->_t(3) . str_replace('"', '\"', implode(PHP_EOL . $this->_t(3), $view['settings']->css_document)); + return $script . $this->setPlaceholders($cssDocument, $this->placeholders) . PHP_EOL . $this->_t(2) . '");'; } } return ''; @@ -3460,21 +3446,21 @@ 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); + return PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add View JavaScript File" . PHP_EOL . $this->_t(2) . $this->setIncludeLibScript($path); } return ''; } @@ -3486,9 +3472,9 @@ class Interpretation extends Fields $view['settings']->js_document = (array) explode(PHP_EOL, $view['settings']->js_document); if (ComponentbuilderHelper::checkArray($view['settings']->js_document)) { - $script = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the Custom JS script to view" . PHP_EOL . "\t\t" . '$this->document->addScriptDeclaration("'; - $jsDocument = PHP_EOL . "\t\t\t" . str_replace('"', '\"', implode(PHP_EOL . "\t\t\t", $view['settings']->js_document)); - return $script . $this->setPlaceholders($jsDocument, $this->placeholders) . PHP_EOL . "\t\t" . '");'; + $script = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set the Custom JS script to view" . PHP_EOL . $this->_t(2) . '$this->document->addScriptDeclaration("'; + $jsDocument = PHP_EOL . $this->_t(3) . str_replace('"', '\"', implode(PHP_EOL . $this->_t(3), $view['settings']->js_document)); + return $script . $this->setPlaceholders($jsDocument, $this->placeholders) . PHP_EOL . $this->_t(2) . '");'; } } return ''; @@ -3547,50 +3533,50 @@ class Interpretation extends Fields public function setMetadataItem($item = 'item') { $meta = array(); - $meta[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " load the meta description"; - $meta[] = "\t\tif (isset(\$this->" . $item . "->metadesc) && \$this->" . $item . "->metadesc)"; - $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setDescription(\$this->" . $item . "->metadesc);"; - $meta[] = "\t\t}"; - $meta[] = "\t\telseif (\$this->params->get('menu-meta_description'))"; - $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; - $meta[] = "\t\t}"; - $meta[] = "\t\t//" . $this->setLine(__LINE__) . " load the key words if set"; - $meta[] = "\t\tif (isset(\$this->" . $item . "->metakey) && \$this->" . $item . "->metakey)"; - $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setMetadata('keywords', \$this->" . $item . "->metakey);"; - $meta[] = "\t\t}"; - $meta[] = "\t\telseif (\$this->params->get('menu-meta_keywords'))"; - $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; - $meta[] = "\t\t}"; - $meta[] = "\t\t//" . $this->setLine(__LINE__) . " check the robot params"; - $meta[] = "\t\tif (isset(\$this->" . $item . "->robots) && \$this->" . $item . "->robots)"; - $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setMetadata('robots', \$this->" . $item . "->robots);"; - $meta[] = "\t\t}"; - $meta[] = "\t\telseif (\$this->params->get('robots'))"; - $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setMetadata('robots', \$this->params->get('robots'));"; - $meta[] = "\t\t}"; - $meta[] = "\t\t//" . $this->setLine(__LINE__) . " check if autor is to be set"; - $meta[] = "\t\tif (isset(\$this->" . $item . "->created_by) && \$this->params->get('MetaAuthor') == '1')"; - $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setMetaData('author', \$this->" . $item . "->created_by);"; - $meta[] = "\t\t}"; - $meta[] = "\t\t//" . $this->setLine(__LINE__) . " check if metadata is available"; - $meta[] = "\t\tif (isset(\$this->" . $item . "->metadata) && \$this->" . $item . "->metadata)"; - $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$mdata = json_decode(\$this->" . $item . "->metadata,true);"; - $meta[] = "\t\t\tforeach (\$mdata as \$k => \$v)"; - $meta[] = "\t\t\t{"; - $meta[] = "\t\t\t\tif (\$v)"; - $meta[] = "\t\t\t\t{"; - $meta[] = "\t\t\t\t\t\$this->document->setMetadata(\$k, \$v);"; - $meta[] = "\t\t\t\t}"; - $meta[] = "\t\t\t}"; - $meta[] = "\t\t}"; + $meta[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the meta description"; + $meta[] = $this->_t(2) . "if (isset(\$this->" . $item . "->metadesc) && \$this->" . $item . "->metadesc)"; + $meta[] = $this->_t(2) . "{"; + $meta[] = $this->_t(3) . "\$this->document->setDescription(\$this->" . $item . "->metadesc);"; + $meta[] = $this->_t(2) . "}"; + $meta[] = $this->_t(2) . "elseif (\$this->params->get('menu-meta_description'))"; + $meta[] = $this->_t(2) . "{"; + $meta[] = $this->_t(3) . "\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; + $meta[] = $this->_t(2) . "}"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the key words if set"; + $meta[] = $this->_t(2) . "if (isset(\$this->" . $item . "->metakey) && \$this->" . $item . "->metakey)"; + $meta[] = $this->_t(2) . "{"; + $meta[] = $this->_t(3) . "\$this->document->setMetadata('keywords', \$this->" . $item . "->metakey);"; + $meta[] = $this->_t(2) . "}"; + $meta[] = $this->_t(2) . "elseif (\$this->params->get('menu-meta_keywords'))"; + $meta[] = $this->_t(2) . "{"; + $meta[] = $this->_t(3) . "\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; + $meta[] = $this->_t(2) . "}"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check the robot params"; + $meta[] = $this->_t(2) . "if (isset(\$this->" . $item . "->robots) && \$this->" . $item . "->robots)"; + $meta[] = $this->_t(2) . "{"; + $meta[] = $this->_t(3) . "\$this->document->setMetadata('robots', \$this->" . $item . "->robots);"; + $meta[] = $this->_t(2) . "}"; + $meta[] = $this->_t(2) . "elseif (\$this->params->get('robots'))"; + $meta[] = $this->_t(2) . "{"; + $meta[] = $this->_t(3) . "\$this->document->setMetadata('robots', \$this->params->get('robots'));"; + $meta[] = $this->_t(2) . "}"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if autor is to be set"; + $meta[] = $this->_t(2) . "if (isset(\$this->" . $item . "->created_by) && \$this->params->get('MetaAuthor') == '1')"; + $meta[] = $this->_t(2) . "{"; + $meta[] = $this->_t(3) . "\$this->document->setMetaData('author', \$this->" . $item . "->created_by);"; + $meta[] = $this->_t(2) . "}"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if metadata is available"; + $meta[] = $this->_t(2) . "if (isset(\$this->" . $item . "->metadata) && \$this->" . $item . "->metadata)"; + $meta[] = $this->_t(2) . "{"; + $meta[] = $this->_t(3) . "\$mdata = json_decode(\$this->" . $item . "->metadata,true);"; + $meta[] = $this->_t(3) . "foreach (\$mdata as \$k => \$v)"; + $meta[] = $this->_t(3) . "{"; + $meta[] = $this->_t(4) . "if (\$v)"; + $meta[] = $this->_t(4) . "{"; + $meta[] = $this->_t(5) . "\$this->document->setMetadata(\$k, \$v);"; + $meta[] = $this->_t(4) . "}"; + $meta[] = $this->_t(3) . "}"; + $meta[] = $this->_t(2) . "}"; return implode(PHP_EOL, $meta); } @@ -3598,21 +3584,21 @@ class Interpretation extends Fields public function setMetadataList() { $meta = array(); - $meta[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " load the meta description"; - $meta[] = "\t\tif (\$this->params->get('menu-meta_description'))"; - $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; - $meta[] = "\t\t}"; - $meta[] = "\t\t//" . $this->setLine(__LINE__) . " load the key words if set"; - $meta[] = "\t\tif (\$this->params->get('menu-meta_keywords'))"; - $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; - $meta[] = "\t\t}"; - $meta[] = "\t\t//" . $this->setLine(__LINE__) . " check the robot params"; - $meta[] = "\t\tif (\$this->params->get('robots'))"; - $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setMetadata('robots', \$this->params->get('robots'));"; - $meta[] = "\t\t}"; + $meta[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the meta description"; + $meta[] = $this->_t(2) . "if (\$this->params->get('menu-meta_description'))"; + $meta[] = $this->_t(2) . "{"; + $meta[] = $this->_t(3) . "\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; + $meta[] = $this->_t(2) . "}"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the key words if set"; + $meta[] = $this->_t(2) . "if (\$this->params->get('menu-meta_keywords'))"; + $meta[] = $this->_t(2) . "{"; + $meta[] = $this->_t(3) . "\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; + $meta[] = $this->_t(2) . "}"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check the robot params"; + $meta[] = $this->_t(2) . "if (\$this->params->get('robots'))"; + $meta[] = $this->_t(2) . "{"; + $meta[] = $this->_t(3) . "\$this->document->setMetadata('robots', \$this->params->get('robots'));"; + $meta[] = $this->_t(2) . "}"; return implode(PHP_EOL, $meta); } @@ -3622,12 +3608,12 @@ class Interpretation extends Fields if (isset($this->googleChart[$this->target][$view['settings']->code]) && $this->googleChart[$this->target][$view['settings']->code]) { $chart = array(); - $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[] = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " add the google chart builder class."; + $chart[] = $this->_t(2) . "require_once JPATH_COMPONENT_ADMINISTRATOR.'/helpers/chartbuilder.php';"; + $chart[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the google chart js."; + $chart[] = $this->_t(2) . "\$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[] = $this->_t(2) . "\$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[] = $this->_t(2) . "\$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 ''; @@ -3638,19 +3624,19 @@ class Interpretation extends Fields // reset bucket $setter = ''; // allways load these in - $setter .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " always make sure jquery is loaded."; - $setter .= PHP_EOL . "\t\tJHtml::_('jquery.framework');"; - $setter .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Load the header checker class."; + $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " always make sure jquery is loaded."; + $setter .= PHP_EOL . $this->_t(2) . "JHtml::_('jquery.framework');"; + $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load the header checker class."; if ($this->target === 'site') { - $setter .= PHP_EOL . "\t\trequire_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' );"; + $setter .= PHP_EOL . $this->_t(2) . "require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' );"; } else { - $setter .= PHP_EOL . "\t\trequire_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );"; + $setter .= PHP_EOL . $this->_t(2) . "require_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 . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Initialize the header checker."; + $setter .= PHP_EOL . $this->_t(2) . "\$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])) { @@ -3801,7 +3787,7 @@ class Interpretation extends Fields // if there was any code added to document then set globaly if ($buildDoc && ComponentbuilderHelper::checkArray($scripts)) { - $this->libraries[$id]->document = "\t\t//" . $this->setLine(__LINE__) . " always load these files." . PHP_EOL . "\t\t" . implode(PHP_EOL . "\t\t", $scripts); + $this->libraries[$id]->document = $this->_t(2) . "//" . $this->setLine(__LINE__) . " always load these files." . PHP_EOL . $this->_t(2) . implode(PHP_EOL . $this->_t(2), $scripts); // success return true; } @@ -3831,11 +3817,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 +3838,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; } @@ -3872,149 +3858,149 @@ class Interpretation extends Fields // load the defaults needed if ($this->uikit > 0) { - $setter .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Load uikit options."; - $setter .= PHP_EOL . "\t\t\$uikit = \$this->params->get('uikit_load');"; - $setter .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set script size."; - $setter .= PHP_EOL . "\t\t\$size = \$this->params->get('uikit_min');"; + $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load uikit options."; + $setter .= PHP_EOL . $this->_t(2) . "\$uikit = \$this->params->get('uikit_load');"; + $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set script size."; + $setter .= PHP_EOL . $this->_t(2) . "\$size = \$this->params->get('uikit_min');"; $tabV = ""; // if both versions should be loaded then add some more logic if (2 == $this->uikit) { - $setter .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Load uikit version."; - $setter .= PHP_EOL . "\t\t\$uikitVersion = \$this->params->get('uikit_version', 2);"; - $setter .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Use Uikit Version 2"; - $setter .= PHP_EOL . "\t\tif (2 == \$uikitVersion)"; - $setter .= PHP_EOL . "\t\t{"; - $tabV = "\t"; + $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load uikit version."; + $setter .= PHP_EOL . $this->_t(2) . "\$uikitVersion = \$this->params->get('uikit_version', 2);"; + $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Use Uikit Version 2"; + $setter .= PHP_EOL . $this->_t(2) . "if (2 == \$uikitVersion)"; + $setter .= PHP_EOL . $this->_t(2) . "{"; + $tabV = $this->_t(1); } } // load the defaults needed if (2 == $this->uikit || 1 == $this->uikit) { - $setter .= PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " Set css style."; - $setter .= PHP_EOL . $tabV . "\t\t\$style = \$this->params->get('uikit_style');"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set css style."; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "\$style = \$this->params->get('uikit_style');"; - $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}"; - $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}"; + $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The uikit css."; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "if ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$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 . $this->_t(2) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The uikit js."; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "if ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$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 . $this->_t(2) . "}"; } // load the components need if ((2 == $this->uikit || 1 == $this->uikit) && isset($this->uikitComp[$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->uikitComp[$view['settings']->code])) { - $setter .= PHP_EOL . PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " Load the script to find all uikit components needed."; - $setter .= PHP_EOL . $tabV . "\t\tif (\$uikit != 2)"; - $setter .= PHP_EOL . $tabV . "\t\t{"; - $setter .= PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " Set the default uikit components in this view."; - $setter .= PHP_EOL . $tabV . "\t\t\t\$uikitComp = array();"; + $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load the script to find all uikit components needed."; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "if (\$uikit != 2)"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set the default uikit components in this view."; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$uikitComp = array();"; foreach ($this->uikitComp[$view['settings']->code] as $class) { - $setter .= PHP_EOL . $tabV . "\t\t\t\$uikitComp[] = '" . $class . "';"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$uikitComp[] = '" . $class . "';"; } // check content for more needed components if (isset($this->siteFieldData['uikit'][$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->siteFieldData['uikit'][$view['settings']->code])) { - $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\t{"; - $setter .= PHP_EOL . $tabV . "\t\t\t\tif (isset(\$uikitComp) && " . $this->fileContentStatic['###Component###'] . "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);"; - $setter .= PHP_EOL . $tabV . "\t\t\t\t}"; - $setter .= PHP_EOL . $tabV . "\t\t\t\telse"; - $setter .= PHP_EOL . $tabV . "\t\t\t\t{"; - $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\$uikitComp = \$uikitFieldComp;"; - $setter .= PHP_EOL . $tabV . "\t\t\t\t}"; - $setter .= PHP_EOL . $tabV . "\t\t\t}"; + $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get field uikit components needed in this view."; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$uikitFieldComp = \$this->get('UikitComp');"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "if (isset(\$uikitFieldComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitFieldComp))"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "if (isset(\$uikitComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "\$uikitComp = array_merge(\$uikitComp, \$uikitFieldComp);"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "\$uikitComp = array_unique(\$uikitComp);"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "else"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "\$uikitComp = \$uikitFieldComp;"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "}"; } - $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\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\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\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}"; - $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\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}"; - $setter .= PHP_EOL . $tabV . "\t\t\t\t}"; - $setter .= PHP_EOL . $tabV . "\t\t\t}"; - $setter .= PHP_EOL . $tabV . "\t\t}"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; + $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load the needed uikit components in this view."; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "if (\$uikit != 2 && isset(\$uikitComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " load just in case."; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "jimport('joomla.filesystem.file');"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " loading..."; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "foreach (\$uikitComp as \$class)"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "foreach (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::\$uk_components[\$class] as \$name)"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine(__LINE__) . " check if the CSS file exists."; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (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 . $this->_t(5) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine(__LINE__) . " load the css."; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "\$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 . $this->_t(5) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine(__LINE__) . " check if the JavaScript file exists."; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine(__LINE__) . " load the js."; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "\$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 . $this->_t(5) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; } elseif ((2 == $this->uikit || 1 == $this->uikit) && isset($this->siteFieldData['uikit'][$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->siteFieldData['uikit'][$view['settings']->code])) { - $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\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\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\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}"; - $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\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}"; - $setter .= PHP_EOL . $tabV . "\t\t\t\t}"; - $setter .= PHP_EOL . $tabV . "\t\t\t}"; - $setter .= PHP_EOL . $tabV . "\t\t}"; + $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load the needed uikit components in this view."; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "\$uikitComp = \$this->get('UikitComp');"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "if (\$uikit != 2 && isset(\$uikitComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " load just in case."; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "jimport('joomla.filesystem.file');"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " loading..."; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "foreach (\$uikitComp as \$class)"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "foreach (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::\$uk_components[\$class] as \$name)"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine(__LINE__) . " check if the CSS file exists."; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (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 . $this->_t(5) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine(__LINE__) . " load the css."; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "\$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 . $this->_t(5) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine(__LINE__) . " check if the JavaScript file exists."; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine(__LINE__) . " load the js."; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "\$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 . $this->_t(5) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; } - // now set the version 3 + // now set the version 3 if (2 == $this->uikit || 3 == $this->uikit) { if (2 == $this->uikit) { - $setter .= PHP_EOL . "\t\t}"; - $setter .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Use Uikit Version 3"; - $setter .= PHP_EOL . "\t\telseif (3 == \$uikitVersion)"; - $setter .= PHP_EOL . "\t\t{"; + $setter .= PHP_EOL . $this->_t(2) . "}"; + $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Use Uikit Version 3"; + $setter .= PHP_EOL . $this->_t(2) . "elseif (3 == \$uikitVersion)"; + $setter .= PHP_EOL . $this->_t(2) . "{"; } // add version 3 fiels to page - $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}"; - $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}"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The uikit css."; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "if ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$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 . $this->_t(2) . "}"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The uikit js."; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "if ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$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 . $this->_t(2) . "}"; if (2 == $this->uikit) { - $setter .= PHP_EOL . "\t\t}"; + $setter .= PHP_EOL . $this->_t(2) . "}"; } } return $setter; @@ -4038,27 +4024,27 @@ 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): ?>'; $body[] = '
    '; - $body[] = "\t" . ''; $body[] = '
    '; $body[] = ''; @@ -4081,16 +4067,16 @@ class Interpretation extends Fields { $script = array(); $script[] = PHP_EOL . ""; return implode(PHP_EOL, $script); @@ -4123,14 +4109,14 @@ class Interpretation extends Fields { // build the file $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, 'template', $template, $config); // set the file data $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); - // ###SITE_TEMPLATE_BODY### <<>> - $this->fileContentDynamic[$view['settings']->code . '_' . $template]['###' . $TARGET . '_TEMPLATE_BODY###'] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders); - // ###SITE_TEMPLATE_CODE_BODY### <<>> - $this->fileContentDynamic[$view['settings']->code . '_' . $template]['###' . $TARGET . '_TEMPLATE_CODE_BODY###'] = $this->setCustomViewTemplateCode($data['php_view']); + // SITE_TEMPLATE_BODY <<>> + $this->fileContentDynamic[$view['settings']->code . '_' . $template][$this->hhh . $TARGET . '_TEMPLATE_BODY' . $this->hhh] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders); + // SITE_TEMPLATE_CODE_BODY <<>> + $this->fileContentDynamic[$view['settings']->code . '_' . $template][$this->hhh . $TARGET . '_TEMPLATE_CODE_BODY' . $this->hhh] = $this->setCustomViewTemplateCode($data['php_view']); } } } @@ -4160,19 +4146,19 @@ class Interpretation extends Fields $this->buildDynamique($target, 'layout'); // set the file data $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); - // ###SITE_LAYOUT_CODE### <<>> + // SITE_LAYOUT_CODE <<>> $php_view = (array) explode(PHP_EOL, $data['php_view']); if (ComponentbuilderHelper::checkArray($php_view)) { $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); - $this->fileContentDynamic[$layout]['###' . $TARGET . '_LAYOUT_CODE###'] = $this->setPlaceholders($php_view, $this->placeholders); + $this->fileContentDynamic[$layout][$this->hhh . $TARGET . '_LAYOUT_CODE' . $this->hhh] = $this->setPlaceholders($php_view, $this->placeholders); } else { - $this->fileContentDynamic[$layout]['###' . $TARGET . '_LAYOUT_CODE###'] = ''; + $this->fileContentDynamic[$layout][$this->hhh . $TARGET . '_LAYOUT_CODE' . $this->hhh] = ''; } - // ###SITE_LAYOUT_BODY### <<>> - $this->fileContentDynamic[$layout]['###' . $TARGET . '_LAYOUT_BODY###'] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders); + // SITE_LAYOUT_BODY <<>> + $this->fileContentDynamic[$layout][$this->hhh . $TARGET . '_LAYOUT_BODY' . $this->hhh] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders); } } } @@ -4217,12 +4203,12 @@ class Interpretation extends Fields if ($type !== 'static') { //var_dump($replacment); echo PHP_EOL; - $echos[$replacment] = "###" . $replacment . "###
    "; + $echos[$replacment] = "#" . "#" . "#" . $replacment . "#" . "#" . "#
    "; } elseif ($type === 'static') { //var_dump($replacment); echo PHP_EOL; - $echos[$replacment] = "###" . $replacment . "###
    "; + $echos[$replacment] = "#" . "#" . "#" . $replacment . "#" . "#" . "#
    "; } } } @@ -4238,17 +4224,17 @@ class Interpretation extends Fields { $script = ''; // get the component name - $Component = $this->fileContentStatic['###Component###']; + $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; // go from base64 to string if (isset($this->base64Builder[$view]) && ComponentbuilderHelper::checkArray($this->base64Builder[$view])) { foreach ($this->base64Builder[$view] as $baseString) { - $script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $baseString . "))"; // TODO && base64_encode(base64_decode(\$item->".$baseString.", true)) === \$item->".$baseString.")"; - $script .= PHP_EOL . "\t\t\t{"; - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " base64 Decode " . $baseString . "."; - $script .= PHP_EOL . "\t\t\t\t\$item->" . $baseString . " = base64_decode(\$item->" . $baseString . ");"; - $script .= PHP_EOL . "\t\t\t}"; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "if (!empty(\$item->" . $baseString . "))"; // TODO && base64_encode(base64_decode(\$item->".$baseString.", true)) === \$item->".$baseString.")"; + $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " base64 Decode " . $baseString . "."; + $script .= PHP_EOL . $this->_t(4) . "\$item->" . $baseString . " = base64_decode(\$item->" . $baseString . ");"; + $script .= PHP_EOL . $this->_t(3) . "}"; } } // decryption @@ -4256,17 +4242,17 @@ class Interpretation extends Fields { if (isset($this->{$cryptionType . 'EncryptionBuilder'}[$view]) && ComponentbuilderHelper::checkArray($this->{$cryptionType . 'EncryptionBuilder'}[$view])) { - $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . "\t\t\t\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the encryption object."; - $script .= PHP_EOL . "\t\t\t\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; + $script .= PHP_EOL . $this->_t(3) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . $this->_t(3) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; foreach ($this->{$cryptionType . 'EncryptionBuilder'}[$view] as $baseString) { - $script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $baseString . ") && \$" . $cryptionType . "key && !is_numeric(\$item->" . $baseString . ") && \$item->" . $baseString . " === base64_encode(base64_decode(\$item->" . $baseString . ", true)))"; - $script .= PHP_EOL . "\t\t\t{"; - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " " . $cryptionType . " decrypt data " . $baseString . "."; - $script .= PHP_EOL . "\t\t\t\t\$item->" . $baseString . " = rtrim(\$" . $cryptionType . "->decryptString(\$item->" . $baseString . "), " . '"\0"' . ");"; - $script .= PHP_EOL . "\t\t\t}"; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "if (!empty(\$item->" . $baseString . ") && \$" . $cryptionType . "key && !is_numeric(\$item->" . $baseString . ") && \$item->" . $baseString . " === base64_encode(base64_decode(\$item->" . $baseString . ", true)))"; + $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " " . $cryptionType . " decrypt data " . $baseString . "."; + $script .= PHP_EOL . $this->_t(4) . "\$item->" . $baseString . " = rtrim(\$" . $cryptionType . "->decryptString(\$item->" . $baseString . "), " . '"\0"' . ");"; + $script .= PHP_EOL . $this->_t(3) . "}"; } } } @@ -4275,13 +4261,13 @@ class Interpretation extends Fields { foreach ($this->jsonItemBuilder[$view] as $jsonItem) { - $script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $jsonItem . "))"; - $script .= PHP_EOL . "\t\t\t{"; - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Convert the " . $jsonItem . " field to an array."; - $script .= PHP_EOL . "\t\t\t\t\$" . $jsonItem . " = new Registry;"; - $script .= PHP_EOL . "\t\t\t\t\$" . $jsonItem . "->loadString(\$item->" . $jsonItem . ");"; - $script .= PHP_EOL . "\t\t\t\t\$item->" . $jsonItem . " = \$" . $jsonItem . "->toArray();"; - $script .= PHP_EOL . "\t\t\t}"; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "if (!empty(\$item->" . $jsonItem . "))"; + $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Convert the " . $jsonItem . " field to an array."; + $script .= PHP_EOL . $this->_t(4) . "\$" . $jsonItem . " = new Registry;"; + $script .= PHP_EOL . $this->_t(4) . "\$" . $jsonItem . "->loadString(\$item->" . $jsonItem . ");"; + $script .= PHP_EOL . $this->_t(4) . "\$item->" . $jsonItem . " = \$" . $jsonItem . "->toArray();"; + $script .= PHP_EOL . $this->_t(3) . "}"; } } // go from json to string @@ -4290,9 +4276,9 @@ class Interpretation extends Fields $makeArray = ''; foreach ($this->jsonStringBuilder[$view] as $jsonString) { - $script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $jsonString . "))"; - $script .= PHP_EOL . "\t\t\t{"; - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " JSON Decode " . $jsonString . "."; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "if (!empty(\$item->" . $jsonString . "))"; + $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " JSON Decode " . $jsonString . "."; if (isset($this->jsonItemBuilderArray[$view]) && ComponentbuilderHelper::checkArray($this->jsonItemBuilderArray[$view]) && in_array($jsonString, $this->jsonItemBuilderArray[$view])) { $makeArray = ',true'; @@ -4301,8 +4287,8 @@ class Interpretation extends Fields { $makeArray = ',true'; } - $script .= PHP_EOL . "\t\t\t\t\$item->" . $jsonString . " = json_decode(\$item->" . $jsonString . $makeArray . ");"; - $script .= PHP_EOL . "\t\t\t}"; + $script .= PHP_EOL . $this->_t(4) . "\$item->" . $jsonString . " = json_decode(\$item->" . $jsonString . $makeArray . ");"; + $script .= PHP_EOL . $this->_t(3) . "}"; } } @@ -4319,11 +4305,11 @@ class Interpretation extends Fields { foreach ($this->checkboxBuilder[$view] as $checkbox) { - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the empty " . $checkbox . " item to data"; - $script .= PHP_EOL . "\t\tif (!isset(\$data['" . $checkbox . "']))"; - $script .= PHP_EOL . "\t\t{"; - $script .= PHP_EOL . "\t\t\t\$data['" . $checkbox . "'] = '';"; - $script .= PHP_EOL . "\t\t}"; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set the empty " . $checkbox . " item to data"; + $script .= PHP_EOL . $this->_t(2) . "if (!isset(\$data['" . $checkbox . "']))"; + $script .= PHP_EOL . $this->_t(2) . "{"; + $script .= PHP_EOL . $this->_t(3) . "\$data['" . $checkbox . "'] = '';"; + $script .= PHP_EOL . $this->_t(2) . "}"; } } return $script; @@ -4339,18 +4325,18 @@ class Interpretation extends Fields { foreach ($this->jsonItemBuilder[$view] as $jsonItem) { - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the " . $jsonItem . " items to data."; - $script .= PHP_EOL . "\t\tif (isset(\$data['" . $jsonItem . "']) && is_array(\$data['" . $jsonItem . "']))"; - $script .= PHP_EOL . "\t\t{"; - $script .= PHP_EOL . "\t\t\t\$" . $jsonItem . " = new JRegistry;"; - $script .= PHP_EOL . "\t\t\t\$" . $jsonItem . "->loadArray(\$data['" . $jsonItem . "']);"; - $script .= PHP_EOL . "\t\t\t\$data['" . $jsonItem . "'] = (string) \$" . $jsonItem . ";"; - $script .= PHP_EOL . "\t\t}"; - $script .= PHP_EOL . "\t\telseif (!isset(\$data['" . $jsonItem . "']))"; - $script .= PHP_EOL . "\t\t{"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Set the empty " . $jsonItem . " to data"; - $script .= PHP_EOL . "\t\t\t\$data['" . $jsonItem . "'] = '';"; - $script .= PHP_EOL . "\t\t}"; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set the " . $jsonItem . " items to data."; + $script .= PHP_EOL . $this->_t(2) . "if (isset(\$data['" . $jsonItem . "']) && is_array(\$data['" . $jsonItem . "']))"; + $script .= PHP_EOL . $this->_t(2) . "{"; + $script .= PHP_EOL . $this->_t(3) . "\$" . $jsonItem . " = new JRegistry;"; + $script .= PHP_EOL . $this->_t(3) . "\$" . $jsonItem . "->loadArray(\$data['" . $jsonItem . "']);"; + $script .= PHP_EOL . $this->_t(3) . "\$data['" . $jsonItem . "'] = (string) \$" . $jsonItem . ";"; + $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . $this->_t(2) . "elseif (!isset(\$data['" . $jsonItem . "']))"; + $script .= PHP_EOL . $this->_t(2) . "{"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set the empty " . $jsonItem . " to data"; + $script .= PHP_EOL . $this->_t(3) . "\$data['" . $jsonItem . "'] = '';"; + $script .= PHP_EOL . $this->_t(2) . "}"; } } // turn string into json string @@ -4358,11 +4344,11 @@ class Interpretation extends Fields { foreach ($this->jsonStringBuilder[$view] as $jsonString) { - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the " . $jsonString . " string to JSON string."; - $script .= PHP_EOL . "\t\tif (isset(\$data['" . $jsonString . "']))"; - $script .= PHP_EOL . "\t\t{"; - $script .= PHP_EOL . "\t\t\t\$data['" . $jsonString . "'] = (string) json_encode(\$data['" . $jsonString . "']);"; - $script .= PHP_EOL . "\t\t}"; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set the " . $jsonString . " string to JSON string."; + $script .= PHP_EOL . $this->_t(2) . "if (isset(\$data['" . $jsonString . "']))"; + $script .= PHP_EOL . $this->_t(2) . "{"; + $script .= PHP_EOL . $this->_t(3) . "\$data['" . $jsonString . "'] = (string) json_encode(\$data['" . $jsonString . "']);"; + $script .= PHP_EOL . $this->_t(2) . "}"; } } // turn string into base 64 string @@ -4370,30 +4356,30 @@ class Interpretation extends Fields { foreach ($this->base64Builder[$view] as $baseString) { - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the " . $baseString . " string to base64 string."; - $script .= PHP_EOL . "\t\tif (isset(\$data['" . $baseString . "']))"; - $script .= PHP_EOL . "\t\t{"; - $script .= PHP_EOL . "\t\t\t\$data['" . $baseString . "'] = base64_encode(\$data['" . $baseString . "']);"; - $script .= PHP_EOL . "\t\t}"; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set the " . $baseString . " string to base64 string."; + $script .= PHP_EOL . $this->_t(2) . "if (isset(\$data['" . $baseString . "']))"; + $script .= PHP_EOL . $this->_t(2) . "{"; + $script .= PHP_EOL . $this->_t(3) . "\$data['" . $baseString . "'] = base64_encode(\$data['" . $baseString . "']);"; + $script .= PHP_EOL . $this->_t(2) . "}"; } } // turn string into encrypted string - $Component = $this->fileContentStatic['###Component###']; + $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; foreach ($this->cryptionTypes as $cryptionType) { if (isset($this->{$cryptionType . 'EncryptionBuilder'}[$view]) && ComponentbuilderHelper::checkArray($this->{$cryptionType . 'EncryptionBuilder'}[$view])) { - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption key."; - $script .= PHP_EOL . "\t\t\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the encryption object"; - $script .= PHP_EOL . "\t\t\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption key."; + $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the encryption object"; + $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; foreach ($this->{$cryptionType . 'EncryptionBuilder'}[$view] as $baseString) { - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Encrypt data " . $baseString . "."; - $script .= PHP_EOL . "\t\tif (isset(\$data['" . $baseString . "']) && \$" . $cryptionType . "key)"; - $script .= PHP_EOL . "\t\t{"; - $script .= PHP_EOL . "\t\t\t\$data['" . $baseString . "'] = \$" . $cryptionType . "->encryptString(\$data['" . $baseString . "']);"; - $script .= PHP_EOL . "\t\t}"; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Encrypt data " . $baseString . "."; + $script .= PHP_EOL . $this->_t(2) . "if (isset(\$data['" . $baseString . "']) && \$" . $cryptionType . "key)"; + $script .= PHP_EOL . $this->_t(2) . "{"; + $script .= PHP_EOL . $this->_t(3) . "\$data['" . $baseString . "'] = \$" . $cryptionType . "->encryptString(\$data['" . $baseString . "']);"; + $script .= PHP_EOL . $this->_t(2) . "}"; } } } @@ -4407,18 +4393,18 @@ class Interpretation extends Fields // reset $oserver = ""; // set component name - $component = $this->fileContentStatic['###component###']; + $component = $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]; // add the tags observer if (isset($this->tagsBuilder[$view]) && ComponentbuilderHelper::checkString($this->tagsBuilder[$view])) { - $oserver .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Adding Tag Options"; - $oserver .= PHP_EOL . "\t\tJTableObserverTags::createObserver(\$this, array('typeAlias' => 'com_" . $component . "." . $view . "'));"; + $oserver .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Adding Tag Options"; + $oserver .= PHP_EOL . $this->_t(2) . "JTableObserverTags::createObserver(\$this, array('typeAlias' => 'com_" . $component . "." . $view . "'));"; } // add the history/version observer if (isset($this->historyBuilder[$view]) && ComponentbuilderHelper::checkString($this->historyBuilder[$view])) { - $oserver .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Adding History Options"; - $oserver .= PHP_EOL . "\t\tJTableObserverContenthistory::createObserver(\$this, array('typeAlias' => 'com_" . $component . "." . $view . "'));"; + $oserver .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Adding History Options"; + $oserver .= PHP_EOL . $this->_t(2) . "JTableObserverContenthistory::createObserver(\$this, array('typeAlias' => 'com_" . $component . "." . $view . "'));"; } return $oserver; } @@ -4440,7 +4426,7 @@ class Interpretation extends Fields if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) { // set component name - $component = $this->fileContentStatic['###component###']; + $component = $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]; // reset $dbStuff = array(); // start loading the content type data @@ -4470,48 +4456,48 @@ class Interpretation extends Fields $taabb = ''; if ($action === 'update') { - $taabb = "\t"; + $taabb = $this->_t(1); } - $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get The Database object"; - $script .= PHP_EOL . "\t\t\t\$db = JFactory::getDbo();"; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get The Database object"; + $script .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDbo();"; foreach ($dbStuff as $name => $tables) { if (ComponentbuilderHelper::checkArray($tables)) { $code = ComponentbuilderHelper::safeString($name); - $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Create the " . $name . " content type object."; - $script .= PHP_EOL . "\t\t\t\$" . $code . " = new stdClass();"; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create the " . $name . " content type object."; + $script .= PHP_EOL . $this->_t(3) . "\$" . $code . " = new stdClass();"; foreach ($tables as $table => $data) { - $script .= PHP_EOL . "\t\t\t\$" . $code . "->" . $table . " = '" . $data . "';"; + $script .= PHP_EOL . $this->_t(3) . "\$" . $code . "->" . $table . " = '" . $data . "';"; } if ($action === 'update') { // we first load script to check if data exist - $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check if " . $name . " type is already in content_type DB."; - $script .= PHP_EOL . "\t\t\t\$" . $code . "_id = null;"; - $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . "\t\t\t\$query->select(\$db->quoteName(array('type_id')));"; - $script .= PHP_EOL . "\t\t\t\$query->from(\$db->quoteName('#__content_types'));"; - $script .= PHP_EOL . "\t\t\t\$query->where(\$db->quoteName('type_alias') . ' LIKE '. \$db->quote($" . $code . "->type_alias));"; - $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL . "\t\t\t\$db->execute();"; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Check if " . $name . " type is already in content_type DB."; + $script .= PHP_EOL . $this->_t(3) . "\$" . $code . "_id = null;"; + $script .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . $this->_t(3) . "\$query->select(\$db->quoteName(array('type_id')));"; + $script .= PHP_EOL . $this->_t(3) . "\$query->from(\$db->quoteName('#__content_types'));"; + $script .= PHP_EOL . $this->_t(3) . "\$query->where(\$db->quoteName('type_alias') . ' LIKE '. \$db->quote($" . $code . "->type_alias));"; + $script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . $this->_t(3) . "\$db->execute();"; } - $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Set the object into the content types table."; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set the object into the content types table."; if ($action === 'update') { - $script .= PHP_EOL . "\t\t\tif (\$db->getNumRows())"; - $script .= PHP_EOL . "\t\t\t{"; - $script .= PHP_EOL . "\t\t\t\t\$" . $code . "->type_id = \$db->loadResult();"; - $script .= PHP_EOL . "\t\t\t\t\$" . $code . "_Updated = \$db->updateObject('#__content_types', \$" . $code . ", 'type_id');"; - $script .= PHP_EOL . "\t\t\t}"; - $script .= PHP_EOL . "\t\t\telse"; - $script .= PHP_EOL . "\t\t\t{"; + $script .= PHP_EOL . $this->_t(3) . "if (\$db->getNumRows())"; + $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . $this->_t(4) . "\$" . $code . "->type_id = \$db->loadResult();"; + $script .= PHP_EOL . $this->_t(4) . "\$" . $code . "_Updated = \$db->updateObject('#__content_types', \$" . $code . ", 'type_id');"; + $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . $this->_t(3) . "else"; + $script .= PHP_EOL . $this->_t(3) . "{"; } - $script .= PHP_EOL . "\t\t\t" . $taabb . "\$" . $code . "_Inserted = \$db->insertObject('#__content_types', \$" . $code . ");"; + $script .= PHP_EOL . $this->_t(3) . $taabb . "\$" . $code . "_Inserted = \$db->insertObject('#__content_types', \$" . $code . ");"; if ($action === 'update') { - $script .= PHP_EOL . "\t\t\t}"; + $script .= PHP_EOL . $this->_t(3) . "}"; } } } @@ -4527,70 +4513,70 @@ class Interpretation extends Fields $script = $this->setComponentToContentTypes('install'); // set the component name - $component = $this->fileContentStatic['###component###']; + $component = $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]; // add the assets table update for permissions rules if (isset($this->assetsRules) && ComponentbuilderHelper::checkArray($this->assetsRules)) { if (ComponentbuilderHelper::checkString($script)) { - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Install the global extenstion assets permission."; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Install the global extenstion assets permission."; } else { - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Install the global extenstion assets permission."; - $script .= PHP_EOL . "\t\t\t\$db = JFactory::getDbo();"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Install the global extenstion assets permission."; + $script .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDbo();"; } - $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Field to update."; - $script .= PHP_EOL . "\t\t\t\$fields = array("; - $script .= PHP_EOL . "\t\t\t\t\$db->quoteName('rules') . ' = ' . \$db->quote('{" . implode(',', $this->assetsRules) . "}'),"; - $script .= PHP_EOL . "\t\t\t);"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Condition."; - $script .= PHP_EOL . "\t\t\t\$conditions = array("; - $script .= PHP_EOL . "\t\t\t\t\$db->quoteName('name') . ' = ' . \$db->quote('com_" . $component . "')"; - $script .= PHP_EOL . "\t\t\t);"; - $script .= PHP_EOL . "\t\t\t\$query->update(\$db->quoteName('#__assets'))->set(\$fields)->where(\$conditions);"; - $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL . "\t\t\t\$allDone = \$db->execute();" . PHP_EOL; + $script .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Field to update."; + $script .= PHP_EOL . $this->_t(3) . "\$fields = array("; + $script .= PHP_EOL . $this->_t(4) . "\$db->quoteName('rules') . ' = ' . \$db->quote('{" . implode(',', $this->assetsRules) . "}'),"; + $script .= PHP_EOL . $this->_t(3) . ");"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Condition."; + $script .= PHP_EOL . $this->_t(3) . "\$conditions = array("; + $script .= PHP_EOL . $this->_t(4) . "\$db->quoteName('name') . ' = ' . \$db->quote('com_" . $component . "')"; + $script .= PHP_EOL . $this->_t(3) . ");"; + $script .= PHP_EOL . $this->_t(3) . "\$query->update(\$db->quoteName('#__assets'))->set(\$fields)->where(\$conditions);"; + $script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . $this->_t(3) . "\$allDone = \$db->execute();" . PHP_EOL; } // add the global params for the component global settings if (isset($this->extensionsParams) && ComponentbuilderHelper::checkArray($this->extensionsParams)) { if (ComponentbuilderHelper::checkString($script)) { - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Install the global extenstion params."; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Install the global extenstion params."; } else { - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Install the global extenstion params."; - $script .= PHP_EOL . "\t\t\t\$db = JFactory::getDbo();"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Install the global extenstion params."; + $script .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDbo();"; } - $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Field to update."; - $script .= PHP_EOL . "\t\t\t\$fields = array("; - $script .= PHP_EOL . "\t\t\t\t\$db->quoteName('params') . ' = ' . \$db->quote('{" . implode(',', $this->extensionsParams) . "}'),"; - $script .= PHP_EOL . "\t\t\t);"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Condition."; - $script .= PHP_EOL . "\t\t\t\$conditions = array("; - $script .= PHP_EOL . "\t\t\t\t\$db->quoteName('element') . ' = ' . \$db->quote('com_" . $component . "')"; - $script .= PHP_EOL . "\t\t\t);"; - $script .= PHP_EOL . "\t\t\t\$query->update(\$db->quoteName('#__extensions'))->set(\$fields)->where(\$conditions);"; - $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL . "\t\t\t\$allDone = \$db->execute();" . PHP_EOL; + $script .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Field to update."; + $script .= PHP_EOL . $this->_t(3) . "\$fields = array("; + $script .= PHP_EOL . $this->_t(4) . "\$db->quoteName('params') . ' = ' . \$db->quote('{" . implode(',', $this->extensionsParams) . "}'),"; + $script .= PHP_EOL . $this->_t(3) . ");"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Condition."; + $script .= PHP_EOL . $this->_t(3) . "\$conditions = array("; + $script .= PHP_EOL . $this->_t(4) . "\$db->quoteName('element') . ' = ' . \$db->quote('com_" . $component . "')"; + $script .= PHP_EOL . $this->_t(3) . ");"; + $script .= PHP_EOL . $this->_t(3) . "\$query->update(\$db->quoteName('#__extensions'))->set(\$fields)->where(\$conditions);"; + $script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . $this->_t(3) . "\$allDone = \$db->execute();" . PHP_EOL; } // add the custom script $script .= $this->getCustomScriptBuilder('php_postflight', 'install', PHP_EOL . PHP_EOL, null, true); // add the component install notice if (ComponentbuilderHelper::checkString($script)) { - $script .= PHP_EOL . "\t\t\t" . 'echo \''; - $script .= PHP_EOL . "\t\t\t\t" . ''; - $script .= PHP_EOL . "\t\t\t\t" . '\';'; + $script .= PHP_EOL . $this->_t(3) . 'echo \''; + $script .= PHP_EOL . $this->_t(4) . ''; + $script .= PHP_EOL . $this->_t(4) . '\';'; return $script; } - return PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " noting to install."; + return PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " noting to install."; } public function setPostUpdateScript() @@ -4601,17 +4587,17 @@ class Interpretation extends Fields $script .= $this->getCustomScriptBuilder('php_postflight', 'update', PHP_EOL . PHP_EOL, null, true); if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) { - $script .= PHP_EOL . "\t\t\t" . 'echo \''; - $script .= PHP_EOL . "\t\t\t\t" . ''; - $script .= PHP_EOL . "\t\t\t\t" . ''; - $script .= PHP_EOL . "\t\t\t\t

    Upgrade to Version " . $this->fileContentStatic['###ACTUALVERSION###'] . " Was Successful! Let us know if anything is not working as expected.

    ';"; + $script .= PHP_EOL . $this->_t(3) . 'echo \''; + $script .= PHP_EOL . $this->_t(4) . ''; + $script .= PHP_EOL . $this->_t(4) . ''; + $script .= PHP_EOL . $this->_t(4) . "

    Upgrade to Version " . $this->fileContentStatic[$this->hhh . 'ACTUALVERSION' . $this->hhh] . " Was Successful! Let us know if anything is not working as expected.

    ';"; } if (ComponentbuilderHelper::checkString($script)) { return $script; } - return PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " noting to update."; + return PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " noting to update."; } public function setUninstallScript() @@ -4620,12 +4606,12 @@ class Interpretation extends Fields $script = ''; if (isset($this->uninstallScriptBuilder) && ComponentbuilderHelper::checkArray($this->uninstallScriptBuilder)) { - $component = $this->fileContentStatic['###component###']; + $component = $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]; // start loading the data to delet - $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get Application object"; - $script .= PHP_EOL . "\t\t\$app = JFactory::getApplication();"; - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get The Database object"; - $script .= PHP_EOL . "\t\t\$db = JFactory::getDbo();"; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get Application object"; + $script .= PHP_EOL . $this->_t(2) . "\$app = JFactory::getApplication();"; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get The Database object"; + $script .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDbo();"; foreach ($this->uninstallScriptBuilder as $viewName => $typeAlias) { @@ -4633,125 +4619,125 @@ class Interpretation extends Fields $view = ComponentbuilderHelper::safeString($viewName); // First check if data is till in table - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $script .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Select id from content type table"; - $script .= PHP_EOL . "\t\t\$query->select(\$db->quoteName('type_id'));"; - $script .= PHP_EOL . "\t\t\$query->from(\$db->quoteName('#__content_types'));"; - $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Where " . $viewName . " alias is found"; - $script .= PHP_EOL . "\t\t\$query->where( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . "\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Execute query to see if alias is found"; - $script .= PHP_EOL . "\t\t\$db->execute();"; - $script .= PHP_EOL . "\t\t\$" . $view . "_found = \$db->getNumRows();"; - $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Now check if there were any rows"; - $script .= PHP_EOL . "\t\tif (\$" . $view . "_found)"; - $script .= PHP_EOL . "\t\t{"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Since there are load the needed " . $view . " type ids"; - $script .= PHP_EOL . "\t\t\t\$" . $view . "_ids = \$db->loadColumn();"; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select id from content type table"; + $script .= PHP_EOL . $this->_t(2) . "\$query->select(\$db->quoteName('type_id'));"; + $script .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__content_types'));"; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Where " . $viewName . " alias is found"; + $script .= PHP_EOL . $this->_t(2) . "\$query->where( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; + $script .= PHP_EOL . $this->_t(2) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Execute query to see if alias is found"; + $script .= PHP_EOL . $this->_t(2) . "\$db->execute();"; + $script .= PHP_EOL . $this->_t(2) . "\$" . $view . "_found = \$db->getNumRows();"; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Now check if there were any rows"; + $script .= PHP_EOL . $this->_t(2) . "if (\$" . $view . "_found)"; + $script .= PHP_EOL . $this->_t(2) . "{"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Since there are load the needed " . $view . " type ids"; + $script .= PHP_EOL . $this->_t(3) . "\$" . $view . "_ids = \$db->loadColumn();"; // Now remove the actual type entry - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $viewName . " from the content type table"; - $script .= PHP_EOL . "\t\t\t\$" . $view . "_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . "\t\t\t\$query->delete(\$db->quoteName('#__content_types'));"; - $script .= PHP_EOL . "\t\t\t\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; - $script .= PHP_EOL . "\t\t\t\$" . $view . "_done = \$db->execute();"; - $script .= PHP_EOL . "\t\t\tif (\$" . $view . "_done);"; - $script .= PHP_EOL . "\t\t\t{"; - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message."; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Remove " . $viewName . " from the content type table"; + $script .= PHP_EOL . $this->_t(3) . "\$" . $view . "_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . $this->_t(3) . "\$query->delete(\$db->quoteName('#__content_types'));"; + $script .= PHP_EOL . $this->_t(3) . "\$query->where(\$" . $view . "_condition);"; + $script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; + $script .= PHP_EOL . $this->_t(3) . "\$" . $view . "_done = \$db->execute();"; + $script .= PHP_EOL . $this->_t(3) . "if (\$" . $view . "_done);"; + $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText:" . ":_('The (" . $typeAlias . ") type alias was removed from the #__content_type table'));"; - $script .= PHP_EOL . "\t\t\t}"; + $script .= PHP_EOL . $this->_t(4) . "\$app->enqueueMessage(JText:" . ":_('The (" . $typeAlias . ") type alias was removed from the #__content_type table'));"; + $script .= PHP_EOL . $this->_t(3) . "}"; // Now remove the related items from contentitem tag map table - $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the contentitem tag map table"; - $script .= PHP_EOL . "\t\t\t\$" . $view . "_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . "\t\t\t\$query->delete(\$db->quoteName('#__contentitem_tag_map'));"; - $script .= PHP_EOL . "\t\t\t\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; - $script .= PHP_EOL . "\t\t\t\$" . $view . "_done = \$db->execute();"; - $script .= PHP_EOL . "\t\t\tif (\$" . $view . "_done);"; - $script .= PHP_EOL . "\t\t\t{"; - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message."; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the contentitem tag map table"; + $script .= PHP_EOL . $this->_t(3) . "\$" . $view . "_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . $this->_t(3) . "\$query->delete(\$db->quoteName('#__contentitem_tag_map'));"; + $script .= PHP_EOL . $this->_t(3) . "\$query->where(\$" . $view . "_condition);"; + $script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; + $script .= PHP_EOL . $this->_t(3) . "\$" . $view . "_done = \$db->execute();"; + $script .= PHP_EOL . $this->_t(3) . "if (\$" . $view . "_done);"; + $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText:" . ":_('The (" . $typeAlias . ") type alias was removed from the #__contentitem_tag_map table'));"; - $script .= PHP_EOL . "\t\t\t}"; + $script .= PHP_EOL . $this->_t(4) . "\$app->enqueueMessage(JText:" . ":_('The (" . $typeAlias . ") type alias was removed from the #__contentitem_tag_map table'));"; + $script .= PHP_EOL . $this->_t(3) . "}"; // Now remove the related items from ucm content table - $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the ucm content table"; - $script .= PHP_EOL . "\t\t\t\$" . $view . "_condition = array( \$db->quoteName('core_type_alias') . ' = ' . \$db->quote('" . $typeAlias . "') );"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . "\t\t\t\$query->delete(\$db->quoteName('#__ucm_content'));"; - $script .= PHP_EOL . "\t\t\t\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; - $script .= PHP_EOL . "\t\t\t\$" . $view . "_done = \$db->execute();"; - $script .= PHP_EOL . "\t\t\tif (\$" . $view . "_done);"; - $script .= PHP_EOL . "\t\t\t{"; - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message."; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the ucm content table"; + $script .= PHP_EOL . $this->_t(3) . "\$" . $view . "_condition = array( \$db->quoteName('core_type_alias') . ' = ' . \$db->quote('" . $typeAlias . "') );"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . $this->_t(3) . "\$query->delete(\$db->quoteName('#__ucm_content'));"; + $script .= PHP_EOL . $this->_t(3) . "\$query->where(\$" . $view . "_condition);"; + $script .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; + $script .= PHP_EOL . $this->_t(3) . "\$" . $view . "_done = \$db->execute();"; + $script .= PHP_EOL . $this->_t(3) . "if (\$" . $view . "_done);"; + $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText:" . ":_('The (" . $typeAlias . ") type alias was removed from the #__ucm_content table'));"; - $script .= PHP_EOL . "\t\t\t}"; + $script .= PHP_EOL . $this->_t(4) . "\$app->enqueueMessage(JText:" . ":_('The (" . $typeAlias . ") type alias was removed from the #__ucm_content table'));"; + $script .= PHP_EOL . $this->_t(3) . "}"; // setup the foreach loop of ids - $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Make sure that all the " . $viewName . " items are cleared from DB"; - $script .= PHP_EOL . "\t\t\tforeach (\$" . $view . "_ids as \$" . $view . "_id)"; - $script .= PHP_EOL . "\t\t\t{"; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Make sure that all the " . $viewName . " items are cleared from DB"; + $script .= PHP_EOL . $this->_t(3) . "foreach (\$" . $view . "_ids as \$" . $view . "_id)"; + $script .= PHP_EOL . $this->_t(3) . "{"; // Now remove the related items from ucm base table - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the ucm base table"; - $script .= PHP_EOL . "\t\t\t\t\$" . $view . "_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$" . $view . "_id);"; - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $script .= PHP_EOL . "\t\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . "\t\t\t\t\$query->delete(\$db->quoteName('#__ucm_base'));"; - $script .= PHP_EOL . "\t\t\t\t\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . "\t\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; - $script .= PHP_EOL . "\t\t\t\t\$db->execute();"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the ucm base table"; + $script .= PHP_EOL . $this->_t(4) . "\$" . $view . "_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$" . $view . "_id);"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . $this->_t(4) . "\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . $this->_t(4) . "\$query->delete(\$db->quoteName('#__ucm_base'));"; + $script .= PHP_EOL . $this->_t(4) . "\$query->where(\$" . $view . "_condition);"; + $script .= PHP_EOL . $this->_t(4) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; + $script .= PHP_EOL . $this->_t(4) . "\$db->execute();"; // Now remove the related items from ucm history table - $script .= PHP_EOL . PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the ucm history table"; - $script .= PHP_EOL . "\t\t\t\t\$" . $view . "_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$" . $view . "_id);"; - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $script .= PHP_EOL . "\t\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . "\t\t\t\t\$query->delete(\$db->quoteName('#__ucm_history'));"; - $script .= PHP_EOL . "\t\t\t\t\$query->where(\$" . $view . "_condition);"; - $script .= PHP_EOL . "\t\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; - $script .= PHP_EOL . "\t\t\t\t\$db->execute();"; + $script .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the ucm history table"; + $script .= PHP_EOL . $this->_t(4) . "\$" . $view . "_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$" . $view . "_id);"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . $this->_t(4) . "\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . $this->_t(4) . "\$query->delete(\$db->quoteName('#__ucm_history'));"; + $script .= PHP_EOL . $this->_t(4) . "\$query->where(\$" . $view . "_condition);"; + $script .= PHP_EOL . $this->_t(4) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; + $script .= PHP_EOL . $this->_t(4) . "\$db->execute();"; - $script .= PHP_EOL . "\t\t\t}"; + $script .= PHP_EOL . $this->_t(3) . "}"; - $script .= PHP_EOL . "\t\t}"; + $script .= PHP_EOL . $this->_t(2) . "}"; } - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " If All related items was removed queued success message."; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " If All related items was removed queued success message."; // TODO lang is not translated - $script .= PHP_EOL . "\t\t\$app->enqueueMessage(JText:" . ":_('All related items was removed from the #__ucm_base table'));"; - $script .= PHP_EOL . "\t\t\$app->enqueueMessage(JText:" . ":_('All related items was removed from the #__ucm_history table'));"; + $script .= PHP_EOL . $this->_t(2) . "\$app->enqueueMessage(JText:" . ":_('All related items was removed from the #__ucm_base table'));"; + $script .= PHP_EOL . $this->_t(2) . "\$app->enqueueMessage(JText:" . ":_('All related items was removed from the #__ucm_history table'));"; // finaly remove the assets from the assets table - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Remove " . $component . " assets from the assets table"; - $script .= PHP_EOL . "\t\t\$" . $component . "_condition = array( \$db->quoteName('name') . ' LIKE ' . \$db->quote('com_" . $component . "%') );"; - $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $script .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL . "\t\t\$query->delete(\$db->quoteName('#__assets'));"; - $script .= PHP_EOL . "\t\t\$query->where(\$" . $component . "_condition);"; - $script .= PHP_EOL . "\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL . "\t\t\$" . $view . "_done = \$db->execute();"; - $script .= PHP_EOL . "\t\tif (\$" . $view . "_done);"; - $script .= PHP_EOL . "\t\t{"; - $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $component . " add queued success message."; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Remove " . $component . " assets from the assets table"; + $script .= PHP_EOL . $this->_t(2) . "\$" . $component . "_condition = array( \$db->quoteName('name') . ' LIKE ' . \$db->quote('com_" . $component . "%') );"; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . $this->_t(2) . "\$query->delete(\$db->quoteName('#__assets'));"; + $script .= PHP_EOL . $this->_t(2) . "\$query->where(\$" . $component . "_condition);"; + $script .= PHP_EOL . $this->_t(2) . "\$db->setQuery(\$query);"; + $script .= PHP_EOL . $this->_t(2) . "\$" . $view . "_done = \$db->execute();"; + $script .= PHP_EOL . $this->_t(2) . "if (\$" . $view . "_done);"; + $script .= PHP_EOL . $this->_t(2) . "{"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " If succesfully remove " . $component . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL . "\t\t\t\$app->enqueueMessage(JText:" . ":_('All related items was removed from the #__assets table'));"; - $script .= PHP_EOL . "\t\t}"; + $script .= PHP_EOL . $this->_t(3) . "\$app->enqueueMessage(JText:" . ":_('All related items was removed from the #__assets table'));"; + $script .= PHP_EOL . $this->_t(2) . "}"; // done $script .= PHP_EOL; } @@ -4766,8 +4752,8 @@ class Interpretation extends Fields { // reset script $script = array(); - $script[] = "\t\t//" . $this->setLine(__LINE__) . " We check if we have dynamic folders to copy"; - $script[] = "\t\t\$this->setDynamicF0ld3rs(\$app, \$parent);"; + $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " We check if we have dynamic folders to copy"; + $script[] = $this->_t(2) . "\$this->setDynamicF0ld3rs(\$app, \$parent);"; // done return PHP_EOL . implode(PHP_EOL, $script); } @@ -4780,40 +4766,40 @@ class Interpretation extends Fields { // reset script $script = array(); - $script[] = "\t/**"; - $script[] = "\t * Method to set/copy dynamic folders into place (use with caution)"; - $script[] = "\t *"; - $script[] = "\t * @return void"; - $script[] = "\t */"; - $script[] = "\tprotected function setDynamicF0ld3rs(\$app, \$parent)"; - $script[] = "\t{"; - $script[] = "\t\t//" . $this->setLine(__LINE__) . " get the instalation path"; - $script[] = "\t\t\$installer = \$parent->getParent();"; - $script[] = "\t\t\$installPath = \$installer->getPath('source');"; - $script[] = "\t\t//" . $this->setLine(__LINE__) . " get all the folders"; - $script[] = "\t\t\$folders = JFolder::folders(\$installPath);"; - $script[] = "\t\t//" . $this->setLine(__LINE__) . " check if we have folders we may want to copy"; - $script[] = "\t\t\$doNotCopy = array('media','admin','site'); // Joomla already deals with these"; - $script[] = "\t\tif (count(\$folders) > 1)"; - $script[] = "\t\t{"; - $script[] = "\t\t\tforeach (\$folders as \$folder)"; - $script[] = "\t\t\t{"; - $script[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Only copy if not a standard folders"; - $script[] = "\t\t\t\tif (!in_array(\$folder, \$doNotCopy))"; - $script[] = "\t\t\t\t{"; - $script[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " set the source path"; - $script[] = "\t\t\t\t\t\$src = \$installPath.'/'.\$folder;"; - $script[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " set the destination path"; - $script[] = "\t\t\t\t\t\$dest = JPATH_ROOT.'/'.\$folder;"; - $script[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " now try to copy the folder"; - $script[] = "\t\t\t\t\tif (!JFolder::copy(\$src, \$dest, '', true))"; - $script[] = "\t\t\t\t\t{"; - $script[] = "\t\t\t\t\t\t\$app->enqueueMessage('Could not copy '.\$folder.' folder into place, please make sure destination is writable!', 'error');"; - $script[] = "\t\t\t\t\t}"; - $script[] = "\t\t\t\t}"; - $script[] = "\t\t\t}"; - $script[] = "\t\t}"; - $script[] = "\t}"; + $script[] = $this->_t(1) . "/**"; + $script[] = $this->_t(1) . " * Method to set/copy dynamic folders into place (use with caution)"; + $script[] = $this->_t(1) . " *"; + $script[] = $this->_t(1) . " * @return void"; + $script[] = $this->_t(1) . " */"; + $script[] = $this->_t(1) . "protected function setDynamicF0ld3rs(\$app, \$parent)"; + $script[] = $this->_t(1) . "{"; + $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get the instalation path"; + $script[] = $this->_t(2) . "\$installer = \$parent->getParent();"; + $script[] = $this->_t(2) . "\$installPath = \$installer->getPath('source');"; + $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get all the folders"; + $script[] = $this->_t(2) . "\$folders = JFolder::folders(\$installPath);"; + $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if we have folders we may want to copy"; + $script[] = $this->_t(2) . "\$doNotCopy = array('media','admin','site'); // Joomla already deals with these"; + $script[] = $this->_t(2) . "if (count(\$folders) > 1)"; + $script[] = $this->_t(2) . "{"; + $script[] = $this->_t(3) . "foreach (\$folders as \$folder)"; + $script[] = $this->_t(3) . "{"; + $script[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Only copy if not a standard folders"; + $script[] = $this->_t(4) . "if (!in_array(\$folder, \$doNotCopy))"; + $script[] = $this->_t(4) . "{"; + $script[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " set the source path"; + $script[] = $this->_t(5) . "\$src = \$installPath.'/'.\$folder;"; + $script[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " set the destination path"; + $script[] = $this->_t(5) . "\$dest = JPATH_ROOT.'/'.\$folder;"; + $script[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " now try to copy the folder"; + $script[] = $this->_t(5) . "if (!JFolder::copy(\$src, \$dest, '', true))"; + $script[] = $this->_t(5) . "{"; + $script[] = $this->_t(6) . "\$app->enqueueMessage('Could not copy '.\$folder.' folder into place, please make sure destination is writable!', 'error');"; + $script[] = $this->_t(5) . "}"; + $script[] = $this->_t(4) . "}"; + $script[] = $this->_t(3) . "}"; + $script[] = $this->_t(2) . "}"; + $script[] = $this->_t(1) . "}"; // done return PHP_EOL . PHP_EOL . implode(PHP_EOL, $script); } @@ -4917,61 +4903,61 @@ class Interpretation extends Fields // build view route helper $View = ComponentbuilderHelper::safeString($viewName_single, 'F'); $routeHelper = array(); - $routeHelper[] = PHP_EOL . PHP_EOL . "\t/**"; - $routeHelper[] = "\t* @param int The route of the " . $View; - $routeHelper[] = "\t*/"; + $routeHelper[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $routeHelper[] = $this->_t(1) . " * @param int The route of the " . $View; + $routeHelper[] = $this->_t(1) . " */"; if ('category' === $viewName_single || 'categories' === $viewName_single) { - $routeHelper[] = "\tpublic static function get" . $View . "Route(\$id = 0)"; + $routeHelper[] = $this->_t(1) . "public static function get" . $View . "Route(\$id = 0)"; } else { - $routeHelper[] = "\tpublic static function get" . $View . "Route(\$id = 0, \$catid = 0)"; + $routeHelper[] = $this->_t(1) . "public static function get" . $View . "Route(\$id = 0, \$catid = 0)"; } - $routeHelper[] = "\t{"; - $routeHelper[] = "\t\tif (\$id > 0)"; - $routeHelper[] = "\t\t{"; - $routeHelper[] = "\t\t\t//" . $this->setLine(__LINE__) . " Initialize the needel array."; - $routeHelper[] = "\t\t\t\$needles = array("; - $routeHelper[] = "\t\t\t\t'" . $viewName_single . "' => array((int) \$id)"; - $routeHelper[] = "\t\t\t);"; - $routeHelper[] = "\t\t\t//" . $this->setLine(__LINE__) . " Create the link"; - $routeHelper[] = "\t\t\t\$link = 'index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_single . "&id='. \$id;"; - $routeHelper[] = "\t\t}"; - $routeHelper[] = "\t\telse"; - $routeHelper[] = "\t\t{"; - $routeHelper[] = "\t\t\t//" . $this->setLine(__LINE__) . " Initialize the needel array."; - $routeHelper[] = "\t\t\t\$needles = array();"; - $routeHelper[] = "\t\t\t//" . $this->setLine(__LINE__) . "Create the link but don't add the id."; - $routeHelper[] = "\t\t\t\$link = 'index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_single . "';"; - $routeHelper[] = "\t\t}"; + $routeHelper[] = $this->_t(1) . "{"; + $routeHelper[] = $this->_t(2) . "if (\$id > 0)"; + $routeHelper[] = $this->_t(2) . "{"; + $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Initialize the needel array."; + $routeHelper[] = $this->_t(3) . "\$needles = array("; + $routeHelper[] = $this->_t(4) . "'" . $viewName_single . "' => array((int) \$id)"; + $routeHelper[] = $this->_t(3) . ");"; + $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create the link"; + $routeHelper[] = $this->_t(3) . "\$link = 'index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_single . "&id='. \$id;"; + $routeHelper[] = $this->_t(2) . "}"; + $routeHelper[] = $this->_t(2) . "else"; + $routeHelper[] = $this->_t(2) . "{"; + $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Initialize the needel array."; + $routeHelper[] = $this->_t(3) . "\$needles = array();"; + $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . "Create the link but don't add the id."; + $routeHelper[] = $this->_t(3) . "\$link = 'index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_single . "';"; + $routeHelper[] = $this->_t(2) . "}"; if ('category' != $viewName_single && 'categories' != $viewName_single) { - $routeHelper[] = "\t\tif (\$catid > 1)"; - $routeHelper[] = "\t\t{"; - $routeHelper[] = "\t\t\t\$categories = JCategories::getInstance('" . $this->fileContentStatic['###component###'] . "." . $viewName_list . "');"; - $routeHelper[] = "\t\t\t\$category = \$categories->get(\$catid);"; - $routeHelper[] = "\t\t\tif (\$category)"; - $routeHelper[] = "\t\t\t{"; - $routeHelper[] = "\t\t\t\t\$needles['category'] = array_reverse(\$category->getPath());"; - $routeHelper[] = "\t\t\t\t\$needles['categories'] = \$needles['category'];"; - $routeHelper[] = "\t\t\t\t\$link .= '&catid='.\$catid;"; - $routeHelper[] = "\t\t\t}"; - $routeHelper[] = "\t\t}"; + $routeHelper[] = $this->_t(2) . "if (\$catid > 1)"; + $routeHelper[] = $this->_t(2) . "{"; + $routeHelper[] = $this->_t(3) . "\$categories = JCategories::getInstance('" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $viewName_list . "');"; + $routeHelper[] = $this->_t(3) . "\$category = \$categories->get(\$catid);"; + $routeHelper[] = $this->_t(3) . "if (\$category)"; + $routeHelper[] = $this->_t(3) . "{"; + $routeHelper[] = $this->_t(4) . "\$needles['category'] = array_reverse(\$category->getPath());"; + $routeHelper[] = $this->_t(4) . "\$needles['categories'] = \$needles['category'];"; + $routeHelper[] = $this->_t(4) . "\$link .= '&catid='.\$catid;"; + $routeHelper[] = $this->_t(3) . "}"; + $routeHelper[] = $this->_t(2) . "}"; } if (isset($this->hasMenuGlobal[$viewName_single])) { - $routeHelper[] = PHP_EOL . "\t\tif (\$item = self::_findItem(\$needles, '" . $viewName_single . "'))"; + $routeHelper[] = PHP_EOL . $this->_t(2) . "if (\$item = self::_findItem(\$needles, '" . $viewName_single . "'))"; } else { - $routeHelper[] = PHP_EOL . "\t\tif (\$item = self::_findItem(\$needles))"; + $routeHelper[] = PHP_EOL . $this->_t(2) . "if (\$item = self::_findItem(\$needles))"; } - $routeHelper[] = "\t\t{"; - $routeHelper[] = "\t\t\t\$link .= '&Itemid='.\$item;"; - $routeHelper[] = "\t\t}"; - $routeHelper[] = PHP_EOL . "\t\treturn \$link;"; - $routeHelper[] = "\t}"; + $routeHelper[] = $this->_t(2) . "{"; + $routeHelper[] = $this->_t(3) . "\$link .= '&Itemid='.\$item;"; + $routeHelper[] = $this->_t(2) . "}"; + $routeHelper[] = PHP_EOL . $this->_t(2) . "return \$link;"; + $routeHelper[] = $this->_t(1) . "}"; return implode(PHP_EOL, $routeHelper); } @@ -4990,9 +4976,9 @@ class Interpretation extends Fields if (isset($viewArray['settings']->main_get->add_php_router_parse) && $viewArray['settings']->main_get->add_php_router_parse == 1 && isset($viewArray['settings']->main_get->php_router_parse) && ComponentbuilderHelper::checkString($viewArray['settings']->main_get->php_router_parse)) { // load the custom script for the switch based on dynamic get - $routerSwitch[] = PHP_EOL . "\t\t\tcase '" . $view . "':"; + $routerSwitch[] = PHP_EOL . $this->_t(3) . "case '" . $view . "':"; $routerSwitch[] = $this->setPlaceholders($this->setDynamicValues(base64_decode($viewArray['settings']->main_get->php_router_parse)), $this->placeholders); - $routerSwitch[] = "\t\t\t\tbreak;"; + $routerSwitch[] = $this->_t(4) . "break;"; return implode(PHP_EOL, $routerSwitch); } @@ -5012,7 +4998,7 @@ class Interpretation extends Fields { if (isset($get['selection']['table'])) { - $viewTable = str_replace('#__' . $this->fileContentStatic['###component###'] . '_', '', $get['selection']['table']); + $viewTable = str_replace('#__' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_', '', $get['selection']['table']); } } break; @@ -5023,45 +5009,45 @@ class Interpretation extends Fields // add if tags is added, also for all front item views if ($aliasView) { - $routerSwitch[] = PHP_EOL . "\t\t\tcase '" . $view . "':"; - $routerSwitch[] = "\t\t\t\t\$vars['view'] = '" . $view . "';"; - $routerSwitch[] = "\t\t\t\tif (is_numeric(\$segments[\$count-1]))"; - $routerSwitch[] = "\t\t\t\t{"; - $routerSwitch[] = "\t\t\t\t\t\$vars['id'] = (int) \$segments[\$count-1];"; - $routerSwitch[] = "\t\t\t\t}"; - $routerSwitch[] = "\t\t\t\telseif (\$segments[\$count-1])"; - $routerSwitch[] = "\t\t\t\t{"; + $routerSwitch[] = PHP_EOL . $this->_t(3) . "case '" . $view . "':"; + $routerSwitch[] = $this->_t(4) . "\$vars['view'] = '" . $view . "';"; + $routerSwitch[] = $this->_t(4) . "if (is_numeric(\$segments[\$count-1]))"; + $routerSwitch[] = $this->_t(4) . "{"; + $routerSwitch[] = $this->_t(5) . "\$vars['id'] = (int) \$segments[\$count-1];"; + $routerSwitch[] = $this->_t(4) . "}"; + $routerSwitch[] = $this->_t(4) . "elseif (\$segments[\$count-1])"; + $routerSwitch[] = $this->_t(4) . "{"; // we need to get from the table of this views main get the alias so we need the table name if ($viewTable) { - $routerSwitch[] = "\t\t\t\t\t\$id = \$this->getVar('" . $viewTable . "', \$segments[\$count-1], 'alias', 'id'" . $isCategory . ");"; + $routerSwitch[] = $this->_t(5) . "\$id = \$this->getVar('" . $viewTable . "', \$segments[\$count-1], 'alias', 'id'" . $isCategory . ");"; } else { - $routerSwitch[] = "\t\t\t\t\t\$id = \$this->getVar('" . $view . "', \$segments[\$count-1], 'alias', 'id'" . $isCategory . ");"; + $routerSwitch[] = $this->_t(5) . "\$id = \$this->getVar('" . $view . "', \$segments[\$count-1], 'alias', 'id'" . $isCategory . ");"; } - $routerSwitch[] = "\t\t\t\t\tif(\$id)"; - $routerSwitch[] = "\t\t\t\t\t{"; - $routerSwitch[] = "\t\t\t\t\t\t\$vars['id'] = \$id;"; - $routerSwitch[] = "\t\t\t\t\t}"; - $routerSwitch[] = "\t\t\t\t}"; - $routerSwitch[] = "\t\t\t\tbreak;"; + $routerSwitch[] = $this->_t(5) . "if(\$id)"; + $routerSwitch[] = $this->_t(5) . "{"; + $routerSwitch[] = $this->_t(6) . "\$vars['id'] = \$id;"; + $routerSwitch[] = $this->_t(5) . "}"; + $routerSwitch[] = $this->_t(4) . "}"; + $routerSwitch[] = $this->_t(4) . "break;"; } elseif ($idView) { - $routerSwitch[] = PHP_EOL . "\t\t\tcase '" . $view . "':"; - $routerSwitch[] = "\t\t\t\t\$vars['view'] = '" . $view . "';"; - $routerSwitch[] = "\t\t\t\tif (is_numeric(\$segments[\$count-1]))"; - $routerSwitch[] = "\t\t\t\t{"; - $routerSwitch[] = "\t\t\t\t\t\$vars['id'] = (int) \$segments[\$count-1];"; - $routerSwitch[] = "\t\t\t\t}"; - $routerSwitch[] = "\t\t\t\tbreak;"; + $routerSwitch[] = PHP_EOL . $this->_t(3) . "case '" . $view . "':"; + $routerSwitch[] = $this->_t(4) . "\$vars['view'] = '" . $view . "';"; + $routerSwitch[] = $this->_t(4) . "if (is_numeric(\$segments[\$count-1]))"; + $routerSwitch[] = $this->_t(4) . "{"; + $routerSwitch[] = $this->_t(5) . "\$vars['id'] = (int) \$segments[\$count-1];"; + $routerSwitch[] = $this->_t(4) . "}"; + $routerSwitch[] = $this->_t(4) . "break;"; } else { - $routerSwitch[] = PHP_EOL . "\t\t\tcase '" . $view . "':"; - $routerSwitch[] = "\t\t\t\t\$vars['view'] = '" . $view . "';"; - $routerSwitch[] = "\t\t\t\tbreak;"; + $routerSwitch[] = PHP_EOL . $this->_t(3) . "case '" . $view . "':"; + $routerSwitch[] = $this->_t(4) . "\$vars['view'] = '" . $view . "';"; + $routerSwitch[] = $this->_t(4) . "break;"; } return implode(PHP_EOL, $routerSwitch); @@ -5069,7 +5055,7 @@ class Interpretation extends Fields public function routerBuildViews(&$view) { - 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])) { return " || \$view === '" . $view . "'"; } @@ -5086,7 +5072,7 @@ class Interpretation extends Fields $batchmove = array(); $VIEW = ComponentbuilderHelper::safeString($viewName_single, 'U'); // component helper name - $Helper = $this->fileContentStatic['###Component###'] . 'Helper'; + $Helper = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper'; // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) @@ -5102,154 +5088,154 @@ class Interpretation extends Fields // prepare custom script $customScript = $this->getCustomScriptBuilder('php_batchmove', $viewName_single, PHP_EOL . PHP_EOL, null, true); - $batchmove[] = PHP_EOL . "\t/**"; - $batchmove[] = "\t * Batch move items to a new category"; - $batchmove[] = "\t *"; - $batchmove[] = "\t * @param integer \$value The new category ID."; - $batchmove[] = "\t * @param array \$pks An array of row IDs."; - $batchmove[] = "\t * @param array \$contexts An array of item contexts."; - $batchmove[] = "\t *"; - $batchmove[] = "\t * @return boolean True if successful, false otherwise and internal error is set."; - $batchmove[] = "\t *"; - $batchmove[] = "\t * @since\t12.2"; - $batchmove[] = "\t */"; - $batchmove[] = "\tprotected function batchMove(\$values, \$pks, \$contexts)"; - $batchmove[] = "\t{"; - $batchmove[] = "\t\tif (empty(\$this->batchSet))"; - $batchmove[] = "\t\t{"; - $batchmove[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set some needed variables."; - $batchmove[] = "\t\t\t\$this->user = JFactory::getUser();"; - $batchmove[] = "\t\t\t\$this->table = \$this->getTable();"; - $batchmove[] = "\t\t\t\$this->tableClassName = get_class(\$this->table);"; - $batchmove[] = "\t\t\t\$this->canDo = " . $Helper . "::getActions('" . $viewName_single . "');"; - $batchmove[] = "\t\t}"; + $batchmove[] = PHP_EOL . $this->_t(1) . "/**"; + $batchmove[] = $this->_t(1) . " * Batch move items to a new category"; + $batchmove[] = $this->_t(1) . " *"; + $batchmove[] = $this->_t(1) . " * @param integer \$value The new category ID."; + $batchmove[] = $this->_t(1) . " * @param array \$pks An array of row IDs."; + $batchmove[] = $this->_t(1) . " * @param array \$contexts An array of item contexts."; + $batchmove[] = $this->_t(1) . " *"; + $batchmove[] = $this->_t(1) . " * @return boolean True if successful, false otherwise and internal error is set."; + $batchmove[] = $this->_t(1) . " *"; + $batchmove[] = $this->_t(1) . " * @since 12.2"; + $batchmove[] = $this->_t(1) . " */"; + $batchmove[] = $this->_t(1) . "protected function batchMove(\$values, \$pks, \$contexts)"; + $batchmove[] = $this->_t(1) . "{"; + $batchmove[] = $this->_t(2) . "if (empty(\$this->batchSet))"; + $batchmove[] = $this->_t(2) . "{"; + $batchmove[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set some needed variables."; + $batchmove[] = $this->_t(3) . "\$this->user = JFactory::getUser();"; + $batchmove[] = $this->_t(3) . "\$this->table = \$this->getTable();"; + $batchmove[] = $this->_t(3) . "\$this->tableClassName = get_class(\$this->table);"; + $batchmove[] = $this->_t(3) . "\$this->canDo = " . $Helper . "::getActions('" . $viewName_single . "');"; + $batchmove[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) { - $batchmove[] = PHP_EOL . "\t\tif (!\$this->canDo->get('" . $core['core.edit'] . "') && !\$this->canDo->get('" . $core['core.batch'] . "'))"; + $batchmove[] = PHP_EOL . $this->_t(2) . "if (!\$this->canDo->get('" . $core['core.edit'] . "') && !\$this->canDo->get('" . $core['core.batch'] . "'))"; } else { - $batchmove[] = PHP_EOL . "\t\tif (!\$this->canDo->get('core.edit') && !\$this->canDo->get('core.batch'))"; + $batchmove[] = PHP_EOL . $this->_t(2) . "if (!\$this->canDo->get('core.edit') && !\$this->canDo->get('core.batch'))"; } - $batchmove[] = "\t\t{"; - $batchmove[] = "\t\t\t\$this->setError(JText:" . ":_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));"; - $batchmove[] = "\t\t\treturn false;"; - $batchmove[] = "\t\t}" . $customScript; + $batchmove[] = $this->_t(2) . "{"; + $batchmove[] = $this->_t(3) . "\$this->setError(JText:" . ":_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));"; + $batchmove[] = $this->_t(3) . "return false;"; + $batchmove[] = $this->_t(2) . "}" . $customScript; - $batchmove[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " make sure published only updates if user has the permission."; + $batchmove[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " make sure published only updates if user has the permission."; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) { - $batchmove[] = "\t\tif (isset(\$values['published']) && !\$this->canDo->get('" . $core['core.edit.state'] . "'))"; + $batchmove[] = $this->_t(2) . "if (isset(\$values['published']) && !\$this->canDo->get('" . $core['core.edit.state'] . "'))"; } else { - $batchmove[] = "\t\tif (isset(\$values['published']) && !\$this->canDo->get('core.edit.state'))"; + $batchmove[] = $this->_t(2) . "if (isset(\$values['published']) && !\$this->canDo->get('core.edit.state'))"; } - $batchmove[] = "\t\t{"; - $batchmove[] = "\t\t\tunset(\$values['published']);"; - $batchmove[] = "\t\t}"; + $batchmove[] = $this->_t(2) . "{"; + $batchmove[] = $this->_t(3) . "unset(\$values['published']);"; + $batchmove[] = $this->_t(2) . "}"; - $batchmove[] = "\t\t//" . $this->setLine(__LINE__) . " remove move_copy from array"; - $batchmove[] = "\t\tunset(\$values['move_copy']);"; + $batchmove[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " remove move_copy from array"; + $batchmove[] = $this->_t(2) . "unset(\$values['move_copy']);"; if ($category) { - $batchmove[] = PHP_EOL . "\t\tif (isset(\$values['category']) && (int) \$values['category'] > 0 && !static::checkCategoryId(\$values['category']))"; - $batchmove[] = "\t\t{"; - $batchmove[] = "\t\t\treturn false;"; - $batchmove[] = "\t\t}"; - $batchmove[] = "\t\telseif (isset(\$values['category']) && (int) \$values['category'] > 0)"; - $batchmove[] = "\t\t{"; - $batchmove[] = "\t\t\t//" . $this->setLine(__LINE__) . " move the category value to correct field name"; - $batchmove[] = "\t\t\t\$values['" . $category . "'] = \$values['category'];"; - $batchmove[] = "\t\t\tunset(\$values['category']);"; - $batchmove[] = "\t\t}"; - $batchmove[] = "\t\telseif (isset(\$values['category']))"; - $batchmove[] = "\t\t{"; - $batchmove[] = "\t\t\tunset(\$values['category']);"; - $batchmove[] = "\t\t}" . PHP_EOL; + $batchmove[] = PHP_EOL . $this->_t(2) . "if (isset(\$values['category']) && (int) \$values['category'] > 0 && !static::checkCategoryId(\$values['category']))"; + $batchmove[] = $this->_t(2) . "{"; + $batchmove[] = $this->_t(3) . "return false;"; + $batchmove[] = $this->_t(2) . "}"; + $batchmove[] = $this->_t(2) . "elseif (isset(\$values['category']) && (int) \$values['category'] > 0)"; + $batchmove[] = $this->_t(2) . "{"; + $batchmove[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " move the category value to correct field name"; + $batchmove[] = $this->_t(3) . "\$values['" . $category . "'] = \$values['category'];"; + $batchmove[] = $this->_t(3) . "unset(\$values['category']);"; + $batchmove[] = $this->_t(2) . "}"; + $batchmove[] = $this->_t(2) . "elseif (isset(\$values['category']))"; + $batchmove[] = $this->_t(2) . "{"; + $batchmove[] = $this->_t(3) . "unset(\$values['category']);"; + $batchmove[] = $this->_t(2) . "}" . PHP_EOL; } - $batchmove[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Parent exists so we proceed"; - $batchmove[] = "\t\tforeach (\$pks as \$pk)"; - $batchmove[] = "\t\t{"; + $batchmove[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Parent exists so we proceed"; + $batchmove[] = $this->_t(2) . "foreach (\$pks as \$pk)"; + $batchmove[] = $this->_t(2) . "{"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']])) { - $batchmove[] = "\t\t\tif (!\$this->user->authorise('" . $core['core.edit'] . "', \$contexts[\$pk]))"; + $batchmove[] = $this->_t(3) . "if (!\$this->user->authorise('" . $core['core.edit'] . "', \$contexts[\$pk]))"; } else { - $batchmove[] = "\t\t\tif (!\$this->user->authorise('core.edit', \$contexts[\$pk]))"; + $batchmove[] = $this->_t(3) . "if (!\$this->user->authorise('core.edit', \$contexts[\$pk]))"; } - $batchmove[] = "\t\t\t{"; - $batchmove[] = "\t\t\t\t\$this->setError(JText:" . ":_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));"; + $batchmove[] = $this->_t(3) . "{"; + $batchmove[] = $this->_t(4) . "\$this->setError(JText:" . ":_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));"; - $batchmove[] = "\t\t\t\treturn false;"; - $batchmove[] = "\t\t\t}"; + $batchmove[] = $this->_t(4) . "return false;"; + $batchmove[] = $this->_t(3) . "}"; - $batchmove[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check that the row actually exists"; - $batchmove[] = "\t\t\tif (!\$this->table->load(\$pk))"; - $batchmove[] = "\t\t\t{"; - $batchmove[] = "\t\t\t\tif (\$error = \$this->table->getError())"; - $batchmove[] = "\t\t\t\t{"; - $batchmove[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Fatal error"; - $batchmove[] = "\t\t\t\t\t\$this->setError(\$error);"; + $batchmove[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Check that the row actually exists"; + $batchmove[] = $this->_t(3) . "if (!\$this->table->load(\$pk))"; + $batchmove[] = $this->_t(3) . "{"; + $batchmove[] = $this->_t(4) . "if (\$error = \$this->table->getError())"; + $batchmove[] = $this->_t(4) . "{"; + $batchmove[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " Fatal error"; + $batchmove[] = $this->_t(5) . "\$this->setError(\$error);"; - $batchmove[] = "\t\t\t\t\treturn false;"; - $batchmove[] = "\t\t\t\t}"; - $batchmove[] = "\t\t\t\telse"; - $batchmove[] = "\t\t\t\t{"; - $batchmove[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error"; - $batchmove[] = "\t\t\t\t\t\$this->setError(JText:" . ":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; - $batchmove[] = "\t\t\t\t\tcontinue;"; - $batchmove[] = "\t\t\t\t}"; - $batchmove[] = "\t\t\t}"; + $batchmove[] = $this->_t(5) . "return false;"; + $batchmove[] = $this->_t(4) . "}"; + $batchmove[] = $this->_t(4) . "else"; + $batchmove[] = $this->_t(4) . "{"; + $batchmove[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " Not fatal error"; + $batchmove[] = $this->_t(5) . "\$this->setError(JText:" . ":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; + $batchmove[] = $this->_t(5) . "continue;"; + $batchmove[] = $this->_t(4) . "}"; + $batchmove[] = $this->_t(3) . "}"; - $batchmove[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " insert all set values."; - $batchmove[] = "\t\t\tif (" . $Helper . "::checkArray(\$values))"; - $batchmove[] = "\t\t\t{"; - $batchmove[] = "\t\t\t\tforeach (\$values as \$key => \$value)"; - $batchmove[] = "\t\t\t\t{"; - $batchmove[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Do special action for access."; - $batchmove[] = "\t\t\t\t\tif ('access' === \$key && strlen(\$value) > 0)"; - $batchmove[] = "\t\t\t\t\t{"; - $batchmove[] = "\t\t\t\t\t\t\$this->table->\$key = \$value;"; - $batchmove[] = "\t\t\t\t\t}"; - $batchmove[] = "\t\t\t\t\telseif (strlen(\$value) > 0 && isset(\$this->table->\$key))"; - $batchmove[] = "\t\t\t\t\t{"; - $batchmove[] = "\t\t\t\t\t\t\$this->table->\$key = \$value;"; - $batchmove[] = "\t\t\t\t\t}"; - $batchmove[] = "\t\t\t\t}"; - $batchmove[] = "\t\t\t}" . PHP_EOL; + $batchmove[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " insert all set values."; + $batchmove[] = $this->_t(3) . "if (" . $Helper . "::checkArray(\$values))"; + $batchmove[] = $this->_t(3) . "{"; + $batchmove[] = $this->_t(4) . "foreach (\$values as \$key => \$value)"; + $batchmove[] = $this->_t(4) . "{"; + $batchmove[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " Do special action for access."; + $batchmove[] = $this->_t(5) . "if ('access' === \$key && strlen(\$value) > 0)"; + $batchmove[] = $this->_t(5) . "{"; + $batchmove[] = $this->_t(6) . "\$this->table->\$key = \$value;"; + $batchmove[] = $this->_t(5) . "}"; + $batchmove[] = $this->_t(5) . "elseif (strlen(\$value) > 0 && isset(\$this->table->\$key))"; + $batchmove[] = $this->_t(5) . "{"; + $batchmove[] = $this->_t(6) . "\$this->table->\$key = \$value;"; + $batchmove[] = $this->_t(5) . "}"; + $batchmove[] = $this->_t(4) . "}"; + $batchmove[] = $this->_t(3) . "}" . PHP_EOL; - $batchmove[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check the row."; - $batchmove[] = "\t\t\tif (!\$this->table->check())"; - $batchmove[] = "\t\t\t{"; - $batchmove[] = "\t\t\t\t\$this->setError(\$this->table->getError());"; + $batchmove[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Check the row."; + $batchmove[] = $this->_t(3) . "if (!\$this->table->check())"; + $batchmove[] = $this->_t(3) . "{"; + $batchmove[] = $this->_t(4) . "\$this->setError(\$this->table->getError());"; - $batchmove[] = PHP_EOL . "\t\t\t\treturn false;"; - $batchmove[] = "\t\t\t}"; + $batchmove[] = PHP_EOL . $this->_t(4) . "return false;"; + $batchmove[] = $this->_t(3) . "}"; - $batchmove[] = PHP_EOL . "\t\t\tif (!empty(\$this->type))"; - $batchmove[] = "\t\t\t{"; - $batchmove[] = "\t\t\t\t\$this->createTagsHelper(\$this->tagsObserver, \$this->type, \$pk, \$this->typeAlias, \$this->table);"; - $batchmove[] = "\t\t\t}"; + $batchmove[] = PHP_EOL . $this->_t(3) . "if (!empty(\$this->type))"; + $batchmove[] = $this->_t(3) . "{"; + $batchmove[] = $this->_t(4) . "\$this->createTagsHelper(\$this->tagsObserver, \$this->type, \$pk, \$this->typeAlias, \$this->table);"; + $batchmove[] = $this->_t(3) . "}"; - $batchmove[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Store the row."; - $batchmove[] = "\t\t\tif (!\$this->table->store())"; - $batchmove[] = "\t\t\t{"; - $batchmove[] = "\t\t\t\t\$this->setError(\$this->table->getError());"; + $batchmove[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Store the row."; + $batchmove[] = $this->_t(3) . "if (!\$this->table->store())"; + $batchmove[] = $this->_t(3) . "{"; + $batchmove[] = $this->_t(4) . "\$this->setError(\$this->table->getError());"; - $batchmove[] = PHP_EOL . "\t\t\t\treturn false;"; - $batchmove[] = "\t\t\t}"; - $batchmove[] = "\t\t}"; + $batchmove[] = PHP_EOL . $this->_t(4) . "return false;"; + $batchmove[] = $this->_t(3) . "}"; + $batchmove[] = $this->_t(2) . "}"; - $batchmove[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Clean the cache"; - $batchmove[] = "\t\t\$this->cleanCache();"; + $batchmove[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Clean the cache"; + $batchmove[] = $this->_t(2) . "\$this->cleanCache();"; - $batchmove[] = PHP_EOL . "\t\treturn true;"; - $batchmove[] = "\t}"; + $batchmove[] = PHP_EOL . $this->_t(2) . "return true;"; + $batchmove[] = $this->_t(1) . "}"; return PHP_EOL . implode(PHP_EOL, $batchmove); } @@ -5264,7 +5250,7 @@ class Interpretation extends Fields $batchcopy = array(); $VIEW = ComponentbuilderHelper::safeString($viewName_single, 'U'); // component helper name - $Helper = $this->fileContentStatic['###Component###'] . 'Helper'; + $Helper = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper'; // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) @@ -5308,221 +5294,221 @@ class Interpretation extends Fields // prepare custom script $customScript = $this->getCustomScriptBuilder('php_batchcopy', $viewName_single, PHP_EOL . PHP_EOL, null, true); - $batchcopy[] = PHP_EOL . "\t/**"; - $batchcopy[] = "\t * Batch copy items to a new category or current."; - $batchcopy[] = "\t *"; - $batchcopy[] = "\t * @param integer \$values The new values."; - $batchcopy[] = "\t * @param array \$pks An array of row IDs."; - $batchcopy[] = "\t * @param array \$contexts An array of item contexts."; - $batchcopy[] = "\t *"; - $batchcopy[] = "\t * @return mixed An array of new IDs on success, boolean false on failure."; - $batchcopy[] = "\t *"; - $batchcopy[] = "\t * @since\t12.2"; - $batchcopy[] = "\t */"; - $batchcopy[] = "\tprotected function batchCopy(\$values, \$pks, \$contexts)"; - $batchcopy[] = "\t{"; + $batchcopy[] = PHP_EOL . $this->_t(1) . "/**"; + $batchcopy[] = $this->_t(1) . " * Batch copy items to a new category or current."; + $batchcopy[] = $this->_t(1) . " *"; + $batchcopy[] = $this->_t(1) . " * @param integer \$values The new values."; + $batchcopy[] = $this->_t(1) . " * @param array \$pks An array of row IDs."; + $batchcopy[] = $this->_t(1) . " * @param array \$contexts An array of item contexts."; + $batchcopy[] = $this->_t(1) . " *"; + $batchcopy[] = $this->_t(1) . " * @return mixed An array of new IDs on success, boolean false on failure."; + $batchcopy[] = $this->_t(1) . " *"; + $batchcopy[] = $this->_t(1) . " * @since 12.2"; + $batchcopy[] = $this->_t(1) . " */"; + $batchcopy[] = $this->_t(1) . "protected function batchCopy(\$values, \$pks, \$contexts)"; + $batchcopy[] = $this->_t(1) . "{"; - $batchcopy[] = "\t\tif (empty(\$this->batchSet))"; - $batchcopy[] = "\t\t{"; - $batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set some needed variables."; - $batchcopy[] = "\t\t\t\$this->user = JFactory::getUser();"; - $batchcopy[] = "\t\t\t\$this->table = \$this->getTable();"; - $batchcopy[] = "\t\t\t\$this->tableClassName = get_class(\$this->table);"; - $batchcopy[] = "\t\t\t\$this->canDo = " . $Helper . "::getActions('" . $viewName_single . "');"; - $batchcopy[] = "\t\t}"; + $batchcopy[] = $this->_t(2) . "if (empty(\$this->batchSet))"; + $batchcopy[] = $this->_t(2) . "{"; + $batchcopy[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set some needed variables."; + $batchcopy[] = $this->_t(3) . "\$this->user = JFactory::getUser();"; + $batchcopy[] = $this->_t(3) . "\$this->table = \$this->getTable();"; + $batchcopy[] = $this->_t(3) . "\$this->tableClassName = get_class(\$this->table);"; + $batchcopy[] = $this->_t(3) . "\$this->canDo = " . $Helper . "::getActions('" . $viewName_single . "');"; + $batchcopy[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) { - $batchcopy[] = PHP_EOL . "\t\tif (!\$this->canDo->get('" . $core['core.create'] . "') && !\$this->canDo->get('" . $core['core.batch'] . "'))"; + $batchcopy[] = PHP_EOL . $this->_t(2) . "if (!\$this->canDo->get('" . $core['core.create'] . "') && !\$this->canDo->get('" . $core['core.batch'] . "'))"; } else { - $batchcopy[] = PHP_EOL . "\t\tif (!\$this->canDo->get('core.create') || !\$this->canDo->get('core.batch'))"; + $batchcopy[] = PHP_EOL . $this->_t(2) . "if (!\$this->canDo->get('core.create') || !\$this->canDo->get('core.batch'))"; } - $batchcopy[] = "\t\t{"; - $batchcopy[] = "\t\t\treturn false;"; - $batchcopy[] = "\t\t}" . $customScript; + $batchcopy[] = $this->_t(2) . "{"; + $batchcopy[] = $this->_t(3) . "return false;"; + $batchcopy[] = $this->_t(2) . "}" . $customScript; - $batchcopy[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " get list of uniqe fields"; - $batchcopy[] = "\t\t\$uniqeFields = \$this->getUniqeFields();"; - $batchcopy[] = "\t\t//" . $this->setLine(__LINE__) . " remove move_copy from array"; - $batchcopy[] = "\t\tunset(\$values['move_copy']);"; + $batchcopy[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " get list of uniqe fields"; + $batchcopy[] = $this->_t(2) . "\$uniqeFields = \$this->getUniqeFields();"; + $batchcopy[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " remove move_copy from array"; + $batchcopy[] = $this->_t(2) . "unset(\$values['move_copy']);"; - $batchcopy[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " make sure published is set"; - $batchcopy[] = "\t\tif (!isset(\$values['published']))"; - $batchcopy[] = "\t\t{"; - $batchcopy[] = "\t\t\t\$values['published'] = 0;"; - $batchcopy[] = "\t\t}"; + $batchcopy[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " make sure published is set"; + $batchcopy[] = $this->_t(2) . "if (!isset(\$values['published']))"; + $batchcopy[] = $this->_t(2) . "{"; + $batchcopy[] = $this->_t(3) . "\$values['published'] = 0;"; + $batchcopy[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) { - $batchcopy[] = "\t\telseif (isset(\$values['published']) && !\$this->canDo->get('" . $core['core.edit.state'] . "'))"; + $batchcopy[] = $this->_t(2) . "elseif (isset(\$values['published']) && !\$this->canDo->get('" . $core['core.edit.state'] . "'))"; } else { - $batchcopy[] = "\t\telseif (isset(\$values['published']) && !\$this->canDo->get('core.edit.state'))"; + $batchcopy[] = $this->_t(2) . "elseif (isset(\$values['published']) && !\$this->canDo->get('core.edit.state'))"; } - $batchcopy[] = "\t\t{"; - $batchcopy[] = "\t\t\t\t\$values['published'] = 0;"; - $batchcopy[] = "\t\t}"; + $batchcopy[] = $this->_t(2) . "{"; + $batchcopy[] = $this->_t(4) . "\$values['published'] = 0;"; + $batchcopy[] = $this->_t(2) . "}"; if ($category) { - $batchcopy[] = PHP_EOL . "\t\tif (isset(\$values['category']) && (int) \$values['category'] > 0 && !static::checkCategoryId(\$values['category']))"; - $batchcopy[] = "\t\t{"; - $batchcopy[] = "\t\t\treturn false;"; - $batchcopy[] = "\t\t}"; - $batchcopy[] = "\t\telseif (isset(\$values['category']) && (int) \$values['category'] > 0)"; - $batchcopy[] = "\t\t{"; - $batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " move the category value to correct field name"; - $batchcopy[] = "\t\t\t\$values['" . $category . "'] = \$values['category'];"; - $batchcopy[] = "\t\t\tunset(\$values['category']);"; - $batchcopy[] = "\t\t}"; - $batchcopy[] = "\t\telseif (isset(\$values['category']))"; - $batchcopy[] = "\t\t{"; - $batchcopy[] = "\t\t\tunset(\$values['category']);"; - $batchcopy[] = "\t\t}"; + $batchcopy[] = PHP_EOL . $this->_t(2) . "if (isset(\$values['category']) && (int) \$values['category'] > 0 && !static::checkCategoryId(\$values['category']))"; + $batchcopy[] = $this->_t(2) . "{"; + $batchcopy[] = $this->_t(3) . "return false;"; + $batchcopy[] = $this->_t(2) . "}"; + $batchcopy[] = $this->_t(2) . "elseif (isset(\$values['category']) && (int) \$values['category'] > 0)"; + $batchcopy[] = $this->_t(2) . "{"; + $batchcopy[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " move the category value to correct field name"; + $batchcopy[] = $this->_t(3) . "\$values['" . $category . "'] = \$values['category'];"; + $batchcopy[] = $this->_t(3) . "unset(\$values['category']);"; + $batchcopy[] = $this->_t(2) . "}"; + $batchcopy[] = $this->_t(2) . "elseif (isset(\$values['category']))"; + $batchcopy[] = $this->_t(2) . "{"; + $batchcopy[] = $this->_t(3) . "unset(\$values['category']);"; + $batchcopy[] = $this->_t(2) . "}"; } - $batchcopy[] = PHP_EOL . "\t\t\$newIds = array();"; + $batchcopy[] = PHP_EOL . $this->_t(2) . "\$newIds = array();"; - $batchcopy[] = "\t\t//" . $this->setLine(__LINE__) . " Parent exists so let's proceed"; - $batchcopy[] = "\t\twhile (!empty(\$pks))"; - $batchcopy[] = "\t\t{"; - $batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " Pop the first ID off the stack"; - $batchcopy[] = "\t\t\t\$pk = array_shift(\$pks);"; + $batchcopy[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Parent exists so let's proceed"; + $batchcopy[] = $this->_t(2) . "while (!empty(\$pks))"; + $batchcopy[] = $this->_t(2) . "{"; + $batchcopy[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Pop the first ID off the stack"; + $batchcopy[] = $this->_t(3) . "\$pk = array_shift(\$pks);"; - $batchcopy[] = PHP_EOL . "\t\t\t\$this->table->reset();"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "\$this->table->reset();"; - $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " only allow copy if user may edit this item."; + $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " only allow copy if user may edit this item."; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']])) { - $batchcopy[] = "\t\t\tif (!\$this->user->authorise('" . $core['core.edit'] . "', \$contexts[\$pk]))"; + $batchcopy[] = $this->_t(3) . "if (!\$this->user->authorise('" . $core['core.edit'] . "', \$contexts[\$pk]))"; } else { - $batchcopy[] = "\t\t\tif (!\$this->user->authorise('core.edit', \$contexts[\$pk]))"; + $batchcopy[] = $this->_t(3) . "if (!\$this->user->authorise('core.edit', \$contexts[\$pk]))"; } - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error"; - $batchcopy[] = "\t\t\t\t\$this->setError(JText:" . ":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; - $batchcopy[] = "\t\t\t\tcontinue;"; - $batchcopy[] = "\t\t\t}"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Not fatal error"; + $batchcopy[] = $this->_t(4) . "\$this->setError(JText:" . ":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; + $batchcopy[] = $this->_t(4) . "continue;"; + $batchcopy[] = $this->_t(3) . "}"; - $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check that the row actually exists"; - $batchcopy[] = "\t\t\tif (!\$this->table->load(\$pk))"; - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\tif (\$error = \$this->table->getError())"; - $batchcopy[] = "\t\t\t\t{"; - $batchcopy[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Fatal error"; - $batchcopy[] = "\t\t\t\t\t\$this->setError(\$error);"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Check that the row actually exists"; + $batchcopy[] = $this->_t(3) . "if (!\$this->table->load(\$pk))"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "if (\$error = \$this->table->getError())"; + $batchcopy[] = $this->_t(4) . "{"; + $batchcopy[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " Fatal error"; + $batchcopy[] = $this->_t(5) . "\$this->setError(\$error);"; - $batchcopy[] = "\t\t\t\t\treturn false;"; - $batchcopy[] = "\t\t\t\t}"; - $batchcopy[] = "\t\t\t\telse"; - $batchcopy[] = "\t\t\t\t{"; - $batchcopy[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error"; - $batchcopy[] = "\t\t\t\t\t\$this->setError(JText:" . ":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; - $batchcopy[] = "\t\t\t\t\tcontinue;"; - $batchcopy[] = "\t\t\t\t}"; - $batchcopy[] = "\t\t\t}"; + $batchcopy[] = $this->_t(5) . "return false;"; + $batchcopy[] = $this->_t(4) . "}"; + $batchcopy[] = $this->_t(4) . "else"; + $batchcopy[] = $this->_t(4) . "{"; + $batchcopy[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " Not fatal error"; + $batchcopy[] = $this->_t(5) . "\$this->setError(JText:" . ":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; + $batchcopy[] = $this->_t(5) . "continue;"; + $batchcopy[] = $this->_t(4) . "}"; + $batchcopy[] = $this->_t(3) . "}"; if ($category && $alias === 'alias' && ($title && count($titles) == 1 && in_array('title', $titles))) { - $batchcopy[] = PHP_EOL . "\t\t\tif (isset(\$values['" . $category . "']))"; - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\tstatic::generateTitle((int) \$values['" . $category . "'], \$this->table);"; - $batchcopy[] = "\t\t\t}"; - $batchcopy[] = "\t\t\telse"; - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\tstatic::generateTitle((int) \$this->table->" . $category . ", \$this->table);"; - $batchcopy[] = "\t\t\t}"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "if (isset(\$values['" . $category . "']))"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "static::generateTitle((int) \$values['" . $category . "'], \$this->table);"; + $batchcopy[] = $this->_t(3) . "}"; + $batchcopy[] = $this->_t(3) . "else"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "static::generateTitle((int) \$this->table->" . $category . ", \$this->table);"; + $batchcopy[] = $this->_t(3) . "}"; } elseif ($category && $alias && ($title && count($titles) == 1)) { - $batchcopy[] = PHP_EOL . "\t\t\tif (isset(\$values['" . $category . "']))"; - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\tlist(\$this->table->" . implode('', $titles) . ", \$this->table->" . $alias . ") = \$this->generateNewTitle(\$values['" . $category . "'], \$this->table->" . $alias . ", \$this->table->" . implode('', $titles) . ");"; - $batchcopy[] = "\t\t\t}"; - $batchcopy[] = "\t\t\telse"; - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\tlist(\$this->table->" . implode('', $titles) . ", \$this->table->" . $alias . ") = \$this->generateNewTitle(\$this->table->" . $category . ", \$this->table->" . $alias . ", \$this->table->" . implode('', $titles) . ");"; - $batchcopy[] = "\t\t\t}"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "if (isset(\$values['" . $category . "']))"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "list(\$this->table->" . implode('', $titles) . ", \$this->table->" . $alias . ") = \$this->generateNewTitle(\$values['" . $category . "'], \$this->table->" . $alias . ", \$this->table->" . implode('', $titles) . ");"; + $batchcopy[] = $this->_t(3) . "}"; + $batchcopy[] = $this->_t(3) . "else"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "list(\$this->table->" . implode('', $titles) . ", \$this->table->" . $alias . ") = \$this->generateNewTitle(\$this->table->" . $category . ", \$this->table->" . $alias . ", \$this->table->" . implode('', $titles) . ");"; + $batchcopy[] = $this->_t(3) . "}"; } elseif (!$category && $alias && ($title && count($titles) == 1)) { - $batchcopy[] = "\t\t\tlist(\$this->table->" . implode('', $titles) . ", \$this->table->" . $alias . ") = \$this->_generateNewTitle(\$this->table->" . $alias . ", \$this->table->" . implode('', $titles) . ");"; + $batchcopy[] = $this->_t(3) . "list(\$this->table->" . implode('', $titles) . ", \$this->table->" . $alias . ") = \$this->_generateNewTitle(\$this->table->" . $alias . ", \$this->table->" . implode('', $titles) . ");"; } elseif (!$category && $alias && $title) { - $batchcopy[] = "\t\t\tlist(" . implode(', ', $titleData) . ", \$this->table->" . $alias . ") = \$this->_generateNewTitle(\$this->table->" . $alias . ", array(" . implode(', ', $titleData) . "));"; + $batchcopy[] = $this->_t(3) . "list(" . implode(', ', $titleData) . ", \$this->table->" . $alias . ") = \$this->_generateNewTitle(\$this->table->" . $alias . ", array(" . implode(', ', $titleData) . "));"; } elseif (!$category && !$alias && ($title && count($titles) == 1 && !in_array('user', $titles) && !in_array('jobnumber', $titles))) // TODO [jobnumber] just for one project (not ideal) { - $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Only for strings"; - $batchcopy[] = "\t\t\tif (" . $Helper . "::checkString(\$this->table->" . implode('', $titles) . ") && !is_numeric(\$this->table->" . implode('', $titles) . "))"; - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\t\$this->table->" . implode('', $titles) . " = \$this->generateUniqe('" . implode('', $titles) . "',\$this->table->" . implode('', $titles) . ");"; - $batchcopy[] = "\t\t\t}"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Only for strings"; + $batchcopy[] = $this->_t(3) . "if (" . $Helper . "::checkString(\$this->table->" . implode('', $titles) . ") && !is_numeric(\$this->table->" . implode('', $titles) . "))"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "\$this->table->" . implode('', $titles) . " = \$this->generateUniqe('" . implode('', $titles) . "',\$this->table->" . implode('', $titles) . ");"; + $batchcopy[] = $this->_t(3) . "}"; } - $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " insert all set values"; - $batchcopy[] = "\t\t\tif (" . $Helper . "::checkArray(\$values))"; - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\tforeach (\$values as \$key => \$value)"; - $batchcopy[] = "\t\t\t\t{"; - $batchcopy[] = "\t\t\t\t\tif (strlen(\$value) > 0 && isset(\$this->table->\$key))"; - $batchcopy[] = "\t\t\t\t\t{"; - $batchcopy[] = "\t\t\t\t\t\t\$this->table->\$key = \$value;"; - $batchcopy[] = "\t\t\t\t\t}"; - $batchcopy[] = "\t\t\t\t}"; - $batchcopy[] = "\t\t\t}" . PHP_EOL; + $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " insert all set values"; + $batchcopy[] = $this->_t(3) . "if (" . $Helper . "::checkArray(\$values))"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "foreach (\$values as \$key => \$value)"; + $batchcopy[] = $this->_t(4) . "{"; + $batchcopy[] = $this->_t(5) . "if (strlen(\$value) > 0 && isset(\$this->table->\$key))"; + $batchcopy[] = $this->_t(5) . "{"; + $batchcopy[] = $this->_t(6) . "\$this->table->\$key = \$value;"; + $batchcopy[] = $this->_t(5) . "}"; + $batchcopy[] = $this->_t(4) . "}"; + $batchcopy[] = $this->_t(3) . "}" . PHP_EOL; - $batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " update all uniqe fields"; - $batchcopy[] = "\t\t\tif (" . $Helper . "::checkArray(\$uniqeFields))"; - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\tforeach (\$uniqeFields as \$uniqeField)"; - $batchcopy[] = "\t\t\t\t{"; - $batchcopy[] = "\t\t\t\t\t\$this->table->\$uniqeField = \$this->generateUniqe(\$uniqeField,\$this->table->\$uniqeField);"; - $batchcopy[] = "\t\t\t\t}"; - $batchcopy[] = "\t\t\t}"; + $batchcopy[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " update all uniqe fields"; + $batchcopy[] = $this->_t(3) . "if (" . $Helper . "::checkArray(\$uniqeFields))"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "foreach (\$uniqeFields as \$uniqeField)"; + $batchcopy[] = $this->_t(4) . "{"; + $batchcopy[] = $this->_t(5) . "\$this->table->\$uniqeField = \$this->generateUniqe(\$uniqeField,\$this->table->\$uniqeField);"; + $batchcopy[] = $this->_t(4) . "}"; + $batchcopy[] = $this->_t(3) . "}"; - $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Reset the ID because we are making a copy"; - $batchcopy[] = "\t\t\t\$this->table->id = 0;"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Reset the ID because we are making a copy"; + $batchcopy[] = $this->_t(3) . "\$this->table->id = 0;"; - $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " TODO: Deal with ordering?"; - $batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " \$this->table->ordering\t= 1;"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " TODO: Deal with ordering?"; + $batchcopy[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " \$this->table->ordering = 1;"; - $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check the row."; - $batchcopy[] = "\t\t\tif (!\$this->table->check())"; - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\t\$this->setError(\$this->table->getError());"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Check the row."; + $batchcopy[] = $this->_t(3) . "if (!\$this->table->check())"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "\$this->setError(\$this->table->getError());"; - $batchcopy[] = PHP_EOL . "\t\t\t\treturn false;"; - $batchcopy[] = "\t\t\t}"; + $batchcopy[] = PHP_EOL . $this->_t(4) . "return false;"; + $batchcopy[] = $this->_t(3) . "}"; - $batchcopy[] = PHP_EOL . "\t\t\tif (!empty(\$this->type))"; - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\t\$this->createTagsHelper(\$this->tagsObserver, \$this->type, \$pk, \$this->typeAlias, \$this->table);"; - $batchcopy[] = "\t\t\t}"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "if (!empty(\$this->type))"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "\$this->createTagsHelper(\$this->tagsObserver, \$this->type, \$pk, \$this->typeAlias, \$this->table);"; + $batchcopy[] = $this->_t(3) . "}"; - $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Store the row."; - $batchcopy[] = "\t\t\tif (!\$this->table->store())"; - $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\t\$this->setError(\$this->table->getError());"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Store the row."; + $batchcopy[] = $this->_t(3) . "if (!\$this->table->store())"; + $batchcopy[] = $this->_t(3) . "{"; + $batchcopy[] = $this->_t(4) . "\$this->setError(\$this->table->getError());"; - $batchcopy[] = PHP_EOL . "\t\t\t\treturn false;"; - $batchcopy[] = "\t\t\t}"; + $batchcopy[] = PHP_EOL . $this->_t(4) . "return false;"; + $batchcopy[] = $this->_t(3) . "}"; - $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the new item ID"; - $batchcopy[] = "\t\t\t\$newId = \$this->table->get('id');"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the new item ID"; + $batchcopy[] = $this->_t(3) . "\$newId = \$this->table->get('id');"; - $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Add the new ID to the array"; - $batchcopy[] = "\t\t\t\$newIds[\$pk] = \$newId;"; - $batchcopy[] = "\t\t}"; + $batchcopy[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Add the new ID to the array"; + $batchcopy[] = $this->_t(3) . "\$newIds[\$pk] = \$newId;"; + $batchcopy[] = $this->_t(2) . "}"; - $batchcopy[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Clean the cache"; - $batchcopy[] = "\t\t\$this->cleanCache();"; + $batchcopy[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Clean the cache"; + $batchcopy[] = $this->_t(2) . "\$this->cleanCache();"; - $batchcopy[] = PHP_EOL . "\t\treturn \$newIds;"; - $batchcopy[] = "\t}"; + $batchcopy[] = PHP_EOL . $this->_t(2) . "return \$newIds;"; + $batchcopy[] = $this->_t(1) . "}"; return PHP_EOL . implode(PHP_EOL, $batchcopy); } @@ -5557,11 +5543,11 @@ class Interpretation extends Fields $titles = array($this->titleBuilder[$viewName_single]); } // start building the fix - $fixUniqe[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Alter the " . implode(', ', $titles) . " for save as copy"; - $fixUniqe[] = "\t\tif (\$input->get('task') === 'save2copy')"; - $fixUniqe[] = "\t\t{"; - $fixUniqe[] = "\t\t\t\$origTable = clone \$this->getTable();"; - $fixUniqe[] = "\t\t\t\$origTable->load(\$input->getInt('id'));"; + $fixUniqe[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Alter the " . implode(', ', $titles) . " for save as copy"; + $fixUniqe[] = $this->_t(2) . "if (\$input->get('task') === 'save2copy')"; + $fixUniqe[] = $this->_t(2) . "{"; + $fixUniqe[] = $this->_t(3) . "\$origTable = clone \$this->getTable();"; + $fixUniqe[] = $this->_t(3) . "\$origTable->load(\$input->getInt('id'));"; // reset the buckets $ifStatment = array(); $titleVars = array(); @@ -5573,86 +5559,86 @@ class Interpretation extends Fields $ifStatment[] = "\$data['" . $title . "'] == \$origTable->" . $title; $titleVars[] = "\$" . $title; $titleData[] = "\$data['" . $title . "']"; - $titleUpdate[] = "\t\t\t\t\$data['" . $title . "'] = \$" . $title . ";"; + $titleUpdate[] = $this->_t(4) . "\$data['" . $title . "'] = \$" . $title . ";"; } - $fixUniqe[] = PHP_EOL . "\t\t\tif (" . implode(' || ', $ifStatment) . ")"; - $fixUniqe[] = "\t\t\t{"; + $fixUniqe[] = PHP_EOL . $this->_t(3) . "if (" . implode(' || ', $ifStatment) . ")"; + $fixUniqe[] = $this->_t(3) . "{"; if ($setCategory && count($titles) == 1) { - $fixUniqe[] = "\t\t\t\tlist(" . implode('', $titleVars) . ", \$" . $alias . ") = \$this->generateNewTitle(\$data['" . $category . "'], \$data['" . $alias . "'], " . implode('', $titleData) . ");"; + $fixUniqe[] = $this->_t(4) . "list(" . implode('', $titleVars) . ", \$" . $alias . ") = \$this->generateNewTitle(\$data['" . $category . "'], \$data['" . $alias . "'], " . implode('', $titleData) . ");"; } elseif (count($titles) == 1) { - $fixUniqe[] = "\t\t\t\tlist(" . implode(', ', $titleVars) . ", \$" . $alias . ") = \$this->_generateNewTitle(\$data['" . $alias . "'], " . implode('', $titleData) . ");"; + $fixUniqe[] = $this->_t(4) . "list(" . implode(', ', $titleVars) . ", \$" . $alias . ") = \$this->_generateNewTitle(\$data['" . $alias . "'], " . implode('', $titleData) . ");"; } else { - $fixUniqe[] = "\t\t\t\tlist(" . implode(', ', $titleVars) . ", \$" . $alias . ") = \$this->_generateNewTitle(\$data['" . $alias . "'], array(" . implode(', ', $titleData) . "));"; + $fixUniqe[] = $this->_t(4) . "list(" . implode(', ', $titleVars) . ", \$" . $alias . ") = \$this->_generateNewTitle(\$data['" . $alias . "'], array(" . implode(', ', $titleData) . "));"; } $fixUniqe[] = implode("\n", $titleUpdate); - $fixUniqe[] = "\t\t\t\t\$data['" . $alias . "'] = \$" . $alias . ";"; - $fixUniqe[] = "\t\t\t}"; - $fixUniqe[] = "\t\t\telse"; - $fixUniqe[] = "\t\t\t{"; - $fixUniqe[] = "\t\t\t\tif (\$data['" . $alias . "'] == \$origTable->" . $alias . ")"; - $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\t\$data['" . $alias . "'] = '';"; - $fixUniqe[] = "\t\t\t\t}"; - $fixUniqe[] = "\t\t\t}"; - $fixUniqe[] = PHP_EOL . "\t\t\t\$data['published'] = 0;"; - $fixUniqe[] = "\t\t}"; - $fixUniqe[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Automatic handling of " . $alias . " for empty fields"; - $fixUniqe[] = "\t\tif (in_array(\$input->get('task'), array('apply', 'save', 'save2new')) && (int) \$input->get('id') == 0)"; - $fixUniqe[] = "\t\t{"; - $fixUniqe[] = "\t\t\tif (\$data['" . $alias . "'] == null || empty(\$data['" . $alias . "']))"; - $fixUniqe[] = "\t\t\t{"; - $fixUniqe[] = "\t\t\t\tif (JFactory::getConfig()->get('unicodeslugs') == 1)"; - $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\t\$data['" . $alias . "'] = JFilterOutput::stringURLUnicodeSlug(" . implode(' . " " . ', $titleData) . ");"; - $fixUniqe[] = "\t\t\t\t}"; - $fixUniqe[] = "\t\t\t\telse"; - $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\t\$data['" . $alias . "'] = JFilterOutput::stringURLSafe(" . implode(' . " " . ', $titleData) . ");"; - $fixUniqe[] = "\t\t\t\t}"; - $fixUniqe[] = PHP_EOL . "\t\t\t\t\$table = JTable::getInstance('" . $viewName_single . "', '" . $this->fileContentStatic['###component###'] . "Table');"; + $fixUniqe[] = $this->_t(4) . "\$data['" . $alias . "'] = \$" . $alias . ";"; + $fixUniqe[] = $this->_t(3) . "}"; + $fixUniqe[] = $this->_t(3) . "else"; + $fixUniqe[] = $this->_t(3) . "{"; + $fixUniqe[] = $this->_t(4) . "if (\$data['" . $alias . "'] == \$origTable->" . $alias . ")"; + $fixUniqe[] = $this->_t(4) . "{"; + $fixUniqe[] = $this->_t(5) . "\$data['" . $alias . "'] = '';"; + $fixUniqe[] = $this->_t(4) . "}"; + $fixUniqe[] = $this->_t(3) . "}"; + $fixUniqe[] = PHP_EOL . $this->_t(3) . "\$data['published'] = 0;"; + $fixUniqe[] = $this->_t(2) . "}"; + $fixUniqe[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Automatic handling of " . $alias . " for empty fields"; + $fixUniqe[] = $this->_t(2) . "if (in_array(\$input->get('task'), array('apply', 'save', 'save2new')) && (int) \$input->get('id') == 0)"; + $fixUniqe[] = $this->_t(2) . "{"; + $fixUniqe[] = $this->_t(3) . "if (\$data['" . $alias . "'] == null || empty(\$data['" . $alias . "']))"; + $fixUniqe[] = $this->_t(3) . "{"; + $fixUniqe[] = $this->_t(4) . "if (JFactory::getConfig()->get('unicodeslugs') == 1)"; + $fixUniqe[] = $this->_t(4) . "{"; + $fixUniqe[] = $this->_t(5) . "\$data['" . $alias . "'] = JFilterOutput::stringURLUnicodeSlug(" . implode(' . " " . ', $titleData) . ");"; + $fixUniqe[] = $this->_t(4) . "}"; + $fixUniqe[] = $this->_t(4) . "else"; + $fixUniqe[] = $this->_t(4) . "{"; + $fixUniqe[] = $this->_t(5) . "\$data['" . $alias . "'] = JFilterOutput::stringURLSafe(" . implode(' . " " . ', $titleData) . ");"; + $fixUniqe[] = $this->_t(4) . "}"; + $fixUniqe[] = PHP_EOL . $this->_t(4) . "\$table = JTable::getInstance('" . $viewName_single . "', '" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "Table');"; if ($setCategory && count($titles) == 1) { - $fixUniqe[] = PHP_EOL . "\t\t\t\tif (\$table->load(array('" . $alias . "' => \$data['" . $alias . "'], '" . $category . "' => \$data['" . $category . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; - $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\t\$msg = JText:" . ":_('COM_" . $this->fileContentStatic['###COMPONENT###'] . "_" . $VIEW . "_SAVE_WARNING');"; - $fixUniqe[] = "\t\t\t\t}"; - $fixUniqe[] = PHP_EOL . "\t\t\t\tlist(" . implode('', $titleVars) . ", \$" . $alias . ") = \$this->generateNewTitle(\$data['" . $category . "'], \$data['" . $alias . "'], " . implode('', $titleData) . ");"; - $fixUniqe[] = "\t\t\t\t\$data['" . $alias . "'] = \$" . $alias . ";"; + $fixUniqe[] = PHP_EOL . $this->_t(4) . "if (\$table->load(array('" . $alias . "' => \$data['" . $alias . "'], '" . $category . "' => \$data['" . $category . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; + $fixUniqe[] = $this->_t(4) . "{"; + $fixUniqe[] = $this->_t(5) . "\$msg = JText:" . ":_('COM_" . $this->fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . "_" . $VIEW . "_SAVE_WARNING');"; + $fixUniqe[] = $this->_t(4) . "}"; + $fixUniqe[] = PHP_EOL . $this->_t(4) . "list(" . implode('', $titleVars) . ", \$" . $alias . ") = \$this->generateNewTitle(\$data['" . $category . "'], \$data['" . $alias . "'], " . implode('', $titleData) . ");"; + $fixUniqe[] = $this->_t(4) . "\$data['" . $alias . "'] = \$" . $alias . ";"; } else { - $fixUniqe[] = PHP_EOL . "\t\t\t\tif (\$table->load(array('" . $alias . "' => \$data['" . $alias . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; - $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\t\$msg = JText:" . ":_('COM_" . $this->fileContentStatic['###COMPONENT###'] . "_" . $VIEW . "_SAVE_WARNING');"; - $fixUniqe[] = "\t\t\t\t}"; - $fixUniqe[] = PHP_EOL . "\t\t\t\t\$data['" . $alias . "'] = \$this->_generateNewTitle(\$data['" . $alias . "']);"; + $fixUniqe[] = PHP_EOL . $this->_t(4) . "if (\$table->load(array('" . $alias . "' => \$data['" . $alias . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; + $fixUniqe[] = $this->_t(4) . "{"; + $fixUniqe[] = $this->_t(5) . "\$msg = JText:" . ":_('COM_" . $this->fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . "_" . $VIEW . "_SAVE_WARNING');"; + $fixUniqe[] = $this->_t(4) . "}"; + $fixUniqe[] = PHP_EOL . $this->_t(4) . "\$data['" . $alias . "'] = \$this->_generateNewTitle(\$data['" . $alias . "']);"; } - $fixUniqe[] = PHP_EOL . "\t\t\t\tif (isset(\$msg))"; - $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\tJFactory::getApplication()->enqueueMessage(\$msg, 'warning');"; - $fixUniqe[] = "\t\t\t\t}"; - $fixUniqe[] = "\t\t\t}"; - $fixUniqe[] = "\t\t}"; + $fixUniqe[] = PHP_EOL . $this->_t(4) . "if (isset(\$msg))"; + $fixUniqe[] = $this->_t(4) . "{"; + $fixUniqe[] = $this->_t(5) . "JFactory::getApplication()->enqueueMessage(\$msg, 'warning');"; + $fixUniqe[] = $this->_t(4) . "}"; + $fixUniqe[] = $this->_t(3) . "}"; + $fixUniqe[] = $this->_t(2) . "}"; } // handel other uniqe fields - $fixUniqe[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Alter the uniqe field for save as copy"; - $fixUniqe[] = "\t\tif (\$input->get('task') === 'save2copy')"; - $fixUniqe[] = "\t\t{"; - $fixUniqe[] = "\t\t\t//" . $this->setLine(__LINE__) . " Automatic handling of other uniqe fields"; - $fixUniqe[] = "\t\t\t\$uniqeFields = \$this->getUniqeFields();"; - $fixUniqe[] = "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$uniqeFields))"; - $fixUniqe[] = "\t\t\t{"; - $fixUniqe[] = "\t\t\t\tforeach (\$uniqeFields as \$uniqeField)"; - $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\t\$data[\$uniqeField] = \$this->generateUniqe(\$uniqeField,\$data[\$uniqeField]);"; - $fixUniqe[] = "\t\t\t\t}"; - $fixUniqe[] = "\t\t\t}"; - $fixUniqe[] = "\t\t}"; + $fixUniqe[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Alter the uniqe field for save as copy"; + $fixUniqe[] = $this->_t(2) . "if (\$input->get('task') === 'save2copy')"; + $fixUniqe[] = $this->_t(2) . "{"; + $fixUniqe[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Automatic handling of other uniqe fields"; + $fixUniqe[] = $this->_t(3) . "\$uniqeFields = \$this->getUniqeFields();"; + $fixUniqe[] = $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uniqeFields))"; + $fixUniqe[] = $this->_t(3) . "{"; + $fixUniqe[] = $this->_t(4) . "foreach (\$uniqeFields as \$uniqeField)"; + $fixUniqe[] = $this->_t(4) . "{"; + $fixUniqe[] = $this->_t(5) . "\$data[\$uniqeField] = \$this->generateUniqe(\$uniqeField,\$data[\$uniqeField]);"; + $fixUniqe[] = $this->_t(4) . "}"; + $fixUniqe[] = $this->_t(3) . "}"; + $fixUniqe[] = $this->_t(2) . "}"; return PHP_EOL . implode(PHP_EOL, $fixUniqe); } @@ -5664,76 +5650,76 @@ class Interpretation extends Fields (array_key_exists($viewName_single, $this->titleBuilder) || isset($this->customAliasBuilder[$viewName_single]))) { // get component name - $Component = $this->fileContentStatic['###Component###']; + $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; // rest the new function $newFunction = array(); - $newFunction[] = PHP_EOL . PHP_EOL . "\t/**"; - $newFunction[] = "\t* Method to change the title/s & alias."; - $newFunction[] = "\t*"; - $newFunction[] = "\t* @param string \$alias The alias."; - $newFunction[] = "\t* @param string/array \$title The title."; - $newFunction[] = "\t*"; - $newFunction[] = "\t* @return array/string Contains the modified title/s and/or alias."; - $newFunction[] = "\t*"; - $newFunction[] = "\t*/"; - $newFunction[] = "\tprotected function _generateNewTitle(\$alias, \$title = null)"; - $newFunction[] = "\t{"; - $newFunction[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Alter the title/s & alias"; - $newFunction[] = "\t\t\$table = \$this->getTable();"; - $newFunction[] = PHP_EOL . "\t\twhile (\$table->load(array('alias' => \$alias)))"; - $newFunction[] = "\t\t{"; - $newFunction[] = "\t\t\t//" . $this->setLine(__LINE__) . " Check if this is an array of titles"; - $newFunction[] = "\t\t\tif (" . $Component . "Helper::checkArray(\$title))"; - $newFunction[] = "\t\t\t{"; - $newFunction[] = "\t\t\t\tforeach(\$title as \$nr => &\$_title)"; - $newFunction[] = "\t\t\t\t{"; - $newFunction[] = "\t\t\t\t\t\$_title = JString::increment(\$_title);"; - $newFunction[] = "\t\t\t\t}"; - $newFunction[] = "\t\t\t}"; - $newFunction[] = "\t\t\t//" . $this->setLine(__LINE__) . " Make sure we have a title"; - $newFunction[] = "\t\t\telseif (\$title)"; - $newFunction[] = "\t\t\t{"; - $newFunction[] = "\t\t\t\t\$title = JString::increment(\$title);"; - $newFunction[] = "\t\t\t}"; - $newFunction[] = "\t\t\t\$alias = JString::increment(\$alias, 'dash');"; - $newFunction[] = "\t\t}"; - $newFunction[] = "\t\t//" . $this->setLine(__LINE__) . " Check if this is an array of titles"; - $newFunction[] = "\t\tif (" . $Component . "Helper::checkArray(\$title))"; - $newFunction[] = "\t\t{"; - $newFunction[] = "\t\t\t\$title[] = \$alias;"; - $newFunction[] = "\t\t\treturn \$title;"; - $newFunction[] = "\t\t}"; - $newFunction[] = "\t\t//" . $this->setLine(__LINE__) . " Make sure we have a title"; - $newFunction[] = "\t\telseif (\$title)"; - $newFunction[] = "\t\t{"; - $newFunction[] = "\t\t\treturn array(\$title, \$alias);"; - $newFunction[] = "\t\t}"; - $newFunction[] = "\t\t//" . $this->setLine(__LINE__) . " We only had an alias"; - $newFunction[] = "\t\treturn \$alias;"; - $newFunction[] = "\t}"; + $newFunction[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $newFunction[] = $this->_t(1) . " * Method to change the title/s & alias."; + $newFunction[] = $this->_t(1) . " *"; + $newFunction[] = $this->_t(1) . " * @param string \$alias The alias."; + $newFunction[] = $this->_t(1) . " * @param string/array \$title The title."; + $newFunction[] = $this->_t(1) . " *"; + $newFunction[] = $this->_t(1) . " * @return array/string Contains the modified title/s and/or alias."; + $newFunction[] = $this->_t(1) . " *"; + $newFunction[] = $this->_t(1) . " */"; + $newFunction[] = $this->_t(1) . "protected function _generateNewTitle(\$alias, \$title = null)"; + $newFunction[] = $this->_t(1) . "{"; + $newFunction[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Alter the title/s & alias"; + $newFunction[] = $this->_t(2) . "\$table = \$this->getTable();"; + $newFunction[] = PHP_EOL . $this->_t(2) . "while (\$table->load(array('alias' => \$alias)))"; + $newFunction[] = $this->_t(2) . "{"; + $newFunction[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Check if this is an array of titles"; + $newFunction[] = $this->_t(3) . "if (" . $Component . "Helper::checkArray(\$title))"; + $newFunction[] = $this->_t(3) . "{"; + $newFunction[] = $this->_t(4) . "foreach(\$title as \$nr => &\$_title)"; + $newFunction[] = $this->_t(4) . "{"; + $newFunction[] = $this->_t(5) . "\$_title = JString::increment(\$_title);"; + $newFunction[] = $this->_t(4) . "}"; + $newFunction[] = $this->_t(3) . "}"; + $newFunction[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Make sure we have a title"; + $newFunction[] = $this->_t(3) . "elseif (\$title)"; + $newFunction[] = $this->_t(3) . "{"; + $newFunction[] = $this->_t(4) . "\$title = JString::increment(\$title);"; + $newFunction[] = $this->_t(3) . "}"; + $newFunction[] = $this->_t(3) . "\$alias = JString::increment(\$alias, 'dash');"; + $newFunction[] = $this->_t(2) . "}"; + $newFunction[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check if this is an array of titles"; + $newFunction[] = $this->_t(2) . "if (" . $Component . "Helper::checkArray(\$title))"; + $newFunction[] = $this->_t(2) . "{"; + $newFunction[] = $this->_t(3) . "\$title[] = \$alias;"; + $newFunction[] = $this->_t(3) . "return \$title;"; + $newFunction[] = $this->_t(2) . "}"; + $newFunction[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Make sure we have a title"; + $newFunction[] = $this->_t(2) . "elseif (\$title)"; + $newFunction[] = $this->_t(2) . "{"; + $newFunction[] = $this->_t(3) . "return array(\$title, \$alias);"; + $newFunction[] = $this->_t(2) . "}"; + $newFunction[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " We only had an alias"; + $newFunction[] = $this->_t(2) . "return \$alias;"; + $newFunction[] = $this->_t(1) . "}"; return implode(PHP_EOL, $newFunction); } elseif (array_key_exists($viewName_single, $this->titleBuilder)) { $newFunction = array(); - $newFunction[] = PHP_EOL . PHP_EOL . "\t/**"; - $newFunction[] = "\t* Method to change the title"; - $newFunction[] = "\t*"; - $newFunction[] = "\t* @param string \$title The title."; - $newFunction[] = "\t*"; - $newFunction[] = "\t* @return array Contains the modified title and alias."; - $newFunction[] = "\t*"; - $newFunction[] = "\t*/"; - $newFunction[] = "\tprotected function _generateNewTitle(\$title)"; - $newFunction[] = "\t{"; - $newFunction[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Alter the title"; - $newFunction[] = "\t\t\$table = \$this->getTable();"; - $newFunction[] = PHP_EOL . "\t\twhile (\$table->load(array('title' => \$title)))"; - $newFunction[] = "\t\t{"; - $newFunction[] = "\t\t\t\$title = JString::increment(\$title);"; - $newFunction[] = "\t\t}"; - $newFunction[] = PHP_EOL . "\t\treturn \$title;"; - $newFunction[] = "\t}"; + $newFunction[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $newFunction[] = $this->_t(1) . " * Method to change the title"; + $newFunction[] = $this->_t(1) . " *"; + $newFunction[] = $this->_t(1) . " * @param string \$title The title."; + $newFunction[] = $this->_t(1) . " *"; + $newFunction[] = $this->_t(1) . " * @return array Contains the modified title and alias."; + $newFunction[] = $this->_t(1) . " *"; + $newFunction[] = $this->_t(1) . " */"; + $newFunction[] = $this->_t(1) . "protected function _generateNewTitle(\$title)"; + $newFunction[] = $this->_t(1) . "{"; + $newFunction[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Alter the title"; + $newFunction[] = $this->_t(2) . "\$table = \$this->getTable();"; + $newFunction[] = PHP_EOL . $this->_t(2) . "while (\$table->load(array('title' => \$title)))"; + $newFunction[] = $this->_t(2) . "{"; + $newFunction[] = $this->_t(3) . "\$title = JString::increment(\$title);"; + $newFunction[] = $this->_t(2) . "}"; + $newFunction[] = PHP_EOL . $this->_t(2) . "return \$title;"; + $newFunction[] = $this->_t(1) . "}"; return implode(PHP_EOL, $newFunction); } return ''; @@ -5769,38 +5755,38 @@ class Interpretation extends Fields } // rest the new function $newFunction = array(); - $newFunction[] = PHP_EOL . PHP_EOL . "\t/**"; - $newFunction[] = "\t* Generate a valid alias from title / date."; - $newFunction[] = "\t* Remains public to be able to check for duplicated alias before saving"; - $newFunction[] = "\t*"; - $newFunction[] = "\t* @return string"; - $newFunction[] = "\t*/"; - $newFunction[] = "\tpublic function generateAlias()"; - $newFunction[] = "\t{"; - $newFunction[] = "\t\tif (empty(\$this->alias))"; - $newFunction[] = "\t\t{"; - $newFunction[] = "\t\t\t\$this->alias = " . implode(".' '.", $titleData) . ';'; - $newFunction[] = "\t\t}"; - $newFunction[] = PHP_EOL . "\t\t\$this->alias = JApplication::stringURLSafe(\$this->alias);"; - $newFunction[] = PHP_EOL . "\t\tif (trim(str_replace('-', '', \$this->alias)) == '')"; - $newFunction[] = "\t\t{"; - $newFunction[] = "\t\t\t\$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');"; - $newFunction[] = "\t\t}"; - $newFunction[] = PHP_EOL . "\t\treturn \$this->alias;"; - $newFunction[] = "\t}"; + $newFunction[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $newFunction[] = $this->_t(1) . " * Generate a valid alias from title / date."; + $newFunction[] = $this->_t(1) . " * Remains public to be able to check for duplicated alias before saving"; + $newFunction[] = $this->_t(1) . " *"; + $newFunction[] = $this->_t(1) . " * @return string"; + $newFunction[] = $this->_t(1) . " */"; + $newFunction[] = $this->_t(1) . "public function generateAlias()"; + $newFunction[] = $this->_t(1) . "{"; + $newFunction[] = $this->_t(2) . "if (empty(\$this->alias))"; + $newFunction[] = $this->_t(2) . "{"; + $newFunction[] = $this->_t(3) . "\$this->alias = " . implode(".' '.", $titleData) . ';'; + $newFunction[] = $this->_t(2) . "}"; + $newFunction[] = PHP_EOL . $this->_t(2) . "\$this->alias = JApplication::stringURLSafe(\$this->alias);"; + $newFunction[] = PHP_EOL . $this->_t(2) . "if (trim(str_replace('-', '', \$this->alias)) == '')"; + $newFunction[] = $this->_t(2) . "{"; + $newFunction[] = $this->_t(3) . "\$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');"; + $newFunction[] = $this->_t(2) . "}"; + $newFunction[] = PHP_EOL . $this->_t(2) . "return \$this->alias;"; + $newFunction[] = $this->_t(1) . "}"; return implode(PHP_EOL, $newFunction); } // rest the new function $newFunction = array(); - $newFunction[] = PHP_EOL . PHP_EOL . "\t/**"; - $newFunction[] = "\t* This view does not actually have an alias"; - $newFunction[] = "\t*"; - $newFunction[] = "\t* @return bool"; - $newFunction[] = "\t*/"; - $newFunction[] = "\tpublic function generateAlias()"; - $newFunction[] = "\t{"; - $newFunction[] = "\t\treturn false;"; - $newFunction[] = "\t}"; + $newFunction[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $newFunction[] = $this->_t(1) . " * This view does not actually have an alias"; + $newFunction[] = $this->_t(1) . " *"; + $newFunction[] = $this->_t(1) . " * @return bool"; + $newFunction[] = $this->_t(1) . " */"; + $newFunction[] = $this->_t(1) . "public function generateAlias()"; + $newFunction[] = $this->_t(1) . "{"; + $newFunction[] = $this->_t(2) . "return false;"; + $newFunction[] = $this->_t(1) . "}"; return implode(PHP_EOL, $newFunction); } @@ -5809,7 +5795,7 @@ class Interpretation extends Fields if (isset($this->queryBuilder) && ComponentbuilderHelper::checkArray($this->queryBuilder)) { // set the main db prefix - $component = $this->fileContentStatic['###component###']; + $component = $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]; // start building the db $db = ''; foreach ($this->queryBuilder as $view => $fields) @@ -5829,9 +5815,9 @@ class Interpretation extends Fields // check if default field was over written if (!isset($this->fieldsNames[$view]['id'])) { - $db_ .= PHP_EOL . "\t`id` INT(11) NOT NULL AUTO_INCREMENT,"; + $db_ .= PHP_EOL . $this->_t(1) . "`id` INT(11) NOT NULL AUTO_INCREMENT,"; } - $db_ .= PHP_EOL . "\t`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',"; + $db_ .= PHP_EOL . $this->_t(1) . "`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',"; ksort($fields); $last_name = 'asset_id'; foreach ($fields as $field => $data) @@ -5880,7 +5866,7 @@ class Interpretation extends Fields $lenght = '(' . $data['lenght'] . ')'; } // set the field to db - $db_ .= PHP_EOL . "\t`" . $field . "` " . $data['type'] . $lenght . " " . $default . ","; + $db_ .= PHP_EOL . $this->_t(1) . "`" . $field . "` " . $data['type'] . $lenght . " " . $default . ","; // check if this a new field that should be added via SQL update if (isset($this->addSQL['field']) && isset($this->addSQL['field'][$view]) && ComponentbuilderHelper::checkArray($this->addSQL['field'][$view]) && in_array($data['ID'], $this->addSQL['field'][$view])) { @@ -5909,108 +5895,108 @@ class Interpretation extends Fields // check if default field was over written if (!isset($this->fieldsNames[$view]['params'])) { - $db_ .= PHP_EOL . "\t`params` text NOT NULL DEFAULT '',"; + $db_ .= PHP_EOL . $this->_t(1) . "`params` text NOT NULL DEFAULT '',"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['published'])) { - $db_ .= PHP_EOL . "\t`published` TINYINT(3) NOT NULL DEFAULT 1,"; + $db_ .= PHP_EOL . $this->_t(1) . "`published` TINYINT(3) NOT NULL DEFAULT 1,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['created_by'])) { - $db_ .= PHP_EOL . "\t`created_by` INT(10) unsigned NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . $this->_t(1) . "`created_by` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['modified_by'])) { - $db_ .= PHP_EOL . "\t`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . $this->_t(1) . "`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['created'])) { - $db_ .= PHP_EOL . "\t`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; + $db_ .= PHP_EOL . $this->_t(1) . "`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['modified'])) { - $db_ .= PHP_EOL . "\t`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; + $db_ .= PHP_EOL . $this->_t(1) . "`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['checked_out'])) { - $db_ .= PHP_EOL . "\t`checked_out` int(11) unsigned NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . $this->_t(1) . "`checked_out` int(11) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['checked_out_time'])) { - $db_ .= PHP_EOL . "\t`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; + $db_ .= PHP_EOL . $this->_t(1) . "`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['version'])) { - $db_ .= PHP_EOL . "\t`version` INT(10) unsigned NOT NULL DEFAULT 1,"; + $db_ .= PHP_EOL . $this->_t(1) . "`version` INT(10) unsigned NOT NULL DEFAULT 1,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['hits'])) { - $db_ .= PHP_EOL . "\t`hits` INT(10) unsigned NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . $this->_t(1) . "`hits` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if view has access if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) { - $db_ .= PHP_EOL . "\t`access` INT(10) unsigned NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . $this->_t(1) . "`access` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['ordering'])) { - $db_ .= PHP_EOL . "\t`ordering` INT(11) NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . $this->_t(1) . "`ordering` INT(11) NOT NULL DEFAULT 0,"; } // check if metadata is added to this view if (isset($this->metadataBuilder[$view]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view])) { - $db_ .= PHP_EOL . "\t`metakey` TEXT NOT NULL DEFAULT '',"; - $db_ .= PHP_EOL . "\t`metadesc` TEXT NOT NULL DEFAULT '',"; - $db_ .= PHP_EOL . "\t`metadata` TEXT NOT NULL DEFAULT '',"; + $db_ .= PHP_EOL . $this->_t(1) . "`metakey` TEXT NOT NULL DEFAULT '',"; + $db_ .= PHP_EOL . $this->_t(1) . "`metadesc` TEXT NOT NULL DEFAULT '',"; + $db_ .= PHP_EOL . $this->_t(1) . "`metadata` TEXT NOT NULL DEFAULT '',"; } - $db_ .= PHP_EOL . "\tPRIMARY KEY (`id`)"; + $db_ .= PHP_EOL . $this->_t(1) . "PRIMARY KEY (`id`)"; if (isset($this->dbUniqueKeys[$view]) && ComponentbuilderHelper::checkArray($this->dbUniqueKeys[$view])) { foreach ($this->dbUniqueKeys[$view] as $nr => $key) { - $db_ .= "," . PHP_EOL . "\tUNIQUE KEY `idx_" . $key . "` (`" . $key . "`)"; + $db_ .= "," . PHP_EOL . $this->_t(1) . "UNIQUE KEY `idx_" . $key . "` (`" . $key . "`)"; } } // check if view has access if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) { - $db_ .= "," . PHP_EOL . "\tKEY `idx_access` (`access`)"; + $db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_access` (`access`)"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['checked_out'])) { - $db_ .= "," . PHP_EOL . "\tKEY `idx_checkout` (`checked_out`)"; + $db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_checkout` (`checked_out`)"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['created_by'])) { - $db_ .= "," . PHP_EOL . "\tKEY `idx_createdby` (`created_by`)"; + $db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_createdby` (`created_by`)"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['modified_by'])) { - $db_ .= "," . PHP_EOL . "\tKEY `idx_modifiedby` (`modified_by`)"; + $db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_modifiedby` (`modified_by`)"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['published'])) { - $db_ .= "," . PHP_EOL . "\tKEY `idx_state` (`published`)"; + $db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_state` (`published`)"; } if (isset($this->dbKeys[$view]) && ComponentbuilderHelper::checkArray($this->dbKeys[$view])) { foreach ($this->dbKeys[$view] as $nr => $key) { - $db_ .= "," . PHP_EOL . "\tKEY `idx_" . $key . "` (`" . $key . "`)"; + $db_ .= "," . PHP_EOL . $this->_t(1) . "KEY `idx_" . $key . "` (`" . $key . "`)"; } } $db_ .= PHP_EOL . ") ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;"; @@ -6030,7 +6016,7 @@ class Interpretation extends Fields { foreach ($this->customScriptBuilder['sql'] as $for => $customSql) { - $placeholders = array('[[[component]]]' => $component, '[[[view]]]' => $for); + $placeholders = array($this->bbb . 'component' . $this->ddd => $component, $this->bbb . 'view' . $this->ddd => $for); $db .= $this->setPlaceholders($customSql, $placeholders) . PHP_EOL . PHP_EOL; } unset($this->customScriptBuilder['sql']); @@ -6319,14 +6305,23 @@ class Interpretation extends Fields } } + /** + * set the list body + * + * @param string $viewName_single + * @param string $viewName_list + * + * @return string + */ public function setListBody($viewName_single, $viewName_list) { 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'; // setup correct core target $coreLoad = false; + $core = null; if (isset($this->permissionCore[$viewName_single])) { $core = $this->permissionCore[$viewName_single]; @@ -6336,70 +6331,70 @@ class Interpretation extends Fields $firstTimeBeingAdded = true; // add the default $body = "items as \$i => \$item): ?>"; - $body .= PHP_EOL . "\tuser->authorise('core.manage', 'com_checkin') || \$item->checked_out == \$this->user->id || \$item->checked_out == 0;"; - $body .= PHP_EOL . "\t\t\$userChkOut = JFactory::getUser(\$item->checked_out);"; - $body .= PHP_EOL . "\t\t\$canDo = " . $Helper . "::getActions('" . $viewName_single . "',\$item,'" . $viewName_list . "');"; - $body .= PHP_EOL . "\t?>"; - $body .= PHP_EOL . "\t" . ''; + $body .= PHP_EOL . $this->_t(1) . "_t(2) . "\$canCheckin = \$this->user->authorise('core.manage', 'com_checkin') || \$item->checked_out == \$this->user->id || \$item->checked_out == 0;"; + $body .= PHP_EOL . $this->_t(2) . "\$userChkOut = JFactory::getUser(\$item->checked_out);"; + $body .= PHP_EOL . $this->_t(2) . "\$canDo = " . $Helper . "::getActions('" . $viewName_single . "',\$item,'" . $viewName_list . "');"; + $body .= PHP_EOL . $this->_t(1) . "?>"; + $body .= PHP_EOL . $this->_t(1) . ''; // only load if not over written if (!isset($this->fieldsNames[$viewName_single]['ordering'])) { - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . $this->_t(2) . ''; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) { - $body .= PHP_EOL . "\t\tget('" . $core['core.edit.state'] . "')): ?>"; + $body .= PHP_EOL . $this->_t(2) . "get('" . $core['core.edit.state'] . "')): ?>"; } else { - $body .= PHP_EOL . "\t\tget('core.edit.state')): ?>"; + $body .= PHP_EOL . $this->_t(2) . "get('core.edit.state')): ?>"; } - $body .= PHP_EOL . "\t\t\tsaveOrder)"; - $body .= PHP_EOL . "\t\t\t\t{"; - $body .= PHP_EOL . "\t\t\t\t\t\$iconClass = ' inactive';"; - $body .= PHP_EOL . "\t\t\t\t}"; - $body .= PHP_EOL . "\t\t\t\telse"; - $body .= PHP_EOL . "\t\t\t\t{"; - $body .= PHP_EOL . "\t\t\t\t\t\$iconClass = ' inactive tip-top" . '" hasTooltip" title="' . "' . JHtml::tooltipText('JORDERINGDISABLED');"; - $body .= PHP_EOL . "\t\t\t\t}"; - $body .= PHP_EOL . "\t\t\t?>"; - $body .= PHP_EOL . "\t\t\t" . ''; - $body .= PHP_EOL . "\t\t\t\t" . ''; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\tsaveOrder) : ?>"; - $body .= PHP_EOL . "\t\t\t\t" . ''; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t\t⋮"; - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . $this->_t(3) . "_t(4) . "if (\$this->saveOrder)"; + $body .= PHP_EOL . $this->_t(4) . "{"; + $body .= PHP_EOL . $this->_t(5) . "\$iconClass = ' inactive';"; + $body .= PHP_EOL . $this->_t(4) . "}"; + $body .= PHP_EOL . $this->_t(4) . "else"; + $body .= PHP_EOL . $this->_t(4) . "{"; + $body .= PHP_EOL . $this->_t(5) . "\$iconClass = ' inactive tip-top" . '" hasTooltip" title="' . "' . JHtml::tooltipText('JORDERINGDISABLED');"; + $body .= PHP_EOL . $this->_t(4) . "}"; + $body .= PHP_EOL . $this->_t(3) . "?>"; + $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(4) . ''; + $body .= PHP_EOL . $this->_t(3) . ""; + $body .= PHP_EOL . $this->_t(3) . "saveOrder) : ?>"; + $body .= PHP_EOL . $this->_t(4) . '_t(4) . 'value="ordering; ?>" class="width-20 text-area-order " />'; + $body .= PHP_EOL . $this->_t(3) . ""; + $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . $this->_t(3) . "⋮"; + $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . $this->_t(2) . ""; } - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . $this->_t(2) . ''; // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) { - $body .= PHP_EOL . "\t\tget('" . $core['core.edit'] . "')): ?>"; + $body .= PHP_EOL . $this->_t(2) . "get('" . $core['core.edit'] . "')): ?>"; } else { - $body .= PHP_EOL . "\t\tget('core.edit')): ?>"; + $body .= PHP_EOL . $this->_t(2) . "get('core.edit')): ?>"; } - $body .= PHP_EOL . "\t\t\t\tchecked_out) : ?>"; - $body .= PHP_EOL . "\t\t\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t\t\tid); ?>"; - $body .= PHP_EOL . "\t\t\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t\t\t□"; - $body .= PHP_EOL . "\t\t\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t\tid); ?>"; - $body .= PHP_EOL . "\t\t\t\t"; - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t\t□"; - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . $this->_t(4) . "checked_out) : ?>"; + $body .= PHP_EOL . $this->_t(5) . ""; + $body .= PHP_EOL . $this->_t(6) . "id); ?>"; + $body .= PHP_EOL . $this->_t(5) . ""; + $body .= PHP_EOL . $this->_t(6) . "□"; + $body .= PHP_EOL . $this->_t(5) . ""; + $body .= PHP_EOL . $this->_t(4) . ""; + $body .= PHP_EOL . $this->_t(5) . "id); ?>"; + $body .= PHP_EOL . $this->_t(4) . ""; + $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . $this->_t(3) . "□"; + $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . $this->_t(2) . ""; // check if this view has fields that should not be escaped $doNotEscape = false; if (isset($this->doNotEscape[$viewName_list])) @@ -6409,234 +6404,60 @@ class Interpretation extends Fields // start adding the dynamic foreach ($this->listBuilder[$viewName_list] as $item) { - $checkoutTriger = false; - if (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && isset($item['custom']['table']) && ComponentbuilderHelper::checkString($item['custom']['table'])) + // set some defaults + $customAdminViewButtons = ''; + // set the item default class + $itemClass = 'hidden-phone'; + // set the item row + $itemRow = $this->getListItemBuilder($item, $viewName_single, $viewName_list, $itemClass, $doNotEscape, $coreLoad, $core); + // check if buttons was aready added + if ($firstTimeBeingAdded) // TODO we must improve this to allow more items to be targeted instead of just the first item :) { - $item['id'] = $item['code']; - if (!$item['multiple']) - { - $item['code'] = $item['code'] . '_' . $item['custom']['text']; - } - } - // check if translated value is used - if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($item['code'], $this->selectionTranslationFixBuilder[$viewName_list])) - { - $itemCode = '' . $item['code'] . '); ?>'; - } - elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['text'] === 'user') - { - $itemCode = '' . $item['code'] . ')->name; ?>'; - } - elseif ($doNotEscape) - { - if (in_array($item['code'], $this->doNotEscape[$viewName_list])) - { - $itemCode = '' . $item['code'] . '; ?>'; - } - else - { - $itemCode = 'escape($item->' . $item['code'] . '); ?>'; - } - } - else - { - $itemCode = 'escape($item->' . $item['code'] . '); ?>'; - } - if ($item['link']) - { - // allways rest custom links - $customAdminView = ''; - // if to be linked - if ($item['type'] === 'category' && !$item['title']) - { - $otherViews = $this->catCodeBuilder[$viewName_single]['views']; - // category and linked - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tuser->authorise('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\t"; - $body .= PHP_EOL . "\t\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - elseif ($item['type'] === 'user' && !$item['title']) - { - // user and linked - $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - else - { - $add = true; - if (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] != 'user' && !$item['title']) - { - // link to that item instead - $link = 'index.php?option=' . $item['custom']['component'] . '&view=' . $item['custom']['views'] . '&task=' . $item['custom']['view'] . '.edit&id=' . $item['id'] . '; ?>&ref=' . $viewName_list; - - $coreLoadLink = false; - if (isset($this->permissionCore[$item['custom']['view']])) - { - $coreLink = $this->permissionCore[$item['custom']['view']]; - $coreLoadLink = true; - } - // check if the item has permissions. - if ($coreLoadLink && (isset($coreLink['core.edit']) && isset($this->permissionBuilder[$coreLink['core.edit']])) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$coreLink['core.edit']]) && in_array($item['custom']['view'], $this->permissionBuilder[$coreLink['core.edit']])) - { - $accessCheck = "\$this->user->authorise('" . $coreLink['core.edit'] . "', 'com_" . $this->fileContentStatic['###component###'] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; - } - else - { - $accessCheck = "\$this->user->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; - } - } - elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && !$item['title']) - { - // user and linked - $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - - $add = false; - } - else - { - // start building the links - $link = '&id=id; ?>'; - // check if custom links should be added to this list views - if (isset($this->customAdminViewListLink[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customAdminViewListLink[$viewName_list]) && $firstTimeBeingAdded) - { - // make sure the custom links are only added once - $firstTimeBeingAdded = false; - // start building the links - $customAdminView = PHP_EOL . "\t\t\t" . '
    '; - 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"; - $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; - $customAdminView .= PHP_EOL . "\t\t\t"; - } - $customAdminView .= PHP_EOL . "\t\t\t" . '
    '; - } - // check if the item has permissions. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) - { - // set permissions. - $accessCheck = "\$canDo->get('" . $core['core.edit'] . "')"; - } - else - { - // set permissions. - $accessCheck = "\$canDo->get('core.edit')"; - } - // triger the checked out script to be added - $checkoutTriger = true; - } - - if ($add) - { - // set as linked - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t" . '
    ' . PHP_EOL . "\t\t\t\t\t" . '' . $itemCode . ''; - if ($checkoutTriger) - { - $body .= PHP_EOL . "\t\t\t\t\tchecked_out): ?>"; - $body .= PHP_EOL . "\t\t\t\t\t\tname, \$item->checked_out_time, '" . $viewName_list . ".', \$canCheckin); ?>"; - $body .= PHP_EOL . "\t\t\t\t\t"; - } - $body .= PHP_EOL . "\t\t\t\t" . '
    '; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t" . '
    ' . $itemCode . '
    '; - $body .= PHP_EOL . "\t\t\t"; - $body .= $customAdminView; - $body .= PHP_EOL . "\t\t"; - } - } - } - else - { - if ($item['type'] === 'category') - { - $body .= PHP_EOL . "\t\tsetListFieldClass($item['code'], $viewName_list, 'hidden-phone') . "\">"; - $body .= PHP_EOL . "\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL . "\t\t"; - } - elseif (ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user') - { - // custom user and linked - $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - elseif ($item['type'] === 'user') - { - // user name only - $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t"; - } - else - { - // normal not linked - $body .= PHP_EOL . "\t\tsetListFieldClass($item['code'], $viewName_list, 'hidden-phone') . "\">"; - $body .= PHP_EOL . "\t\t\t" . $itemCode; - $body .= PHP_EOL . "\t\t"; - } + // get custom admin view buttons + $customAdminViewButtons = $this->getCustomAdminViewButtons($item, $viewName_single, $viewName_list, $coreLoad); + // make sure the custom admin view buttons are only added once + $firstTimeBeingAdded = false; } + // add row to body + $body .= PHP_EOL . $this->_t(2) . "getListFieldClass($item['code'], $viewName_list, $itemClass) . "\">"; + $body .= $itemRow; + $body .= $customAdminViewButtons; + $body .= PHP_EOL . $this->_t(2) . ""; } // add the defaults if (!isset($this->fieldsNames[$viewName_single]['published'])) { - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . $this->_t(2) . ''; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) { - $body .= PHP_EOL . "\t\tget('" . $core['core.edit.state'] . "')) : ?>"; + $body .= PHP_EOL . $this->_t(2) . "get('" . $core['core.edit.state'] . "')) : ?>"; } else { - $body .= PHP_EOL . "\t\tget('core.edit.state')) : ?>"; + $body .= PHP_EOL . $this->_t(2) . "get('core.edit.state')) : ?>"; } - $body .= PHP_EOL . "\t\t\t\tchecked_out) : ?>"; - $body .= PHP_EOL . "\t\t\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t\t\tpublished, \$i, '" . $viewName_list . ".', true, 'cb'); ?>"; - $body .= PHP_EOL . "\t\t\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t\t\tpublished, \$i, '" . $viewName_list . ".', false, 'cb'); ?>"; - $body .= PHP_EOL . "\t\t\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t\tpublished, \$i, '" . $viewName_list . ".', true, 'cb'); ?>"; - $body .= PHP_EOL . "\t\t\t\t"; - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t\tpublished, \$i, '" . $viewName_list . ".', false, 'cb'); ?>"; - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . $this->_t(4) . "checked_out) : ?>"; + $body .= PHP_EOL . $this->_t(5) . ""; + $body .= PHP_EOL . $this->_t(6) . "published, \$i, '" . $viewName_list . ".', true, 'cb'); ?>"; + $body .= PHP_EOL . $this->_t(5) . ""; + $body .= PHP_EOL . $this->_t(6) . "published, \$i, '" . $viewName_list . ".', false, 'cb'); ?>"; + $body .= PHP_EOL . $this->_t(5) . ""; + $body .= PHP_EOL . $this->_t(4) . ""; + $body .= PHP_EOL . $this->_t(5) . "published, \$i, '" . $viewName_list . ".', true, 'cb'); ?>"; + $body .= PHP_EOL . $this->_t(4) . ""; + $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . $this->_t(3) . "published, \$i, '" . $viewName_list . ".', false, 'cb'); ?>"; + $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . $this->_t(2) . ""; } if (!isset($this->fieldsNames[$viewName_single]['id'])) { - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tid; ?>"; - $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . $this->_t(3) . "id; ?>"; + $body .= PHP_EOL . $this->_t(2) . ""; } - $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . $this->_t(1) . ""; $body .= PHP_EOL . ""; // return the build return $body; @@ -6644,11 +6465,382 @@ class Interpretation extends Fields return ''; } - protected function setListFieldClass($name, $listViewName, $default = '') + /** + * Get the list item dynamic row + * + * @param array $item The item array + * @param string $viewName_single The single view code name + * @param string $viewName_list The list view code name + * @param string $itemClass The table row default class + * @param bool $doNotEscape The do not escape global switch + * @param bool $coreLoad The core permission loader switch + * @param array $core The core permission values + * @param bool $class The dive class adding switch + * @param string $ref The link referral string + * @param string $escape The escape code name + * @param string $user The user code name + * @param string $refview The override of the referral view code name + * + * @return string of the completer item value for the table row + * + */ + protected function getListItemBuilder($item, $viewName_single, $viewName_list, &$itemClass, $doNotEscape, $coreLoad, $core, $class = true, $ref = null, $escape = '$this->escape', $user = '$this->user', $refview = null) + { + // check if we have relation fields + if (isset($this->fieldRelations[$viewName_list]) && + isset($this->fieldRelations[$viewName_list][(int) $item['id']]) && + isset($this->fieldRelations[$viewName_list][(int) $item['id']]['area']) && + $this->fieldRelations[$viewName_list][(int) $item['id']]['area'] == 2 && + isset($this->fieldRelations[$viewName_list][(int) $item['id']]['joinfields']) && + ComponentbuilderHelper::checkArray($this->fieldRelations[$viewName_list][(int) $item['id']]['joinfields'])) + { + // set the fields array + $field = array(); + // load the main list view field + $field['[field=' . (int) $item['id'] . ']'] = $this->getListItem($item, $viewName_single, $viewName_list, $itemClass, $doNotEscape, $coreLoad, $core, false, $ref, $escape, $user, $refview); + // now load the relations + foreach ($this->fieldRelations[$viewName_list][(int) $item['id']]['joinfields'] as $join) + { + $blankClass = ''; + if (isset($this->listJoinBuilder[$viewName_list]) && isset($this->listJoinBuilder[$viewName_list][(int) $join])) + { + $field['[field=' . (int) $join . ']'] = $this->getListItem($this->listJoinBuilder[$viewName_list][(int) $join], $viewName_single, $viewName_list, $blankClass, $doNotEscape, $coreLoad, $core, false, $ref, $escape, $user, $refview); + } + } + // join based on join type + if (isset($this->fieldRelations[$viewName_list][(int) $item['id']]['join_type']) && $this->fieldRelations[$viewName_list][(int) $item['id']]['join_type'] == 2 && + isset($this->fieldRelations[$viewName_list][(int) $item['id']]['set']) && ComponentbuilderHelper::checkString($this->fieldRelations[$viewName_list][(int) $item['id']]['set'])) + { + // custom code + return PHP_EOL . $this->_t(3) . "
    " . str_replace(array_keys($field), array_values($field), $this->fieldRelations[$viewName_list][(int) $item['id']]['set']) . PHP_EOL . $this->_t(3) . "
    "; + } + elseif (isset($this->fieldRelations[$viewName_list][(int) $item['id']]['set']) && ComponentbuilderHelper::checkString($this->fieldRelations[$viewName_list][(int) $item['id']]['set'])) + { + // concatenate + return PHP_EOL . $this->_t(3) . "
    " . implode($this->fieldRelations[$viewName_list][(int) $item['id']]['set'], $field) . PHP_EOL . $this->_t(3) . "
    "; + } + // default + return PHP_EOL . $this->_t(3) . "
    " . implode(' ', $field) . PHP_EOL . $this->_t(3) . "
    "; + } + return $this->getListItem($item, $viewName_single, $viewName_list, $itemClass, $doNotEscape, $coreLoad, $core, $class, $ref, $escape, $user, $refview); + } + + /** + * Get the list item row value + * + * @param array $item The item array + * @param string $viewName_single The single view code name + * @param string $viewName_list The list view code name + * @param string $itemClass The table row default class + * @param bool $doNotEscape The do not escape global switch + * @param bool $coreLoad The core permission loader switch + * @param array $core The core permission values + * @param bool $class The dive class adding switch + * @param string $ref The link referral string + * @param string $escape The escape code name + * @param string $user The user code name + * @param string $refview The override of the referral view code name + * + * @return string of the single item value for the table row + * + */ + protected function getListItem($item, $viewName_single, $viewName_list, &$itemClass, $doNotEscape, $coreLoad, $core, $class = true, $ref = null, $escape = '$this->escape', $user = '$this->user', $refview = null) + { + // get list item code + $itemCode = $this->getListItemCode($item, $viewName_list, $doNotEscape, $escape); + // add default links + $defaultLink = true; + if (ComponentbuilderHelper::checkString($refview) && isset($item['custom']) && isset($item['custom']['view']) && $refview === $item['custom']['view']) + { + $defaultLink = false; + } + // is this a linked item + if (($item['link'] || (ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user')) && $defaultLink) + { + // set some defaults + $checkoutTriger = false; + // set the item default class + $itemClass = 'nowrap'; + // get list item link + $itemLink = $this->getListItemLink($item, $checkoutTriger, $viewName_single, $viewName_list, $ref); + // get list item link authority + $itemLinkAuthority = $this->getListItemLinkAuthority($item, $viewName_single, $viewName_list, $coreLoad, $core, $user); + // set item row + return $this->getListItemLinkLogic($itemCode, $itemLink, $itemLinkAuthority, $viewName_list, $checkoutTriger, $class); + } + // return the default (no link) + return PHP_EOL . $this->_t(3) . ""; + } + + /** + * Get the list item link logic + * + * @param string $itemCode The item code string + * @param string $itemLink The item link string + * @param string $itemLinkAuthority The link authority string + * @param string $viewName_list The list view code name + * @param bool $checkoutTriger The check out trigger + * @param bool $class The dive class adding switch + * + * @return string of the complete link logic of row item + * + */ + protected function getListItemLinkLogic($itemCode, $itemLink, $itemLinkAuthority, $viewName_list, $checkoutTriger, $class = true) + { + // build link + $link = ''; + // add class + $tab = ''; + if ($class) + { + $link .= PHP_EOL . $this->_t(3) . '
    '; + $tab = $this->_t(1); + } + // the link logic + $link .= PHP_EOL . $tab . $this->_t(3) . ""; + $link .= PHP_EOL . $tab . $this->_t(4) . ''; + if ($checkoutTriger) + { + $link .= PHP_EOL . $tab . $this->_t(4) . "checked_out): ?>"; + $link .= PHP_EOL . $tab . $this->_t(5) . "name, \$item->checked_out_time, '" . $viewName_list . ".', \$canCheckin); ?>"; + $link .= PHP_EOL . $tab . $this->_t(4) . ""; + } + $link .= PHP_EOL . $tab . $this->_t(3) . ""; + $link .= PHP_EOL . $tab . $this->_t(4) . ""; + $link .= PHP_EOL . $tab . $this->_t(3) . ""; + // add class + if ($class) + { + $link .= PHP_EOL . $this->_t(3) . "
    "; + } + // return the link logic + return $link; + } + + /** + * Get the custom admin view buttons + * + * @param string $viewName_list The list view code name + * @param string $ref The link referral string + * + * @return string of the custom admin view buttons + * + */ + protected function getCustomAdminViewButtons($viewName_list, $ref = '') + { + $customAdminViewButton = ''; + // check if custom links should be added to this list views + if (isset($this->customAdminViewListLink[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customAdminViewListLink[$viewName_list])) + { + // start building the links + $customAdminViewButton .= PHP_EOL . $this->_t(3) . '
    '; + foreach ($this->customAdminViewListLink[$viewName_list] as $customLinkView) + { + $customAdminViewButton .= PHP_EOL . $this->_t(3) . "get('" . $customLinkView['link'] . ".access')): ?>"; + $customAdminViewButton .= PHP_EOL . $this->_t(4) . 'fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . '_' . $customLinkView['NAME'] . "'" . '); ?>" >'; + $customAdminViewButton .= PHP_EOL . $this->_t(3) . ""; + $customAdminViewButton .= PHP_EOL . $this->_t(4) . 'fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; + $customAdminViewButton .= PHP_EOL . $this->_t(3) . ""; + } + $customAdminViewButton .= PHP_EOL . $this->_t(3) . '
    '; + } + return $customAdminViewButton; + } + + /** + * Get the list item code value + * + * @param array $item The item array + * @param string $viewName_list The list view code name + * @param bool $doNotEscape The do not escape global switch + * @param string $escape The escape code name + * + * @return string of the single item code + * + */ + protected function getListItemCode(&$item, $viewName_list, $doNotEscape, $escape = '$this->escape') + { + // first update the code id needed + if (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && isset($item['custom']['table']) && ComponentbuilderHelper::checkString($item['custom']['table'])) + { + $item['id_code'] = $item['code']; + if (!$item['multiple']) + { + $item['code'] = $item['code'] . '_' . $item['custom']['text']; + } + } + // check if category + if ($item['type'] === 'category' && !$item['title']) + { + return $escape . '($item->category_title)'; + } + // check if user + elseif ($item['type'] === 'user') + { + return 'JFactory::getUser((int)$item->' . $item['code'] . ')->name'; + } + // check if custom user + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && isset($item['id_code'])) + { + return 'JFactory::getUser((int)$item->' . $item['id_code'] . ')->name'; + } + // check if translated value is used + elseif (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($item['code'], $this->selectionTranslationFixBuilder[$viewName_list])) + { + return 'JText:' . ':_($item->' . $item['code'] . ')'; + } + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['text'] === 'user') + { + return 'JFactory::getUser((int)$item->' . $item['code'] . ')->name'; + } + elseif ($doNotEscape) + { + if (in_array($item['code'], $this->doNotEscape[$viewName_list])) + { + return '$item->' . $item['code']; + } + } + // default + return $escape . '($item->' . $item['code'] . ')'; + } + + /** + * Get the list item link + * + * @param array $item The item array + * @param bool $checkoutTriger The checkout trigger switch + * @param string $viewName_single The single view code name + * @param string $viewName_list The list view code name + * @param string $ref The link referral string + * + * @return string of the single item link + * + */ + protected function getListItemLink($item, &$checkoutTriger, $viewName_single, $viewName_list, $ref = null) + { + // set referal if not set + $referal = ''; + if (!$ref) + { + $ref = '&ref=' . $viewName_list; + } + // in linked tab/view so must add ref to default + else + { + $referal = $ref; + } + // if to be linked + if ($item['type'] === 'category' && !$item['title']) + { + // get the other view + $otherViews = $this->catCodeBuilder[$viewName_single]['views']; + // return the link to category + return 'index.php?option=com_categories&task=category.edit&id=' . $item['code'] . '; ?>&extension=com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.' . $otherViews; + } + elseif ($item['type'] === 'user' && !$item['title']) + { + // return user link + return 'index.php?option=com_users&task=user.edit&id=' . $item['code'] . ' ?>'; + } + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] != 'user' && !$item['title'] && isset($item['id_code'])) + { + // link to that linked item + return 'index.php?option=' . $item['custom']['component'] . '&view=' . $item['custom']['views'] . '&task=' . $item['custom']['view'] . '.edit&id=' . $item['id_code'] . '; ?>' . $ref; + } + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && !$item['title'] && isset($item['id_code'])) + { + // return user link + return 'index.php?option=com_users&task=user.edit&id=' . $item['id_code'] . ' ?>'; + } + // make sure to triger the checkout + $checkoutTriger = true; + // basic default item link + return '&id=id; ?>' . $referal; + } + + /** + * Get the list item authority + * + * @param array $item The item array + * @param string $viewName_single The single view code name + * @param string $viewName_list The list view code name + * @param bool $coreLoad The core permission loader switch + * @param array $core The core permission values + * @param string $user The user code name + * + * @return string of the single item link authority + * + */ + protected function getListItemLinkAuthority($item, $viewName_single, $viewName_list, $coreLoad, $core, $user = '$this->user') + { + // if to be linked + if ($item['type'] === 'category' && !$item['title']) + { + // get the other view + $otherViews = $this->catCodeBuilder[$viewName_single]['views']; + // return the authority to category + return $user . "->authorise('core.edit', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")"; + } + elseif ($item['type'] === 'user' && !$item['title']) + { + // return user authority + return $user . "->authorise('core.edit', 'com_users')"; + } + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] != 'user' && !$item['title'] && isset($item['id_code'])) + { + // link to that linked item + $coreLoadLink = false; + if (isset($this->permissionCore[$item['custom']['view']])) + { + $coreLink = $this->permissionCore[$item['custom']['view']]; + $coreLoadLink = true; + } + // check if the item has permissions. + if ($coreLoadLink && (isset($coreLink['core.edit']) && isset($this->permissionBuilder[$coreLink['core.edit']])) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$coreLink['core.edit']]) && in_array($item['custom']['view'], $this->permissionBuilder[$coreLink['core.edit']])) + { + return $user . "->authorise('" . $coreLink['core.edit'] . "', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id_code'] . ")"; + } + // return default for this external item + return $user . "->authorise('core.edit', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id_code'] . ")"; + } + elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && !$item['title'] && isset($item['id_code'])) + { + // return user link + return $user . "->authorise('core.edit', 'com_users')"; + } + // check if the item has custom permissions. + elseif ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) + { + // set permissions. + return "\$canDo->get('" . $core['core.edit'] . "')"; + } + // set core permissions. + return "\$canDo->get('core.edit')"; + } + + /** + * Get the list field class + * + * @param string $name The field code name + * @param string $listViewName The list view code name + * @param string $default The default + * + * @return string The list field class + * + */ + protected function getListFieldClass($name, $listViewName, $default = '') { return (isset($this->listFieldClass[$listViewName]) && isset($this->listFieldClass[$listViewName][$name])) ? $this->listFieldClass[$listViewName][$name] : $default; } + /** + * set the list body table head + * + * @param string $viewName_single + * @param string $viewName_list + * + * @return string + */ public function setListHead($viewName_single, $viewName_list) { if (isset($this->listBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listBuilder[$viewName_list])) @@ -6671,29 +6863,35 @@ class Interpretation extends Fields } // set default $head = ''; - $head .= PHP_EOL . "\tcanEdit&& \$this->canState): ?>"; + $head .= PHP_EOL . $this->_t(1) . "canEdit&& \$this->canState): ?>"; if (!isset($this->fieldsNames[$viewName_single]['ordering'])) { - $head .= PHP_EOL . "\t\t" . ''; - $head .= PHP_EOL . "\t\t\t' . "', 'ordering', \$this->listDirn, \$this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>"; - $head .= PHP_EOL . "\t\t"; + $head .= PHP_EOL . $this->_t(2) . ''; + $head .= PHP_EOL . $this->_t(3) . "' . "', 'ordering', \$this->listDirn, \$this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>"; + $head .= PHP_EOL . $this->_t(2) . ""; } - $head .= PHP_EOL . "\t\t" . ''; - $head .= PHP_EOL . "\t\t\t"; - $head .= PHP_EOL . "\t\t"; - $head .= PHP_EOL . "\t"; - $head .= PHP_EOL . "\t\t" . ''; - $head .= PHP_EOL . "\t\t\t▾"; - $head .= PHP_EOL . "\t\t"; - $head .= PHP_EOL . "\t\t" . ''; - $head .= PHP_EOL . "\t\t\t■"; - $head .= PHP_EOL . "\t\t"; - $head .= PHP_EOL . "\t"; + $head .= PHP_EOL . $this->_t(2) . ''; + $head .= PHP_EOL . $this->_t(3) . ""; + $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . $this->_t(1) . ""; + $head .= PHP_EOL . $this->_t(2) . ''; + $head .= PHP_EOL . $this->_t(3) . "▾"; + $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . $this->_t(2) . ''; + $head .= PHP_EOL . $this->_t(3) . "■"; + $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . $this->_t(1) . ""; // set footer Column number $this->listColnrBuilder[$viewName_list] = 4; // build the dynamic fields foreach ($this->listBuilder[$viewName_list] as $item) { + // check if we have an over-ride + if (isset($this->listHeadOverRide[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listHeadOverRide[$viewName_list]) && isset($this->listHeadOverRide[$viewName_list][$item['id']])) + { + $item['lang'] = $this->listHeadOverRide[$viewName_list][$item['id']]; + } + // set the custom code if (ComponentbuilderHelper::checkArray($item['custom'])) { $item['code'] = $item['code'] . '_' . $item['custom']['text']; @@ -6708,29 +6906,29 @@ class Interpretation extends Fields { $title = "listDirn, \$this->listOrder); ?>"; } - $head .= PHP_EOL . "\t" . ''; - $head .= PHP_EOL . "\t\t\t" . $title; - $head .= PHP_EOL . "\t"; + $head .= PHP_EOL . $this->_t(1) . ''; + $head .= PHP_EOL . $this->_t(3) . $title; + $head .= PHP_EOL . $this->_t(1) . ""; $this->listColnrBuilder[$viewName_list] ++; } // set default if (!isset($this->fieldsNames[$viewName_single]['published'])) { - $head .= PHP_EOL . "\tcanState): ?>"; - $head .= PHP_EOL . "\t\t" . ''; - $head .= PHP_EOL . "\t\t\tlistDirn, \$this->listOrder); ?>"; - $head .= PHP_EOL . "\t\t"; - $head .= PHP_EOL . "\t"; - $head .= PHP_EOL . "\t\t" . ''; - $head .= PHP_EOL . "\t\t\t"; - $head .= PHP_EOL . "\t\t"; - $head .= PHP_EOL . "\t"; + $head .= PHP_EOL . $this->_t(1) . "canState): ?>"; + $head .= PHP_EOL . $this->_t(2) . ''; + $head .= PHP_EOL . $this->_t(3) . "listDirn, \$this->listOrder); ?>"; + $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . $this->_t(1) . ""; + $head .= PHP_EOL . $this->_t(2) . ''; + $head .= PHP_EOL . $this->_t(3) . ""; + $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . $this->_t(1) . ""; } if (!isset($this->fieldsNames[$viewName_single]['id'])) { - $head .= PHP_EOL . "\t" . ''; - $head .= PHP_EOL . "\t\t\tlistDirn, \$this->listOrder); ?>"; - $head .= PHP_EOL . "\t"; + $head .= PHP_EOL . $this->_t(1) . ''; + $head .= PHP_EOL . $this->_t(3) . "listDirn, \$this->listOrder); ?>"; + $head .= PHP_EOL . $this->_t(1) . ""; } $head .= PHP_EOL . ""; @@ -6848,7 +7046,7 @@ class Interpretation extends Fields } else { - $items .= "," . PHP_EOL . "\t'" . $name . "'"; + $items .= "," . PHP_EOL . $this->_t(1) . "'" . $name . "'"; } $itemCounter++; } @@ -6885,7 +7083,7 @@ class Interpretation extends Fields // set as title layout $this->setLayout($viewName_single, $layoutCodeName, $items, 'layouttitle'); // load to header - $header .= PHP_EOL . "\t"; + $header .= PHP_EOL . $this->_t(1) . ""; break; case 5: // under // set as title layout @@ -6898,14 +7096,14 @@ class Interpretation extends Fields // set as items layout $this->setLayout($viewName_single, $layoutCodeName, $items, 'layoutitems'); // load the body - $leftside .= PHP_EOL . "\t"; + $leftside .= PHP_EOL . $this->_t(1) . ""; break; case 7: // right side $tabWidth = $tabWidth - 2; // set as items layout $this->setLayout($viewName_single, $layoutCodeName, $items, 'layoutitems'); // load the body - $rightside .= PHP_EOL . "\t"; + $rightside .= PHP_EOL . $this->_t(1) . ""; break; } } @@ -6963,7 +7161,7 @@ class Interpretation extends Fields $body = PHP_EOL . '
    '; if (ComponentbuilderHelper::checkString($span)) { - $body .= PHP_EOL . "\t" . '
    '; + $body .= PHP_EOL . $this->_t(1) . '
    '; } // now build the template foreach ($bucket as $tabCodeName => $posions) @@ -6983,9 +7181,9 @@ class Interpretation extends Fields { case 1: // left case 2: // right - $main .= PHP_EOL . "\t\t\t" . '
    '; - $main .= PHP_EOL . "\t\t\t\t" . $string; - $main .= PHP_EOL . "\t\t\t" . '
    '; + $main .= PHP_EOL . $this->_t(3) . '
    '; + $main .= PHP_EOL . $this->_t(4) . $string; + $main .= PHP_EOL . $this->_t(3) . '
    '; break; } } @@ -6995,25 +7193,25 @@ class Interpretation extends Fields { case 1: // left case 2: // right - $main .= PHP_EOL . "\t\t\t" . '
    '; - $main .= PHP_EOL . "\t\t\t\t" . $string; - $main .= PHP_EOL . "\t\t\t" . '
    '; + $main .= PHP_EOL . $this->_t(3) . '
    '; + $main .= PHP_EOL . $this->_t(4) . $string; + $main .= PHP_EOL . $this->_t(3) . '
    '; break; } } switch ($posion) { case 3: // fullwidth - $mainbottom .= PHP_EOL . "\t\t\t" . '
    '; - $mainbottom .= PHP_EOL . "\t\t\t\t" . $string; - $mainbottom .= PHP_EOL . "\t\t\t" . '
    '; + $mainbottom .= PHP_EOL . $this->_t(3) . '
    '; + $mainbottom .= PHP_EOL . $this->_t(4) . $string; + $mainbottom .= PHP_EOL . $this->_t(3) . '
    '; break; } } // set acctive tab if ($tabCounter == 0) { - $body .= PHP_EOL . PHP_EOL . "\t '" . $tabCodeName . "')); ?>"; + $body .= PHP_EOL . PHP_EOL . $this->_t(1) . " '" . $tabCodeName . "')); ?>"; } // if this is a linked view set permissions $closeIT = false; @@ -7033,7 +7231,7 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoadLinked && isset($coreLinked['core.access']) && isset($this->permissionBuilder['global'][$coreLinked['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$coreLinked['core.access']]) && in_array($linkedCodeName, $this->permissionBuilder['global'][$coreLinked['core.access']])) { - $body .= PHP_EOL . PHP_EOL . "\tcanDo->get('" . $coreLinked['core.access'] . "')) : ?>"; + $body .= PHP_EOL . PHP_EOL . $this->_t(1) . "canDo->get('" . $coreLinked['core.access'] . "')) : ?>"; $closeIT = true; } else @@ -7048,22 +7246,22 @@ class Interpretation extends Fields $body .= PHP_EOL; } // start tab - $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . $this->_t(1) . ""; // add the main - $body .= PHP_EOL . "\t\t" . '
    '; + $body .= PHP_EOL . $this->_t(2) . '
    '; $body .= $main; - $body .= PHP_EOL . "\t\t
    "; + $body .= PHP_EOL . $this->_t(2) . "
    "; if (strlen($mainbottom) > 0) { // add the main bottom - $body .= PHP_EOL . "\t\t" . '
    '; + $body .= PHP_EOL . $this->_t(2) . '
    '; $body .= $mainbottom; - $body .= PHP_EOL . "\t\t
    "; + $body .= PHP_EOL . $this->_t(2) . "
    "; } - $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . $this->_t(1) . ""; if ($closeIT) { - $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . $this->_t(1) . ""; } // set counter $tabCounter++; @@ -7137,19 +7335,19 @@ class Interpretation extends Fields // load the items into one side if (ComponentbuilderHelper::checkArray($items['left'])) { - $items_one .= "'" . implode("'," . PHP_EOL . "\t'", $items['left']) . "'"; + $items_one .= "'" . implode("'," . PHP_EOL . $this->_t(1) . "'", $items['left']) . "'"; } if (ComponentbuilderHelper::checkArray($items['right'])) { // there is already fields just add these if (strlen($items_one) > 3) { - $items_one .= "," . PHP_EOL . "\t'" . implode("'," . PHP_EOL . "\t'", $items['right']) . "'"; + $items_one .= "," . PHP_EOL . $this->_t(1) . "'" . implode("'," . PHP_EOL . $this->_t(1) . "'", $items['right']) . "'"; } // no fields has been added yet else { - $items_one .= "'" . implode("'," . PHP_EOL . "\t'", $items['right']) . "'"; + $items_one .= "'" . implode("'," . PHP_EOL . $this->_t(1) . "'", $items['right']) . "'"; } } // only triger the info notice if there were custom fields targeted to the right alignment position. @@ -7181,7 +7379,7 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($items['left'])) { // load all items - $items_one = "'" . implode("'," . PHP_EOL . "\t'", $items['left']) . "'"; + $items_one = "'" . implode("'," . PHP_EOL . $this->_t(1) . "'", $items['left']) . "'"; // set the publishing layout $this->setLayout($viewName_single, $tabCodeNameLeft, $items_one, 'layoutpublished'); $items_one = true; @@ -7190,7 +7388,7 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($items['right'])) { // load all items - $items_two = "'" . implode("'," . PHP_EOL . "\t'", $items['right']) . "'"; + $items_two = "'" . implode("'," . PHP_EOL . $this->_t(1) . "'", $items['right']) . "'"; // set the publishing layout $this->setLayout($viewName_single, $tabCodeNameRight, $items_two, 'layoutpublished'); $items_two = true; @@ -7229,25 +7427,25 @@ class Interpretation extends Fields $publishingPer[] = "\$this->canDo->get('" . $core_permission . "')"; } } - $body .= PHP_EOL . PHP_EOL . "\t"; + $body .= PHP_EOL . PHP_EOL . $this->_t(1) . ""; // set the default publishing tab - $body .= PHP_EOL . "\t"; - $body .= PHP_EOL . "\t\t" . '
    '; + $body .= PHP_EOL . $this->_t(1) . ""; + $body .= PHP_EOL . $this->_t(2) . '
    '; if ($items_one) { - $body .= PHP_EOL . "\t\t\t" . '
    '; - $body .= PHP_EOL . "\t\t\t\t"; - $body .= PHP_EOL . "\t\t\t
    "; + $body .= PHP_EOL . $this->_t(3) . '
    '; + $body .= PHP_EOL . $this->_t(4) . ""; + $body .= PHP_EOL . $this->_t(3) . "
    "; } if ($items_two) { - $body .= PHP_EOL . "\t\t\t" . '
    '; - $body .= PHP_EOL . "\t\t\t\t"; - $body .= PHP_EOL . "\t\t\t
    "; + $body .= PHP_EOL . $this->_t(3) . '
    '; + $body .= PHP_EOL . $this->_t(4) . ""; + $body .= PHP_EOL . $this->_t(3) . "
    "; } - $body .= PHP_EOL . "\t\t
    "; - $body .= PHP_EOL . "\t"; - $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . $this->_t(2) . "
    "; + $body .= PHP_EOL . $this->_t(1) . ""; + $body .= PHP_EOL . $this->_t(1) . ""; } // make sure we dont load it to a view with the name component if ($viewName_single != 'component') @@ -7262,32 +7460,32 @@ class Interpretation extends Fields $this->langContent[$this->lang][$tabLangName] = 'Permissions'; } // set the permissions tab - $body .= PHP_EOL . PHP_EOL . "\tcanDo->get('core.admin')) : ?>"; - $body .= PHP_EOL . "\t"; - $body .= PHP_EOL . "\t\t" . '
    '; - $body .= PHP_EOL . "\t\t\t" . '
    '; - $body .= PHP_EOL . "\t\t\t\t" . '
    '; - $body .= PHP_EOL . "\t\t\t\t\t" . '
    '; - $body .= PHP_EOL . "\t\t\t\t\tform->getFieldset('accesscontrol') as \$field): ?>"; - $body .= PHP_EOL . "\t\t\t\t\t\t
    "; - $body .= PHP_EOL . "\t\t\t\t\t\t\tlabel; echo \$field->input;?>"; - $body .= PHP_EOL . "\t\t\t\t\t\t
    "; - $body .= PHP_EOL . "\t\t\t\t\t\t" . '
    '; - $body .= PHP_EOL . "\t\t\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t\t
    "; - $body .= PHP_EOL . "\t\t\t\t
    "; - $body .= PHP_EOL . "\t\t\t
    "; - $body .= PHP_EOL . "\t\t
    "; - $body .= PHP_EOL . "\t"; - $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . PHP_EOL . $this->_t(1) . "canDo->get('core.admin')) : ?>"; + $body .= PHP_EOL . $this->_t(1) . ""; + $body .= PHP_EOL . $this->_t(2) . '
    '; + $body .= PHP_EOL . $this->_t(3) . '
    '; + $body .= PHP_EOL . $this->_t(4) . '
    '; + $body .= PHP_EOL . $this->_t(5) . '
    '; + $body .= PHP_EOL . $this->_t(5) . "form->getFieldset('accesscontrol') as \$field): ?>"; + $body .= PHP_EOL . $this->_t(6) . "
    "; + $body .= PHP_EOL . $this->_t(7) . "label; echo \$field->input;?>"; + $body .= PHP_EOL . $this->_t(6) . "
    "; + $body .= PHP_EOL . $this->_t(6) . '
    '; + $body .= PHP_EOL . $this->_t(5) . ""; + $body .= PHP_EOL . $this->_t(5) . "
    "; + $body .= PHP_EOL . $this->_t(4) . "
    "; + $body .= PHP_EOL . $this->_t(3) . "
    "; + $body .= PHP_EOL . $this->_t(2) . "
    "; + $body .= PHP_EOL . $this->_t(1) . ""; + $body .= PHP_EOL . $this->_t(1) . ""; } // end the tab set - $body .= PHP_EOL . PHP_EOL . "\t"; - $body .= PHP_EOL . PHP_EOL . "\t
    "; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t
    "; - $body .= PHP_EOL . "\t
    "; + $body .= PHP_EOL . PHP_EOL . $this->_t(1) . ""; + $body .= PHP_EOL . PHP_EOL . $this->_t(1) . "
    "; + $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . $this->_t(1) . "
    "; + $body .= PHP_EOL . $this->_t(1) . "
    "; $body .= PHP_EOL . "
    "; // check if left has been set if (strlen($leftside) > 0) @@ -7320,32 +7518,32 @@ class Interpretation extends Fields { // set view name $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 +7565,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 +7606,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 . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get Linked view data" . PHP_EOL . $this->_t(2) . "\$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 +7656,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 . $this->_t(2) . "\$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 . $this->_t(2) . "\$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] = ''; } } @@ -7492,50 +7690,53 @@ 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 . 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}"; - $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}"; - $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 . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the CSS for Footable."; + $foo .= PHP_EOL . $this->_t(2) . "\$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 . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Use the Metro Style"; + $foo .= PHP_EOL . $this->_t(2) . "if (!isset(\$this->fooTableStyle) || 0 == \$this->fooTableStyle)"; + $foo .= PHP_EOL . $this->_t(2) . "{"; + $foo .= PHP_EOL . $this->_t(3) . "\$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 . $this->_t(2) . "}"; + $foo .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Use the Legacy Style."; + $foo .= PHP_EOL . $this->_t(2) . "elseif (isset(\$this->fooTableStyle) && 1 == \$this->fooTableStyle)"; + $foo .= PHP_EOL . $this->_t(2) . "{"; + $foo .= PHP_EOL . $this->_t(3) . "\$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 . $this->_t(2) . "}"; + $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the JavaScript for Footable"; + $foo .= PHP_EOL . $this->_t(2) . "\$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 . $this->_t(2) . "\$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 . $this->_t(2) . "\$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 . $this->_t(2) . "\$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'" . '); }";'; - $foo .= PHP_EOL . "\t\t\$this->document->addScriptDeclaration(\$footable);" . PHP_EOL; + $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . '$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'" . '); }";'; + $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScriptDeclaration(\$footable);" . PHP_EOL; } } elseif (3 == $this->footableVersion) // loading version 3 { - $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->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 . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the CSS for Footable"; + $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');"; + $foo .= PHP_EOL . $this->_t(2) . "\$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 . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the JavaScript for Footable (adding all funtions)"; + $foo .= PHP_EOL . $this->_t(2) . "\$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();});});";'; - $foo .= PHP_EOL . "\t\t\$this->document->addScriptDeclaration(\$footable);" . PHP_EOL; + $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' . "'.footable'" . ').footable();});});";'; + $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScriptDeclaration(\$footable);" . PHP_EOL; } } return $foo; } /** - * @param $viewName_single - * @param $viewName_list - * @param $refview + * set the list body of the linked admin view + * + * @param string $viewName_single + * @param string $viewName_list + * @param string $refview + * * @return string */ public function setListBodyLinked($viewName_single, $viewName_list, $refview) @@ -7543,11 +7744,12 @@ 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 $coreLoad = false; + $core = null; if (isset($this->permissionCore[$viewName_single])) { $core = $this->permissionCore[$viewName_single]; @@ -7557,12 +7759,12 @@ class Interpretation extends Fields // add the default $body = PHP_EOL . ""; $body .= PHP_EOL . " \$item): ?>"; - $body .= PHP_EOL . "\tauthorise('core.manage', 'com_checkin') || \$item->checked_out == \$user->id || \$item->checked_out == 0;"; - $body .= PHP_EOL . "\t\t\$userChkOut = JFactory::getUser(\$item->checked_out);"; - $body .= PHP_EOL . "\t\t\$canDo = " . $Helper . "::getActions('" . $viewName_single . "',\$item,'" . $viewName_list . "');"; - $body .= PHP_EOL . "\t?>"; - $body .= PHP_EOL . "\t" . ''; + $body .= PHP_EOL . $this->_t(1) . "_t(2) . "\$canCheckin = \$user->authorise('core.manage', 'com_checkin') || \$item->checked_out == \$user->id || \$item->checked_out == 0;"; + $body .= PHP_EOL . $this->_t(2) . "\$userChkOut = JFactory::getUser(\$item->checked_out);"; + $body .= PHP_EOL . $this->_t(2) . "\$canDo = " . $Helper . "::getActions('" . $viewName_single . "',\$item,'" . $viewName_list . "');"; + $body .= PHP_EOL . $this->_t(1) . "?>"; + $body .= PHP_EOL . $this->_t(1) . ''; // check if this view has fields that should not be escaped $doNotEscape = false; if (isset($this->doNotEscape[$viewName_list])) @@ -7572,266 +7774,81 @@ class Interpretation extends Fields // start adding the dynamic foreach ($this->listBuilder[$viewName_list] as $item) { + // set the ref + $ref = '&ref=' . $refview . '&refid='; + // set some defaults + $customAdminViewButtons = ''; + // set the item row + $itemRow = $this->getListItemBuilder($item, $viewName_single, $viewName_list, $itemClass, $doNotEscape, $coreLoad, $core, false, $ref, '$displayData->escape', '$user', $refview); + // check if buttons was aready added + if ($firstTimeBeingAdded) // TODO we must improve this to allow more items to be targeted instead of just the first item :) + { + // get custom admin view buttons + $customAdminViewButtons = $this->getCustomAdminViewButtons($item, $viewName_single, $viewName_list, $coreLoad, $ref); + // make sure the custom admin view buttons are only added once + $firstTimeBeingAdded = false; + } + // add row to body + $body .= PHP_EOL . $this->_t(2) . ""; + $body .= $itemRow; + $body .= $customAdminViewButtons; + $body .= PHP_EOL . $this->_t(2) . ""; + // increment counter $counter++; - $checkoutTriger = false; - if (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && isset($item['custom']['table']) && ComponentbuilderHelper::checkString($item['custom']['table'])) - { - $item['id'] = $item['code']; - if (!$item['multiple']) - { - $item['code'] = $item['code'] . '_' . $item['custom']['text']; - } - } - // check if translated vlaue is used - if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($item['code'], $this->selectionTranslationFixBuilder[$viewName_list])) - { - $itemCode = '' . $item['code'] . '); ?>'; - } - elseif ($item['custom']['text'] === 'user') - { - $itemCode = '' . $item['code'] . ')->name; ?>'; - } - elseif ($doNotEscape) - { - if (in_array($item['code'], $this->doNotEscape[$viewName_list])) - { - $itemCode = '' . $item['code'] . '; ?>'; - } - else - { - $itemCode = 'escape($item->' . $item['code'] . '); ?>'; - } - } - else - { - $itemCode = 'escape($item->' . $item['code'] . '); ?>'; - } - - if ($item['link']) - { - // allways rest custom links - $customAdminView = ''; - // if to be linked - if ($item['type'] === 'category' && !$item['title']) - { - $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\t"; - $body .= PHP_EOL . "\t\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - elseif ($item['type'] === 'user' && !$item['title']) - { - // user and linked - $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - else - { - $add = true; - if (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] != 'user' && !$item['title']) - { - if ($refview === $item['custom']['view']) - { - // normal not linked - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t\t" . $itemCode; - $body .= PHP_EOL . "\t\t"; - - $add = false; - } - else - { - // link to that item instead - $link = 'index.php?option=' . $item['custom']['component'] . '&view=' . $item['custom']['views'] . '&task=' . $item['custom']['view'] . '.edit&id=' . $item['id'] . '; ?>&ref=' . $refview . '&refid='; - - - $coreLoadLink = false; - if (isset($this->permissionCore[$item['custom']['view']])) - { - $coreLink = $this->permissionCore[$item['custom']['view']]; - $coreLoadLink = true; - } - // 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'] . ")"; - } - else - { - $accessCheck = "\$user->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; - } - } - } - elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && !$item['title']) - { - // user and linked - $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - - $add = false; - } - else - { - $link = '&id=id; ?>&ref=' . $refview . '&refid='; - // check if custom links should be added to this list views - if (isset($this->customAdminViewListLink[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customAdminViewListLink[$viewName_list]) && $firstTimeBeingAdded) - { - // make sure the custom links are only added once - $firstTimeBeingAdded = false; - // start building the links - $customAdminView = PHP_EOL . "\t\t\t" . '
    '; - 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"; - $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; - $customAdminView .= PHP_EOL . "\t\t\t"; - } - $customAdminView .= PHP_EOL . "\t\t\t" . '
    '; - } - // check if the item has permissions. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) - { - // set permissions. - $accessCheck = "\$canDo->get('" . $core['core.edit'] . "')"; - } - else - { - // set permissions. - $accessCheck = "\$canDo->get('core.edit')"; - } - // triger the checked out script to be added - $checkoutTriger = true; - } - - if ($add) - { - // set as linked - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t" . '' . $itemCode . ''; - if ($checkoutTriger) - { - $body .= PHP_EOL . "\t\t\t\t\tchecked_out): ?>"; - $body .= PHP_EOL . "\t\t\t\t\t\tname, \$item->checked_out_time, '" . $viewName_list . ".', \$canCheckin); ?>"; - $body .= PHP_EOL . "\t\t\t\t\t"; - } - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\t" . '
    ' . $itemCode . '
    '; - $body .= PHP_EOL . "\t\t\t"; - $body .= $customAdminView; - $body .= PHP_EOL . "\t\t"; - } - } - } - else - { - if ($item['type'] === 'category') - { - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL . "\t\t"; - } - elseif (ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user') - { - // custom user and linked - $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t\t"; - $body .= PHP_EOL . "\t\t"; - } - elseif ($item['type'] === 'user') - { - // user name only - $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tname; ?>"; - $body .= PHP_EOL . "\t\t"; - } - else - { - // normal not linked - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t\t\t" . $itemCode; - $body .= PHP_EOL . "\t\t"; - } - } } $counter = $counter + 2; $data_value = (3 == $this->footableVersion) ? 'data-sort-value' : 'data-value'; - // add the defaults - $body .= PHP_EOL . "\t\tpublished == 1):?>"; - $body .= PHP_EOL . "\t\t\t" . ''; - $body .= PHP_EOL . "\t\t\t\t" . 'langPrefix . "_PUBLISHED'" . '); ?>">'; - $body .= PHP_EOL . "\t\t\t\t\t" . 'langPrefix . "_PUBLISHED'" . '); ?>'; - $body .= PHP_EOL . "\t\t\t\t" . ''; - $body .= PHP_EOL . "\t\t\t" . ''; + // add the defaults + $body .= PHP_EOL . $this->_t(2) . "published == 1):?>"; + $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(4) . 'langPrefix . "_PUBLISHED'" . '); ?>">'; + $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_PUBLISHED'" . '); ?>'; + $body .= PHP_EOL . $this->_t(4) . ''; + $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . "\t\tpublished == 0):?>"; - $body .= PHP_EOL . "\t\t\t" . ''; - $body .= PHP_EOL . "\t\t\t\t" . 'langPrefix . "_INACTIVE'" . '); ?>">'; - $body .= PHP_EOL . "\t\t\t\t\t" . 'langPrefix . "_INACTIVE'" . '); ?>'; - $body .= PHP_EOL . "\t\t\t\t" . ''; - $body .= PHP_EOL . "\t\t\t" . ''; + $body .= PHP_EOL . $this->_t(2) . "published == 0):?>"; + $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(4) . 'langPrefix . "_INACTIVE'" . '); ?>">'; + $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_INACTIVE'" . '); ?>'; + $body .= PHP_EOL . $this->_t(4) . ''; + $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . "\t\tpublished == 2):?>"; - $body .= PHP_EOL . "\t\t\t" . ''; - $body .= PHP_EOL . "\t\t\t\t" . 'langPrefix . "_ARCHIVED'" . '); ?>">'; - $body .= PHP_EOL . "\t\t\t\t\t" . 'langPrefix . "_ARCHIVED'" . '); ?>'; - $body .= PHP_EOL . "\t\t\t\t" . ''; - $body .= PHP_EOL . "\t\t\t" . ''; + $body .= PHP_EOL . $this->_t(2) . "published == 2):?>"; + $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(4) . 'langPrefix . "_ARCHIVED'" . '); ?>">'; + $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_ARCHIVED'" . '); ?>'; + $body .= PHP_EOL . $this->_t(4) . ''; + $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . "\t\tpublished == -2):?>"; - $body .= PHP_EOL . "\t\t\t" . ''; - $body .= PHP_EOL . "\t\t\t\t" . 'langPrefix . "_TRASHED'" . '); ?>">'; - $body .= PHP_EOL . "\t\t\t\t\t" . 'langPrefix . "_TRASHED'" . '); ?>'; - $body .= PHP_EOL . "\t\t\t\t" . ''; - $body .= PHP_EOL . "\t\t\t" . ''; - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . $this->_t(2) . "published == -2):?>"; + $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(4) . 'langPrefix . "_TRASHED'" . '); ?>">'; + $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_TRASHED'" . '); ?>'; + $body .= PHP_EOL . $this->_t(4) . ''; + $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(2) . ''; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\tid; ?>"; - $body .= PHP_EOL . "\t\t"; - $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . $this->_t(3) . "id; ?>"; + $body .= PHP_EOL . $this->_t(2) . ""; + $body .= PHP_EOL . $this->_t(1) . ""; $body .= PHP_EOL . ""; $body .= PHP_EOL . ""; if (2 == $this->footableVersion) { $body .= PHP_EOL . ''; - $body .= PHP_EOL . "\t" . ''; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t\t\t" . ''; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t" . ''; + $body .= PHP_EOL . $this->_t(1) . ''; + $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . $this->_t(1) . ''; $body .= PHP_EOL . ''; } $body .= PHP_EOL . ''; $body .= PHP_EOL . ''; - $body .= PHP_EOL . "\t" . '
    '; - $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL . "\t" . '
    '; + $body .= PHP_EOL . $this->_t(1) . '
    '; + $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . $this->_t(1) . '
    '; $body .= PHP_EOL . ''; // return the build return $body; @@ -7839,12 +7856,22 @@ class Interpretation extends Fields return ''; } + /** + * set the list body table head linked admin view + * + * @param string $viewName_single + * @param string $viewName_list + * @param bool $addNewButon + * @param string $refview + * + * @return string + */ public function setListHeadLinked($viewName_single, $viewName_list, $addNewButon, $refview) { 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) @@ -7873,23 +7900,23 @@ class Interpretation extends Fields $tabB = ""; if ($addNewButon == 2) { - $head .= PHP_EOL . "\t" . '
    '; - $tabB = "\t"; + $head .= PHP_EOL . $this->_t(1) . '
    '; + $tabB = $this->_t(1); } // add the new buttons if ($addNewButon == 1 || $addNewButon == 2) { - $head .= PHP_EOL . $tabB . "\t" . ' langPrefix . "_NEW'" . '); ?>'; + $head .= PHP_EOL . $tabB . $this->_t(1) . ' langPrefix . "_NEW'" . '); ?>'; } // add the close and new button if ($addNewButon == 2 || $addNewButon == 3) { - $head .= PHP_EOL . $tabB . "\t" . ' langPrefix . "_CLOSE_NEW'" . '); ?>'; + $head .= PHP_EOL . $tabB . $this->_t(1) . ' langPrefix . "_CLOSE_NEW'" . '); ?>'; } // close group button if needed if ($addNewButon == 2) { - $head .= PHP_EOL . "\t" . '


    '; + $head .= PHP_EOL . $this->_t(1) . '


    '; } else { @@ -7926,12 +7953,17 @@ class Interpretation extends Fields { $this->langContent[$this->lang][$idLangName] = 'Id'; } - $head .= PHP_EOL . "\t"; + $head .= PHP_EOL . $this->_t(1) . ""; // set controller for data hiding options $controller = 1; // build the dynamic fields foreach ($this->listBuilder[$viewName_list] as $item) { + // check if we have an over-ride + if (isset($this->listHeadOverRide[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listHeadOverRide[$viewName_list]) && isset($this->listHeadOverRide[$viewName_list][$item['id']])) + { + $item['lang'] = $this->listHeadOverRide[$viewName_list][$item['id']]; + } $setin = (2 == $this->footableVersion) ? ' data-hide="phone"' : ' data-breakpoints="xs sm"'; if ($controller > 3) { @@ -7948,22 +7980,22 @@ class Interpretation extends Fields $setin = (2 == $this->footableVersion) ? ' data-toggle="true"' : ''; $firstLink = false; } - $head .= PHP_EOL . "\t\t"; - $head .= PHP_EOL . "\t\t\t"; - $head .= PHP_EOL . "\t\t"; + $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . $this->_t(3) . ""; + $head .= PHP_EOL . $this->_t(2) . ""; $controller++; } // set some V3 attr $data_hide = (2 == $this->footableVersion) ? 'data-hide="phone,tablet"' : 'data-breakpoints="xs sm md"'; $data_type = (2 == $this->footableVersion) ? 'data-type="numeric"' : 'data-type="number"'; // set default - $head .= PHP_EOL . "\t\t" . ''; - $head .= PHP_EOL . "\t\t\t"; - $head .= PHP_EOL . "\t\t"; - $head .= PHP_EOL . "\t\t" . ''; - $head .= PHP_EOL . "\t\t\t"; - $head .= PHP_EOL . "\t\t"; - $head .= PHP_EOL . "\t"; + $head .= PHP_EOL . $this->_t(2) . ''; + $head .= PHP_EOL . $this->_t(3) . ""; + $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . $this->_t(2) . ''; + $head .= PHP_EOL . $this->_t(3) . ""; + $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . $this->_t(1) . ""; $head .= PHP_EOL . ""; return $head; @@ -7994,32 +8026,32 @@ class Interpretation extends Fields { $addCategory = false; } - $query = PHP_EOL . PHP_EOL . "\t/**"; - $query .= PHP_EOL . "\t* Method to get list data."; - $query .= PHP_EOL . "\t*"; - $query .= PHP_EOL . "\t* @return mixed An array of data items on success, false on failure."; - $query .= PHP_EOL . "\t*/"; - $query .= PHP_EOL . "\tpublic function get" . $functionName . "()"; - $query .= PHP_EOL . "\t{"; + $query = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $query .= PHP_EOL . $this->_t(1) . " * Method to get list data."; + $query .= PHP_EOL . $this->_t(1) . " *"; + $query .= PHP_EOL . $this->_t(1) . " * @return mixed An array of data items on success, false on failure."; + $query .= PHP_EOL . $this->_t(1) . " */"; + $query .= PHP_EOL . $this->_t(1) . "public function get" . $functionName . "()"; + $query .= PHP_EOL . $this->_t(1) . "{"; // setup the query - $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the user object."; - $query .= PHP_EOL . "\t\t\$user = JFactory::getUser();"; - $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $query .= PHP_EOL . "\t\t\$db = JFactory::getDBO();"; - $query .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Select some fields"; - $query .= PHP_EOL . "\t\t\$query->select('a.*');"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the user object."; + $query .= PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $query .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDBO();"; + $query .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select some fields"; + $query .= PHP_EOL . $this->_t(2) . "\$query->select('a.*');"; // add the category if ($addCategory) { - $query .= PHP_EOL . "\t\t\$query->select(\$db->quoteName('c.title','category_title'));"; + $query .= PHP_EOL . $this->_t(2) . "\$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 . $this->_t(2) . "//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . " table"; + $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . "', 'a'));"; // add the category if ($addCategory) { - $query .= PHP_EOL . "\t\t\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." . $categoryCodeName . "') . ' = ' . \$db->quoteName('c.id') . ')');"; + $query .= PHP_EOL . $this->_t(2) . "\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." . $categoryCodeName . "') . ' = ' . \$db->quoteName('c.id') . ')');"; } // add custom filtering php $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL); @@ -8029,20 +8061,20 @@ class Interpretation extends Fields $key && strpos($key, '-R>') === false && strpos($key, '-A>') === false && strpos($key, '-OR>') === false && $parentKey && strpos($parentKey, '-R>') === false && strpos($parentKey, '-A>') === false && strpos($parentKey, '-OR>') === false) { - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " global."; - $query .= PHP_EOL . "\t\t\$" . $globalKey . " = \$this->" . $globalKey . ";"; - $query .= PHP_EOL . "\t\tif (is_numeric(\$" . $globalKey . " ))"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\t\$query->where('a." . $key . " = ' . (int) \$" . $globalKey . " );"; - $query .= PHP_EOL . "\t\t}"; - $query .= PHP_EOL . "\t\telseif (is_string(\$" . $globalKey . "))"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\t\$query->where('a." . $key . " = ' . \$db->quote(\$" . $globalKey . "));"; - $query .= PHP_EOL . "\t\t}"; - $query .= PHP_EOL . "\t\telse"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\t\$query->where('a." . $key . " = -5');"; - $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " global."; + $query .= PHP_EOL . $this->_t(2) . "\$" . $globalKey . " = \$this->" . $globalKey . ";"; + $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$" . $globalKey . " ))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key . " = ' . (int) \$" . $globalKey . " );"; + $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . $this->_t(2) . "elseif (is_string(\$" . $globalKey . "))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key . " = ' . \$db->quote(\$" . $globalKey . "));"; + $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . $this->_t(2) . "else"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key . " = -5');"; + $query .= PHP_EOL . $this->_t(2) . "}"; } elseif (strpos($parentKey, '-OR>') !== false || strpos($key, '-OR>') !== false) { @@ -8070,207 +8102,207 @@ class Interpretation extends Fields $ORquery['i'][] = "a." . $ORkey . " = ' . (int) \$" . $_globalKey; $ORquery['s'][] = "a." . $ORkey . " = ' . \$db->quote(\$" . $_globalKey . ")"; } - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by " . $_globalKey . " global."; - $query .= PHP_EOL . "\t\t\$" . $_globalKey . " = \$this->" . $_globalKey . ";"; - $query .= PHP_EOL . "\t\tif (is_numeric(\$" . $_globalKey . " ))"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\t\$query->where('" . implode(" . ' OR ", $ORquery['i']) . ", ' OR');"; - $query .= PHP_EOL . "\t\t}"; - $query .= PHP_EOL . "\t\telseif (is_string(\$" . $_globalKey . "))"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\t\$query->where('" . implode(" . ' OR ", $ORquery['s']) . ", ' OR');"; - $query .= PHP_EOL . "\t\t}"; - $query .= PHP_EOL . "\t\telse"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\t\$query->where('a." . $ORkey . " = -5');"; - $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by " . $_globalKey . " global."; + $query .= PHP_EOL . $this->_t(2) . "\$" . $_globalKey . " = \$this->" . $_globalKey . ";"; + $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$" . $_globalKey . " ))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('" . implode(" . ' OR ", $ORquery['i']) . ", ' OR');"; + $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . $this->_t(2) . "elseif (is_string(\$" . $_globalKey . "))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('" . implode(" . ' OR ", $ORquery['s']) . ", ' OR');"; + $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . $this->_t(2) . "else"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $ORkey . " = -5');"; + $query .= PHP_EOL . $this->_t(2) . "}"; } } if (isset($this->accessBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName_single])) { - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Join over the asset groups."; - $query .= PHP_EOL . "\t\t\$query->select('ag.title AS access_level');"; - $query .= PHP_EOL . "\t\t\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; - $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by access level."; - $query .= PHP_EOL . "\t\tif (\$access = \$this->getState('filter.access'))"; - $query .= PHP_EOL . "\t\t{"; - $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\t{"; - $query .= PHP_EOL . "\t\t\t\$groups = implode(',', \$user->getAuthorisedViewLevels());"; - $query .= PHP_EOL . "\t\t\t\$query->where('a.access IN (' . \$groups . ')');"; - $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Join over the asset groups."; + $query .= PHP_EOL . $this->_t(2) . "\$query->select('ag.title AS access_level');"; + $query .= PHP_EOL . $this->_t(2) . "\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by access level."; + $query .= PHP_EOL . $this->_t(2) . "if (\$access = \$this->getState('filter.access'))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access = ' . (int) \$access);"; + $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Implement View Level Access"; + $query .= PHP_EOL . $this->_t(2) . "if (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access IN (' . \$groups . ')');"; + $query .= PHP_EOL . $this->_t(2) . "}"; } - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Order the results by ordering"; - $query .= PHP_EOL . "\t\t\$query->order('a.published ASC');"; - $query .= PHP_EOL . "\t\t\$query->order('a.ordering ASC');"; - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Load the items"; - $query .= PHP_EOL . "\t\t\$db->setQuery(\$query);"; - $query .= PHP_EOL . "\t\t\$db->execute();"; - $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"); + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Order the results by ordering"; + $query .= PHP_EOL . $this->_t(2) . "\$query->order('a.published ASC');"; + $query .= PHP_EOL . $this->_t(2) . "\$query->order('a.ordering ASC');"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load the items"; + $query .= PHP_EOL . $this->_t(2) . "\$db->setQuery(\$query);"; + $query .= PHP_EOL . $this->_t(2) . "\$db->execute();"; + $query .= PHP_EOL . $this->_t(2) . "if (\$db->getNumRows())"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$items = \$db->loadObjectList();"; + // add the fixing strings method + $query .= $this->setGetItemsMethodStringFix($viewName_single, $viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], $this->_t(1)); + // add translations + $query .= $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], $this->_t(1)); // 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\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\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\t{"; - $query .= PHP_EOL . "\t\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL . "\t\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL . "\t\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t\telse"; - $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;"; - $query .= PHP_EOL . "\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t}"; - $query .= PHP_EOL . "\t\t\telse"; - $query .= PHP_EOL . "\t\t\t{"; - $query .= PHP_EOL . "\t\t\t\treturn false;"; - $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " in this Repetable Field"; + $query .= PHP_EOL . $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$items) && isset(\$this->" . $globalKey . "))"; + $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "foreach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . $this->_t(4) . "{"; + $query .= PHP_EOL . $this->_t(5) . "if (isset(\$item->" . $field . ") && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(\$item->" . $field . "))"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "\$tmpArray = json_decode(\$item->" . $field . ",true);"; + $query .= PHP_EOL . $this->_t(6) . "if (!isset(\$tmpArray['" . $target . "']) || !" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$tmpArray['" . $target . "']) || !in_array(\$this->" . $globalKey . ", \$tmpArray['" . $target . "']))"; + $query .= PHP_EOL . $this->_t(6) . "{"; + $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . $this->_t(7) . "continue;"; + $query .= PHP_EOL . $this->_t(6) . "}"; + $query .= PHP_EOL . $this->_t(5) . "}"; + $query .= PHP_EOL . $this->_t(5) . "else"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . $this->_t(6) . "continue;"; + $query .= PHP_EOL . $this->_t(5) . "}"; + $query .= PHP_EOL . $this->_t(4) . "}"; + $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . $this->_t(3) . "else"; + $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "return false;"; + $query .= PHP_EOL . $this->_t(3) . "}"; } // filter by child array field values if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($key, '-R>') === false && strpos($key, '-A>') !== false) { - $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\t{"; - $query .= PHP_EOL . "\t\t\t\tforeach (\$items as \$nr => &\$item)"; - $query .= PHP_EOL . "\t\t\t\t{"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " Array Field"; + $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = \$this->" . $globalKey . ";"; + $query .= PHP_EOL . $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$items) && \$" . $globalKey . ")"; + $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "foreach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . $this->_t(4) . "{"; 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\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\t{"; - $query .= PHP_EOL . "\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL . "\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL . "\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t\tif (!in_array(\$" . $globalKey . ",\$item->" . $target . "))"; + $query .= PHP_EOL . $this->_t(5) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(\$item->" . $target . "))"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "\$item->" . $target . " = json_decode(\$item->" . $target . ", true);"; + $query .= PHP_EOL . $this->_t(5) . "}"; + $query .= PHP_EOL . $this->_t(5) . "elseif (!isset(\$item->" . $target . ") || !" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$item->" . $target . "))"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . $this->_t(6) . "continue;"; + $query .= PHP_EOL . $this->_t(5) . "}"; + $query .= PHP_EOL . $this->_t(5) . "if (!in_array(\$" . $globalKey . ",\$item->" . $target . "))"; } else { - $query .= PHP_EOL . "\t\t\t\t\tif (" . $this->fileContentStatic['###Component###'] . "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\t{"; - $query .= PHP_EOL . "\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL . "\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL . "\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t\tif (!in_array(\$" . $globalKey . ",\$item->" . $_key . "))"; + $query .= PHP_EOL . $this->_t(5) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(\$item->" . $_key . "))"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "\$item->" . $_key . " = json_decode(\$item->" . $_key . ", true);"; + $query .= PHP_EOL . $this->_t(5) . "}"; + $query .= PHP_EOL . $this->_t(5) . "elseif (!isset(\$item->" . $_key . ") || !" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$item->" . $_key . "))"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . $this->_t(6) . "continue;"; + $query .= PHP_EOL . $this->_t(5) . "}"; + $query .= PHP_EOL . $this->_t(5) . "if (!in_array(\$" . $globalKey . ",\$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;"; - $query .= PHP_EOL . "\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t}"; - $query .= PHP_EOL . "\t\t\telse"; - $query .= PHP_EOL . "\t\t\t{"; - $query .= PHP_EOL . "\t\t\t\treturn false;"; - $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . $this->_t(6) . "continue;"; + $query .= PHP_EOL . $this->_t(5) . "}"; + $query .= PHP_EOL . $this->_t(4) . "}"; + $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . $this->_t(3) . "else"; + $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "return false;"; + $query .= PHP_EOL . $this->_t(3) . "}"; } // filter by parent repetable field values if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($parentKey, '-R>') !== false && strpos($parentKey, '-A>') === false) { 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\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\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{"; - $query .= PHP_EOL . "\t\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL . "\t\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL . "\t\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t\telse"; - $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;"; - $query .= PHP_EOL . "\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t}"; - $query .= PHP_EOL . "\t\t\telse"; - $query .= PHP_EOL . "\t\t\t{"; - $query .= PHP_EOL . "\t\t\t\treturn false;"; - $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Filter by " . $_key . " Repetable Field"; + $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = json_decode(\$this->" . $globalKey . ",true);"; + $query .= PHP_EOL . $this->_t(3) . "if (" . $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 . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "foreach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . $this->_t(4) . "{"; + $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key . " && isset(\$" . $globalKey . "['" . $target . "']) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" . $_key . ",\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . $this->_t(6) . "{"; + $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . $this->_t(7) . "continue;"; + $query .= PHP_EOL . $this->_t(6) . "}"; + $query .= PHP_EOL . $this->_t(5) . "}"; + $query .= PHP_EOL . $this->_t(5) . "else"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . $this->_t(6) . "continue;"; + $query .= PHP_EOL . $this->_t(5) . "}"; + $query .= PHP_EOL . $this->_t(4) . "}"; + $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . $this->_t(3) . "else"; + $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "return false;"; + $query .= PHP_EOL . $this->_t(3) . "}"; } // filter by parent array field values if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($parentKey, '-R>') === false && strpos($parentKey, '-A>') !== false) { - $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\t{"; - $query .= PHP_EOL . "\t\t\t\tforeach (\$items as \$nr => &\$item)"; - $query .= PHP_EOL . "\t\t\t\t{"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " Array Field"; + $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = \$this->" . $globalKey . ";"; + $query .= PHP_EOL . $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$items) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "))"; + $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "foreach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . $this->_t(4) . "{"; 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\t{"; - $query .= PHP_EOL . "\t\t\t\t\t\tif (!in_array(\$item->" . $_key . ",\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key . " && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" . $_key . ",\$" . $globalKey . "['" . $target . "']))"; } else { - $query .= PHP_EOL . "\t\t\t\t\tif (\$item->" . $_key . ")"; - $query .= PHP_EOL . "\t\t\t\t\t{"; - $query .= PHP_EOL . "\t\t\t\t\t\tif (!in_array(\$item->" . $_key . ",\$" . $globalKey . "))"; + $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key . ")"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" . $_key . ",\$" . $globalKey . "))"; } - $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;"; - $query .= PHP_EOL . "\t\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t\telse"; - $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;"; - $query .= PHP_EOL . "\t\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t\t}"; - $query .= PHP_EOL . "\t\t\t}"; - $query .= PHP_EOL . "\t\t\telse"; - $query .= PHP_EOL . "\t\t\t{"; - $query .= PHP_EOL . "\t\t\t\treturn false;"; - $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . $this->_t(6) . "{"; + $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . $this->_t(7) . "continue;"; + $query .= PHP_EOL . $this->_t(6) . "}"; + $query .= PHP_EOL . $this->_t(5) . "}"; + $query .= PHP_EOL . $this->_t(5) . "else"; + $query .= PHP_EOL . $this->_t(5) . "{"; + $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; + $query .= PHP_EOL . $this->_t(6) . "continue;"; + $query .= PHP_EOL . $this->_t(5) . "}"; + $query .= PHP_EOL . $this->_t(4) . "}"; + $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . $this->_t(3) . "else"; + $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "return false;"; + $query .= PHP_EOL . $this->_t(3) . "}"; } // add custom php to getitems method after all - $query .= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL . PHP_EOL . "\t"); + $query .= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL . PHP_EOL . $this->_t(1)); - $query .= PHP_EOL . "\t\t\treturn \$items;"; - $query .= PHP_EOL . "\t\t}"; - $query .= PHP_EOL . "\t\treturn false;"; - $query .= PHP_EOL . "\t}"; - // ###SELECTIONTRANSLATIONFIXFUNC###<<>> - $query .= $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic['###Component###']); + $query .= PHP_EOL . $this->_t(3) . "return \$items;"; + $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . $this->_t(2) . "return false;"; + $query .= PHP_EOL . $this->_t(1) . "}"; + // SELECTIONTRANSLATIONFIXFUNC<<>> + $query .= $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); // fixe mothod name clash $query = str_replace('selectionTranslation(', 'selectionTranslation' . $functionName . '(', $query); @@ -8294,11 +8326,11 @@ class Interpretation extends Fields $keyLang = $this->langPrefix . '_' . $custom_button['NAME']; $this->langContent[$this->lang][$keyLang] = ComponentbuilderHelper::safeString($custom_button['name'], 'Ww'); // add cpanel button - $buttons[] = "\t\tif (\$this->canDo->get('" . $custom_button['link'] . ".access'))"; - $buttons[] = "\t\t{"; - $buttons[] = "\t\t\t//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; - $buttons[] = "\t\t\tJToolBarHelper::custom('" . $viewName_list . ".redirectTo" . ComponentbuilderHelper::safeString($custom_button['link'], 'F') . "', '" . $custom_button['icon'] . "', '', '" . $keyLang . "', true);"; - $buttons[] = "\t\t}"; + $buttons[] = $this->_t(2) . "if (\$this->canDo->get('" . $custom_button['link'] . ".access'))"; + $buttons[] = $this->_t(2) . "{"; + $buttons[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; + $buttons[] = $this->_t(3) . "JToolBarHelper::custom('" . $viewName_list . ".redirectTo" . ComponentbuilderHelper::safeString($custom_button['link'], 'F') . "', '" . $custom_button['icon'] . "', '', '" . $keyLang . "', true);"; + $buttons[] = $this->_t(2) . "}"; } if (ComponentbuilderHelper::checkArray($buttons)) { @@ -8321,29 +8353,29 @@ class Interpretation extends Fields foreach ($this->customAdminDynamicButtons[$viewName_list] as $custom_button) { // add the custom redirect method - $method[] = PHP_EOL . PHP_EOL . "\tpublic function redirectTo" . ComponentbuilderHelper::safeString($custom_button['link'], 'F') . "()"; - $method[] = "\t{"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " Check for request forgeries"; - $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\t{"; - $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the input"; - $method[] = "\t\t\t\$input = JFactory::getApplication()->input;"; - $method[] = "\t\t\t\$pks = \$input->post->get('cid', array(), 'array');"; - $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Sanitize the input"; - $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\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\treturn;"; - $method[] = "\t}"; + $method[] = PHP_EOL . PHP_EOL . $this->_t(1) . "public function redirectTo" . ComponentbuilderHelper::safeString($custom_button['link'], 'F') . "()"; + $method[] = $this->_t(1) . "{"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for request forgeries"; + $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if export is allowed for this user."; + $method[] = $this->_t(2) . "\$user = JFactory::getUser();"; + $method[] = $this->_t(2) . "if (\$user->authorise('" . $custom_button['link'] . ".access', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; + $method[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the input"; + $method[] = $this->_t(3) . "\$input = JFactory::getApplication()->input;"; + $method[] = $this->_t(3) . "\$pks = \$input->post->get('cid', array(), 'array');"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Sanitize the input"; + $method[] = $this->_t(3) . "JArrayHelper::toInteger(\$pks);"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert to string"; + $method[] = $this->_t(3) . "\$ids = implode('_', \$pks);"; + $method[] = $this->_t(3) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $custom_button['link'] . "&cid='.\$ids, false));"; + $method[] = $this->_t(3) . "return;"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; + $method[] = $this->_t(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED');"; + $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_list . "', false), \$message, 'error');"; + $method[] = $this->_t(2) . "return;"; + $method[] = $this->_t(1) . "}"; // add to lang array $lankey = $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED"; if (!isset($this->langContent[$this->lang][$lankey])) @@ -8367,56 +8399,56 @@ class Interpretation extends Fields $query = ''; if ($this->eximportView[$viewName_list]) { - $query = PHP_EOL . PHP_EOL . "\t/**"; - $query .= PHP_EOL . "\t* Method to get list export data."; - $query .= PHP_EOL . "\t*"; - $query .= PHP_EOL . "\t* @return mixed An array of data items on success, false on failure."; - $query .= PHP_EOL . "\t*/"; - $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\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;"; - $query .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the user object."; - $query .= PHP_EOL . "\t\t\t\$user = JFactory::getUser();"; - $query .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $query .= PHP_EOL . "\t\t\t\$db = JFactory::getDBO();"; - $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 . "\t\t\t\$query->where('a.id IN (' . implode(',',\$pks) . ')');"; + $query = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $query .= PHP_EOL . $this->_t(1) . " * Method to get list export data."; + $query .= PHP_EOL . $this->_t(1) . " *"; + $query .= PHP_EOL . $this->_t(1) . " * @return mixed An array of data items on success, false on failure."; + $query .= PHP_EOL . $this->_t(1) . " */"; + $query .= PHP_EOL . $this->_t(1) . "public function getExportData(\$pks)"; + $query .= PHP_EOL . $this->_t(1) . "{"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " setup the query"; + $query .= PHP_EOL . $this->_t(2) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$pks))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set a value to know this is exporting method."; + $query .= PHP_EOL . $this->_t(3) . "\$_export = true;"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the user object."; + $query .= PHP_EOL . $this->_t(3) . "\$user = JFactory::getUser();"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $query .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDBO();"; + $query .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Select some fields"; + $query .= PHP_EOL . $this->_t(3) . "\$query->select('a.*');"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . " table"; + $query .= PHP_EOL . $this->_t(3) . "\$query->from(\$db->quoteName('#__" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . "', 'a'));"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.id IN (' . implode(',',\$pks) . ')');"; // add custom filtering php - $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL . "\t"); + $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL . $this->_t(1)); 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\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 . ')');"; - $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Implement View Level Access"; + $query .= PHP_EOL . $this->_t(3) . "if (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; + $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; + $query .= PHP_EOL . $this->_t(4) . "\$query->where('a.access IN (' . \$groups . ')');"; + $query .= PHP_EOL . $this->_t(3) . "}"; } - $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Order the results by ordering"; - $query .= PHP_EOL . "\t\t\t\$query->order('a.ordering ASC');"; - $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Load the items"; - $query .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; - $query .= PHP_EOL . "\t\t\t\$db->execute();"; - $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 .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Order the results by ordering"; + $query .= PHP_EOL . $this->_t(3) . "\$query->order('a.ordering ASC');"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Load the items"; + $query .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; + $query .= PHP_EOL . $this->_t(3) . "\$db->execute();"; + $query .= PHP_EOL . $this->_t(3) . "if (\$db->getNumRows())"; + $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "\$items = \$db->loadObjectList();"; + $query .= $this->setGetItemsMethodStringFix($viewName_single, $viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], $this->_t(2), 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;"; - $query .= PHP_EOL . "\t\t\t}"; - $query .= PHP_EOL . "\t\t}"; - $query .= PHP_EOL . "\t\treturn false;"; - $query .= PHP_EOL . "\t}"; + $query .= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL . PHP_EOL . $this->_t(2)); + $query .= PHP_EOL . $this->_t(4) . "return \$items;"; + $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . $this->_t(2) . "return false;"; + $query .= PHP_EOL . $this->_t(1) . "}"; // get the header script $header = ComponentbuilderHelper::getDynamicScripts('headers'); @@ -8437,82 +8469,82 @@ class Interpretation extends Fields $method = array(); // add the export method - $method[] = PHP_EOL . PHP_EOL . "\tpublic function exportData()"; - $method[] = "\t{"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " Check for request forgeries"; - $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\t{"; - $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the input"; - $method[] = "\t\t\t\$input = JFactory::getApplication()->input;"; - $method[] = "\t\t\t\$pks = \$input->post->get('cid', array(), 'array');"; - $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Sanitize the input"; - $method[] = "\t\t\tJArrayHelper::toInteger(\$pks);"; - $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the model"; - $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\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}"; - $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\treturn;"; - $method[] = "\t}"; + $method[] = PHP_EOL . PHP_EOL . $this->_t(1) . "public function exportData()"; + $method[] = $this->_t(1) . "{"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for request forgeries"; + $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if export is allowed for this user."; + $method[] = $this->_t(2) . "\$user = JFactory::getUser();"; + $method[] = $this->_t(2) . "if (\$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[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the input"; + $method[] = $this->_t(3) . "\$input = JFactory::getApplication()->input;"; + $method[] = $this->_t(3) . "\$pks = \$input->post->get('cid', array(), 'array');"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Sanitize the input"; + $method[] = $this->_t(3) . "JArrayHelper::toInteger(\$pks);"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the model"; + $method[] = $this->_t(3) . "\$model = \$this->getModel('" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "');"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the data to export"; + $method[] = $this->_t(3) . "\$data = \$model->getExportData(\$pks);"; + $method[] = $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$data))"; + $method[] = $this->_t(3) . "{"; + $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " now set the data to the spreadsheet"; + $method[] = $this->_t(4) . "\$date = JFactory::getDate();"; + $method[] = $this->_t(4) . $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[] = $this->_t(3) . "}"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; + $method[] = $this->_t(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_EXPORT_FAILED');"; + $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_list . "', false), \$message, 'error');"; + $method[] = $this->_t(2) . "return;"; + $method[] = $this->_t(1) . "}"; // add the import method - $method[] = PHP_EOL . PHP_EOL . "\tpublic function importData()"; - $method[] = "\t{"; - $method[] = "\t\t//" . $this->setLine(__LINE__) . " Check for request forgeries"; - $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\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\t{"; - $method[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Load headers to session."; - $method[] = "\t\t\t\t\$session = JFactory::getSession();"; - $method[] = "\t\t\t\t\$headers = json_encode(\$headers);"; - $method[] = "\t\t\t\t\$session->set('" . $viewName_single . "_VDM_IMPORTHEADERS', \$headers);"; - $method[] = "\t\t\t\t\$session->set('backto_VDM_IMPORT', '" . $viewName_list . "');"; - $method[] = "\t\t\t\t\$session->set('dataType_VDM_IMPORTINTO', '" . $viewName_single . "');"; - $method[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Redirect to import view."; + $method[] = PHP_EOL . PHP_EOL . $this->_t(1) . "public function importData()"; + $method[] = $this->_t(1) . "{"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for request forgeries"; + $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if import is allowed for this user."; + $method[] = $this->_t(2) . "\$user = JFactory::getUser();"; + $method[] = $this->_t(2) . "if (\$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[] = $this->_t(2) . "{"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the import model"; + $method[] = $this->_t(3) . "\$model = \$this->getModel('" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "');"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the headers to import"; + $method[] = $this->_t(3) . "\$headers = \$model->getExImPortHeaders();"; + $method[] = $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkObject(\$headers))"; + $method[] = $this->_t(3) . "{"; + $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Load headers to session."; + $method[] = $this->_t(4) . "\$session = JFactory::getSession();"; + $method[] = $this->_t(4) . "\$headers = json_encode(\$headers);"; + $method[] = $this->_t(4) . "\$session->set('" . $viewName_single . "_VDM_IMPORTHEADERS', \$headers);"; + $method[] = $this->_t(4) . "\$session->set('backto_VDM_IMPORT', '" . $viewName_list . "');"; + $method[] = $this->_t(4) . "\$session->set('dataType_VDM_IMPORTINTO', '" . $viewName_single . "');"; + $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Redirect to import view."; // add to lang array $selectImportFileNote = $this->langPrefix . "_IMPORT_SELECT_FILE_FOR_" . ComponentbuilderHelper::safeString($viewName_list, 'U'); if (!isset($this->langContent[$this->lang][$selectImportFileNote])) { $this->langContent[$this->lang][$selectImportFileNote] = 'Select the file to import data to ' . $viewName_list . '.'; } - $method[] = "\t\t\t\t\$message = JText:" . ":_('" . $selectImportFileNote . "');"; + $method[] = $this->_t(4) . "\$message = JText:" . ":_('" . $selectImportFileNote . "');"; // 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[] = $this->_t(4) . "\$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[] = $this->_t(4) . "\$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\treturn;"; - $method[] = "\t}"; + $method[] = $this->_t(4) . "return;"; + $method[] = $this->_t(3) . "}"; + $method[] = $this->_t(2) . "}"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; + $method[] = $this->_t(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_IMPORT_FAILED');"; + $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_list . "', false), \$message, 'error');"; + $method[] = $this->_t(2) . "return;"; + $method[] = $this->_t(1) . "}"; return implode(PHP_EOL, $method); } return $method; @@ -8531,10 +8563,10 @@ class Interpretation extends Fields $this->langContent[$this->lang][$langExport] = 'Export Data'; } $button = array(); - $button[] = PHP_EOL . PHP_EOL . "\t\t\tif (\$this->canDo->get('core.export') && \$this->canDo->get('" . $viewName_single . ".export'))"; - $button[] = "\t\t\t{"; - $button[] = "\t\t\t\tJToolBarHelper::custom('" . $viewName_list . ".exportData', 'download', '', '" . $langExport . "', true);"; - $button[] = "\t\t\t}"; + $button[] = PHP_EOL . PHP_EOL . $this->_t(3) . "if (\$this->canDo->get('core.export') && \$this->canDo->get('" . $viewName_single . ".export'))"; + $button[] = $this->_t(3) . "{"; + $button[] = $this->_t(4) . "JToolBarHelper::custom('" . $viewName_list . ".exportData', 'download', '', '" . $langExport . "', true);"; + $button[] = $this->_t(3) . "}"; return implode(PHP_EOL, $button); } return $button; @@ -8553,10 +8585,10 @@ class Interpretation extends Fields $this->langContent[$this->lang][$langImport] = 'Import Data'; } $button = array(); - $button[] = PHP_EOL . PHP_EOL . "\t\tif (\$this->canDo->get('core.import') && \$this->canDo->get('" . $viewName_single . ".import'))"; - $button[] = "\t\t{"; - $button[] = "\t\t\tJToolBarHelper::custom('" . $viewName_list . ".importData', 'upload', '', '" . $langImport . "', false);"; - $button[] = "\t\t}"; + $button[] = PHP_EOL . PHP_EOL . $this->_t(2) . "if (\$this->canDo->get('core.import') && \$this->canDo->get('" . $viewName_single . ".import'))"; + $button[] = $this->_t(2) . "{"; + $button[] = $this->_t(3) . "JToolBarHelper::custom('" . $viewName_list . ".importData', 'upload', '', '" . $langImport . "', false);"; + $button[] = $this->_t(2) . "}"; return implode(PHP_EOL, $button); } return $button; @@ -8568,26 +8600,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) @@ -8604,54 +8636,54 @@ class Interpretation extends Fields } // setup the query $query = "//" . $this->setLine(__LINE__) . " Get the user object."; - $query .= PHP_EOL . "\t\t\$user = JFactory::getUser();"; - $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $query .= PHP_EOL . "\t\t\$db = JFactory::getDBO();"; - $query .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Select some fields"; - $query .= PHP_EOL . "\t\t\$query->select('a.*');"; + $query .= PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $query .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDBO();"; + $query .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select some fields"; + $query .= PHP_EOL . $this->_t(2) . "\$query->select('a.*');"; // add the category if ($addCategory) { - $query .= PHP_EOL . "\t\t\$query->select(\$db->quoteName('c.title','category_title'));"; + $query .= PHP_EOL . $this->_t(2) . "\$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 . $this->_t(2) . "//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_item table"; + $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "_" . $viewName_single . "', 'a'));"; // add the category if ($addCategory) { - $query .= PHP_EOL . "\t\t\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." . $categoryCodeName . "') . ' = ' . \$db->quoteName('c.id') . ')');"; + $query .= PHP_EOL . $this->_t(2) . "\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." . $categoryCodeName . "') . ' = ' . \$db->quoteName('c.id') . ')');"; } // add custom filtering php $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL); // add the custom fields query $query .= $this->setCustomQuery($viewName_list, $viewName_single); - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by published state"; - $query .= PHP_EOL . "\t\t\$published = \$this->getState('filter.published');"; - $query .= PHP_EOL . "\t\tif (is_numeric(\$published))"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\t\$query->where('a.published = ' . (int) \$published);"; - $query .= PHP_EOL . "\t\t}"; - $query .= PHP_EOL . "\t\telseif (\$published === '')"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\t\$query->where('(a.published = 0 OR a.published = 1)');"; - $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by published state"; + $query .= PHP_EOL . $this->_t(2) . "\$published = \$this->getState('filter.published');"; + $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$published))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.published = ' . (int) \$published);"; + $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . $this->_t(2) . "elseif (\$published === '')"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('(a.published = 0 OR a.published = 1)');"; + $query .= PHP_EOL . $this->_t(2) . "}"; if (isset($this->accessBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName_single])) { - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Join over the asset groups."; - $query .= PHP_EOL . "\t\t\$query->select('ag.title AS access_level');"; - $query .= PHP_EOL . "\t\t\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; - $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by access level."; - $query .= PHP_EOL . "\t\tif (\$access = \$this->getState('filter.access'))"; - $query .= PHP_EOL . "\t\t{"; - $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\t{"; - $query .= PHP_EOL . "\t\t\t\$groups = implode(',', \$user->getAuthorisedViewLevels());"; - $query .= PHP_EOL . "\t\t\t\$query->where('a.access IN (' . \$groups . ')');"; - $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Join over the asset groups."; + $query .= PHP_EOL . $this->_t(2) . "\$query->select('ag.title AS access_level');"; + $query .= PHP_EOL . $this->_t(2) . "\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by access level."; + $query .= PHP_EOL . $this->_t(2) . "if (\$access = \$this->getState('filter.access'))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access = ' . (int) \$access);"; + $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Implement View Level Access"; + $query .= PHP_EOL . $this->_t(2) . "if (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "'))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access IN (' . \$groups . ')');"; + $query .= PHP_EOL . $this->_t(2) . "}"; } // set the search query $query .= $this->setSearchQuery($viewName_list); @@ -8660,37 +8692,37 @@ class Interpretation extends Fields // add the category if ($addCategory) { - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by a single or group of categories."; - $query .= PHP_EOL . "\t\t\$baselevel = 1;"; - $query .= PHP_EOL . "\t\t\$categoryId = \$this->getState('filter.category_id');"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by a single or group of categories."; + $query .= PHP_EOL . $this->_t(2) . "\$baselevel = 1;"; + $query .= PHP_EOL . $this->_t(2) . "\$categoryId = \$this->getState('filter.category_id');"; $query .= PHP_EOL; - $query .= PHP_EOL . "\t\tif (is_numeric(\$categoryId))"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\t\$cat_tbl = JTable::getInstance('Category', 'JTable');"; - $query .= PHP_EOL . "\t\t\t\$cat_tbl->load(\$categoryId);"; - $query .= PHP_EOL . "\t\t\t\$rgt = \$cat_tbl->rgt;"; - $query .= PHP_EOL . "\t\t\t\$lft = \$cat_tbl->lft;"; - $query .= PHP_EOL . "\t\t\t\$baselevel = (int) \$cat_tbl->level;"; - $query .= PHP_EOL . "\t\t\t\$query->where('c.lft >= ' . (int) \$lft)"; - $query .= PHP_EOL . "\t\t\t\t->where('c.rgt <= ' . (int) \$rgt);"; - $query .= PHP_EOL . "\t\t}"; - $query .= PHP_EOL . "\t\telseif (is_array(\$categoryId))"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\tJArrayHelper::toInteger(\$categoryId);"; - $query .= PHP_EOL . "\t\t\t\$categoryId = implode(',', \$categoryId);"; - $query .= PHP_EOL . "\t\t\t\$query->where('a.category IN (' . \$categoryId . ')');"; - $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$categoryId))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$cat_tbl = JTable::getInstance('Category', 'JTable');"; + $query .= PHP_EOL . $this->_t(3) . "\$cat_tbl->load(\$categoryId);"; + $query .= PHP_EOL . $this->_t(3) . "\$rgt = \$cat_tbl->rgt;"; + $query .= PHP_EOL . $this->_t(3) . "\$lft = \$cat_tbl->lft;"; + $query .= PHP_EOL . $this->_t(3) . "\$baselevel = (int) \$cat_tbl->level;"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('c.lft >= ' . (int) \$lft)"; + $query .= PHP_EOL . $this->_t(4) . "->where('c.rgt <= ' . (int) \$rgt);"; + $query .= PHP_EOL . $this->_t(2) . "}"; + $query .= PHP_EOL . $this->_t(2) . "elseif (is_array(\$categoryId))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "JArrayHelper::toInteger(\$categoryId);"; + $query .= PHP_EOL . $this->_t(3) . "\$categoryId = implode(',', \$categoryId);"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.category IN (' . \$categoryId . ')');"; + $query .= PHP_EOL . $this->_t(2) . "}"; $query .= PHP_EOL; } - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add the list ordering clause."; - $query .= PHP_EOL . "\t\t\$orderCol = \$this->state->get('list.ordering', 'a.id');"; - $query .= PHP_EOL . "\t\t\$orderDirn = \$this->state->get('list.direction', 'asc'); "; - $query .= PHP_EOL . "\t\tif (\$orderCol != '')"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\t\$query->order(\$db->escape(\$orderCol . ' ' . \$orderDirn));"; - $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the list ordering clause."; + $query .= PHP_EOL . $this->_t(2) . "\$orderCol = \$this->state->get('list.ordering', 'a.id');"; + $query .= PHP_EOL . $this->_t(2) . "\$orderDirn = \$this->state->get('list.direction', 'asc'); "; + $query .= PHP_EOL . $this->_t(2) . "if (\$orderCol != '')"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "\$query->order(\$db->escape(\$orderCol . ' ' . \$orderDirn));"; + $query .= PHP_EOL . $this->_t(2) . "}"; $query .= PHP_EOL; - $query .= PHP_EOL . "\t\treturn \$query;"; + $query .= PHP_EOL . $this->_t(2) . "return \$query;"; return $query; } @@ -8723,20 +8755,20 @@ class Interpretation extends Fields } $search .= ")'"; // now setup query - $query = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by search."; - $query .= PHP_EOL . "\t\t\$search = \$this->getState('filter.search');"; - $query .= PHP_EOL . "\t\tif (!empty(\$search))"; - $query .= PHP_EOL . "\t\t{"; - $query .= PHP_EOL . "\t\t\tif (stripos(\$search, 'id:') === 0)"; - $query .= PHP_EOL . "\t\t\t{"; - $query .= PHP_EOL . "\t\t\t\t\$query->where('a.id = ' . (int) substr(\$search, 3));"; - $query .= PHP_EOL . "\t\t\t}"; - $query .= PHP_EOL . "\t\t\telse"; - $query .= PHP_EOL . "\t\t\t{"; - $query .= PHP_EOL . "\t\t\t\t\$search = \$db->quote('%' . \$db->escape(\$search) . '%');"; - $query .= PHP_EOL . "\t\t\t\t\$query->where(" . $search . ");"; - $query .= PHP_EOL . "\t\t\t}"; - $query .= PHP_EOL . "\t\t}"; + $query = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by search."; + $query .= PHP_EOL . $this->_t(2) . "\$search = \$this->getState('filter.search');"; + $query .= PHP_EOL . $this->_t(2) . "if (!empty(\$search))"; + $query .= PHP_EOL . $this->_t(2) . "{"; + $query .= PHP_EOL . $this->_t(3) . "if (stripos(\$search, 'id:') === 0)"; + $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "\$query->where('a.id = ' . (int) substr(\$search, 3));"; + $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . $this->_t(3) . "else"; + $query .= PHP_EOL . $this->_t(3) . "{"; + $query .= PHP_EOL . $this->_t(4) . "\$search = \$db->quote('%' . \$db->escape(\$search) . '%');"; + $query .= PHP_EOL . $this->_t(4) . "\$query->where(" . $search . ");"; + $query .= PHP_EOL . $this->_t(3) . "}"; + $query .= PHP_EOL . $this->_t(2) . "}"; $query .= PHP_EOL; return $query; @@ -8754,9 +8786,9 @@ class Interpretation extends Fields // only load this if table is set if (isset($this->customBuilderList[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customBuilderList[$viewName_list]) && in_array($filter['code'], $this->customBuilderList[$viewName_list]) && isset($filter['custom']['table']) && ComponentbuilderHelper::checkString($filter['custom']['table']) && $filter['method'] == 0) { - $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " From the " . ComponentbuilderHelper::safeString(ComponentbuilderHelper::safeString($filter['custom']['table'], 'w')) . " table."; - $query .= PHP_EOL . "\t\t\$query->select(\$db->quoteName('" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "','" . $filter['code'] . "_" . $filter['custom']['text'] . "'));"; - $query .= PHP_EOL . "\t\t\$query->join('LEFT', \$db->quoteName('" . $filter['custom']['table'] . "', '" . $filter['custom']['db'] . "') . ' ON (' . \$db->quoteName('a." . $filter['code'] . "') . ' = ' . \$db->quoteName('" . $filter['custom']['db'] . "." . $filter['custom']['id'] . "') . ')');"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " From the " . ComponentbuilderHelper::safeString(ComponentbuilderHelper::safeString($filter['custom']['table'], 'w')) . " table."; + $query .= PHP_EOL . $this->_t(2) . "\$query->select(\$db->quoteName('" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "','" . $filter['code'] . "_" . $filter['custom']['text'] . "'));"; + $query .= PHP_EOL . $this->_t(2) . "\$query->join('LEFT', \$db->quoteName('" . $filter['custom']['table'] . "', '" . $filter['custom']['db'] . "') . ' ON (' . \$db->quoteName('a." . $filter['code'] . "') . ' = ' . \$db->quoteName('" . $filter['custom']['db'] . "." . $filter['custom']['id'] . "') . ')');"; } // build the field type file $this->setCustomFieldTypeFile($filter, $viewName_list, $viewName_single); @@ -8774,19 +8806,19 @@ class Interpretation extends Fields { if ($filter['type'] != 'category' && ComponentbuilderHelper::checkArray($filter['custom'])) { - $filterQuery .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by " . $filter['code'] . "."; - $filterQuery .= PHP_EOL . "\t\tif (\$" . $filter['code'] . " = \$this->getState('filter." . $filter['code'] . "'))"; - $filterQuery .= PHP_EOL . "\t\t{"; - $filterQuery .= PHP_EOL . "\t\t\t\$query->where('a." . $filter['code'] . " = ' . \$db->quote(\$db->escape(\$" . $filter['code'] . ")));"; - $filterQuery .= PHP_EOL . "\t\t}"; + $filterQuery .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by " . $filter['code'] . "."; + $filterQuery .= PHP_EOL . $this->_t(2) . "if (\$" . $filter['code'] . " = \$this->getState('filter." . $filter['code'] . "'))"; + $filterQuery .= PHP_EOL . $this->_t(2) . "{"; + $filterQuery .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $filter['code'] . " = ' . \$db->quote(\$db->escape(\$" . $filter['code'] . ")));"; + $filterQuery .= PHP_EOL . $this->_t(2) . "}"; } elseif ($filter['type'] != 'category') { - $filterQuery .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by " . ucwords($filter['code']) . "."; - $filterQuery .= PHP_EOL . "\t\tif (\$" . $filter['code'] . " = \$this->getState('filter." . $filter['code'] . "'))"; - $filterQuery .= PHP_EOL . "\t\t{"; - $filterQuery .= PHP_EOL . "\t\t\t\$query->where('a." . $filter['code'] . " = ' . \$db->quote(\$db->escape(\$" . $filter['code'] . ")));"; - $filterQuery .= PHP_EOL . "\t\t}"; + $filterQuery .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by " . ucwords($filter['code']) . "."; + $filterQuery .= PHP_EOL . $this->_t(2) . "if (\$" . $filter['code'] . " = \$this->getState('filter." . $filter['code'] . "'))"; + $filterQuery .= PHP_EOL . $this->_t(2) . "{"; + $filterQuery .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $filter['code'] . " = ' . \$db->quote(\$db->escape(\$" . $filter['code'] . ")));"; + $filterQuery .= PHP_EOL . $this->_t(2) . "}"; } } return $filterQuery; @@ -8928,7 +8960,7 @@ class Interpretation extends Fields $listener .= PHP_EOL . "});"; $listener .= PHP_EOL . "jQuery('#adminForm').on('change', '#jform_" . $name . "',function (e)"; $listener .= PHP_EOL . "{"; - $listener .= PHP_EOL . "\te.preventDefault();"; + $listener .= PHP_EOL . $this->_t(1) . "e.preventDefault();"; $listener .= $funcCall['code']; $listener .= PHP_EOL . "});" . PHP_EOL; } @@ -8937,9 +8969,9 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkString($modal)) { $listener .= PHP_EOL . "window.SqueezeBox.initialize({"; - $listener .= PHP_EOL . "\tonClose:function(){"; + $listener .= PHP_EOL . $this->_t(1) . "onClose:function(){"; $listener .= $modal; - $listener .= PHP_EOL . "\t}"; + $listener .= PHP_EOL . $this->_t(1) . "}"; $listener .= PHP_EOL . "});" . PHP_EOL; } @@ -8982,31 +9014,31 @@ class Interpretation extends Fields foreach ($f_matchKeys as $a_matchKey) { $name = $matchNames[$a_matchKey]; - $func .= PHP_EOL . "\tif (isSet(" . $a_matchKey . ") && " . $a_matchKey . ".constructor !== Array)" . PHP_EOL . "\t{" . PHP_EOL . "\t\tvar temp_" . $f_function . " = " . $a_matchKey . ";" . PHP_EOL . "\t\tvar " . $a_matchKey . " = [];" . PHP_EOL . "\t\t" . $a_matchKey . ".push(temp_" . $f_function . ");" . PHP_EOL . "\t}"; - $func .= PHP_EOL . "\telse if (!isSet(" . $a_matchKey . "))" . PHP_EOL . "\t{"; - $func .= PHP_EOL . "\t\tvar " . $a_matchKey . " = [];"; - $func .= PHP_EOL . "\t}"; - $func .= PHP_EOL . "\tvar " . $name . " = " . $a_matchKey . ".some(" . $a_matchKey . "_SomeFunc);" . PHP_EOL; + $func .= PHP_EOL . $this->_t(1) . "if (isSet(" . $a_matchKey . ") && " . $a_matchKey . ".constructor !== Array)" . PHP_EOL . $this->_t(1) . "{" . PHP_EOL . $this->_t(2) . "var temp_" . $f_function . " = " . $a_matchKey . ";" . PHP_EOL . $this->_t(2) . "var " . $a_matchKey . " = [];" . PHP_EOL . $this->_t(2) . $a_matchKey . ".push(temp_" . $f_function . ");" . PHP_EOL . $this->_t(1) . "}"; + $func .= PHP_EOL . $this->_t(1) . "else if (!isSet(" . $a_matchKey . "))" . PHP_EOL . $this->_t(1) . "{"; + $func .= PHP_EOL . $this->_t(2) . "var " . $a_matchKey . " = [];"; + $func .= PHP_EOL . $this->_t(1) . "}"; + $func .= PHP_EOL . $this->_t(1) . "var " . $name . " = " . $a_matchKey . ".some(" . $a_matchKey . "_SomeFunc);" . PHP_EOL; // setup the map function $map .= PHP_EOL . "// the " . $f_function . " Some function"; $map .= PHP_EOL . "function " . $a_matchKey . "_SomeFunc(" . $a_matchKey . ")"; $map .= PHP_EOL . "{"; - $map .= PHP_EOL . "\t//" . $this->setLine(__LINE__) . " set the function logic"; - $map .= PHP_EOL . "\tif ("; + $map .= PHP_EOL . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set the function logic"; + $map .= PHP_EOL . $this->_t(1) . "if ("; $if = $ifValue[$a_matchKey]; if (ComponentbuilderHelper::checkString($if)) { $map .= $if; } $map .= ")"; - $map .= PHP_EOL . "\t{"; - $map .= PHP_EOL . "\t\treturn true;"; - $map .= PHP_EOL . "\t}" . PHP_EOL . "\treturn false;"; + $map .= PHP_EOL . $this->_t(1) . "{"; + $map .= PHP_EOL . $this->_t(2) . "return true;"; + $map .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL . $this->_t(1) . "return false;"; $map .= PHP_EOL . "}" . PHP_EOL; } - $func .= PHP_EOL . PHP_EOL . "\t//" . $this->setLine(__LINE__) . " set this function logic"; - $func .= PHP_EOL . "\tif ("; + $func .= PHP_EOL . PHP_EOL . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set this function logic"; + $func .= PHP_EOL . $this->_t(1) . "if ("; // set if counter $aifcounter = 0; foreach ($f_matchKeys as $af_matchKey) @@ -9022,12 +9054,12 @@ class Interpretation extends Fields } $aifcounter++; } - $func .= ")" . PHP_EOL . "\t{"; + $func .= ")" . PHP_EOL . $this->_t(1) . "{"; } else { - $func .= PHP_EOL . "\t//" . $this->setLine(__LINE__) . " set the function logic"; - $func .= PHP_EOL . "\tif ("; + $func .= PHP_EOL . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set the function logic"; + $func .= PHP_EOL . $this->_t(1) . "if ("; // set if counter $ifcounter = 0; foreach ($f_matchKeys as $f_matchKey) @@ -9046,7 +9078,7 @@ class Interpretation extends Fields $ifcounter++; } } - $func .= ")" . PHP_EOL . "\t{"; + $func .= ")" . PHP_EOL . $this->_t(1) . "{"; } // get the controles $controls = $targetControls[$f_matchKeys[0]]; @@ -9063,7 +9095,7 @@ class Interpretation extends Fields $head .= $action['requiredVar']; } } - $func .= PHP_EOL . "\t}" . PHP_EOL . "\telse" . PHP_EOL . "\t{"; + $func .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL . $this->_t(1) . "else" . PHP_EOL . $this->_t(1) . "{"; foreach ($controls as $target => $action) { $func .= $action['default']; @@ -9072,7 +9104,7 @@ class Interpretation extends Fields $func .= $action[$targetDefault]; } } - $func .= PHP_EOL . "\t}" . PHP_EOL . "}" . PHP_EOL . $map; + $func .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL . "}" . PHP_EOL . $map; } // add the needed validation to file if (isset($this->validationFixBuilder[$viewName]) && ComponentbuilderHelper::checkArray($this->validationFixBuilder[$viewName])) @@ -9080,36 +9112,36 @@ class Interpretation extends Fields $validation .= PHP_EOL . "// update required fields"; $validation .= PHP_EOL . "function updateFieldRequired(name,status)"; $validation .= PHP_EOL . "{"; - $validation .= PHP_EOL . "\tvar not_required = jQuery('#jform_not_required').val();"; - $validation .= PHP_EOL . PHP_EOL . "\tif(status == 1)"; - $validation .= PHP_EOL . "\t{"; - $validation .= PHP_EOL . "\t\tif (isSet(not_required) && not_required != 0)"; - $validation .= PHP_EOL . "\t\t{"; - $validation .= PHP_EOL . "\t\t\tnot_required = not_required+','+name;"; - $validation .= PHP_EOL . "\t\t}"; - $validation .= PHP_EOL . "\t\telse"; - $validation .= PHP_EOL . "\t\t{"; - $validation .= PHP_EOL . "\t\t\tnot_required = ','+name;"; - $validation .= PHP_EOL . "\t\t}"; - $validation .= PHP_EOL . "\t}"; - $validation .= PHP_EOL . "\telse"; - $validation .= PHP_EOL . "\t{"; - $validation .= PHP_EOL . "\t\tif (isSet(not_required) && not_required != 0)"; - $validation .= PHP_EOL . "\t\t{"; - $validation .= PHP_EOL . "\t\t\tnot_required = not_required.replace(','+name,'');"; - $validation .= PHP_EOL . "\t\t}"; - $validation .= PHP_EOL . "\t}"; - $validation .= PHP_EOL . PHP_EOL . "\tjQuery('#jform_not_required').val(not_required);"; + $validation .= PHP_EOL . $this->_t(1) . "var not_required = jQuery('#jform_not_required').val();"; + $validation .= PHP_EOL . PHP_EOL . $this->_t(1) . "if(status == 1)"; + $validation .= PHP_EOL . $this->_t(1) . "{"; + $validation .= PHP_EOL . $this->_t(2) . "if (isSet(not_required) && not_required != 0)"; + $validation .= PHP_EOL . $this->_t(2) . "{"; + $validation .= PHP_EOL . $this->_t(3) . "not_required = not_required+','+name;"; + $validation .= PHP_EOL . $this->_t(2) . "}"; + $validation .= PHP_EOL . $this->_t(2) . "else"; + $validation .= PHP_EOL . $this->_t(2) . "{"; + $validation .= PHP_EOL . $this->_t(3) . "not_required = ','+name;"; + $validation .= PHP_EOL . $this->_t(2) . "}"; + $validation .= PHP_EOL . $this->_t(1) . "}"; + $validation .= PHP_EOL . $this->_t(1) . "else"; + $validation .= PHP_EOL . $this->_t(1) . "{"; + $validation .= PHP_EOL . $this->_t(2) . "if (isSet(not_required) && not_required != 0)"; + $validation .= PHP_EOL . $this->_t(2) . "{"; + $validation .= PHP_EOL . $this->_t(3) . "not_required = not_required.replace(','+name,'');"; + $validation .= PHP_EOL . $this->_t(2) . "}"; + $validation .= PHP_EOL . $this->_t(1) . "}"; + $validation .= PHP_EOL . PHP_EOL . $this->_t(1) . "jQuery('#jform_not_required').val(not_required);"; $validation .= PHP_EOL . "}" . PHP_EOL; } // set the isSet function $isSet = PHP_EOL . "// the isSet function"; $isSet .= PHP_EOL . "function isSet(val)"; $isSet .= PHP_EOL . "{"; - $isSet .= PHP_EOL . "\tif ((val != undefined) && (val != null) && 0 !== val.length){"; - $isSet .= PHP_EOL . "\t\treturn true;"; - $isSet .= PHP_EOL . "\t}"; - $isSet .= PHP_EOL . "\treturn false;"; + $isSet .= PHP_EOL . $this->_t(1) . "if ((val != undefined) && (val != null) && 0 !== val.length){"; + $isSet .= PHP_EOL . $this->_t(2) . "return true;"; + $isSet .= PHP_EOL . $this->_t(1) . "}"; + $isSet .= PHP_EOL . $this->_t(1) . "return false;"; $isSet .= PHP_EOL . "}"; } // load to this buket @@ -9195,13 +9227,13 @@ class Interpretation extends Fields $value = $getValue[$matchKey]; if ($value['isArray']) { - $initial .= PHP_EOL . "\t" . $value['get']; + $initial .= PHP_EOL . $this->_t(1) . $value['get']; $funcsets[] = $matchKey; $array = true; } else { - $initial .= PHP_EOL . "\t" . $value['get']; + $initial .= PHP_EOL . $this->_t(1) . $value['get']; $funcsets[] = $matchKey; } } @@ -9209,7 +9241,7 @@ class Interpretation extends Fields // make sure that the function is loaded only once if (ComponentbuilderHelper::checkArray($funcsets)) { - $initial .= PHP_EOL . "\t" . $function . "("; + $initial .= PHP_EOL . $this->_t(1) . $function . "("; $initial .= implode(',', $funcsets); $initial .= ");" . PHP_EOL; } @@ -9303,7 +9335,7 @@ class Interpretation extends Fields } // set target type $targetTypeSufix = ""; - if ($this->defaultField($target['type'], 'spacer')) + if (ComponentbuilderHelper::fieldCheck($target['type'], 'spacer')) { // target a class if this is a note or spacer $targetType = "."; @@ -9321,30 +9353,30 @@ class Interpretation extends Fields $targetType = "#jform_"; } // set the target behavior - $bucket[$target['name']]['behavior'] = PHP_EOL . "\t\tjQuery('" . $targetType . $target['name'] . $targetTypeSufix . "').closest('.control-group')." . $targetBehavior . "();"; + $bucket[$target['name']]['behavior'] = PHP_EOL . $this->_t(2) . "jQuery('" . $targetType . $target['name'] . $targetTypeSufix . "').closest('.control-group')." . $targetBehavior . "();"; // set the target default - $bucket[$target['name']]['default'] = PHP_EOL . "\t\tjQuery('" . $targetType . $target['name'] . $targetTypeSufix . "').closest('.control-group')." . $targetDefault . "();"; + $bucket[$target['name']]['default'] = PHP_EOL . $this->_t(2) . "jQuery('" . $targetType . $target['name'] . $targetTypeSufix . "').closest('.control-group')." . $targetDefault . "();"; // the hide required function if ($target['required'] === 'yes') { - $hide = PHP_EOL . "\t\tif (!jform_" . $unique . "_required)"; - $hide .= PHP_EOL . "\t\t{"; - $hide .= PHP_EOL . "\t\t\tupdateFieldRequired('" . $target['name'] . "',1);"; - $hide .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').removeAttr('required');"; - $hide .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').removeAttr('aria-required');"; - $hide .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').removeClass('required');"; - $hide .= PHP_EOL . "\t\t\tjform_" . $unique . "_required = true;"; - $hide .= PHP_EOL . "\t\t}"; + $hide = PHP_EOL . $this->_t(2) . "if (!jform_" . $unique . "_required)"; + $hide .= PHP_EOL . $this->_t(2) . "{"; + $hide .= PHP_EOL . $this->_t(3) . "updateFieldRequired('" . $target['name'] . "',1);"; + $hide .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').removeAttr('required');"; + $hide .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').removeAttr('aria-required');"; + $hide .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').removeClass('required');"; + $hide .= PHP_EOL . $this->_t(3) . "jform_" . $unique . "_required = true;"; + $hide .= PHP_EOL . $this->_t(2) . "}"; $bucket[$target['name']]['hide'] = $hide; // the show required function - $show = PHP_EOL . "\t\tif (jform_" . $unique . "_required)"; - $show .= PHP_EOL . "\t\t{"; - $show .= PHP_EOL . "\t\t\tupdateFieldRequired('" . $target['name'] . "',0);"; - $show .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').prop('required','required');"; - $show .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').attr('aria-required',true);"; - $show .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').addClass('required');"; - $show .= PHP_EOL . "\t\t\tjform_" . $unique . "_required = false;"; - $show .= PHP_EOL . "\t\t}" . PHP_EOL; + $show = PHP_EOL . $this->_t(2) . "if (jform_" . $unique . "_required)"; + $show .= PHP_EOL . $this->_t(2) . "{"; + $show .= PHP_EOL . $this->_t(3) . "updateFieldRequired('" . $target['name'] . "',0);"; + $show .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').prop('required','required');"; + $show .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').attr('aria-required',true);"; + $show .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').addClass('required');"; + $show .= PHP_EOL . $this->_t(3) . "jform_" . $unique . "_required = false;"; + $show .= PHP_EOL . $this->_t(2) . "}" . PHP_EOL; $bucket[$target['name']]['show'] = $show; // make sure that the axaj and other needed things for this view is loaded $this->validationFixBuilder[$viewName][] = $target['name']; @@ -9369,7 +9401,7 @@ class Interpretation extends Fields { case 1: // Is // only 4 list/radio/checkboxes - if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9400,7 +9432,7 @@ class Interpretation extends Fields break; case 2: // Is Not // only 4 list/radio/checkboxes - if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9431,7 +9463,7 @@ class Interpretation extends Fields break; case 3: // Any Selection // only 4 list/radio/checkboxes/dynamic_list - if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9469,21 +9501,21 @@ class Interpretation extends Fields break; case 4: // Active (not empty) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { $string .= 'isSet(' . $value . ')'; } break; case 5: // Unactive (empty) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { $string .= '!isSet(' . $value . ')'; } break; case 6: // Key Word All (case-sensitive) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options['keywords'])) { @@ -9507,7 +9539,7 @@ class Interpretation extends Fields break; case 7: // Key Word Any (case-sensitive) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options['keywords'])) { @@ -9531,7 +9563,7 @@ class Interpretation extends Fields break; case 8: // Key Word All (case-insensitive) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options['keywords'])) { @@ -9556,7 +9588,7 @@ class Interpretation extends Fields break; case 9: // Key Word Any (case-insensitive) // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options['keywords'])) { @@ -9581,7 +9613,7 @@ class Interpretation extends Fields break; case 10: // Min Length // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9598,7 +9630,7 @@ class Interpretation extends Fields break; case 11: // Max Length // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9615,7 +9647,7 @@ class Interpretation extends Fields break; case 12: // Exact Length // only 4 text_field - if (ComponentbuilderHelper::typeField($type, 'text')) + if (ComponentbuilderHelper::fieldCheck($type, 'text')) { if (ComponentbuilderHelper::checkArray($options)) { @@ -9643,7 +9675,7 @@ class Interpretation extends Fields $buket = array(); if (ComponentbuilderHelper::checkString($options)) { - if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { $optionsArray = array_map('trim', (array) explode(PHP_EOL, $options)); if (!ComponentbuilderHelper::checkArray($optionsArray)) @@ -9663,7 +9695,7 @@ class Interpretation extends Fields } } } - elseif (ComponentbuilderHelper::typeField($type, 'text')) + elseif (ComponentbuilderHelper::fieldCheck($type, 'text')) { // check to get the key words if set $keywords = ComponentbuilderHelper::getBetween($options, 'keywords="', '"'); @@ -9705,7 +9737,7 @@ class Interpretation extends Fields $keyName = $name . '_' . $unique; if ($type === 'checkboxes' || $extends === 'checkboxes') { - $select = "var " . $keyName . " = [];" . PHP_EOL . "\tjQuery('#jform_" . $name . " input[type=checkbox]').each(function()" . PHP_EOL . "\t{" . PHP_EOL . "\t\tif (jQuery(this).is(':checked'))" . PHP_EOL . "\t\t{" . PHP_EOL . "\t\t\t" . $keyName . ".push(jQuery(this).prop('value'));" . PHP_EOL . "\t\t}" . PHP_EOL . "\t});"; + $select = "var " . $keyName . " = [];" . PHP_EOL . $this->_t(1) . "jQuery('#jform_" . $name . " input[type=checkbox]').each(function()" . PHP_EOL . $this->_t(1) . "{" . PHP_EOL . $this->_t(2) . "if (jQuery(this).is(':checked'))" . PHP_EOL . $this->_t(2) . "{" . PHP_EOL . $this->_t(3) . $keyName . ".push(jQuery(this).prop('value'));" . PHP_EOL . $this->_t(2) . "}" . PHP_EOL . $this->_t(1) . "});"; $isArray = true; } elseif ($type === 'checkbox') @@ -9721,12 +9753,12 @@ class Interpretation extends Fields // this is only since 3.3.4 $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '_id").val();'; } - elseif ($type === 'list' || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) + elseif ($type === 'list' || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) { $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '").val();'; $isArray = true; } - elseif (ComponentbuilderHelper::typeField($type, 'text')) + elseif (ComponentbuilderHelper::fieldCheck($type, 'text')) { $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '").val();'; } @@ -9776,41 +9808,41 @@ class Interpretation extends Fields $fix = ''; if (isset($this->validationFixBuilder[$view]) && ComponentbuilderHelper::checkArray($this->validationFixBuilder[$view])) { - $fix .= PHP_EOL . PHP_EOL . "\t/**"; - $fix .= PHP_EOL . "\t* Method to validate the form data."; - $fix .= PHP_EOL . "\t*"; - $fix .= PHP_EOL . "\t* @param JForm \$form The form to validate against."; - $fix .= PHP_EOL . "\t* @param array \$data The data to validate."; - $fix .= PHP_EOL . "\t* @param string \$group The name of the field group to validate."; - $fix .= PHP_EOL . "\t*"; - $fix .= PHP_EOL . "\t* @return mixed Array of filtered data if valid, false otherwise."; - $fix .= PHP_EOL . "\t*"; - $fix .= PHP_EOL . "\t* @see JFormRule"; - $fix .= PHP_EOL . "\t* @see JFilterInput"; - $fix .= PHP_EOL . "\t* @since 12.2"; - $fix .= PHP_EOL . "\t*/"; - $fix .= PHP_EOL . "\tpublic function validate(\$form, \$data, \$group = null)"; - $fix .= PHP_EOL . "\t{"; - $fix .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " check if the not_required field is set"; - $fix .= PHP_EOL . "\t\tif (" . $Component . "Helper::checkString(\$data['not_required']))"; - $fix .= PHP_EOL . "\t\t{"; - $fix .= PHP_EOL . "\t\t\t\$requiredFields = (array) explode(',',(string) \$data['not_required']);"; - $fix .= PHP_EOL . "\t\t\t\$requiredFields = array_unique(\$requiredFields);"; - $fix .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " now change the required field attributes value"; - $fix .= PHP_EOL . "\t\t\tforeach (\$requiredFields as \$requiredField)"; - $fix .= PHP_EOL . "\t\t\t{"; - $fix .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " make sure there is a string value"; - $fix .= PHP_EOL . "\t\t\t\tif (" . $Component . "Helper::checkString(\$requiredField))"; - $fix .= PHP_EOL . "\t\t\t\t{"; - $fix .= PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " change to false"; - $fix .= PHP_EOL . "\t\t\t\t\t\$form->setFieldAttribute(\$requiredField, 'required', 'false');"; - $fix .= PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " also clear the data set"; - $fix .= PHP_EOL . "\t\t\t\t\t\$data[\$requiredField] = '';"; - $fix .= PHP_EOL . "\t\t\t\t}"; - $fix .= PHP_EOL . "\t\t\t}"; - $fix .= PHP_EOL . "\t\t}"; - $fix .= PHP_EOL . "\t\treturn parent::validate(\$form, \$data, \$group);"; - $fix .= PHP_EOL . "\t}"; + $fix .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $fix .= PHP_EOL . $this->_t(1) . " * Method to validate the form data."; + $fix .= PHP_EOL . $this->_t(1) . " *"; + $fix .= PHP_EOL . $this->_t(1) . " * @param JForm \$form The form to validate against."; + $fix .= PHP_EOL . $this->_t(1) . " * @param array \$data The data to validate."; + $fix .= PHP_EOL . $this->_t(1) . " * @param string \$group The name of the field group to validate."; + $fix .= PHP_EOL . $this->_t(1) . " *"; + $fix .= PHP_EOL . $this->_t(1) . " * @return mixed Array of filtered data if valid, false otherwise."; + $fix .= PHP_EOL . $this->_t(1) . " *"; + $fix .= PHP_EOL . $this->_t(1) . " * @see JFormRule"; + $fix .= PHP_EOL . $this->_t(1) . " * @see JFilterInput"; + $fix .= PHP_EOL . $this->_t(1) . " * @since 12.2"; + $fix .= PHP_EOL . $this->_t(1) . " */"; + $fix .= PHP_EOL . $this->_t(1) . "public function validate(\$form, \$data, \$group = null)"; + $fix .= PHP_EOL . $this->_t(1) . "{"; + $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if the not_required field is set"; + $fix .= PHP_EOL . $this->_t(2) . "if (" . $Component . "Helper::checkString(\$data['not_required']))"; + $fix .= PHP_EOL . $this->_t(2) . "{"; + $fix .= PHP_EOL . $this->_t(3) . "\$requiredFields = (array) explode(',',(string) \$data['not_required']);"; + $fix .= PHP_EOL . $this->_t(3) . "\$requiredFields = array_unique(\$requiredFields);"; + $fix .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " now change the required field attributes value"; + $fix .= PHP_EOL . $this->_t(3) . "foreach (\$requiredFields as \$requiredField)"; + $fix .= PHP_EOL . $this->_t(3) . "{"; + $fix .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " make sure there is a string value"; + $fix .= PHP_EOL . $this->_t(4) . "if (" . $Component . "Helper::checkString(\$requiredField))"; + $fix .= PHP_EOL . $this->_t(4) . "{"; + $fix .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " change to false"; + $fix .= PHP_EOL . $this->_t(5) . "\$form->setFieldAttribute(\$requiredField, 'required', 'false');"; + $fix .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " also clear the data set"; + $fix .= PHP_EOL . $this->_t(5) . "\$data[\$requiredField] = '';"; + $fix .= PHP_EOL . $this->_t(4) . "}"; + $fix .= PHP_EOL . $this->_t(3) . "}"; + $fix .= PHP_EOL . $this->_t(2) . "}"; + $fix .= PHP_EOL . $this->_t(2) . "return parent::validate(\$form, \$data, \$group);"; + $fix .= PHP_EOL . $this->_t(1) . "}"; } return $fix; } @@ -9820,8 +9852,8 @@ class Interpretation extends Fields $fix = ''; if (isset($this->customScriptBuilder['token'][$view]) && $this->customScriptBuilder['token'][$view]) { - $fix .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add Ajax Token"; - $fix .= PHP_EOL . "\t\t\$this->document->addScriptDeclaration(\"var token = '\".JSession::getFormToken().\"';\");"; + $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add Ajax Token"; + $fix .= PHP_EOL . $this->_t(2) . "\$this->document->addScriptDeclaration(\"var token = '\".JSession::getFormToken().\"';\");"; } return $fix; } @@ -9843,7 +9875,7 @@ class Interpretation extends Fields { foreach ($taskArray as $name) { - $tasks .= PHP_EOL . "\t\t\$this->registerTask('" . $name . "', 'ajax');"; + $tasks .= PHP_EOL . $this->_t(2) . "\$this->registerTask('" . $name . "', 'ajax');"; } } } @@ -9863,9 +9895,9 @@ class Interpretation extends Fields { foreach ($view as $task) { - $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'] . "');"; + $input[$task['task_name']][] = PHP_EOL . $this->_t(6) . "\$" . $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 . $this->_t(7) . "\$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']) @@ -9884,10 +9916,10 @@ class Interpretation extends Fields { foreach ($getModel as $task => $getMethod) { - $cases .= PHP_EOL . "\t\t\t\tcase '" . $task . "':"; - $cases .= PHP_EOL . "\t\t\t\t\ttry"; - $cases .= PHP_EOL . "\t\t\t\t\t{"; - $cases .= PHP_EOL . "\t\t\t\t\t\t\$returnRaw = \$jinput->get('raw', false, 'BOOLEAN');"; + $cases .= PHP_EOL . $this->_t(4) . "case '" . $task . "':"; + $cases .= PHP_EOL . $this->_t(5) . "try"; + $cases .= PHP_EOL . $this->_t(5) . "{"; + $cases .= PHP_EOL . $this->_t(6) . "\$returnRaw = \$jinput->get('raw', false, 'BOOLEAN');"; foreach ($input[$task] as $string) { $cases .= $string; @@ -9896,40 +9928,40 @@ class Interpretation extends Fields $values = implode(', ', $valueArray[$task]); $ifvalues = implode(' && ', $valueArray[$task]); // set the values to method - $getMethod = str_replace('[[[valueArray]]]', $values, $getMethod); - $cases .= PHP_EOL . "\t\t\t\t\t\tif(" . $ifvalues . $userCheck[$task] . ")"; - $cases .= PHP_EOL . "\t\t\t\t\t\t{"; + $getMethod = str_replace($this->bbb . 'valueArray' . $this->ddd, $values, $getMethod); + $cases .= PHP_EOL . $this->_t(6) . "if(" . $ifvalues . $userCheck[$task] . ")"; + $cases .= PHP_EOL . $this->_t(6) . "{"; $cases .= $getMethod; - $cases .= PHP_EOL . "\t\t\t\t\t\t}"; - $cases .= PHP_EOL . "\t\t\t\t\t\telse"; - $cases .= PHP_EOL . "\t\t\t\t\t\t{"; - $cases .= PHP_EOL . "\t\t\t\t\t\t\t\$result = false;"; - $cases .= PHP_EOL . "\t\t\t\t\t\t}"; - $cases .= PHP_EOL . "\t\t\t\t\t\tif(\$callback = \$jinput->get('callback', null, 'CMD'))"; - $cases .= PHP_EOL . "\t\t\t\t\t\t{"; - $cases .= PHP_EOL . "\t\t\t\t\t\t\techo \$callback . \"(\".json_encode(\$result).\");\";"; - $cases .= PHP_EOL . "\t\t\t\t\t\t}"; - $cases .= PHP_EOL . "\t\t\t\t\t\telseif(\$returnRaw)"; - $cases .= PHP_EOL . "\t\t\t\t\t\t{"; - $cases .= PHP_EOL . "\t\t\t\t\t\t\techo json_encode(\$result);"; - $cases .= PHP_EOL . "\t\t\t\t\t\t}"; - $cases .= PHP_EOL . "\t\t\t\t\t\telse"; - $cases .= PHP_EOL . "\t\t\t\t\t\t{"; - $cases .= PHP_EOL . "\t\t\t\t\t\t\techo \"(\".json_encode(\$result).\");\";"; - $cases .= PHP_EOL . "\t\t\t\t\t\t}"; - $cases .= PHP_EOL . "\t\t\t\t\t}"; - $cases .= PHP_EOL . "\t\t\t\t\tcatch(Exception \$e)"; - $cases .= PHP_EOL . "\t\t\t\t\t{"; - $cases .= PHP_EOL . "\t\t\t\t\t\tif(\$callback = \$jinput->get('callback', null, 'CMD'))"; - $cases .= PHP_EOL . "\t\t\t\t\t\t{"; - $cases .= PHP_EOL . "\t\t\t\t\t\t\techo \$callback.\"(\".json_encode(\$e).\");\";"; - $cases .= PHP_EOL . "\t\t\t\t\t\t}"; - $cases .= PHP_EOL . "\t\t\t\t\t\telse"; - $cases .= PHP_EOL . "\t\t\t\t\t\t{"; - $cases .= PHP_EOL . "\t\t\t\t\t\t\techo \"(\".json_encode(\$e).\");\";"; - $cases .= PHP_EOL . "\t\t\t\t\t\t}"; - $cases .= PHP_EOL . "\t\t\t\t\t}"; - $cases .= PHP_EOL . "\t\t\t\tbreak;"; + $cases .= PHP_EOL . $this->_t(6) . "}"; + $cases .= PHP_EOL . $this->_t(6) . "else"; + $cases .= PHP_EOL . $this->_t(6) . "{"; + $cases .= PHP_EOL . $this->_t(7) . "\$result = false;"; + $cases .= PHP_EOL . $this->_t(6) . "}"; + $cases .= PHP_EOL . $this->_t(6) . "if(\$callback = \$jinput->get('callback', null, 'CMD'))"; + $cases .= PHP_EOL . $this->_t(6) . "{"; + $cases .= PHP_EOL . $this->_t(7) . "echo \$callback . \"(\".json_encode(\$result).\");\";"; + $cases .= PHP_EOL . $this->_t(6) . "}"; + $cases .= PHP_EOL . $this->_t(6) . "elseif(\$returnRaw)"; + $cases .= PHP_EOL . $this->_t(6) . "{"; + $cases .= PHP_EOL . $this->_t(7) . "echo json_encode(\$result);"; + $cases .= PHP_EOL . $this->_t(6) . "}"; + $cases .= PHP_EOL . $this->_t(6) . "else"; + $cases .= PHP_EOL . $this->_t(6) . "{"; + $cases .= PHP_EOL . $this->_t(7) . "echo \"(\".json_encode(\$result).\");\";"; + $cases .= PHP_EOL . $this->_t(6) . "}"; + $cases .= PHP_EOL . $this->_t(5) . "}"; + $cases .= PHP_EOL . $this->_t(5) . "catch(Exception \$e)"; + $cases .= PHP_EOL . $this->_t(5) . "{"; + $cases .= PHP_EOL . $this->_t(6) . "if(\$callback = \$jinput->get('callback', null, 'CMD'))"; + $cases .= PHP_EOL . $this->_t(6) . "{"; + $cases .= PHP_EOL . $this->_t(7) . "echo \$callback.\"(\".json_encode(\$e).\");\";"; + $cases .= PHP_EOL . $this->_t(6) . "}"; + $cases .= PHP_EOL . $this->_t(6) . "else"; + $cases .= PHP_EOL . $this->_t(6) . "{"; + $cases .= PHP_EOL . $this->_t(7) . "echo \"(\".json_encode(\$e).\");\";"; + $cases .= PHP_EOL . $this->_t(6) . "}"; + $cases .= PHP_EOL . $this->_t(5) . "}"; + $cases .= PHP_EOL . $this->_t(4) . "break;"; } } } @@ -9943,7 +9975,7 @@ class Interpretation extends Fields { foreach ($this->customScriptBuilder[$target]['ajax_model'] as $view => $method) { - $methods .= PHP_EOL . PHP_EOL . "\t//" . $this->setLine(__LINE__) . " Used in " . $view . PHP_EOL; + $methods .= PHP_EOL . PHP_EOL . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Used in " . $view . PHP_EOL; $methods .= $this->setPlaceholders($method, $this->placeholders); } } @@ -9961,76 +9993,76 @@ class Interpretation extends Fields { if ($filter['type'] != 'category' && ComponentbuilderHelper::checkArray($filter['custom']) && $filter['custom']['extends'] === 'user') { - $function[] = PHP_EOL . "\tprotected function getThe" . $filter['function'] . ComponentbuilderHelper::safeString($filter['custom']['text'], 'F') . "Selections()"; - $function[] = "\t{"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Get a db connection."; - $function[] = "\t\t\$db = JFactory::getDbo();"; - $function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $function[] = "\t\t\$query = \$db->getQuery(true);"; - $function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Select the text."; - $function[] = "\t\t\$query->select(\$db->quoteName(array('a." . $filter['custom']['id'] . "','a." . $filter['custom']['text'] . "')));"; - $function[] = "\t\t\$query->from(\$db->quoteName('" . $filter['custom']['table'] . "', 'a'));"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " get the targeted groups"; - $function[] = "\t\t\$groups= JComponentHelper::getParams('com_" . $component . "')->get('" . $filter['type'] . "');"; - $function[] = "\t\tif (count(\$groups) > 0)"; - $function[] = "\t\t{"; - $function[] = "\t\t\t\$query->join('LEFT', \$db->quoteName('#__user_usergroup_map', 'group') . ' ON (' . \$db->quoteName('group.user_id') . ' = ' . \$db->quoteName('a.id') . ')');"; - $function[] = "\t\t\t\$query->where('group.group_id IN (' . implode(',', \$groups) . ')');"; - $function[] = "\t\t}"; - $function[] = "\t\t\$query->order('a." . $filter['custom']['text'] . " ASC');"; - $function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; - $function[] = "\t\t\$db->setQuery(\$query);"; - $function[] = PHP_EOL . "\t\t\$results = \$db->loadObjectList();"; - $function[] = "\t\tif (\$results)"; - $function[] = "\t\t{"; - $function[] = "\t\t\t\$filter = array();"; - $function[] = "\t\t\t\$batch = array();"; - $function[] = "\t\t\tforeach (\$results as \$result)"; - $function[] = "\t\t\t{"; - $function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$result->" . $filter['custom']['id'] . ", \$result->" . $filter['custom']['text'] . ");"; - $function[] = "\t\t\t}"; - $function[] = "\t\t\treturn \$filter;"; - $function[] = "\t\t}"; - $function[] = "\t\treturn false;"; - $function[] = "\t}"; + $function[] = PHP_EOL . $this->_t(1) . "protected function getThe" . $filter['function'] . ComponentbuilderHelper::safeString($filter['custom']['text'], 'F') . "Selections()"; + $function[] = $this->_t(1) . "{"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get a db connection."; + $function[] = $this->_t(2) . "\$db = JFactory::getDbo();"; + $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $function[] = $this->_t(2) . "\$query = \$db->getQuery(true);"; + $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select the text."; + $function[] = $this->_t(2) . "\$query->select(\$db->quoteName(array('a." . $filter['custom']['id'] . "','a." . $filter['custom']['text'] . "')));"; + $function[] = $this->_t(2) . "\$query->from(\$db->quoteName('" . $filter['custom']['table'] . "', 'a'));"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get the targeted groups"; + $function[] = $this->_t(2) . "\$groups= JComponentHelper::getParams('com_" . $component . "')->get('" . $filter['type'] . "');"; + $function[] = $this->_t(2) . "if (count(\$groups) > 0)"; + $function[] = $this->_t(2) . "{"; + $function[] = $this->_t(3) . "\$query->join('LEFT', \$db->quoteName('#__user_usergroup_map', 'group') . ' ON (' . \$db->quoteName('group.user_id') . ' = ' . \$db->quoteName('a.id') . ')');"; + $function[] = $this->_t(3) . "\$query->where('group.group_id IN (' . implode(',', \$groups) . ')');"; + $function[] = $this->_t(2) . "}"; + $function[] = $this->_t(2) . "\$query->order('a." . $filter['custom']['text'] . " ASC');"; + $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; + $function[] = $this->_t(2) . "\$db->setQuery(\$query);"; + $function[] = PHP_EOL . $this->_t(2) . "\$results = \$db->loadObjectList();"; + $function[] = $this->_t(2) . "if (\$results)"; + $function[] = $this->_t(2) . "{"; + $function[] = $this->_t(3) . "\$filter = array();"; + $function[] = $this->_t(3) . "\$batch = array();"; + $function[] = $this->_t(3) . "foreach (\$results as \$result)"; + $function[] = $this->_t(3) . "{"; + $function[] = $this->_t(4) . "\$filter[] = JHtml::_('select.option', \$result->" . $filter['custom']['id'] . ", \$result->" . $filter['custom']['text'] . ");"; + $function[] = $this->_t(3) . "}"; + $function[] = $this->_t(3) . "return \$filter;"; + $function[] = $this->_t(2) . "}"; + $function[] = $this->_t(2) . "return false;"; + $function[] = $this->_t(1) . "}"; /* else { - $function[] = PHP_EOL."\tprotected function getThe".$filter['function'].ComponentbuilderHelper::safeString($filter['custom']['text'],'F')."Selections()"; - $function[] = "\t{"; - $function[] = "\t\t//".$this->setLine(__LINE__)." Get a db connection."; - $function[] = "\t\t\$db = JFactory::getDbo();"; - $function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Select the text."; - $function[] = "\t\t\$query = \$db->getQuery(true);"; - $function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Select the text."; - $function[] = "\t\t\$query->select(\$db->quoteName(array('".$filter['custom']['id']."','".$filter['custom']['text']."')));"; - $function[] = "\t\t\$query->from(\$db->quoteName('".$filter['custom']['table']."'));"; - $function[] = "\t\t\$query->where(\$db->quoteName('published') . ' = 1');"; - $function[] = "\t\t\$query->order(\$db->quoteName('".$filter['custom']['text']."') . ' ASC');"; - $function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Reset the query using our newly populated query object."; - $function[] = "\t\t\$db->setQuery(\$query);"; - $function[] = PHP_EOL."\t\t\$results = \$db->loadObjectList();"; - $function[] = PHP_EOL."\t\tif (\$results)"; - $function[] = "\t\t{"; - $function[] = "\t\t\t\$filter = array();"; - $function[] = "\t\t\t\$batch = array();"; - $function[] = "\t\t\tforeach (\$results as \$result)"; - $function[] = "\t\t\t{"; + $function[] = PHP_EOL.$this->_t(1) . "protected function getThe".$filter['function'].ComponentbuilderHelper::safeString($filter['custom']['text'],'F')."Selections()"; + $function[] = $this->_t(1) . "{"; + $function[] = $this->_t(2) . "//".$this->setLine(__LINE__)." Get a db connection."; + $function[] = $this->_t(2) . "\$db = JFactory::getDbo();"; + $function[] = PHP_EOL.$this->_t(2) . "//".$this->setLine(__LINE__)." Select the text."; + $function[] = $this->_t(2) . "\$query = \$db->getQuery(true);"; + $function[] = PHP_EOL.$this->_t(2) . "//".$this->setLine(__LINE__)." Select the text."; + $function[] = $this->_t(2) . "\$query->select(\$db->quoteName(array('".$filter['custom']['id']."','".$filter['custom']['text']."')));"; + $function[] = $this->_t(2) . "\$query->from(\$db->quoteName('".$filter['custom']['table']."'));"; + $function[] = $this->_t(2) . "\$query->where(\$db->quoteName('published') . ' = 1');"; + $function[] = $this->_t(2) . "\$query->order(\$db->quoteName('".$filter['custom']['text']."') . ' ASC');"; + $function[] = PHP_EOL.$this->_t(2) . "//".$this->setLine(__LINE__)." Reset the query using our newly populated query object."; + $function[] = $this->_t(2) . "\$db->setQuery(\$query);"; + $function[] = PHP_EOL.$this->_t(2) . "\$results = \$db->loadObjectList();"; + $function[] = PHP_EOL.$this->_t(2) . "if (\$results)"; + $function[] = $this->_t(2) . "{"; + $function[] = $this->_t(3) . "\$filter = array();"; + $function[] = $this->_t(3) . "\$batch = array();"; + $function[] = $this->_t(3) . "foreach (\$results as \$result)"; + $function[] = $this->_t(3) . "{"; if ($filter['custom']['text'] === 'user') { - $function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);"; - $function[] = "\t\t\t\t\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);"; + $function[] = $this->_t(4) . "\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);"; + $function[] = $this->_t(4) . "\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);"; } else { - $function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", \$result->".$filter['custom']['text'].");"; - $function[] = "\t\t\t\t\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", \$result->".$filter['custom']['text'].");"; + $function[] = $this->_t(4) . "\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", \$result->".$filter['custom']['text'].");"; + $function[] = $this->_t(4) . "\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", \$result->".$filter['custom']['text'].");"; } - $function[] = "\t\t\t}"; - $function[] = "\t\t\treturn array('filter' => \$filter, 'batch' => \$batch);"; - $function[] = "\t\t}"; - $function[] = "\t\treturn false;"; - $function[] = "\t}"; + $function[] = $this->_t(3) . "}"; + $function[] = $this->_t(3) . "return array('filter' => \$filter, 'batch' => \$batch);"; + $function[] = $this->_t(2) . "}"; + $function[] = $this->_t(2) . "return false;"; + $function[] = $this->_t(1) . "}"; } */ } elseif ($filter['type'] != 'category' && !ComponentbuilderHelper::checkArray($filter['custom'])) @@ -10040,55 +10072,55 @@ class Interpretation extends Fields { $translation = true; } - $function[] = PHP_EOL . "\tprotected function getThe" . $filter['function'] . "Selections()"; - $function[] = "\t{"; - $function[] = "\t\t//" . $this->setLine(__LINE__) . " Get a db connection."; - $function[] = "\t\t\$db = JFactory::getDbo();"; - $function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; - $function[] = "\t\t\$query = \$db->getQuery(true);"; - $function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Select the text."; - $function[] = "\t\t\$query->select(\$db->quoteName('" . $filter['code'] . "'));"; - $function[] = "\t\t\$query->from(\$db->quoteName('#__" . $component . "_" . $filter['database'] . "'));"; - $function[] = "\t\t\$query->order(\$db->quoteName('" . $filter['code'] . "') . ' ASC');"; - $function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; - $function[] = "\t\t\$db->setQuery(\$query);"; - $function[] = PHP_EOL . "\t\t\$results = \$db->loadColumn();"; - $function[] = PHP_EOL . "\t\tif (\$results)"; - $function[] = "\t\t{"; + $function[] = PHP_EOL . $this->_t(1) . "protected function getThe" . $filter['function'] . "Selections()"; + $function[] = $this->_t(1) . "{"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get a db connection."; + $function[] = $this->_t(2) . "\$db = JFactory::getDbo();"; + $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $function[] = $this->_t(2) . "\$query = \$db->getQuery(true);"; + $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select the text."; + $function[] = $this->_t(2) . "\$query->select(\$db->quoteName('" . $filter['code'] . "'));"; + $function[] = $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $filter['database'] . "'));"; + $function[] = $this->_t(2) . "\$query->order(\$db->quoteName('" . $filter['code'] . "') . ' ASC');"; + $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; + $function[] = $this->_t(2) . "\$db->setQuery(\$query);"; + $function[] = PHP_EOL . $this->_t(2) . "\$results = \$db->loadColumn();"; + $function[] = PHP_EOL . $this->_t(2) . "if (\$results)"; + $function[] = $this->_t(2) . "{"; // check if translated vlaue is used if ($translation) { - $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " get model"; - $function[] = "\t\t\t\$model = \$this->getModel();"; + $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get model"; + $function[] = $this->_t(3) . "\$model = \$this->getModel();"; } - $function[] = "\t\t\t\$results = array_unique(\$results);"; - $function[] = "\t\t\t\$_filter = array();"; - $function[] = "\t\t\tforeach (\$results as \$" . $filter['code'] . ")"; - $function[] = "\t\t\t{"; + $function[] = $this->_t(3) . "\$results = array_unique(\$results);"; + $function[] = $this->_t(3) . "\$_filter = array();"; + $function[] = $this->_t(3) . "foreach (\$results as \$" . $filter['code'] . ")"; + $function[] = $this->_t(3) . "{"; // check if translated vlaue is used if ($translation) { - $function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Translate the " . $filter['code'] . " selection"; - $function[] = "\t\t\t\t\$text = \$model->selectionTranslation(\$" . $filter['code'] . ",'" . $filter['code'] . "');"; - $function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array"; - $function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", JText:" . ":_(\$text));"; + $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Translate the " . $filter['code'] . " selection"; + $function[] = $this->_t(4) . "\$text = \$model->selectionTranslation(\$" . $filter['code'] . ",'" . $filter['code'] . "');"; + $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array"; + $function[] = $this->_t(4) . "\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", JText:" . ":_(\$text));"; } elseif ($filter['type'] === 'user') { - $function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array"; - $function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", JFactory::getUser(\$" . $filter['code'] . ")->name);"; + $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array"; + $function[] = $this->_t(4) . "\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", JFactory::getUser(\$" . $filter['code'] . ")->name);"; } else { - $function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array"; - $function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", \$" . $filter['code'] . ");"; + $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array"; + $function[] = $this->_t(4) . "\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", \$" . $filter['code'] . ");"; } - $function[] = "\t\t\t}"; - $function[] = "\t\t\treturn \$_filter;"; - $function[] = "\t\t}"; - $function[] = "\t\treturn false;"; - $function[] = "\t}"; + $function[] = $this->_t(3) . "}"; + $function[] = $this->_t(3) . "return \$_filter;"; + $function[] = $this->_t(2) . "}"; + $function[] = $this->_t(2) . "return false;"; + $function[] = $this->_t(1) . "}"; } } if (ComponentbuilderHelper::checkArray($function)) @@ -10103,24 +10135,24 @@ class Interpretation extends Fields public function setUniqueFields(&$view) { $fields = array(); - $fields[] = PHP_EOL . PHP_EOL . "\t/**"; - $fields[] = "\t * Method to get the unique fields of this table."; - $fields[] = "\t *"; - $fields[] = "\t * @return mixed An array of field names, boolean false if none is set."; - $fields[] = "\t *"; - $fields[] = "\t * @since 3.0"; - $fields[] = "\t */"; - $fields[] = "\tprotected function getUniqeFields()"; - $fields[] = "\t{"; + $fields[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $fields[] = $this->_t(1) . " * Method to get the unique fields of this table."; + $fields[] = $this->_t(1) . " *"; + $fields[] = $this->_t(1) . " * @return mixed An array of field names, boolean false if none is set."; + $fields[] = $this->_t(1) . " *"; + $fields[] = $this->_t(1) . " * @since 3.0"; + $fields[] = $this->_t(1) . " */"; + $fields[] = $this->_t(1) . "protected function getUniqeFields()"; + $fields[] = $this->_t(1) . "{"; if (isset($this->dbUniqueKeys[$view]) && ComponentbuilderHelper::checkArray($this->dbUniqueKeys[$view])) { - $fields[] = "\t\treturn array('" . implode("','", $this->dbUniqueKeys[$view]) . "');"; + $fields[] = $this->_t(2) . "return array('" . implode("','", $this->dbUniqueKeys[$view]) . "');"; } else { - $fields[] = "\t\treturn false;"; + $fields[] = $this->_t(2) . "return false;"; } - $fields[] = "\t}"; + $fields[] = $this->_t(1) . "}"; // return the unique fields return implode(PHP_EOL, $fields); } @@ -10137,28 +10169,28 @@ class Interpretation extends Fields $CodeName = ComponentbuilderHelper::safeString($filter['code'] . ' ' . $filter['custom']['text'], 'W'); $codeName = $filter['code'] . ComponentbuilderHelper::safeString($filter['custom']['text'], 'F'); $type = ComponentbuilderHelper::safeString($filter['custom']['type'], 'F'); - $otherFilter[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set " . $CodeName . " Selection"; - $otherFilter[] = "\t\t\$this->" . $codeName . "Options = JFormHelper::loadFieldType('" . $type . "')->getOptions();"; - $otherFilter[] = "\t\tif (\$this->" . $codeName . "Options)"; - $otherFilter[] = "\t\t{"; - $otherFilter[] = "\t\t\t//" . $this->setLine(__LINE__) . " " . $CodeName . " Filter"; - $otherFilter[] = "\t\t\tJHtmlSidebar::addFilter("; - $otherFilter[] = "\t\t\t\t'- Select '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = "\t\t\t\t'filter_" . $filter['code'] . "',"; - $otherFilter[] = "\t\t\t\tJHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))"; - $otherFilter[] = "\t\t\t);"; + $otherFilter[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set " . $CodeName . " Selection"; + $otherFilter[] = $this->_t(2) . "\$this->" . $codeName . "Options = JFormHelper::loadFieldType('" . $type . "')->getOptions();"; + $otherFilter[] = $this->_t(2) . "if (\$this->" . $codeName . "Options)"; + $otherFilter[] = $this->_t(2) . "{"; + $otherFilter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " " . $CodeName . " Filter"; + $otherFilter[] = $this->_t(3) . "JHtmlSidebar::addFilter("; + $otherFilter[] = $this->_t(4) . "'- Select '.JText:" . ":_('" . $filter['lang'] . "').' -',"; + $otherFilter[] = $this->_t(4) . "'filter_" . $filter['code'] . "',"; + $otherFilter[] = $this->_t(4) . "JHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))"; + $otherFilter[] = $this->_t(3) . ");"; - $otherFilter[] = PHP_EOL . "\t\t\tif (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; - $otherFilter[] = "\t\t\t{"; - $otherFilter[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " " . $CodeName . " Batch Selection"; - $otherFilter[] = "\t\t\t\tJHtmlBatch_::addListSelection("; - $otherFilter[] = "\t\t\t\t\t'- Keep Original '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = "\t\t\t\t\t'batch[" . $filter['code'] . "]',"; - $otherFilter[] = "\t\t\t\t\tJHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text')"; - $otherFilter[] = "\t\t\t\t);"; - $otherFilter[] = "\t\t\t}"; + $otherFilter[] = PHP_EOL . $this->_t(3) . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; + $otherFilter[] = $this->_t(3) . "{"; + $otherFilter[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " " . $CodeName . " Batch Selection"; + $otherFilter[] = $this->_t(4) . "JHtmlBatch_::addListSelection("; + $otherFilter[] = $this->_t(5) . "'- Keep Original '.JText:" . ":_('" . $filter['lang'] . "').' -',"; + $otherFilter[] = $this->_t(5) . "'batch[" . $filter['code'] . "]',"; + $otherFilter[] = $this->_t(5) . "JHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text')"; + $otherFilter[] = $this->_t(4) . ");"; + $otherFilter[] = $this->_t(3) . "}"; - $otherFilter[] = "\t\t}"; + $otherFilter[] = $this->_t(2) . "}"; } elseif ($filter['type'] != 'category') { @@ -10171,28 +10203,28 @@ class Interpretation extends Fields { $functionName = "\$this->getThe" . $filter['function'] . "Selections();"; } - $otherFilter[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set " . $Codename . " Selection"; - $otherFilter[] = "\t\t\$this->" . $filter['code'] . "Options = " . $functionName; - $otherFilter[] = "\t\tif (\$this->" . $filter['code'] . "Options)"; - $otherFilter[] = "\t\t{"; - $otherFilter[] = "\t\t\t//" . $this->setLine(__LINE__) . " " . $Codename . " Filter"; - $otherFilter[] = "\t\t\tJHtmlSidebar::addFilter("; - $otherFilter[] = "\t\t\t\t'- Select '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = "\t\t\t\t'filter_" . $filter['code'] . "',"; - $otherFilter[] = "\t\t\t\tJHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))"; - $otherFilter[] = "\t\t\t);"; + $otherFilter[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set " . $Codename . " Selection"; + $otherFilter[] = $this->_t(2) . "\$this->" . $filter['code'] . "Options = " . $functionName; + $otherFilter[] = $this->_t(2) . "if (\$this->" . $filter['code'] . "Options)"; + $otherFilter[] = $this->_t(2) . "{"; + $otherFilter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " " . $Codename . " Filter"; + $otherFilter[] = $this->_t(3) . "JHtmlSidebar::addFilter("; + $otherFilter[] = $this->_t(4) . "'- Select '.JText:" . ":_('" . $filter['lang'] . "').' -',"; + $otherFilter[] = $this->_t(4) . "'filter_" . $filter['code'] . "',"; + $otherFilter[] = $this->_t(4) . "JHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))"; + $otherFilter[] = $this->_t(3) . ");"; - $otherFilter[] = PHP_EOL . "\t\t\tif (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; - $otherFilter[] = "\t\t\t{"; - $otherFilter[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " " . $Codename . " Batch Selection"; - $otherFilter[] = "\t\t\t\tJHtmlBatch_::addListSelection("; - $otherFilter[] = "\t\t\t\t\t'- Keep Original '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = "\t\t\t\t\t'batch[" . $filter['code'] . "]',"; - $otherFilter[] = "\t\t\t\t\tJHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text')"; - $otherFilter[] = "\t\t\t\t);"; - $otherFilter[] = "\t\t\t}"; + $otherFilter[] = PHP_EOL . $this->_t(3) . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; + $otherFilter[] = $this->_t(3) . "{"; + $otherFilter[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " " . $Codename . " Batch Selection"; + $otherFilter[] = $this->_t(4) . "JHtmlBatch_::addListSelection("; + $otherFilter[] = $this->_t(5) . "'- Keep Original '.JText:" . ":_('" . $filter['lang'] . "').' -',"; + $otherFilter[] = $this->_t(5) . "'batch[" . $filter['code'] . "]',"; + $otherFilter[] = $this->_t(5) . "JHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text')"; + $otherFilter[] = $this->_t(4) . ");"; + $otherFilter[] = $this->_t(3) . "}"; - $otherFilter[] = "\t\t}"; + $otherFilter[] = $this->_t(2) . "}"; } } if (ComponentbuilderHelper::checkArray($otherFilter)) @@ -10222,23 +10254,23 @@ class Interpretation extends Fields $COMONENT = ComponentbuilderHelper::safeString($this->componentData->name_code, 'U'); // set filter $filter = array(); - $filter[] = PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Category Filter."; - $filter[] = "\t\tJHtmlSidebar::addFilter("; - $filter[] = "\t\t\tJText:" . ":_('JOPTION_SELECT_CATEGORY'),"; - $filter[] = "\t\t\t'filter_category_id',"; - $filter[] = "\t\t\tJHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . "." . $otherViews . "'), 'value', 'text', \$this->state->get('filter.category_id'))"; - $filter[] = "\t\t);"; + $filter[] = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Category Filter."; + $filter[] = $this->_t(2) . "JHtmlSidebar::addFilter("; + $filter[] = $this->_t(3) . "JText:" . ":_('JOPTION_SELECT_CATEGORY'),"; + $filter[] = $this->_t(3) . "'filter_category_id',"; + $filter[] = $this->_t(3) . "JHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . "." . $otherViews . "'), 'value', 'text', \$this->state->get('filter.category_id'))"; + $filter[] = $this->_t(2) . ");"; - $filter[] = PHP_EOL . "\t\tif (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; - $filter[] = "\t\t{"; - $filter[] = "\t\t\t//" . $this->setLine(__LINE__) . " Category Batch selection."; - $filter[] = "\t\t\tJHtmlBatch_::addListSelection("; - $filter[] = "\t\t\t\tJText:" . ":_('COM_" . $COMONENT . "_KEEP_ORIGINAL_CATEGORY'),"; - $filter[] = "\t\t\t\t'batch[category]',"; - $filter[] = "\t\t\t\tJHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . "." . $otherViews . "'), 'value', 'text')"; - $filter[] = "\t\t\t);"; - $filter[] = "\t\t}"; + $filter[] = PHP_EOL . $this->_t(2) . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; + $filter[] = $this->_t(2) . "{"; + $filter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Category Batch selection."; + $filter[] = $this->_t(3) . "JHtmlBatch_::addListSelection("; + $filter[] = $this->_t(4) . "JText:" . ":_('COM_" . $COMONENT . "_KEEP_ORIGINAL_CATEGORY'),"; + $filter[] = $this->_t(4) . "'batch[category]',"; + $filter[] = $this->_t(4) . "JHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . "." . $otherViews . "'), 'value', 'text')"; + $filter[] = $this->_t(3) . ");"; + $filter[] = $this->_t(2) . "}"; // return the filter return implode(PHP_EOL, $filter); @@ -10264,38 +10296,38 @@ 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[] = "\tif (is_file(\$path))"; - $includeHelper[] = "\t{"; - $includeHelper[] = "\t\tinclude_once \$path;"; - $includeHelper[] = "\t}"; + $includeHelper[] = $this->_t(1) . "\$path = JPATH_SITE . '/components/com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "/helpers/category" . $viewName_list . ".php';"; + $includeHelper[] = $this->_t(1) . "if (is_file(\$path))"; + $includeHelper[] = $this->_t(1) . "{"; + $includeHelper[] = $this->_t(2) . "include_once \$path;"; + $includeHelper[] = $this->_t(1) . "}"; $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 . '"'; + return "," . PHP_EOL . $this->_t(3) . '"com_' . $component . '.' . $otherViews . '" => "' . $otherView . '"'; } else { - return PHP_EOL . "\t\t\t" . '"com_' . $component . '.' . $otherViews . '" => "' . $otherView . '"'; + return PHP_EOL . $this->_t(3) . '"com_' . $component . '.' . $otherViews . '" => "' . $otherView . '"'; } } return ''; @@ -10328,70 +10360,70 @@ class Interpretation extends Fields $otherView = $viewName_single; } // setup the category script - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " get the user object"; - $allow[] = "\t\t\$user = JFactory::getUser();"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " get the user object"; + $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.access']])) { - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access check."; - $allow[] = "\t\t\$access = \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "');"; - $allow[] = "\t\tif (!\$access)"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\treturn false;"; - $allow[] = "\t\t}"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access check."; + $allow[] = $this->_t(2) . "\$access = \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "');"; + $allow[] = $this->_t(2) . "if (!\$access)"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "return false;"; + $allow[] = $this->_t(2) . "}"; } - $allow[] = "\t\t\$categoryId = JArrayHelper::getValue(\$data, 'catid', \$this->input->getInt('filter_category_id'), 'int');"; - $allow[] = "\t\t\$allow = null;"; - $allow[] = PHP_EOL . "\t\tif (\$categoryId)"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " If the category has been passed in the URL check it."; - $allow[] = "\t\t\t\$allow = \$user->authorise('core.create', \$this->option . '." . $otherViews . ".category.' . \$categoryId);"; - $allow[] = "\t\t}"; - $allow[] = PHP_EOL . "\t\tif (\$allow === null)"; - $allow[] = "\t\t{"; + $allow[] = $this->_t(2) . "\$categoryId = JArrayHelper::getValue(\$data, 'catid', \$this->input->getInt('filter_category_id'), 'int');"; + $allow[] = $this->_t(2) . "\$allow = null;"; + $allow[] = PHP_EOL . $this->_t(2) . "if (\$categoryId)"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " If the category has been passed in the URL check it."; + $allow[] = $this->_t(3) . "\$allow = \$user->authorise('core.create', \$this->option . '." . $otherViews . ".category.' . \$categoryId);"; + $allow[] = $this->_t(2) . "}"; + $allow[] = PHP_EOL . $this->_t(2) . "if (\$allow === null)"; + $allow[] = $this->_t(2) . "{"; // check if the item has permissions. if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) { // setup the default script - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = "\t\t\treturn \$user->authorise('" . $core['core.create'] . "', \$this->option);"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(3) . "return \$user->authorise('" . $core['core.create'] . "', \$this->option);"; } else { // setup the default script - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = "\t\t\treturn parent::allowAdd(\$data);"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(3) . "return parent::allowAdd(\$data);"; } - $allow[] = "\t\t}"; - $allow[] = "\t\telse"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\treturn \$allow;"; - $allow[] = "\t\t}"; + $allow[] = $this->_t(2) . "}"; + $allow[] = $this->_t(2) . "else"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "return \$allow;"; + $allow[] = $this->_t(2) . "}"; } else { // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.access']])) { - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access check."; - $allow[] = "\t\t\$access = JFactory::getUser()->authorise('" . $core['core.access'] . "', 'com_" . $component . "');"; - $allow[] = "\t\tif (!\$access)"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\treturn false;"; - $allow[] = "\t\t}"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access check."; + $allow[] = $this->_t(2) . "\$access = JFactory::getUser()->authorise('" . $core['core.access'] . "', 'com_" . $component . "');"; + $allow[] = $this->_t(2) . "if (!\$access)"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "return false;"; + $allow[] = $this->_t(2) . "}"; } // check if the item has permissions. if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) { // setup the default script - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = "\t\treturn JFactory::getUser()->authorise('" . $core['core.create'] . "', \$this->option);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) . "return JFactory::getUser()->authorise('" . $core['core.create'] . "', \$this->option);"; } else { // setup the default script - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = "\t\treturn parent::allowAdd(\$data);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) . "return parent::allowAdd(\$data);"; } } return implode(PHP_EOL, $allow); @@ -10425,183 +10457,183 @@ class Interpretation extends Fields $otherView = $viewName_single; } // setup the category script - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " get user object."; - $allow[] = "\t\t\$user\t\t= JFactory::getUser();"; - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " get record id."; - $allow[] = "\t\t\$recordId\t= (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get user object."; + $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get record id."; + $allow[] = $this->_t(2) . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; // load custom permission script $allow[] = $customAllow; // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.access']])) { - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access check."; - $allow[] = "\t\t\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; - $allow[] = "\t\tif (!\$access)"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\treturn false;"; - $allow[] = "\t\t}"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access check."; + $allow[] = $this->_t(2) . "\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; + $allow[] = $this->_t(2) . "if (!\$access)"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "return false;"; + $allow[] = $this->_t(2) . "}"; } - $allow[] = PHP_EOL . "\t\tif (\$recordId)"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($otherView, $this->permissionBuilder[$core['core.edit']])) { - $allow[] = "\t\t\t\$permission = \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId);"; } else { - $allow[] = "\t\t\t\$permission = \$user->authorise('core.edit', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('core.edit', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId);"; } - $allow[] = "\t\t\tif (!\$permission)"; - $allow[] = "\t\t\t{"; + $allow[] = $this->_t(3) . "if (!\$permission)"; + $allow[] = $this->_t(3) . "{"; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.own']]) && in_array($otherView, $this->permissionBuilder[$core['core.edit.own']])) { - $allow[] = "\t\t\t\tif (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "." . $otherView . ".' . \$recordId))"; + $allow[] = $this->_t(4) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "." . $otherView . ".' . \$recordId))"; } else { - $allow[] = "\t\t\t\tif (\$user->authorise('core.edit.own', 'com_" . $component . "." . $otherView . ".' . \$recordId))"; + $allow[] = $this->_t(4) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "." . $otherView . ".' . \$recordId))"; } - $allow[] = "\t\t\t\t{"; - $allow[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Fallback on edit.own. Now test the owner is the user."; - $allow[] = "\t\t\t\t\t\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; - $allow[] = "\t\t\t\t\tif (empty(\$ownerId))"; - $allow[] = "\t\t\t\t\t{"; - $allow[] = "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " Need to do a lookup from the model."; - $allow[] = "\t\t\t\t\t\t\$record = \$this->getModel()->getItem(\$recordId);"; - $allow[] = PHP_EOL . "\t\t\t\t\t\tif (empty(\$record))"; - $allow[] = "\t\t\t\t\t\t{"; - $allow[] = "\t\t\t\t\t\t\treturn false;"; - $allow[] = "\t\t\t\t\t\t}"; - $allow[] = "\t\t\t\t\t\t\$ownerId = \$record->created_by;"; - $allow[] = "\t\t\t\t\t}"; - $allow[] = PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " If the owner matches 'me' then do the test."; - $allow[] = "\t\t\t\t\tif (\$ownerId == \$user->id)"; - $allow[] = "\t\t\t\t\t{"; + $allow[] = $this->_t(4) . "{"; + $allow[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " Fallback on edit.own. Now test the owner is the user."; + $allow[] = $this->_t(5) . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = $this->_t(5) . "if (empty(\$ownerId))"; + $allow[] = $this->_t(5) . "{"; + $allow[] = $this->_t(6) . "//" . $this->setLine(__LINE__) . " Need to do a lookup from the model."; + $allow[] = $this->_t(6) . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . $this->_t(6) . "if (empty(\$record))"; + $allow[] = $this->_t(6) . "{"; + $allow[] = $this->_t(7) . "return false;"; + $allow[] = $this->_t(6) . "}"; + $allow[] = $this->_t(6) . "\$ownerId = \$record->created_by;"; + $allow[] = $this->_t(5) . "}"; + $allow[] = PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " If the owner matches 'me' then do the test."; + $allow[] = $this->_t(5) . "if (\$ownerId == \$user->id)"; + $allow[] = $this->_t(5) . "{"; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.own']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.edit.own']])) { - $allow[] = "\t\t\t\t\t\tif (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "'))"; + $allow[] = $this->_t(6) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "'))"; } else { - $allow[] = "\t\t\t\t\t\tif (\$user->authorise('core.edit.own', 'com_" . $component . "'))"; + $allow[] = $this->_t(6) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "'))"; } - $allow[] = "\t\t\t\t\t\t{"; - $allow[] = "\t\t\t\t\t\t\treturn true;"; - $allow[] = "\t\t\t\t\t\t}"; - $allow[] = "\t\t\t\t\t}"; - $allow[] = "\t\t\t\t}"; - $allow[] = "\t\t\t\treturn false;"; - $allow[] = "\t\t\t}"; -// $allow[] = PHP_EOL."\t\t\t\$categoryId = (int) isset(\$data['catid']) ? \$data['catid']: \$this->getModel()->getItem(\$recordId)->catid;"; <-- remove category from check -// $allow[] = PHP_EOL."\t\t\tif (\$categoryId)"; -// $allow[] = "\t\t\t{"; -// $allow[] = "\t\t\t\t//".$this->setLine(__LINE__)." The category has been set. Check the category permissions."; -// $allow[] = "\t\t\t\t\$catpermission = \$user->authorise('core.edit', \$this->option . '.".$otherView.".category.' . \$categoryId);"; -// $allow[] = "\t\t\t\tif (!\$catpermission && !is_null(\$catpermission))"; -// $allow[] = "\t\t\t\t{"; -// $allow[] = "\t\t\t\t\treturn false;"; -// $allow[] = "\t\t\t\t}"; -// $allow[] = "\t\t\t}"; - $allow[] = "\t\t}"; + $allow[] = $this->_t(6) . "{"; + $allow[] = $this->_t(7) . "return true;"; + $allow[] = $this->_t(6) . "}"; + $allow[] = $this->_t(5) . "}"; + $allow[] = $this->_t(4) . "}"; + $allow[] = $this->_t(4) . "return false;"; + $allow[] = $this->_t(3) . "}"; +// $allow[] = PHP_EOL.$this->_t(3) . "\$categoryId = (int) isset(\$data['catid']) ? \$data['catid']: \$this->getModel()->getItem(\$recordId)->catid;"; <-- remove category from check +// $allow[] = PHP_EOL.$this->_t(3) . "if (\$categoryId)"; +// $allow[] = $this->_t(3) . "{"; +// $allow[] = $this->_t(4) . "//".$this->setLine(__LINE__)." The category has been set. Check the category permissions."; +// $allow[] = $this->_t(4) . "\$catpermission = \$user->authorise('core.edit', \$this->option . '.".$otherView.".category.' . \$categoryId);"; +// $allow[] = $this->_t(4) . "if (!\$catpermission && !is_null(\$catpermission))"; +// $allow[] = $this->_t(4) . "{"; +// $allow[] = $this->_t(5) . "return false;"; +// $allow[] = $this->_t(4) . "}"; +// $allow[] = $this->_t(3) . "}"; + $allow[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.edit']])) { - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; - $allow[] = "\t\treturn \$user->authorise('" . $core['core.edit'] . "', \$this->option);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; + $allow[] = $this->_t(2) . "return \$user->authorise('" . $core['core.edit'] . "', \$this->option);"; } else { - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; - $allow[] = "\t\treturn parent::allowEdit(\$data, \$key);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; + $allow[] = $this->_t(2) . "return parent::allowEdit(\$data, \$key);"; } } else { // setup the category script - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " get user object."; - $allow[] = "\t\t\$user\t\t= JFactory::getUser();"; - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " get record id."; - $allow[] = "\t\t\$recordId\t= (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " get user object."; + $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get record id."; + $allow[] = $this->_t(2) . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; // load custom permission script $allow[] = $customAllow; // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder[$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.access']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.access']])) { - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access check."; - $allow[] = "\t\t\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; - $allow[] = "\t\tif (!\$access)"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\treturn false;"; - $allow[] = "\t\t}"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access check."; + $allow[] = $this->_t(2) . "\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; + $allow[] = $this->_t(2) . "if (!\$access)"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "return false;"; + $allow[] = $this->_t(2) . "}"; } - $allow[] = PHP_EOL . "\t\tif (\$recordId)"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']])) { - $allow[] = "\t\t\t\$permission = \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; } else { - $allow[] = "\t\t\t\$permission = \$user->authorise('core.edit', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('core.edit', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; } - $allow[] = "\t\t\tif (!\$permission)"; - $allow[] = "\t\t\t{"; + $allow[] = $this->_t(3) . "if (!\$permission)"; + $allow[] = $this->_t(3) . "{"; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.own']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.own']])) { - $allow[] = "\t\t\t\tif (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "." . $viewName_single . ".' . \$recordId))"; + $allow[] = $this->_t(4) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "." . $viewName_single . ".' . \$recordId))"; } else { - $allow[] = "\t\t\t\tif (\$user->authorise('core.edit.own', 'com_" . $component . "." . $viewName_single . ".' . \$recordId))"; + $allow[] = $this->_t(4) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "." . $viewName_single . ".' . \$recordId))"; } - $allow[] = "\t\t\t\t{"; - $allow[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Now test the owner is the user."; - $allow[] = "\t\t\t\t\t\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; - $allow[] = "\t\t\t\t\tif (empty(\$ownerId))"; - $allow[] = "\t\t\t\t\t{"; - $allow[] = "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " Need to do a lookup from the model."; - $allow[] = "\t\t\t\t\t\t\$record = \$this->getModel()->getItem(\$recordId);"; - $allow[] = PHP_EOL . "\t\t\t\t\t\tif (empty(\$record))"; - $allow[] = "\t\t\t\t\t\t{"; - $allow[] = "\t\t\t\t\t\t\treturn false;"; - $allow[] = "\t\t\t\t\t\t}"; - $allow[] = "\t\t\t\t\t\t\$ownerId = \$record->created_by;"; - $allow[] = "\t\t\t\t\t}"; - $allow[] = PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " If the owner matches 'me' then allow."; - $allow[] = "\t\t\t\t\tif (\$ownerId == \$user->id)"; - $allow[] = "\t\t\t\t\t{"; + $allow[] = $this->_t(4) . "{"; + $allow[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " Now test the owner is the user."; + $allow[] = $this->_t(5) . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = $this->_t(5) . "if (empty(\$ownerId))"; + $allow[] = $this->_t(5) . "{"; + $allow[] = $this->_t(6) . "//" . $this->setLine(__LINE__) . " Need to do a lookup from the model."; + $allow[] = $this->_t(6) . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = PHP_EOL . $this->_t(6) . "if (empty(\$record))"; + $allow[] = $this->_t(6) . "{"; + $allow[] = $this->_t(7) . "return false;"; + $allow[] = $this->_t(6) . "}"; + $allow[] = $this->_t(6) . "\$ownerId = \$record->created_by;"; + $allow[] = $this->_t(5) . "}"; + $allow[] = PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " If the owner matches 'me' then allow."; + $allow[] = $this->_t(5) . "if (\$ownerId == \$user->id)"; + $allow[] = $this->_t(5) . "{"; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.own']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.own']])) { - $allow[] = "\t\t\t\t\t\tif (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "'))"; + $allow[] = $this->_t(6) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "'))"; } else { - $allow[] = "\t\t\t\t\t\tif (\$user->authorise('core.edit.own', 'com_" . $component . "'))"; + $allow[] = $this->_t(6) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "'))"; } - $allow[] = "\t\t\t\t\t\t{"; - $allow[] = "\t\t\t\t\t\t\treturn true;"; - $allow[] = "\t\t\t\t\t\t}"; - $allow[] = "\t\t\t\t\t}"; - $allow[] = "\t\t\t\t}"; - $allow[] = "\t\t\t\treturn false;"; - $allow[] = "\t\t\t}"; - $allow[] = "\t\t}"; + $allow[] = $this->_t(6) . "{"; + $allow[] = $this->_t(7) . "return true;"; + $allow[] = $this->_t(6) . "}"; + $allow[] = $this->_t(5) . "}"; + $allow[] = $this->_t(4) . "}"; + $allow[] = $this->_t(4) . "return false;"; + $allow[] = $this->_t(3) . "}"; + $allow[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) { - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; - $allow[] = "\t\treturn \$user->authorise('" . $core['core.edit'] . "', \$this->option);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; + $allow[] = $this->_t(2) . "return \$user->authorise('" . $core['core.edit'] . "', \$this->option);"; } else { - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; - $allow[] = "\t\treturn parent::allowEdit(\$data, \$key);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; + $allow[] = $this->_t(2) . "return parent::allowEdit(\$data, \$key);"; } } @@ -10614,16 +10646,16 @@ class Interpretation extends Fields $component = ComponentbuilderHelper::safeString($this->componentData->name_code); // allways load these $allow = array(); - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the form."; - $allow[] = "\t\t\$form = \$this->loadForm('com_" . $component . "." . $viewName_single . "', '" . $viewName_single . "', array('control' => 'jform', 'load_data' => \$loadData));"; - $allow[] = PHP_EOL . "\t\tif (empty(\$form))"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\treturn false;"; - $allow[] = "\t\t}"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the form."; + $allow[] = $this->_t(2) . "\$form = \$this->loadForm('com_" . $component . "." . $viewName_single . "', '" . $viewName_single . "', array('control' => 'jform', 'load_data' => \$loadData));"; + $allow[] = PHP_EOL . $this->_t(2) . "if (empty(\$form))"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "return false;"; + $allow[] = $this->_t(2) . "}"; // 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; @@ -10646,185 +10678,185 @@ class Interpretation extends Fields $otherView = $viewName_single; } // setup the category script - $allow[] = PHP_EOL . "\t\t\$jinput = JFactory::getApplication()->input;"; - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first."; - $allow[] = "\t\tif (\$jinput->get('a_id'))"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t\$id = \$jinput->get('a_id', 0, 'INT');"; - $allow[] = "\t\t}"; - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default."; - $allow[] = "\t\telse"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t\$id = \$jinput->get('id', 0, 'INT');"; - $allow[] = "\t\t}"; - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Determine correct permissions to check."; - $allow[] = "\t\tif (\$this->getState('" . $viewName_single . ".id'))"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t\$id = \$this->getState('" . $viewName_single . ".id');"; - $allow[] = PHP_EOL . "\t\t\t\$catid = 0;"; - $allow[] = "\t\t\tif (isset(\$this->getItem(\$id)->catid))"; - $allow[] = "\t\t\t{"; - $allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " set category id"; - $allow[] = "\t\t\t\t\$catid = \$this->getItem(\$id)->catid;"; - $allow[] = PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Existing record. Can only edit in selected categories."; - $allow[] = "\t\t\t\t\$form->setFieldAttribute('catid', 'action', 'core.edit');"; - $allow[] = PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Existing record. Can only edit own items in selected categories."; - $allow[] = "\t\t\t\t\$form->setFieldAttribute('catid', 'action', 'core.edit.own');"; - $allow[] = "\t\t\t}"; - $allow[] = "\t\t}"; - $allow[] = "\t\telse"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " New record. Can only create in selected categories."; - $allow[] = "\t\t\t\$form->setFieldAttribute('catid', 'action', 'core.create');"; - $allow[] = "\t\t}"; - $allow[] = PHP_EOL . "\t\t\$user = JFactory::getUser();"; - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check for existing item."; - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls."; + $allow[] = PHP_EOL . $this->_t(2) . "\$jinput = JFactory::getApplication()->input;"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first."; + $allow[] = $this->_t(2) . "if (\$jinput->get('a_id'))"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "\$id = \$jinput->get('a_id', 0, 'INT');"; + $allow[] = $this->_t(2) . "}"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default."; + $allow[] = $this->_t(2) . "else"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "\$id = \$jinput->get('id', 0, 'INT');"; + $allow[] = $this->_t(2) . "}"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Determine correct permissions to check."; + $allow[] = $this->_t(2) . "if (\$this->getState('" . $viewName_single . ".id'))"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "\$id = \$this->getState('" . $viewName_single . ".id');"; + $allow[] = PHP_EOL . $this->_t(3) . "\$catid = 0;"; + $allow[] = $this->_t(3) . "if (isset(\$this->getItem(\$id)->catid))"; + $allow[] = $this->_t(3) . "{"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " set category id"; + $allow[] = $this->_t(4) . "\$catid = \$this->getItem(\$id)->catid;"; + $allow[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Existing record. Can only edit in selected categories."; + $allow[] = $this->_t(4) . "\$form->setFieldAttribute('catid', 'action', 'core.edit');"; + $allow[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Existing record. Can only edit own items in selected categories."; + $allow[] = $this->_t(4) . "\$form->setFieldAttribute('catid', 'action', 'core.edit.own');"; + $allow[] = $this->_t(3) . "}"; + $allow[] = $this->_t(2) . "}"; + $allow[] = $this->_t(2) . "else"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " New record. Can only create in selected categories."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('catid', 'action', 'core.create');"; + $allow[] = $this->_t(2) . "}"; + $allow[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for existing item."; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']])) { - $allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $allow[] = "\t\t\t|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))"; - $allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))"; + $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; + $allow[] = $this->_t(3) . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))"; + $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))"; } else { - $allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $allow[] = "\t\t\t|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))"; - $allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))"; + $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; + $allow[] = $this->_t(3) . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))"; + $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))"; } - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display."; - $allow[] = "\t\t\t\$form->setFieldAttribute('ordering', 'disabled', 'true');"; - $allow[] = "\t\t\t\$form->setFieldAttribute('published', 'disabled', 'true');"; - $allow[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $allow[] = "\t\t\t\$form->setFieldAttribute('ordering', 'filter', 'unset');"; - $allow[] = "\t\t\t\$form->setFieldAttribute('published', 'filter', 'unset');"; - $allow[] = "\t\t}"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'disabled', 'true');"; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'disabled', 'true');"; + $allow[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'filter', 'unset');"; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'filter', 'unset');"; + $allow[] = $this->_t(2) . "}"; } else { - $allow[] = PHP_EOL . "\t\t\$jinput = JFactory::getApplication()->input;"; - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first."; - $allow[] = "\t\tif (\$jinput->get('a_id'))"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t\$id = \$jinput->get('a_id', 0, 'INT');"; - $allow[] = "\t\t}"; - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default."; - $allow[] = "\t\telse"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t\$id = \$jinput->get('id', 0, 'INT');"; - $allow[] = "\t\t}"; - $allow[] = PHP_EOL . "\t\t\$user = JFactory::getUser();"; - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check for existing item."; - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls."; + $allow[] = PHP_EOL . $this->_t(2) . "\$jinput = JFactory::getApplication()->input;"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first."; + $allow[] = $this->_t(2) . "if (\$jinput->get('a_id'))"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "\$id = \$jinput->get('a_id', 0, 'INT');"; + $allow[] = $this->_t(2) . "}"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default."; + $allow[] = $this->_t(2) . "else"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "\$id = \$jinput->get('id', 0, 'INT');"; + $allow[] = $this->_t(2) . "}"; + $allow[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for existing item."; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']])) { - $allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))"; + $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; + $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))"; } else { - $allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))"; + $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; + $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))"; } - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display."; - $allow[] = "\t\t\t\$form->setFieldAttribute('ordering', 'disabled', 'true');"; - $allow[] = "\t\t\t\$form->setFieldAttribute('published', 'disabled', 'true');"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $allow[] = "\t\t\t\$form->setFieldAttribute('ordering', 'filter', 'unset');"; - $allow[] = "\t\t\t\$form->setFieldAttribute('published', 'filter', 'unset');"; - $allow[] = "\t\t}"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'disabled', 'true');"; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'disabled', 'true');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'filter', 'unset');"; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'filter', 'unset');"; + $allow[] = $this->_t(2) . "}"; } - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " If this is a new item insure the greated by is set."; - $allow[] = "\t\tif (0 == \$id)"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set the created_by to this user"; - $allow[] = "\t\t\t\$form->setValue('created_by', null, \$user->id);"; - $allow[] = "\t\t}"; - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded By access controls."; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " If this is a new item insure the greated by is set."; + $allow[] = $this->_t(2) . "if (0 == \$id)"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set the created_by to this user"; + $allow[] = $this->_t(3) . "\$form->setValue('created_by', null, \$user->id);"; + $allow[] = $this->_t(2) . "}"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded By access controls."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.created_by']) && isset($this->permissionBuilder[$core['core.edit.created_by']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.created_by']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.created_by']])) { - $allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "')))"; + $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; + $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "')))"; } else { - $allow[] = "\t\tif (!\$user->authorise('core.edit.created_by', 'com_" . $component . "'))"; + $allow[] = $this->_t(2) . "if (!\$user->authorise('core.edit.created_by', 'com_" . $component . "'))"; } - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display."; - $allow[] = "\t\t\t\$form->setFieldAttribute('created_by', 'disabled', 'true');"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display."; - $allow[] = "\t\t\t\$form->setFieldAttribute('created_by', 'readonly', 'true');"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $allow[] = "\t\t\t\$form->setFieldAttribute('created_by', 'filter', 'unset');"; - $allow[] = "\t\t}"; - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded Date access controls."; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'disabled', 'true');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'readonly', 'true');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'filter', 'unset');"; + $allow[] = $this->_t(2) . "}"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded Date access controls."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.created']) && isset($this->permissionBuilder[$core['core.edit.created']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.created']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.created']])) { - $allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "')))"; + $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; + $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "')))"; } else { - $allow[] = "\t\tif (!\$user->authorise('core.edit.created', 'com_" . $component . "'))"; + $allow[] = $this->_t(2) . "if (!\$user->authorise('core.edit.created', 'com_" . $component . "'))"; } - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display."; - $allow[] = "\t\t\t\$form->setFieldAttribute('created', 'disabled', 'true');"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $allow[] = "\t\t\t\$form->setFieldAttribute('created', 'filter', 'unset');"; - $allow[] = "\t\t}"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('created', 'disabled', 'true');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('created', 'filter', 'unset');"; + $allow[] = $this->_t(2) . "}"; // handel the fields permissions if (isset($this->permissionFields[$viewName_single]) && ComponentbuilderHelper::checkArray($this->permissionFields[$viewName_single])) { foreach ($this->permissionFields[$viewName_single] as $fieldName => $fieldType) { - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Modify the form based on Edit " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls."; - $allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "')))"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display."; - $allow[] = "\t\t\t\$form->setFieldAttribute('" . $fieldName . "', 'disabled', 'true');"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display."; - $allow[] = "\t\t\t\$form->setFieldAttribute('" . $fieldName . "', 'readonly', 'true');"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls."; + $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; + $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "')))"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'disabled', 'true');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'readonly', 'true');"; if ('radio' === $fieldType || 'repeatable' === $fieldType) { - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable radio button for display."; - $allow[] = "\t\t\t\$class = \$form->getFieldAttribute('" . $fieldName . "', 'class', '');"; - $allow[] = "\t\t\t\$form->setFieldAttribute('" . $fieldName . "', 'class', \$class.' disabled no-click');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable radio button for display."; + $allow[] = $this->_t(3) . "\$class = \$form->getFieldAttribute('" . $fieldName . "', 'class', '');"; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'class', \$class.' disabled no-click');"; } - $allow[] = "\t\t\tif (!\$form->getValue('" . $fieldName . "'))"; - $allow[] = "\t\t\t{"; - $allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $allow[] = "\t\t\t\t\$form->setFieldAttribute('" . $fieldName . "', 'filter', 'unset');"; - $allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $allow[] = "\t\t\t\t\$form->setFieldAttribute('" . $fieldName . "', 'required', 'false');"; - $allow[] = "\t\t\t}"; - $allow[] = "\t\t}"; + $allow[] = $this->_t(3) . "if (!\$form->getValue('" . $fieldName . "'))"; + $allow[] = $this->_t(3) . "{"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; + $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'filter', 'unset');"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; + $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'required', 'false');"; + $allow[] = $this->_t(3) . "}"; + $allow[] = $this->_t(2) . "}"; } } - // add the redirect trick to set the field of origin - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Only load these values if no id is found"; - $allow[] = "\t\tif (0 == \$id)"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set redirected field name"; - $allow[] = "\t\t\t\$redirectedField = \$jinput->get('ref', null, 'STRING');"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set redirected field value"; - $allow[] = "\t\t\t\$redirectedValue = \$jinput->get('refid', 0, 'INT');"; - $allow[] = "\t\t\tif (0 != \$redirectedValue && \$redirectedField)"; - $allow[] = "\t\t\t{"; - $allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Now set the local-redirected field default value"; - $allow[] = "\t\t\t\t\$form->setValue(\$redirectedField, null, \$redirectedValue);"; - $allow[] = "\t\t\t}"; - $allow[] = "\t\t}"; + // add the redirect trick to set the field of origin + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Only load these values if no id is found"; + $allow[] = $this->_t(2) . "if (0 == \$id)"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected field name"; + $allow[] = $this->_t(3) . "\$redirectedField = \$jinput->get('ref', null, 'STRING');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected field value"; + $allow[] = $this->_t(3) . "\$redirectedValue = \$jinput->get('refid', 0, 'INT');"; + $allow[] = $this->_t(3) . "if (0 != \$redirectedValue && \$redirectedField)"; + $allow[] = $this->_t(3) . "{"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now set the local-redirected field default value"; + $allow[] = $this->_t(4) . "\$form->setValue(\$redirectedField, null, \$redirectedValue);"; + $allow[] = $this->_t(3) . "}"; + $allow[] = $this->_t(2) . "}"; // setup the default script - $allow[] = PHP_EOL . "\t\treturn \$form;"; + $allow[] = PHP_EOL . $this->_t(2) . "return \$form;"; return implode(PHP_EOL, $allow); } @@ -10835,7 +10867,7 @@ class Interpretation extends Fields // set component name $component = ComponentbuilderHelper::safeString($this->componentData->name_code); // prepare custom permission script - $customAllow = $this->getCustomScriptBuilder('php_allowedit', $viewName_single, "\t\t\$recordId\t= (int) isset(\$data[\$key]) ? \$data[\$key] : 0;" . PHP_EOL); + $customAllow = $this->getCustomScriptBuilder('php_allowedit', $viewName_single, $this->_t(2) . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;" . PHP_EOL); // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) @@ -10846,22 +10878,22 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']])) { - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check specific edit permission then general edit permission."; - $allow[] = "\t\t\$user = JFactory::getUser();"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check specific edit permission then general edit permission."; + $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; // load custom permission script $allow[] = $customAllow; - $allow[] = "\t\treturn \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $viewName_single . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "');"; + $allow[] = $this->_t(2) . "return \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $viewName_single . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "');"; } else { - $allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check specific edit permission then general edit permission."; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check specific edit permission then general edit permission."; if (ComponentbuilderHelper::checkString($customAllow)) { - $allow[] = "\t\t\$user = JFactory::getUser();"; + $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; } // load custom permission script $allow[] = $customAllow; - $allow[] = "\t\treturn JFactory::getUser()->authorise('core.edit', 'com_" . $component . "." . $viewName_single . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or parent::allowEdit(\$data, \$key);"; + $allow[] = $this->_t(2) . "return JFactory::getUser()->authorise('core.edit', 'com_" . $component . "." . $viewName_single . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or parent::allowEdit(\$data, \$key);"; } return implode(PHP_EOL, $allow); @@ -10893,59 +10925,59 @@ class Interpretation extends Fields $otherView = $viewName_single; } // setup the category script - $allow[] = PHP_EOL . "\t\tif (!empty(\$record->id))"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\tif (\$record->published != -2)"; - $allow[] = "\t\t\t{"; - $allow[] = "\t\t\t\treturn;"; - $allow[] = "\t\t\t}"; - $allow[] = PHP_EOL . "\t\t\t\$user = JFactory::getUser();"; - $allow[] = "\t\t\t\$allow = \$user->authorise('core.delete', 'com_" . $component . "." . $otherViews . ".category.' . (int) \$record->catid);"; + $allow[] = PHP_EOL . $this->_t(2) . "if (!empty(\$record->id))"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "if (\$record->published != -2)"; + $allow[] = $this->_t(3) . "{"; + $allow[] = $this->_t(4) . "return;"; + $allow[] = $this->_t(3) . "}"; + $allow[] = PHP_EOL . $this->_t(3) . "\$user = JFactory::getUser();"; + $allow[] = $this->_t(3) . "\$allow = \$user->authorise('core.delete', 'com_" . $component . "." . $otherViews . ".category.' . (int) \$record->catid);"; // check if the item has permissions. if ($coreLoad && isset($this->permissionBuilder[$core['core.delete']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.delete']]) && in_array($otherView, $this->permissionBuilder[$core['core.delete']])) { - $allow[] = PHP_EOL . "\t\t\tif (\$allow)"; - $allow[] = "\t\t\t{"; - $allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; - $allow[] = "\t\t\t\treturn \$user->authorise('" . $core['core.delete'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$record->id);"; - $allow[] = "\t\t\t}"; + $allow[] = PHP_EOL . $this->_t(3) . "if (\$allow)"; + $allow[] = $this->_t(3) . "{"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(4) . "return \$user->authorise('" . $core['core.delete'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$record->id);"; + $allow[] = $this->_t(3) . "}"; } else { - $allow[] = PHP_EOL . "\t\t\tif (\$allow)"; - $allow[] = "\t\t\t{"; - $allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; - $allow[] = "\t\t\t\treturn \$user->authorise('core.delete', 'com_" . $component . "." . $otherView . ".' . (int) \$record->id);"; - $allow[] = "\t\t\t}"; + $allow[] = PHP_EOL . $this->_t(3) . "if (\$allow)"; + $allow[] = $this->_t(3) . "{"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(4) . "return \$user->authorise('core.delete', 'com_" . $component . "." . $otherView . ".' . (int) \$record->id);"; + $allow[] = $this->_t(3) . "}"; } - $allow[] = "\t\t\treturn \$allow;"; - $allow[] = "\t\t}"; - $allow[] = "\t\treturn false;"; + $allow[] = $this->_t(3) . "return \$allow;"; + $allow[] = $this->_t(2) . "}"; + $allow[] = $this->_t(2) . "return false;"; } else { // setup the default script - $allow[] = PHP_EOL . "\t\tif (!empty(\$record->id))"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\tif (\$record->published != -2)"; - $allow[] = "\t\t\t{"; - $allow[] = "\t\t\t\treturn;"; - $allow[] = "\t\t\t}"; + $allow[] = PHP_EOL . $this->_t(2) . "if (!empty(\$record->id))"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "if (\$record->published != -2)"; + $allow[] = $this->_t(3) . "{"; + $allow[] = $this->_t(4) . "return;"; + $allow[] = $this->_t(3) . "}"; // check if the item has permissions. if ($coreLoad && (isset($core['core.delete']) && isset($this->permissionBuilder[$core['core.delete']])) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.delete']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.delete']])) { - $allow[] = PHP_EOL . "\t\t\t\$user = JFactory::getUser();"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; - $allow[] = "\t\t\treturn \$user->authorise('" . $core['core.delete'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$record->id);"; + $allow[] = PHP_EOL . $this->_t(3) . "\$user = JFactory::getUser();"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(3) . "return \$user->authorise('" . $core['core.delete'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$record->id);"; } else { - $allow[] = PHP_EOL . "\t\t\t\$user = JFactory::getUser();"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; - $allow[] = "\t\t\treturn \$user->authorise('core.delete', 'com_" . $component . "." . $viewName_single . ".' . (int) \$record->id);"; + $allow[] = PHP_EOL . $this->_t(3) . "\$user = JFactory::getUser();"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(3) . "return \$user->authorise('core.delete', 'com_" . $component . "." . $viewName_single . ".' . (int) \$record->id);"; } - $allow[] = "\t\t}"; - $allow[] = "\t\treturn false;"; + $allow[] = $this->_t(2) . "}"; + $allow[] = $this->_t(2) . "return false;"; } return implode(PHP_EOL, $allow); @@ -10976,77 +11008,77 @@ class Interpretation extends Fields $otherViews = $viewName_list; $otherView = $viewName_single; } - $allow[] = PHP_EOL . "\t\t\$user = JFactory::getUser();"; - $allow[] = "\t\t\$recordId\t= (!empty(\$record->id)) ? \$record->id : 0;"; - $allow[] = PHP_EOL . "\t\tif (\$recordId)"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; + $allow[] = $this->_t(2) . "\$recordId = (!empty(\$record->id)) ? \$record->id : 0;"; + $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']])) { - $allow[] = "\t\t\t\$permission = \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; } else { - $allow[] = "\t\t\t\$permission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; } - $allow[] = "\t\t\tif (!\$permission && !is_null(\$permission))"; - $allow[] = "\t\t\t{"; - $allow[] = "\t\t\t\treturn false;"; - $allow[] = "\t\t\t}"; - $allow[] = "\t\t}"; + $allow[] = $this->_t(3) . "if (!\$permission && !is_null(\$permission))"; + $allow[] = $this->_t(3) . "{"; + $allow[] = $this->_t(4) . "return false;"; + $allow[] = $this->_t(3) . "}"; + $allow[] = $this->_t(2) . "}"; // setup the category script - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " Check against the category."; - $allow[] = "\t\tif (!empty(\$record->catid))"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t\$catpermission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $otherViews . ".category.' . (int) \$record->catid);"; - $allow[] = "\t\t\tif (!\$catpermission && !is_null(\$catpermission))"; - $allow[] = "\t\t\t{"; - $allow[] = "\t\t\t\treturn false;"; - $allow[] = "\t\t\t}"; - $allow[] = "\t\t}"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check against the category."; + $allow[] = $this->_t(2) . "if (!empty(\$record->catid))"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "\$catpermission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $otherViews . ".category.' . (int) \$record->catid);"; + $allow[] = $this->_t(3) . "if (!\$catpermission && !is_null(\$catpermission))"; + $allow[] = $this->_t(3) . "{"; + $allow[] = $this->_t(4) . "return false;"; + $allow[] = $this->_t(3) . "}"; + $allow[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']])) { - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = "\t\treturn \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "');"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) . "return \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "');"; } else { - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = "\t\treturn parent::canEditState(\$record);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) . "return parent::canEditState(\$record);"; } } else { // setup the default script - $allow[] = PHP_EOL . "\t\t\$user = JFactory::getUser();"; - $allow[] = "\t\t\$recordId\t= (!empty(\$record->id)) ? \$record->id : 0;"; - $allow[] = PHP_EOL . "\t\tif (\$recordId)"; - $allow[] = "\t\t{"; - $allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; + $allow[] = $this->_t(2) . "\$recordId = (!empty(\$record->id)) ? \$record->id : 0;"; + $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; + $allow[] = $this->_t(2) . "{"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; // check if the item has permissions. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']])) { - $allow[] = "\t\t\t\$permission = \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; } else { - $allow[] = "\t\t\t\$permission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; } - $allow[] = "\t\t\tif (!\$permission && !is_null(\$permission))"; - $allow[] = "\t\t\t{"; - $allow[] = "\t\t\t\treturn false;"; - $allow[] = "\t\t\t}"; - $allow[] = "\t\t}"; + $allow[] = $this->_t(3) . "if (!\$permission && !is_null(\$permission))"; + $allow[] = $this->_t(3) . "{"; + $allow[] = $this->_t(4) . "return false;"; + $allow[] = $this->_t(3) . "}"; + $allow[] = $this->_t(2) . "}"; if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) { - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = "\t\treturn \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "');"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) . "return \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "');"; } else { - $allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = "\t\treturn parent::canEditState(\$record);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) . "return parent::canEditState(\$record);"; } } return implode(PHP_EOL, $allow); @@ -11067,47 +11099,47 @@ class Interpretation extends Fields // check if the item has permissions for edit. if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) { - $allow[] = PHP_EOL . "\t\t\$this->canEdit = \$this->canDo->get('" . $core['core.edit'] . "');"; + $allow[] = PHP_EOL . $this->_t(2) . "\$this->canEdit = \$this->canDo->get('" . $core['core.edit'] . "');"; } else { - $allow[] = PHP_EOL . "\t\t\$this->canEdit = \$this->canDo->get('core.edit');"; + $allow[] = PHP_EOL . $this->_t(2) . "\$this->canEdit = \$this->canDo->get('core.edit');"; } // check if the item has permissions for edit state. if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) { - $allow[] = "\t\t\$this->canState = \$this->canDo->get('" . $core['core.edit.state'] . "');"; + $allow[] = $this->_t(2) . "\$this->canState = \$this->canDo->get('" . $core['core.edit.state'] . "');"; } else { - $allow[] = "\t\t\$this->canState = \$this->canDo->get('core.edit.state');"; + $allow[] = $this->_t(2) . "\$this->canState = \$this->canDo->get('core.edit.state');"; } // check if the item has permissions for create. if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) { - $allow[] = "\t\t\$this->canCreate = \$this->canDo->get('" . $core['core.create'] . "');"; + $allow[] = $this->_t(2) . "\$this->canCreate = \$this->canDo->get('" . $core['core.create'] . "');"; } else { - $allow[] = "\t\t\$this->canCreate = \$this->canDo->get('core.create');"; + $allow[] = $this->_t(2) . "\$this->canCreate = \$this->canDo->get('core.create');"; } // check if the item has permissions for delete. if ($coreLoad && isset($core['core.delete']) && isset($this->permissionBuilder['global'][$core['core.delete']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.delete']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.delete']])) { - $allow[] = "\t\t\$this->canDelete = \$this->canDo->get('" . $core['core.delete'] . "');"; + $allow[] = $this->_t(2) . "\$this->canDelete = \$this->canDo->get('" . $core['core.delete'] . "');"; } else { - $allow[] = "\t\t\$this->canDelete = \$this->canDo->get('core.delete');"; + $allow[] = $this->_t(2) . "\$this->canDelete = \$this->canDo->get('core.delete');"; } // check if the item has permissions for batch. if ($coreLoad && isset($core['core.batch']) && isset($this->permissionBuilder['global']['global'][$core['core.batch']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global']['global'][$core['core.batch']]) && in_array($viewName_single, $this->permissionBuilder['global']['global'][$core['core.delete']])) { - $allow[] = "\t\t\$this->canBatch = (\$this->canDo->get('" . $core['core.batch'] . "') && \$this->canDo->get('core.batch'));"; + $allow[] = $this->_t(2) . "\$this->canBatch = (\$this->canDo->get('" . $core['core.batch'] . "') && \$this->canDo->get('core.batch'));"; } else { - $allow[] = "\t\t\$this->canBatch = \$this->canDo->get('core.batch');"; + $allow[] = $this->_t(2) . "\$this->canBatch = \$this->canDo->get('core.batch');"; } return implode(PHP_EOL, $allow); @@ -11124,26 +11156,26 @@ class Interpretation extends Fields $label = 'Permissions in relation to this ' . $view; // set the access fieldset $access = ""; - $access .= PHP_EOL . "\t" . '
    '; - $access .= PHP_EOL . "\t\t"; - $access .= PHP_EOL . "\t\t" . ''; - $access .= PHP_EOL . "\t\t"; - $access .= PHP_EOL . "\t\t" . ''; - $access .= PHP_EOL . "\t" . '
    '; + $access .= PHP_EOL . $this->_t(1) . '
    '; + $access .= PHP_EOL . $this->_t(2) . ""; + $access .= PHP_EOL . $this->_t(2) . '_t(3) . 'name="asset_id"'; + $access .= PHP_EOL . $this->_t(3) . 'type="hidden"'; + $access .= PHP_EOL . $this->_t(3) . 'filter="unset"'; + $access .= PHP_EOL . $this->_t(2) . '/>'; + $access .= PHP_EOL . $this->_t(2) . ""; + $access .= PHP_EOL . $this->_t(2) . '_t(3) . 'name="rules"'; + $access .= PHP_EOL . $this->_t(3) . 'type="rules"'; + $access .= PHP_EOL . $this->_t(3) . 'label="' . $label . '"'; + $access .= PHP_EOL . $this->_t(3) . 'translate_label="false"'; + $access .= PHP_EOL . $this->_t(3) . 'filter="rules"'; + $access .= PHP_EOL . $this->_t(3) . 'validate="rules"'; + $access .= PHP_EOL . $this->_t(3) . 'class="inputbox"'; + $access .= PHP_EOL . $this->_t(3) . 'component="com_' . $component . '"'; + $access .= PHP_EOL . $this->_t(3) . 'section="' . $view . '"'; + $access .= PHP_EOL . $this->_t(2) . '/>'; + $access .= PHP_EOL . $this->_t(1) . '
    '; } // return access field set return $access; @@ -11155,14 +11187,14 @@ class Interpretation extends Fields $donelist = array('id', 'search', 'published', 'access', 'created_by', 'modified_by'); // default filter fields $fields = "'a.id','id'"; - $fields .= "," . PHP_EOL . "\t\t\t\t'a.published','published'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a.published','published'"; if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) { - $fields .= "," . PHP_EOL . "\t\t\t\t'a.access','access'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a.access','access'"; } - $fields .= "," . PHP_EOL . "\t\t\t\t'a.ordering','ordering'"; - $fields .= "," . PHP_EOL . "\t\t\t\t'a.created_by','created_by'"; - $fields .= "," . PHP_EOL . "\t\t\t\t'a.modified_by','modified_by'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a.ordering','ordering'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a.created_by','created_by'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a.modified_by','modified_by'"; // add the rest of the set filters if (isset($this->sortBuilder[$view]) && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) @@ -11173,11 +11205,11 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $fields .= "," . PHP_EOL . "\t\t\t\t'c.title','category_title'"; - $fields .= "," . PHP_EOL . "\t\t\t\t'c.id', 'category_id'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'c.title','category_title'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'c.id', 'category_id'"; if ($filter['code'] != 'category') { - $fields .= "," . PHP_EOL . "\t\t\t\t'a." . $filter['code'] . "', '" . $filter['code'] . "'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a." . $filter['code'] . "', '" . $filter['code'] . "'"; } } else @@ -11185,9 +11217,9 @@ class Interpretation extends Fields // check if custom field is set /* if (ComponentbuilderHelper::checkArray($filter['custom'])) { - $fields .= ",".PHP_EOL."\t\t\t\t'".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'"; + $fields .= ",".PHP_EOL.$this->_t(4) . "'".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'"; } */ - $fields .= "," . PHP_EOL . "\t\t\t\t'a." . $filter['code'] . "','" . $filter['code'] . "'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a." . $filter['code'] . "','" . $filter['code'] . "'"; } $donelist[] = $filter['code']; } @@ -11202,11 +11234,11 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $fields .= "," . PHP_EOL . "\t\t\t\t'c.title','category_title'"; - $fields .= "," . PHP_EOL . "\t\t\t\t'c.id', 'category_id'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'c.title','category_title'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'c.id', 'category_id'"; if ($filter['code'] != 'category') { - $fields .= "," . PHP_EOL . "\t\t\t\t'a." . $filter['code'] . "', '" . $filter['code'] . "'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a." . $filter['code'] . "', '" . $filter['code'] . "'"; } } else @@ -11214,9 +11246,9 @@ class Interpretation extends Fields // check if custom field is set /* if (ComponentbuilderHelper::checkArray($filter['custom'])) { - $fields .= ",".PHP_EOL."\t\t\t\t'".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'"; + $fields .= ",".PHP_EOL.$this->_t(4) . "'".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'"; } */ - $fields .= "," . PHP_EOL . "\t\t\t\t'a." . $filter['code'] . "','" . $filter['code'] . "'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a." . $filter['code'] . "','" . $filter['code'] . "'"; } $donelist[] = $filter['code']; } @@ -11231,16 +11263,16 @@ class Interpretation extends Fields $donelist = array('id', 'search', 'published', 'access', 'created_by', 'modified_by'); // set the defaults first $stored = "//" . $this->setLine(__LINE__) . " Compile the store id."; - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.id');"; - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.search');"; - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.published');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.id');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.search');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.published');"; if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) { - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.access');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.access');"; } - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.ordering');"; - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.created_by');"; - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.modified_by');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.ordering');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.created_by');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.modified_by');"; // add the rest of the set filters if (isset($this->sortBuilder[$view]) && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) { @@ -11250,11 +11282,11 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.category');"; - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.category_id');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.category');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.category_id');"; if ($filter['code'] != 'category') { - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; } } else @@ -11262,9 +11294,9 @@ class Interpretation extends Fields // check if custom field is set /* if (ComponentbuilderHelper::checkArray($filter['custom'])) { - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; + $stored .= PHP_EOL.$this->_t(2) . "\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; } */ - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; } $donelist[] = $filter['code']; } @@ -11279,11 +11311,11 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.category');"; - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.category_id');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.category');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.category_id');"; if ($filter['code'] != 'category') { - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; } } else @@ -11291,9 +11323,9 @@ class Interpretation extends Fields // check if custom field is set /* if (ComponentbuilderHelper::checkArray($filter['custom'])) { - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; + $stored .= PHP_EOL.$this->_t(2) . "\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; } */ - $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; + $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; } $donelist[] = $filter['code']; } @@ -11323,8 +11355,8 @@ class Interpretation extends Fields // build toolbar $toolBar = "JFactory::getApplication()->input->set('hidemainmenu', true);"; - $toolBar .= PHP_EOL . "\t\tJToolBarHelper::title(JText:" . ":_('" . $viewNameLang_readonly . "'), '" . $viewName . "');"; - $toolBar .= PHP_EOL . "\t\tJToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; + $toolBar .= PHP_EOL . $this->_t(2) . "JToolBarHelper::title(JText:" . ":_('" . $viewNameLang_readonly . "'), '" . $viewName . "');"; + $toolBar .= PHP_EOL . $this->_t(2) . "JToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; } else { @@ -11336,141 +11368,141 @@ class Interpretation extends Fields $this->langContent[$this->lang][$viewNameLang_edit] = 'Editing the ' . $view['settings']->name_single; // build toolbar $toolBar = "JFactory::getApplication()->input->set('hidemainmenu', true);"; - $toolBar .= PHP_EOL . "\t\t\$user = JFactory::getUser();"; - $toolBar .= PHP_EOL . "\t\t\$userId = \$user->id;"; - $toolBar .= PHP_EOL . "\t\t\$isNew = \$this->item->id == 0;"; - $toolBar .= PHP_EOL . PHP_EOL . "\t\tJToolbarHelper::title( JText:" . ":_(\$isNew ? '" . $viewNameLang_new . "' : '" . $viewNameLang_edit . "'), 'pencil-2 article-add');"; - $toolBar .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Built the actions for new and existing records."; - $toolBar .= PHP_EOL . "\t\tif (\$this->refid || \$this->ref)"; - $toolBar .= PHP_EOL . "\t\t{"; + $toolBar .= PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; + $toolBar .= PHP_EOL . $this->_t(2) . "\$userId = \$user->id;"; + $toolBar .= PHP_EOL . $this->_t(2) . "\$isNew = \$this->item->id == 0;"; + $toolBar .= PHP_EOL . PHP_EOL . $this->_t(2) . "JToolbarHelper::title( JText:" . ":_(\$isNew ? '" . $viewNameLang_new . "' : '" . $viewNameLang_edit . "'), 'pencil-2 article-add');"; + $toolBar .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Built the actions for new and existing records."; + $toolBar .= PHP_EOL . $this->_t(2) . "if (\$this->refid || \$this->ref)"; + $toolBar .= PHP_EOL . $this->_t(2) . "{"; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) { - $toolBar .= PHP_EOL . "\t\t\tif (\$this->canDo->get('" . $core['core.create'] . "') && \$isNew)"; + $toolBar .= PHP_EOL . $this->_t(3) . "if (\$this->canDo->get('" . $core['core.create'] . "') && \$isNew)"; } else { - $toolBar .= PHP_EOL . "\t\t\tif (\$this->canDo->get('core.create') && \$isNew)"; + $toolBar .= PHP_EOL . $this->_t(3) . "if (\$this->canDo->get('core.create') && \$isNew)"; } - $toolBar .= PHP_EOL . "\t\t\t{"; - $toolBar .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " We can create the record."; - $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL . "\t\t\t}"; + $toolBar .= PHP_EOL . $this->_t(3) . "{"; + $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " We can create the record."; + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . $this->_t(3) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.edit']])) { - $toolBar .= PHP_EOL . "\t\t\telseif (\$this->canDo->get('" . $core['core.edit'] . "'))"; + $toolBar .= PHP_EOL . $this->_t(3) . "elseif (\$this->canDo->get('" . $core['core.edit'] . "'))"; } else { - $toolBar .= PHP_EOL . "\t\t\telseif (\$this->canDo->get('core.edit'))"; + $toolBar .= PHP_EOL . $this->_t(3) . "elseif (\$this->canDo->get('core.edit'))"; } - $toolBar .= PHP_EOL . "\t\t\t{"; - $toolBar .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " We can save the record."; - $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL . "\t\t\t}"; - $toolBar .= PHP_EOL . "\t\t\tif (\$isNew)"; - $toolBar .= PHP_EOL . "\t\t\t{"; - $toolBar .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Do not creat but cancel."; - $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CANCEL');"; - $toolBar .= PHP_EOL . "\t\t\t}"; - $toolBar .= PHP_EOL . "\t\t\telse"; - $toolBar .= PHP_EOL . "\t\t\t{"; - $toolBar .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " We can close it."; - $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; - $toolBar .= PHP_EOL . "\t\t\t}"; - $toolBar .= PHP_EOL . "\t\t}"; - $toolBar .= PHP_EOL . "\t\telse"; - $toolBar .= PHP_EOL . "\t\t{"; - $toolBar .= PHP_EOL . "\t\t\tif (\$isNew)"; - $toolBar .= PHP_EOL . "\t\t\t{"; - $toolBar .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " For new records, check the create permission."; + $toolBar .= PHP_EOL . $this->_t(3) . "{"; + $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " We can save the record."; + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . $this->_t(3) . "}"; + $toolBar .= PHP_EOL . $this->_t(3) . "if (\$isNew)"; + $toolBar .= PHP_EOL . $this->_t(3) . "{"; + $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Do not creat but cancel."; + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CANCEL');"; + $toolBar .= PHP_EOL . $this->_t(3) . "}"; + $toolBar .= PHP_EOL . $this->_t(3) . "else"; + $toolBar .= PHP_EOL . $this->_t(3) . "{"; + $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " We can close it."; + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; + $toolBar .= PHP_EOL . $this->_t(3) . "}"; + $toolBar .= PHP_EOL . $this->_t(2) . "}"; + $toolBar .= PHP_EOL . $this->_t(2) . "else"; + $toolBar .= PHP_EOL . $this->_t(2) . "{"; + $toolBar .= PHP_EOL . $this->_t(3) . "if (\$isNew)"; + $toolBar .= PHP_EOL . $this->_t(3) . "{"; + $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " For new records, check the create permission."; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) { - $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('" . $core['core.create'] . "'))"; + $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" . $core['core.create'] . "'))"; } else { - $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('core.create'))"; + $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('core.create'))"; } - $toolBar .= PHP_EOL . "\t\t\t\t{"; - $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::apply('" . $viewName . ".apply', 'JTOOLBAR_APPLY');"; - $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::custom('" . $viewName . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; - $toolBar .= PHP_EOL . "\t\t\t\t};"; - $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CANCEL');"; - $toolBar .= PHP_EOL . "\t\t\t}"; - $toolBar .= PHP_EOL . "\t\t\telse"; - $toolBar .= PHP_EOL . "\t\t\t{"; + $toolBar .= PHP_EOL . $this->_t(4) . "{"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::apply('" . $viewName . ".apply', 'JTOOLBAR_APPLY');"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::custom('" . $viewName . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; + $toolBar .= PHP_EOL . $this->_t(4) . "};"; + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CANCEL');"; + $toolBar .= PHP_EOL . $this->_t(3) . "}"; + $toolBar .= PHP_EOL . $this->_t(3) . "else"; + $toolBar .= PHP_EOL . $this->_t(3) . "{"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.edit']])) { - $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('" . $core['core.edit'] . "'))"; + $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" . $core['core.edit'] . "'))"; } else { - $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('core.edit'))"; + $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('core.edit'))"; } - $toolBar .= PHP_EOL . "\t\t\t\t{"; - $toolBar .= PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " We can save the new record"; - $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::apply('" . $viewName . ".apply', 'JTOOLBAR_APPLY');"; - $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " We can save this record, but check the create permission to see"; - $toolBar .= PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " if we can return to make a new one."; + $toolBar .= PHP_EOL . $this->_t(4) . "{"; + $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " We can save the new record"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::apply('" . $viewName . ".apply', 'JTOOLBAR_APPLY');"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " We can save this record, but check the create permission to see"; + $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " if we can return to make a new one."; if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) { - $toolBar .= PHP_EOL . "\t\t\t\t\tif (\$this->canDo->get('" . $core['core.create'] . "'))"; + $toolBar .= PHP_EOL . $this->_t(5) . "if (\$this->canDo->get('" . $core['core.create'] . "'))"; } else { - $toolBar .= PHP_EOL . "\t\t\t\t\tif (\$this->canDo->get('core.create'))"; + $toolBar .= PHP_EOL . $this->_t(5) . "if (\$this->canDo->get('core.create'))"; } - $toolBar .= PHP_EOL . "\t\t\t\t\t{"; - $toolBar .= PHP_EOL . "\t\t\t\t\t\tJToolBarHelper::custom('" . $viewName . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; - $toolBar .= PHP_EOL . "\t\t\t\t\t}"; - $toolBar .= PHP_EOL . "\t\t\t\t}"; + $toolBar .= PHP_EOL . $this->_t(5) . "{"; + $toolBar .= PHP_EOL . $this->_t(6) . "JToolBarHelper::custom('" . $viewName . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; + $toolBar .= PHP_EOL . $this->_t(5) . "}"; + $toolBar .= PHP_EOL . $this->_t(4) . "}"; if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.edit']])) { if ($coreLoad && isset($this->historyBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->historyBuilder[$viewName])) { - $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}"; + $toolBar .= PHP_EOL . $this->_t(4) . "\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));"; + $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->state->params->get('save_history', 1) && \$this->canDo->get('" . $core['core.edit'] . "') && \$canVersion)"; + $toolBar .= PHP_EOL . $this->_t(4) . "{"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolbarHelper::versions('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $viewName . "', \$this->item->id);"; + $toolBar .= PHP_EOL . $this->_t(4) . "}"; } } else { if ($coreLoad && isset($this->historyBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->historyBuilder[$viewName])) { - $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}"; + $toolBar .= PHP_EOL . $this->_t(4) . "\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));"; + $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->state->params->get('save_history', 1) && \$this->canDo->get('core.edit') && \$canVersion)"; + $toolBar .= PHP_EOL . $this->_t(4) . "{"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolbarHelper::versions('com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "." . $viewName . "', \$this->item->id);"; + $toolBar .= PHP_EOL . $this->_t(4) . "}"; } } if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) { - $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('" . $core['core.create'] . "'))"; + $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" . $core['core.create'] . "'))"; } else { - $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('core.create'))"; + $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('core.create'))"; } - $toolBar .= PHP_EOL . "\t\t\t\t{"; - $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::custom('" . $viewName . ".save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);"; - $toolBar .= PHP_EOL . "\t\t\t\t}"; + $toolBar .= PHP_EOL . $this->_t(4) . "{"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::custom('" . $viewName . ".save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);"; + $toolBar .= PHP_EOL . $this->_t(4) . "}"; // add custom buttons - $toolBar .= $this->setCustomButtons($view, 2, "\t\t"); - $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; - $toolBar .= PHP_EOL . "\t\t\t}"; - $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{"; - $toolBar .= PHP_EOL . "\t\t\tJToolbarHelper::help('" . $this->langPrefix . "_HELP_MANAGER', false, \$help_url);"; - $toolBar .= PHP_EOL . "\t\t}"; + $toolBar .= $this->setCustomButtons($view, 2, $this->_t(2)); + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; + $toolBar .= PHP_EOL . $this->_t(3) . "}"; + $toolBar .= PHP_EOL . $this->_t(2) . "}"; + $toolBar .= PHP_EOL . $this->_t(2) . "JToolbarHelper::divider();"; + $toolBar .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " set help url for this view if found"; + $toolBar .= PHP_EOL . $this->_t(2) . "\$help_url = " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::getHelpUrl('" . $viewName . "');"; + $toolBar .= PHP_EOL . $this->_t(2) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkString(\$help_url))"; + $toolBar .= PHP_EOL . $this->_t(2) . "{"; + $toolBar .= PHP_EOL . $this->_t(3) . "JToolbarHelper::help('" . $this->langPrefix . "_HELP_MANAGER', false, \$help_url);"; + $toolBar .= PHP_EOL . $this->_t(2) . "}"; } return $toolBar; } @@ -11497,16 +11529,16 @@ class Interpretation extends Fields } else { - $spacer = PHP_EOL . PHP_EOL . "\t\t"; + $spacer = PHP_EOL . PHP_EOL . $this->_t(2); } $state .= $spacer . "\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; - $state .= PHP_EOL . "\t\t\$this->setState('filter.category', \$category);"; - $state .= PHP_EOL . PHP_EOL . "\t\t\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; - $state .= PHP_EOL . "\t\t\$this->setState('filter.category_id', \$categoryId);"; + $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter.category', \$category);"; + $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; + $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter.category_id', \$categoryId);"; if ($filter['code'] != 'category') { - $state .= PHP_EOL . PHP_EOL . "\t\t\$" . $filter['code'] . " = \$app->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; - $state .= PHP_EOL . "\t\t\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; + $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$" . $filter['code'] . " = \$app->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; + $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; } } else @@ -11517,17 +11549,17 @@ class Interpretation extends Fields } else { - $spacer = PHP_EOL . PHP_EOL . "\t\t"; + $spacer = PHP_EOL . PHP_EOL . $this->_t(2); } // check if custom field is set /* if (ComponentbuilderHelper::checkArray($filter['custom'])) { $state .= $spacer."\$".$filter['code']."_".$filter['custom']['text']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['code']."_".$filter['custom']['text']."', 'filter_".$filter['code']."_".$filter['custom']['text']."');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['code']."_".$filter['custom']['text']."', \$".$filter['code']."_".$filter['custom']['text'].");"; - $spacer = PHP_EOL.PHP_EOL."\t\t"; + $state .= PHP_EOL.$this->_t(2) . "\$this->setState('filter.".$filter['code']."_".$filter['custom']['text']."', \$".$filter['code']."_".$filter['custom']['text'].");"; + $spacer = PHP_EOL.PHP_EOL.$this->_t(2); } */ $state .= $spacer . "\$" . $filter['code'] . " = \$this->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; - $state .= PHP_EOL . "\t\t\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; + $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; } $donelist[] = $filter['code']; } @@ -11548,16 +11580,16 @@ class Interpretation extends Fields } else { - $spacer = PHP_EOL . PHP_EOL . "\t\t"; + $spacer = PHP_EOL . PHP_EOL . $this->_t(2); } $state .= $spacer . "\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; - $state .= PHP_EOL . "\t\t\$this->setState('filter.category', \$category);"; - $state .= PHP_EOL . PHP_EOL . "\t\t\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; - $state .= PHP_EOL . "\t\t\$this->setState('filter.category_id', \$categoryId);"; + $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter.category', \$category);"; + $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; + $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter.category_id', \$categoryId);"; if ($filter['code'] != 'category') { - $state .= PHP_EOL . PHP_EOL . "\t\t\$" . $filter['code'] . " = \$app->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; - $state .= PHP_EOL . "\t\t\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; + $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$" . $filter['code'] . " = \$app->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; + $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; } } else @@ -11568,19 +11600,19 @@ class Interpretation extends Fields } else { - $spacer = PHP_EOL . PHP_EOL . "\t\t"; + $spacer = PHP_EOL . PHP_EOL . $this->_t(2); } // check if custom field is set /* if (ComponentbuilderHelper::checkArray($filter['custom'])) { $state .= $spacer."\$".$filter['custom']['text']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['custom']['text']."', 'filter_".$filter['custom']['text']."');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['custom']['text']."', \$".$filter['custom']['text'].");"; - $state .= PHP_EOL."\t\t\$".$filter['code']."_".$filter['custom']['text']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['code']."_".$filter['custom']['text']."', 'filter_".$filter['code']."_".$filter['custom']['text']."');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['code']."_".$filter['custom']['text']."', \$".$filter['code']."_".$filter['custom']['text'].");"; - $spacer = PHP_EOL.PHP_EOL."\t\t"; + $state .= PHP_EOL.$this->_t(2) . "\$this->setState('filter.".$filter['custom']['text']."', \$".$filter['custom']['text'].");"; + $state .= PHP_EOL.$this->_t(2) . "\$".$filter['code']."_".$filter['custom']['text']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['code']."_".$filter['custom']['text']."', 'filter_".$filter['code']."_".$filter['custom']['text']."');"; + $state .= PHP_EOL.$this->_t(2) . "\$this->setState('filter.".$filter['code']."_".$filter['custom']['text']."', \$".$filter['code']."_".$filter['custom']['text'].");"; + $spacer = PHP_EOL.PHP_EOL.$this->_t(2); } */ $state .= $spacer . "\$" . $filter['code'] . " = \$this->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; - $state .= PHP_EOL . "\t\t\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; + $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; } $donelist[] = $filter['code']; } @@ -11595,8 +11627,8 @@ class Interpretation extends Fields $donelist = array('sorting', 'published'); // set the default first $fields = "return array("; - $fields .= PHP_EOL . "\t\t\t'a.sorting' => JText:" . ":_('JGRID_HEADING_ORDERING')"; - $fields .= "," . PHP_EOL . "\t\t\t'a.published' => JText:" . ":_('JSTATUS')"; + $fields .= PHP_EOL . $this->_t(3) . "'a.sorting' => JText:" . ":_('JGRID_HEADING_ORDERING')"; + $fields .= "," . PHP_EOL . $this->_t(3) . "'a.published' => JText:" . ":_('JSTATUS')"; // add the rest of the set filters if (isset($this->sortBuilder[$view]) && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) @@ -11607,88 +11639,88 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $fields .= "," . PHP_EOL . "\t\t\t'c.category_title' => JText:" . ":_('" . $filter['lang'] . "')"; + $fields .= "," . PHP_EOL . $this->_t(3) . "'c.category_title' => JText:" . ":_('" . $filter['lang'] . "')"; } elseif (ComponentbuilderHelper::checkArray($filter['custom'])) { - $fields .= "," . PHP_EOL . "\t\t\t'" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "' => JText:" . ":_('" . $filter['lang'] . "')"; + $fields .= "," . PHP_EOL . $this->_t(3) . "'" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "' => JText:" . ":_('" . $filter['lang'] . "')"; } else { - $fields .= "," . PHP_EOL . "\t\t\t'a." . $filter['code'] . "' => JText:" . ":_('" . $filter['lang'] . "')"; + $fields .= "," . PHP_EOL . $this->_t(3) . "'a." . $filter['code'] . "' => JText:" . ":_('" . $filter['lang'] . "')"; } } } } - $fields .= "," . PHP_EOL . "\t\t\t'a.id' => JText:" . ":_('JGRID_HEADING_ID')"; - $fields .= PHP_EOL . "\t\t);"; + $fields .= "," . PHP_EOL . $this->_t(3) . "'a.id' => JText:" . ":_('JGRID_HEADING_ID')"; + $fields .= PHP_EOL . $this->_t(2) . ");"; // return fields return $fields; } public function setCheckinCall() { - $call = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " check in items"; - $call .= PHP_EOL . "\t\t\$this->checkInNow();" . PHP_EOL; + $call = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " check in items"; + $call .= PHP_EOL . $this->_t(2) . "\$this->checkInNow();" . PHP_EOL; return $call; } public function setAutoCheckin($view, $component) { - $checkin = PHP_EOL . PHP_EOL . "\t/**"; - $checkin .= PHP_EOL . "\t* Build an SQL query to checkin all items left checked out longer then a set time."; - $checkin .= PHP_EOL . "\t*"; - $checkin .= PHP_EOL . "\t* @return a bool"; - $checkin .= PHP_EOL . "\t*"; - $checkin .= PHP_EOL . "\t*/"; - $checkin .= PHP_EOL . "\tprotected function checkInNow()"; - $checkin .= PHP_EOL . "\t{"; - $checkin .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get set check in time"; - $checkin .= PHP_EOL . "\t\t\$time = JComponentHelper::getParams('com_" . $component . "')->get('check_in');"; - $checkin .= PHP_EOL . "\t\t"; - $checkin .= PHP_EOL . "\t\tif (\$time)"; - $checkin .= PHP_EOL . "\t\t{"; - $checkin .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get a db connection."; - $checkin .= PHP_EOL . "\t\t\t\$db = JFactory::getDbo();"; - $checkin .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " reset query"; - $checkin .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; - $checkin .= PHP_EOL . "\t\t\t\$query->select('*');"; - $checkin .= PHP_EOL . "\t\t\t\$query->from(\$db->quoteName('#__" . $component . "_" . $view . "'));"; - $checkin .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; - $checkin .= PHP_EOL . "\t\t\t\$db->execute();"; - $checkin .= PHP_EOL . "\t\t\tif (\$db->getNumRows())"; - $checkin .= PHP_EOL . "\t\t\t{"; - $checkin .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Get Yesterdays date"; - $checkin .= PHP_EOL . "\t\t\t\t\$date = JFactory::getDate()->modify(\$time)->toSql();"; - $checkin .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " reset query"; - $checkin .= PHP_EOL . "\t\t\t\t\$query = \$db->getQuery(true);"; - $checkin .= PHP_EOL . PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Fields to update."; - $checkin .= PHP_EOL . "\t\t\t\t\$fields = array("; - $checkin .= PHP_EOL . "\t\t\t\t\t\$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',"; - $checkin .= PHP_EOL . "\t\t\t\t\t\$db->quoteName('checked_out') . '=0'"; - $checkin .= PHP_EOL . "\t\t\t\t);"; - $checkin .= PHP_EOL . PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Conditions for which records should be updated."; - $checkin .= PHP_EOL . "\t\t\t\t\$conditions = array("; - $checkin .= PHP_EOL . "\t\t\t\t\t\$db->quoteName('checked_out') . '!=0', "; - $checkin .= PHP_EOL . "\t\t\t\t\t\$db->quoteName('checked_out_time') . '<\''.\$date.'\''"; - $checkin .= PHP_EOL . "\t\t\t\t);"; - $checkin .= PHP_EOL . PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Check table"; - $checkin .= PHP_EOL . "\t\t\t\t\$query->update(\$db->quoteName('#__" . $component . "_" . $view . "'))->set(\$fields)->where(\$conditions); "; - $checkin .= PHP_EOL . PHP_EOL . "\t\t\t\t\$db->setQuery(\$query);"; - $checkin .= PHP_EOL . PHP_EOL . "\t\t\t\t\$db->execute();"; - $checkin .= PHP_EOL . "\t\t\t}"; - $checkin .= PHP_EOL . "\t\t}"; - $checkin .= PHP_EOL . PHP_EOL . "\t\treturn false;"; - $checkin .= PHP_EOL . "\t}"; + $checkin = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $checkin .= PHP_EOL . $this->_t(1) . " * Build an SQL query to checkin all items left checked out longer then a set time."; + $checkin .= PHP_EOL . $this->_t(1) . " *"; + $checkin .= PHP_EOL . $this->_t(1) . " * @return a bool"; + $checkin .= PHP_EOL . $this->_t(1) . " *"; + $checkin .= PHP_EOL . $this->_t(1) . " */"; + $checkin .= PHP_EOL . $this->_t(1) . "protected function checkInNow()"; + $checkin .= PHP_EOL . $this->_t(1) . "{"; + $checkin .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get set check in time"; + $checkin .= PHP_EOL . $this->_t(2) . "\$time = JComponentHelper::getParams('com_" . $component . "')->get('check_in');"; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(2) . "if (\$time)"; + $checkin .= PHP_EOL . $this->_t(2) . "{"; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get a db connection."; + $checkin .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDbo();"; + $checkin .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " reset query"; + $checkin .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; + $checkin .= PHP_EOL . $this->_t(3) . "\$query->select('*');"; + $checkin .= PHP_EOL . $this->_t(3) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $view . "'));"; + $checkin .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; + $checkin .= PHP_EOL . $this->_t(3) . "\$db->execute();"; + $checkin .= PHP_EOL . $this->_t(3) . "if (\$db->getNumRows())"; + $checkin .= PHP_EOL . $this->_t(3) . "{"; + $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Get Yesterdays date"; + $checkin .= PHP_EOL . $this->_t(4) . "\$date = JFactory::getDate()->modify(\$time)->toSql();"; + $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " reset query"; + $checkin .= PHP_EOL . $this->_t(4) . "\$query = \$db->getQuery(true);"; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Fields to update."; + $checkin .= PHP_EOL . $this->_t(4) . "\$fields = array("; + $checkin .= PHP_EOL . $this->_t(5) . "\$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',"; + $checkin .= PHP_EOL . $this->_t(5) . "\$db->quoteName('checked_out') . '=0'"; + $checkin .= PHP_EOL . $this->_t(4) . ");"; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Conditions for which records should be updated."; + $checkin .= PHP_EOL . $this->_t(4) . "\$conditions = array("; + $checkin .= PHP_EOL . $this->_t(5) . "\$db->quoteName('checked_out') . '!=0', "; + $checkin .= PHP_EOL . $this->_t(5) . "\$db->quoteName('checked_out_time') . '<\''.\$date.'\''"; + $checkin .= PHP_EOL . $this->_t(4) . ");"; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Check table"; + $checkin .= PHP_EOL . $this->_t(4) . "\$query->update(\$db->quoteName('#__" . $component . "_" . $view . "'))->set(\$fields)->where(\$conditions); "; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "\$db->setQuery(\$query);"; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "\$db->execute();"; + $checkin .= PHP_EOL . $this->_t(3) . "}"; + $checkin .= PHP_EOL . $this->_t(2) . "}"; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(2) . "return false;"; + $checkin .= PHP_EOL . $this->_t(1) . "}"; return $checkin; } - public function setGetItemsMethodStringFix($view, $Component, $tab = '', $export = false) + public function setGetItemsMethodStringFix($view, $viewName_list, $Component, $tab = '', $export = false) { // add the fix if this view has the need for it $fix = ''; + $forEachStart = ''; // encryption switches foreach ($this->cryptionTypes as $cryptionType) { @@ -11705,21 +11737,13 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder[$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.access']]) && in_array($view, $this->permissionBuilder[$core['core.access']])) { - $fix .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set values to display correctly."; - $fix .= PHP_EOL . "\t" . $tab . "\tif (" . $Component . "Helper::checkArray(\$items))"; - $fix .= PHP_EOL . "\t" . $tab . "\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " get user object."; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\$user = JFactory::getUser();"; - $fix .= PHP_EOL . "\t" . $tab . "\t\tforeach (\$items as \$nr => &\$item)"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $view . ".' . (int) \$item->id) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (!\$access)"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tunset(\$items[\$nr]);"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tcontinue;"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t}" . PHP_EOL; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$access = (JFactory::getUser()->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $view . ".' . (int) \$item->id) && JFactory::getUser()->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (!\$access)"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "unset(\$items[\$nr]);"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "continue;"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}" . PHP_EOL; } - if (!$export) { $methodName = 'getItemsMethodListStringFixBuilder'; @@ -11728,18 +11752,20 @@ class Interpretation extends Fields { $methodName = 'getItemsMethodEximportStringFixBuilder'; } - + // load the relations before modeling + if (isset($this->fieldRelations[$viewName_list]) && ComponentbuilderHelper::checkArray($this->fieldRelations[$viewName_list])) + { + foreach ($this->fieldRelations[$viewName_list] as $field) + { + if (isset($field['area']) && $field['area'] == 1 && isset($field['code'])) + { + $fix .= $this->setModelFieldRelation($field, $viewName_list); + } + } + } + // open the values if (isset($this->{$methodName}[$view]) && ComponentbuilderHelper::checkArray($this->{$methodName}[$view])) { - if (!ComponentbuilderHelper::checkString($fix)) - { - $fix .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set values to display correctly."; - $fix .= PHP_EOL . "\t" . $tab . "\tif (" . $Component . "Helper::checkArray(\$items))"; - $fix .= PHP_EOL . "\t" . $tab . "\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\tforeach (\$items as \$nr => &\$item)"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t{"; - } - foreach ($this->{$methodName}[$view] as $item) { switch ($item['method']) @@ -11781,58 +11807,58 @@ class Interpretation extends Fields if ($item['type'] === 'usergroup' && !$export) { - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " decode " . $item['name']; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$" . $item['name'] . "Names = '';"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$counter = 0;"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tforeach (\$" . $item['name'] . "Array as \$" . $item['name'] . ")"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\tif (\$counter == 0)"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= " . $Component . "Helper::getGroupName(\$" . $item['name'] . ");"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\telse"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= ', '." . $Component . "Helper::getGroupName(\$" . $item['name'] . ");"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\$counter++;"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t}"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$item->" . $item['name'] . " = \$" . $item['name'] . "Names;"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " decode " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$" . $item['name'] . "Names = '';"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$counter = 0;"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "foreach (\$" . $item['name'] . "Array as \$" . $item['name'] . ")"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "if (\$counter == 0)"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(6) . "\$" . $item['name'] . "Names .= " . $Component . "Helper::getGroupName(\$" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "else"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(6) . "\$" . $item['name'] . "Names .= ', '." . $Component . "Helper::getGroupName(\$" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "\$counter++;"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$item->" . $item['name'] . " = \$" . $item['name'] . "Names;"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; } /* elseif ($item['type'] === 'usergroup' && $export) { - $fix .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." decode ".$item['name']; - $fix .= PHP_EOL."\t".$tab."\t\t\t\$".$item['name']."Array = ".$decode."(\$item->".$item['name'].$suffix_decode.");"; - $fix .= PHP_EOL."\t".$tab."\t\t\tif (".$Component."Helper::checkArray(\$".$item['name']."Array))"; - $fix .= PHP_EOL."\t".$tab."\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\$item->".$item['name']." = implode('|',\$".$item['name']."Array);"; - $fix .= PHP_EOL."\t".$tab."\t\t\t}"; + $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(3) . "//".$this->setLine(__LINE__)." decode ".$item['name']; + $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(3) . "\$".$item['name']."Array = ".$decode."(\$item->".$item['name'].$suffix_decode.");"; + $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(3) . "if (".$Component."Helper::checkArray(\$".$item['name']."Array))"; + $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(3) . "{"; + $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(4) . "\$item->".$item['name']." = implode('|',\$".$item['name']."Array);"; + $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(3) . "}"; } */ elseif ($item['translation'] && !$export) { - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " convert " . $item['name']; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$" . $item['name'] . "Names = '';"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$counter = 0;"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tforeach (\$" . $item['name'] . "Array as \$" . $item['name'] . ")"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\tif (\$counter == 0)"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= JText:" . ":_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\telse"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= ', '.JText:" . ":_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\$counter++;"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t}"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$item->" . $item['name'] . " = \$" . $item['name'] . "Names;"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$" . $item['name'] . "Names = '';"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$counter = 0;"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "foreach (\$" . $item['name'] . "Array as \$" . $item['name'] . ")"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "if (\$counter == 0)"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(6) . "\$" . $item['name'] . "Names .= JText:" . ":_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "else"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(6) . "\$" . $item['name'] . "Names .= ', '.JText:" . ":_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "\$counter++;"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$item->" . $item['name'] . " = \$" . $item['name'] . "Names;"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; } else { @@ -11841,85 +11867,85 @@ class Interpretation extends Fields $taber = ''; if ($item['method'] == 3) { - $taber = "\t"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (\$basickey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; + $taber = $this->_t(1); + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (\$basickey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; } elseif ($item['method'] == 5) { - $taber = "\t"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (\$mediumkey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; + $taber = $this->_t(1); + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (\$mediumkey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; } elseif ($item['method'] == 4) { - $taber = "\t"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (\$whmcskey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; + $taber = $this->_t(1); + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (\$whmcskey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; } if ($item['method'] == 3 || $item['method'] == 4 || $item['method'] == 5) { - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t//" . $this->setLine(__LINE__) . " decrypt " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "//" . $this->setLine(__LINE__) . " decrypt " . $item['name']; } else { - $fix .= PHP_EOL . "\t" . $tab . $taber . "\t\t\t//" . $this->setLine(__LINE__) . " decode " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $taber . $this->_t(3) . "//" . $this->setLine(__LINE__) . " decode " . $item['name']; } - $fix .= PHP_EOL . "\t" . $tab . $taber . "\t\t\t\$item->" . $item['name'] . " = " . $decode . "(\$item->" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $taber . $this->_t(3) . "\$item->" . $item['name'] . " = " . $decode . "(\$item->" . $item['name'] . ");"; if ($item['method'] == 3 || $item['method'] == 4 || $item['method'] == 5) { - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; } } else { if ($export && $item['type'] === 'repeatable') { - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " decode repeatable " . $item['name']; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$bucket" . $item['name'] . " = array();"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tforeach (\$" . $item['name'] . "Array as \$" . $item['name'] . "FieldName => \$" . $item['name'] . ")"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\tif (" . $Component . "Helper::checkArray(\$" . $item['name'] . "))"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$bucket" . $item['name'] . "[] = \$" . $item['name'] . "FieldName . '<||VDM||>' . implode('<|VDM|>',\$" . $item['name'] . ");"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t}"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t//" . $this->setLine(__LINE__) . " make sure the bucket has values."; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tif (" . $Component . "Helper::checkArray(\$bucket" . $item['name'] . "))"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " clear the repeatable field."; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\tunset(\$item->" . $item['name'] . ");"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " set repeatable field for export."; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\$item->" . $item['name'] . " = implode('<|||VDM|||>',\$bucket" . $item['name'] . ");"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " unset the bucket."; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\tunset(\$bucket" . $item['name'] . ");"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t}"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " decode repeatable " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$bucket" . $item['name'] . " = array();"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "foreach (\$" . $item['name'] . "Array as \$" . $item['name'] . "FieldName => \$" . $item['name'] . ")"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(6) . "\$bucket" . $item['name'] . "[] = \$" . $item['name'] . "FieldName . '<||VDM||>' . implode('<|VDM|>',\$" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "//" . $this->setLine(__LINE__) . " make sure the bucket has values."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "if (" . $Component . "Helper::checkArray(\$bucket" . $item['name'] . "))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "//" . $this->setLine(__LINE__) . " clear the repeatable field."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "unset(\$item->" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "//" . $this->setLine(__LINE__) . " set repeatable field for export."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "\$item->" . $item['name'] . " = implode('<|||VDM|||>',\$bucket" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "//" . $this->setLine(__LINE__) . " unset the bucket."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "unset(\$bucket" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; } elseif ($item['method'] == 1 && !$export) { // TODO we check if this works well. - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " convert " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert " . $item['name']; 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 { $keyTableNAme = $item['custom']['table']; } - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ", ', ', '" . $keyTableNAme . "', '" . $item['custom']['id'] . "', '" . $item['custom']['text'] . "');"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ", ', ', '" . $keyTableNAme . "', '" . $item['custom']['id'] . "', '" . $item['custom']['text'] . "');"; } else { - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ", ', ', '" . $item['name'] . "');"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ", ', ', '" . $item['name'] . "');"; } } else @@ -11927,45 +11953,61 @@ class Interpretation extends Fields if (!$export) { // For thos we have not cached yet. - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " convert " . $item['name']; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ");"; } } } } } } - - // close the foreach if needed - if (!ComponentbuilderHelper::checkString($fix) && $export) + // set translation (TODO) would be nice to cut down on double loops.. +// if (!$export && isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list])) +// { +// foreach ($this->selectionTranslationFixBuilder[$viewName_list] as $name => $values) +// { +// $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert " . $name; +// $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $name . " = \$this->selectionTranslation(\$item->" . $name . ", '" . $name . "');"; +// } +// } + // load the relations after modeling + if (isset($this->fieldRelations[$viewName_list]) && ComponentbuilderHelper::checkArray($this->fieldRelations[$viewName_list])) { - $fix .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set values to display correctly."; - $fix .= PHP_EOL . "\t" . $tab . "\tif (" . $Component . "Helper::checkArray(\$items))"; - $fix .= PHP_EOL . "\t" . $tab . "\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\tforeach (\$items as \$nr => &\$item)"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t{"; + foreach ($this->fieldRelations[$viewName_list] as $field) + { + if (isset($field['area']) && $field['area'] == 3 && isset($field['code'])) + { + $fix .= $this->setModelFieldRelation($field, $viewName_list); + } + } } // close the foreach if needed if (ComponentbuilderHelper::checkString($fix)) { + // start the loop + $forEachStart = PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set values to display correctly."; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" . $Component . "Helper::checkArray(\$items))"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "foreach (\$items as \$nr => &\$item)"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "{"; // remove these values if export if ($export) { - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " unset the values we don't want exported."; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\tunset(\$item->asset_id);"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\tunset(\$item->checked_out);"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\tunset(\$item->checked_out_time);"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " unset the values we don't want exported."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "unset(\$item->asset_id);"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "unset(\$item->checked_out);"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "unset(\$item->checked_out_time);"; } - $fix .= PHP_EOL . "\t" . $tab . "\t\t}"; - $fix .= PHP_EOL . "\t" . $tab . "\t}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; if ($export) { - $fix .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Add headers to items array."; - $fix .= PHP_EOL . "\t" . $tab . "\t\$headers = \$this->getExImPortHeaders();"; - $fix .= PHP_EOL . "\t" . $tab . "\tif (" . $Component . "Helper::checkObject(\$headers))"; - $fix .= PHP_EOL . "\t" . $tab . "\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\tarray_unshift(\$items,\$headers);"; - $fix .= PHP_EOL . "\t" . $tab . "\t}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Add headers to items array."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$headers = \$this->getExImPortHeaders();"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" . $Component . "Helper::checkObject(\$headers))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "array_unshift(\$items,\$headers);"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; } } @@ -11978,14 +12020,42 @@ class Interpretation extends Fields { if (${$cryptionType . 'Crypt'}) { - $script .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption key."; - $script .= PHP_EOL . "\t" . $tab . "\t\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the encryption object."; - $script .= PHP_EOL . "\t" . $tab . "\t\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + $script .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption key."; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; } } // add the encryption script - return $script . $fix; + return $script . $forEachStart . $fix; + } + + protected function setModelFieldRelation($item, $viewName_list) + { + $fix = ''; + // set fields + $field = array(); + // set list field name + $field['$item->{' . (int) $item['listfield'] . '}'] = '$item->' . $item['code']; + // load joint field names + foreach ($item['joinfields'] as $join) + { + $field['$item->{' . (int) $join . '}'] = '$item->' . $this->listJoinBuilder[$viewName_list][(int) $join]['code']; + } + // set based on join_type + if ($item['join_type'] == 2) + { + // code + $code = (array) explode(PHP_EOL, str_replace(array_keys($field), array_values($field), $item['set'])); + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . implode(PHP_EOL . $this->_t(1) . $tab . $this->_t(3), $code); + } + else + { + // concatenate + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " concatenate these fields"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $item['code'] . ' = ' . implode(" . '" . str_replace("'", ''', $item['set']) . "' . ", $field) . ';'; + } + return $fix; } public function setSelectionTranslationFix($views, $Component, $tab = '') @@ -11994,18 +12064,18 @@ class Interpretation extends Fields $fix = ''; if (isset($this->selectionTranslationFixBuilder[$views]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$views])) { - $fix .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set selection value to a translatable value"; - $fix .= PHP_EOL . "\t" . $tab . "\tif (" . $Component . "Helper::checkArray(\$items))"; - $fix .= PHP_EOL . "\t" . $tab . "\t{"; - $fix .= PHP_EOL . "\t" . $tab . "\t\tforeach (\$items as \$nr => &\$item)"; - $fix .= PHP_EOL . "\t" . $tab . "\t\t{"; + $fix .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set selection value to a translatable value"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" . $Component . "Helper::checkArray(\$items))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "foreach (\$items as \$nr => &\$item)"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "{"; foreach ($this->selectionTranslationFixBuilder[$views] as $name => $values) { - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " convert " . $name; - $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$item->" . $name . " = \$this->selectionTranslation(\$item->" . $name . ", '" . $name . "');"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert " . $name; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $name . " = \$this->selectionTranslation(\$item->" . $name . ", '" . $name . "');"; } - $fix .= PHP_EOL . "\t" . $tab . "\t\t}"; - $fix .= PHP_EOL . "\t" . $tab . "\t}" . PHP_EOL; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}" . PHP_EOL; } return $fix; } @@ -12016,21 +12086,21 @@ class Interpretation extends Fields $fix = ''; if (isset($this->selectionTranslationFixBuilder[$views]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$views])) { - $fix .= PHP_EOL . PHP_EOL . "\t/**"; - $fix .= PHP_EOL . "\t* Method to convert selection values to translatable string."; - $fix .= PHP_EOL . "\t*"; - $fix .= PHP_EOL . "\t* @return translatable string"; - $fix .= PHP_EOL . "\t*/"; - $fix .= PHP_EOL . "\tpublic function selectionTranslation(\$value,\$name)"; - $fix .= PHP_EOL . "\t{"; + $fix .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; + $fix .= PHP_EOL . $this->_t(1) . " * Method to convert selection values to translatable string."; + $fix .= PHP_EOL . $this->_t(1) . " *"; + $fix .= PHP_EOL . $this->_t(1) . " * @return translatable string"; + $fix .= PHP_EOL . $this->_t(1) . " */"; + $fix .= PHP_EOL . $this->_t(1) . "public function selectionTranslation(\$value,\$name)"; + $fix .= PHP_EOL . $this->_t(1) . "{"; foreach ($this->selectionTranslationFixBuilder[$views] as $name => $values) { if (ComponentbuilderHelper::checkArray($values)) { - $fix .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Array of " . $name . " language strings"; - $fix .= PHP_EOL . "\t\tif (\$name === '" . $name . "')"; - $fix .= PHP_EOL . "\t\t{"; - $fix .= PHP_EOL . "\t\t\t\$" . $name . "Array = array("; + $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Array of " . $name . " language strings"; + $fix .= PHP_EOL . $this->_t(2) . "if (\$name === '" . $name . "')"; + $fix .= PHP_EOL . $this->_t(2) . "{"; + $fix .= PHP_EOL . $this->_t(3) . "\$" . $name . "Array = array("; $counter = 0; foreach ($values as $value => $translang) { @@ -12049,25 +12119,25 @@ class Interpretation extends Fields } if ($counter == 0) { - $fix .= PHP_EOL . "\t\t\t\t" . $key . " => '" . $translang . "'"; + $fix .= PHP_EOL . $this->_t(4) . $key . " => '" . $translang . "'"; } else { - $fix .= "," . PHP_EOL . "\t\t\t\t" . $key . " => '" . $translang . "'"; + $fix .= "," . PHP_EOL . $this->_t(4) . $key . " => '" . $translang . "'"; } $counter++; } - $fix .= PHP_EOL . "\t\t\t);"; - $fix .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Now check if value is found in this array"; - $fix .= PHP_EOL . "\t\t\tif (isset(\$" . $name . "Array[\$value]) && " . $Component . "Helper::checkString(\$" . $name . "Array[\$value]))"; - $fix .= PHP_EOL . "\t\t\t{"; - $fix .= PHP_EOL . "\t\t\t\treturn \$" . $name . "Array[\$value];"; - $fix .= PHP_EOL . "\t\t\t}"; - $fix .= PHP_EOL . "\t\t}"; + $fix .= PHP_EOL . $this->_t(3) . ");"; + $fix .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Now check if value is found in this array"; + $fix .= PHP_EOL . $this->_t(3) . "if (isset(\$" . $name . "Array[\$value]) && " . $Component . "Helper::checkString(\$" . $name . "Array[\$value]))"; + $fix .= PHP_EOL . $this->_t(3) . "{"; + $fix .= PHP_EOL . $this->_t(4) . "return \$" . $name . "Array[\$value];"; + $fix .= PHP_EOL . $this->_t(3) . "}"; + $fix .= PHP_EOL . $this->_t(2) . "}"; } } - $fix .= PHP_EOL . "\t\treturn \$value;"; - $fix .= PHP_EOL . "\t}"; + $fix .= PHP_EOL . $this->_t(2) . "return \$value;"; + $fix .= PHP_EOL . $this->_t(1) . "}"; } return $fix; } @@ -12076,11 +12146,11 @@ class Interpretation extends Fields { if (strlen($viewName) > 0) { - $router = PHP_EOL . "\t\tcase '" . $viewName . "':"; - $router .= PHP_EOL . "\t\t\t\$id = explode(':', \$segments[$count-1]);"; - $router .= PHP_EOL . "\t\t\t\$vars['id'] = (int) \$id[0];"; - $router .= PHP_EOL . "\t\t\t\$vars['view'] = '" . $viewName . "';"; - $router .= PHP_EOL . "\t\tbreak;"; + $router = PHP_EOL . $this->_t(2) . "case '" . $viewName . "':"; + $router .= PHP_EOL . $this->_t(3) . "\$id = explode(':', \$segments[$count-1]);"; + $router .= PHP_EOL . $this->_t(3) . "\$vars['id'] = (int) \$id[0];"; + $router .= PHP_EOL . $this->_t(3) . "\$vars['view'] = '" . $viewName . "';"; + $router .= PHP_EOL . $this->_t(2) . "break;"; return $router; } @@ -12109,7 +12179,7 @@ class Interpretation extends Fields if (isset($this->permissionDashboard) && ComponentbuilderHelper::checkArray($this->permissionDashboard)) { $this->permissionDashboard = array_unique($this->permissionDashboard); - return PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " view access array" . PHP_EOL . "\t\t\$viewAccess = array(" . PHP_EOL . "\t\t\t" . implode("," . PHP_EOL . "\t\t\t", $this->permissionDashboard) . ");"; + return PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " view access array" . PHP_EOL . $this->_t(2) . "\$viewAccess = array(" . PHP_EOL . $this->_t(3) . implode("," . PHP_EOL . $this->_t(3), $this->permissionDashboard) . ");"; } return ''; } @@ -12299,7 +12369,7 @@ class Interpretation extends Fields $gets[] = "\$this->" . $string . " = \$this->get('" . $get . "');"; } // return the gets - return PHP_EOL . "\t\t" . implode(PHP_EOL . "\t\t", $gets); + return PHP_EOL . $this->_t(2) . implode(PHP_EOL . $this->_t(2), $gets); } return ''; } @@ -12310,7 +12380,7 @@ class Interpretation extends Fields $display = array(); $mainAccordianName = 'cPanel'; $builder = array(); - $tab = "\t"; + $tab = $this->_t(1); $loadTabs = false; // check if we have custom tabs if (isset($this->componentData->dashboard_tab) && ComponentbuilderHelper::checkArray($this->componentData->dashboard_tab)) @@ -12322,12 +12392,12 @@ class Interpretation extends Fields } // since we have custom tabs we must load the tab structure around the cpanel $display[] = '
    '; - $display[] = "\t" . '
    '; - $display[] = "\t 'cpanel')); ?>"; - $display[] = PHP_EOL . "\t\t"; - $display[] = "\t\t" . '
    '; + $display[] = $this->_t(1) . '
    '; + $display[] = $this->_t(1) . " 'cpanel')); ?>"; + $display[] = PHP_EOL . $this->_t(2) . ""; + $display[] = $this->_t(2) . '
    '; // set the tab to insure correct spacing - $tab = "\t\t\t"; + $tab = $this->_t(3); // change the name of the main tab $mainAccordianName = 'Control Panel'; $loadTabs = true; @@ -12338,60 +12408,60 @@ class Interpretation extends Fields } // set dashboard display $display[] = $tab . '
    '; - $display[] = $tab . "\t 'main')); ?>"; - $display[] = $tab . "\t\t"; - $display[] = $tab . "\t\t\tloadTemplate('main');?>"; - $display[] = $tab . "\t\t"; - $display[] = $tab . "\t"; + $display[] = $tab . $this->_t(1) . " 'main')); ?>"; + $display[] = $tab . $this->_t(2) . ""; + $display[] = $tab . $this->_t(3) . "loadTemplate('main');?>"; + $display[] = $tab . $this->_t(2) . ""; + $display[] = $tab . $this->_t(1) . ""; $display[] = $tab . "
    "; $display[] = $tab . '
    '; - $display[] = $tab . "\t 'vdm')); ?>"; - $display[] = $tab . "\t\tfileContentStatic['###COMPANYNAME###'] . "', 'vdm'); ?>"; - $display[] = $tab . "\t\t\tloadTemplate('vdm');?>"; - $display[] = $tab . "\t\t"; - $display[] = $tab . "\t"; + $display[] = $tab . $this->_t(1) . " 'vdm')); ?>"; + $display[] = $tab . $this->_t(2) . "fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] . "', 'vdm'); ?>"; + $display[] = $tab . $this->_t(3) . "loadTemplate('vdm');?>"; + $display[] = $tab . $this->_t(2) . ""; + $display[] = $tab . $this->_t(1) . ""; $display[] = $tab . "
    "; if ($loadTabs) { - $display[] = "\t\t
    "; - $display[] = "\t\t"; + $display[] = $this->_t(2) . "
    "; + $display[] = $this->_t(2) . ""; // load the new tabs foreach ($builder as $tabname => $accordians) { $alias = ComponentbuilderHelper::safeString($tabname); - $display[] = PHP_EOL . "\t\t"; - $display[] = "\t\t" . '
    '; + $display[] = PHP_EOL . $this->_t(2) . ""; + $display[] = $this->_t(2) . '
    '; $display[] = $tab . '
    '; - $display[] = $tab . "\t '" . $alias . "_one')); ?>"; + $display[] = $tab . $this->_t(1) . " '" . $alias . "_one')); ?>"; $slidecounter = 1; foreach ($accordians as $accordianname => $html) { $ac_alias = ComponentbuilderHelper::safeString($accordianname); $counterName = ComponentbuilderHelper::safeString($slidecounter); $tempName = $alias . '_' . $ac_alias; - $display[] = $tab . "\t\t"; - $display[] = $tab . "\t\t\tloadTemplate('" . $tempName . "');?>"; - $display[] = $tab . "\t\t"; + $display[] = $tab . $this->_t(2) . ""; + $display[] = $tab . $this->_t(3) . "loadTemplate('" . $tempName . "');?>"; + $display[] = $tab . $this->_t(2) . ""; $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 . $this->_t(1) . ""; $display[] = $tab . "
    "; - $display[] = "\t\t
    "; - $display[] = "\t\t"; + $display[] = $this->_t(2) . "
    "; + $display[] = $this->_t(2) . ""; } - $display[] = PHP_EOL . "\t"; - $display[] = "\t
    "; + $display[] = PHP_EOL . $this->_t(1) . ""; + $display[] = $this->_t(1) . "
    "; } $display[] = "
    "; // return the display @@ -12583,14 +12653,14 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) { - $menus .= PHP_EOL . "\t\tif (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; - $menus .= PHP_EOL . "\t\t{"; + $menus .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $menus .= PHP_EOL . $this->_t(2) . "{"; // add tab to lines to follow - $tab = "\t"; + $tab = $this->_t(1); } $nameList = ComponentbuilderHelper::safeString($view['settings']->name_list); $nameUpper = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U'); - $menus .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; + $menus .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; $this->langContent[$this->lang][$lang . "_" . $nameUpper] = $view['settings']->name_list; // check if category has another name if (isset($this->catOtherName[$nameList]) && ComponentbuilderHelper::checkArray($this->catOtherName[$nameList])) @@ -12603,14 +12673,14 @@ class Interpretation extends Fields } if (isset($this->categoryBuilder[$nameList]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$nameList]) && !in_array($otherViews, $catArray)) { - $menus .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $this->categoryBuilder[$nameList]['name'] . "'), 'index.php?option=com_categories&view=categories&extension=com_" . $codeName . "." . $otherViews . "', \$submenu === 'categories." . $otherViews . "');"; + $menus .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $this->categoryBuilder[$nameList]['name'] . "'), 'index.php?option=com_categories&view=categories&extension=com_" . $codeName . "." . $otherViews . "', \$submenu === 'categories." . $otherViews . "');"; // make sure we add a category only once $catArray[] = $otherViews; } // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) { - $menus .= PHP_EOL . "\t\t}"; + $menus .= PHP_EOL . $this->_t(2) . "}"; } } } @@ -12690,35 +12760,35 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) { - $custom .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access control (" . $core['core.access'] . " && " . $nameSingle . ".submenu)."; - $custom .= PHP_EOL . "\t\tif (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; - $custom .= PHP_EOL . "\t\t{"; + $custom .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access control (" . $core['core.access'] . " && " . $nameSingle . ".submenu)."; + $custom .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $custom .= PHP_EOL . $this->_t(2) . "{"; // add tab to lines to follow - $tab = "\t"; + $tab = $this->_t(1); } else { - $custom .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access control (" . $nameSingle . ".submenu)."; - $custom .= PHP_EOL . "\t\tif (\$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; - $custom .= PHP_EOL . "\t\t{"; + $custom .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access control (" . $nameSingle . ".submenu)."; + $custom .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $custom .= PHP_EOL . $this->_t(2) . "{"; // add tab to lines to follow - $tab = "\t"; + $tab = $this->_t(1); } if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) { $this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name; // add custom menu - $custom .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');"; + $custom .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');"; } else { $this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name; // add custom menu - $custom .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; + $custom .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; } // check if the item has permissions. - $custom .= PHP_EOL . "\t\t}"; + $custom .= PHP_EOL . $this->_t(2) . "}"; return $custom; } @@ -12737,32 +12807,32 @@ class Interpretation extends Fields // check if the item has permissions. if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) { - $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\tif (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; - $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t{"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "{"; // add tab to lines to follow - $tab = "\t"; + $tab = $this->_t(1); } else { - $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\tif (\$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; - $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t{"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "{"; // add tab to lines to follow - $tab = "\t"; + $tab = $this->_t(1); } if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) { $this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name; // add custom menu - $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');"; } else { $this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name; // add custom menu - $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; } // check if the item has permissions. - $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t}"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "}"; } return false; } @@ -12795,7 +12865,7 @@ class Interpretation extends Fields { $nameList = ComponentbuilderHelper::safeString($view['settings']->name_list); $nameUpper = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U'); - $menus .= PHP_EOL . "\t\t\t" . '' . $lang . '_' . $nameUpper . ''; + $menus .= PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; $this->langContent['adminsys'][$lang . '_' . $nameUpper] = $view['settings']->name_list; } } @@ -12826,13 +12896,13 @@ class Interpretation extends Fields { $this->langContent['adminsys'][$lang . '_' . $menu['settings']->CODE] = $menu['settings']->name; // add custom menu - $customMenu .= PHP_EOL . "\t\t\t" . '' . $lang . '_' . $menu['settings']->CODE . ''; + $customMenu .= PHP_EOL . $this->_t(3) . '' . $lang . '_' . $menu['settings']->CODE . ''; } elseif (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 && empty($menu['before'])) { $this->langContent['adminsys'][$lang . '_' . $menu['settings']->CODE] = $menu['settings']->name; // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL . "\t\t\t" . '' . $lang . '_' . $menu['settings']->CODE . ''; + $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) . '' . $lang . '_' . $menu['settings']->CODE . ''; } } } @@ -12865,7 +12935,7 @@ class Interpretation extends Fields // urlencode $menu['link'] = htmlspecialchars($menu['link'], ENT_XML1, 'UTF-8'); // add custom menu - $customMenu .= PHP_EOL . "\t\t\t" . '' . $lang . '_' . $nameUpper . ''; + $customMenu .= PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; } else { @@ -12873,7 +12943,7 @@ class Interpretation extends Fields $nameUpper = ComponentbuilderHelper::safeString($menu['name_code'], 'U'); $this->langContent['adminsys'][$lang . '_' . $nameUpper] = $menu['name']; // add custom menu - $customMenu .= PHP_EOL . "\t\t\t" . '' . $lang . '_' . $nameUpper . ''; + $customMenu .= PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; } } elseif (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 && empty($menu['before'])) @@ -12898,7 +12968,7 @@ class Interpretation extends Fields // urlencode $menu['link'] = htmlspecialchars($menu['link'], ENT_XML1, 'UTF-8'); // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL . "\t\t\t" . '' . $lang . '_' . $nameUpper . ''; + $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; } else { @@ -12906,7 +12976,7 @@ class Interpretation extends Fields $nameUpper = ComponentbuilderHelper::safeString($menu['name_code'], 'U'); $this->langContent['adminsys'][$lang . '_' . $nameUpper] = $menu['name']; // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL . "\t\t\t" . '' . $lang . '_' . $nameUpper . ''; + $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; } } } @@ -12931,9 +13001,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 @@ -12953,7 +13023,7 @@ class Interpretation extends Fields if (isset($newxmlField->fieldXML)) { $xmlField = dom_import_simplexml($newxmlField->fieldXML); - $xmlField = PHP_EOL . "\t' . PHP_EOL . "\t" . $this->xmlPrettyPrint($xmlField, 'field'); + $xmlField = PHP_EOL . $this->_t(1) . "' . PHP_EOL . $this->_t(1) . $this->xmlPrettyPrint($xmlField, 'field'); } } // make sure the xml is set and a string @@ -13144,13 +13214,13 @@ class Interpretation extends Fields // setup lang $this->langContent[$this->lang][$lang . '_' . $tabUpper] = $tab; // start field set - $this->configFieldSets[] = "\tconfigFieldSets[] = "\t\t" . 'name="' . $tabCode . '"'; - $this->configFieldSets[] = "\t\t" . 'label="' . $lang . '_' . $tabUpper . '">'; + $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . 'name="' . $tabCode . '"'; + $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_' . $tabUpper . '">'; // set the fields $this->configFieldSets[] = implode("", $bucket); // close field set - $this->configFieldSets[] = "\t"; + $this->configFieldSets[] = $this->_t(1) . ""; } // remove after loading unset($this->configFieldSetsCustomField[$tab]); @@ -13164,10 +13234,10 @@ class Interpretation extends Fields if (isset($this->setGroupControl) && ComponentbuilderHelper::checkArray($this->setGroupControl)) { // start building field set for config - $this->configFieldSets[] = "\tconfigFieldSets[] = "\t\t" . 'name="group_config"'; - $this->configFieldSets[] = "\t\t" . 'label="' . $lang . '_GROUPS_LABEL"'; - $this->configFieldSets[] = "\t\t" . 'description="' . $lang . '_GROUPS_DESC">'; + $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . 'name="group_config"'; + $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_GROUPS_LABEL"'; + $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang . '_GROUPS_DESC">'; // setup lang $this->langContent[$this->lang][$lang . '_GROUPS_LABEL'] = "Target Groups"; $this->langContent[$this->lang][$lang . '_GROUPS_DESC'] = "The Parameters for the targeted groups are set here."; @@ -13175,12 +13245,12 @@ class Interpretation extends Fields foreach ($this->setGroupControl as $selector => $label) { - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="usergroup"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $label . '"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_TARGET_GROUP_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'multiple="true"'; - $this->configFieldSets[] = "\t\t/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="usergroup"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $label . '"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_TARGET_GROUP_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'multiple="true"'; + $this->configFieldSets[] = $this->_t(2) . "/>"; // set params defaults $this->extensionsParams[] = '"' . $selector . '":["2"]'; } @@ -13191,7 +13261,7 @@ class Interpretation extends Fields unset($this->configFieldSetsCustomField['Target Groups']); } // close that fieldse - $this->configFieldSets[] = "\t"; + $this->configFieldSets[] = $this->_t(1) . ""; } } @@ -13207,11 +13277,11 @@ class Interpretation extends Fields // start building field set for config $this->configFieldSets[] = 'configFieldSets[] = "\t\t" . 'addrulepath="/administrator/components/com_' . $component . '/models/rules"'; - $this->configFieldSets[] = "\t\t" . 'addfieldpath="/administrator/components/com_' . $component . '/models/fields"'; - $this->configFieldSets[] = "\t\t" . 'name="global_config"'; - $this->configFieldSets[] = "\t\t" . 'label="' . $lang . '_GLOBAL_LABEL"'; - $this->configFieldSets[] = "\t\t" . 'description="' . $lang . '_GLOBAL_DESC">'; + $this->configFieldSets[] = $this->_t(2) . 'addrulepath="/administrator/components/com_' . $component . '/models/rules"'; + $this->configFieldSets[] = $this->_t(2) . 'addfieldpath="/administrator/components/com_' . $component . '/models/fields"'; + $this->configFieldSets[] = $this->_t(2) . 'name="global_config"'; + $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_GLOBAL_LABEL"'; + $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang . '_GLOBAL_DESC">'; // set application update License Key if ($this->componentData->add_license && 1 != $this->componentData->license_type) { @@ -13223,28 +13293,28 @@ class Interpretation extends Fields $this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_LABEL'] = "Your License Key"; $this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_DESC'] = "To get updates you must add the license key here that you recieved from " . $this->componentData->companyname; // set the field - $this->configFieldSets[] = "\t\t" . ''; + $this->configFieldSets[] = $this->_t(2) . ''; break; case 3: // with vdm to lock down ownership $this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_LABEL'] = "Your License Key"; $this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_DESC'] = "To use this component you must add the license key here that you recieved from " . $this->componentData->companyname; // set the field - $this->configFieldSets[] = "\t\t" . ''; + $this->configFieldSets[] = $this->_t(2) . ''; break; } // setup lang $this->langContent[$this->lang][$lang . '_LICENSE_KEY_LABEL'] = "License Key"; $this->langContent[$this->lang][$lang . '_LICENSE_KEY_DESC'] = "Add your license key here."; // add the field - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_LICENSE_KEY_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_LICENSE_KEY_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default=""'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . ''; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_LICENSE_KEY_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_LICENSE_KEY_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default=""'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ''; } // setup lang $this->langContent[$this->lang][$lang . '_GLOBAL_LABEL'] = "Global"; @@ -13252,26 +13322,26 @@ class Interpretation extends Fields // add auto checin if required if ($this->addCheckin) { - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\t" . 'name="check_in"'; - $this->configFieldSets[] = "\t\t\t" . 'type="list"'; - $this->configFieldSets[] = "\t\t\t" . 'default="0"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_CHECK_TIMER_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_CHECK_TIMER_DESC">'; - $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="-5 hours">' . $lang . '_CHECK_TIMER_OPTION_ONE'; - $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="-12 hours">' . $lang . '_CHECK_TIMER_OPTION_TWO'; - $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="-1 day">' . $lang . '_CHECK_TIMER_OPTION_THREE'; - $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="-2 day">' . $lang . '_CHECK_TIMER_OPTION_FOUR'; - $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="-1 week">' . $lang . '_CHECK_TIMER_OPTION_FIVE'; - $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="0">' . $lang . '_CHECK_TIMER_OPTION_SIX'; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t" . ''; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . 'name="check_in"'; + $this->configFieldSets[] = $this->_t(3) . 'type="list"'; + $this->configFieldSets[] = $this->_t(3) . 'default="0"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_CHECK_TIMER_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_CHECK_TIMER_DESC">'; + $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-5 hours">' . $lang . '_CHECK_TIMER_OPTION_ONE'; + $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-12 hours">' . $lang . '_CHECK_TIMER_OPTION_TWO'; + $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-1 day">' . $lang . '_CHECK_TIMER_OPTION_THREE'; + $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-2 day">' . $lang . '_CHECK_TIMER_OPTION_FOUR'; + $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-1 week">' . $lang . '_CHECK_TIMER_OPTION_FIVE'; + $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="0">' . $lang . '_CHECK_TIMER_OPTION_SIX'; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ''; // setup lang $this->langContent[$this->lang][$lang . '_CHECK_TIMER_LABEL'] = "Check in timer"; $this->langContent[$this->lang][$lang . '_CHECK_TIMER_DESC'] = "Set the intervals for the auto checkin fuction of tables that checks out the items to an user."; @@ -13287,26 +13357,26 @@ class Interpretation extends Fields // set history control if ($this->setTagHistory) { - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\t" . 'name="save_history"'; - $this->configFieldSets[] = "\t\t\t" . 'type="radio"'; - $this->configFieldSets[] = "\t\t\t" . 'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = "\t\t\t" . 'default="1"'; - $this->configFieldSets[] = "\t\t\t" . 'label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"'; - $this->configFieldSets[] = "\t\t\t>"; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\t" . 'name="history_limit"'; - $this->configFieldSets[] = "\t\t\t" . 'type="text"'; - $this->configFieldSets[] = "\t\t\t" . 'filter="integer"'; - $this->configFieldSets[] = "\t\t\t" . 'label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'default="10"'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . ''; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . 'name="save_history"'; + $this->configFieldSets[] = $this->_t(3) . 'type="radio"'; + $this->configFieldSets[] = $this->_t(3) . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = $this->_t(3) . 'default="1"'; + $this->configFieldSets[] = $this->_t(3) . 'label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"'; + $this->configFieldSets[] = $this->_t(3) . ">"; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . 'name="history_limit"'; + $this->configFieldSets[] = $this->_t(3) . 'type="text"'; + $this->configFieldSets[] = $this->_t(3) . 'filter="integer"'; + $this->configFieldSets[] = $this->_t(3) . 'label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'default="10"'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ''; // load the Global checkin defautls $this->extensionsParams[] = '"save_history":"1","history_limit":"10"'; } @@ -13317,28 +13387,28 @@ class Interpretation extends Fields unset($this->configFieldSetsCustomField['Global']); } // set the author details - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="spacer"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_AUTHOR"'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_AUTHOR_NAME_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_AUTHOR_NAME_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default="' . $autorName . '"'; - $this->configFieldSets[] = "\t\t\t" . 'readonly="true"'; - $this->configFieldSets[] = "\t\t\t" . 'class="readonly"'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="email"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_AUTHOR_EMAIL_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_AUTHOR_EMAIL_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default="' . $autorEmail . '"'; - $this->configFieldSets[] = "\t\t\t" . 'readonly="true"'; - $this->configFieldSets[] = "\t\t\t" . 'class="readonly"'; - $this->configFieldSets[] = "\t\t/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="spacer"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_AUTHOR"'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_AUTHOR_NAME_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_AUTHOR_NAME_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . $autorName . '"'; + $this->configFieldSets[] = $this->_t(3) . 'readonly="true"'; + $this->configFieldSets[] = $this->_t(3) . 'class="readonly"'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="email"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_AUTHOR_EMAIL_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_AUTHOR_EMAIL_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . $autorEmail . '"'; + $this->configFieldSets[] = $this->_t(3) . 'readonly="true"'; + $this->configFieldSets[] = $this->_t(3) . 'class="readonly"'; + $this->configFieldSets[] = $this->_t(2) . "/>"; // setup lang $this->langContent[$this->lang][$lang . '_AUTHOR'] = "Author Info"; $this->langContent[$this->lang][$lang . '_AUTHOR_NAME_LABEL'] = "Author Name"; @@ -13361,61 +13431,61 @@ class Interpretation extends Fields $cbEmail = htmlspecialchars($contributor['email'], ENT_XML1, 'UTF-8'); $cbWebsite = htmlspecialchars($contributor['website'], ENT_XML1, 'UTF-8'); // ComponentbuilderHelper::htmlEscape($contributor['website']); // load to the $fieldsets - $this->configFieldSets[] = "\t\t" . ''; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="spacer"'; - $this->configFieldSets[] = "\t\t\t" . 'class="text"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_' . $COUNTER . '"'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_TITLE_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_TITLE_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default="' . $cbTitle . '"'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_NAME_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_NAME_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default="' . $cbName . '"'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="email"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_EMAIL_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_EMAIL_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default="' . $cbEmail . '"'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="url"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_LINK_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_LINK_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default="' . $cbWebsite . '"'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="list"'; - $this->configFieldSets[] = "\t\t\t" . 'default="' . (int) $contributor['use'] . '"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_USE_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_USE_DESC">'; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="list"'; - $this->configFieldSets[] = "\t\t\t" . 'default="' . (int) $contributor['show'] . '"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_SHOW_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_SHOW_DESC">'; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = $this->_t(2) . ''; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="spacer"'; + $this->configFieldSets[] = $this->_t(3) . 'class="text"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_' . $COUNTER . '"'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_TITLE_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_TITLE_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbTitle . '"'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_NAME_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_NAME_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbName . '"'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="email"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_EMAIL_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_EMAIL_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbEmail . '"'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="url"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_LINK_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_LINK_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbWebsite . '"'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="list"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . (int) $contributor['use'] . '"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_USE_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_USE_DESC">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="list"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . (int) $contributor['show'] . '"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_SHOW_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_SHOW_DESC">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(2) . ""; // add the contributor - $this->theContributors .= PHP_EOL . "\t@" . strtolower($contributor['title']) . "\t\t" . $contributor['name'] . ' <' . $contributor['website'] . '>'; + $this->theContributors .= PHP_EOL . $this->_t(1) . "@" . strtolower($contributor['title']) . $this->_t(2) . $contributor['name'] . ' <' . $contributor['website'] . '>'; // setup lang $Counter = ComponentbuilderHelper::safeString($counter, 'Ww'); $this->langContent[$this->lang][$langCont . '_' . $COUNTER] = "Contributor " . $Counter; @@ -13446,59 +13516,59 @@ class Interpretation extends Fields { $COUNTER = ComponentbuilderHelper::safeString($counter, 'U'); - $this->configFieldSets[] = "\t\t" . ''; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="spacer"'; - $this->configFieldSets[] = "\t\t\t" . 'class="text"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_' . $COUNTER . '"'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_TITLE_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_TITLE_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default=""'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_NAME_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_NAME_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default=""'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="email"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_EMAIL_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_EMAIL_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default=""'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="url"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_LINK_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_LINK_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default=""'; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="list"'; - $this->configFieldSets[] = "\t\t\t" . 'default="0"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_USE_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_USE_DESC">'; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="list"'; - $this->configFieldSets[] = "\t\t\t" . 'default="0"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_SHOW_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_SHOW_DESC">'; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = $this->_t(2) . ''; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="spacer"'; + $this->configFieldSets[] = $this->_t(3) . 'class="text"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_' . $COUNTER . '"'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_TITLE_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_TITLE_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default=""'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_NAME_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_NAME_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default=""'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="email"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_EMAIL_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_EMAIL_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default=""'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="url"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_LINK_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_LINK_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default=""'; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="list"'; + $this->configFieldSets[] = $this->_t(3) . 'default="0"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_USE_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_USE_DESC">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="list"'; + $this->configFieldSets[] = $this->_t(3) . 'default="0"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_SHOW_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_SHOW_DESC">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(2) . ""; // setup lang $Counter = ComponentbuilderHelper::safeString($counter, 'Ww'); $this->langContent[$this->lang][$langCont . '_' . $COUNTER] = "Contributor " . $Counter; @@ -13528,7 +13598,7 @@ class Interpretation extends Fields $this->langContent[$this->lang][$langCont . '_SHOW_ALL'] = "Both Front & Back-end"; } // close that fieldset - $this->configFieldSets[] = "\t"; + $this->configFieldSets[] = $this->_t(1) . ""; } public function setUikitConfigFieldsets($lang) @@ -13538,10 +13608,10 @@ class Interpretation extends Fields // main lang prefix $lang = $lang . ''; // start building field set for uikit functions - $this->configFieldSets[] = "\tconfigFieldSets[] = "\t\t" . 'name="uikit_config"'; - $this->configFieldSets[] = "\t\t" . 'label="' . $lang . '_UIKIT_LABEL"'; - $this->configFieldSets[] = "\t\t" . 'description="' . $lang . '_UIKIT_DESC">'; + $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . 'name="uikit_config"'; + $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_UIKIT_LABEL"'; + $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang . '_UIKIT_DESC">'; // set tab lang if (1 == $this->uikit) { @@ -13571,18 +13641,18 @@ for developing fast and powerful web interfaces. For more info visit langContent[$this->lang][$lang . '_UIKIT_V2'] = "Version 2"; $this->langContent[$this->lang][$lang . '_UIKIT_V3'] = "Version 3"; // set the field - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="radio"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_UIKIT_VERSION_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_UIKIT_VERSION_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = "\t\t\t" . 'default="2">'; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . '"'; - $this->configFieldSets[] = "\t\t\t" . '"'; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="radio"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_UIKIT_VERSION_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_UIKIT_VERSION_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = $this->_t(3) . 'default="2">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(2) . ""; // set params defaults $this->extensionsParams[] = '"uikit_version":"2"'; } @@ -13595,25 +13665,25 @@ for developing fast and powerful web interfaces. For more info visit langContent[$this->lang][$lang . '_DONT_LOAD'] = "Not"; $this->langContent[$this->lang][$lang . '_ONLY_EXTRA'] = "Only Extra"; // set the field - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="radio"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_UIKIT_LOAD_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_UIKIT_LOAD_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = "\t\t\t" . 'default="">'; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . '"'; - $this->configFieldSets[] = "\t\t\t" . '"'; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="radio"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_UIKIT_LOAD_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_UIKIT_LOAD_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = $this->_t(3) . 'default="">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(3) . '"'; if (2 == $this->uikit || 1 == $this->uikit) { - $this->configFieldSets[] = "\t\t\t" . '"'; + $this->configFieldSets[] = $this->_t(3) . '"'; } - $this->configFieldSets[] = "\t\t\t" . '"'; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(2) . ""; // set params defaults $this->extensionsParams[] = '"uikit_load":"1"'; @@ -13623,18 +13693,18 @@ for developing fast and powerful web interfaces. For more info visit langContent[$this->lang][$lang . '_YES'] = "Yes"; $this->langContent[$this->lang][$lang . '_NO'] = "No"; // set the field - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="radio"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_UIKIT_MIN_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_UIKIT_MIN_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = "\t\t\t" . 'default="">'; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . '"'; - $this->configFieldSets[] = "\t\t\t" . '"'; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="radio"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_UIKIT_MIN_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_UIKIT_MIN_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = $this->_t(3) . 'default="">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(2) . ""; // set params defaults $this->extensionsParams[] = '"uikit_min":""'; @@ -13647,24 +13717,24 @@ for developing fast and powerful web interfaces. For more info visit langContent[$this->lang][$lang . '_ALMOST_FLAT_LOAD'] = "Almost Flat"; $this->langContent[$this->lang][$lang . '_GRADIANT_LOAD'] = "Gradient"; // set the field - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="radio"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_UIKIT_STYLE_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_UIKIT_STYLE_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="radio"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_UIKIT_STYLE_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_UIKIT_STYLE_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'class="btn-group btn-group-yesno"'; if (2 == $this->uikit) { - $this->configFieldSets[] = "\t\t\t" . 'showon="uikit_version:2"'; + $this->configFieldSets[] = $this->_t(3) . 'showon="uikit_version:2"'; } - $this->configFieldSets[] = "\t\t\t" . 'default="">'; - $this->configFieldSets[] = "\t\t\t" . ''; - $this->configFieldSets[] = "\t\t\t" . '"'; - $this->configFieldSets[] = "\t\t\t" . '"'; - $this->configFieldSets[] = "\t\t\t" . '"'; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = $this->_t(3) . 'default="">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(2) . ""; // set params defaults $this->extensionsParams[] = '"uikit_style":""'; } @@ -13675,7 +13745,7 @@ for developing fast and powerful web interfaces. For more info visit configFieldSetsCustomField['Uikit Settings']); } // close that fieldset - $this->configFieldSets[] = "\t"; + $this->configFieldSets[] = $this->_t(1) . ""; } } @@ -13689,9 +13759,9 @@ for developing fast and powerful web interfaces. For more info visit langContent[$this->lang][$lang . '_MAIL_CONFIGURATION'] = "Mail Configuration"; $this->langContent[$this->lang][$lang . '_DKIM'] = "DKIM"; // start building field set for email helper functions - $this->configFieldSets[] = PHP_EOL . "\tconfigFieldSets[] = "\t\tname=\"mail_configuration_custom_config\""; - $this->configFieldSets[] = "\t\tlabel=\"" . $lang . "_MAIL_CONFIGURATION\">"; + $this->configFieldSets[] = PHP_EOL . $this->_t(1) . "configFieldSets[] = $this->_t(2) . "name=\"mail_configuration_custom_config\""; + $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang . "_MAIL_CONFIGURATION\">"; // add custom Mail Configurations if (isset($this->configFieldSetsCustomField['Mail Configuration']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Mail Configuration'])) { @@ -13748,212 +13818,212 @@ for developing fast and powerful web interfaces. For more info visit langContent[$this->lang][$lang . '_SMTPHOST_HINT'] = "localhost"; // set the mailer fields - $this->configFieldSets[] = PHP_EOL . "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"radio\""; - $this->configFieldSets[] = "\t\t\tname=\"mailonline\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_MAILONLINE_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_MAILONLINE_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"btn-group btn-group-yesno\""; - $this->configFieldSets[] = "\t\t\tdefault=\"1\">"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"list\""; - $this->configFieldSets[] = "\t\t\tname=\"mailer\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_MAILER_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_MAILER_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"list_class\""; - $this->configFieldSets[] = "\t\t\tmultiple=\"false\""; - $this->configFieldSets[] = "\t\t\tfilter=\"WORD\""; - $this->configFieldSets[] = "\t\t\trequired=\"true\""; - $this->configFieldSets[] = "\t\t\tdefault=\"global\">"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"emailfrom\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_EMAILFROM_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_EMAILFROM_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; - $this->configFieldSets[] = "\t\t\tvalidate=\"email\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add email address here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_EMAILFROM_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp,sendmail,default\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"fromname\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_FROMNAME_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_FROMNAME_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add some name here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_FROMNAME_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp,sendmail,default\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"replyto\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_EMAILREPLY_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_EMAILREPLY_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; - $this->configFieldSets[] = "\t\t\tvalidate=\"email\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add email address here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_EMAILREPLY_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp,sendmail,default\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"replytoname\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_REPLYNAME_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_REPLYNAME_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add some name here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_REPLYNAME_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp,sendmail,default\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"sendmail\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SENDMAIL_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SENDMAIL_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\trequired=\"false\""; - $this->configFieldSets[] = "\t\t\tfilter=\"PATH\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add path to you local sendmail here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_SENDMAIL_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"mailer:sendmail\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"radio\""; - $this->configFieldSets[] = "\t\t\tname=\"smtpauth\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPAUTH_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPAUTH_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"btn-group btn-group-yesno\""; - $this->configFieldSets[] = "\t\t\tdefault=\"0\""; - $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\">"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"list\""; - $this->configFieldSets[] = "\t\t\tname=\"smtpsecure\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPSECURE_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPSECURE_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"list_class\""; - $this->configFieldSets[] = "\t\t\tmultiple=\"false\""; - $this->configFieldSets[] = "\t\t\tfilter=\"WORD\""; - $this->configFieldSets[] = "\t\t\tdefault=\"none\""; - $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\">"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"smtpport\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPPORT_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdefault=\"25\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPPORT_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add the port number of your SMTP server here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_SMTPPORT_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"smtpuser\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPUSER_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPUSER_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add the username for SMTP server here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_SMTPUSER_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"password\""; - $this->configFieldSets[] = "\t\t\tname=\"smtppass\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPPASS_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPPASS_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"raw\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add the password for SMTP server here.\""; - $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"smtphost\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPHOST_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdefault=\"localhost\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPHOST_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add the name of the SMTP host here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_SMTPHOST_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\""; - $this->configFieldSets[] = "\t\t/>"; + $this->configFieldSets[] = PHP_EOL . $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"radio\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"mailonline\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_MAILONLINE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_MAILONLINE_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"btn-group btn-group-yesno\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"1\">"; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"list\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"mailer\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_MAILER_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_MAILER_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"list_class\""; + $this->configFieldSets[] = $this->_t(3) . "multiple=\"false\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"WORD\""; + $this->configFieldSets[] = $this->_t(3) . "required=\"true\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"global\">"; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"emailfrom\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_EMAILFROM_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_EMAILFROM_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; + $this->configFieldSets[] = $this->_t(3) . "validate=\"email\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add email address here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_EMAILFROM_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp,sendmail,default\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"fromname\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_FROMNAME_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_FROMNAME_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add some name here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_FROMNAME_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp,sendmail,default\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"replyto\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_EMAILREPLY_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_EMAILREPLY_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; + $this->configFieldSets[] = $this->_t(3) . "validate=\"email\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add email address here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_EMAILREPLY_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp,sendmail,default\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"replytoname\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_REPLYNAME_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_REPLYNAME_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add some name here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_REPLYNAME_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp,sendmail,default\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"sendmail\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SENDMAIL_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SENDMAIL_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "required=\"false\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"PATH\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add path to you local sendmail here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_SENDMAIL_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:sendmail\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"radio\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"smtpauth\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPAUTH_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPAUTH_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"btn-group btn-group-yesno\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"0\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\">"; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"list\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"smtpsecure\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPSECURE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPSECURE_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"list_class\""; + $this->configFieldSets[] = $this->_t(3) . "multiple=\"false\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"WORD\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"none\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\">"; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"smtpport\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPPORT_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"25\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPPORT_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add the port number of your SMTP server here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_SMTPPORT_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"smtpuser\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPUSER_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPUSER_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add the username for SMTP server here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_SMTPUSER_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"password\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"smtppass\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPPASS_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPPASS_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"raw\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add the password for SMTP server here.\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"smtphost\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPHOST_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"localhost\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPHOST_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add the name of the SMTP host here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_SMTPHOST_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; } // close that fieldset - $this->configFieldSets[] = "\t"; + $this->configFieldSets[] = $this->_t(1) . ""; // start dkim field set - $this->configFieldSets[] = "\tconfigFieldSets[] = "\t\tname=\"dkim_custom_config\""; - $this->configFieldSets[] = "\t\tlabel=\"" . $lang . "_DKIM\">"; + $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . "name=\"dkim_custom_config\""; + $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang . "_DKIM\">"; // add custom DKIM fields if (isset($this->configFieldSetsCustomField['DKIM']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['DKIM'])) { @@ -14017,134 +14087,134 @@ function vdm_dkim() { $this->langContent[$this->lang][$lang . '_DKIM_VALUE_HINT'] = "v=DKIM1;k=rsa;g=*;s=email;h=sha1;t=s;p=PUBLICKEY"; - $this->configFieldSets[] = PHP_EOL . "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"radio\""; - $this->configFieldSets[] = "\t\t\tname=\"dkim\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"btn-group btn-group-yesno\""; - $this->configFieldSets[] = "\t\t\tdefault=\"0\""; - $this->configFieldSets[] = "\t\t\trequired=\"true\">"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"dkim_domain\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_DOMAIN_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_DOMAIN_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add DKIM Domain here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_DKIM_DOMAIN_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; - $this->configFieldSets[] = "\t\t\tonchange=\"vdm_dkim();\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"dkim_selector\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_SELECTOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdefault=\"vdm\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_SELECTOR_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add DKIM/DNS selector here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_DKIM_SELECTOR_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; - $this->configFieldSets[] = "\t\t\tonchange=\"vdm_dkim();\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"password\""; - $this->configFieldSets[] = "\t\t\tname=\"dkim_passphrase\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_PASSPHRASE_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_PASSPHRASE_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"raw\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add passphrase here.\""; - $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"dkim_identity\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_IDENTITY_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_IDENTITY_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"raw\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add DKIM Identity here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_DKIM_IDENTITY_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"textarea\""; - $this->configFieldSets[] = "\t\t\tname=\"dkim_private_key\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_PRIVATE_KEY_LABEL\""; - $this->configFieldSets[] = "\t\t\trows=\"15\""; - $this->configFieldSets[] = "\t\t\tcols=\"5\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_PRIVATE_KEY_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"input-xxlarge span12\""; - $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"textarea\""; - $this->configFieldSets[] = "\t\t\tname=\"dkim_public_key\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_PUBLIC_KEY_LABEL\""; - $this->configFieldSets[] = "\t\t\trows=\"5\""; - $this->configFieldSets[] = "\t\t\tcols=\"5\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_PUBLIC_KEY_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"input-xxlarge span12\""; - $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; - $this->configFieldSets[] = "\t\t\tonchange=\"vdm_dkim();\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"dkim_key\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_KEY_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"40\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_KEY_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add KEY here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_DKIM_KEY_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"dkim_value\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_VALUE_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"80\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"350\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_VALUE_DESCRIPTION\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add TXT record here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_DKIM_VALUE_HINT\""; - $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; - $this->configFieldSets[] = "\t\t/>"; + $this->configFieldSets[] = PHP_EOL . $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"radio\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"dkim\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"btn-group btn-group-yesno\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"0\""; + $this->configFieldSets[] = $this->_t(3) . "required=\"true\">"; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_domain\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_DOMAIN_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_DOMAIN_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add DKIM Domain here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_DKIM_DOMAIN_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = $this->_t(3) . "onchange=\"vdm_dkim();\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_selector\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_SELECTOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"vdm\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_SELECTOR_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add DKIM/DNS selector here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_DKIM_SELECTOR_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = $this->_t(3) . "onchange=\"vdm_dkim();\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"password\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_passphrase\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_PASSPHRASE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_PASSPHRASE_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"raw\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add passphrase here.\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_identity\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_IDENTITY_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_IDENTITY_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"raw\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add DKIM Identity here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_DKIM_IDENTITY_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"textarea\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_private_key\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_PRIVATE_KEY_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "rows=\"15\""; + $this->configFieldSets[] = $this->_t(3) . "cols=\"5\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_PRIVATE_KEY_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"input-xxlarge span12\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"textarea\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_public_key\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_PUBLIC_KEY_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "rows=\"5\""; + $this->configFieldSets[] = $this->_t(3) . "cols=\"5\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_PUBLIC_KEY_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"input-xxlarge span12\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = $this->_t(3) . "onchange=\"vdm_dkim();\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_key\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_KEY_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"40\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_KEY_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add KEY here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_DKIM_KEY_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_value\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_VALUE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"80\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"350\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_VALUE_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add TXT record here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_DKIM_VALUE_HINT\""; + $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; } // close that fieldset - $this->configFieldSets[] = "\t"; + $this->configFieldSets[] = $this->_t(1) . ""; } } @@ -14152,241 +14222,241 @@ function vdm_dkim() { { if ($this->googlechart) { - $this->configFieldSets[] = PHP_EOL . "\tconfigFieldSets[] = "\t\tname=\"googlechart_config\""; - $this->configFieldSets[] = "\t\tlabel=\"" . $lang . "_CHART_SETTINGS_LABEL\""; - $this->configFieldSets[] = "\t\tdescription=\"" . $lang . "_CHART_SETTINGS_DESC\">"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; - $this->configFieldSets[] = "\t\t\tname=\"admin_chartbackground\""; - $this->configFieldSets[] = "\t\t\tdefault=\"#F7F7FA\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTBACKGROUND_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTBACKGROUND_DESC\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"admin_mainwidth\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_MAINWIDTH_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"20\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_MAINWIDTH_DESC\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add area width here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_MAINWIDTH_HINT\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"admin_chartareatop\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREATOP_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"20\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREATOP_DESC\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add top spacing here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREATOP_HINT\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"admin_chartarealeft\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREALEFT_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"20\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREALEFT_DESC\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add left spacing here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREALEFT_HINT\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"admin_chartareawidth\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREAWIDTH_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"20\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREAWIDTH_DESC\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add chart width here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREAWIDTH_HINT\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; - $this->configFieldSets[] = "\t\t\tname=\"admin_legendtextstylefontcolor\""; - $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"admin_legendtextstylefontsize\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"20\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add size of the legend here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; - $this->configFieldSets[] = "\t\t\tname=\"admin_vaxistextstylefontcolor\""; - $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; - $this->configFieldSets[] = "\t\t\tname=\"admin_haxistextstylefontcolor\""; - $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; - $this->configFieldSets[] = "\t\t\tname=\"admin_haxistitletextstylefontcolor\""; - $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; - $this->configFieldSets[] = "\t\t\tname=\"site_chartbackground\""; - $this->configFieldSets[] = "\t\t\tdefault=\"#F7F7FA\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTBACKGROUND_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTBACKGROUND_DESC\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"site_mainwidth\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_MAINWIDTH_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"20\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_MAINWIDTH_DESC\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add area width here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_MAINWIDTH_HINT\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"site_chartareatop\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREATOP_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"20\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREATOP_DESC\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add top spacing here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREATOP_HINT\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"site_chartarealeft\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREALEFT_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"20\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREALEFT_DESC\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add left spacing here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREALEFT_HINT\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"site_chartareawidth\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREAWIDTH_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"20\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREAWIDTH_DESC\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add chart width here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREAWIDTH_HINT\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; - $this->configFieldSets[] = "\t\t\tname=\"site_legendtextstylefontcolor\""; - $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; - $this->configFieldSets[] = "\t\t\tname=\"site_legendtextstylefontsize\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; - $this->configFieldSets[] = "\t\t\tsize=\"20\""; - $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; - $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; - $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; - $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add size of the legend here.\""; - $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; - $this->configFieldSets[] = "\t\t\tname=\"site_vaxistextstylefontcolor\""; - $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; - $this->configFieldSets[] = "\t\t\tname=\"site_haxistextstylefontcolor\""; - $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; - $this->configFieldSets[] = "\t\t\tname=\"site_haxistitletextstylefontcolor\""; - $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; - $this->configFieldSets[] = "\t\t/>"; + $this->configFieldSets[] = PHP_EOL . $this->_t(1) . "configFieldSets[] = $this->_t(2) . "name=\"googlechart_config\""; + $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang . "_CHART_SETTINGS_LABEL\""; + $this->configFieldSets[] = $this->_t(2) . "description=\"" . $lang . "_CHART_SETTINGS_DESC\">"; + $this->configFieldSets[] = $this->_t(2); + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"admin_chartbackground\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"#F7F7FA\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTBACKGROUND_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTBACKGROUND_DESC\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"admin_mainwidth\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_MAINWIDTH_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_MAINWIDTH_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add area width here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_MAINWIDTH_HINT\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"admin_chartareatop\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREATOP_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREATOP_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add top spacing here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREATOP_HINT\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"admin_chartarealeft\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREALEFT_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREALEFT_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add left spacing here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREALEFT_HINT\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"admin_chartareawidth\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREAWIDTH_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREAWIDTH_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add chart width here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREAWIDTH_HINT\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"admin_legendtextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"admin_legendtextstylefontsize\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add size of the legend here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"admin_vaxistextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"admin_haxistextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"admin_haxistitletextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2); + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2); + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"site_chartbackground\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"#F7F7FA\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTBACKGROUND_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTBACKGROUND_DESC\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"site_mainwidth\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_MAINWIDTH_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_MAINWIDTH_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add area width here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_MAINWIDTH_HINT\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"site_chartareatop\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREATOP_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREATOP_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add top spacing here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREATOP_HINT\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"site_chartarealeft\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREALEFT_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREALEFT_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add left spacing here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREALEFT_HINT\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"site_chartareawidth\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREAWIDTH_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREAWIDTH_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add chart width here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREAWIDTH_HINT\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"site_legendtextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"site_legendtextstylefontsize\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; + $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; + $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; + $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add size of the legend here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"site_vaxistextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"site_haxistextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; + $this->configFieldSets[] = $this->_t(3) . "name=\"site_haxistitletextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(2) . "/>"; // add custom Encryption Settings fields if (isset($this->configFieldSetsCustomField['Chart Settings']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Chart Settings'])) @@ -14395,7 +14465,7 @@ function vdm_dkim() { unset($this->configFieldSetsCustomField['Chart Settings']); } - $this->configFieldSets[] = "\t"; + $this->configFieldSets[] = $this->_t(1) . ""; // set params defaults $this->extensionsParams[] = '"admin_chartbackground":"#F7F7FA","admin_mainwidth":"1000","admin_chartareatop":"20","admin_chartarealeft":"20","admin_chartareawidth":"170","admin_legendtextstylefontcolor":"10","admin_legendtextstylefontsize":"20","admin_vaxistextstylefontcolor":"#63B1F2","admin_haxistextstylefontcolor":"#63B1F2","admin_haxistitletextstylefontcolor":"#63B1F2","site_chartbackground":"#F7F7FA","site_mainwidth":"1000","site_chartareatop":"20","site_chartarealeft":"20","site_chartareawidth":"170","site_legendtextstylefontcolor":"10","site_legendtextstylefontsize":"20","site_vaxistextstylefontcolor":"#63B1F2","site_haxistextstylefontcolor":"#63B1F2","site_haxistitletextstylefontcolor":"#63B1F2"'; @@ -14452,10 +14522,10 @@ function vdm_dkim() { { $dynamicAddFields[] = "Encryption Settings"; // start building field set for encryption functions - $this->configFieldSets[] = "\tconfigFieldSets[] = "\t\t" . 'name="encryption_config"'; - $this->configFieldSets[] = "\t\t" . 'label="' . $lang . '_ENCRYPTION_LABEL"'; - $this->configFieldSets[] = "\t\t" . 'description="' . $lang . '_ENCRYPTION_DESC">'; + $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . 'name="encryption_config"'; + $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_ENCRYPTION_LABEL"'; + $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang . '_ENCRYPTION_DESC">'; // set tab lang if (((isset($this->basicEncryption) && $this->basicEncryption) || @@ -14506,14 +14576,14 @@ function vdm_dkim() { $this->langContent[$this->lang][$lang . '_BASIC_KEY_NOTE_LABEL'] = "Basic Encryption"; $this->langContent[$this->lang][$lang . '_BASIC_KEY_NOTE_DESC'] = "When using the basic encryption please use set a 32 character passphrase.
    Never change this passphrase once it is set! DATA WILL GET CORRUPTED IF YOU DO!"; // set the field - $this->configFieldSets[] = "\t\t" . ''; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_BASIC_KEY_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_BASIC_KEY_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default=""'; - $this->configFieldSets[] = "\t\t/>"; + $this->configFieldSets[] = $this->_t(2) . ''; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_BASIC_KEY_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_BASIC_KEY_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default=""'; + $this->configFieldSets[] = $this->_t(2) . "/>"; } if (isset($this->mediumEncryption) && $this->mediumEncryption) { @@ -14523,16 +14593,16 @@ function vdm_dkim() { $this->langContent[$this->lang][$lang . '_MEDIUM_KEY_NOTE_LABEL'] = "Medium Encryption"; $this->langContent[$this->lang][$lang . '_MEDIUM_KEY_NOTE_DESC'] = "When using the medium encryption option, the system generates its own key and stores it in a file at the folder/path you set here.
    Never change this key once it is set, or remove the key file! DATA WILL GET CORRUPTED IF YOU DO! Also make sure the full path to where the the key file should be stored, is behind the root folder of your website/system, so that it is not public accessible. Making a backup of this key file over a secure connection is recommended!"; // set the field - $this->configFieldSets[] = "\t\t" . ''; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_MEDIUM_KEY_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_MEDIUM_KEY_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="160"'; - $this->configFieldSets[] = "\t\t\t" . 'filter="PATH"'; - $this->configFieldSets[] = "\t\t\t" . 'hint="/home/user/hiddenfolder123/"'; - $this->configFieldSets[] = "\t\t\t" . 'default=""'; - $this->configFieldSets[] = "\t\t/>"; + $this->configFieldSets[] = $this->_t(2) . ''; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_MEDIUM_KEY_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_MEDIUM_KEY_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="160"'; + $this->configFieldSets[] = $this->_t(3) . 'filter="PATH"'; + $this->configFieldSets[] = $this->_t(3) . 'hint="/home/user/hiddenfolder123/"'; + $this->configFieldSets[] = $this->_t(3) . 'default=""'; + $this->configFieldSets[] = $this->_t(2) . "/>"; // set some error message if the path does not exist $this->langContent[$this->lang][$lang . '_MEDIUM_KEY_PATH_ERROR'] = "Medium key path (for encryption of various fields) does not exist, or is not writable. Please check the path and update it in the global option of this component."; } @@ -14577,14 +14647,14 @@ function vdm_dkim() { $this->langContent[$this->lang][$lang . '_WHMCS_KEY_NOTE_DESC'] = "You need to get this key from " . $this->componentData->companyname . "."; } // set the fields - $this->configFieldSets[] = "\t\t" . ''; - $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; - $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_WHMCS_KEY_LABEL"'; - $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_WHMCS_KEY_DESC"'; - $this->configFieldSets[] = "\t\t\t" . 'size="60"'; - $this->configFieldSets[] = "\t\t\t" . 'default=""'; - $this->configFieldSets[] = "\t\t/>"; + $this->configFieldSets[] = $this->_t(2) . ''; + $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_WHMCS_KEY_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_WHMCS_KEY_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'size="60"'; + $this->configFieldSets[] = $this->_t(3) . 'default=""'; + $this->configFieldSets[] = $this->_t(2) . "/>"; } // load the dynamic field sets foreach ($dynamicAddFields as $dynamicAddField) @@ -14597,7 +14667,7 @@ function vdm_dkim() { } } // close that fieldset - $this->configFieldSets[] = "\t"; + $this->configFieldSets[] = $this->_t(1) . ""; } } @@ -14610,13 +14680,13 @@ function vdm_dkim() { $otherViews = $this->catCodeBuilder[$viewName_single]['views']; if ($otherViews == $viewName_list) { - $component .= PHP_EOL . "\t" . '
    '; - $component .= PHP_EOL . "\t\t" . ''; - $component .= PHP_EOL . "\t\t" . ''; - $component .= PHP_EOL . "\t\t" . ''; - $component .= PHP_EOL . "\t\t" . ''; - $component .= PHP_EOL . "\t\t" . ''; - $component .= PHP_EOL . "\t
    "; + $component .= PHP_EOL . $this->_t(1) . '
    '; + $component .= PHP_EOL . $this->_t(2) . ''; + $component .= PHP_EOL . $this->_t(2) . ''; + $component .= PHP_EOL . $this->_t(2) . ''; + $component .= PHP_EOL . $this->_t(2) . ''; + $component .= PHP_EOL . $this->_t(2) . ''; + $component .= PHP_EOL . $this->_t(1) . "
    "; } } return $component; @@ -14630,53 +14700,53 @@ function vdm_dkim() { $this->permissionViews = array(); $this->componentHead[] = '
    '; - $this->componentHead[] = "\t\t" . ''; - $this->componentHead[] = "\t\t" . ''; - $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = $this->_t(2) . ''; + $this->componentHead[] = $this->_t(2) . ''; + $this->componentHead[] = $this->_t(2) . ''; if ($this->addEximport) { $exportTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Export Data', 'U'); $exportDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Export Data', 'U') . '_DESC'; $this->langContent['bothadmin'][$exportTitle] = 'Export Data'; $this->langContent['bothadmin'][$exportDesc] = ' Allows users in this group to export data.'; - $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = $this->_t(2) . ''; $importTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Import Data', 'U'); $importDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Import Data', 'U') . '_DESC'; $this->langContent['bothadmin'][$importTitle] = 'Import Data'; $this->langContent['bothadmin'][$importDesc] = ' Allows users in this group to import data.'; - $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = $this->_t(2) . ''; } // version permission $batchTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Use Batch', 'U'); $batchDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Use Batch', 'U') . '_DESC'; $this->langContent['bothadmin'][$batchTitle] = 'Use Batch'; $this->langContent['bothadmin'][$batchDesc] = ' Allows users in this group to use batch copy/update method.'; - $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = $this->_t(2) . ''; // version permission $importTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Versions', 'U'); $importDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Versions', 'U') . '_DESC'; $this->langContent['bothadmin'][$importTitle] = 'Edit Version'; $this->langContent['bothadmin'][$importDesc] = ' Allows users in this group to edit versions.'; - $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = $this->_t(2) . ''; // set the defaults - $this->componentHead[] = "\t\t" . ''; - $this->componentHead[] = "\t\t" . ''; - $this->componentHead[] = "\t\t" . ''; - $this->componentHead[] = "\t\t" . ''; - $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = $this->_t(2) . ''; + $this->componentHead[] = $this->_t(2) . ''; + $this->componentHead[] = $this->_t(2) . ''; + $this->componentHead[] = $this->_t(2) . ''; + $this->componentHead[] = $this->_t(2) . ''; // new custom created by permissions $created_byTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created By', 'U'); $created_byDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created By', 'U') . '_DESC'; $this->langContent['bothadmin'][$created_byTitle] = 'Edit Created By'; $this->langContent['bothadmin'][$created_byDesc] = ' Allows users in this group to edit created by.'; - $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = $this->_t(2) . ''; // new custom created date permissions $createdTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created Date', 'U'); $createdDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created Date', 'U') . '_DESC'; $this->langContent['bothadmin'][$createdTitle] = 'Edit Created Date'; $this->langContent['bothadmin'][$createdDesc] = ' Allows users in this group to edit created date.'; - $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = $this->_t(2) . ''; // set the menu controller lookup $menuControllers = array('access', 'submenu', 'dashboard_list', 'dashboard_add'); @@ -14693,7 +14763,7 @@ function vdm_dkim() { $sortKey = ComponentbuilderHelper::safeString($customAdminName . ' Access'); $this->langContent['bothadmin'][$customAdminTitle] = $customAdminName . ' Access'; $this->langContent['bothadmin'][$customAdminDesc] = ' Allows the users in this group to access ' . ComponentbuilderHelper::safeString($customAdminName, 'w') . '.'; - $this->componentGlobal[$sortKey] = "\t\t" . ''; + $this->componentGlobal[$sortKey] = $this->_t(2) . ''; // add the custom permissions to use the buttons of this view $this->addCustomButtonPermissions($custom_admin_view['settings'], $customAdminName, $customAdminCode); // add menu controll view that has menus options @@ -14740,7 +14810,7 @@ function vdm_dkim() { { $this->langContent['bothadmin'][$siteTitle] = $siteName . ' (Site) Access'; $this->langContent['bothadmin'][$siteDesc] = ' Allows the users in this group to access site ' . ComponentbuilderHelper::safeString($siteName, 'w') . '.'; - $this->componentGlobal[$sortKey] = "\t\t" . ''; + $this->componentGlobal[$sortKey] = $this->_t(2) . ''; // check if this site view requires access rule to default to public if (isset($site_view['public_access']) && $site_view['public_access'] == 1) @@ -14842,12 +14912,12 @@ function vdm_dkim() { { foreach ($this->permissionViews as $viewName => $actions) { - $componentViews[] = "\t" . '
    '; + $componentViews[] = $this->_t(1) . '
    '; foreach ($actions as $action) { - $componentViews[] = "\t\t" . $action; + $componentViews[] = $this->_t(2) . $action; } - $componentViews[] = "\t
    "; + $componentViews[] = $this->_t(1) . "
    "; } } /// now build the section @@ -14855,7 +14925,7 @@ function vdm_dkim() { // sort the array to insure easy search ksort($this->componentGlobal, SORT_STRING); // add global to the compnent section - $component .= PHP_EOL . implode(PHP_EOL, $this->componentGlobal) . PHP_EOL . "\t
    "; + $component .= PHP_EOL . implode(PHP_EOL, $this->componentGlobal) . PHP_EOL . $this->_t(1) . "
    "; // add views to the compnent section $component .= PHP_EOL . implode(PHP_EOL, $componentViews); // be sure to reset again. (memory) @@ -14882,7 +14952,7 @@ function vdm_dkim() { $sortButtonKey = ComponentbuilderHelper::safeString($nameView . ' ' . $customButtonName . ' Button Access'); $this->langContent['bothadmin'][$customButtonTitle] = $nameView . ' ' . $customButtonName . ' Button Access'; $this->langContent['bothadmin'][$customButtonDesc] = ' Allows the users in this group to access the ' . ComponentbuilderHelper::safeString($customButtonName, 'w') . ' button.'; - $this->componentGlobal[$sortButtonKey] = "\t\t" . ''; + $this->componentGlobal[$sortButtonKey] = $this->_t(2) . ''; } } } @@ -15087,7 +15157,7 @@ function vdm_dkim() { elseif ($permission['implementation'] == 2) { // relation to whole component - $this->componentGlobal[$sortKey] = "\t\t" . ''; + $this->componentGlobal[$sortKey] = $this->_t(2) . ''; // build permission switch $this->permissionBuilder['global'][$action][$nameView] = $nameView; // dashboard icon checker @@ -15123,7 +15193,7 @@ function vdm_dkim() { // load permission to action $this->permissionBuilder[$action][$nameView] = $nameView; // relation to whole component - $this->componentGlobal[$sortKey] = "\t\t" . ''; + $this->componentGlobal[$sortKey] = $this->_t(2) . ''; // build permission switch $this->permissionBuilder['global'][$action][$nameView] = $nameView; // dashboard icon checker @@ -15159,7 +15229,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..920607f8a 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 . $this->_t(1) . '/**'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '* The Global Admin Event Method.'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '**/'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . 'public static function globalEvent($document)'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '{'; + $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 . $this->_t(1) . '}'; } // 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 . $this->_t(3) . "README.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(); @@ -243,7 +243,7 @@ class Infusion extends Interpretation // set site edit view array if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) { - $site_edit_view_array[] = "\t\t\t\t'" . $viewName_single . "'"; + $site_edit_view_array[] = $this->_t(4) . "'" . $viewName_single . "'"; $this->lang = 'both'; } // check if help is being loaded @@ -252,7 +252,7 @@ class Infusion extends Interpretation $this->setCustomAdminViewListLink($view, $viewName_list); // set view array - $viewarray[] = "\t\t\t\t'" . $viewName_single . "' => '" . $viewName_list . "'"; + $viewarray[] = $this->_t(4) . "'" . $viewName_single . "' => '" . $viewName_list . "'"; // set the view names if (isset($view['settings']->name_single) && $view['settings']->name_single != 'null') { @@ -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 . $this->_t(2) . "return;", PHP_EOL . PHP_EOL . $this->_t(2) . "return;"); - // ###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, $this->_t(1)); + $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, $viewName_list, $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, $this->_t(2)); - // ###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, $this->_t(2)); - // ###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 . $this->_t(1) . '/**'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '* The Global Site Event Method.'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '**/'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . 'public static function globalEvent($document)'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '{'; + $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 . $this->_t(1) . '}'; } // 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 . $this->_t(3), $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 . $this->_t(2), $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..c0866db2d 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -1801,7 +1801,7 @@ abstract class ComponentbuilderHelper return $sufix === "" || ($sufix == substr(strrchr($file, "."), -strlen($sufix))); } - public static function imageInfo($path,$request = 'type') + public static function imageInfo($path, $request = 'type') { // set image $image = JPATH_SITE.'/'.$path; @@ -1914,37 +1914,79 @@ abstract class ComponentbuilderHelper return array_unique($bucket); } - public static function typeField($type,$option = 'default') + + /** + * Field Grouping https://docs.joomla.org/Form_field + **/ + protected static $fieldGroups = array( + 'default' => array( + 'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox', + 'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor', + 'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file', + 'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite', + 'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password', + 'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag', + 'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag', + 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup' + ), + 'plain' => array( + 'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color', + 'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors', + 'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite', + 'hidden', 'imagelist', 'integer', 'language', 'media', 'menu', + 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', + 'sessionhandler', 'tag', 'tel', 'text', 'textarea', + 'timezone', 'url', 'user', 'usergroup' + ), + 'text' => array( + 'calendar','color','editor','email','password','tel','text','textarea','url','number','range' + ), + 'list' => array( + 'checkboxes','checkbox','list','radio' + ), + 'dynamic' => array( + 'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter' + ), + 'spacer' => array( + 'note', 'spacer' + ), + 'option' => array( + 'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql' + ), + 'special' => array( + 'contentlanguage', 'groupedlist', 'moduleposition', 'plugin', + 'repeatable', 'templatestyle', 'subform' + ) + ); + + /** + * Field Checker + * + * @param string $type The field type + * @param boolean $option The field grouping + * + * @return boolean if the field was found + */ + public static function fieldCheck($type, $option = 'default') { - // list of default fields - // https://docs.joomla.org/Form_field - $fields = array( - 'default' => array( - 'accesslevel','cachehandler','calendar','captcha','category','checkbox', - 'checkboxes','color','combo','componentlayout','contentlanguage','editor', - 'chromestyle','contenttype','databaseconnection','editors','email','file', - 'filelist','folderlist','groupedlist','hidden','file','headertag','helpsite', - 'imagelist','integer','language','list','media','menu','note','password', - 'plugins','range','radio','repeatable','rules','subform','sessionhandler','spacer','sql','tag', - 'tel','menuitem','modulelayout','meter','moduleorder','moduleposition','moduletag', - 'templatestyle','text','textarea','timezone','url','user','usergroup' - ), - 'text' => array( - 'calendar','color','editor','email','password','tel','text','textarea','url','number','range' - ), - 'list' => array( - 'checkboxes','checkbox','list','radio' - ), - 'dynamic' => array( - 'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter' - ) - ); - - if (in_array($type,$fields[$option])) + // now check + if (isset(self::$fieldGroups[$option]) && in_array($type, self::$fieldGroups[$option])) { return true; } - return false; + return false; + } + + /** + * get the spacer IDs + * + * @return array ids of the spacer field types + */ + public static function getSpacerIds() + { + // get the database object to use quote + $db = JFactory::getDbo(); + return self::getVars('fieldtype', (array) array_map(function($name) use($db) { return $db->quote(ucfirst($name)); }, self::$fieldGroups['spacer']), 'name', 'id'); } /** @@ -3085,15 +3127,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 +3170,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 +3209,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 +3368,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 +3459,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') { @@ -3604,8 +3646,8 @@ abstract class ComponentbuilderHelper } /** - * Load the Component Help URLs. - **/ + * Load the Component Help URLs. + **/ public static function getHelpUrl($view) { $user = JFactory::getUser(); @@ -3642,15 +3684,15 @@ abstract class ComponentbuilderHelper // set joomla article case 1: return self::loadArticleLink($help->article); - break; + break; // set help text case 2: return self::loadHelpTextLink($help->id); - break; + break; // set Link case 3: return $help->url; - break; + break; } } } @@ -3659,16 +3701,16 @@ abstract class ComponentbuilderHelper } /** - * Get the Article Link. - **/ + * Get the Article Link. + **/ protected static function loadArticleLink($id) { return JURI::root().'index.php?option=com_content&view=article&id='.$id.'&tmpl=component&layout=modal'; } /** - * Get the Help Text Link. - **/ + * Get the Help Text Link. + **/ protected static function loadHelpTextLink($id) { $token = JSession::getFormToken(); @@ -3767,8 +3809,8 @@ abstract class ComponentbuilderHelper } /** - * UIKIT Component Classes - **/ + * UIKIT Component Classes + **/ public static $uk_components = array( 'data-uk-grid' => array( 'grid' ), @@ -3822,15 +3864,15 @@ abstract class ComponentbuilderHelper 'upload-drop' => array( 'upload', 'form-file' ) ); - + /** - * Add UIKIT Components - **/ + * Add UIKIT Components + **/ public static $uikit = false; /** - * Get UIKIT Components - **/ + * Get UIKIT Components + **/ public static function getUikitComp($content,$classes = array()) { if (strpos($content,'class="uk-') !== false) @@ -3860,7 +3902,7 @@ abstract class ComponentbuilderHelper } return $temp; } - } + } if (self::checkArray($classes)) { return $classes; @@ -3896,19 +3938,19 @@ abstract class ComponentbuilderHelper { $subjectTab = 'Sheet1'; } - - // make sure the file is loaded + + // make sure the file is loaded JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers'); - + // Create new PHPExcel object $objPHPExcel = new PHPExcel(); - + // Set document properties $objPHPExcel->getProperties()->setCreator($creator) - ->setCompany('Joomla Component Builder') - ->setLastModifiedBy($modified) - ->setTitle($title) - ->setSubject($subjectTab); + ->setCompany('Joomla Component Builder') + ->setLastModifiedBy($modified) + ->setTitle($title) + ->setSubject($subjectTab); if (!$description) { $objPHPExcel->getProperties()->setDescription($description); @@ -3921,7 +3963,7 @@ abstract class ComponentbuilderHelper { $objPHPExcel->getProperties()->setCategory($category); } - + // Some styles $headerStyles = array( 'font' => array( @@ -3943,7 +3985,7 @@ abstract class ComponentbuilderHelper 'size' => 11, 'name' => 'Verdana' )); - + // Add some data if (self::checkArray($rows)) { @@ -3970,43 +4012,43 @@ abstract class ComponentbuilderHelper { return false; } - + // Rename worksheet $objPHPExcel->getActiveSheet()->setTitle($subjectTab); - + // Set active sheet index to the first sheet, so Excel opens this as the first sheet $objPHPExcel->setActiveSheetIndex(0); - + // Redirect output to a client's web browser (Excel5) header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="'.$fileName.'.xls"'); header('Cache-Control: max-age=0'); // If you're serving to IE 9, then the following may be needed header('Cache-Control: max-age=1'); - + // If you're serving to IE over SSL, then the following may be needed header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header ('Pragma: public'); // HTTP/1.0 - + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); jexit(); } - + /** - * Get CSV Headers - */ + * Get CSV Headers + */ public static function getFileHeaders($dataType) - { - // make sure these files are loaded + { + // make sure these files are loaded JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers'); JLoader::import('ChunkReadFilter', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/PHPExcel/Reader'); // get session object - $session = JFactory::getSession(); - $package = $session->get('package', null); - $package = json_decode($package, true); + $session = JFactory::getSession(); + $package = $session->get('package', null); + $package = json_decode($package, true); // set the headers if(isset($package['dir'])) { @@ -4583,7 +4625,7 @@ abstract class ComponentbuilderHelper } } // check if there are any view values remaining - if (count($_result)) + if (count((array)$_result)) { $_result = json_encode($_result); $_result = array($_result); @@ -4777,7 +4819,7 @@ abstract class ComponentbuilderHelper **/ public static function checkArray($array, $removeEmptyString = false) { - if (isset($array) && is_array($array) && count($array) > 0) + if (isset($array) && is_array($array) && count((array)$array) > 0) { // also make sure the empty strings are removed if ($removeEmptyString) @@ -4880,7 +4922,7 @@ abstract class ComponentbuilderHelper { $initial = strlen($string); $words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE); - $words_count = count($words); + $words_count = count((array)$words); $word_length = 0; $last_word = 0; diff --git a/admin/helpers/componentbuilderemail.php b/admin/helpers/componentbuilderemail.php index f88185156..22956ff92 100644 --- a/admin/helpers/componentbuilderemail.php +++ b/admin/helpers/componentbuilderemail.php @@ -215,7 +215,7 @@ abstract class ComponentbuilderEmail if (is_array($mailreply)) { $mail->ClearReplyTos(); - $numReplyTo = count($mailreply); + $numReplyTo = count((array)$mailreply); for ($i=0; $i < $numReplyTo; $i++) { $mail->addReplyTo($mailreply[$i], $replyname[$i]); diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index b73c76453..6e5b5b4be 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -11,6 +11,7 @@ COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_T COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS="Add Custom Code Placeholders" COM_COMPONENTBUILDER_ADD_KEY_HERE="add key here" COM_COMPONENTBUILDER_ADD_MENU="Add Menu" +COM_COMPONENTBUILDER_ADD_MORE_FIELDS_TO_THIS_ADMIN_VIEW="Add more fields to this admin view" COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_SMALLIF_SETSMALL="Add to Backup Folder & Sales Server (if set)" COM_COMPONENTBUILDER_ADD_TO_REPOSITORY_FOLDER="Add to Repository Folder" COM_COMPONENTBUILDER_ADD_YOUR_OWN_JCB_PACKAGES_TO_THE_COMMUNITY_A_S_GITHUBA_REPOSITORYBR_WATCH_THIS_A_S_TUTORIALA_TO_SEE_HOW="Add your own JCB packages to the community gitHub repository.
    Watch this tutorial to see how!" @@ -94,6 +95,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 +151,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 +189,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 +247,55 @@ 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_AREA_LABEL="Area" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_COLUMN_NAME_HINT="Default" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_COLUMN_NAME_LABEL="Table Column Name" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_COLUMN_NAME_MESSAGE="Error! Please add some text here." +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CONCATENATE_RAQUO_GLUE="Concatenate » Glue" +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_RAQUO_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_MODEL_AFTER_MODELLING="Model (after modelling)" +COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODEL_BEFORE_MODELLING="Model (before modelling)" +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_RELATIONS_VIEW="View" 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 +562,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 +705,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 +2308,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 +3739,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 +4190,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 +4380,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 +5515,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)" @@ -5424,6 +5528,8 @@ COM_COMPONENTBUILDER_MAX_LENGTH_ONLY_FOUR_TEXT_FIELD="Max Length (only 4 text_fi COM_COMPONENTBUILDER_MERGE="Merge" COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT="Minify JavaScript" COM_COMPONENTBUILDER_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD="Min Length (only 4 text_field)" +COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)" +COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)" COM_COMPONENTBUILDER_NAME="Name" COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)" COM_COMPONENTBUILDER_NAME_DESC="Name (Desc)" 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/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php index 6ea1e51c7..29a9ee253 100644 --- a/admin/layouts/fieldtype/fields_fullwidth.php +++ b/admin/layouts/fieldtype/fields_fullwidth.php @@ -68,14 +68,14 @@ $can = ComponentbuilderHelper::getActions('field'); $canDo = ComponentbuilderHelper::getActions('field',$item,'fields'); ?> - + get('field.edit')): ?> escape($item->name); ?> - checked_out): ?> - name, $item->checked_out_time, 'fields.', $canCheckin); ?> - + checked_out): ?> + name, $item->checked_out_time, 'fields.', $canCheckin); ?> + -
    escape($item->name); ?>
    + escape($item->name); ?> @@ -93,7 +93,7 @@ $can = ComponentbuilderHelper::getActions('field'); store); ?> - + authorise('core.edit', 'com_componentbuilder.fields.category.' . (int)$item->catid)): ?> escape($item->category_title); ?> diff --git a/admin/layouts/server/linked_components_fullwidth.php b/admin/layouts/server/linked_components_fullwidth.php index c607d032e..1ebc0da63 100644 --- a/admin/layouts/server/linked_components_fullwidth.php +++ b/admin/layouts/server/linked_components_fullwidth.php @@ -59,14 +59,14 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml $canDo = ComponentbuilderHelper::getActions('joomla_component',$item,'joomla_components'); ?> - + get('joomla_component.edit')): ?> escape($item->system_name); ?> - checked_out): ?> - name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> - + checked_out): ?> + name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> + -
    escape($item->system_name); ?>
    + escape($item->system_name); ?> diff --git a/admin/models/admin_fields.php b/admin/models/admin_fields.php index 1bbfed1d4..1a5ca4e1d 100644 --- a/admin/models/admin_fields.php +++ b/admin/models/admin_fields.php @@ -256,7 +256,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -522,7 +522,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -620,7 +620,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -665,7 +665,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -865,13 +865,13 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/admin_fields_conditions.php b/admin/models/admin_fields_conditions.php index 615ca1a08..182c96f78 100644 --- a/admin/models/admin_fields_conditions.php +++ b/admin/models/admin_fields_conditions.php @@ -256,7 +256,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -522,7 +522,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -620,7 +620,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -665,7 +665,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -855,13 +855,13 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/admin_fields_relations.php b/admin/models/admin_fields_relations.php new file mode 100644 index 000000000..49fd62aac --- /dev/null +++ b/admin/models/admin_fields_relations.php @@ -0,0 +1,858 @@ + + * @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(); + } + + 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..8b346660e 100644 --- a/admin/models/admin_view.php +++ b/admin/models/admin_view.php @@ -550,7 +550,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -661,18 +661,18 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -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) { @@ -892,7 +894,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -984,7 +986,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -1049,7 +1051,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { diff --git a/admin/models/admin_views.php b/admin/models/admin_views.php index 0fbaf1e54..73ff4638d 100644 --- a/admin/models/admin_views.php +++ b/admin/models/admin_views.php @@ -104,11 +104,9 @@ class ComponentbuilderModelAdmin_views extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -194,10 +192,10 @@ class ComponentbuilderModelAdmin_views extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -237,11 +235,9 @@ class ComponentbuilderModelAdmin_views extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -385,16 +381,16 @@ class ComponentbuilderModelAdmin_views extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/admins_fields.php b/admin/models/admins_fields.php index 9709ba870..d56384b9e 100644 --- a/admin/models/admins_fields.php +++ b/admin/models/admins_fields.php @@ -90,11 +90,9 @@ class ComponentbuilderModelAdmins_fields extends JModelList // 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.access', 'com_componentbuilder.admin_fields.' . (int) $item->id) && $user->authorise('admin_fields.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $item->id) && JFactory::getUser()->authorise('admin_fields.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelAdmins_fields extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/admins_fields_conditions.php b/admin/models/admins_fields_conditions.php index 351484730..c375c5aa2 100644 --- a/admin/models/admins_fields_conditions.php +++ b/admin/models/admins_fields_conditions.php @@ -90,11 +90,9 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList // 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_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $item->id) && $user->authorise('admin_fields_conditions.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $item->id) && JFactory::getUser()->authorise('admin_fields_conditions.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/admins_fields_relations.php b/admin/models/admins_fields_relations.php new file mode 100644 index 000000000..2dea912aa --- /dev/null +++ b/admin/models/admins_fields_relations.php @@ -0,0 +1,240 @@ + + * @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)) + { + foreach ($items as $nr => &$item) + { + $access = (JFactory::getUser()->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $item->id) && JFactory::getUser()->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..0796869ff 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,11 @@ class ComponentbuilderModelAjax extends JModelList 'type' => 'setURLType', // Admin View 'field' => 'setItemNames', + 'listfield' => 'setItemNames', + 'joinfields' => 'setItemNames', + 'area' => 'setAreaName', + 'set' => 'setCode', + 'join_type' => 'setJoinType', 'list' => 'setAdminBehaviour', 'title' => 'setYesNo', 'alias' => 'setYesNo', @@ -456,6 +462,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 +635,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 +766,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 +845,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) @@ -969,6 +996,28 @@ class ComponentbuilderModelAjax extends JModelList return JText::_('COM_COMPONENTBUILDER_DETAILS'); } + protected function setAreaName($header, $value) + { + switch ($value) + { + case 1: + return JText::_('COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING'); + break; + case 2: + return JText::_('COM_COMPONENTBUILDER_VIEW'); + break; + case 3: + return JText::_('COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING'); + break; + } + return JText::_('COM_COMPONENTBUILDER_NOT_SET'); + } + + protected function setCode($header, $value) + { + return nl2br(htmlspecialchars($value)); + } + protected function setYesNo($header, $value) { if (1 == $value) @@ -1067,7 +1116,7 @@ class ComponentbuilderModelAjax extends JModelList { $result = $this->_db->loadObject(); $result->name = strtolower($result->name); - if (ComponentbuilderHelper::typeField($result->name,'list')) + if (ComponentbuilderHelper::fieldCheck($result->name,'list')) { // load the values form params $xml = json_decode($result->xml); @@ -1111,15 +1160,15 @@ class ComponentbuilderModelAjax extends JModelList // return found field options return $optionSet; } - elseif (ComponentbuilderHelper::typeField($result->name,'text')) + elseif (ComponentbuilderHelper::fieldCheck($result->name,'text')) { return "keywords=\"\"\nlength=\"\""; } - elseif (ComponentbuilderHelper::typeField($result->name,'dynamic')) + elseif (ComponentbuilderHelper::fieldCheck($result->name,'dynamic')) { return 'dynamic_list'; } - elseif (ComponentbuilderHelper::typeField($result->name)) + elseif (ComponentbuilderHelper::fieldCheck($result->name)) { return 'match field type not supported. Select another!'; } @@ -2067,6 +2116,13 @@ class ComponentbuilderModelAjax extends JModelList $targets['admin_view']['not_base64'] = array(); $targets['admin_view']['name'] = 'system_name'; + // #__componentbuilder_admin_fields_relations + $targets['library'] = array(); + $targets['library']['search'] = array('id', 'admin_view', 'addrelations'); + $targets['library']['view'] = 'admin_fields_relations'; + $targets['library']['not_base64'] = array('addrelations' => 'json'); + $targets['library']['name'] = 'admin_view->id:admin_view.system_name'; + // #__componentbuilder_custom_admin_view $targets['custom_admin_view'] = array(); $targets['custom_admin_view']['search'] = array('id', 'system_name', 'default','php_view','php_jview','php_jview_display','php_document', @@ -2114,7 +2170,6 @@ class ComponentbuilderModelAjax extends JModelList // #__componentbuilder_library $targets['library'] = array(); - $targets['library']['view'] = 'libraries'; $targets['library']['search'] = array('id', 'name', 'php_setdocument'); $targets['library']['view'] = 'libraries'; $targets['library']['not_base64'] = array(); @@ -2542,6 +2597,54 @@ class ComponentbuilderModelAjax extends JModelList return $xml; } + // Used in admin_fields_relations + public function getCodeGlueOptions($listfield, $joinfields, $type, $area) + { + // CONCATENATE GLUE + if ($type == 1) + { + // MODEL + if ($area == 1 || $area == 3) + { + return ', '; + } + // VIEW + elseif ($area == 2) + { + return '
    '; + } + } + // CUSTOM CODE + elseif ($type == 2) + { + // build fields array + $fields = array_map( function ($id) { + return (int) $id; + }, (array) explode(',', $joinfields)); + // add the list field to array + array_unshift($fields, (int) $listfield); + // get field names + $names = array_map( function ($id) { + return '[' . $id . ']=> ' . ComponentbuilderHelper::getVar('field', $id, 'id', 'name'); + }, $fields); + // MODEL + if ($area == 1 || $area == 3) + { + // create note + $note = "// ". implode('; ', $names); + return $note . PHP_EOL . '$item->{'.(int)$listfield.'} = $item->{' . implode("} . ', ' . \$item->{", $fields) . '};'; + } + // VIEW + elseif ($area == 2) + { + // create note + $note = ""; + return '[field=' . implode("]
    [field=", $fields). ']' . PHP_EOL . PHP_EOL . $note; + } + } + return false; + } + // Used in get_snippets public function getSnippets($libraries) diff --git a/admin/models/compiler.php b/admin/models/compiler.php index bde6c25ce..a4208a3f3 100644 --- a/admin/models/compiler.php +++ b/admin/models/compiler.php @@ -122,11 +122,11 @@ class ComponentbuilderModelCompiler extends JModelList /** - * Get the uikit needed components - * - * @return mixed An array of objects on success. - * - */ + * Get the uikit needed components + * + * @return mixed An array of objects on success. + * + */ public function getUikitComp() { if (isset($this->uikitComp) && ComponentbuilderHelper::checkArray($this->uikitComp)) diff --git a/admin/models/component_admin_views.php b/admin/models/component_admin_views.php index 7a24f6094..b43ae277a 100644 --- a/admin/models/component_admin_views.php +++ b/admin/models/component_admin_views.php @@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/component_config.php b/admin/models/component_config.php index 7a1ece824..55683e1ff 100644 --- a/admin/models/component_config.php +++ b/admin/models/component_config.php @@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_config extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/component_custom_admin_menus.php b/admin/models/component_custom_admin_menus.php index 6c2e2d630..261501f6d 100644 --- a/admin/models/component_custom_admin_menus.php +++ b/admin/models/component_custom_admin_menus.php @@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/component_custom_admin_views.php b/admin/models/component_custom_admin_views.php index ceeb80214..5a5bc8d3f 100644 --- a/admin/models/component_custom_admin_views.php +++ b/admin/models/component_custom_admin_views.php @@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/component_dashboard.php b/admin/models/component_dashboard.php index bac5d8ec6..99ac42e4e 100644 --- a/admin/models/component_dashboard.php +++ b/admin/models/component_dashboard.php @@ -273,7 +273,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -539,7 +539,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -637,7 +637,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -682,7 +682,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -878,13 +878,13 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/component_files_folders.php b/admin/models/component_files_folders.php index de2ed99cc..5a7c7d138 100644 --- a/admin/models/component_files_folders.php +++ b/admin/models/component_files_folders.php @@ -292,7 +292,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -558,7 +558,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -656,7 +656,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -701,7 +701,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -930,13 +930,13 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/component_mysql_tweaks.php b/admin/models/component_mysql_tweaks.php index cff20782d..fe94e30a0 100644 --- a/admin/models/component_mysql_tweaks.php +++ b/admin/models/component_mysql_tweaks.php @@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/component_site_views.php b/admin/models/component_site_views.php index 027ec6dbb..8f085e8bd 100644 --- a/admin/models/component_site_views.php +++ b/admin/models/component_site_views.php @@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/component_updates.php b/admin/models/component_updates.php index 72ba32f93..50f7e8228 100644 --- a/admin/models/component_updates.php +++ b/admin/models/component_updates.php @@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { 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/components_admin_views.php b/admin/models/components_admin_views.php index 60581bff8..2a29b660d 100644 --- a/admin/models/components_admin_views.php +++ b/admin/models/components_admin_views.php @@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_admin_views extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('component_admin_views.access', 'com_componentbuilder.component_admin_views.' . (int) $item->id) && $user->authorise('component_admin_views.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('component_admin_views.access', 'com_componentbuilder.component_admin_views.' . (int) $item->id) && JFactory::getUser()->authorise('component_admin_views.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_admin_views extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/components_config.php b/admin/models/components_config.php index 9c1bec6e8..d41d07e51 100644 --- a/admin/models/components_config.php +++ b/admin/models/components_config.php @@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_config extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('component_config.access', 'com_componentbuilder.component_config.' . (int) $item->id) && $user->authorise('component_config.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('component_config.access', 'com_componentbuilder.component_config.' . (int) $item->id) && JFactory::getUser()->authorise('component_config.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_config extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/components_custom_admin_menus.php b/admin/models/components_custom_admin_menus.php index 0470cf881..4013e3179 100644 --- a/admin/models/components_custom_admin_menus.php +++ b/admin/models/components_custom_admin_menus.php @@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('component_custom_admin_menus.access', 'com_componentbuilder.component_custom_admin_menus.' . (int) $item->id) && $user->authorise('component_custom_admin_menus.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('component_custom_admin_menus.access', 'com_componentbuilder.component_custom_admin_menus.' . (int) $item->id) && JFactory::getUser()->authorise('component_custom_admin_menus.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/components_custom_admin_views.php b/admin/models/components_custom_admin_views.php index 73ff90912..2068c3013 100644 --- a/admin/models/components_custom_admin_views.php +++ b/admin/models/components_custom_admin_views.php @@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('component_custom_admin_views.access', 'com_componentbuilder.component_custom_admin_views.' . (int) $item->id) && $user->authorise('component_custom_admin_views.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('component_custom_admin_views.access', 'com_componentbuilder.component_custom_admin_views.' . (int) $item->id) && JFactory::getUser()->authorise('component_custom_admin_views.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/components_dashboard.php b/admin/models/components_dashboard.php index e2d50e15e..515799618 100644 --- a/admin/models/components_dashboard.php +++ b/admin/models/components_dashboard.php @@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_dashboard extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('component_dashboard.access', 'com_componentbuilder.component_dashboard.' . (int) $item->id) && $user->authorise('component_dashboard.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('component_dashboard.access', 'com_componentbuilder.component_dashboard.' . (int) $item->id) && JFactory::getUser()->authorise('component_dashboard.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_dashboard extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/components_files_folders.php b/admin/models/components_files_folders.php index d5b7dc714..56bcce65b 100644 --- a/admin/models/components_files_folders.php +++ b/admin/models/components_files_folders.php @@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_files_folders extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('component_files_folders.access', 'com_componentbuilder.component_files_folders.' . (int) $item->id) && $user->authorise('component_files_folders.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('component_files_folders.access', 'com_componentbuilder.component_files_folders.' . (int) $item->id) && JFactory::getUser()->authorise('component_files_folders.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_files_folders extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/components_mysql_tweaks.php b/admin/models/components_mysql_tweaks.php index d69003cdc..13f9d73fb 100644 --- a/admin/models/components_mysql_tweaks.php +++ b/admin/models/components_mysql_tweaks.php @@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('component_mysql_tweaks.access', 'com_componentbuilder.component_mysql_tweaks.' . (int) $item->id) && $user->authorise('component_mysql_tweaks.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('component_mysql_tweaks.access', 'com_componentbuilder.component_mysql_tweaks.' . (int) $item->id) && JFactory::getUser()->authorise('component_mysql_tweaks.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/components_site_views.php b/admin/models/components_site_views.php index d062623ac..818030699 100644 --- a/admin/models/components_site_views.php +++ b/admin/models/components_site_views.php @@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_site_views extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('component_site_views.access', 'com_componentbuilder.component_site_views.' . (int) $item->id) && $user->authorise('component_site_views.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('component_site_views.access', 'com_componentbuilder.component_site_views.' . (int) $item->id) && JFactory::getUser()->authorise('component_site_views.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_site_views extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/components_updates.php b/admin/models/components_updates.php index ec6a3ba3e..b1c7b055f 100644 --- a/admin/models/components_updates.php +++ b/admin/models/components_updates.php @@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_updates extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('component_updates.access', 'com_componentbuilder.component_updates.' . (int) $item->id) && $user->authorise('component_updates.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('component_updates.access', 'com_componentbuilder.component_updates.' . (int) $item->id) && JFactory::getUser()->authorise('component_updates.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_updates extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/custom_admin_view.php b/admin/models/custom_admin_view.php index d560050c9..8d9acce65 100644 --- a/admin/models/custom_admin_view.php +++ b/admin/models/custom_admin_view.php @@ -377,7 +377,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -488,18 +488,18 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -679,7 +679,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -777,7 +777,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -822,7 +822,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -1126,13 +1126,13 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/custom_admin_views.php b/admin/models/custom_admin_views.php index 246fb059e..fb3cfff13 100644 --- a/admin/models/custom_admin_views.php +++ b/admin/models/custom_admin_views.php @@ -104,11 +104,9 @@ class ComponentbuilderModelCustom_admin_views extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && $user->authorise('custom_admin_view.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -198,10 +196,10 @@ class ComponentbuilderModelCustom_admin_views extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -241,11 +239,9 @@ class ComponentbuilderModelCustom_admin_views extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && $user->authorise('custom_admin_view.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -345,16 +341,16 @@ class ComponentbuilderModelCustom_admin_views extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/custom_code.php b/admin/models/custom_code.php index bc1612896..7c8e3959b 100644 --- a/admin/models/custom_code.php +++ b/admin/models/custom_code.php @@ -234,7 +234,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -345,18 +345,18 @@ class ComponentbuilderModelCustom_code extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -536,7 +536,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -634,7 +634,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -679,7 +679,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -862,13 +862,13 @@ class ComponentbuilderModelCustom_code extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/custom_codes.php b/admin/models/custom_codes.php index 8d5716f33..7baf9042b 100644 --- a/admin/models/custom_codes.php +++ b/admin/models/custom_codes.php @@ -108,11 +108,9 @@ class ComponentbuilderModelCustom_codes extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && $user->authorise('custom_code.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -159,10 +157,10 @@ class ComponentbuilderModelCustom_codes extends JModelList } /** - * Method to convert selection values to translatable string. - * - * @return translatable string - */ + * Method to convert selection values to translatable string. + * + * @return translatable string + */ public function selectionTranslation($value,$name) { // Array of target language strings @@ -303,10 +301,10 @@ class ComponentbuilderModelCustom_codes extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -346,11 +344,9 @@ class ComponentbuilderModelCustom_codes extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && $user->authorise('custom_code.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -446,16 +442,16 @@ class ComponentbuilderModelCustom_codes extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/dynamic_get.php b/admin/models/dynamic_get.php index 71c83878a..23cdea082 100644 --- a/admin/models/dynamic_get.php +++ b/admin/models/dynamic_get.php @@ -384,7 +384,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -495,18 +495,18 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -686,7 +686,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -784,7 +784,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -829,7 +829,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -1132,13 +1132,13 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/dynamic_gets.php b/admin/models/dynamic_gets.php index 6deff2c59..6e078e869 100644 --- a/admin/models/dynamic_gets.php +++ b/admin/models/dynamic_gets.php @@ -100,11 +100,9 @@ class ComponentbuilderModelDynamic_gets extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && $user->authorise('dynamic_get.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -132,10 +130,10 @@ class ComponentbuilderModelDynamic_gets extends JModelList } /** - * Method to convert selection values to translatable string. - * - * @return translatable string - */ + * Method to convert selection values to translatable string. + * + * @return translatable string + */ public function selectionTranslation($value,$name) { // Array of main_source language strings @@ -253,10 +251,10 @@ class ComponentbuilderModelDynamic_gets extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -296,11 +294,9 @@ class ComponentbuilderModelDynamic_gets extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && $user->authorise('dynamic_get.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -391,16 +387,16 @@ class ComponentbuilderModelDynamic_gets extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/field.php b/admin/models/field.php index 78369288e..ce4d851e4 100644 --- a/admin/models/field.php +++ b/admin/models/field.php @@ -282,7 +282,7 @@ class ComponentbuilderModelField extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -393,18 +393,18 @@ class ComponentbuilderModelField extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -584,7 +584,7 @@ class ComponentbuilderModelField extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -691,7 +691,7 @@ class ComponentbuilderModelField extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -736,7 +736,7 @@ class ComponentbuilderModelField extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -1024,13 +1024,13 @@ class ComponentbuilderModelField extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/fields.php b/admin/models/fields.php index c46e8803e..f3e3e90f2 100644 --- a/admin/models/fields.php +++ b/admin/models/fields.php @@ -124,11 +124,9 @@ class ComponentbuilderModelFields extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && $user->authorise('field.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && JFactory::getUser()->authorise('field.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -160,10 +158,10 @@ class ComponentbuilderModelFields extends JModelList } /** - * Method to convert selection values to translatable string. - * - * @return translatable string - */ + * Method to convert selection values to translatable string. + * + * @return translatable string + */ public function selectionTranslation($value,$name) { // Array of datatype language strings @@ -364,10 +362,10 @@ class ComponentbuilderModelFields extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -407,11 +405,9 @@ class ComponentbuilderModelFields extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && $user->authorise('field.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && JFactory::getUser()->authorise('field.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -500,16 +496,16 @@ class ComponentbuilderModelFields extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/fields/aliasbuilder.php b/admin/models/fields/aliasbuilder.php index 3c50d6b29..b5ca7834d 100644 --- a/admin/models/fields/aliasbuilder.php +++ b/admin/models/fields/aliasbuilder.php @@ -64,28 +64,36 @@ class JFormFieldAliasbuilder extends JFormFieldList } } } - $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.id','a.name','b.name'),array('id','name','type'))); - $query->from($db->quoteName('#__componentbuilder_field', 'a')); - $query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 'b') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('b.id') . ')'); - $query->where($db->quoteName('a.published') . ' >= 1'); // filter by fields linked if (ComponentbuilderHelper::checkArray($fieldIds)) { + // get list of field types that does not work in list views (note, spacer) + $spacers = ComponentbuilderHelper::getSpacerIds(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name','b.name'),array('id','name','type'))); + $query->from($db->quoteName('#__componentbuilder_field', 'a')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 'b') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('b.id') . ')'); + $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) + // none of these field types + if (ComponentbuilderHelper::checkArray($spacers)) { - $options[] = JHtml::_('select.option', $item->id, $item->name . ' [' . $item->type . ']'); + $query->where($db->quoteName('a.fieldtype') . ' NOT IN (' . implode(',', $spacers) . ')'); + } + $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 . ' [' . $item->type . ']'); + } + return $options; } } - return $options; + return array(JHtml::_('select.option', '', JText::_('COM_COMPONENTBUILDER_ADD_MORE_FIELDS_TO_THIS_ADMIN_VIEW'))); } } diff --git a/admin/models/fields/joinfields.php b/admin/models/fields/joinfields.php new file mode 100644 index 000000000..fc7adabf6 --- /dev/null +++ b/admin/models/fields/joinfields.php @@ -0,0 +1,109 @@ + + * @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)) + { + // get list of field types that does not work in list views (note, spacer) + $spacers = ComponentbuilderHelper::getSpacerIds(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name','t.name'),array('id','name','type'))); + $query->from($db->quoteName('#__componentbuilder_field', 'a')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 't') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('t.id') . ')'); + $query->where($db->quoteName('a.published') . ' >= 1'); + // only load these fields + $query->where($db->quoteName('a.id') . ' IN (' . implode(',', $fieldIds) . ')'); + // none of these field types + if (ComponentbuilderHelper::checkArray($spacers)) + { + $query->where($db->quoteName('a.fieldtype') . ' NOT IN (' . implode(',', $spacers) . ')'); + } + $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 . ' [' . $item->type . ']'); + } + } + return $options; + } + } + return array(JHtml::_('select.option', '', JText::_('COM_COMPONENTBUILDER_ADD_MORE_FIELDS_TO_THIS_ADMIN_VIEW'))); + } +} 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/fieldtype.php b/admin/models/fieldtype.php index 7afb6b358..033170b8d 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -121,10 +121,10 @@ class ComponentbuilderModelFieldtype extends JModelAdmin } /** - * Method to get list data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getWadfields() { // Get the user object. @@ -189,11 +189,9 @@ class ComponentbuilderModelFieldtype extends JModelAdmin // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && $user->authorise('field.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && JFactory::getUser()->authorise('field.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -225,10 +223,10 @@ class ComponentbuilderModelFieldtype extends JModelAdmin } /** - * Method to convert selection values to translatable string. - * - * @return translatable string - */ + * Method to convert selection values to translatable string. + * + * @return translatable string + */ public function selectionTranslationWadfields($value,$name) { // Array of datatype language strings @@ -503,7 +501,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -769,7 +767,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -876,7 +874,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -921,7 +919,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -1127,13 +1125,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/fieldtypes.php b/admin/models/fieldtypes.php index cd4350f15..e7b6afc44 100644 --- a/admin/models/fieldtypes.php +++ b/admin/models/fieldtypes.php @@ -108,11 +108,9 @@ class ComponentbuilderModelFieldtypes extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && $user->authorise('fieldtype.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -222,10 +220,10 @@ class ComponentbuilderModelFieldtypes extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -265,11 +263,9 @@ class ComponentbuilderModelFieldtypes extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && $user->authorise('fieldtype.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -346,16 +342,16 @@ class ComponentbuilderModelFieldtypes extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/forms/admin_fields_relations.js b/admin/models/forms/admin_fields_relations.js new file mode 100644 index 000000000..1e7b136ed --- /dev/null +++ b/admin/models/forms/admin_fields_relations.js @@ -0,0 +1,66 @@ +/** + * @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 + */ + + + + +// little script to set the value +function getCodeGlueOptions(field) { + // get the ID + var id = jQuery(field).attr('id'); + var target = id.split('__'); + //set the subID + var subID = target[0]+'__'+target[1]; + // get listfield value + var listfield = jQuery('#'+subID+'__listfield').val(); + // get joinfields values + var joinfields = jQuery('#'+subID+'__joinfields').val(); + // get type value + var type = jQuery('#'+subID+'__join_type').val(); + // get area value + var area = jQuery('#'+subID+'__area').val(); + // check that values are set + if (_isSet(listfield) && _isSet(joinfields) && _isSet(type) && _isSet(area)) { + // get codeGlueOptions + getCodeGlueOptions_server(listfield, joinfields, type, area).done(function(result) { + if(result){ + jQuery('#'+subID+'__set').val(result); + } else { + jQuery('#'+subID+'__set').val(''); + } + }); + } else { + jQuery('#'+subID+'__set').val(''); + } +} + +function getCodeGlueOptions_server(listfield, joinfields, type, area){ + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getCodeGlueOptions&format=json"; + if(token.length > 0 && listfield > 0 && joinfields.length >= 1 && type > 0 && area > 0) { + var request = 'token='+token+'&listfield='+listfield+'&type='+type+'&area='+area+'&joinfields='+joinfields; + } + return jQuery.ajax({ + type: 'GET', + url: getUrl, + dataType: 'jsonp', + data: request, + jsonp: 'callback' + }); +} + +// the isSet function +function _isSet(val) +{ + if ((val != undefined) && (val != null) && 0 !== val.length){ + return true; + } + return false; +} + diff --git a/admin/models/forms/admin_fields_relations.xml b/admin/models/forms/admin_fields_relations.xml new file mode 100644 index 000000000..e250e8df8 --- /dev/null +++ b/admin/models/forms/admin_fields_relations.xml @@ -0,0 +1,225 @@ + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + + + +
    + \ 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/get_snippets.php b/admin/models/get_snippets.php index 1e0e6fec3..1345f0f34 100644 --- a/admin/models/get_snippets.php +++ b/admin/models/get_snippets.php @@ -123,11 +123,11 @@ class ComponentbuilderModelGet_snippets extends JModelList /** - * Get the uikit needed components - * - * @return mixed An array of objects on success. - * - */ + * Get the uikit needed components + * + * @return mixed An array of objects on success. + * + */ public function getUikitComp() { if (isset($this->uikitComp) && ComponentbuilderHelper::checkArray($this->uikitComp)) diff --git a/admin/models/help_document.php b/admin/models/help_document.php index 1bdd0ea73..2a82a5397 100644 --- a/admin/models/help_document.php +++ b/admin/models/help_document.php @@ -232,7 +232,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -343,18 +343,18 @@ class ComponentbuilderModelHelp_document extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -534,7 +534,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -627,7 +627,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -672,7 +672,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -908,14 +908,14 @@ class ComponentbuilderModelHelp_document extends JModelAdmin } /** - * Method to change the title/s & alias. - * - * @param string $alias The alias. - * @param string/array $title The title. - * - * @return array/string Contains the modified title/s and/or alias. - * - */ + * Method to change the title/s & alias. + * + * @param string $alias The alias. + * @param string/array $title The title. + * + * @return array/string Contains the modified title/s and/or alias. + * + */ protected function _generateNewTitle($alias, $title = null) { diff --git a/admin/models/help_documents.php b/admin/models/help_documents.php index 364c5f090..4f0a3e9f9 100644 --- a/admin/models/help_documents.php +++ b/admin/models/help_documents.php @@ -108,11 +108,9 @@ class ComponentbuilderModelHelp_documents extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && $user->authorise('help_document.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -160,10 +158,10 @@ class ComponentbuilderModelHelp_documents extends JModelList } /** - * Method to convert selection values to translatable string. - * - * @return translatable string - */ + * Method to convert selection values to translatable string. + * + * @return translatable string + */ public function selectionTranslation($value,$name) { // Array of type language strings @@ -289,10 +287,10 @@ class ComponentbuilderModelHelp_documents extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -332,11 +330,9 @@ class ComponentbuilderModelHelp_documents extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && $user->authorise('help_document.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -413,16 +409,16 @@ class ComponentbuilderModelHelp_documents extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/import_joomla_components.php b/admin/models/import_joomla_components.php index 806899ba6..558d559ae 100644 --- a/admin/models/import_joomla_components.php +++ b/admin/models/import_joomla_components.php @@ -698,7 +698,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy $tables = array( 'validation_rule', 'fieldtype', 'field', 'admin_view', 'snippet', 'dynamic_get', 'custom_admin_view', 'site_view', 'template', 'layout', 'joomla_component', 'language', 'language_translation', 'custom_code', - 'admin_fields', 'admin_fields_conditions', 'component_admin_views', 'component_site_views', + 'admin_fields', 'admin_fields_conditions', 'admin_fields_relations', 'component_admin_views', 'component_site_views', 'component_custom_admin_views', 'component_updates', 'component_mysql_tweaks', 'component_custom_admin_menus', 'component_config', 'component_dashboard', 'component_files_folders' ); @@ -2009,12 +2009,14 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy break; case 'admin_fields': case 'admin_fields_conditions': + case 'admin_fields_relations': // diverged id already updated if (!$diverged) { // update the admin_view ID where needed $item = $this->setNewID($item, 'admin_view', 'admin_view', $type); } + $updaterR = array(); // set the updater if ('admin_fields' === $type) { @@ -2034,7 +2036,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy unset($item->addconditions); } } - else + elseif ('admin_fields_conditions' === $type) { // repeatable fields to update $updaterR = array( @@ -2047,10 +2049,20 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy 'addconditions' => array('target_field' => 'field', 'match_field' => 'field') ); } + elseif ('admin_fields_relations' === $type) + { + // subform fields to target + $updaterT = array( + // subformfield => field => type_value + 'addrelations' => array('listfield' => 'field', 'joinfields' => 'field') + ); + } // update the repeatable fields - $item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR); - + if (isset($updaterR) && ComponentbuilderHelper::checkArray($updaterR)) + { + $item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR); + } // update the subform ids $this->updateSubformsIDs($item, $type, $updaterT); } @@ -2390,6 +2402,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy { case 'admin_fields': case 'admin_fields_conditions': + case 'admin_fields_relations': // get by admin_view (since there should only be one of each name) $getter = array('admin_view'); $this->specialValue = array(); diff --git a/admin/models/joomla_component.php b/admin/models/joomla_component.php index c828309f8..ff8ce1484 100644 --- a/admin/models/joomla_component.php +++ b/admin/models/joomla_component.php @@ -412,7 +412,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -523,18 +523,18 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -770,7 +770,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -868,7 +868,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -913,7 +913,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -1231,13 +1231,13 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 148329fe3..0e02ca7cd 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -62,6 +62,7 @@ class ComponentbuilderModelJoomla_components extends JModelList 'getKeyFrom' => null ); public $activeType = 'export'; + public $backupType = 1; protected $params; protected $tempPath; @@ -307,11 +308,12 @@ class ComponentbuilderModelJoomla_components extends JModelList { $this->setData($table, $pks, $field); } - // add fields and conditions + // add fields conditions and relations if (isset($this->smartIDs['admin_view']) && ComponentbuilderHelper::checkArray($this->smartIDs['admin_view'])) { $this->setData('admin_fields', array_values($this->smartIDs['admin_view']), 'admin_view'); $this->setData('admin_fields_conditions', array_values($this->smartIDs['admin_view']), 'admin_view'); + $this->setData('admin_fields_relations', array_values($this->smartIDs['admin_view']), 'admin_view'); } // add validation rules if (isset($this->smartIDs['validation_rule']) && ComponentbuilderHelper::checkArray($this->smartIDs['validation_rule'])) @@ -715,10 +717,17 @@ class ComponentbuilderModelJoomla_components extends JModelList // actions to take if table is admin_fields_conditions if ('admin_fields_conditions' === $table) { - // add fields + // add fields (all should already be added) $this->setData('field', $this->getValues($item->addconditions, 'subform', 'target_field'), 'id'); $this->setData('field', $this->getValues($item->addconditions, 'subform', 'match_field'), 'id'); } + // actions to take if table is admin_fields_relations + if ('admin_fields_relations' === $table) + { + // add fields (all should already be added) + $this->setData('field', $this->getValues($item->addrelations, 'subform', 'listfield'), 'id'); + $this->setData('field', $this->getValues($item->addrelations, 'subform', 'joinfields'), 'id'); + } // actions to take if table is field if ('field' === $table) { @@ -847,7 +856,7 @@ class ComponentbuilderModelJoomla_components extends JModelList $tables = array( 'fieldtype', 'field', 'admin_view', 'snippet', 'dynamic_get', 'custom_admin_view', 'site_view', 'template', 'layout', 'joomla_component', 'language', 'language_translation', 'custom_code', - 'admin_fields', 'admin_fields_conditions', 'component_admin_views', 'component_site_views', + 'admin_fields', 'admin_fields_conditions', 'admin_fields_relations', 'component_admin_views', 'component_site_views', 'component_custom_admin_views', 'component_updates', 'component_mysql_tweaks', 'component_custom_admin_menus', 'component_config', 'component_dashboard', 'component_files_folders' ); @@ -1604,6 +1613,13 @@ class ComponentbuilderModelJoomla_components extends JModelList $targets['admin_view']['not_base64'] = array(); $targets['admin_view']['name'] = 'system_name'; + // #__componentbuilder_admin_fields_relations + $targets['library'] = array(); + $targets['library']['search'] = array('id', 'admin_view', 'addrelations'); + $targets['library']['view'] = 'admin_fields_relations'; + $targets['library']['not_base64'] = array('addrelations' => 'json'); + $targets['library']['name'] = 'admin_view->id:admin_view.system_name'; + // #__componentbuilder_custom_admin_view $targets['custom_admin_view'] = array(); $targets['custom_admin_view']['search'] = array('id', 'system_name', 'default','php_view','php_jview','php_jview_display','php_document', @@ -1651,7 +1667,6 @@ class ComponentbuilderModelJoomla_components extends JModelList // #__componentbuilder_library $targets['library'] = array(); - $targets['library']['view'] = 'libraries'; $targets['library']['search'] = array('id', 'name', 'php_setdocument'); $targets['library']['view'] = 'libraries'; $targets['library']['not_base64'] = array(); @@ -1748,11 +1763,9 @@ class ComponentbuilderModelJoomla_components extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && $user->authorise('joomla_component.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -1848,10 +1861,10 @@ class ComponentbuilderModelJoomla_components extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -1896,11 +1909,9 @@ class ComponentbuilderModelJoomla_components extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && $user->authorise('joomla_component.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -2022,16 +2033,16 @@ class ComponentbuilderModelJoomla_components extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/language.php b/admin/models/language.php index b875f46e2..74eda7f63 100644 --- a/admin/models/language.php +++ b/admin/models/language.php @@ -226,7 +226,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -492,7 +492,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -590,7 +590,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -635,7 +635,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -812,13 +812,13 @@ class ComponentbuilderModelLanguage extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/language_translation.php b/admin/models/language_translation.php index 48d594513..3b320fdfc 100644 --- a/admin/models/language_translation.php +++ b/admin/models/language_translation.php @@ -266,7 +266,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -532,7 +532,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -630,7 +630,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -675,7 +675,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -871,13 +871,13 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/language_translations.php b/admin/models/language_translations.php index ea9812b30..1f120e041 100644 --- a/admin/models/language_translations.php +++ b/admin/models/language_translations.php @@ -92,11 +92,9 @@ class ComponentbuilderModelLanguage_translations extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && $user->authorise('language_translation.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -271,10 +269,10 @@ class ComponentbuilderModelLanguage_translations extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -314,11 +312,9 @@ class ComponentbuilderModelLanguage_translations extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && $user->authorise('language_translation.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -477,16 +473,16 @@ class ComponentbuilderModelLanguage_translations extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/languages.php b/admin/models/languages.php index ad28eb89f..61ec24a1c 100644 --- a/admin/models/languages.php +++ b/admin/models/languages.php @@ -219,11 +219,9 @@ class ComponentbuilderModelLanguages extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && $user->authorise('language.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && JFactory::getUser()->authorise('language.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -309,10 +307,10 @@ class ComponentbuilderModelLanguages extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -352,11 +350,9 @@ class ComponentbuilderModelLanguages extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && $user->authorise('language.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && JFactory::getUser()->authorise('language.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -430,16 +426,16 @@ class ComponentbuilderModelLanguages extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/layout.php b/admin/models/layout.php index 4b22d41e5..3ffa15b96 100644 --- a/admin/models/layout.php +++ b/admin/models/layout.php @@ -272,7 +272,7 @@ class ComponentbuilderModelLayout extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -383,18 +383,18 @@ class ComponentbuilderModelLayout extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -574,7 +574,7 @@ class ComponentbuilderModelLayout extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -667,7 +667,7 @@ class ComponentbuilderModelLayout extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -712,7 +712,7 @@ class ComponentbuilderModelLayout extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -970,14 +970,14 @@ class ComponentbuilderModelLayout extends JModelAdmin } /** - * Method to change the title/s & alias. - * - * @param string $alias The alias. - * @param string/array $title The title. - * - * @return array/string Contains the modified title/s and/or alias. - * - */ + * Method to change the title/s & alias. + * + * @param string $alias The alias. + * @param string/array $title The title. + * + * @return array/string Contains the modified title/s and/or alias. + * + */ protected function _generateNewTitle($alias, $title = null) { diff --git a/admin/models/layouts.php b/admin/models/layouts.php index dbb8f5724..dd01fb700 100644 --- a/admin/models/layouts.php +++ b/admin/models/layouts.php @@ -104,11 +104,9 @@ class ComponentbuilderModelLayouts extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && $user->authorise('layout.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && JFactory::getUser()->authorise('layout.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -203,10 +201,10 @@ class ComponentbuilderModelLayouts extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -246,11 +244,9 @@ class ComponentbuilderModelLayouts extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && $user->authorise('layout.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && JFactory::getUser()->authorise('layout.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -330,16 +326,16 @@ class ComponentbuilderModelLayouts extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/libraries.php b/admin/models/libraries.php index 6b5bca78a..faca76a33 100644 --- a/admin/models/libraries.php +++ b/admin/models/libraries.php @@ -104,17 +104,19 @@ class ComponentbuilderModelLibraries extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('library.access', 'com_componentbuilder.library.' . (int) $item->id) && $user->authorise('library.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('library.access', 'com_componentbuilder.library.' . (int) $item->id) && JFactory::getUser()->authorise('library.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); continue; } + // convert how + $item->how = $this->selectionTranslation($item->how, 'how'); + + } } @@ -125,10 +127,6 @@ class ComponentbuilderModelLibraries extends JModelList { // convert type $item->type = $this->selectionTranslation($item->type, 'type'); - - // convert how - $item->how = $this->selectionTranslation($item->how, 'how'); - } } @@ -138,10 +136,10 @@ class ComponentbuilderModelLibraries extends JModelList } /** - * Method to convert selection values to translatable string. - * - * @return translatable string - */ + * Method to convert selection values to translatable string. + * + * @return translatable string + */ public function selectionTranslation($value,$name) { // Array of type language strings @@ -158,22 +156,22 @@ class ComponentbuilderModelLibraries extends JModelList } } - // Array of how language strings - if ($name === 'how') - { - $howArray = array( - 1 => 'COM_COMPONENTBUILDER_ALWAYS_ADD', - 2 => 'COM_COMPONENTBUILDER_CONDITIONS', - 3 => 'COM_COMPONENTBUILDER_CUSTOM_SCRIPT', - 4 => 'COM_COMPONENTBUILDER_BUILDIN', - 0 => 'COM_COMPONENTBUILDER_DO_NOT_ADD' - ); - // Now check if value is found in this array - if (isset($howArray[$value]) && ComponentbuilderHelper::checkString($howArray[$value])) - { - return JText::_($howArray[$value]); - } - } + // Array of how language strings + if ($name === 'how') + { + $howArray = array( + 1 => 'COM_COMPONENTBUILDER_ALWAYS_ADD', + 2 => 'COM_COMPONENTBUILDER_CONDITIONS', + 3 => 'COM_COMPONENTBUILDER_CUSTOM_SCRIPT', + 4 => 'COM_COMPONENTBUILDER_BUILDIN', + 0 => 'COM_COMPONENTBUILDER_DO_NOT_ADD' + ); + // Now check if value is found in this array + if (isset($howArray[$value]) && ComponentbuilderHelper::checkString($howArray[$value])) + { + return JText::_($howArray[$value]); + } + } return $value; } @@ -283,16 +281,16 @@ class ComponentbuilderModelLibraries extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/libraries_config.php b/admin/models/libraries_config.php index c3de4cdcc..7f6de9474 100644 --- a/admin/models/libraries_config.php +++ b/admin/models/libraries_config.php @@ -90,11 +90,9 @@ class ComponentbuilderModelLibraries_config extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('library_config.access', 'com_componentbuilder.library_config.' . (int) $item->id) && $user->authorise('library_config.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('library_config.access', 'com_componentbuilder.library_config.' . (int) $item->id) && JFactory::getUser()->authorise('library_config.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelLibraries_config extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/libraries_files_folders_urls.php b/admin/models/libraries_files_folders_urls.php index a8b0e89ad..68ee65daa 100644 --- a/admin/models/libraries_files_folders_urls.php +++ b/admin/models/libraries_files_folders_urls.php @@ -90,11 +90,9 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('library_files_folders_urls.access', 'com_componentbuilder.library_files_folders_urls.' . (int) $item->id) && $user->authorise('library_files_folders_urls.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('library_files_folders_urls.access', 'com_componentbuilder.library_files_folders_urls.' . (int) $item->id) && JFactory::getUser()->authorise('library_files_folders_urls.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -188,16 +186,16 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/library.php b/admin/models/library.php index ad76a10e1..066009219 100644 --- a/admin/models/library.php +++ b/admin/models/library.php @@ -274,7 +274,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -385,18 +385,18 @@ class ComponentbuilderModelLibrary extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -638,7 +638,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -736,7 +736,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -781,7 +781,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -1012,13 +1012,13 @@ class ComponentbuilderModelLibrary extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/library_config.php b/admin/models/library_config.php index 52a072d03..ff6351f6e 100644 --- a/admin/models/library_config.php +++ b/admin/models/library_config.php @@ -236,7 +236,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -502,7 +502,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -600,7 +600,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -645,7 +645,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -835,13 +835,13 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/library_files_folders_urls.php b/admin/models/library_files_folders_urls.php index 86d76c2f5..3a43dfe0b 100644 --- a/admin/models/library_files_folders_urls.php +++ b/admin/models/library_files_folders_urls.php @@ -268,7 +268,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -534,7 +534,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -632,7 +632,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -677,7 +677,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -919,13 +919,13 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { 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/models/server.php b/admin/models/server.php index 1e1d26cf8..a1d7483e4 100644 --- a/admin/models/server.php +++ b/admin/models/server.php @@ -152,10 +152,10 @@ class ComponentbuilderModelServer extends JModelAdmin } /** - * Method to get list data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getWanlinked_components() { // Get the user object. @@ -214,11 +214,9 @@ class ComponentbuilderModelServer extends JModelAdmin // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && $user->authorise('joomla_component.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -369,7 +367,7 @@ class ComponentbuilderModelServer extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -480,18 +478,18 @@ class ComponentbuilderModelServer extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -671,7 +669,7 @@ class ComponentbuilderModelServer extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -769,7 +767,7 @@ class ComponentbuilderModelServer extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -814,7 +812,7 @@ class ComponentbuilderModelServer extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -1050,13 +1048,13 @@ class ComponentbuilderModelServer extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/servers.php b/admin/models/servers.php index a4eeefecd..b35f4cdd5 100644 --- a/admin/models/servers.php +++ b/admin/models/servers.php @@ -96,11 +96,9 @@ class ComponentbuilderModelServers extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('server.access', 'com_componentbuilder.server.' . (int) $item->id) && $user->authorise('server.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('server.access', 'com_componentbuilder.server.' . (int) $item->id) && JFactory::getUser()->authorise('server.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -126,10 +124,10 @@ class ComponentbuilderModelServers extends JModelList } /** - * Method to convert selection values to translatable string. - * - * @return translatable string - */ + * Method to convert selection values to translatable string. + * + * @return translatable string + */ public function selectionTranslation($value,$name) { // Array of protocol language strings @@ -231,10 +229,10 @@ class ComponentbuilderModelServers extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -279,11 +277,9 @@ class ComponentbuilderModelServers extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('server.access', 'com_componentbuilder.server.' . (int) $item->id) && $user->authorise('server.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('server.access', 'com_componentbuilder.server.' . (int) $item->id) && JFactory::getUser()->authorise('server.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -402,16 +398,16 @@ class ComponentbuilderModelServers extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/site_view.php b/admin/models/site_view.php index 7d8415eeb..4624c8953 100644 --- a/admin/models/site_view.php +++ b/admin/models/site_view.php @@ -395,7 +395,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -506,18 +506,18 @@ class ComponentbuilderModelSite_view extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -697,7 +697,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -795,7 +795,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -840,7 +840,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -1149,13 +1149,13 @@ class ComponentbuilderModelSite_view extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/site_views.php b/admin/models/site_views.php index f72457865..069684d80 100644 --- a/admin/models/site_views.php +++ b/admin/models/site_views.php @@ -104,11 +104,9 @@ class ComponentbuilderModelSite_views extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('site_view.access', 'com_componentbuilder.site_view.' . (int) $item->id) && $user->authorise('site_view.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('site_view.access', 'com_componentbuilder.site_view.' . (int) $item->id) && JFactory::getUser()->authorise('site_view.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -198,10 +196,10 @@ class ComponentbuilderModelSite_views extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -241,11 +239,9 @@ class ComponentbuilderModelSite_views extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('site_view.access', 'com_componentbuilder.site_view.' . (int) $item->id) && $user->authorise('site_view.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('site_view.access', 'com_componentbuilder.site_view.' . (int) $item->id) && JFactory::getUser()->authorise('site_view.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -345,16 +341,16 @@ class ComponentbuilderModelSite_views extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/snippet.php b/admin/models/snippet.php index 6e250a9ff..4e4da37ca 100644 --- a/admin/models/snippet.php +++ b/admin/models/snippet.php @@ -232,7 +232,7 @@ class ComponentbuilderModelSnippet extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -498,7 +498,7 @@ class ComponentbuilderModelSnippet extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -596,7 +596,7 @@ class ComponentbuilderModelSnippet extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -641,7 +641,7 @@ class ComponentbuilderModelSnippet extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -842,13 +842,13 @@ class ComponentbuilderModelSnippet extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/snippet_type.php b/admin/models/snippet_type.php index 6e24d29b3..30004297e 100644 --- a/admin/models/snippet_type.php +++ b/admin/models/snippet_type.php @@ -226,7 +226,7 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -492,7 +492,7 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -590,7 +590,7 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -635,7 +635,7 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -812,13 +812,13 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/snippet_types.php b/admin/models/snippet_types.php index dafe3304a..56382df95 100644 --- a/admin/models/snippet_types.php +++ b/admin/models/snippet_types.php @@ -96,11 +96,9 @@ class ComponentbuilderModelSnippet_types extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('snippet_type.access', 'com_componentbuilder.snippet_type.' . (int) $item->id) && $user->authorise('snippet_type.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('snippet_type.access', 'com_componentbuilder.snippet_type.' . (int) $item->id) && JFactory::getUser()->authorise('snippet_type.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -207,16 +205,16 @@ class ComponentbuilderModelSnippet_types extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/snippets.php b/admin/models/snippets.php index ae50694b0..007a2171d 100644 --- a/admin/models/snippets.php +++ b/admin/models/snippets.php @@ -222,11 +222,9 @@ class ComponentbuilderModelSnippets extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('snippet.access', 'com_componentbuilder.snippet.' . (int) $item->id) && $user->authorise('snippet.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('snippet.access', 'com_componentbuilder.snippet.' . (int) $item->id) && JFactory::getUser()->authorise('snippet.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -330,10 +328,10 @@ class ComponentbuilderModelSnippets extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -373,11 +371,9 @@ class ComponentbuilderModelSnippets extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('snippet.access', 'com_componentbuilder.snippet.' . (int) $item->id) && $user->authorise('snippet.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('snippet.access', 'com_componentbuilder.snippet.' . (int) $item->id) && JFactory::getUser()->authorise('snippet.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -456,16 +452,16 @@ class ComponentbuilderModelSnippets extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/template.php b/admin/models/template.php index dbcc09f7d..2c964297e 100644 --- a/admin/models/template.php +++ b/admin/models/template.php @@ -272,7 +272,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -383,18 +383,18 @@ class ComponentbuilderModelTemplate extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -574,7 +574,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -667,7 +667,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -712,7 +712,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -970,14 +970,14 @@ class ComponentbuilderModelTemplate extends JModelAdmin } /** - * Method to change the title/s & alias. - * - * @param string $alias The alias. - * @param string/array $title The title. - * - * @return array/string Contains the modified title/s and/or alias. - * - */ + * Method to change the title/s & alias. + * + * @param string $alias The alias. + * @param string/array $title The title. + * + * @return array/string Contains the modified title/s and/or alias. + * + */ protected function _generateNewTitle($alias, $title = null) { diff --git a/admin/models/templates.php b/admin/models/templates.php index 7330d4f4a..c50775e90 100644 --- a/admin/models/templates.php +++ b/admin/models/templates.php @@ -100,11 +100,9 @@ class ComponentbuilderModelTemplates extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('template.access', 'com_componentbuilder.template.' . (int) $item->id) && $user->authorise('template.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('template.access', 'com_componentbuilder.template.' . (int) $item->id) && JFactory::getUser()->authorise('template.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -194,10 +192,10 @@ class ComponentbuilderModelTemplates extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -237,11 +235,9 @@ class ComponentbuilderModelTemplates extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('template.access', 'com_componentbuilder.template.' . (int) $item->id) && $user->authorise('template.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('template.access', 'com_componentbuilder.template.' . (int) $item->id) && JFactory::getUser()->authorise('template.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -320,16 +316,16 @@ class ComponentbuilderModelTemplates extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/models/validation_rule.php b/admin/models/validation_rule.php index 44bc94906..325bf2a38 100644 --- a/admin/models/validation_rule.php +++ b/admin/models/validation_rule.php @@ -258,7 +258,7 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -524,7 +524,7 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -622,7 +622,7 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -667,7 +667,7 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -850,13 +850,13 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/validation_rules.php b/admin/models/validation_rules.php index fb1f39ec7..8ae07f5a0 100644 --- a/admin/models/validation_rules.php +++ b/admin/models/validation_rules.php @@ -96,11 +96,9 @@ class ComponentbuilderModelValidation_rules extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('validation_rule.access', 'com_componentbuilder.validation_rule.' . (int) $item->id) && $user->authorise('validation_rule.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('validation_rule.access', 'com_componentbuilder.validation_rule.' . (int) $item->id) && JFactory::getUser()->authorise('validation_rule.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -186,10 +184,10 @@ class ComponentbuilderModelValidation_rules extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -229,11 +227,9 @@ class ComponentbuilderModelValidation_rules extends JModelList // set values to display correctly. if (ComponentbuilderHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('validation_rule.access', 'com_componentbuilder.validation_rule.' . (int) $item->id) && $user->authorise('validation_rule.access', 'com_componentbuilder')); + $access = (JFactory::getUser()->authorise('validation_rule.access', 'com_componentbuilder.validation_rule.' . (int) $item->id) && JFactory::getUser()->authorise('validation_rule.access', 'com_componentbuilder')); if (!$access) { unset($items[$nr]); @@ -309,16 +305,16 @@ class ComponentbuilderModelValidation_rules extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * 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) { diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index b905feafd..bafe37946 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.', @@ -1499,7 +1525,7 @@ INSERT INTO `#__componentbuilder_fieldtype` (`id`, `catid`, `description`, `name (3, '', 'The checkbox form field type provides a single checkbox. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Checkbox', '{\"properties0\":{\"name\":\"type\",\"example\":\"checkbox\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be checkbox\"},\"properties1\":{\"name\":\"name\",\"example\":\"show_title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Show title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"value\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) is the value of the parameter if this checkbox is set (usually 1).\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value (usually 0 or 1).\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Show the title of the item\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties7\":{\"name\":\"class\",\"example\":\"inputbox\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (JavaScript use)\"}}', 'provides a single checkbox to be checked or unchecked', '', 1, 4, '', ''), (4, '', 'The checkboxes form field type provides a set of checkboxes. Note: unlike most standard form field types, such as textfield or checkbox, this field is not an \"out of the box\" solution. It will create checkboxes for you, and submit their values in form of ', 'Checkboxes', '{\"properties0\":{\"name\":\"type\",\"example\":\"checkboxes\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be checkboxs\"},\"properties1\":{\"name\":\"name\",\"example\":\"toppings\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select Toppings\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"option\",\"example\":\"anch|Anchovies,chor|Chorizo,on|Onions,mush|Mushrooms\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the default value.\"},\"properties5\":{\"name\":\"description\",\"example\":\"Select the topping of your choice\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides unlimited checkboxes that can be used for multi-select.', '', 1, 2, '', ''), (5, '', 'Provides a color picker. Enter the color as #ff00ff or pick it from the palet.', 'Color', '{\"properties0\":{\"name\":\"type\",\"example\":\"color\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be color.\"},\"properties1\":{\"name\":\"name\",\"example\":\"backgroundcolor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"default\",\"example\":\"#FFFFFF\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) provides a color when not set.\"},\"properties3\":{\"name\":\"label\",\"example\":\"Background\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Select the background color here.\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) tooltip for the form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides a color picker when clicking the input box.', '', 1, 2, '', ''), -(6, '', 'The list form field type provides a drop down list or a list box of other current component table entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Custom', '{\"properties0\":{\"name\":\"type\",\"example\":\"subjects\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a Subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties14\":{\"name\":\"extends\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties15\":{\"name\":\"button\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) to add new button next to field in edit view\"},\"properties16\":{\"name\":\"table\",\"example\":\"#__###component###_subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. The ###TABLE### placeholder holds the table in the php.\"},\"properties17\":{\"name\":\"component\",\"example\":\"com_###component###\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties18\":{\"name\":\"view\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties19\":{\"name\":\"views\",\"example\":\"subjects\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties20\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to. The ###TEXT### placeholder holds the value_field in the php.\"},\"properties21\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key. The ###ID### placeholder holds the key_field in the php.\"},\"properties22\":{\"name\":\"prime_php\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"This field makes sure that the PHP used here is used to build the field type, and other are custom fields with the same field type are ignored. So to avoid that they over write the PHP added here. You should only have one prime per\\/type. To disable remove the field or set to 0\"},\"properties23\":{\"name\":\"type_php_1\",\"example\":\"$db = JFactory::getDBO();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties24\":{\"name\":\"type_php_2\",\"example\":\"$query = $db->getQuery(true);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties25\":{\"name\":\"type_php_3\",\"example\":\"$query->select($db->quoteName(array(\'a.###ID###\',\'a.###TEXT###\'),array(\'###ID###\',\'###CODE_TEXT###\')));\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties26\":{\"name\":\"type_php_4\",\"example\":\"$query->from($db->quoteName(\'###TABLE###\', \'a\'));\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties27\":{\"name\":\"type_php_5\",\"example\":\"$query->where($db->quoteName(\'a.published\') . \' = 1\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties28\":{\"name\":\"type_php_6\",\"example\":\"$query->order(\'a.###TEXT### ASC\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties29\":{\"name\":\"type_php_7\",\"example\":\"$db->setQuery((string)$query);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties30\":{\"name\":\"type_php_8\",\"example\":\"$items = $db->loadObjectList();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties31\":{\"name\":\"type_php_9\",\"example\":\"$options = array();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties32\":{\"name\":\"type_php_10\",\"example\":\"if ($items)\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties33\":{\"name\":\"type_php_11\",\"example\":\"{\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties34\":{\"name\":\"type_php_12\",\"example\":\"\\\\t$options[] = JHtml::_(\'select.option\', \'\', \'Select an option\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties35\":{\"name\":\"type_php_13\",\"example\":\"\\\\tforeach($items as $item)\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties36\":{\"name\":\"type_php_14\",\"example\":\"\\\\t{\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties37\":{\"name\":\"type_php_15\",\"example\":\"\\\\t\\\\t$options[] = JHtml::_(\'select.option\', $item->###ID###, $item->###CODE_TEXT###);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties38\":{\"name\":\"type_php_16\",\"example\":\"\\\\t}\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties39\":{\"name\":\"type_php_17\",\"example\":\"}\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties40\":{\"name\":\"type_php_18\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties41\":{\"name\":\"type_php_19\",\"example\":\"return $options;\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"}}', 'provides a drop down list of items entries.', '', 1, 9, '', ''), +(6, '', 'The list form field type provides a drop down list or a list box of other current component table entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Custom', '{\"properties0\":{\"name\":\"type\",\"example\":\"subjects\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a Subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties14\":{\"name\":\"extends\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties15\":{\"name\":\"button\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) to add new button next to field in edit view\"},\"properties16\":{\"name\":\"table\",\"example\":\"#__###component###_subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. The ###TABLE### placeholder holds the table in the php.\"},\"properties17\":{\"name\":\"component\",\"example\":\"com_###component###\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties18\":{\"name\":\"view\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties19\":{\"name\":\"views\",\"example\":\"subjects\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties20\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to. The ###TEXT### placeholder holds the value_field in the php.\"},\"properties21\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key. The ###ID### placeholder holds the key_field in the php.\"},\"properties22\":{\"name\":\"prime_php\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"This field makes sure that the PHP used here is used to build the field type, and other are custom fields with the same field type are ignored. So to avoid that they over write the PHP added here. You should only have one prime per\\/type. To disable remove the field or set to 0\"},\"properties23\":{\"name\":\"type_php_1\",\"example\":\"$db = JFactory::getDBO();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties24\":{\"name\":\"type_php_2\",\"example\":\"$query = $db->getQuery(true);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties25\":{\"name\":\"type_php_3\",\"example\":\"$query->select($db->quoteName(array(\'a.###ID###\',\'a.###TEXT###\'),array(\'###ID###\',\'###CODE_TEXT###\')));\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties26\":{\"name\":\"type_php_4\",\"example\":\"$query->from($db->quoteName(\'###TABLE###\', \'a\'));\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties27\":{\"name\":\"type_php_5\",\"example\":\"$query->where($db->quoteName(\'a.published\') . \' = 1\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties28\":{\"name\":\"type_php_6\",\"example\":\"$query->order(\'a.###TEXT### ASC\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties29\":{\"name\":\"type_php_7\",\"example\":\"$db->setQuery((string)$query);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties30\":{\"name\":\"type_php_8\",\"example\":\"$items = $db->loadObjectList();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties31\":{\"name\":\"type_php_9\",\"example\":\"$options = array();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties32\":{\"name\":\"type_php_10\",\"example\":\"if ($items)\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties33\":{\"name\":\"type_php_11\",\"example\":\"{\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties34\":{\"name\":\"type_php_12\",\"example\":\"\\\\t$options[] = JHtml::_(\'select.option\', \'\', \'Select an option\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties35\":{\"name\":\"type_php_13\",\"example\":\"\\\\tforeach($items as $item)\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties36\":{\"name\":\"type_php_14\",\"example\":\"\\\\t{\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties37\":{\"name\":\"type_php_15\",\"example\":\"\\\\t\\\\t$options[] = JHtml::_(\'select.option\', $item->###ID###, $item->###CODE_TEXT###);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties38\":{\"name\":\"type_php_16\",\"example\":\"\\\\t}\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties39\":{\"name\":\"type_php_17\",\"example\":\"}\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties40\":{\"name\":\"type_php_18\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties41\":{\"name\":\"type_php_19\",\"example\":\"return $options;\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"}}', 'provides a drop down list of items entries.', '', 1, 10, '', ''), (7, '', 'The a list of users that can be targeting one or more groups and excluded users that already belongs to an item in a view.', 'CustomUser', '{\"properties0\":{\"name\":\"type\",\"example\":\"staffusers\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties8\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties9\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"\"},\"properties10\":{\"name\":\"hint\",\"example\":\"select a user\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties12\":{\"name\":\"extends\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties13\":{\"name\":\"table\",\"example\":\"#__users\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The table being linked to. Must be #__users\"},\"properties14\":{\"name\":\"component\",\"example\":\"com_users\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties15\":{\"name\":\"view\",\"example\":\"###view###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties16\":{\"name\":\"views\",\"example\":\"###views###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties17\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The name of the text field in table linked to.\"},\"properties18\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key.\"},\"properties19\":{\"name\":\"type_php_1\",\"example\":\"\\/\\/ set the groups array\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getGroups method.\"},\"properties20\":{\"name\":\"type_php_2\",\"example\":\"$groups = JComponentHelper::getParams(\'com_###component###\')->get(\'###type###\');\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getGroups method.\"},\"properties21\":{\"name\":\"type_php_3\",\"example\":\"return $groups;\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getGroups method.\"},\"properties22\":{\"name\":\"type_phpx_1\",\"example\":\"\\/\\/ To ensure that there is only one record per user\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties23\":{\"name\":\"type_phpx_2\",\"example\":\"\\/\\/ Get a db connection.\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties24\":{\"name\":\"type_phpx_3\",\"example\":\"$db = JFactory::getDbo();\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties25\":{\"name\":\"type_phpx_4\",\"example\":\"\\/\\/ Create a new query object.\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties26\":{\"name\":\"type_phpx_5\",\"example\":\"$query = $db->getQuery(true);\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties27\":{\"name\":\"type_phpx_6\",\"example\":\"\\/\\/ Select all records from the #__###component###_###view### table from ###CODE### column\\\".\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties28\":{\"name\":\"type_phpx_7\",\"example\":\"$query->select($db->quoteName(\'###CODE###\'));\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties29\":{\"name\":\"type_phpx_8\",\"example\":\"$query->from($db->quoteName(\'#__###component###_###view###\'));\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties30\":{\"name\":\"type_phpx_9\",\"example\":\"$db->setQuery($query);\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties31\":{\"name\":\"type_phpx_10\",\"example\":\"$db->execute();\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties32\":{\"name\":\"type_phpx_11\",\"example\":\"$found = $db->getNumRows();\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties33\":{\"name\":\"type_phpx_12\",\"example\":\"if ($found)\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties34\":{\"name\":\"type_phpx_13\",\"example\":\"{\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties35\":{\"name\":\"type_phpx_14\",\"example\":\"\\\\t\\/\\/ return all users already used\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties36\":{\"name\":\"type_phpx_15\",\"example\":\"\\\\treturn array_unique($db->loadColumn());\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties37\":{\"name\":\"type_phpx_16\",\"example\":\"}\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties38\":{\"name\":\"type_phpx_17\",\"example\":\"return null;\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"}}', 'Provides list of users.', '', 1, 2, '', ''), (8, '', 'The Editor field type provides a WYSIWYG editor.', 'Editor', '{\"properties0\":{\"name\":\"type\",\"example\":\"editor\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be editor.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextblock\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Test Field\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"Some text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties16\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties4\":{\"name\":\"width\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width (in pixels) of the wysiwyg editor and defaults to 100%.\"},\"properties5\":{\"name\":\"height\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height (in pixels) of the wysiwyg editor and defaults to 250px.\"},\"properties6\":{\"name\":\"cols\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width of the editor (in columns).\"},\"properties7\":{\"name\":\"rows\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height of the editor (in rows).\"},\"properties8\":{\"name\":\"buttons\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) can be an array of plugin buttons to be excluded or set to false. The default editors-xtd are: article, image, pagebreak and readmore.\"},\"properties9\":{\"name\":\"hide\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) array of plugin buttons to be hidden. eg... set buttons=\\\"true\\\" hide=\\\"readmore,pagebreak\\\"\"},\"properties10\":{\"name\":\"editor\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"specifies the editor to be used and can include two options (editor=\\\"desired|alternative\\\")\"},\"properties11\":{\"name\":\"filter\",\"example\":\"safehtml\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties15\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides an editor area field.', '', 1, 5, '', ''), (9, '', 'The hidden form field type provides a hidden field for saving a field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the params.ini file). If the parameter has a saved value this is entered i', 'Hidden', '{\"properties0\":{\"name\":\"type\",\"example\":\"hidden\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be hidden.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mysecretvariable\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"default\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the data which needs to be collected.\"},\"properties5\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties4\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"}}', 'provides a hidden field for saving a form field whose value cannot be altered directly by a user.', '', 1, 2, '', ''), @@ -1644,6 +1670,16 @@ 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, '', 14, 1, '2018-05-22 01:20:34', '2018-05-23 03:37:27', 9, '', 1), +(2, '', 22, 1, '2018-05-23 03:38:52', '2018-05-26 07:37:25', 18, '', 2), +(3, '', 13, 1, '2018-05-24 17:04:40', '2018-05-24 17:12:52', 4, '', 3), +(4, '{\"addrelations0\":{\"listfield\":\"913\",\"column_name\":\"Preacher Details\",\"joinfields\":[\"691\"],\"area\":\"2\",\"join_type\":\"1\",\"set\":\"
    \"}}', 54, 1, '2018-05-28 07:00:41', '2018-05-28 09:45:25', 7, '', 4); + -- -- 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..d3f20abd7 --- /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.php b/admin/tables/admin_fields.php index cf469158b..7bd14c130 100644 --- a/admin/tables/admin_fields.php +++ b/admin/tables/admin_fields.php @@ -312,10 +312,10 @@ class ComponentbuilderTableAdmin_fields extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/admin_fields_conditions.php b/admin/tables/admin_fields_conditions.php index 69007558e..f7783e2af 100644 --- a/admin/tables/admin_fields_conditions.php +++ b/admin/tables/admin_fields_conditions.php @@ -312,10 +312,10 @@ class ComponentbuilderTableAdmin_fields_conditions extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/admin_fields_relations.php b/admin/tables/admin_fields_relations.php new file mode 100644 index 000000000..000373dc2 --- /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/tables/admin_view.php b/admin/tables/admin_view.php index 87781ed2d..81fbf0dfa 100644 --- a/admin/tables/admin_view.php +++ b/admin/tables/admin_view.php @@ -312,10 +312,10 @@ class ComponentbuilderTableAdmin_view extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/component_admin_views.php b/admin/tables/component_admin_views.php index d21360875..13e2a906f 100644 --- a/admin/tables/component_admin_views.php +++ b/admin/tables/component_admin_views.php @@ -312,10 +312,10 @@ class ComponentbuilderTableComponent_admin_views extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/component_config.php b/admin/tables/component_config.php index 6ac16f875..96a308620 100644 --- a/admin/tables/component_config.php +++ b/admin/tables/component_config.php @@ -312,10 +312,10 @@ class ComponentbuilderTableComponent_config extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/component_custom_admin_menus.php b/admin/tables/component_custom_admin_menus.php index 9ee12ac4f..4ae63178a 100644 --- a/admin/tables/component_custom_admin_menus.php +++ b/admin/tables/component_custom_admin_menus.php @@ -312,10 +312,10 @@ class ComponentbuilderTableComponent_custom_admin_menus extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/component_custom_admin_views.php b/admin/tables/component_custom_admin_views.php index 4238d4639..93f67e821 100644 --- a/admin/tables/component_custom_admin_views.php +++ b/admin/tables/component_custom_admin_views.php @@ -312,10 +312,10 @@ class ComponentbuilderTableComponent_custom_admin_views extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/component_dashboard.php b/admin/tables/component_dashboard.php index 5d8858c1b..06ee0160c 100644 --- a/admin/tables/component_dashboard.php +++ b/admin/tables/component_dashboard.php @@ -312,10 +312,10 @@ class ComponentbuilderTableComponent_dashboard extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/component_files_folders.php b/admin/tables/component_files_folders.php index e0e48a3be..cb02f6e99 100644 --- a/admin/tables/component_files_folders.php +++ b/admin/tables/component_files_folders.php @@ -312,10 +312,10 @@ class ComponentbuilderTableComponent_files_folders extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/component_mysql_tweaks.php b/admin/tables/component_mysql_tweaks.php index afb498b05..84a034cce 100644 --- a/admin/tables/component_mysql_tweaks.php +++ b/admin/tables/component_mysql_tweaks.php @@ -312,10 +312,10 @@ class ComponentbuilderTableComponent_mysql_tweaks extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/component_site_views.php b/admin/tables/component_site_views.php index 7f1a8d84d..4134c8407 100644 --- a/admin/tables/component_site_views.php +++ b/admin/tables/component_site_views.php @@ -312,10 +312,10 @@ class ComponentbuilderTableComponent_site_views extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/component_updates.php b/admin/tables/component_updates.php index 426d103ab..727c952fd 100644 --- a/admin/tables/component_updates.php +++ b/admin/tables/component_updates.php @@ -312,10 +312,10 @@ class ComponentbuilderTableComponent_updates extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/custom_admin_view.php b/admin/tables/custom_admin_view.php index 8b3cf3d67..11d2825e8 100644 --- a/admin/tables/custom_admin_view.php +++ b/admin/tables/custom_admin_view.php @@ -312,10 +312,10 @@ class ComponentbuilderTableCustom_admin_view extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/custom_code.php b/admin/tables/custom_code.php index b8abc33ac..2e15d9efb 100644 --- a/admin/tables/custom_code.php +++ b/admin/tables/custom_code.php @@ -312,10 +312,10 @@ class ComponentbuilderTableCustom_code extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/dynamic_get.php b/admin/tables/dynamic_get.php index e75d67db6..0986572b7 100644 --- a/admin/tables/dynamic_get.php +++ b/admin/tables/dynamic_get.php @@ -312,10 +312,10 @@ class ComponentbuilderTableDynamic_get extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/field.php b/admin/tables/field.php index 15bf9973a..99044ff1c 100644 --- a/admin/tables/field.php +++ b/admin/tables/field.php @@ -312,10 +312,10 @@ class ComponentbuilderTableField extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/fieldtype.php b/admin/tables/fieldtype.php index 9a27ec8cd..7e0b4630f 100644 --- a/admin/tables/fieldtype.php +++ b/admin/tables/fieldtype.php @@ -312,10 +312,10 @@ class ComponentbuilderTableFieldtype extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/help_document.php b/admin/tables/help_document.php index 61e703552..1c3c12db9 100644 --- a/admin/tables/help_document.php +++ b/admin/tables/help_document.php @@ -312,11 +312,11 @@ class ComponentbuilderTableHelp_document extends JTable } /** - * Generate a valid alias from title / date. - * Remains public to be able to check for duplicated alias before saving - * - * @return string - */ + * Generate a valid alias from title / date. + * Remains public to be able to check for duplicated alias before saving + * + * @return string + */ public function generateAlias() { if (empty($this->alias)) diff --git a/admin/tables/joomla_component.php b/admin/tables/joomla_component.php index 68591981a..376403cc8 100644 --- a/admin/tables/joomla_component.php +++ b/admin/tables/joomla_component.php @@ -312,10 +312,10 @@ class ComponentbuilderTableJoomla_component extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/language.php b/admin/tables/language.php index fe5ae6b9c..d11a50f15 100644 --- a/admin/tables/language.php +++ b/admin/tables/language.php @@ -312,10 +312,10 @@ class ComponentbuilderTableLanguage extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/language_translation.php b/admin/tables/language_translation.php index dfa47e2a1..c459f6a23 100644 --- a/admin/tables/language_translation.php +++ b/admin/tables/language_translation.php @@ -312,10 +312,10 @@ class ComponentbuilderTableLanguage_translation extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/layout.php b/admin/tables/layout.php index 491dae4be..ea96bbdf6 100644 --- a/admin/tables/layout.php +++ b/admin/tables/layout.php @@ -312,11 +312,11 @@ class ComponentbuilderTableLayout extends JTable } /** - * Generate a valid alias from title / date. - * Remains public to be able to check for duplicated alias before saving - * - * @return string - */ + * Generate a valid alias from title / date. + * Remains public to be able to check for duplicated alias before saving + * + * @return string + */ public function generateAlias() { if (empty($this->alias)) diff --git a/admin/tables/library.php b/admin/tables/library.php index 84f433cab..04c629e21 100644 --- a/admin/tables/library.php +++ b/admin/tables/library.php @@ -312,10 +312,10 @@ class ComponentbuilderTableLibrary extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/library_config.php b/admin/tables/library_config.php index abf0b0167..2bf6c4c61 100644 --- a/admin/tables/library_config.php +++ b/admin/tables/library_config.php @@ -312,10 +312,10 @@ class ComponentbuilderTableLibrary_config extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/library_files_folders_urls.php b/admin/tables/library_files_folders_urls.php index 0a0060d33..e923ee242 100644 --- a/admin/tables/library_files_folders_urls.php +++ b/admin/tables/library_files_folders_urls.php @@ -312,10 +312,10 @@ class ComponentbuilderTableLibrary_files_folders_urls extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/server.php b/admin/tables/server.php index b0eb874df..3705b7f36 100644 --- a/admin/tables/server.php +++ b/admin/tables/server.php @@ -312,10 +312,10 @@ class ComponentbuilderTableServer extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/site_view.php b/admin/tables/site_view.php index 939477810..5e9df15ac 100644 --- a/admin/tables/site_view.php +++ b/admin/tables/site_view.php @@ -312,10 +312,10 @@ class ComponentbuilderTableSite_view extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/snippet.php b/admin/tables/snippet.php index 1335b2b33..24c87cd72 100644 --- a/admin/tables/snippet.php +++ b/admin/tables/snippet.php @@ -312,10 +312,10 @@ class ComponentbuilderTableSnippet extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/snippet_type.php b/admin/tables/snippet_type.php index 1574b9a9e..00785f494 100644 --- a/admin/tables/snippet_type.php +++ b/admin/tables/snippet_type.php @@ -312,10 +312,10 @@ class ComponentbuilderTableSnippet_type extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * This view does not actually have an alias + * + * @return bool + */ public function generateAlias() { return false; diff --git a/admin/tables/template.php b/admin/tables/template.php index 8e6697b0f..bbd3e4c0f 100644 --- a/admin/tables/template.php +++ b/admin/tables/template.php @@ -312,11 +312,11 @@ class ComponentbuilderTableTemplate extends JTable } /** - * Generate a valid alias from title / date. - * Remains public to be able to check for duplicated alias before saving - * - * @return string - */ + * Generate a valid alias from title / date. + * Remains public to be able to check for duplicated alias before saving + * + * @return string + */ public function generateAlias() { if (empty($this->alias)) diff --git a/admin/tables/validation_rule.php b/admin/tables/validation_rule.php index a47fd5818..12e887e48 100644 --- a/admin/tables/validation_rule.php +++ b/admin/tables/validation_rule.php @@ -312,10 +312,10 @@ class ComponentbuilderTableValidation_rule extends JTable } /** - * This view does not actually have an alias - * - * @return bool - */ + * 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..fb821e443 100644 --- a/admin/views/admin_views/tmpl/default_body.php +++ b/admin/views/admin_views/tmpl/default_body.php @@ -61,25 +61,28 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view. - get('admin_view.edit')): ?> -
    +
    + get('admin_view.edit')): ?> escape($item->system_name); ?> checked_out): ?> name, $item->checked_out_time, 'admin_views.', $canCheckin); ?> -
    - -
    escape($item->system_name); ?>
    - + + escape($item->system_name); ?> + +
    -
    - get('admin_view.edit') && $admin_field_id = ComponentbuilderHelper::getVar('admin_fields', $item->id, 'admin_view', 'id')): ?> - - - get('admin_view.edit') && $admin_condition_id = ComponentbuilderHelper::getVar('admin_fields_conditions', $item->id, 'admin_view', 'id')): ?> - - -
    +
    + 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/tmpl/default_body.php b/admin/views/admins_fields/tmpl/default_body.php index 7f2192afc..bb188db2f 100644 --- a/admin/views/admins_fields/tmpl/default_body.php +++ b/admin/views/admins_fields/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields&task=admin_fie - get('admin_fields.edit')): ?> -
    +
    + get('admin_fields.edit')): ?> escape($item->admin_view_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'admins_fields.', $canCheckin); ?> -
    - -
    escape($item->admin_view_system_name); ?>
    - + + escape($item->admin_view_system_name); ?> + +
    get('admin_fields.edit.state')) : ?> diff --git a/admin/views/admins_fields_conditions/tmpl/default_body.php b/admin/views/admins_fields_conditions/tmpl/default_body.php index 53a80f3a8..1c07fa01d 100644 --- a/admin/views/admins_fields_conditions/tmpl/default_body.php +++ b/admin/views/admins_fields_conditions/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_conditions&tas - get('admin_fields_conditions.edit')): ?> -
    +
    + get('admin_fields_conditions.edit')): ?> escape($item->admin_view_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'admins_fields_conditions.', $canCheckin); ?> -
    - -
    escape($item->admin_view_system_name); ?>
    - + + escape($item->admin_view_system_name); ?> + +
    get('admin_fields_conditions.edit.state')) : ?> 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..064f68df9 --- /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/admin/views/components_admin_views/tmpl/default_body.php b/admin/views/components_admin_views/tmpl/default_body.php index 234268503..f137f3620 100644 --- a/admin/views/components_admin_views/tmpl/default_body.php +++ b/admin/views/components_admin_views/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_admin_views&task= - get('component_admin_views.edit')): ?> -
    +
    + get('component_admin_views.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_admin_views.', $canCheckin); ?> -
    - -
    escape($item->joomla_component_system_name); ?>
    - + + escape($item->joomla_component_system_name); ?> + +
    get('component_admin_views.edit.state')) : ?> diff --git a/admin/views/components_config/tmpl/default_body.php b/admin/views/components_config/tmpl/default_body.php index cab3c9d11..671159739 100644 --- a/admin/views/components_config/tmpl/default_body.php +++ b/admin/views/components_config/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_config&task=compo - get('component_config.edit')): ?> -
    +
    + get('component_config.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_config.', $canCheckin); ?> -
    - -
    escape($item->joomla_component_system_name); ?>
    - + + escape($item->joomla_component_system_name); ?> + +
    get('component_config.edit.state')) : ?> diff --git a/admin/views/components_custom_admin_menus/tmpl/default_body.php b/admin/views/components_custom_admin_menus/tmpl/default_body.php index b79861a29..f125f448c 100644 --- a/admin/views/components_custom_admin_menus/tmpl/default_body.php +++ b/admin/views/components_custom_admin_menus/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_custom_admin_menu - get('component_custom_admin_menus.edit')): ?> -
    +
    + get('component_custom_admin_menus.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_custom_admin_menus.', $canCheckin); ?> -
    - -
    escape($item->joomla_component_system_name); ?>
    - + + escape($item->joomla_component_system_name); ?> + +
    get('component_custom_admin_menus.edit.state')) : ?> diff --git a/admin/views/components_custom_admin_views/tmpl/default_body.php b/admin/views/components_custom_admin_views/tmpl/default_body.php index de47e1a18..5d8a10ef2 100644 --- a/admin/views/components_custom_admin_views/tmpl/default_body.php +++ b/admin/views/components_custom_admin_views/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_custom_admin_view - get('component_custom_admin_views.edit')): ?> -
    +
    + get('component_custom_admin_views.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_custom_admin_views.', $canCheckin); ?> -
    - -
    escape($item->joomla_component_system_name); ?>
    - + + escape($item->joomla_component_system_name); ?> + +
    get('component_custom_admin_views.edit.state')) : ?> diff --git a/admin/views/components_dashboard/tmpl/default_body.php b/admin/views/components_dashboard/tmpl/default_body.php index 57e663948..2fde248dc 100644 --- a/admin/views/components_dashboard/tmpl/default_body.php +++ b/admin/views/components_dashboard/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_dashboard&task=co - get('component_dashboard.edit')): ?> -
    +
    + get('component_dashboard.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_dashboard.', $canCheckin); ?> -
    - -
    escape($item->joomla_component_system_name); ?>
    - + + escape($item->joomla_component_system_name); ?> + +
    get('component_dashboard.edit.state')) : ?> diff --git a/admin/views/components_files_folders/tmpl/default_body.php b/admin/views/components_files_folders/tmpl/default_body.php index f2e11c0d1..33f6fdea7 100644 --- a/admin/views/components_files_folders/tmpl/default_body.php +++ b/admin/views/components_files_folders/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_files_folders&tas - get('component_files_folders.edit')): ?> -
    +
    + get('component_files_folders.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_files_folders.', $canCheckin); ?> -
    - -
    escape($item->joomla_component_system_name); ?>
    - + + escape($item->joomla_component_system_name); ?> + +
    get('component_files_folders.edit.state')) : ?> diff --git a/admin/views/components_mysql_tweaks/tmpl/default_body.php b/admin/views/components_mysql_tweaks/tmpl/default_body.php index 6725ef4da..1de70134e 100644 --- a/admin/views/components_mysql_tweaks/tmpl/default_body.php +++ b/admin/views/components_mysql_tweaks/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_mysql_tweaks&task - get('component_mysql_tweaks.edit')): ?> -
    +
    + get('component_mysql_tweaks.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_mysql_tweaks.', $canCheckin); ?> -
    - -
    escape($item->joomla_component_system_name); ?>
    - + + escape($item->joomla_component_system_name); ?> + +
    get('component_mysql_tweaks.edit.state')) : ?> diff --git a/admin/views/components_site_views/tmpl/default_body.php b/admin/views/components_site_views/tmpl/default_body.php index 7ec42568a..d685036d3 100644 --- a/admin/views/components_site_views/tmpl/default_body.php +++ b/admin/views/components_site_views/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_site_views&task=c - get('component_site_views.edit')): ?> -
    +
    + get('component_site_views.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_site_views.', $canCheckin); ?> -
    - -
    escape($item->joomla_component_system_name); ?>
    - + + escape($item->joomla_component_system_name); ?> + +
    get('component_site_views.edit.state')) : ?> diff --git a/admin/views/components_updates/tmpl/default_body.php b/admin/views/components_updates/tmpl/default_body.php index 5851317de..f5c4dfc62 100644 --- a/admin/views/components_updates/tmpl/default_body.php +++ b/admin/views/components_updates/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=components_updates&task=comp - get('component_updates.edit')): ?> -
    +
    + get('component_updates.edit')): ?> escape($item->joomla_component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'components_updates.', $canCheckin); ?> -
    - -
    escape($item->joomla_component_system_name); ?>
    - + + escape($item->joomla_component_system_name); ?> + +
    get('component_updates.edit.state')) : ?> diff --git a/admin/views/custom_admin_views/tmpl/default_body.php b/admin/views/custom_admin_views/tmpl/default_body.php index 1629a69d7..448cea272 100644 --- a/admin/views/custom_admin_views/tmpl/default_body.php +++ b/admin/views/custom_admin_views/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=custom_admin_views&task=cust - get('core.edit')): ?> -
    +
    + get('core.edit')): ?> escape($item->system_name); ?> checked_out): ?> name, $item->checked_out_time, 'custom_admin_views.', $canCheckin); ?> -
    - -
    escape($item->system_name); ?>
    - + + escape($item->system_name); ?> + +
    escape($item->name); ?> diff --git a/admin/views/custom_codes/tmpl/default_body.php b/admin/views/custom_codes/tmpl/default_body.php index 398bf89f9..95432ff54 100644 --- a/admin/views/custom_codes/tmpl/default_body.php +++ b/admin/views/custom_codes/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=custom_codes&task=custom_cod - get('custom_code.edit')): ?> -
    +
    + get('custom_code.edit')): ?> escape($item->component_system_name); ?> checked_out): ?> name, $item->checked_out_time, 'custom_codes.', $canCheckin); ?> -
    - -
    escape($item->component_system_name); ?>
    - + + escape($item->component_system_name); ?> + +
    escape($item->path); ?> diff --git a/admin/views/dynamic_gets/tmpl/default_body.php b/admin/views/dynamic_gets/tmpl/default_body.php index fa17d0c4b..33a0e6e25 100644 --- a/admin/views/dynamic_gets/tmpl/default_body.php +++ b/admin/views/dynamic_gets/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_ge - get('dynamic_get.edit')): ?> -
    +
    + get('dynamic_get.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'dynamic_gets.', $canCheckin); ?> -
    - -
    escape($item->name); ?>
    - + + escape($item->name); ?> + +
    main_source); ?> diff --git a/admin/views/fields/tmpl/default_body.php b/admin/views/fields/tmpl/default_body.php index d3a5dac8f..845379c85 100644 --- a/admin/views/fields/tmpl/default_body.php +++ b/admin/views/fields/tmpl/default_body.php @@ -61,25 +61,25 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; - get('field.edit')): ?> -
    +
    + get('field.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'fields.', $canCheckin); ?> -
    - -
    escape($item->name); ?>
    - + + escape($item->name); ?> + +
    - user->authorise('fieldtype.edit', 'com_componentbuilder.fieldtype.' . (int)$item->fieldtype)): ?> -
    +
    + user->authorise('fieldtype.edit', 'com_componentbuilder.fieldtype.' . (int)$item->fieldtype)): ?> escape($item->fieldtype_name); ?> -
    - -
    escape($item->fieldtype_name); ?>
    - + + escape($item->fieldtype_name); ?> + +
    datatype); ?> @@ -94,11 +94,13 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; store); ?> - user->authorise('core.edit', 'com_componentbuilder.fields.category.' . (int)$item->catid)): ?> - escape($item->category_title); ?> - - escape($item->category_title); ?> - +
    + user->authorise('core.edit', 'com_componentbuilder.fields.category.' . (int)$item->catid)): ?> + escape($item->category_title); ?> + + escape($item->category_title); ?> + +
    get('field.edit.state')) : ?> diff --git a/admin/views/fieldtypes/tmpl/default_body.php b/admin/views/fieldtypes/tmpl/default_body.php index ef5a9621d..99cae6879 100644 --- a/admin/views/fieldtypes/tmpl/default_body.php +++ b/admin/views/fieldtypes/tmpl/default_body.php @@ -61,26 +61,28 @@ $edit = "index.php?option=com_componentbuilder&view=fieldtypes&task=fieldtype.ed - get('fieldtype.edit')): ?> -
    +
    + get('fieldtype.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'fieldtypes.', $canCheckin); ?> -
    - -
    escape($item->name); ?>
    - + + escape($item->name); ?> + +
    escape($item->short_description); ?> - user->authorise('core.edit', 'com_componentbuilder.fieldtypes.category.' . (int)$item->catid)): ?> - escape($item->category_title); ?> - - escape($item->category_title); ?> - +
    + user->authorise('core.edit', 'com_componentbuilder.fieldtypes.category.' . (int)$item->catid)): ?> + escape($item->category_title); ?> + + escape($item->category_title); ?> + +
    get('fieldtype.edit.state')) : ?> diff --git a/admin/views/help_documents/tmpl/default_body.php b/admin/views/help_documents/tmpl/default_body.php index b6e8c6fce..bd58d0227 100644 --- a/admin/views/help_documents/tmpl/default_body.php +++ b/admin/views/help_documents/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc - get('help_document.edit')): ?> -
    +
    + get('help_document.edit')): ?> escape($item->title); ?> checked_out): ?> name, $item->checked_out_time, 'help_documents.', $canCheckin); ?> -
    - -
    escape($item->title); ?>
    - + + escape($item->title); ?> + +
    type); ?> diff --git a/admin/views/joomla_components/tmpl/default_body.php b/admin/views/joomla_components/tmpl/default_body.php index fb9b793ee..be3bb4e9f 100644 --- a/admin/views/joomla_components/tmpl/default_body.php +++ b/admin/views/joomla_components/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml - get('joomla_component.edit')): ?> -
    +
    + get('joomla_component.edit')): ?> escape($item->system_name); ?> checked_out): ?> name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> -
    - -
    escape($item->system_name); ?>
    - + + escape($item->system_name); ?> + +
    get('component_admin_views.edit') && $component_admin_views_id = ComponentbuilderHelper::getVar('component_admin_views', $item->id, 'joomla_component', 'id')): ?> diff --git a/admin/views/language_translations/tmpl/default_body.php b/admin/views/language_translations/tmpl/default_body.php index f313574a4..88ee31c82 100644 --- a/admin/views/language_translations/tmpl/default_body.php +++ b/admin/views/language_translations/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l - get('language_translation.edit')): ?> -
    +
    + get('language_translation.edit')): ?> source; ?> checked_out): ?> name, $item->checked_out_time, 'language_translations.', $canCheckin); ?> -
    - -
    source; ?>
    - + + source; ?> + +
    get('language_translation.edit.state')) : ?> diff --git a/admin/views/languages/tmpl/default_body.php b/admin/views/languages/tmpl/default_body.php index 2d239bc76..1121fb452 100644 --- a/admin/views/languages/tmpl/default_body.php +++ b/admin/views/languages/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=languages&task=language.edit - get('language.edit')): ?> -
    +
    + get('language.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'languages.', $canCheckin); ?> -
    - -
    escape($item->name); ?>
    - + + escape($item->name); ?> + +
    escape($item->langtag); ?> diff --git a/admin/views/layouts/tmpl/default_body.php b/admin/views/layouts/tmpl/default_body.php index 6307e4a63..03034c310 100644 --- a/admin/views/layouts/tmpl/default_body.php +++ b/admin/views/layouts/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=layouts&task=layout.edit"; - get('core.edit')): ?> -
    +
    + get('core.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'layouts.', $canCheckin); ?> -
    - -
    escape($item->name); ?>
    - + + escape($item->name); ?> + +
    escape($item->alias); ?> @@ -79,13 +79,13 @@ $edit = "index.php?option=com_componentbuilder&view=layouts&task=layout.edit"; escape($item->description); ?> - user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->dynamic_get)): ?> -
    +
    + user->authorise('dynamic_get.edit', 'com_componentbuilder.dynamic_get.' . (int)$item->dynamic_get)): ?> escape($item->dynamic_get_name); ?> -
    - -
    escape($item->dynamic_get_name); ?>
    - + + escape($item->dynamic_get_name); ?> + +
    get('core.edit.state')) : ?> diff --git a/admin/views/libraries/tmpl/default_body.php b/admin/views/libraries/tmpl/default_body.php index 958ea2e00..718c67fca 100644 --- a/admin/views/libraries/tmpl/default_body.php +++ b/admin/views/libraries/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=libraries&task=library.edit" - get('library.edit')): ?> -
    +
    + get('library.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'libraries.', $canCheckin); ?> -
    - -
    escape($item->name); ?>
    - + + escape($item->name); ?> + +
    get('library_config.edit') && $library_config_id = ComponentbuilderHelper::getVar('library_config', $item->id, 'library', 'id')): ?> diff --git a/admin/views/libraries_config/tmpl/default_body.php b/admin/views/libraries_config/tmpl/default_body.php index b763c7b42..029f0ab58 100644 --- a/admin/views/libraries_config/tmpl/default_body.php +++ b/admin/views/libraries_config/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=libraries_config&task=librar - get('library_config.edit')): ?> -
    +
    + get('library_config.edit')): ?> escape($item->library_name); ?> checked_out): ?> name, $item->checked_out_time, 'libraries_config.', $canCheckin); ?> -
    - -
    escape($item->library_name); ?>
    - + + escape($item->library_name); ?> + +
    get('library_config.edit.state')) : ?> diff --git a/admin/views/libraries_files_folders_urls/tmpl/default_body.php b/admin/views/libraries_files_folders_urls/tmpl/default_body.php index 9ff09d78e..768a56cea 100644 --- a/admin/views/libraries_files_folders_urls/tmpl/default_body.php +++ b/admin/views/libraries_files_folders_urls/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=libraries_files_folders_urls - get('library_files_folders_urls.edit')): ?> -
    +
    + get('library_files_folders_urls.edit')): ?> escape($item->library_name); ?> checked_out): ?> name, $item->checked_out_time, 'libraries_files_folders_urls.', $canCheckin); ?> -
    - -
    escape($item->library_name); ?>
    - + + escape($item->library_name); ?> + +
    get('library_files_folders_urls.edit.state')) : ?> diff --git a/admin/views/servers/tmpl/default_body.php b/admin/views/servers/tmpl/default_body.php index b46f01e2b..dde9be73a 100644 --- a/admin/views/servers/tmpl/default_body.php +++ b/admin/views/servers/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=servers&task=server.edit"; - get('server.edit')): ?> -
    +
    + get('server.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'servers.', $canCheckin); ?> -
    - -
    escape($item->name); ?>
    - + + escape($item->name); ?> + +
    protocol); ?> diff --git a/admin/views/site_views/tmpl/default_body.php b/admin/views/site_views/tmpl/default_body.php index 2c94920ab..a65ea1d2a 100644 --- a/admin/views/site_views/tmpl/default_body.php +++ b/admin/views/site_views/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=site_views&task=site_view.ed - get('core.edit')): ?> -
    +
    + get('core.edit')): ?> escape($item->system_name); ?> checked_out): ?> name, $item->checked_out_time, 'site_views.', $canCheckin); ?> -
    - -
    escape($item->system_name); ?>
    - + + escape($item->system_name); ?> + +
    escape($item->name); ?> diff --git a/admin/views/snippet_types/tmpl/default_body.php b/admin/views/snippet_types/tmpl/default_body.php index 22286faf2..4f6d3b05e 100644 --- a/admin/views/snippet_types/tmpl/default_body.php +++ b/admin/views/snippet_types/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=snippet_types&task=snippet_t - get('snippet_type.edit')): ?> -
    +
    + get('snippet_type.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'snippet_types.', $canCheckin); ?> -
    - -
    escape($item->name); ?>
    - + + escape($item->name); ?> + +
    escape($item->description); ?> diff --git a/admin/views/snippets/tmpl/default_body.php b/admin/views/snippets/tmpl/default_body.php index d5db9329f..66fda6474 100644 --- a/admin/views/snippets/tmpl/default_body.php +++ b/admin/views/snippets/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=snippets&task=snippet.edit"; - get('core.edit')): ?> -
    +
    + get('core.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'snippets.', $canCheckin); ?> -
    - -
    escape($item->name); ?>
    - + + escape($item->name); ?> + +
    escape($item->url); ?> @@ -82,13 +82,13 @@ $edit = "index.php?option=com_componentbuilder&view=snippets&task=snippet.edit"; escape($item->heading); ?> - user->authorise('library.edit', 'com_componentbuilder.library.' . (int)$item->library)): ?> -
    +
    + user->authorise('library.edit', 'com_componentbuilder.library.' . (int)$item->library)): ?> escape($item->library_name); ?> -
    - -
    escape($item->library_name); ?>
    - + + escape($item->library_name); ?> + +
    get('core.edit.state')) : ?> diff --git a/admin/views/templates/tmpl/default_body.php b/admin/views/templates/tmpl/default_body.php index 15d683a48..27d094405 100644 --- a/admin/views/templates/tmpl/default_body.php +++ b/admin/views/templates/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=templates&task=template.edit - get('core.edit')): ?> -
    +
    + get('core.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'templates.', $canCheckin); ?> -
    - -
    escape($item->name); ?>
    - + + escape($item->name); ?> + +
    escape($item->alias); ?> diff --git a/admin/views/validation_rules/tmpl/default_body.php b/admin/views/validation_rules/tmpl/default_body.php index da1ddb72a..09fc10a4e 100644 --- a/admin/views/validation_rules/tmpl/default_body.php +++ b/admin/views/validation_rules/tmpl/default_body.php @@ -61,16 +61,16 @@ $edit = "index.php?option=com_componentbuilder&view=validation_rules&task=valida - get('validation_rule.edit')): ?> -
    +
    + get('validation_rule.edit')): ?> escape($item->name); ?> checked_out): ?> name, $item->checked_out_time, 'validation_rules.', $canCheckin); ?> -
    - -
    escape($item->name); ?>
    - + + escape($item->name); ?> + +
    escape($item->short_description); ?> diff --git a/componentbuilder.xml b/componentbuilder.xml index 2eaeece45..b7492a831 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 18th May, 2018 + 30th 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.8.0 Component Builder (v.2.7.10) +

    Component Builder (v.2.8.0)

    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..bd62c6e36 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.8.0 + http://www.joomlacomponentbuilder.com + + https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.8.0/JCB_v2.8.0.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..0c4fb362a 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.8.0 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..ddf22f7fe 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -1801,7 +1801,7 @@ abstract class ComponentbuilderHelper return $sufix === "" || ($sufix == substr(strrchr($file, "."), -strlen($sufix))); } - public static function imageInfo($path,$request = 'type') + public static function imageInfo($path, $request = 'type') { // set image $image = JPATH_SITE.'/'.$path; @@ -1914,37 +1914,79 @@ abstract class ComponentbuilderHelper return array_unique($bucket); } - public static function typeField($type,$option = 'default') + + /** + * Field Grouping https://docs.joomla.org/Form_field + **/ + protected static $fieldGroups = array( + 'default' => array( + 'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox', + 'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor', + 'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file', + 'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite', + 'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password', + 'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag', + 'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag', + 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup' + ), + 'plain' => array( + 'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color', + 'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors', + 'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite', + 'hidden', 'imagelist', 'integer', 'language', 'media', 'menu', + 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', + 'sessionhandler', 'tag', 'tel', 'text', 'textarea', + 'timezone', 'url', 'user', 'usergroup' + ), + 'text' => array( + 'calendar','color','editor','email','password','tel','text','textarea','url','number','range' + ), + 'list' => array( + 'checkboxes','checkbox','list','radio' + ), + 'dynamic' => array( + 'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter' + ), + 'spacer' => array( + 'note', 'spacer' + ), + 'option' => array( + 'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql' + ), + 'special' => array( + 'contentlanguage', 'groupedlist', 'moduleposition', 'plugin', + 'repeatable', 'templatestyle', 'subform' + ) + ); + + /** + * Field Checker + * + * @param string $type The field type + * @param boolean $option The field grouping + * + * @return boolean if the field was found + */ + public static function fieldCheck($type, $option = 'default') { - // list of default fields - // https://docs.joomla.org/Form_field - $fields = array( - 'default' => array( - 'accesslevel','cachehandler','calendar','captcha','category','checkbox', - 'checkboxes','color','combo','componentlayout','contentlanguage','editor', - 'chromestyle','contenttype','databaseconnection','editors','email','file', - 'filelist','folderlist','groupedlist','hidden','file','headertag','helpsite', - 'imagelist','integer','language','list','media','menu','note','password', - 'plugins','range','radio','repeatable','rules','subform','sessionhandler','spacer','sql','tag', - 'tel','menuitem','modulelayout','meter','moduleorder','moduleposition','moduletag', - 'templatestyle','text','textarea','timezone','url','user','usergroup' - ), - 'text' => array( - 'calendar','color','editor','email','password','tel','text','textarea','url','number','range' - ), - 'list' => array( - 'checkboxes','checkbox','list','radio' - ), - 'dynamic' => array( - 'category','headertag','tag','rules','user','file','filelist','folderlist','imagelist','integer','timezone','media','meter' - ) - ); - - if (in_array($type,$fields[$option])) + // now check + if (isset(self::$fieldGroups[$option]) && in_array($type, self::$fieldGroups[$option])) { return true; } - return false; + return false; + } + + /** + * get the spacer IDs + * + * @return array ids of the spacer field types + */ + public static function getSpacerIds() + { + // get the database object to use quote + $db = JFactory::getDbo(); + return self::getVars('fieldtype', (array) array_map(function($name) use($db) { return $db->quote(ucfirst($name)); }, self::$fieldGroups['spacer']), 'name', 'id'); } /** @@ -3085,15 +3127,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 +3170,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 +3209,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 +3368,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 +3459,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') { @@ -3653,8 +3695,8 @@ abstract class ComponentbuilderHelper } /** - * Load the Component Help URLs. - **/ + * Load the Component Help URLs. + **/ public static function getHelpUrl($view) { $user = JFactory::getUser(); @@ -3691,15 +3733,15 @@ abstract class ComponentbuilderHelper // set joomla article case 1: return self::loadArticleLink($help->article); - break; + break; // set help text case 2: return self::loadHelpTextLink($help->id); - break; + break; // set Link case 3: return $help->url; - break; + break; } } } @@ -3708,16 +3750,16 @@ abstract class ComponentbuilderHelper } /** - * Get the Article Link. - **/ + * Get the Article Link. + **/ protected static function loadArticleLink($id) { return JURI::root().'index.php?option=com_content&view=article&id='.$id.'&tmpl=component&layout=modal'; } /** - * Get the Help Text Link. - **/ + * Get the Help Text Link. + **/ protected static function loadHelpTextLink($id) { $token = JSession::getFormToken(); @@ -3869,7 +3911,7 @@ abstract class ComponentbuilderHelper } } // check if there are any view values remaining - if (count($_result)) + if (count((array)$_result)) { $_result = json_encode($_result); $_result = array($_result); @@ -4022,8 +4064,8 @@ abstract class ComponentbuilderHelper } /** - * UIKIT Component Classes - **/ + * UIKIT Component Classes + **/ public static $uk_components = array( 'data-uk-grid' => array( 'grid' ), @@ -4077,15 +4119,15 @@ abstract class ComponentbuilderHelper 'upload-drop' => array( 'upload', 'form-file' ) ); - + /** - * Add UIKIT Components - **/ + * Add UIKIT Components + **/ public static $uikit = false; /** - * Get UIKIT Components - **/ + * Get UIKIT Components + **/ public static function getUikitComp($content,$classes = array()) { if (strpos($content,'class="uk-') !== false) @@ -4115,7 +4157,7 @@ abstract class ComponentbuilderHelper } return $temp; } - } + } if (self::checkArray($classes)) { return $classes; @@ -4511,7 +4553,7 @@ abstract class ComponentbuilderHelper **/ public static function checkArray($array, $removeEmptyString = false) { - if (isset($array) && is_array($array) && count($array) > 0) + if (isset($array) && is_array($array) && count((array)$array) > 0) { // also make sure the empty strings are removed if ($removeEmptyString) @@ -4614,7 +4656,7 @@ abstract class ComponentbuilderHelper { $initial = strlen($string); $words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE); - $words_count = count($words); + $words_count = count((array)$words); $word_length = 0; $last_word = 0; diff --git a/site/helpers/route.php b/site/helpers/route.php index 4ef8b4e64..2f9973218 100644 --- a/site/helpers/route.php +++ b/site/helpers/route.php @@ -24,8 +24,8 @@ abstract class ComponentbuilderHelperRoute protected static $lookup; /** - * @param int The route of the Api - */ + * @param int The route of the Api + */ public static function getApiRoute($id = 0, $catid = 0) { if ($id > 0) diff --git a/site/models/api.php b/site/models/api.php index 7dc982e43..e3c2cfcab 100644 --- a/site/models/api.php +++ b/site/models/api.php @@ -149,11 +149,11 @@ class ComponentbuilderModelApi extends JModelItem /** - * Get the uikit needed components - * - * @return mixed An array of objects on success. - * - */ + * Get the uikit needed components + * + * @return mixed An array of objects on success. + * + */ public function getUikitComp() { if (isset($this->uikitComp) && ComponentbuilderHelper::checkArray($this->uikitComp))