Used convertDashesToUnderscores()
authorRoland Häder <roland@mxchange.org>
Fri, 18 May 2012 20:07:20 +0000 (20:07 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 18 May 2012 20:07:20 +0000 (20:07 +0000)
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/criteria/class_BaseCriteria.php
inc/classes/main/template/class_BaseTemplateEngine.php

index d42cfc3968cf0c06554df81e1d23c10c3dbb2015..7ad8f74dbe0db41399145246c402434df0f7dffb 100644 (file)
@@ -1628,6 +1628,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $fieldArray = $resultInstance->current();
                //* DEBUG: */ $this->debugOutput($fieldName.':<pre>'.print_r($fieldArray, true).'</pre>');
 
                $fieldArray = $resultInstance->current();
                //* DEBUG: */ $this->debugOutput($fieldName.':<pre>'.print_r($fieldArray, true).'</pre>');
 
+               // Convert dashes to underscore
+               $fieldName = $this->convertDashesToUnderscores($fieldName);
+
                // Does the field exist?
                if (isset($fieldArray[$fieldName])) {
                        // Get it
                // Does the field exist?
                if (isset($fieldArray[$fieldName])) {
                        // Get it
index 4b77b8f1e7ba8fbb6c8bd455287d549a5fa66dd3..a3daa36e1cb4ac5001756d22ff8d1b91444c5fee 100644 (file)
@@ -79,7 +79,7 @@ class BaseCriteria extends BaseFrameworkSystem {
         * @return      void
         */
        public final function addCriteria ($criteriaKey, $criteriaValue) {
         * @return      void
         */
        public final function addCriteria ($criteriaKey, $criteriaValue) {
-               $this->criteria[str_replace('-', '_', $criteriaKey)] = (string)$criteriaValue;
+               $this->criteria[$this->convertDashesToUnderscores($criteriaKey)] = (string)$criteriaValue;
        }
 
        /**
        }
 
        /**
@@ -103,7 +103,7 @@ class BaseCriteria extends BaseFrameworkSystem {
         */
        public function getCriteriaElemnent ($criteriaKey) {
                // Convert dashes to underscore
         */
        public function getCriteriaElemnent ($criteriaKey) {
                // Convert dashes to underscore
-               $criteriaKey = str_replace('-', '_', $criteriaKey);
+               $criteriaKey = $this->convertDashesToUnderscores($criteriaKey);
 
                // Default is not found
                $value = NULL;
 
                // Default is not found
                $value = NULL;
@@ -132,12 +132,12 @@ class BaseCriteria extends BaseFrameworkSystem {
                // Walk through all entries
                foreach ($entryArray as $key => $entry) {
                        // Convert dashes to underscore
                // Walk through all entries
                foreach ($entryArray as $key => $entry) {
                        // Convert dashes to underscore
-                       $key = str_replace('-', '_', $key);
+                       $key = $this->convertDashesToUnderscores($key);
 
                        // Then walk through all search criteria
                        foreach ($this->criteria as $criteriaKey => $criteriaValue) {
                                // Convert dashes to underscore
 
                        // Then walk through all search criteria
                        foreach ($this->criteria as $criteriaKey => $criteriaValue) {
                                // Convert dashes to underscore
-                               $criteriaKey = str_replace('-', '_', $criteriaKey);
+                               $criteriaKey = $this->convertDashesToUnderscores($criteriaKey);
 
                                // Is the element found and does it match?
                                if (($key == $criteriaKey) && ($criteriaValue == $entry)) {
 
                                // Is the element found and does it match?
                                if (($key == $criteriaKey) && ($criteriaValue == $entry)) {
@@ -167,7 +167,7 @@ class BaseCriteria extends BaseFrameworkSystem {
                // Now walk through all criterias
                foreach ($this->criteria as $criteriaKey => $criteriaValue) {
                        // Convert dashes to underscore
                // Now walk through all criterias
                foreach ($this->criteria as $criteriaKey => $criteriaValue) {
                        // Convert dashes to underscore
-                       $criteriaKey = str_replace('-', '_', $criteriaKey);
+                       $criteriaKey = $this->convertDashesToUnderscores($criteriaKey);
 
                        // Is the value in array or is $onlyKeys empty?
                        if ((isset($onlyKeys[$criteriaKey])) || (count($onlyKeys) == 0)) {
 
                        // Is the value in array or is $onlyKeys empty?
                        if ((isset($onlyKeys[$criteriaKey])) || (count($onlyKeys) == 0)) {
index 96952b447f1c4085a6a325558f7b10e9a25faa8f..272b9d718ee1db9c99b4659971af8fee6f6afd75 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
         */
        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;
 
                // 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
         */
        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;
 
                // 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
         */
        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);
 
                // 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
         */
        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);
 
                // 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
         */
        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);
 
                // 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
         */
        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(
 
                // 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
         */
        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)) {
 
                // 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
         */
        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);
 
                // Debug message
                //* DEBUG: */ $this->debugOutput(__METHOD__ . ': varName=' . $varName . ',var=' . $var);
@@ -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
                // 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);
 
                        // Debug message
                        $this->debugOutput(__METHOD__ . ':key=' . $key . ',var=' . $var);
@@ -1148,7 +1148,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function assignConfigVariable ($var) {
                // Replace all dashes to underscores to match variables with configuration entries
         */
        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));
 
                // Sweet and simple...
                //* DEBUG: */ $this->debugOutput(__METHOD__ . ': var=' . $var . ',getConfigEntry()=' . $this->getConfigInstance()->getConfigEntry($var));