From b64e423f515dc28b833beebedba9d542bb370f20 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 11 Aug 2021 14:15:35 +0200 Subject: [PATCH] Added the option to import JCB packages with GUID mapping. Resolved gh-657 to allow for painless fieldtype change in the field area. --- README.md | 12 ++-- admin/README.txt | 12 ++-- admin/config.xml | 47 +++++++++----- admin/helpers/compiler/a_Get.php | 16 ++--- admin/helpers/compiler/c_Fields.php | 2 +- admin/helpers/compiler/e_Interpretation.php | 2 +- admin/helpers/componentbuilder.php | 63 ++++++++++++++++++- .../en-GB/en-GB.com_componentbuilder.ini | 35 +++++++---- admin/models/ajax.php | 53 ++++++++++------ admin/models/class_extendings.php | 1 + admin/models/class_methods.php | 6 +- admin/models/class_properties.php | 6 +- .../classextendingsfilterextensiontype.php | 2 +- .../classmethodsfilterextensiontype.php | 2 +- .../classpropertiesfilterextensiontype.php | 2 +- admin/models/forms/admin_custom_tabs.xml | 2 - admin/models/forms/admin_view.xml | 4 -- admin/models/forms/class_extends.xml | 4 +- admin/models/forms/class_method.xml | 12 +++- admin/models/forms/class_property.xml | 22 ++++--- .../forms/component_custom_admin_menus.xml | 2 - admin/models/forms/component_dashboard.xml | 2 - admin/models/forms/custom_admin_view.xml | 4 -- admin/models/forms/dynamic_get.xml | 2 - admin/models/forms/field.xml | 2 - admin/models/forms/fieldtype.xml | 4 -- .../models/forms/filter_class_extendings.xml | 4 +- admin/models/forms/filter_class_methods.xml | 4 +- .../models/forms/filter_class_properties.xml | 4 +- admin/models/forms/joomla_component.xml | 2 - admin/models/forms/joomla_module.xml | 2 - admin/models/forms/joomla_plugin.xml | 2 - admin/models/forms/joomla_plugin_group.xml | 2 - admin/models/forms/language.xml | 2 - admin/models/forms/layout.xml | 2 - admin/models/forms/library.xml | 2 - admin/models/forms/server.xml | 2 - admin/models/forms/site_view.xml | 4 -- admin/models/forms/snippet.xml | 2 - admin/models/forms/snippet_type.xml | 2 - admin/models/forms/template.xml | 2 - admin/models/import_joomla_components.php | 17 +++++ admin/models/joomla_plugins.php | 2 +- admin/sql/install.mysql.utf8.sql | 4 +- admin/sql/updates/mysql/2.12.10.sql | 1 + .../import_joomla_components/view.html.php | 25 ++++++++ componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 17 +++++ script.php | 4 +- site/helpers/componentbuilder.php | 63 ++++++++++++++++++- site/router.php | 2 +- 51 files changed, 345 insertions(+), 155 deletions(-) create mode 100644 admin/sql/updates/mysql/2.12.10.sql diff --git a/README.md b/README.md index 7a683370c..afde64752 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,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 save 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.12.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.12.11) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -143,13 +143,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 14th June, 2021 -+ *Version*: 2.12.10 ++ *Last Build*: 11th August, 2021 ++ *Version*: 2.12.11 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **291956** -+ *Field count*: **1629** -+ *File count*: **1935** ++ *Line count*: **292146** ++ *Field count*: **1630** ++ *File count*: **1936** + *Folder count*: **322** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index 7a683370c..afde64752 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -12,7 +12,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 save 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.12.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.12.11) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -143,13 +143,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 14th June, 2021 -+ *Version*: 2.12.10 ++ *Last Build*: 11th August, 2021 ++ *Version*: 2.12.11 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **291956** -+ *Field count*: **1629** -+ *File count*: **1935** ++ *Line count*: **292146** ++ *Field count*: **1630** ++ *File count*: **1936** + *Folder count*: **322** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/config.xml b/admin/config.xml index 033fe5d6e..625a98366 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -761,20 +761,6 @@ max="100" step="10" /> - - - - - - @@ -839,6 +825,39 @@ COM_COMPONENTBUILDER_CONFIG_ALPHANUMERICDOT +
+ + + + + + + + + + + + + +
diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 74ddada49..0f08ac0ce 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -176,12 +176,12 @@ class Get * New Replace Code = /xxx[REPLACE<>$$$$]xxx/ /xxx[/REPLACE<>$$$$]xxx/ * * //////////////////////////////// when JCB adds it back ////////////////////////////////// - * JCB Add Inserted Code = /xxx[INSERTED$$$$]xxx//x23x/ /xxx[/INSERTED$$$$]xxx/ - * JCB Add Replaced Code = /xxx[REPLACED$$$$]xxx//x25x/ /xxx[/REPLACED$$$$]xxx/ + * JCB Add Inserted Code = /xxx[INSERTED$$$$]xxx//xx23xx/ /xxx[/INSERTED$$$$]xxx/ + * JCB Add Replaced Code = /xxx[REPLACED$$$$]xxx//xx25xx/ /xxx[/REPLACED$$$$]xxx/ * * /////////////////////////////// changeing existing custom code ///////////////////////// - * Update Inserted Code = /xxx[INSERTED<>$$$$]xxx//x23x/ /xxx[/INSERTED<>$$$$]xxx/ - * Update Replaced Code = /xxx[REPLACED<>$$$$]xxx//x25x/ /xxx[/REPLACED<>$$$$]xxx/ + * Update Inserted Code = /xxx[INSERTED<>$$$$]xxx//xx23xx/ /xxx[/INSERTED<>$$$$]xxx/ + * Update Replaced Code = /xxx[REPLACED<>$$$$]xxx//xx25xx/ /xxx[/REPLACED<>$$$$]xxx/ * * The custom script placeholders - we use the (==) to avoid detection it should be (--) * ###################################---> HTML <---##################################### @@ -11423,11 +11423,11 @@ class Get switch ($type) { case 11: - //***[REPLACED$$$$]***//*1*/ + //***[REPLACED$$$$]***//**1**/ if ($this->addPlaceholders === true) { return array( - 'start' => '/***[REPLACED$$$$]***//*' . $id . '*/', + 'start' => '/***[REPLACED$$$$]***//**' . $id . '**/', 'end' => '/***[/REPLACED$$$$]***/'); } else @@ -11438,11 +11438,11 @@ class Get } break; case 12: - //***[INSERTED$$$$]***//*1*/ + //***[INSERTED$$$$]***//**1**/ if ($this->addPlaceholders === true) { return array( - 'start' => '/***[INSERTED$$$$]***//*' . $id . '*/', + 'start' => '/***[INSERTED$$$$]***//**' . $id . '**/', 'end' => '/***[/INSERTED$$$$]***/'); } else diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 43ddf0f18..f1e69679d 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -5042,7 +5042,7 @@ class Fields extends Structure ); break; case 4: - // WHMCS_ENCRYPTION_VDMKEY + // WHMCS_ENCRYPTION_VDMKEY (DUE REMOVAL) $this->whmcsFieldModeling[$nameSingleCode][] = $name; // Site settings of each field if needed $this->buildSiteFieldData( diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index d9229b9a3..2832a5b08 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -465,7 +465,7 @@ class Interpretation extends Fields $bool[] = $this->_t(2) . "return false;"; $bool[] = $this->_t(1) . "}"; - // return the genuine mentod statement + // return the genuine method statement return implode(PHP_EOL, $bool); } diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 5802a470d..91e9f01dd 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -2305,6 +2305,57 @@ abstract class ComponentbuilderHelper return false; } + /** + * get the ITEM of a GUID by table + * + * @param string $guid + * @param string $table + * @param string/array $what + * + * @return mix + */ + public static function getGUID ($guid, $table, $what = 'a.id') + { + // check if we have a string + if (self::validateGUID($guid)) + { + // check if table already has this identifier + if (self::checkString($table)) + { + // Get the database object and a new query object. + $db = \JFactory::getDbo(); + $query = $db->getQuery(true); + if (self::checkArray($what)) + { + $query->select($db->quoteName($what)); + } + else + { + $query->select($what); + } + $query->from($db->quoteName('#__componentbuilder_' . (string) $table, 'a')) + ->where($db->quoteName('a.guid') . ' = ' . $db->quote($guid)); + + // Set and query the database. + $db->setQuery($query); + $db->execute(); + + if ($db->getNumRows()) + { + if (self::checkArray($what) || $what === 'a.*') + { + return $db->loadObject(); + } + else + { + return $db->loadResult(); + } + } + } + } + return false; + } + /** * Validate the Globally Unique Identifier * @@ -2423,7 +2474,7 @@ abstract class ComponentbuilderHelper * @return array on success * */ - public static function getFieldTypeProperties($value, $type, $settings = array(), $xml = null, $db_defaults = false) + public static function getFieldTypeProperties($value, $type, $settings = array(), $xml = null, $dbDefaults = false) { // Get a db connection. $db = JFactory::getDbo(); @@ -2432,7 +2483,7 @@ abstract class ComponentbuilderHelper $query = $db->getQuery(true); $query->select($db->quoteName(array('properties', 'short_description', 'description'))); // load database default values - if ($db_defaults) + if ($dbDefaults) { $query->select($db->quoteName(array('datadefault', 'datadefault_other', 'datalenght', 'datalenght_other', 'datatype', 'has_defaults', 'indexes', 'null_switch', 'store'))); } @@ -2459,6 +2510,12 @@ abstract class ComponentbuilderHelper $nr = 0; // php tracker (we must try to load alteast 17 rows $phpTracker = array(); + // force load all properties + $forceAll = false; + if ($xml && strpos($xml, '..__FORCE_LOAD_ALL_PROPERTIES__..') !== false) + { + $forceAll = true; + } // value to check since there are false and null values even 0 in the values returned $confirmation = '8qvZHoyuFYQqpj0YQbc6F3o5DhBlmS-_-a8pmCZfOVSfANjkmV5LG8pCdAY2JNYu6cB'; // set the headers @@ -2504,7 +2561,7 @@ abstract class ComponentbuilderHelper $field['subform']['properties'.$nr] = array('name' => $property['name'], 'value' => $settings[$property['name']], 'desc' => $property['description']); } } - elseif (!$xml || $confirmation !== $value) + elseif ($forceAll || !$xml || $confirmation !== $value) { // add the xml values $field['values'] .= PHP_EOL."\t" . $property['name'] . '="' . ($confirmation !== $value) ? $value : $example .'" '; diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 92d63fe47..6bf26ab69 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -1420,8 +1420,8 @@ COM_COMPONENTBUILDER_CLASS_EXTENDS_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_CLASS_EXTENDS_DETAILS="Details" COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT="Editing the Class Extends" COM_COMPONENTBUILDER_CLASS_EXTENDS_ERROR_UNIQUE_ALIAS="Another Class Extends has the same alias." -COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_DESCRIPTION="Extension type this class_extends belongs to." -COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL="Extension Type" +COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_DESCRIPTION="The type this class_extends belongs to." +COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL="Type" COM_COMPONENTBUILDER_CLASS_EXTENDS_HEAD_DESCRIPTION="The class header to add any header values can be added." COM_COMPONENTBUILDER_CLASS_EXTENDS_HEAD_LABEL="Class Header" COM_COMPONENTBUILDER_CLASS_EXTENDS_ID="Id" @@ -1438,6 +1438,7 @@ COM_COMPONENTBUILDER_CLASS_EXTENDS_NEW="A New Class Extends" COM_COMPONENTBUILDER_CLASS_EXTENDS_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_CLASS_EXTENDS_PERMISSION="Permissions" COM_COMPONENTBUILDER_CLASS_EXTENDS_PLUGINS="plugins" +COM_COMPONENTBUILDER_CLASS_EXTENDS_POWERS="powers" COM_COMPONENTBUILDER_CLASS_EXTENDS_PUBLISHING="Publishing" COM_COMPONENTBUILDER_CLASS_EXTENDS_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Class Extends to customise the alias." COM_COMPONENTBUILDER_CLASS_EXTENDS_SELECT_AN_OPTION="Select an option" @@ -1512,8 +1513,8 @@ COM_COMPONENTBUILDER_CLASS_METHOD_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_CLASS_METHOD_DETAILS="Details" COM_COMPONENTBUILDER_CLASS_METHOD_EDIT="Editing the Class Method" COM_COMPONENTBUILDER_CLASS_METHOD_ERROR_UNIQUE_ALIAS="Another Class Method has the same alias." -COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_DESCRIPTION="Extension type this class_method belongs to." -COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL="Extension Type" +COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_DESCRIPTION="The type this class_method belongs to." +COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL="Type" COM_COMPONENTBUILDER_CLASS_METHOD_GUID_DESCRIPTION="Globally Unique Identifier" COM_COMPONENTBUILDER_CLASS_METHOD_GUID_HINT="Auto Generated" COM_COMPONENTBUILDER_CLASS_METHOD_GUID_LABEL="GUID" @@ -1532,16 +1533,20 @@ COM_COMPONENTBUILDER_CLASS_METHOD_NEW="A New Class Method" COM_COMPONENTBUILDER_CLASS_METHOD_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_CLASS_METHOD_PERMISSION="Permissions" COM_COMPONENTBUILDER_CLASS_METHOD_PLUGINS="plugins" +COM_COMPONENTBUILDER_CLASS_METHOD_POWERS="powers" COM_COMPONENTBUILDER_CLASS_METHOD_PRIVATE="private" +COM_COMPONENTBUILDER_CLASS_METHOD_PRIVATE_STATIC="private static" COM_COMPONENTBUILDER_CLASS_METHOD_PROTECTED="protected" +COM_COMPONENTBUILDER_CLASS_METHOD_PROTECTED_STATIC="protected static" COM_COMPONENTBUILDER_CLASS_METHOD_PUBLIC="public" +COM_COMPONENTBUILDER_CLASS_METHOD_PUBLIC_STATIC="public static" COM_COMPONENTBUILDER_CLASS_METHOD_PUBLISHING="Publishing" COM_COMPONENTBUILDER_CLASS_METHOD_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Class Method to customise the alias." COM_COMPONENTBUILDER_CLASS_METHOD_SELECT_AN_OPTION="Select an option" COM_COMPONENTBUILDER_CLASS_METHOD_STATUS="Status" COM_COMPONENTBUILDER_CLASS_METHOD_VERSION_DESC="A count of the number of times this Class Method has been revised." COM_COMPONENTBUILDER_CLASS_METHOD_VERSION_LABEL="Version" -COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_DESCRIPTION="The visibility of a function/method or property can be defined by prefixing the declaration with the keywords public, protected or private." +COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_DESCRIPTION="The visibility of a function/method or property can be defined by prefixing the declaration with the keywords public, protected or private. You also have the option to make function/method or property static." COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL="Visibility" COM_COMPONENTBUILDER_CLASS_PROPERTIES="Class Properties" COM_COMPONENTBUILDER_CLASS_PROPERTIES_ACCESS="Class Properties Access" @@ -1605,13 +1610,13 @@ COM_COMPONENTBUILDER_CLASS_PROPERTY_CREATED_DATE_DESC="The date this Class Prope COM_COMPONENTBUILDER_CLASS_PROPERTY_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_DESCRIPTION="Enter default value" COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_HINT="Default Value Here" -COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_LABEL="Default" +COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_LABEL="default" COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_MESSAGE="Error! Please add default value here." COM_COMPONENTBUILDER_CLASS_PROPERTY_DETAILS="Details" COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT="Editing the Class Property" COM_COMPONENTBUILDER_CLASS_PROPERTY_ERROR_UNIQUE_ALIAS="Another Class Property has the same alias." -COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_DESCRIPTION="Extension type this class_property belongs to." -COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL="Extension Type" +COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_DESCRIPTION="The type this class_property belongs to." +COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL="Type" COM_COMPONENTBUILDER_CLASS_PROPERTY_GUID_DESCRIPTION="Globally Unique Identifier" COM_COMPONENTBUILDER_CLASS_PROPERTY_GUID_HINT="Auto Generated" COM_COMPONENTBUILDER_CLASS_PROPERTY_GUID_LABEL="GUID" @@ -1630,16 +1635,20 @@ COM_COMPONENTBUILDER_CLASS_PROPERTY_NEW="A New Class Property" COM_COMPONENTBUILDER_CLASS_PROPERTY_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_CLASS_PROPERTY_PERMISSION="Permissions" COM_COMPONENTBUILDER_CLASS_PROPERTY_PLUGINS="plugins" +COM_COMPONENTBUILDER_CLASS_PROPERTY_POWERS="powers" COM_COMPONENTBUILDER_CLASS_PROPERTY_PRIVATE="private" +COM_COMPONENTBUILDER_CLASS_PROPERTY_PRIVATE_STATIC="private static" COM_COMPONENTBUILDER_CLASS_PROPERTY_PROTECTED="protected" +COM_COMPONENTBUILDER_CLASS_PROPERTY_PROTECTED_STATIC="protected static" COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLIC="public" +COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLIC_STATIC="public static" COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLISHING="Publishing" COM_COMPONENTBUILDER_CLASS_PROPERTY_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Class Property to customise the alias." COM_COMPONENTBUILDER_CLASS_PROPERTY_SELECT_AN_OPTION="Select an option" COM_COMPONENTBUILDER_CLASS_PROPERTY_STATUS="Status" COM_COMPONENTBUILDER_CLASS_PROPERTY_VERSION_DESC="A count of the number of times this Class Property has been revised." COM_COMPONENTBUILDER_CLASS_PROPERTY_VERSION_LABEL="Version" -COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_DESCRIPTION="The visibility of a function/method or property can be defined by prefixing the declaration with the keywords public, protected or private." +COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_DESCRIPTION="The visibility of a function/method or property can be defined by prefixing the declaration with the keywords public, protected or private. You also have the option to make function/method or property static." COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL="Visibility" COM_COMPONENTBUILDER_CLEAR_TMP="Clear tmp" COM_COMPONENTBUILDER_CLONE="Clone" @@ -3413,11 +3422,14 @@ COM_COMPONENTBUILDER_CONFIG_GLOBAL="Global" COM_COMPONENTBUILDER_CONFIG_GLOBAL_DESC="The Global Parameters" COM_COMPONENTBUILDER_CONFIG_GLOBAL_LABEL="Global" COM_COMPONENTBUILDER_CONFIG_GRADIANT_LOAD="Gradient" +COM_COMPONENTBUILDER_CONFIG_IMPORT_GUID_ONLY_DESCRIPTION="Force that all JCB package import (search for local items) is done with GUID value only." +COM_COMPONENTBUILDER_CONFIG_IMPORT_GUID_ONLY_LABEL="Import by GUID only!" COM_COMPONENTBUILDER_CONFIG_INACTIVE="Inactive" COM_COMPONENTBUILDER_CONFIG_INSTALL_DESCRIPTION="Component locally" COM_COMPONENTBUILDER_CONFIG_INSTALL_LABEL="Install" COM_COMPONENTBUILDER_CONFIG_INTELLIGENT_ADDREMOVEIF="Intelligent (add&remove+if)" COM_COMPONENTBUILDER_CONFIG_JCB_COMMUNITY_PACKAGES="JCB Community Packages" +COM_COMPONENTBUILDER_CONFIG_JCB_PACKAGES="JCB Packages" COM_COMPONENTBUILDER_CONFIG_JCB_PACKAGE_DIRECTORIES_DESCRIPTION="Here you can manage what package directories show in the JCB package import area." COM_COMPONENTBUILDER_CONFIG_JCB_PACKAGE_DIRECTORIES_LABEL="Directories" COM_COMPONENTBUILDER_CONFIG_LANGUAGE_LABEL="Language" @@ -5130,8 +5142,6 @@ COM_COMPONENTBUILDER_FILTER_DYNAMIC_GET_ASCENDING="Dynamic Get ascending" COM_COMPONENTBUILDER_FILTER_DYNAMIC_GET_DESCENDING="Dynamic Get descending" COM_COMPONENTBUILDER_FILTER_EXTENDS_ASCENDING="Extends ascending" COM_COMPONENTBUILDER_FILTER_EXTENDS_DESCENDING="Extends descending" -COM_COMPONENTBUILDER_FILTER_EXTENSION_TYPE_ASCENDING="Extension Type ascending" -COM_COMPONENTBUILDER_FILTER_EXTENSION_TYPE_DESCENDING="Extension Type descending" COM_COMPONENTBUILDER_FILTER_FIELDS_CATEGORIES_ASCENDING="Fields Categories ascending" COM_COMPONENTBUILDER_FILTER_FIELDS_CATEGORIES_DESCENDING="Fields Categories descending" COM_COMPONENTBUILDER_FILTER_FIELDTYPES_CATEGORIES_ASCENDING="Fieldtypes Categories ascending" @@ -5284,7 +5294,6 @@ COM_COMPONENTBUILDER_FILTER_SELECT_COMPONENT="Select Component" COM_COMPONENTBUILDER_FILTER_SELECT_DATA_TYPE="Select Data Type" COM_COMPONENTBUILDER_FILTER_SELECT_DYNAMIC_GET="Select Dynamic Get" COM_COMPONENTBUILDER_FILTER_SELECT_EXTENDS="Select Extends" -COM_COMPONENTBUILDER_FILTER_SELECT_EXTENSION_TYPE="Select Extension Type" COM_COMPONENTBUILDER_FILTER_SELECT_FADE_IN_AFFECT="Select Fade In Affect" COM_COMPONENTBUILDER_FILTER_SELECT_FIELDS_CATEGORIES="Select Fields Categories" COM_COMPONENTBUILDER_FILTER_SELECT_FIELDTYPES_CATEGORIES="Select Fieldtypes Categories" @@ -5337,6 +5346,7 @@ COM_COMPONENTBUILDER_FOLDER="Folder" COM_COMPONENTBUILDER_FOLDER_BSB_WAS_MOVED_TO_BSB="Folder %s was moved to %s" COM_COMPONENTBUILDER_FOLDER_BSB_WAS_NOT_MOVED_TO_BSB="Folder %s was not moved to %s" COM_COMPONENTBUILDER_FORCE_LOCAL_UPDATE="Force Local Update" +COM_COMPONENTBUILDER_FORCE_THAT_THIS_JCB_PACKAGE_IMPORT_SEARCH_FOR_LOCAL_ITEMS_TO_BE_DONE_WITH_GUID_VALUE_ONLY_IF_BMERGEB_IS_SET_TO_YES_ABOVE="Force that this JCB package import (search for local items) to be done with GUID value only, if Merge is set to yes above." COM_COMPONENTBUILDER_FREEOPEN="Free/Open" COM_COMPONENTBUILDER_FULL_WIDTH_IN_TAB="Full Width in Tab" COM_COMPONENTBUILDER_FUNCTION_NAME_ALREADY_TAKEN_PLEASE_TRY_AGAIN="Function name already taken, please try again." @@ -5493,6 +5503,7 @@ COM_COMPONENTBUILDER_IAUTHORI_BSB="Author: %s" COM_COMPONENTBUILDER_ICOMPANYI_BSB="Company: %s" COM_COMPONENTBUILDER_ICON="Icon" COM_COMPONENTBUILDER_IEMAILI_BSB="Email: %s" +COM_COMPONENTBUILDER_IMPORT_BY_GUID_ONLY="Import by GUID only!" COM_COMPONENTBUILDER_IMPORT_CONTINUE="Continue" COM_COMPONENTBUILDER_IMPORT_DATA="Import Data" COM_COMPONENTBUILDER_IMPORT_DATA_DESC="Allows users in this group to import data." diff --git a/admin/models/ajax.php b/admin/models/ajax.php index cc3b31f7f..c2d132383 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -604,7 +604,7 @@ class ComponentbuilderModelAjax extends JModelList 'before' => array('table' => 'admin_view', 'tables' => 'admin_views', 'id' => 'id', 'name' => 'system_name', 'text' => 'Admin View') ); - protected function checkRepeatableConversion(&$fieldsData, $fieldsArrayType, $id, $linked_id_name) + protected function checkRepeatableConversion($type, &$fieldsData, $fieldsArrayType, $id, $linked_id_name) { if (ComponentbuilderHelper::checkJson($fieldsData) && isset($this->conversionCheck[$fieldsArrayType])) { @@ -624,7 +624,7 @@ class ComponentbuilderModelAjax extends JModelList $objectUpdate = new stdClass(); $objectUpdate->{$linked_id_name} = (int) $id; $objectUpdate->{$fieldsArrayType} = $fieldsData; - JFactory::getDbo()->updateObject('#__componentbuilder_'.$type, $objectUpdate, 'admin_view'); + JFactory::getDbo()->updateObject('#__componentbuilder_' . $type, $objectUpdate, 'admin_view'); } } } @@ -1733,7 +1733,7 @@ class ComponentbuilderModelAjax extends JModelList // check repeatable conversion if (method_exists(__CLASS__, 'checkRepeatableConversion')) { - $this->checkRepeatableConversion($fieldsData, $fieldName, $id, $idName); + $this->checkRepeatableConversion($type, $fieldsData, $fieldName, $id, $idName); } // get the table $table = $this->getSubformTable($type, $fieldsData); @@ -2180,8 +2180,8 @@ class ComponentbuilderModelAjax extends JModelList { // reset the buttons bucket $buttons = array(); - // some helper for some fields - $helper = array('xml' => 'note_select_field_type'); + // some helper for some fields (I am sorry) + $helper = array('xml' => 'note_filter_information'); // get input $jinput = JFactory::getApplication()->input; $return_here = $jinput->get('return_here', null, 'base64'); @@ -2235,10 +2235,14 @@ class ComponentbuilderModelAjax extends JModelList // check if field has string length if (ComponentbuilderHelper::checkString($value)) { - $buttons[$key] = array(); + // see if the field needs some help :) + $_key = (isset($helper[$key])) ? $helper[$key] : $key; + + // build the buttons + $buttons[$_key] = array(); if (($button = $this->getButton('custom_code', 3)) && ComponentbuilderHelper::checkString($button)) { - $buttons[$key]['_create'] = $button; + $buttons[$_key]['_create'] = $button; } } } @@ -2248,15 +2252,16 @@ class ComponentbuilderModelAjax extends JModelList { foreach ($bucket as $field => $customcodes) { - $edit_icon = ' '; // see if the field needs some help :) - if (isset($helper[$field])) - { - $field = $helper[$field]; - } + $field = (isset($helper[$field])) ? $helper[$field] : $field; + // set the edit icon + $edit_icon = ' '; + // load the buttons found foreach ($customcodes as $customcode) { + // get the customcode name $key = (array) explode('+', $customcode); + // see if we can get the button if (!isset($buttons[$field][$key[0]]) && ($_id = ComponentbuilderHelper::getVar('custom_code', $key[0], 'function_name')) !== false && ($button = ComponentbuilderHelper::getEditTextButton($edit_icon . $key[0], $_id, 'custom_code', 'custom_codes', $return_here, 'com_componentbuilder', false, 'btn btn-small button-edit" style="margin: 0 0 5px 0;')) && ComponentbuilderHelper::checkString($button)) @@ -3225,15 +3230,23 @@ class ComponentbuilderModelAjax extends JModelList { // first check field type $_fieldType = ComponentbuilderHelper::getVar('field', $global['a_id'], 'id', 'fieldtype'); - // only continue if field type is the same - if ($fieldtype == $_fieldType) + $xmlDB = ComponentbuilderHelper::getVar('field', $global['a_id'], 'id', 'xml'); + // check if it is a string + if (ComponentbuilderHelper::checkString($xmlDB)) { - $xmlDB = ComponentbuilderHelper::getVar('field', $global['a_id'], 'id', 'xml'); - // check if it is a string - if (ComponentbuilderHelper::checkString($xmlDB)) - { - $xml = json_decode($xmlDB); - } + $xml = json_decode($xmlDB); + } + // remove the field type if not the same + if ($xml && $fieldtype != $_fieldType) + { + // unset some stuff + $pattern = array(); + $pattern[] = '/type=".+?"/i'; // to force the new type to be set + $pattern[] = '/class=".+?"/i'; // to remove all classes + $pattern[] = '/type_php.+?".+?"/i'; // to remove any PHP code stuff + + // also add a special switch to force adding all properties of the new type + $xml = preg_replace($pattern, '..__FORCE_LOAD_ALL_PROPERTIES__..', $xml); } } return $xml; diff --git a/admin/models/class_extendings.php b/admin/models/class_extendings.php index 4e7077d11..6c1a583b3 100644 --- a/admin/models/class_extendings.php +++ b/admin/models/class_extendings.php @@ -163,6 +163,7 @@ class ComponentbuilderModelClass_extendings extends JModelList { $extension_typeArray = array( 0 => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_SELECT_AN_OPTION', + 'powers' => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_POWERS', 'components' => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_COMPONENTS', 'plugins' => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_PLUGINS', 'modules' => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_MODULES' diff --git a/admin/models/class_methods.php b/admin/models/class_methods.php index f0492760a..74ebe9b33 100644 --- a/admin/models/class_methods.php +++ b/admin/models/class_methods.php @@ -174,7 +174,10 @@ class ComponentbuilderModelClass_methods extends JModelList $visibilityArray = array( 'public' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PUBLIC', 'protected' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PROTECTED', - 'private' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PRIVATE' + 'private' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PRIVATE', + 'public static' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PUBLIC_STATIC', + 'protected static' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PROTECTED_STATIC', + 'private static' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PRIVATE_STATIC' ); // Now check if value is found in this array if (isset($visibilityArray[$value]) && ComponentbuilderHelper::checkString($visibilityArray[$value])) @@ -187,6 +190,7 @@ class ComponentbuilderModelClass_methods extends JModelList { $extension_typeArray = array( 0 => 'COM_COMPONENTBUILDER_CLASS_METHOD_SELECT_AN_OPTION', + 'powers' => 'COM_COMPONENTBUILDER_CLASS_METHOD_POWERS', 'components' => 'COM_COMPONENTBUILDER_CLASS_METHOD_COMPONENTS', 'plugins' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PLUGINS', 'modules' => 'COM_COMPONENTBUILDER_CLASS_METHOD_MODULES' diff --git a/admin/models/class_properties.php b/admin/models/class_properties.php index b2b71680e..5e833621f 100644 --- a/admin/models/class_properties.php +++ b/admin/models/class_properties.php @@ -174,7 +174,10 @@ class ComponentbuilderModelClass_properties extends JModelList $visibilityArray = array( 'public' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLIC', 'protected' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PROTECTED', - 'private' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PRIVATE' + 'private' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PRIVATE', + 'public static' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLIC_STATIC', + 'protected static' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PROTECTED_STATIC', + 'private static' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PRIVATE_STATIC' ); // Now check if value is found in this array if (isset($visibilityArray[$value]) && ComponentbuilderHelper::checkString($visibilityArray[$value])) @@ -187,6 +190,7 @@ class ComponentbuilderModelClass_properties extends JModelList { $extension_typeArray = array( 0 => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_SELECT_AN_OPTION', + 'powers' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_POWERS', 'components' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_COMPONENTS', 'plugins' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PLUGINS', 'modules' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_MODULES' diff --git a/admin/models/fields/classextendingsfilterextensiontype.php b/admin/models/fields/classextendingsfilterextensiontype.php index 0c5d3ba6f..dea27b50a 100644 --- a/admin/models/fields/classextendingsfilterextensiontype.php +++ b/admin/models/fields/classextendingsfilterextensiontype.php @@ -51,7 +51,7 @@ class JFormFieldClassextendingsfilterextensiontype extends JFormFieldList $results = $db->loadColumn(); $_filter = array(); - $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_EXTENSION_TYPE') . ' -'); + $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_TYPE') . ' -'); if ($results) { diff --git a/admin/models/fields/classmethodsfilterextensiontype.php b/admin/models/fields/classmethodsfilterextensiontype.php index f9b4ba76c..dba234cd3 100644 --- a/admin/models/fields/classmethodsfilterextensiontype.php +++ b/admin/models/fields/classmethodsfilterextensiontype.php @@ -51,7 +51,7 @@ class JFormFieldClassmethodsfilterextensiontype extends JFormFieldList $results = $db->loadColumn(); $_filter = array(); - $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_EXTENSION_TYPE') . ' -'); + $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_TYPE') . ' -'); if ($results) { diff --git a/admin/models/fields/classpropertiesfilterextensiontype.php b/admin/models/fields/classpropertiesfilterextensiontype.php index 4fab6a488..4d76fcd70 100644 --- a/admin/models/fields/classpropertiesfilterextensiontype.php +++ b/admin/models/fields/classpropertiesfilterextensiontype.php @@ -51,7 +51,7 @@ class JFormFieldClasspropertiesfilterextensiontype extends JFormFieldList $results = $db->loadColumn(); $_filter = array(); - $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_EXTENSION_TYPE') . ' -'); + $_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_TYPE') . ' -'); if ($results) { diff --git a/admin/models/forms/admin_custom_tabs.xml b/admin/models/forms/admin_custom_tabs.xml index 4733e880a..bf05ddcf6 100644 --- a/admin/models/forms/admin_custom_tabs.xml +++ b/admin/models/forms/admin_custom_tabs.xml @@ -153,8 +153,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_NAME_MESSAGE" diff --git a/admin/models/forms/admin_view.xml b/admin/models/forms/admin_view.xml index 5a8bb84b5..86015c4f7 100644 --- a/admin/models/forms/admin_view.xml +++ b/admin/models/forms/admin_view.xml @@ -608,8 +608,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_MESSAGE" @@ -1788,8 +1786,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_MESSAGE" diff --git a/admin/models/forms/class_extends.xml b/admin/models/forms/class_extends.xml index 2884e5691..8861f9e1d 100644 --- a/admin/models/forms/class_extends.xml +++ b/admin/models/forms/class_extends.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_MESSAGE" @@ -121,6 +119,8 @@ + + + + + + + + +
diff --git a/admin/models/forms/component_custom_admin_menus.xml b/admin/models/forms/component_custom_admin_menus.xml index 442c49a76..92aedb08b 100644 --- a/admin/models/forms/component_custom_admin_menus.xml +++ b/admin/models/forms/component_custom_admin_menus.xml @@ -125,8 +125,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NAME_MESSAGE" diff --git a/admin/models/forms/component_dashboard.xml b/admin/models/forms/component_dashboard.xml index d3fb2f3b5..fa48e9fc1 100644 --- a/admin/models/forms/component_dashboard.xml +++ b/admin/models/forms/component_dashboard.xml @@ -139,8 +139,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NAME_MESSAGE" diff --git a/admin/models/forms/custom_admin_view.xml b/admin/models/forms/custom_admin_view.xml index 736eab4ee..342b510fb 100644 --- a/admin/models/forms/custom_admin_view.xml +++ b/admin/models/forms/custom_admin_view.xml @@ -116,8 +116,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NAME_MESSAGE" @@ -1120,8 +1118,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NAME_MESSAGE" diff --git a/admin/models/forms/dynamic_get.xml b/admin/models/forms/dynamic_get.xml index 32af1c69c..bf0b67278 100644 --- a/admin/models/forms/dynamic_get.xml +++ b/admin/models/forms/dynamic_get.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_DYNAMIC_GET_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_DYNAMIC_GET_NAME_MESSAGE" diff --git a/admin/models/forms/field.xml b/admin/models/forms/field.xml index cfc9c0c70..8d41bed53 100644 --- a/admin/models/forms/field.xml +++ b/admin/models/forms/field.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_FIELD_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_FIELD_NAME_MESSAGE" diff --git a/admin/models/forms/fieldtype.xml b/admin/models/forms/fieldtype.xml index 75ac5e364..4f82ebb79 100644 --- a/admin/models/forms/fieldtype.xml +++ b/admin/models/forms/fieldtype.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_FIELDTYPE_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_FIELDTYPE_NAME_MESSAGE" @@ -324,8 +322,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_FIELDTYPE_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_FIELDTYPE_NAME_MESSAGE" diff --git a/admin/models/forms/filter_class_extendings.xml b/admin/models/forms/filter_class_extendings.xml index b1de23b0a..e701407be 100644 --- a/admin/models/forms/filter_class_extendings.xml +++ b/admin/models/forms/filter_class_extendings.xml @@ -57,8 +57,8 @@ - - + + diff --git a/admin/models/forms/filter_class_methods.xml b/admin/models/forms/filter_class_methods.xml index 937aa8656..1cb605191 100644 --- a/admin/models/forms/filter_class_methods.xml +++ b/admin/models/forms/filter_class_methods.xml @@ -66,8 +66,8 @@ - - + + diff --git a/admin/models/forms/filter_class_properties.xml b/admin/models/forms/filter_class_properties.xml index 3f2ebb42b..c92f82bee 100644 --- a/admin/models/forms/filter_class_properties.xml +++ b/admin/models/forms/filter_class_properties.xml @@ -66,8 +66,8 @@ - - + + diff --git a/admin/models/forms/joomla_component.xml b/admin/models/forms/joomla_component.xml index 0f03d0893..26bb91c4b 100644 --- a/admin/models/forms/joomla_component.xml +++ b/admin/models/forms/joomla_component.xml @@ -1202,8 +1202,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_MESSAGE" diff --git a/admin/models/forms/joomla_module.xml b/admin/models/forms/joomla_module.xml index 8c6cec2c6..a2de9b37c 100644 --- a/admin/models/forms/joomla_module.xml +++ b/admin/models/forms/joomla_module.xml @@ -832,8 +832,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_JOOMLA_MODULE_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_JOOMLA_MODULE_NAME_MESSAGE" diff --git a/admin/models/forms/joomla_plugin.xml b/admin/models/forms/joomla_plugin.xml index 3c3878969..ef43ec2d5 100644 --- a/admin/models/forms/joomla_plugin.xml +++ b/admin/models/forms/joomla_plugin.xml @@ -799,8 +799,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_MESSAGE" diff --git a/admin/models/forms/joomla_plugin_group.xml b/admin/models/forms/joomla_plugin_group.xml index f68c65cc4..888298674 100644 --- a/admin/models/forms/joomla_plugin_group.xml +++ b/admin/models/forms/joomla_plugin_group.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_MESSAGE" diff --git a/admin/models/forms/language.xml b/admin/models/forms/language.xml index a4882c39d..ff794c747 100644 --- a/admin/models/forms/language.xml +++ b/admin/models/forms/language.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_LANGUAGE_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_LANGUAGE_NAME_MESSAGE" diff --git a/admin/models/forms/layout.xml b/admin/models/forms/layout.xml index 75b64a30e..a12c4c786 100644 --- a/admin/models/forms/layout.xml +++ b/admin/models/forms/layout.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_LAYOUT_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_LAYOUT_NAME_MESSAGE" diff --git a/admin/models/forms/library.xml b/admin/models/forms/library.xml index 224f5b017..a6337c185 100644 --- a/admin/models/forms/library.xml +++ b/admin/models/forms/library.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_LIBRARY_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_LIBRARY_NAME_MESSAGE" diff --git a/admin/models/forms/server.xml b/admin/models/forms/server.xml index 884ec9e73..b22cf1557 100644 --- a/admin/models/forms/server.xml +++ b/admin/models/forms/server.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_SERVER_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_SERVER_NAME_MESSAGE" diff --git a/admin/models/forms/site_view.xml b/admin/models/forms/site_view.xml index 5932adc54..eba94ccf6 100644 --- a/admin/models/forms/site_view.xml +++ b/admin/models/forms/site_view.xml @@ -116,8 +116,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_SITE_VIEW_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_SITE_VIEW_NAME_MESSAGE" @@ -1139,8 +1137,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_SITE_VIEW_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_SITE_VIEW_NAME_MESSAGE" diff --git a/admin/models/forms/snippet.xml b/admin/models/forms/snippet.xml index 938d9a023..7fbff3968 100644 --- a/admin/models/forms/snippet.xml +++ b/admin/models/forms/snippet.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_SNIPPET_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_SNIPPET_NAME_MESSAGE" diff --git a/admin/models/forms/snippet_type.xml b/admin/models/forms/snippet_type.xml index 14287a313..8f1a0dd7a 100644 --- a/admin/models/forms/snippet_type.xml +++ b/admin/models/forms/snippet_type.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_SNIPPET_TYPE_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_SNIPPET_TYPE_NAME_MESSAGE" diff --git a/admin/models/forms/template.xml b/admin/models/forms/template.xml index 0d4e7a31d..a2a4495ef 100644 --- a/admin/models/forms/template.xml +++ b/admin/models/forms/template.xml @@ -102,8 +102,6 @@ maxlength="150" description="COM_COMPONENTBUILDER_TEMPLATE_NAME_DESCRIPTION" class="text_area" - readonly="false" - disabled="false" required="true" filter="STRING" message="COM_COMPONENTBUILDER_TEMPLATE_NAME_MESSAGE" diff --git a/admin/models/import_joomla_components.php b/admin/models/import_joomla_components.php index 5e2a000ac..7555c0d72 100644 --- a/admin/models/import_joomla_components.php +++ b/admin/models/import_joomla_components.php @@ -72,6 +72,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy } public $canmerge = 1; + public $importGuidOnly = 1; public $postfix = false; public $forceUpdate = 0; public $hasKey = 0; @@ -224,6 +225,8 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy $this->moreInfo = $this->app->input->getInt('more_info', 0); // allow merge $this->canmerge = $this->app->input->getInt('canmerge', 1); + // forch GUID only search + $this->importGuidOnly = $this->app->input->getInt('import_guid_only', 0); // has a key $this->hasKey = $this->app->input->getInt('haskey', 0); // die sleutle @@ -2671,6 +2674,20 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy $query->from($this->_db->quoteName('#__componentbuilder_' . $type, 'a')); // only run query if where is set $runQuery = false; + // we first try to get the item by GUID + if ($get == 1 && isset($item->guid)) + { + if (($item = ComponentbuilderHelper::getGUID($item->guid, $type, 'a.*')) !== false) + { + return $item; + } + // check if we should continue the search + elseif ($this->importGuidOnly == 1) + { + return false; + } + } + // continue search if ($get == 1 && isset($item->created) && isset($item->id) && (isset($item->name) || isset($item->system_name))) { // to prefent crazy mismatch with old IDs (I know very weired) diff --git a/admin/models/joomla_plugins.php b/admin/models/joomla_plugins.php index ed901e1cd..fa290f49f 100644 --- a/admin/models/joomla_plugins.php +++ b/admin/models/joomla_plugins.php @@ -111,7 +111,7 @@ class ComponentbuilderModelJoomla_plugins extends JModelList // extract the boilerplate class comment $class['comment'] = ComponentbuilderHelper::extractBoilerplateClassComment($fooClass, $classExtends, 'plugins'); // set the extension type - $class['extension_type'] = 'plugins'; + $class['target_type'] = 'plugins'; // store the class $this->storePluginBoilerplate($tables['e'], $models['e'], $class, $app); // work around diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index f73258c51..891b32c98 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -800,7 +800,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_class_property` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `comment` TEXT NOT NULL, - `default` VARCHAR(255) NOT NULL DEFAULT '', + `default` TEXT NOT NULL, `extension_type` VARCHAR(64) NOT NULL DEFAULT '', `guid` VARCHAR(36) NOT NULL DEFAULT '', `joomla_plugin_group` INT(11) NOT NULL DEFAULT 0, @@ -2124,7 +2124,7 @@ INSERT INTO `#__componentbuilder_field` (`id`, `add_css_view`, `add_css_views`, (100, '', '', '', '', '', '', '', '', 255, '', 'VARCHAR', '', '', '', 'Email (required)', 'NOT NULL', '', 24, '\"\"', 1, '2015-05-05 23:44:32', '2016-02-07 22:43:18', 4, '', 285, '10c1eccb-b3c3-4325-a056-45a72d116fd8'), (158, '', '', '', '', '', '', '', '', 255, '', 'VARCHAR', '', '', '', 'Image', 'NOT NULL', '', 12, '\"\"', 1, '2015-04-29 14:00:56', '2020-06-07 02:17:46', 2, '', 45, '0d6970af-b361-4f65-84f6-0eb0c5f09bad'), (196, '', '', '', '', '', '', '', '', 64, '', 'VARCHAR', '', '', '', 'Mobile Phone', 'NOT NULL', '', 23, '\"\"', 1, '2015-04-07 22:12:58', '2016-03-28 14:00:02', 2, '', 7, '65933a19-243a-48b2-aae9-34e2da710051'), -(199, '', '', '', '', '', '', '', '', 255, '', 'VARCHAR', 2, '', '', 'Name (required)', 'NOT NULL', '', 24, '\"\"', 1, '2015-03-19 17:30:59', '2020-06-01 23:44:08', 9, '', 4, '5d3d34dd-4876-4c6a-86ab-b4e162f22c08'), +(199, '', '', '', '', '', '', '', '', 255, '', 'VARCHAR', 2, '', '', 'Name (required)', 'NOT NULL', '', 24, '\"\"', 1, '2015-03-19 17:30:59', '2021-08-05 08:42:17', 10, '', 4, '5d3d34dd-4876-4c6a-86ab-b4e162f22c08'), (203, '', '', '', '', '', '', '', '', 1, '', 'INT', '', '', '', 'Not Required', 'NOT NULL', '', 9, '\"\"', 1, '2015-05-08 16:19:16', '2020-02-27 20:17:33', 13, '', 19, 'da5e6901-6958-40e5-a4f5-6822d6fe57ac'), (280, '', '', '', '', '', '', '', '', 255, '', 'VARCHAR', '', '', '', 'Website', 'NOT NULL', '', 27, '\"\"', 1, '2015-04-08 00:36:16', '2018-07-08 00:11:05', 2, '', 105, '6c3a6983-d1bf-4e5e-9e99-deea00b0cefd'), (682, '', '', '', '', '', '', '', '', 1, '', 'TINYINT', 2, '', '', 'Add More', 'NOT NULL', '', 17, '\"\"', 1, '2015-08-05 01:18:20', '2018-03-30 09:30:45', 4, '', 196, 'a66389aa-2323-4f44-8c23-ff44969639be'), diff --git a/admin/sql/updates/mysql/2.12.10.sql b/admin/sql/updates/mysql/2.12.10.sql new file mode 100644 index 000000000..b666cf9b0 --- /dev/null +++ b/admin/sql/updates/mysql/2.12.10.sql @@ -0,0 +1 @@ +ALTER TABLE `#__componentbuilder_class_property` CHANGE `default` `default` TEXT NOT NULL; diff --git a/admin/views/import_joomla_components/view.html.php b/admin/views/import_joomla_components/view.html.php index 391b215a3..5ad8d7622 100644 --- a/admin/views/import_joomla_components/view.html.php +++ b/admin/views/import_joomla_components/view.html.php @@ -248,6 +248,31 @@ class ComponentbuilderViewImport_joomla_components extends JViewLegacy $merge->setup($mergeXML,1); // add to form $form[] = $merge; + + // get the import_guid_only radio field + $import_guid_only = JFormHelper::loadFieldType('radio',true); + // start import_guid_only xml + $import_guid_onlyXML = new SimpleXMLElement(''); + // import_guid_only attributes + $import_guid_onlyAttributes = array( + 'type' => 'radio', + 'name' => 'import_guid_only', + 'label' => 'COM_COMPONENTBUILDER_IMPORT_BY_GUID_ONLY', + 'class' => 'btn-group btn-group-yesno', + 'description' => 'COM_COMPONENTBUILDER_FORCE_THAT_THIS_JCB_PACKAGE_IMPORT_SEARCH_FOR_LOCAL_ITEMS_TO_BE_DONE_WITH_GUID_VALUE_ONLY_IF_BMERGEB_IS_SET_TO_YES_ABOVE', + 'default' => '1'); + // load the import_guid_only attributes + ComponentbuilderHelper::xmlAddAttributes($import_guid_onlyXML, $import_guid_onlyAttributes); + // set the import_guid_only options + $import_guid_onlyOptions = array( + '1' => 'COM_COMPONENTBUILDER_YES', + '0' => 'COM_COMPONENTBUILDER_NO'); + // load the import_guid_only options + ComponentbuilderHelper::xmlAddOptions($import_guid_onlyXML, $import_guid_onlyOptions); + // setup the import_guid_only radio field + $import_guid_only->setup($import_guid_onlyXML, $this->params->get('import_guid_only', 0)); + // add to form + $form[] = $import_guid_only; if (!$this->packageInfo || ComponentbuilderHelper::getPackageComponentsKeyStatus($this->packageInfo)) { diff --git a/componentbuilder.xml b/componentbuilder.xml index fd6078e49..b20fc17b0 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 14th June, 2021 + 11th August, 2021 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 2.12.10 + 2.12.11 Component Builder (v.2.12.10) +

