X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Finterfaces%2Ftemplate%2Fclass_CompileableTemplate.php;h=d12656878f85a85f83fffa9095bee60d415406a7;hp=41791914ee5581de90d9de32d04206018624081f;hb=5203f9bd014ad46fbc7ee54e7223dcd46e14e3b4;hpb=8904918d814abf3468d084b8826e4d280b0885e3;ds=sidebyside diff --git a/inc/classes/interfaces/template/class_CompileableTemplate.php b/inc/classes/interfaces/template/class_CompileableTemplate.php index 41791914..d1265687 100644 --- a/inc/classes/interfaces/template/class_CompileableTemplate.php +++ b/inc/classes/interfaces/template/class_CompileableTemplate.php @@ -2,11 +2,11 @@ /** * An interface for template engines * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.shipsimu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,13 +32,13 @@ interface CompileableTemplate extends FrameworkInterface { function assignVariable ($variableName, $value); /** - * Load a specified web template into the engine + * Load a specified HTML template into the engine * * @param $template The web template we shall load which is located in * "html" by default * @return void */ - function loadWebTemplate ($template); + function loadHtmlTemplate ($template); /** * Load a specified code template into the engine for later compilation @@ -50,6 +50,16 @@ interface CompileableTemplate extends FrameworkInterface { */ function loadCodeTemplate ($template); + /** + * Load a specified email template into the engine for later compilation + * with other code/web/email templates. + * + * @param $template The email template we shall load which is + * located in "html" by default + * @return void + */ + function loadEmailTemplate ($template); + /** * Compile all variables by inserting their respective values * @@ -78,9 +88,10 @@ interface CompileableTemplate extends FrameworkInterface { * Removes a given variable * * @param $variableName The variable we are looking for + * @param $variableGroup Name of variable group (default: 'general') * @return void */ - function removeVariable ($variableName); + function removeVariable ($variableName, $variableGroup = 'general'); /** * Assign a given congfiguration variable with a value @@ -128,10 +139,10 @@ interface CompileableTemplate extends FrameworkInterface { * "Compiles" a variable by replacing {?var?} with it's content * * @param $rawCode Raw code to compile - * @param $setMatchAsCode Sets $match if readVariable() returns empty result - * @return $rawCode Compile code with inserted variable value + * @param $setMatchAsCode Sets $match if readVariable() returns empty result (default: FALSE) + * @return $rawCode Compile code with inserted variable value */ - function compileRawCode ($rawCode, $setMatchAsCode=false); + function compileRawCode ($rawCode, $setMatchAsCode = FALSE); /** * Renames a variable in code and in stack @@ -157,7 +168,7 @@ interface CompileableTemplate extends FrameworkInterface { * @param $languageSupport New language support setting * @return void */ - function enableLanguageSupport ($languageSupport = true); + function enableLanguageSupport ($languageSupport = TRUE); /** * Checks whether language support is enabled @@ -172,7 +183,7 @@ interface CompileableTemplate extends FrameworkInterface { * @param $xmlCompacting New XML compacting setting * @return void */ - function enableXmlCompacting ($xmlCompacting = true); + function enableXmlCompacting ($xmlCompacting = TRUE); /** * Checks whether XML compacting is enabled @@ -188,6 +199,86 @@ interface CompileableTemplate extends FrameworkInterface { * @return $compactedContent The compacted content */ function compactContent ($uncompactedContent); + + /** + * Getter for given variable group + * + * @param $variableGroup Variable group to check + * @return $varStack Found variable group + */ + function getVarStack ($variableGroup); + + /** + * Settter for variable group + * + * @param $groupName Name of variable group + * @param $add Whether add this group + * @return void + */ + function setVariableGroup ($groupName, $add = TRUE); + + /** + * Getter for template type + * + * @return $templateType The current template's type + */ + function getTemplateType (); + + /** + * Getter for base path + * + * @return $templateBasePath The relative base path for all templates + */ + function getTemplateBasePath (); + + /** + * Getter for generic base path + * + * @return $templateBasePath The relative base path for all templates + */ + function getGenericBasePath (); + + /** + * Getter for template extension + * + * @return $templateExtension The file extension for all uncompiled + * templates + */ + function getRawTemplateExtension (); + + /** + * Getter for code-template extension + * + * @return $codeExtension The file extension for all code- + * templates + */ + function getCodeTemplateExtension (); + + /** + * Getter for raw template data + * + * @return $rawTemplateData The raw data from the template + */ + function getRawTemplateData (); + + /** + * Assigns a lot variables into the stack of currently loaded template. + * This method should only be used in very rare circumstances, e.g. when + * you have to copy a whole set of variables into the template engine. + * Before you use this method, please make sure you have considered all + * other possiblities. + * + * @param $variables An array with variables to be assigned + * @return void + */ + function assignMultipleVariables (array $variables); + + /** + * Getter for variable group array + * + * @return $variableGroups All variable groups + */ + function getVariableGroups (); } // [EOF]