Urgent fix to the fields area to address the extra field options, and fields with 0 being removed. Added the option to add a field and not add it to the database, so it will show in the edit view but will not be stored to the database. This is to use javascript/php to use that field value, and then drop it.
This commit is contained in:
@ -387,7 +387,7 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
'type' => 'setURLType',
|
||||
// Admin View
|
||||
'field' => 'setItemNames',
|
||||
'list' => 'setYesNo',
|
||||
'list' => 'setAdminBehaviour',
|
||||
'title' => 'setYesNo',
|
||||
'alias' => 'setYesNo',
|
||||
'sort' => 'setYesNo',
|
||||
@ -433,7 +433,7 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
'update' => JText::_('COM_COMPONENTBUILDER_UPDATE'),
|
||||
// Admin View (fields)
|
||||
'field' => JText::_('COM_COMPONENTBUILDER_FIELD'),
|
||||
'list' => JText::_('COM_COMPONENTBUILDER_ADMIN_LIST'),
|
||||
'list' => JText::_('COM_COMPONENTBUILDER_ADMIN_BEHAVIOUR'),
|
||||
'order_list' => JText::_('COM_COMPONENTBUILDER_ORDER_IN_LIST_VIEWS'),
|
||||
'title' => JText::_('COM_COMPONENTBUILDER_TITLE'),
|
||||
'alias' => JText::_('COM_COMPONENTBUILDER_ALIAS'),
|
||||
@ -447,10 +447,10 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
'order_edit' => JText::_('COM_COMPONENTBUILDER_ORDER_IN_EDIT'),
|
||||
// Admin View (conditions)
|
||||
'target_field' => JText::_('COM_COMPONENTBUILDER_TARGET_FIELDS'),
|
||||
'target_behavior' => JText::_('COM_COMPONENTBUILDER_TARGET_BEHAVIOR'),
|
||||
'target_behavior' => JText::_('COM_COMPONENTBUILDER_TARGET_BEHAVIOUR'),
|
||||
'target_relation' => JText::_('COM_COMPONENTBUILDER_TARGET_RELATION'),
|
||||
'match_field' => JText::_('COM_COMPONENTBUILDER_MATCH_FIELD'),
|
||||
'match_behavior' => JText::_('COM_COMPONENTBUILDER_MATCH_BEHAVIOR'),
|
||||
'match_behavior' => JText::_('COM_COMPONENTBUILDER_MATCH_BEHAVIOUR'),
|
||||
'match_options' => JText::_('COM_COMPONENTBUILDER_MATCH_OPTIONS'),
|
||||
// Joomla Component
|
||||
'menu' => JText::_('COM_COMPONENTBUILDER_ADD_MENU'),
|
||||
@ -889,6 +889,22 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
return $this->user->authorise($view.'.edit', 'com_componentbuilder.'.$view.'.' . (int) $id);
|
||||
}
|
||||
|
||||
protected function setAdminBehaviour($header, $value)
|
||||
{
|
||||
switch ($value)
|
||||
{
|
||||
case 1:
|
||||
return JText::_('COM_COMPONENTBUILDER_SHOW_IN_LIST_VIEW');
|
||||
break;
|
||||
case 2:
|
||||
return JText::_('COM_COMPONENTBUILDER_NONE_DB');
|
||||
break;
|
||||
default:
|
||||
return JText::_('COM_COMPONENTBUILDER_DEFAULT');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected $tabNames = array();
|
||||
|
||||
protected function setTabName($header, $value)
|
||||
@ -2200,6 +2216,13 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
}
|
||||
|
||||
// Used in field
|
||||
// the current extras available
|
||||
protected $extraFieldProperties = array(
|
||||
'listclass' => 'COM_COMPONENTBUILDER_SET_A_CLASS_VALUE_FOR_THE_LIST_VIEW_OF_THIS_FIELD',
|
||||
'escape' => 'COM_COMPONENTBUILDER_SHOULD_THIS_FIELD_BE_ESCAPED_IN_THE_LIST_VIEW',
|
||||
'display' => 'COM_COMPONENTBUILDER_DISPLAY_SWITCH_FOR_DYNAMIC_PLACEMENT_IN_RELATION_TO_THE_USE_OF_THE_FIELD_IN_MENU_AND_GLOBAL_CONFIGURATION_OPTIONS',
|
||||
'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)
|
||||
{
|
||||
// get the xml
|
||||
@ -2207,17 +2230,54 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
// now get the field options
|
||||
if ($field = ComponentbuilderHelper::getFieldOptions($fieldtype, 'id', null, $xml))
|
||||
{
|
||||
// get subform field properties object
|
||||
$properties = $this->buildFieldOptionsSubform($field['subform'], $field['nameListOptions']);
|
||||
// load the extra options
|
||||
$extraValues = $this->getFieldExtraValues($xml, $field['nameListOptions']);
|
||||
// set the nameListOption
|
||||
$extraNameListOption = $this->extraFieldProperties;
|
||||
array_walk($extraNameListOption, function (&$value, $key) {
|
||||
$value = $key;
|
||||
});
|
||||
// get subform field object
|
||||
$subform = $this->buildFieldOptionsSubform($field['subform'], $field['nameListOptions']);
|
||||
$extras = $this->buildFieldOptionsSubform($extraValues, $extraNameListOption, 'extraproperties', 'COM_COMPONENTBUILDER_EXTRA_PROPERTIES_LIKE_LISTCLASS_ESCAPE_DISPLAY_VALIDATEBR_SMALLHERE_YOU_CAN_SET_THE_EXTRA_PROPERTIES_FOR_THIS_FIELDSMALL');
|
||||
// load the html
|
||||
$field['subform'] = '<div class="control-label prop_removal">'. $subform->label . '</div><div class="controls prop_removal">' . $subform->input . '</div>';
|
||||
$field['subform'] = '<div class="control-label prop_removal">'. $properties->label . '</div><div class="controls prop_removal">' . $properties->input . '</div>';
|
||||
$field['extra'] = '<div class="control-label prop_removal">'. $extras->label . '</div><div class="controls prop_removal">' . $extras->input . '</div>';
|
||||
// return found field options
|
||||
return $field;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function buildFieldOptionsSubform($values, $nameListOptions = null)
|
||||
protected function getFieldExtraValues($xml, $options)
|
||||
{
|
||||
// get the value
|
||||
$values = array();
|
||||
// value to check since there are false and null values even 0 in the values returned
|
||||
$confirmation = '8qvZHoyuFYQqpj0YQbc6F3o5DhBlmS-_-a8pmCZfOVSfANjkmV5LG8pCdAY2JNYu6cB';
|
||||
$nr = 0;
|
||||
foreach ($this->extraFieldProperties as $extra => $desc)
|
||||
{
|
||||
if (!in_array($extra, $options))
|
||||
{
|
||||
$value = ComponentbuilderHelper::getValueFromXMLstring($xml, $extra, $confirmation);
|
||||
if ($confirmation !== $value)
|
||||
{
|
||||
$values['extraproperties' . $nr] = array('name' => $extra, 'value' => $value, 'desc' => JText::_($desc));
|
||||
$nr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// return only if extras founb
|
||||
if (ComponentbuilderHelper::checkArray($values))
|
||||
{
|
||||
return $values;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function buildFieldOptionsSubform($values, $nameListOptions = null, $name = 'properties', $label = 'COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL')
|
||||
{
|
||||
// get the subform
|
||||
$subform = JFormHelper::loadFieldType('subform', true);
|
||||
@ -2226,12 +2286,12 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
// subform attributes
|
||||
$subformAttribute = array(
|
||||
'type' => 'subform',
|
||||
'name' => 'properties',
|
||||
'label' => 'COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL',
|
||||
'name' => $name,
|
||||
'label' => $label,
|
||||
'layout' => 'joomla.form.field.subform.repeatable-table',
|
||||
'multiple' => 'true',
|
||||
'icon' => 'list',
|
||||
'max' => (int) count($nameListOptions));
|
||||
'max' => (ComponentbuilderHelper::checkArray($nameListOptions)) ? (int) count($nameListOptions) : 4);
|
||||
// load the subform attributes
|
||||
ComponentbuilderHelper::xmlAddAttributes($subformXML, $subformAttribute);
|
||||
// now add the subform child form
|
||||
@ -2260,7 +2320,7 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
{
|
||||
$nameAttribute['description'] = 'COM_COMPONENTBUILDER_SELECTION';
|
||||
$nameAttribute['multiple'] = 'false';
|
||||
$nameAttribute['onchange'] = "getFieldPropertyDesc(this)";
|
||||
$nameAttribute['onchange'] = "getFieldPropertyDesc(this, '".$name."')";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2318,46 +2378,56 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
return $subform;
|
||||
}
|
||||
|
||||
public function getFieldPropertyDesc($fieldtype, $_property)
|
||||
public function getFieldPropertyDesc($_property, $fieldtype)
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('properties', 'short_description', 'description')));
|
||||
$query->from($db->quoteName('#__componentbuilder_fieldtype'));
|
||||
$query->where($db->quoteName('id') . ' = '. $fieldtype);
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
if (is_numeric($fieldtype))
|
||||
{
|
||||
// get the result
|
||||
$result = $db->loadObject();
|
||||
// get the xml
|
||||
$xml = $this->getFieldXML($fieldtype);
|
||||
// open the properties
|
||||
$properties = json_decode($result->properties,true);
|
||||
// make sure we have an array
|
||||
if (ComponentbuilderHelper::checkArray($properties))
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
|
||||
// Create a new query object.
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('properties', 'short_description', 'description')));
|
||||
$query->from($db->quoteName('#__componentbuilder_fieldtype'));
|
||||
$query->where($db->quoteName('id') . ' = '. (int) $fieldtype);
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
foreach ($properties as $property)
|
||||
// get the result
|
||||
$result = $db->loadObject();
|
||||
// get the xml
|
||||
$xml = $this->getFieldXML($fieldtype);
|
||||
// open the properties
|
||||
$properties = json_decode($result->properties,true);
|
||||
// value to check since there are false and null values even 0 in the values returned
|
||||
$confirmation = '8qvZHoyuFYQqpj0YQbc6F3o5DhBlmS-_-a8pmCZfOVSfANjkmV5LG8pCdAY2JNYu6cB';
|
||||
// make sure we have an array
|
||||
if (ComponentbuilderHelper::checkArray($properties))
|
||||
{
|
||||
if(isset($property['name']) && $_property === $property['name'])
|
||||
foreach ($properties as $property)
|
||||
{
|
||||
// check if we should load the value
|
||||
if (!$value = ComponentbuilderHelper::getValueFromXMLstring($xml, $property['name']))
|
||||
if(isset($property['name']) && $_property === $property['name'])
|
||||
{
|
||||
$value = (isset($property['example']) && ComponentbuilderHelper::checkString($property['example'])) ? $property['example'] : '';
|
||||
// check if we should load the value
|
||||
$value = ComponentbuilderHelper::getValueFromXMLstring($xml, $property['name'], $confirmation);
|
||||
if ($confirmation === $value)
|
||||
{
|
||||
$value = (isset($property['example']) && ComponentbuilderHelper::checkString($property['example'])) ? $property['example'] : '';
|
||||
}
|
||||
// return the found values
|
||||
return array('value' => $value, 'desc' => $property['description']);
|
||||
}
|
||||
// return the found values
|
||||
return array('value' => $value, 'desc' => $property['description']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (isset($this->extraFieldProperties[$_property]))
|
||||
{
|
||||
return array('value' => '', 'desc' => JText::_($this->extraFieldProperties[$_property]));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -891,6 +891,8 @@ class ComponentbuilderModelField extends JModelAdmin
|
||||
|
||||
// get the properties
|
||||
$properties = $input->get('properties', null, 'ARRAY');
|
||||
// get the extra properties
|
||||
$extraproperties = $input->get('extraproperties', null, 'ARRAY');
|
||||
// make sure we have an array
|
||||
if (ComponentbuilderHelper::checkArray($properties))
|
||||
{
|
||||
@ -899,9 +901,7 @@ class ComponentbuilderModelField extends JModelAdmin
|
||||
foreach($properties as $property)
|
||||
{
|
||||
// make sure we have the correct values
|
||||
if (ComponentbuilderHelper::checkArray($property) &&
|
||||
isset($property['name']) && ComponentbuilderHelper::checkString($property['name']) &&
|
||||
isset($property['value']) && ComponentbuilderHelper::checkString($property['value']))
|
||||
if (ComponentbuilderHelper::checkArray($property) && isset($property['name']) && ComponentbuilderHelper::checkString($property['name']) && isset($property['value']))
|
||||
{
|
||||
// fix the name
|
||||
$property['name'] = ComponentbuilderHelper::safeString($property['name']);
|
||||
@ -918,6 +918,19 @@ class ComponentbuilderModelField extends JModelAdmin
|
||||
$bucket[] = "\t".$property['name'].'="'. str_replace('"', """, $property['value']).'"';
|
||||
}
|
||||
}
|
||||
// make sure we have an array
|
||||
if (ComponentbuilderHelper::checkArray($extraproperties))
|
||||
{
|
||||
foreach($extraproperties as $xproperty)
|
||||
{
|
||||
// make sure we have the correct values
|
||||
if (ComponentbuilderHelper::checkArray($xproperty) && isset($xproperty['name']) && ComponentbuilderHelper::checkString($xproperty['name']) && isset($xproperty['value']))
|
||||
{
|
||||
// load the extra property
|
||||
$bucket[] = "\t".ComponentbuilderHelper::safeString($xproperty['name']).'="'. str_replace('"', """, $xproperty['value']).'"';
|
||||
}
|
||||
}
|
||||
}
|
||||
// if the bucket has been loaded
|
||||
if (ComponentbuilderHelper::checkArray($bucket))
|
||||
{
|
||||
|
@ -49,10 +49,10 @@ class ComponentbuilderModelFields extends JModelList
|
||||
'a.datatype','datatype',
|
||||
'a.indexes','indexes',
|
||||
'a.null_switch','null_switch',
|
||||
'a.store','store',
|
||||
'c.title','category_title',
|
||||
'c.id', 'category_id',
|
||||
'a.catid', 'catid',
|
||||
'a.store','store'
|
||||
'a.catid', 'catid'
|
||||
);
|
||||
}
|
||||
|
||||
@ -88,6 +88,9 @@ class ComponentbuilderModelFields extends JModelList
|
||||
$null_switch = $this->getUserStateFromRequest($this->context . '.filter.null_switch', 'filter_null_switch');
|
||||
$this->setState('filter.null_switch', $null_switch);
|
||||
|
||||
$store = $this->getUserStateFromRequest($this->context . '.filter.store', 'filter_store');
|
||||
$this->setState('filter.store', $store);
|
||||
|
||||
$category = $app->getUserStateFromRequest($this->context . '.filter.category', 'filter_category');
|
||||
$this->setState('filter.category', $category);
|
||||
|
||||
@ -95,10 +98,7 @@ class ComponentbuilderModelFields extends JModelList
|
||||
$this->setState('filter.category_id', $categoryId);
|
||||
|
||||
$catid = $app->getUserStateFromRequest($this->context . '.filter.catid', 'filter_catid');
|
||||
$this->setState('filter.catid', $catid);
|
||||
|
||||
$store = $this->getUserStateFromRequest($this->context . '.filter.store', 'filter_store');
|
||||
$this->setState('filter.store', $store);
|
||||
$this->setState('filter.catid', $catid);
|
||||
|
||||
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
|
||||
$this->setState('filter.sorting', $sorting);
|
||||
@ -313,7 +313,7 @@ class ComponentbuilderModelFields extends JModelList
|
||||
else
|
||||
{
|
||||
$search = $db->quote('%' . $db->escape($search) . '%');
|
||||
$query->where('(a.name LIKE '.$search.' OR a.fieldtype LIKE '.$search.' OR g.name LIKE '.$search.' OR a.datatype LIKE '.$search.' OR a.indexes LIKE '.$search.' OR a.null_switch LIKE '.$search.' OR a.catid LIKE '.$search.' OR a.store LIKE '.$search.' OR a.xml LIKE '.$search.')');
|
||||
$query->where('(a.name LIKE '.$search.' OR a.fieldtype LIKE '.$search.' OR g.name LIKE '.$search.' OR a.datatype LIKE '.$search.' OR a.indexes LIKE '.$search.' OR a.null_switch LIKE '.$search.' OR a.store LIKE '.$search.' OR a.catid LIKE '.$search.' OR a.xml LIKE '.$search.')');
|
||||
}
|
||||
}
|
||||
|
||||
@ -504,10 +504,10 @@ class ComponentbuilderModelFields extends JModelList
|
||||
$id .= ':' . $this->getState('filter.datatype');
|
||||
$id .= ':' . $this->getState('filter.indexes');
|
||||
$id .= ':' . $this->getState('filter.null_switch');
|
||||
$id .= ':' . $this->getState('filter.store');
|
||||
$id .= ':' . $this->getState('filter.category');
|
||||
$id .= ':' . $this->getState('filter.category_id');
|
||||
$id .= ':' . $this->getState('filter.catid');
|
||||
$id .= ':' . $this->getState('filter.store');
|
||||
$id .= ':' . $this->getState('filter.catid');
|
||||
|
||||
return parent::getStoreId($id);
|
||||
}
|
||||
|
@ -49,23 +49,6 @@ class JFormFieldLang extends JFormFieldList
|
||||
*/
|
||||
public function getOptions()
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('a.langtag','a.name'),array('langtag','language_name')));
|
||||
$query->from($db->quoteName('#__componentbuilder_language', 'a'));
|
||||
$query->where($db->quoteName('a.published') . ' >= 1');
|
||||
$query->order('a.langtag ASC');
|
||||
$db->setQuery((string)$query);
|
||||
$items = $db->loadObjectList();
|
||||
$options = array();
|
||||
if ($items)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', '', 'Select an option');
|
||||
foreach($items as $item)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', $item->langtag, $item->language_name . ' (' .$item->langtag.')');
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -118,28 +118,36 @@
|
||||
required="false"
|
||||
button="false"
|
||||
/>
|
||||
<!-- List Field. Type: Checkbox. (joomla) -->
|
||||
<!-- List Field. Type: List. (joomla) -->
|
||||
<field
|
||||
type="checkbox"
|
||||
type="list"
|
||||
name="list"
|
||||
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_LIST_LABEL"
|
||||
value="1"
|
||||
required="false"
|
||||
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_LIST_DESCRIPTION"
|
||||
class="inputbox"
|
||||
/>
|
||||
class="fieldMedium count-the-items1235"
|
||||
multiple="false"
|
||||
required="false"
|
||||
onchange="checkAdminBehaviour(this)">
|
||||
<!-- Option Set. -->
|
||||
<option value="">
|
||||
COM_COMPONENTBUILDER_ADMIN_FIELDS_DEFAULT</option>
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_ADMIN_FIELDS_SHOW_IN_LIST_VIEW</option>
|
||||
<option value="2">
|
||||
COM_COMPONENTBUILDER_ADMIN_FIELDS_NONE_DB</option>
|
||||
</field>
|
||||
<!-- Order_list Field. Type: Integer. (joomla) -->
|
||||
<field
|
||||
type="integer"
|
||||
name="order_list"
|
||||
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_ORDER_LIST_LABEL"
|
||||
default="0"
|
||||
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_ORDER_LIST_DESCRIPTION"
|
||||
class="fieldSmall"
|
||||
required="false"
|
||||
first="0"
|
||||
last="20"
|
||||
step="1"
|
||||
onchange="checkAdminBehaviour(this)"
|
||||
/>
|
||||
<!-- Title Field. Type: Checkbox. (joomla) -->
|
||||
<field
|
||||
@ -259,10 +267,9 @@
|
||||
name="permission"
|
||||
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_LABEL"
|
||||
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_DESCRIPTION"
|
||||
class="fieldMedium"
|
||||
class="fieldMid"
|
||||
multiple="false"
|
||||
required="false"
|
||||
default="0">
|
||||
required="false">
|
||||
<!-- Option Set. -->
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_ADMIN_FIELDS_NONE</option>
|
||||
|
@ -598,7 +598,9 @@ function getFieldOptions(fieldtype){
|
||||
jQuery('.prop_removal').remove();
|
||||
// hide notice
|
||||
jQuery('.note_select_field_type').closest('.control-group').remove();
|
||||
// append to the closed to xml (hidden field)
|
||||
// append to note_filter_information class
|
||||
jQuery('.note_filter_information').closest('.control-group').prepend(result.extra);
|
||||
// append to note_filter_information class
|
||||
jQuery('.note_filter_information').closest('.control-group').prepend(result.subform);
|
||||
// add the watcher
|
||||
rowWatcher();
|
||||
@ -613,7 +615,7 @@ function getFieldOptions(fieldtype){
|
||||
})
|
||||
}
|
||||
|
||||
function getFieldPropertyDesc(field){
|
||||
function getFieldPropertyDesc(field, targetForm){
|
||||
// get the ID
|
||||
var id = jQuery(field).attr('id');
|
||||
// build the target array
|
||||
@ -621,7 +623,7 @@ function getFieldPropertyDesc(field){
|
||||
// get property value
|
||||
var property = jQuery(field).val();
|
||||
// first check that there isn't any of this property type already set
|
||||
if (propertyIsSet(property, id)) {
|
||||
if (propertyIsSet(property, id, targetForm)) {
|
||||
// reset the selection
|
||||
jQuery('#'+id).val('');
|
||||
jQuery('#'+id).trigger("liszt:updated");
|
||||
@ -634,9 +636,13 @@ function getFieldPropertyDesc(field){
|
||||
// do a dynamic update
|
||||
propertyDynamicSet();
|
||||
// get type value
|
||||
var fieldtype = jQuery("#jform_fieldtype option:selected").val();
|
||||
if (targetForm === 'properties') {
|
||||
var fieldtype = jQuery("#jform_fieldtype option:selected").val();
|
||||
} else {
|
||||
var fieldtype = 'extra';
|
||||
}
|
||||
getFieldPropertyDesc_server(fieldtype, property).done(function(result) {
|
||||
if(result.desc && result.value){
|
||||
if(result.desc || result.value){
|
||||
// update the values
|
||||
jQuery('#'+target[0]+'__desc').val(result.desc);
|
||||
jQuery('#'+target[0]+'__value').val(result.value);
|
||||
@ -704,11 +710,11 @@ function rowWatcher() {
|
||||
});
|
||||
}
|
||||
|
||||
function propertyIsSet(prop, id) {
|
||||
function propertyIsSet(prop, id, targetForm) {
|
||||
var i;
|
||||
for (i = 0; i < 70; i++) { // for now this is the number of field we should check
|
||||
// build ID
|
||||
var id_check = rowIdKey+'_'+rowIdKey+i+'__name';
|
||||
var id_check = targetForm+'_'+targetForm+i+'__name';
|
||||
// first check if Id is on page as that not the same as the one currently calling
|
||||
if (jQuery("#"+id_check).length && id_check != id) {
|
||||
// get the property value
|
||||
@ -724,7 +730,7 @@ function propertyIsSet(prop, id) {
|
||||
|
||||
function getFieldPropertyDesc_server(fieldtype, property){
|
||||
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getFieldPropertyDesc&format=json&vdm="+vastDevMod;
|
||||
if(token.length > 0 && fieldtype > 0 && property.length > 0){
|
||||
if(token.length > 0 && (fieldtype > 0 || fieldtype.length > 0)&& property.length > 0){
|
||||
var request = 'token='+token+'&fieldtype='+fieldtype+'&property='+property;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
|
@ -183,98 +183,6 @@
|
||||
<option value="NOT NULL">
|
||||
COM_COMPONENTBUILDER_FIELD_NOT_NULL</option>
|
||||
</field>
|
||||
<!-- Javascript_view_footer Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="javascript_view_footer"
|
||||
label="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_LABEL"
|
||||
rows="30"
|
||||
cols="15"
|
||||
description="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_DESCRIPTION"
|
||||
class="text_area span12"
|
||||
filter="raw"
|
||||
hint="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_HINT"
|
||||
required="true"
|
||||
/>
|
||||
<!-- Css_views Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="css_views"
|
||||
label="COM_COMPONENTBUILDER_FIELD_CSS_VIEWS_LABEL"
|
||||
rows="30"
|
||||
cols="15"
|
||||
description="COM_COMPONENTBUILDER_FIELD_CSS_VIEWS_DESCRIPTION"
|
||||
class="text_area span12"
|
||||
filter="raw"
|
||||
hint="COM_COMPONENTBUILDER_FIELD_CSS_VIEWS_HINT"
|
||||
required="true"
|
||||
/>
|
||||
<!-- Add_javascript_view_footer Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="add_javascript_view_footer"
|
||||
label="COM_COMPONENTBUILDER_FIELD_ADD_JAVASCRIPT_VIEW_FOOTER_LABEL"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELD_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELD_NO</option>
|
||||
</field>
|
||||
<!-- Css_view Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="css_view"
|
||||
label="COM_COMPONENTBUILDER_FIELD_CSS_VIEW_LABEL"
|
||||
rows="30"
|
||||
cols="15"
|
||||
description="COM_COMPONENTBUILDER_FIELD_CSS_VIEW_DESCRIPTION"
|
||||
class="text_area span12"
|
||||
filter="raw"
|
||||
hint="COM_COMPONENTBUILDER_FIELD_CSS_VIEW_HINT"
|
||||
required="true"
|
||||
/>
|
||||
<!-- Add_css_views Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="add_css_views"
|
||||
label="COM_COMPONENTBUILDER_FIELD_ADD_CSS_VIEWS_LABEL"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELD_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELD_NO</option>
|
||||
</field>
|
||||
<!-- Catid Field. Type: Category. (joomla) -->
|
||||
<field
|
||||
type="category"
|
||||
name="catid"
|
||||
label="COM_COMPONENTBUILDER_FIELD_CATID_LABEL"
|
||||
extension="com_componentbuilder.fields"
|
||||
description="COM_COMPONENTBUILDER_FIELD_CATID_DESCRIPTION"
|
||||
class="inputbox"
|
||||
/>
|
||||
<!-- Add_css_view Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="add_css_view"
|
||||
label="COM_COMPONENTBUILDER_FIELD_ADD_CSS_VIEW_LABEL"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELD_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELD_NO</option>
|
||||
</field>
|
||||
<!-- Note_filter_information Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="note_filter_information" description="COM_COMPONENTBUILDER_FIELD_NOTE_FILTER_INFORMATION_DESCRIPTION" class="note_filter_information" />
|
||||
<!-- Store Field. Type: List. (joomla) -->
|
||||
<field
|
||||
type="list"
|
||||
@ -300,6 +208,98 @@
|
||||
<option value="4">
|
||||
COM_COMPONENTBUILDER_FIELD_WHMCSKEY_ENCRYPTION</option>
|
||||
</field>
|
||||
<!-- Catid Field. Type: Category. (joomla) -->
|
||||
<field
|
||||
type="category"
|
||||
name="catid"
|
||||
label="COM_COMPONENTBUILDER_FIELD_CATID_LABEL"
|
||||
extension="com_componentbuilder.fields"
|
||||
description="COM_COMPONENTBUILDER_FIELD_CATID_DESCRIPTION"
|
||||
class="inputbox"
|
||||
/>
|
||||
<!-- Javascript_view_footer Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="javascript_view_footer"
|
||||
label="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_LABEL"
|
||||
rows="30"
|
||||
cols="15"
|
||||
description="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_DESCRIPTION"
|
||||
class="text_area span12"
|
||||
filter="raw"
|
||||
hint="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_HINT"
|
||||
required="true"
|
||||
/>
|
||||
<!-- Add_javascript_view_footer Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="add_javascript_view_footer"
|
||||
label="COM_COMPONENTBUILDER_FIELD_ADD_JAVASCRIPT_VIEW_FOOTER_LABEL"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELD_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELD_NO</option>
|
||||
</field>
|
||||
<!-- Css_views Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="css_views"
|
||||
label="COM_COMPONENTBUILDER_FIELD_CSS_VIEWS_LABEL"
|
||||
rows="30"
|
||||
cols="15"
|
||||
description="COM_COMPONENTBUILDER_FIELD_CSS_VIEWS_DESCRIPTION"
|
||||
class="text_area span12"
|
||||
filter="raw"
|
||||
hint="COM_COMPONENTBUILDER_FIELD_CSS_VIEWS_HINT"
|
||||
required="true"
|
||||
/>
|
||||
<!-- Add_css_views Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="add_css_views"
|
||||
label="COM_COMPONENTBUILDER_FIELD_ADD_CSS_VIEWS_LABEL"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELD_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELD_NO</option>
|
||||
</field>
|
||||
<!-- Css_view Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="css_view"
|
||||
label="COM_COMPONENTBUILDER_FIELD_CSS_VIEW_LABEL"
|
||||
rows="30"
|
||||
cols="15"
|
||||
description="COM_COMPONENTBUILDER_FIELD_CSS_VIEW_DESCRIPTION"
|
||||
class="text_area span12"
|
||||
filter="raw"
|
||||
hint="COM_COMPONENTBUILDER_FIELD_CSS_VIEW_HINT"
|
||||
required="true"
|
||||
/>
|
||||
<!-- Add_css_view Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="add_css_view"
|
||||
label="COM_COMPONENTBUILDER_FIELD_ADD_CSS_VIEW_LABEL"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELD_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELD_NO</option>
|
||||
</field>
|
||||
<!-- Note_filter_information Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="note_filter_information" description="COM_COMPONENTBUILDER_FIELD_NOTE_FILTER_INFORMATION_DESCRIPTION" class="note_filter_information" />
|
||||
<!-- Datadefault_other Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
|
@ -141,7 +141,6 @@
|
||||
label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE_LABEL"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
default="0"
|
||||
required="false"
|
||||
button="false"
|
||||
/>
|
||||
|
Reference in New Issue
Block a user