-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-230 Move vacation box to its own component
- Loading branch information
Showing
5 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
modules/overview/screens/Overview/components/VacationInfoBox/VacationInfoBox.component.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace UniEngine\Engine\Modules\Overview\Screens\Overview\Components\VacationInfoBox; | ||
|
||
/** | ||
* @param array $props | ||
* @param arrayRef $props['user'] | ||
*/ | ||
function render($props) { | ||
global $_Lang; | ||
|
||
if (!isOnVacation($props['user'])) { | ||
return [ | ||
'componentHTML' => '', | ||
]; | ||
} | ||
|
||
$localTemplateLoader = createLocalTemplateLoader(__DIR__); | ||
|
||
$componentHTML = parsetemplate( | ||
$localTemplateLoader('body'), | ||
$_Lang | ||
); | ||
|
||
return [ | ||
'componentHTML' => $componentHTML, | ||
]; | ||
} | ||
|
||
?> |
8 changes: 8 additions & 0 deletions
8
modules/overview/screens/Overview/components/VacationInfoBox/body.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<tr> | ||
<th class="c pad5 orange" colspan="3"> | ||
{VacationModeBox_Text} | ||
</th> | ||
</tr> | ||
<tr> | ||
<th style="visibility: hidden;"> </th> | ||
</tr> |
5 changes: 5 additions & 0 deletions
5
modules/overview/screens/Overview/components/VacationInfoBox/index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
header("Location: ../index.php"); | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters