mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
FilterWidget can display the name of the filter using phrases system
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<?php FilterWidget::displayFilterName(); ?>
|
||||
<div class="filter-name-title">
|
||||
<?php FilterWidget::displayFilterName(); ?>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="panel-group">
|
||||
<div class="panel panel-default">
|
||||
|
||||
@@ -40,6 +40,7 @@ class FilterWidget extends Widget
|
||||
const ACTIVE_FILTERS_OPTION = 'activeFiltersOption';
|
||||
const ACTIVE_FILTERS_OPERATION = 'activeFiltersOperation';
|
||||
const FILTER_NAME = 'filterName';
|
||||
const FILTER_NAME_PHRASE = 'filterNamePhrase';
|
||||
|
||||
const ACTIVE_FILTER_OPTION_POSTFIX = '-option';
|
||||
const ACTIVE_FILTER_OPERATION_POSTFIX = '-operation';
|
||||
@@ -78,6 +79,7 @@ class FilterWidget extends Widget
|
||||
private $checkboxes;
|
||||
private $columnsAliases;
|
||||
private $filterName;
|
||||
private $filterNamePhrase;
|
||||
|
||||
private $dataset;
|
||||
private $metaData;
|
||||
@@ -123,6 +125,11 @@ class FilterWidget extends Widget
|
||||
$this->filterName = $filterSessionArray[self::FILTER_NAME];
|
||||
}
|
||||
|
||||
if ($this->filterNamePhrase == null && isset($filterSessionArray[self::FILTER_NAME_PHRASE]))
|
||||
{
|
||||
$this->filterNamePhrase = $filterSessionArray[self::FILTER_NAME_PHRASE];
|
||||
}
|
||||
|
||||
//
|
||||
if ($filterSessionArray[self::FILTER_ID] != $this->filterId)
|
||||
{
|
||||
@@ -318,9 +325,13 @@ class FilterWidget extends Widget
|
||||
*/
|
||||
public static function displayFilterName()
|
||||
{
|
||||
if (self::$FilterWidgetInstance->filterName != null && self::$FilterWidgetInstance->filterName != '')
|
||||
if (self::$FilterWidgetInstance->filterNamePhrase != null && self::$FilterWidgetInstance->filterNamePhrase != '')
|
||||
{
|
||||
echo '<div class="filter-name-title">'.self::$FilterWidgetInstance->filterName.'</div><br>';
|
||||
echo self::$FilterWidgetInstance->filterNamePhrase;
|
||||
}
|
||||
elseif (self::$FilterWidgetInstance->filterName != null && self::$FilterWidgetInstance->filterName != '')
|
||||
{
|
||||
echo self::$FilterWidgetInstance->filterName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,6 +517,7 @@ class FilterWidget extends Widget
|
||||
$this->hideSave = false;
|
||||
$this->columnsAliases = null;
|
||||
$this->filterName = null;
|
||||
$this->filterNamePhrase = null;
|
||||
|
||||
$this->filterUniqueId = $this->_getFilterUniqueId();
|
||||
|
||||
@@ -657,6 +669,7 @@ class FilterWidget extends Widget
|
||||
$activeFiltersOperation = array();
|
||||
$activeFiltersOption = array();
|
||||
$filterName = null;
|
||||
$filterNamePhrase = null;
|
||||
|
||||
if (isset($jsonEncodedFilter->columns))
|
||||
{
|
||||
@@ -695,7 +708,15 @@ class FilterWidget extends Widget
|
||||
$filterName = $jsonEncodedFilter->name;
|
||||
}
|
||||
|
||||
// Filter name from phrases system
|
||||
if (isset($jsonEncodedFilter->namePhrase))
|
||||
{
|
||||
$this->load->library('PhrasesLib', array('FilterWidget'));
|
||||
$filterNamePhrase = $this->phraseslib->t('FilterWidget', $jsonEncodedFilter->namePhrase);
|
||||
}
|
||||
|
||||
$this->filterName = $filterName;
|
||||
$this->filterNamePhrase = $filterNamePhrase;
|
||||
$this->app = $filter->retval[0]->app;
|
||||
|
||||
$filterSessionArray = array(
|
||||
@@ -1022,6 +1043,7 @@ class FilterWidget extends Widget
|
||||
|
||||
$filterSessionArray[self::FILTER_ID] = $this->filterId;
|
||||
$filterSessionArray[self::FILTER_NAME] = $this->filterName;
|
||||
$filterSessionArray[self::FILTER_NAME_PHRASE] = $this->filterNamePhrase;
|
||||
|
||||
$this->_writeSession(array_merge($session, $filterSessionArray));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user