From d7b555e7af5fc7ab180f495b56c72479a8ef17a1 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 3 May 2019 01:00:05 +0200 Subject: [PATCH] Resolved gh-410 to allow default data type values for the database to be set per fieldtype. --- README.md | 12 +- admin/README.txt | 12 +- admin/access.xml | 8 - admin/helpers/componentbuilder.php | 27 +- .../en-GB/en-GB.com_componentbuilder.ini | 91 +- .../en-GB/en-GB.com_componentbuilder.sys.ini | 8 - ...e_fullwidth.php => database_fullwidth.php} | 0 .../{data_base_left.php => database_left.php} | 0 ...data_base_right.php => database_right.php} | 0 .../fieldtype/database_defaults_left.php | 34 + .../fieldtype/database_defaults_right.php | 32 + admin/layouts/fieldtype/details_above.php | 31 + admin/layouts/fieldtype/details_fullwidth.php | 3 +- admin/layouts/fieldtype/details_left.php | 1 - admin/layouts/fieldtype/fields_fullwidth.php | 2 +- .../server/linked_components_fullwidth.php | 2 +- admin/models/ajax.php | 2 +- admin/models/fieldtype.php | 121 +-- admin/models/fieldtypes.php | 2 +- admin/models/forms/field.js | 35 +- admin/models/forms/fieldtype.js | 792 ++++++++++++++++++ admin/models/forms/fieldtype.xml | 243 +++++- admin/models/forms/help_document.js | 174 ++-- admin/models/forms/server.js | 346 ++++---- admin/models/server.php | 2 +- admin/sql/install.mysql.utf8.sql | 19 +- admin/sql/updates/mysql/2.9.15.sql | 9 + admin/views/field/tmpl/edit.php | 10 +- admin/views/fieldtype/tmpl/edit.php | 374 ++++++++- admin/views/fieldtype/view.html.php | 2 +- admin/views/help_document/tmpl/edit.php | 60 +- admin/views/server/tmpl/edit.php | 132 +-- admin/views/server/view.html.php | 2 +- componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 19 +- script.php | 10 +- site/helpers/componentbuilder.php | 27 +- 37 files changed, 2138 insertions(+), 512 deletions(-) rename admin/layouts/field/{data_base_fullwidth.php => database_fullwidth.php} (100%) rename admin/layouts/field/{data_base_left.php => database_left.php} (100%) rename admin/layouts/field/{data_base_right.php => database_right.php} (100%) create mode 100644 admin/layouts/fieldtype/database_defaults_left.php create mode 100644 admin/layouts/fieldtype/database_defaults_right.php create mode 100644 admin/layouts/fieldtype/details_above.php create mode 100644 admin/sql/updates/mysql/2.9.15.sql diff --git a/README.md b/README.md index 9a15630de..bbec7e4f4 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.9.15) 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.9.16) 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) @@ -146,13 +146,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*: 27th April, 2019 -+ *Version*: 2.9.15 ++ *Last Build*: 2nd May, 2019 ++ *Version*: 2.9.16 + *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*: **203769** -+ *Field count*: **1119** -+ *File count*: **1338** ++ *Line count*: **205393** ++ *Field count*: **1130** ++ *File count*: **1342** + *Folder count*: **209** > 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 9a15630de..bbec7e4f4 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.9.15) 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.9.16) 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) @@ -146,13 +146,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*: 27th April, 2019 -+ *Version*: 2.9.15 ++ *Last Build*: 2nd May, 2019 ++ *Version*: 2.9.16 + *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*: **203769** -+ *Field count*: **1119** -+ *File count*: **1338** ++ *Line count*: **205393** ++ *Field count*: **1130** ++ *File count*: **1342** + *Folder count*: **209** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/access.xml b/admin/access.xml index c78fd341a..8bfa040e9 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -234,11 +234,7 @@ - - - - @@ -552,10 +548,6 @@ - - - -
diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 98efa2efa..f710fb68a 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -1405,7 +1405,13 @@ abstract class ComponentbuilderHelper } - public static function getFieldOptions($value, $type, $settings = array(), $xml = null) + /** + * get field options + * + * @return array on success + * + */ + public static function getFieldOptions($value, $type, $settings = array(), $xml = null, $db_defaults = false) { // Get a db connection. $db = JFactory::getDbo(); @@ -1413,6 +1419,11 @@ abstract class ComponentbuilderHelper // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('properties', 'short_description', 'description'))); + // load database default values + if ($db_defaults) + { + $query->select($db->quoteName(array('datadefault', 'datadefault_other', 'datalenght', 'datalenght_other', 'datatype', 'has_defaults', 'indexes', 'null_switch', 'store'))); + } $query->from($db->quoteName('#__componentbuilder_fieldtype')); $query->where($db->quoteName('published') . ' = 1'); $query->where($db->quoteName($type) . ' = '. $value); @@ -1525,6 +1536,20 @@ abstract class ComponentbuilderHelper } $field['values'] .= PHP_EOL . "/>"; $field['values_description'] .= ''; + // load the database defaults if set and wanted + if ($db_defaults && isset($result->has_defaults) && $result->has_defaults == 1) + { + $field['database'] = array( + 'datatype' => $result->datatype, + 'datadefault' => $result->datadefault, + 'datadefault_other' => $result->datadefault_other, + 'datalenght' => $result->datalenght, + 'datalenght_other' => $result->datalenght_other, + 'indexes' => $result->indexes, + 'null_switch' => $result->null_switch, + 'store' => $result->store + ); + } // return found field options return $field; } diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 1f033d126..57af20c7e 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -4317,16 +4317,8 @@ COM_COMPONENTBUILDER_FIELDTYPES_DELETE="Fieldtypes Delete" COM_COMPONENTBUILDER_FIELDTYPES_DELETE_DESC="Allows the users in this group to delete delete fieldtypes" COM_COMPONENTBUILDER_FIELDTYPES_EDIT="Fieldtypes Edit" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESC="Allows the users in this group to edit the fieldtype" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESCRIPTION="Fieldtypes Edit Description" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESCRIPTION_DESC="Allows the users in this group to edit description of fieldtype" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_NAME="Fieldtypes Edit Name" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_NAME_DESC="Allows the users in this group to edit name of fieldtype" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_OWN="Fieldtypes Edit Own" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_OWN_DESC="Allows the users in this group to edit edit own fieldtypes created by them" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_PROPERTIES="Fieldtypes Edit Properties" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_PROPERTIES_DESC="Allows the users in this group to edit properties of fieldtype" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_SHORT_DESCRIPTION="Fieldtypes Edit Short Description" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_SHORT_DESCRIPTION_DESC="Allows the users in this group to edit short description of fieldtype" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_STATE="Fieldtypes Edit State" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_STATE_DESC="Allows the users in this group to update the state of the fieldtype" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_VERSION="Fieldtypes Edit Version" @@ -4356,18 +4348,50 @@ COM_COMPONENTBUILDER_FIELDTYPES_SUBMENU="Fieldtypes Submenu" COM_COMPONENTBUILDER_FIELDTYPES_SUBMENU_DESC="Allows the users in this group to submenu of fieldtype" COM_COMPONENTBUILDER_FIELDTYPE_ADJUSTABLE_DESCRIPTION="Select if the value is adjustable.
If not the Value/Example will be enforced." COM_COMPONENTBUILDER_FIELDTYPE_ADJUSTABLE_LABEL="Adjustable" +COM_COMPONENTBUILDER_FIELDTYPE_BASESIXTY_FOUR="base64" +COM_COMPONENTBUILDER_FIELDTYPE_BASIC_ENCRYPTION_LOCALDBKEY="Basic Encryption (local-DB-key)" +COM_COMPONENTBUILDER_FIELDTYPE_BIGINT="BIGINT" +COM_COMPONENTBUILDER_FIELDTYPE_BLOB="BLOB" COM_COMPONENTBUILDER_FIELDTYPE_CATID_DESCRIPTION="select one of the following categories" COM_COMPONENTBUILDER_FIELDTYPE_CATID_LABEL="Category" +COM_COMPONENTBUILDER_FIELDTYPE_CHAR="CHAR" COM_COMPONENTBUILDER_FIELDTYPE_CREATED_BY_DESC="The user that created this Fieldtype." COM_COMPONENTBUILDER_FIELDTYPE_CREATED_BY_LABEL="Created By" COM_COMPONENTBUILDER_FIELDTYPE_CREATED_DATE_DESC="The date this Fieldtype was created." COM_COMPONENTBUILDER_FIELDTYPE_CREATED_DATE_LABEL="Created Date" +COM_COMPONENTBUILDER_FIELDTYPE_CURRENT_TIMESTAMP="CURRENT_TIMESTAMP" +COM_COMPONENTBUILDER_FIELDTYPE_DATABASE_DEFAULTS="Database (defaults)" +COM_COMPONENTBUILDER_FIELDTYPE_DATADEFAULT="Datadefault" +COM_COMPONENTBUILDER_FIELDTYPE_DATADEFAULT_DESCRIPTION="The data default value for mysql" +COM_COMPONENTBUILDER_FIELDTYPE_DATADEFAULT_LABEL="Data Default" +COM_COMPONENTBUILDER_FIELDTYPE_DATADEFAULT_OTHER="Datadefault Other" +COM_COMPONENTBUILDER_FIELDTYPE_DATADEFAULT_OTHER_DESCRIPTION="The other default data for mysql" +COM_COMPONENTBUILDER_FIELDTYPE_DATADEFAULT_OTHER_HINT="Other Default Here" +COM_COMPONENTBUILDER_FIELDTYPE_DATADEFAULT_OTHER_LABEL="Other Default" +COM_COMPONENTBUILDER_FIELDTYPE_DATADEFAULT_OTHER_MESSAGE="Error! Please add other default here." +COM_COMPONENTBUILDER_FIELDTYPE_DATALENGHT="Datalenght" +COM_COMPONENTBUILDER_FIELDTYPE_DATALENGHT_DESCRIPTION="The data length or value for mysql (size)" +COM_COMPONENTBUILDER_FIELDTYPE_DATALENGHT_LABEL="Data Length/Values" +COM_COMPONENTBUILDER_FIELDTYPE_DATALENGHT_OTHER="Datalenght Other" +COM_COMPONENTBUILDER_FIELDTYPE_DATALENGHT_OTHER_DESCRIPTION="The other data length/values for mysql" +COM_COMPONENTBUILDER_FIELDTYPE_DATALENGHT_OTHER_HINT="Other Here" +COM_COMPONENTBUILDER_FIELDTYPE_DATALENGHT_OTHER_LABEL="Other" +COM_COMPONENTBUILDER_FIELDTYPE_DATALENGHT_OTHER_MESSAGE="Error! Please add other data length/values here." +COM_COMPONENTBUILDER_FIELDTYPE_DATATYPE="Datatype" +COM_COMPONENTBUILDER_FIELDTYPE_DATATYPE_DESCRIPTION="The data type for mysql" +COM_COMPONENTBUILDER_FIELDTYPE_DATATYPE_LABEL="Data Type" +COM_COMPONENTBUILDER_FIELDTYPE_DATE="DATE" +COM_COMPONENTBUILDER_FIELDTYPE_DATETIME="DATETIME" +COM_COMPONENTBUILDER_FIELDTYPE_DECIMAL="DECIMAL" +COM_COMPONENTBUILDER_FIELDTYPE_DEFAULT="Default" COM_COMPONENTBUILDER_FIELDTYPE_DESCRIPTION="Description" COM_COMPONENTBUILDER_FIELDTYPE_DESCRIPTION_DESCRIPTION="Add Description Here" COM_COMPONENTBUILDER_FIELDTYPE_DESCRIPTION_HINT="Add Description Here" COM_COMPONENTBUILDER_FIELDTYPE_DESCRIPTION_LABEL="Description" COM_COMPONENTBUILDER_FIELDTYPE_DETAILS="Details" +COM_COMPONENTBUILDER_FIELDTYPE_DOUBLE="DOUBLE" COM_COMPONENTBUILDER_FIELDTYPE_EDIT="Editing the Fieldtype" +COM_COMPONENTBUILDER_FIELDTYPE_ELEVEN="11" COM_COMPONENTBUILDER_FIELDTYPE_ERROR_UNIQUE_ALIAS="Another Fieldtype has the same alias." COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_DESCRIPTION="Text Area" COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_HINT="Value/Example Here" @@ -4375,9 +4399,24 @@ COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_LABEL="Value/Example" COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_MESSAGE="Error! Please add value/example here." COM_COMPONENTBUILDER_FIELDTYPE_FIELDS="Fields" COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPE_CATEGORY="Fieldtype Category" +COM_COMPONENTBUILDER_FIELDTYPE_FIFTY="50" +COM_COMPONENTBUILDER_FIELDTYPE_FLOAT="FLOAT" +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" COM_COMPONENTBUILDER_FIELDTYPE_ID="Id" +COM_COMPONENTBUILDER_FIELDTYPE_INDEXES="Indexes" +COM_COMPONENTBUILDER_FIELDTYPE_INDEXES_LABEL="Indexes Type" +COM_COMPONENTBUILDER_FIELDTYPE_INT="INT" +COM_COMPONENTBUILDER_FIELDTYPE_JSON="JSON" +COM_COMPONENTBUILDER_FIELDTYPE_KEY="KEY" +COM_COMPONENTBUILDER_FIELDTYPE_LONGBLOB="LONGBLOB" +COM_COMPONENTBUILDER_FIELDTYPE_LONGTEXT="LONGTEXT" COM_COMPONENTBUILDER_FIELDTYPE_MANDATORY_DESCRIPTION="Select if the property
is mandatory." COM_COMPONENTBUILDER_FIELDTYPE_MANDATORY_LABEL="Mandatory" +COM_COMPONENTBUILDER_FIELDTYPE_MEDIUMBLOB="MEDIUMBLOB" +COM_COMPONENTBUILDER_FIELDTYPE_MEDIUMTEXT="MEDIUMTEXT" +COM_COMPONENTBUILDER_FIELDTYPE_MEDIUM_ENCRYPTION_LOCALFILEKEY="Medium Encryption (local-file-key)" COM_COMPONENTBUILDER_FIELDTYPE_MODIFIED_BY_DESC="The last user that modified this Fieldtype." COM_COMPONENTBUILDER_FIELDTYPE_MODIFIED_BY_LABEL="Modified By" COM_COMPONENTBUILDER_FIELDTYPE_MODIFIED_DATE_DESC="The date this Fieldtype was modified." @@ -4388,25 +4427,59 @@ COM_COMPONENTBUILDER_FIELDTYPE_NAME_HINT="Name Here" COM_COMPONENTBUILDER_FIELDTYPE_NAME_LABEL="Name" COM_COMPONENTBUILDER_FIELDTYPE_NAME_MESSAGE="Error! Please add name here." COM_COMPONENTBUILDER_FIELDTYPE_NEW="A New Fieldtype" +COM_COMPONENTBUILDER_FIELDTYPE_NO="No" +COM_COMPONENTBUILDER_FIELDTYPE_NONE="None" +COM_COMPONENTBUILDER_FIELDTYPE_NONE_SET="None Set" COM_COMPONENTBUILDER_FIELDTYPE_NOTE_ON_FIELDS_DESCRIPTION="To get more form field settings go to https://docs.joomla.org/Form_field" COM_COMPONENTBUILDER_FIELDTYPE_NOTE_ON_FIELDS_LABEL="More Standard form field types" +COM_COMPONENTBUILDER_FIELDTYPE_NOTE_WHMCS_ENCRYPTION_DESCRIPTION="

When using the WHMCS encryption you need to get a WHMCS key from:
https://www.vdm.io, or your own WHMCS install.

Please note that you will need to enable the add-on in the Joomla Component area (Add WHMCS)->Yes.

You can get more info about the WHMCS licensing add-on at the following links.

Helpful Links:
+https://www.whmcs.com/software-licensing/
+http://docs.whmcs.com/Licensing_Addon/

Support JCB and use our affiliate link (https://www.whmcs.com/members/aff.php?aff=37513) to sign-up with WHMCS.

" +COM_COMPONENTBUILDER_FIELDTYPE_NOTE_WHMCS_ENCRYPTION_LABEL="The WHMCS Encryption" +COM_COMPONENTBUILDER_FIELDTYPE_NOT_NULL="NOT NULL" +COM_COMPONENTBUILDER_FIELDTYPE_NOT_REQUIRED="Not Required" +COM_COMPONENTBUILDER_FIELDTYPE_NULL="NULL" +COM_COMPONENTBUILDER_FIELDTYPE_NULL_SWITCH="Null Switch" +COM_COMPONENTBUILDER_FIELDTYPE_NULL_SWITCH_LABEL="Null Switch" +COM_COMPONENTBUILDER_FIELDTYPE_ONE="1" +COM_COMPONENTBUILDER_FIELDTYPE_ONE_HUNDRED="100" +COM_COMPONENTBUILDER_FIELDTYPE_ONE_THOUSAND_AND_TWENTY_FOUR="1024" COM_COMPONENTBUILDER_FIELDTYPE_ORDERING_LABEL="Ordering" +COM_COMPONENTBUILDER_FIELDTYPE_OTHER="Other" COM_COMPONENTBUILDER_FIELDTYPE_PERMISSION="Permissions" COM_COMPONENTBUILDER_FIELDTYPE_PROPERTIES="Properties" COM_COMPONENTBUILDER_FIELDTYPE_PROPERTIES_DESCRIPTION="Options for this field" COM_COMPONENTBUILDER_FIELDTYPE_PROPERTIES_LABEL="Properties" COM_COMPONENTBUILDER_FIELDTYPE_PUBLISHING="Publishing" COM_COMPONENTBUILDER_FIELDTYPE_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Fieldtype to customise the alias." +COM_COMPONENTBUILDER_FIELDTYPE_SELECT_AN_OPTION="Select an option" +COM_COMPONENTBUILDER_FIELDTYPE_SEVEN="7" COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION="Short Description" COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_DESCRIPTION="Enter short description" COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_HINT="Your Short Description Here" COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_LABEL="Short Description" COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_MESSAGE="Error! Please add some short description here." +COM_COMPONENTBUILDER_FIELDTYPE_SIXTY_FOUR="64" COM_COMPONENTBUILDER_FIELDTYPE_STATUS="Status" +COM_COMPONENTBUILDER_FIELDTYPE_STORE="Store" +COM_COMPONENTBUILDER_FIELDTYPE_STORE_DESCRIPTION="How should the data be stored." +COM_COMPONENTBUILDER_FIELDTYPE_STORE_LABEL="Store Method" +COM_COMPONENTBUILDER_FIELDTYPE_TEN="10" +COM_COMPONENTBUILDER_FIELDTYPE_TEXT="TEXT" +COM_COMPONENTBUILDER_FIELDTYPE_TIME="TIME" +COM_COMPONENTBUILDER_FIELDTYPE_TINYBLOB="TINYBLOB" +COM_COMPONENTBUILDER_FIELDTYPE_TINYINT="TINYINT" COM_COMPONENTBUILDER_FIELDTYPE_TRANSLATABLE_DESCRIPTION="Select if the property is translatable." COM_COMPONENTBUILDER_FIELDTYPE_TRANSLATABLE_LABEL="Translatable" +COM_COMPONENTBUILDER_FIELDTYPE_TWO_HUNDRED_AND_FIFTY_FIVE="255" +COM_COMPONENTBUILDER_FIELDTYPE_TWO_THOUSAND_AND_FORTY_EIGHT="2048" +COM_COMPONENTBUILDER_FIELDTYPE_UNIQUE_KEY="UNIQUE KEY" +COM_COMPONENTBUILDER_FIELDTYPE_VARCHAR="VARCHAR" COM_COMPONENTBUILDER_FIELDTYPE_VERSION_DESC="A count of the number of times this Fieldtype has been revised." COM_COMPONENTBUILDER_FIELDTYPE_VERSION_LABEL="Revision" +COM_COMPONENTBUILDER_FIELDTYPE_WHMCSKEY_ENCRYPTION="WHMCS-key Encryption" +COM_COMPONENTBUILDER_FIELDTYPE_YES="Yes" +COM_COMPONENTBUILDER_FIELDTYPE_ZERO="0" COM_COMPONENTBUILDER_FIELD_ADD_CSS_VIEW="Add Css View" COM_COMPONENTBUILDER_FIELD_ADD_CSS_VIEWS="Add Css Views" COM_COMPONENTBUILDER_FIELD_ADD_CSS_VIEWS_LABEL="Add CSS (views)" @@ -4434,6 +4507,7 @@ COM_COMPONENTBUILDER_FIELD_CSS_VIEWS_LABEL="CSS" COM_COMPONENTBUILDER_FIELD_CSS_VIEW_DESCRIPTION="Add CSS for the edit view. Do not add the style tags." COM_COMPONENTBUILDER_FIELD_CSS_VIEW_LABEL="CSS" COM_COMPONENTBUILDER_FIELD_CURRENT_TIMESTAMP="CURRENT_TIMESTAMP" +COM_COMPONENTBUILDER_FIELD_DATABASE="Database" COM_COMPONENTBUILDER_FIELD_DATADEFAULT="Datadefault" COM_COMPONENTBUILDER_FIELD_DATADEFAULT_DESCRIPTION="The data default value for mysql" COM_COMPONENTBUILDER_FIELD_DATADEFAULT_LABEL="Data Default" @@ -4453,7 +4527,6 @@ COM_COMPONENTBUILDER_FIELD_DATALENGHT_OTHER_MESSAGE="Error! Please add other dat COM_COMPONENTBUILDER_FIELD_DATATYPE="Datatype" COM_COMPONENTBUILDER_FIELD_DATATYPE_DESCRIPTION="The data type for mysql" COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL="Data Type" -COM_COMPONENTBUILDER_FIELD_DATA_BASE="Data Base" COM_COMPONENTBUILDER_FIELD_DATE="DATE" COM_COMPONENTBUILDER_FIELD_DATETIME="DATETIME" COM_COMPONENTBUILDER_FIELD_DECIMAL="DECIMAL" diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini index 8a2e9fd9f..7cb2361b6 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini @@ -454,16 +454,8 @@ COM_COMPONENTBUILDER_FIELDTYPES_DELETE="Fieldtypes Delete" COM_COMPONENTBUILDER_FIELDTYPES_DELETE_DESC="Allows the users in this group to delete delete fieldtypes" COM_COMPONENTBUILDER_FIELDTYPES_EDIT="Fieldtypes Edit" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESC="Allows the users in this group to edit the fieldtype" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESCRIPTION="Fieldtypes Edit Description" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_DESCRIPTION_DESC="Allows the users in this group to edit description of fieldtype" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_NAME="Fieldtypes Edit Name" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_NAME_DESC="Allows the users in this group to edit name of fieldtype" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_OWN="Fieldtypes Edit Own" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_OWN_DESC="Allows the users in this group to edit edit own fieldtypes created by them" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_PROPERTIES="Fieldtypes Edit Properties" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_PROPERTIES_DESC="Allows the users in this group to edit properties of fieldtype" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_SHORT_DESCRIPTION="Fieldtypes Edit Short Description" -COM_COMPONENTBUILDER_FIELDTYPES_EDIT_SHORT_DESCRIPTION_DESC="Allows the users in this group to edit short description of fieldtype" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_STATE="Fieldtypes Edit State" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_STATE_DESC="Allows the users in this group to update the state of the fieldtype" COM_COMPONENTBUILDER_FIELDTYPES_EDIT_VERSION="Fieldtypes Edit Version" diff --git a/admin/layouts/field/data_base_fullwidth.php b/admin/layouts/field/database_fullwidth.php similarity index 100% rename from admin/layouts/field/data_base_fullwidth.php rename to admin/layouts/field/database_fullwidth.php diff --git a/admin/layouts/field/data_base_left.php b/admin/layouts/field/database_left.php similarity index 100% rename from admin/layouts/field/data_base_left.php rename to admin/layouts/field/database_left.php diff --git a/admin/layouts/field/data_base_right.php b/admin/layouts/field/database_right.php similarity index 100% rename from admin/layouts/field/data_base_right.php rename to admin/layouts/field/database_right.php diff --git a/admin/layouts/fieldtype/database_defaults_left.php b/admin/layouts/fieldtype/database_defaults_left.php new file mode 100644 index 000000000..c47a0b0db --- /dev/null +++ b/admin/layouts/fieldtype/database_defaults_left.php @@ -0,0 +1,34 @@ + + * @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('_JEXEC') or die('Restricted access'); + +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'has_defaults', + 'datatype', + 'datalenght', + 'datalenght_other', + 'datadefault', + 'datadefault_other' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/fieldtype/database_defaults_right.php b/admin/layouts/fieldtype/database_defaults_right.php new file mode 100644 index 000000000..738776e97 --- /dev/null +++ b/admin/layouts/fieldtype/database_defaults_right.php @@ -0,0 +1,32 @@ + + * @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('_JEXEC') or die('Restricted access'); + +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'indexes', + 'null_switch', + 'store', + 'note_whmcs_encryption' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/fieldtype/details_above.php b/admin/layouts/fieldtype/details_above.php new file mode 100644 index 000000000..1fb957c8f --- /dev/null +++ b/admin/layouts/fieldtype/details_above.php @@ -0,0 +1,31 @@ + + * @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('_JEXEC') or die('Restricted access'); + +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'name' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
diff --git a/admin/layouts/fieldtype/details_fullwidth.php b/admin/layouts/fieldtype/details_fullwidth.php index fee285cf4..1666a0816 100644 --- a/admin/layouts/fieldtype/details_fullwidth.php +++ b/admin/layouts/fieldtype/details_fullwidth.php @@ -16,7 +16,8 @@ $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( 'note_on_fields', - 'properties' + 'properties', + 'not_required' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); diff --git a/admin/layouts/fieldtype/details_left.php b/admin/layouts/fieldtype/details_left.php index 33b2be88d..ce4ad69ad 100644 --- a/admin/layouts/fieldtype/details_left.php +++ b/admin/layouts/fieldtype/details_left.php @@ -15,7 +15,6 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( - 'name', 'catid', 'short_description' ); diff --git a/admin/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php index 11893785e..1f3953212 100644 --- a/admin/layouts/fieldtype/fields_fullwidth.php +++ b/admin/layouts/fieldtype/fields_fullwidth.php @@ -13,7 +13,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->waffields; +$items = $displayData->wamfields; $user = JFactory::getUser(); $id = $displayData->item->id; // set the edit URL diff --git a/admin/layouts/server/linked_components_fullwidth.php b/admin/layouts/server/linked_components_fullwidth.php index 134bb2b45..e74ac9248 100644 --- a/admin/layouts/server/linked_components_fullwidth.php +++ b/admin/layouts/server/linked_components_fullwidth.php @@ -13,7 +13,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->waplinked_components; +$items = $displayData->wawlinked_components; $user = JFactory::getUser(); $id = $displayData->item->id; // set the edit URL diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 4140a7041..90839e748 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -2615,7 +2615,7 @@ class ComponentbuilderModelAjax extends JModelList // get the xml $xml = $this->getFieldXML($fieldtype); // now get the field options - if ($field = ComponentbuilderHelper::getFieldOptions($fieldtype, 'id', null, $xml)) + if ($field = ComponentbuilderHelper::getFieldOptions($fieldtype, 'id', null, $xml, true)) { // get subform field properties object $properties = $this->buildFieldOptionsSubform($field['subform'], $field['nameListOptions']); diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php index 9eba9cea6..40c90c7cf 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -155,7 +155,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getWaffields() + public function getWamfields() { // Get the user object. $user = JFactory::getUser(); @@ -237,13 +237,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin foreach ($items as $nr => &$item) { // convert datatype - $item->datatype = $this->selectionTranslationWaffields($item->datatype, 'datatype'); + $item->datatype = $this->selectionTranslationWamfields($item->datatype, 'datatype'); // convert indexes - $item->indexes = $this->selectionTranslationWaffields($item->indexes, 'indexes'); + $item->indexes = $this->selectionTranslationWamfields($item->indexes, 'indexes'); // convert null_switch - $item->null_switch = $this->selectionTranslationWaffields($item->null_switch, 'null_switch'); + $item->null_switch = $this->selectionTranslationWamfields($item->null_switch, 'null_switch'); // convert store - $item->store = $this->selectionTranslationWaffields($item->store, 'store'); + $item->store = $this->selectionTranslationWamfields($item->store, 'store'); } } @@ -257,7 +257,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return translatable string */ - public function selectionTranslationWaffields($value,$name) + public function selectionTranslationWamfields($value,$name) { // Array of datatype language strings if ($name === 'datatype') @@ -410,74 +410,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin // Disable fields while saving. $form->setFieldAttribute('created', 'filter', 'unset'); } - // Modify the form based on Edit Name access controls. - if ($id != 0 && (!$user->authorise('fieldtype.edit.name', 'com_componentbuilder.fieldtype.' . (int) $id)) - || ($id == 0 && !$user->authorise('fieldtype.edit.name', 'com_componentbuilder'))) - { - // Disable fields for display. - $form->setFieldAttribute('name', 'disabled', 'true'); - // Disable fields for display. - $form->setFieldAttribute('name', 'readonly', 'true'); - // If there is no value continue. - if (!$form->getValue('name')) - { - // Disable fields while saving. - $form->setFieldAttribute('name', 'filter', 'unset'); - // Disable fields while saving. - $form->setFieldAttribute('name', 'required', 'false'); - } - } - // Modify the form based on Edit Properties access controls. - if ($id != 0 && (!$user->authorise('fieldtype.edit.properties', 'com_componentbuilder.fieldtype.' . (int) $id)) - || ($id == 0 && !$user->authorise('fieldtype.edit.properties', 'com_componentbuilder'))) - { - // Disable fields for display. - $form->setFieldAttribute('properties', 'disabled', 'true'); - // Disable fields for display. - $form->setFieldAttribute('properties', 'readonly', 'true'); - // If there is no value continue. - if (!$form->getValue('properties')) - { - // Disable fields while saving. - $form->setFieldAttribute('properties', 'filter', 'unset'); - // Disable fields while saving. - $form->setFieldAttribute('properties', 'required', 'false'); - } - } - // Modify the form based on Edit Description access controls. - if ($id != 0 && (!$user->authorise('fieldtype.edit.description', 'com_componentbuilder.fieldtype.' . (int) $id)) - || ($id == 0 && !$user->authorise('fieldtype.edit.description', 'com_componentbuilder'))) - { - // Disable fields for display. - $form->setFieldAttribute('description', 'disabled', 'true'); - // Disable fields for display. - $form->setFieldAttribute('description', 'readonly', 'true'); - // If there is no value continue. - if (!$form->getValue('description')) - { - // Disable fields while saving. - $form->setFieldAttribute('description', 'filter', 'unset'); - // Disable fields while saving. - $form->setFieldAttribute('description', 'required', 'false'); - } - } - // Modify the form based on Edit Short Description access controls. - if ($id != 0 && (!$user->authorise('fieldtype.edit.short_description', 'com_componentbuilder.fieldtype.' . (int) $id)) - || ($id == 0 && !$user->authorise('fieldtype.edit.short_description', 'com_componentbuilder'))) - { - // Disable fields for display. - $form->setFieldAttribute('short_description', 'disabled', 'true'); - // Disable fields for display. - $form->setFieldAttribute('short_description', 'readonly', 'true'); - // If there is no value continue. - if (!$form->getValue('short_description')) - { - // Disable fields while saving. - $form->setFieldAttribute('short_description', 'filter', 'unset'); - // Disable fields while saving. - $form->setFieldAttribute('short_description', 'required', 'false'); - } - } // Only load these values if no id is found if (0 == $id) { @@ -655,6 +587,42 @@ class ComponentbuilderModelFieldtype extends JModelAdmin return $data; } + /** + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ + public function validate($form, $data, $group = null) + { + // check if the not_required field is set + if (ComponentbuilderHelper::checkString($data['not_required'])) + { + $requiredFields = (array) explode(',',(string) $data['not_required']); + $requiredFields = array_unique($requiredFields); + // now change the required field attributes value + foreach ($requiredFields as $requiredField) + { + // make sure there is a string value + if (ComponentbuilderHelper::checkString($requiredField)) + { + // change to false + $form->setFieldAttribute($requiredField, 'required', 'false'); + // also clear the data set + $data[$requiredField] = ''; + } + } + } + return parent::validate($form, $data, $group); + } + /** * Method to get the unique fields of this table. * @@ -1109,10 +1077,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin $properties->loadArray($data['properties']); $data['properties'] = (string) $properties; } - // Also check permission since the value may be removed due to permissions - // Then we do not want to clear it out, but simple ignore the empty properties - elseif (!isset($data['properties']) - && JFactory::getUser()->authorise('fieldtype.edit.properties', 'com_componentbuilder')) + elseif (!isset($data['properties'])) { // Set the empty properties to data $data['properties'] = ''; diff --git a/admin/models/fieldtypes.php b/admin/models/fieldtypes.php index 320eecdd0..8d3c92d3f 100644 --- a/admin/models/fieldtypes.php +++ b/admin/models/fieldtypes.php @@ -178,7 +178,7 @@ class ComponentbuilderModelFieldtypes extends JModelList else { $search = $db->quote('%' . $db->escape($search) . '%'); - $query->where('(a.name LIKE '.$search.' OR a.description LIKE '.$search.' OR a.short_description LIKE '.$search.' OR a.catid LIKE '.$search.')'); + $query->where('(a.name LIKE '.$search.' OR a.short_description LIKE '.$search.' OR a.description LIKE '.$search.' OR a.catid LIKE '.$search.')'); } } diff --git a/admin/models/forms/field.js b/admin/models/forms/field.js index 397a57c09..2b78b4e5e 100644 --- a/admin/models/forms/field.js +++ b/admin/models/forms/field.js @@ -508,7 +508,7 @@ jQuery(document).ready(function() { // get type value var fieldtype = jQuery("#jform_fieldtype option:selected").val(); - getFieldOptions(fieldtype); + getFieldOptions(fieldtype, false); // get the linked details getLinked(); // get the validation rules @@ -540,7 +540,7 @@ function getFieldOptions_server(fieldtype){ }); } -function getFieldOptions(fieldtype){ +function getFieldOptions(fieldtype, db){ getFieldOptions_server(fieldtype).done(function(result) { if(result.subform){ // load the list of properties @@ -569,6 +569,37 @@ function getFieldOptions(fieldtype){ // set the field type info jQuery('#help').remove(); jQuery('.helpNote').append('
'+result.description+'
'+result.values_description+'
'); + // load the database properties if not set and defaults were found + if (db && result.database){ + // update datatype + jQuery('#jform_datatype').val(result.database.datatype); + jQuery('#jform_datatype').trigger("liszt:updated"); + jQuery('#jform_datatype').trigger("change"); + // update datalenght + jQuery('#jform_datalenght').val(result.database.datalenght); + jQuery('#jform_datalenght').trigger("liszt:updated"); + jQuery('#jform_datalenght').trigger("change"); + // load the datalenght_other if needed + if ('Other' == result.database.datalenght){ + jQuery('#jform_datalenght_other').val(result.database.datalenght_other); + } + // update datadefault + jQuery('#jform_datadefault').val(result.database.datadefault); + jQuery('#jform_datadefault').trigger("liszt:updated"); + jQuery('#jform_datadefault').trigger("change"); + // load the datadefault_other if needed + if ('Other' == result.database.datadefault){ + jQuery('#jform_datadefault_other').val(result.database.datadefault_other); + } + // update indexes + jQuery('#jform_indexes').val(result.database.indexes); + jQuery('#jform_indexes').trigger("liszt:updated"); + jQuery('#jform_indexes').trigger("change"); + // update store + jQuery('#jform_store').val(result.database.store); + jQuery('#jform_store').trigger("liszt:updated"); + jQuery('#jform_store').trigger("change"); + } } }) } diff --git a/admin/models/forms/fieldtype.js b/admin/models/forms/fieldtype.js index e903b1248..ee4a83411 100644 --- a/admin/models/forms/fieldtype.js +++ b/admin/models/forms/fieldtype.js @@ -8,7 +8,799 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ +// Some Global Values +jform_vvvvwbawaf_required = false; +jform_vvvvwbcwag_required = false; +jform_vvvvwbewah_required = false; +jform_vvvvwbfwai_required = false; +jform_vvvvwbgwaj_required = false; +jform_vvvvwblwak_required = false; +jform_vvvvwblwal_required = false; +// Initial Script +jQuery(document).ready(function() +{ + var datalenght_vvvvwba = jQuery("#jform_datalenght").val(); + var has_defaults_vvvvwba = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + vvvvwba(datalenght_vvvvwba,has_defaults_vvvvwba); + + var datadefault_vvvvwbc = jQuery("#jform_datadefault").val(); + var has_defaults_vvvvwbc = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + vvvvwbc(datadefault_vvvvwbc,has_defaults_vvvvwbc); + + var datatype_vvvvwbe = jQuery("#jform_datatype").val(); + var has_defaults_vvvvwbe = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + vvvvwbe(datatype_vvvvwbe,has_defaults_vvvvwbe); + + var has_defaults_vvvvwbf = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + var datatype_vvvvwbf = jQuery("#jform_datatype").val(); + vvvvwbf(has_defaults_vvvvwbf,datatype_vvvvwbf); + + var datatype_vvvvwbg = jQuery("#jform_datatype").val(); + var has_defaults_vvvvwbg = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + vvvvwbg(datatype_vvvvwbg,has_defaults_vvvvwbg); + + var store_vvvvwbi = jQuery("#jform_store").val(); + var datatype_vvvvwbi = jQuery("#jform_datatype").val(); + var has_defaults_vvvvwbi = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + vvvvwbi(store_vvvvwbi,datatype_vvvvwbi,has_defaults_vvvvwbi); + + var datatype_vvvvwbj = jQuery("#jform_datatype").val(); + var store_vvvvwbj = jQuery("#jform_store").val(); + var has_defaults_vvvvwbj = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + vvvvwbj(datatype_vvvvwbj,store_vvvvwbj,has_defaults_vvvvwbj); + + var has_defaults_vvvvwbk = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + var store_vvvvwbk = jQuery("#jform_store").val(); + var datatype_vvvvwbk = jQuery("#jform_datatype").val(); + vvvvwbk(has_defaults_vvvvwbk,store_vvvvwbk,datatype_vvvvwbk); + + var has_defaults_vvvvwbl = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + vvvvwbl(has_defaults_vvvvwbl); +}); + +// the vvvvwba function +function vvvvwba(datalenght_vvvvwba,has_defaults_vvvvwba) +{ + if (isSet(datalenght_vvvvwba) && datalenght_vvvvwba.constructor !== Array) + { + var temp_vvvvwba = datalenght_vvvvwba; + var datalenght_vvvvwba = []; + datalenght_vvvvwba.push(temp_vvvvwba); + } + else if (!isSet(datalenght_vvvvwba)) + { + var datalenght_vvvvwba = []; + } + var datalenght = datalenght_vvvvwba.some(datalenght_vvvvwba_SomeFunc); + + if (isSet(has_defaults_vvvvwba) && has_defaults_vvvvwba.constructor !== Array) + { + var temp_vvvvwba = has_defaults_vvvvwba; + var has_defaults_vvvvwba = []; + has_defaults_vvvvwba.push(temp_vvvvwba); + } + else if (!isSet(has_defaults_vvvvwba)) + { + var has_defaults_vvvvwba = []; + } + var has_defaults = has_defaults_vvvvwba.some(has_defaults_vvvvwba_SomeFunc); + + + // set this function logic + if (datalenght && has_defaults) + { + jQuery('#jform_datalenght_other').closest('.control-group').show(); + // add required attribute to datalenght_other field + if (jform_vvvvwbawaf_required) + { + updateFieldRequired('datalenght_other',0); + jQuery('#jform_datalenght_other').prop('required','required'); + jQuery('#jform_datalenght_other').attr('aria-required',true); + jQuery('#jform_datalenght_other').addClass('required'); + jform_vvvvwbawaf_required = false; + } + } + else + { + jQuery('#jform_datalenght_other').closest('.control-group').hide(); + // remove required attribute from datalenght_other field + if (!jform_vvvvwbawaf_required) + { + updateFieldRequired('datalenght_other',1); + jQuery('#jform_datalenght_other').removeAttr('required'); + jQuery('#jform_datalenght_other').removeAttr('aria-required'); + jQuery('#jform_datalenght_other').removeClass('required'); + jform_vvvvwbawaf_required = true; + } + } +} + +// the vvvvwba Some function +function datalenght_vvvvwba_SomeFunc(datalenght_vvvvwba) +{ + // set the function logic + if (datalenght_vvvvwba == 'Other') + { + return true; + } + return false; +} + +// the vvvvwba Some function +function has_defaults_vvvvwba_SomeFunc(has_defaults_vvvvwba) +{ + // set the function logic + if (has_defaults_vvvvwba == 1) + { + return true; + } + return false; +} + +// the vvvvwbc function +function vvvvwbc(datadefault_vvvvwbc,has_defaults_vvvvwbc) +{ + if (isSet(datadefault_vvvvwbc) && datadefault_vvvvwbc.constructor !== Array) + { + var temp_vvvvwbc = datadefault_vvvvwbc; + var datadefault_vvvvwbc = []; + datadefault_vvvvwbc.push(temp_vvvvwbc); + } + else if (!isSet(datadefault_vvvvwbc)) + { + var datadefault_vvvvwbc = []; + } + var datadefault = datadefault_vvvvwbc.some(datadefault_vvvvwbc_SomeFunc); + + if (isSet(has_defaults_vvvvwbc) && has_defaults_vvvvwbc.constructor !== Array) + { + var temp_vvvvwbc = has_defaults_vvvvwbc; + var has_defaults_vvvvwbc = []; + has_defaults_vvvvwbc.push(temp_vvvvwbc); + } + else if (!isSet(has_defaults_vvvvwbc)) + { + var has_defaults_vvvvwbc = []; + } + var has_defaults = has_defaults_vvvvwbc.some(has_defaults_vvvvwbc_SomeFunc); + + + // set this function logic + if (datadefault && has_defaults) + { + jQuery('#jform_datadefault_other').closest('.control-group').show(); + // add required attribute to datadefault_other field + if (jform_vvvvwbcwag_required) + { + updateFieldRequired('datadefault_other',0); + jQuery('#jform_datadefault_other').prop('required','required'); + jQuery('#jform_datadefault_other').attr('aria-required',true); + jQuery('#jform_datadefault_other').addClass('required'); + jform_vvvvwbcwag_required = false; + } + } + else + { + jQuery('#jform_datadefault_other').closest('.control-group').hide(); + // remove required attribute from datadefault_other field + if (!jform_vvvvwbcwag_required) + { + updateFieldRequired('datadefault_other',1); + jQuery('#jform_datadefault_other').removeAttr('required'); + jQuery('#jform_datadefault_other').removeAttr('aria-required'); + jQuery('#jform_datadefault_other').removeClass('required'); + jform_vvvvwbcwag_required = true; + } + } +} + +// the vvvvwbc Some function +function datadefault_vvvvwbc_SomeFunc(datadefault_vvvvwbc) +{ + // set the function logic + if (datadefault_vvvvwbc == 'Other') + { + return true; + } + return false; +} + +// the vvvvwbc Some function +function has_defaults_vvvvwbc_SomeFunc(has_defaults_vvvvwbc) +{ + // set the function logic + if (has_defaults_vvvvwbc == 1) + { + return true; + } + return false; +} + +// the vvvvwbe function +function vvvvwbe(datatype_vvvvwbe,has_defaults_vvvvwbe) +{ + if (isSet(datatype_vvvvwbe) && datatype_vvvvwbe.constructor !== Array) + { + var temp_vvvvwbe = datatype_vvvvwbe; + var datatype_vvvvwbe = []; + datatype_vvvvwbe.push(temp_vvvvwbe); + } + else if (!isSet(datatype_vvvvwbe)) + { + var datatype_vvvvwbe = []; + } + var datatype = datatype_vvvvwbe.some(datatype_vvvvwbe_SomeFunc); + + if (isSet(has_defaults_vvvvwbe) && has_defaults_vvvvwbe.constructor !== Array) + { + var temp_vvvvwbe = has_defaults_vvvvwbe; + var has_defaults_vvvvwbe = []; + has_defaults_vvvvwbe.push(temp_vvvvwbe); + } + else if (!isSet(has_defaults_vvvvwbe)) + { + var has_defaults_vvvvwbe = []; + } + var has_defaults = has_defaults_vvvvwbe.some(has_defaults_vvvvwbe_SomeFunc); + + + // set this function logic + if (datatype && has_defaults) + { + jQuery('#jform_datadefault').closest('.control-group').show(); + jQuery('#jform_datalenght').closest('.control-group').show(); + jQuery('#jform_indexes').closest('.control-group').show(); + // add required attribute to indexes field + if (jform_vvvvwbewah_required) + { + updateFieldRequired('indexes',0); + jQuery('#jform_indexes').prop('required','required'); + jQuery('#jform_indexes').attr('aria-required',true); + jQuery('#jform_indexes').addClass('required'); + jform_vvvvwbewah_required = false; + } + } + else + { + jQuery('#jform_datadefault').closest('.control-group').hide(); + jQuery('#jform_datalenght').closest('.control-group').hide(); + jQuery('#jform_indexes').closest('.control-group').hide(); + // remove required attribute from indexes field + if (!jform_vvvvwbewah_required) + { + updateFieldRequired('indexes',1); + jQuery('#jform_indexes').removeAttr('required'); + jQuery('#jform_indexes').removeAttr('aria-required'); + jQuery('#jform_indexes').removeClass('required'); + jform_vvvvwbewah_required = true; + } + } +} + +// the vvvvwbe Some function +function datatype_vvvvwbe_SomeFunc(datatype_vvvvwbe) +{ + // set the function logic + if (datatype_vvvvwbe == 'CHAR' || datatype_vvvvwbe == 'VARCHAR' || datatype_vvvvwbe == 'DATETIME' || datatype_vvvvwbe == 'DATE' || datatype_vvvvwbe == 'TIME' || datatype_vvvvwbe == 'INT' || datatype_vvvvwbe == 'TINYINT' || datatype_vvvvwbe == 'BIGINT' || datatype_vvvvwbe == 'FLOAT' || datatype_vvvvwbe == 'DECIMAL' || datatype_vvvvwbe == 'DOUBLE') + { + return true; + } + return false; +} + +// the vvvvwbe Some function +function has_defaults_vvvvwbe_SomeFunc(has_defaults_vvvvwbe) +{ + // set the function logic + if (has_defaults_vvvvwbe == 1) + { + return true; + } + return false; +} + +// the vvvvwbf function +function vvvvwbf(has_defaults_vvvvwbf,datatype_vvvvwbf) +{ + if (isSet(has_defaults_vvvvwbf) && has_defaults_vvvvwbf.constructor !== Array) + { + var temp_vvvvwbf = has_defaults_vvvvwbf; + var has_defaults_vvvvwbf = []; + has_defaults_vvvvwbf.push(temp_vvvvwbf); + } + else if (!isSet(has_defaults_vvvvwbf)) + { + var has_defaults_vvvvwbf = []; + } + var has_defaults = has_defaults_vvvvwbf.some(has_defaults_vvvvwbf_SomeFunc); + + if (isSet(datatype_vvvvwbf) && datatype_vvvvwbf.constructor !== Array) + { + var temp_vvvvwbf = datatype_vvvvwbf; + var datatype_vvvvwbf = []; + datatype_vvvvwbf.push(temp_vvvvwbf); + } + else if (!isSet(datatype_vvvvwbf)) + { + var datatype_vvvvwbf = []; + } + var datatype = datatype_vvvvwbf.some(datatype_vvvvwbf_SomeFunc); + + + // set this function logic + if (has_defaults && datatype) + { + jQuery('#jform_datadefault').closest('.control-group').show(); + jQuery('#jform_datalenght').closest('.control-group').show(); + jQuery('#jform_indexes').closest('.control-group').show(); + // add required attribute to indexes field + if (jform_vvvvwbfwai_required) + { + updateFieldRequired('indexes',0); + jQuery('#jform_indexes').prop('required','required'); + jQuery('#jform_indexes').attr('aria-required',true); + jQuery('#jform_indexes').addClass('required'); + jform_vvvvwbfwai_required = false; + } + } + else + { + jQuery('#jform_datadefault').closest('.control-group').hide(); + jQuery('#jform_datalenght').closest('.control-group').hide(); + jQuery('#jform_indexes').closest('.control-group').hide(); + // remove required attribute from indexes field + if (!jform_vvvvwbfwai_required) + { + updateFieldRequired('indexes',1); + jQuery('#jform_indexes').removeAttr('required'); + jQuery('#jform_indexes').removeAttr('aria-required'); + jQuery('#jform_indexes').removeClass('required'); + jform_vvvvwbfwai_required = true; + } + } +} + +// the vvvvwbf Some function +function has_defaults_vvvvwbf_SomeFunc(has_defaults_vvvvwbf) +{ + // set the function logic + if (has_defaults_vvvvwbf == 1) + { + return true; + } + return false; +} + +// the vvvvwbf Some function +function datatype_vvvvwbf_SomeFunc(datatype_vvvvwbf) +{ + // set the function logic + if (datatype_vvvvwbf == 'CHAR' || datatype_vvvvwbf == 'VARCHAR' || datatype_vvvvwbf == 'DATETIME' || datatype_vvvvwbf == 'DATE' || datatype_vvvvwbf == 'TIME' || datatype_vvvvwbf == 'INT' || datatype_vvvvwbf == 'TINYINT' || datatype_vvvvwbf == 'BIGINT' || datatype_vvvvwbf == 'FLOAT' || datatype_vvvvwbf == 'DECIMAL' || datatype_vvvvwbf == 'DOUBLE') + { + return true; + } + return false; +} + +// the vvvvwbg function +function vvvvwbg(datatype_vvvvwbg,has_defaults_vvvvwbg) +{ + if (isSet(datatype_vvvvwbg) && datatype_vvvvwbg.constructor !== Array) + { + var temp_vvvvwbg = datatype_vvvvwbg; + var datatype_vvvvwbg = []; + datatype_vvvvwbg.push(temp_vvvvwbg); + } + else if (!isSet(datatype_vvvvwbg)) + { + var datatype_vvvvwbg = []; + } + var datatype = datatype_vvvvwbg.some(datatype_vvvvwbg_SomeFunc); + + if (isSet(has_defaults_vvvvwbg) && has_defaults_vvvvwbg.constructor !== Array) + { + var temp_vvvvwbg = has_defaults_vvvvwbg; + var has_defaults_vvvvwbg = []; + has_defaults_vvvvwbg.push(temp_vvvvwbg); + } + else if (!isSet(has_defaults_vvvvwbg)) + { + var has_defaults_vvvvwbg = []; + } + var has_defaults = has_defaults_vvvvwbg.some(has_defaults_vvvvwbg_SomeFunc); + + + // set this function logic + if (datatype && has_defaults) + { + jQuery('#jform_store').closest('.control-group').show(); + // add required attribute to store field + if (jform_vvvvwbgwaj_required) + { + updateFieldRequired('store',0); + jQuery('#jform_store').prop('required','required'); + jQuery('#jform_store').attr('aria-required',true); + jQuery('#jform_store').addClass('required'); + jform_vvvvwbgwaj_required = false; + } + } + else + { + jQuery('#jform_store').closest('.control-group').hide(); + // remove required attribute from store field + if (!jform_vvvvwbgwaj_required) + { + updateFieldRequired('store',1); + jQuery('#jform_store').removeAttr('required'); + jQuery('#jform_store').removeAttr('aria-required'); + jQuery('#jform_store').removeClass('required'); + jform_vvvvwbgwaj_required = true; + } + } +} + +// the vvvvwbg Some function +function datatype_vvvvwbg_SomeFunc(datatype_vvvvwbg) +{ + // set the function logic + if (datatype_vvvvwbg == 'CHAR' || datatype_vvvvwbg == 'VARCHAR' || datatype_vvvvwbg == 'TEXT' || datatype_vvvvwbg == 'MEDIUMTEXT' || datatype_vvvvwbg == 'LONGTEXT' || datatype_vvvvwbg == 'BLOB' || datatype_vvvvwbg == 'TINYBLOB' || datatype_vvvvwbg == 'MEDIUMBLOB' || datatype_vvvvwbg == 'LONGBLOB') + { + return true; + } + return false; +} + +// the vvvvwbg Some function +function has_defaults_vvvvwbg_SomeFunc(has_defaults_vvvvwbg) +{ + // set the function logic + if (has_defaults_vvvvwbg == 1) + { + return true; + } + return false; +} + +// the vvvvwbi function +function vvvvwbi(store_vvvvwbi,datatype_vvvvwbi,has_defaults_vvvvwbi) +{ + if (isSet(store_vvvvwbi) && store_vvvvwbi.constructor !== Array) + { + var temp_vvvvwbi = store_vvvvwbi; + var store_vvvvwbi = []; + store_vvvvwbi.push(temp_vvvvwbi); + } + else if (!isSet(store_vvvvwbi)) + { + var store_vvvvwbi = []; + } + var store = store_vvvvwbi.some(store_vvvvwbi_SomeFunc); + + if (isSet(datatype_vvvvwbi) && datatype_vvvvwbi.constructor !== Array) + { + var temp_vvvvwbi = datatype_vvvvwbi; + var datatype_vvvvwbi = []; + datatype_vvvvwbi.push(temp_vvvvwbi); + } + else if (!isSet(datatype_vvvvwbi)) + { + var datatype_vvvvwbi = []; + } + var datatype = datatype_vvvvwbi.some(datatype_vvvvwbi_SomeFunc); + + if (isSet(has_defaults_vvvvwbi) && has_defaults_vvvvwbi.constructor !== Array) + { + var temp_vvvvwbi = has_defaults_vvvvwbi; + var has_defaults_vvvvwbi = []; + has_defaults_vvvvwbi.push(temp_vvvvwbi); + } + else if (!isSet(has_defaults_vvvvwbi)) + { + var has_defaults_vvvvwbi = []; + } + var has_defaults = has_defaults_vvvvwbi.some(has_defaults_vvvvwbi_SomeFunc); + + + // set this function logic + if (store && datatype && has_defaults) + { + jQuery('.note_whmcs_encryption').closest('.control-group').show(); + } + else + { + jQuery('.note_whmcs_encryption').closest('.control-group').hide(); + } +} + +// the vvvvwbi Some function +function store_vvvvwbi_SomeFunc(store_vvvvwbi) +{ + // set the function logic + if (store_vvvvwbi == 4) + { + return true; + } + return false; +} + +// the vvvvwbi Some function +function datatype_vvvvwbi_SomeFunc(datatype_vvvvwbi) +{ + // set the function logic + if (datatype_vvvvwbi == 'CHAR' || datatype_vvvvwbi == 'VARCHAR' || datatype_vvvvwbi == 'TEXT' || datatype_vvvvwbi == 'MEDIUMTEXT' || datatype_vvvvwbi == 'LONGTEXT' || datatype_vvvvwbi == 'BLOB' || datatype_vvvvwbi == 'TINYBLOB' || datatype_vvvvwbi == 'MEDIUMBLOB' || datatype_vvvvwbi == 'LONGBLOB') + { + return true; + } + return false; +} + +// the vvvvwbi Some function +function has_defaults_vvvvwbi_SomeFunc(has_defaults_vvvvwbi) +{ + // set the function logic + if (has_defaults_vvvvwbi == 1) + { + return true; + } + return false; +} + +// the vvvvwbj function +function vvvvwbj(datatype_vvvvwbj,store_vvvvwbj,has_defaults_vvvvwbj) +{ + if (isSet(datatype_vvvvwbj) && datatype_vvvvwbj.constructor !== Array) + { + var temp_vvvvwbj = datatype_vvvvwbj; + var datatype_vvvvwbj = []; + datatype_vvvvwbj.push(temp_vvvvwbj); + } + else if (!isSet(datatype_vvvvwbj)) + { + var datatype_vvvvwbj = []; + } + var datatype = datatype_vvvvwbj.some(datatype_vvvvwbj_SomeFunc); + + if (isSet(store_vvvvwbj) && store_vvvvwbj.constructor !== Array) + { + var temp_vvvvwbj = store_vvvvwbj; + var store_vvvvwbj = []; + store_vvvvwbj.push(temp_vvvvwbj); + } + else if (!isSet(store_vvvvwbj)) + { + var store_vvvvwbj = []; + } + var store = store_vvvvwbj.some(store_vvvvwbj_SomeFunc); + + if (isSet(has_defaults_vvvvwbj) && has_defaults_vvvvwbj.constructor !== Array) + { + var temp_vvvvwbj = has_defaults_vvvvwbj; + var has_defaults_vvvvwbj = []; + has_defaults_vvvvwbj.push(temp_vvvvwbj); + } + else if (!isSet(has_defaults_vvvvwbj)) + { + var has_defaults_vvvvwbj = []; + } + var has_defaults = has_defaults_vvvvwbj.some(has_defaults_vvvvwbj_SomeFunc); + + + // set this function logic + if (datatype && store && has_defaults) + { + jQuery('.note_whmcs_encryption').closest('.control-group').show(); + } + else + { + jQuery('.note_whmcs_encryption').closest('.control-group').hide(); + } +} + +// the vvvvwbj Some function +function datatype_vvvvwbj_SomeFunc(datatype_vvvvwbj) +{ + // set the function logic + if (datatype_vvvvwbj == 'CHAR' || datatype_vvvvwbj == 'VARCHAR' || datatype_vvvvwbj == 'TEXT' || datatype_vvvvwbj == 'MEDIUMTEXT' || datatype_vvvvwbj == 'LONGTEXT' || datatype_vvvvwbj == 'BLOB' || datatype_vvvvwbj == 'TINYBLOB' || datatype_vvvvwbj == 'MEDIUMBLOB' || datatype_vvvvwbj == 'LONGBLOB') + { + return true; + } + return false; +} + +// the vvvvwbj Some function +function store_vvvvwbj_SomeFunc(store_vvvvwbj) +{ + // set the function logic + if (store_vvvvwbj == 4) + { + return true; + } + return false; +} + +// the vvvvwbj Some function +function has_defaults_vvvvwbj_SomeFunc(has_defaults_vvvvwbj) +{ + // set the function logic + if (has_defaults_vvvvwbj == 1) + { + return true; + } + return false; +} + +// the vvvvwbk function +function vvvvwbk(has_defaults_vvvvwbk,store_vvvvwbk,datatype_vvvvwbk) +{ + if (isSet(has_defaults_vvvvwbk) && has_defaults_vvvvwbk.constructor !== Array) + { + var temp_vvvvwbk = has_defaults_vvvvwbk; + var has_defaults_vvvvwbk = []; + has_defaults_vvvvwbk.push(temp_vvvvwbk); + } + else if (!isSet(has_defaults_vvvvwbk)) + { + var has_defaults_vvvvwbk = []; + } + var has_defaults = has_defaults_vvvvwbk.some(has_defaults_vvvvwbk_SomeFunc); + + if (isSet(store_vvvvwbk) && store_vvvvwbk.constructor !== Array) + { + var temp_vvvvwbk = store_vvvvwbk; + var store_vvvvwbk = []; + store_vvvvwbk.push(temp_vvvvwbk); + } + else if (!isSet(store_vvvvwbk)) + { + var store_vvvvwbk = []; + } + var store = store_vvvvwbk.some(store_vvvvwbk_SomeFunc); + + if (isSet(datatype_vvvvwbk) && datatype_vvvvwbk.constructor !== Array) + { + var temp_vvvvwbk = datatype_vvvvwbk; + var datatype_vvvvwbk = []; + datatype_vvvvwbk.push(temp_vvvvwbk); + } + else if (!isSet(datatype_vvvvwbk)) + { + var datatype_vvvvwbk = []; + } + var datatype = datatype_vvvvwbk.some(datatype_vvvvwbk_SomeFunc); + + + // set this function logic + if (has_defaults && store && datatype) + { + jQuery('.note_whmcs_encryption').closest('.control-group').show(); + } + else + { + jQuery('.note_whmcs_encryption').closest('.control-group').hide(); + } +} + +// the vvvvwbk Some function +function has_defaults_vvvvwbk_SomeFunc(has_defaults_vvvvwbk) +{ + // set the function logic + if (has_defaults_vvvvwbk == 1) + { + return true; + } + return false; +} + +// the vvvvwbk Some function +function store_vvvvwbk_SomeFunc(store_vvvvwbk) +{ + // set the function logic + if (store_vvvvwbk == 4) + { + return true; + } + return false; +} + +// the vvvvwbk Some function +function datatype_vvvvwbk_SomeFunc(datatype_vvvvwbk) +{ + // set the function logic + if (datatype_vvvvwbk == 'CHAR' || datatype_vvvvwbk == 'VARCHAR' || datatype_vvvvwbk == 'TEXT' || datatype_vvvvwbk == 'MEDIUMTEXT' || datatype_vvvvwbk == 'LONGTEXT' || datatype_vvvvwbk == 'BLOB' || datatype_vvvvwbk == 'TINYBLOB' || datatype_vvvvwbk == 'MEDIUMBLOB' || datatype_vvvvwbk == 'LONGBLOB') + { + return true; + } + return false; +} + +// the vvvvwbl function +function vvvvwbl(has_defaults_vvvvwbl) +{ + // set the function logic + if (has_defaults_vvvvwbl == 1) + { + jQuery('#jform_datatype').closest('.control-group').show(); + // add required attribute to datatype field + if (jform_vvvvwblwak_required) + { + updateFieldRequired('datatype',0); + jQuery('#jform_datatype').prop('required','required'); + jQuery('#jform_datatype').attr('aria-required',true); + jQuery('#jform_datatype').addClass('required'); + jform_vvvvwblwak_required = false; + } + jQuery('#jform_null_switch').closest('.control-group').show(); + // add required attribute to null_switch field + if (jform_vvvvwblwal_required) + { + updateFieldRequired('null_switch',0); + jQuery('#jform_null_switch').prop('required','required'); + jQuery('#jform_null_switch').attr('aria-required',true); + jQuery('#jform_null_switch').addClass('required'); + jform_vvvvwblwal_required = false; + } + } + else + { + jQuery('#jform_datatype').closest('.control-group').hide(); + // remove required attribute from datatype field + if (!jform_vvvvwblwak_required) + { + updateFieldRequired('datatype',1); + jQuery('#jform_datatype').removeAttr('required'); + jQuery('#jform_datatype').removeAttr('aria-required'); + jQuery('#jform_datatype').removeClass('required'); + jform_vvvvwblwak_required = true; + } + jQuery('#jform_null_switch').closest('.control-group').hide(); + // remove required attribute from null_switch field + if (!jform_vvvvwblwal_required) + { + updateFieldRequired('null_switch',1); + jQuery('#jform_null_switch').removeAttr('required'); + jQuery('#jform_null_switch').removeAttr('aria-required'); + jQuery('#jform_null_switch').removeClass('required'); + jform_vvvvwblwal_required = true; + } + } +} + +// update required fields +function updateFieldRequired(name,status) +{ + var not_required = jQuery('#jform_not_required').val(); + + if(status == 1) + { + if (isSet(not_required) && not_required != 0) + { + not_required = not_required+','+name; + } + else + { + not_required = ','+name; + } + } + else + { + if (isSet(not_required) && not_required != 0) + { + not_required = not_required.replace(','+name,''); + } + } + + jQuery('#jform_not_required').val(not_required); +} + +// the isSet function +function isSet(val) +{ + if ((val != undefined) && (val != null) && 0 !== val.length){ + return true; + } + return false; +} jQuery(document).ready(function($) diff --git a/admin/models/forms/fieldtype.xml b/admin/models/forms/fieldtype.xml index 3500fdb94..4dfdde50e 100644 --- a/admin/models/forms/fieldtype.xml +++ b/admin/models/forms/fieldtype.xml @@ -101,6 +101,162 @@ message="COM_COMPONENTBUILDER_FIELDTYPE_NAME_MESSAGE" hint="COM_COMPONENTBUILDER_FIELDTYPE_NAME_HINT" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + default="0"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +