list installed icons, to see quickly the one you can insert in dynamic text or in...
authorx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 1 Apr 2007 15:42:07 +0000 (15:42 +0000)
committerx2001corpet <x2001corpet@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sun, 1 Apr 2007 15:42:07 +0000 (15:42 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1644 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
modules/admin.php
templates/admin/icons.tpl [new file with mode: 0644]
templates/admin/index.tpl

index 80f0429..5e83097 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@ New:
 
     * Admin:
         - Fold/unfold wiki folders                                         -Car
+        - View all installed icons                                         -Car
 
     * Banana:
         - Fold/unfold threads                                              -Car
index 216d5b1..4bc6e64 100644 (file)
@@ -45,6 +45,7 @@ class AdminModule extends PLModule
             'admin/validate/answers'       => $this->make_hook('validate_answers', AUTH_MDP, 'admin'),
             'admin/wiki'                   => $this->make_hook('wiki', AUTH_MDP, 'admin'),
             'admin/ipwatch'                => $this->make_hook('ipwatch', AUTH_MDP, 'admin'),
+            'admin/icons'                                                                       => $this->make_hook('icons', AUTH_MDP, 'admin'),
         );
     }
 
@@ -356,7 +357,7 @@ class AdminModule extends PLModule
         require_once("user.func.inc.php");
 
         if (S::has('suid')) {
-            $page->kill("déjà en SUID !!!");
+            $page->kill("déjà en SUID !!!");
         }
 
         if (Env::has('user_id')) {
@@ -693,7 +694,7 @@ class AdminModule extends PLModule
                ORDER BY  u.promo,u.nom,u.prenom');
         $page->assign('diffs', $res->fetchAllAssoc());
 
-        // gens Ã  l'ax mais pas chez nous
+        // gens Ã  l'ax mais pas chez nous
         $res = XDB::query(
                 'SELECT  ia.promo,ia.nom,ia.nom_patro,ia.prenom
                    FROM  identification_ax as ia
@@ -701,7 +702,7 @@ class AdminModule extends PLModule
                   WHERE  u.nom IS NULL');
         $page->assign('mank', $res->fetchAllAssoc());
 
-        // gens chez nous et pas Ã  l'ax
+        // gens chez nous et pas Ã  l'ax
         $res = XDB::query('SELECT promo,nom,prenom FROM auth_user_md5 WHERE matricule_ax IS NULL');
         $page->assign('plus', $res->fetchAllAssoc());
     }
@@ -1064,6 +1065,22 @@ class AdminModule extends PLModule
             $page->assign('ip', $props);
         }
     }
+    
+    function handler_icons(&$page)
+               {
+                               $page->changeTpl('admin/icons.tpl');
+                               $dh = opendir('../htdocs/images/icons');
+                               if (!$dh) {
+                                               $page->trig('Dossier des icones introuvables.');
+                               }
+                               $icons = array();
+                               while (($file = readdir($dh)) !== false) {
+                                               if (strlen($file) > 4 && substr($file,-4) == '.gif') {
+                                                               array_push($icons, substr($file, 0, -4));
+                                               }
+                               }
+                               $page->assign('icons', $icons);
+    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
diff --git a/templates/admin/icons.tpl b/templates/admin/icons.tpl
new file mode 100644 (file)
index 0000000..a79dc42
--- /dev/null
@@ -0,0 +1,33 @@
+{**************************************************************************}
+{*                                                                        *}
+{*  Copyright (C) 2003-2007 Polytechnique.org                             *}
+{*  http://opensource.polytechnique.org/                                  *}
+{*                                                                        *}
+{*  This program is free software; you can redistribute it and/or modify  *}
+{*  it under the terms of the GNU General Public License as published by  *}
+{*  the Free Software Foundation; either version 2 of the License, or     *}
+{*  (at your option) any later version.                                   *}
+{*                                                                        *}
+{*  This program is distributed in the hope that it will be useful,       *}
+{*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
+{*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
+{*  GNU General Public License for more details.                          *}
+{*                                                                        *}
+{*  You should have received a copy of the GNU General Public License     *}
+{*  along with this program; if not, write to the Free Software           *}
+{*  Foundation, Inc.,                                                     *}
+{*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
+{*                                                                        *}
+{**************************************************************************}
+
+<h1> Icônes installées sur <em>plat/al</em></h1>
+<p>
+{foreach from=$icons item='icon'}
+       <img src='images/icons/{$icon}.gif' alt='' title='{$icon}'/>
+{/foreach}
+</p>
+<p>Pour en installer d'autres du même goût, il faut aller sur
+<a href="http://www.famfamfam.com/lab/icons/silk/">www.famfamfam.com</a>, choisir
+son icône, l'enregistrer en GIF (pour la transparence sous Internet Explorer) puis
+de l'ajouter au projet plat/al dans le dossier htdocs/images/icons.
+</p>
index 6f704a9..a98e586 100644 (file)
@@ -78,6 +78,8 @@
       <a href="admin/mx/broken">MX défaillants</a>
       &nbsp;&nbsp;|&nbsp;&nbsp;
       <a href="admin/tips">Astuces</a>
+      &nbsp;&nbsp;|&nbsp;&nbsp;
+      <a href="admin/icons">Icônes</a>
     </td>
   </tr>
   <tr class="impair">