[Phpslash-commit] CVS: phpslash-ft/class functions.inc,1.126,1.127
Brought to you by:
joestewart,
nhruby
From: Matthew L. <sym...@us...> - 2003-02-07 17:29:40
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv10958 Modified Files: functions.inc Log Message: Changed the behavior of getError() to succeed even when templates are not available. Index: functions.inc =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** functions.inc 6 Feb 2003 20:28:19 -0000 1.126 --- functions.inc 7 Feb 2003 17:29:35 -0000 1.127 *************** *** 8,13 **** ****************************************************************************/ function getError ($msg) { ! ! return getMessage( $msg, "error"); } --- 8,17 ---- ****************************************************************************/ function getError ($msg) { ! if (pslClassExists(pslGetClass('slashTemplate'))) { ! return getMessage( $msg, "error"); ! } ! else { ! return sprintf('<div id="error">ERROR: %s</div>',$msg); ! } } *************** *** 17,22 **** $tpl -> template to use ( "$tpl + ".tpl") ****************************************************************************/ - - function getMessage($msg, $tpl="") { --- 21,24 ---- *************** *** 24,45 **** $template = "message.tpl"; /* Templates */ ! $templ = pslNew('slashTemplate'); if( $tpl == "") { $templ->set_file( 'template', $template); ! } elseif ( $templ->set_file('template' , basename($tpl) .".tpl" )) { ! } else { $templ->set_file( 'template', $template); } ! $templ->set_var(array( ! 'ERROR' => pslgetText($msg) ! )); ! $msg = $templ->parse('OUT','template'); ! ! return $msg; } --- 26,50 ---- $template = "message.tpl"; + $templateClass = 'slashTemplate'; /* Templates */ ! $templ = pslNew($templateClass); if( $tpl == "") { $templ->set_file( 'template', $template); ! } ! elseif ( $templ->set_file('template' , basename($tpl) .".tpl" )) { ! } ! else { $templ->set_file( 'template', $template); } ! $templ->set_var(array( ! 'ERROR' => pslgetText($msg) ! )); ! $msg = $templ->parse('OUT','template'); ! ! return $msg; } *************** *** 51,55 **** function pslError($msg) { ! echo getMessage( $msg, "error"); } --- 56,60 ---- function pslError($msg) { ! echo getError( $msg); } |