Exemple #1
0
    //beides ist auch nicht erlaubt
    $gMessage->show($gL10n->get('SYS_INVALID_PAGE_VIEW'));
}
$gNavigation->addUrl(CURRENT_URL, $headline);
if (isset($_SESSION['download_request'])) {
    $form_values = strStripSlashesDeep($_SESSION['download_request']);
    unset($_SESSION['download_request']);
} else {
    $form_values['new_name'] = null;
    $form_values['new_description'] = null;
}
try {
    if ($getFileId) {
        // get recordset of current file from databse
        $file = new TableFile($gDb);
        $file->getFileForDownload($getFileId);
        $originalName = $file->getValue('fil_name');
        if ($form_values['new_name'] == null) {
            $form_values['new_name'] = admFuncGetFilenameWithoutExtension($originalName);
        }
        if ($form_values['new_description'] == null) {
            $form_values['new_description'] = $file->getValue('fil_description');
        }
    } else {
        // get recordset of current folder from databses
        $folder = new TableFolder($gDb);
        $folder->getFolderForDownload($getFolderId);
        $originalName = $folder->getValue('fol_name');
        if ($form_values['new_name'] == null) {
            $form_values['new_name'] = $originalName;
        }
 $sql = 'SELECT fil_timestamp, fil_name, fil_usr_id, fol_name, fol_path, fil_id, fil_fol_id
           FROM ' . TBL_FILES . ', ' . TBL_FOLDERS . '
          WHERE fil_fol_id = fol_id
          ORDER BY fil_timestamp DESC';
 $filesStatement = $gDb->query($sql);
 if ($filesStatement->rowCount() > 0) {
     $anzahl = 0;
     while ($plg_row = $filesStatement->fetchObject()) {
         $errorCode = '';
         $html = '';
         $timestampHtml = '';
         echo '<div class="btn-group-vertical" role="group">';
         try {
             // get recordset of current file from databse
             $file = new TableFile($gDb);
             $file->getFileForDownload($plg_row->fil_id);
         } catch (AdmException $e) {
             $errorCode = $e->getMessage();
             if ($errorCode !== 'DOW_FOLDER_NO_RIGHTS') {
                 $e->showText();
             }
         }
         // only show download if user has rights to view folder
         if ($errorCode !== 'DOW_FOLDER_NO_RIGHTS') {
             // Ermittlung der Dateiendung
             $fileExtension = mb_strtolower(substr($plg_row->fil_name, strrpos($plg_row->fil_name, '.') + 1), 'UTF-8');
             // Auszugebendes Icon ermitteln
             $iconFile = 'page_white_question.png';
             if (array_key_exists($fileExtension, $icon_file_extension)) {
                 $iconFile = $icon_file_extension[$fileExtension];
             }