Add module template files to config for smarty.

@param array  $aModuleTemplates Module templates array
@param string $sModuleId        Module id
506477
protected function _addTemplateFiles($aModuleTemplates, $sModuleId)
    {
        $aTemplates = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleTemplates');
        if (is_array($aModuleTemplates)) {
            $aTemplates[$sModuleId] = $aModuleTemplates;
        }

        $this->_saveToConfig('aModuleTemplates', $aTemplates);
    }
771021
public function modalTabToolTemplateAddAction()
    {
        // declare the Tool service that we will be using to completely create our tool.
        $melisTool = $this->getServiceLocator()->get('MelisCoreTool');

        // tell the Tool what configuration in the app.tool.php that will be used.
        $melisTool->setMelisToolKey('meliscms', 'meliscms_tool_templates');

        $view = new ViewModel();

        $view->setVariable('meliscms_tool_template_add', $melisTool->getForm('meliscms_tool_template_generic_form'));

        return $view;
    }
359526
private function loadTemplate($templateId)
    {
        $template = $this->templateFactory->create();
        $this->templateResource->load($template, $templateId);

        return $template;
    }
438034
public function addTemplates($templates)
    {
        foreach ($templates as $name => $template) {
            $this->twig->getLoader()->setTemplate($name, $template);
        }
    }
1160863
public function getTemplates($sModuleId = null)
    {
        if (is_null($sModuleId)) {
            $sModuleId = $this->getId();
        }

        if (!$sModuleId) {
            return [];
        }

        $sShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();

        return \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getCol("SELECT oxtemplate FROM oxtplblocks WHERE oxmodule = '$sModuleId' AND oxshopid = '$sShopId'");
    }
99881
protected function getAvailableTemplateFromTypoScriptConfiguration($pageId, $templateKey)
    {
        $configuration = $this->getConfigurationFromPageId($pageId);
        return $configuration->getAvailableTemplatesByFileKey($templateKey);
    }
159610
public function setTemplateFile(string $templateFile)
    {
        if (!$templateFile) {
            return $this;
        }
        $this->templateFile = (string) $templateFile;

        return $this;
    }
1040143
public function writeCachedContent(Smarty_Internal_Template $_template, $content)
    {
        $this->addMetaTimestamp($content);

        return $this->write(array($_template->cached->filepath => $content), $_template->cache_lifetime);
    }
1157457
public static function SetTemplate($sTemplateFilename, $sMasterpageFilename = null){
            $oThis = self::CreateInstanceIfNotExists();
            
            if(is_object($oThis->oSmarty)){
                if(!is_null($sMasterpageFilename)){
                    $sContent = $oThis->oSmarty->fetch($sTemplateFilename);
                    $oThis->oSmarty->assign('template', $sContent); 
                    $oThis->sTemplateFilename = $sMasterpageFilename;
                }
                else{
                    $oThis->sTemplateFilename = $sTemplateFilename;
                }
            }
            else{
                $sTemplate = (file_exists($sTemplateFilename)) ? file_get_contents($sTemplateFilename) : null;
                $sMasterpage = (file_exists($sMasterpageFilename)) ? file_get_contents($sMasterpageFilename) : null;

                if(!is_null($sMasterpage))
                    $oThis->sBuffer = str_replace("{\$template}", $sTemplate, $sMasterpage);
                else
                    $oThis->sBuffer = $sTemplate;

                if(Storage::Get("app.minified") && !Storage::Get("debug"))
                    $oThis->SanitizeOutput($oThis->sBuffer);

                $oThis->IncludeTemplate();
            }
        }
560433
public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
    {
        $cached->filepath = $_template->source->uid
                . '#' . $this->sanitize($cached->source->resource)
                . '#' . $this->sanitize($cached->cache_id)
                . '#' . $this->sanitize($cached->compile_id);

        $this->populateTimestamp($cached);
    }
976012
function SmartTemplate ( $template_filename = '' )
		{
			global $_CONFIG;

			if (!empty($_CONFIG['smarttemplate_compiled']))
			{
				$this->temp_dir  =  $_CONFIG['smarttemplate_compiled'];
			}
			if (!empty($_CONFIG['smarttemplate_cache']))
			{
				$this->cache_dir  =  $_CONFIG['smarttemplate_cache'];
			}
			if (is_numeric($_CONFIG['cache_lifetime']))
			{
				$this->cache_lifetime  =  $_CONFIG['cache_lifetime'];
			}
			if (!empty($_CONFIG['template_dir'])  &&  is_file($_CONFIG['template_dir'] . '/' . $template_filename))
			{
				$this->template_dir  =  $_CONFIG['template_dir'];
			}
			$this->tpl_file  =  $template_filename;
		}
581049
public function setTemplate($templateId)
    {
        if ($template = $this->getTemplate($templateId)) {
            $this->subject = $template['gctt_subject'];
            $this->bodyBb = $template['gctt_body'];
            $this->setTemplateId($templateId);
        }
    }
