Jeff PHP framework  0.99
Modular, extensible, OOP, MVC, lightweight php framework designed to ease the programmers in the development of web applications.
document.class.php
Go to the documentation of this file.
00001 <?php
00021 class document {
00022 
00026         private $_registry;
00027         
00031         private $_template;
00032         
00044         function __construct() {
00045 
00046                 $this->_registry = registry::instance();
00047                 $this->_template = $this->getTemplate();
00048 
00049         }
00050 
00056         public function render() {
00057         
00058                 /* init title, description, etc... */
00059                 $this->initHeadVariables();
00060                 
00061                 $buffer = $this->_template->parse();
00062 
00063                 echo $buffer;
00064         
00065         }
00066 
00072         private function initHeadVariables() {
00073 
00074                 // may be modified later on
00075                 $this->_registry->title = $this->_registry->site_settings->app_title;
00076                 $this->_registry->description = $this->_registry->site_settings->app_description;       
00077                 $this->_registry->language = APP_LANGUAGE;
00078                 $this->_registry->keywords = $this->_registry->site_settings->app_keywords;
00079                 $this->_registry->favicon = ROOT."/favicon.ico";
00080                 $this->_registry->addCss(REL_CSS."/main.css");
00081                 $this->_registry->addCss(REL_CSS."/datepicker_dashboard.css");
00082                 $this->_registry->addCss(REL_CSS."/cerabox.css");
00083                 foreach($this->_registry->theme->getCss() as $csspath) $this->_registry->addCss($csspath);
00084                 foreach($this->_registry->theme->getJs() as $jspath) $this->_registry->addJs($jspath);
00085                 $this->_registry->addJs(REL_JSLIB."/mootools-core-yc.js");
00086                 $this->_registry->addJs(REL_JSLIB."/mootools-more-yc.js");
00087                 $this->_registry->addJs(REL_JSLIB."/modernizr.js");
00088                 $this->_registry->addJs(REL_JSLIB."/ajax.js");
00089                 $this->_registry->addJs(REL_JSLIB."/abitools.js");
00090                 $this->_registry->addJs(REL_JSLIB."/form.js");
00091                 $this->_registry->addJs(REL_JSLIB."/datepicker.js");
00092                 $this->_registry->addJs(REL_JSLIB."/tooltip.js");
00093                 $this->_registry->addJs(REL_JSLIB."/cerabox.js");
00094 
00095         }
00096 
00103         public static function errorMessages() {
00104 
00105                 $errorMsg = Error::getErrorMessage();
00106                 return empty($errorMsg) ? '' : "<script>alert('".$errorMsg."');</script>";
00107 
00108         }
00109 
00115         private function getTemplate() {
00116 
00117                 return templateFactory::create();
00118                         
00119         }
00120 
00121 }
00122 
00123 ?>