@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | // Including the global initialization file |
11 | 11 | require_once '../inc/global.inc.php'; |
12 | 12 | |
13 | -$current_course_tool = TOOL_NOTEBOOK; |
|
13 | +$current_course_tool = TOOL_NOTEBOOK; |
|
14 | 14 | |
15 | 15 | // The section (tabs) |
16 | 16 | $this_section = SECTION_COURSES; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | NotebookManager::display_notes(); |
97 | 97 | } else { |
98 | 98 | echo '<div class="actions">'; |
99 | - echo '<a href="index.php">'.Display::return_icon('back.png',get_lang('BackToNotesList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
99 | + echo '<a href="index.php">'.Display::return_icon('back.png', get_lang('BackToNotesList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
100 | 100 | echo '</div>'; |
101 | 101 | $token = Security::get_token(); |
102 | 102 | $form->addElement('hidden', 'sec_token'); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } else { |
148 | 148 | echo '<div class="actions">'; |
149 | 149 | echo '<a href="index.php">'. |
150 | - Display::return_icon('back.png',get_lang('BackToNotesList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
150 | + Display::return_icon('back.png', get_lang('BackToNotesList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
151 | 151 | echo '</div>'; |
152 | 152 | $token = Security::get_token(); |
153 | 153 | $form->addElement('hidden', 'sec_token'); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $tool_name = get_lang('SurveyPublication'); |
65 | 65 | |
66 | 66 | // Displaying the header |
67 | -Display::display_header($tool_name,'Survey'); |
|
67 | +Display::display_header($tool_name, 'Survey'); |
|
68 | 68 | |
69 | 69 | echo '<script> |
70 | 70 | $(function() { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | ); |
133 | 133 | |
134 | 134 | $form->addElement('html', '<div id="check_mail">'); |
135 | -$form->addElement('checkbox', 'send_mail','', get_lang('SendMail')); |
|
135 | +$form->addElement('checkbox', 'send_mail', '', get_lang('SendMail')); |
|
136 | 136 | $form->addElement('html', '</div>'); |
137 | 137 | |
138 | 138 | $form->addElement('html', '<div id="mail_text_wrapper">'); |
@@ -219,8 +219,8 @@ discard block |
||
219 | 219 | ); |
220 | 220 | |
221 | 221 | // Saving the invitations for the additional users |
222 | - $values['additional_users'] = $values['additional_users'].';'; // This is for the case when you enter only one email |
|
223 | - $temp = str_replace(',', ';', $values['additional_users']); // This is to allow , and ; as email separators |
|
222 | + $values['additional_users'] = $values['additional_users'].';'; // This is for the case when you enter only one email |
|
223 | + $temp = str_replace(',', ';', $values['additional_users']); // This is to allow , and ; as email separators |
|
224 | 224 | $additional_users = explode(';', $temp); |
225 | 225 | for ($i = 0; $i < count($additional_users); $i++) { |
226 | 226 | $additional_users[$i] = trim($additional_users[$i]); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $now = api_get_utc_datetime(); |
113 | 113 | if (Database :: num_rows($result) == 0) { |
114 | 114 | $params = [ |
115 | - 'c_id' => $course_id , |
|
115 | + 'c_id' => $course_id, |
|
116 | 116 | 'survey_code' => $surveyCode, |
117 | 117 | 'user' => $userid, |
118 | 118 | 'invitation_code' => $autoInvitationcode, |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | $jquery_ready_content = $returnParams['jquery_ready_content']; |
472 | 472 | |
473 | 473 | // the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function |
474 | - $htmlHeadXtra[] ='<script> |
|
474 | + $htmlHeadXtra[] = '<script> |
|
475 | 475 | $(document).ready(function(){ |
476 | 476 | '.$jquery_ready_content.' |
477 | 477 | }); |
@@ -904,16 +904,16 @@ discard block |
||
904 | 904 | $group2 = $groups[0]; |
905 | 905 | $secondary .= " OR ( survey_group_sec1 = '$group1' AND survey_group_sec2 = '$group2') "; |
906 | 906 | $secondary .= " OR ( survey_group_sec1 = '$group2' AND survey_group_sec2 = '$group1' ) "; |
907 | - $combi.= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />'; |
|
907 | + $combi .= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />'; |
|
908 | 908 | } else { |
909 | 909 | if ($i != 0) { |
910 | 910 | $secondary .= " OR ( survey_group_sec1 = '$group1' AND survey_group_sec2 = '$group2') "; |
911 | 911 | $secondary .= " OR ( survey_group_sec1 = '$group2' AND survey_group_sec2 = '$group1' ) "; |
912 | - $combi.= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />'; |
|
912 | + $combi .= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />'; |
|
913 | 913 | } else { |
914 | 914 | $secondary .= " ( survey_group_sec1 = '$group1' AND survey_group_sec2 = '$group2') "; |
915 | 915 | $secondary .= " OR ( survey_group_sec1 = '$group2' AND survey_group_sec2 = '$group1' ) "; |
916 | - $combi.= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />'; |
|
916 | + $combi .= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />'; |
|
917 | 917 | } |
918 | 918 | } |
919 | 919 | } |
@@ -1132,7 +1132,7 @@ discard block |
||
1132 | 1132 | $questions[$row['sort']]['survey_group_sec1'] = $row['survey_group_sec1']; |
1133 | 1133 | $questions[$row['sort']]['survey_group_sec2'] = $row['survey_group_sec2']; |
1134 | 1134 | $questions[$row['sort']]['survey_group_pri'] = $row['survey_group_pri']; |
1135 | - } else { |
|
1135 | + } else { |
|
1136 | 1136 | // If the type is a page break we are finished loading the questions for this page |
1137 | 1137 | break; |
1138 | 1138 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $class = 'radio-inline'; |
44 | 44 | } |
45 | 45 | |
46 | - $name = 'question' . $questionData['question_id']; |
|
46 | + $name = 'question'.$questionData['question_id']; |
|
47 | 47 | |
48 | 48 | $form->addRadio( |
49 | 49 | $name, |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | // Actions bar |
150 | 150 | echo '<div class="actions">'; |
151 | 151 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'">'. |
152 | - Display::return_icon('back.png', get_lang('BackToSurvey'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
152 | + Display::return_icon('back.png', get_lang('BackToSurvey'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
153 | 153 | echo '</div>'; |
154 | 154 | |
155 | 155 | // Content |
@@ -159,15 +159,15 @@ discard block |
||
159 | 159 | ) { |
160 | 160 | $myweb_survey_id = $survey_id; |
161 | 161 | echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&survey_id='.$myweb_survey_id.'&'.$cidReq.'&single_page=1">'. |
162 | - Display::return_icon('survey_reporting_overall.png',get_lang('QuestionsOverallReport')).' '.get_lang('QuestionsOverallReport').'</a></div><div class="sectioncomment">'.get_lang('QuestionsOverallReportDetail').' </div>'; |
|
162 | + Display::return_icon('survey_reporting_overall.png', get_lang('QuestionsOverallReport')).' '.get_lang('QuestionsOverallReport').'</a></div><div class="sectioncomment">'.get_lang('QuestionsOverallReportDetail').' </div>'; |
|
163 | 163 | echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&survey_id='.$myweb_survey_id.'&'.$cidReq.'">'. |
164 | - Display::return_icon('survey_reporting_question.gif',get_lang('DetailedReportByQuestion')).' '.get_lang('DetailedReportByQuestion').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByQuestionDetail').' </div>'; |
|
164 | + Display::return_icon('survey_reporting_question.gif', get_lang('DetailedReportByQuestion')).' '.get_lang('DetailedReportByQuestion').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByQuestionDetail').' </div>'; |
|
165 | 165 | echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=userreport&survey_id='.$myweb_survey_id.'&'.$cidReq.'">'. |
166 | - Display::return_icon('survey_reporting_user.gif',get_lang('DetailedReportByUser')).' '.get_lang('DetailedReportByUser').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByUserDetail').'.</div>'; |
|
166 | + Display::return_icon('survey_reporting_user.gif', get_lang('DetailedReportByUser')).' '.get_lang('DetailedReportByUser').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByUserDetail').'.</div>'; |
|
167 | 167 | echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=comparativereport&survey_id='.$myweb_survey_id.'&'.$cidReq.'">'. |
168 | - Display::return_icon('survey_reporting_comparative.gif',get_lang('ComparativeReport')).' '.get_lang('ComparativeReport').'</a></div><div class="sectioncomment">'.get_lang('ComparativeReportDetail').'.</div>'; |
|
168 | + Display::return_icon('survey_reporting_comparative.gif', get_lang('ComparativeReport')).' '.get_lang('ComparativeReport').'</a></div><div class="sectioncomment">'.get_lang('ComparativeReportDetail').'.</div>'; |
|
169 | 169 | echo '<div class="sectiontitle"><a href="reporting.php?action=completereport&survey_id='.$myweb_survey_id.'&'.$cidReq.'">'. |
170 | - Display::return_icon('survey_reporting_complete.gif',get_lang('CompleteReport')).' '.get_lang('CompleteReport').'</a></div><div class="sectioncomment">'.get_lang('CompleteReportDetail').'</div>'; |
|
170 | + Display::return_icon('survey_reporting_complete.gif', get_lang('CompleteReport')).' '.get_lang('CompleteReport').'</a></div><div class="sectioncomment">'.get_lang('CompleteReportDetail').'</div>'; |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | // Footer |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | foreach ($formData['answers'] as $key => $value) { |
32 | 32 | $this->getForm()->addHtmlEditor('answers['.$key.']', null, false, false, $config); |
33 | 33 | |
34 | - if ($key < $total-1) { |
|
34 | + if ($key < $total - 1) { |
|
35 | 35 | //$this->getForm()->addButton("move_down[$key]", get_lang('Down')); |
36 | 36 | } |
37 | 37 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | //$this->getForm()->addButton("move_up[$key]", get_lang('Up')); |
40 | 40 | } |
41 | 41 | |
42 | - if ($total> 2) { |
|
42 | + if ($total > 2) { |
|
43 | 43 | $this->getForm()->addButton("delete_answer[$key]", get_lang('Delete'), 'trash', 'danger'); |
44 | 44 | } |
45 | 45 | } |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | $sql = 'SELECT id FROM '.Database :: get_course_table(TABLE_SURVEY_QUESTION_GROUP).' |
58 | 58 | WHERE |
59 | 59 | c_id = '.$course_id.' AND |
60 | - survey_id = '.(int)$_GET['survey_id'].' LIMIT 1'; |
|
60 | + survey_id = '.(int) $_GET['survey_id'].' LIMIT 1'; |
|
61 | 61 | $rs = Database::query($sql); |
62 | - if (Database::num_rows($rs)===0) { |
|
62 | + if (Database::num_rows($rs) === 0) { |
|
63 | 63 | Display::addFlash( |
64 | 64 | Display::return_message(get_lang('YouNeedToCreateGroups')) |
65 | 65 | ); |
66 | - header('Location: '.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.(int)$_GET['survey_id']); |
|
66 | + header('Location: '.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.(int) $_GET['survey_id']); |
|
67 | 67 | exit; |
68 | 68 | } |
69 | 69 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // Actions |
104 | 104 | $actions = '<div class="actions">'; |
105 | 105 | $actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.intval($_GET['survey_id']).'">'. |
106 | - Display::return_icon('back.png', get_lang('BackToSurvey'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
106 | + Display::return_icon('back.png', get_lang('BackToSurvey'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
107 | 107 | $actions .= '</div>'; |
108 | 108 | // Checking if it is a valid type |
109 | 109 | if (!in_array($_GET['type'], $possible_types)) { |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | |
22 | 22 | // Database table definitions |
23 | 23 | $table_survey = Database :: get_course_table(TABLE_SURVEY); |
24 | -$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
25 | -$table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION); |
|
24 | +$table_survey_question = Database :: get_course_table(TABLE_SURVEY_QUESTION); |
|
25 | +$table_survey_question_option = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION); |
|
26 | 26 | $table_course = Database :: get_main_table(TABLE_MAIN_COURSE); |
27 | -$table_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
28 | -$table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION); |
|
27 | +$table_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
28 | +$table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION); |
|
29 | 29 | |
30 | 30 | $tool_name = get_lang('SurveyInvitations'); |
31 | 31 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | if (!isset($_GET['view']) OR $_GET['view'] == 'invited') { |
80 | - echo get_lang('ViewInvited'). ' | '; |
|
80 | + echo get_lang('ViewInvited').' | '; |
|
81 | 81 | } else { |
82 | 82 | echo ' <a href="'.api_get_self().'?survey_id='.$survey_id.'&view=invited">'.get_lang('ViewInvited').'</a> |'; |
83 | 83 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | require_once '../inc/global.inc.php'; |
13 | 13 | |
14 | 14 | $this_section = SECTION_COURSES; |
15 | -$current_course_tool = TOOL_SURVEY; |
|
15 | +$current_course_tool = TOOL_SURVEY; |
|
16 | 16 | |
17 | 17 | api_protect_course_script(true); |
18 | 18 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | // Getting the survey information |
59 | 59 | if (!empty($_GET['survey_id'])) { |
60 | 60 | $course_code = api_get_course_id(); |
61 | - if ($course_code!=-1) { |
|
61 | + if ($course_code != -1) { |
|
62 | 62 | $survey_data = SurveyManager::get_survey($survey_id); |
63 | 63 | } else { |
64 | 64 | Display :: display_header(get_lang('ToolSurvey')); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | Database::query('UPDATE '.$table_survey_question_group.' SET description = \''.Database::escape_string($_POST['description']).'\' |
89 | 89 | WHERE c_id = '.$course_id.' AND id = \''.Database::escape_string($_POST['group_id']).'\''); |
90 | 90 | $sendmsg = 'GroupUpdatedSuccessfully'; |
91 | - } elseif(!empty($_POST['name'])) { |
|
91 | + } elseif (!empty($_POST['name'])) { |
|
92 | 92 | Database::query('INSERT INTO '.$table_survey_question_group.' (c_id, name,description,survey_id) values ('.$course_id.', \''.Database::escape_string($_POST['name']).'\',\''.Database::escape_string($_POST['description']).'\',\''.Database::escape_string($survey_id).'\') '); |
93 | 93 | $sendmsg = 'GroupCreatedSuccessfully'; |
94 | 94 | } else { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | if (isset($action)) { |
118 | 118 | if (($action == 'moveup' || $action == 'movedown') && isset($_GET['question_id'])) { |
119 | - SurveyManager::move_survey_question($my_action_survey,$my_question_id_survey,$my_survey_id_survey); |
|
119 | + SurveyManager::move_survey_question($my_action_survey, $my_question_id_survey, $my_survey_id_survey); |
|
120 | 120 | Display::display_confirmation_message(get_lang('SurveyQuestionMoved')); |
121 | 121 | } |
122 | 122 | if ($action == 'delete' AND is_numeric($_GET['question_id'])) { |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | SurveyUtil::check_first_last_question($_GET['survey_id']); |
131 | 131 | |
132 | 132 | // Action links |
133 | -$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>'; |
|
134 | -$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>'; |
|
133 | +$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>'; |
|
134 | +$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>'; |
|
135 | 135 | //$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>'; |
136 | -$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>'; |
|
137 | -$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>'; |
|
138 | -$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>'; |
|
136 | +$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>'; |
|
137 | +$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>'; |
|
138 | +$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>'; |
|
139 | 139 | echo '<div class="actions">'.$survey_actions.'</div>'; |
140 | 140 | |
141 | 141 | if ($survey_data['survey_type'] == 0) { |
@@ -217,24 +217,24 @@ discard block |
||
217 | 217 | echo ' <td>'.$tool_name.'</td>'; |
218 | 218 | echo ' <td>'.$row['number_of_options'].'</td>'; |
219 | 219 | echo ' <td>'; |
220 | - echo ' <a href="'.api_get_path(WEB_CODE_PATH).'survey/question.php?'.api_get_cidreq().'&action=edit&type='.$row['type'].'&survey_id='.$survey_id.'&question_id='.$row['question_id'].'">'.Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'; |
|
221 | - echo ' <a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&action=delete&survey_id='.$survey_id.'&question_id='.$row['question_id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("DeleteSurveyQuestion").'?',ENT_QUOTES,$charset)).'\')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
220 | + echo ' <a href="'.api_get_path(WEB_CODE_PATH).'survey/question.php?'.api_get_cidreq().'&action=edit&type='.$row['type'].'&survey_id='.$survey_id.'&question_id='.$row['question_id'].'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
|
221 | + echo ' <a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&action=delete&survey_id='.$survey_id.'&question_id='.$row['question_id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("DeleteSurveyQuestion").'?', ENT_QUOTES, $charset)).'\')) return false;">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
222 | 222 | if ($question_counter > 1) { |
223 | - echo ' <a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&action=moveup&survey_id='.$survey_id.'&question_id='.$row['question_id'].'">'.Display::return_icon('up.png', get_lang('MoveUp'),'',ICON_SIZE_SMALL).'</a>'; |
|
223 | + echo ' <a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&action=moveup&survey_id='.$survey_id.'&question_id='.$row['question_id'].'">'.Display::return_icon('up.png', get_lang('MoveUp'), '', ICON_SIZE_SMALL).'</a>'; |
|
224 | 224 | } else { |
225 | - Display::display_icon('up_na.png',' ','',ICON_SIZE_SMALL); |
|
225 | + Display::display_icon('up_na.png', ' ', '', ICON_SIZE_SMALL); |
|
226 | 226 | } |
227 | 227 | if ($question_counter < $question_counter_max) { |
228 | - echo ' <a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&action=movedown&survey_id='.$survey_id.'&question_id='.$row['question_id'].'">'.Display::return_icon('down.png', get_lang('MoveDown'),'',ICON_SIZE_SMALL).'</a>'; |
|
228 | + echo ' <a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&action=movedown&survey_id='.$survey_id.'&question_id='.$row['question_id'].'">'.Display::return_icon('down.png', get_lang('MoveDown'), '', ICON_SIZE_SMALL).'</a>'; |
|
229 | 229 | } else { |
230 | - Display::display_icon('down_na.png',' ','',ICON_SIZE_SMALL); |
|
230 | + Display::display_icon('down_na.png', ' ', '', ICON_SIZE_SMALL); |
|
231 | 231 | } |
232 | 232 | echo ' </td>'; |
233 | 233 | $question_counter++; |
234 | 234 | |
235 | 235 | if ($is_survey_type_1) { |
236 | - echo '<td>'.(($row['survey_group_pri']==0)?get_lang('Secondary'):get_lang('Primary')).'</td>'; |
|
237 | - echo '<td>'.(($row['survey_group_pri']==0)?$groups[$row['survey_group_sec1']].'-'.$groups[$row['survey_group_sec2']]:$groups[$row['survey_group_pri']]).'</td>'; |
|
236 | + echo '<td>'.(($row['survey_group_pri'] == 0) ? get_lang('Secondary') : get_lang('Primary')).'</td>'; |
|
237 | + echo '<td>'.(($row['survey_group_pri'] == 0) ? $groups[$row['survey_group_sec1']].'-'.$groups[$row['survey_group_sec2']] : $groups[$row['survey_group_pri']]).'</td>'; |
|
238 | 238 | } |
239 | 239 | echo '</tr>'; |
240 | 240 | } |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | echo Display::display_confirmation_message(get_lang($_GET['sendmsg']), false); |
249 | 249 | } |
250 | 250 | |
251 | - if (in_array($_GET['sendmsg'], array('GroupNeedName'))){ |
|
251 | + if (in_array($_GET['sendmsg'], array('GroupNeedName'))) { |
|
252 | 252 | echo Display::display_warning_message(get_lang($_GET['sendmsg']), false); |
253 | 253 | } |
254 | 254 | echo '<table border="0"><tr><td width="100">'.get_lang('Name').'</td><td>'.get_lang('Description').'</td></tr></table>'; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | if ($_GET['action'] == 'editgroup') { |
257 | 257 | $sql = 'SELECT name,description FROM '.$table_survey_question_group.' WHERE id = '.intval($_GET['gid']).' AND survey_id = '.intval($survey_id).' limit 1'; |
258 | 258 | $rs = Database::query($sql); |
259 | - $editedrow = Database::fetch_array($rs,'ASSOC'); |
|
259 | + $editedrow = Database::fetch_array($rs, 'ASSOC'); |
|
260 | 260 | echo '<input type="text" maxlength="20" name="name" value="'.$editedrow['name'].'" size="10" disabled>'; |
261 | 261 | echo '<input type="text" maxlength="150" name="description" value="'.$editedrow['description'].'" size="40">'; |
262 | 262 | echo '<input type="hidden" name="group_id" value="'.Security::remove_XSS($_GET['gid']).'">'; |
@@ -278,12 +278,12 @@ discard block |
||
278 | 278 | $sql = 'SELECT id,name,description FROM '.$table_survey_question_group.' WHERE c_id = '.$course_id.' AND survey_id = '.intval($survey_id).' ORDER BY name'; |
279 | 279 | |
280 | 280 | $rs = Database::query($sql); |
281 | - while($row = Database::fetch_array($rs,ASSOC)){ |
|
281 | + while ($row = Database::fetch_array($rs, ASSOC)) { |
|
282 | 282 | $grouplist .= '<tr><td>'.$row['name'].'</td><td>'.$row['description'].'</td><td>'. |
283 | 283 | '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&gid='.$row['id'].'&action=editgroup">'. |
284 | - Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a> '. |
|
285 | - '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&gid='.$row['id'].'&action=deletegroup" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('DeleteSurveyGroup'),$row['name']).'?',ENT_QUOTES)).'\')) return false;">'. |
|
286 | - Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. |
|
284 | + Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a> '. |
|
285 | + '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&gid='.$row['id'].'&action=deletegroup" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('DeleteSurveyGroup'), $row['name']).'?', ENT_QUOTES)).'\')) return false;">'. |
|
286 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'. |
|
287 | 287 | '</td></tr>'; |
288 | 288 | } |
289 | 289 | echo $grouplist.'</table>'; |