Nouveau sujet Répondre Imprimer Syndication RSS 2.0

[RC5]Changement du logo impossible

Nouvelle étincelle
Avatar de oppie
  • Messages : 12
  • Inscrit : 30 Octobre 2007
  Lien vers ce message 30 Octobre 2007, 19:49
  1. Type de bug : Bug sur le forum (côté PHP)
  2. Zone du forum affectée : Administration
  3. Priorité du bug : Basse
  4. Description : Quand je modifie l'image du logo dans le skin whitesummer à partir d'un fichier ou d'une url, tous les liens vers les images se trouvent supprimés http://www.fire-soft-board.com/fsb/images/smileys/fsb2_larme.gif
    Après cela, plus aucune icones ne s'affichent sur le forum.
  5. Elément de réponse : Aucun pour le bug, mais une simple réinstallation du thème remet tout à zéro.
  6. Fichier(s) :
  7. Base de donnée utilisée : MySQL 5
  8. Type de serveur : Apache (généralement unix)
 
Etoile
Avatar de BlackJowy
  • Age : 22 ans
  • Messages : 3459
  • Inscrit : 01 Mars 2007
  Lien vers ce message 30 Octobre 2007, 20:22
Euh, tu peux nous montrer le code source de la page qui bug ou ce que tu as modifié ?

Parce que ça m'a pas l'air d'un bug de la rc5 mais plutot d'une fausse manip :s


"It's backup day today so I'm pissed off. Being the BOFH, however, does have it's advantages. I reassign null to be the tape device — it's so much more economical on my time as I don't have to keep getting up to change tapes every 5 minutes. And it speeds up backups too, so it can't be all bad can it? Of course not." S.Travaglia

 
Nouvelle étincelle
Avatar de oppie
  • Messages : 12
  • Inscrit : 30 Octobre 2007
