4
4
5
5
class HTML extends Class_ {
6
6
public function __construct () {
7
- global $ folders ;
8
-
9
7
parent ::__construct (self ::class);
10
-
11
- $ this -> folders = $ folders ;
12
8
}
13
9
14
10
public static function Element ($ element , $ text = "" , $ attributes = "" , $ class = "" , $ tab = []) {
@@ -41,7 +37,10 @@ public static function Element($element, $text = "", $attributes = "", $class =
41
37
$ tabs ["text " ] .= "\t\t" ;
42
38
}
43
39
44
- if (isset ($ tab ["one " ]) == False and in_array ($ element , $ self_closing_elements ) == True ) {
40
+ if (
41
+ isset ($ tab ["one " ]) == False and
42
+ in_array ($ element , $ self_closing_elements ) == True
43
+ ) {
45
44
if (isset ($ tab ["tab " ]) == False ) {
46
45
$ tabs ["first " ] .= "\t" ;
47
46
}
@@ -53,7 +52,10 @@ public static function Element($element, $text = "", $attributes = "", $class =
53
52
54
53
$ tabs ["text_less_one " ] = substr_replace ($ tabs ["text " ], "" , -1 );
55
54
56
- if (isset ($ tab ["tab " ]) == True and substr_count ($ tab ["tab " ], "\t" ) == 2 ) {
55
+ if (
56
+ isset ($ tab ["tab " ]) == True and
57
+ substr_count ($ tab ["tab " ], "\t" ) == 2
58
+ ) {
57
59
$ tabs ["text_less_one " ] = $ tabs ["text " ];
58
60
}
59
61
@@ -100,7 +102,7 @@ public static function Image($source, $class = "", $attributes = "") {
100
102
global $ website ;
101
103
102
104
if ($ class == "" ) {
103
- $ class = $ website ["data " ]["style " ]["img " ]["theme " ]["dark " ]." " .$ website ["style " ]["box_shadow " ]["theme " ]["light " ];
105
+ $ class = $ website ["Data " ]["Style " ]["img " ]["theme " ]["dark " ]." " .$ website ["Style " ]["box_shadow " ]["theme " ]["light " ];
104
106
}
105
107
106
108
return HTML ::Element ("img " , "" , 'src=" ' .$ source .'" ' .$ attributes , $ class );
@@ -135,15 +137,15 @@ function ($key) {
135
137
public static function Button ($ text = "" , $ attributes = "" , $ class = "" , $ heading = "h3 " ) {
136
138
global $ website ;
137
139
138
- $ class = $ website ["style " ]["button " ]["theme " ]["light " ].$ class ;
140
+ $ class = $ website ["Style " ]["button " ]["theme " ]["light " ].$ class ;
139
141
140
142
$ text_attributes = "" ;
141
143
142
144
if ($ heading == "h3 " ) {
143
145
$ text_attributes = 'style="font-weight: bold;" ' ;
144
146
}
145
147
146
- $ text = HTML ::Element ($ heading , "\n\t\t" .$ text ."\n\t\t" , $ text_attributes , "text_size " .$ website ["style " ]["text " ]["theme " ]["dark " ])."\n" ;
148
+ $ text = HTML ::Element ($ heading , "\n\t\t" .$ text ."\n\t\t" , $ text_attributes , "text_size " .$ website ["Style " ]["text " ]["theme " ]["dark " ])."\n" ;
147
149
148
150
$ button = "\n\n\t" .HTML ::Element ("button " , "\n\t\t" .$ text ."\t" , $ attributes , "w3-btn " .$ class );
149
151
@@ -164,7 +166,7 @@ public static function Tab_Button($tab) {
164
166
}
165
167
166
168
$ button = '<!-- " ' .$ tab ["name " ].'" button --> ' ."\n" .
167
- "\t" .'<span id="button_ ' .($ i + 1 ).'" class="tab_button"> ' ."\n\t\t" .self ::Button ("\n\t\t\t\t" .$ tab ["name_icon " ]."\n\t\t\t" , ' onclick="Open_Tab( \'' .strtolower ($ tab ["id " ]).'\');" style="border-radius: 50px; ' .$ tab ["button_style " ].'" ' , "w3-btn " .$ website ["style " ]["button " ]["theme " ]["light " ].$ tab ["button_class " ], "h2 " )."\n\t" ."</span> " ;
169
+ "\t" .'<span id="button_ ' .($ i + 1 ).'" class="tab_button"> ' ."\n\t\t" .self ::Button ("\n\t\t\t\t" .$ tab ["name_icon " ]."\n\t\t\t" , ' onclick="Open_Tab( \'' .strtolower ($ tab ["id " ]).'\');" style="border-radius: 50px; ' .$ tab ["button_style " ].'" ' , "w3-btn " .$ website ["Style " ]["button " ]["theme " ]["light " ].$ tab ["button_class " ], "h2 " )."\n\t" ."</span> " ;
168
170
169
171
return $ button ;
170
172
}
@@ -174,21 +176,21 @@ public static function Generate_Buttons() {
174
176
global $ Language ;
175
177
global $ i ;
176
178
177
- $ show_text = HTML ::Element ("h2 " , "\n\t\t" .$ website ["icons " ]["bars " ]."\n\t" , "" , "text_size " )."\n" ;
179
+ $ show_text = HTML ::Element ("h2 " , "\n\t\t" .$ website ["Icons " ]["bars " ]."\n\t" , "" , "text_size " )."\n" ;
178
180
$ hide_text = HTML ::Element ("h4 " , "\n\t\t" ."X " ."\n\t\t" , 'style="font-weight: bold;" ' , "text_size " )."\n" ;
179
181
180
- $ border_color = $ website ["style " ]["border_color " ];
182
+ $ border_color = $ website ["Style " ]["border_color " ];
181
183
182
184
$ buttons = [
183
185
"list " => [],
184
186
185
187
"hamburger_menu " => "\n" ."<!-- Open hamburger menu button --> " ."\n" .
186
- HTML ::Element ("button " , "\n\t" .$ show_text , 'id="hamburger_menu_button" onclick="Show_Hamburger_Menu();" style="position: fixed; left: 0%;" ' , "w3-btn " .$ website ["style " ]["button " ]["theme " ]["light " ]." w3-animate-zoom " )."\n" .
188
+ HTML ::Element ("button " , "\n\t" .$ show_text , 'id="hamburger_menu_button" onclick="Show_Hamburger_Menu();" style="position: fixed; left: 0%;" ' , "w3-btn " .$ website ["Style " ]["button " ]["theme " ]["light " ]." w3-animate-zoom " )."\n" .
187
189
"\n" ."<!--- Hamburger menu --> " ."\n" .
188
- '<div id="hamburger_menu" class="w3-container w3-animate-left ' .$ website ["style " ]["background " ]["theme " ]["normal " ]." " .$ website ["style " ]["border_4px " ]["theme " ][$ border_color ]." " .$ website ["style " ]["border_radius " ].'" style="padding: 1%; position: fixed; display: none;"> ' ."\n\n" .
190
+ '<div id="hamburger_menu" class="w3-container w3-animate-left ' .$ website ["Style " ]["background " ]["theme " ]["normal " ]." " .$ website ["Style " ]["border_4px " ]["theme " ][$ border_color ]." " .$ website ["Style " ]["border_radius " ].'" style="padding: 1%; position: fixed; display: none;"> ' ."\n\n" .
189
191
"\t" .'<!-- Hide hamburger menu button --> ' ."\n" .
190
- "\t" .HTML ::Element ("button " , "\n\t\t" .$ hide_text ."\t" , ' onclick="Hide_Hamburger_Menu();" style="float: right; padding: 2px 14px 3px 14px !important;" ' , "w3-btn " .$ website ["style " ]["button " ]["theme " ]["light " ])."\n\n" .
191
- "\t" .HTML ::Element ("h2 " , $ website ["language_texts " ]["tab_menu " ].": " , 'style="font-weight: bold;" ' , "text_size " .$ website ["style " ]["text_highlight " ])."\n\n" .
192
+ "\t" .HTML ::Element ("button " , "\n\t\t" .$ hide_text ."\t" , ' onclick="Hide_Hamburger_Menu();" style="float: right; padding: 2px 14px 3px 14px !important;" ' , "w3-btn " .$ website ["Style " ]["button " ]["theme " ]["light " ])."\n\n" .
193
+ "\t" .HTML ::Element ("h2 " , $ website ["Language texts " ]["tab_menu " ].": " , 'style="font-weight: bold;" ' , "text_size " .$ website ["Style " ]["text_highlight " ])."\n\n" .
192
194
"\t" ."<br /> " ."\n\n" .
193
195
'<div style="overflow-y: auto; overflow-x: hidden; max-height: 80vh;"> ' ."\n"
194
196
];
@@ -216,7 +218,7 @@ public static function Generate_Buttons() {
216
218
foreach ($ buttons ["list " ] as $ button ) {
217
219
$ buttons ["hamburger_menu " ] .= "\t" .$ button ;
218
220
219
- if ($ button != array_reverse ($ buttons ["list " ])[ 0 ] ) {
221
+ if ($ button != end ($ buttons ["list " ])) {
220
222
$ buttons ["hamburger_menu " ] .= "\n\n" ;
221
223
}
222
224
}
@@ -292,7 +294,7 @@ public static function Generate_Buttons_List($tab = [], $remove = "", $center =
292
294
$ string .= $ tab ["button " ];
293
295
}
294
296
295
- $ string .= $ website ["elements " ]["hr_1px " ]["theme " ][$ website ["style " ]["border_color " ]];
297
+ $ string .= $ website ["elements " ]["hr_1px " ]["theme " ][$ website ["Style " ]["border_color " ]];
296
298
297
299
if ($ center == True ) {
298
300
$ string .= "</center> " ;
@@ -332,7 +334,7 @@ public static function Tab_Info($tab, $i) {
332
334
# If file is empty, use empty message text
333
335
if ($ contents ["lines " ] == []) {
334
336
if (isset ($ tab ["empty_message " ]) == False ) {
335
- $ tab ["empty_message " ] = $ website ["language_texts " ]["this_file_does_not_exist_{} " ];
337
+ $ tab ["empty_message " ] = $ website ["Language texts " ]["this_file_does_not_exist_{} " ];
336
338
}
337
339
338
340
$ tab ["content " ] = $ tab ["empty_message " ];
@@ -344,7 +346,7 @@ public static function Tab_Info($tab, $i) {
344
346
}
345
347
346
348
else {
347
- $ tab ["content " ] = self ::Element ("span " , $ tab ["content " ], "" , $ website ["data " ]["style " ]["text_highlight " ]);
349
+ $ tab ["content " ] = self ::Element ("span " , $ tab ["content " ], "" , $ website ["Data " ]["Style " ]["text_highlight " ]);
348
350
}
349
351
350
352
# Define tab name in the user language
@@ -368,19 +370,22 @@ public static function Tab_Info($tab, $i) {
368
370
# Define title if it is not present
369
371
if (isset ($ tab ["title " ]) == False ) {
370
372
if (str_contains ($ tab ["name " ], ": " ) == False ) {
371
- $ tab ["title " ] = $ tab ["name " ].": " .$ website ["icons " ][$ tab ["icon " ]];
373
+ $ tab ["title " ] = $ tab ["name " ].": " .$ website ["Icons " ][$ tab ["icon " ]];
372
374
}
373
375
374
376
if (str_contains ($ tab ["name " ], ": " ) == True ) {
375
- $ tab ["title " ] = $ tab ["name " ].": " .$ website ["icons " ][$ tab ["icon " ]];
377
+ $ tab ["title " ] = $ tab ["name " ].": " .$ website ["Icons " ][$ tab ["icon " ]];
376
378
}
377
379
}
378
380
379
- $ tab ["name_icon " ] = $ tab ["name " ].": " .$ website ["icons " ][$ tab ["icon " ]];
381
+ $ tab ["name_icon " ] = $ tab ["name " ].": " .$ website ["Icons " ][$ tab ["icon " ]];
380
382
381
383
# Define tab content with content file
382
- if (isset ($ tab ["content " ]) == False and isset ($ tab ["template " ]) == False ) {
383
- $ tab ["content_file " ] = $ website ["data " ]["folders " ]["php " ]["tabs " ].($ i + 1 ).".php " ;
384
+ if (
385
+ isset ($ tab ["content " ]) == False and
386
+ isset ($ tab ["template " ]) == False
387
+ ) {
388
+ $ tab ["content_file " ] = $ website ["Data " ]["Folders " ]["PHP " ]["Tabs " ].($ i + 1 ).".php " ;
384
389
385
390
if (file_exists ($ tab ["content_file " ]) == False ) {
386
391
$ File -> Edit ($ tab ["content_file " ], "<?php " ."\n\n\n\n" ."?> " , "w " );
@@ -450,14 +455,14 @@ public static function Generate_Tabs($tabs_data = Null, $buttons = True, $all_bu
450
455
$ tab = self ::Tab_Info ($ tab , $ tabs ["ID " ]);
451
456
452
457
# Define CSS class
453
- $ tab ["class " ] = $ website ["style " ]["tab " ]["black " ];
458
+ $ tab ["class " ] = $ website ["Style " ]["tab " ]["black " ];
454
459
455
460
if (isset ($ tab ["content " ]) == True ) {
456
461
$ tab ["content " ] .= "\n" ;
457
462
}
458
463
459
464
# Generate the tab HTML
460
- $ tab ["content " ] = "<center> " .self ::Tab ($ tab )."</center> " ;
465
+ $ tab ["content " ] = "<center> " ."\n\n" . self ::Tab ($ tab ). "\n\n" ."</center> " ;
461
466
462
467
# Add tab to the tabs array
463
468
array_push ($ tabs ["List " ], $ tab ["name " ]);
0 commit comments