Update the comment formatting to not use the pound bar anymore and to put a space... 3.0.0
authorRobert Sesek <rsesek@bluestatic.org>
Thu, 28 Feb 2008 20:49:05 +0000 (15:49 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Thu, 28 Feb 2008 20:49:05 +0000 (15:49 -0500)
27 files changed:
Api.php
App.php
Date.php
Db.php
DbMySql.php
DbMySqlI.php
DbPostgreSql.php
Functions.php
Input.php
Installer.php
Mail.php
Pagination.php
Printer.php
PrinterAbstract.php
PrinterElement.php
PrinterElementLabel.php
PrinterElementTable.php
PrinterNavigation.php
PrinterRootAbstract.php
PrinterRootForm.php
PrinterRootPage.php
PrinterRootTable.php
Template.php
UnitTest/AppTest.php
UnitTest/DateTest.php
UnitTest/FunctionsTest.php
UnitTest/InputTest.php

diff --git a/Api.php b/Api.php
index 27d6ad728c401f22ef2ed25ee8b256a3ab6914eb..3f5d8603c348e5f7c1a00a0373360ea1d87034c0 100644 (file)
--- a/Api.php
+++ b/Api.php
 \*=====================================================================*/
 
 /**
-* Abstract Datamanger API (api.php)
-*
-* @package     ISSO
-*/
+ * Abstract Datamanger API (api.php)
+ *
+ * @package    ISSO
+ */
 
 if (!defined('REQ_AUTO'))
 {      
        /**
-       * Yes, required
-       */
+        * Yes, required
+        */
        define('REQ_YES', 1);
        
        /**
-       * No, not required
-       */
+        * No, not required
+        */
        define('REQ_NO', 0);
 
        /**
-       * Auto-increasing value
-       */
+        * Auto-increasing value
+        */
        define('REQ_AUTO', -1);
        
        /**
-       * Set by a cusotm set_*() function
-       */
+        * Set by a cusotm set_*() function
+        */
        define('REQ_SET', 2);
        
        /**
-       * Index for cleaning type
-       */
+        * Index for cleaning type
+        */
        define('F_TYPE', 0);
        
        /**
-       * Index for requirement type
-       */
+        * Index for requirement type
+        */
        define('F_REQ', 1);
 }
 
 /**
-* Abstract API
-*
-* Abstract class that is used as an API base for most common database interaction
-* schemes. Creates a simple structure that holds data and can update, remove, and
-* insert.
-* 
-* Life-cycle of a new object:
-* 1. $o = new SubApi();
-* 2. $o->set('foo', 'abc');
-* 3. $o->set('test', 45);
-* 4. try { $o->insert(); <other actions that depend on the saved record> } catch (ApiException $e) {}
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * Abstract API
+ *
+ * Abstract class that is used as an API base for most common database interaction
+ * schemes. Creates a simple structure that holds data and can update, remove, and
+ * insert.
+ 
+ * Life-cycle of a new object:
+ * 1. $o = new SubApi();
+ * 2. $o->set('foo', 'abc');
+ * 3. $o->set('test', 45);
+ * 4. try { $o->insert(); <other actions that depend on the saved record> } catch (ApiException $e) {}
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 abstract class BSApi
 {
        /**
-       * Fields: used for verification and sanitization
-       * NAME => array(TYPE, REQUIRED)
-       * @var  array
-       */
+        * Fields: used for verification and sanitization
+        * NAME => array(TYPE, REQUIRED)
+        * @var array
+        */
        protected $fields = array();
        
        /**
@@ -98,39 +98,39 @@ abstract class BSApi
        protected $prefix = '';
        
        /**
-       * Values array: sanitized and validated field values
-       * @var  array
-       */
+        * Values array: sanitized and validated field values
+        * @var array
+        */
        public $values = array();
        
        /**
-       * Fields that were set by the client
-       * @var  array
-       */
+        * Fields that were set by the client
+        * @var array
+        */
        private $setfields = array();
        
        /**
-       * WHERE condition
-       * @var  string
-       */
+        * WHERE condition
+        * @var string
+        */
        protected $condition = '';
        
        /**
-       * The object table row; a fetched row that represents this instance
-       * @var  array
-       */
+        * The object table row; a fetched row that represents this instance
+        * @var array
+        */
        public $record = array();
        
        /**
-       * Insert ID from the insert() command
-       * @var  integer
-       */
+        * Insert ID from the insert() command
+        * @var integer
+        */
        public $insertid = 0;
        
        /**
-       * Error queue that builds up errors
-       * @var  ApiException
-       */
+        * Error queue that builds up errors
+        * @var ApiException
+        */
        private $exception = null;
        
        /**
@@ -148,12 +148,11 @@ abstract class BSApi
                }
        }
        
-       // ###################################################################
        /**
-       * Adds an error into the error queue that is then hit 
-       *
-       * @param        Exception       Error message
-       */
+        * Adds an error into the error queue that is then hit 
+        *
+        * @param       Exception       Error message
+        */
        protected function _error(Exception $e)
        {
                if ($this->exception == null)
@@ -163,11 +162,10 @@ abstract class BSApi
                $this->exception->addException($e);
        }
        
-       // ###################################################################
        /**
-       * This simply throws the ApiException if it exists, which inside holds
-       * all of the individual and specific errors
-       */
+        * This simply throws the ApiException if it exists, which inside holds
+        * all of the individual and specific errors
+        */
        private function _processErrorQueue()
        {
                if ($this->exception)
@@ -176,15 +174,14 @@ abstract class BSApi
                }
        }
        
-       // ###################################################################
        /**
-       * Sets a value, sanitizes it, and validates it
-       *
-       * @param        string  Field name
-       * @param        mixed   Value
-       * @param        bool    Do clean?
-       * @param        bool    Do validation?
-       */
+        * Sets a value, sanitizes it, and validates it
+        *
+        * @param       string  Field name
+        * @param       mixed   Value
+        * @param       bool    Do clean?
+        * @param       bool    Do validation?
+        */
        public function set($field, $value, $doclean = true, $dovalidate = true)
        {
                if (!isset($this->fields["$field"]))
@@ -202,13 +199,12 @@ abstract class BSApi
                }
        }
        
-       // ###################################################################
        /**
-       * Sets the condition to use in the WHERE clause; if not passed, then
-       * it calculates it from the REQ_AUTO field
-       *
-       * @param        mixed   String with WHERE condition; array of fields to use for WHERE builder
-       */
+        * Sets the condition to use in the WHERE clause; if not passed, then
+        * it calculates it from the REQ_AUTO field
+        *
+        * @param       mixed   String with WHERE condition; array of fields to use for WHERE builder
+        */
        public function setCondition($condition = null)
        {
                if (is_array($condition) && sizeof($condition) > 0)
@@ -252,15 +248,14 @@ abstract class BSApi
                }
        }
        
-       // ###################################################################
        /**
-       * Fetches a record based on the condition
-       *
-       * @param        bool    Run pre_fetch()?
-       * @param        bool    Run post_fetch()?
-       *
-       * @return       boolean Whether or not the row was successfully fetched
-       */
+        * Fetches a record based on the condition
+        *
+        * @param       bool    Run pre_fetch()?
+        * @param       bool    Run post_fetch()?
+        *
+        * @return      boolean Whether or not the row was successfully fetched
+        */
        public function fetch($doPre = true, $doPost = true)
        {
                if (!$this->condition)
@@ -286,13 +281,12 @@ abstract class BSApi
                return true;
        }
        
-       // ###################################################################
        /**
-       * Inserts a record in the database
-       *
-       * @param        bool    Run pre_insert()?
-       * @param        bool    Run post_insert()?
-       */
+        * Inserts a record in the database
+        *
+        * @param       bool    Run pre_insert()?
+        * @param       bool    Run post_insert()?
+        */
        public function insert($doPre = true, $doPost = true)
        {
                $this->_verifyRequired();
@@ -330,13 +324,12 @@ abstract class BSApi
                $this->_runActionMethod('post_insert', $doPost);
        }
        
-       // ###################################################################
        /**
-       * Updates a record in the database using the data in $vaues
-       *
-       * @param        bool    Run pre_update()?
-       * @param        bool    Run post_update()?
-       */
+        * Updates a record in the database using the data in $vaues
+        *
+        * @param       bool    Run pre_update()?
+        * @param       bool    Run post_update()?
+        */
        public function update($doPre = true, $doPost = true)
        {
                if (!$this->condition)
@@ -359,13 +352,12 @@ abstract class BSApi
                $this->_runActionMethod('post_update', $doPost);
        }
        
-       // ###################################################################
        /**
-       * Deletes a record
-       *
-       * @param        bool    Run pre_remove()?
-       * @param        bool    Run post_remove()?
-       */
+        * Deletes a record
+        *
+        * @param       bool    Run pre_remove()?
+        * @param       bool    Run post_remove()?
+        */
        public function remove($doPre = true, $doPost = true)
        {
                if (!$this->condition)
@@ -382,10 +374,9 @@ abstract class BSApi
                $this->_runActionMethod('post_remove', $doPost);
        }
        
-       // ###################################################################
        /**
-       * Verifies that all required fields are set
-       */
+        * Verifies that all required fields are set
+        */
        private function _verifyRequired()
        {
                foreach ($this->fields as $name => $options)
@@ -404,13 +395,12 @@ abstract class BSApi
                }
        }
        
-       // ###################################################################
        /**
-       * Runs a pre- or post-action method for database commands
-       *
-       * @param        string  Action to run
-       * @param        bool    Actually run it?
-       */
+        * Runs a pre- or post-action method for database commands
+        *
+        * @param       string  Action to run
+        * @param       bool    Actually run it?
+        */
        private function _runActionMethod($method, $doRun)
        {
                if (!$doRun || !method_exists($this, $method))
@@ -421,15 +411,14 @@ abstract class BSApi
                $this->$method();
        }
        
-       // ###################################################################
        /**
-       * Prepares a value for use in a SQL query; it encases and escapes
-       * strings and string-like values
-       *
-       * @param        string  Field name
-       *
-       * @return       string  Prepared value entry
-       */
+        * Prepares a value for use in a SQL query; it encases and escapes
+        * strings and string-like values
+        *
+        * @param       string  Field name
+        *
+        * @return      string  Prepared value entry
+        */
        private function _prepareFieldForSql($name)
        {
                $type = $this->fields["$name"][F_TYPE];
@@ -452,10 +441,9 @@ abstract class BSApi
                }
        }
        
-       // ###################################################################
        /**
-       * Verify field: not a zero value
-       */
+        * Verify field: not a zero value
+        */
        protected function _verifyIsNotZero($field)
        {
                if ($this->values[$field] == 0)
@@ -467,10 +455,9 @@ abstract class BSApi
                return true;
        }
        
-       // ###################################################################
        /**
-       * Verify field: not empty
-       */
+        * Verify field: not empty
+        */
        protected function _verifyIsNotEmpty($field)
        {
                if (empty($this->values[$field]))
@@ -482,10 +469,9 @@ abstract class BSApi
                return true;
        }
        
-       // ###################################################################
        /**
-       * Verify field: unique
-       */
+        * Verify field: unique
+        */
        protected function _verifyIsNotUnique($field)
        {
                $res = BSApp::$db->queryFirst("SELECT $field FROM {$this->prefix}{$this->table} WHERE $field = " . $this->_prepareFieldForSql($field) . (empty($this->condition) ? "" : " AND !({$this->condition})"));
@@ -518,7 +504,6 @@ class ApiException extends Exception
         */
        private $exceptions = array();
        
-       // ###################################################################
        /**
         * Constructor
         */
@@ -527,7 +512,6 @@ class ApiException extends Exception
                parent::__construct(_('An error occurred while processing the API data.'));
        }
        
-       // ###################################################################
        /**
         * Adds an exception to the collection
         *
@@ -538,7 +522,6 @@ class ApiException extends Exception
                $this->exceptions[] = $e;
        }
        
-       // ###################################################################
        /**
         * Returns an array of all the exceptions in the collection
         *
@@ -557,7 +540,6 @@ class ApiException extends Exception
  *
  * @author             rsesek
  * @copyright  Copyright (c)2005 - 2008, Blue Static
- * @version            $Id$
  * @package            ISSO
  *
  */
@@ -569,7 +551,6 @@ class FieldException extends Exception
         */
        private $field;
        
-       // ###################################################################
        /**
         * Constructor: create a new exception
         */
@@ -579,7 +560,6 @@ class FieldException extends Exception
                parent::__construct($error);
        }
        
-       // ###################################################################
        /**
         * Returns the name of the field the exception is for
         *
diff --git a/App.php b/App.php
index bfbfb25f8e002df6158d4a1f21ebd78a3f954ff1..7318fcc6de8875870162985b8c1bf12248373e39 100644 (file)
--- a/App.php
+++ b/App.php
 \*=====================================================================*/
 
 /**
-* ISSO Application Root (App.php)
-*
-* @package     ISSO
-*/
+ * ISSO Application Root (App.php)
+ *
+ * @package    ISSO
+ */
 
 // we need PHP 5.2.0 to run
 if (!function_exists('array_fill_keys'))
@@ -54,30 +54,30 @@ if ((bool)ini_get('register_globals') === true)
 require_once(ISSO . '/Functions.php');
 
 /**
-* Application Class
-*
-* This is an ISSO application class. It holds all of the ISSO system variables as well
-* as serving as an object registry that is avaliable in the global scope to prevent
-* globalization of variables. There can only be one instance of this existing
-* at any given time.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * Application Class
+ *
+ * This is an ISSO application class. It holds all of the ISSO system variables as well
+ * as serving as an object registry that is avaliable in the global scope to prevent
+ * globalization of variables. There can only be one instance of this existing
+ * at any given time.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 class BSApp
 {
        /**
-       * Debug mode?
-       * @var  bool
-       */
+        * Debug mode?
+        * @var bool
+        */
        private static $debug = false;
        
        /**
-       * An array of debug messages
-       * @var  array
-       */
+        * An array of debug messages
+        * @var array
+        */
        private static $debugInfo = array();
        
        /**
@@ -86,35 +86,32 @@ class BSApp
        private function __construct()
        {}
        
-       // ###################################################################
        /**
-       * Sets the debug state
-       *
-       * @param        bool    Debug mode on?
-       */
+        * Sets the debug state
+        *
+        * @param       bool    Debug mode on?
+        */
        public static function set_debug($debug)
        {
                self::$debug = $debug;
        }
        
-       // ###################################################################
        /**
-       * Gets the debug mode state
-       *
-       * @return       bool    Debug mode on?
-       */
+        * Gets the debug mode state
+        *
+        * @return      bool    Debug mode on?
+        */
        public static function get_debug()
        {
                return self::$debug;
        }
        
-       // ###################################################################
        /**
-       * Adds a debug message to the array. This only works when debug mode
-       * is enabled.
-       *
-       * @param        string  Debug message
-       */
+        * Adds a debug message to the array. This only works when debug mode
+        * is enabled.
+        *
+        * @param       string  Debug message
+        */
        public static function debug($msg)
        {
                if (self::$debug)
@@ -123,12 +120,11 @@ class BSApp
                }
        }
        
