-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform_helpdom.php
96 lines (52 loc) · 2.78 KB
/
form_helpdom.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
//form help
require_once "help_txt.php";
$form_help = new MyFormDom($htd->get_dom(), "form_gen", $_SERVER['REQUEST_URI']);
$form_help->add_text_element('h1', 'QComb v1.1');
$h_header = $form_help->add_text_element('h2', 'Help');
$h_header->setAttribute("style", "position:relative; left:140px; font-weight:bold;");
$form_help_init = function($form) {
$form->add_form_page_title("QComb v1.1 - HELP");
}; //closure
$form_help->set_init_callable($form_help_init);
$help_ordered_list = $form_help->add_sametype_element("ol", "help_ordered_list");
$num_list = [];
foreach ($item_list as $num_item) {
$num_list[] = $num_item[0];
}
$form_help->add_children_from_array("help_ordered_list", "li", $num_list, false, "b");
foreach ($help_ordered_list->childNodes as $k=>$num_li) {
$help_unordered_list = $form_help->add_sametype_element("ul", "help_unordered_list".$k);
$form_help->add_children_from_array("help_unordered_list".$k, "li", $item_list[$k][1], false);
foreach ($item_list[$k][1] as $j=>$unumline) {
if (substr($unumline, 0, 1) === '^') {
$style_el = $form_help->set_child_attr_by_chindex("help_unordered_list".$k, "li", $j, "style", "list-style-type:none;");
$form_help->el_replace_inner_text($style_el, preg_replace('/^\^{1}/', '',$unumline));
}
if (substr($unumline, 0, 1) === '=') {
$style_el = $form_help->set_child_attr_by_chindex("help_unordered_list".$k, "li", $j, "style", "list-style-type:none; padding-left: 1.5em;");
preg_match('/\*.+\"/', $unumline, $mtar);
$first_bold = $style_el->appendChild($form_help->get_dom()->createElement("b"));
$form_help->set_inner_text($first_bold, $mtar[0]);
$form_help->el_replace_inner_text($style_el, preg_replace('/^={1}\*.+\"/', '',$unumline));
} //if substr
//link
$unumline_ar = explode(':;', $unumline);
if (count($unumline_ar) > 1) {
$link_el = $form_help->get_child_el_by_chindex("help_unordered_list".$k, "li", $j);
$form_help->el_replace_inner_text($link_el, "");
foreach ($unumline_ar as $n=>$unuml_part) {
if (!($n % 2)) {$form_help->set_inner_text($link_el, $unuml_part);}
else {
$link = $form_help->add_text_element('a', $unuml_part);
$link->setAttribute('href', '');
$link->setAttribute('onclick', 'newlinkOpen("' . $unuml_part . '"); return false;'); //false - not to refresh parent
//my res: 1920x1080
$link_el->appendChild($link);
} //if else
} //foreach
} //if count
} //foreach $item_list
$num_li->appendChild($help_unordered_list);
}
?>