[eluser]amw_drizz[/eluser]
Okay this is my ThemeHandler.php Model as the name implies is what it does
Code:
<?php
/*------------------------------------------
| Author :: Jonathan Nedobity
| Version :: 1.0
| Date Created :: 2/25/2009
| Date Modified :: 3/12/2009
| About ::
| This file handles all skining of website
| contents, it takes all input from other
| files and creats the final output.
| this file should be called last!
------------------------------------------*/
class ThemeHandler extends Model{
/*-------------------------------
| The function below will initalize the class
| along with setting variables for future use
|--------------------------------*/
function Themehandler(){
parent::Model();
/* the header variables will eventually become dynamic
| to a database instead of being hard coded */
$header['title'] = "CrystalX"; // Title of the website
$header['discription'] = NULL; // Descirption of the website
$header['keywords'] = NULL; // keywords for search engines
$header['static'] = "http://test.jonweb.vlexo.net/static/themes/crystalx"; // Static path for js and images for the theme
$header['static_path'] = "http://test.jonweb.vlexo.net/static/";
$this->head = $header; // we now assing it so all functions can use it
}
/*--------------------------------
| this is the bread of this file,
| it will take inputs, for fomating
| and display it on the clients
| web browser.
|---------
| $data is the common data for use in a single
| non-repeating page
| $use_empty will toggle if TRUE to use the
| repeating template for database arrays, or arrays
| that are multi-demensional
| $od is to be used if $use_empty is true, as it passes
| such of an array to the parser
|-----------------------------------*/
function loadOutput($data,$use_empty = FALSE,$od = NULL,$codeview = FALSE){ // For a single page, $use_empty and $od are optional
if($use_empty == TRUE){
$data2['empty'] = $this->parser->parse('themes/crystalx/dynamic/dynamic_content',$od,TRUE);
$this->load->view('themes/crystalx/static/header',$this->head);
$this->load->view('themes/crystalx/static/main_menu');
$this->load->view('themes/crystalx/static/empty',$data2);
$this->load->view('themes/crystalx/static/empty',$this->CreateSidebar());
$this->load->view('themes/crystalx/static/footer.php');
}
elseif($codeview == FALSE){
$this->load->view('themes/crystalx/static/header',$this->head);
$this->load->view('themes/crystalx/static/main_menu');
$this->load->view('themes/crystalx/static/static_content',$data);
$this->load->view('themes/crystalx/static/empty',$this->CreateSidebar());
$this->load->view('themes/crystalx/static/footer.php');
}
else{
$this->load->view('themes/crystalx/static/header',$this->head);
$this->load->view('themes/crystalx/static/main_menu');
$this->load->view('themes/crystalx/static/code_content',$data);
$this->load->view('themes/crystalx/static/empty',$this->CreateSidebar());
$this->load->view('themes/crystalx/static/footer.php');
}
}
.... more code
}
?>
Cut off, the full file is too long but you get the geist