Commented out all debug lines in template engine
[core.git] / inc / classes / main / template / class_BaseTemplateEngine.php
index 96952b447f1c4085a6a325558f7b10e9a25faa8f..a95838ec3cb117e8834566975ed9518a2b9c0faa 100644 (file)
@@ -173,7 +173,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function getVariableIndex ($var, $stack = NULL) {
                // Replace all dashes to underscores to match variables with configuration entries
-               $var = trim(str_replace('-', '_', $var));
+               $var = trim($this->convertDashesToUnderscores($var));
 
                // First everything is not found
                $found = false;
@@ -248,7 +248,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        protected function readVariable ($var, $stack = NULL) {
                // Replace all dashes to underscores to match variables with configuration entries
-               $var = trim(str_replace('-', '_', $var));
+               $var = trim($this->convertDashesToUnderscores($var));
 
                // First everything is not found
                $content = NULL;
@@ -336,7 +336,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function addGroupVariable ($var, $value) {
                // Replace all dashes to underscores to match variables with configuration entries
-               $var = trim(str_replace('-', '_', $var));
+               $var = trim($this->convertDashesToUnderscores($var));
 
                // Debug message
                //* DEBUG: */ $this->debugOutput(__METHOD__.': group=' . $this->currGroup . ', var=' . $var . ', value=' . $value);
@@ -373,7 +373,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function modifyVariable ($var, $value) {
                // Replace all dashes to underscores to match variables with configuration entries
-               $var = trim(str_replace('-', '_', $var));
+               $var = trim($this->convertDashesToUnderscores($var));
 
                // Get index for variable
                $index = $this->getVariableIndex($var);
@@ -412,7 +412,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        protected function setVariable ($varGroup, $var, $value) {
                // Replace all dashes to underscores to match variables with configuration entries
-               $var = trim(str_replace('-', '_', $var));
+               $var = trim($this->convertDashesToUnderscores($var));
 
                // Get index for variable
                $index = $this->getVariableIndex($var);
@@ -437,7 +437,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function generateVariableArray ($var, $value) {
                // Replace all dashes to underscores to match variables with configuration entries
-               $var = trim(str_replace('-', '_', $var));
+               $var = trim($this->convertDashesToUnderscores($var));
 
                // Generate the temporary array
                $varData = array(
@@ -587,7 +587,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public final function assignVariable ($var, $value) {
                // Replace all dashes to underscores to match variables with configuration entries
-               $var = trim(str_replace('-', '_', $var));
+               $var = trim($this->convertDashesToUnderscores($var));
 
                // Empty variable found?
                if (empty($var)) {
@@ -783,7 +783,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        private function assignTemplateVariable ($varName, $var) {
                // Replace all dashes to underscores to match variables with configuration entries
-               $var = trim(str_replace('-', '_', $var));
+               $var = trim($this->convertDashesToUnderscores($var));
 
                // Debug message
                //* DEBUG: */ $this->debugOutput(__METHOD__ . ': varName=' . $varName . ',var=' . $var);
@@ -812,7 +812,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                preg_match_all('/\$(\w+)(\[(\w+)\])?/', $rawData, $variableMatches);
 
                // Debug message
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ':rawData(' . strlen($rawData) . ')=' . $rawData . ',variableMatches=' . print_r($variableMatches, true));
+               //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':rawData(' . strlen($rawData) . ')=' . $rawData . ',variableMatches=' . print_r($variableMatches, true));
 
                // Did we find some variables?
                if ((is_array($variableMatches)) && (count($variableMatches) == 4) && (count($variableMatches[0]) > 0)) {
@@ -1007,7 +1007,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                // Search for all variables
                foreach ($varMatches[1] as $key => $var) {
                        // Replace all dashes to underscores to match variables with configuration entries
-                       $var = trim(str_replace('-', '_', $var));
+                       $var = trim($this->convertDashesToUnderscores($var));
 
                        // Debug message
                        $this->debugOutput(__METHOD__ . ':key=' . $key . ',var=' . $var);
@@ -1060,7 +1060,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                                if (($foundIndex !== false) && (isset($templateMatches[3][$foundIndex]))) {
                                        // Split it up with another reg. exp. into variable=value pairs
                                        preg_match_all($this->regExpVarValue, $templateMatches[3][$foundIndex], $varMatches);
-                                       ///* DEBUG: */ $this->debugOutput(__METHOD__ . ':varMatches=' . print_r($varMatches,true));
+                                       //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':varMatches=' . print_r($varMatches, true));
 
                                        // Assign all variables
                                        $this->assignAllVariables($varMatches);
@@ -1148,7 +1148,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function assignConfigVariable ($var) {
                // Replace all dashes to underscores to match variables with configuration entries
-               $var = trim(str_replace('-', '_', $var));
+               $var = trim($this->convertDashesToUnderscores($var));
 
                // Sweet and simple...
                //* DEBUG: */ $this->debugOutput(__METHOD__ . ': var=' . $var . ',getConfigEntry()=' . $this->getConfigInstance()->getConfigEntry($var));
@@ -1323,7 +1323,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                preg_match_all($this->regExpCodeTags, $rawData, $templateMatches);
 
                // Debug message
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ':templateMatches=' . print_r($templateMatches , true));
+               //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':templateMatches=' . print_r($templateMatches , true));
 
                // Analyze the matches array
                if ((is_array($templateMatches)) && (count($templateMatches) == 4) && (count($templateMatches[0]) > 0)) {
@@ -1430,11 +1430,11 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function compileRawCode ($rawCode, $setMatchAsCode=false) {
                // Find the variables
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ':rawCode=<pre>' . htmlentities($rawCode) . '</pre>');
+               //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':rawCode=<pre>' . htmlentities($rawCode) . '</pre>');
                preg_match_all($this->regExpVarValue, $rawCode, $varMatches);
 
                // Compile all variables
-               //* DEBUG: */ $this->debugOutput(__METHOD__ . ':<pre>' . print_r($varMatches, true) . '</pre>');
+               //* NOISY-DEBUG: */ $this->debugOutput(__METHOD__ . ':<pre>' . print_r($varMatches, true) . '</pre>');
                foreach ($varMatches[0] as $match) {
                        // Add variable tags around it
                        $varCode = '{?' . $match . '?}';
@@ -1445,7 +1445,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        // Is the variable found in code? (safes some calls)
                        if (strpos($rawCode, $varCode) !== false) {
                                // Debug message
-                               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': match=' . $match . ',value[' . gettype($value) . ']=' . $value);
+                               //* DEBUG: */ $this->debugOutput(__METHOD__ . ': match=' . $match . ',rawCode[' . gettype($rawCode) . ']=' . $rawCode);
 
                                // Use $match as new value or $value from read variable?
                                if ($setMatchAsCode === true) {