version 1.1.1.1, 2007/11/02 20:55:00
|
version 1.1.1.1.2.2, 2007/11/15 15:31:35
|
Line 24
|
Line 24
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# SUCH DAMAGE. |
# SUCH DAMAGE. |
# |
# |
|
# $Paefchen: FreeBSD/tinderbox/webui/module/module.php,v 1.1.1.1.2.1 2007/11/13 07:36:19 as Exp $ |
# $MCom: portstools/tinderbox/webui/module/module.php,v 1.4 2005/12/26 22:41:41 marcus Exp $ |
# $MCom: portstools/tinderbox/webui/module/module.php,v 1.4 2005/12/26 22:41:41 marcus Exp $ |
# |
# |
|
|
require_once 'core/functions.php'; |
|
require_once 'core/TinderboxDS.php'; |
|
|
|
class module { |
class module { |
|
public $TinderboxDS = null; |
|
private $_template_vars = array(); |
|
|
function module() { | public function __construct() { |
$this->TinderboxDS = new TinderboxDS(); | $this->TinderboxDS = TinderboxDS::instance(); |
} |
} |
|
|
function template_parse( $template ) { | public function template_parse($template) { |
global $templatesdir; | /* as xxx */ |
global $templatesuri; | # global $display_login; |
global $tinderbox_name; | |
global $tinderbox_title; | |
global $display_login; | |
|
|
$this->template_assign( 'templatesuri', $templatesuri ); | $this->template_assign('templatesuri', TEMPLATESURL); |
$this->template_assign( 'tinderbox_name', $tinderbox_name ); | $this->template_assign('tinderbox_name', TB_NAME); |
$this->template_assign( 'tinderbox_title', $tinderbox_title ); | $this->template_assign('tinderbox_title', TB_TITLE); |
$this->template_assign( 'display_login', $display_login ); | $this->template_assign('display_login', $display_login); |
$this->template_assign( 'errors', $this->TinderboxDS->getErrors() ); | /* as xxx */ |
| #$this->template_assign('errors', $this->TinderboxDS->getErrors()); |
|
|
foreach( $this->TEMPLATE_VARS as $varname => $varcontent ) { | foreach ($this->_template_vars as $varname => $varcontent) |
$varcontent = var_export( $varcontent, true ); | $$varname = $varcontent; |
eval( '$'.$varname.' = '.$varcontent.';' ); | |
} | |
ob_start(); |
ob_start(); |
require $templatesdir.'/'.$template; | require TEMPLATESDIR.'/'.$template; |
$parsed = ob_get_contents(); |
$parsed = ob_get_contents(); |
ob_end_clean(); |
ob_end_clean(); |
|
|
Line 63 class module {
|
Line 60 class module {
|
return $parsed; |
return $parsed; |
} |
} |
|
|
function template_assign( $varname, $varcontent ) { | public function template_assign( $varname, $varcontent ) { |
$this->TEMPLATE_VARS[$varname] = $varcontent; | $this->_template_vars[$varname] = $varcontent; |
} |
} |
|
|
function template_cleanup() { | public function template_cleanup() { |
return $this->TEMPLATE_VARS = array(); | return $this->_template_vars = array(); |
} |
} |
} |
} |
|
|
?> |
?> |