Expanded the automatic DB update feature, to insure that any changes to a field name/datatype/lenght will now also create a DB update, resolve gh-241

This commit is contained in:
Llewellyn van der Merwe 2018-03-11 04:44:43 +02:00
parent 79747403b6
commit ee949fbe6e
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
40 changed files with 440 additions and 407 deletions

View File

@ -126,11 +126,11 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015
+ *Last Build*: 10th March, 2018
+ *Last Build*: 11th March, 2018
+ *Version*: 2.6.18
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **184097**
+ *Line count*: **184122**
+ *Field count*: **1651**
+ *File count*: **1172**
+ *Folder count*: **189**

View File

@ -126,11 +126,11 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015
+ *Last Build*: 10th March, 2018
+ *Last Build*: 11th March, 2018
+ *Version*: 2.6.18
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **184097**
+ *Line count*: **184122**
+ *Field count*: **1651**
+ *File count*: **1172**
+ *Folder count*: **189**

View File

@ -24,6 +24,7 @@
/* CSS Document */
.fieldMedium {
width: 80px !important;
}

View File

@ -69,11 +69,11 @@
min="10"
max="100"
step="10" />
<!-- Spacer_hr_a Field. Type: Spacer. A None Database Field. (joomla) -->
<!-- Spacer_hr_one Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer"
name="spacer_hr_a"
name="spacer_hr_one"
hr="true"
class="spacer_hr_a" />
class="spacer_hr_one" />
<!-- Api Field. Type: User. (joomla) -->
<field type="user"
name="api"
@ -114,11 +114,11 @@
<option value="604800">COM_COMPONENTBUILDER_CONFIG_EVERY_WEEK</option>
<option value="0">COM_COMPONENTBUILDER_CONFIG_NEVER_UPDATE</option>
</field>
<!-- Spacer_hr_b Field. Type: Spacer. A None Database Field. (joomla) -->
<!-- Spacer_hr_two Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer"
name="spacer_hr_b"
name="spacer_hr_two"
hr="true"
class="spacer_hr_b" />
class="spacer_hr_two" />
<field name="autorTitle"
type="spacer"
label="COM_COMPONENTBUILDER_CONFIG_AUTHOR"

View File