1346688
private function loadCompiledTemplate(Smarty_Internal_Template $_template)
    {
        if (function_exists('opcache_invalidate')) {
            opcache_invalidate($_template->compiled->filepath);
        }
        $_smarty_tpl = $_template;
        if (defined('HHVM_VERSION')) {
            $_template->smarty->ext->_hhvm->includeHhvm($_template, $_template->compiled->filepath);
        } else {
            include($_template->compiled->filepath);
        }
    }
822954
public function compileTemplate(Smarty_Internal_Template $template)
    {
        $this->template = $template;
        $this->template->compiled->file_dependency[$this->template->source->uid] = array($this->template->source->filepath,
                                                                                             $this->template->source->getTimeStamp(),
                                                                                             $this->template->source->type);
        if ($this->smarty->debugging) {
            $this->smarty->_debug->start_compile($this->template);
        }
        // init the lexer/parser to compile the config file
        /* @var Smarty_Internal_ConfigFileLexer $lex */
        $lex = new $this->lexer_class(str_replace(array("\r\n", "\r"), "\n", $template->source->getContent()) .
                                      "\n", $this);
        /* @var Smarty_Internal_ConfigFileParser $parser */
        $parser = new $this->parser_class($lex, $this);

        if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
            $mbEncoding = mb_internal_encoding();
            mb_internal_encoding('ASCII');
        } else {
            $mbEncoding = null;
        }

        if ($this->smarty->_parserdebug) {
            $parser->PrintTrace();
        }
        // get tokens from lexer and parse them
        while ($lex->yylex()) {
            if ($this->smarty->_parserdebug) {
                echo "<br>Parsing  {$parser->yyTokenName[$lex->token]} Token {$lex->value} Line {$lex->line} \n";
            }
            $parser->doParse($lex->token, $lex->value);
        }
        // finish parsing process
        $parser->doParse(0, 0);

        if ($mbEncoding) {
            mb_internal_encoding($mbEncoding);
        }
        if ($this->smarty->debugging) {
            $this->smarty->_debug->end_compile($this->template);
        }
        // template header code
        $template_header = "<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " .
            strftime("%Y-%m-%d %H:%M:%S") . "\n";
        $template_header .= "         compiled from \"" . $this->template->source->filepath . "\" */ ?>\n";

        $code = '<?php $_smarty_tpl->smarty->ext->configLoad->_loadConfigVars($_smarty_tpl, ' .
            var_export($this->config_data, true) . '); ?>';
        return $template_header . $this->template->smarty->ext->_codeFrame->create($this->template, $code);
    }
342274
public function populateCompiledFilepath(Smarty_Internal_Template $_template)
    {
        $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w]+!', '_', $_template->compile_id) : null;
        if ($_template->source->isConfig) {
            $_flag = '_' .
                ((int) $_template->smarty->config_read_hidden + (int) $_template->smarty->config_booleanize * 2 +
                    (int) $_template->smarty->config_overwrite * 4);
        } else {
            $_flag =
                '_' . ((int) $_template->smarty->merge_compiled_includes + (int) $_template->smarty->escape_html * 2);
        }
        $_filepath = $_template->source->uid . $_flag;
        // if use_sub_dirs, break file into directories
        if ($_template->smarty->use_sub_dirs) {
            $_filepath = substr($_filepath, 0, 2) . DS . substr($_filepath, 2, 2) . DS . substr($_filepath, 4, 2) . DS .
                $_filepath;
        }
        $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^';
        if (isset($_compile_id)) {
            $_filepath = $_compile_id . $_compile_dir_sep . $_filepath;
        }
        // caching token
        if ($_template->caching) {
            $_cache = '.cache';
        } else {
            $_cache = '';
        }
        $_compile_dir = $_template->smarty->getCompileDir();
        // set basename if not specified
        $_basename = $_template->source->handler->getBasename($_template->source);
        if ($_basename === null) {
            $_basename = basename(preg_replace('![^\w]+!', '_', $_template->source->name));
        }
        // separate (optional) basename by dot
        if ($_basename) {
            $_basename = '.' . $_basename;
        }

        $this->filepath = $_compile_dir . $_filepath . '.' . $_template->source->type . $_basename . $_cache . '.php';
        $this->exists = is_file($this->filepath);
        if (!$this->exists) {
            $this->timestamp = false;
        }
    }
71138
static function ModuleCustomTemplatesFolder(TemplateModule $module)
    {
        $parentFolder = Path::Combine(PHINE_PATH, 'App/Phine/ModuleTemplates');
        $bundleFolder = Path::Combine($parentFolder, $module->MyBundle());
        return Path::Combine($bundleFolder, $module->MyName());
    }
1021965
protected function _saveModulePath($sModuleId, $sModulePath)
    {
        $aModulePaths = $this->getModuleConfigParametersByKey(static::MODULE_KEY_PATHS);

        $aModulePaths[$sModuleId] = $sModulePath;
        \OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar('aarr', 'aModulePaths', $aModulePaths);
    }