* @package chamilo.course_description */ // protect a course script api_protect_course_script(true); // display actions menu if (api_is_allowed_to_edit(null,true)) { $categories = array(); foreach ($default_description_titles as $id => $title) { $categories[$id] = $title; } $categories[ADD_BLOCK] = get_lang('NewBloc'); $i=1; echo '
'; ksort($categories); foreach ($categories as $id => $title) { if ($i==ADD_BLOCK) { echo ''. Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).''; break; } else { echo ''. Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).''; $i++; } } echo '
'; } $history = isset($history) ? $history : null; // display course description list if ($history) { echo '

'.get_lang('ThematicAdvanceHistory').'

'. Display::return_icon('info.png',get_lang('BackToCourseDesriptionList'), array('style'=>'vertical-align:middle;'),ICON_SIZE_SMALL).' '.get_lang('BackToCourseDesriptionList').'
'; } $user_info = api_get_user_info(); if (isset($descriptions) && count($descriptions) > 0) { foreach ($descriptions as $id => $description) { if (!empty($description)) { echo '
'; echo '
'; if (api_is_allowed_to_edit(null,true) && !$history) { if (api_get_session_id() == $description['session_id']) { $description['title'] = $description['title'].' '.api_get_session_image(api_get_session_id(), $user_info['status']); // delete echo ''; echo Display::return_icon('delete.png', get_lang('Delete'), array('style' => 'vertical-align:middle;float:right;'),ICON_SIZE_SMALL); echo ' '; // edit echo ''; echo Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align:middle;float:right; padding-right:4px;'),ICON_SIZE_SMALL); echo ' '; } else { echo Display::return_icon('edit_na.png', get_lang('EditionNotAvailableFromSession'), array('style' => 'vertical-align:middle;float:right;'),ICON_SIZE_SMALL); } } echo $description['title']; echo '
'; echo '
'; echo $description['content']; echo '
'; } } } else { echo ''.get_lang('ThisCourseDescriptionIsEmpty').''; }