Page MenuHomeIn-Portal Phabricator

in-bulletin
No OneTemporary

File Metadata

Created
Mon, Feb 24, 1:28 PM

in-bulletin

Index: branches/5.2.x/install.php
===================================================================
--- branches/5.2.x/install.php (revision 15647)
+++ branches/5.2.x/install.php (revision 15648)
@@ -1,52 +1,58 @@
<?php
/**
* @version $Id$
* @package In-Bulletin
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
- $module_folder = 'modules/in-bulletin';
+$module_folder = 'modules/in-bulletin';
- if (!defined('IS_INSTALL')) {
- // separate module install
- define('IS_INSTALL', 1);
- define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__) . '/../..') );
+if ( !defined('IS_INSTALL') ) {
+ // separate module install
+ define('IS_INSTALL', 1);
+ define('ADMIN', 1);
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../..'));
- include_once(FULL_PATH . '/core/kernel/startup.php');
- require_once FULL_PATH . '/core/install/install_toolkit.php';
+ include_once(FULL_PATH . '/core/kernel/startup.php');
+ require_once FULL_PATH . '/core/install/install_toolkit.php';
- $toolkit = new kInstallToolkit();
- }
- else {
- // install, using installation wizard
- $toolkit =& $this->toolkit;
- /* @var $toolkit kInstallToolkit */
- }
-
- $application =& kApplication::Instance();
- $application->Init();
+ $constants_file = FULL_PATH . '/' . $module_folder . '/constants.php';
- if ($application->RecallVar('user_id') != USER_ROOT) {
- die('restricted access!');
+ if ( file_exists($constants_file) ) {
+ require_once $constants_file;
}
- $category =& $toolkit->createModuleCategory('Forums', 'Discussion Forums', '#in-bulletin/section_design#', 'in-bulletin/img/menu_topics.gif');
-
- $toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql');
- $toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{TopicCatId}', $category->GetID());
- $toolkit->ImportLanguage('/' . $module_folder . '/install/english');
-
- $toolkit->SetModuleRootCategory(basename($module_folder), $category->GetID());
-
-// $toolkit->linkCustomFields(basename($module_folder), 'bb', 3); // to create Custom Fields for Topics
- $toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
- $toolkit->setModuleItemTemplate($category, 'bb', '#in-bulletin/item_design#');
+ $toolkit = new kInstallToolkit();
+}
+else {
+ // install, using installation wizard
+ $toolkit =& $this->toolkit;
+ /* @var $toolkit kInstallToolkit */
+}
+
+$application =& kApplication::Instance();
+$application->Init();
+
+if ( $application->RecallVar('user_id') != USER_ROOT ) {
+ die('restricted access!');
+}
+
+$category =& $toolkit->createModuleCategory('Forums', 'Discussion Forums', '#in-bulletin/section_design#', 'in-bulletin/img/menu_topics.gif');
+
+$toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql');
+$toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{TopicCatId}', $category->GetID());
+$toolkit->ImportLanguage('/' . $module_folder . '/install/english');
+
+$toolkit->SetModuleRootCategory(basename($module_folder), $category->GetID());
+
+//$toolkit->linkCustomFields(basename($module_folder), 'bb', 3); // to create Custom Fields for Topics
+$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
+$toolkit->setModuleItemTemplate($category, 'bb', '#in-bulletin/item_design#');
- $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
+$toolkit->finalizeModuleInstall($module_folder, true);

Event Timeline