mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 12:11:19 +00:00
factory can be called without a class
in that case only the parent class SeedDMS_Bootstrap_Style will be initiated
This commit is contained in:
parent
4ab841b09d
commit
97d98137ca
|
@ -44,11 +44,17 @@ class UI extends UI_Default {
|
|||
* @param array $params parameter passed to constructor of view class
|
||||
* @return object an object of a class implementing the view
|
||||
*/
|
||||
static function factory($theme, $class, $params=array()) { /* {{{ */
|
||||
static function factory($theme, $class='', $params=array()) { /* {{{ */
|
||||
global $settings, $session;
|
||||
if(file_exists("../views/".$theme."/class.".$class.".php")) {
|
||||
require("../views/".$theme."/class.".$class.".php");
|
||||
if(!$class) {
|
||||
$class = 'Bootstrap';
|
||||
$classname = "SeedDMS_Bootstrap_Style";
|
||||
} else {
|
||||
$classname = "SeedDMS_View_".$class;
|
||||
}
|
||||
$filename = "../views/".$theme."/class.".$class.".php";
|
||||
if(file_exists($filename)) {
|
||||
require($filename);
|
||||
$view = new $classname($params, $theme);
|
||||
/* Set some configuration parameters */
|
||||
$view->setParam('refferer', $_SERVER['REQUEST_URI']);
|
||||
|
|
Loading…
Reference in New Issue
Block a user