projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge xmlrpc stuff, and put it in classes/
[platal.git]
/
include
/
xorg.plugin.inc.php
diff --git
a/include/xorg.plugin.inc.php
b/include/xorg.plugin.inc.php
index
c6f3027
..
445e340
100644
(file)
--- a/
include/xorg.plugin.inc.php
+++ b/
include/xorg.plugin.inc.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-200
4
Polytechnique.org *
+ * Copyright (C) 2003-200
6
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-35,15
+35,15
@@
class XOrgPlugin
{
// {{{ properties
class XOrgPlugin
{
// {{{ properties
-
+
/** have to override, contents the fields names used to drive the plugin */
/** have to override, contents the fields names used to drive the plugin */
- var $_get_vars =
A
rray();
+ var $_get_vars =
a
rray();
/** some polymorphism at low cost, may be used, or not */
var $_callback;
// }}}
// {{{ function XOrgPlugin()
/** some polymorphism at low cost, may be used, or not */
var $_callback;
// }}}
// {{{ function XOrgPlugin()
-
+
/** constructor.
* the constructor override $_get_vars settings by prefixing the names with $prefix
*/
/** constructor.
* the constructor override $_get_vars settings by prefixing the names with $prefix
*/
@@
-58,7
+58,7
@@
class XOrgPlugin
// }}}
// {{{ function get_value()
// }}}
// {{{ function get_value()
-
+
/** transparent access to $_GET, wrt the right $prefix
*/
function get_value($key)
/** transparent access to $_GET, wrt the right $prefix
*/
function get_value($key)
@@
-68,7
+68,7
@@
class XOrgPlugin
// }}}
// {{{ function make_url()
// }}}
// {{{ function make_url()
-
+
/** construct an url with the given parameters to drive the plugin.
* leave all other GET params alone
*/
/** construct an url with the given parameters to drive the plugin.
* leave all other GET params alone
*/
@@
-78,22
+78,21
@@
class XOrgPlugin
$args = isset($params) ? $params : Array();
if (!is_array($args)) {
$args = isset($params) ? $params : Array();
if (!is_array($args)) {
- if (count($this->_get_vars)!=1) {
- return "<p class='erreur'>params should be an array</p>";
- } else {
- $args = Array($this->_get_vars[0]=>$params);
- }
+ $args = array($this->_get_vars[0]=>$params);
}
foreach ($_GET as $key=>$val) {
}
foreach ($_GET as $key=>$val) {
- if (in_array($key,$this->_get_vars) && array_key_exists($key,$args)) {
+ if ($key == 'p') {
+ 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) {
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]);
}
if ($args[$key]) {
$get[] = urlencode($key) . '=' . urlencode($args[$key]);
}
@@
-102,7
+101,7
@@
class XOrgPlugin
}
}
}
}
- return
$_SERVER['PHP_SELF'] . '?' . join('&',
$get);
+ return
pl_self() . '?' . join('&',
$get);
}
// }}}
}
// }}}