--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2006 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 *
+ ***************************************************************************/
+
+require_once dirname(__FILE__).'/Platal.php';
+
+class Xnet extends Platal
+{
+ function Xnet()
+ {
+ $modules = func_get_args();
+ call_user_func_array(array(&$this, 'Platal'), $modules);
+
+ global $globals;
+ if ($globals->asso()) {
+ if ($p = strpos($this->path, '/')) {
+ $this->ns = substr($this->path, 0, $p);
+ $this->path = 'grp'.substr($this->path, $p);
+ } else {
+ $this->ns = $this->path.'/';
+ $this->path = 'grp';
+ }
+ }
+ }
+}
+
+?>
+++ /dev/null
-<?php
-
-require 'xnet.inc.php';
-
-new_page('xnet/groupe/asso.tpl', AUTH_PUBLIC);
-$page->useMenu();
-$page->setType($globals->asso('cat'));
-$page->assign('is_member', is_member());
-$page->assign('logged', logged());
-
-$page->assign('asso', $globals->asso());
-if (!$globals->asso('id')) {
- redirect("../");
-}
-
-$page->run();
-
-?>
require 'xnet.inc.php';
-require_once dirname(__FILE__).'/../classes/Platal.php';
+require_once dirname(__FILE__).'/../classes/Xnet.php';
require_once dirname(__FILE__).'/../classes/PLModule.php';
-$platal = new Platal('xnet');
+$platal = new Xnet('xnet', 'xnetgrp');
$platal->run();
?>
if (logged() && (is_member() || may_update())) {
$sub = array();
$dim = $globals->asso('diminutif');
- $sub['présentation'] = "$dim/asso.php";
+ $sub['présentation'] = "$dim/";
if (may_update() || $globals->asso('pub') == 'public') {
$sub['annuaire du groupe'] = "$dim/annuaire.php";
if ($globals->xnet->geoloc)
WHERE m.uid={?}", Session::getInt('uid'));
$html = '<div>Mes groupes :</div>';
while (list($nom, $mini) = $res->next()) {
- $html .= "<a class='gp' href='".smarty_function_rel()."/$mini/asso.php'>• $nom</a>";
+ $html .= "<a class='gp' href='".smarty_function_rel()."/$mini'>• $nom</a>";
}
return $html;
}
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2006 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 *
+ ***************************************************************************/
+
+class XnetGrpModule extends PLModule
+{
+ function handlers()
+ {
+ return array(
+ 'grp' => $this->make_hook('index', AUTH_PUBLIC),
+ );
+ }
+
+ function handler_index(&$page)
+ {
+ global $globals;
+
+ if (!$globals->asso('id')) {
+ return PL_NOT_FOUND;
+ }
+
+ $page->changeTpl('xnet/groupe/asso.tpl');
+ $page->useMenu();
+ $page->setType($globals->asso('cat'));
+ $page->assign('is_member', is_member());
+ $page->assign('logged', logged());
+
+ $page->assign('asso', $globals->asso());
+ }
+}
+
+?>
{
static $rel;
if (empty($rel)) {
- global $globals;
+ global $globals, $platal;
+
$url = parse_url($globals->baseurl);
return ($rel = $url['path']);
}
{**************************************************************************}
{if $asso.site}
-<a href="{$asso.site}"><img src='getlogo.php' alt="LOGO" style="float: right;" /></a>
+<a href="{$asso.site}"><img src='{rel}/{$platal->ns}getlogo.php' alt="LOGO" style="float: right;" /></a>
{else}
-<img src='getlogo.php' alt="LOGO" style="float: right;" />
+<img src='{rel}/{$platal->ns}getlogo.php' alt="LOGO" style="float: right;" />
{/if}
<h1>{$asso.nom} : Accueil</h1>
Forum:
</td>
<td>
- <a href="https://www.polytechnique.org/banana/?group={$asso.forum}">par le web</a>
+ <a href="https://www.polytechnique.org/banana/{$asso.forum}">par le web</a>
ou <a href="news://ssl.polytechnique.org/{$asso.forum}">par nntp</a>
</td>
</tr>
M'inscrire :
</td>
<td>
- <a href="{$asso.sub_url|default:"inscrire.php"}">m'inscrire</a>
+ <a href="{rel}/{$platal->ns}inscrire.php">m'inscrire</a>
</td>
</tr>
{/if}
<p class="descr">
<strong>Ta demande d'inscription a bien été envoyée !</strong> Tu seras averti par email de la suite qui lui sera donnée.
<p>
-<p class="descr">[<a href="asso.php">Retour à la page d'accueil de {$asso.nom}</a>]</p>
+<p class="descr">[<a href="{rel}/{$platal->ns}">Retour à la page d'accueil de {$asso.nom}</a>]</p>
{else}
<td style="text-align:right;">
{iterate from=$gps item=g}
<table style="float: left;" cellspacing="2" cellpadding="0">
- <tr><td class="oval{if $doms}2{/if}"><a href="{rel}/{$g.diminutif}/asso.php">{$g.nom}</a></td></tr>
+ <tr><td class="oval{if $doms}2{/if}"><a href="{rel}/{$g.diminutif}/">{$g.nom}</a></td></tr>
</table>
{/iterate}
</td>
Après avoir sélectionné l'association
polytechnicienne de ton choix, tu arrives sur la page qui lui est dédiée.
-<a href="http://www.polytechnique.net/X-Israel/asso.php"> L'exemple d'X-Israël</a
+<a href="http://www.polytechnique.net/X-Israel/"> L'exemple d'X-Israël</a
La page de chaque association comporte ainsi :
<ul style='margin-top:0cm' type=disc>
{foreach from=$groupesx key=id item=dom}
<a class="cat" href="{rel}/groups/groupesx/{$id}">{$dom[0].domnom}</a>
{foreach from=$dom item=g}
- <a href="{$g.diminutif}/asso.php">{$g.nom}</a>
+ <a href="{rel}/{$g.diminutif}/">{$g.nom}</a>
{/foreach}
{/foreach}
</td>
{foreach from=$binets key=id item=dom}
<a class="cat" href="sommaire.php?cat=binets&dom={$id}">{$dom[0].domnom}</a>
{foreach from=$dom item=g}
- <a href="{$g.diminutif}/asso.php">{$g.nom}</a>
+ <a href="{rel}/{$g.diminutif}/">{$g.nom}</a>
{/foreach}
{/foreach}
</td>
<tr>
<td class="listec">
{iterate from=$promos item=g}
- <a href="{$g.diminutif}/asso.php">{$g.nom}</a>
+ <a href="{rel}/{$g.diminutif}/">{$g.nom}</a>
{/iterate}
</td>
</tr>
<tr>
<td class="listec">
{iterate from=$inst item=g}
- <a href="{$g.diminutif}/asso.php">{$g.nom}</a>
+ <a href="{rel}/{$g.diminutif}/">{$g.nom}</a>
{/iterate}
</td>
</tr>