* @return void
*/
public final function addCriteria ($criteriaKey, $criteriaValue) {
- $this->criteria[str_replace('-', '_', $criteriaKey)] = (string)$criteriaValue;
+ $this->criteria[$this->convertDashesToUnderscores($criteriaKey)] = (string)$criteriaValue;
}
/**
*/
public function getCriteriaElemnent ($criteriaKey) {
// Convert dashes to underscore
- $criteriaKey = str_replace('-', '_', $criteriaKey);
+ $criteriaKey = $this->convertDashesToUnderscores($criteriaKey);
// Default is not found
$value = NULL;
// 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
- $criteriaKey = str_replace('-', '_', $criteriaKey);
+ $criteriaKey = $this->convertDashesToUnderscores($criteriaKey);
// Is the element found and does it match?
if (($key == $criteriaKey) && ($criteriaValue == $entry)) {
// 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)) {
*/
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;
*/
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;
*/
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);
*/
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);
*/
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);
*/
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(
*/
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)) {
*/
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);
// 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);
*/
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));