forked from joomla/Component-Builder
Improved the fields builder area in the new assistant area.
This commit is contained in:
parent
cf94654c61
commit
5fa49f1bca
@ -144,12 +144,12 @@ 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*: 8th January, 2020
|
||||
+ *Last Build*: 11th January, 2020
|
||||
+ *Version*: 2.10.10
|
||||
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **280873**
|
||||
+ *Field count*: **1503**
|
||||
+ *Line count*: **281402**
|
||||
+ *Field count*: **1505**
|
||||
+ *File count*: **1769**
|
||||
+ *Folder count*: **280**
|
||||
|
||||
|
@ -144,12 +144,12 @@ 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*: 8th January, 2020
|
||||
+ *Last Build*: 11th January, 2020
|
||||
+ *Version*: 2.10.10
|
||||
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **280873**
|
||||
+ *Field count*: **1503**
|
||||
+ *Line count*: **281402**
|
||||
+ *Field count*: **1505**
|
||||
+ *File count*: **1769**
|
||||
+ *Folder count*: **280**
|
||||
|
||||
|
@ -56,7 +56,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
$this->registerTask('getExistingValidationRuleCode', 'ajax');
|
||||
$this->registerTask('getValidationRulesTable', 'ajax');
|
||||
$this->registerTask('checkRuleName', 'ajax');
|
||||
$this->registerTask('fieldOptions', 'ajax');
|
||||
$this->registerTask('fieldTypeProperties', 'ajax');
|
||||
$this->registerTask('getFieldPropertyDesc', 'ajax');
|
||||
$this->registerTask('getCodeGlueOptions', 'ajax');
|
||||
$this->registerTask('snippetDetails', 'ajax');
|
||||
@ -1272,14 +1272,14 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'fieldOptions':
|
||||
case 'fieldTypeProperties':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$idValue = $jinput->get('id', NULL, 'INT');
|
||||
if($idValue)
|
||||
{
|
||||
$result = $this->getModel('ajax')->getFieldOptions($idValue);
|
||||
$result = $this->getModel('ajax')->getFieldTypeProperties($idValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2173,12 +2173,12 @@ abstract class ComponentbuilderHelper
|
||||
|
||||
|
||||
/**
|
||||
* get field options
|
||||
* get field type properties
|
||||
*
|
||||
* @return array on success
|
||||
*
|
||||
*/
|
||||
public static function getFieldOptions($value, $type, $settings = array(), $xml = null, $db_defaults = false)
|
||||
public static function getFieldTypeProperties($value, $type, $settings = array(), $xml = null, $db_defaults = false)
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
@ -2338,6 +2338,100 @@ abstract class ComponentbuilderHelper
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get field types properties
|
||||
*
|
||||
* @return array on success
|
||||
*
|
||||
*/
|
||||
public static function getFieldTypesProperties($targets = array(), $filter = array(), $exclude = array(), $type = 'id', $operator = 'IN')
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('id','properties')));
|
||||
$query->from($db->quoteName('#__componentbuilder_fieldtype'));
|
||||
$query->where($db->quoteName('published') . ' = 1');
|
||||
// make sure we have ids (or get all)
|
||||
if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator)
|
||||
{
|
||||
$query->where($db->quoteName($type) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","',$targets) . '")');
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where($db->quoteName($type) . ' ' . $operator . ' (' . implode(',',$targets) . ')');
|
||||
}
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
$_types = array();
|
||||
$_properties = array();
|
||||
$types = $db->loadObjectList('id');
|
||||
foreach ($types as $id => $type)
|
||||
{
|
||||
$properties = json_decode($type->properties);
|
||||
foreach ($properties as $property)
|
||||
{
|
||||
if (!isset($_types[$id]))
|
||||
{
|
||||
$_types[$id] = array();
|
||||
}
|
||||
// add if no objection is found
|
||||
$add = true;
|
||||
// check if we have exclude
|
||||
if (self::checkArray($exclude) && in_array($property->name, $exclude))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// check if we have filter
|
||||
if (self::checkArray($filter))
|
||||
{
|
||||
foreach($filter as $key => $val)
|
||||
{
|
||||
if (!isset($property->$key) || $property->$key != $val)
|
||||
{
|
||||
$add = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// now add the property
|
||||
if ($add)
|
||||
{
|
||||
$_types[$id][$property->name] = array('name' => ucfirst($property->name), 'example' => $property->example, 'description' => $property->description);
|
||||
// set mandatory
|
||||
if (isset($property->mandatory) && $property->mandatory == 1)
|
||||
{
|
||||
$_types[$id][$property->name]['mandatory'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_types[$id][$property->name]['mandatory'] = false;
|
||||
}
|
||||
// set translatable
|
||||
if (isset($property->translatable) && $property->translatable == 1)
|
||||
{
|
||||
$_types[$id][$property->name]['translatable'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_types[$id][$property->name]['translatable'] = false;
|
||||
}
|
||||
$_properties[$property->name] = $_types[$id][$property->name]['name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return found types & properties
|
||||
return array('types' => $_types, 'properties' => $_properties);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The zipper method
|
||||
*
|
||||
@ -3562,6 +3656,64 @@ abstract class ComponentbuilderHelper
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the field types id -> name of a group or groups
|
||||
*
|
||||
* @return array ids of the spacer field types
|
||||
*/
|
||||
public static function getFieldTypesByGroup($groups = array())
|
||||
{
|
||||
// make sure we have a group
|
||||
if (($ids = self::getFieldTypesIdsByGroup($groups)) !== false)
|
||||
{
|
||||
// get the database object to use quote
|
||||
$db = JFactory::getDbo();
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('id', 'name')));
|
||||
$query->from($db->quoteName('#__componentbuilder_fieldtype'));
|
||||
$query->where($db->quoteName('published') . ' = 1');
|
||||
$query->where($db->quoteName('id') . ' IN (' . implode(',',$ids) . ')');
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
return $db->loadAssocList('id', 'name');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the field types IDs of a group or groups
|
||||
*
|
||||
* @return array ids of the spacer field types
|
||||
*/
|
||||
public static function getFieldTypesIdsByGroup($groups = array())
|
||||
{
|
||||
// make sure we have a group
|
||||
if (self::checkArray($groups))
|
||||
{
|
||||
$merge_groups = array();
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
if (isset(self::$fieldGroups[$group]))
|
||||
{
|
||||
$merge_groups[] = self::$fieldGroups[$group];
|
||||
}
|
||||
}
|
||||
// make sure we have these types of groups
|
||||
if (self::checkArray($merge_groups))
|
||||
{
|
||||
// get the database object to use quote
|
||||
$db = JFactory::getDbo();
|
||||
return self::getVars('fieldtype', (array) array_map(function($name) use($db) { return $db->quote(ucfirst($name)); }, self::mergeArrays($merge_groups)), 'name', 'id');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the spacer IDs
|
||||
*
|
||||
@ -3569,9 +3721,7 @@ abstract class ComponentbuilderHelper
|
||||
*/
|
||||
public static function getSpacerIds()
|
||||
{
|
||||
// get the database object to use quote
|
||||
$db = JFactory::getDbo();
|
||||
return self::getVars('fieldtype', (array) array_map(function($name) use($db) { return $db->quote(ucfirst($name)); }, self::$fieldGroups['spacer']), 'name', 'id');
|
||||
return self::getFieldTypesIdsByGroup($groups = array('spacer'));
|
||||
}
|
||||
|
||||
|
||||
|
@ -281,7 +281,7 @@ class Builder extends Mapping
|
||||
$settings['default'] = ($field['default'] == 'Other') ? $field['defaultOther'] : $field['default'];
|
||||
$settings['hint'] = $field['label'] .' Here!';
|
||||
// okay set the xml field values
|
||||
if ($fieldOptions = ComponentbuilderHelper::getFieldOptions($fieldId, 'id', $settings))
|
||||
if ($fieldOptions = ComponentbuilderHelper::getFieldTypeProperties($fieldId, 'id', $settings))
|
||||
{
|
||||
return json_encode($fieldOptions['values']);
|
||||
}
|
||||
|
@ -1755,7 +1755,6 @@ COM_COMPONENTBUILDER_CLONE="Clone"
|
||||
COM_COMPONENTBUILDER_CLONE_FAILED="Clone failed!"
|
||||
COM_COMPONENTBUILDER_CLOSE_NEW="Close & New"
|
||||
COM_COMPONENTBUILDER_CODE="Code"
|
||||
COM_COMPONENTBUILDER_COLUMN="Column"
|
||||
COM_COMPONENTBUILDER_COMMUNITY_PACKAGES="Community Packages"
|
||||
COM_COMPONENTBUILDER_COMPANY="Company"
|
||||
COM_COMPONENTBUILDER_COMPANY_NAME="Company Name"
|
||||
@ -4755,6 +4754,7 @@ COM_COMPONENTBUILDER_EDIT_S_FOR_THIS_S="Edit %s for this %s"
|
||||
COM_COMPONENTBUILDER_EDIT_VERSIONS="Edit Version"
|
||||
COM_COMPONENTBUILDER_EDIT_VERSIONS_DESC="Allows users in this group to edit versions."
|
||||
COM_COMPONENTBUILDER_EDIT_VIEW="Edit View"
|
||||
COM_COMPONENTBUILDER_EIGHT_COLUMN="Eight Column"
|
||||
COM_COMPONENTBUILDER_EMAIL="Email"
|
||||
COM_COMPONENTBUILDER_EMAIL_S="Email %s"
|
||||
COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SEND="Email with the new key was send"
|
||||
@ -4769,6 +4769,7 @@ COM_COMPONENTBUILDER_EQUAL_MEANS_THAT_THE_COMMUNITY_PLAN_WITH_THE_SAME_NAME_CATE
|
||||
COM_COMPONENTBUILDER_EQUAL_MEANS_THAT_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_AND_YOUR_LOCAL_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_THE_SAME_BCREATIONB_AND_BMODIFIED_DATEB="Equal means that the community snippet (with the same name, library and type) and your local snippet (with the same name, library and type) has the same <b>creation</b> and <b>modified date</b>."
|
||||
COM_COMPONENTBUILDER_ERROR="Error"
|
||||
COM_COMPONENTBUILDER_ERROR_BR_S="Error! <br />%s"
|
||||
COM_COMPONENTBUILDER_ERROR_FIELD_TYPE_DOES_NOT_EXIST="Error field type does not exist."
|
||||
COM_COMPONENTBUILDER_ERROR_THE_PATH_HAS_A_MISMATCH_AND_COULD_THEREFORE_NOT_RETRIEVE_THE_SNIPPET_FROM_GITHUB="Error! The path has a mismatch and could therefore not retrieve the snippet from gitHub!"
|
||||
COM_COMPONENTBUILDER_ERROR_THE_SNIPPET_IS_FAULTY_AND_COULD_NOT_BE_SAVED="Error! The snippet is faulty and could not be saved."
|
||||
COM_COMPONENTBUILDER_ERROR_YOU_DO_NOT_HAVE_ACCESS_TO_THE_SNIPPETS="Error! You do not have access to the snippets."
|
||||
@ -5281,16 +5282,19 @@ COM_COMPONENTBUILDER_FIELD_WHMCSKEY_ENCRYPTION="WHMCS-key Encryption"
|
||||
COM_COMPONENTBUILDER_FIELD_XML="Xml"
|
||||
COM_COMPONENTBUILDER_FIELD_YES="Yes"
|
||||
COM_COMPONENTBUILDER_FIELD_ZERO="0"
|
||||
COM_COMPONENTBUILDER_FIFTH_COLUMN="Fifth Column"
|
||||
COM_COMPONENTBUILDER_FILE="File"
|
||||
COM_COMPONENTBUILDER_FILE_BSB_COULD_NOT_BE_UNLOCKED="File <b>%s</b> could not be unlocked!"
|
||||
COM_COMPONENTBUILDER_FILE_BSB_WAS_MOVED_TO_BSB="File <b>%s</b> was moved to <b>%s</b>"
|
||||
COM_COMPONENTBUILDER_FILE_BSB_WAS_NOT_MOVED_TO_BSB="File <b>%s</b> was not moved to <b>%s</b>"
|
||||
COM_COMPONENTBUILDER_FILE_BSB_WAS_SUCCESSFULLY_UNLOCKED="File <b>%s</b> was successfully unlocked!"
|
||||
COM_COMPONENTBUILDER_FILTER="Filter"
|
||||
COM_COMPONENTBUILDER_FIRSTTITLE_COLUMN="First/Title Column"
|
||||
COM_COMPONENTBUILDER_FOLDER="Folder"
|
||||
COM_COMPONENTBUILDER_FOLDER_BSB_WAS_MOVED_TO_BSB="Folder <b>%s</b> was moved to <b>%s</b>"
|
||||
COM_COMPONENTBUILDER_FOLDER_BSB_WAS_NOT_MOVED_TO_BSB="Folder <b>%s</b> was not moved to <b>%s</b>"
|
||||
COM_COMPONENTBUILDER_FORCE_LOCAL_UPDATE="Force Local Update"
|
||||
COM_COMPONENTBUILDER_FORTH_COLUMN="Forth Column"
|
||||
COM_COMPONENTBUILDER_FREEOPEN="Free/Open"
|
||||
COM_COMPONENTBUILDER_FULL_WIDTH_IN_TAB="Full Width in Tab"
|
||||
COM_COMPONENTBUILDER_FUNCTION_NAME_ALREADY_TAKEN_PLEASE_TRY_AGAIN="Function name already taken, please try again."
|
||||
@ -5337,6 +5341,7 @@ COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK="Great, this placeholder w
|
||||
COM_COMPONENTBUILDER_GREAT_THIS_VALIDATION_RULE_NAME_S_WILL_WORK="Great, this validation rule name (%s) will work!"
|
||||
COM_COMPONENTBUILDER_GROUP="group"
|
||||
COM_COMPONENTBUILDER_HAS_METADATA="Has Metadata"
|
||||
COM_COMPONENTBUILDER_HAS_THESE_AVAILABLE_PROPERTIES="has these available properties"
|
||||
COM_COMPONENTBUILDER_HELP_DOCUMENT="Help Document"
|
||||
COM_COMPONENTBUILDER_HELP_DOCUMENTS="Help Documents"
|
||||
COM_COMPONENTBUILDER_HELP_DOCUMENTS_ACCESS="Help Documents Access"
|
||||
@ -5518,6 +5523,7 @@ COM_COMPONENTBUILDER_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE="Package to import not
|
||||
COM_COMPONENTBUILDER_IMPORT_UPDATE_DATA="Import Data"
|
||||
COM_COMPONENTBUILDER_IMPORT_UPLOAD_BOTTON="Upload File"
|
||||
COM_COMPONENTBUILDER_INACTIVE="Inactive"
|
||||
COM_COMPONENTBUILDER_INACTIVE_COLUMN="inactive column"
|
||||
COM_COMPONENTBUILDER_IN_SYNC="In Sync"
|
||||
COM_COMPONENTBUILDER_ISOLATE="Isolate"
|
||||
COM_COMPONENTBUILDER_ISSUE="issue"
|
||||
@ -7736,6 +7742,7 @@ COM_COMPONENTBUILDER_LOCAL_GET="Local (get)"
|
||||
COM_COMPONENTBUILDER_LOCAL_PLAN="Local plan"
|
||||
COM_COMPONENTBUILDER_LOCAL_SNIPPET="Local snippet"
|
||||
COM_COMPONENTBUILDER_MAIN_MENU="Main Menu"
|
||||
COM_COMPONENTBUILDER_MAKE_SURE_THAT_YOU_USE_THE_BCORRECT_PROPERTY_NAMEB_THAT_EXIST_IN_JCB_FOR_THIS_FIELD_TYPE="Make sure that you use the <b>correct property name</b> that exist in JCB for this field type."
|
||||
COM_COMPONENTBUILDER_MATCH_BEHAVIOUR="Match Behaviour"
|
||||
COM_COMPONENTBUILDER_MATCH_FIELD="Match Field"
|
||||
COM_COMPONENTBUILDER_MATCH_OPTIONS="Match Options"
|
||||
@ -7763,6 +7770,7 @@ COM_COMPONENTBUILDER_NONE_DB="None DB"
|
||||
COM_COMPONENTBUILDER_NONE_SELECTED="None selected"
|
||||
COM_COMPONENTBUILDER_NOTICE_BOARD="Notice Board"
|
||||
COM_COMPONENTBUILDER_NOTRANSLATION="no-translation"
|
||||
COM_COMPONENTBUILDER_NOT_AVAILABLE="not available"
|
||||
COM_COMPONENTBUILDER_NOT_FOUND_OR_ACCESS_DENIED="Not found, or access denied."
|
||||
COM_COMPONENTBUILDER_NOT_SET="not set"
|
||||
COM_COMPONENTBUILDER_NO_ACCESS_GRANTED="No Access Granted!"
|
||||
@ -7772,6 +7780,7 @@ COM_COMPONENTBUILDER_NO_COMPONENT_WAS_SELECTED_PLEASE_MAKE_A_SELECTION_OF_ONE_CO
|
||||
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_FIELDS_SET="no fields set"
|
||||
COM_COMPONENTBUILDER_NO_FILES_LINKED="No Files Linked"
|
||||
COM_COMPONENTBUILDER_NO_FOUND="No Found"
|
||||
COM_COMPONENTBUILDER_NO_ITEM_FOUND="No Item Found"
|
||||
@ -7802,6 +7811,8 @@ COM_COMPONENTBUILDER_OPTIONS="Options"
|
||||
COM_COMPONENTBUILDER_ORDER_BEFORE="Order Before"
|
||||
COM_COMPONENTBUILDER_ORDER_IN_EDIT="Order in Edit"
|
||||
COM_COMPONENTBUILDER_ORDER_IN_LIST_VIEWS="Order in list views"
|
||||
COM_COMPONENTBUILDER_OTHER="Other"
|
||||
COM_COMPONENTBUILDER_OTHER_VIEW="Other View"
|
||||
COM_COMPONENTBUILDER_OUT_OF_DATE="Out of Date"
|
||||
COM_COMPONENTBUILDER_OVERVIEW="Overview"
|
||||
COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET="Owner details was set"
|
||||
@ -7942,6 +7953,8 @@ 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_PROPERTY_VALUE_IS_MANDATORY="Property Value is Mandatory"
|
||||
COM_COMPONENTBUILDER_PROPERTY_VALUE_IS_TRANSLATABLE="Property Value is Translatable"
|
||||
COM_COMPONENTBUILDER_PUBLIC_ACCESS="Public Access"
|
||||
COM_COMPONENTBUILDER_PUBLISHED="Published"
|
||||
COM_COMPONENTBUILDER_PUBLISHING="Publishing"
|
||||
@ -7965,6 +7978,7 @@ COM_COMPONENTBUILDER_SAVE_SUCCESS="Great! Item successfully saved."
|
||||
COM_COMPONENTBUILDER_SAVE_WARNING="The value already existed so please select another."
|
||||
COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_TO_GITHUB_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO_TO_RETRIEVE_S="%s<br />You can add a <b>gitHub Access Token</b> to Componentbuilder global options to make authenticated requests to gitHub. An access token with only public access will do to retrieve %s."
|
||||
COM_COMPONENTBUILDER_SEARCHABLE="Searchable"
|
||||
COM_COMPONENTBUILDER_SECOND_COLUMN="Second Column"
|
||||
COM_COMPONENTBUILDER_SEE_ALL_IMPORT_INFO="See All Import Info"
|
||||
COM_COMPONENTBUILDER_SELECTION="selection"
|
||||
COM_COMPONENTBUILDER_SELECT_AN_OPTION="Select an option"
|
||||
@ -8121,7 +8135,9 @@ COM_COMPONENTBUILDER_SERVER_USERNAME_MESSAGE="Error! Please add the username her
|
||||
COM_COMPONENTBUILDER_SERVER_VERSION_DESC="A count of the number of times this Server has been revised."
|
||||
COM_COMPONENTBUILDER_SERVER_VERSION_LABEL="Version"
|
||||
COM_COMPONENTBUILDER_SET_A_CLASS_VALUE_FOR_THE_LIST_VIEW_OF_THIS_FIELD="Set a class value for the list view of this field."
|
||||
COM_COMPONENTBUILDER_SEVENT_COLUMN="Sevent Column"
|
||||
COM_COMPONENTBUILDER_SHARE_SNIPPETS="Share Snippets"
|
||||
COM_COMPONENTBUILDER_SHORT_DESCRIPTION="Short Description"
|
||||
COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code."
|
||||
COM_COMPONENTBUILDER_SHOULD_THE_COMPONENT_BE_MOVED_TO_YOUR_LOCAL_REPOSITORY_FOLDER="Should the component be moved to your local repository folder?"
|
||||
COM_COMPONENTBUILDER_SHOULD_THE_JAVASCRIPT_BE_MINIFIED_IN_THE_COMPONENT="Should the JavaScript be minified in the component."
|
||||
@ -8600,6 +8616,7 @@ COM_COMPONENTBUILDER_SITE_VIEW_YES="Yes"
|
||||
COM_COMPONENTBUILDER_SITE_VIEW_YOUTUBE="Youtube"
|
||||
COM_COMPONENTBUILDER_SITE_VIEW_ZOOM_IN="Zoom In"
|
||||
COM_COMPONENTBUILDER_SITE_VIEW_ZOOM_OUT="Zoom Out"
|
||||
COM_COMPONENTBUILDER_SITH_COLUMN="Sith Column"
|
||||
COM_COMPONENTBUILDER_SMART_PACKAGE_OPTIONS="Smart Package Options"
|
||||
COM_COMPONENTBUILDER_SNIPPET="Snippet"
|
||||
COM_COMPONENTBUILDER_SNIPPETS="Snippets"
|
||||
@ -9035,11 +9052,11 @@ COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_VALID
|
||||
COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_EXIST="The url (%s) set to retrieve the packages does not exist!"
|
||||
COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_DATA="The url (%s) set to retrieve the packages does not return any data!"
|
||||
COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING="The wiki is loading"
|
||||
COM_COMPONENTBUILDER_THIRD_COLUMN="Third Column"
|
||||
COM_COMPONENTBUILDER_THIS_BSB_IS_NOT_LINKED_TO_ANY_OTHER_AREAS_OF_JCB_AT_THIS_TIME="This <b>%s</b> is not linked to any other areas of JCB at this time!"
|
||||
COM_COMPONENTBUILDER_THIS_PACKAGE_BPASSEDB_THE_CHECKSUM_VALIDATIONBR_BR_SMALLMANUALLY_ALSO_VALIDATE_THAT_THE_CORRECT_CHECKSUM_WAS_USEDSMALLBR_THIS_CHECKSUM_BSB_MUST_BE_THE_SAME_AS_THE_ONE_FOUND_A_S_SA="This package <b>PASSED</b> the checksum validation!<br /><br /><small>Manually also validate that the correct checksum was used.</small><br />This checksum: <b>%s</b> must be the same as the one found @ <a %s %s</a>"
|
||||
COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key."
|
||||
COM_COMPONENTBUILDER_TITLE="Title"
|
||||
COM_COMPONENTBUILDER_TITLE_COLUMN="Title Column"
|
||||
COM_COMPONENTBUILDER_TOTAL_DOWNLOADS="total downloads"
|
||||
COM_COMPONENTBUILDER_TO_ADD_SIMPLY_COPY_AND_PAST_THE_SNIPPET_INTO_YOUR_CODE="To add simply copy and past the snippet into your code."
|
||||
COM_COMPONENTBUILDER_TO_ADD_VALIDATION_TO_A_FIELD_IF_VALIDATION_IS_NOT_PART_OF_FIELD_TYPE_PROPERTIES_LOADED_ABOVE_SO_IF_YOU_HAVE_VALIDATION_SET_AS_A_FIELD_PROPERTY_THIS_EXTRA_PROPERTY_WILL_NOT_BE_NEEDED="To add validation to a field if validation is not part of field type properties loaded above. So if you have validation set as a field property this extra property will not be needed."
|
||||
@ -9239,6 +9256,7 @@ COM_COMPONENTBUILDER_WE_SUCCESSFULLY_MOVED_BSB="We successfully moved <b>%s</b>!
|
||||
COM_COMPONENTBUILDER_YES="Yes"
|
||||
COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEYBR_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY="Your data is encrypted with a AES 128 bit encryption using the above 32 character key.<br />Without this key it will take the current technology with a brute force attack method more then <a href="http://random-ize.com/how-long-to-hack-pass/" target="_blank" title="How long to hack pass">700 000 000 000 000 000 000 000 000 000 000</a> years to crack theoretically."
|
||||
COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY_UNLESS_THEY_HAVE_THIS_KEY_ABOVE_SO_DO_KEEP_IT_SAFE="Your data is encrypted with a AES 128 bit encryption using the above 32 character key. Without this key it will take the current technology with a brute force attack method more then <a href="http://random-ize.com/how-long-to-hack-pass/" target="_blank" title="How long to hack pass">700 000 000 000 000 000 000 000 000 000 000</a> years to crack theoretically. Unless they have this key above, so do keep it safe."
|
||||
COM_COMPONENTBUILDER_YOUR_SHORT_DESCRIPTION_HERE="Your Short Description Here"
|
||||
COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LIKE_TO_IMPORTBR_SMALLPLEASE_NOTE_THAT_SMART_COMPONENT_IMPORT_ONLY_WORKS_WITH_THE_FOLLOWING_FORMAT_BZIPBSMALL="You can now select the component <b>zip</b> package you would like to import.<br /><small>Please note that smart component import only works with the following format: <b>(.zip)</b></small>"
|
||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="You do not have permission to access the server details (<b>%s - denied</b>), please contact your system administrator for more info."
|
||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_CLONE_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to clone a component, please contact your system administrator for more help."
|
||||
|
@ -33,7 +33,7 @@ extract($displayData);
|
||||
$subform_fields = array(
|
||||
'left' => array('name'),
|
||||
'right' => array('list_name'),
|
||||
'bottom' => array('builder'),
|
||||
'bottom' => array('short_description', 'builder'),
|
||||
'modal' => array('fields' => array('fields'), 'listview' => array('columns'), 'display' => array('display'))
|
||||
);
|
||||
|
||||
|
@ -2933,12 +2933,12 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
'display' => 'COM_COMPONENTBUILDER_DISPLAY_SWITCH_FOR_DYNAMIC_PLACEMENT_IN_RELATION_TO_THE_USE_OF_THE_FIELD_IN_MENU_AND_GLOBAL_CONFIGURATION_OPTIONS_SO_THE_CONFIG_OPTION_WILL_ONLY_ADD_THE_FIELD_TO_THE_GLOBAL_CONFIGURATION_AREA_MENU_WILL_ADD_THE_FIELD_ONLY_TO_THE_MENU_AREA',
|
||||
'validate' => 'COM_COMPONENTBUILDER_TO_ADD_VALIDATION_TO_A_FIELD_IF_VALIDATION_IS_NOT_PART_OF_FIELD_TYPE_PROPERTIES_LOADED_ABOVE_SO_IF_YOU_HAVE_VALIDATION_SET_AS_A_FIELD_PROPERTY_THIS_EXTRA_PROPERTY_WILL_NOT_BE_NEEDED');
|
||||
|
||||
public function getFieldOptions($fieldtype)
|
||||
public function getFieldTypeProperties($fieldtype)
|
||||
{
|
||||
// get the xml
|
||||
$xml = $this->getFieldXML($fieldtype);
|
||||
// now get the field options
|
||||
if ($field = ComponentbuilderHelper::getFieldOptions($fieldtype, 'id', null, $xml, true))
|
||||
if ($field = ComponentbuilderHelper::getFieldTypeProperties($fieldtype, 'id', null, $xml, true))
|
||||
{
|
||||
// get subform field properties object
|
||||
$properties = $this->buildFieldOptionsSubform($field['subform'], $field['nameListOptions']);
|
||||
|
@ -788,7 +788,7 @@ jQuery(document).ready(function()
|
||||
{
|
||||
// get type value
|
||||
var fieldtype = jQuery("#jform_fieldtype option:selected").val();
|
||||
getFieldOptions(fieldtype, false);
|
||||
getFieldTypeProperties(fieldtype, false);
|
||||
// get the linked details
|
||||
getLinked();
|
||||
// get the validation rules
|
||||
@ -806,8 +806,8 @@ jQuery(document).ready(function()
|
||||
// the options row id key
|
||||
var rowIdKey = 'properties';
|
||||
|
||||
function getFieldOptions(fieldtype, db){
|
||||
getCodeFrom_server(fieldtype, 'type', 'type', 'fieldOptions').done(function(result) {
|
||||
function getFieldTypeProperties(fieldtype, db){
|
||||
getCodeFrom_server(fieldtype, 'type', 'type', 'fieldTypeProperties').done(function(result) {
|
||||
if(result.subform){
|
||||
// load the list of properties
|
||||
propertiesArray = result.nameListOptions;
|
||||
|
@ -2142,7 +2142,7 @@ INSERT INTO `#__componentbuilder_fieldtype` (`id`, `catid`, `description`, `name
|
||||
(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.\"},\"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 label.\"},\"properties5\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties6\":{\"name\":\"width\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width (in pixels) of the wysiwyg editor and defaults to 100%.\"},\"properties7\":{\"name\":\"height\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height (in pixels) of the wysiwyg editor and defaults to 250px.\"},\"properties8\":{\"name\":\"cols\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width of the editor (in columns).\"},\"properties9\":{\"name\":\"rows\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height of the editor (in rows).\"},\"properties10\":{\"name\":\"buttons\",\"example\":\"no\",\"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.\"},\"properties11\":{\"name\":\"syntax\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) can be used to set the code syntax matching for this field.\"},\"properties12\":{\"name\":\"hide\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) array of plugin buttons to be hidden. eg... set buttons=\\\"true\\\" hide=\\\"readmore,pagebreak\\\"\"},\"properties13\":{\"name\":\"editor\",\"example\":\"codemirror|none\",\"adjustable\":\"1\",\"description\":\"specifies the editor to be used and can include two options (editor=\\\"desired|alternative\\\")\"},\"properties14\":{\"name\":\"filter\",\"example\":\"safehtml\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties15\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties16\":{\"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.\"},\"properties17\":{\"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, 10, '', '', '51f288d2-6eaa-42bc-a182-a6f69b3032b8'),
|
||||
(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, '', '', '82f1b5ca-bb9b-44d7-9a7a-9a03fb2a31dd'),
|
||||
(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.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"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.\"},\"properties6\":{\"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\'.\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"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.\"},\"properties9\":{\"name\":\"first\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties10\":{\"name\":\"last\",\"example\":\"20\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties11\":{\"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.\"},\"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)\"}}', 'provides a drop down list of integers between a minimum and maximum.', '', 1, 5, '', '', 'fdbb50ea-35d2-45b2-a0bc-076fdf1544b8'),
|
||||
(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.\"},\"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\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"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\":\"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.\"},\"properties14\":{\"name\":\"useglobal\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) if set to true, it will show the value that is set in the global configuration if found in the database.\"},\"properties11\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties12\":{\"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+\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of custom-defined entries.', '', 1, 7, '', '', 'a51dfc06-1b9b-4d0a-86ba-f705bcd40d4d'),
|
||||
(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.\"},\"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\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"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\":\"option\",\"example\":\"0|Option 1,1|Option 2,2|Option 1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties11\":{\"name\":\"useglobal\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) if set to true, it will show the value that is set in the global configuration if found in the database.\"},\"properties12\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties13\":{\"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+\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of custom-defined entries.', '', 1, 8, '', '', 'a51dfc06-1b9b-4d0a-86ba-f705bcd40d4d'),
|
||||
(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\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be media.\"},\"properties1\":{\"name\":\"name\",\"example\":\"media\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"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\",\"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\",\"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\",\"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\",\"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, 3, '', '', '69957007-e3d4-4976-a32b-611d02dbad71'),
|
||||
(13, '', 'Provides a meter to show value in a range, updated with jQuery if needed or simply a fixed value.', 'Meter', '{\"properties0\":{\"name\":\"type\",\"example\":\"meter\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be meter.\"},\"properties1\":{\"name\":\"name\",\"example\":\"meter\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Meter\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"width\",\"example\":\"330px\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the width of meter box\"},\"properties4\":{\"name\":\"color\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The background color\"},\"properties5\":{\"name\":\"default\",\"example\":\"9\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"animated\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) lets the bar have strips\"},\"properties7\":{\"name\":\"active\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) lets the strips on the bar move\"},\"properties8\":{\"name\":\"description\",\"example\":\"Enter some description\",\"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.\"},\"properties9\":{\"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 \'text_area\'.\"},\"properties10\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(mandatory) this value is the min on the meter.\"},\"properties11\":{\"name\":\"max\",\"example\":\"20\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(mandatory) this value is the max on meter.\"},\"properties12\":{\"name\":\"step\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a meter to show value in a range.', '', 1, 2, '', '', '81668284-e572-4e17-927b-ba697fc64bd0'),
|
||||
(14, '', 'This form field makes it possible to create titles, texts, descriptions and even alert boxes. It also allows you to bring order in the settings for extensions, by separating them with useful titles. Or adding descriptions for certain settings (without having to rely on the tooltips). Or adding any other text you want.', 'Note', '{\"properties0\":{\"name\":\"type\",\"example\":\"note\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be note\"},\"properties1\":{\"name\":\"name\",\"example\":\"note_one\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory or optional if using description) (translatable) is the descriptive title of the note \"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional if using label)(translatable) the description\\/text of the note \"},\"properties4\":{\"name\":\"heading\",\"example\":\"h4\",\"adjustable\":\"1\",\"description\":\"(optional) the type of heading element to use for the label (default: h4)\"},\"properties5\":{\"name\":\"class\",\"example\":\"alert\",\"adjustable\":\"1\",\"description\":\"(optional) a class name (or class names), like these examples ( alert, alert alert-info, alert alert-success, alert alert-error )\"},\"properties6\":{\"name\":\"close\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) a value of \'true\' (for alerts) or the value for the data-dismiss of the bootstrap close icon\"},\"properties7\":{\"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+\"}}', 'supports a one line text field.', '', 1, 4, '', '', 'f9ecacd0-8481-4157-8c71-d7aaefc2b7c3'),
|
||||
|
@ -10,454 +10,85 @@
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
function buildSubform()
|
||||
{
|
||||
// get the subform
|
||||
$subform = JFormHelper::loadFieldType('subform', true);
|
||||
// make sure the layout is created
|
||||
// JLayoutHelper::render('assistantsubformrepeatable', null);
|
||||
// start building the subform field XML
|
||||
$subformXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$subformAttribute = array(
|
||||
'type' => 'subform',
|
||||
'name' => 'views',
|
||||
'label' => 'COM_COMPONENTBUILDER_VIEW_BUILDER',
|
||||
'layout' => 'assistantsubformrepeatable',
|
||||
'multiple' => 'true',
|
||||
'icon' => 'list',
|
||||
'max' => 20,
|
||||
'min' => 1
|
||||
);
|
||||
// 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);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'text',
|
||||
'name' => 'name',
|
||||
'label' => 'COM_COMPONENTBUILDER_VIEW_NAME',
|
||||
'size' => '40',
|
||||
'maxlength' => '150',
|
||||
'class' => 'text_area',
|
||||
'hint' => 'COM_COMPONENTBUILDER_VIEW_NAME',
|
||||
'filter' => 'STRING'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $nameXML);
|
||||
|
||||
// view building the list name field XML
|
||||
$listnameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$listnameAttribute = array(
|
||||
'type' => 'text',
|
||||
'name' => 'list_name',
|
||||
'label' => 'COM_COMPONENTBUILDER_LIST_VIEW_NAME',
|
||||
'size' => '40',
|
||||
'maxlength' => '150',
|
||||
'class' => 'text_area',
|
||||
'hint' => 'COM_COMPONENTBUILDER_LIST_VIEW_NAME',
|
||||
'filter' => 'STRING'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($listnameXML, $listnameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $listnameXML);
|
||||
|
||||
// start building the builder area XML
|
||||
$noteXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$noteAttribute = array(
|
||||
'type' => 'note',
|
||||
'name' => 'builder',
|
||||
'label' => 'COM_COMPONENTBUILDER_BUILDER',
|
||||
'description' => '
|
||||
<div class="uk-button-group uk-width-1-1">
|
||||
<a id="button-fields-[[[VDM]]]" class="uk-button uk-button-small uk-width-1-3" href="#modal-fields-[[[VDM]]]" data-uk-modal onclick="setJCBuilder(this, 1)">' . JText::_('COM_COMPONENTBUILDER_FIELDS') . '</a>
|
||||
<a id="button-listview-[[[VDM]]]" class="uk-button uk-button-small uk-width-1-3" href="#modal-listview-[[[VDM]]]" data-uk-modal onclick="setJCBuilder(this, 2)">' . JText::_('COM_COMPONENTBUILDER_LIST_VIEW') . '</a>
|
||||
<a id="button-display-[[[VDM]]]" class="uk-button uk-button-small uk-width-1-3" href="#modal-display-[[[VDM]]]" data-uk-modal onclick="setJCBuilder(this, 3)">' . JText::_('COM_COMPONENTBUILDER_DISPLAY_VIEW') . '</a>
|
||||
</div><div class="builder"></div><br />',
|
||||
'heading' => 'h5'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($noteXML, $noteAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $noteXML);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// FIELDS SUBFORM START
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// start building the subform field XML
|
||||
$sub_subformXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$sub_subformAttribute = array(
|
||||
'type' => 'subform',
|
||||
'name' => 'fields',
|
||||
'label' => 'COM_COMPONENTBUILDER_FIELD_BUILDER',
|
||||
'layout' => 'joomla.form.field.subform.repeatable-table',
|
||||
'multiple' => 'true',
|
||||
'icon' => 'list',
|
||||
'max' => 20,
|
||||
'min' => 1
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_subformXML, $sub_subformAttribute);
|
||||
// now add the subform child form
|
||||
$sub_childform = $sub_subformXML->addChild('form');
|
||||
// child form attributes
|
||||
$sub_childformAttribute = array(
|
||||
'hidden' => 'true',
|
||||
'name' => 'list_properties',
|
||||
'repeat' => 'true');
|
||||
// load the child form attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_childform, $sub_childformAttribute);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'text',
|
||||
'name' => 'name',
|
||||
'label' => 'COM_COMPONENTBUILDER_FIELD_NAME',
|
||||
'size' => '40',
|
||||
'maxlength' => '150',
|
||||
'class' => 'text_area',
|
||||
'hint' => 'COM_COMPONENTBUILDER_FIELD_NAME',
|
||||
'filter' => 'STRING'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the field type XML
|
||||
$fieldtypeXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$fieldtypeAttribute = array(
|
||||
'type' => 'fieldtypes',
|
||||
'name' => 'fieldtype',
|
||||
'label' => 'COM_COMPONENTBUILDER_FIELD_TYPE',
|
||||
'multiple' => false,
|
||||
'required' => true,
|
||||
'class' => 'btn-group',
|
||||
'addfieldpath' => '/administrator/components/com_componentbuilder/models/fields'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($fieldtypeXML, $fieldtypeAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $fieldtypeXML);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// FIELDPROPERTIES SUBFORM START
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// start building the subform field XML
|
||||
$sub_sub_subformXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$sub_sub_subformAttribute = array(
|
||||
'type' => 'subform',
|
||||
'name' => 'properties',
|
||||
'label' => 'COM_COMPONENTBUILDER_PROPERTIES',
|
||||
'layout' => 'joomla.form.field.subform.repeatable',
|
||||
'multiple' => 'true',
|
||||
'icon' => 'list'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_sub_subformXML, $sub_sub_subformAttribute);
|
||||
// now add the subform child form
|
||||
$sub_sub_childform = $sub_sub_subformXML->addChild('form');
|
||||
// child form attributes
|
||||
$sub_sub_childformAttribute = array(
|
||||
'hidden' => 'true',
|
||||
'name' => 'list_properties',
|
||||
'repeat' => 'true');
|
||||
// load the child form attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_sub_childform, $sub_sub_childformAttribute);
|
||||
|
||||
// view building the list name field XML
|
||||
$propertiesXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$propertiesAttribute = array(
|
||||
'type' => 'text',
|
||||
'name' => 'property',
|
||||
'label' => 'COM_COMPONENTBUILDER_PROPERTY',
|
||||
'size' => '100',
|
||||
'maxlength' => '150',
|
||||
'class' => 'text_area',
|
||||
'hint' => 'COM_COMPONENTBUILDER_PROPERTY_NAME',
|
||||
'filter' => 'STRING'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($propertiesXML, $propertiesAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_sub_childform, $propertiesXML);
|
||||
|
||||
// view building the value field XML
|
||||
$valueXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$valueAttribute = array(
|
||||
'type' => 'text',
|
||||
'name' => 'value',
|
||||
'label' => 'COM_COMPONENTBUILDER_VALUE',
|
||||
'size' => '40',
|
||||
'maxlength' => '150',
|
||||
'class' => 'text_area',
|
||||
'hint' => 'COM_COMPONENTBUILDER_PROPERTY_VALUE',
|
||||
'filter' => 'STRING'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($valueXML, $valueAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_sub_childform, $valueXML);
|
||||
|
||||
// no add to main sub from
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $sub_sub_subformXML);
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// FIELDPROPERTIES SUBFORM END
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// no add to main sub from
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $sub_subformXML);
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// FIELDS SUBFORM END
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// LISTVIEW SUBFORM END
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// start building the subform field XML
|
||||
$sub_subformXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$sub_subformAttribute = array(
|
||||
'type' => 'subform',
|
||||
'name' => 'columns',
|
||||
'label' => 'COM_COMPONENTBUILDER_LIST_VIEW_COLUMNS',
|
||||
'layout' => 'joomla.form.field.subform.repeatable-table',
|
||||
'multiple' => 'true',
|
||||
'icon' => 'list',
|
||||
'max' => 2,
|
||||
'min' => 1
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_subformXML, $sub_subformAttribute);
|
||||
// now add the subform child form
|
||||
$sub_childform = $sub_subformXML->addChild('form');
|
||||
// child form attributes
|
||||
$sub_childformAttribute = array(
|
||||
'hidden' => 'true',
|
||||
'name' => 'list_properties',
|
||||
'repeat' => 'true');
|
||||
// load the child form attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_childform, $sub_childformAttribute);
|
||||
|
||||
// view building the name field XML
|
||||
$targetXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$targetAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'target',
|
||||
'label' => 'COM_COMPONENTBUILDER_TARGET',
|
||||
'description' => 'COM_COMPONENTBUILDER_AREA',
|
||||
'required' => true,
|
||||
'class' => 'list_class',
|
||||
'default' => '1'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($targetXML, $targetAttribute);
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($targetXML, array(1 => 'COM_COMPONENTBUILDER_ADMIN', 2 => 'COM_COMPONENTBUILDER_SITE'));
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $targetXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'viewfields',
|
||||
'name' => 'column_0',
|
||||
'label' => 'COM_COMPONENTBUILDER_TITLE_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => true,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'viewfields',
|
||||
'name' => 'column_1',
|
||||
'label' => 'COM_COMPONENTBUILDER_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'viewfields',
|
||||
'name' => 'column_2',
|
||||
'label' => 'COM_COMPONENTBUILDER_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'viewfields',
|
||||
'name' => 'column_3',
|
||||
'label' => 'COM_COMPONENTBUILDER_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'viewfields',
|
||||
'name' => 'column_4',
|
||||
'label' => 'COM_COMPONENTBUILDER_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'viewfields',
|
||||
'name' => 'column_5',
|
||||
'label' => 'COM_COMPONENTBUILDER_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'viewfields',
|
||||
'name' => 'column_6',
|
||||
'label' => 'COM_COMPONENTBUILDER_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'viewfields',
|
||||
'name' => 'column_7',
|
||||
'label' => 'COM_COMPONENTBUILDER_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
|
||||
// no add to main sub from
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $sub_subformXML);
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// LISTVIEW SUBFORM END
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// DISPLAY START
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// start building the display area XML
|
||||
$displayXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$displayAttribute = array(
|
||||
'type' => 'note',
|
||||
'name' => 'display',
|
||||
'label' => 'COM_COMPONENTBUILDER_ITEM_DISPLAY',
|
||||
'description' => '
|
||||
<b>More details soon, to help build the site/front display of a single item.</b>',
|
||||
'heading' => 'h5'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($displayXML, $displayAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $displayXML);
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// DISPLAY END
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// setup subform with values
|
||||
$subform->setup($subformXML, null, 'jcbform');
|
||||
|
||||
// return subfrom object
|
||||
return $subform;
|
||||
}
|
||||
// get the subform
|
||||
$subform = buildSubform();
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<div class="control-label">
|
||||
<?php echo $subform->label; ?>
|
||||
<?php echo $this->viewsSubform->label; ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $subform->input; ?>
|
||||
<?php echo $this->viewsSubform->input; ?>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function setJCBuilder(area, target){
|
||||
var active_view = 'view0';
|
||||
function setJCBuilder(area, view, target){
|
||||
// set the active view
|
||||
active_view = view;
|
||||
console.log(active_view);
|
||||
console.log(jQuery(area).attr('id'));
|
||||
console.log(target);
|
||||
}
|
||||
function setFieldTypeOptions(obj){
|
||||
// get type id
|
||||
var type_id = jQuery(obj).attr('id');
|
||||
// setup help ID
|
||||
var help_id = 'help_' + type_id;
|
||||
// clear past help messages
|
||||
jQuery('#' + help_id).remove();
|
||||
// get the type value
|
||||
var type_value = jQuery('#' + type_id).val();
|
||||
var type_text = jQuery('#' + type_id + ' option:selected').text();
|
||||
// show what is available
|
||||
if (typeof fieldtype_properties[type_value] === "undefined"){
|
||||
var help_note = '<div id="' + help_id + '">' + Joomla.JText._('COM_COMPONENTBUILDER_ERROR_FIELD_TYPE_DOES_NOT_EXIST') + '</div>';
|
||||
} else {
|
||||
var help_note = '<div id="' + help_id + '" data-uk-check-display>' + type_text + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_HAS_THESE_AVAILABLE_PROPERTIES') + ':<ul class="uk-list">';
|
||||
for (var key in fieldtype_properties[type_value]) {
|
||||
if (fieldtype_properties[type_value].hasOwnProperty(key)) {
|
||||
if (fieldtype_properties[type_value][key].mandatory){
|
||||
var mandatory = '<span style="color:red" data-uk-tooltip title="' + Joomla.JText._('COM_COMPONENTBUILDER_PROPERTY_VALUE_IS_MANDATORY') + '"><i class="uk-icon-asterisk"></i></span> ';
|
||||
} else {
|
||||
var mandatory = '<i class="uk-icon-angle-right"></i> ';
|
||||
}
|
||||
if (fieldtype_properties[type_value][key].translatable){
|
||||
var translatable = ' <span data-uk-tooltip title="' + Joomla.JText._('COM_COMPONENTBUILDER_PROPERTY_VALUE_IS_TRANSLATABLE') + '"><i class="uk-icon-language uk-icon-small"></i></span>';
|
||||
} else {
|
||||
var translatable = '';
|
||||
}
|
||||
help_note += '<li>' + mandatory + '<span data-uk-tooltip title="' + fieldtype_properties[type_value][key].description + '">' + fieldtype_properties[type_value][key].name + '</span>' + translatable + '</li>';
|
||||
}
|
||||
}
|
||||
help_note += '</ul></div>';
|
||||
}
|
||||
// add help note
|
||||
jQuery(help_note).insertAfter(jQuery('#' + type_id).closest('.control-group'));
|
||||
}
|
||||
function setPropertyDefaultValue(obj){
|
||||
// get property id
|
||||
var property_id = jQuery(obj).attr('id');
|
||||
// get the property value
|
||||
var property_value = jQuery('#' + property_id).val();
|
||||
// get base line
|
||||
var base = property_id.split('__properties__properties');
|
||||
// get the type id
|
||||
var type_id = base[0] + '__type';
|
||||
// get the type value
|
||||
var type_value = jQuery('#' + type_id).val();
|
||||
var type_text = jQuery('#' + type_id + ' option:selected').text();
|
||||
// get property value id
|
||||
var value_id = jQuery.string_replace('__property', '__value', property_id);
|
||||
// get the example/default value
|
||||
if (typeof fieldtype_properties[type_value] === "undefined" ||
|
||||
typeof fieldtype_properties[type_value][property_value] === "undefined"){
|
||||
var value = Joomla.JText._('COM_COMPONENTBUILDER_NOT_AVAILABLE');
|
||||
var readonly = true;
|
||||
} else {
|
||||
var value = fieldtype_properties[type_value][property_value].example;
|
||||
var readonly = false;
|
||||
}
|
||||
// set the property default value
|
||||
jQuery('#' + value_id).val(value);
|
||||
// make read only or not as needed
|
||||
document.getElementById(value_id).readOnly = readonly;
|
||||
}
|
||||
</script>
|
||||
|
@ -37,10 +37,10 @@ class ComponentbuilderViewAssistant extends JViewLegacy
|
||||
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=assistant');
|
||||
$this->sidebar = JHtmlSidebar::render();
|
||||
}
|
||||
// get the forms
|
||||
$this->forms = $this->setForms();
|
||||
//
|
||||
JHtml::_('jquery.ui', array('core', 'sortable'));
|
||||
// load jQuery sortable
|
||||
JHtml::_('jquery.ui', array('core', 'sortable'));
|
||||
// get the views forms
|
||||
$this->viewsSubform = $this->buildViewsSubform();
|
||||
|
||||
// We don't need toolbar in the modal window.
|
||||
if ($this->getLayout() !== 'modal')
|
||||
@ -61,14 +61,525 @@ class ComponentbuilderViewAssistant extends JViewLegacy
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
protected function setForms()
|
||||
protected function buildViewsSubform()
|
||||
{
|
||||
// get component form (just required fields)
|
||||
|
||||
// get admin form (just required fields)
|
||||
|
||||
// get field form (just required fields)
|
||||
|
||||
// get the subform
|
||||
$subform = JFormHelper::loadFieldType('subform', true);
|
||||
// make sure the layout is created
|
||||
// JLayoutHelper::render('assistantsubformrepeatable', null);
|
||||
// start building the subform field XML
|
||||
$subformXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$subformAttribute = array(
|
||||
'type' => 'subform',
|
||||
'name' => 'views',
|
||||
'label' => 'COM_COMPONENTBUILDER_VIEW_BUILDER',
|
||||
'layout' => 'assistantsubformrepeatable',
|
||||
'multiple' => 'true',
|
||||
'icon' => 'list',
|
||||
'max' => 20,
|
||||
'min' => 1
|
||||
);
|
||||
// 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);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'text',
|
||||
'name' => 'name',
|
||||
'label' => 'COM_COMPONENTBUILDER_VIEW_NAME',
|
||||
'size' => '40',
|
||||
'required' => true,
|
||||
'maxlength' => '150',
|
||||
'class' => 'text_area',
|
||||
'hint' => 'COM_COMPONENTBUILDER_VIEW_NAME',
|
||||
'filter' => 'STRING'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $nameXML);
|
||||
|
||||
// view building the list name field XML
|
||||
$listnameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$listnameAttribute = array(
|
||||
'type' => 'text',
|
||||
'name' => 'list_name',
|
||||
'label' => 'COM_COMPONENTBUILDER_LIST_VIEW_NAME',
|
||||
'size' => '40',
|
||||
'required' => true,
|
||||
'maxlength' => '150',
|
||||
'class' => 'text_area',
|
||||
'hint' => 'COM_COMPONENTBUILDER_LIST_VIEW_NAME',
|
||||
'filter' => 'STRING'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($listnameXML, $listnameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $listnameXML);
|
||||
|
||||
// view building the list name field XML
|
||||
$listnameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$listnameAttribute = array(
|
||||
'type' => 'text',
|
||||
'name' => 'short_description',
|
||||
'label' => 'COM_COMPONENTBUILDER_SHORT_DESCRIPTION',
|
||||
'size' => '100',
|
||||
'required' => false,
|
||||
'maxlength' => '150',
|
||||
'class' => 'text_area span12',
|
||||
'hint' => 'COM_COMPONENTBUILDER_YOUR_SHORT_DESCRIPTION_HERE',
|
||||
'filter' => 'HTML'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($listnameXML, $listnameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $listnameXML);
|
||||
|
||||
// start building the builder area XML
|
||||
$noteXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$noteAttribute = array(
|
||||
'type' => 'note',
|
||||
'name' => 'builder',
|
||||
'label' => 'COM_COMPONENTBUILDER_BUILDER',
|
||||
'description' => '
|
||||
<div class="uk-button-group uk-width-1-1">
|
||||
<a id="button-fields-[[[VDM]]]" class="uk-button uk-button-small uk-width-1-3" href="#modal-fields-[[[VDM]]]" data-uk-modal onclick="setJCBuilder(this, \'[[[VDM]]]\', 1)">' . JText::_('COM_COMPONENTBUILDER_FIELDS') . '</a>
|
||||
<a id="button-listview-[[[VDM]]]" class="uk-button uk-button-small uk-width-1-3" href="#modal-listview-[[[VDM]]]" data-uk-modal onclick="setJCBuilder(this, \'[[[VDM]]]\', 2)">' . JText::_('COM_COMPONENTBUILDER_LIST_VIEW') . '</a>
|
||||
<a id="button-display-[[[VDM]]]" class="uk-button uk-button-small uk-width-1-3" href="#modal-display-[[[VDM]]]" data-uk-modal onclick="setJCBuilder(this, \'[[[VDM]]]\', 3)">' . JText::_('COM_COMPONENTBUILDER_DISPLAY_VIEW') . '</a>
|
||||
</div><div class="builder"></div><br />',
|
||||
'heading' => 'h5'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($noteXML, $noteAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $noteXML);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// FIELDS SUBFORM START
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// start building the subform field XML
|
||||
$sub_subformXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$sub_subformAttribute = array(
|
||||
'type' => 'subform',
|
||||
'name' => 'fields',
|
||||
'label' => 'COM_COMPONENTBUILDER_FIELD_BUILDER',
|
||||
'layout' => 'joomla.form.field.subform.repeatable-table',
|
||||
'multiple' => 'true',
|
||||
'icon' => 'list',
|
||||
'max' => 20,
|
||||
'min' => 1
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_subformXML, $sub_subformAttribute);
|
||||
// now add the subform child form
|
||||
$sub_childform = $sub_subformXML->addChild('form');
|
||||
// child form attributes
|
||||
$sub_childformAttribute = array(
|
||||
'hidden' => 'true',
|
||||
'name' => 'list_properties',
|
||||
'repeat' => 'true');
|
||||
// load the child form attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_childform, $sub_childformAttribute);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'text',
|
||||
'name' => 'name',
|
||||
'label' => 'COM_COMPONENTBUILDER_FIELD_NAME',
|
||||
'size' => '40',
|
||||
'maxlength' => '150',
|
||||
'class' => 'text_area',
|
||||
'hint' => 'COM_COMPONENTBUILDER_FIELD_NAME',
|
||||
'filter' => 'STRING'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the field type XML
|
||||
$fieldtypeXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$fieldtypeAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'type',
|
||||
'label' => 'COM_COMPONENTBUILDER_FIELD_TYPE',
|
||||
'onchange' => 'setFieldTypeOptions(this)',
|
||||
'multiple' => false,
|
||||
'required' => true,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($fieldtypeXML, $fieldtypeAttribute);
|
||||
// get field types active and available to the assistant
|
||||
$field_types = ComponentbuilderHelper::getFieldTypesByGroup(array('text', 'list', 'spacer'));
|
||||
$field_types_ids = array_keys($field_types);
|
||||
// add views option
|
||||
// $field_types[1111111] = 'COM_COMPONENTBUILDER_OTHER_VIEW';
|
||||
// sort
|
||||
uasort ($field_types , function ($a, $b) {
|
||||
return strnatcmp($a,$b);
|
||||
}
|
||||
);
|
||||
// add empty
|
||||
$_empty = array(0 => 'COM_COMPONENTBUILDER_SELECT_AN_OPTION');
|
||||
$field_types = $_empty + $field_types;
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($fieldtypeXML, $field_types);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $fieldtypeXML);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// FIELDPROPERTIES SUBFORM START
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// make sure the layout is created
|
||||
// JLayout Helper::render('assistantsubformfieldspropertiesrepeatable', null);
|
||||
// start building the subform field XML
|
||||
$sub_sub_subformXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$sub_sub_subformAttribute = array(
|
||||
'type' => 'subform',
|
||||
'name' => 'properties',
|
||||
'label' => 'COM_COMPONENTBUILDER_PROPERTIES',
|
||||
'layout' => 'joomla.form.field.subform.repeatable',
|
||||
'multiple' => 'true',
|
||||
'min' => 1,
|
||||
'icon' => 'list'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_sub_subformXML, $sub_sub_subformAttribute);
|
||||
// now add the subform child form
|
||||
$sub_sub_childform = $sub_sub_subformXML->addChild('form');
|
||||
// child form attributes
|
||||
$sub_sub_childformAttribute = array(
|
||||
'hidden' => 'true',
|
||||
'name' => 'list_properties',
|
||||
'repeat' => 'true');
|
||||
// load the child form attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_sub_childform, $sub_sub_childformAttribute);
|
||||
|
||||
// view building the property list field XML
|
||||
$propertiesXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$propertiesAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'property',
|
||||
'label' => 'COM_COMPONENTBUILDER_PROPERTY',
|
||||
'onchange' => 'setPropertyDefaultValue(this)',
|
||||
'multiple' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($propertiesXML, $propertiesAttribute);
|
||||
// get properties
|
||||
$field_properties = ComponentbuilderHelper::getFieldTypesProperties($field_types_ids, array('adjustable' => 1), array('label', 'type', 'name'));
|
||||
// add as json to document
|
||||
$this->document->addScriptDeclaration("var fieldtype_properties = " . json_encode($field_properties['types']) . ";");
|
||||
// sort
|
||||
uasort ($field_properties['properties'] , function ($a, $b) {
|
||||
return strnatcmp($a,$b);
|
||||
}
|
||||
);
|
||||
// add empty
|
||||
$field_properties['properties'] = $_empty + $field_properties['properties'];
|
||||
// add other
|
||||
$field_properties['properties']['other'] = 'COM_COMPONENTBUILDER_OTHER';
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($propertiesXML, $field_properties['properties']);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_sub_childform, $propertiesXML);
|
||||
|
||||
// view building the value field XML
|
||||
$valueXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$valueAttribute = array(
|
||||
'type' => 'text',
|
||||
'name' => 'other',
|
||||
'label' => 'COM_COMPONENTBUILDER_OTHER',
|
||||
'description' => 'COM_COMPONENTBUILDER_MAKE_SURE_THAT_YOU_USE_THE_BCORRECT_PROPERTY_NAMEB_THAT_EXIST_IN_JCB_FOR_THIS_FIELD_TYPE',
|
||||
'size' => '40',
|
||||
'maxlength' => '150',
|
||||
'class' => 'text_area',
|
||||
'hint' => 'COM_COMPONENTBUILDER_PROPERTY_NAME',
|
||||
'filter' => 'WORD',
|
||||
'showon' => 'property:other'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($valueXML, $valueAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_sub_childform, $valueXML);
|
||||
|
||||
// view building the value field XML
|
||||
$valueXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$valueAttribute = array(
|
||||
'type' => 'text',
|
||||
'name' => 'value',
|
||||
'label' => 'COM_COMPONENTBUILDER_VALUE',
|
||||
'size' => '40',
|
||||
'maxlength' => '150',
|
||||
'class' => 'text_area',
|
||||
'hint' => 'COM_COMPONENTBUILDER_PROPERTY_VALUE',
|
||||
'filter' => 'STRING'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($valueXML, $valueAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_sub_childform, $valueXML);
|
||||
|
||||
// no add to main sub from
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $sub_sub_subformXML);
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// FIELDPROPERTIES SUBFORM END
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// no add to main sub from
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $sub_subformXML);
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// FIELDS SUBFORM END
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// LISTVIEW SUBFORM END
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// start building the subform field XML
|
||||
$sub_subformXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$sub_subformAttribute = array(
|
||||
'type' => 'subform',
|
||||
'name' => 'columns',
|
||||
'label' => 'COM_COMPONENTBUILDER_LIST_VIEW_COLUMNS',
|
||||
'layout' => 'joomla.form.field.subform.repeatable',
|
||||
'multiple' => 'true',
|
||||
'icon' => 'list',
|
||||
'max' => 2,
|
||||
'min' => 1
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_subformXML, $sub_subformAttribute);
|
||||
// now add the subform child form
|
||||
$sub_childform = $sub_subformXML->addChild('form');
|
||||
// child form attributes
|
||||
$sub_childformAttribute = array(
|
||||
'hidden' => 'true',
|
||||
'name' => 'list_properties',
|
||||
'repeat' => 'true');
|
||||
// load the child form attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($sub_childform, $sub_childformAttribute);
|
||||
|
||||
// view building the name field XML
|
||||
$targetXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$targetAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'target',
|
||||
'label' => 'COM_COMPONENTBUILDER_TARGET',
|
||||
'description' => 'COM_COMPONENTBUILDER_AREA',
|
||||
'required' => true,
|
||||
'class' => 'list_class',
|
||||
'default' => '1'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($targetXML, $targetAttribute);
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($targetXML, array(1 => 'COM_COMPONENTBUILDER_ADMIN', 2 => 'COM_COMPONENTBUILDER_SITE'));
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $targetXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'column_1',
|
||||
'label' => 'COM_COMPONENTBUILDER_FIRSTTITLE_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => true,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($nameXML, array(0 => 'COM_COMPONENTBUILDER_INACTIVE_COLUMN', 1 => 'COM_COMPONENTBUILDER_NO_FIELDS_SET'));
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'column_2',
|
||||
'label' => 'COM_COMPONENTBUILDER_SECOND_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($nameXML, array(0 => 'COM_COMPONENTBUILDER_INACTIVE_COLUMN', 1 => 'COM_COMPONENTBUILDER_NO_FIELDS_SET'));
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'column_3',
|
||||
'label' => 'COM_COMPONENTBUILDER_THIRD_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($nameXML, array(0 => 'COM_COMPONENTBUILDER_INACTIVE_COLUMN', 1 => 'COM_COMPONENTBUILDER_NO_FIELDS_SET'));
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'column_4',
|
||||
'label' => 'COM_COMPONENTBUILDER_FORTH_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($nameXML, array(0 => 'COM_COMPONENTBUILDER_INACTIVE_COLUMN', 1 => 'COM_COMPONENTBUILDER_NO_FIELDS_SET'));
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'column_5',
|
||||
'label' => 'COM_COMPONENTBUILDER_FIFTH_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($nameXML, array(0 => 'COM_COMPONENTBUILDER_INACTIVE_COLUMN', 1 => 'COM_COMPONENTBUILDER_NO_FIELDS_SET'));
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'column_6',
|
||||
'label' => 'COM_COMPONENTBUILDER_SITH_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($nameXML, array(0 => 'COM_COMPONENTBUILDER_INACTIVE_COLUMN', 1 => 'COM_COMPONENTBUILDER_NO_FIELDS_SET'));
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'column_7',
|
||||
'label' => 'COM_COMPONENTBUILDER_SEVENT_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($nameXML, array(0 => 'COM_COMPONENTBUILDER_INACTIVE_COLUMN', 1 => 'COM_COMPONENTBUILDER_NO_FIELDS_SET'));
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// view building the name field XML
|
||||
$nameXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$nameAttribute = array(
|
||||
'type' => 'list',
|
||||
'name' => 'column_8',
|
||||
'label' => 'COM_COMPONENTBUILDER_EIGHT_COLUMN',
|
||||
'multiple' => false,
|
||||
'required' => false,
|
||||
'class' => 'list_class'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
|
||||
// add the options
|
||||
ComponentbuilderHelper::xmlAddOptions($nameXML, array(0 => 'COM_COMPONENTBUILDER_INACTIVE_COLUMN', 1 => 'COM_COMPONENTBUILDER_NO_FIELDS_SET'));
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($sub_childform, $nameXML);
|
||||
|
||||
// no add to main sub from
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $sub_subformXML);
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// LISTVIEW SUBFORM END
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// DISPLAY START
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// start building the display area XML
|
||||
$displayXML = new SimpleXMLElement('<field/>');
|
||||
// subform attributes
|
||||
$displayAttribute = array(
|
||||
'type' => 'note',
|
||||
'name' => 'display',
|
||||
'label' => 'COM_COMPONENTBUILDER_ITEM_DISPLAY',
|
||||
'description' => '
|
||||
<b>More details soon, to help build the site/front display of a single item.</b>',
|
||||
'heading' => 'h5'
|
||||
);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($displayXML, $displayAttribute);
|
||||
// now add the fields to the child form
|
||||
ComponentbuilderHelper::xmlAppend($childForm, $displayXML);
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// DISPLAY END
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// setup subform with values
|
||||
$subform->setup($subformXML, null, 'jcbform');
|
||||
|
||||
// return subfrom object
|
||||
return $subform;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -112,6 +623,7 @@ class ComponentbuilderViewAssistant extends JViewLegacy
|
||||
$uikitComp = array();
|
||||
$uikitComp[] = 'UIkit.notify';
|
||||
$uikitComp[] = 'data-uk-grid';
|
||||
$uikitComp[] = 'data-uk-tooltip';
|
||||
}
|
||||
|
||||
// Load the needed uikit components in this view.
|
||||
@ -225,6 +737,12 @@ class ComponentbuilderViewAssistant extends JViewLegacy
|
||||
JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_PLANS_TO_UPDATE_AT_THIS_TIME');
|
||||
JText::script('COM_COMPONENTBUILDER_AVAILABLE_CATEGORIES');
|
||||
JText::script('COM_COMPONENTBUILDER_OPEN_CATEGORY_PLANS');
|
||||
// for the views tab
|
||||
JText::script('COM_COMPONENTBUILDER_ERROR_FIELD_TYPE_DOES_NOT_EXIST');
|
||||
JText::script('COM_COMPONENTBUILDER_HAS_THESE_AVAILABLE_PROPERTIES');
|
||||
JText::script('COM_COMPONENTBUILDER_PROPERTY_VALUE_IS_MANDATORY');
|
||||
JText::script('COM_COMPONENTBUILDER_PROPERTY_VALUE_IS_TRANSLATABLE');
|
||||
JText::script('COM_COMPONENTBUILDER_NOT_AVAILABLE');
|
||||
// Set the local plans array
|
||||
$this->document->addScriptDeclaration("var local_plans = '';");
|
||||
// add the document default css file
|
||||
|
@ -419,7 +419,7 @@ jQuery('#adminForm').on('change', '#jform_fieldtype',function (e) {
|
||||
e.preventDefault();
|
||||
// get type value
|
||||
var fieldId = jQuery("#jform_fieldtype option:selected").val();
|
||||
getFieldOptions(fieldId, true);
|
||||
getFieldTypeProperties(fieldId, true);
|
||||
// get the field type text
|
||||
var fieldText = jQuery("#jform_fieldtype option:selected").text().toLowerCase();
|
||||
// now check if database input is needed
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="component" version="3.2" method="upgrade">
|
||||
<name>COM_COMPONENTBUILDER</name>
|
||||
<creationDate>8th January, 2020</creationDate>
|
||||
<creationDate>11th January, 2020</creationDate>
|
||||
<author>Llewellyn van der Merwe</author>
|
||||
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
|
||||
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>
|
||||
|
@ -2173,12 +2173,12 @@ abstract class ComponentbuilderHelper
|
||||
|
||||
|
||||
/**
|
||||
* get field options
|
||||
* get field type properties
|
||||
*
|
||||
* @return array on success
|
||||
*
|
||||
*/
|
||||
public static function getFieldOptions($value, $type, $settings = array(), $xml = null, $db_defaults = false)
|
||||
public static function getFieldTypeProperties($value, $type, $settings = array(), $xml = null, $db_defaults = false)
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
@ -2338,6 +2338,100 @@ abstract class ComponentbuilderHelper
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get field types properties
|
||||
*
|
||||
* @return array on success
|
||||
*
|
||||
*/
|
||||
public static function getFieldTypesProperties($targets = array(), $filter = array(), $exclude = array(), $type = 'id', $operator = 'IN')
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('id','properties')));
|
||||
$query->from($db->quoteName('#__componentbuilder_fieldtype'));
|
||||
$query->where($db->quoteName('published') . ' = 1');
|
||||
// make sure we have ids (or get all)
|
||||
if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator)
|
||||
{
|
||||
$query->where($db->quoteName($type) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","',$targets) . '")');
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where($db->quoteName($type) . ' ' . $operator . ' (' . implode(',',$targets) . ')');
|
||||
}
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
$_types = array();
|
||||
$_properties = array();
|
||||
$types = $db->loadObjectList('id');
|
||||
foreach ($types as $id => $type)
|
||||
{
|
||||
$properties = json_decode($type->properties);
|
||||
foreach ($properties as $property)
|
||||
{
|
||||
if (!isset($_types[$id]))
|
||||
{
|
||||
$_types[$id] = array();
|
||||
}
|
||||
// add if no objection is found
|
||||
$add = true;
|
||||
// check if we have exclude
|
||||
if (self::checkArray($exclude) && in_array($property->name, $exclude))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// check if we have filter
|
||||
if (self::checkArray($filter))
|
||||
{
|
||||
foreach($filter as $key => $val)
|
||||
{
|
||||
if (!isset($property->$key) || $property->$key != $val)
|
||||
{
|
||||
$add = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// now add the property
|
||||
if ($add)
|
||||
{
|
||||
$_types[$id][$property->name] = array('name' => ucfirst($property->name), 'example' => $property->example, 'description' => $property->description);
|
||||
// set mandatory
|
||||
if (isset($property->mandatory) && $property->mandatory == 1)
|
||||
{
|
||||
$_types[$id][$property->name]['mandatory'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_types[$id][$property->name]['mandatory'] = false;
|
||||
}
|
||||
// set translatable
|
||||
if (isset($property->translatable) && $property->translatable == 1)
|
||||
{
|
||||
$_types[$id][$property->name]['translatable'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$_types[$id][$property->name]['translatable'] = false;
|
||||
}
|
||||
$_properties[$property->name] = $_types[$id][$property->name]['name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return found types & properties
|
||||
return array('types' => $_types, 'properties' => $_properties);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The zipper method
|
||||
*
|
||||
@ -3562,6 +3656,64 @@ abstract class ComponentbuilderHelper
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the field types id -> name of a group or groups
|
||||
*
|
||||
* @return array ids of the spacer field types
|
||||
*/
|
||||
public static function getFieldTypesByGroup($groups = array())
|
||||
{
|
||||
// make sure we have a group
|
||||
if (($ids = self::getFieldTypesIdsByGroup($groups)) !== false)
|
||||
{
|
||||
// get the database object to use quote
|
||||
$db = JFactory::getDbo();
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('id', 'name')));
|
||||
$query->from($db->quoteName('#__componentbuilder_fieldtype'));
|
||||
$query->where($db->quoteName('published') . ' = 1');
|
||||
$query->where($db->quoteName('id') . ' IN (' . implode(',',$ids) . ')');
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
return $db->loadAssocList('id', 'name');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the field types IDs of a group or groups
|
||||
*
|
||||
* @return array ids of the spacer field types
|
||||
*/
|
||||
public static function getFieldTypesIdsByGroup($groups = array())
|
||||
{
|
||||
// make sure we have a group
|
||||
if (self::checkArray($groups))
|
||||
{
|
||||
$merge_groups = array();
|
||||
foreach ($groups as $group)
|
||||
{
|
||||
if (isset(self::$fieldGroups[$group]))
|
||||
{
|
||||
$merge_groups[] = self::$fieldGroups[$group];
|
||||
}
|
||||
}
|
||||
// make sure we have these types of groups
|
||||
if (self::checkArray($merge_groups))
|
||||
{
|
||||
// get the database object to use quote
|
||||
$db = JFactory::getDbo();
|
||||
return self::getVars('fieldtype', (array) array_map(function($name) use($db) { return $db->quote(ucfirst($name)); }, self::mergeArrays($merge_groups)), 'name', 'id');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the spacer IDs
|
||||
*
|
||||
@ -3569,9 +3721,7 @@ abstract class ComponentbuilderHelper
|
||||
*/
|
||||
public static function getSpacerIds()
|
||||
{
|
||||
// get the database object to use quote
|
||||
$db = JFactory::getDbo();
|
||||
return self::getVars('fieldtype', (array) array_map(function($name) use($db) { return $db->quote(ucfirst($name)); }, self::$fieldGroups['spacer']), 'name', 'id');
|
||||
return self::getFieldTypesIdsByGroup($groups = array('spacer'));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user