HEX
Server: Apache
System: Linux p3plzcpnl489526.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: vmasmheia229 (9244908)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/vmasmheia229/public_html/htmlCHRIS/old/iwp/includes/TPL.php
<?php 

/************************************************************
 * InfiniteWP Admin panel									*
 * Copyright (c) 2012 Revmakx								*
 * www.revmakx.com											*
 *															*
 ************************************************************/
 
class TPL{
	
	private static $capture=array();

	public static function setTPL(){//before executing templates excute mysql_close and session_write_close
		$controller = Reg::get('controller');
		$action = Reg::get('action');
		include_once("controllers/".$controller.".php");
		if($action == 'add') $action = 'update';
		
		$tplFile = APP_ROOT.'/templates/'.$controller.'/'.$action.'.tpl.php';
		
		if(file_exists($tplFile)){
			return file_get_contents($tplFile);
		}
		else{
			$error = 404;	
			return  file_get_contents(APP_ROOT.'/templates/common/exception.tpl.php');
		}		
	}
	
	public static function get($file, $d=array()){
	
		$tplFile = APP_ROOT.$file;
		
		if(file_exists($tplFile)){
			ob_start();
			include($tplFile);
			$HTML = ob_get_clean();
			$HTML = preg_replace('/>\s+</', "><", $HTML);  
			return $HTML;
		}
		else{
			return '<br><strong>TPL Error:</strong> File not found	('.$tplFile.')<br>';
		}	
	}
	
	public static function captureStart($name){
		ob_start();
	}
	
	public static function captureStop($name){
		self::$capture[$name] = ob_get_clean();
	}
	
	public static function captureGet($name){
		return self::$capture[$name];
	}
	
	public static function captureClear($name){
		unset(self::$capture[$name]);
	}
}

?>