Quellcode durchsuchen

#334 If there is no default template, set one by default upon enable

Alex Trofimov vor 10 Jahren
Ursprung
Commit
fe178a3a6d

+ 30 - 0
modules/base/template/classes/BxBaseModTemplateInstaller.php

@@ -0,0 +1,30 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    BaseTemplate Base classes for template modules
+ * @ingroup     TridentModules
+ *
+ * @{
+ */
+
+class BxBaseModTemplateInstaller extends BxDolStudioInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+
+	function enable($aParams)
+    {
+        $aResult = parent::enable($aParams);
+
+        if ($aResult['result'] && !getParam('template'))
+            setParam('template', $this->_aConfig['home_uri']);
+
+        return $aResult;
+    }
+}
+
+/** @} */

+ 1 - 3
modules/boonex/air/install/installer.php

@@ -9,9 +9,7 @@
  * @{
  * @{
  */
  */
 
 
-bx_import('BxDolStudioInstaller');
-
-class BxAirInstaller extends BxDolStudioInstaller
+class BxAirInstaller extends BxBaseModTemplateInstaller
 {
 {
     function __construct($aConfig)
     function __construct($aConfig)
     {
     {

+ 1 - 1
modules/boonex/ocean/install/installer.php

@@ -9,7 +9,7 @@
  * @{
  * @{
  */
  */
 
 
-class BxOceanInstaller extends BxDolStudioInstaller
+class BxOceanInstaller extends BxBaseModTemplateInstaller
 {
 {
     function __construct($aConfig)
     function __construct($aConfig)
     {
     {

+ 1 - 1
modules/boonex/protean/install/installer.php

@@ -9,7 +9,7 @@
  * @{
  * @{
  */
  */
 
 
-class BxProteanInstaller extends BxDolStudioInstaller
+class BxProteanInstaller extends BxBaseModTemplateInstaller
 {
 {
     function __construct($aConfig)
     function __construct($aConfig)
     {
     {