From 52bd3236b60c12d3e164b22355d9a48b9aa69417 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Sun, 30 Sep 2007 19:33:32 +0000 Subject: moved docs to global funcs --- auto_prepend.php | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'auto_prepend.php') diff --git a/auto_prepend.php b/auto_prepend.php index 66dc6d1..da31810 100644 --- a/auto_prepend.php +++ b/auto_prepend.php @@ -83,7 +83,11 @@ function EDX() } /** - * Shortcut to $it_text->Text() + * Return a text in the selected language + * @param $label Label of text to return + * @param $raw Optional (deprecated) + * @param $language Optional language to return text in. + * @return Localized text string */ function T($label, $raw = null, $language = null) { @@ -91,9 +95,13 @@ function T($label, $raw = null, $language = null) return $GLOBALS['it_text']->text($label, $raw, $language); } - /** - * Shortcut to $it_text->etext() + * Return a text in the selected language + * Replaces variables of the form {var} with value from argument $values + * @param $label Label of text to return + * @param $values Associative array containing values to fill in + * @param $language Optional language to return text in. + * @return Localized text string with variables replaced by their values */ function ET($label, $values = null, $language = null) { @@ -102,15 +110,19 @@ function ET($label, $values = null, $language = null) } /** - * Return "db4" or "db2" depending on availability + * Change language + * @param $language New language to set + * @param $setcookie Optional flag if a cookie is to be set (default: true) */ -function db_version() +function T_set_language($language, $setcookie = true) { - return in_array("db4", dba_handlers()) ? "db4" : "db2"; + it_text::init(); + return $GLOBALS['it_text']->set_language($language, $setcookie); } /** - * Shortcut to $it_text->get_language() + * Get active language + * @return currently active language */ function T_lang() { @@ -119,21 +131,22 @@ function T_lang() } /** - * Shortcut to $it_text->get_language() + * Check if a text entry for a specific label exists + * @param $label Label to check + * @return true if text exists in actual (or supplied) language, false otherwise. */ -function T_set_language($language, $setcookie = true) +function T_exists($label, $language = null) { it_text::init(); - return $GLOBALS['it_text']->set_language($language, $setcookie); + return $GLOBALS['it_text']->text_exists($label, $language); } /** - * Shortcut to $it_text->text_exists() + * Return "db4" or "db2" depending on availability */ -function T_exists($label, $language = null) +function db_version() { - it_text::init(); - return $GLOBALS['it_text']->text_exists($label, $language); + return in_array("db4", dba_handlers()) ? "db4" : "db2"; } ?> -- cgit v1.2.3