Index: branches/5.3.x/core/units/helpers/themes_helper.php =================================================================== diff -u -N -r15584 -r15698 --- branches/5.3.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 15584) +++ branches/5.3.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 15698) @@ -1,6 +1,6 @@ Application->getUnitOption('theme', 'IDField'); - $table_name = $this->Application->getUnitOption('theme', 'TableName'); + $config = $this->Application->getUnitConfig('theme'); + $id_field = $config->getIDField(); + $table_name = $config->getTableName(); $sql = 'SELECT * FROM ' . $table_name . ' @@ -149,8 +150,10 @@ */ protected function _saveThemeSettings($theme_id, $theme_path) { - $id_field = $this->Application->getUnitOption('theme', 'IDField'); - $table_name = $this->Application->getUnitOption('theme', 'TableName'); + $config = $this->Application->getUnitConfig('theme'); + $id_field = $config->getIDField(); + $table_name = $config->getTableName(); + $this->Conn->doUpdate($this->_getThemeSettings($theme_id, $theme_path), $table_name, $id_field . ' = ' . $theme_id); } @@ -509,8 +512,9 @@ catch ( UnexpectedValueException $e ) { } - $id_field = $this->Application->getUnitOption('theme', 'IDField'); - $table_name = $this->Application->getUnitOption('theme', 'TableName'); + $config = $this->Application->getUnitConfig('theme'); + $id_field = $config->getIDField(); + $table_name = $config->getTableName(); // 1. only one theme found -> enable it and make primary /*if (count($themes_found) == 1) { @@ -554,10 +558,10 @@ return ; } - $id_field = $this->Application->getUnitOption('theme', 'IDField'); - $table_name = $this->Application->getUnitOption('theme', 'TableName'); + $config = $this->Application->getUnitConfig('theme'); + $id_field = $config->getIDField(); - $sql = 'DELETE FROM '.$table_name.' + $sql = 'DELETE FROM '. $config->getTableName() .' WHERE '.$id_field.' IN ('.implode(',', $theme_ids).')'; $this->Conn->Query($sql); @@ -585,11 +589,10 @@ if ($theme_id === false) { // query, because "m_theme" is always empty in admin - $id_field = $this->Application->getUnitOption('theme', 'IDField'); - $table_name = $this->Application->getUnitOption('theme', 'TableName'); + $config = $this->Application->getUnitConfig('theme'); - $sql = 'SELECT ' . $id_field . ' - FROM ' . $table_name . ' + $sql = 'SELECT ' . $config->getIDField() . ' + FROM ' . $config->getTableName() . ' WHERE (PrimaryTheme = 1) AND (Enabled = 1)'; $theme_id = $this->Conn->GetOne($sql); } @@ -623,9 +626,10 @@ } $template_crc = kUtil::crc32(mb_strtolower($template)); + $categories_config = $this->Application->getUnitConfig('c'); - $sql = 'SELECT ' . $this->Application->getUnitOption('c', 'IDField') . ' - FROM ' . $this->Application->getUnitOption('c', 'TableName') . ' + $sql = 'SELECT ' . $categories_config->getIDField() . ' + FROM ' . $categories_config->getTableName() . ' WHERE ( (NamedParentPathHash = ' . $template_crc . ') OR