@@ -28,6 +28,8 @@ class Courseware extends StudIPPlugin implements StandardPlugin
2828 */
2929 private $ container ;
3030
31+ public static $ registered_blocks = [];
32+
3133 public function __construct ()
3234 {
3335 parent ::__construct ();
@@ -45,6 +47,8 @@ public function __construct()
4547
4648 // set text-domain for translations in this plugin
4749 bindtextdomain ('courseware ' , dirname (__FILE__ ).'/locale ' );
50+
51+ \NotificationCenter::postNotification ('CoursewareRegisterBlocks ' , \Context::getId ());
4852 }
4953
5054 public function getPluginname ()
@@ -91,7 +95,7 @@ public function getTabNavigation($courseId)
9195 );
9296 $ settingsUrl = PluginEngine::getURL ($ this , compact ('cid ' ), 'courseware/settings ' , true );
9397 $ navigation ->addSubnavigation (
94- 'settings ' ,
98+ 'settings ' ,
9599 new Navigation (_cw ('Einstellungen ' ), $ settingsUrl )
96100 );
97101 $ navigation ->addSubnavigation (
@@ -176,7 +180,7 @@ public function getIconNavigation($courseId, $last_visit, $user_id)
176180 seminar_id = :cid
177181 AND
178182 chdate >= :last_visit
179- AND
183+ AND
180184 type NOT IN ('Courseware', 'Chapter', 'Subchapter', 'Section')
181185 " );
182186 $ stmt ->bindParam (':cid ' , $ courseId );
@@ -189,7 +193,7 @@ public function getIconNavigation($courseId, $last_visit, $user_id)
189193 if ($ plugin_manager ->getPluginInfo ('VipsPlugin ' ) == null ){
190194 $ vips = false ;
191195 }
192- if ($ plugin_manager ->getPlugin ('VipsPlugin ' )){
196+ if ($ plugin_manager ->getPlugin ('VipsPlugin ' )){
193197 $ version = $ plugin_manager ->getPluginManifest ($ plugin_manager ->getPlugin ('VipsPlugin ' )->getPluginPath ())['version ' ];
194198 if (version_compare ('1.3 ' ,$ version ) > 0 ) {
195199 $ vips = false ;
@@ -517,19 +521,19 @@ public static function deleteUserdata($user_id)
517521
518522 $ stmt = $ db ->prepare ('
519523 DELETE FROM
520- mooc_userprogress
521- WHERE
524+ mooc_userprogress
525+ WHERE
522526 user_id = :uid
523527 ' );
524528 $ stmt ->bindParam (':uid ' , $ user_id );
525529 $ exec = $ stmt ->execute ();
526530
527531 $ stmt = $ db ->prepare ('
528532 DELETE FROM
529- mooc_fields
530- WHERE
533+ mooc_fields
534+ WHERE
531535 user_id = :uid
532- AND
536+ AND
533537 (name = "visited" OR name = "lastSelected")
534538 ' );
535539 $ stmt ->bindParam (':uid ' , $ user_id );
@@ -538,4 +542,8 @@ public static function deleteUserdata($user_id)
538542 return $ exec ;
539543 }
540544
545+ public static function addBlockPath ($ path_to_block )
546+ {
547+ self ::$ registered_blocks [] = $ path_to_block ;
548+ }
541549}
0 commit comments