17 $this->mRoot->mDelegateManager->add(
'Legacy.Event.ThemeSettingChanged', [$this,
'doThemeSettingChanged']);
20 public function doThemeSettingChanged($mainTheme, $selectableThemes)
22 $root = XCube_Root::getSingleton();
23 $db = $root->mController->mDB;
24 $table = $db->prefix(
'users');
26 $mainTheme = $db->quoteString($mainTheme);
29 $t_conds[] =
'theme <> ' . $db->quoteString(
'');
30 foreach ($selectableThemes as $theme) {
31 $t_conds[] =
'theme <> ' . $db->quoteString($theme);
34 $sql =
"UPDATE {$table} SET theme={$mainTheme} WHERE " . implode(
' AND ', $t_conds);