From 46e52db0970dcfc530b89fba74af4a585c1c7957 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 3 Jan 2020 03:41:55 +0200 Subject: [PATCH] Added GUID to selected views, and started updating JCB accordingly. --- README.md | 12 +- admin/README.txt | 12 +- admin/assets/js/get_snippets.js | 27 +- admin/helpers/compiler/e_Interpretation.php | 4 +- admin/helpers/componentbuilder.php | 72 + .../en-GB/en-GB.com_componentbuilder.ini | 54 +- admin/layouts/admin_view/publishing.php | 1 + admin/layouts/class_method/publishing.php | 1 + admin/layouts/class_property/publishing.php | 1 + .../layouts/custom_admin_view/publishing.php | 1 + admin/layouts/dynamic_get/publishing.php | 1 + admin/layouts/field/publishing.php | 1 + admin/layouts/fieldtype/publishing.php | 1 + admin/layouts/jcbnoticeboardtabs.php | 37 + admin/layouts/joomla_component/publishing.php | 1 + admin/layouts/joomla_module/publishing.php | 1 + admin/layouts/joomla_plugin/publishing.php | 1 + admin/layouts/library/publishing.php | 1 + admin/layouts/site_view/publishing.php | 1 + admin/layouts/snippet/publishing.php | 1 + admin/models/admin_custom_tabs.php | 4 +- admin/models/admin_fields.php | 4 +- admin/models/admin_fields_conditions.php | 4 +- admin/models/admin_fields_relations.php | 4 +- admin/models/admin_view.php | 679 ++-- admin/models/admin_views.php | 176 +- admin/models/ajax.php | 4 +- admin/models/class_extends.php | 4 +- admin/models/class_method.php | 20 +- admin/models/class_property.php | 20 +- admin/models/component_admin_views.php | 4 +- admin/models/component_config.php | 4 +- admin/models/component_custom_admin_menus.php | 4 +- admin/models/component_custom_admin_views.php | 4 +- admin/models/component_dashboard.php | 4 +- admin/models/component_files_folders.php | 4 +- admin/models/component_modules.php | 4 +- admin/models/component_mysql_tweaks.php | 4 +- admin/models/component_placeholders.php | 4 +- admin/models/component_plugins.php | 4 +- admin/models/component_site_views.php | 4 +- admin/models/component_updates.php | 4 +- admin/models/custom_admin_view.php | 180 +- admin/models/custom_admin_views.php | 30 +- admin/models/custom_code.php | 4 +- admin/models/dynamic_get.php | 169 +- admin/models/dynamic_gets.php | 20 +- admin/models/field.php | 44 +- admin/models/fields.php | 4 +- admin/models/fieldtype.php | 19 +- admin/models/forms/admin_view.xml | 2806 +++++++++-------- admin/models/forms/class_method.xml | 14 + admin/models/forms/class_property.xml | 14 + admin/models/forms/custom_admin_view.xml | 528 ++-- admin/models/forms/dynamic_get.xml | 1940 ++++++------ admin/models/forms/field.xml | 254 +- admin/models/forms/fieldtype.xml | 226 +- admin/models/forms/joomla_component.xml | 1622 +++++----- admin/models/forms/joomla_module.xml | 760 ++--- admin/models/forms/joomla_plugin.xml | 536 ++-- admin/models/forms/library.xml | 50 +- admin/models/forms/site_view.xml | 564 ++-- admin/models/forms/snippet.xml | 14 + admin/models/help_document.php | 4 +- admin/models/joomla_component.php | 335 +- admin/models/joomla_components.php | 108 +- admin/models/joomla_module.php | 202 +- .../joomla_module_files_folders_urls.php | 4 +- admin/models/joomla_module_updates.php | 4 +- admin/models/joomla_plugin.php | 128 +- .../joomla_plugin_files_folders_urls.php | 4 +- admin/models/joomla_plugin_group.php | 4 +- admin/models/joomla_plugin_updates.php | 4 +- admin/models/language.php | 4 +- admin/models/language_translation.php | 4 +- admin/models/layout.php | 4 +- admin/models/library.php | 59 +- admin/models/library_config.php | 4 +- admin/models/library_files_folders_urls.php | 4 +- admin/models/placeholder.php | 4 +- admin/models/rules/guid.php | 54 + admin/models/server.php | 4 +- admin/models/site_view.php | 216 +- admin/models/site_views.php | 30 +- admin/models/snippet.php | 20 +- admin/models/snippet_type.php | 4 +- admin/models/template.php | 4 +- admin/models/validation_rule.php | 4 +- admin/sql/install.mysql.utf8.sql | 639 ++-- admin/sql/updates/mysql/2.10.9.sql | 25 + .../admin_fields_conditions/tmpl/edit.php | 2 +- .../admin_fields_relations/tmpl/edit.php | 2 +- admin/views/admin_view/tmpl/edit.php | 2 +- admin/views/admin_views/view.html.php | 132 +- admin/views/class_extends/tmpl/edit.php | 2 +- admin/views/class_method/tmpl/edit.php | 2 +- admin/views/class_property/tmpl/edit.php | 2 +- admin/views/compiler/tmpl/default.php | 23 +- admin/views/compiler/view.html.php | 4 +- admin/views/component_dashboard/tmpl/edit.php | 2 +- admin/views/custom_admin_view/tmpl/edit.php | 2 +- admin/views/custom_code/tmpl/edit.php | 2 +- admin/views/dynamic_get/tmpl/edit.php | 2 +- admin/views/field/tmpl/edit.php | 2 +- admin/views/fieldtype/tmpl/edit.php | 2 +- admin/views/get_snippets/tmpl/default.php | 3 +- admin/views/get_snippets/view.html.php | 5 +- .../import_joomla_components/tmpl/default.php | 2 +- admin/views/joomla_component/tmpl/edit.php | 2 +- admin/views/joomla_module/tmpl/edit.php | 2 +- admin/views/joomla_plugin/tmpl/edit.php | 2 +- .../views/language_translation/tmpl/edit.php | 2 +- admin/views/layout/tmpl/edit.php | 2 +- admin/views/library/tmpl/edit.php | 2 +- admin/views/placeholder/tmpl/edit.php | 2 +- admin/views/site_view/tmpl/edit.php | 2 +- admin/views/template/tmpl/edit.php | 2 +- admin/views/validation_rule/tmpl/edit.php | 2 +- componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 17 + script.php | 220 +- site/helpers/componentbuilder.php | 72 + 122 files changed, 7142 insertions(+), 6262 deletions(-) create mode 100644 admin/layouts/jcbnoticeboardtabs.php create mode 100644 admin/models/rules/guid.php create mode 100644 admin/sql/updates/mysql/2.10.9.sql diff --git a/README.md b/README.md index dd76571ff..25bc1a267 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 safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.9) 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.10.10) 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) @@ -144,13 +144,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*: 23rd December, 2019 -+ *Version*: 2.10.9 ++ *Last Build*: 3rd January, 2020 ++ *Version*: 2.10.10 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **277353** -+ *Field count*: **1490** -+ *File count*: **1752** ++ *Line count*: **278234** ++ *Field count*: **1503** ++ *File count*: **1755** + *Folder count*: **278** > 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 dd76571ff..25bc1a267 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 safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.9) 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.10.10) 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) @@ -144,13 +144,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*: 23rd December, 2019 -+ *Version*: 2.10.9 ++ *Last Build*: 3rd January, 2020 ++ *Version*: 2.10.10 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **277353** -+ *Field count*: **1490** -+ *File count*: **1752** ++ *Line count*: **278234** ++ *Field count*: **1503** ++ *File count*: **1755** + *Folder count*: **278** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/assets/js/get_snippets.js b/admin/assets/js/get_snippets.js index 98adece7b..5e3becadc 100644 --- a/admin/assets/js/get_snippets.js +++ b/admin/assets/js/get_snippets.js @@ -9,6 +9,7 @@ */ /* JS Document */ + // start the moment the document is ready jQuery(document).ready(function () { // just get the available libraries @@ -97,9 +98,9 @@ function buildLibraries(paths) { var temp = {}; jQuery.each(paths.tree, function(key,value) { if (value.path.match(".json$")) { - var libName = value.path.split(/ -(.+)/)[0]; - libName = libName.trim() - temp[libName] = libName; + var libraryName = value.path.split(/ -(.+)/)[0]; + libraryName = libraryName.trim() + temp[libraryName] = libraryName; } }); // load only this library paths @@ -110,7 +111,7 @@ function buildLibraries(paths) { // set the libraries function setLibraries(names) { - // now load the lib buttons + // now load the library buttons jQuery.each(names, function(value) { setLibrary(value); }); @@ -131,7 +132,7 @@ function setLibrary(name) { html += '

' + name + '

