Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2020-06-25 08:57:02 +02:00
commit 9eae07fae9
3 changed files with 8 additions and 3 deletions

View File

@ -37,8 +37,8 @@ class SeedDMS_ExtExample extends SeedDMS_ExtBase {
*
* Use this method to do some initialization like setting up the hooks
* You have access to the following global variables:
* $GLOBALS['settings'] : current global configuration
* $GLOBALS['settings']->_extensions['example'] : configuration of this extension
* $this->settings : current global configuration
* $this->settings->_extensions['example'] : configuration of this extension
* $GLOBALS['LANG'] : the language array with translations for all languages
* $GLOBALS['SEEDDMS_HOOKS'] : all hooks added so far
*/

View File

@ -29,4 +29,9 @@
* @package SeedDMS
*/
class SeedDMS_ExtBase {
var $settings;
public function __construct($settings) {
$this->settings = $settings;
}
}

View File

@ -44,7 +44,7 @@ foreach($extMgr->getExtensionConfiguration() as $extname=>$extconf) {
$classfile = $settings->_rootDir."/ext/".$extname."/".$extconf['class']['file'];
if(file_exists($classfile)) {
include($classfile);
$obj = new $extconf['class']['name'];
$obj = new $extconf['class']['name']($settings);
if(method_exists($obj, 'init'))
$obj->init(isset($settings->_extensions[$extname]) ? $settings->_extensions[$extname] : null);
}