Thread: [phpwebapp-commits] CVS: web_app/parser class.Parser.php,1.13,1.14
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2004-07-21 17:04:44
|
Update of /cvsroot/phpwebapp/web_app/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2634/parser Modified Files: class.Parser.php Log Message: Index: class.Parser.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/parser/class.Parser.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** class.Parser.php 20 Jul 2004 17:26:09 -0000 1.13 --- class.Parser.php 21 Jul 2004 17:04:31 -0000 1.14 *************** *** 131,135 **** if ($tpl===UNDEFINED) $tpl = new Template; ! if (!$well_formed) { //The contents of the string usually is not well-formed xml --- 131,136 ---- if ($tpl===UNDEFINED) $tpl = new Template; ! //if (!$well_formed) ! if (substr($xml_string, 0, 5) != '<?xml') { //The contents of the string usually is not well-formed xml *************** *** 234,238 **** } ! //reset parsing options to default and safe values $this->copy_mode = false; } --- 235,239 ---- } ! //reset parsing modes to default and safe values $this->copy_mode = false; } *************** *** 396,400 **** $name = strtolower($name); $attr_list = $this->get_attr_list($attribs); ! $this->append("<$name $attr_list>"); break; --- 397,401 ---- $name = strtolower($name); $attr_list = $this->get_attr_list($attribs); ! $this->append("<$name$attr_list>"); break; *************** *** 408,412 **** $name = strtolower($name); $attr_list = $this->get_attr_list($attribs); ! $this->append("<$name $attr_list>"); break; } --- 409,413 ---- $name = strtolower($name); $attr_list = $this->get_attr_list($attribs); ! $this->append("<$name$attr_list>"); break; } *************** *** 673,721 **** function start_HEAD($attribs) { ! if ($this->current_tpl->type<>"MainTpl") { ! //give a warning message ! $msg = "Parser: <head> element cannot be used " ! ."in this place"; ! $err_msg = WebApp::warning_msg($msg); ! $this->append($err_msg); } - - $tpl = new Template("HeadTpl", "HeadTpl"); - $this->push_current_tpl($tpl); - $attr_list = $this->get_attr_list($attribs); - $this->append('<head'.$attr_list.'>'); } function end_HEAD() { ! $this->append('</head>'); ! $tpl = $this->pop_current_tpl(); ! //link it to the MainTpl ! $this->link_template($tpl); ! if ($this->current_tpl->type=="MainTpl") { ! global $webPage; $this->current_tpl->head = &$webPage->tpl_collection[$tpl->id]; } } function start_BODY($attribs) { ! if ($this->current_tpl->type<>"MainTpl") { ! //give a warning message ! $msg = "Parser: <body> element cannot be used " ! ."in this place"; ! $err_msg = WebApp::warning_msg($msg); ! $this->append($err_msg); } - - //create a body template - $tpl = new Template("BodyTpl", "BodyTpl"); - - $this->push_current_tpl($tpl); - - $this->append('<body'.$this->get_attr_list($attribs).'>'); } function end_BODY() --- 674,721 ---- function start_HEAD($attribs) { ! if ($this->current_tpl->type=="MainTpl") { ! $tpl = new Template("HeadTpl", "HeadTpl"); ! $this->push_current_tpl($tpl); ! $this->append('<head>'); ! } ! else ! { ! $tpl = new Template; ! $this->push_current_tpl($tpl); } } function end_HEAD() { ! global $webPage; ! if ($this->current_tpl->type=="HeadTpl") { ! $this->append('</head>'); ! $tpl = $this->pop_current_tpl(); ! $this->link_template($tpl); $this->current_tpl->head = &$webPage->tpl_collection[$tpl->id]; } + else + { + $tpl = $this->pop_current_tpl(); + $tpl->parent = &$webPage->tpl_collection['HeadTpl']; + $webPage->append_to_head('&&'.$tpl->id.';;'); + } } function start_BODY($attribs) { ! if ($this->current_tpl->type=="MainTpl") { ! $tpl = new Template("BodyTpl", "BodyTpl"); ! $this->push_current_tpl($tpl); ! $this->append('<body'.$this->get_attr_list($attribs).'>'); ! } ! else ! { ! $tpl = new Template; ! $this->push_current_tpl($tpl); } } function end_BODY() *************** *** 815,819 **** if ($this->current_tpl->type=="WebClassTpl") { ! $name = strtoupper($name); $this->current_tpl->params[$name] = $default; } --- 815,819 ---- if ($this->current_tpl->type=="WebClassTpl") { ! $name = strtolower($name); $this->current_tpl->params[$name] = $default; } *************** *** 830,833 **** --- 830,835 ---- function start_WEBOBJECT($attribs) { + global $webPage; + //get the attributes of the webobject $class_name = $attribs['CLASS']; *************** *** 860,866 **** while (list($p_name,$p_default) = each($tpl->params)) { ! if (isset($attribs[$p_name])) { ! $tpl->params[$p_name] = $attribs[$p_name]; } } --- 862,868 ---- while (list($p_name,$p_default) = each($tpl->params)) { ! if (isset($attribs[strtoupper($p_name)])) { ! $tpl->params[$p_name] = $attribs[strtoupper($p_name)]; } } |