/** * Constructor. * * @param oktCore $okt * @param string $sThemesDir * @param string $sThemesPath * @return void */ public function __construct($okt, $sThemesDir, $sThemesPath) { $this->okt = $okt; $this->sThemesPath = $sThemesPath; $this->sThemesDir = $sThemesDir; $this->oThemes = new oktThemes($okt, $sThemesPath); $this->aThemes = $this->oThemes->getThemesAdminList(); }
protected function copyAssetsFiles() { if (is_dir($this->root() . '/_install/assets/')) { foreach (oktThemes::getThemes() as $sThemeId => $sTheme) { $this->checklist->addItem('assets_dir_' . $sThemeId, $this->forceReplaceAssets(OKT_THEMES_PATH . '/' . $sThemeId, oktThemes::getLockedFiles($sThemeId)), 'Create assets dir in ' . $sTheme . ' theme', 'Cannot create assets dir in ' . $sTheme . ' theme'); } } }
*/ /** * @ingroup okt_theme_testing * @brief La page de configuration d'un thème. * */ # Accès direct interdit if (!defined('ON_CONFIGURATION_MODULE')) { die; } /* Initialisations ----------------------------------------------------------*/ # Locales l10n::set(OKT_LOCALES_PATH . '/' . $okt->user->language . '/admin.themes'); # Themes object $oThemes = new oktThemes($okt, OKT_THEMES_PATH); # Liste des thèmes présents $aInstalledThemes = $oThemes->getThemesAdminList(); # Tri par ordre alphabétique des listes de thème uasort($aInstalledThemes, array('oktThemes', 'sortThemesList')); # Theme infos $sThemeId = !empty($_REQUEST['theme_id']) ? $_REQUEST['theme_id'] : null; if (!isset($aInstalledThemes[$sThemeId])) { http::redirect('configuration.php?action=themes'); } $aThemeInfos = $aInstalledThemes[$sThemeId]; # Notes de développement $sDevNotesFilename = OKT_THEMES_PATH . '/' . $sThemeId . '/notes.md'; $bHasDevNotes = $bEditDevNotes = false; if (file_exists($sDevNotesFilename)) { $bHasDevNotes = true;
if (!$okt->config->themes_repositories_enabled) { ?> <p><?php _e('c_a_themes_repositories_themes_disabled'); ?> </p> <?php } elseif (!empty($aThemesRepositories)) { ?> <?php foreach ($aThemesRepositories as $repo_name => $aThemes) { ?> <h4><?php echo html::escapeHTML($repo_name) . ' (' . oktThemes::pluralizethemesCount(count($aThemes)) . ')'; ?> </h4> <table class="common"> <caption><?php printf('c_a_themes_list_themes_available_%s', html::escapeHTML($repo_name)); ?> </caption> <thead><tr> <th scope="col" class="left"><?php _e('c_c_Name'); ?> </th> <th scope="col" class="center"><?php _e('c_a_themes_version');
/** * La page de configuration de l'affichage * * @addtogroup Okatea * */ # Accès direct interdit if (!defined('ON_CONFIGURATION_MODULE')) { die; } # locales l10n::set(OKT_LOCALES_PATH . '/' . $okt->user->language . '/admin.display'); /* Initialisations ----------------------------------------------------------*/ $aUiThemes = htmlPage::getUiThemes(); $aThemes = array_flip(oktThemes::getThemes()); $aNotAllowedAdminThemes = array('dark-hive', 'dot-luv', 'eggplant', 'le-frog', 'mint-choc', 'swanky-purse', 'trontastic', 'ui-darkness', 'vader'); $aAllowedAdminThemes = array_diff($aUiThemes, $aNotAllowedAdminThemes); $aAllowedAdminThemes = array_combine($aAllowedAdminThemes, $aAllowedAdminThemes); foreach ($aAllowedAdminThemes as $theme) { if ($theme == $okt->config->admin_theme) { $aAllowedAdminThemes[$theme] = $theme . __('c_a_config_display_current_theme'); } } $aAllowedAdminThemes = array_flip($aAllowedAdminThemes); /* Traitements ----------------------------------------------------------*/ if (!empty($_POST['form_sent'])) { # traitement d'un éventuel theme uploadé if (isset($_FILES['p_upload_theme']) && !empty($_FILES['p_upload_theme']['tmp_name'])) { $sUploadedFile = $_FILES['p_upload_theme'];
$okt->modules->dowloadModule($_GET['download']); } else { if (!empty($_GET['templates']) && array_key_exists($_GET['templates'], $aInstalledModules)) { $sInstallClassName = $okt->modules->getInstallClass($_GET['templates']); $oInstallModule = new $sInstallClassName($okt, OKT_MODULES_PATH, $_GET['templates']); $oInstallModule->forceReplaceTpl(); # cache de la liste de module $okt->modules->generateCacheList(); $okt->page->flashMessages->addSuccess(__('c_a_modules_templates_files_replaced')); $okt->redirect('configuration.php?action=modules'); } else { if (!empty($_GET['common']) && array_key_exists($_GET['common'], $aInstalledModules)) { $sInstallClassName = $okt->modules->getInstallClass($_GET['common']); $oInstallModule = new $sInstallClassName($okt, OKT_MODULES_PATH, $_GET['common']); foreach (oktThemes::getThemes() as $sThemeId => $sTheme) { $oInstallModule->forceReplaceAssets(OKT_THEMES_PATH . '/' . $sThemeId, oktThemes::getLockedFiles($sThemeId)); } # cache de la liste de module $okt->modules->generateCacheList(); $okt->page->flashMessages->addSuccess(__('c_a_modules_common_files_replaced')); $okt->redirect('configuration.php?action=modules'); } else { if (!empty($_GET['public']) && array_key_exists($_GET['public'], $aInstalledModules)) { $sInstallClassName = $okt->modules->getInstallClass($_GET['public']); $oInstallModule = new $sInstallClassName($okt, OKT_MODULES_PATH, $_GET['public']); $oInstallModule->forceReplacePublic(); # cache de la liste de module $okt->modules->generateCacheList(); $okt->page->flashMessages->addSuccess(__('c_a_modules_public_files_replaced')); $okt->redirect('configuration.php?action=modules'); } else {