Minor - format code

1.10.x
Julio Montoya 10 years ago
parent 49e9ecf273
commit b5bd595b8a
  1. 8
      main/survey/fillsurvey.php
  2. 8
      main/survey/generate_link.php
  3. 14
      main/survey/link.php
  4. 11
      main/survey/preview.php
  5. 7
      main/survey/question.php
  6. 30
      main/survey/survey_invite.php

@ -1187,18 +1187,15 @@ if (isset($questions) && is_array($questions)) {
if ($survey_data['survey_type'] === '0') {
if ($survey_data['show_form_profile'] == 0) {
// The normal survey as always
if (($show < $numberofpages) || !$_GET['show']) { //$show = $_GET['show'] + 1
if (($show < $numberofpages) || !$_GET['show']) {
if ($show == 0) {
$form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success', 'large');
// echo '<button type="submit" name="next_survey_page" class="survey-next">'.get_lang('StartSurvey').'</button>';
} else {
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right');
//echo '<button type="submit" name="next_survey_page" class="survey-next">'.get_lang('Next').'</button>';
}
}
if ($show >= $numberofpages && $_GET['show']) {
$form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right');
//echo '<button type="submit" name="finish_survey" class="survey-next">'.get_lang('FinishSurvey').'</button>';
}
} else {
// The normal survey as always but with the form profile
@ -1207,16 +1204,13 @@ if ($survey_data['survey_type'] === '0') {
if (($show < $numberofpages) || !$_GET['show']) { //$show = $_GET['show'] + 1
if ($show == 0) {
$form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success', 'large');
//echo '<button type="submit" name="next_survey_page" class="next">'.get_lang('StartSurvey').'</button>';
} else {
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right');
//echo '<button type="submit" name="next_survey_page" class="next">'.get_lang('Next').'</button>';
}
}
if ($show >= $numberofpages && $_GET['show']) {
$form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right');
//echo '<button type="submit" name="finish_survey" class="next">'.get_lang('FinishSurvey').'</button>';
}
}
}

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
require_once '../inc/global.inc.php';
if (!api_is_allowed_to_edit(false, true)) {
@ -23,7 +24,12 @@ if (!SurveyManager::survey_generation_hash_available()) {
api_not_allowed(true);
}
$link = SurveyManager::generate_survey_link($survey_id, api_get_course_int_id(), api_get_session_id(), api_get_group_id());
$link = SurveyManager::generate_survey_link(
$survey_id,
api_get_course_int_id(),
api_get_session_id(),
api_get_group_id()
);
echo '<div class="row">';
echo '<div class="span12" style="text-align:center">';
echo Display::url(get_lang('GenerateSurveyAccessLink'), $link, array('class' => 'btn btn-primary btn-large'));

@ -13,9 +13,19 @@ if (!SurveyManager::survey_generation_hash_available()) {
}
$course_info = api_get_course_info_by_id($_REQUEST['c']);
$hash_is_valid = SurveyManager::validate_survey_hash($survey_id, $_REQUEST['c'], $_REQUEST['s'], $_REQUEST['g'], $_REQUEST['h']);
$hash_is_valid = SurveyManager::validate_survey_hash(
$survey_id,
$_REQUEST['c'],
$_REQUEST['s'],
$_REQUEST['g'],
$_REQUEST['h']
);
if ($hash_is_valid && $course_info) {
$survey_data = SurveyManager::get_survey($survey_id, null, $course_info['code']);
$survey_data = SurveyManager::get_survey(
$survey_id,
null,
$course_info['code']
);
$invitation_code = api_get_unique_id();

@ -9,7 +9,7 @@
* @version $Id: survey_list.php 10680 2007-01-11 21:26:23Z pcool $
*
*/
// Including the global initialization file
require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;
@ -34,9 +34,9 @@ $sql = "SELECT survey_invitation.user
LEFT JOIN $table_survey survey
ON survey_invitation.survey_code = survey.code
WHERE
survey_invitation.c_id = $course_id AND
survey.survey_id = $surveyId AND
survey_invitation.user = $userId";
survey_invitation.c_id = $course_id AND
survey.survey_id = $surveyId AND
survey_invitation.user = $userId";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
$userInvited = 1;
@ -221,10 +221,8 @@ if (api_is_course_admin() ||
if (($show < $numberofpages) || (!$_GET['show'] && count($questions) > 0)) {
if ($show == 0) {
$form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success', 'large');
//echo '<br /><button type="submit" name="next_survey_page" class="next">'.get_lang('StartSurvey').' </button>';
} else {
$form->addButton('next_survey_page', get_lang('NextQuestion'), 'arrow-right');
//echo '<br /><button type="submit" name="next_survey_page" class="next">'.get_lang('NextQuestion').' </button>';
}
}
if ($show >= $numberofpages && $_GET['show'] || (isset($_GET['show']) && count($questions) == 0)) {
@ -232,7 +230,6 @@ if (api_is_course_admin() ||
echo '<p>'.get_lang('ThereAreNotQuestionsForthisSurvey').'</p>';
}
$form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right');
//echo '<button type="submit" name="finish_survey" class="next">'.get_lang('FinishSurvey').' </button>';
}
$form->display();
} else {

@ -7,7 +7,7 @@
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts of the code
* @version $Id: question.php 21734 2009-07-02 17:12:41Z cvargas1 $
*/
// Including the global initialization file
require_once '../inc/global.inc.php';
$htmlHeadXtra[] = '<script>
@ -102,7 +102,7 @@ $possible_types = array(
// Actions
$actions = '<div class="actions">';
$actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.Security::remove_XSS($_GET['survey_id']).'">'.
$actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.intval($_GET['survey_id']).'">'.
Display::return_icon('back.png', get_lang('BackToSurvey'),'',ICON_SIZE_MEDIUM).'</a>';
$actions .= '</div>';
// Checking if it is a valid type
@ -161,7 +161,6 @@ if ($surveyQuestion->getForm()->validate()) {
Display::display_header($tool_name, 'Survey');
echo $surveyQuestion->getForm()->return_form();
// Footer
echo $surveyQuestion->getForm()->returnForm();
Display :: display_footer();

@ -12,7 +12,7 @@
* @todo check if the mailtext contains the **link** part, if not, add the link to the end
* @todo add rules: title and text cannot be empty
*/
// Including the global initialization file
require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;
@ -25,11 +25,11 @@ if (!api_is_allowed_to_edit(false, true)) {
}
// Database table definitions
$table_survey = Database :: get_course_table(TABLE_SURVEY);
$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION);
$table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
$table_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_survey = Database:: get_course_table(TABLE_SURVEY);
$table_survey_question = Database:: get_course_table(TABLE_SURVEY_QUESTION);
$table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);
$table_course = Database:: get_main_table(TABLE_MAIN_COURSE);
$table_user = Database:: get_main_table(TABLE_MAIN_USER);
$course_id = api_get_course_int_id();
@ -51,9 +51,15 @@ if (api_strlen(strip_tags($survey_data['title'])) > 40) {
// Breadcrumbs
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'survey/survey_list.php', 'name' => get_lang('SurveyList'));
if (api_is_course_admin()) {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id, 'name' => $urlname);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&'.api_get_cidreq(),
'name' => $urlname,
);
} else {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?survey_id='.$survey_id, 'name' => $urlname);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?survey_id='.$survey_id.'&'.api_get_cidreq(),
'name' => $urlname,
);
}
$tool_name = get_lang('SurveyPublication');
@ -79,9 +85,9 @@ if (Database::num_rows($result) > 1) {
// Invited / answered message
if ($survey_data['invited'] > 0 && !isset($_POST['submit'])) {
$message = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=answered&amp;survey_id='.$survey_data['survey_id'].'">'.$survey_data['answered'].'</a> ';
$message = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=answered&survey_id='.$survey_data['survey_id'].'">'.$survey_data['answered'].'</a> ';
$message .= get_lang('HaveAnswered').' ';
$message .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=invited&amp;survey_id='.$survey_data['survey_id'].'">'.$survey_data['invited'].'</a> ';
$message .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=invited&survey_id='.$survey_data['survey_id'].'">'.$survey_data['invited'].'</a> ';
$message .= get_lang('WereInvited');
Display::display_normal_message($message, false);
}
@ -243,10 +249,10 @@ if ($form->validate()) {
$row = Database::fetch_array($result);
$total_invited = $row['invited'];
if ($total_invited > 0) {
$message = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=answered&amp;survey_id='.$survey_data['survey_id'].'">'.
$message = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=answered&survey_id='.$survey_data['survey_id'].'">'.
$survey_data['answered'].'</a> ';
$message .= get_lang('HaveAnswered').' ';
$message .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=invited&amp;survey_id='.$survey_data['survey_id'].'">'.
$message .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=invited&survey_id='.$survey_data['survey_id'].'">'.
$total_invited.'</a> ';
$message .= get_lang('WereInvited');
Display::display_normal_message($message, false);

Loading…
Cancel
Save