From df65ca3456f2bf96c238e437eb5b6791caa985e5 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Tue, 31 Jul 2018 04:20:11 +0200 Subject: [PATCH 01/12] Added a new global helper method getFieldObject. Update the compiler area to make use of this new method. --- README.md | 4 +- admin/README.txt | 4 +- admin/compiler/joomla_3/Helper.php | 56 +++++++++--- admin/compiler/joomla_3/Helper_site.php | 58 ++++++++---- admin/helpers/componentbuilder.php | 56 +++++++++--- admin/views/compiler/view.html.php | 113 +++++------------------- componentbuilder.xml | 2 +- site/helpers/componentbuilder.php | 58 ++++++++---- 8 files changed, 197 insertions(+), 154 deletions(-) diff --git a/README.md b/README.md index 38a59c502..12a34de6b 100644 --- a/README.md +++ b/README.md @@ -125,11 +125,11 @@ 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*: 30th July, 2018 ++ *Last Build*: 31st July, 2018 + *Version*: 2.8.5 + *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*: **186360** ++ *Line count*: **186347** + *Field count*: **1059** + *File count*: **1239** + *Folder count*: **197** diff --git a/admin/README.txt b/admin/README.txt index 38a59c502..12a34de6b 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -125,11 +125,11 @@ 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*: 30th July, 2018 ++ *Last Build*: 31st July, 2018 + *Version*: 2.8.5 + *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*: **186360** ++ *Line count*: **186347** + *Field count*: **1059** + *File count*: **1239** + *Folder count*: **197** diff --git a/admin/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php index 51e07c462..ec0a5c897 100644 --- a/admin/compiler/joomla_3/Helper.php +++ b/admin/compiler/joomla_3/Helper.php @@ -753,6 +753,46 @@ abstract class ###Component###Helper } } + /** + * get the field object + * + * @param array $attributes The array of attributes + * @param string $default The default of the field + * @param array $options The options to apply to the XML element + * + * @return object + * + */ + public static function getFieldObject($attributes, $default = '', $options = null) + { + // make sure we have a type + if (isset($attributes['type'])) + { + // make sure the form helper class is loaded + if (!method_exists('JFormHelper', 'loadFieldType')) + { + jimport('joomla.form.form'); + } + // get field type + $field = JFormHelper::loadFieldType($attributes['type'],true); + // start field xml + $XML = new SimpleXMLElement(''); + // load the attributes + self::xmlAddAttributes($XML, $attributes); + // check if we have options + if (self::checkArray($options)) + { + // load the options + self::xmlAddOptions($XML, $options); + } + // setup the field + $field->setup($XML, $default); + // return the field object + return $field; + } + return false; + } + /** * Render Bool Button * @@ -771,8 +811,6 @@ abstract class ###Component###Helper $args = func_get_args(); // check if there is additional button class $additional = isset($args[1]) ? (string) $args[1] : ''; // not used at this time - // start the xml - $buttonXML = new SimpleXMLElement(''); // button attributes $buttonAttributes = array( 'type' => 'radio', @@ -781,22 +819,12 @@ abstract class ###Component###Helper 'class' => 'btn-group', 'filter' => 'INT', 'default' => isset($args[2]) ? (int) $args[2] : 0); - // load the haskey attributes - self::xmlAddAttributes($buttonXML, $buttonAttributes); // set the button options $buttonOptions = array( '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); - // load the button options - self::xmlAddOptions($buttonXML, $buttonOptions); - - // get the radio element - $button = JFormHelper::loadFieldType('radio'); - - // run - $button->setup($buttonXML, $buttonAttributes['default']); - - return $button->input; + // return the input + return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; } /** diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php index 9cced568a..d405849de 100644 --- a/admin/compiler/joomla_3/Helper_site.php +++ b/admin/compiler/joomla_3/Helper_site.php @@ -399,10 +399,50 @@ abstract class ###Component###Helper } } + /** + * get the field object + * + * @param array $attributes The array of attributes + * @param string $default The default of the field + * @param array $options The options to apply to the XML element + * + * @return object + * + */ + public static function getFieldObject($attributes, $default = '', $options = null) + { + // make sure we have a type + if (isset($attributes['type'])) + { + // make sure the form helper class is loaded + if (!method_exists('JFormHelper', 'loadFieldType')) + { + jimport('joomla.form.form'); + } + // get field type + $field = JFormHelper::loadFieldType($attributes['type'],true); + // start field xml + $XML = new SimpleXMLElement(''); + // load the attributes + self::xmlAddAttributes($XML, $attributes); + // check if we have options + if (self::checkArray($options)) + { + // load the options + self::xmlAddOptions($XML, $options); + } + // setup the field + $field->setup($XML, $default); + // return the field object + return $field; + } + return false; + } + /** * Render Bool Button * - * @param array $args All the args for the button + * @param array $args All the args for the button * 0) name * 1) additional (options class) // not used at this time * 2) default @@ -417,8 +457,6 @@ abstract class ###Component###Helper $args = func_get_args(); // check if there is additional button class $additional = isset($args[1]) ? (string) $args[1] : ''; // not used at this time - // start the xml - $buttonXML = new SimpleXMLElement(''); // button attributes $buttonAttributes = array( 'type' => 'radio', @@ -427,22 +465,12 @@ abstract class ###Component###Helper 'class' => 'btn-group', 'filter' => 'INT', 'default' => isset($args[2]) ? (int) $args[2] : 0); - // load the haskey attributes - self::xmlAddAttributes($buttonXML, $buttonAttributes); // set the button options $buttonOptions = array( '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); - // load the button options - self::xmlAddOptions($buttonXML, $buttonOptions); - - // get the radio element - $button = JFormHelper::loadFieldType('radio'); - - // run - $button->setup($buttonXML, $buttonAttributes['default']); - - return $button->input; + // return the input + return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; }###HELPER_UIKIT### ###HELPER_CREATEUSER### /** diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 12b4dbf1a..111411a7d 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -4731,6 +4731,46 @@ abstract class ComponentbuilderHelper } } + /** + * get the field object + * + * @param array $attributes The array of attributes + * @param string $default The default of the field + * @param array $options The options to apply to the XML element + * + * @return object + * + */ + public static function getFieldObject($attributes, $default = '', $options = null) + { + // make sure we have a type + if (isset($attributes['type'])) + { + // make sure the form helper class is loaded + if (!method_exists('JFormHelper', 'loadFieldType')) + { + jimport('joomla.form.form'); + } + // get field type + $field = JFormHelper::loadFieldType($attributes['type'],true); + // start field xml + $XML = new SimpleXMLElement(''); + // load the attributes + self::xmlAddAttributes($XML, $attributes); + // check if we have options + if (self::checkArray($options)) + { + // load the options + self::xmlAddOptions($XML, $options); + } + // setup the field + $field->setup($XML, $default); + // return the field object + return $field; + } + return false; + } + /** * Render Bool Button * @@ -4749,8 +4789,6 @@ abstract class ComponentbuilderHelper $args = func_get_args(); // check if there is additional button class $additional = isset($args[1]) ? (string) $args[1] : ''; // not used at this time - // start the xml - $buttonXML = new SimpleXMLElement(''); // button attributes $buttonAttributes = array( 'type' => 'radio', @@ -4759,22 +4797,12 @@ abstract class ComponentbuilderHelper 'class' => 'btn-group', 'filter' => 'INT', 'default' => isset($args[2]) ? (int) $args[2] : 0); - // load the haskey attributes - self::xmlAddAttributes($buttonXML, $buttonAttributes); // set the button options $buttonOptions = array( '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); - // load the button options - self::xmlAddOptions($buttonXML, $buttonOptions); - - // get the radio element - $button = JFormHelper::loadFieldType('radio'); - - // run - $button->setup($buttonXML, $buttonAttributes['default']); - - return $button->input; + // return the input + return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; } /** diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index 18684897b..e4c6f4104 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -64,168 +64,99 @@ class ComponentbuilderViewCompiler extends JViewLegacy public function setForm() { - if(ComponentbuilderHelper::checkArray($this->Components)){ - jimport('joomla.form.form'); - + if(ComponentbuilderHelper::checkArray($this->Components)) + { // start the form $form = array(); - - // get the sales radio field - $sales = JFormHelper::loadFieldType('radio',true); - // start sales xml - $salesXML = new SimpleXMLElement(''); // sales attributes - $salesAttributes = array( + $attributes = array( 'type' => 'radio', 'name' => 'backup', 'label' => 'COM_COMPONENTBUILDER_ADD_TO_BACKUP_FOLDER_AMP_SALES_SERVER_SMALLIF_SETSMALL', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_ZIPPED_PACKAGE_OF_THE_COMPONENT_BE_MOVED_TO_THE_LOCAL_BACKUP_AND_REMOTE_SALES_SERVER_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_THOSE_VALUES_SET', 'default' => '0'); - // load the sales attributes - ComponentbuilderHelper::xmlAddAttributes($salesXML, $salesAttributes); // set the sales options - $salesOptions = array( + $options = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); - // load the sales options - ComponentbuilderHelper::xmlAddOptions($salesXML, $salesOptions); - // setup the sales radio field - $sales->setup($salesXML,0); // add to form - $form[] = $sales; - - // get the repository radio field - $repository = JFormHelper::loadFieldType('radio',true); - // start repository xml - $repositoryXML = new SimpleXMLElement(''); + $form[] = ComponentbuilderHelper::getFieldObject($attributes, 0, $options); // repository attributes - $repositoryAttributes = array( + $attributes = array( 'type' => 'radio', 'name' => 'repository', 'label' => 'COM_COMPONENTBUILDER_ADD_TO_REPOSITORY_FOLDER', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_COMPONENT_BE_MOVED_TO_YOUR_LOCAL_REPOSITORY_FOLDER', 'default' => '1'); - // load the repository attributes - ComponentbuilderHelper::xmlAddAttributes($repositoryXML, $repositoryAttributes); // start the repository options - $repositoryOptions = array( + $options = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); - // load the repository options - ComponentbuilderHelper::xmlAddOptions($repositoryXML, $repositoryOptions); - // setup the repository radio field - $repository->setup($repositoryXML,1); // add to form - $form[] = $repository; - - // get the placeholders radio field - $placeholders = JFormHelper::loadFieldType('radio',true); - // start placeholders xml - $placeholdersXML = new SimpleXMLElement(''); + $form[] = ComponentbuilderHelper::getFieldObject($attributes, 1, $options); // placeholders attributes - $placeholdersAttributes = array( + $attributes = array( 'type' => 'radio', 'name' => 'placeholders', 'label' => 'COM_COMPONENTBUILDER_ADD_CUSTOM_CODE_PLACEHOLDERS', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE', 'default' => '2'); - // load the placeholders attributes - ComponentbuilderHelper::xmlAddAttributes($placeholdersXML, $placeholdersAttributes); // start the placeholders options - $placeholdersOptions = array( + $options = array( '2' => 'COM_COMPONENTBUILDER_GLOBAL', '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); - // load the placeholders options - ComponentbuilderHelper::xmlAddOptions($placeholdersXML, $placeholdersOptions); - // setup the placeholders radio field - $placeholders->setup($placeholdersXML,2); // add to form - $form[] = $placeholders; - - // get the debuglinenr radio field - $debuglinenr = JFormHelper::loadFieldType('radio',true); - // start debuglinenr xml - $debuglinenrXML = new SimpleXMLElement(''); + $form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options); // debuglinenr attributes - $debuglinenrAttributes = array( + $attributes = array( 'type' => 'radio', 'name' => 'debuglinenr', 'label' => 'COM_COMPONENTBUILDER_DEBUG_LINE_NUMBERS', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_ADD_CORRESPONDING_LINE_NUMBERS_TO_THE_DYNAMIC_COMMENTS_SO_TO_SEE_WHERE_IN_THE_COMPILER_THE_LINES_OF_CODE_WAS_BUILD_THIS_WILL_HELP_IF_YOU_NEED_TO_GET_MORE_TECHNICAL_WITH_AN_ISSUE_ON_GITHUB_OR_EVEN_FOR_YOUR_OWN_DEBUGGING', 'default' => '2'); - // load the debuglinenr attributes - ComponentbuilderHelper::xmlAddAttributes($debuglinenrXML, $debuglinenrAttributes); - // start the debuglinenr options - $debuglinenrOptions = array( + $options = array( '2' => 'COM_COMPONENTBUILDER_GLOBAL', '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); - // load the debuglinenr options - ComponentbuilderHelper::xmlAddOptions($debuglinenrXML, $debuglinenrOptions); - // setup the debuglinenr radio field - $debuglinenr->setup($debuglinenrXML,2); // add to form - $form[] = $debuglinenr; - - // get the minify radio field - $minify = JFormHelper::loadFieldType('radio',true); - // start minify xml - $minifyXML = new SimpleXMLElement(''); + $form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options); // minify attributes - $minifyAttributes = array( + $attributes = array( 'type' => 'radio', 'name' => 'minify', 'label' => 'COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT', 'class' => 'btn-group btn-group-yesno', 'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_JAVASCRIPT_BE_MINIFIED_IN_THE_COMPONENT', 'default' => '2'); - // load the minify attributes - ComponentbuilderHelper::xmlAddAttributes($minifyXML, $minifyAttributes); - // start the minify options - $minifyOptions = array( + $options = array( '2' => 'COM_COMPONENTBUILDER_GLOBAL', '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); - // load the minify options - ComponentbuilderHelper::xmlAddOptions($minifyXML, $minifyOptions); - // setup the minify radio field - $minify->setup($minifyXML,2); // add to form - $form[] = $minify; - - // get the component list field - $component = JFormHelper::loadFieldType('list',true); - // start component xml - $componentXML = new SimpleXMLElement(''); + $form[] = ComponentbuilderHelper::getFieldObject($attributes, 2, $options); // component attributes - $componentAttributes = array( + $attributes = array( 'type' => 'list', 'name' => 'component', 'label' => 'COM_COMPONENTBUILDER_COMPONENTS', 'class' => 'list_class', 'description' => 'COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE', 'required' => 'true'); - // load the component attributes - ComponentbuilderHelper::xmlAddAttributes($componentXML, $componentAttributes); // start the component options - $componentOptions = array(); - $componentOptions[''] = 'COM_COMPONENTBUILDER__SELECT_COMPONENT_'; + $options = array(); + $options[''] = 'COM_COMPONENTBUILDER__SELECT_COMPONENT_'; // load component options from array foreach($this->Components as $componet) { - $componentOptions[(int) $componet->id] = $this->escape($componet->name); + $options[(int) $componet->id] = $this->escape($componet->name); } - // load the component options - ComponentbuilderHelper::xmlAddOptions($componentXML, $componentOptions); - // setup the component radio field - $component->setup($componentXML,''); // add to form - $form[] = $component; + $form[] = ComponentbuilderHelper::getFieldObject($attributes, '', $options); // return the form array return $form; diff --git a/componentbuilder.xml b/componentbuilder.xml index d9d3bacea..2592174c9 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 30th July, 2018 + 31st July, 2018 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index 224489707..fa5d434c2 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -4017,10 +4017,50 @@ abstract class ComponentbuilderHelper } } + /** + * get the field object + * + * @param array $attributes The array of attributes + * @param string $default The default of the field + * @param array $options The options to apply to the XML element + * + * @return object + * + */ + public static function getFieldObject($attributes, $default = '', $options = null) + { + // make sure we have a type + if (isset($attributes['type'])) + { + // make sure the form helper class is loaded + if (!method_exists('JFormHelper', 'loadFieldType')) + { + jimport('joomla.form.form'); + } + // get field type + $field = JFormHelper::loadFieldType($attributes['type'],true); + // start field xml + $XML = new SimpleXMLElement(''); + // load the attributes + self::xmlAddAttributes($XML, $attributes); + // check if we have options + if (self::checkArray($options)) + { + // load the options + self::xmlAddOptions($XML, $options); + } + // setup the field + $field->setup($XML, $default); + // return the field object + return $field; + } + return false; + } + /** * Render Bool Button * - * @param array $args All the args for the button + * @param array $args All the args for the button * 0) name * 1) additional (options class) // not used at this time * 2) default @@ -4035,8 +4075,6 @@ abstract class ComponentbuilderHelper $args = func_get_args(); // check if there is additional button class $additional = isset($args[1]) ? (string) $args[1] : ''; // not used at this time - // start the xml - $buttonXML = new SimpleXMLElement(''); // button attributes $buttonAttributes = array( 'type' => 'radio', @@ -4045,22 +4083,12 @@ abstract class ComponentbuilderHelper 'class' => 'btn-group', 'filter' => 'INT', 'default' => isset($args[2]) ? (int) $args[2] : 0); - // load the haskey attributes - self::xmlAddAttributes($buttonXML, $buttonAttributes); // set the button options $buttonOptions = array( '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); - // load the button options - self::xmlAddOptions($buttonXML, $buttonOptions); - - // get the radio element - $button = JFormHelper::loadFieldType('radio'); - - // run - $button->setup($buttonXML, $buttonAttributes['default']); - - return $button->input; + // return the input + return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; } /** -- 2.40.1 From f5c6fa899d148dec9d79b67985527380f8ddcf7a Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 2 Aug 2018 07:36:47 +0200 Subject: [PATCH 02/12] Added a fix to prefent language strings colliding on compilation. Added the option to use []+, in the custom code arg values. Added easy debug option for the setDynamicValues method in the compiler. Fixed the editor issue in the fields view. --- README.md | 4 +- admin/README.txt | 4 +- admin/compiler/joomla_3/Helper.php | 6 +- admin/compiler/joomla_3/Helper_site.php | 4 +- admin/helpers/compiler/a_Get.php | 126 ++++++++++++++++++-- admin/helpers/compiler/e_Interpretation.php | 11 +- admin/helpers/componentbuilder.php | 6 +- admin/models/field.php | 17 +++ admin/models/fields/aliasbuilder.php | 2 +- componentbuilder.xml | 2 +- site/helpers/componentbuilder.php | 4 +- 11 files changed, 154 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 12a34de6b..84b60c0d5 100644 --- a/README.md +++ b/README.md @@ -125,11 +125,11 @@ 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*: 31st July, 2018 ++ *Last Build*: 2nd August, 2018 + *Version*: 2.8.5 + *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*: **186347** ++ *Line count*: **186364** + *Field count*: **1059** + *File count*: **1239** + *Folder count*: **197** diff --git a/admin/README.txt b/admin/README.txt index 12a34de6b..84b60c0d5 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -125,11 +125,11 @@ 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*: 31st July, 2018 ++ *Last Build*: 2nd August, 2018 + *Version*: 2.8.5 + *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*: **186347** ++ *Line count*: **186364** + *Field count*: **1059** + *File count*: **1239** + *Folder count*: **197** diff --git a/admin/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php index ec0a5c897..55458e6a6 100644 --- a/admin/compiler/joomla_3/Helper.php +++ b/admin/compiler/joomla_3/Helper.php @@ -763,10 +763,10 @@ abstract class ###Component###Helper * @return object * */ - public static function getFieldObject($attributes, $default = '', $options = null) + public static function getFieldObject(&$attributes, $default = '', $options = null) { - // make sure we have a type - if (isset($attributes['type'])) + // make sure we have attributes and a type value + if (self::checkArray($attributes) && isset($attributes['type'])) { // make sure the form helper class is loaded if (!method_exists('JFormHelper', 'loadFieldType')) diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php index d405849de..2dbc8149c 100644 --- a/admin/compiler/joomla_3/Helper_site.php +++ b/admin/compiler/joomla_3/Helper_site.php @@ -411,8 +411,8 @@ abstract class ###Component###Helper */ public static function getFieldObject($attributes, $default = '', $options = null) { - // make sure we have a type - if (isset($attributes['type'])) + // make sure we have attributes and a type value + if (self::checkArray($attributes) && isset($attributes['type'])) { // make sure the form helper class is loaded if (!method_exists('JFormHelper', 'loadFieldType')) diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index ddcc9fe3d..b966f5339 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -74,6 +74,18 @@ class Get */ public $addPlaceholders = false; + /** + * The placeholders for custom code keys + * + * @var array + */ + protected $customCodeKeyPlacholders = array( + '[' => '[', + ']' => ']', + ',' => ',', + '+' => '+' + ); + /** * The Component data * @@ -2817,7 +2829,7 @@ class Get case 3: // set custom script $result->main_get[0]['selection'] = array( - 'select' => base64_decode($result->php_custom_get), + 'select' => $this->setDynamicValues(base64_decode($result->php_custom_get)), 'from' => '', 'table' => '', 'type' => ''); break; } @@ -3840,6 +3852,8 @@ class Get { $langOnly[] = ComponentbuilderHelper::getAllBetween($content, "JustTEXT:" . ":_('", "')"); $langOnly[] = ComponentbuilderHelper::getAllBetween($content, 'JustTEXT:' . ':_("', '")'); + // merge lang only + $langOnly = ComponentbuilderHelper::mergeArrays($langOnly); } // set language data foreach ($langStringTargets as $langStringTarget) @@ -3865,6 +3879,11 @@ class Get // load the language targets foreach ($langStringTargets as $langStringTarget) { + // need some special treatment here + if ($langStringTarget === 'JustTEXT:' . ':_(') + { + continue; + } $langHolders[$langStringTarget . "'" . $string . "'"] = $langStringTarget . "'" . $keyLang . "'"; $langHolders[$langStringTarget . '"' . $string . '"'] = $langStringTarget . '"' . $keyLang . '"'; } @@ -3874,7 +3893,6 @@ class Get // the uppercase loading only (for arrays and other tricks) if (ComponentbuilderHelper::checkArray($langOnly)) { - $langOnly = ComponentbuilderHelper::mergeArrays($langOnly); foreach ($langOnly as $string) { if ($keyLang = $this->setLang($string)) @@ -4331,15 +4349,23 @@ class Get * Set the dynamic values in strings here * * @param string $string The content to check + * @param int $debug The switch to debug the update + * We can now at any time debug the + * dynamic build values if it gets broken * * @return string * */ - public function setDynamicValues($string) + public function setDynamicValues($string, $debug = 0) { if (ComponentbuilderHelper::checkString($string)) { - return $this->setLangStrings($this->setCustomCodeData($this->setExternalCodeString($string))); + $string = $this->setLangStrings($this->setCustomCodeData($this->setExternalCodeString($string, $debug), $debug)); + } + // if debug + if ($debug) + { + jexit(); } return $string; } @@ -4348,15 +4374,22 @@ class Get * Set the external code string & load it in to string * * @param string $string The content to check + * @param int $debug The switch to debug the update * * @return string * */ - public function setExternalCodeString($string) + public function setExternalCodeString($string, $debug = 0) { // check if content has custom code place holder if (strpos($string, '[EXTERNA' . 'LCODE=') !== false) { + // if debug + if ($debug) + { + echo 'External Code String:'; + var_dump($string); + } // target content $bucket = array(); $found = ComponentbuilderHelper::getAllBetween($string, '[EXTERNA' . 'LCODE=', ']'); @@ -4402,6 +4435,12 @@ class Get $string = $this->setPlaceholders($string, $bucket); } } + // if debug + if ($debug) + { + echo 'External Code String After Update:'; + var_dump($string); + } } return $string; } @@ -4481,17 +4520,24 @@ class Get * We start set the custom code data & can load it in to string * * @param string $string The content to check + * @param int $debug The switch to debug the update * * @return string * */ - public function setCustomCodeData($string) + public function setCustomCodeData($string, $debug = 0) { // insure the code is loaded $loaded = false; // check if content has custom code place holder if (strpos($string, '[CUSTO' . 'MCODE=') !== false) { + // if debug + if ($debug) + { + echo 'Custom Code String:'; + var_dump($string); + } // the ids found in this content $bucket = array(); $found = ComponentbuilderHelper::getAllBetween($string, '[CUSTO' . 'MCODE=', ']'); @@ -4499,6 +4545,12 @@ class Get { foreach ($found as $key) { + // if debug + if ($debug) + { + echo '$key before update:'; + var_dump($key); + } // check if we have args if (is_numeric($key)) { @@ -4554,12 +4606,16 @@ class Get { if (strpos($array[1], ',') !== false) { - $this->customCodeData[$id]['args'][$key] = explode(',', $array[1]); + // update the function values with the custom code key placholdres (this allow the use of [] + and , in the values) + $this->customCodeData[$id]['args'][$key] = array_map(function($_key) { + return $this->setPlaceholders($_key, $this->customCodeKeyPlacholders); + }, (array) explode(',', $array[1])); } elseif (ComponentbuilderHelper::checkString($array[1])) { $this->customCodeData[$id]['args'][$key] = array(); - $this->customCodeData[$id]['args'][$key][] = $array[1]; + // update the function values with the custom code key placholdres (this allow the use of [] + and , in the values) + $this->customCodeData[$id]['args'][$key][] = $this->setPlaceholders($array[1], $this->customCodeKeyPlacholders); } } } @@ -4571,6 +4627,12 @@ class Get $bucket[$id] = $id; } } + // if debug + if ($debug) + { + echo 'Bucket:'; + var_dump($bucket); + } // check if any custom code placeholders where found if (ComponentbuilderHelper::checkArray($bucket)) { @@ -4582,10 +4644,22 @@ class Get // revert lang to current setting $this->lang = $_tmpLang; } + // if debug + if ($debug) + { + echo 'Loaded:'; + var_dump($loaded); + } // when the custom code is loaded if ($loaded === true) { - $string = $this->insertCustomCode($string); + $string = $this->insertCustomCode($string, $debug); + } + // if debug + if ($debug) + { + echo 'Custom Code String After Update:'; + var_dump($string); } } return $string; @@ -4595,16 +4669,31 @@ class Get * Insert the custom code into the string * * @param string $string The content to check + * @param int $debug The switch to debug the update * * @return string on success * */ - protected function insertCustomCode($string) + protected function insertCustomCode($string, $debug = 0) { $code = array(); + // if debug + if ($debug) + { + echo '$this->customCode:'; + var_dump($this->customCode); + } foreach ($this->customCode as $item) { - $this->buildCustomCodePlaceholders($item, $code); + $this->buildCustomCodePlaceholders($item, $code, $debug); + } + // if debug + if ($debug) + { + echo 'Place holders to Update String:'; + var_dump($code); + echo 'Custom Code String Before Update:'; + var_dump($string); } // now update the string return $this->setPlaceholders($string, $code); @@ -4614,21 +4703,34 @@ class Get * Insert the custom code into the string * * @param string $string The content to check + * @param int $debug The switch to debug the update * * @return string on success * */ - protected function buildCustomCodePlaceholders($item, &$code) + protected function buildCustomCodePlaceholders($item, &$code, $debug = 0) { // check if there is args for this code if (isset($this->customCodeData[$item['id']]['args']) && ComponentbuilderHelper::checkArray($this->customCodeData[$item['id']]['args'])) { // since we have args we cant update this code via IDE (TODO) $placeholder = $this->getPlaceHolder(3, null); + // if debug + if ($debug) + { + echo 'Custom Code Placeholders:'; + var_dump($placeholder); + } // we have args and so need to load each foreach ($this->customCodeData[$item['id']]['args'] as $key => $args) { $this->setThesePlaceHolders('arg', $args); + // if debug + if ($debug) + { + echo 'Custom Code Global Placholders:'; + var_dump($this->placeholders); + } $code['[CUSTOM' . 'CODE=' . $key . ']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders) . $placeholder['end']; } // always clear the args diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 3ee87f583..45e162028 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -1578,16 +1578,19 @@ class Interpretation extends Fields { // load this unuiqe key $this->customViewQueryChecker[$this->target][] = $checker; - if (ComponentbuilderHelper::checkString($the_get['selection']['type'])) + if (isset($the_get['selection']['type']) && ComponentbuilderHelper::checkString($the_get['selection']['type'])) { $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']; + // set the selection + $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . $the_get['selection']['select']; } else { $getItem = PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get data"; + // set the selection + $getItem .= PHP_EOL . $this->setPlaceholders($the_get['selection']['select'], $this->placeholders); } - // set the selection - $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . $the_get['selection']['select']; + // load the from selection 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'])))) { @@ -5108,7 +5111,7 @@ class Interpretation extends Fields { foreach ($viewArray['settings']->main_get->main_get as $get) { - if ($get['as'] === 'a') + if (isset($get['as']) && $get['as'] === 'a') { if (isset($get['selection']) && ComponentbuilderHelper::checkArray($get['selection']) && isset($get['selection']['select_gets']) && ComponentbuilderHelper::checkArray($get['selection']['select_gets'])) { diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 111411a7d..a615821dc 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -4741,10 +4741,10 @@ abstract class ComponentbuilderHelper * @return object * */ - public static function getFieldObject($attributes, $default = '', $options = null) + public static function getFieldObject(&$attributes, $default = '', $options = null) { - // make sure we have a type - if (isset($attributes['type'])) + // make sure we have attributes and a type value + if (self::checkArray($attributes) && isset($attributes['type'])) { // make sure the form helper class is loaded if (!method_exists('JFormHelper', 'loadFieldType')) diff --git a/admin/models/field.php b/admin/models/field.php index 1c8789469..b7cdf238b 100644 --- a/admin/models/field.php +++ b/admin/models/field.php @@ -231,6 +231,23 @@ class ComponentbuilderModelField extends JModelAdmin $form->setValue($redirectedField, null, $redirectedValue); } } + + // update all editors to use this components global editor + $global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none'); + // now get all the editor fields + $editors = $form->getXml()->xpath("//field[@type='editor']"); + // check if we found any + if (ComponentbuilderHelper::checkArray($editors)) + { + foreach ($editors as $editor) + { + // get the field names + $name = (string) $editor['name']; + // set the field editor value (with none as fallback) + $form->setFieldAttribute($name, 'editor', $global_editor . '|none'); + } + } + return $form; } diff --git a/admin/models/fields/aliasbuilder.php b/admin/models/fields/aliasbuilder.php index b5ca7834d..daf9124aa 100644 --- a/admin/models/fields/aliasbuilder.php +++ b/admin/models/fields/aliasbuilder.php @@ -35,7 +35,7 @@ class JFormFieldAliasbuilder extends JFormFieldList */ public function getOptions() { - // load the db opbject + // load the db object $db = JFactory::getDBO(); // get the input from url $jinput = JFactory::getApplication()->input; diff --git a/componentbuilder.xml b/componentbuilder.xml index 2592174c9..47e28242e 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 31st July, 2018 + 2nd August, 2018 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index fa5d434c2..f5b5dbd83 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -4029,8 +4029,8 @@ abstract class ComponentbuilderHelper */ public static function getFieldObject($attributes, $default = '', $options = null) { - // make sure we have a type - if (isset($attributes['type'])) + // make sure we have attributes and a type value + if (self::checkArray($attributes) && isset($attributes['type'])) { // make sure the form helper class is loaded if (!method_exists('JFormHelper', 'loadFieldType')) -- 2.40.1 From 78208d1525aa3f0f30469ba15a0118dc478ec3d2 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Tue, 7 Aug 2018 14:25:26 +0200 Subject: [PATCH 03/12] Fixed the compiler to allow edit views be build even if no other site views are set. Removed all the depreciated joomla jimport statments. Update the getModel method in the controller. Updated the getRedirectToItemAppend, cancel and save method in the controller to also use the return value if internal. Added the addTablePath to the getTable method in the model to insure table is found when called from outside the in another component. Updated the diplay method in the JViewLagacy class to also use the return value if not null. Updated the component core to use JAccessExceptionNotallowed instead of JError::raiseWaring when user not have access to core. --- README.md | 4 +- admin/README.txt | 4 +- .../joomla_3/DASHJControllerAdmin.php | 3 - admin/compiler/joomla_3/DASHJModelList.php | 4 - admin/compiler/joomla_3/DASHJViewLagacy.php | 3 - admin/compiler/joomla_3/Helper_email.php | 2 +- admin/compiler/joomla_3/JControllerAdmin.php | 29 ++-- .../JControllerAdmin_custom_admin.php | 3 - admin/compiler/joomla_3/JControllerForm.php | 135 ++++++++++------- .../joomla_3/JControllerForm_custom_site.php | 3 - .../joomla_3/JControllerForm_site.php | 139 ++++++++++-------- admin/compiler/joomla_3/JControllerLegacy.php | 3 - .../joomla_3/JControllerLegacyAjax.php | 3 - .../joomla_3/JControllerLegacyAjaxSite.php | 3 - .../joomla_3/JControllerLegacyHelp.php | 3 - .../joomla_3/JControllerLegacyHelp_site.php | 3 - .../joomla_3/JControllerLegacySITE.php | 3 - .../JControllerLegacy_custom_admin.php | 3 - admin/compiler/joomla_3/JModelAdmin.php | 6 +- admin/compiler/joomla_3/JModelAdmin_site.php | 6 +- .../joomla_3/JModelItem_custom_admin.php | 3 - admin/compiler/joomla_3/JModelItem_site.php | 3 - admin/compiler/joomla_3/JModelList.php | 3 - admin/compiler/joomla_3/JModelListAjax.php | 2 - .../joomla_3/JModelList_custom_admin.php | 3 - admin/compiler/joomla_3/JModelList_site.php | 3 - admin/compiler/joomla_3/JTable.php | 3 - .../joomla_3/JViewLegacy_custom_admin.php | 5 +- admin/compiler/joomla_3/JViewLegacy_edit.php | 21 ++- .../joomla_3/JViewLegacy_edit_site.php | 37 +++-- .../compiler/joomla_3/JViewLegacy_import.php | 3 - .../joomla_3/JViewLegacy_import_custom.php | 3 - admin/compiler/joomla_3/JViewLegacy_list.php | 3 - .../JViewLegacy_list_custom_admin.php | 5 +- .../joomla_3/JViewLegacy_list_site.php | 5 +- admin/compiler/joomla_3/JViewLegacy_site.php | 5 +- admin/compiler/joomla_3/ajax.json.php | 13 +- admin/compiler/joomla_3/ajax.php | 18 +-- admin/compiler/joomla_3/batchselection.php | 4 +- admin/compiler/joomla_3/component_admin.php | 15 +- admin/compiler/joomla_3/component_site.php | 11 +- admin/compiler/joomla_3/edit.php | 2 +- admin/compiler/joomla_3/edit_site.php | 2 +- admin/compiler/joomla_3/layout.php | 1 - .../compiler/joomla_3/layout_custom_admin.php | 1 - admin/compiler/joomla_3/layout_site.php | 1 - admin/compiler/joomla_3/layoutfull.php | 1 - admin/compiler/joomla_3/layoutitems.php | 1 - admin/compiler/joomla_3/layoutlinkedview.php | 1 - admin/compiler/joomla_3/layoutmetadata.php | 1 - admin/compiler/joomla_3/layoutpublished.php | 1 - admin/compiler/joomla_3/layouttitle.php | 1 - admin/compiler/joomla_3/routeHelper.php | 4 - admin/compiler/joomla_3/script.php | 2 - admin/componentbuilder.php | 15 +- admin/controller.php | 3 - admin/controllers/admin_fields.php | 135 ++++++++++------- admin/controllers/admin_fields_conditions.php | 135 ++++++++++------- admin/controllers/admin_fields_relations.php | 135 ++++++++++------- admin/controllers/admin_view.php | 135 ++++++++++------- admin/controllers/admin_views.php | 29 ++-- admin/controllers/admins_fields.php | 29 ++-- .../controllers/admins_fields_conditions.php | 29 ++-- admin/controllers/admins_fields_relations.php | 29 ++-- admin/controllers/ajax.json.php | 3 - admin/controllers/compiler.php | 3 - admin/controllers/component_admin_views.php | 135 ++++++++++------- admin/controllers/component_config.php | 135 ++++++++++------- .../component_custom_admin_menus.php | 135 ++++++++++------- .../component_custom_admin_views.php | 135 ++++++++++------- admin/controllers/component_dashboard.php | 135 ++++++++++------- admin/controllers/component_files_folders.php | 135 ++++++++++------- admin/controllers/component_mysql_tweaks.php | 135 ++++++++++------- admin/controllers/component_site_views.php | 135 ++++++++++------- admin/controllers/component_updates.php | 135 ++++++++++------- admin/controllers/componentbuilder.php | 3 - admin/controllers/components_admin_views.php | 29 ++-- admin/controllers/components_config.php | 29 ++-- .../components_custom_admin_menus.php | 29 ++-- .../components_custom_admin_views.php | 29 ++-- admin/controllers/components_dashboard.php | 29 ++-- .../controllers/components_files_folders.php | 29 ++-- admin/controllers/components_mysql_tweaks.php | 29 ++-- admin/controllers/components_site_views.php | 29 ++-- admin/controllers/components_updates.php | 29 ++-- admin/controllers/custom_admin_view.php | 135 ++++++++++------- admin/controllers/custom_admin_views.php | 29 ++-- admin/controllers/custom_code.php | 135 ++++++++++------- admin/controllers/custom_codes.php | 29 ++-- admin/controllers/dynamic_get.php | 135 ++++++++++------- admin/controllers/dynamic_gets.php | 29 ++-- admin/controllers/field.php | 135 ++++++++++------- admin/controllers/fields.php | 29 ++-- admin/controllers/fieldtype.php | 135 ++++++++++------- admin/controllers/fieldtypes.php | 29 ++-- admin/controllers/get_snippets.php | 3 - admin/controllers/help.php | 3 - admin/controllers/help_document.php | 135 ++++++++++------- admin/controllers/help_documents.php | 29 ++-- admin/controllers/joomla_component.php | 135 ++++++++++------- admin/controllers/joomla_components.php | 29 ++-- admin/controllers/language.php | 135 ++++++++++------- admin/controllers/language_translation.php | 135 ++++++++++------- admin/controllers/language_translations.php | 29 ++-- admin/controllers/languages.php | 29 ++-- admin/controllers/layout.php | 135 ++++++++++------- admin/controllers/layouts.php | 29 ++-- admin/controllers/libraries.php | 29 ++-- admin/controllers/libraries_config.php | 29 ++-- .../libraries_files_folders_urls.php | 29 ++-- admin/controllers/library.php | 135 ++++++++++------- admin/controllers/library_config.php | 135 ++++++++++------- .../library_files_folders_urls.php | 135 ++++++++++------- admin/controllers/server.php | 135 ++++++++++------- admin/controllers/servers.php | 29 ++-- admin/controllers/site_view.php | 135 ++++++++++------- admin/controllers/site_views.php | 29 ++-- admin/controllers/snippet.php | 135 ++++++++++------- admin/controllers/snippet_type.php | 135 ++++++++++------- admin/controllers/snippet_types.php | 29 ++-- admin/controllers/snippets.php | 29 ++-- admin/controllers/template.php | 135 ++++++++++------- admin/controllers/templates.php | 29 ++-- admin/controllers/validation_rule.php | 135 ++++++++++------- admin/controllers/validation_rules.php | 29 ++-- admin/helpers/compiler.php | 2 +- admin/helpers/compiler/e_Interpretation.php | 14 +- admin/helpers/compiler/f_Infusion.php | 30 ++-- admin/helpers/componentbuilderemail.php | 2 +- .../en-GB/en-GB.com_componentbuilder.ini | 2 +- admin/layouts/admin_fields/fields_above.php | 1 - .../layouts/admin_fields/fields_fullwidth.php | 1 - admin/layouts/admin_fields/publishing.php | 1 - admin/layouts/admin_fields/publlshing.php | 1 - .../conditions_above.php | 1 - .../conditions_fullwidth.php | 1 - .../admin_fields_conditions/publishing.php | 1 - .../admin_fields_conditions/publlshing.php | 1 - .../admin_fields_relations/publishing.php | 1 - .../admin_fields_relations/publlshing.php | 1 - .../relations_above.php | 1 - .../relations_fullwidth.php | 1 - admin/layouts/admin_view/css_fullwidth.php | 1 - .../admin_view/custom_buttons_fullwidth.php | 1 - .../admin_view/custom_buttons_left.php | 1 - .../admin_view/custom_import_fullwidth.php | 1 - admin/layouts/admin_view/details_above.php | 1 - .../layouts/admin_view/details_fullwidth.php | 1 - admin/layouts/admin_view/details_left.php | 1 - admin/layouts/admin_view/details_right.php | 1 - admin/layouts/admin_view/details_under.php | 1 - admin/layouts/admin_view/fields_fullwidth.php | 1 - admin/layouts/admin_view/fields_left.php | 1 - admin/layouts/admin_view/fields_right.php | 1 - .../admin_view/javascript_fullwidth.php | 1 - admin/layouts/admin_view/mysql_fullwidth.php | 1 - admin/layouts/admin_view/mysql_left.php | 1 - admin/layouts/admin_view/php_fullwidth.php | 1 - admin/layouts/admin_view/publishing.php | 1 - admin/layouts/admin_view/publlshing.php | 1 - .../layouts/admin_view/settings_fullwidth.php | 1 - admin/layouts/batchselection.php | 4 +- .../component_admin_views/publishing.php | 1 - .../component_admin_views/publlshing.php | 1 - .../component_admin_views/views_above.php | 1 - .../component_admin_views/views_fullwidth.php | 1 - admin/layouts/component_config/publishing.php | 1 - admin/layouts/component_config/publlshing.php | 1 - .../layouts/component_config/tweaks_above.php | 1 - .../component_config/tweaks_fullwidth.php | 1 - .../publishing.php | 1 - .../publlshing.php | 1 - .../tweaks_above.php | 1 - .../tweaks_fullwidth.php | 1 - .../publishing.php | 1 - .../publlshing.php | 1 - .../views_above.php | 1 - .../views_fullwidth.php | 1 - .../component_dashboard/dashboard_above.php | 1 - .../dashboard_fullwidth.php | 1 - .../component_dashboard/publishing.php | 1 - .../component_dashboard/publlshing.php | 1 - .../advance_fullwidth.php | 1 - .../component_files_folders/basic_above.php | 1 - .../basic_fullwidth.php | 1 - .../component_files_folders/publishing.php | 1 - .../component_files_folders/publlshing.php | 1 - .../component_mysql_tweaks/publishing.php | 1 - .../component_mysql_tweaks/publlshing.php | 1 - .../component_mysql_tweaks/tweaks_above.php | 1 - .../tweaks_fullwidth.php | 1 - .../component_site_views/publishing.php | 1 - .../component_site_views/publlshing.php | 1 - .../component_site_views/views_above.php | 1 - .../component_site_views/views_fullwidth.php | 1 - .../layouts/component_updates/publishing.php | 1 - .../layouts/component_updates/publlshing.php | 1 - .../component_updates/updates_above.php | 1 - .../component_updates/updates_fullwidth.php | 1 - .../custom_buttons_fullwidth.php | 1 - .../custom_admin_view/custom_buttons_left.php | 1 - .../custom_admin_view/details_above.php | 1 - .../custom_admin_view/details_fullwidth.php | 1 - .../custom_admin_view/details_left.php | 1 - .../custom_admin_view/details_right.php | 1 - .../custom_admin_view/details_rightside.php | 1 - .../custom_admin_view/details_under.php | 1 - .../javascript_css_fullwidth.php | 1 - .../linked_components_fullwidth.php | 1 - .../custom_admin_view/php_fullwidth.php | 1 - .../layouts/custom_admin_view/publishing.php | 1 - .../layouts/custom_admin_view/publlshing.php | 1 - admin/layouts/custom_code/details_above.php | 1 - .../layouts/custom_code/details_fullwidth.php | 1 - admin/layouts/custom_code/details_left.php | 1 - admin/layouts/custom_code/details_right.php | 1 - admin/layouts/custom_code/details_under.php | 1 - admin/layouts/custom_code/publishing.php | 1 - admin/layouts/custom_code/publlshing.php | 1 - .../layouts/dynamic_get/abacus_fullwidth.php | 1 - admin/layouts/dynamic_get/abacus_left.php | 1 - .../dynamic_get/custom_script_fullwidth.php | 1 - admin/layouts/dynamic_get/joint_fullwidth.php | 1 - admin/layouts/dynamic_get/main_above.php | 1 - admin/layouts/dynamic_get/main_fullwidth.php | 1 - admin/layouts/dynamic_get/main_left.php | 1 - admin/layouts/dynamic_get/main_under.php | 1 - admin/layouts/dynamic_get/publishing.php | 1 - admin/layouts/dynamic_get/publlshing.php | 1 - admin/layouts/dynamic_get/tweak_fullwidth.php | 1 - admin/layouts/field/data_base_fullwidth.php | 1 - admin/layouts/field/data_base_left.php | 1 - admin/layouts/field/data_base_right.php | 1 - admin/layouts/field/publishing.php | 1 - admin/layouts/field/publlshing.php | 1 - admin/layouts/field/scripts_left.php | 1 - admin/layouts/field/scripts_right.php | 1 - admin/layouts/field/set_properties_above.php | 1 - .../field/set_properties_fullwidth.php | 1 - admin/layouts/field/set_properties_under.php | 1 - admin/layouts/field/type_info_fullwidth.php | 1 - admin/layouts/fieldtype/details_fullwidth.php | 1 - admin/layouts/fieldtype/details_left.php | 1 - admin/layouts/fieldtype/details_right.php | 1 - admin/layouts/fieldtype/fields_fullwidth.php | 1 - admin/layouts/fieldtype/publishing.php | 1 - admin/layouts/fieldtype/publlshing.php | 1 - admin/layouts/help_document/details_above.php | 1 - .../help_document/details_fullwidth.php | 1 - admin/layouts/help_document/details_left.php | 1 - admin/layouts/help_document/details_right.php | 1 - admin/layouts/help_document/details_under.php | 1 - admin/layouts/help_document/publishing.php | 1 - admin/layouts/help_document/publlshing.php | 1 - .../admin_views_fullwidth.php | 1 - .../custom_admin_views_fullwidth.php | 1 - .../dash_install_fullwidth.php | 1 - .../joomla_component/dash_install_left.php | 1 - .../joomla_component/dash_install_right.php | 1 - .../joomla_component/details_above.php | 1 - .../layouts/joomla_component/details_left.php | 1 - .../joomla_component/details_right.php | 1 - .../joomla_component/details_under.php | 1 - .../dynamic_build_beta_fullwidth.php | 1 - .../dynamic_integration_fullwidth.php | 1 - .../libs_helpers_fullwidth.php | 1 - admin/layouts/joomla_component/metadata.php | 1 - .../joomla_component/mysql_fullwidth.php | 1 - admin/layouts/joomla_component/publishing.php | 1 - .../layouts/joomla_component/readme_left.php | 1 - .../layouts/joomla_component/readme_right.php | 1 - .../joomla_component/settings_fullwidth.php | 1 - .../joomla_component/settings_left.php | 1 - .../joomla_component/settings_right.php | 1 - .../joomla_component/site_views_fullwidth.php | 1 - admin/layouts/language/details_left.php | 1 - admin/layouts/language/details_right.php | 1 - admin/layouts/language/publishing.php | 1 - admin/layouts/language/publlshing.php | 1 - .../details_fullwidth.php | 1 - .../language_translation/publishing.php | 1 - .../language_translation/publlshing.php | 1 - .../layout/custom_script_fullwidth.php | 1 - admin/layouts/layout/details_fullwidth.php | 1 - admin/layouts/layout/details_left.php | 1 - admin/layouts/layout/details_right.php | 1 - admin/layouts/layout/details_rightside.php | 1 - admin/layouts/layout/details_under.php | 1 - admin/layouts/layout/publishing.php | 1 - admin/layouts/layout/publlshing.php | 1 - admin/layouts/library/behaviour_above.php | 1 - admin/layouts/library/behaviour_fullwidth.php | 1 - admin/layouts/library/behaviour_left.php | 1 - admin/layouts/library/behaviour_right.php | 1 - admin/layouts/library/behaviour_under.php | 1 - admin/layouts/library/config_fullwidth.php | 1 - .../library/files_folders_urls_fullwidth.php | 1 - admin/layouts/library/linked_fullwidth.php | 1 - admin/layouts/library/publishing.php | 1 - admin/layouts/library/publlshing.php | 1 - admin/layouts/library_config/publishing.php | 1 - admin/layouts/library_config/publlshing.php | 1 - admin/layouts/library_config/tweaks_above.php | 1 - .../library_config/tweaks_fullwidth.php | 1 - .../advance_fullwidth.php | 1 - .../basic_above.php | 1 - .../basic_fullwidth.php | 1 - .../library_files_folders_urls/publishing.php | 1 - .../library_files_folders_urls/publlshing.php | 1 - admin/layouts/server/details_above.php | 1 - admin/layouts/server/details_fullwidth.php | 1 - admin/layouts/server/details_left.php | 1 - admin/layouts/server/details_right.php | 1 - .../server/linked_components_fullwidth.php | 1 - admin/layouts/server/publishing.php | 1 - admin/layouts/server/publlshing.php | 1 - .../site_view/custom_buttons_fullwidth.php | 1 - .../layouts/site_view/custom_buttons_left.php | 1 - .../site_view/custom_buttons_right.php | 1 - admin/layouts/site_view/details_above.php | 1 - admin/layouts/site_view/details_fullwidth.php | 1 - admin/layouts/site_view/details_left.php | 1 - admin/layouts/site_view/details_right.php | 1 - admin/layouts/site_view/details_rightside.php | 1 - admin/layouts/site_view/details_under.php | 1 - .../site_view/javascript_css_fullwidth.php | 1 - .../site_view/linked_components_fullwidth.php | 1 - admin/layouts/site_view/php_fullwidth.php | 1 - admin/layouts/site_view/publishing.php | 1 - admin/layouts/site_view/publlshing.php | 1 - .../layouts/snippet/contributor_fullwidth.php | 1 - admin/layouts/snippet/contributor_left.php | 1 - admin/layouts/snippet/contributor_right.php | 1 - admin/layouts/snippet/details_above.php | 1 - admin/layouts/snippet/details_left.php | 1 - admin/layouts/snippet/details_right.php | 1 - admin/layouts/snippet/publishing.php | 1 - admin/layouts/snippet/publlshing.php | 1 - admin/layouts/snippet_type/details_left.php | 1 - admin/layouts/snippet_type/details_right.php | 1 - admin/layouts/snippet_type/publishing.php | 1 - admin/layouts/snippet_type/publlshing.php | 1 - .../template/custom_script_fullwidth.php | 1 - admin/layouts/template/details_fullwidth.php | 1 - admin/layouts/template/details_left.php | 1 - admin/layouts/template/details_right.php | 1 - admin/layouts/template/details_rightside.php | 1 - admin/layouts/template/details_under.php | 1 - admin/layouts/template/publishing.php | 1 - admin/layouts/template/publlshing.php | 1 - .../extends_formrule_above.php | 1 - .../extends_formrule_fullwidth.php | 1 - .../validation_rule/extends_formrule_left.php | 1 - .../extends_formrule_right.php | 1 - admin/layouts/validation_rule/publishing.php | 1 - admin/layouts/validation_rule/publlshing.php | 1 - admin/models/admin_fields.php | 18 ++- admin/models/admin_fields_conditions.php | 18 ++- admin/models/admin_fields_relations.php | 18 ++- admin/models/admin_view.php | 18 ++- admin/models/admin_views.php | 3 - admin/models/admins_fields.php | 3 - admin/models/admins_fields_conditions.php | 3 - admin/models/admins_fields_relations.php | 3 - admin/models/ajax.php | 2 - admin/models/compiler.php | 3 - admin/models/component_admin_views.php | 18 ++- admin/models/component_config.php | 18 ++- admin/models/component_custom_admin_menus.php | 18 ++- admin/models/component_custom_admin_views.php | 18 ++- admin/models/component_dashboard.php | 18 ++- admin/models/component_files_folders.php | 18 ++- admin/models/component_mysql_tweaks.php | 18 ++- admin/models/component_site_views.php | 18 ++- admin/models/component_updates.php | 18 ++- admin/models/componentbuilder.php | 4 - admin/models/components_admin_views.php | 3 - admin/models/components_config.php | 3 - .../models/components_custom_admin_menus.php | 3 - .../models/components_custom_admin_views.php | 3 - admin/models/components_dashboard.php | 3 - admin/models/components_files_folders.php | 3 - admin/models/components_mysql_tweaks.php | 3 - admin/models/components_site_views.php | 3 - admin/models/components_updates.php | 3 - admin/models/custom_admin_view.php | 18 ++- admin/models/custom_admin_views.php | 3 - admin/models/custom_code.php | 18 ++- admin/models/custom_codes.php | 3 - admin/models/dynamic_get.php | 18 ++- admin/models/dynamic_gets.php | 3 - admin/models/field.php | 18 ++- admin/models/fields.php | 3 - admin/models/fieldtype.php | 18 ++- admin/models/fieldtypes.php | 3 - admin/models/get_snippets.php | 3 - admin/models/help_document.php | 18 ++- admin/models/help_documents.php | 3 - admin/models/joomla_component.php | 18 ++- admin/models/joomla_components.php | 3 - admin/models/language.php | 18 ++- admin/models/language_translation.php | 18 ++- admin/models/language_translations.php | 3 - admin/models/languages.php | 3 - admin/models/layout.php | 18 ++- admin/models/layouts.php | 3 - admin/models/libraries.php | 3 - admin/models/libraries_config.php | 3 - admin/models/libraries_files_folders_urls.php | 3 - admin/models/library.php | 18 ++- admin/models/library_config.php | 18 ++- admin/models/library_files_folders_urls.php | 18 ++- admin/models/server.php | 18 ++- admin/models/servers.php | 3 - admin/models/site_view.php | 18 ++- admin/models/site_views.php | 3 - admin/models/snippet.php | 18 ++- admin/models/snippet_type.php | 18 ++- admin/models/snippet_types.php | 3 - admin/models/snippets.php | 3 - admin/models/template.php | 18 ++- admin/models/templates.php | 3 - admin/models/validation_rule.php | 18 ++- admin/models/validation_rules.php | 3 - admin/sql/install.mysql.utf8.sql | 2 +- admin/tables/admin_fields.php | 3 - admin/tables/admin_fields_conditions.php | 3 - admin/tables/admin_fields_relations.php | 3 - admin/tables/admin_view.php | 3 - admin/tables/component_admin_views.php | 3 - admin/tables/component_config.php | 3 - admin/tables/component_custom_admin_menus.php | 3 - admin/tables/component_custom_admin_views.php | 3 - admin/tables/component_dashboard.php | 3 - admin/tables/component_files_folders.php | 3 - admin/tables/component_mysql_tweaks.php | 3 - admin/tables/component_site_views.php | 3 - admin/tables/component_updates.php | 3 - admin/tables/custom_admin_view.php | 3 - admin/tables/custom_code.php | 3 - admin/tables/dynamic_get.php | 3 - admin/tables/field.php | 3 - admin/tables/fieldtype.php | 3 - admin/tables/help_document.php | 3 - admin/tables/joomla_component.php | 3 - admin/tables/language.php | 3 - admin/tables/language_translation.php | 3 - admin/tables/layout.php | 3 - admin/tables/library.php | 3 - admin/tables/library_config.php | 3 - admin/tables/library_files_folders_urls.php | 3 - admin/tables/server.php | 3 - admin/tables/site_view.php | 3 - admin/tables/snippet.php | 3 - admin/tables/snippet_type.php | 3 - admin/tables/template.php | 3 - admin/tables/validation_rule.php | 3 - admin/views/admin_fields/tmpl/edit.php | 2 +- admin/views/admin_fields/view.html.php | 23 +-- .../admin_fields_conditions/tmpl/edit.php | 2 +- .../admin_fields_conditions/view.html.php | 23 +-- .../admin_fields_relations/tmpl/edit.php | 2 +- .../admin_fields_relations/view.html.php | 23 +-- admin/views/admin_view/tmpl/edit.php | 2 +- admin/views/admin_view/view.html.php | 23 +-- admin/views/admin_views/view.html.php | 3 - admin/views/admins_fields/view.html.php | 3 - .../admins_fields_conditions/view.html.php | 3 - .../admins_fields_relations/view.html.php | 3 - admin/views/compiler/view.html.php | 3 - .../views/component_admin_views/tmpl/edit.php | 2 +- .../views/component_admin_views/view.html.php | 23 +-- admin/views/component_config/tmpl/edit.php | 2 +- admin/views/component_config/view.html.php | 23 +-- .../tmpl/edit.php | 2 +- .../view.html.php | 23 +-- .../tmpl/edit.php | 2 +- .../view.html.php | 23 +-- admin/views/component_dashboard/tmpl/edit.php | 2 +- admin/views/component_dashboard/view.html.php | 23 +-- .../component_files_folders/tmpl/edit.php | 2 +- .../component_files_folders/view.html.php | 23 +-- .../component_mysql_tweaks/tmpl/edit.php | 2 +- .../component_mysql_tweaks/view.html.php | 23 +-- .../views/component_site_views/tmpl/edit.php | 2 +- .../views/component_site_views/view.html.php | 23 +-- admin/views/component_updates/tmpl/edit.php | 2 +- admin/views/component_updates/view.html.php | 23 +-- admin/views/componentbuilder/view.html.php | 3 - .../components_admin_views/view.html.php | 3 - admin/views/components_config/view.html.php | 3 - .../view.html.php | 3 - .../view.html.php | 3 - .../views/components_dashboard/view.html.php | 3 - .../components_files_folders/view.html.php | 3 - .../components_mysql_tweaks/view.html.php | 3 - .../views/components_site_views/view.html.php | 3 - admin/views/components_updates/view.html.php | 3 - admin/views/custom_admin_view/tmpl/edit.php | 2 +- admin/views/custom_admin_view/view.html.php | 23 +-- admin/views/custom_admin_views/view.html.php | 3 - admin/views/custom_code/tmpl/edit.php | 2 +- admin/views/custom_code/view.html.php | 23 +-- admin/views/custom_codes/view.html.php | 3 - admin/views/dynamic_get/tmpl/edit.php | 2 +- admin/views/dynamic_get/view.html.php | 23 +-- admin/views/dynamic_gets/view.html.php | 3 - admin/views/field/tmpl/edit.php | 2 +- admin/views/field/view.html.php | 23 +-- admin/views/fields/view.html.php | 3 - admin/views/fieldtype/tmpl/edit.php | 2 +- admin/views/fieldtype/view.html.php | 23 +-- admin/views/fieldtypes/view.html.php | 3 - admin/views/get_snippets/view.html.php | 3 - admin/views/help_document/tmpl/edit.php | 2 +- admin/views/help_document/view.html.php | 23 +-- admin/views/help_documents/view.html.php | 3 - admin/views/import/view.html.php | 3 - .../import_joomla_components/view.html.php | 3 - .../view.html.php | 3 - admin/views/joomla_component/tmpl/edit.php | 2 +- admin/views/joomla_component/view.html.php | 23 +-- admin/views/joomla_components/view.html.php | 3 - admin/views/language/tmpl/edit.php | 2 +- admin/views/language/view.html.php | 23 +-- .../views/language_translation/tmpl/edit.php | 2 +- .../views/language_translation/view.html.php | 23 +-- .../views/language_translations/view.html.php | 3 - admin/views/languages/view.html.php | 3 - admin/views/layout/tmpl/edit.php | 2 +- admin/views/layout/view.html.php | 23 +-- admin/views/layouts/view.html.php | 3 - admin/views/libraries/view.html.php | 3 - admin/views/libraries_config/view.html.php | 3 - .../view.html.php | 3 - admin/views/library/tmpl/edit.php | 2 +- admin/views/library/view.html.php | 23 +-- admin/views/library_config/tmpl/edit.php | 2 +- admin/views/library_config/view.html.php | 23 +-- .../library_files_folders_urls/tmpl/edit.php | 2 +- .../library_files_folders_urls/view.html.php | 23 +-- admin/views/server/tmpl/edit.php | 2 +- admin/views/server/view.html.php | 23 +-- admin/views/servers/view.html.php | 3 - admin/views/site_view/tmpl/edit.php | 2 +- admin/views/site_view/view.html.php | 23 +-- admin/views/site_views/view.html.php | 3 - admin/views/snippet/tmpl/edit.php | 2 +- admin/views/snippet/view.html.php | 23 +-- admin/views/snippet_type/tmpl/edit.php | 2 +- admin/views/snippet_type/view.html.php | 23 +-- admin/views/snippet_types/view.html.php | 3 - admin/views/snippets/view.html.php | 3 - admin/views/template/tmpl/edit.php | 2 +- admin/views/template/view.html.php | 23 +-- admin/views/templates/view.html.php | 3 - admin/views/validation_rule/tmpl/edit.php | 2 +- admin/views/validation_rule/view.html.php | 23 +-- admin/views/validation_rules/view.html.php | 3 - componentbuilder.xml | 2 +- script.php | 2 - site/componentbuilder.php | 11 +- site/controller.php | 3 - site/controllers/api.php | 3 - site/controllers/help.php | 3 - site/helpers/route.php | 4 - site/models/api.php | 3 - site/views/api/view.html.php | 3 - 568 files changed, 4230 insertions(+), 3609 deletions(-) diff --git a/README.md b/README.md index 84b60c0d5..fff3d7b47 100644 --- a/README.md +++ b/README.md @@ -125,11 +125,11 @@ 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*: 2nd August, 2018 ++ *Last Build*: 7th August, 2018 + *Version*: 2.8.5 + *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*: **186364** ++ *Line count*: **187020** + *Field count*: **1059** + *File count*: **1239** + *Folder count*: **197** diff --git a/admin/README.txt b/admin/README.txt index 84b60c0d5..fff3d7b47 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -125,11 +125,11 @@ 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*: 2nd August, 2018 ++ *Last Build*: 7th August, 2018 + *Version*: 2.8.5 + *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*: **186364** ++ *Line count*: **187020** + *Field count*: **1059** + *File count*: **1239** + *Folder count*: **197** diff --git a/admin/compiler/joomla_3/DASHJControllerAdmin.php b/admin/compiler/joomla_3/DASHJControllerAdmin.php index c168d2d51..1d6e6ae7c 100644 --- a/admin/compiler/joomla_3/DASHJControllerAdmin.php +++ b/admin/compiler/joomla_3/DASHJControllerAdmin.php @@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * ###Component### Controller */ diff --git a/admin/compiler/joomla_3/DASHJModelList.php b/admin/compiler/joomla_3/DASHJModelList.php index 65f0b06c4..19a250abc 100644 --- a/admin/compiler/joomla_3/DASHJModelList.php +++ b/admin/compiler/joomla_3/DASHJModelList.php @@ -29,10 +29,6 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import the Joomla modellist library -jimport('joomla.application.component.modellist'); -jimport('joomla.application.component.helper'); - /** * ###Component### Model */ diff --git a/admin/compiler/joomla_3/DASHJViewLagacy.php b/admin/compiler/joomla_3/DASHJViewLagacy.php index 5a31fd861..f7125737b 100644 --- a/admin/compiler/joomla_3/DASHJViewLagacy.php +++ b/admin/compiler/joomla_3/DASHJViewLagacy.php @@ -29,9 +29,6 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla view library -jimport('joomla.application.component.view'); - /** * ###Component### View class */ diff --git a/admin/compiler/joomla_3/Helper_email.php b/admin/compiler/joomla_3/Helper_email.php index a75d36ad2..2dd21a0be 100644 --- a/admin/compiler/joomla_3/Helper_email.php +++ b/admin/compiler/joomla_3/Helper_email.php @@ -319,7 +319,7 @@ abstract class ###Component###Email $body[] = ""; $body[] = ""; $body[] = ""; - $body[] = "".$subject.""; + $body[] = "" . $subject . ""; $body[] = "