* @access public * @modulegroup elearning_interface_modules * @module Ilias3ConnectedLink * @package ELearning-Interface */ class Ilias3ConnectedLink extends ConnectedLink { /** * constructor * * init class. * @access * @param string $cms system-type */ function __construct($cms) { parent::__construct($cms); $this->cms_link = "ilias3_referrer.php"; } /** * get user module links * * returns content module links for user * @return string html-code */ public function getUserModuleLinks() { global $connected_cms, $current_module; $output = ''; if ($connected_cms[$this->cms_type]->isAuthNecessary() && !$connected_cms[$this->cms_type]->user->isConnected()) { $output .= $this->getNewAccountLink(); } elseif (!$connected_cms[$this->cms_type]->content_module[$current_module]->isDummy()) { if ($connected_cms[$this->cms_type]->content_module[$current_module]->isAllowed(OPERATION_READ)) { $output .= LinkButton::create( _('Starten'), URLHelper::getURL($this->cms_link, [ 'client_id' => $connected_cms[$this->cms_type]->getClientId(), 'cms_select' => $this->cms_type, // 'sess_id' => $connected_cms[$this->cms_type]->user->getSessionId(), 'ref_id' => $connected_cms[$this->cms_type]->content_module[$current_module]->getId(), 'type' => $connected_cms[$this->cms_type]->content_module[$current_module]->getModuleType(), 'target' => 'start', ]), [ 'target' => '_blank', 'rel' => 'noopener noreferrer', ] ); $output .= " "; } if ($connected_cms[$this->cms_type]->content_module[$current_module]->isAllowed(OPERATION_WRITE)) { $output .= LinkButton::create( _('Bearbeiten'), URLHelper::getURL($this->cms_link, [ 'client_id' => $connected_cms[$this->cms_type]->getClientId(), 'cms_select' => $this->cms_type, // 'sess_id' => $connected_cms[$this->cms_type]->user->getSessionId(), 'ref_id' => $connected_cms[$this->cms_type]->content_module[$current_module]->getId(), 'type' => $connected_cms[$this->cms_type]->content_module[$current_module]->getModuleType(), 'target' => 'edit', ]), [ 'target' => '_blank', 'rel' => 'noopener noreferrer', ] ); $output .= " "; } } return $output; } /** * get admin module links * * returns links add or remove a module from course * @return string returns html-code */ public function getAdminModuleLinks() { global $connected_cms, $view, $search_key, $cms_select, $current_module; $output = "
\n"; $output .= CSRFProtection::tokenTag(); $output .= "\n"; $output .= "\n"; $output .= "\n"; $output .= "cms_type]->content_module[$current_module]->getModuleType()) . "\">\n"; $output .= "cms_type]->content_module[$current_module]->getId()) . "\">\n"; $output .= "cms_type) . "\">\n"; if ($connected_cms[$this->cms_type]->content_module[$current_module]->isConnected()) { $output .= " " . Button::create(_('Entfernen'), 'remove'); } elseif ($connected_cms[$this->cms_type]->content_module[$current_module]->isAllowed(OPERATION_WRITE)) { $output .= "
"; $output .= _("Mit Schreibrechten für alle Lehrenden/Tutoren und Tutorinnen dieser Veranstaltung") . "
"; $output .= ""; $output .= _("Mit Schreibrechten für alle Teilnehmenden dieser Veranstaltung") . "
"; $output .= Button::create(_('Hinzufügen'), 'add') . "
"; } else { $output .= " " . Button::create(_('Hinzufügen'), 'add'); } $output .= "
"; return $output; } /** * get new module link * * returns link to create a new module if allowed * @return string|false returns html-code or false */ public function getNewModuleLink() { global $connected_cms, $auth; $output = "\n"; if (Request::get("module_type_" . $this->cms_type)) { if (!$connected_cms[$this->cms_type]->user->category) { $connected_cms[$this->cms_type]->user->newUserCategory(); if ($connected_cms[$this->cms_type]->user->category == false) { return $output; } } $output = " "; $output .= LinkButton::create( _('Neu anlegen'), URLHelper::getURL($this->cms_link, [ 'client_id' => $connected_cms[$this->cms_type]->getClientId(), 'cms_select' => $this->cms_type, // 'sess_id' => $connected_cms[$this->cms_type]->user->getSessionId(), 'ref_id' => $connected_cms[$this->cms_type]->user->category, 'type' => Request::option("module_type_" . $this->cms_type), 'target' => 'new', ]), [ 'target' => '_blank', 'rel' => 'noopener noreferrer', ] ); } $user_crs_role = $connected_cms[$this->cms_type]->crs_roles[$auth->auth['perm']]; if ($user_crs_role === 'admin') { return $output; } return false; } /** * get start page link * * returns link to ilias start-page * @access public * @return string returns url or false */ function getStartpageLink() { global $connected_cms; if ($connected_cms[$this->cms_type]->user->isConnected()) { $output = $this->cms_link . "?" . "client_id=" . $connected_cms[$this->cms_type]->getClientId() . "&cms_select=" . $this->cms_type . "&target=login"; } return $output; } } ?>