[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/inc class.Template3.inc.ph
From: |
Michael Totschnig <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/inc class.Template3.inc.php,1.2,1.3 |
Date: |
Sat, 18 Jan 2003 20:10:04 -0500 |
Update of /cvsroot/phpgroupware/sitemgr/sitemgr-site/inc
In directory subversions:/tmp/cvs-serv21057/sitemgr-site/inc
Modified Files:
class.Template3.inc.php
Log Message:
add some code to make migration of existing templates easier
add function find_template_dir
Index: class.Template3.inc.php
===================================================================
RCS file:
/cvsroot/phpgroupware/sitemgr/sitemgr-site/inc/class.Template3.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.Template3.inc.php 18 Jan 2003 04:30:34 -0000 1.2
--- class.Template3.inc.php 19 Jan 2003 01:10:02 -0000 1.3
***************
*** 121,130 ****
{
include($transformerfile);
}
! if (class_exists($transformername))
{
! $transformer = new $transformername;
}
-
$content = '';
$blocks =
$this->bo->getvisibleblockdefsforarea($areaname,$page->cat_id,$page->id);
--- 121,137 ----
{
include($transformerfile);
+ if (class_exists($transformername))
+ {
+ $transformer = new $transformername;
+ }
}
! //compatibility with former sideblocks template
! elseif (($areaname == "left" || $areaname == "right")
&& file_exists($this->root . SEP . 'sideblock.tpl'))
{
! $t = Createobject('phpgwapi.Template');
! $t->set_root($this->root);
! $t->set_file('SideBlock','sideblock.tpl');
! $transformer = new sideblock_transform($t);
}
$content = '';
$blocks =
$this->bo->getvisibleblockdefsforarea($areaname,$page->cat_id,$page->id);
***************
*** 241,252 ****
--- 248,264 ----
{
case 'title':
+ case 'page_title':
return $page->title;
case 'subtitle':
+ case 'page_subtitle':
return $page->subtitle;
case 'sitename':
+ case 'site_name':
return
$GLOBALS['sitemgr_info']['sitemgr-site-name-' .
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang']];
case 'footer':
+ case 'site_footer':
return
$GLOBALS['Common_BO']->headerfooter->getsitefooter($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']);
case 'header':
+ case 'site_header':
return
$GLOBALS['Common_BO']->headerfooter->getsiteheader($GLOBALS['phpgw_info']['user']['preferences']['common']['lang']);
case 'user':
***************
*** 307,309 ****
--- 319,339 ----
}
+ }
+
+ class sideblock_transform
+ {
+ function sideblock_transform(&$template)
+ {
+ $this->template = $template;
+ }
+
+
+ function apply_transform($title,$content)
+ {
+ $this->template->set_var(array(
+ 'block_title' => $title,
+ 'block_content' => $content
+ ));
+ return $this->template->parse('out','SideBlock');
+ }
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/inc class.Template3.inc.php,1.2,1.3,
Michael Totschnig <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: sitemgr/setup default_records.inc.php,1.1,1.2 tables_update.inc.php,1.7,1.8
- Next by Date:
[Phpgroupware-cvs] CVS: sitemgr/doc modules.dvi,1.2,1.3 modules.html,1.2,1.3 modules.lyx,1.2,1.3 modules.pdf,1.2,1.3 modules.ps,1.2,1.3 modules.sgml,1.2,1.3 modules.txt,1.2,1.3
- Previous by thread:
[Phpgroupware-cvs] CVS: sitemgr/setup default_records.inc.php,1.1,1.2 tables_update.inc.php,1.7,1.8
- Next by thread:
[Phpgroupware-cvs] CVS: sitemgr/doc modules.dvi,1.2,1.3 modules.html,1.2,1.3 modules.lyx,1.2,1.3 modules.pdf,1.2,1.3 modules.ps,1.2,1.3 modules.sgml,1.2,1.3 modules.txt,1.2,1.3
- Index(es):