Hi can anyone tell me whats wrong with this?
/*****************************************************************
Universal CMS Frame ver 0.01
Autor: Aaron Hanburg aka blinki bill
*****************************************************************/
<?
class view{
//private $content = array();
private function __construct(){
}
public function build_block($module, $template){
global $config_data;
$block = file_get_contents('templates/'.$config_data['template_folder'].'/'.$module.'/'.$template.'.html');
eval($block);
$block_content = ob_get_contents();
ob_end_clean();
ob_start();
return $block_content;
}
public function build_template($content,$template){
global $config_data;
$template = file_get_contents('templates/'.$config_data['template_folder'].'/'.$template);
$arr1 = array();
$arr2 = array();
foreach($content as $k=>$v){
$arr1[] = '{'.$k.'}';
$arr2[] = $v;
}
$arr1[] = '{meta}';
$arr2[] = $this->meta;
$this->content['meta'].= $this->meta;
$template = str_replace($arr1,$arr2,$template);
eval($template);
}
public function add_style($stylefile){
$this->meta .= '
<link rel="stylesheet" type="text/css" href="/templates/'.$stylefile.'" />';
}
public function add_js($jsfile){
$this->meta .= '
<script type="text/javascript" src="/js/'.$jsfile.'"></script>';
}
public function add_canonical($link){
$this->meta .= '
<link rel="canonical" href="'.$link.'" />';
}
public function set_data($d){
foreach($d as $k=>$v){$this->$k = $v;}
}
public function add_button($action,$text,$controller,$element='',$onclick='',$style='',$class='sbutt'){
return '<a href="/admin/'.$controller.'/'.$action.'/'.($element?'id/'.$element:'').'" class="'.$class.'"'.($style?' style="'.$style.'"':'').($onclick?' onclick="'.$onclick.'"':'').'>'.$text.'</a>';
}
public function get_post(){
return controller::get_post();
}
public function get_template_dir(){
global $config_data;
return 'templates/'.$config_data['template_folder'].'/';
}
public function get_skin_dir(){
global $config_data;
return 'templates/'.$config_data['template_folder'].'/skin/';
}
public function get_header(){
global $config_data;
eval(file_get_contents('templates/'.$config_data['template_folder'].'/'.$config_data['template_settings'][$this->page['template']]['header']));
}
public function get_footer(){
global $config_data;
eval(file_get_contents('templates/'.$config_data['template_folder'].'/'.$config_data['template_settings'][$this->page['template']]['footer']));
}
}
?>