mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
read view class from extension directories
set default theme to bootstrap
This commit is contained in:
parent
c1b216bf51
commit
8237f92a7b
|
@ -26,7 +26,7 @@ if (!isset($theme) || strlen($theme)==0) {
|
||||||
$theme = $settings->_theme;
|
$theme = $settings->_theme;
|
||||||
}
|
}
|
||||||
if (strlen($theme)==0) {
|
if (strlen($theme)==0) {
|
||||||
$theme="blue";
|
$theme="bootstrap";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sooner or later the parent will be removed, because all output will
|
/* Sooner or later the parent will be removed, because all output will
|
||||||
|
@ -45,15 +45,29 @@ class UI extends UI_Default {
|
||||||
* @return object an object of a class implementing the view
|
* @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;
|
global $settings, $session, $EXT_CONF;
|
||||||
if(!$class) {
|
if(!$class) {
|
||||||
$class = 'Bootstrap';
|
$class = 'Bootstrap';
|
||||||
$classname = "SeedDMS_Bootstrap_Style";
|
$classname = "SeedDMS_Bootstrap_Style";
|
||||||
} else {
|
} else {
|
||||||
$classname = "SeedDMS_View_".$class;
|
$classname = "SeedDMS_View_".$class;
|
||||||
}
|
}
|
||||||
$filename = $settings->_rootDir."views/".$theme."/class.".$class.".php";
|
/* Do not check for class file anymore but include it relative
|
||||||
if(file_exists($filename)) {
|
* to rootDir or an extension dir if it has set the include path
|
||||||
|
*/
|
||||||
|
$filename = '';
|
||||||
|
foreach($EXT_CONF as $extname=>$extconf) {
|
||||||
|
$filename = '../ext/'.$extname.'/views/'.$theme."/class.".$class.".php";
|
||||||
|
if(file_exists($filename)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$filename = '';
|
||||||
|
}
|
||||||
|
if(!$filename)
|
||||||
|
$filename = $settings->_rootDir."views/".$theme."/class.".$class.".php";
|
||||||
|
if(!file_exists($filename))
|
||||||
|
$filename = '';
|
||||||
|
if($filename) {
|
||||||
require($filename);
|
require($filename);
|
||||||
$view = new $classname($params, $theme);
|
$view = new $classname($params, $theme);
|
||||||
/* Set some configuration parameters */
|
/* Set some configuration parameters */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user