Index: branches/5.3.x/core/units/configuration/configuration_tag_processor.php =================================================================== diff -u -N -r15483 -r15698 --- branches/5.3.x/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 15483) +++ branches/5.3.x/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 15698) @@ -1,6 +1,6 @@ GetList($params); - $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); + $id_field = $this->getUnitConfig()->getIDField(); $list->Query(); $o = ''; @@ -107,29 +107,28 @@ function getModuleItemName() { $module = $this->Application->GetVar('module'); - $table = $this->Application->getUnitOption('confs', 'TableName'); + $table = $this->Application->getUnitConfig('confs')->getTableName(); $sql = 'SELECT ConfigHeader - FROM '.$table.' - WHERE ModuleName = '.$this->Conn->qstr($module); + FROM ' . $table . ' + WHERE ModuleName = ' . $this->Conn->qstr($module); + return $this->Conn->GetOne($sql); } function PrintConfList($params) { $list =& $this->GetList($params); - $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); $list->Query(); - $o = ''; $list->GoFirst(); - $tmp_row = Array(); + $tmp_row = Array (); - while (!$list->EOL()) { + while ( !$list->EOL() ) { $rec = $list->getCurrentRecord(); $tmp_row[0][$rec['VariableName']] = $rec['VariableValue']; - $tmp_row[0][$rec['VariableName'].'_prompt'] = $rec['Prompt']; + $tmp_row[0][$rec['VariableName'] . '_prompt'] = $rec['Prompt']; $list->GoNext(); } @@ -242,13 +241,13 @@ static $cached_ids = Array (); $var_name = $params['name']; - if (!isset($cached_ids[$var_name])) { - $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); - $sql = 'SELECT '.$id_field.' - FROM '.$table_name.' - WHERE VariableName = '.$this->Conn->qstr($params['name']); + if ( !isset($cached_ids[$var_name]) ) { + $config = $this->getUnitConfig(); + + $sql = 'SELECT ' . $config->getIDField() . ' + FROM ' . $config->getTableName() . ' + WHERE VariableName = ' . $this->Conn->qstr($params['name']); $cached_ids[$var_name] = $this->Conn->GetOne($sql); } @@ -260,13 +259,11 @@ static $cached_sections = Array (); $var_name = $params['name']; - if (!isset($cached_sections[$var_name])) { - $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); + if ( !isset($cached_sections[$var_name]) ) { $sql = 'SELECT Section - FROM '.$table_name.' - WHERE VariableName = '.$this->Conn->qstr($params['name']); + FROM ' . $this->getUnitConfig()->getTableName() . ' + WHERE VariableName = ' . $this->Conn->qstr($params['name']); $cached_sections[$var_name] = $this->Conn->GetOne($sql); }