$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
}
}
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);
}
}
'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'),
);
}
$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;
+ }
+ }
}
?>
action
</th>
</tr>
-{foreach from=$wiki_pages item=perm key=page}
- <tr class="{cycle values="impair,pair"}">
- <td>
- <a href="{$page|replace:'.':'/'}">{$page}</a> <a href="{$page|replace:'.':'/'}?action=edit" class="indice">{icon name=page_edit title='éditer'}</a>
+{foreach from=$wiki_pages key=cat item=pages}
+ <tr class="pair">
+ <td colspan="4" style="margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; height: 20px">
+ <img src="images/k2.gif" alt="-" width="9" height="21" />
+ {$cat}
+ </td>
+ </tr>
+{foreach from=$pages item=perm key=page name=pages}
+ <tr class="impair" onmouseover="this.className='pair';" onmouseout="this.className='impair';">
+ <td style="margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; height: 20px">
+ {if $smarty.foreach.pages.last}
+ <img src="images/L.gif" alt="L" width="12" height="21" />
+ {else}
+ <img src="images/T.gif" alt="|" style="width: 12px: height: 21px" />
+ {/if}
+ <a href="{$cat}/{$page}">{$page}</a> <a href="{$cat}/{$page}?action=edit" class="indice">{icon name=page_edit title='éditer'}</a>
</td>
- <td class="center">
+ <td class="center" style="margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; height: 20px">
{$perm.read}
</td>
- <td class="center">
+ <td class="center" style="margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; height: 20px">
{$perm.edit}
</td>
- <td class="action">
- <input type="checkbox" name="{$page|replace:'.':'/'}"/>
+ <td class="action" style="margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; height: 20px">
+ <input type="checkbox" name="{$cat}/{$page}"/>
</td>
</tr>
{/foreach}
- <tr>
+{/foreach}
+ <tr class="pair">
<td class="action" colspan="4">
<span onclick="check_all_boxes('update_pages', true)">{icon name=tick title='tout cocher'}</span>
<span onclick="check_all_boxes('update_pages', false)">{icon name=cross title='tout décocher'}</span>
<span onclick="check_all_boxes('update_pages', 'toggle')">{icon name=arrow_refresh title='toggle'}</span>
</td>
</tr>
- <tr>
+ <tr class="pair">
<td>
Attribue les permissions aux pages cochées :
</td>