Refactoring all the static functions to not use the upper camel-case nomenclature...
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 13 Jan 2008 08:19:10 +0000 (00:19 -0800)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 13 Jan 2008 08:19:10 +0000 (00:19 -0800)
14 files changed:
Api.php
App.php
Date.php
Db.php
Functions.php
Input.php
Installer.php
Mail.php
Pagination.php
Printer.php
PrinterNavigation.php
PrinterRootElementPage.php
PrinterTableElement.php
Template.php

diff --git a/Api.php b/Api.php
index 47ca47dab8ed3d2551735ab53b3f0587a296f5c7..227240e01f4e49f6224cd0425cb4edb3b28b4bbf 100644 (file)
--- a/Api.php
+++ b/Api.php
@@ -139,7 +139,7 @@ abstract class BSApi
        */
        public function __construct()
        {
-               BSApp::RequiredModules(array('Db', 'Input'));
+               BSApp::required_modules(array('Db', 'Input'));
        }
        
        // ###################################################################
@@ -186,7 +186,7 @@ abstract class BSApi
                        throw new Exception('Field "' . $field . '" is not valid');
                }
                
-               $this->values["$field"] = ($doclean ? BSApp::Registry()->getType('Input')->clean($value, $this->fields["$field"][F_TYPE]) : $value);
+               $this->values["$field"] = ($doclean ? BSApp::registry()->getType('Input')->clean($value, $this->fields["$field"][F_TYPE]) : $value);
                
                $this->setfields["$field"] = $field;
                
@@ -267,7 +267,7 @@ abstract class BSApi
                
                $this->_runActionMethod('pre_fetch', $doPre);
                
-               $result = BSApp::Registry()->getType('Db')->queryFirst("SELECT * FROM {$this->prefix}{$this->table} WHERE {$this->condition}");
+               $result = BSApp::registry()->getType('Db')->queryFirst("SELECT * FROM {$this->prefix}{$this->table} WHERE {$this->condition}");
                if (!$result)
                {
                        return false;
@@ -301,9 +301,9 @@ abstract class BSApi
                        $values[] = $this->_prepareFieldForSql($field);
                }
                
-               BSApp::Registry()->getType('Db')->query("INSERT INTO {$this->prefix}{$this->table} (" . implode(',', $fields) . ") VALUES (" . implode(',', $values) . ")");
+               BSApp::registry()->getType('Db')->query("INSERT INTO {$this->prefix}{$this->table} (" . implode(',', $fields) . ") VALUES (" . implode(',', $values) . ")");
                
-               if (BSApp::Registry()->getType('DbPostgreSql'))
+               if (BSApp::registry()->getType('DbPostgreSql'))
                {
                        foreach ($this->fields AS $field => $info)
                        {
@@ -314,11 +314,11 @@ abstract class BSApi
                                }
                        }
                        
-                       $this->insertid = BSApp::Registry()->getType('Db')->insertId($this->prefix . $this->table, $autofield);
+                       $this->insertid = BSApp::registry()->getType('Db')->insertId($this->prefix . $this->table, $autofield);
                }
                else
                {
-                       $this->insertid = BSApp::Registry()->getType('Db')->insertId();
+                       $this->insertid = BSApp::registry()->getType('Db')->insertId();
                }
                
                $this->_runActionMethod('post_insert', $doPost);
@@ -348,7 +348,7 @@ abstract class BSApi
                }
                $updates = implode(', ', $updates);
                
-               BSApp::Registry()->getType('Db')->query("UPDATE {$this->prefix}{$this->table} SET $updates WHERE {$this->condition}");
+               BSApp::registry()->getType('Db')->query("UPDATE {$this->prefix}{$this->table} SET $updates WHERE {$this->condition}");
                
                $this->_runActionMethod('post_update', $doPost);
        }
@@ -371,7 +371,7 @@ abstract class BSApi
                
                $this->_runActionMethod('pre_remove', $doPre);
                
-               BSApp::Registry()->getType('Db')->query("DELETE FROM {$this->prefix}{$this->table} WHERE {$this->condition}");
+               BSApp::registry()->getType('Db')->query("DELETE FROM {$this->prefix}{$this->table} WHERE {$this->condition}");
                
                $this->_runActionMethod('post_remove', $doPost);
        }
