* @access public
* @modulegroup elearning_interface_modules
* @module Ilias3ConnectedCMS
* @package ELearning-Interface
*/
class Ilias3ConnectedCMS extends ConnectedCMS
{
var $client_id;
// var $root_user_id;
var $root_user_sid;
var $main_category_node_id;
var $user_role_template_id;
var $user_skin;
var $user_style;
var $crs_roles;
var $global_roles;
var $db_class_object;
var $db_class_tree;
var $db_class_course;
var $soap_client;
/**
* constructor
*
* init class.
* @access public
* @param string $cms system-type
*/
function __construct($cms)
{
global $ELEARNING_INTERFACE_MODULES;
parent::__construct($cms);
require_once($this->CLASS_PREFIX . "Soap.class.php");
$classname = $this->CLASS_PREFIX . "Soap";
$this->soap_client = new $classname($this->cms_type);
$this->soap_client->setCachingStatus(true);
$this->main_category_node_id = ELearningUtils::getConfigValue("category_id", $cms);
if ((ELearningUtils::getConfigValue("user_role_template_id", $cms) == "") AND ($GLOBALS["role_template_name"] == ""))
$GLOBALS["role_template_name"] = "Author";
$this->user_role_template_id = ELearningUtils::getConfigValue("user_role_template_id", $cms);
$this->user_skin = ELearningUtils::getConfigValue("user_skin", $cms);
$this->user_style = ELearningUtils::getConfigValue("user_style", $cms);
$this->encrypt_passwords = ELearningUtils::getConfigValue("encrypt_passwords", $cms);
$this->crs_roles = $ELEARNING_INTERFACE_MODULES[$cms]["crs_roles"];
$this->client_id = $ELEARNING_INTERFACE_MODULES[$cms]["soap_data"]["client"];
$this->global_roles = $ELEARNING_INTERFACE_MODULES[$cms]["global_roles"];
// $this->root_user_sid = $this->soap_client->login();
$this->is_first_call = true;
}
/**
* get preferences
*
* shows additional settings.
* @access public
*/
function getPreferences()
{
global $connected_cms;
$role_template_name = Request::get('role_template_name');
$cat_name = Request::get('cat_name');
$style_setting = Request::option('style_setting');
$encrypt_passwords = Request::option('encrypt_passwords');
$this->soap_client->setCachingStatus(false);
if ($cat_name != "")
{
$cat = $this->soap_client->getReferenceByTitle( trim( $cat_name ), "cat");
if ($cat == false)
$messages["error"] .= sprintf(_("Das Objekt mit dem Namen \"%s\" wurde im System %s nicht gefunden."), htmlReady($cat_name), htmlReady($this->getName())) . "
\n";
if ($cat != "")
{
ELearningUtils::setConfigValue("category_id", $cat, $this->cms_type);
$this->main_category_node_id = $cat;
}
}
if ($role_template_name != "")
{
$role_template = $this->soap_client->getObjectByTitle( trim( $role_template_name ), "rolt" );
if ($role_template == false)
$messages["error"] .= sprintf(_("Das Rollen-Template mit dem Namen \"%s\" wurde im System %s nicht gefunden."), htmlReady($role_template_name), htmlReady($this->getName())) . "
\n";
if (is_array($role_template))
{
ELearningUtils::setConfigValue("user_role_template_id", $role_template["obj_id"], $this->cms_type);
ELearningUtils::setConfigValue("user_role_template_name", $role_template["title"], $this->cms_type);
$this->user_role_template_id = $role_template["obj_id"];
}
}
if (Request::submitted('submit'))
{
ELearningUtils::setConfigValue("user_style", $style_setting, $this->cms_type);
ELearningUtils::setConfigValue("user_skin", $style_setting, $this->cms_type);
ELearningUtils::setConfigValue("encrypt_passwords", $encrypt_passwords, $this->cms_type);
}
else
{
if (ELearningUtils::getConfigValue("user_style", $this->cms_type) != "")
$style_setting = ELearningUtils::getConfigValue("user_style", $this->cms_type);
if (ELearningUtils::getConfigValue("encrypt_passwords", $this->cms_type) != "")
$encrypt_passwords = ELearningUtils::getConfigValue("encrypt_passwords", $this->cms_type);
}
if ($messages["error"] != "")
echo "" . Icon::create('decline', 'attention')->asImg(['class' => 'text-top', 'title' => _('Fehler')]) . " " . $messages["error"] . "
";
echo "
| "; echo "" . _("SOAP-Verbindung: ") . ""; echo " | ";
$error = $this->soap_client->getError();
if ($error != false)
echo sprintf(_("Beim Herstellen der SOAP-Verbindung trat folgender Fehler auf:")) . " " . $error; else echo sprintf(_("Die SOAP-Verbindung zum Klienten \"%s\" wurde hergestellt, der Name des Administrator-Accounts ist \"%s\"."), htmlReady($this->soap_data["client"]), htmlReady($this->soap_data["username"])); echo " \n"; echo " \n"; echo " |
| "; $cat = $this->soap_client->getObjectByReference( $this->main_category_node_id ); echo '' . _('Kategorie') . ':'; echo " | "; echo " "; echo Icon::create('info-circle', 'inactive', ['title' => _('Geben Sie hier den Namen einer bestehenden ILIAS 3 - Kategorie ein, in der die Lernmodule und User-Kategorien abgelegt werden sollen.')])->asImg(); echo " |
| ";
echo " (ID " . $this->main_category_node_id;
if ($cat["description"] != "")
echo ", " . _("Beschreibung: ") . htmlReady($cat["description"]);
echo ")";
echo " \n"; echo " \n"; echo " | |
| "; echo "" . _("Rollen-Template für die persönliche Kategorie: ") . ""; echo " | "; echo "cms_type) . "\" name=\"role_template_name\"> "; echo Icon::create('info-circle', 'inactive', ['title' => _('Geben Sie den Namen des Rollen-Templates ein, das für die persönliche Kategorie von Lehrenden verwendet werden soll (z.B. \"Author\").')])->asImg(); echo " |
| ";
echo " (ID " . $this->user_role_template_id;
echo ")";
echo " \n"; echo " \n"; echo " | |
| "; echo "" . _("Passwörter: ") . ""; echo " | "; echo " " . _("ILIAS-Passwörter verschlüsselt speichern."); echo Icon::create('info-circle', 'inactive', ['title' => _('Wählen Sie diese Option, wenn die ILIAS-Passwörter der zugeordneten Accounts verschlüsselt in der Stud.IP-Datenbank abgelegt werden sollen.')])->asImg(); echo " |
| ";
echo " \n"; echo " \n"; echo " | |
| "; echo "" . _("Style / Skin: ") . ""; echo " | "; echo " " . _("Stud.IP-Style für neue Nutzer-Accounts voreinstellen."); echo Icon::create('info-circle', 'inactive', ['title' => _('Wählen Sie diese Option, wenn für alle von Stud.IP angelegten ILIAS-Accounts das Stud.IP-Layout als System-Style eingetragen werden soll. ILIAS-seitig angelegte Accounts erhalten weiterhin den Standard-Style.')])->asImg(); echo " |
| ";
echo " \n"; echo " \n"; echo " |