Get("Module_SortOrder"); $orderBy = trim($objConfig->Get("Module_SortField")." ".$order); if(strlen($orderBy)) { $orderBy = " ORDER BY LoadOrder,".$orderBy; } else $orderBy = " ORDER BY LoadOrder"; // 1. get list of modules installed in system $objModules->Clear(); $sql = "SELECT * FROM ".GetTablePrefix()."Modules"; $objModules->Query_Item($sql); $objModList = new clsModList(); $path = $pathtoroot; // 2. get folders on HDD, that probably are modules, but not installed yet $new = array(); if ($dir = @opendir($path)) { while (($file = readdir($dir)) !== false) { if ($file !="." && $file !=".." && substr($file,0,1)!="_") { if (is_dir($path.'/'.$file)) { if (file_exists($path . '/' . $file . '/' . $admin . '/install.php')) { if (!$objModules->ModuleInstalled($file)) { $new[$file] = false; // not new module } } if (file_exists($path . '/' . $file . '/install.php')) { if ('/' . $file == ADMIN_DIRECTORY) { // don't count in-portal folder as module continue; } if (!$objModules->ModuleInstalled($file)) { $new[$file] = true; // new module } } } } } closedir($dir); } foreach ($new as $mod => $new_module) { $m = new clsModule(); $script_location = $new_module ? '' : '/admin'; unset($data); $data = array(); $status= admin_language("la_text_ready_to_install"); $pre_error = admin_language("la_text_prerequisit_not_passed"); $mod_tmp_name = implode('-', array_map('ucfirst', explode('-', $mod))); if (ed592fe427e1ce60e32ffcb0c82d8557($mod_tmp_name)) { $result = true; if (file_exists($pathtoroot.strtolower($mod_tmp_name) . $script_location . '/install/prerequisit.php')) { include_once($pathtoroot.strtolower($mod_tmp_name) . $script_location . '/install/prerequisit.php'); } if ($result) { // prerequisit check is ok $url = $application->HREF('dummy', '_FRONT_END_', Array ('redirect' => 1, 'admin' => 1), $mod . $script_location . '/install.php'); $data['Url'] = '' . $status . ''; } else { // prerequisit check failed $show_errors = true; $url = $application->HREF('dummy', '', Array ('module' => strtolower($mod_tmp_name), 'is_new' => (int)$new_module), 'install/prerequisit_errors.php'); $data['Url'] = ''.$pre_error.''; } } else { $data['Url'] = ''.admin_language("la_module_not_licensed").''; } $data['Name'] = $mod_tmp_name; $objModList->AddItemFromArray($data); } $itemcount = $objModList->NumItems(); $title = admin_language("la_Text_Install")." ".admin_language("la_Text_Modules")." (".$itemcount.")"; $objListView = new clsListView(NULL,$objModList); $objListView->IdField = "Name"; $objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl"; $objListView->ColumnHeaders->Add("Name", admin_language("la_prompt_Available_Modules"),1,0,$order,"width=\"50%\"","Module_SortField","Module_SortOrder","Name"); $objListView->ColumnHeaders->Add("Url",admin_language("la_prompt_Install_Status"),1,0,$order,"width=\"50%\"","Module_SortField","Module_SortOrder","Version"); $objListView->ColumnHeaders->SetSort("Name",$order); $objListView->PrintToolBar = FALSE; $objListView->SearchBar = FALSE; $objListView->checkboxes= FALSE; $objListView->SearchAction=""; $objListView->CurrentPageVar = "Page_Modules"; $objListView->PerPageVar = "Perpage_Modules"; $objListView->CheckboxName = ""; $objListView->TotalItemCount = $itemcount; $objListView->SelectorType="none"; int_header(null,NULL,$title); ?>
PageLinks = $objListView->PrintPageLinks(); /* call this before we slice! */ $objListView->SliceItems(); print $objListView->PrintList(); ?>