IT/ITX - I don't get it - long messages

From: Date: Mon, 11 Feb 2002 11:19:05 +0000
Subject: IT/ITX - I don't get it - long messages
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-818@lists.php.net to get a copy of this message
Hi For the last 2 weeks I have tried to re-write one of my websites from being a mix of ADODB/PEAR/MySQL/Smarty/Hardcoded HTML ( yes I know a mess ;-) ) to be a 100% PEAR based site, but the IT/ITX keeps giving me troubles. My main template contains 'global' placeholders which I will use to put information in depending on userstatus etc. I have a placeholder named {USER_MENU} which should display a login form if the user is not logged in, and a user specific menu if the user is logged in. The login_form.html contain 2 blocks (loginerr, and loginform), on to print error messages in case of login errors, and one with the login form. I use the following code: if(!isset($userinfo['medlemsnr'])) { // Load the loginform $tpl->addBlockfile("USER_MENU", "loginForm_block", "login_form.html"); if(isset($errmsg)) { $tpl->setCurrentBlock("LOGINERR"); $tpl->setVariable("ERR_MSG",$errmsg); $tpl->parseCurrentBlock(); } $tpl->setCurrentBlock("LOGINFORM"); $tpl->touchBlock("LOGINFORM"); $tpl->parseCurrentBlock(); } else { // load usermenu $tpl->addBlockfile("USER_MENU", "usermenu_block", "user_menu.html"); $tpl->setCurrentBlock("usermenu_block"); // this block don't contains any vars {}, so we need to touch it $tpl->touchBlock("usermenu_block"); $tpl->parseCurrentBlock(); } Now, when the user is NOT logged in I get these 2 warrnings: Warning: Undefined index: LOGINERR in E:\www\kostplanen\www\include\pear\HTML\ITX.php on line 684 Warning: Undefined index: LOGINFORM in E:\www\kostplanen\www\include\pear\HTML\ITX.php on line 684 And when the user is logged in I get this: Warning: Undefined index: usermenu_block in E:\www\kostplanen\www\include\pear\HTML\ITX.php on line 684 I know it's only warnings, and that I can turn them off, but when I'm developing I preferre to have error_reporting(E_ALL) I think it prevent sloppy coding - at least i works for me ;-) Is it a 'bug in IT/ITX or am I doing something wrong ? Thanks in advance. Steen

« previous php.pear.general (#818) next »