'; html += '
'; // set the data buttons - html += setLibButtons(name); + html += setLibraryButtons(name); // close the box panel html += ''; html += ''; @@ -139,7 +140,7 @@ function setLibrary(name) { jQuery('#libraries-grid').append(html); } -function setLibButtons(name) { +function setLibraryButtons(name) { return ''; } @@ -525,4 +526,16 @@ function getKeyID(key) { keyID = keyID.replace(/\)/g, ''); // return the id build return keyID; -} \ No newline at end of file +} + +// get key ID +function getKeyID(key) { + // get useful ID + var keyID = key.replace('-', ''); + keyID = keyID.replace('.json', ''); + keyID = keyID.replace(/\s+/ig, '-'); + keyID = keyID.replace(/\(/g, ''); + keyID = keyID.replace(/\)/g, ''); + // return the id build + return keyID; +} diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 6b83c75c0..8790dfd44 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -11728,14 +11728,14 @@ class Interpretation extends Fields $component = $this->componentCodeName; // allways load these $getForm = array(); - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " // check if xpath was set in options"; + $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if xpath was set in options"; $getForm[] = $this->_t(2) . "\$xpath = false;"; $getForm[] = $this->_t(2) . "if (isset(\$options['xpath']))"; $getForm[] = $this->_t(2) . "{"; $getForm[] = $this->_t(3) . "\$xpath = \$options['xpath'];"; $getForm[] = $this->_t(3) . "unset(\$options['xpath']);"; $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " // check if clear form was set in options"; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if clear form was set in options"; $getForm[] = $this->_t(2) . "\$clear = false;"; $getForm[] = $this->_t(2) . "if (isset(\$options['clear']))"; $getForm[] = $this->_t(2) . "{"; diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 99c7bda52..48d4122f8 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -2008,6 +2008,78 @@ abstract class ComponentbuilderHelper return $default; } + /** + * Returns a GUIDv4 string + * + * Thanks to Dave Pearson (and other) + * https://www.php.net/manual/en/function.com-create-guid.php#119168 + * + * Uses the best cryptographically secure method + * for all supported platforms with fallback to an older, + * less secure version. + * + * @param bool $trim + * @return string + */ + public static function GUID ($trim = true) + { + // Windows + if (function_exists('com_create_guid') === true) + { + if ($trim === true) + { + return trim(com_create_guid(), '{}'); + } + return com_create_guid(); + } + + // set the braces if needed + $lbrace = $trim ? "" : chr(123); // "{" + $rbrace = $trim ? "" : chr(125); // "}" + + // OSX/Linux + if (function_exists('openssl_random_pseudo_bytes') === true) + { + $data = openssl_random_pseudo_bytes(16); + $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100 + $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10 + return $lbrace . vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)) . $lbrace; + } + + // Fallback (PHP 4.2+) + mt_srand((double)microtime() * 10000); + $charid = strtolower(md5(uniqid(rand(), true))); + $hyphen = chr(45); // "-" + $guidv4 = $lbrace. + substr($charid, 0, 8).$hyphen. + substr($charid, 8, 4).$hyphen. + substr($charid, 12, 4).$hyphen. + substr($charid, 16, 4).$hyphen. + substr($charid, 20, 12). + $rbrace; + return $guidv4; + } + + /** + * Validate the Globally Unique Identifier + * + * Thanks to Lewie + * https://stackoverflow.com/a/1515456/1429677 + * + * @param string $guid + * @return bool + */ + public static function validGUID ($guid) + { + // check if we have a string + if (self::checkString($guid)) + { + return preg_match("/^(\{)?[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}(?(1)\})$/i", $guid); + } + return false; + } + + /** * Tab/spacer bucket (to speed-up the build) * diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 39d7633f8..d3cd3e44e 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -549,7 +549,7 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_ALIAS_BUILDER_TYPE_LABEL="Alias Builder Type" COM_COMPONENTBUILDER_ADMIN_VIEW_ALLOW_ZERO_DESCRIPTION="null & zero values" COM_COMPONENTBUILDER_ADMIN_VIEW_ALLOW_ZERO_LABEL="Allow" COM_COMPONENTBUILDER_ADMIN_VIEW_ALNUM="ALNUM" -COM_COMPONENTBUILDER_ADMIN_VIEW_ARCHIVE="ARCHIVE" +COM_COMPONENTBUILDER_ADMIN_VIEW_ARCHIVE="Archive" COM_COMPONENTBUILDER_ADMIN_VIEW_ARMSCIIEIGHT_ARMSCIIEIGHT_ARMENIAN_MOST_SUITABLE_COLLATION_ARMSCIIEIGHT_GENERAL_CI="armscii8 - ARMSCII-8 Armenian (most suitable collation = armscii8_general_ci)" COM_COMPONENTBUILDER_ADMIN_VIEW_ARMSCIIEIGHT_BIN_CHARSET_ARMSCIIEIGHT="armscii8_bin (charset = armscii8)" COM_COMPONENTBUILDER_ADMIN_VIEW_ARMSCIIEIGHT_GENERAL_CI_CHARSET_ARMSCIIEIGHT="armscii8_general_ci (charset = armscii8)" @@ -755,6 +755,10 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_GREEK_GENERAL_CI_CHARSET_GREEK="greek_general_ci COM_COMPONENTBUILDER_ADMIN_VIEW_GREEK_ISO_EIGHT_THOUSAND_EIGHT_HUNDRED_AND_FIFTY_NINESEVEN_GREEK_MOST_SUITABLE_COLLATION_GREEK_GENERAL_CI="greek - ISO 8859-7 Greek (most suitable collation = greek_general_ci)" COM_COMPONENTBUILDER_ADMIN_VIEW_GRID="Grid" COM_COMPONENTBUILDER_ADMIN_VIEW_GRID_TWO="Grid 2" +COM_COMPONENTBUILDER_ADMIN_VIEW_GUID="Guid" +COM_COMPONENTBUILDER_ADMIN_VIEW_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_ADMIN_VIEW_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_ADMIN_VIEW_GUID_LABEL="GUID" COM_COMPONENTBUILDER_ADMIN_VIEW_HEALTH="Health" COM_COMPONENTBUILDER_ADMIN_VIEW_HEART="Heart" COM_COMPONENTBUILDER_ADMIN_VIEW_HEART_TWO="Heart 2" @@ -1588,6 +1592,10 @@ COM_COMPONENTBUILDER_CLASS_METHOD_ERROR_UNIQUE_ALIAS="Another Class Method has t COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE="Extension Type" 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_GUID="Guid" +COM_COMPONENTBUILDER_CLASS_METHOD_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_CLASS_METHOD_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_CLASS_METHOD_GUID_LABEL="GUID" COM_COMPONENTBUILDER_CLASS_METHOD_ID="Id" COM_COMPONENTBUILDER_CLASS_METHOD_JOOMLA_PLUGIN_GROUP="Joomla Plugin Group" COM_COMPONENTBUILDER_CLASS_METHOD_JOOMLA_PLUGIN_GROUP_LABEL="Joomla Plugin Group" @@ -1687,6 +1695,10 @@ COM_COMPONENTBUILDER_CLASS_PROPERTY_ERROR_UNIQUE_ALIAS="Another Class Property h COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE="Extension Type" 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_GUID="Guid" +COM_COMPONENTBUILDER_CLASS_PROPERTY_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_CLASS_PROPERTY_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_CLASS_PROPERTY_GUID_LABEL="GUID" COM_COMPONENTBUILDER_CLASS_PROPERTY_ID="Id" COM_COMPONENTBUILDER_CLASS_PROPERTY_JOOMLA_PLUGIN_GROUP="Joomla Plugin Group" COM_COMPONENTBUILDER_CLASS_PROPERTY_JOOMLA_PLUGIN_GROUP_LABEL="Joomla Plugin Group" @@ -3840,6 +3852,10 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GET_SNIPPETS_BUTTON_ACCESS="Custom Admin COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GRID="Grid" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GRID_TWO="Grid 2" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GUID="Guid" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_GUID_LABEL="GUID" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_HEALTH="Health" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_HEART="Heart" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_HEART_TWO="Heart 2" @@ -4509,6 +4525,10 @@ COM_COMPONENTBUILDER_DYNAMIC_GET_GREATER_THAN_OR_EQUAL="greater than or equal" COM_COMPONENTBUILDER_DYNAMIC_GET_GROUP="Group" COM_COMPONENTBUILDER_DYNAMIC_GET_GROUP_DESCRIPTION="Here you can set the grouping per data set." COM_COMPONENTBUILDER_DYNAMIC_GET_GROUP_LABEL="Grouping" +COM_COMPONENTBUILDER_DYNAMIC_GET_GUID="Guid" +COM_COMPONENTBUILDER_DYNAMIC_GET_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_DYNAMIC_GET_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_DYNAMIC_GET_GUID_LABEL="GUID" COM_COMPONENTBUILDER_DYNAMIC_GET_H="h" COM_COMPONENTBUILDER_DYNAMIC_GET_HH="hh" COM_COMPONENTBUILDER_DYNAMIC_GET_I="i" @@ -4883,6 +4903,10 @@ COM_COMPONENTBUILDER_FIELDTYPE_FIELDS="Fields" COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES="Fieldtypes Categories" COM_COMPONENTBUILDER_FIELDTYPE_FIFTY="50" COM_COMPONENTBUILDER_FIELDTYPE_FLOAT="FLOAT" +COM_COMPONENTBUILDER_FIELDTYPE_GUID="Guid" +COM_COMPONENTBUILDER_FIELDTYPE_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_FIELDTYPE_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_FIELDTYPE_GUID_LABEL="GUID" COM_COMPONENTBUILDER_FIELDTYPE_HAS_DEFAULTS="Has Defaults" COM_COMPONENTBUILDER_FIELDTYPE_HAS_DEFAULTS_DESCRIPTION="set the database defaults for this field type" COM_COMPONENTBUILDER_FIELDTYPE_HAS_DEFAULTS_LABEL="Set Database Defaults" @@ -5024,6 +5048,10 @@ COM_COMPONENTBUILDER_FIELD_FIELDTYPE_DESCRIPTION="Set the field type" COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL="Type" COM_COMPONENTBUILDER_FIELD_FIFTY="50" COM_COMPONENTBUILDER_FIELD_FLOAT="FLOAT" +COM_COMPONENTBUILDER_FIELD_GUID="Guid" +COM_COMPONENTBUILDER_FIELD_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_FIELD_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_FIELD_GUID_LABEL="GUID" COM_COMPONENTBUILDER_FIELD_HELPNOTE_LABEL="Field Information" COM_COMPONENTBUILDER_FIELD_ID="Id" COM_COMPONENTBUILDER_FIELD_INDEXES="Indexes" @@ -5689,6 +5717,10 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_KEY_HINT="Export Key Here" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_KEY_LABEL="Export Key
(encrypted field)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_KEY_MESSAGE="Error! Please add export key here." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_FRONT="Front" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GUID="Guid" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_GUID_LABEL="GUID" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ID="Id" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE="Image" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_DESCRIPTION="The component image (product box) for the dashboard and install page, must be 300px X 300px." @@ -6299,6 +6331,10 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_FILE_LABEL="File Name" COM_COMPONENTBUILDER_JOOMLA_MODULE_FORMS_FIELDS="Forms & Fields" COM_COMPONENTBUILDER_JOOMLA_MODULE_GET_SNIPPETS_BUTTON_ACCESS="Joomla Module Get Snippets Button Access" COM_COMPONENTBUILDER_JOOMLA_MODULE_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." +COM_COMPONENTBUILDER_JOOMLA_MODULE_GUID="Guid" +COM_COMPONENTBUILDER_JOOMLA_MODULE_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_JOOMLA_MODULE_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_JOOMLA_MODULE_GUID_LABEL="GUID" COM_COMPONENTBUILDER_JOOMLA_MODULE_HELPER="Helper" COM_COMPONENTBUILDER_JOOMLA_MODULE_HTML="HTML" COM_COMPONENTBUILDER_JOOMLA_MODULE_ID="Id" @@ -6813,6 +6849,10 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_SAVE_WARNING="Alias already existed so COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_STATUS="Status" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_VERSION_DESC="A count of the number of times this Joomla Plugin Group has been revised." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_VERSION_LABEL="Version" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GUID="Guid" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GUID_LABEL="GUID" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_HEAD="Head" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_HEAD_DESCRIPTION="The class head, where JLoader, namespace and use is added, so that class being extended will work." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_HEAD_LABEL="Class Head" @@ -7555,6 +7595,10 @@ COM_COMPONENTBUILDER_LIBRARY_FILE_DESCRIPTION="to library" COM_COMPONENTBUILDER_LIBRARY_FILE_LABEL="Target File Linked" COM_COMPONENTBUILDER_LIBRARY_GET_SNIPPETS_BUTTON_ACCESS="Library Get Snippets Button Access" COM_COMPONENTBUILDER_LIBRARY_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." +COM_COMPONENTBUILDER_LIBRARY_GUID="Guid" +COM_COMPONENTBUILDER_LIBRARY_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_LIBRARY_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_LIBRARY_GUID_LABEL="GUID" COM_COMPONENTBUILDER_LIBRARY_HOW="How" COM_COMPONENTBUILDER_LIBRARY_HOW_DESCRIPTION="Select how you want to control the behaviour of the library file inclusion." COM_COMPONENTBUILDER_LIBRARY_HOW_LABEL="File Behaviour" @@ -8266,6 +8310,10 @@ COM_COMPONENTBUILDER_SITE_VIEW_GET_SNIPPETS_BUTTON_ACCESS="Site View Get Snippet COM_COMPONENTBUILDER_SITE_VIEW_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." COM_COMPONENTBUILDER_SITE_VIEW_GRID="Grid" COM_COMPONENTBUILDER_SITE_VIEW_GRID_TWO="Grid 2" +COM_COMPONENTBUILDER_SITE_VIEW_GUID="Guid" +COM_COMPONENTBUILDER_SITE_VIEW_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_SITE_VIEW_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_SITE_VIEW_GUID_LABEL="GUID" COM_COMPONENTBUILDER_SITE_VIEW_HEALTH="Health" COM_COMPONENTBUILDER_SITE_VIEW_HEART="Heart" COM_COMPONENTBUILDER_SITE_VIEW_HEART_TWO="Heart 2" @@ -8580,6 +8628,10 @@ COM_COMPONENTBUILDER_SNIPPET_EDIT="Editing the Snippet" COM_COMPONENTBUILDER_SNIPPET_ERROR_UNIQUE_ALIAS="Another Snippet has the same alias." COM_COMPONENTBUILDER_SNIPPET_GET_SNIPPETS_BUTTON_ACCESS="Snippet Get Snippets Button Access" COM_COMPONENTBUILDER_SNIPPET_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." +COM_COMPONENTBUILDER_SNIPPET_GUID="Guid" +COM_COMPONENTBUILDER_SNIPPET_GUID_DESCRIPTION="Globally Unique Identifier" +COM_COMPONENTBUILDER_SNIPPET_GUID_HINT="Auto Generated" +COM_COMPONENTBUILDER_SNIPPET_GUID_LABEL="GUID" COM_COMPONENTBUILDER_SNIPPET_HEADING="Heading" COM_COMPONENTBUILDER_SNIPPET_HEADING_DESCRIPTION="Enter short heading" COM_COMPONENTBUILDER_SNIPPET_HEADING_HINT="Your Heading Here" diff --git a/admin/layouts/admin_view/publishing.php b/admin/layouts/admin_view/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/admin_view/publishing.php +++ b/admin/layouts/admin_view/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/class_method/publishing.php b/admin/layouts/class_method/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/class_method/publishing.php +++ b/admin/layouts/class_method/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/class_property/publishing.php b/admin/layouts/class_property/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/class_property/publishing.php +++ b/admin/layouts/class_property/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/custom_admin_view/publishing.php b/admin/layouts/custom_admin_view/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/custom_admin_view/publishing.php +++ b/admin/layouts/custom_admin_view/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/dynamic_get/publishing.php b/admin/layouts/dynamic_get/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/dynamic_get/publishing.php +++ b/admin/layouts/dynamic_get/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/field/publishing.php b/admin/layouts/field/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/field/publishing.php +++ b/admin/layouts/field/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/fieldtype/publishing.php b/admin/layouts/fieldtype/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/fieldtype/publishing.php +++ b/admin/layouts/fieldtype/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/jcbnoticeboardtabs.php b/admin/layouts/jcbnoticeboardtabs.php new file mode 100644 index 000000000..dd67d4880 --- /dev/null +++ b/admin/layouts/jcbnoticeboardtabs.php @@ -0,0 +1,37 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('JPATH_BASE') or die('Restricted access'); + + + +?> +
+ 'vdm-noticeboard')); ?> + +
+ +
.
+
<<ewe>>yn
+
+
+ + +
+ +
.
+
JCB PRO
+
+
+ + +
diff --git a/admin/layouts/joomla_component/publishing.php b/admin/layouts/joomla_component/publishing.php index 7f3f312c2..8f786efbc 100644 --- a/admin/layouts/joomla_component/publishing.php +++ b/admin/layouts/joomla_component/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/joomla_module/publishing.php b/admin/layouts/joomla_module/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/joomla_module/publishing.php +++ b/admin/layouts/joomla_module/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/joomla_plugin/publishing.php b/admin/layouts/joomla_plugin/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/joomla_plugin/publishing.php +++ b/admin/layouts/joomla_plugin/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/library/publishing.php b/admin/layouts/library/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/library/publishing.php +++ b/admin/layouts/library/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/site_view/publishing.php b/admin/layouts/site_view/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/site_view/publishing.php +++ b/admin/layouts/site_view/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/layouts/snippet/publishing.php b/admin/layouts/snippet/publishing.php index 68e3657ce..579558e43 100644 --- a/admin/layouts/snippet/publishing.php +++ b/admin/layouts/snippet/publishing.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'guid', 'created', 'created_by', 'modified', diff --git a/admin/models/admin_custom_tabs.php b/admin/models/admin_custom_tabs.php index f62c14050..698572a79 100644 --- a/admin/models/admin_custom_tabs.php +++ b/admin/models/admin_custom_tabs.php @@ -130,14 +130,14 @@ class ComponentbuilderModelAdmin_custom_tabs extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/admin_fields.php b/admin/models/admin_fields.php index aeb2d2b6d..bf274b6d5 100644 --- a/admin/models/admin_fields.php +++ b/admin/models/admin_fields.php @@ -151,14 +151,14 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/admin_fields_conditions.php b/admin/models/admin_fields_conditions.php index 634642883..d668482b4 100644 --- a/admin/models/admin_fields_conditions.php +++ b/admin/models/admin_fields_conditions.php @@ -151,14 +151,14 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/admin_fields_relations.php b/admin/models/admin_fields_relations.php index ce4edc40e..36164f8d2 100644 --- a/admin/models/admin_fields_relations.php +++ b/admin/models/admin_fields_relations.php @@ -213,14 +213,14 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/admin_view.php b/admin/models/admin_view.php index 641dd7773..adfd45815 100644 --- a/admin/models/admin_view.php +++ b/admin/models/admin_view.php @@ -94,20 +94,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin 'php_document' ) ), - 'mysql' => array( - 'left' => array( - 'mysql_table_engine', - 'mysql_table_charset', - 'mysql_table_collate', - 'mysql_table_row_format', - 'add_sql', - 'source', - 'addtables' - ), - 'fullwidth' => array( - 'sql' - ) - ), 'custom_import' => array( 'fullwidth' => array( 'note_beginner_import', @@ -122,6 +108,20 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin 'php_import_ext' ) ), + 'mysql' => array( + 'left' => array( + 'mysql_table_engine', + 'mysql_table_charset', + 'mysql_table_collate', + 'mysql_table_row_format', + 'add_sql', + 'source', + 'addtables' + ), + 'fullwidth' => array( + 'sql' + ) + ), 'settings' => array( 'fullwidth' => array( 'note_on_permissions', @@ -293,76 +293,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $item->metadata = $registry->toArray(); } - if (!empty($item->php_import_headers)) + if (!empty($item->php_before_cancel)) { - // base64 Decode php_import_headers. - $item->php_import_headers = base64_decode($item->php_import_headers); - } - - if (!empty($item->html_import_view)) - { - // base64 Decode html_import_view. - $item->html_import_view = base64_decode($item->html_import_view); - } - - if (!empty($item->php_import_save)) - { - // base64 Decode php_import_save. - $item->php_import_save = base64_decode($item->php_import_save); - } - - if (!empty($item->php_getitems_after_all)) - { - // base64 Decode php_getitems_after_all. - $item->php_getitems_after_all = base64_decode($item->php_getitems_after_all); - } - - if (!empty($item->php_getlistquery)) - { - // base64 Decode php_getlistquery. - $item->php_getlistquery = base64_decode($item->php_getlistquery); - } - - if (!empty($item->css_view)) - { - // base64 Decode css_view. - $item->css_view = base64_decode($item->css_view); - } - - if (!empty($item->php_getform)) - { - // base64 Decode php_getform. - $item->php_getform = base64_decode($item->php_getform); - } - - if (!empty($item->php_before_save)) - { - // base64 Decode php_before_save. - $item->php_before_save = base64_decode($item->php_before_save); - } - - if (!empty($item->css_views)) - { - // base64 Decode css_views. - $item->css_views = base64_decode($item->css_views); - } - - if (!empty($item->php_save)) - { - // base64 Decode php_save. - $item->php_save = base64_decode($item->php_save); - } - - if (!empty($item->php_postsavehook)) - { - // base64 Decode php_postsavehook. - $item->php_postsavehook = base64_decode($item->php_postsavehook); - } - - if (!empty($item->javascript_view_file)) - { - // base64 Decode javascript_view_file. - $item->javascript_view_file = base64_decode($item->javascript_view_file); + // base64 Decode php_before_cancel. + $item->php_before_cancel = base64_decode($item->php_before_cancel); } if (!empty($item->php_allowadd)) @@ -371,64 +305,22 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $item->php_allowadd = base64_decode($item->php_allowadd); } - if (!empty($item->php_allowedit)) + if (!empty($item->php_save)) { - // base64 Decode php_allowedit. - $item->php_allowedit = base64_decode($item->php_allowedit); + // base64 Decode php_save. + $item->php_save = base64_decode($item->php_save); } - if (!empty($item->javascript_view_footer)) + if (!empty($item->php_getform)) { - // base64 Decode javascript_view_footer. - $item->javascript_view_footer = base64_decode($item->javascript_view_footer); + // base64 Decode php_getform. + $item->php_getform = base64_decode($item->php_getform); } - if (!empty($item->php_before_cancel)) + if (!empty($item->php_import_display)) { - // base64 Decode php_before_cancel. - $item->php_before_cancel = base64_decode($item->php_before_cancel); - } - - if (!empty($item->php_after_cancel)) - { - // base64 Decode php_after_cancel. - $item->php_after_cancel = base64_decode($item->php_after_cancel); - } - - if (!empty($item->javascript_views_file)) - { - // base64 Decode javascript_views_file. - $item->javascript_views_file = base64_decode($item->javascript_views_file); - } - - if (!empty($item->php_batchcopy)) - { - // base64 Decode php_batchcopy. - $item->php_batchcopy = base64_decode($item->php_batchcopy); - } - - if (!empty($item->php_batchmove)) - { - // base64 Decode php_batchmove. - $item->php_batchmove = base64_decode($item->php_batchmove); - } - - if (!empty($item->javascript_views_footer)) - { - // base64 Decode javascript_views_footer. - $item->javascript_views_footer = base64_decode($item->javascript_views_footer); - } - - if (!empty($item->php_before_publish)) - { - // base64 Decode php_before_publish. - $item->php_before_publish = base64_decode($item->php_before_publish); - } - - if (!empty($item->php_after_publish)) - { - // base64 Decode php_after_publish. - $item->php_after_publish = base64_decode($item->php_after_publish); + // base64 Decode php_import_display. + $item->php_import_display = base64_decode($item->php_import_display); } if (!empty($item->php_before_delete)) @@ -437,10 +329,76 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $item->php_before_delete = base64_decode($item->php_before_delete); } - if (!empty($item->php_controller)) + if (!empty($item->php_batchcopy)) { - // base64 Decode php_controller. - $item->php_controller = base64_decode($item->php_controller); + // base64 Decode php_batchcopy. + $item->php_batchcopy = base64_decode($item->php_batchcopy); + } + + if (!empty($item->php_before_publish)) + { + // base64 Decode php_before_publish. + $item->php_before_publish = base64_decode($item->php_before_publish); + } + + if (!empty($item->php_document)) + { + // base64 Decode php_document. + $item->php_document = base64_decode($item->php_document); + } + + if (!empty($item->sql)) + { + // base64 Decode sql. + $item->sql = base64_decode($item->sql); + } + + if (!empty($item->php_import_setdata)) + { + // base64 Decode php_import_setdata. + $item->php_import_setdata = base64_decode($item->php_import_setdata); + } + + if (!empty($item->php_getlistquery)) + { + // base64 Decode php_getlistquery. + $item->php_getlistquery = base64_decode($item->php_getlistquery); + } + + if (!empty($item->php_before_save)) + { + // base64 Decode php_before_save. + $item->php_before_save = base64_decode($item->php_before_save); + } + + if (!empty($item->php_postsavehook)) + { + // base64 Decode php_postsavehook. + $item->php_postsavehook = base64_decode($item->php_postsavehook); + } + + if (!empty($item->php_allowedit)) + { + // base64 Decode php_allowedit. + $item->php_allowedit = base64_decode($item->php_allowedit); + } + + if (!empty($item->php_after_cancel)) + { + // base64 Decode php_after_cancel. + $item->php_after_cancel = base64_decode($item->php_after_cancel); + } + + if (!empty($item->php_batchmove)) + { + // base64 Decode php_batchmove. + $item->php_batchmove = base64_decode($item->php_batchmove); + } + + if (!empty($item->php_after_publish)) + { + // base64 Decode php_after_publish. + $item->php_after_publish = base64_decode($item->php_after_publish); } if (!empty($item->php_after_delete)) @@ -449,18 +407,66 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $item->php_after_delete = base64_decode($item->php_after_delete); } + if (!empty($item->php_import)) + { + // base64 Decode php_import. + $item->php_import = base64_decode($item->php_import); + } + + if (!empty($item->php_import_ext)) + { + // base64 Decode php_import_ext. + $item->php_import_ext = base64_decode($item->php_import_ext); + } + + if (!empty($item->css_view)) + { + // base64 Decode css_view. + $item->css_view = base64_decode($item->css_view); + } + + if (!empty($item->css_views)) + { + // base64 Decode css_views. + $item->css_views = base64_decode($item->css_views); + } + + if (!empty($item->javascript_view_file)) + { + // base64 Decode javascript_view_file. + $item->javascript_view_file = base64_decode($item->javascript_view_file); + } + + if (!empty($item->javascript_view_footer)) + { + // base64 Decode javascript_view_footer. + $item->javascript_view_footer = base64_decode($item->javascript_view_footer); + } + + if (!empty($item->javascript_views_file)) + { + // base64 Decode javascript_views_file. + $item->javascript_views_file = base64_decode($item->javascript_views_file); + } + + if (!empty($item->javascript_views_footer)) + { + // base64 Decode javascript_views_footer. + $item->javascript_views_footer = base64_decode($item->javascript_views_footer); + } + + if (!empty($item->php_controller)) + { + // base64 Decode php_controller. + $item->php_controller = base64_decode($item->php_controller); + } + if (!empty($item->php_model)) { // base64 Decode php_model. $item->php_model = base64_decode($item->php_model); } - if (!empty($item->php_document)) - { - // base64 Decode php_document. - $item->php_document = base64_decode($item->php_document); - } - if (!empty($item->php_controller_list)) { // base64 Decode php_controller_list. @@ -479,34 +485,22 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $item->php_ajaxmethod = base64_decode($item->php_ajaxmethod); } - if (!empty($item->sql)) - { - // base64 Decode sql. - $item->sql = base64_decode($item->sql); - } - - if (!empty($item->php_import_display)) - { - // base64 Decode php_import_display. - $item->php_import_display = base64_decode($item->php_import_display); - } - if (!empty($item->php_getitem)) { // base64 Decode php_getitem. $item->php_getitem = base64_decode($item->php_getitem); } - if (!empty($item->php_import)) + if (!empty($item->html_import_view)) { - // base64 Decode php_import. - $item->php_import = base64_decode($item->php_import); + // base64 Decode html_import_view. + $item->html_import_view = base64_decode($item->html_import_view); } - if (!empty($item->php_import_setdata)) + if (!empty($item->php_import_headers)) { - // base64 Decode php_import_setdata. - $item->php_import_setdata = base64_decode($item->php_import_setdata); + // base64 Decode php_import_headers. + $item->php_import_headers = base64_decode($item->php_import_headers); } if (!empty($item->php_getitems)) @@ -515,18 +509,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $item->php_getitems = base64_decode($item->php_getitems); } - if (!empty($item->php_import_ext)) + if (!empty($item->php_import_save)) { - // base64 Decode php_import_ext. - $item->php_import_ext = base64_decode($item->php_import_ext); + // base64 Decode php_import_save. + $item->php_import_save = base64_decode($item->php_import_save); } - if (!empty($item->addtables)) + if (!empty($item->php_getitems_after_all)) { - // Convert the addtables field to an array. - $addtables = new Registry; - $addtables->loadString($item->addtables); - $item->addtables = $addtables->toArray(); + // base64 Decode php_getitems_after_all. + $item->php_getitems_after_all = base64_decode($item->php_getitems_after_all); } if (!empty($item->addpermissions)) @@ -569,6 +561,14 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $item->custom_button = $custom_button->toArray(); } + if (!empty($item->addtables)) + { + // Convert the addtables field to an array. + $addtables = new Registry; + $addtables->loadString($item->addtables); + $item->addtables = $addtables->toArray(); + } + if (!empty($item->ajax_input)) { // Convert the ajax_input field to an array. @@ -687,14 +687,14 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { @@ -796,6 +796,13 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $form->setFieldAttribute($name, 'editor', $global_editor . '|none'); } } + + + // Only load the GUID if new item + if (0 == $id) + { + $form->setValue('guid', null, ComponentbuilderHelper::GUID()); + } return $form; } @@ -1481,19 +1488,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $data['system_name'] = $data['name_single']; } + // Set the GUID if empty or not valid + if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'])) + { + $data['guid'] = (string) ComponentbuilderHelper::GUID(); + } - // Set the addtables items to data. - if (isset($data['addtables']) && is_array($data['addtables'])) - { - $addtables = new JRegistry; - $addtables->loadArray($data['addtables']); - $data['addtables'] = (string) $addtables; - } - elseif (!isset($data['addtables'])) - { - // Set the empty addtables to data - $data['addtables'] = ''; - } // Set the addpermissions items to data. if (isset($data['addpermissions']) && is_array($data['addpermissions'])) @@ -1560,6 +1560,19 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $data['custom_button'] = ''; } + // Set the addtables items to data. + if (isset($data['addtables']) && is_array($data['addtables'])) + { + $addtables = new JRegistry; + $addtables->loadArray($data['addtables']); + $data['addtables'] = (string) $addtables; + } + elseif (!isset($data['addtables'])) + { + // Set the empty addtables to data + $data['addtables'] = ''; + } + // Set the ajax_input items to data. if (isset($data['ajax_input']) && is_array($data['ajax_input'])) { @@ -1573,76 +1586,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $data['ajax_input'] = ''; } - // Set the php_import_headers string to base64 string. - if (isset($data['php_import_headers'])) + // Set the php_before_cancel string to base64 string. + if (isset($data['php_before_cancel'])) { - $data['php_import_headers'] = base64_encode($data['php_import_headers']); - } - - // Set the html_import_view string to base64 string. - if (isset($data['html_import_view'])) - { - $data['html_import_view'] = base64_encode($data['html_import_view']); - } - - // Set the php_import_save string to base64 string. - if (isset($data['php_import_save'])) - { - $data['php_import_save'] = base64_encode($data['php_import_save']); - } - - // Set the php_getitems_after_all string to base64 string. - if (isset($data['php_getitems_after_all'])) - { - $data['php_getitems_after_all'] = base64_encode($data['php_getitems_after_all']); - } - - // Set the php_getlistquery string to base64 string. - if (isset($data['php_getlistquery'])) - { - $data['php_getlistquery'] = base64_encode($data['php_getlistquery']); - } - - // Set the css_view string to base64 string. - if (isset($data['css_view'])) - { - $data['css_view'] = base64_encode($data['css_view']); - } - - // Set the php_getform string to base64 string. - if (isset($data['php_getform'])) - { - $data['php_getform'] = base64_encode($data['php_getform']); - } - - // Set the php_before_save string to base64 string. - if (isset($data['php_before_save'])) - { - $data['php_before_save'] = base64_encode($data['php_before_save']); - } - - // Set the css_views string to base64 string. - if (isset($data['css_views'])) - { - $data['css_views'] = base64_encode($data['css_views']); - } - - // Set the php_save string to base64 string. - if (isset($data['php_save'])) - { - $data['php_save'] = base64_encode($data['php_save']); - } - - // Set the php_postsavehook string to base64 string. - if (isset($data['php_postsavehook'])) - { - $data['php_postsavehook'] = base64_encode($data['php_postsavehook']); - } - - // Set the javascript_view_file string to base64 string. - if (isset($data['javascript_view_file'])) - { - $data['javascript_view_file'] = base64_encode($data['javascript_view_file']); + $data['php_before_cancel'] = base64_encode($data['php_before_cancel']); } // Set the php_allowadd string to base64 string. @@ -1651,64 +1598,22 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $data['php_allowadd'] = base64_encode($data['php_allowadd']); } - // Set the php_allowedit string to base64 string. - if (isset($data['php_allowedit'])) + // Set the php_save string to base64 string. + if (isset($data['php_save'])) { - $data['php_allowedit'] = base64_encode($data['php_allowedit']); + $data['php_save'] = base64_encode($data['php_save']); } - // Set the javascript_view_footer string to base64 string. - if (isset($data['javascript_view_footer'])) + // Set the php_getform string to base64 string. + if (isset($data['php_getform'])) { - $data['javascript_view_footer'] = base64_encode($data['javascript_view_footer']); + $data['php_getform'] = base64_encode($data['php_getform']); } - // Set the php_before_cancel string to base64 string. - if (isset($data['php_before_cancel'])) + // Set the php_import_display string to base64 string. + if (isset($data['php_import_display'])) { - $data['php_before_cancel'] = base64_encode($data['php_before_cancel']); - } - - // Set the php_after_cancel string to base64 string. - if (isset($data['php_after_cancel'])) - { - $data['php_after_cancel'] = base64_encode($data['php_after_cancel']); - } - - // Set the javascript_views_file string to base64 string. - if (isset($data['javascript_views_file'])) - { - $data['javascript_views_file'] = base64_encode($data['javascript_views_file']); - } - - // Set the php_batchcopy string to base64 string. - if (isset($data['php_batchcopy'])) - { - $data['php_batchcopy'] = base64_encode($data['php_batchcopy']); - } - - // Set the php_batchmove string to base64 string. - if (isset($data['php_batchmove'])) - { - $data['php_batchmove'] = base64_encode($data['php_batchmove']); - } - - // Set the javascript_views_footer string to base64 string. - if (isset($data['javascript_views_footer'])) - { - $data['javascript_views_footer'] = base64_encode($data['javascript_views_footer']); - } - - // Set the php_before_publish string to base64 string. - if (isset($data['php_before_publish'])) - { - $data['php_before_publish'] = base64_encode($data['php_before_publish']); - } - - // Set the php_after_publish string to base64 string. - if (isset($data['php_after_publish'])) - { - $data['php_after_publish'] = base64_encode($data['php_after_publish']); + $data['php_import_display'] = base64_encode($data['php_import_display']); } // Set the php_before_delete string to base64 string. @@ -1717,10 +1622,76 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $data['php_before_delete'] = base64_encode($data['php_before_delete']); } - // Set the php_controller string to base64 string. - if (isset($data['php_controller'])) + // Set the php_batchcopy string to base64 string. + if (isset($data['php_batchcopy'])) { - $data['php_controller'] = base64_encode($data['php_controller']); + $data['php_batchcopy'] = base64_encode($data['php_batchcopy']); + } + + // Set the php_before_publish string to base64 string. + if (isset($data['php_before_publish'])) + { + $data['php_before_publish'] = base64_encode($data['php_before_publish']); + } + + // Set the php_document string to base64 string. + if (isset($data['php_document'])) + { + $data['php_document'] = base64_encode($data['php_document']); + } + + // Set the sql string to base64 string. + if (isset($data['sql'])) + { + $data['sql'] = base64_encode($data['sql']); + } + + // Set the php_import_setdata string to base64 string. + if (isset($data['php_import_setdata'])) + { + $data['php_import_setdata'] = base64_encode($data['php_import_setdata']); + } + + // Set the php_getlistquery string to base64 string. + if (isset($data['php_getlistquery'])) + { + $data['php_getlistquery'] = base64_encode($data['php_getlistquery']); + } + + // Set the php_before_save string to base64 string. + if (isset($data['php_before_save'])) + { + $data['php_before_save'] = base64_encode($data['php_before_save']); + } + + // Set the php_postsavehook string to base64 string. + if (isset($data['php_postsavehook'])) + { + $data['php_postsavehook'] = base64_encode($data['php_postsavehook']); + } + + // Set the php_allowedit string to base64 string. + if (isset($data['php_allowedit'])) + { + $data['php_allowedit'] = base64_encode($data['php_allowedit']); + } + + // Set the php_after_cancel string to base64 string. + if (isset($data['php_after_cancel'])) + { + $data['php_after_cancel'] = base64_encode($data['php_after_cancel']); + } + + // Set the php_batchmove string to base64 string. + if (isset($data['php_batchmove'])) + { + $data['php_batchmove'] = base64_encode($data['php_batchmove']); + } + + // Set the php_after_publish string to base64 string. + if (isset($data['php_after_publish'])) + { + $data['php_after_publish'] = base64_encode($data['php_after_publish']); } // Set the php_after_delete string to base64 string. @@ -1729,18 +1700,66 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $data['php_after_delete'] = base64_encode($data['php_after_delete']); } + // Set the php_import string to base64 string. + if (isset($data['php_import'])) + { + $data['php_import'] = base64_encode($data['php_import']); + } + + // Set the php_import_ext string to base64 string. + if (isset($data['php_import_ext'])) + { + $data['php_import_ext'] = base64_encode($data['php_import_ext']); + } + + // Set the css_view string to base64 string. + if (isset($data['css_view'])) + { + $data['css_view'] = base64_encode($data['css_view']); + } + + // Set the css_views string to base64 string. + if (isset($data['css_views'])) + { + $data['css_views'] = base64_encode($data['css_views']); + } + + // Set the javascript_view_file string to base64 string. + if (isset($data['javascript_view_file'])) + { + $data['javascript_view_file'] = base64_encode($data['javascript_view_file']); + } + + // Set the javascript_view_footer string to base64 string. + if (isset($data['javascript_view_footer'])) + { + $data['javascript_view_footer'] = base64_encode($data['javascript_view_footer']); + } + + // Set the javascript_views_file string to base64 string. + if (isset($data['javascript_views_file'])) + { + $data['javascript_views_file'] = base64_encode($data['javascript_views_file']); + } + + // Set the javascript_views_footer string to base64 string. + if (isset($data['javascript_views_footer'])) + { + $data['javascript_views_footer'] = base64_encode($data['javascript_views_footer']); + } + + // Set the php_controller string to base64 string. + if (isset($data['php_controller'])) + { + $data['php_controller'] = base64_encode($data['php_controller']); + } + // Set the php_model string to base64 string. if (isset($data['php_model'])) { $data['php_model'] = base64_encode($data['php_model']); } - // Set the php_document string to base64 string. - if (isset($data['php_document'])) - { - $data['php_document'] = base64_encode($data['php_document']); - } - // Set the php_controller_list string to base64 string. if (isset($data['php_controller_list'])) { @@ -1759,34 +1778,22 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']); } - // Set the sql string to base64 string. - if (isset($data['sql'])) - { - $data['sql'] = base64_encode($data['sql']); - } - - // Set the php_import_display string to base64 string. - if (isset($data['php_import_display'])) - { - $data['php_import_display'] = base64_encode($data['php_import_display']); - } - // Set the php_getitem string to base64 string. if (isset($data['php_getitem'])) { $data['php_getitem'] = base64_encode($data['php_getitem']); } - // Set the php_import string to base64 string. - if (isset($data['php_import'])) + // Set the html_import_view string to base64 string. + if (isset($data['html_import_view'])) { - $data['php_import'] = base64_encode($data['php_import']); + $data['html_import_view'] = base64_encode($data['html_import_view']); } - // Set the php_import_setdata string to base64 string. - if (isset($data['php_import_setdata'])) + // Set the php_import_headers string to base64 string. + if (isset($data['php_import_headers'])) { - $data['php_import_setdata'] = base64_encode($data['php_import_setdata']); + $data['php_import_headers'] = base64_encode($data['php_import_headers']); } // Set the php_getitems string to base64 string. @@ -1795,10 +1802,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $data['php_getitems'] = base64_encode($data['php_getitems']); } - // Set the php_import_ext string to base64 string. - if (isset($data['php_import_ext'])) + // Set the php_import_save string to base64 string. + if (isset($data['php_import_save'])) { - $data['php_import_ext'] = base64_encode($data['php_import_ext']); + $data['php_import_save'] = base64_encode($data['php_import_save']); + } + + // Set the php_getitems_after_all string to base64 string. + if (isset($data['php_getitems_after_all'])) + { + $data['php_getitems_after_all'] = base64_encode($data['php_getitems_after_all']); } // Set the Params Items to data diff --git a/admin/models/admin_views.php b/admin/models/admin_views.php index f6c07e361..121c7e4c9 100644 --- a/admin/models/admin_views.php +++ b/admin/models/admin_views.php @@ -31,10 +31,10 @@ class ComponentbuilderModelAdmin_views extends JModelList 'a.name_single','name_single', 'a.short_description','short_description', 'a.add_fadein','add_fadein', - 'a.add_custom_import','add_custom_import', 'a.type','type', 'a.add_custom_button','add_custom_button', - 'a.add_php_ajax','add_php_ajax' + 'a.add_php_ajax','add_php_ajax', + 'a.add_custom_import','add_custom_import' ); } @@ -67,9 +67,6 @@ class ComponentbuilderModelAdmin_views extends JModelList $add_fadein = $this->getUserStateFromRequest($this->context . '.filter.add_fadein', 'filter_add_fadein'); $this->setState('filter.add_fadein', $add_fadein); - $add_custom_import = $this->getUserStateFromRequest($this->context . '.filter.add_custom_import', 'filter_add_custom_import'); - $this->setState('filter.add_custom_import', $add_custom_import); - $type = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type'); $this->setState('filter.type', $type); @@ -77,7 +74,10 @@ class ComponentbuilderModelAdmin_views extends JModelList $this->setState('filter.add_custom_button', $add_custom_button); $add_php_ajax = $this->getUserStateFromRequest($this->context . '.filter.add_php_ajax', 'filter_add_php_ajax'); - $this->setState('filter.add_php_ajax', $add_php_ajax); + $this->setState('filter.add_php_ajax', $add_php_ajax); + + $add_custom_import = $this->getUserStateFromRequest($this->context . '.filter.add_custom_import', 'filter_add_custom_import'); + $this->setState('filter.add_custom_import', $add_custom_import); $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); $this->setState('filter.sorting', $sorting); @@ -142,14 +142,14 @@ class ComponentbuilderModelAdmin_views extends JModelList { // convert add_fadein $item->add_fadein = $this->selectionTranslation($item->add_fadein, 'add_fadein'); - // convert add_custom_import - $item->add_custom_import = $this->selectionTranslation($item->add_custom_import, 'add_custom_import'); // convert type $item->type = $this->selectionTranslation($item->type, 'type'); // convert add_custom_button $item->add_custom_button = $this->selectionTranslation($item->add_custom_button, 'add_custom_button'); // convert add_php_ajax $item->add_php_ajax = $this->selectionTranslation($item->add_php_ajax, 'add_php_ajax'); + // convert add_custom_import + $item->add_custom_import = $this->selectionTranslation($item->add_custom_import, 'add_custom_import'); } } @@ -178,19 +178,6 @@ class ComponentbuilderModelAdmin_views extends JModelList return $add_fadeinArray[$value]; } } - // Array of add_custom_import language strings - if ($name === 'add_custom_import') - { - $add_custom_importArray = array( - 1 => 'COM_COMPONENTBUILDER_ADMIN_VIEW_YES', - 0 => 'COM_COMPONENTBUILDER_ADMIN_VIEW_NO' - ); - // Now check if value is found in this array - if (isset($add_custom_importArray[$value]) && ComponentbuilderHelper::checkString($add_custom_importArray[$value])) - { - return $add_custom_importArray[$value]; - } - } // Array of type language strings if ($name === 'type') { @@ -230,6 +217,19 @@ class ComponentbuilderModelAdmin_views extends JModelList return $add_php_ajaxArray[$value]; } } + // Array of add_custom_import language strings + if ($name === 'add_custom_import') + { + $add_custom_importArray = array( + 1 => 'COM_COMPONENTBUILDER_ADMIN_VIEW_YES', + 0 => 'COM_COMPONENTBUILDER_ADMIN_VIEW_NO' + ); + // Now check if value is found in this array + if (isset($add_custom_importArray[$value]) && ComponentbuilderHelper::checkString($add_custom_importArray[$value])) + { + return $add_custom_importArray[$value]; + } + } return $value; } @@ -297,11 +297,6 @@ class ComponentbuilderModelAdmin_views extends JModelList { $query->where('a.add_fadein = ' . $db->quote($db->escape($add_fadein))); } - // Filter by Add_custom_import. - if ($add_custom_import = $this->getState('filter.add_custom_import')) - { - $query->where('a.add_custom_import = ' . $db->quote($db->escape($add_custom_import))); - } // Filter by Type. if ($type = $this->getState('filter.type')) { @@ -317,6 +312,11 @@ class ComponentbuilderModelAdmin_views extends JModelList { $query->where('a.add_php_ajax = ' . $db->quote($db->escape($add_php_ajax))); } + // Filter by Add_custom_import. + if ($add_custom_import = $this->getState('filter.add_custom_import')) + { + $query->where('a.add_custom_import = ' . $db->quote($db->escape($add_custom_import))); + } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); @@ -389,82 +389,82 @@ class ComponentbuilderModelAdmin_views extends JModelList continue; } - // decode php_import_headers - $item->php_import_headers = base64_decode($item->php_import_headers); - // decode html_import_view - $item->html_import_view = base64_decode($item->html_import_view); - // decode php_import_save - $item->php_import_save = base64_decode($item->php_import_save); - // decode php_getitems_after_all - $item->php_getitems_after_all = base64_decode($item->php_getitems_after_all); - // decode php_getlistquery - $item->php_getlistquery = base64_decode($item->php_getlistquery); - // decode css_view - $item->css_view = base64_decode($item->css_view); - // decode php_getform - $item->php_getform = base64_decode($item->php_getform); - // decode php_before_save - $item->php_before_save = base64_decode($item->php_before_save); - // decode css_views - $item->css_views = base64_decode($item->css_views); - // decode php_save - $item->php_save = base64_decode($item->php_save); - // decode php_postsavehook - $item->php_postsavehook = base64_decode($item->php_postsavehook); - // decode javascript_view_file - $item->javascript_view_file = base64_decode($item->javascript_view_file); - // decode php_allowadd - $item->php_allowadd = base64_decode($item->php_allowadd); - // decode php_allowedit - $item->php_allowedit = base64_decode($item->php_allowedit); - // decode javascript_view_footer - $item->javascript_view_footer = base64_decode($item->javascript_view_footer); // decode php_before_cancel $item->php_before_cancel = base64_decode($item->php_before_cancel); - // decode php_after_cancel - $item->php_after_cancel = base64_decode($item->php_after_cancel); - // decode javascript_views_file - $item->javascript_views_file = base64_decode($item->javascript_views_file); - // decode php_batchcopy - $item->php_batchcopy = base64_decode($item->php_batchcopy); - // decode php_batchmove - $item->php_batchmove = base64_decode($item->php_batchmove); - // decode javascript_views_footer - $item->javascript_views_footer = base64_decode($item->javascript_views_footer); - // decode php_before_publish - $item->php_before_publish = base64_decode($item->php_before_publish); - // decode php_after_publish - $item->php_after_publish = base64_decode($item->php_after_publish); + // decode php_allowadd + $item->php_allowadd = base64_decode($item->php_allowadd); + // decode php_save + $item->php_save = base64_decode($item->php_save); + // decode php_getform + $item->php_getform = base64_decode($item->php_getform); + // decode php_import_display + $item->php_import_display = base64_decode($item->php_import_display); // decode php_before_delete $item->php_before_delete = base64_decode($item->php_before_delete); - // decode php_controller - $item->php_controller = base64_decode($item->php_controller); - // decode php_after_delete - $item->php_after_delete = base64_decode($item->php_after_delete); - // decode php_model - $item->php_model = base64_decode($item->php_model); + // decode php_batchcopy + $item->php_batchcopy = base64_decode($item->php_batchcopy); + // decode php_before_publish + $item->php_before_publish = base64_decode($item->php_before_publish); // decode php_document $item->php_document = base64_decode($item->php_document); + // decode sql + $item->sql = base64_decode($item->sql); + // decode php_import_setdata + $item->php_import_setdata = base64_decode($item->php_import_setdata); + // decode php_getlistquery + $item->php_getlistquery = base64_decode($item->php_getlistquery); + // decode php_before_save + $item->php_before_save = base64_decode($item->php_before_save); + // decode php_postsavehook + $item->php_postsavehook = base64_decode($item->php_postsavehook); + // decode php_allowedit + $item->php_allowedit = base64_decode($item->php_allowedit); + // decode php_after_cancel + $item->php_after_cancel = base64_decode($item->php_after_cancel); + // decode php_batchmove + $item->php_batchmove = base64_decode($item->php_batchmove); + // decode php_after_publish + $item->php_after_publish = base64_decode($item->php_after_publish); + // decode php_after_delete + $item->php_after_delete = base64_decode($item->php_after_delete); + // decode php_import + $item->php_import = base64_decode($item->php_import); + // decode php_import_ext + $item->php_import_ext = base64_decode($item->php_import_ext); + // decode css_view + $item->css_view = base64_decode($item->css_view); + // decode css_views + $item->css_views = base64_decode($item->css_views); + // decode javascript_view_file + $item->javascript_view_file = base64_decode($item->javascript_view_file); + // decode javascript_view_footer + $item->javascript_view_footer = base64_decode($item->javascript_view_footer); + // decode javascript_views_file + $item->javascript_views_file = base64_decode($item->javascript_views_file); + // decode javascript_views_footer + $item->javascript_views_footer = base64_decode($item->javascript_views_footer); + // decode php_controller + $item->php_controller = base64_decode($item->php_controller); + // decode php_model + $item->php_model = base64_decode($item->php_model); // decode php_controller_list $item->php_controller_list = base64_decode($item->php_controller_list); // decode php_model_list $item->php_model_list = base64_decode($item->php_model_list); // decode php_ajaxmethod $item->php_ajaxmethod = base64_decode($item->php_ajaxmethod); - // decode sql - $item->sql = base64_decode($item->sql); - // decode php_import_display - $item->php_import_display = base64_decode($item->php_import_display); // decode php_getitem $item->php_getitem = base64_decode($item->php_getitem); - // decode php_import - $item->php_import = base64_decode($item->php_import); - // decode php_import_setdata - $item->php_import_setdata = base64_decode($item->php_import_setdata); + // decode html_import_view + $item->html_import_view = base64_decode($item->html_import_view); + // decode php_import_headers + $item->php_import_headers = base64_decode($item->php_import_headers); // decode php_getitems $item->php_getitems = base64_decode($item->php_getitems); - // decode php_import_ext - $item->php_import_ext = base64_decode($item->php_import_ext); + // decode php_import_save + $item->php_import_save = base64_decode($item->php_import_save); + // decode php_getitems_after_all + $item->php_getitems_after_all = base64_decode($item->php_getitems_after_all); // unset the values we don't want exported. unset($item->asset_id); unset($item->checked_out); @@ -529,10 +529,10 @@ class ComponentbuilderModelAdmin_views extends JModelList $id .= ':' . $this->getState('filter.name_single'); $id .= ':' . $this->getState('filter.short_description'); $id .= ':' . $this->getState('filter.add_fadein'); - $id .= ':' . $this->getState('filter.add_custom_import'); $id .= ':' . $this->getState('filter.type'); $id .= ':' . $this->getState('filter.add_custom_button'); - $id .= ':' . $this->getState('filter.add_php_ajax'); + $id .= ':' . $this->getState('filter.add_php_ajax'); + $id .= ':' . $this->getState('filter.add_custom_import'); return parent::getStoreId($id); } diff --git a/admin/models/ajax.php b/admin/models/ajax.php index e12056b33..740cc6362 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -2514,7 +2514,7 @@ class ComponentbuilderModelAjax extends JModelList // #__componentbuilder_custom_admin_view (g) 'custom_admin_view' => array( 'search' => array('id', 'system_name', 'default', 'php_view', 'php_jview', 'php_jview_display', 'php_document', - 'js_document', 'css_document', 'css', 'php_ajaxmethod', 'php_model', 'php_controller'), + 'javascript_file', 'js_document', 'css_document', 'css', 'php_ajaxmethod', 'php_model', 'php_controller'), 'views' => 'custom_admin_views', 'not_base64' => array(), 'name' => 'system_name' @@ -2522,7 +2522,7 @@ class ComponentbuilderModelAjax extends JModelList // #__componentbuilder_site_view (h) 'site_view' => array( 'search' => array('id', 'system_name', 'default', 'php_view', 'php_jview', 'php_jview_display', 'php_document', - 'js_document', 'css_document', 'css', 'php_ajaxmethod', 'php_model', 'php_controller'), + 'javascript_file', 'js_document', 'css_document', 'css', 'php_ajaxmethod', 'php_model', 'php_controller'), 'views' => 'site_views', 'not_base64' => array(), 'name' => 'system_name' diff --git a/admin/models/class_extends.php b/admin/models/class_extends.php index cd3ba03ac..eb4961b40 100644 --- a/admin/models/class_extends.php +++ b/admin/models/class_extends.php @@ -220,14 +220,14 @@ class ComponentbuilderModelClass_extends extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/class_method.php b/admin/models/class_method.php index 06d0fd51e..46e1efecb 100644 --- a/admin/models/class_method.php +++ b/admin/models/class_method.php @@ -229,14 +229,14 @@ class ComponentbuilderModelClass_method extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { @@ -338,6 +338,13 @@ class ComponentbuilderModelClass_method extends JModelAdmin $form->setFieldAttribute($name, 'editor', $global_editor . '|none'); } } + + + // Only load the GUID if new item + if (0 == $id) + { + $form->setValue('guid', null, ComponentbuilderHelper::GUID()); + } return $form; } @@ -960,7 +967,14 @@ class ComponentbuilderModelClass_method extends JModelAdmin } // make sure the name is safe to be used as a function name - $data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']); + $data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']); + + // Set the GUID if empty or not valid + if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'])) + { + $data['guid'] = (string) ComponentbuilderHelper::GUID(); + } + // Set the code string to base64 string. if (isset($data['code'])) diff --git a/admin/models/class_property.php b/admin/models/class_property.php index b7ef158db..68c578371 100644 --- a/admin/models/class_property.php +++ b/admin/models/class_property.php @@ -220,14 +220,14 @@ class ComponentbuilderModelClass_property extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { @@ -329,6 +329,13 @@ class ComponentbuilderModelClass_property extends JModelAdmin $form->setFieldAttribute($name, 'editor', $global_editor . '|none'); } } + + + // Only load the GUID if new item + if (0 == $id) + { + $form->setValue('guid', null, ComponentbuilderHelper::GUID()); + } return $form; } @@ -951,7 +958,14 @@ class ComponentbuilderModelClass_property extends JModelAdmin } // make sure the name is safe to be used as a function name - $data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']); + $data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']); + + // Set the GUID if empty or not valid + if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'])) + { + $data['guid'] = (string) ComponentbuilderHelper::GUID(); + } + // Set the comment string to base64 string. if (isset($data['comment'])) diff --git a/admin/models/component_admin_views.php b/admin/models/component_admin_views.php index e6bea6189..716d226af 100644 --- a/admin/models/component_admin_views.php +++ b/admin/models/component_admin_views.php @@ -162,14 +162,14 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/component_config.php b/admin/models/component_config.php index dd2bae7f3..c8b8912bc 100644 --- a/admin/models/component_config.php +++ b/admin/models/component_config.php @@ -161,14 +161,14 @@ class ComponentbuilderModelComponent_config extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/component_custom_admin_menus.php b/admin/models/component_custom_admin_menus.php index ebcd866e3..2ef2d3a05 100644 --- a/admin/models/component_custom_admin_menus.php +++ b/admin/models/component_custom_admin_menus.php @@ -161,14 +161,14 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/component_custom_admin_views.php b/admin/models/component_custom_admin_views.php index a40086b03..2ff595ff2 100644 --- a/admin/models/component_custom_admin_views.php +++ b/admin/models/component_custom_admin_views.php @@ -162,14 +162,14 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/component_dashboard.php b/admin/models/component_dashboard.php index a1460f7fb..702f25250 100644 --- a/admin/models/component_dashboard.php +++ b/admin/models/component_dashboard.php @@ -250,14 +250,14 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/component_files_folders.php b/admin/models/component_files_folders.php index bd79e5f91..29e995f32 100644 --- a/admin/models/component_files_folders.php +++ b/admin/models/component_files_folders.php @@ -198,14 +198,14 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/component_modules.php b/admin/models/component_modules.php index a4c7ca57e..ff50a83c1 100644 --- a/admin/models/component_modules.php +++ b/admin/models/component_modules.php @@ -131,14 +131,14 @@ class ComponentbuilderModelComponent_modules extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/component_mysql_tweaks.php b/admin/models/component_mysql_tweaks.php index 4737b58da..f679e1b03 100644 --- a/admin/models/component_mysql_tweaks.php +++ b/admin/models/component_mysql_tweaks.php @@ -161,14 +161,14 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/component_placeholders.php b/admin/models/component_placeholders.php index 14d621ad4..0c54fcb80 100644 --- a/admin/models/component_placeholders.php +++ b/admin/models/component_placeholders.php @@ -130,14 +130,14 @@ class ComponentbuilderModelComponent_placeholders extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/component_plugins.php b/admin/models/component_plugins.php index 54e29f388..622727714 100644 --- a/admin/models/component_plugins.php +++ b/admin/models/component_plugins.php @@ -131,14 +131,14 @@ class ComponentbuilderModelComponent_plugins extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/component_site_views.php b/admin/models/component_site_views.php index 75c415832..0da8beb67 100644 --- a/admin/models/component_site_views.php +++ b/admin/models/component_site_views.php @@ -162,14 +162,14 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/component_updates.php b/admin/models/component_updates.php index bb03d4e98..90757336a 100644 --- a/admin/models/component_updates.php +++ b/admin/models/component_updates.php @@ -161,14 +161,14 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/custom_admin_view.php b/admin/models/custom_admin_view.php index 038684eb1..4acbdc29d 100644 --- a/admin/models/custom_admin_view.php +++ b/admin/models/custom_admin_view.php @@ -84,6 +84,11 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin 'css' ) ), + 'linked_components' => array( + 'fullwidth' => array( + 'note_linked_to_notice' + ) + ), 'custom_buttons' => array( 'left' => array( 'add_custom_button', @@ -93,11 +98,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin 'php_controller', 'php_model' ) - ), - 'linked_components' => array( - 'fullwidth' => array( - 'note_linked_to_notice' - ) ) ); @@ -212,28 +212,16 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $item->metadata = $registry->toArray(); } - if (!empty($item->php_jview_display)) + if (!empty($item->css_document)) { - // base64 Decode php_jview_display. - $item->php_jview_display = base64_decode($item->php_jview_display); + // base64 Decode css_document. + $item->css_document = base64_decode($item->css_document); } - if (!empty($item->php_view)) + if (!empty($item->css)) { - // base64 Decode php_view. - $item->php_view = base64_decode($item->php_view); - } - - if (!empty($item->default)) - { - // base64 Decode default. - $item->default = base64_decode($item->default); - } - - if (!empty($item->php_jview)) - { - // base64 Decode php_jview. - $item->php_jview = base64_decode($item->php_jview); + // base64 Decode css. + $item->css = base64_decode($item->css); } if (!empty($item->js_document)) @@ -248,10 +236,16 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $item->javascript_file = base64_decode($item->javascript_file); } - if (!empty($item->css_document)) + if (!empty($item->default)) { - // base64 Decode css_document. - $item->css_document = base64_decode($item->css_document); + // base64 Decode default. + $item->default = base64_decode($item->default); + } + + if (!empty($item->php_ajaxmethod)) + { + // base64 Decode php_ajaxmethod. + $item->php_ajaxmethod = base64_decode($item->php_ajaxmethod); } if (!empty($item->php_document)) @@ -260,16 +254,22 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $item->php_document = base64_decode($item->php_document); } - if (!empty($item->css)) + if (!empty($item->php_view)) { - // base64 Decode css. - $item->css = base64_decode($item->css); + // base64 Decode php_view. + $item->php_view = base64_decode($item->php_view); } - if (!empty($item->php_ajaxmethod)) + if (!empty($item->php_jview_display)) { - // base64 Decode php_ajaxmethod. - $item->php_ajaxmethod = base64_decode($item->php_ajaxmethod); + // base64 Decode php_jview_display. + $item->php_jview_display = base64_decode($item->php_jview_display); + } + + if (!empty($item->php_jview)) + { + // base64 Decode php_jview. + $item->php_jview = base64_decode($item->php_jview); } if (!empty($item->php_controller)) @@ -292,14 +292,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $item->custom_get = $custom_get->toArray(); } - if (!empty($item->ajax_input)) - { - // Convert the ajax_input field to an array. - $ajax_input = new Registry; - $ajax_input->loadString($item->ajax_input); - $item->ajax_input = $ajax_input->toArray(); - } - if (!empty($item->libraries)) { // Convert the libraries field to an array. @@ -308,6 +300,14 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $item->libraries = $libraries->toArray(); } + if (!empty($item->ajax_input)) + { + // Convert the ajax_input field to an array. + $ajax_input = new Registry; + $ajax_input->loadString($item->ajax_input); + $item->ajax_input = $ajax_input->toArray(); + } + if (!empty($item->custom_button)) { // Convert the custom_button field to an array. @@ -395,14 +395,14 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { @@ -502,6 +502,13 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $form->setFieldAttribute($name, 'editor', $global_editor . '|none'); } } + + + // Only load the GUID if new item + if (0 == $id) + { + $form->setValue('guid', null, ComponentbuilderHelper::GUID()); + } return $form; } @@ -1113,7 +1120,14 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin { // always make safe string $data['context'] = ComponentbuilderHelper::safeString($data['context']); - } + } + + // Set the GUID if empty or not valid + if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'])) + { + $data['guid'] = (string) ComponentbuilderHelper::GUID(); + } + // Set the custom_get items to data. if (isset($data['custom_get']) && is_array($data['custom_get'])) @@ -1128,19 +1142,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $data['custom_get'] = ''; } - // Set the ajax_input items to data. - if (isset($data['ajax_input']) && is_array($data['ajax_input'])) - { - $ajax_input = new JRegistry; - $ajax_input->loadArray($data['ajax_input']); - $data['ajax_input'] = (string) $ajax_input; - } - elseif (!isset($data['ajax_input'])) - { - // Set the empty ajax_input to data - $data['ajax_input'] = ''; - } - // Set the libraries items to data. if (isset($data['libraries']) && is_array($data['libraries'])) { @@ -1154,6 +1155,19 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $data['libraries'] = ''; } + // Set the ajax_input items to data. + if (isset($data['ajax_input']) && is_array($data['ajax_input'])) + { + $ajax_input = new JRegistry; + $ajax_input->loadArray($data['ajax_input']); + $data['ajax_input'] = (string) $ajax_input; + } + elseif (!isset($data['ajax_input'])) + { + // Set the empty ajax_input to data + $data['ajax_input'] = ''; + } + // Set the custom_button items to data. if (isset($data['custom_button']) && is_array($data['custom_button'])) { @@ -1167,28 +1181,16 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $data['custom_button'] = ''; } - // Set the php_jview_display string to base64 string. - if (isset($data['php_jview_display'])) + // Set the css_document string to base64 string. + if (isset($data['css_document'])) { - $data['php_jview_display'] = base64_encode($data['php_jview_display']); + $data['css_document'] = base64_encode($data['css_document']); } - // Set the php_view string to base64 string. - if (isset($data['php_view'])) + // Set the css string to base64 string. + if (isset($data['css'])) { - $data['php_view'] = base64_encode($data['php_view']); - } - - // Set the default string to base64 string. - if (isset($data['default'])) - { - $data['default'] = base64_encode($data['default']); - } - - // Set the php_jview string to base64 string. - if (isset($data['php_jview'])) - { - $data['php_jview'] = base64_encode($data['php_jview']); + $data['css'] = base64_encode($data['css']); } // Set the js_document string to base64 string. @@ -1203,10 +1205,16 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $data['javascript_file'] = base64_encode($data['javascript_file']); } - // Set the css_document string to base64 string. - if (isset($data['css_document'])) + // Set the default string to base64 string. + if (isset($data['default'])) { - $data['css_document'] = base64_encode($data['css_document']); + $data['default'] = base64_encode($data['default']); + } + + // Set the php_ajaxmethod string to base64 string. + if (isset($data['php_ajaxmethod'])) + { + $data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']); } // Set the php_document string to base64 string. @@ -1215,16 +1223,22 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $data['php_document'] = base64_encode($data['php_document']); } - // Set the css string to base64 string. - if (isset($data['css'])) + // Set the php_view string to base64 string. + if (isset($data['php_view'])) { - $data['css'] = base64_encode($data['css']); + $data['php_view'] = base64_encode($data['php_view']); } - // Set the php_ajaxmethod string to base64 string. - if (isset($data['php_ajaxmethod'])) + // Set the php_jview_display string to base64 string. + if (isset($data['php_jview_display'])) { - $data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']); + $data['php_jview_display'] = base64_encode($data['php_jview_display']); + } + + // Set the php_jview string to base64 string. + if (isset($data['php_jview'])) + { + $data['php_jview'] = base64_encode($data['php_jview']); } // Set the php_controller string to base64 string. diff --git a/admin/models/custom_admin_views.php b/admin/models/custom_admin_views.php index 258a106d7..b6692fee1 100644 --- a/admin/models/custom_admin_views.php +++ b/admin/models/custom_admin_views.php @@ -239,7 +239,7 @@ class ComponentbuilderModelCustom_admin_views extends JModelList else { $search = $db->quote('%' . $db->escape($search) . '%'); - $query->where('(a.system_name LIKE '.$search.' OR a.name LIKE '.$search.' OR a.description LIKE '.$search.' OR a.main_get LIKE '.$search.' OR g.name LIKE '.$search.' OR a.context LIKE '.$search.' OR a.codename LIKE '.$search.')'); + $query->where('(a.system_name LIKE '.$search.' OR a.name LIKE '.$search.' OR a.description LIKE '.$search.' OR a.main_get LIKE '.$search.' OR g.name LIKE '.$search.' OR a.codename LIKE '.$search.' OR a.context LIKE '.$search.')'); } } @@ -330,26 +330,26 @@ class ComponentbuilderModelCustom_admin_views extends JModelList continue; } - // decode php_jview_display - $item->php_jview_display = base64_decode($item->php_jview_display); - // decode php_view - $item->php_view = base64_decode($item->php_view); - // decode default - $item->default = base64_decode($item->default); - // decode php_jview - $item->php_jview = base64_decode($item->php_jview); + // decode css_document + $item->css_document = base64_decode($item->css_document); + // decode css + $item->css = base64_decode($item->css); // decode js_document $item->js_document = base64_decode($item->js_document); // decode javascript_file $item->javascript_file = base64_decode($item->javascript_file); - // decode css_document - $item->css_document = base64_decode($item->css_document); - // decode php_document - $item->php_document = base64_decode($item->php_document); - // decode css - $item->css = base64_decode($item->css); + // decode default + $item->default = base64_decode($item->default); // decode php_ajaxmethod $item->php_ajaxmethod = base64_decode($item->php_ajaxmethod); + // decode php_document + $item->php_document = base64_decode($item->php_document); + // decode php_view + $item->php_view = base64_decode($item->php_view); + // decode php_jview_display + $item->php_jview_display = base64_decode($item->php_jview_display); + // decode php_jview + $item->php_jview = base64_decode($item->php_jview); // decode php_controller $item->php_controller = base64_decode($item->php_controller); // decode php_model diff --git a/admin/models/custom_code.php b/admin/models/custom_code.php index 33c9aa537..f4806983b 100644 --- a/admin/models/custom_code.php +++ b/admin/models/custom_code.php @@ -229,14 +229,14 @@ class ComponentbuilderModelCustom_code extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { diff --git a/admin/models/dynamic_get.php b/admin/models/dynamic_get.php index faf71c97b..1b690211a 100644 --- a/admin/models/dynamic_get.php +++ b/admin/models/dynamic_get.php @@ -51,16 +51,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin 'not_required' ) ), - 'abacus' => array( - 'left' => array( - 'addcalculation' - ), - 'fullwidth' => array( - 'note_calculation_item', - 'note_calculation_items', - 'php_calculation' - ) - ), 'custom_script' => array( 'fullwidth' => array( 'add_php_before_getitem', @@ -77,6 +67,16 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin 'php_router_parse' ) ), + 'abacus' => array( + 'left' => array( + 'addcalculation' + ), + 'fullwidth' => array( + 'note_calculation_item', + 'note_calculation_items', + 'php_calculation' + ) + ), 'joint' => array( 'fullwidth' => array( 'join_view_table', @@ -205,28 +205,10 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $item->metadata = $registry->toArray(); } - if (!empty($item->php_custom_get)) + if (!empty($item->php_router_parse)) { - // base64 Decode php_custom_get. - $item->php_custom_get = base64_decode($item->php_custom_get); - } - - if (!empty($item->php_before_getitem)) - { - // base64 Decode php_before_getitem. - $item->php_before_getitem = base64_decode($item->php_before_getitem); - } - - if (!empty($item->php_after_getitem)) - { - // base64 Decode php_after_getitem. - $item->php_after_getitem = base64_decode($item->php_after_getitem); - } - - if (!empty($item->php_getlistquery)) - { - // base64 Decode php_getlistquery. - $item->php_getlistquery = base64_decode($item->php_getlistquery); + // base64 Decode php_router_parse. + $item->php_router_parse = base64_decode($item->php_router_parse); } if (!empty($item->php_before_getitems)) @@ -241,10 +223,22 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $item->php_after_getitems = base64_decode($item->php_after_getitems); } - if (!empty($item->php_router_parse)) + if (!empty($item->php_after_getitem)) { - // base64 Decode php_router_parse. - $item->php_router_parse = base64_decode($item->php_router_parse); + // base64 Decode php_after_getitem. + $item->php_after_getitem = base64_decode($item->php_after_getitem); + } + + if (!empty($item->php_getlistquery)) + { + // base64 Decode php_getlistquery. + $item->php_getlistquery = base64_decode($item->php_getlistquery); + } + + if (!empty($item->php_custom_get)) + { + // base64 Decode php_custom_get. + $item->php_custom_get = base64_decode($item->php_custom_get); } if (!empty($item->php_calculation)) @@ -253,12 +247,10 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $item->php_calculation = base64_decode($item->php_calculation); } - if (!empty($item->join_view_table)) + if (!empty($item->php_before_getitem)) { - // Convert the join_view_table field to an array. - $join_view_table = new Registry; - $join_view_table->loadString($item->join_view_table); - $item->join_view_table = $join_view_table->toArray(); + // base64 Decode php_before_getitem. + $item->php_before_getitem = base64_decode($item->php_before_getitem); } if (!empty($item->join_db_table)) @@ -309,6 +301,14 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $item->global = $global->toArray(); } + if (!empty($item->join_view_table)) + { + // Convert the join_view_table field to an array. + $join_view_table = new Registry; + $join_view_table->loadString($item->join_view_table); + $item->join_view_table = $join_view_table->toArray(); + } + if (!empty($item->plugin_events)) { // JSON Decode plugin_events. @@ -409,14 +409,14 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { @@ -516,6 +516,13 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $form->setFieldAttribute($name, 'editor', $global_editor . '|none'); } } + + + // Only load the GUID if new item + if (0 == $id) + { + $form->setValue('guid', null, ComponentbuilderHelper::GUID()); + } return $form; } @@ -1137,18 +1144,13 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $data['metadata'] = (string) $metadata; } - // Set the join_view_table items to data. - if (isset($data['join_view_table']) && is_array($data['join_view_table'])) - { - $join_view_table = new JRegistry; - $join_view_table->loadArray($data['join_view_table']); - $data['join_view_table'] = (string) $join_view_table; - } - elseif (!isset($data['join_view_table'])) - { - // Set the empty join_view_table to data - $data['join_view_table'] = ''; - } + + // Set the GUID if empty or not valid + if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'])) + { + $data['guid'] = (string) ComponentbuilderHelper::GUID(); + } + // Set the join_db_table items to data. if (isset($data['join_db_table']) && is_array($data['join_db_table'])) @@ -1228,34 +1230,29 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $data['global'] = ''; } + // Set the join_view_table items to data. + if (isset($data['join_view_table']) && is_array($data['join_view_table'])) + { + $join_view_table = new JRegistry; + $join_view_table->loadArray($data['join_view_table']); + $data['join_view_table'] = (string) $join_view_table; + } + elseif (!isset($data['join_view_table'])) + { + // Set the empty join_view_table to data + $data['join_view_table'] = ''; + } + // Set the plugin_events string to JSON string. if (isset($data['plugin_events'])) { $data['plugin_events'] = (string) json_encode($data['plugin_events']); } - // Set the php_custom_get string to base64 string. - if (isset($data['php_custom_get'])) + // Set the php_router_parse string to base64 string. + if (isset($data['php_router_parse'])) { - $data['php_custom_get'] = base64_encode($data['php_custom_get']); - } - - // Set the php_before_getitem string to base64 string. - if (isset($data['php_before_getitem'])) - { - $data['php_before_getitem'] = base64_encode($data['php_before_getitem']); - } - - // Set the php_after_getitem string to base64 string. - if (isset($data['php_after_getitem'])) - { - $data['php_after_getitem'] = base64_encode($data['php_after_getitem']); - } - - // Set the php_getlistquery string to base64 string. - if (isset($data['php_getlistquery'])) - { - $data['php_getlistquery'] = base64_encode($data['php_getlistquery']); + $data['php_router_parse'] = base64_encode($data['php_router_parse']); } // Set the php_before_getitems string to base64 string. @@ -1270,16 +1267,34 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $data['php_after_getitems'] = base64_encode($data['php_after_getitems']); } - // Set the php_router_parse string to base64 string. - if (isset($data['php_router_parse'])) + // Set the php_after_getitem string to base64 string. + if (isset($data['php_after_getitem'])) { - $data['php_router_parse'] = base64_encode($data['php_router_parse']); + $data['php_after_getitem'] = base64_encode($data['php_after_getitem']); + } + + // Set the php_getlistquery string to base64 string. + if (isset($data['php_getlistquery'])) + { + $data['php_getlistquery'] = base64_encode($data['php_getlistquery']); + } + + // Set the php_custom_get string to base64 string. + if (isset($data['php_custom_get'])) + { + $data['php_custom_get'] = base64_encode($data['php_custom_get']); } // Set the php_calculation string to base64 string. if (isset($data['php_calculation'])) { $data['php_calculation'] = base64_encode($data['php_calculation']); + } + + // Set the php_before_getitem string to base64 string. + if (isset($data['php_before_getitem'])) + { + $data['php_before_getitem'] = base64_encode($data['php_before_getitem']); } // Set the Params Items to data diff --git a/admin/models/dynamic_gets.php b/admin/models/dynamic_gets.php index 5ec969544..b60268df2 100644 --- a/admin/models/dynamic_gets.php +++ b/admin/models/dynamic_gets.php @@ -313,22 +313,22 @@ class ComponentbuilderModelDynamic_gets extends JModelList continue; } - // decode php_custom_get - $item->php_custom_get = base64_decode($item->php_custom_get); - // decode php_before_getitem - $item->php_before_getitem = base64_decode($item->php_before_getitem); - // decode php_after_getitem - $item->php_after_getitem = base64_decode($item->php_after_getitem); - // decode php_getlistquery - $item->php_getlistquery = base64_decode($item->php_getlistquery); + // decode php_router_parse + $item->php_router_parse = base64_decode($item->php_router_parse); // decode php_before_getitems $item->php_before_getitems = base64_decode($item->php_before_getitems); // decode php_after_getitems $item->php_after_getitems = base64_decode($item->php_after_getitems); - // decode php_router_parse - $item->php_router_parse = base64_decode($item->php_router_parse); + // decode php_after_getitem + $item->php_after_getitem = base64_decode($item->php_after_getitem); + // decode php_getlistquery + $item->php_getlistquery = base64_decode($item->php_getlistquery); + // decode php_custom_get + $item->php_custom_get = base64_decode($item->php_custom_get); // decode php_calculation $item->php_calculation = base64_decode($item->php_calculation); + // decode php_before_getitem + $item->php_before_getitem = base64_decode($item->php_before_getitem); // unset the values we don't want exported. unset($item->asset_id); unset($item->checked_out); diff --git a/admin/models/field.php b/admin/models/field.php index 34225d89b..1c76164b3 100644 --- a/admin/models/field.php +++ b/admin/models/field.php @@ -220,18 +220,18 @@ class ComponentbuilderModelField extends JModelAdmin $item->css_view = base64_decode($item->css_view); } - if (!empty($item->css_views)) - { - // base64 Decode css_views. - $item->css_views = base64_decode($item->css_views); - } - if (!empty($item->javascript_view_footer)) { // base64 Decode javascript_view_footer. $item->javascript_view_footer = base64_decode($item->javascript_view_footer); } + if (!empty($item->css_views)) + { + // base64 Decode css_views. + $item->css_views = base64_decode($item->css_views); + } + if (!empty($item->javascript_views_footer)) { // base64 Decode javascript_views_footer. @@ -308,14 +308,14 @@ class ComponentbuilderModelField extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { @@ -415,6 +415,13 @@ class ComponentbuilderModelField extends JModelAdmin $form->setFieldAttribute($name, 'editor', $global_editor . '|none'); } } + + + // Only load the GUID if new item + if (0 == $id) + { + $form->setValue('guid', null, ComponentbuilderHelper::GUID()); + } return $form; } @@ -1132,7 +1139,14 @@ class ComponentbuilderModelField extends JModelAdmin { $data['xml'] = ""; } - } + } + + // Set the GUID if empty or not valid + if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'])) + { + $data['guid'] = (string) ComponentbuilderHelper::GUID(); + } + // Set the xml string to JSON string. if (isset($data['xml'])) @@ -1164,18 +1178,18 @@ class ComponentbuilderModelField extends JModelAdmin $data['css_view'] = base64_encode($data['css_view']); } - // Set the css_views string to base64 string. - if (isset($data['css_views'])) - { - $data['css_views'] = base64_encode($data['css_views']); - } - // Set the javascript_view_footer string to base64 string. if (isset($data['javascript_view_footer'])) { $data['javascript_view_footer'] = base64_encode($data['javascript_view_footer']); } + // Set the css_views string to base64 string. + if (isset($data['css_views'])) + { + $data['css_views'] = base64_encode($data['css_views']); + } + // Set the javascript_views_footer string to base64 string. if (isset($data['javascript_views_footer'])) { diff --git a/admin/models/fields.php b/admin/models/fields.php index 73ffa1358..075d73ec1 100644 --- a/admin/models/fields.php +++ b/admin/models/fields.php @@ -437,10 +437,10 @@ class ComponentbuilderModelFields extends JModelList $item->initiator_on_get_model = base64_decode($item->initiator_on_get_model); // decode css_view $item->css_view = base64_decode($item->css_view); - // decode css_views - $item->css_views = base64_decode($item->css_views); // decode javascript_view_footer $item->javascript_view_footer = base64_decode($item->javascript_view_footer); + // decode css_views + $item->css_views = base64_decode($item->css_views); // decode javascript_views_footer $item->javascript_views_footer = base64_decode($item->javascript_views_footer); // decode initiator_on_save_model diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php index 8915a5957..c0eb66434 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -450,14 +450,14 @@ class ComponentbuilderModelFieldtype extends JModelAdmin { // set load data option $options['load_data'] = $loadData; - // // check if xpath was set in options + // check if xpath was set in options $xpath = false; if (isset($options['xpath'])) { $xpath = $options['xpath']; unset($options['xpath']); } - // // check if clear form was set in options + // check if clear form was set in options $clear = false; if (isset($options['clear'])) { @@ -541,6 +541,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin $form->setValue($redirectedField, null, $redirectedValue); } } + + // Only load the GUID if new item + if (0 == $id) + { + $form->setValue('guid', null, ComponentbuilderHelper::GUID()); + } + return $form; } @@ -1186,6 +1193,14 @@ class ComponentbuilderModelFieldtype extends JModelAdmin $data['metadata'] = (string) $metadata; } + + // Set the GUID if empty or not valid + if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid'])) + { + $data['guid'] = (string) ComponentbuilderHelper::GUID(); + } + + // Set the properties items to data. if (isset($data['properties']) && is_array($data['properties'])) { diff --git a/admin/models/forms/admin_view.xml b/admin/models/forms/admin_view.xml index 41b154bc2..184b247d8 100644 --- a/admin/models/forms/admin_view.xml +++ b/admin/models/forms/admin_view.xml @@ -129,62 +129,70 @@ message="COM_COMPONENTBUILDER_ADMIN_VIEW_SHORT_DESCRIPTION_MESSAGE" hint="COM_COMPONENTBUILDER_ADMIN_VIEW_SHORT_DESCRIPTION_HINT" /> - + - - - - - + type="editor" + name="php_before_cancel" + label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_CANCEL_LABEL" + description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_CANCEL_DESCRIPTION" + width="100%" + height="450px" + cols="15" + rows="30" + buttons="no" + syntax="php" + editor="codemirror|none" + filter="raw" + validate="code" + /> + - - - - - + type="editor" + name="php_allowadd" + label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_ALLOWADD_LABEL" + description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_ALLOWADD_DESCRIPTION" + width="100%" + height="450px" + cols="15" + rows="30" + buttons="no" + syntax="php" + editor="codemirror|none" + filter="raw" + validate="code" + /> + - - - - - + type="editor" + name="php_save" + label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_SAVE_LABEL" + description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_SAVE_DESCRIPTION" + width="100%" + height="450px" + cols="15" + rows="30" + buttons="no" + syntax="php" + editor="codemirror|none" + filter="raw" + validate="code" + /> + - - - - + type="editor" + name="php_getform" + label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETFORM_LABEL" + description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETFORM_DESCRIPTION" + width="100%" + height="450px" + cols="15" + rows="30" + buttons="no" + syntax="php" + editor="codemirror|none" + filter="raw" + validate="code" + /> + + - + - - - - + type="editor" + name="php_before_delete" + label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_DELETE_LABEL" + description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_DELETE_DESCRIPTION" + width="100%" + height="450px" + cols="15" + rows="30" + buttons="no" + syntax="php" + editor="codemirror|none" + filter="raw" + validate="code" + /> @@ -267,520 +290,60 @@ description="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_ADD_DESCRIPTION" directory="" /> - + - - - - - + type="editor" + name="php_batchcopy" + label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHCOPY_LABEL" + description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHCOPY_DESCRIPTION" + width="100%" + height="450px" + cols="15" + rows="30" + buttons="no" + syntax="php" + editor="codemirror|none" + filter="raw" + validate="code" + /> + + default="DYNAMIC"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + COM_COMPONENTBUILDER_ADMIN_VIEW_OMIT + + + + - + - - - - - - - - - - + type="editor" + name="php_before_publish" + label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_PUBLISH_LABEL" + description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_PUBLISH_DESCRIPTION" + width="100%" + height="450px" + cols="15" + rows="30" + buttons="no" + syntax="php" + editor="codemirror|none" + filter="raw" + validate="code" + /> COM_COMPONENTBUILDER_ADMIN_VIEW_READONLY - + -