public function getCSSFilesForAllAvailableVariants() { $available_variants = $this->theme_variant->getAllowedVariants(); $css_files = array(); foreach ($available_variants as $variant) { $css_files[] = self::FULL_PATH . $variant . '.css'; } return $css_files; }
} // $theme_list is defined in /www/include/utils.php $user_theme = $GLOBALS['sys_themedefault']; $theme_list = util_get_theme_list(); if ($request->existAndNonEmpty('user_theme')) { if ($request->valid(new Valid_WhiteList('user_theme', $theme_list))) { $user_theme = $request->get('user_theme'); } else { $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('account_preferences', 'error_user_theme')); } } $user_theme_variant = null; $requested_variant = 'current_theme_variant'; $theme_variant = new ThemeVariant(); if ($request->existAndNonEmpty($requested_variant)) { $validator = new Valid_WhiteList('current_theme_variant', $theme_variant->getAllowedVariants()); if ($request->valid($validator)) { $user_theme_variant = $request->get($requested_variant); } else { $user_theme_variant = $theme_variant->getDefault(); } } $user_edition_default_format = null; $requested_default_format = 'user_text_default_format'; if ($request->existAndNonEmpty($requested_variant)) { $user_edition_default_format = $request->get($requested_default_format); } $form_sticky_login = 0; if ($request->existAndNonEmpty('form_sticky_login')) { if ($request->valid(new Valid_WhiteList('form_sticky_login', array(0, 1)))) { $form_sticky_login = (int) $request->get('form_sticky_login');
<?php /** * Copyright (c) Enalean, 2014. All rights reserved * * This file is a part of Tuleap. * * Tuleap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Tuleap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Tuleap. If not, see <http://www.gnu.org/licenses/ */ require_once 'pre.php'; $available_theme_variants = array('selected' => false, 'values' => array()); if ($request->get('theme') === 'FlamingParrot') { require_once '../themes/FlamingParrot/FlamingParrot_CSSFilesProvider.class.php'; $theme_variant = new ThemeVariant(); $css_file_selector = new FlamingParrot_CSSFilesProvider($theme_variant); $available_theme_variants['selected'] = $theme_variant->getVariantForUser($request->getCurrentUser()); $available_theme_variants['values'] = $theme_variant->getAllowedVariants(); $available_theme_variants['css_files'] = $css_file_selector->getCSSFilesForAllAvailableVariants(); } $GLOBALS['Response']->sendJSON($available_theme_variants);