Fixed gh-235 to insure that the public access switch for front-end views work. Resolved gh-236 to Auto save Name to System Name if blank. Added text area for private key of server. Fixed the getModel helper method. Fixed the batch methods. Maked a few tweaks to the compiler.

This commit is contained in:
2018-02-27 14:17:38 +02:00
parent 61a8d6fe3f
commit 1b86f1539a
98 changed files with 1409 additions and 1169 deletions

View File

@ -546,8 +546,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields');
}
@ -572,7 +570,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -582,17 +579,11 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('admin_fields.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -602,7 +593,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -613,7 +603,11 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
}
}
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->admin_view) && !is_numeric($this->table->admin_view))
{
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -695,8 +689,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields');
}
@ -720,7 +712,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
if (!$this->user->authorise('admin_fields.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -731,7 +722,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -546,8 +546,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
}
@ -572,7 +570,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -582,17 +579,11 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('admin_fields_conditions.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -602,7 +593,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -613,7 +603,11 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
}
}
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->admin_view) && !is_numeric($this->table->admin_view))
{
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -695,8 +689,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
}
@ -720,7 +712,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
if (!$this->user->authorise('admin_fields_conditions.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -731,7 +722,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -352,7 +352,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_import_ext = base64_decode($item->php_import_ext);
}
if (empty($item->id))
{
$id = 0;
@ -371,7 +371,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id);
ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod);
}
}
// update the fields
$objectUpdate = new stdClass();
@ -908,8 +908,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_view');
}
@ -934,7 +932,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -944,17 +941,11 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('admin_view.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -964,7 +955,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -1029,7 +1019,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
// Add the new ID to the array
$newIds[$pk] = $newId;
}
if (ComponentbuilderHelper::checkArray($newIds))
{
foreach($newIds as $oldID => $newID)
@ -1048,7 +1038,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
}
}
}
// Clean the cache
$this->cleanCache();
@ -1075,8 +1065,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_view');
}
@ -1100,7 +1088,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
if (!$this->user->authorise('admin_view.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -1111,7 +1098,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -1192,6 +1178,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// if system name is empty create from name_single
if (empty($data['system_name']) || !ComponentbuilderHelper::checkString($data['system_name']))
{
$data['system_name'] = $data['name_single'];
}
// Set the addtables items to data.
if (isset($data['addtables']) && is_array($data['addtables']))
{

View File

@ -44,7 +44,7 @@ class ComponentbuilderModelAjax extends JModelList
}
// Used in joomla_component
/**
* Check and if a vdm notice is new (per/user)
**/
@ -91,7 +91,7 @@ class ComponentbuilderModelAjax extends JModelList
return true;
}
return false;
}
}
/**
* get the component details (html)
**/
@ -177,7 +177,7 @@ class ComponentbuilderModelAjax extends JModelList
}
// Used in admin_view
protected $viewid = array();
protected function getViewID($call = 'table')
@ -209,7 +209,7 @@ class ComponentbuilderModelAjax extends JModelList
}
return false;
}
protected $buttonArray = array(
'library_config' => 'libraries_config',
'library_files_folders_urls' => 'libraries_files_folders_urls',
@ -226,7 +226,7 @@ class ComponentbuilderModelAjax extends JModelList
'component_dashboard' => 'components_dashboard',
'component_files_folders' => 'components_files_folders',
'language' => true);
public function getButton($type)
{
if (isset($this->buttonArray[$type]))
@ -262,8 +262,8 @@ class ComponentbuilderModelAjax extends JModelList
return '';
}
return false;
}
}
public function getButtonID($type, $size)
{
if (isset($this->buttonArray[$type]))
@ -331,7 +331,7 @@ class ComponentbuilderModelAjax extends JModelList
}
}
return '';
}
}
public static function getDynamicScripts($type)
{
@ -446,7 +446,7 @@ class ComponentbuilderModelAjax extends JModelList
return ComponentbuilderHelper::safeString($keys[1], 'Ww');
}
protected function getSubformTable($idName, $data)
{
// make sure we convert the json to array
@ -553,7 +553,7 @@ class ComponentbuilderModelAjax extends JModelList
{
$rows[$nr] .= '<td data-column=" '.$_header.' ">'.$value.'</td>';
}
}
}
protected $ref;
protected $fieldsArray = array(
@ -1840,7 +1840,7 @@ class ComponentbuilderModelAjax extends JModelList
}
return false;
}
/**
* Get the keys of the values to search custom code in
*
@ -1977,7 +1977,7 @@ class ComponentbuilderModelAjax extends JModelList
return $targets[$target];
}
return false;
}
}
// Used in field
public function getFieldOptions($id)
@ -1991,7 +1991,7 @@ class ComponentbuilderModelAjax extends JModelList
}
// Used in get_snippets
public function getSnippets($libraries)
{
if (ComponentbuilderHelper::checkJson($libraries))
@ -2074,7 +2074,7 @@ class ComponentbuilderModelAjax extends JModelList
}
}
return false;
}
}
public function getSnippetDetails($id)
{
// Get a db connection.

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_admin_views');
}
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('component_admin_views.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
}
}
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_admin_views');
}
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
if (!$this->user->authorise('component_admin_views.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_config');
}
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('component_config.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
}
}
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_config');
}
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
if (!$this->user->authorise('component_config.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus');
}
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('component_custom_admin_menus.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
}
}
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus');
}
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
if (!$this->user->authorise('component_custom_admin_menus.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views');
}
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('component_custom_admin_views.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
}
}
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views');
}
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
if (!$this->user->authorise('component_custom_admin_views.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -563,8 +563,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_dashboard');
}
@ -589,7 +587,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -599,17 +596,11 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('component_dashboard.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -619,7 +610,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -630,7 +620,11 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
}
}
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -712,8 +706,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_dashboard');
}
@ -737,7 +729,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
if (!$this->user->authorise('component_dashboard.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -748,7 +739,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -582,8 +582,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_files_folders');
}
@ -608,7 +606,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -618,17 +615,11 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('component_files_folders.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -638,7 +629,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -649,7 +639,11 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
}
}
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -731,8 +725,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_files_folders');
}
@ -756,7 +748,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
if (!$this->user->authorise('component_files_folders.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -767,7 +758,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks');
}
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('component_mysql_tweaks.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
}
}
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks');
}
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
if (!$this->user->authorise('component_mysql_tweaks.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_site_views');
}
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('component_site_views.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
}
}
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_site_views');
}
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
if (!$this->user->authorise('component_site_views.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_updates');
}
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('component_updates.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
}
}
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_updates');
}
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
if (!$this->user->authorise('component_updates.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -336,7 +336,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList
return $icons;
}
public function getGithub()
{
// load jquery (not sure why... but else the timeago breaks)
@ -428,8 +428,8 @@ class ComponentbuilderModelComponentbuilder extends JModelList
'closedissues' => $create.'<div id="closedissues">'.JText::_('COM_COMPONENTBUILDER_A_FEW_CLOSED_ISSUES_FROM_GITHUB_IS_LOADING').'.<span class="loading-dots">.</span></small></div>'.$moreclosed,
'tagreleases' => '<div id="tagreleases">'.JText::_('COM_COMPONENTBUILDER_LAST_FEW_RELEASES_FROM_GITHUB_IS_LOADING').'.<span class="loading-dots">.</span></small></div>'.$viewissues
);
}
}
public function getWiki()
{
$document = JFactory::getDocument();
@ -448,8 +448,8 @@ class ComponentbuilderModelComponentbuilder extends JModelList
return '<div id="wiki-md"><small>'.JText::_('COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING').'.<span class="loading-dots">.</span></small></div>';
}
public function getNoticeboard()
{
// get the document to load the scripts
@ -521,8 +521,8 @@ class ComponentbuilderModelComponentbuilder extends JModelList
});');
return '<div id="noticeboard-md">'.JText::_('COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING').'.<span class="loading-dots">.</span></small></div>';
}
}
public function getReadme()
{
$document = JFactory::getDocument();
@ -539,5 +539,5 @@ class ComponentbuilderModelComponentbuilder extends JModelList
});');
return '<div id="readme-md"><small>'.JText::_('COM_COMPONENTBUILDER_THE_README_IS_LOADING').'.<span class="loading-dots">.</span></small></div>';
}
}
}

View File

@ -204,7 +204,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$item->php_model = base64_decode($item->php_model);
}
if (empty($item->id))
{
$id = 0;
@ -223,7 +223,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'custom_admin_view__'.$id);
ComponentbuilderHelper::set('custom_admin_view__'.$id, $this->vastDevMod);
}
}
// check what type of custom_button array we have here (should be subform... but just incase)
// This could happen due to huge data sets
@ -703,8 +703,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('custom_admin_view');
}
@ -729,7 +727,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -739,17 +736,11 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -759,7 +750,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -770,7 +760,11 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
}
}
$this->table->name = $this->generateUniqe('name',$this->table->name);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUniqe('name',$this->table->name);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -852,8 +846,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('custom_admin_view');
}
@ -877,7 +869,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -888,7 +879,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -560,8 +560,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('custom_code');
}
@ -586,7 +584,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -596,17 +593,11 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('custom_code.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -616,7 +607,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -627,7 +617,11 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
}
}
$this->table->component = $this->generateUniqe('component',$this->table->component);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->component) && !is_numeric($this->table->component))
{
$this->table->component = $this->generateUniqe('component',$this->table->component);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -709,8 +703,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('custom_code');
}
@ -734,7 +726,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
if (!$this->user->authorise('custom_code.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -745,7 +736,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -196,7 +196,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$item->php_calculation = base64_decode($item->php_calculation);
}
if (empty($item->id))
{
$id = 0;
@ -215,7 +215,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'dynamic_get__'.$id);
ComponentbuilderHelper::set('dynamic_get__'.$id, $this->vastDevMod);
}
}
// update the fields
$objectUpdate = new stdClass();
@ -710,8 +710,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('dynamic_get');
}
@ -736,7 +734,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -746,17 +743,11 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('dynamic_get.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -766,7 +757,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -777,7 +767,11 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
}
}
$this->table->name = $this->generateUniqe('name',$this->table->name);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUniqe('name',$this->table->name);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -859,8 +853,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('dynamic_get');
}
@ -884,7 +876,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
if (!$this->user->authorise('dynamic_get.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -895,7 +886,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -130,7 +130,7 @@ class ComponentbuilderModelField extends JModelAdmin
$item->javascript_views_footer = base64_decode($item->javascript_views_footer);
}
if (empty($item->id))
{
$id = 0;
@ -149,7 +149,7 @@ class ComponentbuilderModelField extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'field__'.$id);
ComponentbuilderHelper::set('field__'.$id, $this->vastDevMod);
}
}
if (!empty($item->id))
{
@ -608,8 +608,6 @@ class ComponentbuilderModelField extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('field');
}
@ -649,7 +647,6 @@ class ComponentbuilderModelField extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -659,17 +656,11 @@ class ComponentbuilderModelField extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('field.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -679,7 +670,6 @@ class ComponentbuilderModelField extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -770,8 +760,6 @@ class ComponentbuilderModelField extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('field');
}
@ -811,7 +799,6 @@ class ComponentbuilderModelField extends JModelAdmin
if (!$this->user->authorise('field.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -822,7 +809,6 @@ class ComponentbuilderModelField extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -791,8 +791,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('fieldtype');
}
@ -832,7 +830,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -842,17 +839,11 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('fieldtype.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -862,7 +853,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -953,8 +943,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('fieldtype');
}
@ -994,7 +982,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
if (!$this->user->authorise('fieldtype.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -1005,7 +992,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -1240,7 +1240,7 @@ function getAjaxDisplay_server(type){
function addData(result,where){
jQuery(result).insertAfter(jQuery(where).closest('.control-group'));
}
function addButtonID_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0 && size > 0){
@ -1264,8 +1264,8 @@ function addButtonID(type, where, size){
}
}
});
}
}
function addButton_server(type){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){
@ -1285,8 +1285,8 @@ function addButton(type,where){
addData(result,'#jform_'+where);
}
})
}
}
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
@ -1307,7 +1307,7 @@ function getLinked(){
jQuery('#display_linked_to').html(result);
}
});
}
}
function getTableColumns_server(tableName){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.tableColumns&format=json&vdm="+vastDevMod;

View File

@ -443,7 +443,7 @@ jQuery(document).ready(function()
// get the linked details
getLinked();
});
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
@ -464,8 +464,8 @@ function getLinked(){
jQuery('#display_linked_to').html(result);
}
});
}
}
function getSnippetDetails_server(snippetId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json";
if(token.length > 0 && snippetId > 0){
@ -513,8 +513,8 @@ function getSnippetDetails(id){
jQuery('.snippet-usage').append(usage);
}
})
}
}
function getDynamicValues_server(dynamicId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json";
if(token.length > 0 && dynamicId > 0){
@ -540,8 +540,8 @@ function getDynamicValues(id){
});
}
})
}
}
function getLayoutDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json";
if(token.length > 0 && id > 0){
@ -566,8 +566,8 @@ function getLayoutDetails(id){
});
}
})
}
}
function getTemplateDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json";
if(token.length > 0 && id > 0){
@ -592,8 +592,8 @@ function getTemplateDetails(id){
});
}
})
}
}
// set snippets that are on the page
var snippetIds = [];
var snippets = {};
@ -664,4 +664,4 @@ function setSnippets(array){
jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>');
}
jQuery('#jform_snippet').trigger('liszt:updated');
}
}

View File

@ -1435,7 +1435,7 @@ jQuery(document).ready(function()
var valueSwitch = jQuery("#jform_add_php_router_parse input[type='radio']:checked").val();
getDynamicScripts(valueSwitch);
});
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
@ -1456,7 +1456,7 @@ function getLinked(){
jQuery('#display_linked_to').html(result);
}
});
}
}
function getViewTableColumns_server(viewId,asKey,rowType)
{

View File

@ -514,7 +514,7 @@ jQuery(document).ready(function()
// get the linked details
getLinked();
});
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
@ -535,7 +535,7 @@ function getLinked(){
jQuery('#display_linked_to').html(result);
}
});
}
}
function getFieldOptions_server(fieldId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldOptions&format=json";

View File

@ -23,289 +23,289 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvwazwao_required = false;
jform_vvvvwbawap_required = false;
jform_vvvvwbbwaq_required = false;
jform_vvvvwbcwar_required = false;
jform_vvvvwbdwas_required = false;
jform_vvvvwbewat_required = false;
jform_vvvvwbdwan_required = false;
jform_vvvvwbewao_required = false;
jform_vvvvwbfwap_required = false;
jform_vvvvwbgwaq_required = false;
jform_vvvvwbhwar_required = false;
jform_vvvvwbiwas_required = false;
// Initial Script
jQuery(document).ready(function()
{
var location_vvvvwaz = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwaz(location_vvvvwaz);
var location_vvvvwbd = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwbd(location_vvvvwbd);
var location_vvvvwba = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwba(location_vvvvwba);
var location_vvvvwbe = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwbe(location_vvvvwbe);
var type_vvvvwbb = jQuery("#jform_type").val();
vvvvwbb(type_vvvvwbb);
var type_vvvvwbf = jQuery("#jform_type").val();
vvvvwbf(type_vvvvwbf);
var type_vvvvwbc = jQuery("#jform_type").val();
vvvvwbc(type_vvvvwbc);
var type_vvvvwbg = jQuery("#jform_type").val();
vvvvwbg(type_vvvvwbg);
var type_vvvvwbd = jQuery("#jform_type").val();
vvvvwbd(type_vvvvwbd);
var type_vvvvwbh = jQuery("#jform_type").val();
vvvvwbh(type_vvvvwbh);
var target_vvvvwbe = jQuery("#jform_target input[type='radio']:checked").val();
vvvvwbe(target_vvvvwbe);
var target_vvvvwbi = jQuery("#jform_target input[type='radio']:checked").val();
vvvvwbi(target_vvvvwbi);
});
// the vvvvwaz function
function vvvvwaz(location_vvvvwaz)
// the vvvvwbd function
function vvvvwbd(location_vvvvwbd)
{
// set the function logic
if (location_vvvvwaz == 1)
if (location_vvvvwbd == 1)
{
jQuery('#jform_admin_view').closest('.control-group').show();
if (jform_vvvvwazwao_required)
if (jform_vvvvwbdwan_required)
{
updateFieldRequired('admin_view',0);
jQuery('#jform_admin_view').prop('required','required');
jQuery('#jform_admin_view').attr('aria-required',true);
jQuery('#jform_admin_view').addClass('required');
jform_vvvvwazwao_required = false;
jform_vvvvwbdwan_required = false;
}
}
else
{
jQuery('#jform_admin_view').closest('.control-group').hide();
if (!jform_vvvvwazwao_required)
if (!jform_vvvvwbdwan_required)
{
updateFieldRequired('admin_view',1);
jQuery('#jform_admin_view').removeAttr('required');
jQuery('#jform_admin_view').removeAttr('aria-required');
jQuery('#jform_admin_view').removeClass('required');
jform_vvvvwazwao_required = true;
jform_vvvvwbdwan_required = true;
}
}
}
// the vvvvwba function
function vvvvwba(location_vvvvwba)
// the vvvvwbe function
function vvvvwbe(location_vvvvwbe)
{
// set the function logic
if (location_vvvvwba == 2)
if (location_vvvvwbe == 2)
{
jQuery('#jform_site_view').closest('.control-group').show();
if (jform_vvvvwbawap_required)
if (jform_vvvvwbewao_required)
{
updateFieldRequired('site_view',0);
jQuery('#jform_site_view').prop('required','required');
jQuery('#jform_site_view').attr('aria-required',true);
jQuery('#jform_site_view').addClass('required');
jform_vvvvwbawap_required = false;
jform_vvvvwbewao_required = false;
}
}
else
{
jQuery('#jform_site_view').closest('.control-group').hide();
if (!jform_vvvvwbawap_required)
if (!jform_vvvvwbewao_required)
{
updateFieldRequired('site_view',1);
jQuery('#jform_site_view').removeAttr('required');
jQuery('#jform_site_view').removeAttr('aria-required');
jQuery('#jform_site_view').removeClass('required');
jform_vvvvwbawap_required = true;
jform_vvvvwbewao_required = true;
}
}
}
// the vvvvwbb function
function vvvvwbb(type_vvvvwbb)
// the vvvvwbf function
function vvvvwbf(type_vvvvwbf)
{
if (isSet(type_vvvvwbb) && type_vvvvwbb.constructor !== Array)
if (isSet(type_vvvvwbf) && type_vvvvwbf.constructor !== Array)
{
var temp_vvvvwbb = type_vvvvwbb;
var type_vvvvwbb = [];
type_vvvvwbb.push(temp_vvvvwbb);
var temp_vvvvwbf = type_vvvvwbf;
var type_vvvvwbf = [];
type_vvvvwbf.push(temp_vvvvwbf);
}
else if (!isSet(type_vvvvwbb))
else if (!isSet(type_vvvvwbf))
{
var type_vvvvwbb = [];
var type_vvvvwbf = [];
}
var type = type_vvvvwbb.some(type_vvvvwbb_SomeFunc);
var type = type_vvvvwbf.some(type_vvvvwbf_SomeFunc);
// set this function logic
if (type)
{
jQuery('#jform_url').closest('.control-group').show();
if (jform_vvvvwbbwaq_required)
if (jform_vvvvwbfwap_required)
{
updateFieldRequired('url',0);
jQuery('#jform_url').prop('required','required');
jQuery('#jform_url').attr('aria-required',true);
jQuery('#jform_url').addClass('required');
jform_vvvvwbbwaq_required = false;
jform_vvvvwbfwap_required = false;
}
}
else
{
jQuery('#jform_url').closest('.control-group').hide();
if (!jform_vvvvwbbwaq_required)
if (!jform_vvvvwbfwap_required)
{
updateFieldRequired('url',1);
jQuery('#jform_url').removeAttr('required');
jQuery('#jform_url').removeAttr('aria-required');
jQuery('#jform_url').removeClass('required');
jform_vvvvwbbwaq_required = true;
jform_vvvvwbfwap_required = true;
}
}
}
// the vvvvwbb Some function
function type_vvvvwbb_SomeFunc(type_vvvvwbb)
// the vvvvwbf Some function
function type_vvvvwbf_SomeFunc(type_vvvvwbf)
{
// set the function logic
if (type_vvvvwbb == 3)
if (type_vvvvwbf == 3)
{
return true;
}
return false;
}
// the vvvvwbc function
function vvvvwbc(type_vvvvwbc)
// the vvvvwbg function
function vvvvwbg(type_vvvvwbg)
{
if (isSet(type_vvvvwbc) && type_vvvvwbc.constructor !== Array)
if (isSet(type_vvvvwbg) && type_vvvvwbg.constructor !== Array)
{
var temp_vvvvwbc = type_vvvvwbc;
var type_vvvvwbc = [];
type_vvvvwbc.push(temp_vvvvwbc);
var temp_vvvvwbg = type_vvvvwbg;
var type_vvvvwbg = [];
type_vvvvwbg.push(temp_vvvvwbg);
}
else if (!isSet(type_vvvvwbc))
else if (!isSet(type_vvvvwbg))
{
var type_vvvvwbc = [];
var type_vvvvwbg = [];
}
var type = type_vvvvwbc.some(type_vvvvwbc_SomeFunc);
var type = type_vvvvwbg.some(type_vvvvwbg_SomeFunc);
// set this function logic
if (type)
{
jQuery('#jform_article').closest('.control-group').show();
if (jform_vvvvwbcwar_required)
if (jform_vvvvwbgwaq_required)
{
updateFieldRequired('article',0);
jQuery('#jform_article').prop('required','required');
jQuery('#jform_article').attr('aria-required',true);
jQuery('#jform_article').addClass('required');
jform_vvvvwbcwar_required = false;
jform_vvvvwbgwaq_required = false;
}
}
else
{
jQuery('#jform_article').closest('.control-group').hide();
if (!jform_vvvvwbcwar_required)
if (!jform_vvvvwbgwaq_required)
{
updateFieldRequired('article',1);
jQuery('#jform_article').removeAttr('required');
jQuery('#jform_article').removeAttr('aria-required');
jQuery('#jform_article').removeClass('required');
jform_vvvvwbcwar_required = true;
jform_vvvvwbgwaq_required = true;
}
}
}
// the vvvvwbc Some function
function type_vvvvwbc_SomeFunc(type_vvvvwbc)
// the vvvvwbg Some function
function type_vvvvwbg_SomeFunc(type_vvvvwbg)
{
// set the function logic
if (type_vvvvwbc == 1)
if (type_vvvvwbg == 1)
{
return true;
}
return false;
}
// the vvvvwbd function
function vvvvwbd(type_vvvvwbd)
// the vvvvwbh function
function vvvvwbh(type_vvvvwbh)
{
if (isSet(type_vvvvwbd) && type_vvvvwbd.constructor !== Array)
if (isSet(type_vvvvwbh) && type_vvvvwbh.constructor !== Array)
{
var temp_vvvvwbd = type_vvvvwbd;
var type_vvvvwbd = [];
type_vvvvwbd.push(temp_vvvvwbd);
var temp_vvvvwbh = type_vvvvwbh;
var type_vvvvwbh = [];
type_vvvvwbh.push(temp_vvvvwbh);
}
else if (!isSet(type_vvvvwbd))
else if (!isSet(type_vvvvwbh))
{
var type_vvvvwbd = [];
var type_vvvvwbh = [];
}
var type = type_vvvvwbd.some(type_vvvvwbd_SomeFunc);
var type = type_vvvvwbh.some(type_vvvvwbh_SomeFunc);
// set this function logic
if (type)
{
jQuery('#jform_content-lbl').closest('.control-group').show();
if (jform_vvvvwbdwas_required)
if (jform_vvvvwbhwar_required)
{
updateFieldRequired('content',0);
jQuery('#jform_content').prop('required','required');
jQuery('#jform_content').attr('aria-required',true);
jQuery('#jform_content').addClass('required');
jform_vvvvwbdwas_required = false;
jform_vvvvwbhwar_required = false;
}
}
else
{
jQuery('#jform_content-lbl').closest('.control-group').hide();
if (!jform_vvvvwbdwas_required)
if (!jform_vvvvwbhwar_required)
{
updateFieldRequired('content',1);
jQuery('#jform_content').removeAttr('required');
jQuery('#jform_content').removeAttr('aria-required');
jQuery('#jform_content').removeClass('required');
jform_vvvvwbdwas_required = true;
jform_vvvvwbhwar_required = true;
}
}
}
// the vvvvwbd Some function
function type_vvvvwbd_SomeFunc(type_vvvvwbd)
// the vvvvwbh Some function
function type_vvvvwbh_SomeFunc(type_vvvvwbh)
{
// set the function logic
if (type_vvvvwbd == 2)
if (type_vvvvwbh == 2)
{
return true;
}
return false;
}
// the vvvvwbe function
function vvvvwbe(target_vvvvwbe)
// the vvvvwbi function
function vvvvwbi(target_vvvvwbi)
{
// set the function logic
if (target_vvvvwbe == 1)
if (target_vvvvwbi == 1)
{
jQuery('#jform_groups').closest('.control-group').show();
if (jform_vvvvwbewat_required)
if (jform_vvvvwbiwas_required)
{
updateFieldRequired('groups',0);
jQuery('#jform_groups').prop('required','required');
jQuery('#jform_groups').attr('aria-required',true);
jQuery('#jform_groups').addClass('required');
jform_vvvvwbewat_required = false;
jform_vvvvwbiwas_required = false;
}
}
else
{
jQuery('#jform_groups').closest('.control-group').hide();
if (!jform_vvvvwbewat_required)
if (!jform_vvvvwbiwas_required)
{
updateFieldRequired('groups',1);
jQuery('#jform_groups').removeAttr('required');
jQuery('#jform_groups').removeAttr('aria-required');
jQuery('#jform_groups').removeClass('required');
jform_vvvvwbewat_required = true;
jform_vvvvwbiwas_required = true;
}
}
}

View File

@ -915,7 +915,7 @@ function addData(result, where){
jQuery(result).insertAfter(jQuery(where).closest('.control-group'));
}
function addButtonID_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0 && size > 0){
@ -939,8 +939,8 @@ function addButtonID(type, where, size){
}
}
});
}
}
function addButton_server(type){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){
@ -960,5 +960,5 @@ function addButton(type,where){
addData(result,'#jform_'+where);
}
})
}
}

View File

@ -32,7 +32,7 @@ jQuery(document).ready(function($)
function addData(result,where){
jQuery(result).insertAfter(jQuery(where).closest('.control-group'));
}
function addButton_server(type){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){
@ -52,4 +52,4 @@ function addButton(type,where){
addData(result,'#jform_'+where);
}
})
}
}

View File

@ -99,7 +99,7 @@ function isSet(val)
return false;
}
function getSnippetDetails_server(snippetId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json";
if(token.length > 0 && snippetId > 0){
@ -147,8 +147,8 @@ function getSnippetDetails(id){
jQuery('.snippet-usage').append(usage);
}
})
}
}
function getDynamicValues_server(dynamicId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json";
if(token.length > 0 && dynamicId > 0){
@ -174,8 +174,8 @@ function getDynamicValues(id){
});
}
})
}
}
function getLayoutDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json";
if(token.length > 0 && id > 0){
@ -200,8 +200,8 @@ function getLayoutDetails(id){
});
}
})
}
}
// set snippets that are on the page
var snippetIds = [];
var snippets = {};
@ -272,4 +272,4 @@ function setSnippets(array){
jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>');
}
jQuery('#jform_snippet').trigger('liszt:updated');
}
}

View File

@ -426,7 +426,7 @@ jQuery(document).ready(function()
function addData(result,where){
jQuery(result).insertAfter(jQuery(where).closest('.control-group'));
}
function addButtonID_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0 && size > 0){
@ -450,8 +450,8 @@ function addButtonID(type, where, size){
}
}
});
}
}
function addButton_server(type){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){
@ -471,8 +471,8 @@ function addButton(type,where){
addData(result,'#jform_'+where);
}
})
}
}
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
@ -493,7 +493,7 @@ function getLinked(){
jQuery('#display_linked_to').html(result);
}
});
}
}
function getAjaxDisplay(type){
getAjaxDisplay_server(type).done(function(result) {

View File

@ -31,7 +31,6 @@ jform_vvvvwatwai_required = false;
jform_vvvvwauwaj_required = false;
jform_vvvvwavwak_required = false;
jform_vvvvwaxwal_required = false;
jform_vvvvwaywam_required = false;
// Initial Script
jQuery(document).ready(function()
@ -50,9 +49,13 @@ jQuery(document).ready(function()
var authentication_vvvvwax = jQuery("#jform_authentication").val();
vvvvwax(protocol_vvvvwax,authentication_vvvvwax);
var authentication_vvvvway = jQuery("#jform_authentication").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);
var protocol_vvvvwaz = jQuery("#jform_protocol").val();
var authentication_vvvvwaz = jQuery("#jform_authentication").val();
vvvvwaz(protocol_vvvvwaz,authentication_vvvvwaz);
var protocol_vvvvwbb = jQuery("#jform_protocol").val();
var authentication_vvvvwbb = jQuery("#jform_authentication").val();
vvvvwbb(protocol_vvvvwbb,authentication_vvvvwbb);
});
// the vvvvwat function
@ -316,7 +319,7 @@ function protocol_vvvvwav_SomeFunc(protocol_vvvvwav)
function authentication_vvvvwav_SomeFunc(authentication_vvvvwav)
{
// set the function logic
if (authentication_vvvvwav == 1 || authentication_vvvvwav == 3)
if (authentication_vvvvwav == 1 || authentication_vvvvwav == 3 || authentication_vvvvwav == 5)
{
return true;
}
@ -364,7 +367,6 @@ function vvvvwax(protocol_vvvvwax,authentication_vvvvwax)
jform_vvvvwaxwal_required = false;
}
jQuery('#jform_secret').closest('.control-group').show();
}
else
{
@ -377,7 +379,6 @@ function vvvvwax(protocol_vvvvwax,authentication_vvvvwax)
jQuery('#jform_private').removeClass('required');
jform_vvvvwaxwal_required = true;
}
jQuery('#jform_secret').closest('.control-group').hide();
}
}
@ -403,80 +404,122 @@ function authentication_vvvvwax_SomeFunc(authentication_vvvvwax)
return false;
}
// the vvvvway function
function vvvvway(authentication_vvvvway,protocol_vvvvway)
// the vvvvwaz function
function vvvvwaz(protocol_vvvvwaz,authentication_vvvvwaz)
{
if (isSet(authentication_vvvvway) && authentication_vvvvway.constructor !== Array)
if (isSet(protocol_vvvvwaz) && protocol_vvvvwaz.constructor !== Array)
{
var temp_vvvvway = authentication_vvvvway;
var authentication_vvvvway = [];
authentication_vvvvway.push(temp_vvvvway);
var temp_vvvvwaz = protocol_vvvvwaz;
var protocol_vvvvwaz = [];
protocol_vvvvwaz.push(temp_vvvvwaz);
}
else if (!isSet(authentication_vvvvway))
else if (!isSet(protocol_vvvvwaz))
{
var authentication_vvvvway = [];
var protocol_vvvvwaz = [];
}
var authentication = authentication_vvvvway.some(authentication_vvvvway_SomeFunc);
var protocol = protocol_vvvvwaz.some(protocol_vvvvwaz_SomeFunc);
if (isSet(protocol_vvvvway) && protocol_vvvvway.constructor !== Array)
if (isSet(authentication_vvvvwaz) && authentication_vvvvwaz.constructor !== Array)
{
var temp_vvvvway = protocol_vvvvway;
var protocol_vvvvway = [];
protocol_vvvvway.push(temp_vvvvway);
var temp_vvvvwaz = authentication_vvvvwaz;
var authentication_vvvvwaz = [];
authentication_vvvvwaz.push(temp_vvvvwaz);
}
else if (!isSet(protocol_vvvvway))
else if (!isSet(authentication_vvvvwaz))
{
var protocol_vvvvway = [];
var authentication_vvvvwaz = [];
}
var protocol = protocol_vvvvway.some(protocol_vvvvway_SomeFunc);
var authentication = authentication_vvvvwaz.some(authentication_vvvvwaz_SomeFunc);
// set this function logic
if (authentication && protocol)
if (protocol && authentication)
{
jQuery('#jform_private').closest('.control-group').show();
if (jform_vvvvwaywam_required)
{
updateFieldRequired('private',0);
jQuery('#jform_private').prop('required','required');
jQuery('#jform_private').attr('aria-required',true);
jQuery('#jform_private').addClass('required');
jform_vvvvwaywam_required = false;
}
jQuery('#jform_secret').closest('.control-group').show();
jQuery('#jform_private_key').closest('.control-group').show();
}
else
{
jQuery('#jform_private').closest('.control-group').hide();
if (!jform_vvvvwaywam_required)
{
updateFieldRequired('private',1);
jQuery('#jform_private').removeAttr('required');
jQuery('#jform_private').removeAttr('aria-required');
jQuery('#jform_private').removeClass('required');
jform_vvvvwaywam_required = true;
}
jQuery('#jform_secret').closest('.control-group').hide();
jQuery('#jform_private_key').closest('.control-group').hide();
}
}
// the vvvvway Some function
function authentication_vvvvway_SomeFunc(authentication_vvvvway)
// the vvvvwaz Some function
function protocol_vvvvwaz_SomeFunc(protocol_vvvvwaz)
{
// set the function logic
if (authentication_vvvvway == 2 || authentication_vvvvway == 3)
if (protocol_vvvvwaz == 2)
{
return true;
}
return false;
}
// the vvvvway Some function
function protocol_vvvvway_SomeFunc(protocol_vvvvway)
// the vvvvwaz Some function
function authentication_vvvvwaz_SomeFunc(authentication_vvvvwaz)
{
// set the function logic
if (protocol_vvvvway == 2)
if (authentication_vvvvwaz == 4 || authentication_vvvvwaz == 5)
{
return true;
}
return false;
}
// the vvvvwbb function
function vvvvwbb(protocol_vvvvwbb,authentication_vvvvwbb)
{
if (isSet(protocol_vvvvwbb) && protocol_vvvvwbb.constructor !== Array)
{
var temp_vvvvwbb = protocol_vvvvwbb;
var protocol_vvvvwbb = [];
protocol_vvvvwbb.push(temp_vvvvwbb);
}
else if (!isSet(protocol_vvvvwbb))
{
var protocol_vvvvwbb = [];
}
var protocol = protocol_vvvvwbb.some(protocol_vvvvwbb_SomeFunc);
if (isSet(authentication_vvvvwbb) && authentication_vvvvwbb.constructor !== Array)
{
var temp_vvvvwbb = authentication_vvvvwbb;
var authentication_vvvvwbb = [];
authentication_vvvvwbb.push(temp_vvvvwbb);
}
else if (!isSet(authentication_vvvvwbb))
{
var authentication_vvvvwbb = [];
}
var authentication = authentication_vvvvwbb.some(authentication_vvvvwbb_SomeFunc);
// set this function logic
if (protocol && authentication)
{
jQuery('#jform_secret').closest('.control-group').show();
}
else
{
jQuery('#jform_secret').closest('.control-group').hide();
}
}
// the vvvvwbb Some function
function protocol_vvvvwbb_SomeFunc(protocol_vvvvwbb)
{
// set the function logic
if (protocol_vvvvwbb == 2)
{
return true;
}
return false;
}
// the vvvvwbb Some function
function authentication_vvvvwbb_SomeFunc(authentication_vvvvwbb)
{
// set the function logic
if (authentication_vvvvwbb == 2 || authentication_vvvvwbb == 3 || authentication_vvvvwbb == 4 || authentication_vvvvwbb == 5)
{
return true;
}

View File

@ -107,18 +107,6 @@
<option value="1">COM_COMPONENTBUILDER_SERVER_FTP</option>
<option value="2">COM_COMPONENTBUILDER_SERVER_SFTP</option>
</field>
<!-- Host Field. Type: Text. (joomla)-->
<field type="text"
name="host"
label="COM_COMPONENTBUILDER_SERVER_HOST_LABEL"
size="40"
maxlength="150"
description="COM_COMPONENTBUILDER_SERVER_HOST_DESCRIPTION"
class="text_area"
required="true"
filter="STRING"
message="COM_COMPONENTBUILDER_SERVER_HOST_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_HOST_HINT" />
<!-- Note_ftp_signature Field. Type: Note. A None Database Field. (joomla)-->
<field type="note"
name="note_ftp_signature"
@ -126,27 +114,6 @@
description="COM_COMPONENTBUILDER_SERVER_NOTE_FTP_SIGNATURE_DESCRIPTION"
heading="h4"
class="alert alert-success note_ftp_signature" />
<!-- Note_ssh_security Field. Type: Note. A None Database Field. (joomla)-->
<field type="note"
name="note_ssh_security"
label="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_LABEL"
description="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_DESCRIPTION"
heading="h4"
class="alert alert-info note_ssh_security" />
<!-- Port Field. Type: Text. (joomla)-->
<field type="text"
name="port"
label="COM_COMPONENTBUILDER_SERVER_PORT_LABEL"
size="10"
maxlength="50"
default="22"
description="COM_COMPONENTBUILDER_SERVER_PORT_DESCRIPTION"
class="text_area"
required="true"
filter="INT"
message="COM_COMPONENTBUILDER_SERVER_PORT_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PORT_HINT"
onchange="if(!jQuery(this).val().match(/^\d+$/)){jQuery(this).val('')};" />
<!-- Path Field. Type: Text. (joomla)-->
<field type="text"
name="path"
@ -161,15 +128,20 @@
filter="PATH"
message="COM_COMPONENTBUILDER_SERVER_PATH_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PATH_HINT" />
<!-- Secret Field. Type: Password. (joomla)-->
<field type="password"
name="secret"
label="COM_COMPONENTBUILDER_SERVER_SECRET_LABEL"
size="60"
description="COM_COMPONENTBUILDER_SERVER_SECRET_DESCRIPTION"
message="Error! Please add the passphrase here."
<!-- Port Field. Type: Text. (joomla)-->
<field type="text"
name="port"
label="COM_COMPONENTBUILDER_SERVER_PORT_LABEL"
size="10"
maxlength="50"
default="22"
description="COM_COMPONENTBUILDER_SERVER_PORT_DESCRIPTION"
class="text_area"
filter="raw" />
required="true"
filter="INT"
message="COM_COMPONENTBUILDER_SERVER_PORT_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PORT_HINT"
onchange="if(!jQuery(this).val().match(/^\d+$/)){jQuery(this).val('')};" />
<!-- Authentication Field. Type: List. (joomla)-->
<field type="list"
name="authentication"
@ -182,9 +154,49 @@
<!-- Option Set.-->
<option value="">COM_COMPONENTBUILDER_SERVER_SELECT_AN_OPTION</option>
<option value="1">COM_COMPONENTBUILDER_SERVER_PASSWORD</option>
<option value="2">COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_FILE</option>
<option value="3">COM_COMPONENTBUILDER_SERVER_BOTH</option>
<option value="2">COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_FILE_PATH</option>
<option value="3">COM_COMPONENTBUILDER_SERVER_BOTH_PASSWORD_PRIVATE_KEY_FILE_PATH</option>
<option value="4">COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_TEXT_FIELD</option>
<option value="5">COM_COMPONENTBUILDER_SERVER_BOTH_PASSWORD_PRIVATE_KEY_TEXT_FIELD</option>
</field>
<!-- Note_ssh_security Field. Type: Note. A None Database Field. (joomla)-->
<field type="note"
name="note_ssh_security"
label="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_LABEL"
description="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_DESCRIPTION"
heading="h4"
class="alert alert-info note_ssh_security" />
<!-- Password Field. Type: Password. (joomla)-->
<field type="password"
name="password"
label="COM_COMPONENTBUILDER_SERVER_PASSWORD_LABEL"
size="60"
description="COM_COMPONENTBUILDER_SERVER_PASSWORD_DESCRIPTION"
message="Error! Please add the password here."
class="text_area"
required="true"
filter="raw" />
<!-- Secret Field. Type: Password. (joomla)-->
<field type="password"
name="secret"
label="COM_COMPONENTBUILDER_SERVER_SECRET_LABEL"
size="60"
description="COM_COMPONENTBUILDER_SERVER_SECRET_DESCRIPTION"
message="Error! Please add the passphrase here."
class="text_area"
filter="raw" />
<!-- Host Field. Type: Text. (joomla)-->
<field type="text"
name="host"
label="COM_COMPONENTBUILDER_SERVER_HOST_LABEL"
size="40"
maxlength="150"
description="COM_COMPONENTBUILDER_SERVER_HOST_DESCRIPTION"
class="text_area"
required="true"
filter="STRING"
message="COM_COMPONENTBUILDER_SERVER_HOST_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_HOST_HINT" />
<!-- Signature Field. Type: Text. (joomla)-->
<field type="text"
name="signature"
@ -198,20 +210,6 @@
message="COM_COMPONENTBUILDER_SERVER_SIGNATURE_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_SIGNATURE_HINT"
autocomplete="off" />
<!-- Password Field. Type: Password. (joomla)-->
<field type="password"
name="password"
label="COM_COMPONENTBUILDER_SERVER_PASSWORD_LABEL"
size="60"
description="COM_COMPONENTBUILDER_SERVER_PASSWORD_DESCRIPTION"
message="Error! Please add the password here."
class="text_area"
required="true"
filter="raw" />
<!-- Not_required Field. Type: Hidden. (joomla)-->
<field type="hidden"
name="not_required"
default="[]" />
<!-- Username Field. Type: Text. (joomla)-->
<field type="text"
name="username"
@ -224,6 +222,10 @@
filter="STRING"
message="COM_COMPONENTBUILDER_SERVER_USERNAME_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_USERNAME_HINT" />
<!-- Not_required Field. Type: Hidden. (joomla)-->
<field type="hidden"
name="not_required"
default="[]" />
<!-- Private Field. Type: Text. (joomla)-->
<field type="text"
name="private"
@ -238,6 +240,15 @@
filter="PATH"
message="COM_COMPONENTBUILDER_SERVER_PRIVATE_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PRIVATE_HINT" />
<!-- Private_key Field. Type: Textarea. (joomla)-->
<field type="textarea"
name="private_key"
label="COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_LABEL"
rows="15"
cols="5"
description="COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_DESCRIPTION"
class="input-xxlarge span12"
hint="COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_HINT" />
</fieldset>
<!-- Access Control Fields. -->

View File

@ -484,7 +484,7 @@ jQuery(document).ready(function()
// get the linked details
getLinked();
});
function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){
@ -505,8 +505,8 @@ function getLinked(){
jQuery('#display_linked_to').html(result);
}
});
}
}
function getSnippetDetails_server(snippetId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json";
if(token.length > 0 && snippetId > 0){
@ -554,8 +554,8 @@ function getSnippetDetails(id){
jQuery('.snippet-usage').append(usage);
}
})
}
}
function getDynamicValues_server(dynamicId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json";
if(token.length > 0 && dynamicId > 0){
@ -581,8 +581,8 @@ function getDynamicValues(id){
});
}
})
}
}
function getLayoutDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json";
if(token.length > 0 && id > 0){
@ -607,8 +607,8 @@ function getLayoutDetails(id){
});
}
})
}
}
function getTemplateDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json";
if(token.length > 0 && id > 0){
@ -633,8 +633,8 @@ function getTemplateDetails(id){
});
}
})
}
}
// set snippets that are on the page
var snippetIds = [];
var snippets = {};
@ -705,4 +705,4 @@ function setSnippets(array){
jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>');
}
jQuery('#jform_snippet').trigger('liszt:updated');
}
}

View File

@ -99,7 +99,7 @@ function isSet(val)
return false;
}
function getSnippetDetails_server(snippetId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json";
if(token.length > 0 && snippetId > 0){
@ -147,8 +147,8 @@ function getSnippetDetails(id){
jQuery('.snippet-usage').append(usage);
}
})
}
}
function getDynamicValues_server(dynamicId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json";
if(token.length > 0 && dynamicId > 0){
@ -174,8 +174,8 @@ function getDynamicValues(id){
});
}
})
}
}
function getLayoutDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json";
if(token.length > 0 && id > 0){
@ -200,8 +200,8 @@ function getLayoutDetails(id){
});
}
})
}
}
function getTemplateDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json";
if(token.length > 0 && id > 0){
@ -226,8 +226,8 @@ function getTemplateDetails(id){
});
}
})
}
}
// set snippets that are on the page
var snippetIds = [];
var snippets = {};
@ -298,4 +298,4 @@ function setSnippets(array){
jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>');
}
jQuery('#jform_snippet').trigger('liszt:updated');
}
}

View File

@ -558,8 +558,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('help_document');
}
@ -584,7 +582,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -594,17 +591,11 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('help_document.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -614,7 +605,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -624,7 +614,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
continue;
}
}
list($this->table->title, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->title);
// insert all set values
@ -707,8 +696,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('help_document');
}
@ -732,7 +719,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
if (!$this->user->authorise('help_document.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -743,7 +729,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -1507,6 +1507,18 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
}
// remove from this dataset
unset($item->css);
// rename sales_server_ftp field
if (isset($item->sales_server_ftp))
{
$item->sales_server = $item->sales_server_ftp;
unset($item->sales_server_ftp);
}
// rename update_server_ftp field
if (isset($item->update_server_ftp))
{
$item->update_server = $item->update_server_ftp;
unset($item->update_server_ftp);
}
// repeatable fields to update
$updaterR = array(
// repeatablefield => checker
@ -2267,19 +2279,19 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
case 'joomla_component':
if ($retry == 3)
{
// get by name only
$getter = array('name', 'name_code'); // risky will look at this again
// get by names only
$getter = array('name', 'name_code', 'system_name');
}
elseif ($retry == 2)
{
// get by name ...
$getter = array('name', 'name_code', 'short_description', 'author', 'email', 'component_version', 'companyname', 'system_name', 'website', 'bom', 'copyright', 'license'); // risky will look at this again
$getter = array('name', 'name_code', 'short_description', 'author', 'email', 'component_version', 'companyname', 'system_name', 'website', 'bom', 'copyright', 'license');
$retryAgain = 3;
}
else
{
// get by id name ...
$getter = array('id', 'name', 'name_code', 'short_description', 'author', 'component_version', 'companyname', 'system_name'); // risky will look at this again
$getter = array('id', 'name', 'name_code', 'short_description', 'author', 'component_version', 'companyname', 'system_name');
$retryAgain = 2;
}
break;

View File

@ -221,7 +221,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$item->export_key = rtrim($basic->decryptString($item->export_key), "\0");
}
if (empty($item->id))
{
$id = 0;
@ -240,7 +240,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'joomla_component__'.$id);
ComponentbuilderHelper::set('joomla_component__'.$id, $this->vastDevMod);
}
}
// update the fields
$objectUpdate = new stdClass();
@ -782,20 +782,21 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
if (ComponentbuilderHelper::checkArray($pks))
{
$_tablesArray = array(
'component_admin_views',
'component_site_views',
'component_custom_admin_views',
'component_updates',
'component_mysql_tweaks',
'component_custom_admin_menus',
'component_config',
'component_dashboard',
'component_files_folders'
'component_admin_views' => 'joomla_component',
'component_site_views' => 'joomla_component',
'component_custom_admin_views' => 'joomla_component',
'component_updates' => 'joomla_component',
'component_mysql_tweaks' => 'joomla_component',
'component_custom_admin_menus' => 'joomla_component',
'component_config' => 'joomla_component',
'component_dashboard' => 'joomla_component',
'component_files_folders' => 'joomla_component',
'custom_code' => 'component'
);
foreach($_tablesArray as $_updateTable)
foreach($_tablesArray as $_updateTable => $_key)
{
// get the linked IDs
if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, 'joomla_component', 'id'))
if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, $_key, 'id'))
{
// load the model
$_Model = ComponentbuilderHelper::getModel($_updateTable);
@ -829,20 +830,21 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
if (ComponentbuilderHelper::checkArray($pks))
{
$_tablesArray = array(
'component_admin_views',
'component_site_views',
'component_custom_admin_views',
'component_updates',
'component_mysql_tweaks',
'component_custom_admin_menus',
'component_config',
'component_dashboard',
'component_files_folders'
'component_admin_views' => 'joomla_component',
'component_site_views' => 'joomla_component',
'component_custom_admin_views' => 'joomla_component',
'component_updates' => 'joomla_component',
'component_mysql_tweaks' => 'joomla_component',
'component_custom_admin_menus' => 'joomla_component',
'component_config' => 'joomla_component',
'component_dashboard' => 'joomla_component',
'component_files_folders' => 'joomla_component',
'custom_code' => 'component'
);
foreach($_tablesArray as $_updateTable)
foreach($_tablesArray as $_updateTable => $_key)
{
// get the linked IDs
if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, 'joomla_component', 'id'))
if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, $_key, 'id'))
{
// load the model
$_Model = ComponentbuilderHelper::getModel($_updateTable);
@ -970,8 +972,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('joomla_component');
}
@ -996,7 +996,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -1006,17 +1005,11 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('joomla_component.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -1026,7 +1019,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -1037,7 +1029,11 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
}
}
$this->table->system_name = $this->generateUniqe('system_name',$this->table->system_name);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->system_name) && !is_numeric($this->table->system_name))
{
$this->table->system_name = $this->generateUniqe('system_name',$this->table->system_name);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -1119,8 +1115,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('joomla_component');
}
@ -1144,7 +1138,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
if (!$this->user->authorise('joomla_component.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -1155,7 +1148,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -1236,6 +1228,12 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// if system name is empty create from name
if (empty($data['system_name']) || !ComponentbuilderHelper::checkString($data['system_name']))
{
$data['system_name'] = $data['name'];
}
// Set the addcontributors items to data.
if (isset($data['addcontributors']) && is_array($data['addcontributors']))
{

View File

@ -1252,7 +1252,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
}
}
}
/**
* Get the keys of the values to search custom code in
*
@ -1389,7 +1389,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
return $targets[$target];
}
return false;
}
}
/**
* Method to auto-populate the model state.

View File

@ -516,8 +516,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('language');
}
@ -542,7 +540,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -552,17 +549,11 @@ class ComponentbuilderModelLanguage extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('language.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -572,7 +563,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -583,7 +573,11 @@ class ComponentbuilderModelLanguage extends JModelAdmin
}
}
$this->table->name = $this->generateUniqe('name',$this->table->name);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUniqe('name',$this->table->name);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -665,8 +659,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('language');
}
@ -690,7 +682,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
if (!$this->user->authorise('language.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -701,7 +692,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -107,14 +107,14 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$translation->loadString($item->translation);
$item->translation = $translation->toArray();
}
if (!empty($item->components))
{
// JSON Decode components.
$item->components = json_decode($item->components, true);
}
if (empty($item->id))
{
$id = 0;
@ -133,7 +133,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'language_translation__'.$id);
ComponentbuilderHelper::set('language_translation__'.$id, $this->vastDevMod);
}
}
if (!empty($item->id))
{
@ -556,8 +556,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('language_translation');
}
@ -582,7 +580,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -592,17 +589,11 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('language_translation.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -612,7 +603,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -623,7 +613,11 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
}
}
$this->table->entranslation = $this->generateUniqe('entranslation',$this->table->entranslation);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->entranslation) && !is_numeric($this->table->entranslation))
{
$this->table->entranslation = $this->generateUniqe('entranslation',$this->table->entranslation);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -705,8 +699,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('language_translation');
}
@ -730,7 +722,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
if (!$this->user->authorise('language_translation.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -741,7 +732,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -572,8 +572,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('layout');
}
@ -598,7 +596,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -608,17 +605,11 @@ class ComponentbuilderModelLayout extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -628,7 +619,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -638,7 +628,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
continue;
}
}
list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name);
// insert all set values
@ -721,8 +710,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('layout');
}
@ -746,7 +733,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -757,7 +743,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -139,10 +139,10 @@ class ComponentbuilderModelLibraries extends JModelList
{
// convert type
$item->type = $this->selectionTranslation($item->type, 'type');
// convert how
$item->how = $this->selectionTranslation($item->how, 'how');
}
}
@ -171,7 +171,7 @@ class ComponentbuilderModelLibraries extends JModelList
return $typeArray[$value];
}
}
// Array of how language strings
if ($name === 'how')
{
@ -188,7 +188,7 @@ class ComponentbuilderModelLibraries extends JModelList
return JText::_($howArray[$value]);
}
}
return $value;
}

View File

@ -122,7 +122,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$item->php_setdocument = base64_decode($item->php_setdocument);
}
if (empty($item->id))
{
$id = 0;
@ -141,7 +141,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'library__'.$id);
ComponentbuilderHelper::set('library__'.$id, $this->vastDevMod);
}
}
if (!empty($item->id))
{
@ -443,9 +443,9 @@ class ComponentbuilderModelLibrary extends JModelAdmin
*/
protected function getUniqeFields()
{
return array('name');
}
/**
@ -662,8 +662,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library');
}
@ -688,7 +686,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -698,17 +695,11 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('library.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -718,7 +709,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -729,7 +719,11 @@ class ComponentbuilderModelLibrary extends JModelAdmin
}
}
$this->table->name = $this->generateUniqe('name',$this->table->name);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUniqe('name',$this->table->name);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -811,8 +805,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library');
}
@ -836,7 +828,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
if (!$this->user->authorise('library.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -847,7 +838,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -526,8 +526,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library_config');
}
@ -552,7 +550,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -562,17 +559,11 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('library_config.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -582,7 +573,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -593,7 +583,11 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
}
}
$this->table->library = $this->generateUniqe('library',$this->table->library);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->library) && !is_numeric($this->table->library))
{
$this->table->library = $this->generateUniqe('library',$this->table->library);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -675,8 +669,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library_config');
}
@ -700,7 +692,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
if (!$this->user->authorise('library_config.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -711,7 +702,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -558,8 +558,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls');
}
@ -584,7 +582,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -594,17 +591,11 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('library_files_folders_urls.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -614,7 +605,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -625,7 +615,11 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
}
}
$this->table->library = $this->generateUniqe('library',$this->table->library);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->library) && !is_numeric($this->table->library))
{
$this->table->library = $this->generateUniqe('library',$this->table->library);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -707,8 +701,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls');
}
@ -732,7 +724,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
if (!$this->user->authorise('library_files_folders_urls.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -743,7 +734,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -100,10 +100,10 @@ class ComponentbuilderModelServer extends JModelAdmin
// Get the encryption object.
$basic = new FOFEncryptAes($basickey, 128);
if (!empty($item->host) && $basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true)))
if (!empty($item->path) && $basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true)))
{
// basic decrypt data host.
$item->host = rtrim($basic->decryptString($item->host), "\0");
// basic decrypt data path.
$item->path = rtrim($basic->decryptString($item->path), "\0");
}
if (!empty($item->port) && $basickey && !is_numeric($item->port) && $item->port === base64_encode(base64_decode($item->port, true)))
@ -112,10 +112,10 @@ class ComponentbuilderModelServer extends JModelAdmin
$item->port = rtrim($basic->decryptString($item->port), "\0");
}
if (!empty($item->path) && $basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true)))
if (!empty($item->password) && $basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
{
// basic decrypt data path.
$item->path = rtrim($basic->decryptString($item->path), "\0");
// basic decrypt data password.
$item->password = rtrim($basic->decryptString($item->password), "\0");
}
if (!empty($item->secret) && $basickey && !is_numeric($item->secret) && $item->secret === base64_encode(base64_decode($item->secret, true)))
@ -124,18 +124,18 @@ class ComponentbuilderModelServer extends JModelAdmin
$item->secret = rtrim($basic->decryptString($item->secret), "\0");
}
if (!empty($item->host) && $basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true)))
{
// basic decrypt data host.
$item->host = rtrim($basic->decryptString($item->host), "\0");
}
if (!empty($item->signature) && $basickey && !is_numeric($item->signature) && $item->signature === base64_encode(base64_decode($item->signature, true)))
{
// basic decrypt data signature.
$item->signature = rtrim($basic->decryptString($item->signature), "\0");
}
if (!empty($item->password) && $basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
{
// basic decrypt data password.
$item->password = rtrim($basic->decryptString($item->password), "\0");
}
if (!empty($item->username) && $basickey && !is_numeric($item->username) && $item->username === base64_encode(base64_decode($item->username, true)))
{
// basic decrypt data username.
@ -146,6 +146,12 @@ class ComponentbuilderModelServer extends JModelAdmin
{
// basic decrypt data private.
$item->private = rtrim($basic->decryptString($item->private), "\0");
}
if (!empty($item->private_key) && $basickey && !is_numeric($item->private_key) && $item->private_key === base64_encode(base64_decode($item->private_key, true)))
{
// basic decrypt data private_key.
$item->private_key = rtrim($basic->decryptString($item->private_key), "\0");
}
if (!empty($item->id))
@ -164,7 +170,7 @@ class ComponentbuilderModelServer extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getWanlinked_components()
public function getWamlinked_components()
{
// Get the user object.
$user = JFactory::getUser();
@ -689,8 +695,6 @@ class ComponentbuilderModelServer extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('server');
}
@ -715,7 +719,6 @@ class ComponentbuilderModelServer extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -725,17 +728,11 @@ class ComponentbuilderModelServer extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('server.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -745,7 +742,6 @@ class ComponentbuilderModelServer extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -756,7 +752,11 @@ class ComponentbuilderModelServer extends JModelAdmin
}
}
$this->table->name = $this->generateUniqe('name',$this->table->name);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUniqe('name',$this->table->name);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -838,8 +838,6 @@ class ComponentbuilderModelServer extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('server');
}
@ -863,7 +861,6 @@ class ComponentbuilderModelServer extends JModelAdmin
if (!$this->user->authorise('server.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -874,7 +871,6 @@ class ComponentbuilderModelServer extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -960,10 +956,10 @@ class ComponentbuilderModelServer extends JModelAdmin
// Get the encryption object
$basic = new FOFEncryptAes($basickey, 128);
// Encrypt data host.
if (isset($data['host']) && $basickey)
// Encrypt data path.
if (isset($data['path']) && $basickey)
{
$data['host'] = $basic->encryptString($data['host']);
$data['path'] = $basic->encryptString($data['path']);
}
// Encrypt data port.
@ -972,10 +968,10 @@ class ComponentbuilderModelServer extends JModelAdmin
$data['port'] = $basic->encryptString($data['port']);
}
// Encrypt data path.
if (isset($data['path']) && $basickey)
// Encrypt data password.
if (isset($data['password']) && $basickey)
{
$data['path'] = $basic->encryptString($data['path']);
$data['password'] = $basic->encryptString($data['password']);
}
// Encrypt data secret.
@ -984,18 +980,18 @@ class ComponentbuilderModelServer extends JModelAdmin
$data['secret'] = $basic->encryptString($data['secret']);
}
// Encrypt data host.
if (isset($data['host']) && $basickey)
{
$data['host'] = $basic->encryptString($data['host']);
}
// Encrypt data signature.
if (isset($data['signature']) && $basickey)
{
$data['signature'] = $basic->encryptString($data['signature']);
}
// Encrypt data password.
if (isset($data['password']) && $basickey)
{
$data['password'] = $basic->encryptString($data['password']);
}
// Encrypt data username.
if (isset($data['username']) && $basickey)
{
@ -1006,6 +1002,12 @@ class ComponentbuilderModelServer extends JModelAdmin
if (isset($data['private']) && $basickey)
{
$data['private'] = $basic->encryptString($data['private']);
}
// Encrypt data private_key.
if (isset($data['private_key']) && $basickey)
{
$data['private_key'] = $basic->encryptString($data['private_key']);
}
// Set the Params Items to data

View File

@ -304,36 +304,36 @@ class ComponentbuilderModelServers extends JModelList
continue;
}
if ($basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true)))
if ($basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true)))
{
// decrypt host
$item->host = $basic->decryptString($item->host);
// decrypt path
$item->path = $basic->decryptString($item->path);
}
if ($basickey && !is_numeric($item->port) && $item->port === base64_encode(base64_decode($item->port, true)))
{
// decrypt port
$item->port = $basic->decryptString($item->port);
}
if ($basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true)))
if ($basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
{
// decrypt path
$item->path = $basic->decryptString($item->path);
// decrypt password
$item->password = $basic->decryptString($item->password);
}
if ($basickey && !is_numeric($item->secret) && $item->secret === base64_encode(base64_decode($item->secret, true)))
{
// decrypt secret
$item->secret = $basic->decryptString($item->secret);
}
if ($basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true)))
{
// decrypt host
$item->host = $basic->decryptString($item->host);
}
if ($basickey && !is_numeric($item->signature) && $item->signature === base64_encode(base64_decode($item->signature, true)))
{
// decrypt signature
$item->signature = $basic->decryptString($item->signature);
}
if ($basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
{
// decrypt password
$item->password = $basic->decryptString($item->password);
}
if ($basickey && !is_numeric($item->username) && $item->username === base64_encode(base64_decode($item->username, true)))
{
// decrypt username
@ -344,6 +344,11 @@ class ComponentbuilderModelServers extends JModelList
// decrypt private
$item->private = $basic->decryptString($item->private);
}
if ($basickey && !is_numeric($item->private_key) && $item->private_key === base64_encode(base64_decode($item->private_key, true)))
{
// decrypt private_key
$item->private_key = $basic->decryptString($item->private_key);
}
// unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);

View File

@ -204,7 +204,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$item->php_controller = base64_decode($item->php_controller);
}
if (empty($item->id))
{
$id = 0;
@ -223,7 +223,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'site_view__'.$id);
ComponentbuilderHelper::set('site_view__'.$id, $this->vastDevMod);
}
}
// update the fields
$objectUpdate = new stdClass();
@ -721,8 +721,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('site_view');
}
@ -747,7 +745,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -757,17 +754,11 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -777,7 +768,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -788,7 +778,11 @@ class ComponentbuilderModelSite_view extends JModelAdmin
}
}
$this->table->name = $this->generateUniqe('name',$this->table->name);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUniqe('name',$this->table->name);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -870,8 +864,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('site_view');
}
@ -895,7 +887,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -906,7 +897,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -988,7 +978,12 @@ class ComponentbuilderModelSite_view extends JModelAdmin
}
// always reset the snippets
$data['snippet'] = 0;
$data['snippet'] = 0;
// if system name is empty create from name
if (empty($data['system_name']) || !ComponentbuilderHelper::checkString($data['system_name']))
{
$data['system_name'] = $data['name'];
}
// Set the libraries items to data.
if (isset($data['libraries']) && is_array($data['libraries']))

View File

@ -522,8 +522,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('snippet');
}
@ -548,7 +546,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -558,17 +555,11 @@ class ComponentbuilderModelSnippet extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -578,7 +569,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -589,7 +579,11 @@ class ComponentbuilderModelSnippet extends JModelAdmin
}
}
$this->table->name = $this->generateUniqe('name',$this->table->name);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUniqe('name',$this->table->name);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -671,8 +665,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('snippet');
}
@ -696,7 +688,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -707,7 +698,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -516,8 +516,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('snippet_type');
}
@ -542,7 +540,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -552,17 +549,11 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('snippet_type.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -572,7 +563,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -583,7 +573,11 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
}
}
$this->table->name = $this->generateUniqe('name',$this->table->name);
// Only for strings
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUniqe('name',$this->table->name);
}
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
@ -665,8 +659,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('snippet_type');
}
@ -690,7 +682,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
if (!$this->user->authorise('snippet_type.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -701,7 +692,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else

View File

@ -572,8 +572,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('template');
}
@ -598,7 +596,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
@ -608,17 +605,11 @@ class ComponentbuilderModelTemplate extends JModelAdmin
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
@ -628,7 +619,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else
@ -638,7 +628,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
continue;
}
}
list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name);
// insert all set values
@ -721,8 +710,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('template');
}
@ -746,7 +733,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
@ -757,7 +743,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
{
// Fatal error
$this->setError($error);
return false;
}
else