Skip to content
Snippets Groups Projects
Commit 40fc9d70 authored by David Siegfried's avatar David Siegfried
Browse files

prevent php-warnings, closes #2306

Closes #2306

Merge request studip/studip!1524
parent f2003b61
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
...@@ -29,7 +29,7 @@ use Studip\Button, Studip\LinkButton; ...@@ -29,7 +29,7 @@ use Studip\Button, Studip\LinkButton;
require '../lib/bootstrap.php'; require '../lib/bootstrap.php';
page_open(["sess" => "Seminar_Session", "auth" => "Seminar_Auth", "perm" => "Seminar_Perm", 'user' => "Seminar_User"]); page_open(["sess" => "Seminar_Session", "auth" => "Seminar_Auth", "perm" => "Seminar_Perm", 'user' => "Seminar_User"]);
$perm->check("root"); $GLOBALS['perm']->check("root");
include 'lib/seminar_open.php'; // initialise Stud.IP-Session include 'lib/seminar_open.php'; // initialise Stud.IP-Session
// -- here you have to put initialisations for the current page // -- here you have to put initialisations for the current page
...@@ -44,7 +44,8 @@ $cms_select = Request::get('cms_select'); ...@@ -44,7 +44,8 @@ $cms_select = Request::get('cms_select');
if (Config::get()->ELEARNING_INTERFACE_ENABLE) if (Config::get()->ELEARNING_INTERFACE_ENABLE)
{ {
$connection_status = [];
$connected_cms = [];
if ($cms_select != "" && isset($ELEARNING_INTERFACE_MODULES[$cms_select])) if ($cms_select != "" && isset($ELEARNING_INTERFACE_MODULES[$cms_select]))
{ {
$connected_cms[$cms_select] = new ConnectedCMS(); $connected_cms[$cms_select] = new ConnectedCMS();
...@@ -84,17 +85,17 @@ if (Config::get()->ELEARNING_INTERFACE_ENABLE) ...@@ -84,17 +85,17 @@ if (Config::get()->ELEARNING_INTERFACE_ENABLE)
{ {
if ($msg["error"] != "") if ($msg["error"] != "")
{ {
echo "<tr><td valign=\"middle\">" . Icon::create('decline', 'attention')->asImg(['class' => 'text-top', 'title' => _('Fehler')]) . $msg["error"] . "</td></tr>"; echo "<tr><td valign=\"middle\">" . Icon::create('decline', Icon::ROLE_ATTENTION)->asImg(['class' => 'text-top', 'title' => _('Fehler')]) . $msg["error"] . "</td></tr>";
$error_count++; $error_count++;
} }
else else
echo "<tr><td valign=\"middle\">" . Icon::create('accept', 'accept')->asImg(['class' => 'text-top', 'title' => _('OK')]) . $msg["info"] . "</td></tr>"; echo "<tr><td valign=\"middle\">" . Icon::create('accept', Icon::ROLE_ACCEPT)->asImg(['class' => 'text-top', 'title' => _('OK')]) . $msg["info"] . "</td></tr>";
} }
echo "<tr><td><br></td></tr>"; echo "<tr><td><br></td></tr>";
if ($error_count > 0) if ($error_count > 0)
{ {
$status_info = "error"; $status_info = "error";
echo "<tr><td valign=\"middle\">" . Icon::create('decline', 'attention')->asImg(['class' => 'text-top', 'title' => _('Fehler')]) . "<b>"; echo "<tr><td valign=\"middle\">" . Icon::create('decline', Icon::ROLE_ATTENTION)->asImg(['class' => 'text-top', 'title' => _('Fehler')]) . "<b>";
echo _("Beim Laden der Schnittstelle sind Fehler aufgetreten. "); echo _("Beim Laden der Schnittstelle sind Fehler aufgetreten. ");
if (ELearningUtils::isCMSActive($cms_select)) if (ELearningUtils::isCMSActive($cms_select))
{ {
...@@ -104,10 +105,10 @@ if (Config::get()->ELEARNING_INTERFACE_ENABLE) ...@@ -104,10 +105,10 @@ if (Config::get()->ELEARNING_INTERFACE_ENABLE)
echo "</b></td></tr>"; echo "</b></td></tr>";
} }
else else
echo "<tr><td valign=\"middle\">" . Icon::create('accept', 'accept', ['title' => _('OK')])->asImg(['class' => 'text-top']) . "<b>" .sprintf( _("Die Schnittstelle zum %s-System ist korrekt konfiguriert."), $connected_cms[$cms_select]->getName()) . "</b></td></tr>"; echo "<tr><td valign=\"middle\">" . Icon::create('accept', Icon::ROLE_ACCEPT, ['title' => _('OK')])->asImg(['class' => 'text-top']) . "<b>" .sprintf( _("Die Schnittstelle zum %s-System ist korrekt konfiguriert."), $connected_cms[$cms_select]->getName()) . "</b></td></tr>";
echo "</table>"; echo "</table>";
echo "<br>\n"; echo "<br>\n";
echo ELearningUtils::getCMSHeader($connected_cms[$cms_select]->getName()); echo htmlReady(ELearningUtils::getCMSHeader(isset($connected_cms[$cms_select]) ? $connected_cms[$cms_select]->getName() : ''));
echo "<form method=\"POST\" action=\"" . URLHelper::getLink() . "\" class=\"default\">\n"; echo "<form method=\"POST\" action=\"" . URLHelper::getLink() . "\" class=\"default\">\n";
echo CSRFProtection::tokenTag(); echo CSRFProtection::tokenTag();
echo '<fieldset>'; echo '<fieldset>';
...@@ -174,7 +175,7 @@ if (Config::get()->ELEARNING_INTERFACE_ENABLE) ...@@ -174,7 +175,7 @@ if (Config::get()->ELEARNING_INTERFACE_ENABLE)
} }
// terminate objects // terminate objects
if (is_array($connected_cms)) if (!empty($connected_cms))
foreach($connected_cms as $system) foreach($connected_cms as $system)
$system->terminate(); $system->terminate();
......
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