summaryrefslogtreecommitdiff
path: root/auto_prepend.php
diff options
context:
space:
mode:
Diffstat (limited to 'auto_prepend.php')
-rw-r--r--auto_prepend.php95
1 files changed, 60 insertions, 35 deletions
diff --git a/auto_prepend.php b/auto_prepend.php
index 08ed7b1..09092ca 100644
--- a/auto_prepend.php
+++ b/auto_prepend.php
@@ -1,40 +1,6 @@
<?php
-/**
- * Print an error message and end page
- */
-function fail($text)
-{
- trigger_error($text, E_USER_ERROR);
- it::fatal($text);
-}
-
-/**
- * Global shortcut for $it_debug::debug()
- * @see it_debug::debug()
- */
-function debug($text, $level=0)
-{
- if (isset($GLOBALS['it_debug']))
- $GLOBALS['it_debug']->debug($text, $level);
-}
-
-/**
- * Convert a htmlentities-encoded string back to normal
- */
-function it_htmlentities_decode($string)
-{
- return strtr($string, array_flip(get_html_translation_table(HTML_ENTITIES)));
-}
-
-/**
- * Clone an object and return copy, works for all PHP versions
- */
-function &it_clone(&$object)
-{
- $result = (is_object($object) && version_compare(zend_version(), 2, '>=')) ? clone($object) : $object;
- return $result; # PHP internals need a tmp var to return by ref
-}
+/****************** functions for class it_debug **********************/
/**
* Return string containing names and values of all arguments
@@ -90,6 +56,10 @@ function EDX()
exit(it_debug::dump($args));
}
+
+
+/****************** functions for class it_text **********************/
+
/**
* Return a text in the selected language
* @param $label Label of text to return
@@ -171,6 +141,61 @@ function db_version()
return in_array("db4", dba_handlers()) ? "db4" : "db2";
}
+
+
+
+/****************** functions for class it_text **********************/
+
+/**
+ * Build an url
+ */
+function U(/* ... */)
+{
+ $args = func_get_args();
+ return call_user_func_array(array('it_html', 'U'), $args);
+}
+
+
+
+
+/************************** other functions ***************************/
+
+/**
+ * Print an error message and end page
+ */
+function fail($text)
+{
+ trigger_error($text, E_USER_ERROR);
+ it::fatal($text);
+}
+
+/**
+ * Global shortcut for $it_debug::debug()
+ * @see it_debug::debug()
+ */
+function debug($text, $level=0)
+{
+ if (isset($GLOBALS['it_debug']))
+ $GLOBALS['it_debug']->debug($text, $level);
+}
+
+/**
+ * Convert a htmlentities-encoded string back to normal
+ */
+function it_htmlentities_decode($string)
+{
+ return strtr($string, array_flip(get_html_translation_table(HTML_ENTITIES)));
+}
+
+/**
+ * Clone an object and return copy, works for all PHP versions
+ */
+function &it_clone(&$object)
+{
+ $result = (is_object($object) && version_compare(zend_version(), 2, '>=')) ? clone($object) : $object;
+ return $result; # PHP internals need a tmp var to return by ref
+}
+
/**
* Experimental PHP taint support, see ftp://ftp.porcupine.org/pub/php/
*/