* @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 '
';
}
$history = isset($history) ? $history : null;
// display course description list
if ($history) {
echo '';
}
$user_info = api_get_user_info();
if (isset($descriptions) && count($descriptions) > 0) {
foreach ($descriptions as $id => $description) {
if (!empty($description)) {
$actions = '';
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
$actions .= '';
$actions .= Display::return_icon('delete.png', get_lang('Delete'), array('style' => 'vertical-align:middle;float:right;'),ICON_SIZE_SMALL);
$actions .= ' ';
// edit
$actions .= '';
$actions .= Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align:middle;float:right; padding-right:4px;'),ICON_SIZE_SMALL);
$actions .= ' ';
} else {
$actions .= Display::return_icon('edit_na.png', get_lang('EditionNotAvailableFromSession'), array('style' => 'vertical-align:middle;float:right;'),ICON_SIZE_SMALL);
}
}
echo Display::panel(
$description['content'],
$description['title'].$actions,
'',
'info'
);
}
}
} else {
echo ''.get_lang('ThisCourseDescriptionIsEmpty').'';
}