From 04148a2c284578d18aeafc4498593959e24612af Mon Sep 17 00:00:00 2001 From: x2001corpet Date: Sun, 1 Apr 2007 15:42:07 +0000 Subject: [PATCH] list installed icons, to see quickly the one you can insert in dynamic text or in static templates git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1644 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 1 + modules/admin.php | 23 ++++++++++++++++++++--- templates/admin/icons.tpl | 33 +++++++++++++++++++++++++++++++++ templates/admin/index.tpl | 2 ++ 4 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 templates/admin/icons.tpl diff --git a/ChangeLog b/ChangeLog index 80f0429..5e83097 100644 --- 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 diff --git a/modules/admin.php b/modules/admin.php index 216d5b1..4bc6e64 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -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 index 0000000..a79dc42 --- /dev/null +++ b/templates/admin/icons.tpl @@ -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 *} +{* *} +{**************************************************************************} + +

Icônes installées sur plat/al

+

+{foreach from=$icons item='icon'} + +{/foreach} +

+

Pour en installer d'autres du même goût, il faut aller sur +www.famfamfam.com, 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. +

diff --git a/templates/admin/index.tpl b/templates/admin/index.tpl index 6f704a9..a98e586 100644 --- a/templates/admin/index.tpl +++ b/templates/admin/index.tpl @@ -78,6 +78,8 @@ MX défaillants   |   Astuces +   |   + Icônes -- 2.1.4