示例#1
0
    exit;
}
// Displaying the header
Display::display_header($tool_name, 'Survey');
// Action handling
$my_action_survey = Security::remove_XSS($action);
$my_question_id_survey = isset($_GET['question_id']) ? Security::remove_XSS($_GET['question_id']) : null;
$my_survey_id_survey = Security::remove_XSS($_GET['survey_id']);
$message_information = isset($_GET['message']) ? Security::remove_XSS($_GET['message']) : null;
if (isset($action)) {
    if (($action == 'moveup' || $action == 'movedown') && isset($_GET['question_id'])) {
        SurveyManager::move_survey_question($my_action_survey, $my_question_id_survey, $my_survey_id_survey);
        Display::display_confirmation_message(get_lang('SurveyQuestionMoved'));
    }
    if ($action == 'delete' and is_numeric($_GET['question_id'])) {
        SurveyManager::delete_survey_question($my_survey_id_survey, $my_question_id_survey, $survey_data['is_shared']);
    }
}
if (!empty($survey_data['survey_version'])) {
    echo '<b>' . get_lang('Version') . ': ' . $survey_data['survey_version'] . '</b>';
}
// We exit here is the first or last question is a pagebreak (which causes errors)
SurveyUtil::check_first_last_question($_GET['survey_id']);
// Action links
$survey_actions = '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/create_new_survey.php?' . api_get_cidreq() . '&action=edit&survey_id=' . $survey_id . '">' . Display::return_icon('edit.png', get_lang('EditSurvey'), '', ICON_SIZE_MEDIUM) . '</a>';
$survey_actions .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/survey_list.php?' . api_get_cidreq() . '&action=delete&survey_id=' . $survey_id . '" onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('DeleteSurvey') . '?', ENT_QUOTES)) . '\')) return false;">' . Display::return_icon('delete.png', get_lang('DeleteSurvey'), '', ICON_SIZE_MEDIUM) . '</a>';
//$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_survey_in_another_language.php?id_survey='.$survey_id.'">'.Display::return_icon('copy.gif', get_lang('Copy')).'</a>';
$survey_actions .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/preview.php?' . api_get_cidreq() . '&survey_id=' . $survey_id . '">' . Display::return_icon('preview_view.png', get_lang('Preview'), '', ICON_SIZE_MEDIUM) . '</a>';
$survey_actions .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/survey_invite.php?' . api_get_cidreq() . '&survey_id=' . $survey_id . '">' . Display::return_icon('mail_send.png', get_lang('Publish'), '', ICON_SIZE_MEDIUM) . '</a>';
$survey_actions .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/reporting.php?' . api_get_cidreq() . '&survey_id=' . $survey_id . '">' . Display::return_icon('stats.png', get_lang('Reporting'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<div class="actions">' . $survey_actions . '</div>';