X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fxorg.plugin.inc.php;h=f6fba1880fa1f14fa445702e58ff94dd4529ef83;hb=b7550106ff9bc8e7ea2b09c622456e3eef87500a;hp=c6f30272173e2eed4e00183f4396839a051256dc;hpb=0337d704b62718d7c77106c0e4c4e26fb02beacf;p=platal.git diff --git a/include/xorg.plugin.inc.php b/include/xorg.plugin.inc.php index c6f3027..f6fba18 100644 --- a/include/xorg.plugin.inc.php +++ b/include/xorg.plugin.inc.php @@ -1,6 +1,6 @@ _prefix.$key); + return Get::v($this->_prefix.$key); } // }}} // {{{ function make_url() - + /** construct an url with the given parameters to drive the plugin. * leave all other GET params alone */ @@ -78,31 +78,30 @@ class XOrgPlugin $args = isset($params) ? $params : Array(); if (!is_array($args)) { - if (count($this->_get_vars)!=1) { - return "

params should be an array

"; - } else { - $args = Array($this->_get_vars[0]=>$params); - } + $args = array($this->_get_vars[0]=>$params); } foreach ($_GET as $key=>$val) { - if (in_array($key,$this->_get_vars) && array_key_exists($key,$args)) { + if ($key == 'n') { + continue; + } + if (in_array($key, $this->_get_vars) && array_key_exists($key, $args)) { continue; } $get[] = urlencode($key) . '=' . urlencode($val); } foreach ($this->_get_vars as $key) { - if (array_key_exists($key,$args)) { + if (array_key_exists($key, $args)) { if ($args[$key]) { $get[] = urlencode($key) . '=' . urlencode($args[$key]); } } elseif (Get::has('key')) { - $get[] = urlencode($key) . '=' . urlencode(Get::get($key)); + $get[] = urlencode($key) . '=' . urlencode(Get::v($key)); } } - return $_SERVER['PHP_SELF'] . '?' . join('&',$get); + return pl_self() . '?' . join('&', $get); } // }}}