From 492d70752398012a9d18e06945826ef222cab56c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 2 Jan 2006 19:59:13 +0000 Subject: [PATCH] Adding fields and set() methods --- date.php | 23 +++++++++++++++++++++++ db_postgresql.php | 25 ++++++++++++++++++++++++- functions.php | 31 ++++++++++++++++++++++++++++--- mail.php | 40 ++++++++++++++++++++++++++++++++++------ printer.php | 25 ++++++++++++++++++++++++- template.php | 45 ++++++++++++++++++++++++++++++++++++++------- template_fs.php | 28 ++++++++++++++++++++++++++-- xml.php | 25 ++++++++++++++++++++++++- 8 files changed, 221 insertions(+), 21 deletions(-) diff --git a/date.php b/date.php index 17dce5a..cd98203 100644 --- a/date.php +++ b/date.php @@ -81,6 +81,15 @@ class Date */ var $offset = 0; + /** + * Fields array that is used in this module + * @var array + * @access private + */ + var $fields = array( + 'usertz' => array(REQ_NO, null, false) + ); + // ################################################################### /** * Constructor: sets the server's timezone @@ -101,6 +110,20 @@ class Date $this->__construct($registry); } + // ################################################################### + /** + * Sets an ISSO field + * + * @access public + * + * @param string Field name + * @param mixed Value of the field + */ + function set($name, $value) + { + $this->registry->do_set($name, $value, 'date'); + } + // ################################################################### /** * Computes the total offset, taking into account all the various diff --git a/db_postgresql.php b/db_postgresql.php index ff340a2..541c974 100644 --- a/db_postgresql.php +++ b/db_postgresql.php @@ -65,10 +65,19 @@ class DB_PostgreSQL extends DB_Abstract /** * Port number to connect to * @var integer - * @access public + * @access private */ var $port = 5432; + /** + * Fields array that is used in this module + * @var array + * @access private + */ + var $fields = array( + 'port' => array(REQ_NO, null, true) + ); + // ################################################################### /** * Constructor @@ -87,6 +96,20 @@ class DB_PostgreSQL extends DB_Abstract $this->__construct($registry); } + // ################################################################### + /** + * Sets an ISSO field + * + * @access public + * + * @param string Field name + * @param mixed Value of the field + */ + function set($name, $value) + { + $this->registry->do_set($name, $value, 'db_postgresql'); + } + // ################################################################### /** * Wrapper: pg_connect diff --git a/functions.php b/functions.php index 4ff2cde..45eef04 100644 --- a/functions.php +++ b/functions.php @@ -50,21 +50,21 @@ class Functions /** * The path that is used to set cookies * @var string - * @access public + * @access pprivateublic */ var $cookiepath = '/'; /** * The domain used for cookie setting * @var string - * @access public + * @access private */ var $cookiedom = ''; /** * The time it takes for a cookie to expire * @var integer - * @access public + * @access private */ var $cookieexp = 900; @@ -75,6 +75,17 @@ class Functions */ var $bgcolour = ''; + /** + * Fields array that is used in this module + * @var array + * @access private + */ + var $fields = array( + 'cookiepath' => array(REQ_YES, null, true), + 'cookiedom' => array(REQ_YES, null, true), + 'cookieexp' => array(REQ_YES, null, true) + ); + // ################################################################### /** * Constructor @@ -93,6 +104,20 @@ class Functions $this->__construct($registry); } + // ################################################################### + /** + * Sets an ISSO field + * + * @access public + * + * @param string Field name + * @param mixed Value of the field + */ + function set($name, $value) + { + $this->registry->do_set($name, $value, 'functions'); + } + // ################################################################### /** * Sets a cookie with a friendly interface diff --git a/mail.php b/mail.php index 0c60a10..1a7f719 100644 --- a/mail.php +++ b/mail.php @@ -50,45 +50,59 @@ class Mail /** * The message recipient's email address * @var string - * @access public + * @access private */ var $to = ''; /** * The subject of the message * @var string - * @access public + * @access private */ var $subject = ''; /** * Body of the message * @var string - * @access public + * @access private */ var $body = ''; /** * The message sender's email address * @var string - * @access public + * @access private */ var $from = ''; /** * The message sender's display name * @var string - * @access public + * @access private */ var $fromname = ''; /** * Additional message headers * @var string - * @access public + * @access private */ var $headers = ''; + /** + * Fields array that is used in this module + * @var array + * @access private + */ + var $fields = array( + 'to' => array(REQ_YES, null, false), + 'subject' => array(REQ_YES, null, false), + 'body' => array(REQ_YES, null, false), + 'from' => array(REQ_YES, null, false), + 'fromname' => array(REQ_NO, null, false), + 'headers' => array(REQ_NO, null, false) + ); + // ################################################################### /** * Constructor @@ -107,6 +121,20 @@ class Mail $this->__construct($registry); } + // ################################################################### + /** + * Sets an ISSO field + * + * @access public + * + * @param string Field name + * @param mixed Value of the field + */ + function set($name, $value) + { + $this->registry->do_set($name, $value, 'mail'); + } + // ################################################################### /** * Sends an email to the specified address with the specified diff --git a/printer.php b/printer.php index 5a59ce7..daaa3aa 100644 --- a/printer.php +++ b/printer.php @@ -60,7 +60,7 @@ class Printer /** * Realm that we are operating in (displayed in the ) * @var string - * @access public + * @access private */ var $realm = '[UNDEFINED REALM]'; @@ -71,6 +71,15 @@ class Printer */ var $css = ''; + /** + * Fields array that is used in this module + * @var array + * @access private + */ + var $fields = array( + 'realm' => array(REQ_YES, null, false) + ); + // ################################################################### /** * Constructor @@ -89,6 +98,20 @@ class Printer $this->__construct($registry); } + // ################################################################### + /** + * Sets an ISSO field + * + * @access public + * + * @param string Field name + * @param mixed Value of the field + */ + function set($name, $value) + { + $this->registry->do_set($name, $value, 'printer'); + } + // ################################################################### /** * Creates a redirect to another page; constructs the header and footer diff --git a/template.php b/template.php index 204445d..02cc71a 100644 --- a/template.php +++ b/template.php @@ -54,42 +54,42 @@ class Template /** * Name of the database table templates are in * @var string - * @access public + * @access private */ var $tablename = ''; /** * Name of the table column template names are in * @var string - * @access public + * @access private */ var $namecolumn = ''; /** * Name of the table column templates are in * @var string - * @access public + * @access private */ var $datacolumn = ''; /** * Additional WHERE clauses for the template fetch SQL * @var string - * @access public + * @access private */ var $extrawhere = ''; /** * The name of the function phrases are fetched with * @var string - * @access public + * @access private */ var $langcall = '$GLOBALS[\'isso:null-framework\']->modules[\'localize\']->string'; /** * The name of the function phrases are sprintf() parsed with * @var string - * @access public + * @access private */ var $langconst = 'sprintf'; @@ -124,10 +124,25 @@ class Template /** * The name of a function that is called before template parsing of phrases and conditionals occurs * @var string - * @access public + * @access private */ var $pre_parse_hook = ':=NO METHOD=:'; + /** + * Fields array that is used in this module + * @var array + * @access private + */ + var $fields = array( + 'tablename' => array(REQ_YES, null, false), + 'namecolumn' => array(REQ_YES, null, false), + 'datacolumn' => array(REQ_YES, null, false), + 'extrawhere' => array(REQ_NO, null, false), + 'langcall' => array(REQ_YES, null, true), + 'langconst' => array(REQ_YES, null, true), + 'pre_parse_hook' => array(REQ_NO, null, false) + ); + // ################################################################### /** * Constructor @@ -146,6 +161,20 @@ class Template $this->__construct($registry); } + // ################################################################### + /** + * Sets an ISSO field + * + * @access public + * + * @param string Field name + * @param mixed Value of the field + */ + function set($name, $value) + { + $this->registry->do_set($name, $value, 'template'); + } + // ################################################################### /** * Takes an array of template names, loads them, and then stores a @@ -157,6 +186,8 @@ class Template */ function cache($namearray) { + $this->registry->check_isso_fields(); + if (sizeof($this->cache) > 0) { trigger_error('You cannot cache templates more than once per initialization', E_USER_WARNING); diff --git a/template_fs.php b/template_fs.php index 838f5d9..318dbda 100644 --- a/template_fs.php +++ b/template_fs.php @@ -45,17 +45,27 @@ class Template_FS extends Template /** * The path, from the path of the application, where templates are stored * @var string - * @access public + * @access private */ var $templatedir = ''; /** * The extension all the template files have * @var string - * @access public + * @access private */ var $extension = 'tpl'; + /** + * Fields array that is used in this module + * @var array + * @access private + */ + var $fields = array( + 'templatedir' => array(REQ_YES, '$this->registry->fetch_sourcepath', false), + 'extension' => array(REQ_YES, null, false) + ); + // ################################################################### /** * Constructor @@ -74,6 +84,20 @@ class Template_FS extends Template $this->__construct($registry); } + // ################################################################### + /** + * Sets an ISSO field + * + * @access public + * + * @param string Field name + * @param mixed Value of the field + */ + function set($name, $value) + { + $this->registry->do_set($name, $value, 'template_fs'); + } + // ################################################################### /** * Takes an array of template names, loads them, and then stores a diff --git a/xml.php b/xml.php index 5605a67..96ddff6 100644 --- a/xml.php +++ b/xml.php @@ -56,7 +56,7 @@ class XML /** * An array of function names that are to be executed for each tag name (name => function) * @var array() - * @access public + * @access private */ var $taghandler = array(); @@ -88,6 +88,15 @@ class XML */ var $result = array(); + /** + * Fields array that is used in this module + * @var array + * @access private + */ + var $fields = array( + 'taghandler' => array(REQ_NO, null, false) + ); + // ################################################################### /** * Constructor @@ -106,6 +115,20 @@ class XML $this->__construct($registry); } + // ################################################################### + /** + * Sets an ISSO field + * + * @access public + * + * @param string Field name + * @param mixed Value of the field + */ + function set($name, $value) + { + $this->registry->do_set($name, $value, 'xml'); + } + // ################################################################### /** * Parse an XML file -- 2.22.5