1 | <?php |
||
18 | class Download extends Controller |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Install model instance |
||
23 | * @var \gplcart\modules\installer\models\Install $install |
||
24 | */ |
||
25 | protected $install_model; |
||
26 | |||
27 | /** |
||
28 | * @param Install $install |
||
29 | */ |
||
30 | public function __construct(Install $install) |
||
36 | |||
37 | /** |
||
38 | * Route page callback to display the module download page |
||
39 | */ |
||
40 | public function editDownload() |
||
41 | { |
||
42 | $this->downloadErrorsDownload(); |
||
43 | $this->setTitleEditDownload(); |
||
44 | $this->setBreadcrumbEditDownload(); |
||
45 | |||
46 | $this->submitDownload(); |
||
47 | |||
48 | $sources = $this->getData('download.sources'); |
||
49 | |||
50 | if (is_array($sources)) { |
||
51 | $this->setData('download.sources', implode(PHP_EOL, $sources)); |
||
52 | } |
||
53 | |||
54 | $this->outputEditDownload(); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Set title on the module download page |
||
59 | */ |
||
60 | protected function setTitleEditDownload() |
||
61 | { |
||
62 | $title = $this->text('Edit %name settings', array('%name' => $this->text('Installer'))); |
||
63 | $this->setTitle($title); |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * Set breadcrumbs on the module download page |
||
68 | */ |
||
69 | protected function setBreadcrumbEditDownload() |
||
85 | |||
86 | /** |
||
87 | * Downloads an error log file |
||
88 | */ |
||
89 | protected function downloadErrorsDownload() |
||
97 | |||
98 | /** |
||
99 | * Handles submitted data |
||
100 | */ |
||
101 | protected function submitDownload() |
||
108 | |||
109 | /** |
||
110 | * Validate an array of submitted data |
||
111 | */ |
||
112 | protected function validateDownload() |
||
121 | |||
122 | /** |
||
123 | * Validates an array of submitted source URLs |
||
124 | */ |
||
125 | protected function validateUrlDownload() |
||
140 | |||
141 | /** |
||
142 | * Render and output the download modules page |
||
143 | */ |
||
144 | protected function outputEditDownload() |
||
148 | |||
149 | } |
||
150 |