public function __toString() { TemplateEngine::appendPath(Ntentan::getFilePath('lib/views/helpers/lists/templates')); $this->rowTemplate = $this->rowTemplate == null ? 'row.tpl.php' : $this->rowTemplate; $this->defaultCellTemplate = $this->defaultCellTemplate == null ? 'default_cell.tpl.php' : $this->defaultCellTemplate; return TemplateEngine::render('list.tpl.php', array("headers" => $this->headers, "data" => $this->data, "row_template" => $this->rowTemplate, "cell_templates" => $this->cellTemplates, "default_cell_template" => $this->defaultCellTemplate, "variables" => $this->variables, "has_headers" => $this->hasHeaders)); }
public function login() { TemplateEngine::appendPath(Ntentan::getFilePath('lib/controllers/components/auth/views')); if (isset($_REQUEST["username"]) && isset($_REQUEST["password"])) { return $this->authLocalPassword($_REQUEST["username"], $_REQUEST["password"]); } else { return false; } }
public function init() { parent::init(); $this->addComponent('wyf.model_controller'); $wyf = $this->wyfModelControllerComponent; $wyf->listFields = array('firstname', 'lastname', 'username'); $wyf->addOperation('Assign Roles', 'assign_roles'); TemplateEngine::appendPath(Ntentan::getPluginPath('wyf/views/system_module')); }
public function init() { parent::init(); $this->addComponent('wyf.model_controller'); $wyf = $this->wyfModelControllerComponent; $wyf->addOperation('Set Permissions', 'set_permissions'); $wyf->listFields = array('name', 'description'); TemplateEngine::appendPath(Ntentan::getPluginPath('wyf/views/system_module')); }
public function out($viewData) { try { if ($this->template === false) { $data = null; } else { $data = TemplateEngine::render($this->template, $viewData, $this); } if ($this->layout !== false && !Ntentan::isAjax()) { $viewData['contents'] = $data; $output = TemplateEngine::render($this->layout, $viewData, $this); } else { $output = $data; } } catch (Exception $e) { print "Error!"; } return $output; }
public function __toString() { $filename = "public/" . $this->getExtension() . "/bundle_{$this->context}." . $this->getExtension(); if (!file_exists($filename) || Ntentan::$debug === true) { foreach ($this->minifiableScripts as $script) { if (Ntentan::$debug === true) { $tags .= $this->getTag(Ntentan::getUrl(TemplateEngine::loadAsset($this->getExtension() . "/" . basename($script), $script))); } else { $minifiedScript .= file_get_contents($script); } } if (Ntentan::$debug === false) { file_put_contents($filename, Minifier::minify($minifiedScript, $this->getMinifier())); } } if (Ntentan::$debug === false) { $tags = $this->getTag(Ntentan::getUrl($filename)); } foreach ($this->otherScripts as $script) { $tags .= $this->getTag(Ntentan::getUrl($script)); } return $tags; }
public function __construct() { Ntentan::addIncludePath(Ntentan::getFilePath("lib/views/helpers/forms/api")); Ntentan::addIncludePath(Ntentan::getFilePath("lib/views/helpers/forms/api/renderers")); \ntentan\views\template_engines\TemplateEngine::appendPath(Ntentan::getFilePath("lib/views/helpers/forms/views")); }
public function init() { TemplateEngine::appendPath(Ntentan::getPluginPath('wyf/views/report_controller')); }
public function init() { TemplateEngine::appendPath(Ntentan::getFilePath('lib/controllers/components/admin/views/layouts')); TemplateEngine::appendPath(Ntentan::getFilePath('lib/controllers/components/admin/views/templates')); }
public function __toString() { return TemplateEngine::render('wyf_inputs_forms_date.tpl.php', $this->getTemplateVariables()); }
private function getCacheKey() { return ($this->alias == '' ? $this->name : "{$this->alias}_{$this->name}_") . TemplateEngine::getContext() . '_widget'; }
function u_load_asset($asset, $copyFrom = null) { return TemplateEngine::loadAssetWithUrl($asset, $copyFrom); }
public static function render($template, $templateData, $view = null) { $cacheKey = "template_{$template}_" . TemplateEngine::getContext(); $path = TemplateEngine::getPath(); if (Cache::exists($cacheKey) && Ntentan::$debug === false) { $templateFile = Cache::get($cacheKey); } else { $extension = explode('.', $template); $breakDown = explode('_', array_shift($extension)); $extension = implode(".", $extension); for ($i = 0; $i < count($breakDown); $i++) { $testTemplate = implode("_", array_slice($breakDown, $i, count($breakDown) - $i)) . ".{$extension}"; foreach (TemplateEngine::getPath() as $path) { $newTemplateFile = "{$path}/{$testTemplate}"; if (file_exists($newTemplateFile)) { Cache::add($cacheKey, $newTemplateFile); $templateFile = $newTemplateFile; break; } } if ($templateFile != '') { break; } } } if ($templateFile == null) { $pathString = "[" . implode('; ', TemplateEngine::getPath()) . "]"; Ntentan::error("Could not find a suitable template file for the current request <b><code>{$template}</code></b>. Template path <b>{$pathString}</b>"); die; } else { return TemplateEngine::getEngineInstance($templateFile)->generate($templateData, $view); } }