@ -428,6 +428,27 @@ class Get
*/
private $_fieldData = array();
/**
* Set unique Names
*
* @var array
*/
public $uniqueNames = array();
/**
* Set unique Names
*
* @var array
*/
protected $uniqueFieldNames = array();
/**
* Category other name bucket
*
* @var array
*/
public $catOtherName = array();
/**
* The linked admin view tabs
*
@ -952,13 +973,32 @@ class Get
$component->addconfig = (isset($component->addconfig) && ComponentbuilderHelper::checkJson($component->addconfig)) ? json_decode($component->addconfig, true) : null;
if (ComponentbuilderHelper::checkArray($component->addconfig))
{
$component->config = array_map(function($array)
$component->config = array_map(function($field)
{
$array['alias'] = 0;
$array['title'] = 0;
$array['settings'] = $this->getFieldData($array['field']);
return $array;
// set hash
static $hash = 1;
// load hash
$field['hash'] = md5($field['field'].$hash);
// increment hash
$hash++;
$field['alias'] = 0;
$field['title'] = 0;
// load the settings
$field['settings'] = $this->getFieldData($field['field']);
// set real field name
$field['base_name'] = $this->getFieldName($field);
// set unigue name keeper
$this->setUniqueNameCounter($this->getFieldName($field), 'configs');
// return field
return $field;
}, array_values($component->addconfig));
// do some house cleaning (for fields)
foreach ($component->config as $field)
{
// so first we lock the field name in
$this->getFieldName($field, 'configs');
}
// unset original value
unset($component->addconfig);
}
@ -1357,11 +1397,24 @@ class Get
if (ComponentbuilderHelper::checkArray($view->addfields))
{
// load the field data
$view->fields = array_map(function($array) use($name_single, $name_list)
$view->fields = array_map(function($field) use($name_single, $name_list)
{
$array['settings'] = $this->getFieldData($array['field'], $name_single, $name_list);
return $array;
// set hash
static $hash = 1;
// load hash
$field['hash'] = md5($field['field'].$hash);
// increment hash
$hash++;
// set the settings
$field['settings'] = $this->getFieldData($field['field'], $name_single, $name_list);
// set real field name
$field['base_name'] = $this->getFieldName($field);
// set unigue name keeper
$this->setUniqueNameCounter($field['base_name'], $name_list);
// return field
return $field;
}, array_values($view->addfields));
// sort the fields acording to order
usort($view->fields, function($a, $b)
{
@ -1383,6 +1436,62 @@ class Get
}
return 0;
});
// do some house cleaning (for fields)
foreach ($view->fields as $field)
{
// so first we lock the field name in
$field_name = $this->getFieldName($field, $name_list);
// check if the field changed since the last compilation
if (ComponentbuilderHelper::checkObject($field['settings']->history))
{
// check if the datatype changed
if (isset($field['settings']->history->datatype))
{
$this->setUpdateSQL($field['settings']->history->datatype, $field['settings']->datatype, 'field.datatype', $name_single.'.'.$field_name);
}
// check if the datatype lenght changed
if (isset($field['settings']->history->datalenght) && isset($field['settings']->history->datalenght_other))
{
$this->setUpdateSQL($field['settings']->history->datalenght.$field['settings']->history->datalenght_other, $field['settings']->datalenght.$field['settings']->datalenght_other, 'field.lenght', $name_single.'.'.$field_name);
}
// check if the name changed
if (isset($field['settings']->history->xml) && ComponentbuilderHelper::checkJson($field['settings']->history->xml))
{
// only run if this is not an alias or a tag
if ((!isset($field['alias']) || !$field['alias']) && 'tag' !== $field['settings']->type_name)
{
// build temp field bucket
$tmpfield = array();
$tmpfield['settings'] = new stdClass();
// convert the xml json string to normal string
$tmpfield['settings']->xml = $this->setDynamicValues(json_decode($field['settings']->history->xml));
// add properties from current field as it is generic
$tmpfield['settings']->properties = $field['settings']->properties;
// add the old name
$tmpfield['settings']->name = $field['settings']->history->name;
// add the field type from current field since it is generic
$tmpfield['settings']->type_name = $field['settings']->type_name;
// get the old name
$old_field_name = $this->getFieldName($tmpfield);
// only run this if not a multi field
if (!isset($this->uniqueNames[$name_list]['names'][$field_name]))
{
// this only works when the field is not multiple of the same field
$this->setUpdateSQL($old_field_name, $field_name, 'field.name', $name_single.'.'.$field_name);
}
elseif ($old_field_name !== $field_name)
{
// give a notice atleast that the multi fields could have changed and no DB update was done
$this->app->enqueueMessage(JText::sprintf('You have a field called <b>%s</b> that has been added multiple times to the <b>%s</b> view, the name of that field has changed to <b>%s</b>. Normaly we would automaticly add the update SQL to your component, but with multiple fields this does not work automaticly since it could be that noting changed and it just seems like it did. Therefore you will have to do this manualy if it actualy did change!', $field_name, $name_single, $old_field_name), 'Notice');
}
// remove tmp
unset($tmpfield);
}
}
}
}
}
}
unset($view->addfields);
@ -1418,16 +1527,10 @@ class Get
$required = ($required == true) ? 'yes' : 'no';
$filter = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml, 'filter="', '"');
$filter = ComponentbuilderHelper::checkString($filter) ? $filter : 'none';
// get name
$name = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml, 'name="', '"');
$name = ComponentbuilderHelper::checkString($name) ? $name : $fieldValues['settings']->name;
// get type
$type = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml, 'type="', '"');
$type = ComponentbuilderHelper::checkString($type) ? $type : $fieldValues['settings']->type_name;
// set the field name
$conditionValue['target_field'][$fieldKey] = array(
'name' => ComponentbuilderHelper::safeString($name),
'type' => ComponentbuilderHelper::safeString($type),
'name' => $this->getFieldName($fieldValues, $name_list),
'type' => $this->getFieldType($fieldValues),
'required' => $required,
'filter' => $filter
);
@ -1444,15 +1547,11 @@ class Get
{
if ((int) $fieldValue['field'] == (int) $conditionValue['match_field'])
{
// get name
$name = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml, 'name="', '"');
$name = ComponentbuilderHelper::checkString($name) ? $name : $fieldValue['settings']->name;
// get type
$type = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml, 'type="', '"');
$type = ComponentbuilderHelper::checkString($type) ? $type : $fieldValue['settings']->type_name;
// set the type
$type = $this->getFieldType($fieldValue);
// set the field details
$conditionValue['match_name'] = ComponentbuilderHelper::safeString($name);
$conditionValue['match_type'] = ComponentbuilderHelper::safeString($type);
$conditionValue['match_name'] = $this->getFieldName($fieldValue, $name_list);
$conditionValue['match_type'] = $type;
$conditionValue['match_xml'] = $fieldValue['settings']->xml;
// if custom field load field being extended
if (!ComponentbuilderHelper::typeField($type))
@ -1500,7 +1599,7 @@ class Get
}
$this->customScriptBuilder[$scripter_target][$name_single] = '';
}
$this->customScriptBuilder[$scripter_target][$name_single] .= $view->$scripter;
$this->customScriptBuilder[$scripter_target][$name_single] .= PHP_EOL . $view->$scripter;
if (strpos($view->$scripter, "token") !== false || strpos($view->$scripter, "task=ajax") !== false)
{
if (!$this->customScriptBuilder['token'][$name_single])
@ -1521,7 +1620,7 @@ class Get
{
$this->customScriptBuilder[$scripter][$name_single] = '';
}
$this->customScriptBuilder[$scripter][$name_single] .= base64_decode($view->$scripter);
$this->customScriptBuilder[$scripter][$name_single] .= PHP_EOL . base64_decode($view->$scripter);
unset($view->$scripter);
}
}
@ -2076,7 +2175,7 @@ class Get
$this->_fieldData[$id]->javascript_views_footer = $this->setDynamicValues(base64_decode($this->_fieldData[$id]->javascript_views_footer));
$this->_fieldData[$id]->javascript_views_footer_decoded = true;
}
$this->customScriptBuilder['views_footer'][$name_list] .= $this->_fieldData[$id]->javascript_views_footer;
$this->customScriptBuilder['views_footer'][$name_list] .= PHP_EOL . $this->_fieldData[$id]->javascript_views_footer;
if (strpos($this->_fieldData[$id]->javascript_views_footer, "token") !== false ||
strpos($this->_fieldData[$id]->javascript_views_footer, "task=ajax") !== false)
{
@ -2108,7 +2207,7 @@ class Get
$this->setCustomCodeData($this->_fieldData[$id]->css_views);
$this->_fieldData[$id]->css_views_decoded = true;
}
$this->customScriptBuilder['css_views'][$name_list] .= $this->_fieldData[$id]->css_views;
$this->customScriptBuilder['css_views'][$name_list] .= PHP_EOL . $this->_fieldData[$id]->css_views;
}
// add this only once to view.
@ -2123,6 +2222,207 @@ class Get
return false;
}
/**
* Get the field's actual type
*
* @param object $field The field object
*
* @return string Success returns field type
*
*/
public function getFieldType(&$field)
{
// set the type name
$type_name = ComponentbuilderHelper::safeString($field['settings']->type_name);
// check that we have the poperties
if (ComponentbuilderHelper::checkArray($field['settings']->properties))
{
foreach ($field['settings']->properties as $property)
{
if ($property['name'] === 'type')
{
if ($type_name === 'custom' || $type_name === 'customuser')
{
$type = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($field['settings']->xml, 'type="', '"'));
}
// use field core type
elseif (ComponentbuilderHelper::checkString($type_name))
{
$type = $type_name;
}
// make sure none adjustable fields are set (should be same as above)
elseif (isset($property['example']) && ComponentbuilderHelper::checkString($property['example']) && $property['adjustable'] == 0)
{
$type = $property['example'];
}
// fall back on the xml settings (not ideal)
else
{
$type = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xml, 'type="', '"'));
}
// check if the value is set
if (ComponentbuilderHelper::checkString($type))
{
// add the value
return $type;
}
// exit foreach loop
break;
}
}
}
// fall back to text
return 'text';
}
/**
* Get the field's actual name
*
* @param object $field The field object
* @param string $listViewName The list view name
*
* @return string Success returns field name
*
*/
public function getFieldName(&$field, $listViewName = null)
{
// return the unique name if already set
if (ComponentbuilderHelper::checkString($listViewName) && isset($field['hash']) && isset($this->uniqueFieldNames[$listViewName.$field['hash']]))
{
return $this->uniqueFieldNames[$listViewName.$field['hash']];
}
// set the type name
$type_name = ComponentbuilderHelper::safeString($field['settings']->type_name);
// set the name of the field
$name = ComponentbuilderHelper::safeString($field['settings']->name);
// check that we have the poperties
if (ComponentbuilderHelper::checkArray($field['settings']->properties))
{
foreach ($field['settings']->properties as $property)
{
if ($property['name'] === 'name')
{
// if category then name must be catid (only one per view)
if ($type_name === 'category')
{
// quick check if this is a category linked to view page
$requeSt_id = ComponentbuilderHelper::getBetween($field['settings']->xml, 'name="', '"');
if (strpos($requeSt_id, '_request_id') !== false || strpos($requeSt_id, '_request_catid') !== false)
{
// keep it then, don't change
$name = $requeSt_id;
}
else
{
$name = 'catid';
}
// if list view name is set
if (ComponentbuilderHelper::checkString($listViewName))
{
// check if we should use another Text Name as this views name
$otherName = ComponentbuilderHelper::getBetween($field['settings']->xml, 'othername="', '"');
$otherViews = ComponentbuilderHelper::getBetween($field['settings']->xml, 'views="', '"');
$otherView = ComponentbuilderHelper::getBetween($field['settings']->xml, 'view="', '"');
if (ComponentbuilderHelper::checkString($otherName) && ComponentbuilderHelper::checkString($otherViews) && ComponentbuilderHelper::checkString($otherView))
{
$this->catOtherName[$listViewName] = array(
'name' => ComponentbuilderHelper::safeString($otherName),
'views' => ComponentbuilderHelper::safeString($otherViews),
'view' => ComponentbuilderHelper::safeString($otherView)
);
}
}
}
// if tag is set then enable all tag options for this view (only one per view)
elseif ($type_name === 'tag')
{
$name = 'tags';
}
// if the field is set as alias it must be called alias
elseif (isset($field['alias']) && $field['alias'])
{
$name = 'alias';
}
else
{
$name = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($field['settings']->xml, 'name="', '"'));
}
// exit foreach loop
break;
}
}
}
// return the value unique
if (ComponentbuilderHelper::checkString($listViewName) && isset($field['hash']) )
{
$this->uniqueFieldNames[$listViewName.$field['hash']] = $this->uniqueName($name, $listViewName);
// now return the unique name
return $this->uniqueFieldNames[$listViewName.$field['hash']];
}
// fall back to global
return $name;
}
/**
* Count how many times the same field is used per view
*
* @param string $name The name of the field
* @param string $view The name of the view
*
* @return void
*
*/
protected function setUniqueNameCounter($name, $view)
{
if (!isset($this->uniqueNames[$view]))
{
$this->uniqueNames[$view] = array();
$this->uniqueNames[$view]['counter'] = array();
$this->uniqueNames[$view]['names'] = array();
}
if (!isset($this->uniqueNames[$view]['counter'][$name]))
{
$this->uniqueNames[$view]['counter'][$name] = 1;
return;
}
// count how many times the field is used
$this->uniqueNames[$view]['counter'][$name] ++;
return;
}
/**
* Naming each field with an unique name
*
* @param string $name The name of the field
* @param string $view The name of the view
*
* @return string the name
*
*/
protected function uniqueName($name, $view)
{
// only increment if the field name is used multiple times
if (isset($this->uniqueNames[$view]['counter'][$name]) && $this->uniqueNames[$view]['counter'][$name] > 1)
{
$counter = 1;
// set the unique name
$uniqueName = ComponentbuilderHelper::safeString($name . '_' . $counter);
while (isset($this->uniqueNames[$view]['names'][$uniqueName]))
{
// increment the number
$counter++;
// try again
$uniqueName = ComponentbuilderHelper::safeString($name . '_' . $counter);
}
// set the new name number
$this->uniqueNames[$view]['names'][$uniqueName] = $counter;
// return the unique name
return $uniqueName;
}
return $name;
}
/**
* Set get Data
*

View File

@ -551,8 +551,8 @@ class Structure extends Get
if (count($getter) == 2 && is_numeric($getter[1]))
{
// the pointers
$id = (int) $getter[1];
$t = ComponentbuilderHelper::safeString($getter[0], 'U');
$id = (int) $getter[1];
// the dynamic stuff
$targets = array('A' => 'admin_views', 'C' => 'custom_admin_views');
$names = array('A' => 'admin view', 'C' => 'custom admin view');
@ -561,12 +561,14 @@ class Structure extends Get
// check the target values
if (isset($targets[$t]) && $id > 0)
{
// set the type name
$type_names = ComponentbuilderHelper::safeString($targets[$t], 'w');
// set the dynamic dash
if (isset($this->componentData->{$targets[$t]}) && ComponentbuilderHelper::checkArray($this->componentData->{$targets[$t]}))
{
// search the target views
$dashboard = (array) array_filter($this->componentData->{$targets[$t]}, function($view) use($id, $t, $types){
if (isset($view[$types[$t]]) && $id == (int) $view[$types[$t]])
if (isset($view[$types[$t]]) && $id == $view[$types[$t]])
{
return true;
}
@ -579,16 +581,12 @@ class Structure extends Get
}
else
{
// set the type name
$type_names = ComponentbuilderHelper::safeString($targets[$t], 'w');
// set massage that something is wrong
$this->app->enqueueMessage(JText::sprintf('The <b>%s</b> (<b>%s</b>) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component.', $names[$t], $this->componentData->dashboard, $type_names), 'Error');
}
}
else
{
// set the type name
$type_names = ComponentbuilderHelper::safeString($targets[$t], 'w');
// set massage that something is wrong
$this->app->enqueueMessage(JText::sprintf('The <b>%s</b> (<b>%s</b>) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component.', $names[$t], $this->componentData->dashboard, $type_names), 'Error');
}

View File

@ -75,13 +75,6 @@ class Fields extends Structure
*/
public $siteFieldData = array();
/**
* Category other name bucket
*
* @var array
*/
public $catOtherName = array();
/**
* list of fields that are not being escaped
*
@ -341,13 +334,6 @@ class Fields extends Structure
*/
public $fieldsNames = array();
/**
* Set unique Names
*
* @var array
*/
public $uniqueNames = array();
/**
* Default Fields
*
@ -461,22 +447,14 @@ class Fields extends Structure
$this->langContent[$this->lang][$langView . '_VERSION_LABEL'] = "Revision";
$this->langContent[$this->lang][$langView . '_VERSION_DESC'] = "A count of the number of times this " . $view['settings']->name_single . " has been revised.";
$this->langContent[$this->lang][$langView . '_SAVE_WARNING'] = "Alias already existed so a number was added at the end. You can re-edit the " . $view['settings']->name_single . " to customise the alias.";
// check if the same field is added multiple times
foreach ($view['settings']->fields as $field)
{
$name = ComponentbuilderHelper::safeString($field['settings']->name);
$this->setUniqueNameKeeper($field, $view['settings']->type, $name, $viewName);
}
// start adding dynamc fields
$dynamicFieldsXML = array();
$spacerCounter = 'a';
// set the custom table key
$dbkey = 'g';
// TODO we should add the global and local view switch if field for front end
foreach ($view['settings']->fields as $field)
{
$dynamicFieldsXML[] = $this->setDynamicField($field, $view, $view['settings']->type, $langView, $viewName, $listViewName, $spacerCounter, $this->placeholders, $dbkey, true);
$dynamicFieldsXML[] = $this->setDynamicField($field, $view, $view['settings']->type, $langView, $viewName, $listViewName, $this->placeholders, $dbkey, true);
}
// set the default fields
$XML = new simpleXMLElement('<a/>');
@ -781,7 +759,6 @@ class Fields extends Structure
* @param string $langView The language string of the view
* @param string $viewName The singel view name
* @param string $listViewName The list view name
* @param string $spacerCounter The space counter value
* @param array $placeholders The place holder and replace values
* @param string $dbkey The the custom table key
* @param boolean $build The switch to set the build option
@ -789,19 +766,19 @@ class Fields extends Structure
* @return SimpleXMLElement The complete field in xml
*
*/
public function setDynamicField(&$field, &$view, &$viewType, &$langView, &$viewName, &$listViewName, &$spacerCounter, &$placeholders, &$dbkey, $build)
public function setDynamicField(&$field, &$view, &$viewType, &$langView, &$viewName, &$listViewName, &$placeholders, &$dbkey, $build)
{
if (isset($field['settings']) && ComponentbuilderHelper::checkObject($field['settings']))
{
// reset some values
$name = ComponentbuilderHelper::safeString($field['settings']->name);
$typeName = ComponentbuilderHelper::safeString($field['settings']->type_name);
$name = $this->getFieldName($field, $listViewName);
$typeName = $this->getFieldType($field);
$multiple = false;
$langLabel = '';
$fieldSet = '';
$fieldAttributes = array();
// set field attributes
$fieldAttributes = $this->setFieldAttributes($field, $viewType, $name, $typeName, $multiple, $langLabel, $langView, $spacerCounter, $listViewName, $viewName, $placeholders);
$fieldAttributes = $this->setFieldAttributes($field, $viewType, $name, $typeName, $multiple, $langLabel, $langView, $listViewName, $viewName, $placeholders);
// check if values were set
if (ComponentbuilderHelper::checkArray($fieldAttributes))
{
@ -849,11 +826,6 @@ class Fields extends Structure
}
// now add to the field set
$xmlElement = $this->setField('spacer', $fieldAttributes, $name, $typeName, $langView, $viewName, $listViewName, $placeholders, $optionArray);
// increment spacer counter
if ($typeName === 'spacer')
{
$spacerCounter++;
}
}
elseif ($this->defaultField($typeName, 'special'))
{
@ -1064,12 +1036,12 @@ class Fields extends Structure
$fieldData['settings'] = $this->getFieldData($fieldId, $viewName);
if (ComponentbuilderHelper::checkObject($fieldData['settings']))
{
$r_name = ComponentbuilderHelper::safeString($fieldData['settings']->name);
$r_typeName = ComponentbuilderHelper::safeString($fieldData['settings']->type_name);
$r_name = $this->getFieldName($fieldData);
$r_typeName = $this->getFieldType($fieldData);
$r_multiple = false;
$r_langLabel = '';
// get field values
$r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $spacerCounter, $listViewName, $viewName, $placeholders, true);
$r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $listViewName, $viewName, $placeholders, true);
// check if values were set
if (ComponentbuilderHelper::checkArray($r_fieldValues))
{
@ -1161,12 +1133,12 @@ class Fields extends Structure
$fieldData['settings'] = $this->getFieldData($fieldId, $viewName);
if (ComponentbuilderHelper::checkObject($fieldData['settings']))
{
$r_name = ComponentbuilderHelper::safeString($fieldData['settings']->name);
$r_typeName = ComponentbuilderHelper::safeString($fieldData['settings']->type_name);
$r_name = $this->getFieldName($fieldData);
$r_typeName = $this->getFieldType($fieldData);
$r_multiple = false;
$r_langLabel = '';
// get field values
$r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $spacerCounter, $listViewName, $viewName, $placeholders, true);
$r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $listViewName, $viewName, $placeholders, true);
// check if values were set
if (ComponentbuilderHelper::checkArray($r_fieldValues))
{
@ -1372,7 +1344,6 @@ class Fields extends Structure
* @param boolean $multiple The switch to set multiple selection option
* @param string $langLabel The language string for field label
* @param string $langView The language string of the view
* @param string $spacerCounter The space counter value
* @param string $listViewName The list view name
* @param string $viewName The singel view name
* @param array $placeholders The place holder and replace values
@ -1381,7 +1352,7 @@ class Fields extends Structure
* @return array The field attributes
*
*/
private function setFieldAttributes(&$field, &$viewType, &$name, &$typeName, &$multiple, &$langLabel, $langView, &$spacerCounter, $listViewName, $viewName, $placeholders, $repeatable = false)
private function setFieldAttributes(&$field, &$viewType, &$name, &$typeName, &$multiple, &$langLabel, $langView, $listViewName, $viewName, $placeholders, $repeatable = false)
{
// reset array
$fieldAttributes = array();
@ -1402,38 +1373,8 @@ class Fields extends Structure
$langValue = '';
if ($property['name'] === 'type')
{
if ($typeName === 'custom' || $typeName === 'customuser')
{
$xmlValue = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($field['settings']->xml, 'type="', '"'));
}
// use field core type only if not found
elseif (ComponentbuilderHelper::checkString($typeName))
{
// get type name
$xmlValue = $typeName;
}
// make sure none adjustable fields are set
elseif (isset($property['example']) && ComponentbuilderHelper::checkString($property['example']) && $property['adjustable'] == 0)
{
$xmlValue = $property['example'];
}
// fall back on the xml settings
else
{
$xmlValue = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($field['settings']->xml, 'type="', '"'));
}
// check if the value is set
if (ComponentbuilderHelper::checkString($xmlValue))
{
// add the value
$typeName = $xmlValue;
}
else
{
// fall back to text
$xmlValue = 'text';
$typeName = $xmlValue;
}
// add to custom if it is custom
if ($setCustom)
@ -1444,67 +1385,8 @@ class Fields extends Structure
}
elseif ($property['name'] === 'name')
{
// if category then name must be catid (only one per view)
if ($typeName === 'category')
{
// quick check if this is a category linked to view page
$requeSt_id = ComponentbuilderHelper::getBetween($field['settings']->xml, 'name="', '"');
if (strpos($requeSt_id, '_request_id') !== false || strpos($requeSt_id, '_request_catid') !== false)
{
// keep it then, don't change
$xmlValue = $requeSt_id;
}
else
{
$xmlValue = 'catid';
}
// check if we should use another Text Name as this views name
$otherName = ComponentbuilderHelper::getBetween($field['settings']->xml, 'othername="', '"');
$otherViews = ComponentbuilderHelper::getBetween($field['settings']->xml, 'views="', '"');
$otherView = ComponentbuilderHelper::getBetween($field['settings']->xml, 'view="', '"');
if (ComponentbuilderHelper::checkString($otherName) && ComponentbuilderHelper::checkString($otherViews) && ComponentbuilderHelper::checkString($otherView))
{
$this->catOtherName[$listViewName] = array(
'name' => ComponentbuilderHelper::safeString($otherName),
'views' => ComponentbuilderHelper::safeString($otherViews),
'view' => ComponentbuilderHelper::safeString($otherView)
);
}
}
// if tag is set then enable all tag options for this view (only one per view)
elseif ($typeName === 'tag')
{
$xmlValue = 'tags';
}
// if the field is set as alias it must be called alias
elseif (isset($field['alias']) && $field['alias'])
{
$xmlValue = 'alias';
}
elseif ($typeName === 'spacer')
{
// make sure the name is unique
$xmlValue = $name . '_' . $spacerCounter;
}
else
{
$xmlValue = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($field['settings']->xml, 'name="', '"'));
}
// use field core name only if not found in xml
if (!ComponentbuilderHelper::checkString($xmlValue))
{
// make sure the XML name is uniqe, so we can add one field multiple times
$name = $this->uniqueName($name, $viewName);
$xmlValue = $name;
}
// set the name if found
else
{
// make sure the XML name is uniqe, so we can add one field multiple times
$xmlValue = $this->uniqueName($xmlValue, $viewName);
$name = $this->setPlaceholders($xmlValue, $placeholders);
}
// get the actual field name
$xmlValue = $this->setPlaceholders($name, $placeholders);
}
elseif ($property['name'] === 'extension' || $property['name'] === 'directory' || $property['name'] === 'formsource')
{
@ -1623,9 +1505,9 @@ class Fields extends Structure
// update label if field use multiple times
if ($property['name'] === 'label')
{
if (isset($fieldAttributes['name']) && isset($this->uniqueNames[$viewName]['names'][$fieldAttributes['name']]))
if (isset($fieldAttributes['name']) && isset($this->uniqueNames[$listViewName]['names'][$fieldAttributes['name']]))
{
$xmlValue .= ' (' . ComponentbuilderHelper::safeString($this->uniqueNames[$viewName]['names'][$fieldAttributes['name']]) . ')';
$xmlValue .= ' (' . ComponentbuilderHelper::safeString($this->uniqueNames[$listViewName]['names'][$fieldAttributes['name']]) . ')';
}
}
// replace placeholders
@ -1718,123 +1600,6 @@ class Fields extends Structure
return $fieldAttributes;
}
/**
* Keep track of the field names, to see if it used multiple times
*
* @param array $field The field data
* @param string $typeName The field type
* @param string $name The field name
* @param string $viewName The singel view name
*
* @return void
*
*/
protected function setUniqueNameKeeper(&$field, &$typeName, &$name, $viewName)
{
// setup a default field
if (ComponentbuilderHelper::checkArray($field['settings']->properties))
{
foreach ($field['settings']->properties as $property)
{
// reset
$xmlValue = '';
if ($property['name'] === 'name')
{
// if category then name must be catid (only one per view)
if ($typeName === 'category')
{
// only one allowed
return;
}
// if tag is set then enable all tag options for this view (only one per view)
elseif ($typeName === 'tag')
{
// only one allowed
return;
}
// if the field is set as alias it must be called alias
elseif (isset($field['alias']) && $field['alias'])
{
// only one allowed
return;
}
elseif ($typeName === 'spacer')
{
// not needed here
return;
}
else
{
$xmlValue = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($field['settings']->xml, 'name="', '"'));
}
// use field core name only if not found in xml
if (!ComponentbuilderHelper::checkString($xmlValue))
{
$xmlValue = $name;
}
// make sure the XML name is uniqe, so we can add one field multiple times
return $this->setUniqueNameCounter($xmlValue, $viewName);
}
}
}
}
/**
* Count how many times the same field is used per view
*
* @param string $name The name of the field
* @param string $view The name of the view
*
* @return void
*
*/
protected function setUniqueNameCounter($name, $view)
{
if (!isset($this->uniqueNames[$view]))
{
$this->uniqueNames[$view] = array();
$this->uniqueNames[$view]['counter'] = array();
$this->uniqueNames[$view]['names'] = array();
}
if (!isset($this->uniqueNames[$view]['counter'][$name]))
{
$this->uniqueNames[$view]['counter'][$name] = 1;
return;
}
// count how many times the field is used
$this->uniqueNames[$view]['counter'][$name] ++;
return;
}
/**
* Naming each field with an unique name
*
* @param string $name The name of the field
* @param string $view The name of the view
*
* @return string the name
*
*/
protected function uniqueName($name, $view)
{
// only increment if the field name is used multiple times
if (isset($this->uniqueNames[$view]['counter'][$name]) && $this->uniqueNames[$view]['counter'][$name] > 1)
{
$counter = $this->uniqueNames[$view]['counter'][$name];
$uniqueName = ComponentbuilderHelper::safeString($name . '_' . $counter);
while (isset($this->uniqueNames[$view]['names'][$uniqueName]))
{
$counter--;
$uniqueName = ComponentbuilderHelper::safeString($name . '_' . $counter);
}
// set the new name
$this->uniqueNames[$view]['names'][$uniqueName] = $counter;
return $uniqueName;
}
return $name;
}
/**
* set Builders
*

View File

@ -5634,7 +5634,6 @@ class Interpretation extends Fields
// set the main db prefix
$component = $this->fileContentStatic['###component###'];
// start building the db
$db = '';
foreach ($this->queryBuilder as $view => $fields)
{
@ -5711,9 +5710,21 @@ class Interpretation extends Fields
$this->updateSQLBuilder["ALTERTABLE`#__" . $component . "_" . $view . "`ADD`" . $field . "`"] = "ALTER TABLE `#__" . $component . "_" . $view . "` ADD `" . $field . "` " . $data['type'] . $lenght . " " . $default . " AFTER `" . $last_name . "`;";
}
// check if the field has changed name and/or data type and lenght
elseif (0)
elseif ((isset($this->updateSQL['field.datatype']) && isset($this->updateSQL['field.datatype'][$view.'.'.$field])) ||
(isset($this->updateSQL['field.lenght']) && isset($this->updateSQL['field.lenght'][$view.'.'.$field])) ||
(isset($this->updateSQL['field.name']) && isset($this->updateSQL['field.name'][$view.'.'.$field])))
{
// hmmm tough one
// if the name changed
if (isset($this->updateSQL['field.name']) && isset($this->updateSQL['field.name'][$view.'.'.$field]))
{
$oldName = $this->updateSQL['field.name'][$view.'.'.$field]['old'];
}
else
{
$oldName = $field;
}
// now set the update SQL
$this->updateSQLBuilder["ALTERTABLE`#__" . $component . "_" . $view . "`CHANGE`" . $oldName . "``" . $field . "`"] = "ALTER TABLE `#__" . $component . "_" . $view . "` CHANGE `" . $oldName . "` `" . $field . "` " . $data['type'] . $lenght . " " . $default . ";";
}
// be sure to track the last name used :)
$last_name = $field;
@ -12853,14 +12864,14 @@ class Interpretation extends Fields
'###component###' => $component,
'###view###' => $viewName,
'###views###' => $listViewName);
$spacerCounter = 'a';
$view = '';
$viewType = 0;
// set the custom table key
$dbkey = 'g';
foreach ($this->componentData->config as $field)
{
$newxmlField = $this->setDynamicField($field, $view, $viewType, $lang, $viewName, $listViewName, $spacerCounter, $placeholders, $dbkey, false);
$newxmlField = $this->setDynamicField($field, $view, $viewType, $lang, $viewName, $listViewName, $placeholders, $dbkey, false);
// tmp hack untill this whole area is also done in xml (TODO)
if (isset($newxmlField->fieldXML))
{
@ -14715,8 +14726,8 @@ function vdm_dkim() {
$propertyType = $property;
}
}
$fieldType = $this->getFieldType($field['settings']->type_name, $field['settings']->xml, $propertyType);
$fieldName = $this->getFieldName($fieldType, $field['settings']->xml, $field['alias']);
$fieldType = $this->getFieldType($field);
$fieldName = $this->getFieldName($field, $nameViews);
$fieldView = array();
// set the permission for this field
$fieldView['action'] = 'view.edit.' . $fieldName;
@ -15065,72 +15076,6 @@ function vdm_dkim() {
}
}
public function getFieldName($typeName, $xml, $alias)
{
// if category then name must be catid (only one per view)
if ($typeName === 'category')
{
return 'catid';
}
// if tag is set then enable all tag options for this view (only one per view)
elseif ($typeName === 'tag')
{
return 'tags';
}
// if the field is set as alias it must be called alias
elseif ($alias)
{
return 'alias';
}
elseif ($typeName === 'spacer')
{
// make sure the name is unique
return false;
}
else
{
return ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xml, 'name="', '"'));
}
}
public function getFieldType($typeName, $xml, $property)
{
// make sure its lower case
$typeName = ComponentbuilderHelper::safeString($typeName);
if ($typeName === 'custom' || $typeName === 'customuser')
{
$xmlValue = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xml, 'type="', '"'));
}
// use field core type only if not found
elseif (ComponentbuilderHelper::checkString($typeName))
{
$xmlValue = $typeName;
}
// make sure none adjustable fields are set
elseif (isset($property['example']) && ComponentbuilderHelper::checkString($property['example']) && $property['adjustable'] == 0)
{
$xmlValue = $property['example'];
}
// fall back on the xml settings
else
{
$xmlValue = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xml, 'type="', '"'));
}
// check if the value is set
if (ComponentbuilderHelper::checkString($xmlValue))
{
// add the value
return $xmlValue;
}
else
{
// fall back to text
return 'text';
}
}
public function getInbetweenStrings($str, $start = '###', $end = '###')
{
$matches = array();

View File

@ -2114,12 +2114,14 @@ COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_CREATED_DATE_DESC="The date this Compo
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_CREATED_DATE_LABEL="Created Date"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_DEFAULT_VIEW_DESCRIPTION="Select only one."
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_DEFAULT_VIEW_LABEL="Default View"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_DESCRIPTION="if view uses Access,<br />should default be public."
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_EDIT="Editing the Component Site Views"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ERROR_UNIQUE_ALIAS="Another Component Site Views has the same alias."
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ID="Id"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_JOOMLA_COMPONENT="Joomla Component"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_JOOMLA_COMPONENT_DESCRIPTION="Select a Joomla Component"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_JOOMLA_COMPONENT_LABEL="Component"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_LABEL="Public Access"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_MENU_DESCRIPTION="Select if the view should show have a menu link."
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_MENU_LABEL="Add Menu"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_METADATA_DESCRIPTION="Select if this view should have metadata."
@ -2133,8 +2135,6 @@ COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_NOTE_ON_SITE_VIEWS_DESCRIPTION="Do not
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_NOTE_ON_SITE_VIEWS_LABEL="Setting Site Views"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ORDERING_LABEL="Ordering"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_PERMISSION="Permissions"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_PUBLIC_ACCESS_DESCRIPTION="if view uses Access,<br />should default be public."
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_PUBLIC_ACCESS_LABEL="Public Access"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Component Site Views to customise the alias."
COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_SITEVIEW="Siteview"

View File

@ -30,7 +30,7 @@ defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'spacer_hr_f',
'spacer_hr_six',
'note_on_contributors',
'addcontributors',
'emptycontributors',

View File

@ -31,11 +31,11 @@ $form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'note_moved_views',
'spacer_hr_a',
'spacer_hr_one',
'note_mysql_tweak_options',
'spacer_hr_b',
'spacer_hr_two',
'note_add_custom_menus',
'spacer_hr_c',
'spacer_hr_three',
'note_add_config'
);

View File

@ -31,10 +31,10 @@ $form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'note_component_files_folders',
'spacer_hr_d',
'spacer_hr_four',
'to_ignore_note',
'toignore',
'spacer_hr_e',
'spacer_hr_five',
'jcb_export_package_note',
'export_key',
'export_package_link',

View File

@ -24,6 +24,7 @@
function getFieldSelectOptions_server(fieldId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json";
if(token.length > 0 && fieldId > 0){

View File

@ -1196,6 +1196,7 @@ function isSet(val)
return false;
}
jQuery(document).ready(function()
{
// get the linked details

View File

@ -152,13 +152,13 @@
required="false"
description="COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ACCESS_DESCRIPTION"
class="inputbox" />
<!-- Public_access Field. Type: Checkbox. (joomla)-->
<!-- Field. Type: Checkbox. (joomla)-->
<field type="checkbox"
name="public_access"
label="COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_PUBLIC_ACCESS_LABEL"
name="show_title"
label="COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_PUBLIC_ACCESS_DESCRIPTION"
description="COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_DESCRIPTION"
class="inputbox" />
</form>
</field>

View File

@ -438,6 +438,7 @@ function isSet(val)
return false;
}
jQuery(document).ready(function()
{
// get the linked details

View File

@ -224,6 +224,7 @@ function isSet(val)
return false;
}
jQuery(document).ready(function()
{
var target = jQuery("#jform_target input[type='radio']:checked").val();

View File

@ -1428,6 +1428,7 @@ function isSet(val)
return false;
}
jQuery(document).ready(function()
{
// get the linked details

View File

@ -509,6 +509,7 @@ function isSet(val)
return false;
}
jQuery(document).ready(function()
{
// get the linked details

View File

@ -880,6 +880,7 @@ function isSet(val)
return false;
}
jQuery(document).ready(function()
{
// check what is the dashboard switch

View File

@ -665,11 +665,11 @@
<option value="1">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES</option>
<option value="0">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
</field>
<!-- Spacer_hr_a Field. Type: Spacer. A None Database Field. (joomla)-->
<!-- Spacer_hr_one Field. Type: Spacer. A None Database Field. (joomla)-->
<field type="spacer"
name="spacer_hr_a"
name="spacer_hr_one"
hr="true"
class="spacer_hr_a" />
class="spacer_hr_one" />
<!-- Addfootable Field. Type: List. (joomla)-->
<field type="list"
name="addfootable"
@ -702,11 +702,11 @@
<option value="1">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES</option>
<option value="0">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
</field>
<!-- Spacer_hr_b Field. Type: Spacer. A None Database Field. (joomla)-->
<!-- Spacer_hr_two Field. Type: Spacer. A None Database Field. (joomla)-->
<field type="spacer"
name="spacer_hr_b"
name="spacer_hr_two"
hr="true"
class="spacer_hr_b" />
class="spacer_hr_two" />
<!-- Add_php_helper_admin Field. Type: Radio. (joomla)-->
<field type="radio"
name="add_php_helper_admin"
@ -736,11 +736,11 @@
<option value="1">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES</option>
<option value="0">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
</field>
<!-- Spacer_hr_c Field. Type: Spacer. A None Database Field. (joomla)-->
<!-- Spacer_hr_three Field. Type: Spacer. A None Database Field. (joomla)-->
<field type="spacer"
name="spacer_hr_c"
name="spacer_hr_three"
hr="true"
class="spacer_hr_c" />
class="spacer_hr_three" />
<!-- Add_php_helper_site Field. Type: Radio. (joomla)-->
<field type="radio"
name="add_php_helper_site"
@ -788,11 +788,11 @@
<option value="1">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES</option>
<option value="0">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
</field>
<!-- Spacer_hr_d Field. Type: Spacer. A None Database Field. (joomla)-->
<!-- Spacer_hr_four Field. Type: Spacer. A None Database Field. (joomla)-->
<field type="spacer"
name="spacer_hr_d"
name="spacer_hr_four"
hr="true"
class="spacer_hr_d" />
class="spacer_hr_four" />
<!-- Add_css_admin Field. Type: Radio. (joomla)-->
<field type="radio"
name="add_css_admin"
@ -846,11 +846,11 @@
<option value="1">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEFAULT</option>
<option value="2">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DYNAMIC</option>
</field>
<!-- Spacer_hr_e Field. Type: Spacer. A None Database Field. (joomla)-->
<!-- Spacer_hr_five Field. Type: Spacer. A None Database Field. (joomla)-->
<field type="spacer"
name="spacer_hr_e"
name="spacer_hr_five"
hr="true"
class="spacer_hr_e" />
class="spacer_hr_five" />
<!-- Dashboard Field. Type: Dynamicdashboard. (custom)-->
<field type="dynamicdashboard"
name="dashboard"
@ -947,11 +947,11 @@
<option value="1">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES</option>
<option value="0">COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
</field>
<!-- Spacer_hr_f Field. Type: Spacer. A None Database Field. (joomla)-->
<!-- Spacer_hr_six Field. Type: Spacer. A None Database Field. (joomla)-->
<field type="spacer"
name="spacer_hr_f"
name="spacer_hr_six"
hr="true"
class="spacer_hr_f" />
class="spacer_hr_six" />
<!-- Add_php_method_uninstall Field. Type: Radio. (joomla)-->
<field type="radio"
name="add_php_method_uninstall"

View File

@ -24,6 +24,7 @@
jQuery(document).ready(function($)
{
// set button to add more languages

View File

@ -100,6 +100,7 @@ function isSet(val)
}
function getSnippetDetails_server(snippetId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json";
if(token.length > 0 && snippetId > 0){

View File

@ -414,6 +414,7 @@ function isSet(val)
return false;
}
jQuery(document).ready(function()
{
// get the linked details

View File

@ -479,6 +479,7 @@ function isSet(val)
return false;
}
jQuery(document).ready(function()
{
// get the linked details

View File

@ -100,6 +100,7 @@ function isSet(val)
}
function getSnippetDetails_server(snippetId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json";
if(token.length > 0 && snippetId > 0){

View File

@ -1521,7 +1521,7 @@ INSERT INTO `#__componentbuilder_help_document` (`id`, `admin_view`, `alias`, `a
--
INSERT INTO `#__componentbuilder_admin_fields` (`id`, `addfields`, `admin_view`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES
(111, '{\"addfields0\":{\"field\":\"199\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"alias\":\"0\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"0\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":\"4\",\"order_edit\":\"1\",\"permission\":\"1\"},\"addfields1\":{\"field\":\"23\",\"list\":\"0\",\"order_list\":\"0\",\"title\":\"0\",\"alias\":\"1\",\"sort\":\"0\",\"search\":\"1\",\"filter\":\"0\",\"link\":\"0\",\"tab\":\"1\",\"alignment\":\"4\",\"order_edit\":\"2\",\"permission\":\"1\"},\"addfields2\":{\"field\":\"84\",\"list\":\"1\",\"order_list\":\"2\",\"title\":\"0\",\"alias\":\"0\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"0\",\"link\":\"0\",\"tab\":\"1\",\"alignment\":\"3\",\"order_edit\":\"1\",\"permission\":\"1\"},\"addfields3\":{\"field\":\"682\",\"list\":\"0\",\"order_list\":\"0\",\"title\":\"0\",\"alias\":\"0\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"1\",\"link\":\"0\",\"tab\":\"2\",\"alignment\":\"1\",\"order_edit\":\"1\",\"permission\":\"1\"},\"addfields4\":{\"field\":\"100\",\"list\":\"0\",\"order_list\":\"0\",\"title\":\"0\",\"alias\":\"0\",\"sort\":\"0\",\"search\":\"0\",\"filter\":\"0\",\"link\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"1\",\"permission\":\"1\"},\"addfields5\":{\"field\":\"196\",\"list\":\"0\",\"order_list\":\"0\",\"title\":\"0\",\"alias\":\"0\",\"sort\":\"0\",\"search\":\"0\",\"filter\":\"0\",\"link\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"2\",\"permission\":\"1\"},\"addfields6\":{\"field\":\"1011\",\"list\":\"0\",\"order_list\":\"0\",\"title\":\"0\",\"alias\":\"0\",\"sort\":\"0\",\"search\":\"0\",\"filter\":\"0\",\"link\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"3\",\"permission\":\"1\"},\"addfields7\":{\"field\":\"158\",\"list\":\"0\",\"order_list\":\"0\",\"title\":\"0\",\"alias\":\"0\",\"sort\":\"0\",\"search\":\"0\",\"filter\":\"0\",\"link\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"4\",\"permission\":\"1\"},\"addfields8\":{\"field\":\"280\",\"list\":\"0\",\"order_list\":\"0\",\"title\":\"0\",\"alias\":\"0\",\"sort\":\"0\",\"search\":\"0\",\"filter\":\"0\",\"link\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"5\",\"permission\":\"1\"},\"addfields9\":{\"field\":\"203\",\"list\":\"0\",\"order_list\":\"0\",\"title\":\"0\",\"alias\":\"0\",\"sort\":\"0\",\"search\":\"0\",\"filter\":\"0\",\"link\":\"0\",\"tab\":\"1\",\"alignment\":\"5\",\"order_edit\":\"1\",\"permission\":\"0\"}}', 109, 1, '2017-10-12 19:52:03', '0000-00-00 00:00:00', 2, '', '');
(111, '{\"0\":{\"field\":\"84\",\"list\":\"1\",\"order_list\":\"2\",\"sort\":\"1\",\"search\":\"1\",\"tab\":\"1\",\"alignment\":\"3\",\"order_edit\":\"1\",\"permission\":\"0\"},\"1\":{\"field\":\"199\",\"list\":\"1\",\"order_list\":\"1\",\"title\":\"1\",\"sort\":\"1\",\"search\":\"1\",\"link\":\"1\",\"tab\":\"1\",\"alignment\":\"4\",\"order_edit\":\"1\",\"permission\":\"0\"},\"2\":{\"field\":\"23\",\"order_list\":\"0\",\"alias\":\"1\",\"search\":\"1\",\"tab\":\"1\",\"alignment\":\"4\",\"order_edit\":\"2\",\"permission\":\"0\"},\"3\":{\"field\":\"203\",\"order_list\":\"0\",\"tab\":\"1\",\"alignment\":\"5\",\"order_edit\":\"1\",\"permission\":\"0\"},\"4\":{\"field\":\"682\",\"order_list\":\"0\",\"sort\":\"1\",\"search\":\"1\",\"filter\":\"1\",\"tab\":\"2\",\"alignment\":\"1\",\"order_edit\":\"1\",\"permission\":\"0\"},\"5\":{\"field\":\"100\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"1\",\"permission\":\"0\"},\"6\":{\"field\":\"196\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"2\",\"permission\":\"0\"},\"7\":{\"field\":\"1011\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"3\",\"permission\":\"0\"},\"8\":{\"field\":\"158\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"4\",\"permission\":\"0\"},\"9\":{\"field\":\"280\",\"order_list\":\"0\",\"tab\":\"2\",\"alignment\":\"2\",\"order_edit\":\"5\",\"permission\":\"0\"}}', 109, 1, '2017-10-12 19:52:03', '2018-03-10 23:04:11', 4, '', '');
--
-- Dumping data for table `#__componentbuilder_admin_fields_conditions`

View File

@ -119,6 +119,7 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
<script type="text/javascript">
<?php $numberAddconditions = range(0, count($this->item->addconditions) + 3, 1);?>
// for the values already set

View File

@ -703,7 +703,8 @@ jQuery('input.form-field-repeatable').on('row-add', function (e) {
jQuery('#jform_custom_button_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
});
});
<?php endforeach; ?><?php $numberAddtables = range(0, count($this->item->addtables) + 3, 1);?>
<?php endforeach; ?>
<?php $numberAddtables = range(0, count($this->item->addtables) + 3, 1);?>
// for the values already set
jQuery(document).ready(function(){

View File

@ -355,7 +355,8 @@ jQuery('input.form-field-repeatable').on('row-add', function (e) {
jQuery('#jform_custom_button_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
});
});
<?php endforeach; ?>jQuery(function() {
<?php endforeach; ?>
jQuery(function() {
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");
});

View File

@ -226,6 +226,7 @@ jQuery('#adminForm').on('change', '#jform_target',function (e)
});
jQuery('#adminForm').on('change', '#jform_function_name',function (e)
{
e.preventDefault();

View File

@ -620,6 +620,7 @@ jQuery('#adminForm').on('change', '#jform_add_php_router_parse',function (e)
});
<?php $fieldNrs = range(0,50,1); ?>
<?php $fieldNames = array('db' => 'Db','view' => 'View'); ?>
// for the vlaues already set

View File

@ -292,6 +292,7 @@ jQuery('#adminForm').on('change', '#jform_add_javascript_views_footer',function
});
jQuery(function() {
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");

View File

@ -745,6 +745,7 @@ jQuery('#adminForm').on('change', '#jform_dashboard_type',function (e)
<?php
$app = JFactory::getApplication();
?>

View File

@ -119,6 +119,7 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
<?php
$app = JFactory::getApplication();
?>

View File

@ -160,7 +160,8 @@ jQuery(function() {
jQuery('#open-libraries').html('<a href="index.php?option=com_componentbuilder&view=libraries"><?php echo JText::_('COM_COMPONENTBUILDER_LIBRARIES'); ?></a>');
});
jQuery('#jform_snippet').closest('.input-append').addClass('jform_snippet_input_width');
jQuery('#jform_dynamic_get').closest('.input-append').addClass('jform_dynamic_get_input_width');jQuery(function() {
jQuery('#jform_dynamic_get').closest('.input-append').addClass('jform_dynamic_get_input_width');
jQuery(function() {
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");
});

View File

@ -278,6 +278,7 @@ jQuery('#adminForm').on('change', '#jform_type',function (e)
});
<?php $numberAddconditions = range(0, count($this->item->addconditions) + 3, 1);?>
// for the values already set

View File

@ -373,7 +373,8 @@ jQuery('input.form-field-repeatable').on('row-add', function (e) {
jQuery('#jform_custom_button_fields_icomoon_<?php echo $nr; ?>_chzn').closest("td").append(span);
});
});
<?php endforeach; ?>jQuery(function() {
<?php endforeach; ?>
jQuery(function() {
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");
});

View File

@ -160,7 +160,8 @@ jQuery(function() {
jQuery('#open-libraries').html('<a href="index.php?option=com_componentbuilder&view=libraries"><?php echo JText::_('COM_COMPONENTBUILDER_LIBRARIES'); ?></a>');
});
jQuery('#jform_snippet').closest('.input-append').addClass('jform_snippet_input_width');
jQuery('#jform_dynamic_get').closest('.input-append').addClass('jform_dynamic_get_input_width');jQuery(function() {
jQuery('#jform_dynamic_get').closest('.input-append').addClass('jform_dynamic_get_input_width');
jQuery(function() {
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");
});

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>10th March, 2018</creationDate>
<creationDate>11th March, 2018</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://joomlacomponentbuilder.com</authorUrl>