* @package chamilo.course_description
*/
// protect a course script
api_protect_course_script(true);
// display messages
if ($messages['edit'] || $messages['add']) {
Display :: display_confirmation_message(get_lang('CourseDescriptionUpdated'));
} else if ($messages['destroy']) {
Display :: display_confirmation_message(get_lang('CourseDescriptionDeleted'));
}
// 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 '
';
}
// display course description list
if ($history) {
echo '';
}
$user_info = api_get_user_info();
if (isset($descriptions) && count($descriptions) > 0) {
foreach ($descriptions as $id => $description) {
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 '';
}
} else {
echo ''.get_lang('ThisCourseDescriptionIsEmpty').'';
}