Skip to content

Commit

Permalink
JLayout for date filters. Alerted layout search path ordering.
Browse files Browse the repository at this point in the history
  • Loading branch information
pollen8 committed Apr 28, 2015
1 parent 03fa829 commit 55c551f
Show file tree
Hide file tree
Showing 10 changed files with 365 additions and 152 deletions.
7 changes: 7 additions & 0 deletions components/com_fabrik/layouts/fabrik-list-filter-checkbox.php
@@ -0,0 +1,7 @@
<?php
defined('JPATH_BASE') or die;

$d = $displayData;

echo implode("\n", FabrikHelperHTML::grid($d->values, $d->labels, $d->default, $d->name,
'checkbox', false, 2, array('input' => array('fabrik_filter'))));
23 changes: 20 additions & 3 deletions components/com_fabrik/models/element.php
Expand Up @@ -3299,7 +3299,7 @@ protected function filterClass()
*
* @since 3.0.7
*
* @return string Checkbox filter HTML
* @return string Checkbox filter JLayout HTML
*/

protected function checkboxFilter($rows, $default, $v)
Expand All @@ -3315,7 +3315,23 @@ protected function checkboxFilter($rows, $default, $v)

$default = (array) $default;

return implode("\n", FabrikHelperHTML::grid($values, $labels, $default, $v, 'checkbox', false, 1, array('input' => array('fabrik_filter'))));
$layout = $this->getLayout('list-filter-checkbox');
$displayData = new stdClass;
$displayData->values = $values;
$displayData->labels = $labels;
$displayData->default = $default;
$displayData->name = $v;
$res = $layout->render($displayData);

// If no custom list layout found revert to the default list-filter-checkbox renderer
if ($res === '')
{
$basePath = COM_FABRIK_FRONTEND . '/layouts/';
$layout = new JLayoutFile('fabrik-list-filter-checkbox', $basePath, array('debug' => false, 'component' => 'com_fabrik', 'client' => 'site'));
$res = $layout->render($displayData);
}

return $res;
}

/**
Expand Down Expand Up @@ -3367,7 +3383,6 @@ protected function rangedFilterFields($default, &$return, $rows, $v, $type = 'li
*
* @return array HTML bits
*/

protected function autoCompleteFilter($default, $v, $labelValue = null, $normal = true)
{
if (is_null($labelValue))
Expand Down Expand Up @@ -7585,7 +7600,9 @@ public function getLayout($type)
$name = strtolower(JString::str_ireplace('PlgFabrik_Element', '', $name));
$basePath = COM_FABRIK_BASE . '/plugins/fabrik_element/' . $name . '/layouts';
$layout = new FabrikLayoutFile('fabrik-element-' . $name. '-' . $type, $basePath, array('debug' => false, 'component' => 'com_fabrik', 'client' => 'site'));
$layout->addIncludePaths(JPATH_SITE . '/layouts');
$layout->addIncludePaths(JPATH_THEMES . '/' . JFactory::getApplication()->getTemplate() . '/html/layouts');
$layout->addIncludePaths(JPATH_THEMES . '/' . JFactory::getApplication()->getTemplate() . '/html/layouts/com_fabrik');

return $layout;
}
Expand Down

0 comments on commit 55c551f

Please sign in to comment.