From 7facb7ab78a526744984c2ad8f68687ae051d328 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 6 Jun 2018 15:12:42 +0200 Subject: [PATCH] Improved PhrasesLib and Phrase_model . optimized code in PhrasesLib.php . secured method in Phrase_model with bindings --- application/libraries/PhrasesLib.php | 9 +++++++-- application/models/system/Phrase_model.php | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index bfc2f8493..e50fc4d22 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -263,8 +263,13 @@ class PhrasesLib } /** - * - * stores phrases-array in property $_phrases + * Retrieves phrases in the users language. + * If a phrase is not set in the users language it will be retrieved in the default language. + * Stores phrases-array in property $_phrases. + * @param array $categories Could be an: + * - indexed array: string or an array of strings. These are the categories used to load phrases. + * - associative array: of categories, and for each category there is an array of phrases. + * @param string User's language or default language. */ private function _setPhrases($categories, $language) { diff --git a/application/models/system/Phrase_model.php b/application/models/system/Phrase_model.php index 694605ae3..fd121758a 100644 --- a/application/models/system/Phrase_model.php +++ b/application/models/system/Phrase_model.php @@ -81,7 +81,6 @@ class Phrase_model extends DB_Model /** * Loads phrases using category(s) and language as keys using associative category array * that contains also phrases for each category - * They are ordered by p.category, p.phrase, pt.orgeinheit_kurzbz DESC and pt.orgform_kurzbz DESC' */ public function getPhrasesByCategoryAndPhrasesAndLanguage($phrasesParams, $language) {