diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 9e21b147d25..7d539790014 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -206,7 +206,8 @@ class Conf extends stdClass 'member' => array(), 'hooks' => array(), 'dir' => array(), - 'syslog' => array() + 'syslog' => array(), + 'websitetemplates' => array() ); // First level object that are modules. @@ -316,6 +317,7 @@ class Conf extends stdClass 'hooks' => array(), 'dir' => array(), 'syslog' => array(), + 'websitetemplates' => array(), ); if (!is_null($db) && is_object($db)) { @@ -375,7 +377,7 @@ class Conf extends stdClass $newvalue = $arrValue; } elseif (in_array($partname, array('login', 'menus', 'substitutions', 'triggers', 'tpl'))) { $newvalue = '/'.$modulename.'/core/'.$partname.'/'; - } elseif (in_array($partname, array('models', 'theme'))) { + } elseif (in_array($partname, array('models', 'theme', 'websitetemplates'))) { $newvalue = '/'.$modulename.'/'; } elseif ($value == 1) { $newvalue = '/'.$modulename.'/core/modules/'.$partname.'/'; // ex: partname = societe diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 65e488151b3..08faaa7e965 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -540,7 +540,7 @@ function dolSaveLicense($file, $content) */ function showWebsiteTemplates(Website $website) { - global $conf, $langs, $db, $form, $user; + global $conf, $langs, $form, $user; $dirthemes = array('/doctemplates/websites'); if (!empty($conf->modules_parts['websitetemplates'])) { // Using this feature slow down application diff --git a/htdocs/core/modules/modWebhook.class.php b/htdocs/core/modules/modWebhook.class.php index d8e5ac36c34..99711641cf0 100644 --- a/htdocs/core/modules/modWebhook.class.php +++ b/htdocs/core/modules/modWebhook.class.php @@ -290,8 +290,6 @@ class modWebhook extends DolibarrModules */ public function init($options = '') { - global $conf, $langs; - $result = $this->_load_tables('/install/mysql/tables/', 'webhook'); //$result = $this->_load_tables('/webhook/sql/'); if ($result < 0) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 44ca54a0abb..f18df770569 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -664,7 +664,7 @@ if (GETPOSTISSET('disablemodules')) { $_SESSION["disablemodules"] = GETPOST('disablemodules', 'alpha'); } if (!empty($_SESSION["disablemodules"])) { - $modulepartkeys = array('css', 'js', 'tabs', 'triggers', 'login', 'substitutions', 'menus', 'theme', 'sms', 'tpl', 'barcode', 'models', 'societe', 'hooks', 'dir', 'syslog', 'tpllinkable', 'contactelement', 'moduleforexternal'); + $modulepartkeys = array('css', 'js', 'tabs', 'triggers', 'login', 'substitutions', 'menus', 'theme', 'sms', 'tpl', 'barcode', 'models', 'societe', 'hooks', 'dir', 'syslog', 'tpllinkable', 'contactelement', 'moduleforexternal', 'websitetemplates'); $disabled_modules = explode(',', $_SESSION["disablemodules"]); foreach ($disabled_modules as $module) { diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index c905b62543b..ed784bbe702 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -247,7 +247,7 @@ class MyObject extends CommonObject */ public function __construct(DoliDB $db) { - global $conf, $langs; + global $langs; $this->db = $db; diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 889804e87db..c8cebf3070c 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -123,6 +123,8 @@ class modMyModule extends DolibarrModules ), // Set this to 1 if features of module are opened to external users 'moduleforexternal' => 0, + // Set this to 1 if the module provides a website template into doctemplates/websites/website_template-mytemplate + 'websitetemplates' => 0 ); // Data directories to create when module is enabled. diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 557eca88bc2..9a1c5d0d237 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -4036,6 +4036,7 @@ if ($action == 'createsite') { } if ($action == 'importsite') { + print ''; print '
'; print '
';