From a82aea85ab068bc87e76871b35fdb9ddab2a6a26 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 11 Dec 2005 21:23:43 +0000 Subject: [PATCH] Delineating functions --- api.php | 24 ++++++++++++---- date.php | 12 ++++++-- db_mysql.php | 13 +++++++++ functions.php | 34 +++++++++++++++++----- kernel.php | 43 ++++++++++++++++++++++------ localize.php | 6 ++++ mail.php | 5 ++++ printer.php | 76 ++++++++++++++++++++++++++++++++++++++----------- template.php | 19 ++++++++++--- template_fs.php | 12 +++++--- xml.php | 8 ++++++ 11 files changed, 204 insertions(+), 48 deletions(-) diff --git a/api.php b/api.php index 5298e64..3591a53 100644 --- a/api.php +++ b/api.php @@ -128,6 +128,7 @@ class API */ var $norunners = array(); + // ################################################################### /** * Constructor: cannot instantiate class directly */ @@ -146,6 +147,7 @@ class API $this->registry =& $registry; } + // ################################################################### /** * (PHP 4) Constructor */ @@ -154,6 +156,7 @@ class API $this->__construct($registry); } + // ################################################################### /** * Constructs an error for the error handler to receive * @@ -166,6 +169,7 @@ class API call_user_func(APIError(), $message); } + // ################################################################### /** * Sets a value, sanitizes it, and verifies it * @@ -206,9 +210,10 @@ class API } } + // ################################################################### /** - * Sets the condition to use in the WHERE clause; if not passed, then it calculates it - * from the REQ_AUTO field + * Sets the condition to use in the WHERE clause; if not passed, then + * it calculates it from the REQ_AUTO field * * @access public * @@ -243,6 +248,7 @@ class API } } + // ################################################################### /** * Sets existing data into $values where it's not already present * @@ -269,6 +275,7 @@ class API $run = true; } + // ################################################################### /** * Fetches a record based on the condition * @@ -295,6 +302,7 @@ class API $this->objdata = $result; } + // ################################################################### /** * Inserts a record in the database * @@ -318,6 +326,7 @@ class API $this->run_action_method('post_insert'); } + // ################################################################### /** * Updates a record in the database using the data in $vaues * @@ -343,6 +352,7 @@ class API $this->run_action_method('post_update'); } + // ################################################################### /** * Deletes a record * @@ -364,6 +374,7 @@ class API $this->run_action_method('post_delete'); } + // ################################################################### /** * Verifies that all required fields are set * @@ -387,6 +398,7 @@ class API } } + // ################################################################### /** * Runs a pre- or post-action method for database commands * @@ -404,6 +416,7 @@ class API $actmethod = (method_exists($this, $method) ? $this->$method() : ''); } + // ################################################################### /** * Verify field: not a zero value * @@ -419,6 +432,7 @@ class API return true; } + // ################################################################### /** * Verify field: not empty * @@ -435,10 +449,10 @@ class API } } +// ################################################################### /** -* Setter and getter method for the API error reporting -* system. Passing a name will cause the set, no arguments -* will cause the get. +* Setter and getter method for the API error reporting system. Passing +* a name will cause the set, no arguments will cause the get. * * @access public * diff --git a/date.php b/date.php index afefdf3..3d99726 100644 --- a/date.php +++ b/date.php @@ -76,6 +76,7 @@ class Date */ var $offset = 0; + // ################################################################### /** * Constructor: sets the server's timezone */ @@ -86,6 +87,7 @@ class Date $this->servertz = date('Z', TIMENOW) / 3600; } + // ################################################################### /** * (PHP 4) Constructor */ @@ -94,9 +96,10 @@ class Date $this->__construct($registry); } + // ################################################################### /** - * Computes the total offset, taking into account all - * the various options + * Computes the total offset, taking into account all the various + * options * * @access public */ @@ -106,8 +109,10 @@ class Date $this->offset = $this->offsettz * 3600; } + // ################################################################### /** - * Formats a UNIX timestamp to a certain date format in the proper time zone + * Formats a UNIX timestamp to a certain date format in the proper time + * zone * * @access public * @@ -127,6 +132,7 @@ class Date return date($format, $timestamp); } + // ################################################################### /** * Fetches an array of timezones for a \n"; } + // ################################################################### /** * Closes a
tag * @@ -527,9 +552,12 @@ EOD; echo "
\n\n"; } + // ------------------------------------------------------------------- + // ################################################################### /** - * Creates a table row that spans an entire row; this is used to divide sections, usually + * Creates a table row that spans an entire row; this is used to divide + * sections, usually * * @access public * @@ -563,9 +591,11 @@ EOD; echo "\n\n\t$text\n"; } + // ################################################################### /** - * Creates a table row that has more than two columns; this is used in conjunction with table_column_head() - * usually; it takes an array of values + * Creates a table row that has more than two columns; this is used in + * conjunction with table_column_head() usually; it takes an array of + * values * * @access public * @@ -606,9 +636,11 @@ EOD; echo "\n\n"; } + // ################################################################### /** - * Generic row creation function that has two columns: label and value; this is used for many - * other form functions, but can also be used for non-editable fields + * Generic row creation function that has two columns: label and value; + * this is used for many other form functions, but can also be used for + * non-editable fields * * @access public * @@ -651,6 +683,7 @@ EOD; echo "\n\n"; } + // ################################################################### /** * Creates a table row with an text field as the value column * @@ -670,6 +703,7 @@ EOD; $this->row_text($label, "", $lalign, $colspan); } + // ################################################################### /** * Creates a table row with a ", 'top', $colspan); } + // ################################################################### /** * Creates a table row with the tfoot class * @@ -702,6 +737,7 @@ EOD; echo $this->row_span($data, 'tfoot', 'center', $colspan); } + // ################################################################### /** * Creates a tfoot table row with submit buttons * @@ -739,8 +775,10 @@ EOD; $this->row_tfoot($output, $colspan); } + // ################################################################### /** - * Creates an upload row; you need to specify some other paramaters in form_start() for this to work + * Creates an upload row; you need to specify some other paramaters in + * form_start() for this to work * * @access public * @@ -753,8 +791,10 @@ EOD; $this->row_text($label, "", 'top', $colspan); } + // ################################################################### /** - * Adds a name-value pair to an array that is constructed into a list * * @access public * @@ -769,6 +809,7 @@ EOD; $listitem[] = "\n\t"; } + // ################################################################### /** * Assembles a $optionlist\n" . (($is_jump) ? "\nregistry->modules['localize']->string('Go') . " \" accesskey=\"g\" />" : '') . "\n", $colspan); } + // ################################################################### /** * Creates a row with two radio buttons: yes and now * diff --git a/template.php b/template.php index e1260b0..351129b 100644 --- a/template.php +++ b/template.php @@ -106,6 +106,7 @@ class Template */ var $doneflush = false; + // ################################################################### /** * Constructor */ @@ -114,6 +115,7 @@ class Template $this->registry =& $registry; } + // ################################################################### /** * (PHP 4) Constructor */ @@ -122,9 +124,10 @@ class Template $this->__construct($registry); } + // ################################################################### /** - * Takes an array of template names, loads them, and then stores - * a parsed version for optimum speed. + * Takes an array of template names, loads them, and then stores a + * parsed version for optimum speed. * * @access public * @@ -147,9 +150,10 @@ class Template } } + // ################################################################### /** - * Loads a template from the cache or the _load function and - * stores the parsed version of it + * Loads a template from the cache or the _load function and stores the + * parsed version of it * * @access public * @@ -181,6 +185,7 @@ class Template return $template; } + // ################################################################### /** * Output a template fully compiled to the browser * @@ -355,6 +360,7 @@ class Template print($template); } + // ################################################################### /** * Loads an additional template from the database * @@ -377,6 +383,7 @@ class Template } } + // ################################################################### /** * A wrapper for all the parsing functions and compiling functins * @@ -394,6 +401,7 @@ class Template return $template; } + // ################################################################### /** * Prepares language and locale information inside templates * @@ -474,6 +482,7 @@ class Template return $template; } + // ################################################################### /** * Turns a localized phrase tag into a function call * @@ -488,6 +497,7 @@ class Template return '" . ' . $this->langcall . '(\'' . str_replace(array('\\\"', "'"), array('"', "\'"), $text) . '\') . "'; } + // ################################################################### /** * Parser for in-line template conditionals * @@ -619,6 +629,7 @@ class Template } } +// ################################################################### /** * Debugging function used to print characters * in a string that are around a certain position. diff --git a/template_fs.php b/template_fs.php index 8eede7d..773b346 100644 --- a/template_fs.php +++ b/template_fs.php @@ -60,6 +60,7 @@ class Template_FS extends Template */ var $extension = 'tpl'; + // ################################################################### /** * Constructor */ @@ -68,6 +69,7 @@ class Template_FS extends Template $this->registry =& $registry; } + // ################################################################### /** * (PHP 4) Constructor */ @@ -76,9 +78,10 @@ class Template_FS extends Template $this->__construct($registry); } + // ################################################################### /** - * Takes an array of template names, loads them, and then stores - * a parsed version for optimum speed. + * Takes an array of template names, loads them, and then stores a + * parsed version for optimum speed. * * @access public * @@ -102,9 +105,10 @@ class Template_FS extends Template } } + // ################################################################### /** - * Loads a template from the file system from the specified $templatedir - * with the file extension $extension + * Loads a template from the file system from the specified + * $templatedir with the file extension $extension * * @access private * diff --git a/xml.php b/xml.php index f72987b..3f8010c 100644 --- a/xml.php +++ b/xml.php @@ -81,6 +81,7 @@ class XML */ var $result = array(); + // ################################################################### /** * Constructor */ @@ -89,6 +90,7 @@ class XML $this->registry =& $registry; } + // ################################################################### /** * (PHP 4) Constructor */ @@ -97,6 +99,7 @@ class XML $this->__construct($registry); } + // ################################################################### /** * Parse an XML file * @@ -140,6 +143,7 @@ class XML return $this->result; } + // ################################################################### /** * Process the opening location of an XML tag * @@ -175,6 +179,7 @@ class XML } } + // ################################################################### /** * Process XML CDATA * @@ -188,6 +193,7 @@ class XML $this->cdata .= $data; } + // ################################################################### /** * Process the closing of an XML tag * @@ -224,6 +230,7 @@ class XML $this->detach_node(); } + // ################################################################### /** * Shifts the node tree * @@ -240,6 +247,7 @@ class XML $this->attribs =& $node; } + // ################################################################### /** * Unshifts the node tree * -- 2.22.5