From c78a753b1654c453cb9216b7cc4321466deeb6aa Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 12 Oct 2006 04:35:24 +0000 Subject: [PATCH] - Starting to convert from the fields system to a get-set system - Removed the localize API - Use gettext for internationalized strings --- api.php | 10 +-- date.php | 88 ++++++++++----------- db_postgresql.php | 29 ++----- dev/changes.txt | 7 ++ functions.php | 82 ++++++++++++++------ kernel.php | 190 +++++----------------------------------------- localize.php | 181 ------------------------------------------- printer.php | 72 ++++++++---------- printer_css.php | 26 +++---- xml.php | 52 ------------- 10 files changed, 178 insertions(+), 559 deletions(-) delete mode 100644 localize.php diff --git a/api.php b/api.php index 7388537..786a6f9 100644 --- a/api.php +++ b/api.php @@ -279,7 +279,7 @@ class API { if ($verify === false) { - $this->error(sprintf($this->registry->modules['localize']->string('Validation of %1$s failed'), $field)); + $this->error(sprintf(_('Validation of %1$s failed'), $field)); } else { @@ -390,7 +390,7 @@ class API $result = $this->registry->modules[ISSO_DB_LAYER]->query_first("SELECT * FROM {$this->prefix}{$this->table} WHERE {$this->condition}"); if (!$result) { - $this->error($this->registry->modules['localize']->string('No records were returned')); + $this->error(_('No records were returned')); return; } @@ -520,7 +520,7 @@ class API { if (!isset($this->values["$name"])) { - $this->error(sprintf($this->registry->modules['localize']->string('Required field %1$s was not set'), $name)); + $this->error(sprintf(_('Required field %1$s was not set'), $name)); } } else if ($options[F_REQ] == REQ_SET) @@ -629,7 +629,7 @@ class API { if ($this->values["$field"] == 0) { - return sprintf($this->registry->modules['localize']->string('The field "%1$s" cannot be zero'), $field); + return sprintf(_('The field "%1$s" cannot be zero'), $field); } return true; @@ -645,7 +645,7 @@ class API { if (empty($this->values["$field"])) { - return sprintf($this->registry->modules['localize']->string('The field "%1$s" cannot be empty'), $field); + return sprintf(_('The field "%1$s" cannot be empty'), $field); } return true; diff --git a/date.php b/date.php index d663412..c5b0243 100644 --- a/date.php +++ b/date.php @@ -81,15 +81,6 @@ 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 @@ -112,31 +103,28 @@ class Date // ################################################################### /** - * Sets an ISSO field + * Sets the user timezone variable * * @access public * - * @param string Field name - * @param mixed Value of the field + * @param integer User time zone */ - function set($name, $value) + function setUserTimezone($tz) { - $this->registry->do_set($name, $value, 'date'); + $this->usertz = $tz; } // ################################################################### /** - * Gets an ISSO field + * Gets the user timezone variable * * @access public * - * @param string Field name - * - * @return mixed Value of the field + * @return integer The user timezone */ - function get($fieldname) + function getUserTimezone() { - return $this->registry->do_get($fieldname, 'date'); + return $this->usertz; } // ################################################################### @@ -187,36 +175,36 @@ class Date { $opt = array(); - $opt['-12'] = $this->registry->modules['localize']->string('(GMT - 12:00) Enitwetok, Kwajalien'); - $opt['-11'] = $this->registry->modules['localize']->string('(GMT - 11:00) Midway Island, Samoa'); - $opt['-10'] = $this->registry->modules['localize']->string('(GMT - 10:00) Hawaii'); - $opt['-9'] = $this->registry->modules['localize']->string('(GMT - 9:00) Alaska'); - $opt['-8'] = $this->registry->modules['localize']->string('(GMT - 8:00) Pacific Time (US & Canada)'); - $opt['-7'] = $this->registry->modules['localize']->string('(GMT - 7:00) Mountain Time (US & Canada)'); - $opt['-6'] = $this->registry->modules['localize']->string('(GMT - 6:00) Central Time (US & Canada)'); - $opt['-5'] = $this->registry->modules['localize']->string('(GMT - 5:00) Eastern Time (US & Canada)'); - $opt['-4'] = $this->registry->modules['localize']->string('(GMT - 4:00) Atlantic Time (Canada)'); - $opt['-3.5'] = $this->registry->modules['localize']->string('(GMT - 3:30) Newfoundland'); - $opt['-3'] = $this->registry->modules['localize']->string('(GMT - 3:00) Brazil, Buenos Aires, Georgetown'); - $opt['-2'] = $this->registry->modules['localize']->string('(GMT - 2:00) Mid-Atlantic, St. Helena'); - $opt['-1'] = $this->registry->modules['localize']->string('(GMT - 1:00) Azores, Cape Verde Islands'); - $opt['0'] = $this->registry->modules['localize']->string('(GMT) London, Dublin, Casablanca'); - $opt['1'] = $this->registry->modules['localize']->string('(GMT + 1:00) Berlin, Madrid, Paris'); - $opt['2'] = $this->registry->modules['localize']->string('(GMT + 2:00) Kaliningrad, South Africa, Warsaws'); - $opt['3'] = $this->registry->modules['localize']->string('(GMT + 3:00) Baghdad, Moscow, Nairobi'); - $opt['3.5'] = $this->registry->modules['localize']->string('(GMT + 3:30) Tehran'); - $opt['4'] = $this->registry->modules['localize']->string('(GMT + 4:00) Abu Dhabi, Tbilisi, Muscat'); - $opt['4.5'] = $this->registry->modules['localize']->string('(GMT + 4:30) Kabul'); - $opt['5'] = $this->registry->modules['localize']->string('(GMT + 5:00) Ekaterinburg, Islamabad, Tashkent'); - $opt['5.5'] = $this->registry->modules['localize']->string('(GMT + 5:30) Calcutta, Madras, New Delhi'); - $opt['6'] = $this->registry->modules['localize']->string('(GMT + 6:00) Almaty, Colomba, Dhakra'); - $opt['7'] = $this->registry->modules['localize']->string('(GMT + 7:00) Bangkok, Hanoi, Jakarta'); - $opt['8'] = $this->registry->modules['localize']->string('(GMT + 8:00) Beijing, Hong Kong, Singapore'); - $opt['9'] = $this->registry->modules['localize']->string('(GMT + 9:00) Seoul, Tokyo, Yakutsk'); - $opt['9.5'] = $this->registry->modules['localize']->string('(GMT + 9:30) Adelaide, Darwin'); - $opt['10'] = $this->registry->modules['localize']->string('(GMT + 10:00) Guam, Papua New Guinea, Sydney'); - $opt['11'] = $this->registry->modules['localize']->string('(GMT + 11:00) Magadan, New Caledonia, Solomon Islands'); - $opt['12'] = $this->registry->modules['localize']->string('(GMT + 12:00) Auckland, Wellington, Fiji'); + $opt['-12'] = _('(GMT - 12:00) Enitwetok, Kwajalien'); + $opt['-11'] = _('(GMT - 11:00) Midway Island, Samoa'); + $opt['-10'] = _('(GMT - 10:00) Hawaii'); + $opt['-9'] = _('(GMT - 9:00) Alaska'); + $opt['-8'] = _('(GMT - 8:00) Pacific Time (US & Canada)'); + $opt['-7'] = _('(GMT - 7:00) Mountain Time (US & Canada)'); + $opt['-6'] = _('(GMT - 6:00) Central Time (US & Canada)'); + $opt['-5'] = _('(GMT - 5:00) Eastern Time (US & Canada)'); + $opt['-4'] = _('(GMT - 4:00) Atlantic Time (Canada)'); + $opt['-3.5'] = _('(GMT - 3:30) Newfoundland'); + $opt['-3'] = _('(GMT - 3:00) Brazil, Buenos Aires, Georgetown'); + $opt['-2'] = _('(GMT - 2:00) Mid-Atlantic, St. Helena'); + $opt['-1'] = _('(GMT - 1:00) Azores, Cape Verde Islands'); + $opt['0'] = _('(GMT) London, Dublin, Casablanca'); + $opt['1'] = _('(GMT + 1:00) Berlin, Madrid, Paris'); + $opt['2'] = _('(GMT + 2:00) Kaliningrad, South Africa, Warsaws'); + $opt['3'] = _('(GMT + 3:00) Baghdad, Moscow, Nairobi'); + $opt['3.5'] = _('(GMT + 3:30) Tehran'); + $opt['4'] = _('(GMT + 4:00) Abu Dhabi, Tbilisi, Muscat'); + $opt['4.5'] = _('(GMT + 4:30) Kabul'); + $opt['5'] = _('(GMT + 5:00) Ekaterinburg, Islamabad, Tashkent'); + $opt['5.5'] = _('(GMT + 5:30) Calcutta, Madras, New Delhi'); + $opt['6'] = _('(GMT + 6:00) Almaty, Colomba, Dhakra'); + $opt['7'] = _('(GMT + 7:00) Bangkok, Hanoi, Jakarta'); + $opt['8'] = _('(GMT + 8:00) Beijing, Hong Kong, Singapore'); + $opt['9'] = _('(GMT + 9:00) Seoul, Tokyo, Yakutsk'); + $opt['9.5'] = _('(GMT + 9:30) Adelaide, Darwin'); + $opt['10'] = _('(GMT + 10:00) Guam, Papua New Guinea, Sydney'); + $opt['11'] = _('(GMT + 11:00) Magadan, New Caledonia, Solomon Islands'); + $opt['12'] = _('(GMT + 12:00) Auckland, Wellington, Fiji'); return $opt; } diff --git a/db_postgresql.php b/db_postgresql.php index 86a18a4..afac834 100644 --- a/db_postgresql.php +++ b/db_postgresql.php @@ -72,15 +72,6 @@ class DB_PostgreSQL extends DB_Abstract */ 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 @@ -101,33 +92,29 @@ class DB_PostgreSQL extends DB_Abstract // ################################################################### /** - * Sets an ISSO field + * Sets the PGSQL port number * * @access public * - * @param string Field name - * @param mixed Value of the field + * @param integer The port number */ - function set($name, $value) + function setPort($port) { - $this->registry->do_set($name, $value, 'db_postgresql'); + $this->port = $port; } // ################################################################### /** - * Gets an ISSO field + * Gets the currently-set port number * * @access public * - * @param string Field name - * - * @return mixed Value of the field + * @return integer The port number */ - function get($fieldname) + function getPort() { - return $this->registry->do_get($fieldname, 'db_postgresql'); + return $this->port; } - // ################################################################### /** diff --git a/dev/changes.txt b/dev/changes.txt index 79ef115..c5ee9a3 100644 --- a/dev/changes.txt +++ b/dev/changes.txt @@ -1,3 +1,10 @@ +2.1.0 +=============== +- Removed the unspecifc set() functions in place of hard-coded ones +- ** API BRAEK ** removed the tag handler feature of the XML processor +- ** API BREAK ** removed the localization module +- Use gettext internally for strings + 2.0.2 =============== - ** API BREAK ** changed Printer->page_start() to be more internationalization-friendly and to use more CSS rather than nested
s [printer.php] diff --git a/functions.php b/functions.php index a1f2492..0aefea5 100644 --- a/functions.php +++ b/functions.php @@ -75,17 +75,6 @@ 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 @@ -106,31 +95,80 @@ class Functions // ################################################################### /** - * Sets an ISSO field + * Sets the cookie path + * + * @access public + * + * @param string Cookie path + */ + function setCookiePath($path) + { + $this->cookiepath = $path; + } + + // ################################################################### + /** + * Gets the cookie path + * + * @access public + * + * @return string The cookie path + */ + function getCookiePath() + { + return $this->cookiepath; + } + + // ################################################################### + /** + * Sets the cookie domain + * + * @access public + * + * @param string Cookie domain + */ + function setCookieDomain($domain) + { + $this->cookiedom = $domain; + } + + // ################################################################### + /** + * Gets the cookie domain * * @access public * - * @param string Field name - * @param mixed Value of the field + * @return string The cookie domain */ - function set($name, $value) + function getCookieDomain() { - $this->registry->do_set($name, $value, 'functions'); + return $this->cookiedom; } // ################################################################### /** - * Gets an ISSO field + * Sets the cookie expiration time * * @access public * - * @param string Field name + * @param integer Cookie expiration time + */ + function setCookiePath($exp) + { + $this->cookieexp = $exp; + } + + // ################################################################### + /** + * Gets the cookie expiration time + * + * @access public * - * @return mixed Value of the field + * @return integer The cookie expiration time */ - function get($fieldname) + function getCookiePath() { - return $this->registry->do_get($fieldname, 'functions'); + return $this->cookieexp; } // ################################################################### @@ -145,8 +183,6 @@ class Functions */ function cookie($name, $value = '', $sticky = true) { - $this->registry->check_isso_fields(get_class($this)); - // expire the cookie if (!$value) { diff --git a/kernel.php b/kernel.php index cab6c2e..5a70fca 100644 --- a/kernel.php +++ b/kernel.php @@ -252,8 +252,6 @@ class ISSO * @access private */ var $fields = array( - 'sourcepath' => array(REQ_YES, 'fetch_sourcepath', false), - 'apppath' => array(REQ_YES, 'fetch_sourcepath', false), 'webpath' => array(REQ_NO, 'fetch_sourcepath', false), 'application' => array(REQ_YES, null, false), 'appversion' => array(REQ_NO, null, false), @@ -281,7 +279,7 @@ class ISSO // attempt to set the sourcepath $path = call_user_func('debug_backtrace'); - $this->set('sourcepath', str_replace('kernel.php', '', $path[0]['file'])); + $this->setSourcePath(str_replace('kernel.php', '', $path[0]['file'])); // start input sanitize using variable_order GPC if (!defined('ISSO_NO_INPUT_SANITIZE')) @@ -306,206 +304,54 @@ class ISSO // ################################################################### /** - * Sets a specified field in the ISSO. This is used to set all the - * required fields that ISSO uses for linking. It replaces the old - * method of setting the instance variables directly. + * Sets the sourcepath * * @access public * - * @param string Field name - * @param mixed Value of the field + * @param string Source path */ - function set($fieldname, $value) + function setSourcePath($path) { - $this->do_set($fieldname, $value, null); + $this->sourcepath = $this->fetch_sourcepath($path); } // ################################################################### /** - * Does the actual setting of the field. set() is defined in each - * module, but this controls the actual data. This is done so that - * there isn't an extra parameter in set() that controls module spaces + * Gets the sourcepath * - * @access protected - * - * @param string Field name - * @param mixed Value - * @param string Module name (as referred to in ISSO->modules[]) to place in - */ - function do_set($fieldname, $value, $module) - { - if ($module == null) - { - $field =& $this->fields["$fieldname"]; - } - else - { - $field =& $this->modules["$module"]->fields["$fieldname"]; - } - - if (is_array($field)) - { - if ($field[1] != null) - { - if (preg_match('#^\$(.*)#', $field[1])) - { - $caller = preg_replace('#^\$(.*)->([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$#', 'array(&$\1, "\2")', $field[1]); - eval('$caller = ' . $caller . ';'); - } - else - { - $caller = array(&$this, $field[1]); - } - - $value = call_user_func($caller, $value); - } - - if ($module == null) - { - $this->$fieldname = $value; - } - else - { - $this->modules["$module"]->$fieldname = $value; - } - - $field[2] = true; - } - else - { - trigger_error('Invalid field `' . $module . '.' . $fieldname . '` specified in ISSO->do_set()', E_USER_ERROR); - } - } - - // ################################################################### - /** - * Fetches the value of a field. This is protected because get() should - * be defined in each module to make a call to this function. - * - * @access protected + * @access public * - * @param string Field name - * @param string Module name (as referred to in ISSO->modules[]) to fetch from + * @return string Source path */ - function do_get($fieldname, $module) + function getSourcePath() { - if ($module == null) - { - $field =& $this->fields["$fieldname"]; - } - else - { - $field =& $this->modules["$module"]->fields["$fieldname"]; - } - - if (is_array($field)) - { - if ($field[2] == false) - { - trigger_error('Field ' . $module . ':: ' . $filedname . ' is not set and therefore cannot be get()', E_USER_ERROR); - } - - if ($module == null) - { - return $this->$fieldname; - } - else - { - return $this->modules["$module"]->$fieldname; - } - - $field[2] = true; - } - else - { - trigger_error('Invalid field `' . $module . '.' . $fieldname . '` specified in ISSO->do_get()', E_USER_ERROR); - } + return $this->sourcepath; } // ################################################################### /** - * Returns the value of an ISSO field. You should not access any instance - * variables directly, use this instead. + * Sets the apppath * * @access public * - * @param string Field name - * - * @return mixed Value of the field + * @param string Application path */ - function get($fieldname) + function setAppPath($path) { - return $this->do_get($fieldname, null); + $this->apppath = $this->fetch_sourcepath($path); } // ################################################################### /** - * Makes sure that all of the required fields in ISSO are set before - * any action is done. This will throw an error block describing - * the fields that need to be set if any are missing. + * Gets the apppath * * @access public * - * @param string Module to check for; null is kernel, string is a module name, false is all - * @param bool Is this a non-error environment that should display all fields? + * @return string Source path */ - function check_isso_fields($module = null, $called = false) + function getAppPath() { - $missing = array(); - - if ($module === false) - { - $modules = $this->show_modules(true); - } - else if ($module === null) - { - $modules = array(get_class($this)); - } - else - { - $modules = array($module); - } - - foreach ($modules AS $module) - { - if (empty($this->modules["$module"]->fields)) - { - continue; - } - - foreach ($this->modules["$module"]->fields AS $name => $field) - { - if ($field[0] == REQ_YES AND $field[2] == false AND $called == false) - { - $missing[] = $module . ':: ' . $name; - } - else if ($called == true AND $field[2] == false) - { - $missing[] = $module . ':: ' . $name . ($field[0] == REQ_YES ? ' (REQUIRED)' : ''); - } - } - } - - if (sizeof($missing) > 0) - { - $error = ($called ? 'The following fields are not set:' : 'You are missing required ISSO fields. Please make sure you have set:'); - $error .= "\n"; - $error .= ''; - - $this->message(($called ? '' : 'Missing ') . 'Fields', $error, ($called ? 1 : 3)); - - if ($called == false) - { - exit; - } - } + return $this->apppath; } // ################################################################### diff --git a/localize.php b/localize.php deleted file mode 100644 index b0480e2..0000000 --- a/localize.php +++ /dev/null @@ -1,181 +0,0 @@ -registry =& $registry; - } - - // ################################################################### - /** - * (PHP 4) Constructor - */ - function Localize(&$registry) - { - $this->__construct($registry); - } - - // ################################################################### - /** - * Initializes the localization system with a table - * - * @access public - * - * @param array Localization table - */ - function init_with_table($table) - { - $this->localtable = $table; - } - - // ################################################################### - /** - * Returns a localized string from the table - * - * @access public - * - * @param string Text to localize - * - * @return string Localized string - */ - function string($key) - { - if (defined('ISSO_LOCALIZE_DEBUG')) - { - return '[@"' . $key . '"]'; - } - - if (isset($this->localtable["$key"])) - { - return $this->localtable["$key"]; - } - - return $key; - } - - // ################################################################### - /** - * Returns a value from the lex table for a specific code - * - * @access public - * - * @param string Lex code - * - * @return string Localized string - */ - function getlex($code) - { - if (defined('ISSO_LOCALIZE_DEBUG')) - { - return '&[@"' . $code . '"]'; - } - - if (isset($this->lextable["$code"])) - { - return $this->lextable["$code"]; - } - - trigger_error('Lex code `' . $code . '` did not appear in the lex table', E_USER_ERROR); - } - - // ################################################################### - /** - * Sets a value in the lex table for easy access of strings - * that are commonly used - * - * @access public - * - * @param string Lex code - * @param string Text equiv - */ - function setlex($code, $value) - { - if (isset($this->lextable["$code"])) - { - trigger_error('Cannot set lex `' . $code . '` : value already exists', E_USER_ERROR); - } - - $this->lextable["$code"] = $value; - } -} - -/*=====================================================================*\ -|| ################################################################### -|| # $HeadURL$ -|| # $Id$ -|| ################################################################### -\*=====================================================================*/ -?> \ No newline at end of file diff --git a/printer.php b/printer.php index b738a19..a3c7a47 100644 --- a/printer.php +++ b/printer.php @@ -89,15 +89,6 @@ class Printer */ var $language = array('langcode' => 'en_US', 'direction' => 'ltr', 'charset' => 'utf-8'); - /** - * Fields array that is used in this module - * @var array - * @access private - */ - var $fields = array( - 'realm' => array(REQ_YES, null, false) - ); - // ################################################################### /** * Constructor @@ -118,16 +109,28 @@ class Printer // ################################################################### /** - * Sets an ISSO field + * Sets the realm + * + * @access public + * + * @param string Realm + */ + function setRealm($realm) + { + $this->realm = $realm; + } + + // ################################################################### + /** + * Gets the realm * * @access public * - * @param string Field name - * @param mixed Value of the field + * @return string Realm */ - function set($name, $value) + function getRealm() { - $this->registry->do_set($name, $value, 'printer'); + return $this->realm; } // ################################################################### @@ -156,21 +159,6 @@ class Printer $this->language = $lang; } - // ################################################################### - /** - * Gets an ISSO field - * - * @access public - * - * @param string Field name - * - * @return mixed Value of the field - */ - function get($fieldname) - { - return $this->registry->do_get($fieldname, 'printer'); - } - // ################################################################### /** * Creates a redirect to another page; constructs the header and footer @@ -241,7 +229,7 @@ JS; define('ISSO_PRINTER_NO_NAVIGATION', 1); } - $this->page_start($this->registry->modules['localize']->string('Redirect')); + $this->page_start(_('Redirect')); if ($postvars) { @@ -255,7 +243,7 @@ JS; $this->form_end(); } - $redir = sprintf($this->registry->modules['localize']->string('Please wait to be redirected. If you are not redirected in a few seconds, click here.'), $location); + $redir = sprintf(_('Please wait to be redirected. If you are not redirected in a few seconds, click here.'), $location); $override = false; if ($message == null) { @@ -268,7 +256,7 @@ JS; $override = true; } - $this->page_message($this->registry->modules['localize']->string('Redirect'), $showmessage, $override); + $this->page_message(_('Redirect'), $showmessage, $override); $this->page_code($js); @@ -290,8 +278,8 @@ JS; define('ISSO_PRINTER_NO_NAVIGATION', 1); } - $this->page_start($this->registry->modules['localize']->string('Error')); - $this->page_message($this->registry->modules['localize']->string('Error'), $message); + $this->page_start(_('Error')); + $this->page_message(_('Error'), $message); $this->page_end(); exit; @@ -323,7 +311,7 @@ JS; return; } - $title = sprintf($this->registry->modules['localize']->string('%1$s - %2$s - %3$s'), $this->registry->application, $this->realm, $actiontitle); + $title = sprintf(_('%1$s - %2$s - %3$s'), $this->registry->application, $this->realm, $actiontitle); echo "\n"; echo "language['langcode'] . "\" lang=\"" . $this->language['langcode'] . "\" dir=\"" . $this->language['direction'] . "\">\n"; @@ -434,7 +422,7 @@ JS; define('ISSO_PRINTER_NO_NAVIGATION', 1); } - $this->page_start($this->registry->modules['localize']->string('Confirm')); + $this->page_start(_('Confirm')); $this->form_start($location, $action); foreach ($params AS $key => $value) @@ -443,9 +431,9 @@ JS; } $this->table_start(true, '75%'); - $this->table_head($this->registry->modules['localize']->string('Confirm'), 1); + $this->table_head(_('Confirm'), 1); $this->row_span("
$message
", ':swap:', 'left', 1); - $this->row_submit('', $this->registry->modules['localize']->string('Yes'), ''); + $this->row_submit('', _('Yes'), ''); $this->table_end(); $this->form_end(); @@ -813,7 +801,7 @@ JS; { if ($submit === ':save:') { - $submit = " " . $this->registry->modules['localize']->string('Submit') . " "; + $submit = " " . _('Submit') . " "; } else { @@ -822,7 +810,7 @@ JS; if ($reset === ':reset:') { - $reset = " " . $this->registry->modules['localize']->string('Reset') . " "; + $reset = " " . _('Reset') . " "; } else { @@ -892,7 +880,7 @@ JS; $listitem = array(); - $this->row_text($label, "\n" . (($is_jump) ? "\nregistry->modules['localize']->string('Go') . " \" accesskey=\"g\" />" : '') . "\n", $colspan); + $this->row_text($label, "\n" . (($is_jump) ? "\n" : '') . "\n", $colspan); } // ################################################################### @@ -932,7 +920,7 @@ JS; */ function row_yesno($label, $name, $value, $colspan = 2) { - $this->row_text($label, " " . $this->registry->modules['localize']->string('Yes') . " " . $this->registry->modules['localize']->string('No'), $colspan); + $this->row_text($label, " " . _('Yes') . " " . _('No'), $colspan); } } diff --git a/printer_css.php b/printer_css.php index 4c22780..83759ac 100644 --- a/printer_css.php +++ b/printer_css.php @@ -216,23 +216,23 @@ class Printer_CSS $print =& $this->registry->modules['printer']; $lang = array( - 'standard_css_attributes' => $this->registry->modules['localize']->string('Standard CSS Attributes'), - 'extra_css_attributes' => $this->registry->modules['localize']->string('Extra CSS Attributes'), + 'standard_css_attributes' => _('Standard CSS Attributes'), + 'extra_css_attributes' => _('Extra CSS Attributes'), - 'links_normal' => $this->registry->modules['localize']->string('Normal CSS Links'), - 'links_visited' => $this->registry->modules['localize']->string('Visited CSS Links'), - 'links_hover' => $this->registry->modules['localize']->string('Hover CSS Links'), + 'links_normal' => _('Normal CSS Links'), + 'links_visited' => _('Visited CSS Links'), + 'links_hover' => _('Hover CSS Links'), - 'background' => $this->registry->modules['localize']->string('Background'), - 'font_color' => $this->registry->modules['localize']->string('Font Color'), - 'font_style' => $this->registry->modules['localize']->string('Font Style'), - 'font_size' => $this->registry->modules['localize']->string('Font Size'), - 'font_family' => $this->registry->modules['localize']->string('Font Family'), + 'background' => _('Background'), + 'font_color' => _('Font Color'), + 'font_style' => _('Font Style'), + 'font_size' => _('Font Size'), + 'font_family' => _('Font Family'), - 'text_decoration' => $this->registry->modules['localize']->string('Text Decoration'), + 'text_decoration' => _('Text Decoration'), - 'css_selector' => $this->registry->modules['localize']->string('CSS Selector'), - 'save_css' => $this->registry->modules['localize']->string('Save CSS') + 'css_selector' => _('CSS Selector'), + 'save_css' => _('Save CSS') ); foreach ($this->descriptors AS $descriptor) diff --git a/xml.php b/xml.php index 478e7cb..ebe6137 100644 --- a/xml.php +++ b/xml.php @@ -88,15 +88,6 @@ 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 @@ -115,35 +106,6 @@ 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'); - } - - // ################################################################### - /** - * Gets an ISSO field - * - * @access public - * - * @param string Field name - * - * @return mixed Value of the field - */ - function get($fieldname) - { - return $this->registry->do_get($fieldname, 'xml'); - } - // ################################################################### /** * Parse an XML file @@ -271,20 +233,6 @@ class XML // attach data to the node if (($this->cdata = trim($this->cdata)) != '') { - // if we have a data handler, operate it now - if (isset($this->taghandler["$name"])) - { - $this->registry->debug("handler: " . $this->taghandler["$name"]); - if (function_exists($this->taghandler["$name"])) - { - $this->cdata = $this->taghandler["$name"]($this->cdata, $this); - } - else - { - trigger_error('Could not find the function [' . $this->taghandler["$name"] . '()] for the XML tag "' . $name . '"', E_USER_ERROR); - } - } - $this->attribs['value'] = $this->cdata; } -- 2.22.5