Jeff PHP framework
0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
|
00001 <?php 00049 abstract class templateFactory { 00050 00056 public static function create() { 00057 00058 $registry = registry::instance(); 00059 00060 if($registry->site == 'admin') { 00061 $tpl = access::check('main', $registry->admin_view_privilege) ? "admin_private" : "admin_public"; 00062 } 00063 elseif($registry->site == 'main') { 00064 if($registry->user->id) $tpl = $registry->isHome ? "home_private" : "page_private"; 00065 elseif($registry->isHome) $tpl = 'home_public'; 00066 else $tpl = 'page_public'; 00067 } 00068 00069 $registry->theme->setTpl($tpl); 00070 00071 $tplObj = $registry->theme->getTemplate(); 00072 00073 if($tplObj) return $tplObj; 00074 else 00075 Error::syserrorMessage('templateFactory', 'create', sprintf(__("CantChargeTplError"), $tpl), __LINE__); 00076 00077 } 00078 00079 } 00080 00081 ?>