Added getListViewDefaultOrdering method to compiler. Moved getFieldDatabaseName to the get class of the compiler. Updated the setFieldFilterListSet method. Imporved the filter query code to ignore empty values. gh-378

This commit is contained in:
2020-11-30 05:59:45 +02:00
parent 9d9c8e664e
commit f20039b390
66 changed files with 1124 additions and 322 deletions

View File

@ -4143,6 +4143,98 @@ class Get
}
}
/**
* get the list default ordering values
*
* @param string $nameListCode The list view name
*
* @return array
*
*/
public function getListViewDefaultOrdering(&$nameListCode)
{
if (isset($this->viewsDefaultOrdering[$nameListCode])
&& $this->viewsDefaultOrdering[$nameListCode]['add_admin_ordering'] == 1)
{
foreach (
$this->viewsDefaultOrdering[$nameListCode]['admin_ordering_fields']
as $order_field
)
{
if (($order_field_name = $this->getFieldDatabaseName(
$nameListCode, $order_field['field']
)) !== false)
{
// just the first field is the based ordering state
return array(
'name' => $order_field_name,
'direction' => $order_field['direction']
);
}
}
}
// the default
return array(
'name' => 'a.id',
'direction' => 'DESC'
);
}
/**
* get the field database name and AS prefix
*
* @param string $nameListCode The list view name
* @param int $fieldId The field ID
* @param string $targetArea The area being targeted
*
* @return string
*
*/
public function getFieldDatabaseName($nameListCode, int $fieldId,
$targetArea = 'listBuilder'
) {
if (isset($this->{$targetArea}[$nameListCode]))
{
if ($fieldId < 0)
{
switch ($fieldId)
{
case -1:
return 'a.id';
case -2:
return 'a.ordering';
case -3:
return 'a.published';
}
}
foreach ($this->{$targetArea}[$nameListCode] as $field)
{
if ($field['id'] == $fieldId)
{
// now check if this is a category
if ($field['type'] === 'category')
{
return 'c.title';
}
// set the custom code
elseif (ComponentbuilderHelper::checkArray(
$field['custom']
))
{
return $field['custom']['db'] . "."
. $field['custom']['text'];
}
else
{
return 'a.' . $field['code'];
}
}
}
}
return false;
}
/**
* Get the field's actual type
*

View File

@ -4559,10 +4559,11 @@ class Fields extends Structure
// set lang
$listLangName = $langView . '_'
. ComponentbuilderHelper::safeFieldName($tempName, true);
// set field name
$listFieldName = ComponentbuilderHelper::safeString($tempName, 'W');
// add to lang array
$this->setLangContent(
$this->lang, $listLangName,
ComponentbuilderHelper::safeString($tempName, 'W')
$this->lang, $listLangName, $listFieldName
);
}
else
@ -4570,10 +4571,11 @@ class Fields extends Structure
// set lang (just in case)
$listLangName = $langView . '_'
. ComponentbuilderHelper::safeFieldName($name, true);
// set field name
$listFieldName = ComponentbuilderHelper::safeString($name, 'W');
// add to lang array
$this->setLangContent(
$this->lang, $listLangName,
ComponentbuilderHelper::safeString($name, 'W')
$this->lang, $listLangName, $listFieldName
);
// if label was set use instead
if (ComponentbuilderHelper::checkString($langLabel))
@ -4971,6 +4973,8 @@ class Fields extends Structure
$this->selectionTranslationFixBuilder[$nameListCode][$name]
= $options;
}
// main lang filter prefix
$lang_filter_ = $this->langPrefix . '_FILTER_';
// build the sort values
if ($dbSwitch && (isset($field['sort']) && $field['sort'] == 1)
&& ($listSwitch || $listJoin)
@ -4979,11 +4983,40 @@ class Fields extends Structure
&& $typeName != 'repeatable'
&& $typeName != 'subform'))
{
$this->sortBuilder[$nameListCode][] = array('type' => $typeName,
'code' => $name,
'lang' => $listLangName,
'custom' => $custom,
'options' => $options);
// add the language only for new filter option
$filter_name_asc_lang = '';
$filter_name_desc_lang = '';
if (isset($this->adminFilterType[$nameListCode])
&& $this->adminFilterType[$nameListCode] == 2)
{
// set the language strings for ascending
$filter_name_asc = $listFieldName . ' ascending';
$filter_name_asc_lang = $lang_filter_
. ComponentbuilderHelper::safeString(
$filter_name_asc, 'U'
);
// and to translation
$this->setLangContent(
$this->lang, $filter_name_asc_lang, $filter_name_asc
);
// set the language strings for descending
$filter_name_desc = $listFieldName . ' descending';
$filter_name_desc_lang = $lang_filter_
. ComponentbuilderHelper::safeString(
$filter_name_desc, 'U'
);
// and to translation
$this->setLangContent(
$this->lang, $filter_name_desc_lang, $filter_name_desc
);
}
$this->sortBuilder[$nameListCode][] = array('type' => $typeName,
'code' => $name,
'lang' => $listLangName,
'lang_asc' => $filter_name_asc_lang,
'lang_desc' => $filter_name_desc_lang,
'custom' => $custom,
'options' => $options);
}
// build the search values
if ($dbSwitch && isset($field['search']) && $field['search'] == 1)
@ -5011,6 +5044,23 @@ class Fields extends Structure
$filter_function_name = ComponentbuilderHelper::safeString(
$name, 'F'
);
// add the language only for new filter option
$filter_name_select_lang = '';
if (isset($this->adminFilterType[$nameListCode])
&& $this->adminFilterType[$nameListCode] == 2)
{
// set the language strings for selection
$filter_name_select = 'Select ' . $listFieldName;
$filter_name_select_lang = $lang_filter_
. ComponentbuilderHelper::safeString(
$filter_name_select, 'U'
);
// and to translation
$this->setLangContent(
$this->lang, $filter_name_select_lang, $filter_name_select
);
}
// add the filter details
$this->filterBuilder[$nameListCode][] = array(
'id' => (int) $field['field'],
@ -5019,6 +5069,7 @@ class Fields extends Structure
'code' => $name,
'label' => $langLabel,
'lang' => $listLangName,
'lang_select' => $filter_name_select_lang,
'database' => $nameSingleCode,
'function' => $filter_function_name,
'custom' => $custom,
@ -5498,17 +5549,29 @@ class Fields extends Structure
{
// check if this is the above/new filter option
if (isset($this->adminFilterType[$nameListCode])
&& $this->adminFilterType[$nameListCode] == 2
&& isset($this->filterBuilder[$nameListCode])
&& ComponentbuilderHelper::checkArray(
$this->filterBuilder[$nameListCode]
))
&& $this->adminFilterType[$nameListCode] == 2)
{
// we first create the file
$target = array('admin' => 'filter_' . $nameListCode);
$this->buildDynamique(
$target, 'filter'
);
// the search language string
$lang_search = $this->langPrefix . '_FILTER_SEARCH';
// and to translation
$this->setLangContent(
$this->lang, $lang_search, 'Search'
. ComponentbuilderHelper::safeString($nameListCode, 'w')
);
// the search description language string
$lang_search_desc = $this->langPrefix . '_FILTER_SEARCH_'
. strtoupper($nameListCode);
// and to translation
$this->setLangContent(
$this->lang, $lang_search_desc, 'Search the '
. ComponentbuilderHelper::safeString($nameSingleCode, 'w')
. ' items. Prefix with ID: to search for an item by ID.'
);
// now build the XML
$field_filter_sets = array();
$field_filter_sets[] = $this->_t(1) . '<fields name="filter">';
@ -5518,21 +5581,35 @@ class Fields extends Structure
$field_filter_sets[] = $this->_t(3) . 'name="search"';
$field_filter_sets[] = $this->_t(3) . 'inputmode="search"';
$field_filter_sets[] = $this->_t(3)
. 'label="COM_CONTENT_FILTER_SEARCH_LABEL"';
. 'label="' . $lang_search . '"';
$field_filter_sets[] = $this->_t(3)
. 'description="COM_CONTENT_FILTER_SEARCH_DESC"';
. 'description="' . $lang_search_desc . '"';
$field_filter_sets[] = $this->_t(3) . 'hint="JSEARCH_FILTER"';
$field_filter_sets[] = $this->_t(2) . '/>';
// add the published filter if published is not set
if (!isset($this->fieldsNames[$nameSingleCode]['published']))
{
// the published language string
$lang_published = $this->langPrefix . '_FILTER_PUBLISHED';
// and to translation
$this->setLangContent(
$this->lang, $lang_published, 'Status'
);
// the published description language string
$lang_published_desc = $this->langPrefix . '_FILTER_PUBLISHED_'
. strtoupper($nameListCode);
// and to translation
$this->setLangContent(
$this->lang, $lang_published_desc, 'Status options for '
. ComponentbuilderHelper::safeString($nameListCode, 'w')
);
$field_filter_sets[] = $this->_t(2) . '<field';
$field_filter_sets[] = $this->_t(3) . 'type="status"';
$field_filter_sets[] = $this->_t(3) . 'name="published"';
$field_filter_sets[] = $this->_t(3)
. 'label="COM_CONTENT_FILTER_PUBLISHED"';
. 'label="' . $lang_published . '"';
$field_filter_sets[] = $this->_t(3)
. 'description="COM_CONTENT_FILTER_PUBLISHED_DESC"';
. 'description="' . $lang_published_desc . '"';
$field_filter_sets[] = $this->_t(3)
. 'onchange="this.form.submit();"';
$field_filter_sets[] = $this->_t(2) . '>';
@ -5563,49 +5640,57 @@ class Fields extends Structure
$field_filter_sets[] = $this->_t(2) . '/>';
}
// now add the dynamic fields
foreach ($this->filterBuilder[$nameListCode] as $r => &$filter)
if (isset($this->filterBuilder[$nameListCode])
&& ComponentbuilderHelper::checkArray(
$this->filterBuilder[$nameListCode]
))
{
if ($filter['type'] != 'category')
foreach ($this->filterBuilder[$nameListCode] as $r => &$filter)
{
$field_filter_sets[] = $this->_t(2) . '<field';
// if this is a custom field
if (ComponentbuilderHelper::checkArray(
$filter['custom']
))
{
// we use the field type from the custom field
$field_filter_sets[] = $this->_t(3) . 'type="'
. $filter['type'] . '"';
// set css classname of this field
$filter['class'] = ucfirst($filter['type']);
}
else
{
// we use the filter field type that was build
$field_filter_sets[] = $this->_t(3) . 'type="'
. $filter['filter_type'] . '"';
// set css classname of this field
$filter['class'] = ucfirst($filter['filter_type']);
}
$field_filter_sets[] = $this->_t(3) . 'name="'
. $filter['code'] . '"';
$field_filter_sets[] = $this->_t(3) . 'label="'
. $filter['label'] . '"';
// if this is a multi field
if ($filter['multi'] == 2)
{
$field_filter_sets[] = $this->_t(3) . 'class="multiple'
. $filter['class'] . '"';
$field_filter_sets[] = $this->_t(3) . 'multiple="true"';
}
else
if ($filter['type'] != 'category')
{
$field_filter_sets[] = $this->_t(2) . '<field';
// if this is a custom field
if (ComponentbuilderHelper::checkArray(
$filter['custom']
))
{
// we use the field type from the custom field
$field_filter_sets[] = $this->_t(3) . 'type="'
. $filter['type'] . '"';
// set css classname of this field
$filter['class'] = ucfirst($filter['type']);
}
else
{
// we use the filter field type that was build
$field_filter_sets[] = $this->_t(3) . 'type="'
. $filter['filter_type'] . '"';
// set css classname of this field
$filter['class'] = ucfirst($filter['filter_type']);
}
$field_filter_sets[] = $this->_t(3) . 'name="'
. $filter['code'] . '"';
$field_filter_sets[] = $this->_t(3) . 'label="'
. $filter['label'] . '"';
// if this is a multi field
if ($filter['multi'] == 2)
{
$field_filter_sets[] = $this->_t(3)
. 'class="multiple'
. $filter['class'] . '"';
$field_filter_sets[] = $this->_t(3)
. 'multiple="true"';
}
else
{
$field_filter_sets[] = $this->_t(3)
. 'multiple="false"';
}
$field_filter_sets[] = $this->_t(3)
. 'multiple="false"';
. 'onchange="this.form.submit();"';
$field_filter_sets[] = $this->_t(2) . '/>';
}
$field_filter_sets[] = $this->_t(3)
. 'onchange="this.form.submit();"';
$field_filter_sets[] = $this->_t(2) . '/>';
}
}
$field_filter_sets[] = $this->_t(2)
@ -5630,7 +5715,119 @@ class Fields extends Structure
*/
public function setFieldFilterListSet(&$nameSingleCode, &$nameListCode)
{
// soon we will add this TODO
// check if this is the above/new filter option
if (isset($this->adminFilterType[$nameListCode])
&& $this->adminFilterType[$nameListCode] == 2)
{
// keep track of all fields already added
$donelist = array('ordering' => true, 'id' => true);
// now build the XML
$list_sets = array();
$list_sets[] = $this->_t(1) . '<fields name="list">';
$list_sets[] = $this->_t(2) . '<field';
$list_sets[] = $this->_t(3) . 'name="fullordering"';
$list_sets[] = $this->_t(3) . 'type="list"';
$list_sets[] = $this->_t(3)
. 'label="COM_CONTENT_LIST_FULL_ORDERING"';
$list_sets[] = $this->_t(3)
. 'description="COM_CONTENT_LIST_FULL_ORDERING_DESC"';
$list_sets[] = $this->_t(3) . 'onchange="this.form.submit();"';
// add dynamic ordering (Admin view)
$default_ordering = $this->getListViewDefaultOrdering(
$nameListCode
);
// set the default ordering
$list_sets[] = $this->_t(3) . 'default="'
. $default_ordering['name'] . ' '
. $default_ordering['direction'] . '"';
$list_sets[] = $this->_t(3) . 'validate="options"';
$list_sets[] = $this->_t(2) . '>';
$list_sets[] = $this->_t(3)
. '<option value="">JGLOBAL_SORT_BY</option>';
$list_sets[] = $this->_t(3)
. '<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>';
$list_sets[] = $this->_t(3)
. '<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>';
// add the published filter if published is not set
if (!isset($this->fieldsNames[$nameSingleCode]['published']))
{
// add to done list
$donelist['published'] = true;
// add to xml :)
$list_sets[] = $this->_t(3)
. '<option value="a.published ASC">JSTATUS_ASC</option>';
$list_sets[] = $this->_t(3)
. '<option value="a.published DESC">JSTATUS_DESC</option>';
}
// add the rest of the set filters
if (isset($this->sortBuilder[$nameListCode])
&& ComponentbuilderHelper::checkArray(
$this->sortBuilder[$nameListCode]
))
{
foreach ($this->sortBuilder[$nameListCode] as $filter)
{
if (!isset($donelist[$filter['code']]))
{
if ($filter['type'] === 'category')
{
$list_sets[] = $this->_t(3)
. '<option value="category_title ASC">'
. $filter['lang_asc'] . '</option>';
$list_sets[] = $this->_t(3)
. '<option value="category_title DESC">'
. $filter['lang_desc'] . '</option>';
}
elseif (ComponentbuilderHelper::checkArray(
$filter['custom']
))
{
$list_sets[] = $this->_t(3) . '<option value="'
. $filter['custom']['db'] . '.'
. $filter['custom']['text'] . ' ASC">'
. $filter['lang_asc'] . '</option>';
$list_sets[] = $this->_t(3) . '<option value="'
. $filter['custom']['db'] . '.'
. $filter['custom']['text'] . ' DESC">'
. $filter['lang_desc'] . '</option>';
}
else
{
$list_sets[] = $this->_t(3) . '<option value="a.'
. $filter['code'] . ' ASC">'
. $filter['lang_asc'] . '</option>';
$list_sets[] = $this->_t(3) . '<option value="a.'
. $filter['code'] . ' DESC">'
. $filter['lang_desc'] . '</option>';
}
// do not add again
$donelist[$filter['code']] = true;
}
}
}
$list_sets[] = $this->_t(3)
. '<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>';
$list_sets[] = $this->_t(3)
. '<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>';
$list_sets[] = $this->_t(2) . '</field>' . PHP_EOL;
$list_sets[] = $this->_t(2) . '<field';
$list_sets[] = $this->_t(3) . 'name="limit"';
$list_sets[] = $this->_t(3) . 'type="limitbox"';
$list_sets[] = $this->_t(3) . 'label="COM_CONTENT_LIST_LIMIT"';
$list_sets[] = $this->_t(3)
. 'description="COM_CONTENT_LIST_LIMIT_DESC"';
$list_sets[] = $this->_t(3) . 'class="input-mini"';
$list_sets[] = $this->_t(3) . 'default="25"';
$list_sets[] = $this->_t(3) . 'onchange="this.form.submit();"';
$list_sets[] = $this->_t(2) . '/>';
$list_sets[] = $this->_t(1) . '</fields>';
return implode(PHP_EOL, $list_sets);
}
return '';
}