Component Builder (v.2.12.11)

The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index 74c6de32c..4ffc5cb8d 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -1036,4 +1036,21 @@ http://www.joomlacomponentbuilder.com + + Component Builder + Builds Complex Joomla Components + com_componentbuilder + component + 2.12.11 + http://www.joomlacomponentbuilder.com + + http://domain.com/demo.zip + + + stable + + Llewellyn van der Merwe + http://www.joomlacomponentbuilder.com + + \ No newline at end of file diff --git a/script.php b/script.php index 57350a693..c859e4694 100644 --- a/script.php +++ b/script.php @@ -6614,7 +6614,7 @@ class com_componentbuilderInstallerScript $query = $db->getQuery(true); // Field to update. $fields = array( - $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","builder_gif_size":"480-272","add_menu_prefix":"1","menu_prefix":"»","minify":"0","language":"en-GB","percentagelanguageadd":"50","export_language_strings":"1","assets_table_fix":"1","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'), + $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","builder_gif_size":"480-272","add_menu_prefix":"1","menu_prefix":"»","minify":"0","language":"en-GB","percentagelanguageadd":"50","assets_table_fix":"1","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","import_guid_only":"1","export_language_strings":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'), ); // Condition. $conditions = array( @@ -9252,7 +9252,7 @@ class com_componentbuilderInstallerScript echo ' -

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

