mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 18:02:18 +00:00
- Added FiltersLib to contain all the shared logic of a FilterWidget
- Adapted Filters controller and FilterWidget to use this new lib - Better memory usage in FilterWidget - PhrasesLib now checks if categories is an empty array, it it is then avoid to call the method to load phrases (avoids an ugly error) - Renamed the class FHC_PhraseLib to FHC_PhrasesLib (like the filename)
This commit is contained in:
@@ -16,7 +16,7 @@ class FiltersLib
|
||||
const SESSION_ADDITIONAL_COLUMNS = 'additionalColumns';
|
||||
const SESSION_CHECKBOXES = 'checkboxes';
|
||||
const SESSION_FILTERS = 'filters';
|
||||
const SESSION_DATASET_METADATA = 'datasetMetadata';
|
||||
const SESSION_METADATA = 'datasetMetadata';
|
||||
const SESSION_DATASET = 'dataset';
|
||||
const SESSION_ROW_NUMBER = 'rowNumber';
|
||||
const SESSION_RELOAD_DATASET = 'reloadDataset';
|
||||
|
||||
@@ -257,7 +257,8 @@ class PhrasesLib
|
||||
$language = $this->_ci->PersonModel->getLanguage(getAuthUID());
|
||||
}
|
||||
|
||||
$this->_setPhrases($categories, $language);
|
||||
// If only categories is not an empty array then loads phrases
|
||||
if (count($categories) > 0) $this->_setPhrases($categories, $language);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -285,8 +286,7 @@ class PhrasesLib
|
||||
{
|
||||
// is assoc array -> Loads specific phrasentexte by category and phrases
|
||||
$isIndexArray = false;
|
||||
$phrases = $this->_ci->PhraseModel
|
||||
->getPhrasesByCategoryAndPhrasesAndLanguage($categories, $language);
|
||||
$phrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndPhrasesAndLanguage($categories, $language);
|
||||
}
|
||||
|
||||
// If language is not default language and phrasentext is null -> fallback to default language
|
||||
@@ -296,13 +296,11 @@ class PhrasesLib
|
||||
$defaultPhrases = null;
|
||||
if ($isIndexArray)
|
||||
{
|
||||
$defaultPhrases = $this->_ci->PhraseModel
|
||||
->getPhrasesByCategoryAndLanguage($categories, DEFAULT_LANGUAGE);
|
||||
$defaultPhrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndLanguage($categories, DEFAULT_LANGUAGE);
|
||||
}
|
||||
else
|
||||
{
|
||||
$defaultPhrases = $this->_ci->PhraseModel
|
||||
->getPhrasesByCategoryAndPhrasesAndLanguage($categories, DEFAULT_LANGUAGE);
|
||||
$defaultPhrases = $this->_ci->PhraseModel->getPhrasesByCategoryAndPhrasesAndLanguage($categories, DEFAULT_LANGUAGE);
|
||||
}
|
||||
|
||||
// combine array with phrasentexte in users language and in default language
|
||||
|
||||
Reference in New Issue
Block a user