1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Modules\Files;
13
14 use ICanBoogie\I18n;
15 use ICanBoogie\Uploaded;
16
17 use Brickrouge\Element;
18
19 class FileUpload extends \Brickrouge\File
20 {
21 protected function infos()
22 {
23 $path = $this['value'];
24 $details = $this->details($path);
25 $preview = $this->preview($path);
26
27 $rc = '';
28
29 if ($preview)
30 {
31 $rc .= '<div class="preview">';
32 $rc .= $preview;
33 $rc .= '</div>';
34 }
35
36 if ($details)
37 {
38 $rc .= '<ul class="details">';
39
40 foreach ($details as $detail)
41 {
42 $rc .= '<li>' . $detail . '</li>';
43 }
44
45 $rc .= '</ul>';
46 }
47
48 return $rc;
49 }
50
51 protected function preview($path)
52 {
53 $rc = '<a class="icon-download-alt" href="' . $path . '" title="' . I18n\t('download', array(), array('scope' => array('fileupload', 'element'))) . '"></a>';
54
55 return $rc;
56 }
57 }