Added the feature to add custom Joomla fields to your components, requested in gh-247. Added plugin events to the dynamic get area. Added the script to remove field build in relation to component when component gets uninstalled. Improved the getForm method in the model to allow the passing of options to the form. Made further improvements to the implementation of the return parameter across the component redirecting behavior. Made some changes to the list layout views using the field relations area.
This commit is contained in:
@@ -28,9 +28,9 @@ class ComponentbuilderModelLayouts extends JModelList
|
||||
'a.created_by','created_by',
|
||||
'a.modified_by','modified_by',
|
||||
'a.name','name',
|
||||
'a.alias','alias',
|
||||
'a.description','description',
|
||||
'a.dynamic_get','dynamic_get'
|
||||
'a.dynamic_get','dynamic_get',
|
||||
'a.add_php_view','add_php_view'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -54,14 +54,14 @@ class ComponentbuilderModelLayouts extends JModelList
|
||||
$name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name');
|
||||
$this->setState('filter.name', $name);
|
||||
|
||||
$alias = $this->getUserStateFromRequest($this->context . '.filter.alias', 'filter_alias');
|
||||
$this->setState('filter.alias', $alias);
|
||||
|
||||
$description = $this->getUserStateFromRequest($this->context . '.filter.description', 'filter_description');
|
||||
$this->setState('filter.description', $description);
|
||||
|
||||
$dynamic_get = $this->getUserStateFromRequest($this->context . '.filter.dynamic_get', 'filter_dynamic_get');
|
||||
$this->setState('filter.dynamic_get', $dynamic_get);
|
||||
$this->setState('filter.dynamic_get', $dynamic_get);
|
||||
|
||||
$add_php_view = $this->getUserStateFromRequest($this->context . '.filter.add_php_view', 'filter_add_php_view');
|
||||
$this->setState('filter.add_php_view', $add_php_view);
|
||||
|
||||
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
|
||||
$this->setState('filter.sorting', $sorting);
|
||||
@@ -111,10 +111,44 @@ class ComponentbuilderModelLayouts extends JModelList
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set selection value to a translatable value
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// convert add_php_view
|
||||
$item->add_php_view = $this->selectionTranslation($item->add_php_view, 'add_php_view');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// return items
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to convert selection values to translatable string.
|
||||
*
|
||||
* @return translatable string
|
||||
*/
|
||||
public function selectionTranslation($value,$name)
|
||||
{
|
||||
// Array of add_php_view language strings
|
||||
if ($name === 'add_php_view')
|
||||
{
|
||||
$add_php_viewArray = array(
|
||||
1 => 'COM_COMPONENTBUILDER_LAYOUT_YES',
|
||||
0 => 'COM_COMPONENTBUILDER_LAYOUT_NO'
|
||||
);
|
||||
// Now check if value is found in this array
|
||||
if (isset($add_php_viewArray[$value]) && ComponentbuilderHelper::checkString($add_php_viewArray[$value]))
|
||||
{
|
||||
return $add_php_viewArray[$value];
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,7 +210,7 @@ class ComponentbuilderModelLayouts extends JModelList
|
||||
else
|
||||
{
|
||||
$search = $db->quote('%' . $db->escape($search) . '%');
|
||||
$query->where('(a.name LIKE '.$search.' OR a.alias LIKE '.$search.' OR a.description LIKE '.$search.' OR a.dynamic_get LIKE '.$search.' OR g.name LIKE '.$search.')');
|
||||
$query->where('(a.name LIKE '.$search.' OR a.description LIKE '.$search.' OR a.dynamic_get LIKE '.$search.' OR g.name LIKE '.$search.' OR a.alias LIKE '.$search.')');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,6 +219,11 @@ class ComponentbuilderModelLayouts extends JModelList
|
||||
{
|
||||
$query->where('a.dynamic_get = ' . $db->quote($db->escape($dynamic_get)));
|
||||
}
|
||||
// Filter by Add_php_view.
|
||||
if ($add_php_view = $this->getState('filter.add_php_view'))
|
||||
{
|
||||
$query->where('a.add_php_view = ' . $db->quote($db->escape($add_php_view)));
|
||||
}
|
||||
|
||||
// Add the list ordering clause.
|
||||
$orderCol = $this->state->get('list.ordering', 'a.id');
|
||||
@@ -315,9 +354,9 @@ class ComponentbuilderModelLayouts extends JModelList
|
||||
$id .= ':' . $this->getState('filter.created_by');
|
||||
$id .= ':' . $this->getState('filter.modified_by');
|
||||
$id .= ':' . $this->getState('filter.name');
|
||||
$id .= ':' . $this->getState('filter.alias');
|
||||
$id .= ':' . $this->getState('filter.description');
|
||||
$id .= ':' . $this->getState('filter.dynamic_get');
|
||||
$id .= ':' . $this->getState('filter.dynamic_get');
|
||||
$id .= ':' . $this->getState('filter.add_php_view');
|
||||
|
||||
return parent::getStoreId($id);
|
||||
}
|
||||
|
Reference in New Issue
Block a user