88use Chamilo \CoreBundle \Entity \SequenceResource ;
99use Chamilo \CourseBundle \Component \CourseCopy \CourseBuilder ;
1010use Chamilo \CourseBundle \Component \CourseCopy \CourseRestorer ;
11+ use Chamilo \CourseBundle \Entity \CCourseDescription ;
1112use ChamiloSession as Session ;
1213use Doctrine \Common \Collections \Criteria ;
1314
@@ -3442,24 +3443,24 @@ public static function getExtraFieldsToBePresented($courseId)
34423443 /**
34433444 * Lists details of the course description.
34443445 *
3445- * @param array The course description
3446- * @param string The encoding
3447- * @param bool If true is displayed if false is hidden
3446+ * @param array<int, CCourseDescription> $descriptions The course description
3447+ * @param string $charset The encoding
3448+ * @param bool $action_show If true is displayed if false is hidden
34483449 *
34493450 * @return string The course description in html
34503451 */
34513452 public static function get_details_course_description_html (
3452- $ descriptions ,
3453- $ charset ,
3454- $ action_show = true
3455- ) {
3453+ array $ descriptions ,
3454+ string $ charset ,
3455+ bool $ action_show = true
3456+ ): ? string {
34563457 $ data = null ;
3457- if (isset ( $ descriptions ) && count ($ descriptions ) > 0 ) {
3458+ if (count ($ descriptions ) > 0 ) {
34583459 foreach ($ descriptions as $ description ) {
34593460 $ data .= '<div class="sectiontitle"> ' ;
34603461 if (api_is_allowed_to_edit () && $ action_show ) {
34613462 //delete
3462- $ data .= '<a href=" ' .api_get_self ().'? ' .api_get_cidreq ().'&action=delete&description_id= ' .$ description ->id .'" onclick="javascript:if(!confirm( \'' .addslashes (api_htmlentities (
3463+ $ data .= '<a href=" ' .api_get_self ().'? ' .api_get_cidreq ().'&action=delete&description_id= ' .$ description ->getIid () .'" onclick="javascript:if(!confirm( \'' .addslashes (api_htmlentities (
34633464 get_lang ('ConfirmYourChoice ' ),
34643465 ENT_QUOTES ,
34653466 $ charset
@@ -3471,7 +3472,7 @@ public static function get_details_course_description_html(
34713472 );
34723473 $ data .= '</a> ' ;
34733474 //edit
3474- $ data .= '<a href=" ' .api_get_self ().'? ' .api_get_cidreq ().'&description_id= ' .$ description ->id .'"> ' ;
3475+ $ data .= '<a href=" ' .api_get_self ().'? ' .api_get_cidreq ().'&description_id= ' .$ description ->getIid () .'"> ' ;
34753476 $ data .= Display::return_icon (
34763477 'edit.png ' ,
34773478 get_lang ('Edit ' ),
@@ -3480,10 +3481,10 @@ public static function get_details_course_description_html(
34803481 );
34813482 $ data .= '</a> ' ;
34823483 }
3483- $ data .= $ description ->title ;
3484+ $ data .= Security:: remove_XSS ( $ description ->getTitle ()) ;
34843485 $ data .= '</div> ' ;
34853486 $ data .= '<div class="sectioncomment"> ' ;
3486- $ data .= Security::remove_XSS ($ description ->content );
3487+ $ data .= Security::remove_XSS ($ description ->getContent () );
34873488 $ data .= '</div> ' ;
34883489 }
34893490 } else {
0 commit comments