Changeset 10330 for extensions/Icons_Set


Ignore:
Timestamp:
Apr 12, 2011, 5:55:18 PM (13 years ago)
Author:
flop25
Message:

plugin functional !
todo : localization

Location:
extensions/Icons_Set
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/Icons_Set/admin.php

    r10326 r10330  
    88$page['infos'] = array();
    99
    10 
     10// +-------------------------------------------------------+
     11// |                  envoi de la config                   |
     12// +-------------------------------------------------------+
    1113if (isset($_POST['envoi_config']) and $_POST['envoi_config']=='iconset')
    1214{
     
    4951        load_conf_from_db();
    5052}
    51 ////////////////////////////////////////////////
    52 ////////[ liste les icones dispo  ]    //////////
     53
     54// +-------------------------------------------------------+
     55// |            liste les icones dispo                     |
     56// +-------------------------------------------------------+
     57
    5358// RQ : un set d'icone = chemin vers le *.conf.php ; on associe (ou pas) un fichier *.conf.php par thème
    54 ////////////////////////////////////////////////
     59
    5560function get_list_iconconf_path ($dir) {
    5661        static $list_iconconf_path=array();
     
    8792        return $list_iconconf_path;
    8893}       
    89 
     94// +-------------------------------------------------------+
     95// |          Vérifie l'intégrité de la config             |
     96// +-------------------------------------------------------+
    9097function check_config()
    9198{
     
    159166        if (!empty($info_deleted_icon)) {       array_push($page['infos'], l10n('iconset_info_deleted_icon').$info_deleted_icon );       }
    160167}
    161 check_config();
    162 load_conf_from_db();
     168
     169// +-------------------------------------------------------+
     170// |                début réel                             |
     171// +-------------------------------------------------------+
     172
     173if (!isset($_POST['envoi_config']))// on économise du temps
     174{
     175        check_config();
     176        load_conf_from_db();
     177}
    163178$conf_iconset = @unserialize($conf['iconset']);//pwg_db_real_escape_string(serialize($conf_iconset))
    164179$conf_themes=$conf_iconset['themes'];
     
    168183$themes->sort_fs_themes();
    169184$all_themes=array();
     185
     186// affichage des themes
    170187foreach ($conf_themes as $theme_id => $iconset)
    171188{
     
    187204);
    188205
     206// affichage des icônes
    189207foreach ($conf_icons as $iconset)
    190208{
    191         include_once('icons/'.$iconset);
     209        @include_once('icons/'.$iconset);
    192210        $all_icons[]=array(
    193211        'path'=>$iconset,
  • extensions/Icons_Set/main.inc.php

    r10297 r10330  
    2626  return $menu;
    2727}
     28add_event_handler('loc_after_page_header', 'load_set');
     29function load_set()
     30{
     31        global $template, $user, $conf;
     32        $conf_iconset = @unserialize($conf['iconset']);//pwg_db_real_escape_string(serialize($conf_iconset))
     33        $conf_themes=$conf_iconset['themes'];
     34        $conf_icons=$conf_iconset['icons'];
     35        if (isset($user['theme']) and array_key_exists($user['theme'], $conf_themes) and !empty($conf_themes[$user['theme']]) and file_exists(ICONS_PATH.$conf_themes[$user['theme']]) )
     36        {
     37                include ICONS_PATH.$conf_themes[$user['theme']];
     38                $template->func_combine_css(array(
     39                        'path' => $iconsetconf['css_file'],
     40                        'order' => 100,
     41                        ),
     42                        $smarty
     43                );
     44               
     45        }
    2846
     47
     48}
    2949?>
Note: See TracChangeset for help on using the changeset viewer.