From b5c7b4a8036d1805db3430d9bd0eb38984d76e10 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Sat, 27 Nov 2004 19:00:32 +0000 Subject: [PATCH] really closes #184 --- ChangeLog | 2 +- htdocs/listes/delete.php | 45 ++++++++++++++++++++++ templates/listes/delete.tpl | 78 ++++++++++++++++++++++++++++++++++++++ templates/listes/header_listes.tpl | 11 ++++-- 4 files changed, 132 insertions(+), 4 deletions(-) create mode 100644 htdocs/listes/delete.php create mode 100644 templates/listes/delete.tpl diff --git a/ChangeLog b/ChangeLog index 2626785..725a3a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,7 +39,7 @@ Bug/Wish : - #83,208,222 : New fiche. -MC * Lists : - - #184 : XML-RPC now know how to delete a list. -MC + - #184 : Owners can now delete their lists. -MC - #231 : Add a link to the user's fiche on moderation page. -MC * Search : diff --git a/htdocs/listes/delete.php b/htdocs/listes/delete.php new file mode 100644 index 0000000..f8b38ad --- /dev/null +++ b/htdocs/listes/delete.php @@ -0,0 +1,45 @@ +delete_list($liste,!empty($_POST['del_archive'])) ) { + $page->assign('deleted', true); +} elseif (list($details,$options) = $client->get_owner_options($liste)) { + $page->assign_by_ref('details', $details); + $page->assign_by_ref('options', $options); + $page->assign('bogo_level', $client->get_bogo_level($liste)); +} else { + $page->assign('no_list', true); +} + +$page->run(); +?> diff --git a/templates/listes/delete.tpl b/templates/listes/delete.tpl new file mode 100644 index 0000000..3fc230c --- /dev/null +++ b/templates/listes/delete.tpl @@ -0,0 +1,78 @@ +{*************************************************************************** + * Copyright (C) 2003-2004 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 * + *************************************************************************** + $Id : admin.tpl,v 1.4 2004/09/23 18:47:00 x2000habouzit Exp $ + ***************************************************************************} + +{dynamic} + +{if $no_list || ( !$details.own && $smarty.session.perms neq admin )} + +

La liste n'existe pas ou tu n'as pas le droit de l'administrer

+ +{else} + +{if $deleted} + +

[Voir toutes les listes]

+

La liste a été détruite !

+ +{else} + +{if !$details.own} +

+Tu n'es pas administrateur de la liste, mais du site. +

+{/if} + +{include file="listes/header_listes.tpl" on=delete} + +

+ Détruire la liste {$details.addr} ? +

+ +
+ + + + + + + + + + +
+ Veux tu réellement détruire la liste {$details.addr} ?
+ Pour valider ton choix, écris en majuscules (sans espace) « OUI » : + +
+ Si tu veux préserver les archives de la liste, décoche la case ci-contre. + +
+ +
+
+{/if} + +{/if} + +{/dynamic} + +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/listes/header_listes.tpl b/templates/listes/header_listes.tpl index 352d377..73b653c 100644 --- a/templates/listes/header_listes.tpl +++ b/templates/listes/header_listes.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: header_listes.tpl,v 1.2 2004-11-07 14:58:35 x2000habouzit Exp $ + $Id: header_listes.tpl,v 1.3 2004-11-27 19:00:33 x2000habouzit Exp $ ***************************************************************************} {dynamic} @@ -45,7 +45,7 @@ {if $details.own || $smarty.session.perms eq admin} - Administration de la liste : + Administrer la liste : {if $on neq moderate} [modération] @@ -62,12 +62,17 @@ {else} [options] {/if} + {if $on neq delete} + [détruire liste] + {else} + [détruire liste] + {/if} {/if} {perms level=admin} - Administration avancée : + Administrer (avancé) : {if $on neq soptions} [options avancées] -- 2.1.4