getOptions(); } if (method_exists($theme, 'getThemeData')) { $options = array_merge($options, $theme->getThemeData()); } unset($options['data']); foreach ($getKeys as $key) { $method = 'get' . ucfirst($key); if (method_exists($theme, $method)) { $options[$key] = $theme->{$method}(); } } // TAO default logo URL is different if ($theme instanceof DefaultTheme) { $options['logoUrl'] = Template::img('tao-logo.png', 'tao'); } if (method_exists($theme, 'getTemplate')) { if (empty($options[ConfigurablePlatformTheme::TEMPLATES])) { $options[ConfigurablePlatformTheme::TEMPLATES] = []; } foreach ($templates as $id) { $template = $theme->getTemplate($id); if (!is_null($template)) { $options[ConfigurablePlatformTheme::TEMPLATES][$id] = $template; } } } // example: oat\taoExtension\model\theme\MyTheme $themeClass = get_class($theme); //@todo: map to container id if (empty($options[ConfigurablePlatformTheme::EXTENSION_ID])) { strtok($themeClass, '\\'); $options[ConfigurablePlatformTheme::EXTENSION_ID] = strtok('\\'); } if (empty($options[ConfigurablePlatformTheme::LABEL])) { $options[ConfigurablePlatformTheme::LABEL] = basename($themeClass); } return new ConfigurablePlatformTheme($options); } }