Update of /cvsroot/phpslash/phpslash-ft/class
In directory sc8-pr-cvs1:/tmp/cvs-serv29798/phpslash-ft/class
Modified Files:
slashTemplate.class functions.inc NavBar.class
Log Message:
template set_file tweaks
Index: slashTemplate.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/slashTemplate.class,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** slashTemplate.class 20 Dec 2002 22:17:30 -0000 1.1
--- slashTemplate.class 7 Jan 2003 19:31:13 -0000 1.2
***************
*** 70,84 ****
$filepath = $templatedir ."/". $skin_cfg['skin.parent'] ."/". $filename;
if(!file_exists($filepath)) {
! $this->halt("set_file1: set_file: For varname $varname filename $filepath is invalid.");
}
} else {
! $this->halt("set_file2: set_file: For varname $varname filename $filepath is invalid.");
}
}
! Template::set_file($varname, $filepath);
!
} else {
reset($varname);
!
while(list($v, $f) = each($varname)) {
--- 70,88 ----
$filepath = $templatedir ."/". $skin_cfg['skin.parent'] ."/". $filename;
if(!file_exists($filepath)) {
! $this->message = "set_file: set_file: For varname $varname filename $filepath is invalid.";
! // $this->halt($this->message);
! return false;
}
} else {
! $this->message = "set_file: set_file: For varname $varname filename $filepath is invalid.";
! // $this->halt($this->message);
! return false;
}
}
! return Template::set_file($varname, $filepath);
!
} else {
reset($varname);
!
while(list($v, $f) = each($varname)) {
***************
*** 94,108 ****
$varname_ary[$v] = $filepath;
if(!is_file($filepath)) {
! $this->halt("set_file: set_file: For varname $v filename $filepath is invalid.");
}
} else {
! $this->halt("set_file: set_file: For varname $varname filename $filepath is invalid.");
}
}
}
! Template::set_file($varname_ary, $filename);
}
! }
! }
?>
--- 98,120 ----
$varname_ary[$v] = $filepath;
if(!is_file($filepath)) {
! $this->message = "set_file: set_file: For varname $v filename $filepath is invalid.";
! $this->halt($this->message);
}
} else {
! $this->message = "set_file: set_file: For varname $varname filename $filepath is invalid.";
! $this->halt($this->message);
}
}
}
! return Template::set_file($varname_ary, $filename);
}
!
! // no matches return false.
! return false;
!
! } // end of function set_root
!
! } // end of slashTemplate class
!
?>
Index: functions.inc
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v
retrieving revision 1.120
retrieving revision 1.121
diff -C2 -d -r1.120 -r1.121
*** functions.inc 20 Dec 2002 22:32:25 -0000 1.120
--- functions.inc 7 Jan 2003 19:31:13 -0000 1.121
***************
*** 196,214 ****
/* Templates */
! $templ = pslNew("slashTemplate",$_PSL['templatedir']);
$templ->debug = 0;
! if ( ($box_type != "") AND ( file_exists($_PSL['templatedir'] . "/" . basename($box_type) . "box.tpl")) ) {
! $template = basename($box_type) . "box.tpl";
! }
!
! $templ->set_file(array(
! 'fancybox' => $template
! ));
!
! $templ->set_var(array(
! 'IMAGEDIR' => $_PSL['imageurl']
! ));
!
if (!$contents) {
return;
--- 196,212 ----
/* Templates */
! $templ = pslNew("slashTemplate");
$templ->debug = 0;
! if( $box_type == "") {
! $templ->set_file( 'fancybox', $template);
! } elseif ( $templ->set_file('fancybox' , basename($box_type) ."box.tpl" )
! )
! {
! } else {
! $templ->set_file( 'fancybox', $template);
! }
!
! // If the contents are empty don't generate an empty box
if (!$contents) {
return;
***************
*** 222,231 ****
} else {
$templ->set_var(array(
! 'LINK_OPEN' => "<A HREF=\"$link\">",
! 'LINK_CLOSE' => "</A>"
));
}
$templ->set_var(array(
'SKIN' => $_PSL['skin'],
'WIDTH' => $width,
--- 220,230 ----
} else {
$templ->set_var(array(
! 'LINK_OPEN' => "<a href=\"$link\">",
! 'LINK_CLOSE' => "</a>"
));
}
$templ->set_var(array(
+ 'IMAGEDIR' => $_PSL['imageurl'],
'SKIN' => $_PSL['skin'],
'WIDTH' => $width,
***************
*** 239,244 ****
}
// debug("templ_var", $templ->varvals);
! $templ->parse('FANCYBOX', "fancybox" );
! return $templ->get('FANCYBOX');
}
--- 238,244 ----
}
// debug("templ_var", $templ->varvals);
! // $templ->parse('FANCYBOX', "fancybox" );
! // return $templ->get('FANCYBOX');
! return $templ->parse('FANCYBOX', "fancybox" );
}
Index: NavBar.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/NavBar.class,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** NavBar.class 20 Dec 2002 22:17:29 -0000 1.17
--- NavBar.class 7 Jan 2003 19:31:13 -0000 1.18
***************
*** 60,84 ****
global $auth, $perm;
! $default_template = "navbar";
if( $menu_ary == "") {
$menu_ary = $this->psl['menuitem'];
}
-
- if( empty($tpl) ) {
- $template = $default_template;
- } elseif ( file_exists($this->psl['templatedir'] . "/" . basename($tpl) . ".tpl") ) {
- $tpl_file = basename($tpl) . ".tpl";
- $this->templ->set_file(array(
- "template" => "$tpl_file"
- ));
- $template = "template";
- } else {
- debug ( "NavBar.class::getNavBar:Template file doesn't exist,
- using default instead", $tpl);
- $template = $default_template;
- }
! $this->templ->set_block( $template, "each_destination", "block" );
$this->templ->set_var( array( 'LINK_NAVBAR' => "",
'LINK_NAVBAR_TEXT' => "") );
--- 60,77 ----
global $auth, $perm;
! $default_template = "navbar.tpl";
if( $menu_ary == "") {
$menu_ary = $this->psl['menuitem'];
}
! if( $tpl == "") {
! $this->templ->set_file( 'template', $default_template);
! } elseif ( $this->templ->set_file('template' , basename($tpl) . ".tpl" )) {
! } else {
! $this->templ->set_file( 'template', $default_template);
! }
!
! $this->templ->set_block( 'template', "each_destination", "block" );
$this->templ->set_var( array( 'LINK_NAVBAR' => "",
'LINK_NAVBAR_TEXT' => "") );
***************
*** 110,114 ****
}
! $this->templ->parse( "OUT", $template );
return $this->templ->get( "OUT" );
}
--- 103,107 ----
}
! $this->templ->parse( "OUT", 'template' );
return $this->templ->get( "OUT" );
}
|