Resolved gh-287 that adds the feature to join/combine results of multiple fields in the admin list view. Update the tab string to make tabs dynamic in nature. Imporved the compiler building of the admin list view

This commit is contained in:
2018-05-26 12:03:08 +02:00
parent fef3460772
commit f7be7ddad0
153 changed files with 6911 additions and 6779 deletions

View File

@ -256,7 +256,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -522,7 +522,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -620,7 +620,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -665,7 +665,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -865,13 +865,13 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -256,7 +256,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -522,7 +522,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -620,7 +620,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -665,7 +665,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -855,13 +855,13 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -236,7 +236,7 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -502,7 +502,7 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -600,7 +600,7 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -645,7 +645,7 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -835,13 +835,13 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -550,7 +550,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -661,18 +661,18 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -894,7 +894,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -986,7 +986,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -1051,7 +1051,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{

View File

@ -104,11 +104,9 @@ class ComponentbuilderModelAdmin_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -194,10 +192,10 @@ class ComponentbuilderModelAdmin_views extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -237,11 +235,9 @@ class ComponentbuilderModelAdmin_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -385,16 +381,16 @@ class ComponentbuilderModelAdmin_views extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelAdmins_fields extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $item->id) && $user->authorise('admin_fields.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $item->id) && JFactory::getUser()->authorise('admin_fields.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelAdmins_fields extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $item->id) && $user->authorise('admin_fields_conditions.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $item->id) && JFactory::getUser()->authorise('admin_fields_conditions.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelAdmins_fields_relations extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $item->id) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $item->id) && JFactory::getUser()->authorise('admin_fields_relations.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelAdmins_fields_relations extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -2092,6 +2092,13 @@ class ComponentbuilderModelAjax extends JModelList
$targets['admin_view']['not_base64'] = array();
$targets['admin_view']['name'] = 'system_name';
// #__componentbuilder_admin_fields_relations
$targets['library'] = array();
$targets['library']['search'] = array('id', 'admin_view', 'addrelations');
$targets['library']['view'] = 'admin_fields_relations';
$targets['library']['not_base64'] = array('addrelations' => 'json');
$targets['library']['name'] = 'admin_view->id:admin_view.system_name';
// #__componentbuilder_custom_admin_view
$targets['custom_admin_view'] = array();
$targets['custom_admin_view']['search'] = array('id', 'system_name', 'default','php_view','php_jview','php_jview_display','php_document',
@ -2139,7 +2146,6 @@ class ComponentbuilderModelAjax extends JModelList
// #__componentbuilder_library
$targets['library'] = array();
$targets['library']['view'] = 'libraries';
$targets['library']['search'] = array('id', 'name', 'php_setdocument');
$targets['library']['view'] = 'libraries';
$targets['library']['not_base64'] = array();
@ -2597,17 +2603,19 @@ class ComponentbuilderModelAjax extends JModelList
$names = array_map( function ($id) {
return '[' . $id . ']=> ' . ComponentbuilderHelper::getVar('field', $id, 'id', 'name');
}, $fields);
// create note
$note = "// ". implode('; ', $names);
// MODEL
if ($area == 1)
if ($area == 1 || $area == 3)
{
return $note . PHP_EOL . PHP_EOL . '$item->[' . implode("] . ', ' . \$item->[", $fields) . '];';
// create note
$note = "// ". implode('; ', $names);
return $note . PHP_EOL . '$item->{'.(int)$listfield.'} = $item->{' . implode("} . ', ' . \$item->{", $fields) . '};';
}
// VIEW
elseif ($area == 2)
{
return '$this->escape($item->[' . implode("]) . '<br />' . \$this->escape(\$item->[", $fields). ']);' . PHP_EOL . PHP_EOL . $note;
// create note
$note = "<!-- " . implode('; ', $names) . " -->";
return '[field=' . implode("]<br />[field=", $fields). ']' . PHP_EOL . PHP_EOL . $note;
}
}
return false;

View File

@ -122,11 +122,11 @@ class ComponentbuilderModelCompiler extends JModelList
/**
* Get the uikit needed components
*
* @return mixed An array of objects on success.
*
*/
* Get the uikit needed components
*
* @return mixed An array of objects on success.
*
*/
public function getUikitComp()
{
if (isset($this->uikitComp) && ComponentbuilderHelper::checkArray($this->uikitComp))

View File

@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -273,7 +273,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -539,7 +539,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -637,7 +637,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -682,7 +682,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -878,13 +878,13 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -292,7 +292,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -558,7 +558,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -656,7 +656,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -701,7 +701,7 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -930,13 +930,13 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -267,7 +267,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -533,7 +533,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -631,7 +631,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -676,7 +676,7 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -866,13 +866,13 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_admin_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_admin_views.access', 'com_componentbuilder.component_admin_views.' . (int) $item->id) && $user->authorise('component_admin_views.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_admin_views.access', 'com_componentbuilder.component_admin_views.' . (int) $item->id) && JFactory::getUser()->authorise('component_admin_views.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_admin_views extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_config extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_config.access', 'com_componentbuilder.component_config.' . (int) $item->id) && $user->authorise('component_config.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_config.access', 'com_componentbuilder.component_config.' . (int) $item->id) && JFactory::getUser()->authorise('component_config.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_config extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_custom_admin_menus.access', 'com_componentbuilder.component_custom_admin_menus.' . (int) $item->id) && $user->authorise('component_custom_admin_menus.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_custom_admin_menus.access', 'com_componentbuilder.component_custom_admin_menus.' . (int) $item->id) && JFactory::getUser()->authorise('component_custom_admin_menus.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_custom_admin_views.access', 'com_componentbuilder.component_custom_admin_views.' . (int) $item->id) && $user->authorise('component_custom_admin_views.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_custom_admin_views.access', 'com_componentbuilder.component_custom_admin_views.' . (int) $item->id) && JFactory::getUser()->authorise('component_custom_admin_views.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_dashboard extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_dashboard.access', 'com_componentbuilder.component_dashboard.' . (int) $item->id) && $user->authorise('component_dashboard.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_dashboard.access', 'com_componentbuilder.component_dashboard.' . (int) $item->id) && JFactory::getUser()->authorise('component_dashboard.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_dashboard extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_files_folders extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_files_folders.access', 'com_componentbuilder.component_files_folders.' . (int) $item->id) && $user->authorise('component_files_folders.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_files_folders.access', 'com_componentbuilder.component_files_folders.' . (int) $item->id) && JFactory::getUser()->authorise('component_files_folders.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_files_folders extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_mysql_tweaks.access', 'com_componentbuilder.component_mysql_tweaks.' . (int) $item->id) && $user->authorise('component_mysql_tweaks.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_mysql_tweaks.access', 'com_componentbuilder.component_mysql_tweaks.' . (int) $item->id) && JFactory::getUser()->authorise('component_mysql_tweaks.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_site_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_site_views.access', 'com_componentbuilder.component_site_views.' . (int) $item->id) && $user->authorise('component_site_views.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_site_views.access', 'com_componentbuilder.component_site_views.' . (int) $item->id) && JFactory::getUser()->authorise('component_site_views.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_site_views extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelComponents_updates extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('component_updates.access', 'com_componentbuilder.component_updates.' . (int) $item->id) && $user->authorise('component_updates.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('component_updates.access', 'com_componentbuilder.component_updates.' . (int) $item->id) && JFactory::getUser()->authorise('component_updates.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelComponents_updates extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -377,7 +377,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -488,18 +488,18 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -679,7 +679,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -777,7 +777,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -822,7 +822,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -1126,13 +1126,13 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -104,11 +104,9 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && $user->authorise('custom_admin_view.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -198,10 +196,10 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -241,11 +239,9 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && $user->authorise('custom_admin_view.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder.custom_admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('custom_admin_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -345,16 +341,16 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -234,7 +234,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -345,18 +345,18 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -536,7 +536,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -634,7 +634,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -679,7 +679,7 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -862,13 +862,13 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -108,11 +108,9 @@ class ComponentbuilderModelCustom_codes extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && $user->authorise('custom_code.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -159,10 +157,10 @@ class ComponentbuilderModelCustom_codes extends JModelList
}
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
public function selectionTranslation($value,$name)
{
// Array of target language strings
@ -303,10 +301,10 @@ class ComponentbuilderModelCustom_codes extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -346,11 +344,9 @@ class ComponentbuilderModelCustom_codes extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && $user->authorise('custom_code.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder.custom_code.' . (int) $item->id) && JFactory::getUser()->authorise('custom_code.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -446,16 +442,16 @@ class ComponentbuilderModelCustom_codes extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -384,7 +384,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -495,18 +495,18 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -686,7 +686,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -784,7 +784,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -829,7 +829,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -1132,13 +1132,13 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -100,11 +100,9 @@ class ComponentbuilderModelDynamic_gets extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && $user->authorise('dynamic_get.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -123,8 +121,6 @@ class ComponentbuilderModelDynamic_gets extends JModelList
$item->main_source = $this->selectionTranslation($item->main_source, 'main_source');
// convert gettype
$item->gettype = $this->selectionTranslation($item->gettype, 'gettype');
// convert addcalculation
$item->addcalculation = $this->selectionTranslation($item->addcalculation, 'addcalculation');
}
}
@ -134,10 +130,10 @@ class ComponentbuilderModelDynamic_gets extends JModelList
}
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
public function selectionTranslation($value,$name)
{
// Array of main_source language strings
@ -170,19 +166,6 @@ class ComponentbuilderModelDynamic_gets extends JModelList
return $gettypeArray[$value];
}
}
// Array of addcalculation language strings
if ($name === 'addcalculation')
{
$addcalculationArray = array(
1 => 'COM_COMPONENTBUILDER_DYNAMIC_GET_YES',
0 => 'COM_COMPONENTBUILDER_DYNAMIC_GET_NO'
);
// Now check if value is found in this array
if (isset($addcalculationArray[$value]) && ComponentbuilderHelper::checkString($addcalculationArray[$value]))
{
return $addcalculationArray[$value];
}
}
return $value;
}
@ -205,10 +188,6 @@ class ComponentbuilderModelDynamic_gets extends JModelList
// From the componentbuilder_item table
$query->from($db->quoteName('#__componentbuilder_dynamic_get', 'a'));
// From the componentbuilder_admin_view table.
$query->select($db->quoteName('h.system_name','view_table_main_system_name'));
$query->join('LEFT', $db->quoteName('#__componentbuilder_admin_view', 'h') . ' ON (' . $db->quoteName('a.view_table_main') . ' = ' . $db->quoteName('h.id') . ')');
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
@ -272,10 +251,10 @@ class ComponentbuilderModelDynamic_gets extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -315,11 +294,9 @@ class ComponentbuilderModelDynamic_gets extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && $user->authorise('dynamic_get.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder.dynamic_get.' . (int) $item->id) && JFactory::getUser()->authorise('dynamic_get.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -410,16 +387,16 @@ class ComponentbuilderModelDynamic_gets extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -282,7 +282,7 @@ class ComponentbuilderModelField extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -393,18 +393,18 @@ class ComponentbuilderModelField extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -584,7 +584,7 @@ class ComponentbuilderModelField extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -691,7 +691,7 @@ class ComponentbuilderModelField extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -736,7 +736,7 @@ class ComponentbuilderModelField extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -1024,13 +1024,13 @@ class ComponentbuilderModelField extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -124,11 +124,9 @@ class ComponentbuilderModelFields extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && $user->authorise('field.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && JFactory::getUser()->authorise('field.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -160,10 +158,10 @@ class ComponentbuilderModelFields extends JModelList
}
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
public function selectionTranslation($value,$name)
{
// Array of datatype language strings
@ -364,10 +362,10 @@ class ComponentbuilderModelFields extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -407,11 +405,9 @@ class ComponentbuilderModelFields extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && $user->authorise('field.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && JFactory::getUser()->authorise('field.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -500,16 +496,16 @@ class ComponentbuilderModelFields extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -121,10 +121,10 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
}
/**
* Method to get list data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getWadfields()
{
// Get the user object.
@ -189,11 +189,9 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && $user->authorise('field.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('field.access', 'com_componentbuilder.field.' . (int) $item->id) && JFactory::getUser()->authorise('field.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -225,10 +223,10 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
}
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
public function selectionTranslationWadfields($value,$name)
{
// Array of datatype language strings
@ -503,7 +501,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -769,7 +767,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -876,7 +874,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -921,7 +919,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -1127,13 +1125,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -108,11 +108,9 @@ class ComponentbuilderModelFieldtypes extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && $user->authorise('fieldtype.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -222,10 +220,10 @@ class ComponentbuilderModelFieldtypes extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -265,11 +263,9 @@ class ComponentbuilderModelFieldtypes extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && $user->authorise('fieldtype.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder.fieldtype.' . (int) $item->id) && JFactory::getUser()->authorise('fieldtype.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -346,16 +342,16 @@ class ComponentbuilderModelFieldtypes extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -144,7 +144,9 @@
onchange="getCodeGlueOptions(this)">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODEL</option>
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODEL_BEFORE_MODELLING</option>
<option value="3">
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_MODEL_AFTER_MODELLING</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_VIEW</option>
</field>

View File

@ -123,11 +123,11 @@ class ComponentbuilderModelGet_snippets extends JModelList
/**
* Get the uikit needed components
*
* @return mixed An array of objects on success.
*
*/
* Get the uikit needed components
*
* @return mixed An array of objects on success.
*
*/
public function getUikitComp()
{
if (isset($this->uikitComp) && ComponentbuilderHelper::checkArray($this->uikitComp))

View File

@ -232,7 +232,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -343,18 +343,18 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -534,7 +534,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -627,7 +627,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -672,7 +672,7 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -908,14 +908,14 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
}
/**
* Method to change the title/s & alias.
*
* @param string $alias The alias.
* @param string/array $title The title.
*
* @return array/string Contains the modified title/s and/or alias.
*
*/
* Method to change the title/s & alias.
*
* @param string $alias The alias.
* @param string/array $title The title.
*
* @return array/string Contains the modified title/s and/or alias.
*
*/
protected function _generateNewTitle($alias, $title = null)
{

View File

@ -108,11 +108,9 @@ class ComponentbuilderModelHelp_documents extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && $user->authorise('help_document.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -160,10 +158,10 @@ class ComponentbuilderModelHelp_documents extends JModelList
}
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
public function selectionTranslation($value,$name)
{
// Array of type language strings
@ -289,10 +287,10 @@ class ComponentbuilderModelHelp_documents extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -332,11 +330,9 @@ class ComponentbuilderModelHelp_documents extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && $user->authorise('help_document.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder.help_document.' . (int) $item->id) && JFactory::getUser()->authorise('help_document.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -413,16 +409,16 @@ class ComponentbuilderModelHelp_documents extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -698,7 +698,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
$tables = array(
'validation_rule', 'fieldtype', 'field', 'admin_view', 'snippet', 'dynamic_get', 'custom_admin_view', 'site_view',
'template', 'layout', 'joomla_component', 'language', 'language_translation', 'custom_code',
'admin_fields', 'admin_fields_conditions', 'component_admin_views', 'component_site_views',
'admin_fields', 'admin_fields_conditions', 'admin_fields_relations', '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'
);
@ -2009,12 +2009,14 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
break;
case 'admin_fields':
case 'admin_fields_conditions':
case 'admin_fields_relations':
// diverged id already updated
if (!$diverged)
{
// update the admin_view ID where needed
$item = $this->setNewID($item, 'admin_view', 'admin_view', $type);
}
$updaterR = array();
// set the updater
if ('admin_fields' === $type)
{
@ -2034,7 +2036,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
unset($item->addconditions);
}
}
else
elseif ('admin_fields_conditions' === $type)
{
// repeatable fields to update
$updaterR = array(
@ -2047,10 +2049,20 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
'addconditions' => array('target_field' => 'field', 'match_field' => 'field')
);
}
elseif ('admin_fields_relations' === $type)
{
// subform fields to target
$updaterT = array(
// subformfield => field => type_value
'addrelations' => array('listfield' => 'field', 'joinfields' => 'field')
);
}
// update the repeatable fields
$item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR);
if (isset($updaterR) && ComponentbuilderHelper::checkArray($updaterR))
{
$item = ComponentbuilderHelper::convertRepeatableFields($item, $updaterR);
}
// update the subform ids
$this->updateSubformsIDs($item, $type, $updaterT);
}
@ -2390,6 +2402,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
{
case 'admin_fields':
case 'admin_fields_conditions':
case 'admin_fields_relations':
// get by admin_view (since there should only be one of each name)
$getter = array('admin_view');
$this->specialValue = array();

View File

@ -412,7 +412,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -523,18 +523,18 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -770,7 +770,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -868,7 +868,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -913,7 +913,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -1231,13 +1231,13 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -307,11 +307,12 @@ class ComponentbuilderModelJoomla_components extends JModelList
{
$this->setData($table, $pks, $field);
}
// add fields and conditions
// add fields conditions and relations
if (isset($this->smartIDs['admin_view']) && ComponentbuilderHelper::checkArray($this->smartIDs['admin_view']))
{
$this->setData('admin_fields', array_values($this->smartIDs['admin_view']), 'admin_view');
$this->setData('admin_fields_conditions', array_values($this->smartIDs['admin_view']), 'admin_view');
$this->setData('admin_fields_relations', array_values($this->smartIDs['admin_view']), 'admin_view');
}
// add validation rules
if (isset($this->smartIDs['validation_rule']) && ComponentbuilderHelper::checkArray($this->smartIDs['validation_rule']))
@ -715,10 +716,17 @@ class ComponentbuilderModelJoomla_components extends JModelList
// actions to take if table is admin_fields_conditions
if ('admin_fields_conditions' === $table)
{
// add fields
// add fields (all should already be added)
$this->setData('field', $this->getValues($item->addconditions, 'subform', 'target_field'), 'id');
$this->setData('field', $this->getValues($item->addconditions, 'subform', 'match_field'), 'id');
}
// actions to take if table is admin_fields_relations
if ('admin_fields_relations' === $table)
{
// add fields (all should already be added)
$this->setData('field', $this->getValues($item->addrelations, 'subform', 'listfield'), 'id');
$this->setData('field', $this->getValues($item->addrelations, 'subform', 'joinfields'), 'id');
}
// actions to take if table is field
if ('field' === $table)
{
@ -847,7 +855,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
$tables = array(
'fieldtype', 'field', 'admin_view', 'snippet', 'dynamic_get', 'custom_admin_view', 'site_view',
'template', 'layout', 'joomla_component', 'language', 'language_translation', 'custom_code',
'admin_fields', 'admin_fields_conditions', 'component_admin_views', 'component_site_views',
'admin_fields', 'admin_fields_conditions', 'admin_fields_relations', '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'
);
@ -1604,6 +1612,13 @@ class ComponentbuilderModelJoomla_components extends JModelList
$targets['admin_view']['not_base64'] = array();
$targets['admin_view']['name'] = 'system_name';
// #__componentbuilder_admin_fields_relations
$targets['library'] = array();
$targets['library']['search'] = array('id', 'admin_view', 'addrelations');
$targets['library']['view'] = 'admin_fields_relations';
$targets['library']['not_base64'] = array('addrelations' => 'json');
$targets['library']['name'] = 'admin_view->id:admin_view.system_name';
// #__componentbuilder_custom_admin_view
$targets['custom_admin_view'] = array();
$targets['custom_admin_view']['search'] = array('id', 'system_name', 'default','php_view','php_jview','php_jview_display','php_document',
@ -1651,7 +1666,6 @@ class ComponentbuilderModelJoomla_components extends JModelList
// #__componentbuilder_library
$targets['library'] = array();
$targets['library']['view'] = 'libraries';
$targets['library']['search'] = array('id', 'name', 'php_setdocument');
$targets['library']['view'] = 'libraries';
$targets['library']['not_base64'] = array();
@ -1748,11 +1762,9 @@ class ComponentbuilderModelJoomla_components extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && $user->authorise('joomla_component.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -1848,10 +1860,10 @@ class ComponentbuilderModelJoomla_components extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -1896,11 +1908,9 @@ class ComponentbuilderModelJoomla_components extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && $user->authorise('joomla_component.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -2022,16 +2032,16 @@ class ComponentbuilderModelJoomla_components extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -226,7 +226,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -492,7 +492,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -590,7 +590,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -635,7 +635,7 @@ class ComponentbuilderModelLanguage extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -812,13 +812,13 @@ class ComponentbuilderModelLanguage extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -266,7 +266,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -532,7 +532,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -630,7 +630,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -675,7 +675,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -871,13 +871,13 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -92,11 +92,9 @@ class ComponentbuilderModelLanguage_translations extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && $user->authorise('language_translation.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -271,10 +269,10 @@ class ComponentbuilderModelLanguage_translations extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -314,11 +312,9 @@ class ComponentbuilderModelLanguage_translations extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && $user->authorise('language_translation.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -477,16 +473,16 @@ class ComponentbuilderModelLanguage_translations extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -219,11 +219,9 @@ class ComponentbuilderModelLanguages extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && $user->authorise('language.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && JFactory::getUser()->authorise('language.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -309,10 +307,10 @@ class ComponentbuilderModelLanguages extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -352,11 +350,9 @@ class ComponentbuilderModelLanguages extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && $user->authorise('language.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && JFactory::getUser()->authorise('language.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -430,16 +426,16 @@ class ComponentbuilderModelLanguages extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -272,7 +272,7 @@ class ComponentbuilderModelLayout extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -383,18 +383,18 @@ class ComponentbuilderModelLayout extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -574,7 +574,7 @@ class ComponentbuilderModelLayout extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -667,7 +667,7 @@ class ComponentbuilderModelLayout extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -712,7 +712,7 @@ class ComponentbuilderModelLayout extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -970,14 +970,14 @@ class ComponentbuilderModelLayout extends JModelAdmin
}
/**
* Method to change the title/s & alias.
*
* @param string $alias The alias.
* @param string/array $title The title.
*
* @return array/string Contains the modified title/s and/or alias.
*
*/
* Method to change the title/s & alias.
*
* @param string $alias The alias.
* @param string/array $title The title.
*
* @return array/string Contains the modified title/s and/or alias.
*
*/
protected function _generateNewTitle($alias, $title = null)
{

View File

@ -104,11 +104,9 @@ class ComponentbuilderModelLayouts extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && $user->authorise('layout.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && JFactory::getUser()->authorise('layout.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -203,10 +201,10 @@ class ComponentbuilderModelLayouts extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -246,11 +244,9 @@ class ComponentbuilderModelLayouts extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && $user->authorise('layout.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('layout.access', 'com_componentbuilder.layout.' . (int) $item->id) && JFactory::getUser()->authorise('layout.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -330,16 +326,16 @@ class ComponentbuilderModelLayouts extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -104,17 +104,19 @@ class ComponentbuilderModelLibraries extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('library.access', 'com_componentbuilder.library.' . (int) $item->id) && $user->authorise('library.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('library.access', 'com_componentbuilder.library.' . (int) $item->id) && JFactory::getUser()->authorise('library.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
continue;
}
// convert how
$item->how = $this->selectionTranslation($item->how, 'how');
}
}
@ -125,10 +127,6 @@ class ComponentbuilderModelLibraries extends JModelList
{
// convert type
$item->type = $this->selectionTranslation($item->type, 'type');
// convert how
$item->how = $this->selectionTranslation($item->how, 'how');
}
}
@ -138,10 +136,10 @@ class ComponentbuilderModelLibraries extends JModelList
}
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
public function selectionTranslation($value,$name)
{
// Array of type language strings
@ -158,22 +156,22 @@ class ComponentbuilderModelLibraries extends JModelList
}
}
// Array of how language strings
if ($name === 'how')
{
$howArray = array(
1 => 'COM_COMPONENTBUILDER_ALWAYS_ADD',
2 => 'COM_COMPONENTBUILDER_CONDITIONS',
3 => 'COM_COMPONENTBUILDER_CUSTOM_SCRIPT',
4 => 'COM_COMPONENTBUILDER_BUILDIN',
0 => 'COM_COMPONENTBUILDER_DO_NOT_ADD'
);
// Now check if value is found in this array
if (isset($howArray[$value]) && ComponentbuilderHelper::checkString($howArray[$value]))
{
return JText::_($howArray[$value]);
}
}
// Array of how language strings
if ($name === 'how')
{
$howArray = array(
1 => 'COM_COMPONENTBUILDER_ALWAYS_ADD',
2 => 'COM_COMPONENTBUILDER_CONDITIONS',
3 => 'COM_COMPONENTBUILDER_CUSTOM_SCRIPT',
4 => 'COM_COMPONENTBUILDER_BUILDIN',
0 => 'COM_COMPONENTBUILDER_DO_NOT_ADD'
);
// Now check if value is found in this array
if (isset($howArray[$value]) && ComponentbuilderHelper::checkString($howArray[$value]))
{
return JText::_($howArray[$value]);
}
}
return $value;
}
@ -283,16 +281,16 @@ class ComponentbuilderModelLibraries extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelLibraries_config extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('library_config.access', 'com_componentbuilder.library_config.' . (int) $item->id) && $user->authorise('library_config.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('library_config.access', 'com_componentbuilder.library_config.' . (int) $item->id) && JFactory::getUser()->authorise('library_config.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelLibraries_config extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -90,11 +90,9 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('library_files_folders_urls.access', 'com_componentbuilder.library_files_folders_urls.' . (int) $item->id) && $user->authorise('library_files_folders_urls.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('library_files_folders_urls.access', 'com_componentbuilder.library_files_folders_urls.' . (int) $item->id) && JFactory::getUser()->authorise('library_files_folders_urls.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -188,16 +186,16 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -274,7 +274,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -385,18 +385,18 @@ class ComponentbuilderModelLibrary extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -638,7 +638,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -736,7 +736,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -781,7 +781,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -1012,13 +1012,13 @@ class ComponentbuilderModelLibrary extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -236,7 +236,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -502,7 +502,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -600,7 +600,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -645,7 +645,7 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -835,13 +835,13 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -268,7 +268,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -534,7 +534,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -632,7 +632,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -677,7 +677,7 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -919,13 +919,13 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -152,10 +152,10 @@ class ComponentbuilderModelServer extends JModelAdmin
}
/**
* Method to get list data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getWanlinked_components()
{
// Get the user object.
@ -214,11 +214,9 @@ class ComponentbuilderModelServer extends JModelAdmin
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && $user->authorise('joomla_component.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -369,7 +367,7 @@ class ComponentbuilderModelServer extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -480,18 +478,18 @@ class ComponentbuilderModelServer extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -671,7 +669,7 @@ class ComponentbuilderModelServer extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -769,7 +767,7 @@ class ComponentbuilderModelServer extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -814,7 +812,7 @@ class ComponentbuilderModelServer extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -1050,13 +1048,13 @@ class ComponentbuilderModelServer extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -96,11 +96,9 @@ class ComponentbuilderModelServers extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('server.access', 'com_componentbuilder.server.' . (int) $item->id) && $user->authorise('server.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('server.access', 'com_componentbuilder.server.' . (int) $item->id) && JFactory::getUser()->authorise('server.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -126,10 +124,10 @@ class ComponentbuilderModelServers extends JModelList
}
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
* Method to convert selection values to translatable string.
*
* @return translatable string
*/
public function selectionTranslation($value,$name)
{
// Array of protocol language strings
@ -231,10 +229,10 @@ class ComponentbuilderModelServers extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -279,11 +277,9 @@ class ComponentbuilderModelServers extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('server.access', 'com_componentbuilder.server.' . (int) $item->id) && $user->authorise('server.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('server.access', 'com_componentbuilder.server.' . (int) $item->id) && JFactory::getUser()->authorise('server.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -402,16 +398,16 @@ class ComponentbuilderModelServers extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -395,7 +395,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -506,18 +506,18 @@ class ComponentbuilderModelSite_view extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -697,7 +697,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -795,7 +795,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -840,7 +840,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -1149,13 +1149,13 @@ class ComponentbuilderModelSite_view extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -104,11 +104,9 @@ class ComponentbuilderModelSite_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('site_view.access', 'com_componentbuilder.site_view.' . (int) $item->id) && $user->authorise('site_view.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('site_view.access', 'com_componentbuilder.site_view.' . (int) $item->id) && JFactory::getUser()->authorise('site_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -198,10 +196,10 @@ class ComponentbuilderModelSite_views extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -241,11 +239,9 @@ class ComponentbuilderModelSite_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('site_view.access', 'com_componentbuilder.site_view.' . (int) $item->id) && $user->authorise('site_view.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('site_view.access', 'com_componentbuilder.site_view.' . (int) $item->id) && JFactory::getUser()->authorise('site_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -345,16 +341,16 @@ class ComponentbuilderModelSite_views extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -232,7 +232,7 @@ class ComponentbuilderModelSnippet extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -498,7 +498,7 @@ class ComponentbuilderModelSnippet extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -596,7 +596,7 @@ class ComponentbuilderModelSnippet extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -641,7 +641,7 @@ class ComponentbuilderModelSnippet extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -842,13 +842,13 @@ class ComponentbuilderModelSnippet extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -226,7 +226,7 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -492,7 +492,7 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -590,7 +590,7 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -635,7 +635,7 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -812,13 +812,13 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -96,11 +96,9 @@ class ComponentbuilderModelSnippet_types extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('snippet_type.access', 'com_componentbuilder.snippet_type.' . (int) $item->id) && $user->authorise('snippet_type.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('snippet_type.access', 'com_componentbuilder.snippet_type.' . (int) $item->id) && JFactory::getUser()->authorise('snippet_type.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -207,16 +205,16 @@ class ComponentbuilderModelSnippet_types extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -222,11 +222,9 @@ class ComponentbuilderModelSnippets extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('snippet.access', 'com_componentbuilder.snippet.' . (int) $item->id) && $user->authorise('snippet.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('snippet.access', 'com_componentbuilder.snippet.' . (int) $item->id) && JFactory::getUser()->authorise('snippet.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -330,10 +328,10 @@ class ComponentbuilderModelSnippets extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -373,11 +371,9 @@ class ComponentbuilderModelSnippets extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('snippet.access', 'com_componentbuilder.snippet.' . (int) $item->id) && $user->authorise('snippet.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('snippet.access', 'com_componentbuilder.snippet.' . (int) $item->id) && JFactory::getUser()->authorise('snippet.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -456,16 +452,16 @@ class ComponentbuilderModelSnippets extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -272,7 +272,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -383,18 +383,18 @@ class ComponentbuilderModelTemplate extends JModelAdmin
}
/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return mixed Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 12.2
*/
public function validate($form, $data, $group = null)
{
// check if the not_required field is set
@ -574,7 +574,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -667,7 +667,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -712,7 +712,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -970,14 +970,14 @@ class ComponentbuilderModelTemplate extends JModelAdmin
}
/**
* Method to change the title/s & alias.
*
* @param string $alias The alias.
* @param string/array $title The title.
*
* @return array/string Contains the modified title/s and/or alias.
*
*/
* Method to change the title/s & alias.
*
* @param string $alias The alias.
* @param string/array $title The title.
*
* @return array/string Contains the modified title/s and/or alias.
*
*/
protected function _generateNewTitle($alias, $title = null)
{

View File

@ -100,11 +100,9 @@ class ComponentbuilderModelTemplates extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('template.access', 'com_componentbuilder.template.' . (int) $item->id) && $user->authorise('template.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('template.access', 'com_componentbuilder.template.' . (int) $item->id) && JFactory::getUser()->authorise('template.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -194,10 +192,10 @@ class ComponentbuilderModelTemplates extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -237,11 +235,9 @@ class ComponentbuilderModelTemplates extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('template.access', 'com_componentbuilder.template.' . (int) $item->id) && $user->authorise('template.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('template.access', 'com_componentbuilder.template.' . (int) $item->id) && JFactory::getUser()->authorise('template.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -320,16 +316,16 @@ class ComponentbuilderModelTemplates extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{

View File

@ -258,7 +258,7 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
@ -524,7 +524,7 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
@ -622,7 +622,7 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
@ -667,7 +667,7 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
@ -850,13 +850,13 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin
}
/**
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
* Method to change the title
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{

View File

@ -96,11 +96,9 @@ class ComponentbuilderModelValidation_rules extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('validation_rule.access', 'com_componentbuilder.validation_rule.' . (int) $item->id) && $user->authorise('validation_rule.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('validation_rule.access', 'com_componentbuilder.validation_rule.' . (int) $item->id) && JFactory::getUser()->authorise('validation_rule.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -186,10 +184,10 @@ class ComponentbuilderModelValidation_rules extends JModelList
}
/**
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
* Method to get list export data.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExportData($pks)
{
// setup the query
@ -229,11 +227,9 @@ class ComponentbuilderModelValidation_rules extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('validation_rule.access', 'com_componentbuilder.validation_rule.' . (int) $item->id) && $user->authorise('validation_rule.access', 'com_componentbuilder'));
$access = (JFactory::getUser()->authorise('validation_rule.access', 'com_componentbuilder.validation_rule.' . (int) $item->id) && JFactory::getUser()->authorise('validation_rule.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
@ -309,16 +305,16 @@ class ComponentbuilderModelValidation_rules extends JModelList
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{