document.getElementById('wikiedit').innerHTML = \"
Click to Load Attachment List...
\"+document.getElementById('wikiedit').innerHTML; function LoadFileList() { document.getElementById('attachlist').innerHTML = '

Loading...

'; var req = document.createElement('SCRIPT'); req.type = 'text/javascript'; req.src = \"?action=jsfilelist\"; document.body.appendChild(req); } "; } if ($action == "jsfilelist") { header("Content-Type: text/javascript"); $uploaddir = FmtPageName("$jsflUploadDir$UploadPrefixFmt", $pagename); $dirp = @opendir($uploaddir); ## No Folder if (!$dirp) { echo "document.getElementById('attachlist').innerHTML = \"There are no Attachment for this page, you can still Attach: from other pages.\"; document.getElementById('attachlist').onclick = null;"; exit; } $filelist = array(); while (($file=readdir($dirp)) !== false) { if ($file{0} == '.') continue; if (@$matchext && !preg_match(@$matchext, $file)) continue; $filelist[$file] = $file; } closedir($dirp); $out = array(); $out[] = ""; #$out[] = ""; if(preg_match("/Firefox/", $_SERVER['HTTP_USER_AGENT'])) { $out[] = "
"; $out[] = ""; $out[] = "
"; } echo "document.getElementById('attachlist').innerHTML = \"" . implode('', $out) . "\"; document.getElementById('attachlist').onclick = null;"; exit; }