-       // ###################################################################
        /**
-       * Returns a <select> menu of all the debug notices
-       *
-       * @return       string  Debug list
-       */
+        * Returns a <select> menu of all the debug notices
+        *
+        * @return      string  Debug list
+        */
        public static function get_debug_list()
        {
                $output = '<select><option>Debug Notices (' . sizeof(self::$debugInfo) . ')</option>';
index 5761b03eaa6e51f3d495b7601ac870ffa823494c..76e26965805e6a3f3c46b204347fd8fb1e54e944 100644 (file)
--- a/Date.php
+++ b/Date.php
 \*=====================================================================*/
 
 /**
-* Date formatting system (Date.php)
-*
-* @package     ISSO
-*/
+ * Date formatting system (Date.php)
+ *
+ * @package    ISSO
+ */
 
 /**
-* Defined constant time
-*/
+ * Defined constant time
+ */
 define('TIMENOW', time());
 
 /**
-* Date Formatting System
-*
-* This framework wraps date and time functions into one neat little
-* package that takes care of modifying timestamps to meet the right
-* time zone
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * Date Formatting System
+ *
+ * This framework wraps date and time functions into one neat little
+ * package that takes care of modifying timestamps to meet the right
+ * time zone
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 class BSDate
 {
        /**
-       * Offset in seconds; this is set using fetch_offset()
-       * @var  integer
-       */
+        * Offset in seconds; this is set using fetch_offset()
+        * @var integer
+        */
        private $offset = 0;
        
-       // ###################################################################
        /**
-       * Sets the user time zone and then calculates the total offset
-       *
-       * @param        float   User time zone
-       */
+        * Sets the user time zone and then calculates the total offset
+        *
+        * @param       float   User time zone
+        */
        public function setUserTimeZone($usertz)
        {
                $this->offset = $usertz * 3600;
        }
        
-       // ###################################################################
        /**
-       * Formats a UNIX timestamp to a certain date format in the proper time
-       * zone
-       *
-       * @param        string  Format of the date (same as PHP's date() function)
-       * @param        integer UNIX timestamp to format
-       * @param        bool    Adjust the date to the user's language?
-       *
-       * @return       string  Formatted date
-       */
+        * Formats a UNIX timestamp to a certain date format in the proper time
+        * zone
+        *
+        * @param       string  Format of the date (same as PHP's date() function)
+        * @param       integer UNIX timestamp to format
+        * @param       bool    Adjust the date to the user's language?
+        *
+        * @return      string  Formatted date
+        */
        public function format($format, $timestamp = TIMENOW, $adjust = true)
        {
                if ($adjust)
@@ -81,12 +79,11 @@ class BSDate
                return gmdate($format, $timestamp);
        }
        
-       // ###################################################################
        /**
-       * Fetches an array of timezone names indexed by their offset
-       *
-       * @return       array   List of timezones
-       */
+        * Fetches an array of timezone names indexed by their offset
+        *
+        * @return      array   List of timezones
+        */
        public static function fetch_timezone_list()
        {
                $opt = array();
diff --git a/Db.php b/Db.php
index 0457a0d93dbe684943a4e88ec1a90abeb6f28f58..57dc5e60ac23901d866645bf40a4e9f625a0a512 100644 (file)
--- a/Db.php
+++ b/Db.php
 \*=====================================================================*/
 
 /**
-* Abstract Database Layer (Db.php)
-*
-* @package     ISSO
-*/
+ * Abstract Database Layer (Db.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/Functions.php');
 
 /**
-* Abstract Database Layer
-*
-* This class provides an abstract template for all RDBMS layers. All
-* ISSO abstraction layers should inherit this class. It provides error
-* reporting, SQL analysis, and general connection functionality.
-*
-* Constants:
-             ISSO_SHOW_QUERIES_LIVE - Show queries in page output as they are sent
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * Abstract Database Layer
+ *
+ * This class provides an abstract template for all RDBMS layers. All
+ * ISSO abstraction layers should inherit this class. It provides error
+ * reporting, SQL analysis, and general connection functionality.
+ *
+ * Constants:
+ *             ISSO_SHOW_QUERIES_LIVE - Show queries in page output as they are sent
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 abstract class BSDb
 {
        /**
-       * Determines whether or not errors should be shown
-       * @var  bool
-       */
+        * Determines whether or not errors should be shown
+        * @var bool
+        */
        public $showerrors = true;
        
        /**
-       * Current error number
-       * @var  integer
-       */
+        * Current error number
+        * @var integer
+        */
        protected $errnum = 0;
        
        /**
-       * Description of current error
-       * @var  string
-       */
+        * Description of current error
+        * @var string
+        */
        protected $errstr = '';
        
        /**
-       * Currend open database connection
-       * @var  integer
-       */
+        * Currend open database connection
+        * @var integer
+        */
        protected $dblink = null;
        
        /**
-       * Current query ID
-       * @var  integer
-       */
+        * Current query ID
+        * @var integer
+        */
        protected $result = null;
        
        /**
-       * Current query string
-       * @var  string
-       */
+        * Current query string
+        * @var string
+        */
        protected $querystr = '';
        
        /**
-       * History of all executed queryies
-       * @var  array
-       */
+        * History of all executed queryies
+        * @var array
+        */
        protected $history = array();
        
-       // ###################################################################
        /**
-       * Returns the history information array
-       *
-       * @return       array   History record
-       */
+        * Returns the history information array
+        *
+        * @return      array   History record
+        */
        public function getHistory()
        {
                return $this->history;
        }
        
-       // ###################################################################
-       /**
-       * Connect to a the specified database
-       *
-       * @param        string  Server name
-       * @param        string  User name
-       * @param        string  Password
-       * @param        string  Database name
-       *
-       * @return       bool    Result of connect
-       */
+       /**
+        * Connect to a the specified database
+        *
+        * @param       string  Server name
+        * @param       string  User name
+        * @param       string  Password
+        * @param       string  Database name
+        *
+        * @return      bool    Result of connect
+        */
        public function connect($server, $user, $password, $database)
        {
                if ($this->dblink == false)
@@ -125,26 +123,25 @@ abstract class BSDb
        }
        
        /**
-       * Abstract function that returns a database link after establishing a connection. This just
-       * calls the function and does not do any checking
-       *
-       * @param        string  Server name
-       * @param        string  User name
-       * @param        string  Password
-       * @param        string  Database name
-       *
-       * @return       integer Database link
-       */
+        * Abstract function that returns a database link after establishing a connection. This just
+        * calls the function and does not do any checking
+        *
+        * @param       string  Server name
+        * @param       string  User name
+        * @param       string  Password
+        * @param       string  Database name
+        *
+        * @return      integer Database link
+        */
        protected abstract function _connect($server, $user, $password, $database);
        
-       // ###################################################################
        /**
-       * Send a query to the open database link
-       *
-       * @param        string  Query string
-       *
-       * @return       BSDbResult      Result object, or NULL
-       */
+        * Send a query to the open database link
+        *
+        * @param       string  Query string
+        *
+        * @return      BSDbResult      Result object, or NULL
+        */
        public function query($string)
        {
                $time = microtime();
@@ -175,89 +172,85 @@ abstract class BSDb
        }
        
        /**
-       * Abstract function that executes the query command on the database
-       *
-       * @param        string  Query string
-       *
-       * @return       integer Result ID
-       */
+        * Abstract function that executes the query command on the database
+        *
+        * @param       string  Query string
+        *
+        * @return      integer Result ID
+        */
        protected abstract function _query($query);
        
-       // ###################################################################
        /**
-       * Escape a string (depending on character set, if supported)
-       *
-       * @param        string  String to be escaped
-       *
-       * @return       string  Escaped string
-       */
+        * Escape a string (depending on character set, if supported)
+        *
+        * @param       string  String to be escaped
+        *
+        * @return      string  Escaped string
+        */
        public function escapeString($string)
        {
                return $this->_escapeString($string);
        }
        
        /**
-       * Abstract function that calls the escape_string() method
-       *
-       * @param        string  String to escape
-       *
-       * @return       string  Escaped string
-       */
+        * Abstract function that calls the escape_string() method
+        *
+        * @param       string  String to escape
+        *
+        * @return      string  Escaped string
+        */
        protected abstract function _escapeString($string);
        
-       // ###################################################################
        /**
-       * Escapes a binary string for insertion into the database
-       *
-       * @param        string  Unescaped data
-       *
-       * @return       string  Escaped binary data
-       */
+        * Escapes a binary string for insertion into the database
+        *
+        * @param       string  Unescaped data
+        *
+        * @return      string  Escaped binary data
+        */
        public function escapeBinary($binary)
        {
                return $this->_escapeBinary($binary);
        }
        
        /**
-       * Abstract function that calls escape_binary()
-       *
-       * @param        string  Binary to escape
-       *
-       * @return       string  Escaped binary
-       */
+        * Abstract function that calls escape_binary()
+        *
+        * @param       string  Binary to escape
+        *
+        * @return      string  Escaped binary
+        */
        protected abstract function _escapeBinary($string);
        
-       // ###################################################################
        /**
-       * Unescapes a binary string that was fetched from the database
-       *
-       * @param        string  Escaped data
-       *
-       * @return       string  Unescaped binary data
-       */
+        * Unescapes a binary string that was fetched from the database
+        *
+        * @param       string  Escaped data
+        *
+        * @return      string  Unescaped binary data
+        */
        public function unescapeBinary($binary)
        {
                return $this->_unescapeBinary($binary);
        }
        
        /**
-       * Abstract function that calls unescape_binary()
-       *
-       * @param        string  Escaped data
-       *
-       * @return       string  Data that has been unescaped
-       */
+        * Abstract function that calls unescape_binary()
+        *
+        * @param       string  Escaped data
+        *
+        * @return      string  Data that has been unescaped
+        */
        protected abstract function _unescapeBinary($string);
        
-       // ###################################################################
        /**
-       * Send a query and return the first row of the results
-       *
-       * @param        string  Query string
-       * @param        string  Result return function (in the database layer)
-       *
-       * @return       mixed   Results in variable formats
-       */
+        * Send a query and return the first row of the results
+        *
+        * @param       string  Query string
+        * @param       string  Result return function (in the database layer)
+        *
+        * @return      mixed   Results in variable formats
+        */
        public function queryFirst($string, $callback = 'fetchArray')
        {
                $resource = $this->query($string);
@@ -273,79 +266,73 @@ abstract class BSDb
                }
        }
        
-       // ###################################################################
        /**
-       * Returns the errror number
-       */
+        * Returns the errror number
+        */
        public abstract function _errorNumber();
        
        /**
-       * Returns the error string
-       */
+        * Returns the error string
+        */
        public abstract function _errorString();
        
-       // ###################################################################
        /**
-       * Fetch the unique ID of the record just inserted
-       *
-       * @return       integer Insert-ID
-       */
+        * Fetch the unique ID of the record just inserted
+        *
+        * @return      integer Insert-ID
+        */
        public function insertId()
        {
                return $this->_insertID();
        }
        
        /**
-       * Abstract function that returns the ID of the most recently-inserted
-       * record
-       *
-       * @return       integer Insertion ID
-       */
+        * Abstract function that returns the ID of the most recently-inserted
+        * record
+        *
+        * @return      integer Insertion ID
+        */
        protected abstract function _insertId();
        
-       // ###################################################################
        /**
-       * Fetch the number of rows affected by the query
-       *
-       * @param        integer Result
-       *
-       * @return       integer Number of affected rows
-       */
+        * Fetch the number of rows affected by the query
+        *
+        * @param       integer Result
+        *
+        * @return      integer Number of affected rows
+        */
        public function affectedRows()
        {
                return $this->_affectedRows($this->result);
        }
        
        /**
-       * Abstract function that returns the number of affected rows in the result
-       *
-       * @param        integer Result ID
-       *
-       * @return       integer Number of rows
-       */
+        * Abstract function that returns the number of affected rows in the result
+        *
+        * @param       integer Result ID
+        *
+        * @return      integer Number of rows
+        */
        protected abstract function _affectedRows($result);
        
-       // ###################################################################
        /**
-       * Sends the command to start a transaction. This command should never
-       * be reached as it's always overridden
-       */
+        * Sends the command to start a transaction. This command should never
+        * be reached as it's always overridden
+        */
        public abstract function begin();
        
-       // ###################################################################
        /**
-       * Sends the command to rollback to a given savepoint. This command
-       * should never be reached as it's always overridden
-       *
-       * @param        string  Named savepoint
-       */
+        * Sends the command to rollback to a given savepoint. This command
+        * should never be reached as it's always overridden
+        *
+        * @param       string  Named savepoint
+        */
        public abstract function rollback();
        
-       // ###################################################################
        /**
-       * Sends the command to commit the entire transaction. This command
-       * should never be reached as it's always overridden
-       */
+        * Sends the command to commit the entire transaction. This command
+        * should never be reached as it's always overridden
+        */
        public abstract function commit();
 }
 
@@ -367,7 +354,6 @@ abstract class BSDbResult
         */
        private $result;
        
-       // ###################################################################
        /**
         * Sets the resource and returns a result object
         *
@@ -378,98 +364,94 @@ abstract class BSDbResult
                $this->result = $result;
        }
        
-       // ###################################################################
        /**
-       * Fetch the query result as an array
-       *
-       * @param        integer Result
-       * @param        bool    Return an associative array?
-       *
-       * @return       array   A row of the query result
-       */
+        * Fetch the query result as an array
+        *
+        * @param       integer Result
+        * @param       bool    Return an associative array?
+        *
+        * @return      array   A row of the query result
+        */
        public function fetchArray($assoc = true)
        {
                return $this->{($assoc ? '_fetchAssocArray' : '_fetchRowArray')}($this->result);
        }
        
        /**
-       * Abstract function that returns an associative array of given result
-       *
-       * @param        integer Result
-       *
-       * @return       array   Result array
-       */
+        * Abstract function that returns an associative array of given result
+        *
+        * @param       integer Result
+        *
+        * @return      array   Result array
+        */
        protected abstract function _fetchAssocArray($result);
        
        /**
-       * Abstract function that returns a row array of given result
-       *
-       * @param        integer Result
-       *
-       * @return       array   Result array
-       */
+        * Abstract function that returns a row array of given result
+        *
+        * @param       integer Result
+        *
+        * @return      array   Result array
+        */
        protected abstract function _fetchRowArray($result);
        
-       // ###################################################################
        /**
-       * Fetch the query result as an object
-       *
-       * @param        integer Result
-       *
-       * @return       object  An object with the query result
-       */
+        * Fetch the query result as an object
+        *
+        * @param       integer Result
+        *
+        * @return      object  An object with the query result
+        */
        public function fetchObject()
        {
                return $this->_fetchObject($this->result);
        }
        
        /**
-       * Abstract function that returns an object for a given result
-       *
-       * @param        integer Result
-       *
-       * @return       object  Row object
-       */
+        * Abstract function that returns an object for a given result
+        *
+        * @param       integer Result
+        *
+        * @return      object  Row object
+        */
        public abstract function _fetchObject($result);
        
-       // ###################################################################
        /**
-       * Free the current query result
-       *
-       * @param        integer Result
-       */
+        * Free the current query result
+        *
+        * @param       integer Result
+        */
        public function free()
        {
                $this->_freeResult($this->result);
        }
        
        /**
-       * Abstract function that frees a given result
-       *
-       * @param        integer Result ID
-       */
+        * Abstract function that frees a given result
+        *
+        * @param       integer Result ID
+        */
        protected abstract function _freeResult($result);
        
-       // ###################################################################
        /**
-       * Fetch the number of rows in the result
-       *
-       * @param        integer Result
-       *
-       * @return       integer Number of rows
-       */
+        * Fetch the number of rows in the result
+        *
+        * @param       integer Result
+        *
+        * @return      integer Number of rows
+        */
        public function size()
        {
                return $this->_numRows($this->result);
        }
        
        /**
-       * Abstract function that returns the number of rows in the result
-       *
-       * @param        integer Result ID
-       *
-       * @return       integer Number of rows
-       */
+        * Abstract function that returns the number of rows in the result
+        *
+        * @param       integer Result ID
+        *
+        * @return      integer Number of rows
+        */
        protected abstract function _numRows($result);
 }
 
@@ -491,7 +473,6 @@ class BSDbException extends Exception
         */
        private $query;
        
-       // ###################################################################
        /**
         * Initializes a new database exception
         * 
@@ -505,7 +486,6 @@ class BSDbException extends Exception
                parent::__construct($error, $errorNum);
        }
        
-       // ###################################################################
        /**
         * Returns the query that failed
         *
index 0319bcfea10aa435a52781d07d3d925ec583aa86..13d693eef4524768f8f2ec3ce31f5cef77a3fe9c 100644 (file)
 \*=====================================================================*/
 
 /**
-* MySQL Database Layer (DbMySql.php)
-*
-* @package     ISSO
-*/
+ * MySQL Database Layer (DbMySql.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/Db.php');
 
 /**
-* MySQL Database Layer
-*
-* This framework is a function wrapper for MySQL functions so we can have
-* better error reporting and query reporting.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * MySQL Database Layer
+ *
+ * This framework is a function wrapper for MySQL functions so we can have
+ * better error reporting and query reporting.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 class BSDbMySql extends BSDb
 {
-       // ###################################################################
        /**
-       * Wrapper: mysql_connect
-       */
+        * Wrapper: mysql_connect
+        */
        protected function _connect($server, $user, $password, $database)
        {
                $link = @mysql_connect($server, $user, $password, true);
@@ -55,13 +54,12 @@ class BSDbMySql extends BSDb
                return $link;
        }
 
-       // ###################################################################
        /**
-       * Opens a connection to the specified database name
-       *
-       * @param        string  Database name
-       * @param        integer DB-Link
-       */
+        * Opens a connection to the specified database name
+        *
+        * @param       string  Database name
+        * @param       integer DB-Link
+        */
        private function _selectDb($database, $link)
        {
                if (!mysql_select_db($database, $link))
@@ -70,28 +68,25 @@ class BSDbMySql extends BSDb
                }
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_query
-       */
+        * Wrapper: mysql_query
+        */
        protected function _query($string)
        {
                return mysql_query($string, $this->dblink);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_escape_string
-       */
+        * Wrapper: mysql_escape_string
+        */
        protected function _escapeBinary($binary)
        {
                return mysql_escape_string($binary);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql(_real)_escape_string
-       */
+        * Wrapper: mysql(_real)_escape_string
+        */
        protected function _escapeString($string)
        {
                if (function_exists('mysql_real_escape_string'))
@@ -104,77 +99,69 @@ class BSDbMySql extends BSDb
                }
        }
        
-       // ###################################################################
        /**
-       * Not supported: unescape binary string
-       */
+        * Not supported: unescape binary string
+        */
        protected function _unescapeBinary($string)
        {
                return $string;
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_insert_id
-       */
+        * Wrapper: mysql_insert_id
+        */
        protected function _insertId()
        {
                return mysql_insert_id($this->dblink);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_affected_rows
-       */
+        * Wrapper: mysql_affected_rows
+        */
        protected function _affectedRows($result)
        {
                return mysql_affected_rows($this->dblink);
        }
        
-       // ###################################################################
        /**
-       * Starts a database transaction
-       */
+        * Starts a database transaction
+        */
        public function begin()
        {
                $this->query("BEGIN WORK");
        }
        
-       // ###################################################################
        /**
-       * Reverts a transaction back to a given savepoint
-       */
+        * Reverts a transaction back to a given savepoint
+        */
        public function rollback()
        {
                $this->query("ROLLBACK");
        }
        
-       // ###################################################################
        /**
-       * Commits a database transaction
-       */
+        * Commits a database transaction
+        */
        public function commit()
        {
                $this->query("COMMIT");
        }
        
-       // ###################################################################
        /**
-       * Returns the error number
-       *
-       * @return       integer Error number
-       */
+        * Returns the error number
+        *
+        * @return      integer Error number
+        */
        public function _errorNumber()
        {
                return mysql_errno($this->dblink);
        }
        
-       // ###################################################################
        /**
-       * Returns the error string
-       *
-       * @return       string  Error string
-       */
+        * Returns the error string
+        *
+        * @return      string  Error string
+        */
        public function _errorString()
        {
                return mysql_error($this->dblink);
@@ -193,46 +180,41 @@ class BSDbMySql extends BSDb
  */
 class BSDbMySqlResult extends BSDbResult
 {
-       // ###################################################################
        /**
-       * Wrapper: mysql_fetch_assoc
-       */
+        * Wrapper: mysql_fetch_assoc
+        */
        protected function _fetchAssocArray($result)
        {
                return mysql_fetch_assoc($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_fetch_row
-       */
+        * Wrapper: mysql_fetch_row
+        */
        protected function _fetchRowArray($result)
        {
                return mysql_fetch_row($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_fetch_object
-       */
+        * Wrapper: mysql_fetch_object
+        */
        public function _fetchObject($result)
        {
                return mysql_fetch_object($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_free_result
-       */
+        * Wrapper: mysql_free_result
+        */
        protected function _freeResult($result)
        {
                mysql_free_result($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_num_rows
-       */
+        * Wrapper: mysql_num_rows
+        */
        protected function _numRows($result)
        {
                return mysql_num_rows($result);
index 11f171b30a834db42b9266cb53748b3d867f4be4..3c5015f69426d291baa2ed7a4fb692704661a22f 100644 (file)
 \*=====================================================================*/
 
 /**
-* MySQLi Database Layer (DbMySqlI.php)
-*
-* @package     ISSO
-*/
+ * MySQLi Database Layer (DbMySqlI.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/Db.php');
 
 /**
-* MySQLi Database Layer
-*
-* This framework is a function wrapper for MySQLi functions so we can have
-* better error reporting and query reporting.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * MySQLi Database Layer
+ *
+ * This framework is a function wrapper for MySQLi functions so we can have
+ * better error reporting and query reporting.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 class BSDbMySqlI extends BSDb
 {
-       // ###################################################################
        /**
-       * Wrapper: mysql_connect
-       */
+        * Wrapper: mysql_connect
+        */
        protected function _connect($server, $user, $password, $database)
        {
                return @mysqli_connect($server, $user, $password, $database);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_query
-       */
+        * Wrapper: mysql_query
+        */
        protected function _query($string)
        {
                return mysqli_query($this->dblink, $string);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_escape_string
-       */
+        * Wrapper: mysql_escape_string
+        */
        protected function _escapeBinary($binary)
        {
                return mysqli_real_escape_string($this->dblink, $binary);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql(_real)_escape_string
-       */
+        * Wrapper: mysql(_real)_escape_string
+        */
        protected function _escapeString($string)
        {
                return mysqli_real_escape_string($this->dblink, $string);
        }
        
-       // ###################################################################
        /**
-       * Not supported: unescape binary string
-       */
+        * Not supported: unescape binary string
+        */
        protected function _unescapeBinary($string)
        {
                return $string;
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_insert_id
-       */
+        * Wrapper: mysql_insert_id
+        */
        protected function _insertId()
        {
                return mysqli_insert_id($this->dblink);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_affected_rows
-       */
+        * Wrapper: mysql_affected_rows
+        */
        protected function _affectedRows($result)
        {
                return mysqli_affected_rows($this->dblink);
        }
        
-       // ###################################################################
        /**
-       * Starts a database transaction
-       */
+        * Starts a database transaction
+        */
        public function begin()
        {
                $this->query("START TRANSACTION");
        }
        
-       // ###################################################################
        /**
-       * Reverts a transaction back to a given savepoint
-       */
+        * Reverts a transaction back to a given savepoint
+        */
        public function rollback()
        {
                $this->query("ROLLBACK");
        }
        
-       // ###################################################################
        /**
-       * Commits a database transaction
-       */
+        * Commits a database transaction
+        */
        public function commit()
        {
                $this->query("COMMIT");
        }
        
-       // ###################################################################
        /**
-       * Returns the error number
-       *
-       * @return       integer Error number
-       */
+        * Returns the error number
+        *
+        * @return      integer Error number
+        */
        public function _errorNumber()
        {
                return mysqli_errno($this->dblink);
        }
        
-       // ###################################################################
        /**
-       * Returns the error string
-       *
-       * @return       string  Error string
-       */
+        * Returns the error string
+        *
+        * @return      string  Error string
+        */
        public function _errorString()
        {
                return mysqli_error($this->dblink);
@@ -165,46 +153,41 @@ class BSDbMySqlI extends BSDb
  */
 class BSDbMySqlIResult extends BSDbResult
 {
-       // ###################################################################
        /**
-       * Wrapper: mysql_fetch_assoc
-       */
+        * Wrapper: mysql_fetch_assoc
+        */
        protected function _fetchAssocArray($result)
        {
                return mysqli_fetch_assoc($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_fetch_row
-       */
+        * Wrapper: mysql_fetch_row
+        */
        protected function _fetchRowArray($result)
        {
                return mysqli_fetch_row($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_fetch_object
-       */
+        * Wrapper: mysql_fetch_object
+        */
        public function _fetchObject($result)
        {
                return mysqli_fetch_object($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_free_result
-       */
+        * Wrapper: mysql_free_result
+        */
        protected function _freeResult($result)
        {
                mysqli_free_result($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: mysql_num_rows
-       */
+        * Wrapper: mysql_num_rows
+        */
        protected function _numRows($result)
        {
                return mysqli_num_rows($result);
index 75fc4b89f93212b908d8fe16b7a606680f462e8f..2d707a4bae17dff9fd32dc41caa16467511d15c3 100644 (file)
 \*=====================================================================*/
 
 /**
-* PostgreSQL Database Layer (DbPostgreSql.php)
-*
-* @package     ISSO
-*/
+ * PostgreSQL Database Layer (DbPostgreSql.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/Db.php');
 
 /**
-* PostgreSQL Database Layer
-*
-* This framework is a function wrapper for PostgreSQL functions so we can have
-* better error reporting and query reporting.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * PostgreSQL Database Layer
+ *
+ * This framework is a function wrapper for PostgreSQL functions so we can have
+ * better error reporting and query reporting.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 class BSDbPostgreSql extends BSDb
 {
        /**
-       * Port number to connect to
-       * @var  integer
-       */
+        * Port number to connect to
+        * @var integer
+        */
        private $port = 5432;
        
-       // ###################################################################
        /**
-       * Sets the port number for the connection
-       *
-       * @param        integer Port number
-       */
+        * Sets the port number for the connection
+        *
+        * @param       integer Port number
+        */
        public function setPort($port)
        {
                $this->port = $port;
        }
 
-       // ###################################################################
        /**
-       * Wrapper: pg_connect
-       */
+        * Wrapper: pg_connect
+        */
        protected function _connect($server, $user, $password, $database)
        {
                return pg_connect("host='$server' port={$this->port} user='$user' password='$password' dbname='$database'");
        }
        
-       // ###################################################################
        /**
-       * Wrapper: pg_escape_string
-       */
+        * Wrapper: pg_escape_string
+        */
        protected function _escapeString()
        {
                return pg_escape_string($string);
        }
        
-       // ###################################################################
        /**
-       * Wrapper/no support: error string
-       */
+        * Wrapper/no support: error string
+        */
        protected function _errorString()
        {
                if ($this->result)
@@ -89,19 +85,17 @@ class BSDbPostgreSql extends BSDb
                return pg_last_error($this->dblink);
        }
        
-       // ###################################################################
        /**
-       * Not supported: error numbers
-       */
+        * Not supported: error numbers
+        */
        protected function _errorNumber()
        {
                return -1;
        }
        
-       // ###################################################################
        /**
-       * Overload: insertId
-       */
+        * Overload: insertId
+        */
        public function insertId($table, $field)
        {
                return $this->queryFirst("SELECT last_value FROM {$table}_{$field}_seq")->fetchObject()->last_value;
@@ -110,59 +104,53 @@ class BSDbPostgreSql extends BSDb
        protected function _insertId()
        {}
        
-       // ###################################################################
        /**
-       * Wrapper: pg_affected_rows
-       */
+        * Wrapper: pg_affected_rows
+        */
        protected function _affectedRows($result)
        {
                return pg_affected_rows($result);
        }
        
-       // ###################################################################
        /**
-       * Starts a database transaction
-       */
+        * Starts a database transaction
+        */
        public function begin()
        {
                $this->query("BEGIN");
        }
 
-       // ###################################################################
        /**
-       * Reverts a transaction back to a given savepoint
-       */
+        * Reverts a transaction back to a given savepoint
+        */
        public function rollback()
        {
                $this->query("ROLLBACK");
        }
        
-       // ###################################################################
        /**
-       * Commits a database transaction
-       */
+        * Commits a database transaction
+        */
        public function commit()
        {
                $this->query("COMMIT");
        }
        
-       // ###################################################################
        /**
-       * Returns the error number
-       *
-       * @return       integer Error number
-       */
+        * Returns the error number
+        *
+        * @return      integer Error number
+        */
        public function _errorNumber()
        {
                return -1;
        }
        
-       // ###################################################################
        /**
-       * Returns the error string
-       *
-       * @return       string  Error string
-       */
+        * Returns the error string
+        *
+        * @return      string  Error string
+        */
        public function _errorString()
        {
                return pg_last_error($this->dblink);
@@ -181,46 +169,41 @@ class BSDbPostgreSql extends BSDb
  */
 class BSDbPostgreSqlResult extends BSDbResult
 {      
-       // ###################################################################
        /**
-       * Wrapper: pg_fetch_assoc
-       */
+        * Wrapper: pg_fetch_assoc
+        */
        protected function _fetchAssocArray($result)
        {
                return pg_fetch_assoc($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: pg_fetch_row
-       */
+        * Wrapper: pg_fetch_row
+        */
        protected function _fetchRowArray($result)
        {
                return pg_fetch_row($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: pg_fetch_object
-       */
+        * Wrapper: pg_fetch_object
+        */
        public function _fetchObject($result)
        {
                return pg_fetch_object($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: pg_free_result
-       */
+        * Wrapper: pg_free_result
+        */
        protected function _freeResult($result)
        {
                pg_free_result($result);
        }
        
-       // ###################################################################
        /**
-       * Wrapper: pg_num_rows
-       */
+        * Wrapper: pg_num_rows
+        */
        protected function _numRows($result)
        {
                return pg_num_rows($result);
index 18e19e8efd5ac4e91d4f22684b75003b4ce63bad..c93b35fc47fb01f3a3cf14444affafda1b615617 100644 (file)
 \*=====================================================================*/
 
 /**
-* Static functions (Functions.php)
-*
-* @package     ISSO
-*/
+ * Static functions (Functions.php)
+ *
+ * @package    ISSO
+ */
 
 /**
-* Functions
-*
-* This is a bunch of static functions. This class is singleton so it
-* can store data while remaining static.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * Functions
+ *
+ * This is a bunch of static functions. This class is singleton so it
+ * can store data while remaining static.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 class BSFunctions
 {
        /**
-       * Singleton instance
-       * @var  object
-       */
+        * Singleton instance
+        * @var object
+        */
        private static $instance;
        
        /**
-       * Cookie path
-       * @var  string
-       */
+        * Cookie path
+        * @var string
+        */
        private $cookiePath = '/';
        
        /**
-       * Cookie domain setting
-       * @var  string
-       */
+        * Cookie domain setting
+        * @var string
+        */
        private $cookieDomain = '';
        
        /**
-       * Cookie expiration time
-       * @var  integer
-       */
+        * Cookie expiration time
+        * @var integer
+        */
        private $cookieTimeout = 900;
        
        /**
-       * Current swapped CSS class
-       * @var  string
-       */
+        * Current swapped CSS class
+        * @var string
+        */
        public static $cssClass = '';
        
-       // ###################################################################
        /**
-       * Constructor
-       */
+        * Constructor
+        */
        private function __construct() {}
        
-       // ###################################################################
        /**
-       * Returns the shared instance for singleton
-       *
-       * @return       object  Shared instance
-       */
+        * Returns the shared instance for singleton
+        *
+        * @return      object  Shared instance
+        */
        private function _instance()
        {
                if (!self::$instance)
@@ -89,47 +87,43 @@ class BSFunctions
                return self::$instance;
        }
        
-       // ###################################################################
        /**
-       * Sets the cookie path
-       *
-       * @param        string  New path
-       */
+        * Sets the cookie path
+        *
+        * @param       string  New path
+        */
        public static function set_cookie_path($path)
        {
                self::_instance()->cookiePath = $path;
        }
        
-       // ###################################################################
        /**
-       * Sets the cookie domain setting
-       *
-       * @param        string  Cookie domain
-       */
+        * Sets the cookie domain setting
+        *
+        * @param       string  Cookie domain
+        */
        public static function set_cookie_domain($domain)
        {
                self::_instance()->cookieDomain = $domain;
        }
        
-       // ###################################################################
        /**
-       * Sets the cookie timeout
-       *
-       * @param        integer Cookie timeout
-       */
+        * Sets the cookie timeout
+        *
+        * @param       integer Cookie timeout
+        */
        public static function set_cookie_timeout($timeout)
        {
                self::_instance()->cookieTimeout = intval($timeout);
        }
        
-       // ###################################################################
        /**
-       * Sets a cookie in the user's computer/browing session
-       *
-       * @param        string  Name of the cookie
-       * @param        string  Value of the cookie, FALSE to clear
-       * @param        bool    Is the cookie permanent?
-       */
+        * Sets a cookie in the user's computer/browing session
+        *
+        * @param       string  Name of the cookie
+        * @param       string  Value of the cookie, FALSE to clear
+        * @param       bool    Is the cookie permanent?
+        */
        public static function cookie($name, $value, $sticky = true)
        {
                // expire the cookie
@@ -153,13 +147,12 @@ class BSFunctions
                }
        }
        
-       // ###################################################################
        /**
-       * Alternate between two CSS classes
-       *
-       * @param        string  First CSS class name
-       * @param        string  Second CSS class name
-       */
+        * Alternate between two CSS classes
+        *
+        * @param       string  First CSS class name
+        * @param       string  Second CSS class name
+        */
        public static function swap_css_classes($class1 = 'alt1', $class2 = 'alt2')
        {
                static $count;
@@ -168,16 +161,15 @@ class BSFunctions
                $count++;
        }
        
-       // ###################################################################
        /**
-       * Returns the 'source path' version of a file path. It adds a
-       * directory separator to the end of a string if it does not already
-       * exist.
-       *
-       * @param        string  Path
-       *
-       * @return       string  Path with directory separator ending
-       */
+        * Returns the 'source path' version of a file path. It adds a
+        * directory separator to the end of a string if it does not already
+        * exist.
+        *
+        * @param       string  Path
+        *
+        * @return      string  Path with directory separator ending
+        */
        public static function fetch_source_path($source)
        {
                if (substr($source, strlen($source) - 1) != DIRECTORY_SEPARATOR)
@@ -187,14 +179,13 @@ class BSFunctions
                return $source;
        }
        
-       // ###################################################################
        /**
-       * Force-download a file by sending application/octetstream
-       *
-       * @param        string  The text of the file to be streamed
-       * @param        string  File name of the new file
-       * @param        bool    Whether or not to die after stringeaming the file
-       */
+        * Force-download a file by sending application/octetstream
+        *
+        * @param       string  The text of the file to be streamed
+        * @param       string  File name of the new file
+        * @param       bool    Whether or not to die after stringeaming the file
+        */
        public static function download_file($file, $name, $exit = true)
        {
                header("Content-Type: application/octetstream");
@@ -213,14 +204,13 @@ class BSFunctions
                }
        }
        
-       // ###################################################################
        /**
-       * Verify that an email address is valid via regex
-       *
-       * @param        string  An email address
-       *
-       * @return       bool    Validity of the email address
-       */
+        * Verify that an email address is valid via regex
+        *
+        * @param       string  An email address
+        *
+        * @return      bool    Validity of the email address
+        */
        public static function is_valid_email($email)
        {
                if (preg_match('#^[a-z0-9\.\-\+_]+?@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}$#i', $email))
@@ -233,15 +223,14 @@ class BSFunctions
                }
        }
        
-       // ###################################################################
        /**
-       * Generates a random string of random length (unless otherwise
-       * specified)
-       *
-       * @param        integer Optional length
-       *
-       * @return       string  A random string
-       */
+        * Generates a random string of random length (unless otherwise
+        * specified)
+        *
+        * @param       integer Optional length
+        *
+        * @return      string  A random string
+        */
        public static function random($length = 0)
        {
                // length wasn't provided, so create our own
@@ -271,16 +260,15 @@ class BSFunctions
                return $string;
        }
        
-       // ###################################################################
        /**
-       * Sets the current array position to be the specified key. This
-       * function should be avoided on large arrays.
-       *
-       * @param        array   The array whose counter is to be updated
-       * @param        mixed   The key of the element of the array that the counter is to be set to
-       *
-       * @return       mixed   Return the elelment of the array that we just put the counter to
-       */
+        * Sets the current array position to be the specified key. This
+        * function should be avoided on large arrays.
+        *
+        * @param       array   The array whose counter is to be updated
+        * @param       mixed   The key of the element of the array that the counter is to be set to
+        *
+        * @return      mixed   Return the elelment of the array that we just put the counter to
+        */
        public static function array_set_current(&$array, $key)
        {
                reset($array);
@@ -295,15 +283,14 @@ class BSFunctions
                return current($array);
        }
        
-       // ###################################################################
        /**
-       * Calculates the microtime difference by taking a given microtime and
-       * subtracting it from the current one
-       *
-       * @param        string  The start microtime
-       *
-       * @return       float   Microtime difference
-       */
+        * Calculates the microtime difference by taking a given microtime and
+        * subtracting it from the current one
+        *
+        * @param       string  The start microtime
+        *
+        * @return      float   Microtime difference
+        */
        public static function fetch_microtime_diff($mtstart)
        {
                $mtend = microtime();
@@ -312,15 +299,14 @@ class BSFunctions
                return ($endMicro + $endSec) - ($startMicro + $startSec);
        }
        
-       // ###################################################################
        /**
-       * Fetches the extension of a file by extracting everything after the
-       * last period
-       *
-       * @param        string  Filename
-       *
-       * @return       string  The extension for the specifid file name
-       */
+        * Fetches the extension of a file by extracting everything after the
+        * last period
+        *
+        * @param       string  Filename
+        *
+        * @return      string  The extension for the specifid file name
+        */
        public static function fetch_extension($filename)
        {
                $array = explode('.', $filename);
@@ -333,14 +319,13 @@ class BSFunctions
                return strval(end($array));
        }
        
-       // ###################################################################
        /**
-       * Gets the maximum file size for attachment uploading, as specified by
-       * PHP. If no value is present, 10 MB (represented in bytes) is
-       * returned.
-       *
-       * @return       integer The maximum file upload size in bytes
-       */
+        * Gets the maximum file size for attachment uploading, as specified by
+        * PHP. If no value is present, 10 MB (represented in bytes) is
+        * returned.
+        *
+        * @return      integer The maximum file upload size in bytes
+        */
        public static function fetch_max_php_file_size()
        {
                if ($size = @ini_get('upload_max_filesize'))
@@ -360,34 +345,32 @@ class BSFunctions
                }
        }
        
-       // ###################################################################
        /**
-       * Scans a specified directory path and returns an array of all the
-       * items in that directory. Directories found by this are end in a "/"
-       *
-       * @param        string  Path to scan
-       * @param        bool    Whether or not to recursively scan the directories encountered
-       * @param        bool    Ignore files beginning with a dot
-       *
-       * @return       array   A list of all the files in the specified path
-       */
+        * Scans a specified directory path and returns an array of all the
+        * items in that directory. Directories found by this are end in a "/"
+        *
+        * @param       string  Path to scan
+        * @param       bool    Whether or not to recursively scan the directories encountered
+        * @param       bool    Ignore files beginning with a dot
+        *
+        * @return      array   A list of all the files in the specified path
+        */
        public static function scan_directory($path, $recurse = true, $ignoreDot = true)
        {
                return self::_help_scan_directory($path, $recurse, $ignoreDot, '');
        }
        
-       // ###################################################################
        /**
-       * Scans a specified directory path and returns an array of all the
-       * items in that directory. Directories found by this are end in a "/"
-       *
-       * @param        string  Path to scan
-       * @param        bool    Whether or not to recursively scan the directories encountered
-       * @param        bool    Ignore files beginning with a dot
-       * @param        string  Add to the beginning of the path
-       *
-       * @return       array   A list of all the files in the specified path
-       */
+        * Scans a specified directory path and returns an array of all the
+        * items in that directory. Directories found by this are end in a "/"
+        *
+        * @param       string  Path to scan
+        * @param       bool    Whether or not to recursively scan the directories encountered
+        * @param       bool    Ignore files beginning with a dot
+        * @param       string  Add to the beginning of the path
+        *
+        * @return      array   A list of all the files in the specified path
+        */
        private static function _help_scan_directory($path, $recurse = true, $ignoreDot = true, $pathAdd = '')
        {
                $filelist = array();
@@ -414,15 +397,14 @@ class BSFunctions
                return $filelist;
        }
        
-       // ###################################################################
        /**
-       * Changes line breaks into one format
-       *
-       * @param        string  Text
-       * @param        string  New line break (default is UNIX \n format)
-       *
-       * @return       string  Text with one type of line break
-       */
+        * Changes line breaks into one format
+        *
+        * @param       string  Text
+        * @param       string  New line break (default is UNIX \n format)
+        *
+        * @return      string  Text with one type of line break
+        */
        public static function convert_line_breaks($text, $convert_to = "\n")
        {
                $text = trim($text);
@@ -431,15 +413,14 @@ class BSFunctions
                return $text;
        }
        
-       // ###################################################################
        /**
-       * Removes all empty() [by PHP's standards] elements in an array. This
-       * can be used in place of using PREG_SPLIT_NO_EMPTY.
-       *
-       * @param        array   An array to strip empties from
-       *
-       * @return       array   Full-valued array
-       */
+        * Removes all empty() [by PHP's standards] elements in an array. This
+        * can be used in place of using PREG_SPLIT_NO_EMPTY.
+        *
+        * @param       array   An array to strip empties from
+        *
+        * @return      array   Full-valued array
+        */
        public static function array_strip_empty($array)
        {
                foreach ($array as $key => $value)
@@ -456,19 +437,18 @@ class BSFunctions
                return $array;
        }
        
-       // ###################################################################
        /**
-       * A backtrace formatter.
-       *
-       * This is very slightly modified from PEAR/PHP_Compat (PHP license)
-       *
-       * @author       Laurent Laville <pear@laurent-laville.org>
-       * @author       Aidan Lister <aidan@php.net>
-       *
-       * @param        array   The backtrace from debug_backtrace() to format
-       *
-       * @return       string  Formatted output
-       */
+        * A backtrace formatter.
+        *
+        * This is very slightly modified from PEAR/PHP_Compat (PHP license)
+        *
+        * @author      Laurent Laville <pear@laurent-laville.org>
+        * @author      Aidan Lister <aidan@php.net>
+        *
+        * @param       array   The backtrace from debug_backtrace() to format
+        *
+        * @return      string  Formatted output
+        */
        public static function format_backtrace($backtrace)
        {
                // Unset call to debug_print_backtrace
@@ -521,18 +501,17 @@ class BSFunctions
                return implode("\n", $calls);
        }
        
-       // ###################################################################
        /**
-       * A variation of PHP's substr() method that takes in the start
-       * and end position of a string, rather than a start and length. This
-       * mimics Java's String.substring() method.
-       *
-       * @param        string  The string
-       * @param        integer Start position
-       * @param        integer End position
-       *
-       * @return       string  Part of a string
-       */
+        * A variation of PHP's substr() method that takes in the start
+        * and end position of a string, rather than a start and length. This
+        * mimics Java's String.substring() method.
+        *
+        * @param       string  The string
+        * @param       integer Start position
+        * @param       integer End position
+        *
+        * @return      string  Part of a string
+        */
        public static function substring($string, $start, $end)
        {
                return substr($string, $start, $end - $start);
index e34c28f2649e19164a3986561d525ffaf2503fdd..08873f924a4a040ad46b565895bb86ac72b9c0c8 100644 (file)
--- a/Input.php
+++ b/Input.php
 \*=====================================================================*/
 
 /**
-* Input sanitizer (Input.php)
-*
-* @package     ISSO
-*/
+ * Input sanitizer (Input.php)
+ *
+ * @package    ISSO
+ */
 
 /**#@+
-* Input cleaning type constant
-*/
+ * Input cleaning type constant
+ */
 /**
-* Integer type
-*/
+ * Integer type
+ */
 define('TYPE_INT', 1);
 
 /**
-* Unsigned integer
-*/
+ * Unsigned integer
+ */
 define('TYPE_UINT', 2);
 
 /**
-* Float type
-*/
+ * Float type
+ */
 define('TYPE_FLOAT', 4);
 
 /**
-* Boolean type
-*/
+ * Boolean type
+ */
 define('TYPE_BOOL', 8);
 
 /**
-* String - cleaned
-*/
+ * String - cleaned
+ */
 define('TYPE_STR', 16);
 
 /**
-* String - deliberate unclean
-*/
+ * String - deliberate unclean
+ */
 define('TYPE_STRUN', 32);
 
 /**
-* No cleaning - here for use in API
-*/
+ * No cleaning - here for use in API
+ */
 define('TYPE_NONE', 64);
 
 /**
-* Macro for using DB->escape_binary() without cleaning - used in API
-*/
+ * Macro for using DB->escape_binary() without cleaning - used in API
+ */
 define('TYPE_BIN', 128);
 /**#@-*/
 
 /**
-* Input Sanitizer
-*
-* This class is responsible for cleaning input.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * Input Sanitizer
+ *
+ * This class is responsible for cleaning input.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 class BSInput
 {
        /**
-       * An array of sanitized variables that have been cleaned for HTML tag openers and double quotes
-       * @var  array
-       */
+        * An array of sanitized variables that have been cleaned for HTML tag openers and double quotes
+        * @var array
+        */
        public $in = array();
        
        /**
-       * If we are running with magic_quotes_gpc on or off
-       * @var  int
-       */
+        * If we are running with magic_quotes_gpc on or off
+        * @var int
+        */
        private $magicquotes = 0;
        
-       // ###################################################################
        /**
-       * Constructor: set instance variables and execute input cleaning
-       */
+        * Constructor: set instance variables and execute input cleaning
+        */
        public function __construct()
        {
                // magic quotes
@@ -110,14 +109,13 @@ class BSInput
                $this->_sanitizeInputData();
        }
        
-       // ###################################################################
        /**
-       * Recursive XSS cleaner
-       *
-       * @param        mixed   Unsanitized REQUEST data
-       *
-       * @return       mixed   Sanitized data
-       */
+        * Recursive XSS cleaner
+        *
+        * @param       mixed   Unsanitized REQUEST data
+        *
+        * @return      mixed   Sanitized data
+        */
        private function _sanitizeDataRecursive($data)
        {
                foreach ($data as $key => $value)
@@ -138,14 +136,13 @@ class BSInput
                return $data;
        }
        
-       // ###################################################################
        /**
-       * Simple way to protect against HTML attacks with Unicode support
-       *
-       * @param        string  Unsanitzed text
-       *
-       * @return       string  Properly protected text that only encodes potential threats
-       */
+        * Simple way to protect against HTML attacks with Unicode support
+        *
+        * @param       string  Unsanitzed text
+        *
+        * @return      string  Properly protected text that only encodes potential threats
+        */
        public function sanitize($text)
        {
                if ($this->magicquotes)
@@ -158,14 +155,13 @@ class BSInput
                }
        }
        
-       // ###################################################################
        /**
-       * Unicode-safe entity encoding system; similar to sanitize()
-       *
-       * @param        string  Unsanitized text
-       *
-       * @return       string  Unicode-safe sanitized text with entities preserved
-       */
+        * Unicode-safe entity encoding system; similar to sanitize()
+        *
+        * @param       string  Unsanitized text
+        *
+        * @return      string  Unicode-safe sanitized text with entities preserved
+        */
        public function entityEncode($text)
        {
                $text = str_replace('&', '&amp;', $text);
@@ -173,31 +169,29 @@ class BSInput
                return $text;
        }
        
-       // ###################################################################
        /**
-       * Takes text that has been processed for HTML and unsanitizes it
-       *
-       * @param        string  Text that needs to be turned back into HTML
-       *
-       * @return       string  Unsanitized text
-       */
+        * Takes text that has been processed for HTML and unsanitizes it
+        *
+        * @param       string  Text that needs to be turned back into HTML
+        *
+        * @return      string  Unsanitized text
+        */
        public function unsanitize($text)
        {
                return str_replace(array('&lt;', '&gt;', '&quot;'), array('<', '>', '"'), $text);
        }
        
-       // ###################################################################
        /**
-       * Smart addslashes() that only applies itself it the Magic Quotes GPC
-       * is off. This should only be run on database query values that come
-       * from ISSO->in[] input; data that needs sanitization should be run
-       * through Db->escapeString()
-       *
-       * @param        string  Some string
-       * @param        bool    Force magic quotes to be off
-       *
-       * @return       string  String that has slashes added
-       */
+        * Smart addslashes() that only applies itself it the Magic Quotes GPC
+        * is off. This should only be run on database query values that come
+        * from ISSO->in[] input; data that needs sanitization should be run
+        * through Db->escapeString()
+        *
+        * @param       string  Some string
+        * @param       bool    Force magic quotes to be off
+        *
+        * @return      string  String that has slashes added
+        */
        public function escape($str, $force = true)
        {
                $db = BSApp::$db;
@@ -219,24 +213,22 @@ class BSInput
                }
        }
        
-       // ###################################################################
        /**
-       * Runs through all of the input data and sanitizes it.
-       */
+        * Runs through all of the input data and sanitizes it.
+        */
        private function _sanitizeInputData()
        {
                $this->in = $this->_sanitizeDataRecursive(array_merge($_GET, $_POST, $_COOKIE));
        }
        
-       // ###################################################################
        /**
-       * Sanitize function for something other than a string (which
-       * everything is sanitized for if you use _sanitizeInputData(). Cleaned
-       * data is placed back into Input->in; this makes it so you don't have
-       * to constantly intval() [etc.] data.
-       *
-       * @param        array   Array of elements to clean as varname => type
-       */
+        * Sanitize function for something other than a string (which
+        * everything is sanitized for if you use _sanitizeInputData(). Cleaned
+        * data is placed back into Input->in; this makes it so you don't have
+        * to constantly intval() [etc.] data.
+        *
+        * @param       array   Array of elements to clean as varname => type
+        */
        public function inputCleanArray($vars)
        {
                foreach ($vars as $varname => $type)
@@ -245,14 +237,13 @@ class BSInput
                }
        }
        
-       // ###################################################################
        /**
-       * Sanitize function that does a single variable as oppoesd to an array
-       * (see inputCleanArray() for more details)
-       *
-       * @param        string  Variable name in ISSO->in[]
-       * @param        integer Sanitization type constant
-       */
+        * Sanitize function that does a single variable as oppoesd to an array
+        * (see inputCleanArray() for more details)
+        *
+        * @param       string  Variable name in ISSO->in[]
+        * @param       integer Sanitization type constant
+        */
        public function inputClean($varname, $type)
        {
                if (isset($this->in["$varname"]))
@@ -267,17 +258,16 @@ class BSInput
                return $this->in["$varname"];
        }
        
-       // ###################################################################
        /**
-       * Runs Input->escape() on a variable on Input->in[]. This is just a
-       * short-hand wrapper so that queries can be shortened. When this is used,
-       * the actual value in Input->in[] is not changed, only the return value
-       * is escaped.
-       *
-       * @param        string  Input variable
-       *
-       * @return       string  Escaped input
-       */
+        * Runs Input->escape() on a variable on Input->in[]. This is just a
+        * short-hand wrapper so that queries can be shortened. When this is used,
+        * the actual value in Input->in[] is not changed, only the return value
+        * is escaped.
+        *
+        * @param       string  Input variable
+        *
+        * @return      string  Escaped input
+        */
        public function inputEscape($varname)
        {
                if (isset($this->in["$varname"]))
@@ -290,17 +280,16 @@ class BSInput
                }
        }
        
-       // ###################################################################
        /**
-       * Cleaning function that does the work for inputClean(); this is
-       * moved here so it can be used to clean things that aren't in
-       * Input->in[]
-       *
-       * @param        mixed   Data
-       * @param        integer Sanitization type constant
-       *
-       * @return       mixed   Cleaned data
-       */
+        * Cleaning function that does the work for inputClean(); this is
+        * moved here so it can be used to clean things that aren't in
+        * Input->in[]
+        *
+        * @param       mixed   Data
+        * @param       integer Sanitization type constant
+        *
+        * @return      mixed   Cleaned data
+        */
        public function clean($value, $type)
        {
                if (is_array($value))
@@ -356,15 +345,14 @@ class BSInput
                return $value;
        }
        
-       // ###################################################################
        /**
-       * Recursion function for Input->clean()
-       *
-       * @param        array   Uncleaned array
-       * @param        integer Sanitization type constant
-       *
-       * @return       array   Cleaned array of data
-       */
+        * Recursion function for Input->clean()
+        *
+        * @param       array   Uncleaned array
+        * @param       integer Sanitization type constant
+        *
+        * @return      array   Cleaned array of data
+        */
        private function _cleanArray($array, $type)
        {
                foreach ($array as $key => $value)
@@ -375,12 +363,11 @@ class BSInput
                return $array;
        }
        
-       // ###################################################################
        /**
-       * Returns the lowercase version of the HTTP method (post or get)
-       *
-       * @return       string  HTTP method
-       */
+        * Returns the lowercase version of the HTTP method (post or get)
+        *
+        * @return      string  HTTP method
+        */
        public function getHttpMethod()
        {
                $method = strtolower($_SERVER['REQUEST_METHOD']);
@@ -391,10 +378,9 @@ class BSInput
                return $method;
        }
        
-       // ###################################################################
        /**
-       * Checks to see if a POST refer is actually from us
-       */
+        * Checks to see if a POST refer is actually from us
+        */
        public function checkPostReferer()
        {
                if ($this->getHttpMethod() == 'post')
index 4c587b711258cc737c035e4fd1c399eae1eaecc8..8835afa394505781872c4bb7eab10a369a341ab7 100644 (file)
 \*=====================================================================*/
 
 /**
-* Installer creator (Install.php)
-*
-* @package     ISSO
-*/
+ * Installer creator (Install.php)
+ *
+ * @package    ISSO
+ */
 
 /**
-* Installer
-*
-* Installer modules should extend this class. In the install module router,
-* instantiate the right module. Methods beginning with step*() will be executed
-* in numerical order.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-*
-*/
+ * Installer
+ *
+ * Installer modules should extend this class. In the install module router,
+ * instantiate the right module. Methods beginning with step*() will be executed
+ * in numerical order.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ *
+ */
 abstract class BSInstaller
 {
        /**
-       * All the method steps
-       * @var array
-       */
+        * All the method steps
+        * @var array
+        */
        private $steps = array();
        
        /**
-       * The file name of this module
-       * @var string
-       */
+        * The file name of this module
+        * @var string
+        */
        protected $fileName;
        
        /**
-       * Constructor: set up the steps
-       *
-       * @param        string  The file name for this module
-       */
+        * Constructor: set up the steps
+        *
+        * @param       string  The file name for this module
+        */
        public function __construct($fileName)
        {
                $this->fileName = $fileName;
@@ -78,36 +78,32 @@ abstract class BSInstaller
                $this->_runStep(BSApp::$input->inputClean('step', TYPE_UINT));
        }
        
-       // ###################################################################
        /**
-       * An abstract method that needs to be overridden by a subclass that
-       * populates the page title
-       *
-       * @return       string  Returns the page title
-       */
+        * An abstract method that needs to be overridden by a subclass that
+        * populates the page title
+        *
+        * @return      string  Returns the page title
+        */
        protected abstract function _pageTitle();
        
-       // ###################################################################
        /**
-       * Abstract method that will return link to the page after all the
-       * steps are completed. This needs to provide it's own <a>
-       *
-       * @return       string  Final page link
-       */
+        * Abstract method that will return link to the page after all the
+        * steps are completed. This needs to provide it's own <a>
+        *
+        * @return      string  Final page link
+        */
        protected abstract function _finalLink();
        
-       // ###################################################################
        /**
-       * Abstract method that prints out the first welcome screen that the
-       * user sees when no step has been selected
-       */
+        * Abstract method that prints out the first welcome screen that the
+        * user sees when no step has been selected
+        */
        protected abstract function _welcomePage();
                        
-       // ###################################################################
        /**
-       * Prints out the page header... you really don't do this more than
-       * once
-       */
+        * Prints out the page header... you really don't do this more than
+        * once
+        */
        protected function _setUp()
        {
                ?>
@@ -159,13 +155,12 @@ abstract class BSInstaller
                <?php
        }
        
-       // ###################################################################
        /**
-       * Runs the specific step method; if it does not exist, it will throw
-       * an error
-       *
-       * @param        integer Step number
-       */
+        * Runs the specific step method; if it does not exist, it will throw
+        * an error
+        *
+        * @param       integer Step number
+        */
        protected function _runStep($step)
        {
                if ($step == 0)
@@ -186,13 +181,12 @@ abstract class BSInstaller
                }
        }
        
-       // ###################################################################
        /**
-       * Prints out the footer part of the page, and the appropriate forwarding
-       * action button
-       *
-       * @param        integer Step number
-       */
+        * Prints out the footer part of the page, and the appropriate forwarding
+        * action button
+        *
+        * @param       integer Step number
+        */
        protected function _setDown($step)
        {
                // this is the last step, print the final button
index a8afc2e0001a19afd41a9157d3b1482e28bcf126..05db039077975251ec66f9ebaa48b8943c9178b8 100644 (file)
--- a/Mail.php
+++ b/Mail.php
 \*=====================================================================*/
 
 /**
-* Mail Sender (mail.php)
-*
-* @package     ISSO
-*/
+ * Mail Sender (mail.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/Functions.php');
 
 /**
-* Mail Sender
-*
-* This framework is a wrapper for the PHP mail function that properly
-* sends mail with full email headers.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * Mail Sender
+ *
+ * This framework is a wrapper for the PHP mail function that properly
+ * sends mail with full email headers.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 class BSMail
 {
        /**
-       * The subject of the message
-       * @var  string
-       */
+        * The subject of the message
+        * @var string
+        */
        private $subject = '';
        
        /**
-       * Body plain-text of the message
-       * @var  string
-       */
+        * Body plain-text of the message
+        * @var string
+        */
        private $bodyText = '';
        
        /**
-       * HTML multi-part body of the message
-       * @var  string
-       */
+        * HTML multi-part body of the message
+        * @var string
+        */
        private $bodyHtml = '';
        
        /**
-       * The message sender's email address
-       * @var  string
-       */
+        * The message sender's email address
+        * @var string
+        */
        private $from = '';
        
        /**
-       * The message sender's display name
-       * @var  string
-       */
+        * The message sender's display name
+        * @var string
+        */
        private $fromName = '';
        
        /**
-       * Additional message headers
-       * @var  string
-       */
+        * Additional message headers
+        * @var string
+        */
        private $headers = '';
 
        /**
-       * The new line delimiter used in the message
-       * @var  string
-       * @access       private
-       */
+        * The new line delimiter used in the message
+        * @var string
+        * @access      private
+        */
        private $delim = "\n";
        
        /**
-       * Character set used to send messages with
-       * @var  string
-       * @access       public
-       */
+        * Character set used to send messages with
+        * @var string
+        * @access      public
+        */
        private $charset = 'utf-8'; // should we be using iso-8859-1 ?
        
        /**
@@ -101,94 +101,86 @@ class BSMail
                }
        }
                
-       // ###################################################################
        /**
-       * Sets the subject
-       *
-       * @param        string  Subject text
-       */
+        * Sets the subject
+        *
+        * @param       string  Subject text
+        */
        public function setSubject($subject)
        {
                $this->subject = $subject;
        }
        
-       // ###################################################################
        /**
-       * Sets the body text (required)
-       *
-       * @param        string  Body text
-       */
+        * Sets the body text (required)
+        *
+        * @param       string  Body text
+        */
        public function setBodyText($body)
        {
                $this->bodyText = $body;
        }
        
-       // ###################################################################
        /**
-       * Sets the HTML body (optional)
-       *
-       * @param        string  Body HTML
-       */
+        * Sets the HTML body (optional)
+        *
+        * @param       string  Body HTML
+        */
        public function setBodyHtml($body)
        {
                $this->bodyHtml = $body;
        }
        
-       // ###################################################################
        /**
-       * Sets the from address
-       *
-       * @param        string  Sending email address
-       */
+        * Sets the from address
+        *
+        * @param       string  Sending email address
+        */
        public function setFromAddress($address)
        {
                $this->from = $address;
        }
        
-       // ###################################################################
        /**
-       * Sets the from display name
-       *
-       * @param        string  From name
-       */
+        * Sets the from display name
+        *
+        * @param       string  From name
+        */
        public function setFromName($name)
        {
                $this->fromName = $name;
        }
        
-       // ###################################################################
        /**
-       * Sets any additional headers
-       *
-       * @param        string  Additional headers separated by a \n
-       */
+        * Sets any additional headers
+        *
+        * @param       string  Additional headers separated by a \n
+        */
        public function setHeaders($headers)
        {
                $this->headers = $headers;
        }
        
-       // ###################################################################
        /**
-       * Sets the character set to send the email in
-       *
-       * @param        string  Charset
-       */
+        * Sets the character set to send the email in
+        *
+        * @param       string  Charset
+        */
        public function setCharset($charset)
        {
                $this->charset = $charset;
        }
                
-       // ###################################################################
        /**
-       * Sends an email to the specified address with the specified
-       * sender, subject, and body.
-       *
-       * @param        string  Email address to send to
-       * @param        string  Name of the recipient
-       * @param        bool    Send an HTML multipart (if HTML body specified)?
-       *
-       * @return       bool    Status of the message
-       */
+        * Sends an email to the specified address with the specified
+        * sender, subject, and body.
+        *
+        * @param       string  Email address to send to
+        * @param       string  Name of the recipient
+        * @param       bool    Send an HTML multipart (if HTML body specified)?
+        *
+        * @return      bool    Status of the message
+        */
        public function send($address, $name = null, $sendHtml = false)
        {
                if (empty($address))
@@ -292,14 +284,13 @@ class BSMail
                }
        }
        
-       // ###################################################################
        /**
-       * Fetches the first line of a string
-       *
-       * @param        string  A string
-       *
-       * @return       string  The first line of the string
-       */
+        * Fetches the first line of a string
+        *
+        * @param       string  A string
+        *
+        * @return      string  The first line of the string
+        */
        private function _fetchFirstLine($string)
        {
                $string = BSFunctions::convert_line_breaks($string);
@@ -307,15 +298,14 @@ class BSMail
                return $broken[0];
        }
        
-       // ###################################################################
        /**
-       * Encodes a header value (to name, fron name, subject, etc.) according
-       * to RFC 2047
-       *
-       * @param        string  The text to encode
-       *
-       * @return       string  Encoded text
-       */
+        * Encodes a header value (to name, fron name, subject, etc.) according
+        * to RFC 2047
+        *
+        * @param       string  The text to encode
+        *
+        * @return      string  Encoded text
+        */
        function _encodeHeaderValue($text)
        {
                if (preg_match('#[^a-zA-Z0-9\+\-\*!/]#', $text) == 0)
index ae824258f5cd37a31e01265e46789b9f9a019563..f0956e8481a654d2f16f7064960ebed58f1d6e16 100644 (file)
 \*=====================================================================*/
 
 /**
-* Pagination System (Pagination.php)
-*
-* @package     ISSO
-*/
+ * Pagination System (Pagination.php)
+ *
+ * @package    ISSO
+ */
 
 /**
-* Pagination System
-*
-* On many pages, it is necessary to limit the amount of records to display.
-* Using this class, you can set the maximum and minimum values to display,
-* and then the input variables for page number and perpage. This will
-* then create a page navigator and manage the SQL LIMIT statements.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * Pagination System
+ *
+ * On many pages, it is necessary to limit the amount of records to display.
+ * Using this class, you can set the maximum and minimum values to display,
+ * and then the input variables for page number and perpage. This will
+ * then create a page navigator and manage the SQL LIMIT statements.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 abstract class BSPagination
 {
        /**
-       * Current page number
-       * @var  integer
-       */
+        * Current page number
+        * @var integer
+        */
        protected $page;
        
        /**
-       * Per-page value
-       * @var  integer
-       */
+        * Per-page value
+        * @var integer
+        */
        protected $perpage;
        
        /**
-       * Number of page links
-       * @var  integer
-       */
+        * Number of page links
+        * @var integer
+        */
        protected $pagelinks;
        
        /**
-       * Total number of results
-       * @var  integer
-       */
+        * Total number of results
+        * @var integer
+        */
        protected $total;
        
        /**
-       * Total number of pages
-       * @var  integer
-       */
+        * Total number of pages
+        * @var integer
+        */
        protected $pagecount;
        
        /**
-       * Maximum number of per-page results
-       * @var  integer
-       */
+        * Maximum number of per-page results
+        * @var integer
+        */
        protected $maxperpage = 100;
        
        /**
-       * Default number of per-page results
-       * @var  integer
-       */
+        * Default number of per-page results
+        * @var integer
+        */
        protected $defaultperpage = 20;
        
-       // ###################################################################
        /**
         * Callback public function for the processing of an indivdual page link
         * 
@@ -94,7 +93,6 @@ abstract class BSPagination
         */
        protected abstract function _bitProcessor($baselink, $isCurrent, $pagenumber);
        
-       // ###################################################################
        /**
         * Callback public function for the processing the entire page navigator
         * 
@@ -124,55 +122,50 @@ abstract class BSPagination
                }
        }
        
-       // ###################################################################
        /**
-       * Returns the current page number
-       *
-       * @return       integer Current page
-       */
+        * Returns the current page number
+        *
+        * @return      integer Current page
+        */
        public function getPage()
        {
                return $this->page;
        }
        
-       // ###################################################################
        /**
-       * Returns the current perpage value
-       *
-       * @return       integer Current perpage
-       */
+        * Returns the current perpage value
+        *
+        * @return      integer Current perpage
+        */
        public function getPerPage()
        {
                return $this->perpage;
        }
        
-       // ###################################################################
        /**
-       * Sets total
-       *
-       * @param        integer Total number
-       */
+        * Sets total
+        *
+        * @param       integer Total number
+        */
        public function setTotal($total)
        {
                $this->total = $total;
        }
        
-       // ###################################################################
        /**
-       * Returns the number of pages to be in the navigator
-       *
-       * @param        integer Number of pages
-       */
+        * Returns the number of pages to be in the navigator
+        *
+        * @param       integer Number of pages
+        */
        public function getPageCount()
        {
                return $this->pagecount;
        }
                
-       // ###################################################################
        /**
-       * Takes all of the information from the set() functions and then
-       * prepares all of the data through verification
-       */
+        * Takes all of the information from the set() functions and then
+        * prepares all of the data through verification
+        */
        public function processIncomingData()
        {
                $this->_setVariables();
@@ -197,10 +190,9 @@ abstract class BSPagination
                $this->perpage = BSApp::$input->clean($this->perpage, TYPE_INT);
        }
        
-       // ###################################################################
        /**
-       * Takes the variables and splits up the pages
-       */
+        * Takes the variables and splits up the pages
+        */
        public function splitPages()
        {
                $this->pagecount = ceil($this->total / $this->perpage);
@@ -210,14 +202,13 @@ abstract class BSPagination
                }
        }
        
-       // ###################################################################
        /**
-       * Returns the lower limit of the pages
-       *
-       * @param        integer Page number
-       *
-       * @return       integer Lower result limit
-       */
+        * Returns the lower limit of the pages
+        *
+        * @param       integer Page number
+        *
+        * @return      integer Lower result limit
+        */
        public function fetchLimit($page = null)
        {
                if ($page === null)
@@ -252,15 +243,14 @@ abstract class BSPagination
                }
        }
        
-       // ###################################################################
        /**
-       * Constructs the page navigator
-       *
-       * @param        string  Base link path
-       * @param        bool    Add a ? or a & to the path so it's link-friendly
-       *
-       * @return       string  Generated HTML page navigator
-       */
+        * Constructs the page navigator
+        *
+        * @param       string  Base link path
+        * @param       bool    Add a ? or a & to the path so it's link-friendly
+        *
+        * @return      string  Generated HTML page navigator
+        */
        public function constructPageNav($baselink, $addParam = true)
        {
                // handle base link
index 21f845272e570fcff6ed25f65e9e76bf443bf4d0..5bd67649cd87d74c9099bade00c96326e3599876 100644 (file)
 \*=====================================================================*/
 
 /**
-* Printer System (printer.php)
-*
-* @package     ISSO
-*/
+ * Printer System (printer.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/PrinterAbstract.php');
 require_once(ISSO . '/PrinterElement.php');
@@ -36,41 +36,41 @@ require_once(ISSO . '/PrinterRootTable.php');
 require_once(ISSO . '/PrinterNavigation.php');
 
 /**
-* Printer System
-*
-* This is the root static framework module for the HTML printer system that
-* works without templates. Here, you simply set the language and stylesheet
-* information and use the other classes to generate the code.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * Printer System
+ *
+ * This is the root static framework module for the HTML printer system that
+ * works without templates. Here, you simply set the language and stylesheet
+ * information and use the other classes to generate the code.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 class BSPrinter
 {      
        /**
-       * Singleton instance
-       * @var BSPrinter
-       */
+        * Singleton instance
+        * @var BSPrinter
+        */
        private static $instance;
        
        /**
-       * Language information for all printer elements with format array(langcode: en_US, direction: ltr/rtl, charset: utf-8)
-       * @var string
-       */
+        * Language information for all printer elements with format array(langcode: en_US, direction: ltr/rtl, charset: utf-8)
+        * @var string
+        */
        private $language = array('langcode' => 'en_US', 'direction' => 'ltr', 'charset' => 'utf-8');
        
        /**
-       * CSS stylesheet to link to
-       * @var string
-       */
+        * CSS stylesheet to link to
+        * @var string
+        */
        private $stylesheet;
        
        /**
-       * Realm; the extra bit added to the title
-       * @var string
-       */
+        * Realm; the extra bit added to the title
+        * @var string
+        */
        private $realm = 'BSPrinterOutput';
        
        /**
@@ -79,18 +79,16 @@ class BSPrinter
         */
        private $copyright;
        
-       // ###################################################################
        /**
-       * Constructor (private)
-       */
+        * Constructor (private)
+        */
        private function __construct() {}
        
-       // ###################################################################
        /**
-       * Returns the singleton instance
-       *
-       * @return       BSPrinter       Singleton instance
-       */
+        * Returns the singleton instance
+        *
+        * @return      BSPrinter       Singleton instance
+        */
        private static function _instance()
        {
                if (!self::$instance)
@@ -120,67 +118,61 @@ class BSPrinter
                self::_instance()->copyright = $copyright;
        }
        
-       // ###################################################################
        /**
-       * Returns the realm
-       *
-       * @return       string  Realm
-       */
+        * Returns the realm
+        *
+        * @return      string  Realm
+        */
        public static function get_realm()
        {
                return self::_instance()->realm;
        }
        
-       // ###################################################################
        /**
-       * Sets the realm
-       *
-       * @param        string  Realm
-       */
+        * Sets the realm
+        *
+        * @param       string  Realm
+        */
        public static function set_realm($realm)
        {
                self::_instance()->realm = $realm;
        }
        
-       // ###################################################################
        /**
-       * Returns the language array
-       *
-       * @return       array   Language array
-       */
+        * Returns the language array
+        *
+        * @return      array   Language array
+        */
        public static function get_language_information()
        {
                return self::_instance()->language;
        }
        
-       // ###################################################################
        /**
-       * Sets the language array information
-       *
-       * @param        array   Language array
-       */
+        * Sets the language array information
+        *
+        * @param       array   Language array
+        */
        public static function set_language_information($lang)
        {               
                self::_instance()->language = $lang;
        }
        
-       // ###################################################################
        /**
-       * Returns the stylesheet URL
-       *
-       * @return       string  Stylesheet link
-       */
+        * Returns the stylesheet URL
+        *
+        * @return      string  Stylesheet link
+        */
        public static function get_stylesheet()
        {
                return self::_instance()->stylesheet;
        }
        
-       // ###################################################################
        /**
-       * Sets the path to the CSS style sheet
-       *
-       * @param        string  Path
-       */
+        * Sets the path to the CSS style sheet
+        *
+        * @param       string  Path
+        */
        public static function set_stylesheet($stylesheet)
        {
                self::_instance()->stylesheet = $stylesheet;
index 348742f3e6f4f997b914eb6335200ac155228b51..e8ad7d3c4d54e6b98e50f0f2951d4b32c057eaa7 100644 (file)
 \*=====================================================================*/
 
 /**
-* Printer Element Abstract Class (PrinterAbstract.php)
-*
-* @package     ISSO
-*/
+ * Printer Element Abstract Class (PrinterAbstract.php)
+ *
+ * @package    ISSO
+ */
 
 /**
-* Printer Element
-*
-* This abstract class is used for all printer elements and describes
-* the basic functionality of an element.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-*
-*/
+ * Printer Element
+ *
+ * This abstract class is used for all printer elements and describes
+ * the basic functionality of an element.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ *
+ */
 abstract class BSPrinterAbstract
 {
        /**
-       * Style information
-       * @var array
-       */
+        * Style information
+        * @var array
+        */
        protected $style = array();
        
        /**
-       * The CSS class to use
-       * @var string
-       */
+        * The CSS class to use
+        * @var string
+        */
        protected $cssClass = ':swap:';
        
        /**
@@ -56,44 +56,41 @@ abstract class BSPrinterAbstract
        public abstract static function make();
        
        /**
-       * Tells the element to paint itself (and any children)
-       */
+        * Tells the element to paint itself (and any children)
+        */
        public abstract function paint();
        
-       // ###################################################################
        /**
-       * Sets the CSS class to use. Use ":swap:" to alternate
-       *
-       * @param        string  CSS class
-       * 
-       * @return       fluent interface
-       */
+        * Sets the CSS class to use. Use ":swap:" to alternate
+        *
+        * @param       string  CSS class
+        
+        * @return      fluent interface
+        */
        public function setCssClass($class)
        {
                $this->cssClass = $class;
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Sets the style information
-       * 
-       * @param        array Style attributes
-       * 
-       * @return       fluent interface
-       */
+        * Sets the style information
+        
+        * @param       array Style attributes
+        
+        * @return      fluent interface
+        */
        public function setStyle(Array $attributes)
        {
                $this->style = $attributes;
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Returns a string of CSS style attributes
-       *
-       * @return       string  CSS attributes
-       */
+        * Returns a string of CSS style attributes
+        *
+        * @return      string  CSS attributes
+        */
        protected function _prepareStyle()
        {
                if (empty($this->style) && empty($this->cssClass))
index 6b1aa395c2152770c4c19e68e3732f157bb54b32..977984b0d2b038dc76c11fe0e7f96c66e8d5f198 100644 (file)
 \*=====================================================================*/
 
 /**
-* Base Printer Element (PrinterElement.php)
-*
-* @package     ISSO
-*/
+ * Base Printer Element (PrinterElement.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/PrinterAbstract.php');
 
 /**
-* Base Printer Element
-*
-* This class represents the lowest level of printer elements:
-* buttons, input fields, etc. These cannot have children elements
-* and are only attached to a parent.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-*
-*/
+ * Base Printer Element
+ *
+ * This class represents the lowest level of printer elements:
+ * buttons, input fields, etc. These cannot have children elements
+ * and are only attached to a parent.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ *
+ */
 class BSPrinterElement extends BSPrinterAbstract
 {
        /**
-       * The name of the element
-       * @var string
-       */
+        * The name of the element
+        * @var string
+        */
        private $name;
        
        /**
-       * Type of element
-       * @var string
-       */
+        * Type of element
+        * @var string
+        */
        private $type;
        
        /**
-       * The value of the element
-       * @var string
-       */
+        * The value of the element
+        * @var string
+        */
        private $value;
        
        /**
-       * The checked/selected attribute (checkbox, radio, and option only)
-       * @var boolean
-       */
+        * The checked/selected attribute (checkbox, radio, and option only)
+        * @var boolean
+        */
        private $active;
        
        /**
-       * The JavaScript onClick attribute
-       * @var string
-       */
+        * The JavaScript onClick attribute
+        * @var string
+        */
        private $onClick;
        
        /**
-       * Accesskey attribute
-       * @var string
-       */
+        * Accesskey attribute
+        * @var string
+        */
        private $accessKey;
        
        /**
-       * Constructor
-       */
+        * Constructor
+        */
        function __construct($type, $name, $value = '')
        {
                $this->type = $type;
@@ -105,15 +105,14 @@ class BSPrinterElement extends BSPrinterAbstract
                return $obj->newInstanceArgs($args);
        }
        
-       // ###################################################################
        /**
-       * If the type is either checkbox, radio, or option then this will
-       * set the selected/checked attribute
-       *
-       * @param        boolean Active?
-       * 
-       * @return       fluent interface
-       */
+        * If the type is either checkbox, radio, or option then this will
+        * set the selected/checked attribute
+        *
+        * @param       boolean Active?
+        
+        * @return      fluent interface
+        */
        public function setActive($active)
        {
                if (!in_array($this->type, array('checkbox', 'radio', 'option')))
@@ -124,76 +123,70 @@ class BSPrinterElement extends BSPrinterAbstract
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Sets the JavaScript onclick action
-       *
-       * @param        string  onClick attribute value
-       * 
-       * @return       fluent interface
-       */
+        * Sets the JavaScript onclick action
+        *
+        * @param       string  onClick attribute value
+        
+        * @return      fluent interface
+        */
        public function setOnClick($onClick)
        {
                $this->onClick = $onClick;
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Sets the accesskey attribute value
-       *
-       * @param        string  Access key
-       * 
-       * @return       fluent interface
-       */
+        * Sets the accesskey attribute value
+        *
+        * @param       string  Access key
+        
+        * @return      fluent interface
+        */
        public function setAccessKey($accessKey)
        {
                $this->accessKey = $accessKey;
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Returns the type
-       *
-       * @return       string  Element type
-       */
+        * Returns the type
+        *
+        * @return      string  Element type
+        */
        public function getType()
        {
                return $this->type;
        }
        
-       // ###################################################################
        /**
-       * Returns the name of the element
-       *
-       * @return       string  Name
-       */
+        * Returns the name of the element
+        *
+        * @return      string  Name
+        */
        public function getName()
        {
                return $this->name;
        }
        
-       // ###################################################################
        /**
-       * Sets the name of the element
-       *
-       * @param        string  A new name
-       * 
-       * @return       fluent interface
-       */
+        * Sets the name of the element
+        *
+        * @param       string  A new name
+        
+        * @return      fluent interface
+        */
        public function setName($name)
        {
                $this->name = $name;
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Returns the output HTML
-       *
-       * @return       string  Output HTML
-       */
+        * Returns the output HTML
+        *
+        * @return      string  Output HTML
+        */
        public function paint()
        {
                $name = ' name="' . $this->name . '"';
index d422c776e21c11f88f6fbeceb223949c7853d247..ccaa4edaa23b8359a25828ff13a540032c939b29 100644 (file)
 \*=====================================================================*/
 
 /**
-* Printer Label Element (PrinterElementLabel.php)
-*
-* @package     ISSO
-*/
+ * Printer Label Element (PrinterElementLabel.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/PrinterAbstract.php');
 
 /**
-* Printer Label Element
-*
-* This element is a wrapper for a PHP string to be displayed in the
-* standard printer
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-*
-*/
+ * Printer Label Element
+ *
+ * This element is a wrapper for a PHP string to be displayed in the
+ * standard printer
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ *
+ */
 class BSPrinterElementLabel extends BSPrinterAbstract
 {
        /**
-       * The value to print
-       * @var string
-       */
+        * The value to print
+        * @var string
+        */
        private $string = '';
        
-       // ###################################################################
        /**
-       * Constructor
-       *
-       * @param        string  String to display
-       */
+        * Constructor
+        *
+        * @param       string  String to display
+        */
        function __construct($string)
        {
                $this->string = $string;
@@ -70,12 +69,11 @@ class BSPrinterElementLabel extends BSPrinterAbstract
                return $obj->newInstanceArgs($args);
        }
        
-       // ###################################################################
        /**
-       * Prints the string
-       *
-       * @return       string  The string; wrapped in a <span> if it has styling
-       */
+        * Prints the string
+        *
+        * @return      string  The string; wrapped in a <span> if it has styling
+        */
        public function paint()
        {
                if ($this->_prepareStyle())
index 35c1d9b1958f149a6d8da176ebb36e6a5aef2f19..17e635b2f13c1f039e64b51dcd2a8276b0455e5a 100644 (file)
 \*=====================================================================*/
 
 /**
-* Printer Table Element (PrinterElementTable.php)
-*
-* @package     ISSO
-*/
+ * Printer Table Element (PrinterElementTable.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/PrinterRootTable.php');
 require_once(ISSO . '/PrinterElement.php');
 
 /**
-* Printer Table Element
-*
-* This represents a table row that holds elements.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-*
-*/
+ * Printer Table Element
+ *
+ * This represents a table row that holds elements.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ *
+ */
 class BSPrinterElementTable extends BSPrinterAbstract
 {
        /**
-       * Array of child nodes
-       * @var array
-       */
+        * Array of child nodes
+        * @var array
+        */
        private $children = array();
        
        /**
-       * Number of columns to span
-       * @var integer
-       */
+        * Number of columns to span
+        * @var integer
+        */
        private $colspan = 0;
        
-       // ###################################################################
        /**
-       * Creates a table element; takes a variable number of arguments which
-       * are added as children in the order passed
-       *
-       * @param        BSPrinterElementTable...        Variable number (or no) children
-       */
+        * Creates a table element; takes a variable number of arguments which
+        * are added as children in the order passed
+        *
+        * @param       BSPrinterElementTable...        Variable number (or no) children
+        */
        public function __construct()
        {
                $childs = func_get_args();
@@ -80,15 +79,14 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $obj->newInstanceArgs($args);
        }
        
-       // ###################################################################
        /**
-       * Prints a simple row of text and text
-       *
-       * @param        string  Label (left side)
-       * @param        string  Value (right side)
-       *
-       * @return       BSPrinterElementTable   Table row element
-       */
+        * Prints a simple row of text and text
+        *
+        * @param       string  Label (left side)
+        * @param       string  Value (right side)
+        *
+        * @return      BSPrinterElementTable   Table row element
+        */
        public static function row_label($label, $value)
        {
                $tr = new BSPrinterElementTable();
@@ -99,17 +97,16 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Creates an input[text/password] field row
-       *
-       * @param        string  Label
-       * @param        string  Field name
-       * @param        mixed   Default value
-       * @param        bool    A password field?
-       *
-       * @return       BPrinterElementTable    Table row element
-       */
+        * Creates an input[text/password] field row
+        *
+        * @param       string  Label
+        * @param       string  Field name
+        * @param       mixed   Default value
+        * @param       bool    A password field?
+        *
+        * @return      BPrinterElementTable    Table row element
+        */
        public static function row_text($label, $name, $value = null, $password = false)
        {
                $tr = new BSPrinterElementTable();
@@ -120,16 +117,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Creates a submit row
-       *
-       * @param        array   Child elements to add before the buttons
-       * @param        string  Save button text
-       * @param        string  Reset button text
-       *
-       * @return       BSPrinterElementTable   Table row element
-       */
+        * Creates a submit row
+        *
+        * @param       array   Child elements to add before the buttons
+        * @param       string  Save button text
+        * @param       string  Reset button text
+        *
+        * @return      BSPrinterElementTable   Table row element
+        */
        public static function row_submit(Array $children = null, $save = ':submit:', $reset = ':reset:')
        {
                $build = '';
@@ -165,16 +161,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Constructs a <select> row from an array of BSPrinterElement's
-       *
-       * @param        string  Label
-       * @param        string  Name
-       * @param        array   Array of BSPrinterElement[option]'s
-       *
-       * @return       BSPrinterElementTable   Table row
-       */
+        * Constructs a <select> row from an array of BSPrinterElement's
+        *
+        * @param       string  Label
+        * @param       string  Name
+        * @param       array   Array of BSPrinterElement[option]'s
+        *
+        * @return      BSPrinterElementTable   Table row
+        */
        public static function row_list($label, $name, Array $options)
        {
                $build = '';
@@ -198,16 +193,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Constructs a row from an array of BSPrinterElement's of checkboxes
-       *
-       * @param        string  Label
-       * @param        string  Name
-       * @param        array   Array of BSPrinterElement[checkbox]'s that follow array(box label => BSPrinterElement)
-       *
-       * @return       BSPrinterElementTable   Table row
-       */
+        * Constructs a row from an array of BSPrinterElement's of checkboxes
+        *
+        * @param       string  Label
+        * @param       string  Name
+        * @param       array   Array of BSPrinterElement[checkbox]'s that follow array(box label => BSPrinterElement)
+        *
+        * @return      BSPrinterElementTable   Table row
+        */
        public static function row_checkbox($label, $name, Array $boxes)
        {
                $build = '';
@@ -235,16 +229,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Factory method to create an upload form element; requires that the
-       * form this is attached to have the upload flag set
-       *
-       * @param        string  Label for the element
-       * @param        string  Name of the <input>
-       *
-       * @return       BSPrinterElementTable   Upload form
-       */
+        * Factory method to create an upload form element; requires that the
+        * form this is attached to have the upload flag set
+        *
+        * @param       string  Label for the element
+        * @param       string  Name of the <input>
+        *
+        * @return      BSPrinterElementTable   Upload form
+        */
        public static function row_upload($label, $name)
        {
                $tr = new BSPrinterElementTable();
@@ -255,16 +248,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Creates a row with a radio select option for yes/no
-       *
-       * @param        string  Row label
-       * @param        string  Name of the radio buttons
-       * @param        bool    Yes is selected? (if false, No is selected)
-       *
-       * @return       BSPrinterElementTable   Yes-No row
-       */
+        * Creates a row with a radio select option for yes/no
+        *
+        * @param       string  Row label
+        * @param       string  Name of the radio buttons
+        * @param       bool    Yes is selected? (if false, No is selected)
+        *
+        * @return      BSPrinterElementTable   Yes-No row
+        */
        public static function row_yes_no($label, $name, $yes)
        {
                $elm = new BSPrinterElement('radio', $name, 1);
@@ -283,16 +275,15 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Prints a row with a textarea
-       *
-       * @param        string  Label
-       * @param        string  Textarea name
-       * @param        string  Value to fill with
-       *
-       * @return       BSPrinterElementTable   Table row
-       */
+        * Prints a row with a textarea
+        *
+        * @param       string  Label
+        * @param       string  Textarea name
+        * @param       string  Value to fill with
+        *
+        * @return      BSPrinterElementTable   Table row
+        */
        public static function row_textarea($label, $name, $value = null)
        {
                $tr = new BSPrinterElementTable();
@@ -303,40 +294,37 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $tr;
        }
        
-       // ###################################################################
        /**
-       * Returns the number of columns in this element
-       *
-       * @return       integer Column count
-       */
+        * Returns the number of columns in this element
+        *
+        * @return      integer Column count
+        */
        public function numberOfColumns()
        {
                return sizeof($this->children);
        }
        
-       // ###################################################################
        /**
-       * Adds a child node to the element
-       *
-       * @param        BSPrinterAbstract       A child element
-       * 
-       * @return       fluent interface
-       */
+        * Adds a child node to the element
+        *
+        * @param       BSPrinterAbstract       A child element
+        
+        * @return      fluent interface
+        */
        public function addChild(BSPrinterAbstract $child)
        {
                $this->children[] = $child;
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Sets the number of columns this row should have and pads the <td>
-       * elements accordingly
-       *
-       * @param        integer Column count
-       * 
-       * @return       fluent interface
-       */
+        * Sets the number of columns this row should have and pads the <td>
+        * elements accordingly
+        *
+        * @param       integer Column count
+        
+        * @return      fluent interface
+        */
        public function setColumnNumber($cols)
        {
                if ($cols < $this->numberOfColumns())
@@ -347,12 +335,11 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Returns the HTML for all printed children elements
-       *
-       * @return       string  Printed HTML
-       */
+        * Returns the HTML for all printed children elements
+        *
+        * @return      string  Printed HTML
+        */
        protected function _paintChildren()
        {
                $builder = '';
@@ -382,12 +369,11 @@ class BSPrinterElementTable extends BSPrinterAbstract
                return $builder;
        }
        
-       // ###################################################################
        /**
-       * Paints the entire table row
-       *
-       * @return       string  Table row HTML
-       */
+        * Paints the entire table row
+        *
+        * @return      string  Table row HTML
+        */
        public function paint()
        {
                return "\t<tr" . $this->_prepareStyle() . ">" . $this->_paintChildren() . "\n\t</tr>";
index ee0fb1a75dea00463d102c332feada1729d18447..2de0cce5f688cdf5fe7bc1d315ebc77811192523 100644 (file)
 \*=====================================================================*/
 
 /**
-* Printer: Navigation Generator (PrinterNavigation.php)
-*
-* @package     ISSO
-*/
+ * Printer: Navigation Generator (PrinterNavigation.php)
+ *
+ * @package    ISSO
+ */
 
 /**
-* Printer: Navigation Generator
-*
-* This framework works in conjunction with BSPrinter to generate a page header
-* and sidebar to be used for navigation. You set the navigation array and then can
-* specify a given key to highlight elements. Elements are broken into three types:
-* tabs (top of the page), groups (blocks of link actions), and links
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * Printer: Navigation Generator
+ *
+ * This framework works in conjunction with BSPrinter to generate a page header
+ * and sidebar to be used for navigation. You set the navigation array and then can
+ * specify a given key to highlight elements. Elements are broken into three types:
+ * tabs (top of the page), groups (blocks of link actions), and links
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 class BSPrinterNavigation
 {
        /**
index 0f45699809fbd132fd46b92dac3ae1c7d44a7fe2..ab6ca2a01498d8290282e8cab0e39351acaea6da 100644 (file)
 \*=====================================================================*/
 
 /**
-* Printer Root Element (PrinterRootAbstract.php)
-*
-* @package     ISSO
-*/
+ * Printer Root Element (PrinterRootAbstract.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/PrinterAbstract.php');
 
 /**
-* Printer Root Element
-*
-* This is a root element class. That means that elements can be printed
-* directly into this and this can stand alone as a page. However, that
-* does not mean that all root elements produce valid XHTML.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-*
-*/
+ * Printer Root Element
+ *
+ * This is a root element class. That means that elements can be printed
+ * directly into this and this can stand alone as a page. However, that
+ * does not mean that all root elements produce valid XHTML.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ *
+ */
 abstract class BSPrinterRootAbstract extends BSPrinterAbstract
 {
        /**
-       * Child elements
-       * @var string
-       */
+        * Child elements
+        * @var string
+        */
        protected $children = array();
        
        /**
-       * Returns all of the children painted in the right order
-       */
+        * Returns all of the children painted in the right order
+        */
        protected abstract function _paintChildren();
        
-       // ###################################################################
        /**
-       * Adds a child node to the element
-       *
-       * @param        BSPrinterAbstract       A child element
-       * 
-       * @return       fluent interface
-       */
+        * Adds a child node to the element
+        *
+        * @param       BSPrinterAbstract       A child element
+        
+        * @return      fluent interface
+        */
        public function addChild(BSPrinterAbstract $child)
        {
                $this->children[] = $child;
index 8c0deb8416dc3f69f10e1884081ff1e34854db01..f5f42a55f320e119ee87bb5992e6f72196513fa9 100644 (file)
 \*=====================================================================*/
 
 /**
-* Printer Root Element: Form (PrinterRootForm.php)
-*
-* @package     ISSO
-*/
+ * Printer Root Element: Form (PrinterRootForm.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/PrinterRootAbstract.php');
 
 /**
-* Printer Root Element: Form
-*
-* Represents a <form> object. This can have a parent or not: if it does,
-* then it will be painted as a child, otherwise it will act as a root.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-*
-*/
+ * Printer Root Element: Form
+ *
+ * Represents a <form> object. This can have a parent or not: if it does,
+ * then it will be painted as a child, otherwise it will act as a root.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ *
+ */
 class BSPrinterRootForm extends BSPrinterRootAbstract
 {
        /**
-       * The form's action
-       * @var string
-       */
+        * The form's action
+        * @var string
+        */
        private $action;
        
        /**
-       * "Do" parameter
-       * @var string
-       */
+        * "Do" parameter
+        * @var string
+        */
        private $do;
        
        /**
-       * The form's name
-       * @var string
-       */
+        * The form's name
+        * @var string
+        */
        private $name;
        
        /**
-       * This form is upload-ready
-       * @var bool
-       */
+        * This form is upload-ready
+        * @var bool
+        */
        private $upload;
        
-       // ###################################################################
        /**
-       * Constructor
-       */
+        * Constructor
+        */
        public function __construct($action, $do, $name = 'issoform')
        {
                $this->action = $action;
@@ -87,40 +86,37 @@ class BSPrinterRootForm extends BSPrinterRootAbstract
                return $obj->newInstanceArgs($args);
        }
        
-       // ###################################################################
        /**
-       * Should this form be used for upload?
-       *
-       * @param        bool    Upload?
-       * 
-       * @return       fluent interface
-       */
+        * Should this form be used for upload?
+        *
+        * @param       bool    Upload?
+        
+        * @return      fluent interface
+        */
        public function setUpload($upload)
        {
                $this->upload = $upload;
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Adds a table row into the child list
-       *
-       * @param        BSPrinterAbstract       Table element
-       * 
-       * @return       fluent interface
-       */
+        * Adds a table row into the child list
+        *
+        * @param       BSPrinterAbstract       Table element
+        
+        * @return      fluent interface
+        */
        public function addChild(BSPrinterAbstract $tr)
        {
                $this->children[] = $tr;
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Returns the HTML for all printed children elements
-       *
-       * @return       string  Printed HTML
-       */
+        * Returns the HTML for all printed children elements
+        *
+        * @return      string  Printed HTML
+        */
        protected function _paintChildren()
        {
                $builder = '';
@@ -133,12 +129,11 @@ class BSPrinterRootForm extends BSPrinterRootAbstract
                return $builder;
        }
        
-       // ###################################################################
        /**
-       * Paints the <table>
-       *
-       * @return       string  Table HTML code
-       */
+        * Paints the <table>
+        *
+        * @return      string  Table HTML code
+        */
        public function paint()
        {
                array_push($this->children, new BSPrinterElement('hidden', 'do', $this->do));
index ed54f9567c8ad9a9e58f13826a2173d0918e8490..2724239f9e0a10d1fd052b1e60551b48950fcf2f 100644 (file)
 \*=====================================================================*/
 
 /**
-* Printer Root Element: Page (PrinterRootPage.php)
-*
-* @package     ISSO
-*/
+ * Printer Root Element: Page (PrinterRootPage.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/PrinterRootAbstract.php');
 
 /**
-* Printer Root Element: Page
-*
-* This root element represents the entire page and is usually used for all
-* printer applications
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-*
-*/
+ * Printer Root Element: Page
+ *
+ * This root element represents the entire page and is usually used for all
+ * printer applications
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ *
+ */
 class BSPrinterRootPage extends BSPrinterRootAbstract
 {
        /**
-       * The page title
-       * @var string
-       */
+        * The page title
+        * @var string
+        */
        private $title;
        
        /**
@@ -52,12 +52,11 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
         */
        private $navigator;
        
-       // ###################################################################
        /**
-       * Constructor
-       *
-       * @param        string  Page title
-       */
+        * Constructor
+        *
+        * @param       string  Page title
+        */
        function __construct($title)
        {
                $this->title = $title;
@@ -98,15 +97,14 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
                return $this->navigatior;
        }
        
-       // ###################################################################
        /**
-       * Creates a redirect to another page; constructs the header and footer
-       * (therefore execution stops)
-       *
-       * @param        string  Location
-       * @param        string  Redirect message to be shown
-       * @param        array   An aray of POST variables to send through on the redirect
-       */
+        * Creates a redirect to another page; constructs the header and footer
+        * (therefore execution stops)
+        *
+        * @param       string  Location
+        * @param       string  Redirect message to be shown
+        * @param       array   An aray of POST variables to send through on the redirect
+        */
        public static function redirect($location, $message = null, $postvars = array())
        {
                if (!defined('ISSO_PRINTER_NO_NAVIGATION'))
@@ -168,15 +166,14 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
                exit;
        }
        
-       // ###################################################################
        /**
-       * Prints a complete table message
-       *
-       * @param        string  Message title
-       * @param        string  Message text
-       *
-       * @return       BSPrinterRootTable      A table
-       */
+        * Prints a complete table message
+        *
+        * @param       string  Message title
+        * @param       string  Message text
+        *
+        * @return      BSPrinterRootTable      A table
+        */
        public static function message($title, $message)
        {
                $table = new BSPrinterRootTable();
@@ -193,17 +190,16 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
                return $table;
        }
        
-       // ###################################################################
        /**
-       * Produces an entire page layout that asks the user whether or not
-       * they want to perform X action and provides a link to the YES and NO
-       * action
-       *
-       * @param        string  Message that asks if they want to do X
-       * @param        string  Location to go to if the user confirms
-       * @param        string  Form 'do' value
-       * @param        array   Hidden parameters to pass to the next page
-       */
+        * Produces an entire page layout that asks the user whether or not
+        * they want to perform X action and provides a link to the YES and NO
+        * action
+        *
+        * @param       string  Message that asks if they want to do X
+        * @param       string  Location to go to if the user confirms
+        * @param       string  Form 'do' value
+        * @param       array   Hidden parameters to pass to the next page
+        */
        public static function confirm($message, $action, $do, $params)
        {
                if (!defined('ISSO_PRINTER_NO_NAVIGATION'))
@@ -239,12 +235,11 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
                exit;
        }
        
-       // ###################################################################
        /**
-       * Throws a fatal error message
-       *
-       * @param        string  Error string
-       */
+        * Throws a fatal error message
+        *
+        * @param       string  Error string
+        */
        public static function error($message)
        {
                if (!defined('ISSO_PRINTER_NO_NAVIGATION'))
@@ -259,12 +254,11 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
                exit;
        }
        
-       // ###################################################################
        /**
-       * Returns the HTML for all printed children elements
-       *
-       * @return       string  Printed HTML
-       */
+        * Returns the HTML for all printed children elements
+        *
+        * @return      string  Printed HTML
+        */
        protected function _paintChildren()
        {
                $builder = '';
@@ -277,10 +271,9 @@ class BSPrinterRootPage extends BSPrinterRootAbstract
                return $builder;
        }
        
-       // ###################################################################
        /**
-       * Tells the element to paint itself (and any children)
-       */
+        * Tells the element to paint itself (and any children)
+        */
        public function paint()
        {
                $language = BSPrinter::get_language_information();
index 395b0f82f4fd33dfa68bae186d9558d2881e4447..108f58bee4955da5659793d2bbe4d8ae2bc5ba80 100644 (file)
 \*=====================================================================*/
 
 /**
-* Printer Root Element: Table (PrinterRootTable.php)
-*
-* @package     ISSO
-*/
+ * Printer Root Element: Table (PrinterRootTable.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/PrinterRootAbstract.php');
 
 /**
-* Printer Root Element: Table
-*
-* Represents a <table> object. This can have a parent or not: if it does,
-* then it will be painted as a child, otherwise it will act as a root.
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-*
-*/
+ * Printer Root Element: Table
+ *
+ * Represents a <table> object. This can have a parent or not: if it does,
+ * then it will be painted as a child, otherwise it will act as a root.
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ *
+ */
 class BSPrinterRootTable extends BSPrinterRootAbstract
 {
        /**
-       * Maximum number of columns
-       * @var integer
-       */
+        * Maximum number of columns
+        * @var integer
+        */
        private $colspan = 0;
        
        /**
-       * Heading child elements
-       * @var array
-       */
+        * Heading child elements
+        * @var array
+        */
        private $headers = array();
        
        /**
-       * Width of the table
-       * @var string
-       */
+        * Width of the table
+        * @var string
+        */
        private $width = '90%';
        
-       // ###################################################################
        /**
-       * Constructor
-       */
+        * Constructor
+        */
        public function __construct()
        {
                $this->setCssClass('tborder');
@@ -79,14 +78,13 @@ class BSPrinterRootTable extends BSPrinterRootAbstract
                return $obj->newInstanceArgs($args);
        }
        
-       // ###################################################################
        /**
-       * Adds a table row into the child list
-       *
-       * @param        BSPrinterElementTable   Table element
-       * 
-       * @return       fluent interface
-       */
+        * Adds a table row into the child list
+        *
+        * @param       BSPrinterElementTable   Table element
+        
+        * @return      fluent interface
+        */
        public function addChild(BSPrinterAbstract $tr)
        {
                if (!$tr instanceof BSPrinterElementTable)
@@ -97,40 +95,37 @@ class BSPrinterRootTable extends BSPrinterRootAbstract
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Adds a table element to be a heading of the table. This is still
-       * considered a child, but it goes before all other child elemends
-       *
-       * @param        BSPrinterElementTable   Child element
-       * 
-       * @return       fluent interface
-       */
+        * Adds a table element to be a heading of the table. This is still
+        * considered a child, but it goes before all other child elemends
+        *
+        * @param       BSPrinterElementTable   Child element
+        
+        * @return      fluent interface
+        */
        public function addHeadingChild(BSPrinterElementTable $tr)
        {
                $this->headers[] = $tr;
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Sets the width of the table
-       *
-       * @param        string  Width value
-       * 
-       * @return       fluent interface
-       */
+        * Sets the width of the table
+        *
+        * @param       string  Width value
+        
+        * @return      fluent interface
+        */
        public function setWidth($width)
        {
                $this->width = $width;
                return $this;
        }
        
-       // ###################################################################
        /**
-       * Calculates the number of columns to display based on the colspan
-       * of children elements
-       */
+        * Calculates the number of columns to display based on the colspan
+        * of children elements
+        */
        private function _calculateColumnCount()
        {
                foreach ($this->children as $child)
@@ -142,12 +137,11 @@ class BSPrinterRootTable extends BSPrinterRootAbstract
                }
        }
        
-       // ###################################################################
        /**
-       * Returns the HTML for all printed children elements
-       *
-       * @return       string  Printed HTML
-       */
+        * Returns the HTML for all printed children elements
+        *
+        * @return      string  Printed HTML
+        */
        protected function _paintChildren()
        {
                $builder = '';
@@ -166,12 +160,11 @@ class BSPrinterRootTable extends BSPrinterRootAbstract
                return $builder;
        }
        
-       // ###################################################################
        /**
-       * Paints the <table>
-       *
-       * @return       string  Table HTML code
-       */
+        * Paints the <table>
+        *
+        * @return      string  Table HTML code
+        */
        public function paint()
        {
                return "<br />\n<table cellpadding=\"4\" cellspacing=\"1\" border=\"0\" align=\"center\" width=\"" . $this->width . "\"" . $this->_prepareStyle() . ">" . $this->_paintChildren() . "\n</table>";
index b15d749219200d6852f286a8ebaa896e92f6ae94..5e135667f8b904776c0ed388a73051a97c56c3bb 100644 (file)
 \*=====================================================================*/
 
 /**
-* Database-Driven Template System (template.php)
-*
-* @package     ISSO
-*/
+ * Database-Driven Template System (template.php)
+ *
+ * @package    ISSO
+ */
 
 require_once(ISSO . '/Functions.php');
 
 /**
-* File-Based Template System
-*
-* This framework merely replaces the template loading functions with
-* file-system based ones. It has an optional caching system in which
-* template data will remain stored in the database as long as the filesystem
-* file is modified. To do this, pass a table name to setDatabaseCache() and make sure
-* there's a DB module that has access to a table with this schema:
-*
-* CREATE TABLE template (filename VARCHAR (250) NOT NULL, template TEXT NOT NULL, timestamp INT NOT NULL);
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO
-* 
-*/
+ * File-Based Template System
+ *
+ * This framework merely replaces the template loading functions with
+ * file-system based ones. It has an optional caching system in which
+ * template data will remain stored in the database as long as the filesystem
+ * file is modified. To do this, pass a table name to setDatabaseCache() and make sure
+ * there's a DB module that has access to a table with this schema:
+ *
+ * CREATE TABLE template (filename VARCHAR (250) NOT NULL, template TEXT NOT NULL, timestamp INT NOT NULL);
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO
+ 
+ */
 class BSTemplate
 {
        /**
-       * The path, from the path of the application, where templates are stored
-       * @var  string
-       */
+        * The path, from the path of the application, where templates are stored
+        * @var string
+        */
        private $templateDir = '';
        
        /**
-       * The extension all the template files have
-       * @var  string
-       */
+        * The extension all the template files have
+        * @var string
+        */
        private $extension = 'tpl';
        
        /**
-       * The database table name for the template cache
-       * @var string
-       */
+        * The database table name for the template cache
+        * @var string
+        */
        private $dbCacheTable = null;
        
        /**
-       * The name of the function phrases are fetched with
-       * @var  string
-       */
+        * The name of the function phrases are fetched with
+        * @var string
+        */
        private $langcall = 'gettext';
        
        /**
-       * The name of the function phrases are sprintf() parsed with
-       * @var  string
-       */
+        * The name of the function phrases are sprintf() parsed with
+        * @var string
+        */
        private $langconst = 'sprintf';
        
        /**
-       * Array of pre-compiled templates that are stored to decrease server load
-       * @var  array
-       */
+        * Array of pre-compiled templates that are stored to decrease server load
+        * @var array
+        */
        protected $cache = array();
        
        /**
-       * A list of templates that weren't cached, but are still used
-       * @var  array
-       */
+        * A list of templates that weren't cached, but are still used
+        * @var array
+        */
        protected $uncached = array();
        
        /**
-       * Whether or not the page has been flush()'d already
-       * @var  bool
-       */
+        * Whether or not the page has been flush()'d already
+        * @var bool
+        */
        private $doneflush = false;
        
        /**
-       * The name of a function that is called before template parsing of phrases and conditionals occurs
-       * @var  string
-       */
+        * The name of a function that is called before template parsing of phrases and conditionals occurs
+        * @var string
+        */
        private $preParseHook = ':undefined:';
        
-       // ###################################################################
        /**
-       * Sets the template directory name
-       *
-       * @param        string  Template directory name
-       */
+        * Sets the template directory name
+        *
+        * @param       string  Template directory name
+        */
        public function setTemplateDirectory($dir)
        {
                $this->templateDir = BSFunctions::fetch_source_path($dir);
        }
        
-       // ###################################################################
        /**
-       * Sets the file extension for the templates
-       *
-       * @param        string  File extension
-       */
+        * Sets the file extension for the templates
+        *
+        * @param       string  File extension
+        */
        public function setExtension($ext)
        {
                $this->extension = $ext;
        }
        
-       // ###################################################################
        /**
-       * Sets the name of the table to access for the datbase cache
-       *
-       * @param        string  DB table name
-       */
+        * Sets the name of the table to access for the datbase cache
+        *
+        * @param       string  DB table name
+        */
        public function setDatabaseCache($table)
        {
                $this->dbCacheTable = $table;
        }
        
-       // ###################################################################
        /**
-       * Sets the pre-parse hook method which is called before any other
-       * processing is done on the template.
-       *
-       * @param        string  Method name
-       */
+        * Sets the pre-parse hook method which is called before any other
+        * processing is done on the template.
+        *
+        * @param       string  Method name
+        */
        public function setPreParseHook($hook)
        {
                $this->preParseHook = $hook;
        }
        
-       // ###################################################################
        /**
-       * Takes an array of template names, loads them, and then stores a
-       * parsed version for optimum speed.
-       *
-       * @param        array   List of template names to be cached
-       */
+        * Takes an array of template names, loads them, and then stores a
+        * parsed version for optimum speed.
+        *
+        * @param       array   List of template names to be cached
+        */
        public function cache($namearray)
        {
                if (sizeof($this->cache) > 0)
@@ -201,15 +196,14 @@ class BSTemplate
                }
        }
        
-       // ###################################################################
        /**
-       * Loads a template from the cache or the _load function and stores the
-       * parsed version of it
-       *
-       * @param        string  The name of the template
-       *
-       * @return       string  A parsed and loaded template
-       */
+        * Loads a template from the cache or the _load function and stores the
+        * parsed version of it
+        *
+        * @param       string  The name of the template
+        *
+        * @return      string  A parsed and loaded template
+        */
        public function fetch($name)
        {
                if (isset($this->cache[$name]))
@@ -227,12 +221,11 @@ class BSTemplate
                return $template;
        }
        
-       // ###################################################################
        /**
-       * Output a template fully compiled to the browser
-       *
-       * @param        string  Compiled and ready template
-       */
+        * Output a template fully compiled to the browser
+        *
+        * @param       string  Compiled and ready template
+        */
        public function flush($template)
        {
                ob_start();
@@ -284,14 +277,13 @@ class BSTemplate
                print($template);
        }
        
-       // ###################################################################
        /**
-       * Loads an additional template from the database
-       *
-       * @param        string  The name of the template
-       *
-       * @return       string  Template data from the database
-       */
+        * Loads an additional template from the database
+        *
+        * @param       string  The name of the template
+        *
+        * @return      string  Template data from the database
+        */
        protected function _loadTemplate($name)
        {
                $path = $this->templateDir . $name . '.' . $this->extension;
@@ -305,14 +297,13 @@ class BSTemplate
                }
        }
        
-       // ###################################################################
        /**
-       * A wrapper for all the parsing functions and compiling functins
-       *
-       * @param        string  Unparsed template data
-       *
-       * @return       string  Parsed template data
-       */
+        * A wrapper for all the parsing functions and compiling functins
+        *
+        * @param       string  Unparsed template data
+        *
+        * @return      string  Parsed template data
+        */
        protected function _parseTemplate($template)
        {
                $template = str_replace('"', '\"', $template);
@@ -328,14 +319,13 @@ class BSTemplate
                return $template;
        }
        
-       // ###################################################################
        /**
-       * Parses anything with curly braces {} (including phrases)
-       *
-       * @param        string  Template data
-       *
-       * @return       string  Parsed template data
-       */
+        * Parses anything with curly braces {} (including phrases)
+        *
+        * @param       string  Template data
+        *
+        * @return      string  Parsed template data
+        */
        private function _parseBlocksAndTokens($template)
        {
                $stack = array();
@@ -384,14 +374,13 @@ class BSTemplate
                }
        }
        
-       // ###################################################################
        /**
-       * Parses a curly brace token {}
-       *
-       * @param        string  Token
-       *
-       * @return       string  Parsed value
-       */
+        * Parses a curly brace token {}
+        *
+        * @param       string  Token
+        *
+        * @return      string  Parsed value
+        */
        private function _parseToken($token)
        {
                // knock of the braces
@@ -409,14 +398,13 @@ class BSTemplate
                }
        }
        
-       // ###################################################################
        /**
-       * Prepares language and locale information inside templates
-       *
-       * @param        string  Template data to be processed
-       *
-       * @return       string  Language-ready template data
-       */
+        * Prepares language and locale information inside templates
+        *
+        * @param       string  Template data to be processed
+        *
+        * @return      string  Language-ready template data
+        */
        private function _parsePhrases($template)
        {
                $tagStart = '<lang ';
@@ -517,14 +505,13 @@ class BSTemplate
                return $template;
        }
        
-       // ###################################################################
        /**
-       * Parser for in-line template conditionals
-       *
-       * @param        string  Template data awaiting processing
-       *
-       * @return       string  Parsed template data
-       */
+        * Parser for in-line template conditionals
+        *
+        * @param       string  Template data awaiting processing
+        *
+        * @return      string  Parsed template data
+        */
        private function _parseConditionals($template)
        {
                // tag data
index 6b7926918d0d4ad5fe5886c0fa8f5a2fb644b567..7ebb49ab84c52bdb258d27e0229e85b48acbe618 100644 (file)
@@ -4,13 +4,13 @@ require_once 'PHPUnit/Framework.php';
 
 
 /**
-* Application Test Suite
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO Tests
-* 
-*/
+ * Application Test Suite
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO Tests
+ 
+ */
 class AppTest extends PHPUnit_Framework_TestCase
 {
        public function setUp()
index e0c7609606cf03222e7ccc7de4df27f8baab1163..282dd347b34fd782ffe7227ca45f0be56be490ea 100644 (file)
@@ -3,13 +3,13 @@
 require_once 'PHPUnit/Framework.php';
 
 /**
-* DateTest
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO Tests
-*
-*/
+ * DateTest
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO Tests
+ *
+ */
 class DateTest extends PHPUnit_Framework_TestCase
 {
        private $fixture;
index 570ae03b64f3ec93261b6a5742953a5b1454b49d..55f9d8f431594eda18c542428d1778e993b8f9e1 100644 (file)
@@ -3,13 +3,13 @@
 require_once 'PHPUnit/Framework.php';
 
 /**
-* Functions Test Suite
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO Tests
-* 
-*/
+ * Functions Test Suite
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO Tests
+ 
+ */
 class FunctionsTest extends PHPUnit_Framework_TestCase
 {
        public function setUp()
index 4c7c174664d01738261226de5dff44da71176886..8079041e871fce522a5eadbd3ef7de9452c049f7 100644 (file)
@@ -3,13 +3,13 @@
 require_once 'PHPUnit/Framework.php';
 
 /**
-* InputTest
-*
-* @author              Blue Static
-* @copyright   Copyright (c)2005 - 2008, Blue Static
-* @package             ISSO Tests
-*
-*/
+ * InputTest
+ *
+ * @author             Blue Static
+ * @copyright  Copyright (c)2005 - 2008, Blue Static
+ * @package            ISSO Tests
+ *
+ */
 class InputTest extends PHPUnit_Framework_TestCase
 {
        private $fixture;