1
|
<?php
|
2
|
|
3
|
require_once('./inc/all.inc.php');
|
4
|
|
5
|
|
6
|
|
7
|
//zobrazeni
|
8
|
$tpl = & new Template(INDEX_TMPL);
|
9
|
|
10
|
//prvni krok
|
11
|
if ( Empty($_POST['actionButton']) || $_POST['actionButton'] == $sec_button_label_back ) {
|
12
|
|
13
|
$body = & new Template('./tmpl/insert-new-text.tmpl.php');
|
14
|
|
15
|
//pole pro selecty
|
16
|
$body->set('object_type_array', utils_get_object_types());
|
17
|
$body->set('surface_type_array', utils_get_surface_types());
|
18
|
//nazvy buttonu
|
19
|
$body->set('first_button_label', $first_button_label);
|
20
|
//znovu zobrazene promenne
|
21
|
$body->set('POST', $_POST);
|
22
|
|
23
|
}
|
24
|
//druhy krok
|
25
|
else if (!Empty($_POST['actionButton']) && $_POST['actionButton'] == $first_button_label) {
|
26
|
$body = & new Template('./tmpl/preview.tmpl.php');
|
27
|
//pole pro selecty
|
28
|
$body->set('object_type_array', utils_get_object_types());
|
29
|
$body->set('surface_type_array', utils_get_surface_types());
|
30
|
$body->set('book_type_array', utils_get_book_types());
|
31
|
$body->set('book_array', utils_get_books());
|
32
|
$body->set('museum_array', utils_get_museums());
|
33
|
$body->set('origin_array', utils_get_origins());
|
34
|
//nazvy buttonu
|
35
|
$body->set('sec_button_label', $sec_button_label);
|
36
|
$body->set('sec_button_label_back', $sec_button_label_back);
|
37
|
//znovu zobrazene promenne
|
38
|
$body->set('POST', $_POST);
|
39
|
}
|
40
|
//treti krok
|
41
|
else if (!Empty($_POST['actionButton']) && $_POST['actionButton'] == $sec_button_label) {
|
42
|
//aplikacni logika
|
43
|
$body = & new Template('./logic/insert-new-text.logic.php');
|
44
|
//pole pro selecty
|
45
|
$body->set('object_type_array', utils_get_object_types());
|
46
|
$body->set('surface_type_array', utils_get_surface_types());
|
47
|
$body->set('POST', $_REQUEST);
|
48
|
}
|
49
|
else {
|
50
|
//empty
|
51
|
}
|
52
|
|
53
|
$tpl->set('obsah', $body);
|
54
|
|
55
|
echo $tpl->fetch(INDEX_TMPL);
|
56
|
|
57
|
//p_g($_POST);
|
58
|
?>
|