diff --git a/README.md b/README.md index cbe36754a..548d1f96d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.1) 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.7.2) 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) @@ -126,13 +126,13 @@ Component Builder is mapped as a component in itself on my local development env + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *First Build*: 30th April, 2015 -+ *Last Build*: 8th April, 2018 -+ *Version*: 2.7.1 ++ *Last Build*: 11th April, 2018 ++ *Version*: 2.7.2 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **188944** ++ *Line count*: **189475** + *Field count*: **1011** -+ *File count*: **1197** ++ *File count*: **1199** + *Folder count*: **193** > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index cbe36754a..548d1f96d 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.7.1) 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.7.2) 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) @@ -126,13 +126,13 @@ Component Builder is mapped as a component in itself on my local development env + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *First Build*: 30th April, 2015 -+ *Last Build*: 8th April, 2018 -+ *Version*: 2.7.1 ++ *Last Build*: 11th April, 2018 ++ *Version*: 2.7.2 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **188944** ++ *Line count*: **189475** + *Field count*: **1011** -+ *File count*: **1197** ++ *File count*: **1199** + *Folder count*: **193** > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/assets/css/field.css b/admin/assets/css/field.css index a66357a0f..140abb4d1 100644 --- a/admin/assets/css/field.css +++ b/admin/assets/css/field.css @@ -25,6 +25,5 @@ /* CSS Document */ -.uk-scrollable-box { -height: 380px !important; -} +.uk-scrollable-box { height: 380px !important; } +.subform-table-sublayout-section .controls { margin-left: 0px; } diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index 9998797e4..7fcabd6e3 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -65,6 +65,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy $this->registerTask('getValidationRulesTable', 'ajax'); $this->registerTask('checkRuleName', 'ajax'); $this->registerTask('fieldOptions', 'ajax'); + $this->registerTask('getFieldPropertyDesc', 'ajax'); $this->registerTask('snippetDetails', 'ajax'); $this->registerTask('setSnippetGithub', 'ajax'); $this->registerTask('getSnippets', 'ajax'); @@ -967,6 +968,45 @@ class ComponentbuilderControllerAjax extends JControllerLegacy } } break; + case 'getFieldPropertyDesc': + try + { + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $fieldtypeValue = $jinput->get('fieldtype', NULL, 'INT'); + $propertyValue = $jinput->get('property', NULL, 'WORD'); + if($fieldtypeValue && $propertyValue && $user->id != 0) + { + $result = $this->getModel('ajax')->getFieldPropertyDesc($fieldtypeValue, $propertyValue); + } + else + { + $result = false; + } + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback."(".json_encode($e).");"; + } + else + { + echo "(".json_encode($e).");"; + } + } + break; case 'snippetDetails': try { diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 4f02d7780..6a58752f6 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -170,7 +170,7 @@ class Compiler extends Infusion foreach ($mismatch as $string) { $constant = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($string, 'U'); - $this->app->enqueueMessage(JText::sprintf('The Joomla.JText._(\'%s\') language constant for (%s) does not have a corresponding JText::Script() decalaration.', $constant, $string), 'Warning'); + $this->app->enqueueMessage(JText::sprintf('The Joomla.JText._(\'%s\') language constant for %s does not have a corresponding JText::script(\'%s\') decalaration, please add it.', $constant, $string, $string), 'Warning'); } $this->app->enqueueMessage('
', 'Warning'); } diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index fd1d9f24e..6d9a87487 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -1578,6 +1578,85 @@ abstract class ComponentbuilderHelper $extruder = new Extrusion($data); } + public static function getFieldOptions($value, $type, $settings = array(), $xml = null) + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('properties', 'short_description', 'description'))); + $query->from($db->quoteName('#__componentbuilder_fieldtype')); + $query->where($db->quoteName('published') . ' = 1'); + $query->where($db->quoteName($type) . ' = '. $value); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $result = $db->loadObject(); + $properties = json_decode($result->properties,true); + $field = array( + 'subform' => array(), + 'nameListOptions' => array(), + 'values' => " '', + 'short_description' => $result->short_description, + 'description' => $result->description); + // number pointer + $nr = 0; + // set the headers + $field['values_description'] .= ''; + foreach ($properties as $property) + { + $example = (isset($property['example']) && self::checkString($property['example'])) ? self::shorten($property['example'], 30) : ''; + $field['values_description'] .= ''; + // check if we should load the value + $value = self::getValueFromXMLstring($xml, $property['name']); + if(self::checkArray($settings) && isset($settings[$property['name']])) + { + // add the xml values + $field['values'] .= "\n\t".$property['name'].'="'.$settings[$property['name']].'" '; + // add the json values + $field['subform']['properties'.$nr] = array('name' => $property['name'], 'value' => $settings[$property['name']]); + // add the name List Options as set + $field['nameListOptionsSet'][$property['name']] = $property['name']; + } + elseif (!$xml || $value) + { + // add the xml values + $field['values'] .= "\n\t" . $property['name'] . '="'. ($value) ? $value : $property['example'] .'" '; + // add the json values + $field['subform']['properties' . $nr] = array('name' => $property['name'], 'value' => ($value) ? $value : $property['example'], 'desc' => $property['description']); + } + // add the name List Options + $field['nameListOptions'][$property['name']] = $property['name']; + // increment the number + $nr++; + } + $field['values'] .= "\n/>"; + $field['values_description'] .= '
'.JText::_('COM_COMPONENTBUILDER_PROPERTY').''.JText::_('COM_COMPONENTBUILDER_EXAMPLE').''.JText::_('COM_COMPONENTBUILDER_DESCRIPTION').'
'.$property['name'].''.$example.''.$property['description'].'
'; + // return found field options + return $field; + } + return false; + } + + public static function getValueFromXMLstring($xml, $get) + { + if (self::checkString($xml)) + { + $value = self::getBetween($xml, $get.'="', '"'); + if (self::checkString($value)) + { + return $value; + } + } + return false; + } + + /** * The zipper method * @@ -1661,50 +1740,6 @@ abstract class ComponentbuilderHelper return $klaar; } - - public static function getFieldOptions($value, $type, $settings = array()) - { - // Get a db connection. - $db = JFactory::getDbo(); - - // Create a new query object. - $query = $db->getQuery(true); - $query->select($db->quoteName(array('properties', 'short_description', 'description'))); - $query->from($db->quoteName('#__componentbuilder_fieldtype')); - $query->where($db->quoteName('published') . ' = 1'); - $query->where($db->quoteName($type) . ' = '. $value); - - // Reset the query using our newly populated query object. - $db->setQuery($query); - $db->execute(); - if ($db->getNumRows()) - { - $result = $db->loadObject(); - $properties = json_decode($result->properties,true); - $field = array('values' => " '', 'short_description' => $result->short_description, 'description' => $result->description); - // set the headers - $field['values_description'] .= ''; - foreach ($properties as $property) - { - $example = (isset($property['example']) && self::checkString($property['example'])) ? self::shorten($property['example'], 30) : ''; - $field['values_description'] .= ''; - if(isset($settings[$property['name']])) - { - $field['values'] .= "\n\t".$property['name'].'="'.$settings[$property['name']].'" '; - } - else - { - $field['values'] .= "\n\t".$property['name'].'="'.$property['example'].'" '; - } - } - $field['values'] .= "\n/>"; - $field['values_description'] .= '
'.JText::_('COM_COMPONENTBUILDER_PROPERTY').''.JText::_('COM_COMPONENTBUILDER_EXAMPLE').''.JText::_('COM_COMPONENTBUILDER_DESCRIPTION').'
'.$property['name'].''.$example.''.$property['description'].'
'; - // return found field options - return $field; - } - return false; - } - /** * the basic localkey **/ diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index fd348ca7c..b0ec0b5dc 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -3782,11 +3782,11 @@ 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" COM_COMPONENTBUILDER_FIELD_DEFAULT="Default" -COM_COMPONENTBUILDER_FIELD_DETAILS="Details" COM_COMPONENTBUILDER_FIELD_DOUBLE="DOUBLE" COM_COMPONENTBUILDER_FIELD_EDIT="Editing the Field" COM_COMPONENTBUILDER_FIELD_ELEVEN="11" @@ -3933,6 +3933,7 @@ COM_COMPONENTBUILDER_FIELD_PERMISSION="Permissions" COM_COMPONENTBUILDER_FIELD_PUBLISHING="Publishing" COM_COMPONENTBUILDER_FIELD_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Field to customise the alias." COM_COMPONENTBUILDER_FIELD_SCRIPTS="Scripts" +COM_COMPONENTBUILDER_FIELD_SET_PROPERTIES="Set Properties" COM_COMPONENTBUILDER_FIELD_SEVEN="7" COM_COMPONENTBUILDER_FIELD_SIXTY_FOUR="64" COM_COMPONENTBUILDER_FIELD_STATUS="Status" @@ -3945,15 +3946,13 @@ COM_COMPONENTBUILDER_FIELD_TIME="TIME" COM_COMPONENTBUILDER_FIELD_TINYINT="TINYINT" COM_COMPONENTBUILDER_FIELD_TWO_HUNDRED_AND_FIFTY_FIVE="255" COM_COMPONENTBUILDER_FIELD_TWO_THOUSAND_AND_FORTY_EIGHT="2048" +COM_COMPONENTBUILDER_FIELD_TYPE_INFO="Type Info" COM_COMPONENTBUILDER_FIELD_UNIQUE_KEY="UNIQUE KEY" COM_COMPONENTBUILDER_FIELD_VARCHAR="VARCHAR" COM_COMPONENTBUILDER_FIELD_VERSION_DESC="A count of the number of times this Field has been revised." COM_COMPONENTBUILDER_FIELD_VERSION_LABEL="Revision" COM_COMPONENTBUILDER_FIELD_WHMCSKEY_ENCRYPTION="WHMCS-key Encryption" COM_COMPONENTBUILDER_FIELD_XML="Xml" -COM_COMPONENTBUILDER_FIELD_XML_DESCRIPTION="Text Area" -COM_COMPONENTBUILDER_FIELD_XML_HINT="Field XML Go Here" -COM_COMPONENTBUILDER_FIELD_XML_LABEL="XML field definition (Please set the field details here to fit your needs)" COM_COMPONENTBUILDER_FIELD_YES="Yes" COM_COMPONENTBUILDER_FIELD_ZERO="0" COM_COMPONENTBUILDER_FILE="File" @@ -5327,11 +5326,13 @@ COM_COMPONENTBUILDER_NO_ACCESS_GRANTED="No Access Granted!" COM_COMPONENTBUILDER_NO_COMPONENTS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN="No components were selected, please make a selection and try again!" COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_FOR_S="No cronjob path found for (%s)" COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED="No cronjob path found since incorrect type requested." +COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND="No description found." COM_COMPONENTBUILDER_NO_FILES_LINKED="No Files Linked" COM_COMPONENTBUILDER_NO_FOUND="No Found" COM_COMPONENTBUILDER_NO_ITEM_FOUND="No Item Found" COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="No keys were found. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key." COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION="No need to get it since it is already in sync with your local version" +COM_COMPONENTBUILDER_NO_RESULTS_MATCH="No results match" COM_COMPONENTBUILDER_NO_SNIPPETS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN="No snippets were selected, please make a selection and try again!" COM_COMPONENTBUILDER_NO_S_FOUND="No %s Found" COM_COMPONENTBUILDER_NO_S_HAVE_BEEN_LINKED_TO_THIS_VIEW_SOON_AS_THIS_IS_DONE_IT_WILL_BE_DISPLAYED_HERE="No %s have been linked to this view. Soon as this is done it will be displayed here." @@ -5368,7 +5369,11 @@ COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONENT_THAT_YOU_WOULD_LIKE_TO_COMPILE="P COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER="Please try again later" COM_COMPONENTBUILDER_PLEASE_WAIT_CLEARING_THE_TMP_FOLDER="Please wait! Clearing the tmp folder" COM_COMPONENTBUILDER_PLEASE_WAIT_LOADING="Please wait, loading" +COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL="Properties
Here you can set the properties for this field" COM_COMPONENTBUILDER_PROPERTY="Property" +COM_COMPONENTBUILDER_PROPERTY_ALREADY_SELECTED_TRY_ANOTHER="Property already selected, try another." +COM_COMPONENTBUILDER_PROPERTY_NAME="Property Name" +COM_COMPONENTBUILDER_PROPERTY_VALUE="Property Value" COM_COMPONENTBUILDER_PUBLIC_ACCESS="Public Access" COM_COMPONENTBUILDER_PUBLISHED="Published" COM_COMPONENTBUILDER_PUBLISHING="Publishing" @@ -5389,7 +5394,9 @@ COM_COMPONENTBUILDER_SAVE_WARNING="The value already existed so please select an COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_AN_BACCESS_TOKENB_TO_GETBIBLE_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO="%s
You can add an access token to getBible global options to make authenticated requests. An access token with only public access will do." COM_COMPONENTBUILDER_SEARCHABLE="Searchable" COM_COMPONENTBUILDER_SEE_ALL_IMPORT_INFO="See All Import Info" +COM_COMPONENTBUILDER_SELECTION="selection" COM_COMPONENTBUILDER_SELECT_AN_OPTION="Select an option" +COM_COMPONENTBUILDER_SELECT_A_PROPERTY="Select a property" COM_COMPONENTBUILDER_SELECT_A_SNIPPET="select a snippet" COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE="Select the component to compile" COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_YOUR_WOULD_LIKE_TO_IMPORT="Select the component your would like to import." @@ -6419,6 +6426,7 @@ COM_COMPONENTBUILDER_TYPE_ASC="Type (Asc)" COM_COMPONENTBUILDER_TYPE_DESC="Type (Desc)" COM_COMPONENTBUILDER_TYPE_ERROR="Type Error" COM_COMPONENTBUILDER_TYPE_NAME="Type - Name" +COM_COMPONENTBUILDER_TYPE_OR_SELECT_SOME_OPTIONS="Type or select some options" COM_COMPONENTBUILDER_UNACTIVE_ONLY_FOUR_TEXT_FIELD="Unactive (only 4 text_field)" COM_COMPONENTBUILDER_UNDERNEATH_TABS="Underneath Tabs" COM_COMPONENTBUILDER_UPDATE="Update" @@ -6514,6 +6522,7 @@ COM_COMPONENTBUILDER_VALIDATION_RULE_SHORT_DESCRIPTION_MESSAGE="Error! Please ad COM_COMPONENTBUILDER_VALIDATION_RULE_STATUS="Status" COM_COMPONENTBUILDER_VALIDATION_RULE_VERSION_DESC="A count of the number of times this Validation Rule has been revised." COM_COMPONENTBUILDER_VALIDATION_RULE_VERSION_LABEL="Revision" +COM_COMPONENTBUILDER_VALUE="Value" COM_COMPONENTBUILDER_VDM_NOTICE_BOARD="VDM Notice Board" COM_COMPONENTBUILDER_VDM_PACKAGES="VDM Packages" COM_COMPONENTBUILDER_VERSION="Version" diff --git a/admin/layouts/field/scripts_left.php b/admin/layouts/field/data_base_left.php similarity index 92% rename from admin/layouts/field/scripts_left.php rename to admin/layouts/field/data_base_left.php index 6ea8283f7..0cb0fc003 100644 --- a/admin/layouts/field/scripts_left.php +++ b/admin/layouts/field/data_base_left.php @@ -13,7 +13,7 @@ @version 2.7.x @created 30th April, 2015 @package Component Builder - @subpackage scripts_left.php + @subpackage data_base_left.php @author Llewellyn van der Merwe @github Joomla Component Builder @copyright Copyright (C) 2015. All Rights Reserved @@ -30,10 +30,15 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( + 'datatype', + 'datalenght', + 'datalenght_other', + 'css_views', + 'datadefault_other', 'add_css_view', 'css_view', 'add_css_views', - 'css_views' + 'datadefault' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); diff --git a/admin/layouts/field/details_right.php b/admin/layouts/field/data_base_right.php similarity index 93% rename from admin/layouts/field/details_right.php rename to admin/layouts/field/data_base_right.php index e6d42da76..2df312850 100644 --- a/admin/layouts/field/details_right.php +++ b/admin/layouts/field/data_base_right.php @@ -13,7 +13,7 @@ @version 2.7.x @created 30th April, 2015 @package Component Builder - @subpackage details_right.php + @subpackage data_base_right.php @author Llewellyn van der Merwe @github Joomla Component Builder @copyright Copyright (C) 2015. All Rights Reserved @@ -30,7 +30,10 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( - 'helpnote' + 'indexes', + 'null_switch', + 'store', + 'note_whmcs_encryption' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); diff --git a/admin/layouts/field/details_left.php b/admin/layouts/field/details_left.php deleted file mode 100644 index c2def0c81..000000000 --- a/admin/layouts/field/details_left.php +++ /dev/null @@ -1,65 +0,0 @@ - - @github Joomla Component Builder - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ - -// No direct access to this file - -defined('_JEXEC') or die('Restricted access'); - -$form = $displayData->getForm(); - -$fields = $displayData->get('fields') ?: array( - 'fieldtype', - 'name', - 'catid', - 'datatype', - 'datalenght', - 'datalenght_other', - 'datadefault', - 'datadefault_other', - 'indexes', - 'null_switch', - 'store', - 'note_whmcs_encryption' -); - -$hiddenFields = $displayData->get('hidden_fields') ?: array(); - -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} diff --git a/admin/layouts/field/set_properties_above.php b/admin/layouts/field/set_properties_above.php new file mode 100644 index 000000000..b0892dcb7 --- /dev/null +++ b/admin/layouts/field/set_properties_above.php @@ -0,0 +1,43 @@ + + @github Joomla Component Builder + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +$form = $displayData->getForm(); + +$fields = array( + 'fieldtype', + 'name', + 'catid' +); + +?> +
+ renderField($field); + } ?> +
diff --git a/admin/layouts/field/details_fullwidth.php b/admin/layouts/field/set_properties_fullwidth.php similarity index 96% rename from admin/layouts/field/details_fullwidth.php rename to admin/layouts/field/set_properties_fullwidth.php index 2a18dc60f..4b977ed0a 100644 --- a/admin/layouts/field/details_fullwidth.php +++ b/admin/layouts/field/set_properties_fullwidth.php @@ -13,7 +13,7 @@ @version 2.7.x @created 30th April, 2015 @package Component Builder - @subpackage details_fullwidth.php + @subpackage set_properties_fullwidth.php @author Llewellyn van der Merwe @github Joomla Component Builder @copyright Copyright (C) 2015. All Rights Reserved diff --git a/admin/layouts/field/details_under.php b/admin/layouts/field/set_properties_under.php similarity index 96% rename from admin/layouts/field/details_under.php rename to admin/layouts/field/set_properties_under.php index 44171f053..535819eee 100644 --- a/admin/layouts/field/details_under.php +++ b/admin/layouts/field/set_properties_under.php @@ -13,7 +13,7 @@ @version 2.7.x @created 30th April, 2015 @package Component Builder - @subpackage details_under.php + @subpackage set_properties_under.php @author Llewellyn van der Merwe @github Joomla Component Builder @copyright Copyright (C) 2015. All Rights Reserved diff --git a/admin/layouts/field/type_info_fullwidth.php b/admin/layouts/field/type_info_fullwidth.php new file mode 100644 index 000000000..8dc52b45f --- /dev/null +++ b/admin/layouts/field/type_info_fullwidth.php @@ -0,0 +1,48 @@ + + @github Joomla Component Builder + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'helpnote' +); + +?> +
+ +
+
+ getLabel($field); ?> +
+
+ getInput($field); ?> +
+
+ +
diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 0c030cca6..236a31211 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -2200,14 +2200,190 @@ class ComponentbuilderModelAjax extends JModelList } // Used in field - public function getFieldOptions($id) + public function getFieldOptions($fieldtype) { - if ($field = ComponentbuilderHelper::getFieldOptions($id, 'id')) + // get the xml + $xml = $this->getFieldXML($fieldtype); + // now get the field options + if ($field = ComponentbuilderHelper::getFieldOptions($fieldtype, 'id', null, $xml)) { + // get subform field object + $subform = $this->buildFieldOptionsSubform($field['subform'], $field['nameListOptions']); + // load the html + $field['subform'] = '
'. $subform->label . '
' . $subform->input . '
'; // return found field options return $field; } return false; + } + + protected function buildFieldOptionsSubform($values, $nameListOptions = null) + { + // get the subform + $subform = JFormHelper::loadFieldType('subform', true); + // start building the subform field XML + $subformXML = new SimpleXMLElement(''); + // subform attributes + $subformAttribute = array( + 'type' => 'subform', + 'name' => 'properties', + 'label' => 'COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL', + 'layout' => 'joomla.form.field.subform.repeatable-table', + 'multiple' => 'true', + 'icon' => 'list', + 'max' => (int) count($nameListOptions)); + // load the subform attributes + ComponentbuilderHelper::xmlAddAttributes($subformXML, $subformAttribute); + // now add the subform child form + $childForm = $subformXML->addChild('form'); + // child form attributes + $childFormAttribute = array( + 'hidden' => 'true', + 'name' => 'list_properties', + 'repeat' => 'true'); + // load the child form attributes + ComponentbuilderHelper::xmlAddAttributes($childForm, $childFormAttribute); + + // start building the name field XML + $nameXML = new SimpleXMLElement(''); + // subform attributes + $nameAttribute = array( + 'type' => (ComponentbuilderHelper::checkArray($nameListOptions)) ? 'list' : 'text', + 'name' => 'name', + 'label' => 'COM_COMPONENTBUILDER_PROPERTY', + 'size' => '40', + 'maxlength' => '150', + 'class' => (ComponentbuilderHelper::checkArray($nameListOptions)) ? 'list_class field_list_name_options' : 'text_area', + 'filter' => 'STRING'); + // add the hint only if not name list and description if name list is an array + if (ComponentbuilderHelper::checkArray($nameListOptions)) + { + $nameAttribute['description'] = 'COM_COMPONENTBUILDER_SELECTION'; + $nameAttribute['multiple'] = 'false'; + $nameAttribute['onchange'] = "getFieldPropertyDesc(this)"; + } + else + { + $nameAttribute['hint'] = 'COM_COMPONENTBUILDER_PROPERTY_NAME'; + } + // load the subform attributes + ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute); + // add name list if found + if (ComponentbuilderHelper::checkArray($nameListOptions)) + { + ComponentbuilderHelper::xmlAddOptions($nameXML, $nameListOptions); + } + // now add the fields to the child form + ComponentbuilderHelper::xmlAppend($childForm, $nameXML); + + // start building the name field XML + $valueXML = new SimpleXMLElement(''); + // subform attributes + $valueAttribute = array( + 'type' => 'textarea', + 'name' => 'value', + 'label' => 'COM_COMPONENTBUILDER_VALUE', + 'rows' => '1', + 'cols' => '15', + 'class' => 'text_area span12', + 'filter' => 'STRING', + 'hint' => 'COM_COMPONENTBUILDER_PROPERTY_VALUE'); + // load the subform attributes + ComponentbuilderHelper::xmlAddAttributes($valueXML, $valueAttribute); + // now add the fields to the child form + ComponentbuilderHelper::xmlAppend($childForm, $valueXML); + + // start building the desc field XML + $descXML = new SimpleXMLElement(''); + // subform attributes + $descAttribute = array( + 'type' => 'textarea', + 'name' => 'desc', + 'label' => 'COM_COMPONENTBUILDER_DESCRIPTION', + 'rows' => '3', + 'cols' => '25', + 'readonly' => 'true', + 'class' => 'text_area span12', + 'filter' => 'WORD', + 'hint' => 'COM_COMPONENTBUILDER_SELECT_A_PROPERTY'); + // load the desc attributes + ComponentbuilderHelper::xmlAddAttributes($descXML, $descAttribute); + // now add the fields to the child form + ComponentbuilderHelper::xmlAppend($childForm, $descXML); + + // setup subform with values + $subform->setup($subformXML, $values); + + // return subfrom object + return $subform; + } + + public function getFieldPropertyDesc($fieldtype, $_property) + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('properties', 'short_description', 'description'))); + $query->from($db->quoteName('#__componentbuilder_fieldtype')); + $query->where($db->quoteName('id') . ' = '. $fieldtype); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + // get the result + $result = $db->loadObject(); + // get the xml + $xml = $this->getFieldXML($fieldtype); + // open the properties + $properties = json_decode($result->properties,true); + // make sure we have an array + if (ComponentbuilderHelper::checkArray($properties)) + { + foreach ($properties as $property) + { + if(isset($property['name']) && $_property === $property['name']) + { + // check if we should load the value + if (!$value = ComponentbuilderHelper::getValueFromXMLstring($xml, $property['name'])) + { + $value = (isset($property['example']) && ComponentbuilderHelper::checkString($property['example'])) ? $property['example'] : ''; + } + // return the found values + return array('value' => $value, 'desc' => $property['description']); + } + } + } + } + return false; + } + + protected function getFieldXML($fieldtype) + { + // reset xml to null + $xml = null; + // get the view name & id + $global = $this->getViewID(); + // get the xml if this view already has it set + if (!is_null($global['a_id']) && $global['a_id'] > 0 && isset($global['a_view']) && 'field' === $global['a_view']) + { + // first check field type + $_fieldType = ComponentbuilderHelper::getVar('field', $global['a_id'], 'id', 'fieldtype'); + // only continue if field type is the same + if ($fieldtype == $_fieldType) + { + $xmlDB = ComponentbuilderHelper::getVar('field', $global['a_id'], 'id', 'xml'); + // check if it is a string + if (ComponentbuilderHelper::checkString($xmlDB)) + { + $xml = json_decode($xmlDB); + } + } + } + return $xml; } // Used in get_snippets diff --git a/admin/models/field.php b/admin/models/field.php index e4520c5c2..e2235c453 100644 --- a/admin/models/field.php +++ b/admin/models/field.php @@ -106,28 +106,28 @@ class ComponentbuilderModelField extends JModelAdmin $item->xml = json_decode($item->xml); } - 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_views_footer)) + { + // base64 Decode javascript_views_footer. + $item->javascript_views_footer = base64_decode($item->javascript_views_footer); + } + 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_footer)) + if (!empty($item->css_view)) { - // base64 Decode javascript_views_footer. - $item->javascript_views_footer = base64_decode($item->javascript_views_footer); + // base64 Decode css_view. + $item->css_view = base64_decode($item->css_view); } @@ -889,34 +889,70 @@ class ComponentbuilderModelField extends JModelAdmin $data['metadata'] = (string) $metadata; } + // get the properties + $properties = $input->get('properties', null, 'ARRAY'); + // make sure we have an array + if (ComponentbuilderHelper::checkArray($properties)) + { + // set the bucket + $bucket = array(); + foreach($properties as $property) + { + // make sure we have the correct values + if (ComponentbuilderHelper::checkArray($property) && + isset($property['name']) && ComponentbuilderHelper::checkString($property['name']) && + isset($property['value']) && ComponentbuilderHelper::checkString($property['value'])) + { + // fix the name + $property['name'] = ComponentbuilderHelper::safeString($property['name']); + // some fixes, just in case (more can be added) + switch ($property['name']) + { + // fix the values + case 'name': + case 'type': + $property['value'] = ComponentbuilderHelper::safeString($property['value']); + break; + } + // load the property + $bucket[] = "\t".$property['name'].'="'. str_replace('"', """, $property['value']).'"'; + } + } + // if the bucket has been loaded + if (ComponentbuilderHelper::checkArray($bucket)) + { + $data['xml'] = ""; + } + } + // Set the xml string to JSON string. if (isset($data['xml'])) { $data['xml'] = (string) json_encode($data['xml']); } - // 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_views_footer string to base64 string. + if (isset($data['javascript_views_footer'])) + { + $data['javascript_views_footer'] = base64_encode($data['javascript_views_footer']); + } + // 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_footer string to base64 string. - if (isset($data['javascript_views_footer'])) + // Set the css_view string to base64 string. + if (isset($data['css_view'])) { - $data['javascript_views_footer'] = base64_encode($data['javascript_views_footer']); + $data['css_view'] = base64_encode($data['css_view']); } // Set the Params Items to data diff --git a/admin/models/fields.php b/admin/models/fields.php index 071d3ed71..3c6fbe74a 100644 --- a/admin/models/fields.php +++ b/admin/models/fields.php @@ -313,7 +313,7 @@ class ComponentbuilderModelFields extends JModelList else { $search = $db->quote('%' . $db->escape($search) . '%'); - $query->where('(a.name LIKE '.$search.' OR a.fieldtype LIKE '.$search.' OR g.name LIKE '.$search.' OR a.datatype LIKE '.$search.' OR a.indexes LIKE '.$search.' OR a.null_switch LIKE '.$search.' OR a.catid LIKE '.$search.' OR a.xml LIKE '.$search.' OR a.store LIKE '.$search.')'); + $query->where('(a.name LIKE '.$search.' OR a.fieldtype LIKE '.$search.' OR g.name LIKE '.$search.' OR a.datatype LIKE '.$search.' OR a.indexes LIKE '.$search.' OR a.null_switch LIKE '.$search.' OR a.catid LIKE '.$search.' OR a.store LIKE '.$search.' OR a.xml LIKE '.$search.')'); } } @@ -431,14 +431,14 @@ class ComponentbuilderModelFields extends JModelList continue; } - // 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 javascript_views_footer $item->javascript_views_footer = base64_decode($item->javascript_views_footer); + // decode javascript_view_footer + $item->javascript_view_footer = base64_decode($item->javascript_view_footer); + // decode css_view + $item->css_view = base64_decode($item->css_view); // unset the values we don't want exported. unset($item->asset_id); unset($item->checked_out); diff --git a/admin/models/forms/field.js b/admin/models/forms/field.js index 2b10c0b63..98f7e9048 100644 --- a/admin/models/forms/field.js +++ b/admin/models/forms/field.js @@ -512,6 +512,9 @@ function isSet(val) jQuery(document).ready(function() { + // get type value + var fieldtype = jQuery("#jform_fieldtype option:selected").val(); + getFieldOptions(fieldtype); // get the linked details getLinked(); // get the validation rules @@ -569,10 +572,13 @@ function addButton(type, where, size){ }) } -function getFieldOptions_server(fieldId){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldOptions&format=json"; - if(token.length > 0 && fieldId > 0){ - var request = 'token='+token+'&id='+fieldId; +// the options row id key +var rowIdKey = 'properties'; + +function getFieldOptions_server(fieldtype){ + var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldOptions&format=json&vdm="+vastDevMod; + if(token.length > 0 && fieldtype > 0){ + var request = 'token='+token+'&id='+fieldtype; } return jQuery.ajax({ type: 'GET', @@ -583,20 +589,156 @@ function getFieldOptions_server(fieldId){ }); } -function getFieldOptions(id,setValue){ - getFieldOptions_server(id).done(function(result) { - if(result.values){ - if(setValue){ - jQuery('textarea#jform_xml').val(result.values); - } +function getFieldOptions(fieldtype){ + getFieldOptions_server(fieldtype).done(function(result) { + if(result.subform){ + // load the list of properties + propertiesArray = result.nameListOptions; + // remove previous forms of exist + jQuery('.prop_removal').remove(); + // remove the hidden jform_properties + jQuery('#jform_xml').closest('.control-group').remove(); + // append to the closed to xml (hidden field) + jQuery('.note_filter_information').closest('.control-group').prepend(result.subform); + // add the watcher + rowWatcher(); + // initialize the new form + jQuery('div.subform-repeatable').subformRepeatable(); + // update all the list fields to only show items not selected already + propertyDynamicSet(); + // set the field type info jQuery('#help').remove(); - jQuery('.helpNote').append('
'+result.description+'
'+result.values_description+'
'); + jQuery('.helpNote').append('
'+result.description+'
'+result.values_description+'
'); } }) } +function getFieldPropertyDesc(field){ + // get the ID + var id = jQuery(field).attr('id'); + // build the target array + var target = id.split('__'); + // get property value + var property = jQuery(field).val(); + // first check that there isn't any of this property type already set + if (propertyIsSet(property, id)) { + // reset the selection + jQuery('#'+id).val(''); + jQuery('#'+id).trigger("liszt:updated"); + // give out a notice + jQuery.UIkit.notify({message: Joomla.JText._('COM_COMPONENTBUILDER_PROPERTY_ALREADY_SELECTED_TRY_ANOTHER'), timeout: 5000, status: 'warning', pos: 'top-center'}); + // update the values + jQuery('#'+target[0]+'__desc').val(''); + jQuery('#'+target[0]+'__value').val(''); + } else { + // do a dynamic update + propertyDynamicSet(); + // get type value + var fieldtype = jQuery("#jform_fieldtype option:selected").val(); + getFieldPropertyDesc_server(fieldtype, property).done(function(result) { + if(result.desc && result.value){ + // update the values + jQuery('#'+target[0]+'__desc').val(result.desc); + jQuery('#'+target[0]+'__value').val(result.value); + } else { + // update the values + jQuery('#'+target[0]+'__desc').val(Joomla.JText._('COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND')); + jQuery('#'+target[0]+'__value').val(''); + } + }); + } +} + +// set properties the options +propertiesArray = {}; +var propertyIdRemoved; + +function propertyDynamicSet() { + propertiesAvailable = {}; + propertiesSelectedArray = {}; + propertiesTrackerArray = {}; + var i; + for (i = 0; i < 70; i++) { // for now this is the number of field we should check + // build ID + var id_check = rowIdKey+'_'+rowIdKey+i+'__name'; + // first check if Id is on page as that not the same as the one currently calling + if (jQuery("#"+id_check).length && propertyIdRemoved !== id_check) { + // build the selected array + var key = jQuery("#"+id_check+" option:selected").val(); + var text = jQuery("#"+id_check+" option:selected").text(); + propertiesSelectedArray[key] = text; + // keep track of the value set + propertiesTrackerArray[id_check] = key; + // clear the options out + jQuery("#"+id_check).find('option').remove().end(); + } + } + // trigger chosen on the list fields + jQuery('.field_list_name_options').chosen({"disable_search_threshold":10,"search_contains":true,"allow_single_deselect":true,"placeholder_text_multiple":Joomla.JText._("COM_COMPONENTBUILDER_TYPE_OR_SELECT_SOME_OPTIONS"),"placeholder_text_single":Joomla.JText._("COM_COMPONENTBUILDER_SELECT_A_PROPERTY"),"no_results_text":Joomla.JText._("COM_COMPONENTBUILDER_NO_RESULTS_MATCH")}); + // now build the list to keep + jQuery.each( propertiesArray, function( prop, name ) { + if (!propertiesSelectedArray.hasOwnProperty(prop)) { + propertiesAvailable[prop] = name; + } + }); + // now add the lists back + jQuery.each( propertiesTrackerArray, function( tId, tKey ) { + if (jQuery('#'+tId).length) { + jQuery('#'+tId).append(''); + jQuery.each( propertiesAvailable, function( aKey, aValue ) { + jQuery('#'+tId).append(''); + }); + jQuery('#'+tId).val(tKey); + jQuery('#'+tId).trigger('liszt:updated'); + } + }); +} + +function rowWatcher() { + jQuery(document).on('subform-row-remove', function(event, row){ + propertyIdRemoved = jQuery(row.innerHTML).find('.field_list_name_options').attr('id'); + propertyDynamicSet(); + }); + jQuery(document).on('subform-row-add', function(event, row){ + propertyDynamicSet(); + }); +} + +function propertyIsSet(prop, id) { + var i; + for (i = 0; i < 70; i++) { // for now this is the number of field we should check + // build ID + var id_check = rowIdKey+'_'+rowIdKey+i+'__name'; + // first check if Id is on page as that not the same as the one currently calling + if (jQuery("#"+id_check).length && id_check != id) { + // get the property value + var tmp = jQuery("#"+id_check+" option:selected").val(); + // now validate + if (tmp === prop) { + return true; + } + } + } + return false; +} + +function getFieldPropertyDesc_server(fieldtype, property){ + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getFieldPropertyDesc&format=json&vdm="+vastDevMod; + if(token.length > 0 && fieldtype > 0 && property.length > 0){ + var request = 'token='+token+'&fieldtype='+fieldtype+'&property='+property; + } + return jQuery.ajax({ + type: 'GET', + url: getUrl, + dataType: 'jsonp', + data: request, + jsonp: 'callback' + }); +} + + function getValidationRulesTable_server(){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getValidationRulesTable&format=json"; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getValidationRulesTable&format=json&vdm="+vastDevMod; if(token.length > 0){ var request = 'token='+token+'&id=1'; } diff --git a/admin/models/forms/field.xml b/admin/models/forms/field.xml index b59d24bfb..41dd42ab9 100644 --- a/admin/models/forms/field.xml +++ b/admin/models/forms/field.xml @@ -183,105 +183,65 @@
- + - - - - - + type="text" + name="datadefault_other" + label="COM_COMPONENTBUILDER_FIELD_DATADEFAULT_OTHER_LABEL" + size="10" + maxlength="50" + description="COM_COMPONENTBUILDER_FIELD_DATADEFAULT_OTHER_DESCRIPTION" + class="text_area" + readonly="false" + disabled="false" + required="true" + filter="STRING" + message="COM_COMPONENTBUILDER_FIELD_DATADEFAULT_OTHER_MESSAGE" + hint="COM_COMPONENTBUILDER_FIELD_DATADEFAULT_OTHER_HINT" + /> + - - - - - + - + - - - - - - - - - - - - - - - - + type="textarea" + name="javascript_view_footer" + label="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_LABEL" + rows="30" + cols="15" + description="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_DESCRIPTION" + class="text_area span12" + filter="raw" + hint="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_HINT" + required="true" + /> + + COM_COMPONENTBUILDER_FIELD_OTHER - + - - + type="radio" + name="add_css_view" + label="COM_COMPONENTBUILDER_FIELD_ADD_CSS_VIEW_LABEL" + class="btn-group btn-group-yesno" + default="0" + required="true"> - - - - - + COM_COMPONENTBUILDER_FIELD_YES + - + - + + + @@ -408,36 +343,95 @@ - + - - - + + type="radio" + name="add_javascript_view_footer" + label="COM_COMPONENTBUILDER_FIELD_ADD_JAVASCRIPT_VIEW_FOOTER_LABEL" + class="btn-group btn-group-yesno" + default="0" + required="true"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 09a1e5104..35d653981 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -731,15 +731,15 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_field` ( KEY `idx_datatype` (`datatype`), KEY `idx_indexes` (`indexes`), KEY `idx_null_switch` (`null_switch`), + KEY `idx_datadefault_other` (`datadefault_other`), + KEY `idx_datalenght` (`datalenght`), KEY `idx_add_css_view` (`add_css_view`), KEY `idx_catid` (`catid`), + KEY `idx_datalenght_other` (`datalenght_other`), KEY `idx_add_javascript_view_footer` (`add_javascript_view_footer`), - KEY `idx_add_javascript_views_footer` (`add_javascript_views_footer`), KEY `idx_add_css_views` (`add_css_views`), - KEY `idx_datalenght` (`datalenght`), - KEY `idx_datadefault_other` (`datadefault_other`), - KEY `idx_datadefault` (`datadefault`), - KEY `idx_datalenght_other` (`datalenght_other`) + KEY `idx_add_javascript_views_footer` (`add_javascript_views_footer`), + KEY `idx_datadefault` (`datadefault`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `#__componentbuilder_fieldtype` ( @@ -1501,7 +1501,7 @@ INSERT INTO `#__componentbuilder_fieldtype` (`id`, `catid`, `description`, `name (6, '', 'The list form field type provides a drop down list or a list box of other current component table entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Custom', '{\"properties0\":{\"name\":\"type\",\"example\":\"subjects\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a Subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties14\":{\"name\":\"extends\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties15\":{\"name\":\"button\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) to add new button next to field in edit view\"},\"properties16\":{\"name\":\"table\",\"example\":\"#__###component###_subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. \"},\"properties17\":{\"name\":\"component\",\"example\":\"com_###component###\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties18\":{\"name\":\"view\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties19\":{\"name\":\"views\",\"example\":\"subjects\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties20\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to.\"},\"properties21\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key.\"},\"properties22\":{\"name\":\"prime_php\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"This field makes sure that the PHP used here is used to build the field type, and other are custom fields with the same field type are ignored. So to avoid that they over write the PHP added here. You should only have one prime per\\/type. To disable remove the field or set to 0\"},\"properties23\":{\"name\":\"type_php_1\",\"example\":\"$db = JFactory::getDBO();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties24\":{\"name\":\"type_php_2\",\"example\":\"$query = $db->getQuery(true);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties25\":{\"name\":\"type_php_3\",\"example\":\"$query->select($db->quoteName(array(\'a.###ID###\',\'a.###TEXT###\'),array(\'###ID###\',\'###CODE_TEXT###\')));\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties26\":{\"name\":\"type_php_4\",\"example\":\"$query->from($db->quoteName(\'###TABLE###\', \'a\'));\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties27\":{\"name\":\"type_php_5\",\"example\":\"$query->where($db->quoteName(\'a.published\') . \' = 1\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties28\":{\"name\":\"type_php_6\",\"example\":\"$query->order(\'a.###TEXT### ASC\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties29\":{\"name\":\"type_php_7\",\"example\":\"$db->setQuery((string)$query);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties30\":{\"name\":\"type_php_8\",\"example\":\"$items = $db->loadObjectList();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties31\":{\"name\":\"type_php_9\",\"example\":\"$options = array();\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties32\":{\"name\":\"type_php_10\",\"example\":\"if ($items)\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties33\":{\"name\":\"type_php_11\",\"example\":\"{\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties34\":{\"name\":\"type_php_12\",\"example\":\"\\\\t$options[] = JHtml::_(\'select.option\', \'\', \'Select an option\');\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties35\":{\"name\":\"type_php_13\",\"example\":\"\\\\tforeach($items as $item)\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties36\":{\"name\":\"type_php_14\",\"example\":\"\\\\t{\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties37\":{\"name\":\"type_php_15\",\"example\":\"\\\\t\\\\t$options[] = JHtml::_(\'select.option\', $item->###ID###, $item->###CODE_TEXT###);\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties38\":{\"name\":\"type_php_16\",\"example\":\"\\\\t}\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties39\":{\"name\":\"type_php_17\",\"example\":\"}\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties40\":{\"name\":\"type_php_18\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"},\"properties41\":{\"name\":\"type_php_19\",\"example\":\"return $options;\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"}}', 'provides a drop down list of items entries.', '', 1, 8, '', ''), (7, '', 'The a list of users that can be targeting one or more groups and excluded users that already belongs to an item in a view.', 'CustomUser', '{\"properties0\":{\"name\":\"type\",\"example\":\"staffusers\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties8\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties9\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"\"},\"properties10\":{\"name\":\"hint\",\"example\":\"select a user\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties12\":{\"name\":\"extends\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties13\":{\"name\":\"table\",\"example\":\"#__users\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The table being linked to. Must be #__users\"},\"properties14\":{\"name\":\"component\",\"example\":\"com_users\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties15\":{\"name\":\"view\",\"example\":\"###view###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties16\":{\"name\":\"views\",\"example\":\"###views###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties17\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The name of the text field in table linked to.\"},\"properties18\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key.\"},\"properties19\":{\"name\":\"type_php_1\",\"example\":\"\\/\\/ set the groups array\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getGroups method.\"},\"properties20\":{\"name\":\"type_php_2\",\"example\":\"$groups = JComponentHelper::getParams(\'com_###component###\')->get(\'###type###\');\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getGroups method.\"},\"properties21\":{\"name\":\"type_php_3\",\"example\":\"return $groups;\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getGroups method.\"},\"properties22\":{\"name\":\"type_phpx_1\",\"example\":\"\\/\\/ To ensure that there is only one record per user\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties23\":{\"name\":\"type_phpx_2\",\"example\":\"\\/\\/ Get a db connection.\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties24\":{\"name\":\"type_phpx_3\",\"example\":\"$db = JFactory::getDbo();\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties25\":{\"name\":\"type_phpx_4\",\"example\":\"\\/\\/ Create a new query object.\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties26\":{\"name\":\"type_phpx_5\",\"example\":\"$query = $db->getQuery(true);\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties27\":{\"name\":\"type_phpx_6\",\"example\":\"\\/\\/ Select all records from the #__###component###_###view### table from ###CODE### column\\\".\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties28\":{\"name\":\"type_phpx_7\",\"example\":\"$query->select($db->quoteName(\'###CODE###\'));\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties29\":{\"name\":\"type_phpx_8\",\"example\":\"$query->from($db->quoteName(\'#__###component###_###view###\'));\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties30\":{\"name\":\"type_phpx_9\",\"example\":\"$db->setQuery($query);\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties31\":{\"name\":\"type_phpx_10\",\"example\":\"$db->execute();\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties32\":{\"name\":\"type_phpx_11\",\"example\":\"$found = $db->getNumRows();\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties33\":{\"name\":\"type_phpx_12\",\"example\":\"if ($found)\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties34\":{\"name\":\"type_phpx_13\",\"example\":\"{\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties35\":{\"name\":\"type_phpx_14\",\"example\":\"\\\\t\\/\\/ return all users already used\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties36\":{\"name\":\"type_phpx_15\",\"example\":\"\\\\treturn array_unique($db->loadColumn());\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties37\":{\"name\":\"type_phpx_16\",\"example\":\"}\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"},\"properties38\":{\"name\":\"type_phpx_17\",\"example\":\"return null;\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"The php for the getExcluded method.\"}}', 'Provides list of users.', '', 1, 2, '', ''), (8, '', 'The Editor field type provides a WYSIWYG editor.', 'Editor', '{\"properties0\":{\"name\":\"type\",\"example\":\"editor\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be editor.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextblock\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Test Field\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"Some text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties16\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties4\":{\"name\":\"width\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width (in pixels) of the wysiwyg editor and defaults to 100%.\"},\"properties5\":{\"name\":\"height\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height (in pixels) of the wysiwyg editor and defaults to 250px.\"},\"properties6\":{\"name\":\"cols\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width of the editor (in columns).\"},\"properties7\":{\"name\":\"rows\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height of the editor (in rows).\"},\"properties8\":{\"name\":\"buttons\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) can be an array of plugin buttons to be excluded or set to false. The default editors-xtd are: article, image, pagebreak and readmore.\"},\"properties9\":{\"name\":\"hide\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) array of plugin buttons to be hidden. eg... set buttons=\\\"true\\\" hide=\\\"readmore,pagebreak\\\"\"},\"properties10\":{\"name\":\"editor\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"specifies the editor to be used and can include two options (editor=\\\"desired|alternative\\\")\"},\"properties11\":{\"name\":\"filter\",\"example\":\"safehtml\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties15\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides an editor area field.', '', 1, 5, '', ''), -(9, '', 'The hidden form field type provides a hidden field for saving a field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the params.ini file). If the parameter has a saved value this is entered i', 'Hidden', '{\"properties0\":{\"name\":\"type\",\"example\":\"hidden\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be hidden.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mysecretvariable\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"default\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the data which needs to be collected.\"}}', 'provides a hidden field for saving a form field whose value cannot be altered directly by a user.', '', 1, 1, '', ''), +(9, '', 'The hidden form field type provides a hidden field for saving a field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the params.ini file). If the parameter has a saved value this is entered i', 'Hidden', '{\"properties0\":{\"name\":\"type\",\"example\":\"hidden\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be hidden.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mysecretvariable\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"default\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the data which needs to be collected.\"},\"properties5\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties4\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"}}', 'provides a hidden field for saving a form field whose value cannot be altered directly by a user.', '', 1, 2, '', ''), (10, '', 'The integer form field type provides a select box with a range of integer values. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Integer', '{\"properties0\":{\"name\":\"type\",\"example\":\"integer\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be integer.\"},\"properties1\":{\"name\":\"name\",\"example\":\"size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties12\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties13\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties7\":{\"name\":\"first\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties8\":{\"name\":\"last\",\"example\":\"20\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties9\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties10\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides a drop down list of integers between a minimum and maximum.', '', 1, 3, '', ''), (11, '', 'The list form field type provides a drop down list or a list box of custom-defined entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'List', '{\"properties0\":{\"name\":\"type\",\"example\":\"list\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be list.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mylist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties13\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties4\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties14\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties8\":{\"name\":\"option\",\"example\":\"0|Option 1,1|Option 2,2|Option 1\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties9\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties10\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties11\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of custom-defined entries.', '', 1, 5, '', ''), (12, '', 'The media form field type provides modal access to the media manager for the choice of an image. Users with appropriate permissions will be able to upload files.', 'Media', '{\"properties0\":{\"name\":\"type\",\"example\":\"media\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be media.\"},\"properties1\":{\"name\":\"name\",\"example\":\"media\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Media\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"directory\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the directory from which the user will be able to choose a file. This attribute should be relative to the top level \\/images\\/ folder.\"},\"properties5\":{\"name\":\"preview\",\"example\":\"false\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) shows or hides the preview of the currently chosen image. (\\\"true\\\": Show always, \\\"tooltip\\\": Show as tooltip, \\\"false\\\": Show never) (since Joomla! 2.5.5)\"},\"properties6\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.', '', 1, 2, '', ''), diff --git a/admin/sql/updates/mysql/2.7.1.sql b/admin/sql/updates/mysql/2.7.1.sql new file mode 100644 index 000000000..d3f5a12fa --- /dev/null +++ b/admin/sql/updates/mysql/2.7.1.sql @@ -0,0 +1 @@ + diff --git a/admin/views/field/tmpl/edit.php b/admin/views/field/tmpl/edit.php index e717e7537..119778e00 100644 --- a/admin/views/field/tmpl/edit.php +++ b/admin/views/field/tmpl/edit.php @@ -58,37 +58,50 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');