-
Notifications
You must be signed in to change notification settings - Fork 2
/
Module.class.php
executable file
·38 lines (29 loc) · 1.05 KB
/
Module.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
Class Module {
public $output;
public function __construct($model) {
$this->model = $model;
}
function run() {
try {
$this->output.= '<div class="sectionHeader">Название страницы модуля</div>
<div class="sectionBody">
<div style="display: inline-block; width:100%;">';
$this->actions();
$this->output.= $this->model->getModuleData();
$this->output.= '</div></div>';
return $this->output;
} catch (Exception $e) {
if($e->getCode()==1) {
return ModuleController::message('Ошибка', $e->getMessage(), 'error', true);
}else
return ModuleController::message('Сообщение', $e->getMessage(), 'warning', false).$this->output;
}
}
function actions() {
if (isset($_GET['action']) && $_GET['action'] == 1) {
$this->output.='1';
}
}
}
?>