Stable release v2.10.0
This commit is contained in:
@ -540,82 +540,82 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$item->ajax_input = $ajax_input->toArray();
|
||||
}
|
||||
|
||||
if (empty($item->id))
|
||||
{
|
||||
$id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = $item->id;
|
||||
}
|
||||
// set the id and view name to session
|
||||
if ($vdm = ComponentbuilderHelper::get('admin_view__'.$id))
|
||||
{
|
||||
$this->vastDevMod = $vdm;
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the vast development method key
|
||||
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id);
|
||||
ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod);
|
||||
// set a return value if found
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
}
|
||||
|
||||
// update the fields
|
||||
$objectUpdate = new stdClass();
|
||||
$objectUpdate->id = (int) $item->id;
|
||||
// repeatable values to check
|
||||
$arrayChecker = array(
|
||||
'addlinked_views' => 'adminview',
|
||||
'ajax_input' => 'value_name',
|
||||
'custom_button' => 'name',
|
||||
'addpermissions' => 'action',
|
||||
'addtables' => 'table',
|
||||
'addtabs' => 'name'
|
||||
);
|
||||
foreach ($arrayChecker as $_value => $checker)
|
||||
{
|
||||
// check what type of array we have here (should be subform... but just in case)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->{$_value} as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket[$_value.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->{$_value} = $bucket;
|
||||
$objectUpdate->{$_value} = 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');
|
||||
}
|
||||
|
||||
// update the mysql_table_engine defaults
|
||||
if (isset($item->mysql_table_engine) && is_numeric($item->mysql_table_engine))
|
||||
{
|
||||
$item->mysql_table_engine = 'MyISAM';
|
||||
}
|
||||
// update the mysql_table_charset defaults
|
||||
if (isset($item->mysql_table_charset) && is_numeric($item->mysql_table_charset))
|
||||
{
|
||||
$item->mysql_table_charset = 'utf8';
|
||||
}
|
||||
// update the mysql_table_collate defaults
|
||||
if (isset($item->mysql_table_collate) && is_numeric($item->mysql_table_collate))
|
||||
{
|
||||
$item->mysql_table_collate = 'utf8_general_ci';
|
||||
}
|
||||
if (empty($item->id))
|
||||
{
|
||||
$id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = $item->id;
|
||||
}
|
||||
// set the id and view name to session
|
||||
if ($vdm = ComponentbuilderHelper::get('admin_view__'.$id))
|
||||
{
|
||||
$this->vastDevMod = $vdm;
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the vast development method key
|
||||
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id);
|
||||
ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod);
|
||||
// set a return value if found
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
}
|
||||
|
||||
// update the fields
|
||||
$objectUpdate = new stdClass();
|
||||
$objectUpdate->id = (int) $item->id;
|
||||
// repeatable values to check
|
||||
$arrayChecker = array(
|
||||
'addlinked_views' => 'adminview',
|
||||
'ajax_input' => 'value_name',
|
||||
'custom_button' => 'name',
|
||||
'addpermissions' => 'action',
|
||||
'addtables' => 'table',
|
||||
'addtabs' => 'name'
|
||||
);
|
||||
foreach ($arrayChecker as $_value => $checker)
|
||||
{
|
||||
// check what type of array we have here (should be subform... but just in case)
|
||||
// This could happen due to huge data sets
|
||||
if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
|
||||
{
|
||||
$bucket = array();
|
||||
foreach($item->{$_value} as $option => $values)
|
||||
{
|
||||
foreach($values as $nr => $value)
|
||||
{
|
||||
$bucket[$_value.$nr][$option] = $value;
|
||||
}
|
||||
}
|
||||
$item->{$_value} = $bucket;
|
||||
$objectUpdate->{$_value} = 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');
|
||||
}
|
||||
|
||||
// update the mysql_table_engine defaults
|
||||
if (isset($item->mysql_table_engine) && is_numeric($item->mysql_table_engine))
|
||||
{
|
||||
$item->mysql_table_engine = 'MyISAM';
|
||||
}
|
||||
// update the mysql_table_charset defaults
|
||||
if (isset($item->mysql_table_charset) && is_numeric($item->mysql_table_charset))
|
||||
{
|
||||
$item->mysql_table_charset = 'utf8';
|
||||
}
|
||||
// update the mysql_table_collate defaults
|
||||
if (isset($item->mysql_table_collate) && is_numeric($item->mysql_table_collate))
|
||||
{
|
||||
$item->mysql_table_collate = 'utf8_general_ci';
|
||||
}
|
||||
|
||||
|
||||
if (!empty($item->id))
|
||||
@ -1414,11 +1414,11 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$data['metadata'] = (string) $metadata;
|
||||
}
|
||||
|
||||
// if system name is empty create a system name from the name_single
|
||||
if (empty($data['system_name']) || !ComponentbuilderHelper::checkString($data['system_name']))
|
||||
{
|
||||
$data['system_name'] = $data['name_single'];
|
||||
}
|
||||
// if system name is empty create a system name from the name_single
|
||||
if (empty($data['system_name']) || !ComponentbuilderHelper::checkString($data['system_name']))
|
||||
{
|
||||
$data['system_name'] = $data['name_single'];
|
||||
}
|
||||
|
||||
|
||||
// Set the addtables items to data.
|
||||
|
@ -1051,11 +1051,17 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
switch ($value)
|
||||
{
|
||||
case 1:
|
||||
return JText::_('COM_COMPONENTBUILDER_SHOW_IN_LIST_VIEW');
|
||||
return JText::_('COM_COMPONENTBUILDER_SHOW_IN_ALL_LIST_VIEWS');
|
||||
break;
|
||||
case 2:
|
||||
return JText::_('COM_COMPONENTBUILDER_NONE_DB');
|
||||
break;
|
||||
case 3:
|
||||
return JText::_('COM_COMPONENTBUILDER_ONLY_IN_ADMIN_LIST_VIEW');
|
||||
break;
|
||||
case 4:
|
||||
return JText::_('COM_COMPONENTBUILDER_ONLY_IN_LINKED_LIST_VIEWS');
|
||||
break;
|
||||
default:
|
||||
return JText::_('COM_COMPONENTBUILDER_DEFAULT');
|
||||
break;
|
||||
|
Reference in New Issue
Block a user