Index: branches/5.3.x/core/units/themes/themes_eh.php =================================================================== diff -u -N -r15483 -r15698 --- branches/5.3.x/core/units/themes/themes_eh.php (.../themes_eh.php) (revision 15483) +++ branches/5.3.x/core/units/themes/themes_eh.php (.../themes_eh.php) (revision 15698) @@ -1,6 +1,6 @@ Application->getUnitOption($this->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); + $config = $this->getUnitConfig(); + $table_name = $config->getTableName(); $sql = 'UPDATE '.$table_name.' SET PrimaryTheme = 0'; @@ -87,7 +87,7 @@ $sql = 'UPDATE '.$table_name.' SET PrimaryTheme = 1, Enabled = 1 - WHERE '.$id_field.' = '.$id; + WHERE '. $config->getIDField() .' = '.$id; $this->Conn->Query($sql); } @@ -127,14 +127,12 @@ return ; } + $config = $event->getUnitConfig(); $ids = $event->getEventParam('ids'); - $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - $sql = 'SELECT COUNT(*) - FROM ' . $table_name . ' - WHERE ' . $id_field . ' IN (' . $ids . ') AND (Enabled = 1)'; + FROM ' . $config->getTableName() . ' + WHERE ' . $config->getIDField() . ' IN (' . $ids . ') AND (Enabled = 1)'; $enabled_themes = $this->Conn->GetOne($sql); if ( $enabled_themes ) {