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:
@ -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)
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user