X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxnet.php;h=08e6163643625ffce5c1c865149fdfa1a003e1d7;hb=f6e35ff3fefafe908e1675690340ab93265192a0;hp=9983abade82119310607530d31dfc3e5e9cdc6d2;hpb=fb813fb52d5ab65ca9a5b92b5cb9089523380d79;p=platal.git diff --git a/classes/xnet.php b/classes/xnet.php index 9983aba..08e6163 100644 --- a/classes/xnet.php +++ b/classes/xnet.php @@ -23,54 +23,25 @@ class Xnet extends Platal { public function __construct() { - $modules = func_get_args(); - parent::__construct($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'; - } - } - } - - 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); + parent::__construct('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', + 'payment', 'bandeau'); } - 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; }