Index: branches/5.2.x/install.php =================================================================== diff -u -N -r14691 -r15644 --- branches/5.2.x/install.php (.../install.php) (revision 14691) +++ branches/5.2.x/install.php (.../install.php) (revision 15644) @@ -1,6 +1,6 @@ toolkit; - /* @var $toolkit kInstallToolkit */ - } - $application =& kApplication::Instance(); - $application->Init(); + $toolkit = new kInstallToolkit(); +} +else { + // install, using installation wizard + $toolkit =& $this->toolkit; + /* @var $toolkit kInstallToolkit */ +} - if ($application->RecallVar('user_id') != USER_ROOT) { - die('restricted access!'); - } +$application =& kApplication::Instance(); +$application->Init(); - $category =& $toolkit->createModuleCategory('News', 'News Articles', '#in-news/section_design#', 'in-news/img/menu_articles.gif'); +if ( $application->RecallVar('user_id') != USER_ROOT ) { + die('restricted access!'); +} - $toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql'); - $toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{NewsCatId}', $category->GetID()); - $toolkit->ImportLanguage('/' . $module_folder . '/install/english'); +$category =& $toolkit->createModuleCategory('News', 'News Articles', '#in-news/section_design#', 'in-news/img/menu_articles.gif'); - $toolkit->SetModuleRootCategory(basename($module_folder), $category->GetID()); +$toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql'); +$toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{NewsCatId}', $category->GetID()); +$toolkit->ImportLanguage('/' . $module_folder . '/install/english'); - $toolkit->linkCustomFields(basename($module_folder), 'n', 2); // to create Custom Fields for News - $toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field - $toolkit->setModuleItemTemplate($category, 'n', '#in-news/item_design#'); +$toolkit->SetModuleRootCategory(basename($module_folder), $category->GetID()); - $toolkit->finalizeModuleInstall($module_folder, true); \ No newline at end of file +$toolkit->linkCustomFields(basename($module_folder), 'n', 2); // to create Custom Fields for News +$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field +$toolkit->setModuleItemTemplate($category, 'n', '#in-news/item_design#'); + +$toolkit->finalizeModuleInstall($module_folder, true);