View File

@ -5121,49 +5121,19 @@ class Interpretation extends Fields
$script .= PHP_EOL . $this->_t(2) . "\$this->activeFilters "
. "= \$this->get('ActiveFilters');";
}
// add the custom ordering if set
if (isset($this->viewsDefaultOrdering[$nameListCode])
&& $this->viewsDefaultOrdering[$nameListCode]['add_admin_ordering']
== 1)
{
// the first is from the state
$order_first = true;
foreach (
$this->viewsDefaultOrdering[$nameListCode]['admin_ordering_fields']
as $order_field
)
{
if ($order_first
&& ($order_field_name = $this->getFieldDatabaseName(
$nameListCode, $order_field['field']
)) !== false)
{
// just the first field is based on state
$order_first = false;
$script .= PHP_EOL . $this->_t(2) . "//"
. $this->setLine(
__LINE__
) . " Add the list ordering clause.";
$script .= PHP_EOL . $this->_t(2)
. "\$this->listOrder = \$this->escape(\$this->state->get('list.ordering', '"
. $order_field_name . "'));";
$script .= PHP_EOL . $this->_t(2)
. "\$this->listDirn = \$this->escape(\$this->state->get('list.direction', '"
. $order_field['direction'] . "'));";
}
}
}
// if no ordering is added we must add default
if (!ComponentbuilderHelper::checkString($script))
{
$script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(
__LINE__
) . " Add the list ordering clause.";
$script .= PHP_EOL . $this->_t(2)
. "\$this->listOrder = \$this->escape(\$this->state->get('list.ordering', 'a.id'));";
$script .= PHP_EOL . $this->_t(2)
. "\$this->listDirn = \$this->escape(\$this->state->get('list.direction', 'asc'));";
}
// get the default ordering values
$default_ordering = $this->getListViewDefaultOrdering($nameListCode);
// now add the default ordering
$script .= PHP_EOL . $this->_t(2) . "//"
. $this->setLine(
__LINE__
) . " Add the list ordering clause.";
$script .= PHP_EOL . $this->_t(2)
. "\$this->listOrder = \$this->escape(\$this->state->get('list.ordering', '"
. $default_ordering['name'] . "'));";
$script .= PHP_EOL . $this->_t(2)
. "\$this->listDirn = \$this->escape(\$this->state->get('list.direction', '"
. $default_ordering['direction'] . "'));";
return $script;
}
@ -15507,57 +15477,6 @@ class Interpretation extends Fields
return $query;
}
/**
* get the field database name and AS prefix
*
* @return string
*
*/
protected function getFieldDatabaseName($nameListCode, int $fieldId,
$targetArea = 'listBuilder'
) {
if (isset($this->{$targetArea}[$nameListCode]))
{
if ($fieldId < 0)
{
switch ($fieldId)
{
case -1:
return 'a.id';
case -2:
return 'a.ordering';
case -3:
return 'a.published';
}
}
foreach ($this->{$targetArea}[$nameListCode] as $field)
{
if ($field['id'] == $fieldId)
{
// now check if this is a category
if ($field['type'] === 'category')
{
return 'c.title';
}
// set the custom code
elseif (ComponentbuilderHelper::checkArray(
$field['custom']
))
{
return $field['custom']['db'] . "."
. $field['custom']['text'];
}
else
{
return 'a.' . $field['code'];
}
}
}
}
return false;
}
public function setSearchQuery($nameListCode)
{
if (isset($this->searchBuilder[$nameListCode])
@ -15739,7 +15658,7 @@ class Interpretation extends Fields
else
{
$filterQuery .= $this->setSingleFilterQuery(
$filter
$filter, $Helper
);
}
}
@ -15755,21 +15674,40 @@ class Interpretation extends Fields
* build single filter query
*
* @param array $filter The field/filter
* @param string $Helper The helper name of the component being build
* @param string $a The db table target name (a)
*
* @return string The php to place in model to filter this field
*
*/
protected function setSingleFilterQuery($filter, $a = "a")
protected function setSingleFilterQuery($filter, $Helper, $a = "a")
{
$filterQuery = PHP_EOL . $this->_t(2) . "if (\$"
$filterQuery = PHP_EOL . $this->_t(2) . "\$_"
. $filter['code'] . " = \$this->getState('filter."
. $filter['code'] . "'))";
. $filter['code'] . "');";
$filterQuery .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$_"
. $filter['code'] . "))";
$filterQuery .= PHP_EOL . $this->_t(2) . "{";
$filterQuery .= PHP_EOL . $this->_t(3) . "if (is_float(\$_"
. $filter['code'] . "))";
$filterQuery .= PHP_EOL . $this->_t(3) . "{";
$filterQuery .= PHP_EOL . $this->_t(4)
. "\$query->where('" . $a . "." . $filter['code']
. " = ' . (float) \$_" . $filter['code'] . ");";
$filterQuery .= PHP_EOL . $this->_t(3) . "}";
$filterQuery .= PHP_EOL . $this->_t(3) . "else";
$filterQuery .= PHP_EOL . $this->_t(3) . "{";
$filterQuery .= PHP_EOL . $this->_t(4)
. "\$query->where('" . $a . "." . $filter['code']
. " = ' . (int) \$_" . $filter['code'] . ");";
$filterQuery .= PHP_EOL . $this->_t(3) . "}";
$filterQuery .= PHP_EOL . $this->_t(2) . "}";
$filterQuery .= PHP_EOL . $this->_t(2) . "elseif ("
. $Helper . "::checkString(\$_" . $filter['code'] . "))";
$filterQuery .= PHP_EOL . $this->_t(2) . "{";
$filterQuery .= PHP_EOL . $this->_t(3)
. "\$query->where('" . $a . "." . $filter['code']
. " = ' . \$db->quote(\$db->escape(\$"
. $filter['code']
. " = ' . \$db->quote(\$db->escape(\$_" . $filter['code']
. ")));";
$filterQuery .= PHP_EOL . $this->_t(2) . "}";
@ -17637,6 +17575,13 @@ class Interpretation extends Fields
$function[] = $this->_t(2) . "{";
$function[] = $this->_t(3) . "\$filter = array();";
$function[] = $this->_t(3) . "\$batch = array();";
// if this is not a multi field
if (!$funtion_path && $filter['multi'] == 1)
{
$function[] = $this->_t(4)
. "\$filter[] = JHtml::_('select.option', '', '- Select ' . JText:"
. ":_('" . $filter['lang'] . "') . ' -');";
}
$function[] = $this->_t(3)
. "foreach (\$results as \$result)";
$function[] = $this->_t(3) . "{";
@ -17802,6 +17747,13 @@ class Interpretation extends Fields
. "\$results = array_unique(\$results);";
}
$function[] = $this->_t(3) . "\$_filter = array();";
// if this is not a multi field
if (!$funtion_path && $filter['multi'] == 1)
{
$function[] = $this->_t(3)
. "\$_filter[] = JHtml::_('select.option', '', '- Select ' . JText:"
. ":_('" . $filter['lang'] . "') . ' -');";
}
$function[] = $this->_t(3) . "foreach (\$results as \$"
. $filter['code'] . ")";
$function[] = $this->_t(3) . "{";
@ -17878,8 +17830,6 @@ class Interpretation extends Fields
&& $filter['multi'] == 2
&& ComponentbuilderHelper::checkArray($filter['custom']))
{
//var_dump($filter);
//jexit();
// get the field code
$field_code = $this->getCustomFieldCode(
$filter['custom']
@ -18068,8 +18018,8 @@ class Interpretation extends Fields
__LINE__
) . " " . $CodeName . " Filter";
$fieldFilters[] = $this->_t(3) . "JHtmlSidebar::addFilter(";
$fieldFilters[] = $this->_t(4) . "'- Select '.JText:"
. ":_('" . $filter['lang'] . "').' -',";
$fieldFilters[] = $this->_t(4) . "'- Select ' . JText:"
. ":_('" . $filter['lang'] . "') . ' -',";
$fieldFilters[] = $this->_t(4) . "'filter_"
. $filter['code']
. "',";
@ -21873,30 +21823,18 @@ class Interpretation extends Fields
$this->filterBuilder[$nameListCode]
))
{
// main lang prefix
$lang_ = $this->langPrefix . '_FILTER_';
foreach ($this->filterBuilder[$nameListCode] as $filter)
{
// we need this only for filters that are multi
if (isset($filter['multi'])
&& $filter['multi'] == 2)
{
// set the selection string (not ideal)
$select_name = "Select " . strip_tags($filter['name']);
// set the language
$select_lang = $lang_ . ComponentbuilderHelper::safeString(
$select_name, 'U'
);
// set selection lang
$this->setLangContent(
$this->lang, $select_lang, $select_name
);
// add the header
$headers[]
= 'JHtml::_(\'formbehavior.chosen\', \'.multiple'
. $filter['class']
. '\', null, array(\'placeholder_text_multiple\' => JText::_(\''
. $select_lang . '\')));';
. '\', null, array(\'placeholder_text_multiple\' => \'- \' . JText::_(\''
. $filter['lang_select'] . '\') . \' -\'));';
}
}
}

View File

@ -1486,7 +1486,6 @@ class Infusion extends Interpretation
. 'CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT' . $this->hhh]
= $this->setCustomViewSubmitButtonScript($view);
// setup the templates
$this->setCustomViewTemplateBody($view);