Init(); require_once FULL_PATH.'/admin/install/install_lib.php'; require_once FULL_PATH.'/kernel/include/tag-class.php'; if( !is_object($objTagList) ) $objTagList = new clsTagList(); $ado =& GetADODBConnection(); // create module category $cat =& $application->recallObject('c', null, Array('skip_autoload' => true)); $cat_fields = Array('Name' => 'News', 'AutomaticFilename' => 1, 'Filename' => 'News', 'Description' => 'News Articles', 'Status' => 1, 'ParentId' => 0, 'CategoryTemplate' => 'innews/index', 'ItemTemplate' => 'innews/detail', 'CachedCategoryTemplate' => 'innews/index', 'CachedItemTemplate' => 'innews/detail'); $cat->SetDBFieldsFromHash($cat_fields); $cat->Create(); $cat_id = $cat->GetId(); $filename = FULL_PATH.'/'.$MODULE_NAME.'/admin/install/inportal_schema.sql'; if (file_exists($filename)) RunSchemaFile($ado, $filename); $filename = FULL_PATH.'/'.$MODULE_NAME.'/admin/install/inportal_data.sql'; if (file_exists($filename)) { $sql = file($filename); for ($x = 0; $x < count($sql); $x++) { $sql[$x] = str_replace('{NewsCatId}', $cat_id, $sql[$x]); } RunSQLText($ado, $sql); $sql = 'SELECT Version FROM '.TABLE_PREFIX.'Modules WHERE Name = '.$ado->qstr('In-News'); $mod_version = $application->Conn->GetOne($sql); if ($ini_file == '') { $ini_file = FULL_PATH.'/config.php'; $ini_vars = inst_parse_portal_ini($ini_file, true); } set_ini_value('Module Versions', 'In-News', $mod_version); save_values(); $objTagList->ParseFile(FULL_PATH.'/'.$MODULE_NAME.'/parser.php'); } linkCustomFields($MODULE_NAME, 'n', 2); linkCustomFields('KERNEL', 'c', 1); // because in-news module creates some custom fields for categories $sql = 'DELETE FROM '.TABLE_PREFIX.'Cache WHERE (VarName = "config_files") OR (VarName LIKE "%_parsed")'; $application->Conn->Query($sql); $objModules->Refresh(); $objModules->SetModuleRoot('In-News', $cat_id); $inp_cat =& $objCatList->GetCategory($cat_id); $inp_cat->UpdateCachedPath(); $inp_cat->UpdateACL(); finalizeModuleInstall($MODULE_NAME); ?>