Added field fix in models to help with the change from repeatable fields to subform fields. Added ajax to load admin fields and conditions into the admin view.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 21 of this MVC
|
||||
@version @update number 22 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 12th October, 2017
|
||||
@package Component Builder
|
||||
|
@ -10,7 +10,7 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 14 of this MVC
|
||||
@version @update number 15 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 12th October, 2017
|
||||
@package Component Builder
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 141 of this MVC
|
||||
@build 13th October, 2017
|
||||
@version @update number 166 of this MVC
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage admin_view.php
|
||||
@ -366,6 +366,105 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id);
|
||||
ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod);
|
||||
}
|
||||
|
||||
// update the fields
|
||||
$objectUpdate = new stdClass();
|
||||
$objectUpdate->id = (int) $item->id;
|
||||
// check what type of linked_views array we have here (should be subform... but just incase)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->addlinked_views) && isset($item->addlinked_views['adminview']))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->addlinked_views as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket['addlinked_views'.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->addlinked_views = $bucket;
|
||||
$objectUpdate->addconditions = json_encode($bucket);
|
||||
}
|
||||
// check what type of ajax_input array we have here (should be subform... but just incase)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->ajax_input) && isset($item->ajax_input['value_name']))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->ajax_input as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket['ajax_input'.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->ajax_input = $bucket;
|
||||
$objectUpdate->ajax_input = json_encode($bucket);
|
||||
}
|
||||
// check what type of custom_button array we have here (should be subform... but just incase)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->custom_button) && isset($item->custom_button['name']))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->custom_button as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket['custom_button'.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->custom_button = $bucket;
|
||||
$objectUpdate->custom_button = json_encode($bucket);
|
||||
}
|
||||
// check what type of permissions array we have here (should be subform... but just incase)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->addpermissions) && isset($item->addpermissions['action']))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->addpermissions as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket['addpermissions'.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->addpermissions = $bucket;
|
||||
$objectUpdate->addpermissions = json_encode($bucket);
|
||||
}
|
||||
// check what type of table array we have here (should be subform... but just incase)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->addtables) && isset($item->addtables['table']))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->addtables as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket['addtables'.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->addtables = $bucket;
|
||||
$objectUpdate->addtables = json_encode($bucket);
|
||||
}
|
||||
// check what type of tabs array we have here (should be subform... but just incase)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->addtabs) && isset($item->addtabs['name']))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->addtabs as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket['addtabs'.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->addtabs = $bucket;
|
||||
$objectUpdate->addtabs = json_encode($bucket);
|
||||
}
|
||||
// be sure to update the table if we found repeatable fields that are still not converted
|
||||
if (count((array) $objectUpdate) > 1)
|
||||
{
|
||||
$this->_db->updateObject('#__componentbuilder_admin_view', $objectUpdate, 'id');
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
{
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 141 of this MVC
|
||||
@build 13th October, 2017
|
||||
@version @update number 166 of this MVC
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage admin_views.php
|
||||
|
@ -10,7 +10,7 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 21 of this MVC
|
||||
@version @update number 22 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 12th October, 2017
|
||||
@package Component Builder
|
||||
|
@ -10,7 +10,7 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 14 of this MVC
|
||||
@version @update number 15 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 12th October, 2017
|
||||
@package Component Builder
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage ajax.php
|
||||
@ -308,6 +308,335 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
return ComponentbuilderHelper::getImportScripts($type);
|
||||
}
|
||||
|
||||
protected $functionArray = array(
|
||||
'field' => 'setFieldsNames',
|
||||
'list' => 'setYesNo',
|
||||
'title' => 'setYesNo',
|
||||
'alias' => 'setYesNo',
|
||||
'sort' => 'setYesNo',
|
||||
'search' => 'setYesNo',
|
||||
'filter' => 'setYesNo',
|
||||
'link' => 'setYesNo',
|
||||
'permission' => 'setYesNo',
|
||||
'tab' => 'setTabName',
|
||||
'alignment' => 'setAlignmentName',
|
||||
'target_field' => 'setFieldsNames',
|
||||
'target_behavior' => 'setTargetBehavior',
|
||||
'target_relation' => 'setTargetRelation',
|
||||
'match_field' => 'setFieldsNames',
|
||||
'match_behavior' => 'setMatchBehavior',
|
||||
'match_options' => 'setMatchOptions');
|
||||
|
||||
protected function getSubformTable($idName, $oject)
|
||||
{
|
||||
if (ComponentbuilderHelper::checkJson($oject) && ComponentbuilderHelper::checkString($idName))
|
||||
{
|
||||
$array = json_decode($oject, true);
|
||||
if (ComponentbuilderHelper::checkArray($array))
|
||||
{
|
||||
// Build heading
|
||||
$head = array();
|
||||
foreach ($array as $headers)
|
||||
{
|
||||
foreach ($headers as $header => $value)
|
||||
{
|
||||
$head[$header] = '<th>' . ComponentbuilderHelper::safeString($header, 'Ww');
|
||||
}
|
||||
}
|
||||
// build the rows
|
||||
$rows = array();
|
||||
if (ComponentbuilderHelper::checkArray($array) && ComponentbuilderHelper::checkArray($head))
|
||||
{
|
||||
foreach ($array as $nr => $values)
|
||||
{
|
||||
foreach ($head as $key => $t)
|
||||
{
|
||||
// set the value for the row
|
||||
if (isset($values[$key]))
|
||||
{
|
||||
$this->setSubformRows($nr, $this->setSubformValue($key, $values[$key]), $rows);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setSubformRows($nr, $this->setSubformValue($key, ''), $rows);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// build table
|
||||
if (ComponentbuilderHelper::checkArray($rows) && ComponentbuilderHelper::checkArray($head))
|
||||
{
|
||||
// return the table
|
||||
return $this->setSubformTable($head, $rows);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function setSubformTable($head, $rows)
|
||||
{
|
||||
$table[] = "<div class=\"row-fluid\">";
|
||||
$table[] = "\t<div class=\"subform-repeatable-wrapper subform-table-layout subform-table-sublayout-section-byfieldsets\">";
|
||||
$table[] = "\t\t<div class=\"subform-repeatable\">";
|
||||
$table[] = "\t\t\t<table class=\"adminlist table table-striped table-bordered\">";
|
||||
$table[] = "\t\t\t\t<thead>";
|
||||
$table[] = "\t\t\t\t\t<tr>";
|
||||
$table[] = "\t\t\t\t\t\t". implode("", $head);
|
||||
$table[] = "\t\t\t\t\t</tr>";
|
||||
$table[] = "\t\t\t\t</thead>";
|
||||
$table[] = "\t\t\t\t<tbody>";
|
||||
foreach ($rows as $row)
|
||||
{
|
||||
$table[] = "\t\t\t\t\t<tr class=\"subform-repeatable-group\">";
|
||||
$table[] = "\t\t\t\t\t\t" . $row;
|
||||
$table[] = "\t\t\t\t\t</tr>";
|
||||
}
|
||||
$table[] = "\t\t\t\t</tbody>";
|
||||
$table[] = "\t\t\t</table>";
|
||||
$table[] = "\t\t</div>";
|
||||
$table[] = "\t</div>";
|
||||
$table[] = "</div>";
|
||||
// return the table
|
||||
return implode("\n", $table);
|
||||
}
|
||||
|
||||
protected function setSubformValue($header, $value)
|
||||
{
|
||||
if (array_key_exists($header, $this->functionArray) && method_exists($this, $this->functionArray[$header]))
|
||||
{
|
||||
$value = $this->{$this->functionArray[$header]}($header, $value);
|
||||
}
|
||||
// if no value are set
|
||||
if (!ComponentbuilderHelper::checkString($value))
|
||||
{
|
||||
$value = '-';
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
protected function setSubformRows($nr, $value, &$rows)
|
||||
{
|
||||
// build rows
|
||||
if (!isset($rows[$nr]))
|
||||
{
|
||||
$rows[$nr] = '<td>'.$value.'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$rows[$nr] .= '<td>'.$value.'</td>';
|
||||
}
|
||||
}
|
||||
|
||||
protected $fieldsArray = array(
|
||||
'admin_fields' => 'addfields',
|
||||
'admin_fields_conditions' => 'addconditions');
|
||||
|
||||
public function getFieldsDisplay($type)
|
||||
{
|
||||
if (isset($this->fieldsArray[$type]))
|
||||
{
|
||||
// get the view name & id
|
||||
$values = $this->getViewID();
|
||||
// check if we are in the correct view.
|
||||
if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']) && $values['a_view'] === 'admin_view')
|
||||
{
|
||||
// get the field data
|
||||
if ($fieldsData = ComponentbuilderHelper::getVar($type, (int) $values['a_id'], 'admin_view', $this->fieldsArray[$type]))
|
||||
{
|
||||
// decode the fields
|
||||
return $this->getSubformTable($type, $fieldsData);
|
||||
}
|
||||
}
|
||||
return '<div class="control-group"><div class="alert alert-info">' . JText::sprintf('COM_COMPONENTBUILDER_NO_S_HAVE_BEEN_LINKED_TO_THIS_VIEW_SOON_AS_THIS_IS_DONE_IT_WILL_BE_DISPLAYED_HERE', ComponentbuilderHelper::safeString($type, 'w')) . '</div></div>';
|
||||
}
|
||||
return '<div class="control-group"><div class="alert alert-error"><h4>' . JText::_('COM_COMPONENTBUILDER_TYPE_ERROR') . '</h4><p>' . JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_IF_THIS_CONTINUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR_OF_A_TYPE_ERROR_IN_THE_FIELDS_DISPLAY_REQUEST') . '</p></div></div>';
|
||||
}
|
||||
|
||||
protected function setAlignmentName($header, $value)
|
||||
{
|
||||
switch ($value)
|
||||
{
|
||||
case 1:
|
||||
return JText::_('COM_COMPONENTBUILDER_LEFT_IN_TAB');
|
||||
break;
|
||||
case 2:
|
||||
return JText::_('COM_COMPONENTBUILDER_RIGHT_IN_TAB');
|
||||
break;
|
||||
case 3:
|
||||
return JText::_('COM_COMPONENTBUILDER_FULL_WIDTH_IN_TAB');
|
||||
break;
|
||||
case 4:
|
||||
return JText::_('COM_COMPONENTBUILDER_ABOVE_TABS');
|
||||
break;
|
||||
case 5:
|
||||
return JText::_('COM_COMPONENTBUILDER_UNDERNEATH_TABS');
|
||||
break;
|
||||
case 6:
|
||||
return JText::_('COM_COMPONENTBUILDER_LEFT_OF_TABS');
|
||||
break;
|
||||
case 7:
|
||||
return JText::_('COM_COMPONENTBUILDER_RIGHT_OF_TABS');
|
||||
break;
|
||||
}
|
||||
return JText::_('COM_COMPONENTBUILDER_NOT_SET');
|
||||
}
|
||||
|
||||
protected $fieldNames = array();
|
||||
|
||||
protected function setFieldsNames($header, $value)
|
||||
{
|
||||
$bucket = array();
|
||||
if (ComponentbuilderHelper::checkArray($value))
|
||||
{
|
||||
foreach ($value as $field)
|
||||
{
|
||||
if (!isset($this->fieldNames[$field]))
|
||||
{
|
||||
if (!$this->fieldNames[$field] = ComponentbuilderHelper::getVar('field', (int) $field, 'id', 'name'))
|
||||
{
|
||||
$this->fieldNames[$field] = JText::_('COM_COMPONENTBUILDER_NO_FIELD_FOUND');
|
||||
}
|
||||
}
|
||||
$bucket[] = $this->fieldNames[$field];
|
||||
}
|
||||
}
|
||||
elseif (is_numeric($value))
|
||||
{
|
||||
if (!isset($this->fieldNames[$value]))
|
||||
{
|
||||
if (!$this->fieldNames[$value] = ComponentbuilderHelper::getVar('field', (int) $value, 'id', 'name'))
|
||||
{
|
||||
$this->fieldNames[$value] = JText::_('COM_COMPONENTBUILDER_NO_FIELD_FOUND');
|
||||
}
|
||||
}
|
||||
$bucket[] = $this->fieldNames[$value];
|
||||
}
|
||||
// return found fields
|
||||
if (ComponentbuilderHelper::checkArray($bucket))
|
||||
{
|
||||
return implode('<br />', $bucket);
|
||||
}
|
||||
return JText::_('COM_COMPONENTBUILDER_NO_FIELD_FOUND');
|
||||
}
|
||||
|
||||
protected $tabNames = array();
|
||||
|
||||
protected function setTabName($header, $value)
|
||||
{
|
||||
if (ComponentbuilderHelper::checkArray($this->tabNames))
|
||||
{
|
||||
// get the view name & id
|
||||
$values = $this->getViewID();
|
||||
if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']) && $values['a_view'] === 'admin_view')
|
||||
{
|
||||
if ($tabs = ComponentbuilderHelper::getVar('admin_view', $values['a_id'], 'id', 'addtabs'))
|
||||
{
|
||||
$tabs = json_decode($tabs, true);
|
||||
if (ComponentbuilderHelper::checkArray($tabs))
|
||||
{
|
||||
$nr = 1;
|
||||
foreach ($tabs as $tab)
|
||||
{
|
||||
if (ComponentbuilderHelper::checkArray($tab) && isset($tab['name']))
|
||||
{
|
||||
$this->tabNames[$nr] = $tab['name'];
|
||||
$nr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// has it been set
|
||||
if (ComponentbuilderHelper::checkArray($this->tabNames) && isset($this->tabNames[$value]))
|
||||
{
|
||||
return $this->tabNames[$value];
|
||||
}
|
||||
return JText::_('COM_COMPONENTBUILDER_DETAILS');
|
||||
}
|
||||
|
||||
protected function setYesNo($header, $value)
|
||||
{
|
||||
if (1 == $value)
|
||||
{
|
||||
return JText::_('COM_COMPONENTBUILDER_YES');
|
||||
}
|
||||
return JText::_('COM_COMPONENTBUILDER_NO');
|
||||
}
|
||||
|
||||
protected function setTargetBehavior($header, $value)
|
||||
{
|
||||
if (1 == $value)
|
||||
{
|
||||
return JText::_('COM_COMPONENTBUILDER_SHOW');
|
||||
}
|
||||
return JText::_('COM_COMPONENTBUILDER_HIDE');
|
||||
}
|
||||
|
||||
protected function setTargetRelation($header, $value)
|
||||
{
|
||||
switch ($value)
|
||||
{
|
||||
case 0:
|
||||
return JText::_('COM_COMPONENTBUILDER_ISOLATE');
|
||||
break;
|
||||
case 1:
|
||||
return JText::_('COM_COMPONENTBUILDER_CHAIN');
|
||||
break;
|
||||
}
|
||||
return JText::_('COM_COMPONENTBUILDER_NOT_SET');
|
||||
}
|
||||
|
||||
protected function setMatchBehavior($header, $value)
|
||||
{
|
||||
switch ($value)
|
||||
{
|
||||
case 1:
|
||||
return JText::_('COM_COMPONENTBUILDER_IS_ONLY_FOUR_LISTRADIOCHECKBOXES');
|
||||
break;
|
||||
case 2:
|
||||
return JText::_('COM_COMPONENTBUILDER_IS_NOT_ONLY_FOUR_LISTRADIOCHECKBOXES');
|
||||
break;
|
||||
case 3:
|
||||
return JText::_('COM_COMPONENTBUILDER_ANY_SELECTION_ONLY_FOUR_LISTRADIOCHECKBOXESDYNAMIC_LIST');
|
||||
break;
|
||||
case 4:
|
||||
return JText::_('COM_COMPONENTBUILDER_ACTIVE_ONLY_FOUR_TEXT_FIELD');
|
||||
break;
|
||||
case 5:
|
||||
return JText::_('COM_COMPONENTBUILDER_UNACTIVE_ONLY_FOUR_TEXT_FIELD');
|
||||
break;
|
||||
case 6:
|
||||
return JText::_('COM_COMPONENTBUILDER_KEY_WORD_ALL_CASESENSITIVE_ONLY_FOUR_TEXT_FIELD');
|
||||
break;
|
||||
case 7:
|
||||
return JText::_('COM_COMPONENTBUILDER_KEY_WORD_ANY_CASESENSITIVE_ONLY_FOUR_TEXT_FIELD');
|
||||
break;
|
||||
case 8:
|
||||
return JText::_('COM_COMPONENTBUILDER_KEY_WORD_ALL_CASEINSENSITIVE_ONLY_FOUR_TEXT_FIELD');
|
||||
break;
|
||||
case 9:
|
||||
return JText::_('COM_COMPONENTBUILDER_KEY_WORD_ANY_CASEINSENSITIVE_ONLY_FOUR_TEXT_FIELD');
|
||||
break;
|
||||
case 10:
|
||||
return JText::_('COM_COMPONENTBUILDER_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD');
|
||||
break;
|
||||
case 11:
|
||||
return JText::_('COM_COMPONENTBUILDER_MAX_LENGTH_ONLY_FOUR_TEXT_FIELD');
|
||||
break;
|
||||
case 12:
|
||||
return JText::_('COM_COMPONENTBUILDER_EXACT_LENGTH_ONLY_FOUR_TEXT_FIELD');
|
||||
break;
|
||||
}
|
||||
return JText::_('COM_COMPONENTBUILDER_NOT_SET');
|
||||
}
|
||||
|
||||
protected function setMatchOptions($header, $value)
|
||||
{
|
||||
return str_replace("\n", "<br />", $value);
|
||||
}
|
||||
|
||||
public function getFieldSelectOptions($id)
|
||||
{
|
||||
// Get a db connection.
|
||||
@ -1010,7 +1339,7 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
$query['a']['select'] = array('id', 'system_name', 'php_preflight_install','php_postflight_install',
|
||||
'php_preflight_update','php_postflight_update','php_method_uninstall',
|
||||
'php_helper_admin','php_admin_event','php_helper_both','php_helper_site',
|
||||
'php_site_event','php_dashboard_methods','dashboard_tab');
|
||||
'php_site_event','php_dashboard_methods','dashboard_tab','javascript');
|
||||
$query['a']['not_base64'] = array('dashboard_tab' => 'json');
|
||||
$query['a']['name'] = 'system_name';
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 55 of this MVC
|
||||
@build 13th September, 2017
|
||||
@version @update number 57 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 1st February, 2017
|
||||
@package Component Builder
|
||||
@subpackage compiler.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 27 of this MVC
|
||||
@build 9th October, 2017
|
||||
@version @update number 31 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 13th August, 2015
|
||||
@package Component Builder
|
||||
@subpackage custom_admin_view.php
|
||||
@ -169,6 +169,27 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
|
||||
{
|
||||
// base64 Decode css.
|
||||
$item->css = base64_decode($item->css);
|
||||
}
|
||||
|
||||
// check what type of custom_button array we have here (should be subform... but just incase)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->custom_button) && isset($item->custom_button['name']))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->custom_button as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket['custom_button'.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->custom_button = $bucket;
|
||||
// update the fields
|
||||
$objectUpdate = new stdClass();
|
||||
$objectUpdate->id = (int) $item->id;
|
||||
$objectUpdate->custom_button = json_encode($bucket);
|
||||
// be sure to update the table if we found repeatable fields that are still not converted
|
||||
$this->_db->updateObject('#__componentbuilder_custom_admin_view ', $objectUpdate, 'id');
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 27 of this MVC
|
||||
@build 9th October, 2017
|
||||
@version @update number 31 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 13th August, 2015
|
||||
@package Component Builder
|
||||
@subpackage custom_admin_views.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 82 of this MVC
|
||||
@build 4th October, 2017
|
||||
@version @update number 84 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 11th October, 2016
|
||||
@package Component Builder
|
||||
@subpackage custom_code.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 82 of this MVC
|
||||
@build 4th October, 2017
|
||||
@version @update number 84 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 11th October, 2016
|
||||
@package Component Builder
|
||||
@subpackage custom_codes.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage adminviewfolderlist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage adminviews.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage articles.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage component.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage components.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customadminviews.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customfilelist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customfolderlist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customgets.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dbtables.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dynamicget.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dynamicgets.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fields.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldsmulti.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtypes.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage ftps.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage lang.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage maingets.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage siteviewfolderlist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage siteviews.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage snippets.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage viewtabs.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 15 of this MVC
|
||||
@build 17th September, 2017
|
||||
@version @update number 16 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtype.php
|
||||
@ -101,6 +101,26 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
|
||||
$properties = new Registry;
|
||||
$properties->loadString($item->properties);
|
||||
$item->properties = $properties->toArray();
|
||||
}
|
||||
|
||||
// check what type of properties array we have here (should be subform... but just incase)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->properties) && isset($item->properties['name']))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->properties as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket['addfields'.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->properties = $bucket;
|
||||
// be sure to update the value in the db
|
||||
$objectUpdate = new stdClass();
|
||||
$objectUpdate->id = (int) $item->id;
|
||||
$objectUpdate->properties = json_encode($bucket);
|
||||
$this->db->updateObject('#__componentbuilder_fieldtype', $objectUpdate, 'id');
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 15 of this MVC
|
||||
@build 17th September, 2017
|
||||
@version @update number 16 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtypes.php
|
||||
|
@ -9,7 +9,7 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 21 of this MVC
|
||||
@version @update number 22 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 12th October, 2017
|
||||
@package Component Builder
|
||||
|
@ -9,7 +9,7 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 14 of this MVC
|
||||
@version @update number 15 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 12th October, 2017
|
||||
@package Component Builder
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 141 of this MVC
|
||||
@build 13th October, 2017
|
||||
@version @update number 166 of this MVC
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage admin_view.js
|
||||
@ -1183,8 +1183,34 @@ jQuery(document).ready(function()
|
||||
var valueSwitch = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
|
||||
getImportScripts(valueSwitch);
|
||||
addButtonID('admin_fields_conditions','create_edit_buttons'); // <-- second
|
||||
|
||||
// now load the fields
|
||||
getFieldsDisplay('admin_fields');
|
||||
getFieldsDisplay('admin_fields_conditions');
|
||||
});
|
||||
|
||||
function getFieldsDisplay(type){
|
||||
getFieldsDisplay_server(type).done(function(result) {
|
||||
if(result){
|
||||
jQuery('#display_'+type).html(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getFieldsDisplay_server(type){
|
||||
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getFieldsDisplay&format=json&vdm="+vastDevMod;
|
||||
if(token.length > 0 && type.length > 0){
|
||||
var request = 'token='+token+'&type=' + type;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
});
|
||||
}
|
||||
|
||||
function addData(result,where){
|
||||
jQuery(where).closest('.control-group').parent().append(result);
|
||||
}
|
||||
@ -1207,7 +1233,7 @@ function addButtonID(type,where){
|
||||
if(result){
|
||||
addData(result,'#jform_'+where);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function getTableColumns_server(tableName){
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 27 of this MVC
|
||||
@build 9th October, 2017
|
||||
@version @update number 31 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 13th August, 2015
|
||||
@package Component Builder
|
||||
@subpackage custom_admin_view.js
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 82 of this MVC
|
||||
@build 4th October, 2017
|
||||
@version @update number 84 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 11th October, 2016
|
||||
@package Component Builder
|
||||
@subpackage custom_code.js
|
||||
@ -325,6 +325,7 @@ function usedin(functioName, ide) {
|
||||
if (used.in) {
|
||||
jQuery('#usedin-'+used.id).show();
|
||||
jQuery('#area-'+used.id).html(used.in);
|
||||
jQuery.UIkit.notify({message: used.in, timeout: 5000, status: 'success', pos: 'top-right'});
|
||||
found = true;
|
||||
} else {
|
||||
jQuery('#usedin-'+target).hide();
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 15 of this MVC
|
||||
@build 17th September, 2017
|
||||
@version @update number 16 of this MVC
|
||||
@build 13th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtype.js
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 58 of this MVC
|
||||
@build 9th October, 2017
|
||||
@version @update number 63 of this MVC
|
||||
@build 14th October, 2017
|
||||
@created 29th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage site_view.js
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage import.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.8
|
||||
@build 13th October, 2017
|
||||
@build 14th October, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage import_joomla_components.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 58 of this MVC
|
||||
@build 9th October, 2017
|
||||
@version @update number 63 of this MVC
|
||||
@build 14th October, 2017
|
||||
@created 29th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage site_view.php
|
||||
@ -183,6 +183,45 @@ class ComponentbuilderModelSite_view extends JModelAdmin
|
||||
{
|
||||
// base64 Decode php_jview.
|
||||
$item->php_jview = base64_decode($item->php_jview);
|
||||
}
|
||||
|
||||
// update the fields
|
||||
$objectUpdate = new stdClass();
|
||||
$objectUpdate->id = (int) $item->id;
|
||||
// check what type of custom_button array we have here (should be subform... but just incase)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->custom_button) && isset($item->custom_button['name']))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->custom_button as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket['custom_button'.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->custom_button = $bucket;
|
||||
$objectUpdate->custom_button = json_encode($bucket);
|
||||
}
|
||||
// check what type of ajax_input array we have here (should be subform... but just incase)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->ajax_input) && isset($item->ajax_input['value_name']))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->ajax_input as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket['ajax_input'.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->ajax_input = $bucket;
|
||||
$objectUpdate->ajax_input = json_encode($bucket);
|
||||
}
|
||||
// be sure to update the table if we found repeatable fields that are still not converted
|
||||
if (count((array) $objectUpdate) > 1)
|
||||
{
|
||||
$this->_db->updateObject('#__componentbuilder_site_view', $objectUpdate, 'id');
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 58 of this MVC
|
||||
@build 9th October, 2017
|
||||
@version @update number 63 of this MVC
|
||||
@build 14th October, 2017
|
||||
@created 29th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage site_views.php
|
||||
|
Reference in New Issue
Block a user