From: Florent Bruneau Date: Sun, 11 Apr 2010 09:44:55 +0000 (+0200) Subject: No more hacks to handle '%grp'. X-Git-Tag: xorg/1.0.0~302 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=220cce87f8c3b96a80172ff9540c94ad257d4731;p=platal.git No more hacks to handle '%grp'. Signed-off-by: Florent Bruneau --- diff --git a/classes/xnet.php b/classes/xnet.php index 4d0437f..08e6163 100644 --- a/classes/xnet.php +++ b/classes/xnet.php @@ -25,52 +25,23 @@ class Xnet extends Platal { parent::__construct('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', 'payment', 'bandeau'); - - 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'; - } - } - } - - protected function find_nearest_key($key, array &$array) - { - global $globals; - if (in_array('%grp', array_keys($array)) && $key == $globals->asso('diminutif')) { - return '%grp'; - } - return parent::find_nearest_key($key, $array); } - public function near_hook() + public function hook_map($name) { - global $globals; - $link = str_replace('%grp', $globals->asso('diminutif'), parent::near_hook()); - if ($link != $this->path) { - return $link; + if ($name == 'grp') { + global $globals; + if ($globals->asso()) { + return $globals->asso('shortname'); + } } return null; } - public function pl_self($n = null) - { - global $globals; - return str_replace('%grp', $globals->asso('diminutif'), parent::pl_self($n)); - } - protected function find_hook() { $ans = parent::find_hook(); $this->https = false; - if ($ans && $this->ns) { - $this->path = $this->ns . substr($this->path, 5); - $this->argv[0] = $this->ns . substr($this->argv[0], 5); - } return $ans; } diff --git a/core b/core index b0a8daa..46ca274 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit b0a8daa8a2428ffc76ea4eb690ab8379cdc22aec +Subproject commit 46ca2746b59162c026f67271c5583fa2f20f5c4c