Skip to content

Commit

Permalink
GH-230 Move account activation info box to own component
Browse files Browse the repository at this point in the history
  • Loading branch information
mdziekon committed Jul 12, 2022
1 parent ef2c939 commit de2ef2f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 5 deletions.
1 change: 1 addition & 0 deletions modules/overview/_includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
include($includePath . './screens/FirstLogin/utils/effects/updateUserOnFirstLogin.effect.php');
include($includePath . './screens/FirstLogin/utils/helpers/getReferrerTasksData.helper.php');

include($includePath . './screens/Overview/components/AccountActivationInfoBox/AccountActivationInfoBox.component.php');
include($includePath . './screens/Overview/components/AdminAlerts/AdminAlerts.component.php');
include($includePath . './screens/Overview/components/EmailChangeInfo/EmailChangeInfo.component.php');
include($includePath . './screens/Overview/components/Morale/Morale.component.php');
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace UniEngine\Engine\Modules\Overview\Screens\Overview\Components\AccountActivationInfoBox;

/**
* @param array $props
* @param arrayRef $props['user']
*/
function render($props) {
global $_Lang;

if (isUserAccountActivated($props['user'])) {
return [
'componentHTML' => '',
];
}

$localTemplateLoader = createLocalTemplateLoader(__DIR__);

$componentHTML = parsetemplate(
$localTemplateLoader('body'),
$_Lang
);

return [
'componentHTML' => $componentHTML,
];
}

?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<tr>
<th class="c pad5 orange" colspan="3">
{ActivationInfo_Text}
</th>
</tr>
<tr>
<th style="visibility: hidden;">&nbsp;</th>
</tr>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

header("Location: ../index.php");

?>
8 changes: 3 additions & 5 deletions overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@
$parse['VacationModeBox'] = Overview\Screens\Overview\Components\VacationInfoBox\render([
'user' => &$_User,
])['componentHTML'];

// --- Activation Box
if (!isUserAccountActivated($_User)) {
$parse['ActivationInfoBox'] = '<tr><th class="c pad5 orange" colspan="3">'.$_Lang['ActivationInfo_Text'].'</th></tr><tr><th style="visibility: hidden;">&nbsp;</th></tr>';
}
$parse['ActivationInfoBox'] = Overview\Screens\Overview\Components\AccountActivationInfoBox\render([
'user' => &$_User,
])['componentHTML'];

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

0 comments on commit de2ef2f

Please sign in to comment.