add method __invoke()

calls the function whose name is passed as $_GET['action']
This commit is contained in:
Uwe Steinmann 2015-08-20 15:53:30 +02:00
parent ca32bc856e
commit 80f0499d1b

View File

@ -25,17 +25,26 @@
* @version Release: @package_version@
*/
class SeedDMS_View_Common {
var $theme;
protected $theme;
var $params;
// var $settings;
protected $params;
function __construct($params, $theme='blue') {
$this->theme = $theme;
$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) {
$this->params = $params;
}
@ -49,14 +58,7 @@ class SeedDMS_View_Common {
unset($this->params[$name]);
}
/*
function setConfiguration($conf) {
$this->settings = $conf;
}
*/
function show() {
}
}
?>