From: x2003bruneau Date: Fri, 22 Dec 2006 15:14:13 +0000 (+0000) Subject: Relook wiki administration page to show the tree structure of the site X-Git-Tag: xorg/0.9.13~158 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=bc0903c71a064931efd8677b246e7f31c194fb82;p=platal.git Relook wiki administration page to show the tree structure of the site git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1309 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/htdocs/images/L.gif b/htdocs/images/L.gif new file mode 100644 index 0000000..171dcb6 Binary files /dev/null and b/htdocs/images/L.gif differ diff --git a/htdocs/images/T.gif b/htdocs/images/T.gif new file mode 100644 index 0000000..cf2335f Binary files /dev/null and b/htdocs/images/T.gif differ diff --git a/htdocs/images/k2.gif b/htdocs/images/k2.gif new file mode 100644 index 0000000..37eb368 Binary files /dev/null and b/htdocs/images/k2.gif differ diff --git a/modules/admin.php b/modules/admin.php index ecb35d7..829bec4 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -860,7 +860,9 @@ class AdminModule extends PLModule $table_editor->describe('description','description',false); $table_editor->apply($page, $action, $id); } - function handler_wiki(&$page, $action='list') { + + function handler_wiki(&$page, $action='list') + { require_once 'wiki.inc.php'; // update wiki perms @@ -896,9 +898,19 @@ class AdminModule extends PLModule } } ksort($wiki_pages); + $wiki_tree = array(); + foreach ($wiki_pages as $file => $desc) { + list($cat, $name) = explode('.', $file); + if (!isset($wiki_tree[$cat])) { + $wiki_tree[$cat] = array(); + } + $wiki_tree[$cat][$name] = $desc; + } + + $page->changeTpl('admin/wiki.tpl'); - $page->assign('wiki_pages', $wiki_pages); + $page->assign('wiki_pages', $wiki_tree); $page->assign('perms_opts', $perms); } } diff --git a/modules/newsletter.php b/modules/newsletter.php index 87ba7a1..4eae2c0 100644 --- a/modules/newsletter.php +++ b/modules/newsletter.php @@ -30,6 +30,12 @@ class NewsletterModule extends PLModule 'admin/newsletter' => $this->make_hook('admin_nl', AUTH_MDP, 'admin'), 'admin/newsletter/categories' => $this->make_hook('admin_nl_cat', AUTH_MDP, 'admin'), 'admin/newsletter/edit' => $this->make_hook('admin_nl_edit', AUTH_MDP, 'admin'), + + 'ax' => $this->make_hook('ax', AUTH_COOKIE), + 'ax/show' => $this->make_hook('ax_show', AUTH_COOKIE), + 'ax/submit' => $this->make_hook('ax_submit', AUTH_MDP), + 'ax/edit' => $this->make_hook('ax_submit', AUTH_MDP), + 'admin/axletter/rights' => $this->make_hook('admin_ax_rights', AUTH_MDP, 'admin'), ); } @@ -154,8 +160,41 @@ class NewsletterModule extends PLModule $table_editor->describe('titre','intitulé',true); $table_editor->describe('pos','position',true); $table_editor->apply($page, $action, $id); - } - + } + + function handler_ax(&$page, $action = null) + { + require_once 'newsletter.inc.php'; + + $page->changeTpl('newsletter/ax.tpl'); + $page->assign('xorg_title','Polytechnique.org - Envois de l\'AX'); + + switch ($action) { + case 'out': AXLetter::unsubscribe(); break; + case 'in': AXLetter::subscribe(); break; + default: ; + } + + $perm = AXLetter::hasPerms(); + if ($perm) { + $waiting = AXLetter::awaiting(); + if ($waiting) { + $new = new AXLetter($waiting); + $page->assign('new', $new); + } + } + $page->assign('axs', AXLetter::subscriptionState()); + $page->assign('ax_list', AXLetter::listSent()); + $page->assign('ax_rights', AXLetter::hasPerms()); + } + + function handler_ax_submit(&$page) + { + require_once('newsletter.inc.php'); + if (!AXLetter::hasPerms()) { + return PL_FORBIDDEN; + } + } } ?> diff --git a/templates/admin/wiki.tpl b/templates/admin/wiki.tpl index 84204d0..2320245 100644 --- a/templates/admin/wiki.tpl +++ b/templates/admin/wiki.tpl @@ -54,30 +54,43 @@ action -{foreach from=$wiki_pages item=perm key=page} - - - {$page} {icon name=page_edit title='éditer'} +{foreach from=$wiki_pages key=cat item=pages} + + + - + {$cat} + + +{foreach from=$pages item=perm key=page name=pages} + + + {if $smarty.foreach.pages.last} + L + {else} + | + {/if} + {$page} {icon name=page_edit title='éditer'} - + {$perm.read} - + {$perm.edit} - - + + {/foreach} - +{/foreach} + {icon name=tick title='tout cocher'} {icon name=cross title='tout décocher'} {icon name=arrow_refresh title='toggle'} - + Attribue les permissions aux pages cochées :