'; +

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

'; // Set db if not set already. if (!isset($db)) diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index 152ee23fe..cd1e9e2fd 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -2302,6 +2302,57 @@ abstract class ComponentbuilderHelper return false; } + /** + * get the ITEM of a GUID by table + * + * @param string $guid + * @param string $table + * @param string/array $what + * + * @return mix + */ + public static function getGUID ($guid, $table, $what = 'a.id') + { + // check if we have a string + if (self::validateGUID($guid)) + { + // check if table already has this identifier + if (self::checkString($table)) + { + // Get the database object and a new query object. + $db = \JFactory::getDbo(); + $query = $db->getQuery(true); + if (self::checkArray($what)) + { + $query->select($db->quoteName($what)); + } + else + { + $query->select($what); + } + $query->from($db->quoteName('#__componentbuilder_' . (string) $table, 'a')) + ->where($db->quoteName('a.guid') . ' = ' . $db->quote($guid)); + + // Set and query the database. + $db->setQuery($query); + $db->execute(); + + if ($db->getNumRows()) + { + if (self::checkArray($what) || $what === 'a.*') + { + return $db->loadObject(); + } + else + { + return $db->loadResult(); + } + } + } + } + return false; + } + /** * Validate the Globally Unique Identifier * @@ -2420,7 +2471,7 @@ abstract class ComponentbuilderHelper * @return array on success * */ - public static function getFieldTypeProperties($value, $type, $settings = array(), $xml = null, $db_defaults = false) + public static function getFieldTypeProperties($value, $type, $settings = array(), $xml = null, $dbDefaults = false) { // Get a db connection. $db = JFactory::getDbo(); @@ -2429,7 +2480,7 @@ abstract class ComponentbuilderHelper $query = $db->getQuery(true); $query->select($db->quoteName(array('properties', 'short_description', 'description'))); // load database default values - if ($db_defaults) + if ($dbDefaults) { $query->select($db->quoteName(array('datadefault', 'datadefault_other', 'datalenght', 'datalenght_other', 'datatype', 'has_defaults', 'indexes', 'null_switch', 'store'))); } @@ -2456,6 +2507,12 @@ abstract class ComponentbuilderHelper $nr = 0; // php tracker (we must try to load alteast 17 rows $phpTracker = array(); + // force load all properties + $forceAll = false; + if ($xml && strpos($xml, '..__FORCE_LOAD_ALL_PROPERTIES__..') !== false) + { + $forceAll = true; + } // value to check since there are false and null values even 0 in the values returned $confirmation = '8qvZHoyuFYQqpj0YQbc6F3o5DhBlmS-_-a8pmCZfOVSfANjkmV5LG8pCdAY2JNYu6cB'; // set the headers @@ -2501,7 +2558,7 @@ abstract class ComponentbuilderHelper $field['subform']['properties'.$nr] = array('name' => $property['name'], 'value' => $settings[$property['name']], 'desc' => $property['description']); } } - elseif (!$xml || $confirmation !== $value) + elseif ($forceAll || !$xml || $confirmation !== $value) { // add the xml values $field['values'] .= PHP_EOL."\t" . $property['name'] . '="' . ($confirmation !== $value) ? $value : $example .'" '; diff --git a/site/router.php b/site/router.php index d1af4fe9e..2afc76448 100644 --- a/site/router.php +++ b/site/router.php @@ -51,7 +51,7 @@ class ComponentbuilderRouter extends JComponentRouterBase { $view = $query['view']; - if (empty($query['Itemid'])) + if (empty($query['Itemid']) && !(isset($view) && isset($query['id']) && ($view === 'api'))) { $segments[] = $query['view']; }