| 40 | | $image = $CFG->wwwroot . "_files/icon.php?id=" . $file->ident . "&w=200&h=200"; |
|---|
| 41 | | $filepath = $CFG->wwwroot . user_info("username",$file->files_owner) . "/files/$folder->ident/$file->ident/" . urlencode($file->originalname); |
|---|
| 42 | | $image = "<a href=\"{$CFG->wwwroot}_files/icon.php?id={$file->ident}&w=500&h=500\" rel=\"lightbox[folder]\"><img src=\"$image\" /></a>"; |
|---|
| 43 | | $fileinfo = round(($file->size / 1048576),4) . "Mb"; |
|---|
| 44 | | $filelinks = file_edit_links($file); |
|---|
| 45 | | $uploaded = sprintf(__gettext("Uploaded on %s"),strftime("%A, %e %B %Y",$file->time_uploaded)); |
|---|
| 46 | | $keywords = display_output_field(array("","keywords","file","file",$file->ident,$file->owner)); |
|---|
| 47 | | $mimetype = mimeinfo('type',$file->originalname); |
|---|
| 48 | | |
|---|
| 49 | | if (empty($file->title)) { |
|---|
| 50 | | $file->title = __gettext("No title"); |
|---|
| 51 | | } |
|---|
| 53 | | if (substr_count($mimetype, "image") > 0) { |
|---|
| 54 | | $photo_html .= <<< END |
|---|
| | 43 | if (run("users:access_level_check",$file->access) == true) { |
|---|
| | 44 | |
|---|
| | 45 | $image = $CFG->wwwroot . "_files/icon.php?id=" . $file->ident . "&w=200&h=200"; |
|---|
| | 46 | $filepath = $CFG->wwwroot . user_info("username",$file->files_owner) . "/files/$folder->ident/$file->ident/" . urlencode($file->originalname); |
|---|
| | 47 | $image = "<a href=\"{$CFG->wwwroot}_files/icon.php?id={$file->ident}&w=500&h=500\" rel=\"lightbox[folder]\"><img src=\"$image\" /></a>"; |
|---|
| | 48 | $fileinfo = round(($file->size / 1048576),4) . "Mb"; |
|---|
| | 49 | $filelinks = file_edit_links($file); |
|---|
| | 50 | $uploaded = sprintf(__gettext("Uploaded on %s"),strftime("%A, %e %B %Y",$file->time_uploaded)); |
|---|
| | 51 | $keywords = display_output_field(array("","keywords","file","file",$file->ident,$file->owner)); |
|---|
| | 52 | $mimetype = mimeinfo('type',$file->originalname); |
|---|
| | 53 | |
|---|
| | 54 | if (empty($file->title)) { |
|---|
| | 55 | $file->title = __gettext("No title"); |
|---|
| | 56 | } |
|---|
| 56 | | <div class="photogallery-photo-container"> |
|---|
| 57 | | <div class="photogallery-photo-image"> |
|---|
| 58 | | $image |
|---|
| | 58 | if (substr_count($mimetype, "image") > 0) { |
|---|
| | 59 | $photo_html .= <<< END |
|---|
| | 60 | |
|---|
| | 61 | <div class="photogallery-photo-container"> |
|---|
| | 62 | <div class="photogallery-photo-image"> |
|---|
| | 63 | $image |
|---|
| | 64 | </div> |
|---|
| | 65 | <div class="photogallery-photo-info"> |
|---|
| | 66 | <h2 class="photogallery-photo-title"><a href="$filepath" >{$file->title}</a></h2> |
|---|
| | 67 | <p class="photogallery-photo-description"> |
|---|
| | 68 | {$file->description} |
|---|
| | 69 | </p> |
|---|
| | 70 | <p class="photogallery-photo-keywords"> |
|---|
| | 71 | {$keywords} |
|---|
| | 72 | </p> |
|---|
| | 73 | <p class="photogallery-photo-infobar"> |
|---|
| | 74 | {$uploaded}<br /> |
|---|
| | 75 | {$fileinfo} {$mimetype} {$filelinks} |
|---|
| | 76 | </p> |
|---|
| | 77 | </div> |
|---|
| 60 | | <div class="photogallery-photo-info"> |
|---|
| 61 | | <h2 class="photogallery-photo-title"><a href="$filepath" >{$file->title}</a></h2> |
|---|
| 62 | | <p class="photogallery-photo-description"> |
|---|
| 63 | | {$file->description} |
|---|
| 64 | | </p> |
|---|
| 65 | | <p class="photogallery-photo-keywords"> |
|---|
| 66 | | {$keywords} |
|---|
| 67 | | </p> |
|---|
| 68 | | <p class="photogallery-photo-infobar"> |
|---|
| 69 | | {$uploaded}<br /> |
|---|
| 70 | | {$fileinfo} {$mimetype} {$filelinks} |
|---|
| 71 | | </p> |
|---|
| | 79 | |
|---|
| | 80 | END; |
|---|
| | 81 | } else { |
|---|
| | 82 | $file_html .= <<< END |
|---|
| | 83 | |
|---|
| | 84 | <div class="photogallery-file-container"> |
|---|
| | 85 | <div class="photogallery-file-image"> |
|---|
| | 86 | <a href="{$filepath}">$image</a> |
|---|
| | 87 | </div> |
|---|
| | 88 | <div class="photogallery-file-info"> |
|---|
| | 89 | <h2 class="photogallery-file-title"><a href="{$filepath}">{$file->title}</a></h2> |
|---|
| | 90 | <p>{$file->description}</p> |
|---|
| | 91 | <p class="photogallery-file-keywords"> |
|---|
| | 92 | {$keywords} |
|---|
| | 93 | </p> |
|---|
| | 94 | <p class="photogallery-file-infobar"> |
|---|
| | 95 | {$uploaded}<br /> |
|---|
| | 96 | {$fileinfo} {$mimetype} {$filelinks} |
|---|
| | 97 | </p> |
|---|
| | 98 | </div> |
|---|
| 76 | | } else { |
|---|
| 77 | | $file_html .= <<< END |
|---|
| 78 | | |
|---|
| 79 | | <div class="photogallery-file-container"> |
|---|
| 80 | | <div class="photogallery-file-image"> |
|---|
| 81 | | <a href="{$filepath}">$image</a> |
|---|
| 82 | | </div> |
|---|
| 83 | | <div class="photogallery-file-info"> |
|---|
| 84 | | <h2 class="photogallery-file-title"><a href="{$filepath}">{$file->title}</a></h2> |
|---|
| 85 | | <p>{$file->description}</p> |
|---|
| 86 | | <p class="photogallery-file-keywords"> |
|---|
| 87 | | {$keywords} |
|---|
| 88 | | </p> |
|---|
| 89 | | <p class="photogallery-file-infobar"> |
|---|
| 90 | | {$uploaded}<br /> |
|---|
| 91 | | {$fileinfo} {$mimetype} {$filelinks} |
|---|
| 92 | | </p> |
|---|
| 93 | | </div> |
|---|
| 94 | | </div> |
|---|
| 95 | | |
|---|
| 96 | | END; |
|---|
| | 102 | } |
|---|