@@ -430,7 +430,7 @@ abstract class BSApi
                
                if ($type == TYPE_NONE OR $type == TYPE_STR OR $type == TYPE_STRUN)
                {
-                       return "'" . BSApp::Registry()->getType('Db')->escapeString($this->values["$name"]) . "'";
+                       return "'" . BSApp::registry()->getType('Db')->escapeString($this->values["$name"]) . "'";
                }
                else if ($type == TYPE_BOOL)
                {
@@ -438,7 +438,7 @@ abstract class BSApi
                }
                else if ($type == TYPE_BIN)
                {
-                       return "'" . BSApp::Registry()->getType('Db')->escapeBinary($this->values["$name"]) . "'";
+                       return "'" . BSApp::registry()->getType('Db')->escapeBinary($this->values["$name"]) . "'";
                }
                else
                {
@@ -482,7 +482,7 @@ abstract class BSApi
        */
        protected function _verifyIsNotUnique($field)
        {
-               $res = BSApp::Registry()->getType('Db')->queryFirst("SELECT $field FROM {$this->prefix}{$this->table} WHERE $field = " . $this->_prepareFieldForSql($field) . (empty($this->condition) ? "" : " AND !({$this->condition})"));
+               $res = BSApp::registry()->getType('Db')->queryFirst("SELECT $field FROM {$this->prefix}{$this->table} WHERE $field = " . $this->_prepareFieldForSql($field) . (empty($this->condition) ? "" : " AND !({$this->condition})"));
                if ($res)
                {
                        $this->_error(new FieldException(sprintf(_('The "%1$s" field must contain a unique value'), $field), $field));
diff --git a/App.php b/App.php
index 9c95af3265dd918a1cbae4f75c1d34fa5e3d826a..5869303709dc6168841456ee0eaa8860307d5ba3 100644 (file)
--- a/App.php
+++ b/App.php
@@ -133,7 +133,7 @@ class BSApp
        *
        * @return       object  BSApp instance
        */
-       private static function _Instance()
+       private static function _instance()
        {
                if (!self::$instance)
                {
@@ -148,9 +148,9 @@ class BSApp
        *
        * @param        string  Application name
        */
-       public static function SetApplication($name)
+       public static function set_application($name)
        {
-               self::_Instance()->application = $name;
+               self::_instance()->application = $name;
        }
        
        // ###################################################################
@@ -159,9 +159,9 @@ class BSApp
        *
        * @return       string  Application name
        */
-       public static function GetApplication()
+       public static function get_application()
        {
-               return self::_Instance()->application;
+               return self::_instance()->application;
        }
        
        // ###################################################################
@@ -170,9 +170,9 @@ class BSApp
        *
        * @param        string  Path
        */
-       public static function SetAppPath($path)
+       public static function set_app_path($path)
        {
-               self::_Instance()->appPath = BSFunctions::FetchSourcePath($path);
+               self::_instance()->appPath = BSFunctions::fetch_source_path($path);
        }
        
        // ###################################################################
@@ -181,9 +181,9 @@ class BSApp
        *
        * @return       string  Application path
        */
-       public static function GetAppPath()
+       public static function get_app_path()
        {
-               return self::_Instance()->appPath;
+               return self::_instance()->appPath;
        }
        
        // ###################################################################
@@ -192,9 +192,9 @@ class BSApp
        *
        * @param        string  Application version
        */
-       public static function SetAppVersion($vers)
+       public static function set_app_version($vers)
        {
-               self::_Instance()->appVersion = $vers;
+               self::_instance()->appVersion = $vers;
        }
        
        // ###################################################################
@@ -203,9 +203,9 @@ class BSApp
        *
        * @return       string  Application version
        */
-       public static function GetAppVersion()
+       public static function get_app_version()
        {
-               return self::_Instance()->appVersion;
+               return self::_instance()->appVersion;
        }
        
        // ###################################################################
@@ -215,9 +215,9 @@ class BSApp
        *
        * @param        string  Path
        */
-       public static function SetWebPath($path)
+       public static function set_web_path($path)
        {
-               self::_Instance()->webPath = BSFunctions::FetchSourcePath($path);
+               self::_instance()->webPath = BSFunctions::fetch_source_path($path);
        }
        
        // ###################################################################
@@ -226,9 +226,9 @@ class BSApp
        *
        * @return       string  Application's web path
        */
-       public static function GetWebPath()
+       public static function get_web_path()
        {
-               return self::_Instance()->webPath;
+               return self::_instance()->webPath;
        }
        
        // ###################################################################
@@ -237,9 +237,9 @@ class BSApp
        *
        * @param        bool    Debug mode on?
        */
-       public static function SetDebug($debug)
+       public static function set_debug($debug)
        {
-               self::_Instance()->debug = $debug;
+               self::_instance()->debug = $debug;
        }
        
        // ###################################################################
@@ -248,9 +248,9 @@ class BSApp
        *
        * @return       bool    Debug mode on?
        */
-       public static function GetDebug()
+       public static function get_debug()
        {
-               return self::_Instance()->debug;
+               return self::_instance()->debug;
        }
        
        // ###################################################################
@@ -260,9 +260,9 @@ class BSApp
         *
         * @return      StdClass
         */
-       public static function Registry()
+       public static function registry()
        {
-               return self::_Instance()->registry;
+               return self::_instance()->registry;
        }
        
        // ###################################################################
@@ -272,11 +272,11 @@ class BSApp
        *
        * @param        string  Debug message
        */
-       public static function Debug($msg)
+       public static function debug($msg)
        {
-               if (self::_Instance()->debug)
+               if (self::_instance()->debug)
                {
-                       self::_Instance()->debugInfo[] = $msg;
+                       self::_instance()->debugInfo[] = $msg;
                }
        }
        
@@ -286,10 +286,10 @@ class BSApp
        *
        * @return       string  Debug list
        */
-       public static function GetDebugList()
+       public static function get_debug_list()
        {
-               $output = '<select><option>Debug Notices (' . sizeof(self::_Instance()->debugInfo) . ')</option>';
-               foreach (self::_Instance()->debugInfo AS $notice)
+               $output = '<select><option>Debug Notices (' . sizeof(self::_instance()->debugInfo) . ')</option>';
+               foreach (self::_instance()->debugInfo AS $notice)
                {
                        $output .= "<option>--- $notice</option>";
                }
@@ -304,9 +304,9 @@ class BSApp
        *
        * @return       object  Instantiated module
        */
-       public static function LoadModule($name)
+       public static function load_module($name)
        {
-               if (self::GetDebug())
+               if (self::get_debug())
                {
                        include_once(ISSO . "/$name.php");
                }
@@ -335,11 +335,11 @@ class BSApp
        *
        * @param        array   Array of module names to check for loadedness
        */
-       public static function RequiredModules($modules)
+       public static function required_modules($modules)
        {
                foreach ($modules AS $module)
                {
-                       if (self::Registry()->getType($module) == null)
+                       if (self::registry()->getType($module) == null)
                        {
                                throw new Exception('The ' . $module . ' module is required in order to use this framework module');
                        }
index aa04bc41e1bbc883f76fe1ec66931ae0d37cf307..714539906decdb831a2cd83089d3c5e2fc3f4ab4 100644 (file)
--- a/Date.php
+++ b/Date.php
@@ -87,7 +87,7 @@ class BSDate
        *
        * @return       array   List of timezones
        */
-       public static function FetchTimeZoneList()
+       public static function fetch_time_zone_list()
        {
                $opt = array();
                
diff --git a/Db.php b/Db.php
index f1b5e5102a49183314f54bb3514d340dc2341f5d..0457a0d93dbe684943a4e88ec1a90abeb6f28f58 100644 (file)
--- a/Db.php
+++ b/Db.php
@@ -157,7 +157,7 @@ abstract class BSDb
                        throw new BSDbException($this->_errorString(), $this->_errorNumber(), $string);
                }
                
-               $this->history[] = $history = array('query' => $string, 'time' => BSFunctions::FetchMicrotimeDiff($time), 'trace' => BSFunctions::FormatBacktrace(debug_backtrace()));
+               $this->history[] = $history = array('query' => $string, 'time' => BSFunctions::fetch_microtime_diff($time), 'trace' => BSFunctions::format_backtrace(debug_backtrace()));
                
                if (defined('ISSO_SHOW_QUERIES_LIVE'))
                {
index 3305d9e62f6365471c2da39b80245c174e32bff2..55d369c7769e1e69835a716f626a3f462c7b2bc9 100644 (file)
@@ -80,7 +80,7 @@ class BSFunctions
        *
        * @return       object  Shared instance
        */
-       private function _Instance()
+       private function _instance()
        {
                if (!self::$instance)
                {
@@ -95,9 +95,9 @@ class BSFunctions
        *
        * @param        string  New path
        */
-       public static function SetCookiePath($path)
+       public static function set_cookie_path($path)
        {
-               self::_Instance()->cookiePath = $path;
+               self::_instance()->cookiePath = $path;
        }
        
        // ###################################################################
@@ -106,9 +106,9 @@ class BSFunctions
        *
        * @param        string  Cookie domain
        */
-       public static function SetCookieDomain($domain)
+       public static function set_cookie_domain($domain)
        {
-               self::_Instance()->cookieDomain = $domain;
+               self::_instance()->cookieDomain = $domain;
        }
        
        // ###################################################################
@@ -117,9 +117,9 @@ class BSFunctions
        *
        * @param        integer Cookie timeout
        */
-       public static function SetCookieTimeout($timeout)
+       public static function set_cookie_timeout($timeout)
        {
-               self::_Instance()->cookieTimeout = intval($timeout);
+               self::_instance()->cookieTimeout = intval($timeout);
        }
        
        // ###################################################################
@@ -130,12 +130,12 @@ class BSFunctions
        * @param        string  Value of the cookie, FALSE to clear
        * @param        bool    Is the cookie permanent?
        */
-       public static function Cookie($name, $value, $sticky = true)
+       public static function cookie($name, $value, $sticky = true)
        {
                // expire the cookie
                if ($value === false)
                {
-                       setcookie($name, $value, time() - (2 * self::_Instance()->cookieTimeout), self::_Instance()->cookiePath, self::_Instance()->cookieDomain);
+                       setcookie($name, $value, time() - (2 * self::_instance()->cookieTimeout), self::_instance()->cookiePath, self::_instance()->cookieDomain);
                }
                // set the cookie
                else
@@ -146,10 +146,10 @@ class BSFunctions
                        }
                        else
                        {
-                               $expire = time() + self::_Instance()->cookieTimeout;
+                               $expire = time() + self::_instance()->cookieTimeout;
                        }
                        
-                       setcookie($name, $value, $expire, self::_Instance()->cookiePath, self::_Instance()->cookieDomain);
+                       setcookie($name, $value, $expire, self::_instance()->cookiePath, self::_instance()->cookieDomain);
                }
        }
        
@@ -178,7 +178,7 @@ class BSFunctions
        *
        * @return       string  Path with directory separator ending
        */
-       public static function FetchSourcePath($source)
+       public static function fetch_source_path($source)
        {
                if (substr($source, strlen($source) - 1) != DIRECTORY_SEPARATOR)
                {
@@ -195,9 +195,9 @@ class BSFunctions
        * @param        string  File name of the new file
        * @param        bool    Whether or not to die after stringeaming the file
        */
-       public static function DownloadFile($file, $name, $exit = true)
+       public static function download_file($file, $name, $exit = true)
        {
-               if (self::IsBrowser('ie') OR self::IsBrowser('opera') OR self::IsBrowser('safari'))
+               if (self::is_browser('ie') OR self::is_browser('opera') OR self::is_browser('safari'))
                {
                        $mime = 'application/octetstream';
                }
@@ -229,7 +229,7 @@ class BSFunctions
        *
        * @return       bool    Validity of the email address
        */
-       public static function IsValidEmail($email)
+       public static function is_valid_email($email)
        {
                if (preg_match('#^[a-z0-9\.\-\+_]+?@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}$#i', $email))
                {
@@ -250,7 +250,7 @@ class BSFunctions
        *
        * @param        mixed   False if there is no match, the version if there is
        */
-       public static function IsBrowser($check, $version = '')
+       public static function is_browser($check, $version = '')
        {
                $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
                $browser = array();
@@ -400,7 +400,7 @@ class BSFunctions
        *
        * @return       string  A random string
        */
-       public static function Random($length = 0)
+       public static function random($length = 0)
        {
                // custom high and lows
                if (is_array($length))
@@ -443,7 +443,7 @@ class BSFunctions
        *
        * @return       mixed   Return the elelment of the array that we just put the counter to
        */
-       public static function ArraySetCurrent(&$array, $key)
+       public static function array_set_current(&$array, $key)
        {
                reset($array);
                while (current($array) !== false)
@@ -466,7 +466,7 @@ class BSFunctions
        *
        * @return       float   Microtime difference
        */
-       public static function FetchMicrotimeDiff($mtstart)
+       public static function fetch_microtime_diff($mtstart)
        {
                $mtend = microtime();
                list($startMicro, $startSec) = explode(' ', $mtstart);
@@ -483,7 +483,7 @@ class BSFunctions
        *
        * @return       string  The extension for the specifid file name
        */
-       public static function FetchExtension($filename)
+       public static function fetch_extension($filename)
        {
                $array = explode('.', $filename);
                
@@ -503,7 +503,7 @@ class BSFunctions
        *
        * @return       integer The maximum file upload size in bytes
        */
-       public static function FetchMaxPhpFileSize()
+       public static function fetch_max_php_file_size()
        {
                if ($size = @ini_get('upload_max_filesize'))
                {
@@ -533,9 +533,9 @@ class BSFunctions
        *
        * @return       array   A list of all the files in the specified path
        */
-       public static function ScanDirectory($path, $recurse = true, $ignoreDot = true)
+       public static function scan_directory($path, $recurse = true, $ignoreDot = true)
        {
-               return self::_helpScanDirectory($path, $recurse, $ignoreDot, '');
+               return self::_helpscan_directory($path, $recurse, $ignoreDot, '');
        }
        
        // ###################################################################
@@ -550,10 +550,10 @@ class BSFunctions
        *
        * @return       array   A list of all the files in the specified path
        */
-       private static function _helpScanDirectory($path, $recurse = true, $ignoreDot = true, $pathAdd = '')
+       private static function _help_scan_directory($path, $recurse = true, $ignoreDot = true, $pathAdd = '')
        {
                $filelist = array();
-               $path = self::FetchSourcePath($path);
+               $path = self::fetch_source_path($path);
                
                $dir = new DirectoryIterator($path);
                foreach ($dir AS $file)
@@ -566,7 +566,7 @@ class BSFunctions
                        
                        if ($file->isDir() AND $recurse)
                        {
-                               $filelist = array_merge($filelist, self::_helpScanDirectory($path . $name, $recurse, $ignoreDot, $pathAdd . BSFunctions::FetchSourcePath(str_replace($path, '', $file->getPathname()))));
+                               $filelist = array_merge($filelist, self::_helpscan_directory($path . $name, $recurse, $ignoreDot, $pathAdd . BSFunctions::fetch_source_path(str_replace($path, '', $file->getPathname()))));
                                continue;
                        }
                        
@@ -585,7 +585,7 @@ class BSFunctions
        *
        * @return       string  Text with one type of line break
        */
-       public static function ConvertLineBreaks($text, $convert_to = "\n")
+       public static function convert_line_breaks($text, $convert_to = "\n")
        {
                $text = trim($text);
                $text = str_replace(array("\r\n", "\r", "\n"), "\n", $text);
@@ -602,13 +602,13 @@ class BSFunctions
        *
        * @return       array   Full-valued array
        */
-       public static function ArrayStripEmpty($array)
+       public static function array_strip_empty($array)
        {
                foreach ($array AS $key => $value)
                {
                        if (is_array($array["$key"]))
                        {
-                               $array["$key"] = self::ArrayStripEmpty($array["$key"]);
+                               $array["$key"] = self::array_strip_empty($array["$key"]);
                        }
                        else if (empty($value) OR is_null($value))
                        {
@@ -631,7 +631,7 @@ class BSFunctions
        *
        * @return       string  Formatted output
        */
-       public static function FormatBacktrace($backtrace)
+       public static function format_backtrace($backtrace)
        {
                // Unset call to debug_print_backtrace
                array_shift($backtrace);
@@ -695,7 +695,7 @@ class BSFunctions
        *
        * @return       string  Part of a string
        */
-       public static function Substring($string, $start, $end)
+       public static function substring($string, $start, $end)
        {
                return substr($string, $start, $end - $start);
        }
index 1a25be171a8dfd8dbaffe0a1bf07065326662a13..bfb37e48d32f53e6d60195908876ab6d2488aa32 100644 (file)
--- a/Input.php
+++ b/Input.php
@@ -108,8 +108,8 @@ class BSInput
                set_magic_quotes_runtime(0);
                
                // some debug info that's always useful
-               BSApp::Debug('magic_quotes_gpc = ' . $this->magicquotes);
-               BSApp::Debug('register_globals = ' . ini_get('register_globals'));
+               BSApp::debug('magic_quotes_gpc = ' . $this->magicquotes);
+               BSApp::debug('register_globals = ' . ini_get('register_globals'));
                
                $this->_sanitizeInputData();
                
@@ -209,7 +209,7 @@ class BSInput
        */
        public function escape($str, $force = true)
        {
-               $db = BSApp::Registry()->getType('Db');
+               $db = BSApp::registry()->getType('Db');
                if ($this->magicquotes AND !$force)
                {
                        if ($db)
@@ -420,11 +420,11 @@ class BSInput
                                        throw new Exception('No external hosts are allowed to POST to this application');
                                        exit;
                                }
-                               BSApp::Debug('remote post check = ok');
+                               BSApp::debug('remote post check = ok');
                        }
                        else
                        {
-                               BSApp::Debug('remote post check = FAILED');
+                               BSApp::debug('remote post check = FAILED');
                        }
                }
        }
index c65f47140828f1e8c311bc44a928dfbe617deecd..64c1dded808dbce2fa5546cf9f5ef1a986ca62fa 100644 (file)
@@ -60,7 +60,7 @@ abstract class BSInstaller
        {
                $this->fileName = $fileName;
                
-               BSApp::RequiredModules(array('Input'));
+               BSApp::required_modules(array('Input'));
                
                $methods = get_class_methods($this);
                foreach ($methods AS $name)
@@ -72,7 +72,7 @@ abstract class BSInstaller
                }
                natsort($this->steps);
                                
-               $this->_runStep(BSApp::Registry()->getType('Input')->inputClean('step', TYPE_UINT));
+               $this->_runStep(BSApp::registry()->getType('Input')->inputClean('step', TYPE_UINT));
        }
        
        // ###################################################################
index 22d4ea8949785de96d0cebfdd9adc4c6c776b2ae..d2849856e7aa0fa8021647cbe8db27d3637d3fc7 100644 (file)
--- a/Mail.php
+++ b/Mail.php
@@ -186,18 +186,18 @@ class BSMail
                }
                
                // load the input sanitizer
-               $input = BSApp::Registry()->getType('Input');
+               $input = BSApp::registry()->getType('Input');
                if ($input == null)
                {
-                       BSApp::Debug(ISSO . '/Input not loaded, so manually doing so');
-                       $input = BSApp::LoadModule('Input');
+                       BSApp::debug(ISSO . '/Input not loaded, so manually doing so');
+                       $input = BSApp::load_module('Input');
                }
                
                // make sure we have a mailer
                // TODO - add support for SMTP
                if (!@ini_get('sendmail_path'))
                {
-                       BSApp::Debug("email: no sendmail -> not sending");
+                       BSApp::debug("email: no sendmail -> not sending");
                        return false;
                }
                
@@ -230,7 +230,7 @@ class BSMail
                }
                
                // sanitize the body
-               $bodyText = BSFunctions::ConvertLineBreaks($this->bodyText, $this->delim);
+               $bodyText = BSFunctions::convert_line_breaks($this->bodyText, $this->delim);
                $bodyText = trim($input->unsanitize($bodyText, true));
                if (empty($bodyText))
                {
@@ -238,7 +238,7 @@ class BSMail
                }
                
                // attach additional headers
-               $headers = BSFunctions::ConvertLineBreaks($this->headers, $this->delim);
+               $headers = BSFunctions::convert_line_breaks($this->headers, $this->delim);
                $headers .= ((!preg_match("#{$this->delim}$#", $headers) AND $headers != '') ? "\n" : '') . "From: \"{$fromName}\" <{$from}>" . $this->delim;
                $headers .= "Return-Path: {$from}" . $this->delim;
                $headers .= "X-Mailer: ISSO Mail Framework" . $this->delim;
@@ -250,7 +250,7 @@ class BSMail
                        $boundary = 'ISSO-MULTIPART-' . BSFunctions::Rand(10);
                        $headers .= "Content-Type: multipart/alternative; boundary=\"$boundary\"" . $this->delim;
                        
-                       $bodyHtml = BSFunctions::ConvertLineBreaks($this->bodyHtml, $this->delim);
+                       $bodyHtml = BSFunctions::convert_line_breaks($this->bodyHtml, $this->delim);
                        
                        // first part of the message (plaintext)
                        $body = "--$boundary" . $this->delim;
@@ -281,11 +281,11 @@ class BSMail
                // attempt to send the mail!
                if (mail($tostring, $subject, $body, $headers, "-f {$from}"))
                {
-                       BSApp::Debug("email: sent to $address");
+                       BSApp::debug("email: sent to $address");
                }
                else
                {
-                       BSApp::Debug("email: error sending to $address");
+                       BSApp::debug("email: error sending to $address");
                }
        }
        
@@ -299,7 +299,7 @@ class BSMail
        */
        private function _fetchFirstLine($string)
        {
-               $string = BSFunctions::ConvertLineBreaks($string);
+               $string = BSFunctions::convert_line_breaks($string);
                $broken = explode("\n", $string);
                return $broken[0];
        }
index b8434e12efcb07e457e867537321e3a7ebcd5ef5..a2325f76fd6d4b47313b4b76798054b41e20c84c 100644 (file)
@@ -241,8 +241,8 @@ class BSPagination
                $input = BSApp::GetType('Input');
                if ($input == null)
                {
-                       BSApp::Debug(ISSO . '/Input not loaded, so manually doing so');
-                       $input = BSApp::LoadModule('Input');
+                       BSApp::debug(ISSO . '/Input not loaded, so manually doing so');
+                       $input = BSApp::load_module('Input');
                }
                
                $this->page = $input->inputClean($this->pagevar, TYPE_INT);
index 5075b4d99706cab128981247cbb038882fc04c5b..38ab1a202076f9a67ca86fdd1ca339aedc7718d9 100644 (file)
@@ -84,7 +84,7 @@ class BSPrinter
        *
        * @return       BSPrinter       Singleton instance
        */
-       private static function _Instance()
+       private static function _instance()
        {
                if (!self::$instance)
                {
@@ -99,9 +99,9 @@ class BSPrinter
        *
        * @return       string  Realm
        */
-       public static function GetRealm()
+       public static function get_realm()
        {
-               return self::_Instance()->realm;
+               return self::_instance()->realm;
        }
        
        // ###################################################################
@@ -110,9 +110,9 @@ class BSPrinter
        *
        * @param        string  Realm
        */
-       public static function SetRealm($realm)
+       public static function set_realm($realm)
        {
-               self::_Instance()->realm = $realm;
+               self::_instance()->realm = $realm;
        }
        
        // ###################################################################
@@ -121,9 +121,9 @@ class BSPrinter
        *
        * @return       array   Language array
        */
-       public static function GetLanguageInformation()
+       public static function get_language_information()
        {
-               return self::_Instance()->language;
+               return self::_instance()->language;
        }
        
        // ###################################################################
@@ -132,9 +132,9 @@ class BSPrinter
        *
        * @param        array   Language array
        */
-       public static function SetLanguageInformation($lang)
+       public static function set_language_information($lang)
        {               
-               self::_Instance()->language = $lang;
+               self::_instance()->language = $lang;
        }
        
        // ###################################################################
@@ -143,9 +143,9 @@ class BSPrinter
        *
        * @return       string  Stylesheet link
        */
-       public static function GetStylesheet()
+       public static function get_stylesheet()
        {
-               return self::_Instance()->stylesheet;
+               return self::_instance()->stylesheet;
        }
        
        // ###################################################################
@@ -154,9 +154,9 @@ class BSPrinter
        *
        * @param        string  Path
        */
-       public static function SetStylesheet($stylesheet)
+       public static function set_stylesheet($stylesheet)
        {
-               self::_Instance()->stylesheet = $stylesheet;
+               self::_instance()->stylesheet = $stylesheet;
        }
 }
 
index 739804405e81426f0de9ee0c0d9d58529aef91ad..a22d8b229844fa20a260a495e2b4b934fd0e8a3a 100644 (file)
@@ -177,7 +177,7 @@ class BSPrinterNavigation
                }
                
                $output .= "\n" . '<div id="toplinks">';
-               $output .= "\n\t" . '<div>' . BSApp::GetApplicaiton . ' ' . BSPrinter::GetRealm() . '</div>';
+               $output .= "\n\t" . '<div>' . BSApp::get_application() . ' ' . BSPrinter::get_realm() . '</div>';
                $output .= "\n\t" . '<div id="toplinks-links">' . implode(' &bull; ', $output2) . '</div>';
                $output .= "\n" . '</div>';
                
index 85c7b15003ff8d3b9594d96fc18f18add08bc676..4231c4e1982b5e708607f5f38bc2b75e5ec9732a 100644 (file)
@@ -79,7 +79,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
        * @param        string  Redirect message to be shown
        * @param        array   An aray of POST variables to send through on the redirect
        */
-       public static function Redirect($controller, $action, $message = null, $postvars = array())
+       public static function redirect($controller, $action, $message = null, $postvars = array())
        {
                if (!defined('ISSO_PRINTER_NO_NAVIGATION'))
                {
@@ -135,7 +135,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
                        $override = true;
                }
 
-               $page->addChild(BSPrinterRootElementPage::Message(_('Redirect'), $showmessage));
+               $page->addChild(BSPrinterRootElementPage::message(_('Redirect'), $showmessage));
                
                $page->paint();
                exit;
@@ -150,7 +150,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
        *
        * @return       BSPrinterRootElementTable       A table
        */
-       public static function Message($title, $message)
+       public static function message($title, $message)
        {
                $table = new BSPrinterRootElementTable();
                
@@ -177,7 +177,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
        * @param        string  Action to pass
        * @param        array   Hidden parameters to pass to the next page
        */
-       public static function Confirm($message, $controller, $action, $params)
+       public static function confirm($message, $controller, $action, $params)
        {
                if (!defined('ISSO_PRINTER_NO_NAVIGATION'))
                {
@@ -204,7 +204,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
                $table->addChild(new BSPrinterTableElement(new BSPrinterLabelElement("<blockquote>$message</blockquote>")));
                $no = new BSPrinterBaseElement('button', '__no__', _('No'));
                $no->setOnClick('history.back(1); return false;');
-               $table->addChild(BSPrinterTableElement::RowSubmit(array($no), _('Yes'), null));
+               $table->addChild(BSPrinterTableElement::row_submit(array($no), _('Yes'), null));
                
                $form->addChild($table);
                
@@ -218,7 +218,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
        *
        * @param        string  Error string
        */
-       public static function Error($message)
+       public static function error($message)
        {
                if (!defined('ISSO_PRINTER_NO_NAVIGATION'))
                {
@@ -226,7 +226,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
                }
                
                $page = new BSPrinterRootElementPage(_('Error'));
-               $page->addChild(BSPrinterRootElementPage::Message(_('Error'), $message));
+               $page->addChild(BSPrinterRootElementPage::message(_('Error'), $message));
                $page->paint();
                
                exit;
@@ -256,13 +256,13 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
        */
        public function paint()
        {
-               $language = BSPrinter::GetLanguageInformation();
+               $language = BSPrinter::get_language_information();
                
                echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
                echo "<html xml:lang=\"" . $language['langcode'] . "\" lang=\"" . $language['langcode'] . "\" dir=\"" . $language['direction'] . "\">\n<head>";
-               echo "\n\t<title>" . sprintf(_('%1$s - %2$s - %3$s'), BSApp::GetApplication(), BSPrinter::GetRealm(), $this->title) . "</title>";
+               echo "\n\t<title>" . sprintf(_('%1$s - %2$s - %3$s'), BSApp::get_application(), BSPrinter::get_realm(), $this->title) . "</title>";
                echo "\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . $language['charset'] . "\" />";
-               echo "\n\t<link rel=\"stylesheet\" href=\"" . BSPrinter::GetStylesheet() . "\" />";
+               echo "\n\t<link rel=\"stylesheet\" href=\"" . BSPrinter::get_stylesheet() . "\" />";
                echo "\n</head>\n<body>\n";
                
                if (BSApp::GetType('PrinterNavigation') AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR !constant('ISSO_PRINTER_NO_NAVIGATION')))
@@ -277,7 +277,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
                        echo BSApp::GetType('PrinterNavigation')->constructFooterHtml();
                }
                
-               $copyright = "\n<br />\n<p align=\"center\" class=\"copyright\">\n\t<a href=\"http://www.bluestatic.org\" target=\"_blank\">" . BSApp::GetApplication() . ' ' . BSApp::GetAppVersion() . ", &copy;2002 - " . gmdate('Y') . " Blue Static</a>\n</p>";
+               $copyright = "\n<br />\n<p align=\"center\" class=\"copyright\">\n\t<a href=\"http://www.bluestatic.org\" target=\"_blank\">" . BSApp::get_application() . ' ' . BSApp::get_app_version() . ", &copy;2002 - " . gmdate('Y') . " Blue Static</a>\n</p>";
                                
                if (!defined('ISSO_PRINTER_HIDE_SETUP'))
                {
@@ -285,7 +285,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
                        
                        echo "\n\n\n";
                        
-                       if (BSApp::GetDebug())
+                       if (BSApp::get_debug())
                        {
                                if (defined('SVN') AND preg_match('#^\$Id:?#', constant('SVN')))
                                {
@@ -294,10 +294,10 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
                                
                                if (defined('ISSO_MT_START'))
                                {
-                                       echo "\n<div align=\"center\">Executed in " . round(BSFunctions::FetchMicrotimeDiff(ISSO_MT_START), 10) . ' seconds</div>';
+                                       echo "\n<div align=\"center\">Executed in " . round(BSFunctions::fetch_microtime_diff(ISSO_MT_START), 10) . ' seconds</div>';
                                }
                                
-                               echo "\n<br /><div align=\"center\">" . BSApp::GetDebugList() . "</div>\n";
+                               echo "\n<br /><div align=\"center\">" . BSApp::get_debug_list() . "</div>\n";
                                
                                if (BSApp::GetType('Db'))
                                {
index adffe905126cd5e31f5c89e0287a7bf2423ad492..0f09eed62be58330ff2a0ae3edf821d757b4e457 100644 (file)
@@ -89,7 +89,7 @@ class BSPrinterTableElement extends BSPrinterElement
        *
        * @return       BSPrinterTableElement   Table row element
        */
-       public static function RowLabel($label, $value)
+       public static function row_label($label, $value)
        {
                $tr = new BSPrinterTableElement();
                
@@ -110,7 +110,7 @@ class BSPrinterTableElement extends BSPrinterElement
        *
        * @return       BPrinterTableElement    Table row element
        */
-       public static function RowText($label, $name, $value = null, $password = false)
+       public static function row_text($label, $name, $value = null, $password = false)
        {
                $tr = new BSPrinterTableElement();
                
@@ -130,7 +130,7 @@ class BSPrinterTableElement extends BSPrinterElement
        *
        * @return       BSPrinterTableElement   Table row element
        */
-       public static function RowSubmit(Array $children = null, $save = ':submit:', $reset = ':reset:')
+       public static function row_submit(Array $children = null, $save = ':submit:', $reset = ':reset:')
        {
                $build = '';
                if (sizeof($children) > 0)
@@ -175,7 +175,7 @@ class BSPrinterTableElement extends BSPrinterElement
        *
        * @return       BSPrinterTableElement   Table row
        */
-       public static function RowList($label, $name, Array $options)
+       public static function row_list($label, $name, Array $options)
        {
                $build = '';
                foreach ($options AS $option)
@@ -186,7 +186,7 @@ class BSPrinterTableElement extends BSPrinterElement
                        }
                        else
                        {
-                               throw new Exception('Only BSPrinterBaseElement\'s of type "option" are allowed in BSPrinterTableElement::RowList()');
+                               throw new Exception('Only BSPrinterBaseElement\'s of type "option" are allowed in BSPrinterTableElement::row_list()');
                        }
                }
                
@@ -208,7 +208,7 @@ class BSPrinterTableElement extends BSPrinterElement
        *
        * @return       BSPrinterTableElement   Table row
        */
-       public static function RowCheckbox($label, $name, Array $boxes)
+       public static function row_checkbox($label, $name, Array $boxes)
        {
                $build = '';
                foreach ($boxes AS $boxLabel => $box)
@@ -223,7 +223,7 @@ class BSPrinterTableElement extends BSPrinterElement
                        }
                        else
                        {
-                               throw new Exception('Only BSPrinterBaseElement\'s of type "checkbox" are allowed in BSPrinterTableElement::RowCheckbox()');
+                               throw new Exception('Only BSPrinterBaseElement\'s of type "checkbox" are allowed in BSPrinterTableElement::row_checkbox()');
                        }
                }
                
@@ -245,7 +245,7 @@ class BSPrinterTableElement extends BSPrinterElement
        *
        * @return       BSPrinterTableElement   Upload form
        */
-       public static function RowUpload($label, $name)
+       public static function row_upload($label, $name)
        {
                $tr = new BSPrinterTableElement();
                
@@ -265,7 +265,7 @@ class BSPrinterTableElement extends BSPrinterElement
        *
        * @return       BSPrinterTableElement   Yes-No row
        */
-       public static function RowYesNo($label, $name, $yes)
+       public static function row_yes_no($label, $name, $yes)
        {
                $elm = new BSPrinterBaseElement('radio', $name, 1);
                $elm->setActive($yes);
@@ -293,7 +293,7 @@ class BSPrinterTableElement extends BSPrinterElement
        *
        * @return       BSPrinterTableElement   Table row
        */
-       public static function RowTextarea($label, $name, $value = null)
+       public static function row_textarea($label, $name, $value = null)
        {
                $tr = new BSPrinterTableElement();
                
index 4b2da85c7726800bb9305c81863d5a0b536eef55..d364c471d5f92cfb536bec17294cc622e8f4558d 100644 (file)
@@ -107,7 +107,7 @@ class BSTemplate
        */
        public function setTemplateDirectory($dir)
        {
-               $this->templateDir = BSFunctions::FetchSourcePath($dir);
+               $this->templateDir = BSFunctions::fetch_source_path($dir);
        }
        
        // ###################################################################
@@ -162,7 +162,7 @@ class BSTemplate
                        $dbCache = array();
                        if ($this->dbCacheTable)
                        {
-                               $db =& BSApp::Registry()->getType('Db');
+                               $db =& BSApp::registry()->getType('Db');
                                $cache = $db->query("SELECT * FROM {$this->dbCacheTable} WHERE filename IN ('" . implode("', '", $namearray) . "')");
                                while ($tpl = $cache->fetchArray())
                                {
@@ -219,7 +219,7 @@ class BSTemplate
                else
                {
                        $this->uncached[$name] = (isset($this->uncached[$name]) ? $this->uncached[$name] + 1 : 0);
-                       BSApp::Debug("Manually loading template '$name'");
+                       BSApp::debug("Manually loading template '$name'");
                        $template = $this->_loadTemplate($name);
                        $template = $this->_parseTemplate($template);
                }
@@ -248,10 +248,10 @@ class BSTemplate
                }
                
                $debugBlock = '';
-               if (BSApp::GetDebug())
+               if (BSApp::get_debug())
                {                       
-                       $debugBlock .= "\n<div align=\"center\">Executed in " . round(BSFunctions::FetchMicrotimeDiff('0 ' . $_SERVER['REQUEST_TIME']), 10) . ' seconds</div>';
-                       $debugBlock .= "\n<br /><div align=\"center\">" . BSApp::GetDebugList() . "</div>";
+                       $debugBlock .= "\n<div align=\"center\">Executed in " . round(BSFunctions::fetch_microtime_diff('0 ' . $_SERVER['REQUEST_TIME']), 10) . ' seconds</div>';
+                       $debugBlock .= "\n<br /><div align=\"center\">" . BSApp::get_debug_list() . "</div>";
                        
                        if (sizeof($this->uncached) > 0)
                        {
@@ -262,9 +262,9 @@ class BSTemplate
                                $debugBlock .= "<br /><div style=\"color: red\" align=\"center\"><strong>Uncached Templates:</strong>" . implode(', ', $tpls) . " )</div>\n";
                        }
                        
-                       if (BSApp::Registry()->getType('Db'))
+                       if (BSApp::registry()->getType('Db'))
                        {
-                               $queries = BSApp::Registry()->getType('Db')->getHistory();
+                               $queries = BSApp::registry()->getType('Db')->getHistory();
                                
                                $debugBlock .= "<br />\n" . '<table cellpadding="4" cellspacing="1" border="0" align="center" width="30%" style="background-color: rgb(60, 60, 60); color: white">' . "\n\t" . '<tr><td><strong>Query Debug</strong></td></tr>';
                                
@@ -454,9 +454,9 @@ class BSTemplate
                                                if ($template[$backPos] == '"')
                                                {
                                                        // startPosition + length(startTag) + length(=\")
-                                                       $varMap[intval($varNum)] = BSFunctions::Substring($template, $capturePos + 3, $backPos - 1);
+                                                       $varMap[intval($varNum)] = BSFunctions::substring($template, $capturePos + 3, $backPos - 1);
                                                        // remove our old substitution from the capture
-                                                       $capture = BSFunctions::Substring($template, $backPos + 1, $i);
+                                                       $capture = BSFunctions::substring($template, $backPos + 1, $i);
                                                        break;
                                                }
                                                $backPos--;
@@ -478,7 +478,7 @@ class BSTemplate
                                else if ($template[$i] == '>' AND $template[$i - 1] == '"')
                                {
                                        // the final variable substitution
-                                       $varMap[intval($varNum)] = BSFunctions::Substring($template, $capturePos + 3, $i - 2);
+                                       $varMap[intval($varNum)] = BSFunctions::substring($template, $capturePos + 3, $i - 2);
                                        $varEnds = $i;
                                        break;
                                }
@@ -495,7 +495,7 @@ class BSTemplate
                        }
                        
                        // this is the string that gets variable replacement
-                       $str = BSFunctions::Substring($template, $varEnds + 1, $end);
+                       $str = BSFunctions::substring($template, $varEnds + 1, $end);
                        
                        // create the complete varmap