aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2025-04-03 13:22:17 +0200
committerMurtaza Sultani <sultani@data-quest.de>2025-09-11 16:04:31 +0200
commit2bb5a64adfa449fb1f4a6383eafe48b76daed5d9 (patch)
treee2942c3c064886c80fbc3fb4bb54be37908f4932
parenta4f052eb4c20d7cb982b8c181ae7518c40fbb769 (diff)
changed view
-rw-r--r--app/controllers/course/lti.php10
-rw-r--r--app/views/course/lti/share_as_tool.php94
2 files changed, 53 insertions, 51 deletions
diff --git a/app/controllers/course/lti.php b/app/controllers/course/lti.php
index 1060168..0987e3b 100644
--- a/app/controllers/course/lti.php
+++ b/app/controllers/course/lti.php
@@ -996,10 +996,12 @@ class Course_LtiController extends StudipController
$this->share_as_tool = CourseConfig::get($this->course_id)->SHARE_COURSE_AS_LTI_TOOL;
$this->lti_entry_point = CourseConfig::get($this->course_id)->LTI_TOOL_ENTRY_POINT;
$this->plugin_data = $this->getPluginData($this->course_id);
- $this->platforms = LtiPlatform::findBySQL(
- "`range_id` = :course_id ORDER BY `name` ASC",
- ['course_id' => $this->course_id]
- );
+ if ($this->share_as_tool) {
+ $this->platforms = LtiPlatform::findBySQL(
+ "`range_id` = :course_id ORDER BY `name` ASC",
+ ['course_id' => $this->course_id]
+ );
+ }
}
public function save_share_as_tool_settings_action()
diff --git a/app/views/course/lti/share_as_tool.php b/app/views/course/lti/share_as_tool.php
index fb26c98..143988e 100644
--- a/app/views/course/lti/share_as_tool.php
+++ b/app/views/course/lti/share_as_tool.php
@@ -5,6 +5,7 @@
* @var bool $share_as_tool
* @var array $plugin_data
* @var int $lti_entry_point
+ * @var ?LtiPlatform[] $platforms
*/
?>
<section class="contentbox">
@@ -53,51 +54,50 @@
</form>
</section>
</section>
-<section class="contentbox">
- <header><h1><?= _('Angebundene LTI-Plattformen') ?></h1></header>
- <section>
- <? if ($platforms) : ?>
- <table class="default">
- <thead>
- <tr>
- <th><?= _('Plattform') ?></th>
- <th><?= _('Verantwortliche Person') ?></th>
- <th class="actions"><?= _('Aktionen') ?></th>
- </tr>
- </thead>
- <tfoot>
- <?= \Studip\LinkButton::create(_('Hinzufügen'), $controller->url_for('course/lti/add_platform', ['cid' => $this->course_id])) ?>
- </tfoot>
- <tbody>
- <? foreach ($platforms as $platform) : ?>
- <tr>
- <td><?= htmlReady($platform->name) ?></td>
- <td><?= htmlReady($platform->responsible_person?->getFullName() ?? _('unbekannt')) ?></td>
- <td>
- <?
- $menu = ActionMenu::get();
- $menu->addLink(
- $controller->url_for('course/lti/edit_platform/' . $platform->id),
- Icon::create('edit'),
- ['data-dialog' => 'reload-on-close']
- );
- $menu->addLink(
- $controller->url_for('course/lti/delete_platform/' . $platform->id),
- Icon::create('trash'),
- ['data-confirm' => studip_interpolate(
- _('Soll die Plattform %{name} wirklich gelöscht werden?'),
- ['name' => $platform->name]
- )]
- );
- $menu->render();
- ?>
- </td>
- </tr>
- <? endforeach ?>
- </tbody>
- </table>
- <? else : ?>
- <?= MessageBox::info(_('Es sind keine LTI-Plattformen an diese Veranstaltung angebunden.')) ?>
- <? endif ?>
+<? if ($share_as_tool) : ?>
+ <section class="contentbox">
+ <header><h1><?= _('Angebundene LTI-Plattformen') ?></h1></header>
+ <section>
+ <? if ($platforms) : ?>
+ <table class="default">
+ <thead>
+ <tr>
+ <th><?= _('Plattform') ?></th>
+ <th><?= _('Verantwortliche Person') ?></th>
+ <th class="actions"><?= _('Aktionen') ?></th>
+ </tr>
+ </thead>
+ <tbody>
+ <? foreach ($platforms as $platform) : ?>
+ <tr>
+ <td><?= htmlReady($platform->name) ?></td>
+ <td><?= htmlReady($platform->responsible_person?->getFullName() ?? _('unbekannt')) ?></td>
+ <td>
+ <?
+ $menu = ActionMenu::get();
+ $menu->addLink(
+ $controller->url_for('course/lti/edit_platform/' . $platform->id),
+ Icon::create('edit'),
+ ['data-dialog' => 'reload-on-close']
+ );
+ $menu->addLink(
+ $controller->url_for('course/lti/delete_platform/' . $platform->id),
+ Icon::create('trash'),
+ ['data-confirm' => studip_interpolate(
+ _('Soll die Plattform %{name} wirklich gelöscht werden?'),
+ ['name' => $platform->name]
+ )]
+ );
+ $menu->render();
+ ?>
+ </td>
+ </tr>
+ <? endforeach ?>
+ </tbody>
+ </table>
+ <? else : ?>
+ <?= MessageBox::info(_('Es sind keine LTI-Plattformen an diese Veranstaltung angebunden.')) ?>
+ <? endif ?>
+ </section>
</section>
-</section>
+<? endif ?>