summaryrefslogtreecommitdiff
path: root/auto_prepend.php
diff options
context:
space:
mode:
authorUrban Müller2013-10-08 15:05:20 +0000
committerUrban Müller2013-10-08 15:05:20 +0000
commitfb31f42b294161a1f2686413f2cb710e5a1a609a (patch)
tree1bda4f13e33e867635f4ca38f6d14f17a8b078fb /auto_prepend.php
parent6cca6bf6150cf765631e902f1a388ab11e71737d (diff)
downloaditools-fb31f42b294161a1f2686413f2cb710e5a1a609a.tar.gz
itools-fb31f42b294161a1f2686413f2cb710e5a1a609a.tar.bz2
itools-fb31f42b294161a1f2686413f2cb710e5a1a609a.zip
faster EDC(), ET() docs
Diffstat (limited to 'auto_prepend.php')
-rw-r--r--auto_prepend.php31
1 files changed, 18 insertions, 13 deletions
diff --git a/auto_prepend.php b/auto_prepend.php
index b71acb7..ba62442 100644
--- a/auto_prepend.php
+++ b/auto_prepend.php
@@ -28,22 +28,26 @@ function ED()
* Same as ED(), but if first argument is foo then $GLOBALS['debug_foo'] must be set for output
* @return boolean indicating whether $GLOBALS['debug_foo'] was set
*/
-function EDC()
+function EDC($var)
{
- $args = func_get_args();
- $var = array_shift($args);
$GLOBALS['ULTRADEBUGVARS'][$var] = 1;
- if (($result = $GLOBALS["debug_$var"]) && $args)
+ if (($result = $GLOBALS["debug_$var"]))
{
- if (ob_get_level() == 0 && $_SERVER['REMOTE_ADDR'])
- ob_start(); # prevent later 'headers already sent' error
- echo it_debug::dump($args);
+ $args = func_get_args();
+ array_shift($args); # remove $var
+
+ if ($args)
+ {
+ if (ob_get_level() == 0 && $_SERVER['REMOTE_ADDR'])
+ ob_start(); # prevent later 'headers already sent' error
+ echo it_debug::dump($args);
+ }
+
+ if (!$result || $result === true) # Compatibility with old map relying on 0|1
+ $result = intval($result);
}
- if (!$result || $result === true) # Compatibility with old map relying on 0|1
- $result = intval($result);
-
return $result;
}
@@ -62,9 +66,10 @@ function EDX()
/**
* Return a text in the selected language
+ * Replaces variables of the form {var} with quoted values from argument $values
* @param $label Label of text to return
- * @param $language Optional value array or language string
- * @param $values Optional value array or language string
+ * @param $language Optional value array or language string (will be sent through Q())
+ * @param $values Optional value array or language string (will be sent through Q())
* @return Localized text string
*/
function T($label, $language = null, $values = null)
@@ -81,7 +86,7 @@ function T($label, $language = null, $values = null)
* 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 $values Associative array containing values to fill in (no quoting)
* @param $language Optional language to return text in.
* @return Localized text string with variables replaced by their values
*/