mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
add method __invoke()
calls the function whose name is passed as $_GET['action']
This commit is contained in:
parent
ca32bc856e
commit
80f0499d1b
|
@ -25,17 +25,26 @@
|
||||||
* @version Release: @package_version@
|
* @version Release: @package_version@
|
||||||
*/
|
*/
|
||||||
class SeedDMS_View_Common {
|
class SeedDMS_View_Common {
|
||||||
var $theme;
|
protected $theme;
|
||||||
|
|
||||||
var $params;
|
protected $params;
|
||||||
|
|
||||||
// var $settings;
|
|
||||||
|
|
||||||
function __construct($params, $theme='blue') {
|
function __construct($params, $theme='blue') {
|
||||||
$this->theme = $theme;
|
$this->theme = $theme;
|
||||||
$this->params = $params;
|
$this->params = $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function __invoke($get=array()) {
|
||||||
|
if(isset($get['action']) && $get['action']) {
|
||||||
|
if(method_exists($this, $get['action'])) {
|
||||||
|
$this->{$get['action']}();
|
||||||
|
} else {
|
||||||
|
echo "Missing action '".$get['action']."'";
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
$this->show();
|
||||||
|
}
|
||||||
|
|
||||||
function setParams($params) {
|
function setParams($params) {
|
||||||
$this->params = $params;
|
$this->params = $params;
|
||||||
}
|
}
|
||||||
|
@ -49,14 +58,7 @@ class SeedDMS_View_Common {
|
||||||
unset($this->params[$name]);
|
unset($this->params[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
function setConfiguration($conf) {
|
|
||||||
$this->settings = $conf;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user