2013-01-11 16:55:34 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Implementation of view class
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2013-01-11 16:55:34 +00:00
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Parent class for all view classes
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2013-01-11 16:55:34 +00:00
|
|
|
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
2013-02-14 11:10:53 +00:00
|
|
|
class SeedDMS_View_Common {
|
2015-08-20 13:53:30 +00:00
|
|
|
protected $theme;
|
2013-01-11 16:55:34 +00:00
|
|
|
|
2015-08-20 13:53:30 +00:00
|
|
|
protected $params;
|
2013-01-11 16:55:34 +00:00
|
|
|
|
|
|
|
function __construct($params, $theme='blue') {
|
|
|
|
$this->theme = $theme;
|
|
|
|
$this->params = $params;
|
|
|
|
}
|
|
|
|
|
2015-08-20 13:53:30 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2013-01-11 16:55:34 +00:00
|
|
|
function setParams($params) {
|
|
|
|
$this->params = $params;
|
|
|
|
}
|
|
|
|
|
|
|
|
function setParam($name, $value) {
|
|
|
|
$this->params[$name] = $value;
|
|
|
|
}
|
|
|
|
|
2015-08-25 12:58:16 +00:00
|
|
|
function getParam($name) {
|
|
|
|
if(isset($this->params[$name]))
|
|
|
|
return $this->params[$name];
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2013-06-18 16:14:14 +00:00
|
|
|
function unsetParam($name) {
|
|
|
|
if(isset($this->params[$name]))
|
|
|
|
unset($this->params[$name]);
|
|
|
|
}
|
|
|
|
|
2013-01-11 16:55:34 +00:00
|
|
|
function show() {
|
|
|
|
}
|
2016-03-08 09:37:07 +00:00
|
|
|
|
|
|
|
function jsTranslations($keys) {
|
|
|
|
echo "var trans = {\n";
|
|
|
|
foreach($keys as $key) {
|
|
|
|
echo " '".$key."': '".str_replace("'", "\\\'", getMLText($key))."',\n";
|
|
|
|
}
|
|
|
|
echo "};\n";
|
|
|
|
}
|
2013-01-11 16:55:34 +00:00
|
|
|
}
|
|
|
|
?>
|