Skip to content
Snippets Groups Projects
Commit edc32a6b authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by 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 13112b14
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,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');
......@@ -80,30 +97,13 @@ 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 '<div><div class="index_container">';
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';
......@@ -103,6 +103,12 @@ div.index_container {
}
}
#login-plugin-contents {
@login-page-margin: 50px;
@gap-between-boxes: (@login-page-margin / 2);
margin: @gap-between-boxes @login-page-margin 0;
}
#index,
#login {
.messagebox {
......
......@@ -423,6 +423,12 @@
}
}
#login-plugin-contents {
width: 500px;
margin-left: auto;
margin-right: auto;
}
#layout_footer {
display: block;
min-width: 0;
......@@ -442,6 +448,10 @@
}
}
}
#login-plugin-contents {
width: 100%;
}
});
}
......
<?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)
......@@ -86,3 +92,11 @@ if ($bg_mobile) {
</div>
</footer>
</div>
<? if (count($plugin_contents) > 0): ?>
<div id="login-plugin-contents">
<? foreach ($plugin_contents as $content): ?>
<?= $content ?>
<? endforeach; ?>
</div>
<? endif; ?>
<?
# 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