Skip to content

Commit de2ef2f

Browse files
committed
GH-230 Move account activation info box to own component
1 parent ef2c939 commit de2ef2f

File tree

5 files changed

+47
-5
lines changed

5 files changed

+47
-5
lines changed

modules/overview/_includes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
include($includePath . './screens/FirstLogin/utils/effects/updateUserOnFirstLogin.effect.php');
2525
include($includePath . './screens/FirstLogin/utils/helpers/getReferrerTasksData.helper.php');
2626

27+
include($includePath . './screens/Overview/components/AccountActivationInfoBox/AccountActivationInfoBox.component.php');
2728
include($includePath . './screens/Overview/components/AdminAlerts/AdminAlerts.component.php');
2829
include($includePath . './screens/Overview/components/EmailChangeInfo/EmailChangeInfo.component.php');
2930
include($includePath . './screens/Overview/components/Morale/Morale.component.php');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace UniEngine\Engine\Modules\Overview\Screens\Overview\Components\AccountActivationInfoBox;
4+
5+
/**
6+
* @param array $props
7+
* @param arrayRef $props['user']
8+
*/
9+
function render($props) {
10+
global $_Lang;
11+
12+
if (isUserAccountActivated($props['user'])) {
13+
return [
14+
'componentHTML' => '',
15+
];
16+
}
17+
18+
$localTemplateLoader = createLocalTemplateLoader(__DIR__);
19+
20+
$componentHTML = parsetemplate(
21+
$localTemplateLoader('body'),
22+
$_Lang
23+
);
24+
25+
return [
26+
'componentHTML' => $componentHTML,
27+
];
28+
}
29+
30+
?>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<tr>
2+
<th class="c pad5 orange" colspan="3">
3+
{ActivationInfo_Text}
4+
</th>
5+
</tr>
6+
<tr>
7+
<th style="visibility: hidden;">&nbsp;</th>
8+
</tr>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
header("Location: ../index.php");
4+
5+
?>

overview.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,9 @@
6262
$parse['VacationModeBox'] = Overview\Screens\Overview\Components\VacationInfoBox\render([
6363
'user' => &$_User,
6464
])['componentHTML'];
65-
66-
// --- Activation Box
67-
if (!isUserAccountActivated($_User)) {
68-
$parse['ActivationInfoBox'] = '<tr><th class="c pad5 orange" colspan="3">'.$_Lang['ActivationInfo_Text'].'</th></tr><tr><th style="visibility: hidden;">&nbsp;</th></tr>';
69-
}
65+
$parse['ActivationInfoBox'] = Overview\Screens\Overview\Components\AccountActivationInfoBox\render([
66+
'user' => &$_User,
67+
])['componentHTML'];
7068

7169
// --- New User Protection Box
7270
if($_User['NoobProtection_EndTime'] > $Now)

0 commit comments

Comments
 (0)