RemositoryBasicFunctionURL('search'); $ordername = array ('zero', _DOWN_ID, _DOWN_FILE_TITLE_SORT, _DOWN_DOWNLOADS_SORT, _DOWN_SUB_DATE_SORT, _DOWN_SUB_ID_SORT, _DOWN_AUTHOR_ABOUT, _DOWN_RATING_TITLE); for ($by = 1, $n=count($ordername); $by < $n; $by++) { if ($orderby<>$by) $option[] = <<{$ordername[$by]} SORT_OPTION; else $option[] = $ordername[$by]; } $sortlist = implode (' | ', $option); return <<

$downfiles

$downorder $sortlist LIST_HEADING; } private function displayContainer ($container, $func) { $icon = $container->icon ? $this->repository->RemositoryImageURL('folder_icons/folder_yellow.gif') : $this->repository->RemositoryImageURL('folder_icons/'.$container->icon); $name = htmlspecialchars($container->name); return <<

$icon $name

{$this->displayFolderCounts($container)} {$this->displayDescription($container)} {$this->displayAllSubcontainers($container, $func)} SHOW_CONTAINER; } private function displayFolderCounts ($container) { if (is_object($container) AND $this->repository->Show_File_Folder_Counts) return << ($container->foldercount/$container->filecount) FOLDER_COUNTS; } private function displayDescription ($container) { if ($container->description) return << $container->description A_DESCRIPTION; } private function displaySubContainer ($child, $func, $stripe) { // May be called with null subcontainer to even up the columns if (is_object($child)) { $name = ' '.htmlspecialchars($child->name); $link = $this->repository->RemositoryFunctionURL($func, $child->id).$name.''; } else $link = ''; // Organise two column layout, use alternate columns if ('odd' == $oddness) return << $link {$this->displayFolderCounts($child)} ODD_PART; else return << $link {$this->displayFolderCounts($child)} EVEN_PART; } private function displayAllSubContainers ($folder, $func) { $html = ''; // Check configuration option for showing sub containers if ($this->repository->Show_SubCategories) { $children = $folder->getChildren(); $i = 0; foreach ($children as $child) { // Check whether this is an odd or even item $oddness = ($i++ % 2) ? 'even' : 'odd'; $html .= $this->displaySubContainer($child, $func, $oddness); } // Make sure we have an even number of calls in total if ('odd' == $oddness) $html .= $this->displaySubContainer(null, $func, 'even'); return << $html ALL_SUBCONTAINERS; } } public function fileListHTML( $id, $container, $folders, $files, $page, $func, $directlink ) { if ($container->id) { $container->setMetaData(); $container->showCMSPathway(); $this->pathwayHTML($container->getParent()); } $this->mainPageHeading($container->id); if ($container->id) $this->folderListHeading($container); if ($folders){ $title = _DOWN_CONTAINERS; $ff = _DOWN_FOLDERS_FILES; echo "\n\t
"; echo "\n\t\t"; echo "\n\t\t"; echo "\n\t\t\t"; if ($this->repository->Show_File_Folder_Counts) echo "\n\t\t\t"; echo "\n\t\t"; foreach ($folders as $folder) { $i = 0; echo $this->displayContainer($folder, $func); $this->tabcnt = ($this->tabcnt+1) % 2; } echo "\n\t\t
$title$ff
"; echo "\n\t"; echo "\n\t
\n"; } if ($files){ $this->tabcnt = 0; $downlogo = $this->repository->RemositoryImageURL('download_trans.gif'); echo $this->fileListHeading($this->orderby, $id, $func); $page->showNavigation(); echo "\n\t
"; foreach ($files as $file) { $this->fileListing ($file, $container, $downlogo, $this->remUser, false, 'A', $directlink); $this->tabcnt = ($this->tabcnt+1) % 2; } echo "\n\t"; echo "\n\t
\n"; $page->showNavigation(); ?> filesFooterHTML (); $this->remositoryCredits(); } public function emptyHTML () { $mosConfig_sitename = remositoryInterface::getInstance()->getCfg('sitename'); echo <<

{$this->show(_DOWN_EMPTY_REPOSITORY)}

{$this->showHTML(_DOWN_NO_CATS)}

EMPTY_HTML; } }