diff --git a/classes/UDFCheck/class.ilUDFCheck.php b/classes/UDFCheck/class.ilUDFCheck.php index 882f7b8..9e8cabd 100644 --- a/classes/UDFCheck/class.ilUDFCheck.php +++ b/classes/UDFCheck/class.ilUDFCheck.php @@ -1,5 +1,9 @@ {$field_name}); break; } + return NULL; } @@ -311,6 +316,7 @@ public function wakeUp($field_name, $field_value) { return strtotime($field_value); break; } + return NULL; } diff --git a/classes/UserSetting/class.ilUserSetting.php b/classes/UserSetting/class.ilUserSetting.php index ef43bb0..fe7cdcf 100644 --- a/classes/UserSetting/class.ilUserSetting.php +++ b/classes/UserSetting/class.ilUserSetting.php @@ -1,5 +1,9 @@ limit($this->getOffset(), $this->getOffset() + $this->getLimit()); $xdglRequestList->orderBy('title'); $a_data = $xdglRequestList->getArray(); - $img_on = ilUtil::img(ilUtil::getImagePath('icon_led_on_s.png')); - $img_off = ilUtil::img(ilUtil::getImagePath('icon_led_off_s.png')); + if(ilUserDefaultsPlugin::is55()) { + $img_on = ilUtil::img(ilUtil::getImagePath('icon_ok.svg')); + $img_off = ilUtil::img(ilUtil::getImagePath('icon_not_ok.svg')); + }else { + $img_on = ilUtil::img(ilUtil::getImagePath('icon_led_on_s.png')); + $img_off = ilUtil::img(ilUtil::getImagePath('icon_led_off_s.png')); + } + foreach ($a_data as $k => $d) { $a_data[$k]['status_image'] = ($d['status'] == ilUserSetting::STATUS_ACTIVE ? $img_on : $img_off); } diff --git a/classes/class.ilUserDefaultsPlugin.php b/classes/class.ilUserDefaultsPlugin.php index 03a986f..45630a3 100644 --- a/classes/class.ilUserDefaultsPlugin.php +++ b/classes/class.ilUserDefaultsPlugin.php @@ -39,31 +39,17 @@ public static function getInstance() { * @param array array of event specific parameters */ public function handleEvent($a_component, $a_event, $a_parameter) { - if ($a_component == 'Modules/Course' AND $a_event == 'update') { - - -// $ilUser = new ilObjUser(); -// $ilUser->setEmail('info@fschmid.ch'); -// $ilUser->setPasswd('homer'); -// $ilUser->setActive(1); -// $ilUser->setTimeLimitUnlimited(true); -// $ilUser->setFirstname('Fabian'); -// $ilUser->setLastname('Schmid'); -// $a_str = 'fschmid' . rand(100, 99999); -// $ilUser->create(); -// $ilUser->setLogin($a_str); -// $ilUser->saveAsNew(false); -// ilUtil::sendInfo($a_str, true); -// /** -// * @var $ilUserSetting ilUserSetting -// */ -// global $ilUser; -// foreach (ilUserSetting::where(array( 'status' => ilUserSetting::STATUS_ACTIVE ))->get() as $ilUserSetting) { -// $ilUserSetting->doAssignements($ilUser); -// } - } - - if ($a_component == 'Services/User' AND $a_event == 'saveAsNew') { + // if ($a_component == 'Modules/Course' AND $a_event == 'update') { + // global $ilUser; + // /** + // * @var $ilUserSetting ilUserSetting + // */ + // foreach (ilUserSetting::where(array( 'status' => ilUserSetting::STATUS_ACTIVE ))->get() as $ilUserSetting) { + //// $ilUserSetting->doAssignements($ilUser); + // } + // } + + if ($a_component == 'Services/User' AND ($a_event == 'saveAsNew' OR $a_event == 'afterCreate')) { /** * @var $ilUser ilObjUser */ @@ -91,6 +77,14 @@ public function getPluginName() { } + /** + * @return bool + */ + public static function is55() { + return ((int)str_ireplace('.', '', ILIAS_VERSION_NUMERIC)) >= 500; + } + + public function updateLanguageFiles() { ini_set('auto_detect_line_endings', true); $path = substr(__FILE__, 0, strpos(__FILE__, 'classes')) . 'lang/'; diff --git a/plugin.php b/plugin.php index 98e7c68..3d0a16b 100644 --- a/plugin.php +++ b/plugin.php @@ -1,8 +1,8 @@