Index: /extensions/Icons_Set/admin.php
===================================================================
--- /extensions/Icons_Set/admin.php	(revision 10297)
+++ /extensions/Icons_Set/admin.php	(revision 10297)
@@ -0,0 +1,159 @@
+<?php
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $template, $conf, $user;
+
+load_language('plugin.lang', ICONSET_PATH);
+$page['infos'] = array();
+
+
+if (isset($_POST['envoi_config']) and $_POST['envoi_config']=='iconset')
+{
+	check_pwg_token();
+}
+////////////////////////////////////////////////
+////////[ liste les icones dispo  ]    //////////
+// RQ : un set d'icone = chemin vers le *.conf.php ; on associe (ou pas) un fichier *.conf.php par thème
+////////////////////////////////////////////////
+function get_list_iconconf_path ($dir) {
+	static $list_iconconf_path=array();
+	$dh = opendir ($dir);
+	while (($file = readdir ($dh)) !== false ) {
+		if ($file !== '.' && $file !== '..') {
+			$path =$dir.'/'.$file;
+			if (is_dir ($path)) { 
+				get_list_iconconf_path ($path);
+			}
+			else
+			{
+				$page = explode('.', $file);
+				$nb = count($page);
+				$nom_fichier = $page[0];
+				for ($i = 1; $i < $nb-1; $i++){
+				 $nom_fichier .= '.'.$page[$i];
+				}
+				if(isset($page[1])){
+				 $ext_fichier = $page[$nb-2].'.'.$page[$nb-1];
+				}
+				else {
+				 $ext_fichier = '';
+				}
+			
+				if($ext_fichier == 'conf.php') { //On ne prend que les .conf.php
+					$path = str_replace("/plugins/Icons_Set", "", $path);
+					$list_iconconf_path[]=$path;
+				}
+			}
+		}
+	}
+	closedir ($dh);
+	return $list_iconconf_path;
+}	
+
+function check_config()
+{
+	global $conf, $prefixeTable, $page;
+	$conf_iconset = @unserialize($conf['iconset']);//pwg_db_real_escape_string(serialize($conf_iconset))
+	include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');
+	$themes = new themes();
+	$all_icons=get_list_iconconf_path ('./plugins/Icons_Set/icons');
+	if ( !isset($conf_iconset) or empty($conf_iconset) or !is_array($conf_iconset) )
+	{
+		$conf['iconset']=array(
+		'themes'=>array(),
+		'icons'=>array()
+		);
+	}
+	$themes->sort_fs_themes();
+	$conf_themes=$conf_iconset['themes'];
+	$conf_icons=$conf_iconset['icons'];
+	$list_theme_id=array();
+	$info_new_theme='';
+	$info_new_icon='';
+	$info_deleted_theme='';
+	$info_deleted_icon='';
+	foreach ($themes->fs_themes as $theme_id => $fs_theme)
+	{
+    if  ((isset($fs_theme['activable']) and !$fs_theme['activable']) or $theme_id == 'default' )
+		{
+			continue;
+		}
+		if (!array_key_exists($fs_theme['id'], $conf_themes)) // theme ajouté
+		{
+			$info_new_theme.=$theme_id.'<br>';
+			$conf_themes[$theme_id]=''; // RAZ
+		}
+		if (!empty($conf_themes[$theme_id]) and !in_array($conf_themes[$theme_id], $all_icons))  //  association thème/icon supprimée
+		{
+			$info_deleted_icon.=$conf_themes[$theme_id].'<br>';
+			$conf_themes[$theme_id]=''; // RAZ
+		}
+		$list_theme_id[]=$theme_id;
+	}
+	foreach ($conf_themes as $theme_id => $iconset) // theme supprimé
+	{
+		if (!in_array($theme_id, $list_theme_id))
+		{
+			$info_deleted_theme.=$theme_id.'<br>';
+			unset($conf_themes[$theme_id]);// suppression de sa config
+		}
+	}
+	foreach ($all_icons as $iconset) // icones ajoutées
+	{
+		if (!in_array($iconset, $conf_icons))
+		{
+			$info_new_icon.=$iconset.'<br>';
+		}
+	}
+	$conf['iconset']=array(
+		'themes'=>$conf_themes,
+		'icons'=>$all_icons
+		);
+  $query = '
+    UPDATE '.CONFIG_TABLE.'
+    SET value="'.pwg_db_real_escape_string(serialize($conf['iconset'])).'"
+    WHERE param="iconset"
+    LIMIT 1';
+  pwg_query($query);
+	if (!empty($info_new_theme)) { 	array_push($page['infos'], l10n('iconset_info_new_theme').$info_new_theme );	 }
+	if (!empty($info_new_icon)) { 	array_push($page['infos'], l10n('iconset_info_new_icon').$info_new_icon );	 }
+	if (!empty($info_deleted_theme)) { 	array_push($page['infos'], l10n('iconset_info_deleted_theme').$info_deleted_theme );	 }
+	if (!empty($info_deleted_icon)) { 	array_push($page['infos'], l10n('iconset_info_deleted_icon').$info_deleted_icon );	 }
+}
+check_config();
+load_conf_from_db();
+$conf_iconset = @unserialize($conf['iconset']);//pwg_db_real_escape_string(serialize($conf_iconset))
+$conf_themes=$conf_iconset['themes'];
+$conf_icons=$conf_iconset['icons'];
+include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');
+$themes = new themes();
+$themes->sort_fs_themes();
+$all_themes=array();
+foreach ($conf_themes as $theme_id => $iconset) // theme supprimé
+{
+	$all_themes[$theme_id]=array(
+	'name'=>$themes->fs_themes[$theme_id]['name'],
+	'id'=>$themes->fs_themes[$theme_id]['id'],
+	'screenshot'=>$themes->fs_themes[$theme_id]['screenshot'],
+	'icon'=>$iconset,
+	);
+}
+$template->assign(array(
+  'all_themes' => $all_themes,
+  'all_icons' => $conf_icons,
+));
+
+$template->assign(array(
+  'PWG_TOKEN' => get_pwg_token()
+));
+
+$template->func_combine_css(array(
+	'path' => 'plugins/'.ICONSET_DIR.'/template/admin.css',
+	),
+	$smarty
+);
+$template->set_filename('plugin_admin_content', dirname(__FILE__) .'/template/admin.tpl');
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+?>
Index: /extensions/Icons_Set/icons/fruck/iconset.conf.php
===================================================================
--- /extensions/Icons_Set/icons/fruck/iconset.conf.php	(revision 10297)
+++ /extensions/Icons_Set/icons/fruck/iconset.conf.php	(revision 10297)
@@ -0,0 +1,9 @@
+<?php
+$iconsetconf = array(
+  'name' => 'Old fruck',
+  'id' => 'fruck',
+  'icon_file' => ICONSET_PATH.'icons/fruck/icon.png',
+  'css_file' => ICONSET_PATH.'icons/fruck/icon.css',
+);
+
+?>
Index: /extensions/Icons_Set/icons/old_sylvia/iconset.conf.php
===================================================================
--- /extensions/Icons_Set/icons/old_sylvia/iconset.conf.php	(revision 10297)
+++ /extensions/Icons_Set/icons/old_sylvia/iconset.conf.php	(revision 10297)
@@ -0,0 +1,9 @@
+<?php
+$iconsetconf = array(
+  'name' => 'Old Sylvia',
+  'id' => 'old_sylvia',
+  'icon_file' => ICONSET_PATH.'icons/old_sylvia/icon.png',
+  'css_file' => ICONSET_PATH.'icons/old_sylvia/icon.css',
+);
+
+?>
Index: /extensions/Icons_Set/main.inc.php
===================================================================
--- /extensions/Icons_Set/main.inc.php	(revision 10297)
+++ /extensions/Icons_Set/main.inc.php	(revision 10297)
@@ -0,0 +1,29 @@
+<?php
+/*
+Plugin Name: Icons Set
+Version: auto
+Description: Allow you to use other icons for any themes
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=
+Author: Flop25
+Author URI: http://www.planete-flop.fr/
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+define('ICONSET_DIR' , basename(dirname(__FILE__)));
+define('ICONSET_PATH' , PHPWG_PLUGINS_PATH . ICONSET_DIR . '/');
+define('ICONS_PATH' , PHPWG_PLUGINS_PATH . ICONSET_DIR . '/icons/');
+
+add_event_handler('get_admin_plugin_menu_links', 'iconset_admin_menu');
+function iconset_admin_menu($menu)
+{
+  global $conf;
+
+  array_push($menu, array(
+    'NAME' => 'Icons Set',
+    'URL' => get_root_url().'admin.php?page=plugin-'.ICONSET_DIR
+    )
+  );
+  return $menu;
+}
+
+?>
Index: /extensions/Icons_Set/maintain.inc.php
===================================================================
--- /extensions/Icons_Set/maintain.inc.php	(revision 10297)
+++ /extensions/Icons_Set/maintain.inc.php	(revision 10297)
@@ -0,0 +1,31 @@
+<?php
+
+function plugin_install()
+{
+    global $prefixeTable;
+    $q = '
+INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
+	VALUES
+	("iconset" , "" , "List of icons and their associations with themes");';
+    pwg_query($q);
+
+}
+
+
+
+function plugin_activate()
+{
+    global $prefixeTable;
+}//fin active
+
+
+
+
+function plugin_uninstall()
+{
+	global $prefixeTable;
+  pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param IN (\'iconset\')');
+}//fin uninstall
+
+
+?>
Index: /extensions/Icons_Set/template/admin.css
===================================================================
--- /extensions/Icons_Set/template/admin.css	(revision 10297)
+++ /extensions/Icons_Set/template/admin.css	(revision 10297)
@@ -0,0 +1,11 @@
+/* CSS Document */
+
+.iconBox {
+    background-color: #333333;
+    border-radius: 5px 5px 5px 5px;
+    display: inline-table;
+    height: 50px;
+    margin: 5px;
+    overflow: hidden;
+    text-align: center;
+}
Index: /extensions/Icons_Set/template/admin.tpl
===================================================================
--- /extensions/Icons_Set/template/admin.tpl	(revision 10297)
+++ /extensions/Icons_Set/template/admin.tpl	(revision 10297)
@@ -0,0 +1,45 @@
+<div class="titrePage">
+  <h2>{'Installed Themes'|@translate}</h2>
+</div>
+
+<div id="themesContent">
+<fieldset>
+<legend>{'iconset_All_Themes'|@translate}</legend>
+<form action="" method="post" name="externe">
+<div class="themeBoxes">
+{foreach from=$all_themes item=theme}
+  <div class="themeBox">
+    <div class="themeName">{$theme.name}</div>
+    <div class="themeShot"><img src="{$theme.screenshot}" alt="screenshot"></div>
+    <div class="themeActions">
+      <div>
+      <select name="set">
+        <option value="NULL">{'iconset_nochange'|@translate}</option>
+        <option value="NULL">{'iconset_nothing'|@translate}</option>
+        {foreach from=$list_set item=ls}
+        <option value="{$ls.FILE}">{$ls.TEXTE}</option>
+        {/foreach}
+      </select>
+      </div>
+    </div> <!-- themeActions -->
+  </div>
+{/foreach}
+</div> <!-- themeBoxes -->
+  <input name="envoi_config" type="hidden" value="iconset" />
+  <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
+  <input type="submit" name="button2" id="button2" value="{'iconset_send'|@translate}" />
+</form>
+</fieldset>
+
+<fieldset>
+<legend>{'iconset_All_Icons'|@translate}</legend>
+<div class="iconBoxes">
+{foreach from=$all_icons item=icons}
+  <div class="iconBox">
+    <div class="iconName">{$icons.name}</div>
+    <div class="iconShot"><img src="{$icons.png}" alt=""></div>
+  </div>
+{/foreach}
+</div> <!-- themeBoxes -->
+</fieldset>
+</div> <!-- themesContent -->
