Changeset View
Changeset View
Standalone View
Standalone View
modules/in-news/install.php
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
if ( $application->RecallVar('user_id') != USER_ROOT ) { | if ( $application->RecallVar('user_id') != USER_ROOT ) { | ||||
die('restricted access!'); | die('restricted access!'); | ||||
} | } | ||||
$category =& $toolkit->createModuleCategory('News', 'News Articles', '#in-news/section_design#', 'in-news/img/menu_articles.gif'); | $category =& $toolkit->createModuleCategory('News', 'News Articles', '#in-news/section_design#', 'in-news/img/menu_articles.gif'); | ||||
$toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql'); | $toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql'); | ||||
$toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{NewsCatId}', $category->GetID()); | $toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{NewsCatId}', $category->GetID()); | ||||
$toolkit->ImportLanguage('/' . $module_folder . '/install/english'); | $toolkit->ImportLanguage('/' . $module_folder . '/install/english', isset($constants_file)); | ||||
$toolkit->SetModuleRootCategory(basename($module_folder), $category->GetID()); | $toolkit->SetModuleRootCategory(basename($module_folder), $category->GetID()); | ||||
$toolkit->linkCustomFields(basename($module_folder), 'n', 2); // to create Custom Fields for News | $toolkit->linkCustomFields(basename($module_folder), 'n', 2); // to create Custom Fields for News | ||||
$toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field | $toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field | ||||
$toolkit->setModuleItemTemplate($category, 'n', '#in-news/item_design#'); | $toolkit->setModuleItemTemplate($category, 'n', '#in-news/item_design#'); | ||||
$toolkit->finalizeModuleInstall($module_folder, true); | $toolkit->finalizeModuleInstall($module_folder, true); |