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@ * @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() {
} }
} }
?> ?>