[Phpslash-commit] CVS: phpslash-ft/class Block_render_skin.class,1.10,1.11
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2003-02-06 17:17:55
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory sc8-pr-cvs1:/tmp/cvs-serv30157/phpslash-ft/class Modified Files: Block_render_skin.class Log Message: standardized the alternate template logic to use template::set_file Index: Block_render_skin.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_render_skin.class,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Block_render_skin.class 20 Dec 2002 22:17:29 -0000 1.10 --- Block_render_skin.class 6 Feb 2003 17:17:46 -0000 1.11 *************** *** 37,41 **** $db = pslNew("SlashDB"); ! $default_tpl = "skinsblock.tpl"; $options = $block_info["source_url"]; --- 37,41 ---- $db = pslNew("SlashDB"); ! $default_template = "skinsblock.tpl"; $options = $block_info["source_url"]; *************** *** 53,66 **** $templatedir = substr( $this->psl['templatedir'], 0, strrpos($this->psl['templatedir'], "/") ); - // $tpl = ""; // disable template option - if( empty($tpl) ) { - $tpl = $default_tpl; - } elseif ( file_exists($templatedir . "/" . basename($tpl) . ".tpl") ) { - $tpl = basename($tpl) . ".tpl"; - } else { - debug ( "Block_render_skin:Template file doesn't exist, using default instead", $tpl); - $tpl = $default_tpl; - } - if( !empty($GLOBALS['QUERY_STRING'])) { $QUERY_STRING = $GLOBALS['QUERY_STRING']. $this->psl['amp']; --- 53,56 ---- *************** *** 71,78 **** $template = pslNew("slashTemplate",$templatedir . "/" . $skin); $template->debug = 0; ! $template->set_file(array( ! 'block' => $tpl ! )); ! $template->set_block ("block", "each_skin", "skin_block"); $template->set_var (array ( 'QUERYSTRING' => $QUERY_STRING, --- 61,73 ---- $template = pslNew("slashTemplate",$templatedir . "/" . $skin); $template->debug = 0; ! ! if( $tpl == '') { ! $template->set_file( 'template', $default_template); ! } elseif ( $template->set_file('template' , basename($tpl) . ".tpl" )) { ! } else { ! $template->set_file( 'template', $default_template); ! } ! ! $template->set_block ("template", "each_skin", "skin_block"); $template->set_var (array ( 'QUERYSTRING' => $QUERY_STRING, *************** *** 90,102 **** ( $eachfile != "CVS") ) { ! $template->set_var(array( 'SKIN' => $eachfile )); $template->parse("skin_block","each_skin",true); ! } } ! $output = $template->parse('OUT',"block"); unset($db); return $output; --- 85,97 ---- ( $eachfile != "CVS") ) { ! $template->set_var(array( 'SKIN' => $eachfile )); $template->parse("skin_block","each_skin",true); ! } } ! $output = $template->parse('OUT',"template"); unset($db); return $output; |