@@ -24,16 +24,24 @@ class ilCalendarCronRemoteReader extends ilCronJob
2424{
2525 private const DEFAULT_SYNC_HOURS = 1 ;
2626
27- private ilLanguage $ lng ;
2827 private ilLogger $ logger ;
29-
3028 private ?ilCalendarSettings $ calendar_settings = null ;
3129
32- public function __construct ()
30+ public function __construct (
31+ string $ component ,
32+ \ILIAS \Language \Language $ lng ,
33+ bool $ registration = false
34+ ) {
35+ parent ::__construct ($ component , $ lng );
36+ $ this ->lng ->loadLanguageModule ('dateplaner ' );
37+ if (!$ registration ) {
38+ $ this ->additionalConstruct ();
39+ }
40+ }
41+
42+ private function additionalConstruct ()
3343 {
3444 global $ DIC ;
35-
36- $ this ->lng = $ DIC ->language ();
3745 $ this ->logger = $ DIC ->logger ()->cal ();
3846 $ this ->calendar_settings = ilCalendarSettings::_getInstance ();
3947 }
@@ -106,8 +114,8 @@ public function run(): ilCronJobResult
106114 $ reader ->setUser ($ remoteCalendar ->getRemoteUser ());
107115 $ reader ->setPass ($ remoteCalendar ->getRemotePass ());
108116 try {
109- $ reader ->read ();
110- $ reader ->import ($ remoteCalendar );
117+ $ reader ->read ();
118+ $ reader ->import ($ remoteCalendar );
111119 } catch (Exception $ e ) {
112120 $ this ->logger ->warning ('Remote Calendar: ' . $ remoteCalendar ->getCategoryID ());
113121 $ this ->logger ->warning ('Reading remote calendar failed with message: ' . $ e ->getMessage ());
0 commit comments