1 | <?php |
||
17 | class Listing extends Command |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Controller class instance |
||
22 | * @var \gplcart\core\Controller $controller |
||
23 | */ |
||
24 | protected $controller; |
||
25 | |||
26 | /** |
||
27 | * Command model class instance |
||
28 | * @var \gplcart\modules\file_manager\models\Command $command |
||
29 | */ |
||
30 | protected $command; |
||
31 | |||
32 | /** |
||
33 | * Listing constructor. |
||
34 | * @param CommandModel $command |
||
35 | */ |
||
36 | public function __construct(CommandModel $command) |
||
42 | |||
43 | /** |
||
44 | * Whether the command is allowed for the file |
||
45 | * @param \SplFileInfo $file |
||
46 | * @return bool |
||
47 | */ |
||
48 | public function allowed($file) |
||
52 | |||
53 | /** |
||
54 | * Returns an array of data used to display the command |
||
55 | * @param \SplFileInfo $file |
||
56 | * @param \gplcart\core\Controller $controller |
||
57 | * @return array |
||
58 | */ |
||
59 | public function view($file, $controller) |
||
84 | |||
85 | /** |
||
86 | * Returns an array of scanned and prepared files |
||
87 | * @param string $path |
||
88 | * @param array $params |
||
89 | * @return array |
||
90 | */ |
||
91 | protected function getFilesListing($path, array $params) |
||
96 | |||
97 | /** |
||
98 | * Prepares an array of scanned files |
||
99 | * @param array $files |
||
100 | * @return array |
||
101 | */ |
||
102 | protected function prepareFiles(array $files) |
||
129 | |||
130 | /** |
||
131 | * Returns a rendered icon for the given file extension and type |
||
132 | * @param array $item |
||
133 | * @return string |
||
134 | */ |
||
135 | protected function renderIcon(array $item) |
||
155 | |||
156 | } |
||
157 |