source: spip-zone/_plugins_/habillages/unstable/habillages.php @ 5439

Last change on this file since 5439 was 5439, checked in by cedric@…, 15 years ago

gestion des themes de l'espace privé sans toucher au systeme de fichier
il suffit de surcharger la fonction http_img_pack de inc/minipres pour modifier le chemin de toutes les icones
plein de code en moins

File size: 1.3 KB
Line 
1<?php
2
3$p=explode(basename(_DIR_PLUGINS)."/",str_replace('\\','/',realpath(dirname(__FILE__))));
4define('_DIR_PLUGIN_HABILLAGES',(_DIR_PLUGINS.end($p)));
5
6function habillages_ajouter_onglets($flux) {
7  if($flux['args']=='configuration')
8        $flux['data']['config_habillages']= new Bouton(
9        _DIR_PLUGIN_HABILLAGES.'/img_pack/habillage_prive-22.png', 'Habillages', generer_url_ecrire("config_habillages"));
10  return $flux;
11}
12
13function habillages_header_prive($flux){
14
15        global $exec;
16       
17        if (file_exists("img_pack/theme.xml")) {
18       
19        $theme_file = "img_pack/theme.xml";
20        $plugin_directory = _DIR_PLUGIN_HABILLAGES;
21        $open_theme_file = fopen($theme_file, 'r');
22        $theme_file_size = filesize ($theme_file);
23        $read_theme_file = fread ($open_theme_file, $theme_file_size);
24        $search_theme_name = eregi("<prefixe>(.*)</prefixe>", $read_theme_file, $theme_name);
25        $flux .= '<link rel="stylesheet" href="'.$plugin_directory.'/prive/themes/'.$theme_name[1].'/img_pack/style.css" type="text/css" />'."\n";
26        $flux .= '<meta http-equiv="Pragma" content="no-cache">'."\n";
27        $flux .= '<meta http-equiv="expires" content="0">'."\n";
28        return $flux;   
29        }
30        else {
31                $flux .= '<meta http-equiv="Pragma" content="no-cache">'."\n";
32                $flux .= '<meta http-equiv="expires" content="0">'."\n";
33                return $flux;
34        }
35}
36?>
Note: See TracBrowser for help on using the repository browser.