From 9daf4133bf6f61cbe3787a46b021d261242a85f0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 19 May 2007 08:34:02 +0100 Subject: add tagwall --- tw/error/FOO_error.php | 43 ++++++++++++++++++++ tw/error/LINK_error.php | 94 +++++++++++++++++++++++++++++++++++++++++++ tw/error/__Template_error.php | 69 +++++++++++++++++++++++++++++++ 3 files changed, 206 insertions(+) create mode 100644 tw/error/FOO_error.php create mode 100644 tw/error/LINK_error.php create mode 100644 tw/error/__Template_error.php (limited to 'tw/error') diff --git a/tw/error/FOO_error.php b/tw/error/FOO_error.php new file mode 100644 index 000000000..3924768ee --- /dev/null +++ b/tw/error/FOO_error.php @@ -0,0 +1,43 @@ +TW_errors($options); + } + + function add($errval, $position, $show_code, $param1=null, $param2=null ) + { + $this->ErrorArray["TW_err_".$this->identifier++] = array($errval, $param1, $param2, $position, $show_code); + if($errval & 0xff00) $this->IsError = 1; + return null; + } +} +?> \ No newline at end of file diff --git a/tw/error/LINK_error.php b/tw/error/LINK_error.php new file mode 100644 index 000000000..580e15fbc --- /dev/null +++ b/tw/error/LINK_error.php @@ -0,0 +1,94 @@ +TW_errors($options); + } + + function add($errval, $position, $show_code, $param1=null, $param2=null ) + { + $err_id = "TW_err_".$this->identifier++; + $this->ErrorArray[$err_id] = array($errval, $param1, $param2, $position, $show_code); + if($errval & 0xff00) $this->IsError = 1; + + // append errors and warnings + if(($errval & 0x0ff0) && $show_code != null ) + return ''.$show_code.''; + + return null; + } + + // You can call this method from your project and create nice list of errors. + // + // $lang - error string pack + // $mask - any combination of following masks: + // 0xf000 - internal, + // 0x0f00 - errors, + // 0x00f0 - warnings, + // 0x000f - comments + // + function create_list (&$lang, $mask = 0x0ff0) + { + $errors = $this->get_by_mask($mask); + + $out = ""; + } + + function get_error_class ($error) + { + if($error&0xf000) return "tw-err-int"; + if($error&0x0f00) return "tw-err-err"; + if($error&0x00f0) return "tw-err-war"; + return "tw-err-com"; + } +} +?> \ No newline at end of file diff --git a/tw/error/__Template_error.php b/tw/error/__Template_error.php new file mode 100644 index 000000000..194f4a272 --- /dev/null +++ b/tw/error/__Template_error.php @@ -0,0 +1,69 @@ +TW_errors($options); + + // TODO: add your own module initializations here + } + + // You must implement your own add method. + + function add($errval, $position, $show_code, $param1=null, $param2=null ) + { + $err_id = "TW_err_".$this->identifier++; + // + // This is basic error implementation. Modify this code only if you really need it. + // + $this->ErrorArray[$err_id] = array($errval, $param1, $param2, $position, $show_code); + if($errval & 0xff00) $this->IsError = 1; + + // TODO: create your output additions here, and return it as string + + return null; + } + + // TODO: + // You can implement ohther methods here. + // For example: special error filters, post-parsing functions for generating + // error lists, etc... + +} +?> \ No newline at end of file -- cgit v1.2.3