diff --git a/frontend/cphp/class.templater.php b/frontend/cphp/class.templater.php index f67a794..24da07e 100644 --- a/frontend/cphp/class.templater.php +++ b/frontend/cphp/class.templater.php @@ -120,4 +120,13 @@ class Templater Throw new Exception("No template loaded."); } } + + public static function InlineRender($templatename, $localize = array(), $compile = array()) + { + $template = new Templater(); + $template->Load($templatename); + $template->Localize($localize); + $template->Compile($compile); + return $template->Render(); + } } diff --git a/frontend/interface.php b/frontend/interface.php index 83030f9..32a4d65 100644 --- a/frontend/interface.php +++ b/frontend/interface.php @@ -8,10 +8,7 @@ $settings['salt'] = "kAU0qM"; $sContainer = new Container(1); -$template_main = new Templater(); -$template_main->Load("main"); -$template_main->Localize($locale->strings); -$template_main->Compile(array( +echo(Templater::InlineRender("main", $locale->strings, array( 'server-location' => $sContainer->sNode->sPhysicalLocation, 'operating-system' => $sContainer->sTemplate->sName, 'guaranteed-ram' => "{$sContainer->sGuaranteedRam}MB", @@ -19,7 +16,6 @@ $template_main->Compile(array( 'disk-space' => "{$sContainer->sDiskSpace}MB", 'total-traffic-limit' => "{$sContainer->sTotalTrafficLimit} bytes", 'bandwidth-limit' => "100mbit", -)); -$template_main->Output(); +))); ?>