Skip to content

Commit

Permalink
Add meeting toolbar see BT#15378
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Mar 13, 2019
1 parent 6f3eb17 commit e30ccf2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
18 changes: 18 additions & 0 deletions main/survey/meeting.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,5 +268,23 @@ class="question" '.$checked.'
$content .= '</form>';
}

$actions = '';
if (api_is_allowed_to_edit()) {
$actions .= Display::url(
Display::return_icon('edit.png', get_lang('EditSurvey'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'survey/edit_meeting.php?'.api_get_cidreq().'&action=edit&survey_id='.$surveyId
);
$actions .= Display::url(
Display::return_icon('delete.png', get_lang('DeleteSurvey'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq().'&action=delete&survey_id='.$surveyId,
['onclick' => 'javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('DeleteSurvey').'?', ENT_QUOTES)).'\')) return false;']
);
$actions .= Display::url(
Display::return_icon('mail_send.png', get_lang('Publish'), '', ICON_SIZE_MEDIUM),
api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?'.api_get_cidreq().'&survey_id='.$surveyId
);
}

$template->assign('actions', Display::toolbarAction('toolbar', [$actions]));
$template->assign('content', $content);
$template->display_one_col_template();
15 changes: 11 additions & 4 deletions main/survey/survey_invite.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,17 @@
'name' => get_lang('SurveyList'),
];
if (api_is_course_admin()) {
$interbreadcrumb[] = [
'url' => api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&'.api_get_cidreq(),
'name' => $urlname,
];
if ($survey_data['survey_type'] == 3) {
$interbreadcrumb[] = [
'url' => api_get_path(WEB_CODE_PATH).'survey/meeting.php?survey_id='.$survey_id.'&'.api_get_cidreq(),
'name' => $urlname,
];
} else {
$interbreadcrumb[] = [
'url' => api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&'.api_get_cidreq(),
'name' => $urlname,
];
}
} else {
$interbreadcrumb[] = [
'url' => api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?survey_id='.$survey_id.'&'.api_get_cidreq(),
Expand Down

0 comments on commit e30ccf2

Please sign in to comment.