Skip to content
Snippets Groups Projects
Commit e3f61de1 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fix display of portal plugins for nobody and set function as deprecated, fixes #2051

Closes #2051

Merge request studip/studip!1330
parent 31a81f95
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,23 @@ PageLayout::setTabNavigation(NULL); // disable display of tabs
include 'lib/include/html_head.inc.php'; // Output of html head
include 'lib/include/header.php';
// Prüfen, ob PortalPlugins vorhanden sind.
// TODO: Remove for Stud.IP 6.0
/** @deprecated */
$portalplugins = PluginEngine::getPlugins('PortalPlugin');
$layout = $GLOBALS['template_factory']->open('shared/index_box');
$plugin_contents = [];
foreach ($portalplugins as $portalplugin) {
$template = $portalplugin->getPortalTemplate();
if ($template) {
$plugin_contents[] = $template->render(NULL, $layout);
$layout->clear_attributes();
}
}
$index_nobody_template = $GLOBALS['template_factory']->open('index_nobody');
$cache = StudipCacheFactory::getCache();
$stat = $cache->read('LOGINFORM_STATISTICS');
......@@ -88,29 +105,12 @@ if (!is_array($stat)) {
}
$index_nobody_template->set_attributes(array_merge($stat, [
'num_online_users' => get_users_online_count(),
'plugin_contents' => $plugin_contents,
'logout' => Request::bool('logout'),
]));
if (Request::get('logout'))
{
$index_nobody_template->set_attribute('logout', true);
}
echo $index_nobody_template->render();
$layout = $GLOBALS['template_factory']->open('shared/index_box');
// Prüfen, ob PortalPlugins vorhanden sind.
$portalplugins = PluginEngine::getPlugins('PortalPlugin');
foreach ($portalplugins as $portalplugin) {
$template = $portalplugin->getPortalTemplate();
if ($template) {
echo $template->render(NULL, $layout);
$layout->clear_attributes();
}
}
page_close();
include 'lib/include/html_end.inc.php';
......@@ -2,6 +2,9 @@ body {
min-height: 100%;
}
$login-page-margin: 50px;
$gap-between-boxes: ($login-page-margin / 2);
#main-header {
grid-column: 1 / 3;
grid-row: 1 / 1;
......@@ -26,11 +29,16 @@ body {
z-index: -1;
}
#index,
#login {
#content {
padding: $login-page-margin;
}
}
#loginbox {
background-color: rgba(255, 255, 255, 0.8);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
margin-left: 50px;
margin-top: 50px;
padding: 20px;
width: 450px;
......@@ -91,12 +99,6 @@ body {
a {
text-decoration: underline;
color: $base-color;
&:hover, &:focus {
font-size: 1em;
color: $red;
}
}
}
......@@ -113,12 +115,16 @@ body {
}
}
}
& > a {
> a {
margin-left: 12px;
}
}
}
#login-plugin-contents {
margin-top: $gap-between-boxes;
}
#index,
#login {
......@@ -127,7 +133,7 @@ body {
}
.messagebox {
margin: 50px 0 -25px 50px;
margin-bottom: $gap-between-boxes;
width: 418px;
}
}
......@@ -859,10 +859,9 @@ html:not(.responsive-display):not(.fullscreen-mode) {
display: none;
}
main {
#content {
margin: 0;
padding: 0;
width: calc(100% - 10px);
.messagebox {
margin: 0;
......@@ -951,5 +950,3 @@ html:not(.responsive-display):not(.fullscreen-mode) {
max-width: 100vw;
}
}
<?php
# Lifter010: TODO
/**
* @var int $num_active_courses
* @var int $num_registered_users
* @var int $num_online_users
* @var bool $logout
* @var string[] $plugin_contents
*/
// Get background images (this should be resolved differently since mobile
// browsers might still download the desktop background)
......@@ -18,9 +24,9 @@ if ($bg_mobile) {
?>
<!-- Startseite (nicht eingeloggt) -->
<main id="content">
<? if (!empty($logout)) : ?>
<?= MessageBox::success(_('Sie sind nun aus dem System abgemeldet.'), array_filter([$GLOBALS['UNI_LOGOUT_ADD']])) ?>
<? endif; ?>
<? if ($logout): ?>
<?= MessageBox::success(_('Sie sind nun aus dem System abgemeldet.'), array_filter([$GLOBALS['UNI_LOGOUT_ADD']])) ?>
<? endif; ?>
<div id="background-desktop" style="background: url(<?= $bg_desktop ?>) no-repeat top left/cover;"></div>
<div id="background-mobile" style="background: url(<?= $bg_mobile ?>) no-repeat top left/cover;"></div>
......@@ -103,4 +109,12 @@ if ($bg_mobile) {
</div>
</footer>
</article>
<? if (count($plugin_contents) > 0): ?>
<div id="login-plugin-contents">
<? foreach ($plugin_contents as $content): ?>
<?= $content ?>
<? endforeach; ?>
</div>
<? endif; ?>
</main>
<?
# Lifter010: TODO
<?php
/**
* @var string $content_for_layout
* @var string|null $icon_url
* @var string $title
* @var string|null $admin_url
* @var string|null $admin_title
*/
?>
<? if ($content_for_layout != ''): ?>
<? if (!isset($admin_title)) $admin_title = _('Administration') ?>
<table class="index_box">
<tr>
<td class="table_header_bold" style="font-weight: bold;">
......@@ -14,11 +18,13 @@
</td>
<td class="table_header_bold" style="text-align: right;">
<? if (isset($admin_url)): ?>
<a href="<?= URLHelper::getLink($admin_url) ?>" title="<?= htmlReady($admin_title) ?>">
<?= Icon::create('admin', 'info_alt')->asImg(16, ["alt" => htmlReady($admin_title)]) ?>
</a>
<? endif ?>
<? if (isset($admin_url)): ?>
<a href="<?= URLHelper::getLink($admin_url) ?>" title="<?= htmlReady($admin_title ?? _('Administration')) ?>">
<?= Icon::create('admin', Icon::ROLE_INFO_ALT)->asImg([
'alt' => $admin_title ?? ('Administration'),
]) ?>
</a>
<? endif ?>
</td>
</tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment