@@ -243,16 +243,16 @@ private function createNewCourseware($courseware)
243243
244244 $ subchapter_map = [];
245245 $ section_map = [];
246- $ new_link_blocks = [];
246+ $ this -> new_link_blocks = [];
247247
248248 foreach ($ courseware ['children ' ] as $ chapter ) {
249249 $ subchapters = $ chapter ['children ' ];
250- if (count ($ subchapters ) > 1 ) {
250+ if (count (( array ) $ subchapters ) > 1 ) {
251251 $ new_chapter = $ this ->createStructuralElement ($ chapter , $ root ->id );
252252 $ this ->fillEmptyPage ($ new_chapter , false );
253253 foreach ($ subchapters as $ subchapter ) {
254254 $ sections = $ subchapter ['children ' ];
255- if (count ($ sections ) > 1 ) {
255+ if (count (( array ) $ sections ) > 1 ) {
256256 $ new_subchapter = $ this ->createStructuralElement ($ subchapter , $ new_chapter ->id );
257257 $ this ->fillEmptyPage ($ new_subchapter , false );
258258 $ subchapter_map [$ subchapter ['id ' ]] = $ new_subchapter ->id ;
@@ -263,7 +263,7 @@ private function createNewCourseware($courseware)
263263 $ this ->createSectionBlocks ($ section ['children ' ], $ new_container );
264264 }
265265 }
266- if (count ($ sections ) === 1 ) {
266+ if (count (( array ) $ sections ) === 1 ) {
267267 $ section = $ sections [0 ];
268268 $ new_section = $ this ->createStructuralElement ($ section , $ new_chapter ->id );
269269 $ new_section ->title =
@@ -278,10 +278,10 @@ private function createNewCourseware($courseware)
278278 }
279279 }
280280 }
281- if (count ($ subchapters ) === 1 ) {
281+ if (count (( array ) $ subchapters ) === 1 ) {
282282 $ subchapter = $ subchapters [0 ];
283283 $ sections = $ subchapter ['children ' ];
284- if (count ($ sections ) > 1 ) {
284+ if (count (( array ) $ sections ) > 1 ) {
285285 $ new_subchapter = $ this ->createStructuralElement ($ subchapter , $ root ->id );
286286 $ new_subchapter ->title =
287287 strval ($ chapter ['title ' ]) == strval ($ subchapter ['title ' ]) ?
@@ -298,7 +298,7 @@ private function createNewCourseware($courseware)
298298 $ this ->createSectionBlocks ($ section ['children ' ], $ new_container );
299299 }
300300 }
301- if (count ($ sections ) === 1 ) {
301+ if (count (( array ) $ sections ) === 1 ) {
302302 $ section = $ sections [0 ];
303303 $ new_section = $ this ->createStructuralElement ($ section , $ root ->id );
304304 $ new_section_title =
@@ -318,7 +318,7 @@ private function createNewCourseware($courseware)
318318 }
319319
320320 }
321- foreach ($ new_link_blocks as $ link_block ) {
321+ foreach ($ this -> new_link_blocks as $ link_block ) {
322322 $ new_link_block = $ link_block ['block ' ];
323323 $ old_target = $ link_block ['link_target ' ]['id ' ];
324324 $ payload = json_decode ($ new_link_block ->payload );
@@ -439,7 +439,7 @@ private function createSectionBlocks($blocks, $new_container)
439439 continue ;
440440 }
441441 if ($ new_block ->type ->getType () === 'link ' ) {
442- array_push ($ new_link_blocks , array ('block ' => $ new_block , 'link_target ' => $ create_new_block ['link_target ' ]));
442+ array_push ($ this -> new_link_blocks , array ('block ' => $ new_block , 'link_target ' => $ create_new_block ['link_target ' ]));
443443 }
444444 $ user_progresses = \Mooc \DB \UserProgress::findBySQL ('block_id = ? ' , array ($ block ['id ' ]));
445445 foreach ($ user_progresses as $ user_progress ) {
@@ -799,8 +799,12 @@ private function createBlock($block, $container)
799799 case 'PostBlock ' :
800800 // convert this to a TextBlock and put content into comments
801801 $ block_type = 'text ' ;
802+ $ hint = 'Dies ist ein automatisch konvertierter Block des Typs "Kommentare &
803+ Diskussion". Um die vorhandenen Kommentare anzuzeigen, wählen Sie bitte
804+ links die Ansicht "Bearbeiten" und aktivieren Sie dann im Menü an diesem
805+ Block die Aktion "Kommentare anzeigen". ' ;
802806 $ payload = array (
803- 'text ' => $ block [ ' fields ' ][ ' post_title ' ]
807+ 'text ' => $ hint
804808 );
805809 $ addBlock = true ;
806810 break ;
0 commit comments