mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-07 13:49:23 +00:00
call parent class in class.Bootstrap.php, move imgpath in parent
This commit is contained in:
parent
2413da8c0b
commit
97d08ef1b4
|
@ -31,12 +31,18 @@ class SeedDMS_View_Common {
|
||||||
|
|
||||||
protected $params;
|
protected $params;
|
||||||
|
|
||||||
function __construct($params, $theme='blue') {
|
protected $baseurl;
|
||||||
|
|
||||||
|
protected $imgpath;
|
||||||
|
|
||||||
|
public function __construct($params, $theme='bootstrap') {
|
||||||
$this->theme = $theme;
|
$this->theme = $theme;
|
||||||
$this->params = $params;
|
$this->params = $params;
|
||||||
|
$this->baseurl = '';
|
||||||
|
$this->imgpath = '../views/'.$theme.'/images/';
|
||||||
}
|
}
|
||||||
|
|
||||||
function __invoke($get=array()) {
|
public function __invoke($get=array()) {
|
||||||
if(isset($get['action']) && $get['action']) {
|
if(isset($get['action']) && $get['action']) {
|
||||||
if(method_exists($this, $get['action'])) {
|
if(method_exists($this, $get['action'])) {
|
||||||
$this->{$get['action']}();
|
$this->{$get['action']}();
|
||||||
|
@ -47,26 +53,30 @@ class SeedDMS_View_Common {
|
||||||
$this->show();
|
$this->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setParams($params) {
|
public function setParams($params) {
|
||||||
$this->params = $params;
|
$this->params = $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setParam($name, $value) {
|
public function setParam($name, $value) {
|
||||||
$this->params[$name] = $value;
|
$this->params[$name] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getParam($name) {
|
public function getParam($name) {
|
||||||
if(isset($this->params[$name]))
|
if(isset($this->params[$name]))
|
||||||
return $this->params[$name];
|
return $this->params[$name];
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function unsetParam($name) {
|
public function unsetParam($name) {
|
||||||
if(isset($this->params[$name]))
|
if(isset($this->params[$name]))
|
||||||
unset($this->params[$name]);
|
unset($this->params[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function show() {
|
public function setBaseUrl($baseurl) {
|
||||||
|
$this->baseurl = $baseurl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,7 +96,7 @@ class SeedDMS_View_Common {
|
||||||
* @return string concatenated string, merged arrays or whatever the hook
|
* @return string concatenated string, merged arrays or whatever the hook
|
||||||
* function returns
|
* function returns
|
||||||
*/
|
*/
|
||||||
function callHook($hook) { /* {{{ */
|
public function callHook($hook) { /* {{{ */
|
||||||
$tmp = explode('_', get_class($this));
|
$tmp = explode('_', get_class($this));
|
||||||
$ret = null;
|
$ret = null;
|
||||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])])) {
|
if(isset($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])])) {
|
||||||
|
@ -142,7 +152,7 @@ class SeedDMS_View_Common {
|
||||||
* @params string $classname name of class (current class if left empty)
|
* @params string $classname name of class (current class if left empty)
|
||||||
* @return array list of hook objects registered for the class
|
* @return array list of hook objects registered for the class
|
||||||
*/
|
*/
|
||||||
function getHookObjects($classname='') { /* {{{ */
|
public function getHookObjects($classname='') { /* {{{ */
|
||||||
if($classname)
|
if($classname)
|
||||||
$tmp = explode('_', $classname);
|
$tmp = explode('_', $classname);
|
||||||
else
|
else
|
||||||
|
@ -161,7 +171,7 @@ class SeedDMS_View_Common {
|
||||||
* true if all hooks succedded,
|
* true if all hooks succedded,
|
||||||
* null if no hook was called
|
* null if no hook was called
|
||||||
*/
|
*/
|
||||||
function hasHook($hook) { /* {{{ */
|
public function hasHook($hook) { /* {{{ */
|
||||||
$tmp = explode('_', get_class($this));
|
$tmp = explode('_', get_class($this));
|
||||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])])) {
|
if(isset($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])])) {
|
||||||
foreach($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])] as $hookObj) {
|
foreach($GLOBALS['SEEDDMS_HOOKS']['view'][lcfirst($tmp[2])] as $hookObj) {
|
||||||
|
@ -173,7 +183,7 @@ class SeedDMS_View_Common {
|
||||||
return false;
|
return false;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function jsTranslations($keys) {
|
public function jsTranslations($keys) {
|
||||||
echo "var trans = {\n";
|
echo "var trans = {\n";
|
||||||
foreach($keys as $key) {
|
foreach($keys as $key) {
|
||||||
echo " '".$key."': '".str_replace("'", "\\\'", getMLText($key))."',\n";
|
echo " '".$key."': '".str_replace("'", "\\\'", getMLText($key))."',\n";
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
|
|
||||||
|
|
||||||
class SeedDMS_Bootstrap_Style extends SeedDMS_View_Common {
|
class SeedDMS_Bootstrap_Style extends SeedDMS_View_Common {
|
||||||
var $imgpath;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $extraheader extra html code inserted in the html header
|
* @var string $extraheader extra html code inserted in the html header
|
||||||
* of the page
|
* of the page
|
||||||
|
@ -32,9 +30,7 @@ class SeedDMS_Bootstrap_Style extends SeedDMS_View_Common {
|
||||||
protected $extraheader;
|
protected $extraheader;
|
||||||
|
|
||||||
function __construct($params, $theme='bootstrap') {
|
function __construct($params, $theme='bootstrap') {
|
||||||
$this->theme = $theme;
|
parent::__construct($params, $theme);
|
||||||
$this->params = $params;
|
|
||||||
$this->imgpath = '../views/'.$theme.'/images/';
|
|
||||||
$this->extraheader = array('js'=>'', 'css'=>'');
|
$this->extraheader = array('js'=>'', 'css'=>'');
|
||||||
$this->footerjs = array();
|
$this->footerjs = array();
|
||||||
}
|
}
|
||||||
|
@ -80,7 +76,9 @@ class SeedDMS_Bootstrap_Style extends SeedDMS_View_Common {
|
||||||
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
|
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
|
||||||
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n";
|
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n";
|
||||||
if($base)
|
if($base)
|
||||||
echo '<base href="../../">'."\n";
|
echo '<base href="'.$base.'">'."\n";
|
||||||
|
elseif($this->baseurl)
|
||||||
|
echo '<base href="'.$this->baseurl.'">'."\n";
|
||||||
echo '<link href="../styles/'.$this->theme.'/bootstrap/css/bootstrap.css" rel="stylesheet">'."\n";
|
echo '<link href="../styles/'.$this->theme.'/bootstrap/css/bootstrap.css" rel="stylesheet">'."\n";
|
||||||
echo '<link href="../styles/'.$this->theme.'/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">'."\n";
|
echo '<link href="../styles/'.$this->theme.'/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">'."\n";
|
||||||
echo '<link href="../styles/'.$this->theme.'/font-awesome/css/font-awesome.css" rel="stylesheet">'."\n";
|
echo '<link href="../styles/'.$this->theme.'/font-awesome/css/font-awesome.css" rel="stylesheet">'."\n";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user