File tree Expand file tree Collapse file tree 6 files changed +83
-19
lines changed
screens/Overview/components/FeedbackMessagesDisplay Expand file tree Collapse file tree 6 files changed +83
-19
lines changed Original file line number Diff line number Diff line change 27
27
include ($ includePath . './screens/Overview/components/AccountActivationInfoBox/AccountActivationInfoBox.component.php ' );
28
28
include ($ includePath . './screens/Overview/components/AdminAlerts/AdminAlerts.component.php ' );
29
29
include ($ includePath . './screens/Overview/components/EmailChangeInfo/EmailChangeInfo.component.php ' );
30
+ include ($ includePath . './screens/Overview/components/FeedbackMessagesDisplay/FeedbackMessagesDisplay.component.php ' );
31
+ include ($ includePath . './screens/Overview/components/FeedbackMessagesDisplay/FeedbackMessagesDisplay.utils.php ' );
30
32
include ($ includePath . './screens/Overview/components/GiftItemsInfoBox/GiftItemsInfoBox.component.php ' );
31
33
include ($ includePath . './screens/Overview/components/Morale/Morale.component.php ' );
32
34
include ($ includePath . './screens/Overview/components/Morale/Morale.utils.php ' );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace UniEngine \Engine \Modules \Overview \Screens \Overview \Components \FeedbackMessagesDisplay ;
4
+
5
+ use UniEngine \Engine \Modules \Overview \Screens \Overview \Components \FeedbackMessagesDisplay ;
6
+
7
+ /**
8
+ * @param array $props
9
+ * @param arrayRef $props['input']
10
+ */
11
+ function render ($ props ) {
12
+ $ messages = FeedbackMessagesDisplay \Utils \getMessagesToDisplay ($ props );
13
+
14
+ if (empty ($ messages )) {
15
+ return [
16
+ 'componentHTML ' => '' ,
17
+ ];
18
+ }
19
+
20
+ $ localTemplateLoader = createLocalTemplateLoader (__DIR__ );
21
+ $ tplBodyCache = [
22
+ 'messageRow ' => $ localTemplateLoader ('messageRow ' ),
23
+ ];
24
+
25
+ $ parsedMessages = array_map_withkeys ($ messages , function ($ message ) use (&$ tplBodyCache ) {
26
+ return parsetemplate (
27
+ $ tplBodyCache ['messageRow ' ],
28
+ $ message
29
+ );
30
+ });
31
+
32
+ $ componentHTML = implode ('' , $ parsedMessages );
33
+
34
+ return [
35
+ 'componentHTML ' => $ componentHTML ,
36
+ ];
37
+ }
38
+
39
+ ?>
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace UniEngine \Engine \Modules \Overview \Screens \Overview \Components \FeedbackMessagesDisplay \Utils ;
4
+
5
+ /**
6
+ * @param array $props
7
+ * @param arrayRef $props['input']
8
+ */
9
+ function getMessagesToDisplay ($ props ) {
10
+ global $ _Lang ;
11
+
12
+ $ input = &$ props ['input ' ];
13
+
14
+ $ messages = [];
15
+
16
+ if (
17
+ !empty ($ input ['showmsg ' ]) &&
18
+ $ input ['showmsg ' ] == 'abandon '
19
+ ) {
20
+ $ messages [] = [
21
+ 'messageContent ' => $ _Lang ['Abandon_ColonyAbandoned ' ],
22
+ 'colorClass ' => 'lime ' ,
23
+ ];
24
+ }
25
+
26
+ return $ messages ;
27
+ }
28
+
29
+ ?>
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ header ("Location: ../index.php " );
4
+
5
+ ?>
Original file line number Diff line number Diff line change
1
+ <tr >
2
+ <th colspan =" 3" class =" pad5 { colorClass} " >
3
+ { messageContent}
4
+ </th >
5
+ </tr >
Original file line number Diff line number Diff line change 98
98
])['componentHTML ' ];
99
99
100
100
// --- System Messages Box -------------------------------------------------------------------------------
101
- if (!empty ($ _GET ['showmsg ' ]))
102
- {
103
- $ SysMsgLoop = 0 ;
104
- if ($ _GET ['showmsg ' ] == 'abandon ' )
105
- {
106
- $ ShowSystemMsg [$ SysMsgLoop ]['txt ' ] = $ _Lang ['Abandon_ColonyAbandoned ' ];
107
- $ ShowSystemMsg [$ SysMsgLoop ]['col ' ] = 'lime ' ;
108
- $ SysMsgLoop += 1 ;
109
- }
110
- }
111
-
112
- if (!empty ($ ShowSystemMsg ))
113
- {
114
- $ parse ['SystemMsgBox ' ] = '' ;
115
- foreach ($ ShowSystemMsg as $ SystemMsg )
116
- {
117
- $ parse ['SystemMsgBox ' ] .= '<tr><th colspan="3" class="pad5 ' .$ SystemMsg ['col ' ].'"> ' .$ SystemMsg ['txt ' ].'</th></tr> ' ;
118
- }
119
- }
101
+ $ parse ['SystemMsgBox ' ] = Overview \Screens \Overview \Components \FeedbackMessagesDisplay \render ([
102
+ 'input ' => &$ _GET ,
103
+ ])['componentHTML ' ];
120
104
121
105
// --- New Messages Information Box ----------------------------------------------------------------------
122
106
$ parse ['NewMsgBox ' ] = Overview \Screens \Overview \Components \NewMessagesInfo \render ([
You can’t perform that action at this time.
0 commit comments