array(), 'utt-dict' => array() ); $dn = "files/"; if ($dh = opendir($dn)) { while (($file = readdir($dh)) !== false) { if(true == is_file($dn.$file)) { if(preg_match('/^utt\-dict\-.+?\.(.+)$/', $file, $dopasowania)) { $arch_type = $dopasowania[1]; if(! array_key_exists($arch_type, $archiwa['utt-dict'])) { $archiwa['utt-dict'][$arch_type] = array(); } $archiwa['utt-dict'][$arch_type][] = $file; } else if(preg_match('/^utt\-\d.+?\.(.+)$/', $file, $dopasowania)) { $arch_type = $dopasowania[1]; if(! array_key_exists($arch_type, $archiwa['utt'])) { $archiwa['utt'][$arch_type] = array(); } $archiwa['utt'][$arch_type][] = $file; } } // if is file } // while closedir($dh); } // if opendir //print_r($archiwa); $title = 'UAM Text Tools - '.DOWNLOAD_SELECTFILE_PAGE_TITLE."\n"; $content = "

".DOWNLOAD_SELECTFILE_CAPTION.":

\n"; $content .= ''; # aplikacja $content .= '\n"; $content .= '\n"; $content .= '
'.DOWNLOAD_SELECTFILE_APP_CAPTION."
'; if(count(array_keys($archiwa['utt'])) > 0) { $content .= ''; $content .= "\n"; foreach (array_keys($archiwa['utt']) as $dist_type) { $content .= '\n"; $content .= "\n"; } $content .= "
'.DOWNLOAD_SELECTFILE_DISTRIBUTION_TYPE." $dist_type 
\n"; $arr = $archiwa['utt'][$dist_type]; rsort($arr); foreach($arr as $app) { $content .= "\n\n"; } $content .= "
\n"; $content .= ""; $content .= ""; $content .= $app." (".(filesize($dn.$app)/1024)." KB)\n"; $content .= "
\n
\n"; } else { $content .= DOWNLOAD_SELECTFILE_NO_FILE."\n"; } # slowniki $content .= '
'.DOWNLOAD_SELECTFILE_DICT_CAPTION."
'; if(count(array_keys($archiwa['utt-dict'])) > 0) { $content .= ''; $content .= "\n"; foreach (array_keys($archiwa['utt-dict']) as $dist_type) { $content .= '\n"; $content .= "\n"; } $content .= "
'.DOWNLOAD_SELECTFILE_DISTRIBUTION_TYPE." $dist_type 
\n"; $arr = $archiwa['utt-dict'][$dist_type]; rsort($arr); foreach($arr as $dict) { $content .= "\n\n"; } $content .= "
\n"; $content .= ""; $content .= ""; $content .= $dict." (".(filesize($dn.$dict)/1024)." KB)\n"; $content .= "
\n
\n"; } else { $content .= DOWNLOAD_SELECTFILE_NO_FILE."\n"; } $content .= '
'; $content .= "\n"; getMainPage($title, $content); ?>