Message édité 5 fois, dernière édition par oppie, 31 Octobre 2007, 2:28     Lien vers ce message 30 Octobre 2007, 20:58
Revoilà le message édité (enfin j'espère http://www.fire-soft-board.com/fsb/images/smileys/fsb2_lol.gif)

Donc voici les étapes de ce qui se produit d'un point de vue admin :

http://oppie.free.fr/affichage/01.png

Sélection de l'image à remplacer.

http://oppie.free.fr/affichage/02.png

Suppression de tous les images du thème

http://oppie.free.fr/affichage/03.png

Affichage de l'index du forum

Ensuite pour les codes sources

<?php
/*
** +---------------------------------------------------+
** | Name :        ~/admin/general/general_tpl.php
** | Begin :    04/07/2005
** | Last :        22/10/2007
** | User :        Genova
** | Project :    Fire-Soft-Board 2 - Copyright FSB group
** | License :    GPL v2.0
** +---------------------------------------------------+
*/

/*
** Page de gestion des thèmes (fichiers templates, CSS, images ...)
*/
class Fsb_frame_child extends Fsb_admin_frame
{
    // Arguments de la page
    public $mode;
    public $tpl_name;
    public $file;
    public $class_name;
    public $img_name;

    // Initialisation des styles
    public $style = array(
        'border_color' =>            '',
        'border_type' =>            '',
        'border_width_unit' =>        'px',
        'border_width_up' =>        0,
        'border_width_right' =>        0,
        'border_width_down' =>        0,
        'border_width_left' =>        0,
        'background_color' =>        '',
        'background_img' =>            '',
        'repeat_img' =>                'no-repeat',
        'bold' =>                    '',
        'underline' =>                '',
        'italic' =>                    '',
        'font_color' =>                '',
        'font_size' =>                '',
        'font_size_unit' =>            'px',
    );

    public $style_exists = array(
        'border-color',
        'border-style',
        'border-width',
        'background-color',
        'background-image',
        'background-repeat',
        'font-weight',
        'text-decoration',
        'font-style',
        'color',
        'font-size',
    );

    // Navigation
    public $nav = array();

    /*
    ** Constructeur
    */
    public function main()
    {
        $this->mode =        Http::request('mode');
        $this->tpl_name =    str_replace('../', './', htmlspecialchars(Http::request('tpl_name')));
        $this->file =        str_replace('../', './', htmlspecialchars(Http::request('file')));
        $this->class_name = htmlspecialchars(Http::request('class_name', 'post|get'));
        $this->img_name =    htmlspecialchars(Http::request('img_name', 'post|get'));

        if (Http::request('choose_class', 'post'))
        {
            $this->class_name = htmlspecialchars(Http::request('choose_class_name', 'post'));
        }

        $call = new Call($this);
        $call->module(array(
            'list' =>        array('tpl', 'extern', 'diff'),
            'url' =>        'index.' . PHPEXT . '?p=general_tpl',
            'lang' =>        'adm_tpl_',
            'default' =>    'tpl',
        ));

        $call->post(array(
            'submit_install' =>        'install_tpl',
            'submit_html' =>        'preview_html',
            'submit_php' =>            'preview_php',
            'submit_edit' =>        'submit_edit',
            'change_css_mode' =>    'edit_css',
            'submit_edit_css' =>    'submit_edit_css',
            'submit_edit_img' =>    'submit_edit_img',
            'export_tpl' =>            ':page_export_tpl',
            'install_news_tpl' =>    ':page_install_from_news',
        ));

        $call->functions(array(
            'module' => array(
                'tpl' => array(
                    'mode' => array(
                        'install_tpl' =>        'page_install_tpl',
                        'uncache_tpl' =>        'page_cache_tpl',
                        'cache_tpl' =>            'page_cache_tpl',
                        'edit_tpl' =>            'page_show_tpl',
                        'preview_html' =>        'page_show_tpl',
                        'preview_php' =>        'page_show_tpl',
                        'edit_css' =>            'page_show_tpl_css',
                        'submit_edit' =>        'page_submit_edit',
                        'submit_edit_css' =>    'page_submit_edit_css',
                        'edit_img' =>            'page_show_tpl_img',
                        'submit_edit_img' =>    'page_submit_edit_img',
                        'codepress' =>            'page_codepress',
                        'css_generator' =>        'page_css_generator',
                        'default' =>            'page_default_tpl',
                    ),
                ),
                'extern' => array(
                    'mode' => array(
                        'default' =>            'page_tpl_news',
                    ),
                ),
                'diff' =>                        'page_show_diff',
            ),
        ));
    }

    /*
    ** Page par défaut de la gestion des thèmes
    */
    public function page_default_tpl()
    {
        Fsb::$tpl->set_switch('tpl_list');

        Fsb::$tpl->set_vars(array(
            'USE_FTP' =>        (Fsb::$cfg->get('ftp_default')) ? TRUE : FALSE,
            'LIST_TPL' =>        Html::list_dir('export_tpl_name', '', ROOT . 'tpl/', array(), TRUE),

            'U_ACTION' =>        sid('index.' . PHPEXT . '?p=general_tpl'),
        ));

        $this->page_put_tpl();
    }

    /*
    ** Affiche les thèmes disponibles
    */
    public function page_put_tpl()
    {
        // Utilisation du thème
        $sql = 'SELECT u_tpl, COUNT(u_tpl) AS total
                FROM ' . SQL_PREFIX . 'users
                WHERE u_id <> ' . VISITOR_ID . '
                GROUP BY u_tpl';
        $result = Fsb::$db->query($sql);
        $used_by = array();
        while ($row = Fsb::$db->row($result))
        {
            $used_by[$row['u_tpl']] = $row['total'];
        }
        Fsb::$db->free($result);

        if ($fd = opendir(ROOT . 'tpl'))
        {
            while ($file = readdir($fd))
            {
                if ($file[0] != '.' && is_dir(ROOT . 'tpl/' . $file) && file_exists(ROOT . 'tpl/' . $file . '/config_tpl.' . PHPEXT))
                {
                    include(ROOT . 'tpl/' . $file . '/config_tpl.' . PHPEXT);
                    Fsb::$tpl->set_blocks('tpl', array(
                        'NAME' =>        $file,
                        'AUTOR' =>        $config_tpl['autor'],
                        'WEB' =>        $config_tpl['web'],
                        'LICENSE' =>    $config_tpl['license'],
                        'USED_BY' =>    (isset($used_by[$file])) ? $used_by[$file] : 0,

                        'U_EDIT_TPL' =>    sid('index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_tpl&amp;tpl_name=' . $file),
                        'U_EDIT_CSS' =>    sid('index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_css&amp;tpl_name=' . $file),
                        'U_EDIT_IMG' =>    sid('index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_img&amp;tpl_name=' . $file),
                    ));
                    unset($config_tpl);
                }
            }
        }
    }

    /*
    ** Affiche la liste des fichiers templates du thème
    */
    public function page_show_tpl()
    {
        if ($this->tpl_name == NULL || !is_dir(ROOT . 'tpl/' . $this->tpl_name))
        {
            Display::message(Fsb::$session->lang('adm_tpl_not_exists'));
        }

        if ($this->file)
        {
            $this->page_edit_tpl();
            return ;
        }

        // Navigation
        $this->nav = array(
            array(
                'name' =>    $this->tpl_name,
                'url' =>    'index.' . PHPEXT . '?p=general_tpl',
            ),
            array(
                'name' =>    Fsb::$session->lang('adm_tpl_edit_list'),
            ),
        );

        Fsb::$tpl->set_switch('tpl_list_templates');
        $cache = Cache::factory('tpl');

        // On récupère la liste des fichiers template du thème (_root pour placer cette clef au début)
        $fd = opendir(ROOT . 'tpl/' . $this->tpl_name . '/files');
        $list_tpl = array('_root' => array());
        while ($file = readdir($fd))
        {
            if ($file[0] != '.' && $file != 'index.html')
            {
                if (preg_match('/\.html$/si', $file))
                {
                    $list_tpl['_root'][] = array(
                        'cache' =>            ($cache->exists(md5('tpl/' . $this->tpl_name . '/files/' . $file))) ? TRUE : FALSE,
                        'filename' =>        $file,
                        'filesize' =>        convert_size(filesize(ROOT . 'tpl/' . $this->tpl_name . '/files/' . $file)),
                    );
                }
                else if (is_dir(ROOT . 'tpl/' . $this->tpl_name . '/files/' . $file))
                {
                    $fd2 = opendir(ROOT . 'tpl/' . $this->tpl_name . '/files/' . $file);
                    while ($file2 = readdir($fd2))
                    {
                        if ($file2[0] != '.' && $file2 != 'index.html' && preg_match('/\.html$/si', $file2))
                        {
                            $list_tpl[$file][] = array(
                                'cache' =>            ($cache->exists(md5('tpl/' . $this->tpl_name . '/files/' . $file . '/' . $file2))) ? TRUE : FALSE,
                                'filename' =>        $file . '/' . $file2,
                                'filesize' =>        convert_size(filesize(ROOT . 'tpl/' . $this->tpl_name . '/files/' . $file . '/' . $file2)),
                            );
                        }
                    }
                    closedir($fd2);
                }
            }
        }
        closedir($fd);

        // On affiche la liste des templates
        ksort($list_tpl);
        foreach ($list_tpl AS $dir => $list)
        {
            Fsb::$tpl->set_blocks('tpl', array(
                'NAME' =>        ($dir == '_root') ? $this->tpl_name : $this->tpl_name . '/' . $dir,
            ));

            foreach ($list AS $f)
            {
                Fsb::$tpl->set_blocks('tpl.f', array(
                    'CACHE' =>        ($f['cache']) ? Fsb::$session->lang('adm_tpl_file_uncache') : Fsb::$session->lang('adm_tpl_file_cache'),
                    'NAME' =>        $f['filename'],
                    'SIZE' =>        $f['filesize'],

                    'U_CACHE' =>    sid('index.' . PHPEXT . '?p=general_tpl&amp;mode=' . (($f['cache']) ? 'un' : '') . 'cache_tpl&amp;tpl_name=' . $this->tpl_name . '&amp;file=' . urlencode($f['filename'])),
                    'U_EDIT' =>        sid('index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_tpl&amp;tpl_name=' . $this->tpl_name . '&amp;file=' . urlencode($f['filename'])),
                ));
            }
        }
    }

    /*
    ** Edite un fichier du thème
    */
    public function page_edit_tpl()
    {
        // Navigation
        $this->nav = array(
            array(
                'name' =>    $this->tpl_name,
                'url' =>    'index.' . PHPEXT . '?p=general_tpl',
            ),
            array(
                'name' =>    Fsb::$session->lang('adm_tpl_edit_list'),
                'url' =>    'index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_tpl&amp;tpl_name=' . $this->tpl_name,
            ),
            array(
                'name' =>    sprintf(Fsb::$session->lang('adm_tpl_edit_title'), $this->file),
            ),
        );

        $content = Http::request('content');

        Fsb::$tpl->set_switch('tpl_edit_template');

        Fsb::$tpl->set_vars(array(
            'L_EDIT_TITLE' =>        sprintf(Fsb::$session->lang('adm_tpl_edit_title'), $this->file),
            'CONTENT' =>            htmlspecialchars(($content == NULL) ? file_get_contents(ROOT . 'tpl/' .$this->tpl_name . '/files/' . $this->file) : $content),
            'USE_FTP' =>            (Fsb::$cfg->get('ftp_default')) ? TRUE : FALSE,

            'U_ACTION' =>            sid('index.' . PHPEXT . '?p=general_tpl&amp;tpl_name=' . $this->tpl_name . '&amp;file=' . $this->file),
            'U_CODEPRESS' =>        sid('index.' . PHPEXT . '?p=general_tpl&amp;mode=codepress&amp;tpl_name=' . $this->tpl_name . '&amp;file=' . $this->file),
        ));
    }

    /*
    ** Charge le contenu d'un fichier pour l'afficher d'éditeur Codepress
    */
    public function page_codepress()
    {
        if ($this->tpl_name == NULL || !is_dir(ROOT . 'tpl/' . $this->tpl_name))
        {
            Display::message(Fsb::$session->lang('adm_tpl_not_exists'));
        }

        // Language d'affichage pour CodePress
        $language = 'php';

        Fsb::$tpl->set_file('codepress.html');
        Fsb::$tpl->set_vars(array(
            'CODEPRESS_LANGUAGE' =>        $language,
        ));
    }

    /*
    ** Sauvegarde mes modifications effectuées sur un fichier template
    */
    public function page_submit_edit()
    {
        $file = File::factory(Http::request('use_ftp', 'post'));

        $content = Http::request('content', 'post');
        $file->write('tpl/' . $this->tpl_name . '/files/' . $this->file, $content);

        Log::add(Log::ADMIN, 'tpl_log_edit', ROOT . 'tpl/' . $this->tpl_name . '/files/' . $this->file);
        Display::message(Fsb::$session->lang('adm_tpl_well_edit'), 'index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_tpl&amp;tpl_name=' . $this->tpl_name, 'general_tpl2');
    }

    /*
    ** Met en cache un fichier template
    */
    public function page_cache_tpl()
    {
        if ($this->tpl_name == NULL || !is_dir(ROOT . 'tpl/' . $this->tpl_name))
        {
            Display::message(Fsb::$session->lang('adm_tpl_not_exists'));
        }

        if ($this->file == NULL || !is_file(ROOT . 'tpl/' . $this->tpl_name . '/files/' . $this->file))
        {
            Display::message(Fsb::$session->lang('adm_tpl_file_not_exists'));
        }

        $cache = Cache::factory('tpl');
        $hash = md5('tpl/' . $this->tpl_name . '/files/' . $this->file);
        if ($this->mode == 'cache_tpl')
        {
            $new_tpl = new Tpl(ROOT . 'tpl/' . $this->tpl_name . '/files/');
            $new_tpl->set_file($this->file);
            $code = $new_tpl->compile();
            $cache->put($hash, $code, '', filemtime($new_tpl->data['main']['file']));
            unset($code);
        }
        else
        {
            $cache->delete($hash);
        }
        $this->file = NULL;

        Display::message(Fsb::$session->lang('adm_tpl_well_' . $this->mode), 'index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_tpl&amp;tpl_name=' . $this->tpl_name, 'general_tpl2');
    }

    /*
    ** Affiche les classes disponibles dans la css main.css du thème
    */
    public function page_show_tpl_css()
    {
        if ($this->tpl_name == NULL || !is_dir(ROOT . 'tpl/' . $this->tpl_name))
        {
            Display::message(Fsb::$session->lang('adm_tpl_not_exists'));
        }

        if ($this->class_name)
        {
            $this->page_edit_tpl_css();
            return;
        }

        // Navigation
        $this->nav = array(
            array(
                'name' =>    $this->tpl_name,
                'url' =>    'index.' . PHPEXT . '?p=general_tpl',
            ),
            array(
                'name' =>    Fsb::$session->lang('adm_tpl_css_list'),
            ),
        );

        Fsb::$tpl->set_switch('tpl_list_css');

        $css = new Css();
        $css->load_file(ROOT . 'tpl/' . $this->tpl_name . '/main.css');
        foreach ($css->data AS $filename => $filedata)
        {
            Fsb::$tpl->set_blocks('file', array(
                'NAME' =>    $filename,

                'U_EDIT' =>    sid('index.' . PHPEXT . '?p=tools_webftp&amp;mode=edit&amp;dir=tpl/' . $this->tpl_name . '/&amp;file=' . $filename),
            ));

            foreach ($filedata AS $i => $classinfo)
            {
                Fsb::$tpl->set_blocks('file.css', array(
                    'NAME' =>        $classinfo['name'],
                    'DESC' =>        htmlspecialchars($classinfo['comments']),

                    'U_EDIT' =>        sid('index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_css&amp;tpl_name=' . $this->tpl_name . '&amp;class_name=' . $filename . '&amp;id=' . $i),
                ));
            }
        }
    }

    /*
    ** Affiche la page d'édition d'une classe de la feuille de style
    */
    public function page_edit_tpl_css()
    {
        $id = intval(Http::request('id'));

        // On récupère la classe CSS
        $css = new Css();
        $css->load_file(ROOT . 'tpl/' . $this->tpl_name . '/' . $this->class_name);

        if (!isset($css->data[$this->class_name], $css->data[$this->class_name][$id]))
        {
            Display::message(Fsb::$session->lang('adm_tpl_not_exists'));
        }
        $class_data = $css->data[$this->class_name][$id];

        // Navigation
        $this->nav = array(
            array(
                'name' =>    $this->tpl_name,
                'url' =>    'index.' . PHPEXT . '?p=general_tpl',
            ),
            array(
                'name' =>    Fsb::$session->lang('adm_tpl_css_list'),
                'url' =>    'index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_css&amp;tpl_name=' . $this->tpl_name,
            ),
            array(
                'name' =>    sprintf(Fsb::$session->lang('adm_css_edit_class'), $class_data['name']),
            ),
        );

        Fsb::$tpl->set_switch('tpl_edit_css');

        $preview_css =        Http::request('preview_css', 'post');
        $edit_css_type =    Http::request('edit_css_type');
        if ($edit_css_type == NULL)
        {
            $edit_css_type = 'simple';
        }

        // On récupère les classes de la CSS pour la liste
        $list_class_ary = array();
        foreach ($css->data[$this->class_name] AS $class)
        {
            $list_class_ary[] = $class['name'];
        }
        
        /*
        ** Prévisualisation de la CSS ?
        */
        if ($preview_css)
        {
            if ($edit_css_type == 'complex')
            {
                $preview_style = htmlspecialchars(Http::request('content', 'post'));
            }
            else
            {
                $preview_style = $this->page_get_css_content();
            }
        
            Fsb::$tpl->set_switch('preview');
            Fsb::$tpl->set_vars(array(
                'PREVIEW_STYLE' =>    str_replace(array('\r\n', '\n'), array(' ', ' '), $preview_style),
            ));
        }

        $list_change_mode = Html::create_list('edit_css_type', $edit_css_type, array(
            'simple' =>            Fsb::$session->lang('adm_css_simple_mode'),
            'complex' =>        Fsb::$session->lang('adm_css_complex_mode'),
        ), '', 'onchange="location.href=\'' . sid('index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_css&amp;tpl_name=' . $this->tpl_name . '&amp;class_name=' . $this->class_name . '&amp;id=' . $id) . '&amp;edit_css_type=\' + this.value;"');

        $list_class = Html::create_list('choose_class_name', $id, $list_class_ary, '', 'onchange="location.href=\'' . sid('index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_css&amp;tpl_name=' . $this->tpl_name . '&amp;edit_css_type=' . $edit_css_type . '&amp;class_name=' . $this->class_name) . '&amp;id=\' + this.value;"');

        // Champs cachés
        $hidden = Html::hidden('edit_css_type_submit', $edit_css_type) . Html::hidden('tpl_name', $this->tpl_name) . Html::hidden('class_name', $this->class_name);

        Fsb::$tpl->set_vars(array(
            'LIST_MODE' =>        $list_change_mode,
            'LIST_CSS' =>        $list_class,
            'HIDDEN' =>            $hidden,
            'U_ACTION' =>        sid('index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_css&amp;tpl_name=' . $this->tpl_name . '&amp;class_name=' . $this->class_name . '&amp;id=' . $id),
        ));

        if ($edit_css_type == 'complex')
        {
            $content = (Http::request('preview_css', 'post')) ? $preview_style : $css->get_properties($class_data);
            Fsb::$tpl->set_vars(array(
                'CONTENT' =>        $content,
            ));
        }
        else
        {
            // Affiche l'éditeur de CSS
            $list_size = array('px' => 'px', 'pt' => 'pt', 'em' => 'em', '%' => '%');
            $list_border_type = array(
                'solid' =>        Fsb::$session->lang('adm_css_border_type_solid'),
                'dashed' =>        Fsb::$session->lang('adm_css_border_type_dashed'),
                'dotted' =>        Fsb::$session->lang('adm_css_border_type_dotted'),
                'double' =>        Fsb::$session->lang('adm_css_border_type_double'),
            );

            $list_repeat = array(
                'no-repeat' =>        Fsb::$session->lang('adm_css_no_repeat'),
                'repeat' =>            Fsb::$session->lang('adm_css_repeat'),
                'repeat_x' =>        Fsb::$session->lang('adm_css_repeat_x'),
                'repeat_y' =>        Fsb::$session->lang('adm_css_repeat_y'),
            );

            $parse_style = $this->page_check_css_style($class_data, (Http::request('preview_css', 'post')) ? $preview_style : NULL);

            Fsb::$tpl->set_switch('simple_mode');
            Fsb::$tpl->set_vars(array(
                'BACKGROUND_COLOR' =>        $this->style['background_color'],
                'BORDER_COLOR' =>            $this->style['border_color'],
                'BORDER_WIDTH_UP' =>        $this->style['border_width_up'],
                'BORDER_WIDTH_DOWN' =>        $this->style['border_width_down'],
                'BORDER_WIDTH_LEFT' =>        $this->style['border_width_left'],
                'BORDER_WIDTH_RIGHT' =>        $this->style['border_width_right'],
                'FONT_STYLE_BOLD' =>        (($this->style['bold']) ? 'checked="checked"' : ''),
                'FONT_STYLE_UNDERLINE' =>    (($this->style['underline']) ? 'checked="checked"' : ''),
                'FONT_STYLE_ITALIC' =>        (($this->style['italic']) ? 'checked="checked"' : ''),
                'FONT_COLOR' =>                $this->style['font_color'],
                'FONT_SIZE' =>                $this->style['font_size'],

                'LIST_BACKGROUND_IMG' =>    Html::list_dir('background_img', $this->style['background_img'], ROOT . 'tpl/' . $this->tpl_name . '/img/', array('gif', 'jpg', 'jpeg'), FALSE, '<option value="0">' . Fsb::$session->lang('adm_css_no_img') . '</option>'),
                'LIST_REPEAT_IMG' =>        Html::create_list('repeat_img', $this->style['repeat_img'], $list_repeat),
                'LIST_FONT_SIZE' =>            Html::create_list('font_size_unit', $this->style['font_size_unit'], $list_size),
                'LIST_BORDER_WIDTH' =>        Html::create_list('border_width_unit', $this->style['border_width_unit'], $list_size),
                'LIST_BORDER_TYPE' =>        Html::create_list('border_type', $this->style['border_type'], $list_border_type),
            ));

            foreach ($parse_style AS $key => $value)
            {
                if (!in_array($key, $this->style_exists))
                {
                    Fsb::$tpl->set_switch('other_style');
                    Fsb::$tpl->set_blocks('other', array(
                        'L_NAME' =>    $key,
                        
                        'NAME' =>        'other_' . $key,
                        'VALUE' =>        $value,
                    ));
                }
            }
        }
    }

    /*
    ** Récupère dans un tableau de données valide les propriétés de la classe
    */
    public function page_check_css_style($class_data, $content = NULL)
    {
        $css = new Css();
        $css->load_file(ROOT . 'tpl/' . $this->tpl_name . '/' . $this->class_name);
        if ($content != NULL)
        {
            $p = $css->parse_properties($content);
        }
        else
        {
            $p = $class_data['properties'];
        }

        // Couleur de la bordure
        if (isset($p['border-color']))
        {
            $this->style['border_color'] = $p['border-color'];
        }

        // Style de la bordure
        if (isset($p['border-style']))
        {
            $this->style['border_type'] = $p['border-style'];
        }

        // Utilisation de la balise border
        if (isset($p['border']))
        {
            $tmp = explode(' ', $p['border']);
            $border_style = array('none', 'solid', 'dashed', 'dotted', 'groove', 'double', 'ridge', 'inset', 'outset', 'hidden');

            foreach ($tmp AS $value)
            {
                if (in_array($value, $border_style))
                {
                    $this->style['border_type'] = $value;
                }
                else if (preg_match('#([0-9]+)(px|em|%|pt)#i', $value, $match))
                {
                    $this->style['border_width_unit'] = $match[2];
                    $this->style['border_width_up'] = intval($match[1]);
                    $this->style['border_width_right'] = intval($match[1]);
                    $this->style['border_width_down'] = intval($match[1]);
                    $this->style['border_width_left'] = intval($match[1]);
                }
                else
                {
                    $this->style['border_color'] = $value;
                }
            }
            unset($tmp, $p['border']);
        }

        // Largeur de la bordure
        if (isset($p['border-width']))
        {
            $tmp = String::split(' ', $p['border-width']);
            preg_match('/([0-9]+)([a-zA-Z%]+)/i', $tmp[0], $match);
            $this->style['border_width_unit'] = $match[2];
            $this->style['border_width_up'] = intval($tmp[0]);
            $this->style['border_width_right'] = intval($tmp[1]);
            $this->style['border_width_down'] = intval($tmp[2]);
            $this->style['border_width_left'] = intval($tmp[3]);
            unset($tmp);
        }

        // Couleur de l'arière plan
        if (isset($p['background-color']))
        {
            $this->style['background_color'] = $p['background-color'];
        }

        // Image d'arrière plan
        if (isset($p['background-image']))
        {
            $this->style['background_img'] = preg_replace('#url\((\'|")?(.*?)(\'|")?\)#i', '$2', $p['background-image']);
            $this->style['background_img'] = preg_replace('#^img/#', '', $this->style['background_img']);
        }

        // Répétition de l'image en arrière plan
        if (isset($p['background-repeat']))
        {
            $this->style['background_repeat'] = $p['background-repeat'];
        }

        // Texte gras
        if (isset($p['font-weight']))
        {
            $this->style['bold'] = TRUE;
        }

        // Texte souligné
        if (isset($p['text-decoration']) && $p['text-decoration'] == 'underline')
        {
            $this->style['underline'] = TRUE;
        }

        // Texte italique
        if (isset($p['font-style']))
        {
            $this->style['italic'] = TRUE;
        }

        // Couleur du texte
        if (isset($p['color']))
        {
            $this->style['font_color'] = $p['color'];
        }

        // Taille du texte
        if (isset($p['font-size']))
        {
            preg_match('/([0-9]+)([a-zA-Z%]+)/i', $p['font-size'], $match);
            $this->style['font_size'] = intval($match[1]);
            $this->style['font_size_unit'] = $match[2];
        }
        
        return ($p);
    }

    /*
    ** Soumet les modifications de la CSS
    */
    public function page_submit_edit_css()
    {
        $edit_css_type = Http::request('edit_css_type_submit', 'post');
        if ($edit_css_type == NULL)
        {
            $edit_css_type = 'simple';
        }

        $css = new Css();
        $css->load_file(ROOT . 'tpl/' . $this->tpl_name . '/' . $this->class_name);

        $id = intval(Http::request('id'));
        if (!isset($css->data[$this->class_name], $css->data[$this->class_name][$id]))
        {
            Display::message(Fsb::$session->lang('adm_tpl_not_exists'));
        }

        if ($edit_css_type == 'complex')
        {
            $content = htmlspecialchars(Http::request('content', 'post'));
        }
        else
        {
            $content = $this->page_get_css_content();
        }

        $css->data[$this->class_name][$id]['properties'] = $css->parse_properties($content);
        $css->write(ROOT . 'tpl/' . $this->tpl_name . '/', $this->class_name);

        Log::add(Log::ADMIN, 'css_log_edit', ROOT . 'tpl/' . $this->tpl_name . '/' . $this->class_name . ' :: ' . $css->data[$this->class_name][$id]['name']);
        Display::message(Fsb::$session->lang('adm_css_well_edit'), 'index.' . PHPEXT . '?p=general_tpl&amp;mode=edit_css&amp;tpl_name=' . $this->tpl_name, 'general_tpl2');
    }

    /*
    ** Renvoie le contenu de la classe en fonction des choix du mode simple
    */
    public function page_get_css_content()
    {
        foreach ($this->style AS $key => $value)
        {
            $$key = Http::request($key, 'post');
            $$key = (gettype($value) == 'int' || gettype($value) == 'bool') ? intval($$key) : htmlspecialchars($$key);
        }

        $content = '';
        $border_style_exists = FALSE;
        if ($border_width_up > 0 || $border_width_right > 0 || $border_width_down > 0 || $border_width_left > 0)
        {
            $border_style_exists = TRUE;
            $content .= "border-width: ${border_width_up}${border_width_unit} ${border_width_right}${border_width_unit} ${border_width_down}${border_width_unit} ${border_width_right}${border_width_unit};" . EOF;
        }

        if (!empty($border_color) && $border_style_exists)
        {
            $content .= "border-color: $border_color;" . EOF;
        }

        if (!empty($border_type) && $border_style_exists)
        {
            $content .= "border-style: $border_type;" . EOF;
        }

        if (!empty($background_color))
        {
            $content .= "background-color: $background_color;" . EOF;
        }

        if (!empty($background_img))
        {
            $content .= "background-image: url($background_img);" . EOF;
        }

        if (!empty($repeat_img) && !empty($background_img))
        {
            $content .= "background-repeat: $repeat_img;" . EOF;
        }

        if ($bold)
        {
            $content .= "font-weight: bold;" . EOF;
        }

        if (