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 {
|
2013-01-11 16:55:34 +00:00
|
|
|
var $theme;
|
|
|
|
|
|
|
|
var $params;
|
|
|
|
|
|
|
|
// var $settings;
|
|
|
|
|
|
|
|
function __construct($params, $theme='blue') {
|
|
|
|
$this->theme = $theme;
|
|
|
|
$this->params = $params;
|
|
|
|
}
|
|
|
|
|
|
|
|
function setParams($params) {
|
|
|
|
$this->params = $params;
|
|
|
|
}
|
|
|
|
|
|
|
|
function setParam($name, $value) {
|
|
|
|
$this->params[$name] = $value;
|
|
|
|
}
|
|
|
|
|
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 setConfiguration($conf) {
|
|
|
|
$this->settings = $conf;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
function show() {
|
|
|
|
}
|
2013-05-02 10:12:28 +00:00
|
|
|
|
2013-07-31 15:28:02 +00:00
|
|
|
/**
|
|
|
|
* Call a hook with a given name
|
|
|
|
*
|
|
|
|
* Checks if a hook with the given name and for the current view
|
|
|
|
* exists and executes it. The name of the current view is taken
|
|
|
|
* from the current class name by lower casing the first char.
|
|
|
|
* This function will execute all registered hooks in the order
|
|
|
|
* they were registered.
|
|
|
|
*
|
|
|
|
* @params string $hook name of hook
|
|
|
|
* @return mixed whatever the hook function returns
|
|
|
|
*/
|
2013-05-02 10:12:28 +00:00
|
|
|
function callHook($hook) {
|
|
|
|
$tmp = explode('_', get_class($this));
|
2013-07-21 09:52:58 +00:00
|
|
|
if(isset($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])])) {
|
|
|
|
foreach($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])] as $hookObj) {
|
2013-05-02 10:12:28 +00:00
|
|
|
if (method_exists($hookObj, $hook)) {
|
2013-07-31 15:28:02 +00:00
|
|
|
switch(func_num_args()) {
|
|
|
|
case 1:
|
|
|
|
return $hookObj->$hook($this);
|
|
|
|
case 2:
|
|
|
|
return $hookObj->$hook($this, func_get_arg(1));
|
|
|
|
case 3:
|
|
|
|
default:
|
|
|
|
return $hookObj->$hook($this, func_get_arg(1), func_get_arg(2));
|
|
|
|
}
|
2013-05-02 10:12:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-07-31 15:28:02 +00:00
|
|
|
return null;
|
2013-05-02 10:12:28 +00:00
|
|
|
}
|
2013-01-11 16:55:34 +00:00
|
|
|
}
|
|
|
|
?>
|