@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | $cidReset = true; |
13 | 13 | require_once '../inc/global.inc.php'; |
14 | -$current_course_tool = TOOL_COURSE_MAINTENANCE; |
|
14 | +$current_course_tool = TOOL_COURSE_MAINTENANCE; |
|
15 | 15 | |
16 | 16 | api_protect_global_admin_script(); |
17 | 17 | api_protect_limit_for_session_admin(); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | function display_form() |
84 | 84 | { |
85 | - $html = ''; |
|
85 | + $html = ''; |
|
86 | 86 | $sessions = SessionManager::get_sessions_list(array(), array('name', 'ASC')); |
87 | 87 | |
88 | 88 | // Actions |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | //destination |
111 | 111 | $html .= '<div class="form-group">'; |
112 | - $html .= '<label class="col-sm-2 control-label">' . get_lang('DestinationCoursesFromSession') . ': </label>'; |
|
112 | + $html .= '<label class="col-sm-2 control-label">'.get_lang('DestinationCoursesFromSession').': </label>'; |
|
113 | 113 | $html .= '<div class="col-sm-5" id="ajax_sessions_list_destination">'; |
114 | 114 | $html .= '<select class="form-control" name="sessions_list_destination" onchange="javascript: xajax_search_courses(this.value,\'destination\');">'; |
115 | 115 | $html .= '<option value = "0">'.get_lang('ThereIsNotStillASession').'</option></select ></div>'; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $html .= '<button class="btn btn-success" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;"><em class="fa fa-files-o"></em> '.get_lang('CopyCourse').'</button>'; |
132 | 132 | |
133 | 133 | // Add Security token |
134 | - $html .= '<input type="hidden" value="' . Security::get_token() . '" name="sec_token">'; |
|
134 | + $html .= '<input type="hidden" value="'.Security::get_token().'" name="sec_token">'; |
|
135 | 135 | $html .= '</div></div>'; |
136 | 136 | |
137 | 137 | $html .= '</form>'; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | |
230 | 230 | /* HTML head extra */ |
231 | 231 | |
232 | -$htmlHeadXtra[] = $xajax->getJavascript( api_get_path(WEB_LIBRARY_PATH).'xajax/'); |
|
232 | +$htmlHeadXtra[] = $xajax->getJavascript(api_get_path(WEB_LIBRARY_PATH).'xajax/'); |
|
233 | 233 | $htmlHeadXtra[] = '<script type="text/javascript"> |
234 | 234 | function checkSelected(id_select,id_radio,id_title,id_destination) { |
235 | 235 | var num=0; |
@@ -299,22 +299,22 @@ discard block |
||
299 | 299 | display_form(); |
300 | 300 | } else { |
301 | 301 | |
302 | - $arr_course_origin = array(); |
|
302 | + $arr_course_origin = array(); |
|
303 | 303 | $arr_course_destination = array(); |
304 | - $destination_session = ''; |
|
305 | - $origin_session = ''; |
|
304 | + $destination_session = ''; |
|
305 | + $origin_session = ''; |
|
306 | 306 | |
307 | 307 | if (isset($_POST['SessionCoursesListOrigin'])) { |
308 | - $arr_course_origin = $_POST['SessionCoursesListOrigin']; |
|
308 | + $arr_course_origin = $_POST['SessionCoursesListOrigin']; |
|
309 | 309 | } |
310 | 310 | if (isset($_POST['SessionCoursesListDestination'])) { |
311 | 311 | $arr_course_destination = $_POST['SessionCoursesListDestination']; |
312 | 312 | } |
313 | 313 | if (isset($_POST['sessions_list_destination'])) { |
314 | - $destination_session = $_POST['sessions_list_destination']; |
|
314 | + $destination_session = $_POST['sessions_list_destination']; |
|
315 | 315 | } |
316 | 316 | if (isset($_POST['sessions_list_origin'])) { |
317 | - $origin_session = $_POST['sessions_list_origin']; |
|
317 | + $origin_session = $_POST['sessions_list_origin']; |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | if ((is_array($arr_course_origin) && count($arr_course_origin) > 0) && !empty($destination_session)) { |
@@ -354,22 +354,22 @@ discard block |
||
354 | 354 | Display::display_normal_message(get_lang('ToExportDocumentsWithGlossaryYouHaveToSelectGlossary')); |
355 | 355 | } |
356 | 356 | |
357 | - $arr_course_origin = array(); |
|
357 | + $arr_course_origin = array(); |
|
358 | 358 | $arr_course_destination = array(); |
359 | - $destination_session = ''; |
|
360 | - $origin_session = ''; |
|
359 | + $destination_session = ''; |
|
360 | + $origin_session = ''; |
|
361 | 361 | |
362 | 362 | if (isset($_POST['SessionCoursesListOrigin'])) { |
363 | - $arr_course_origin = $_POST['SessionCoursesListOrigin']; |
|
363 | + $arr_course_origin = $_POST['SessionCoursesListOrigin']; |
|
364 | 364 | } |
365 | 365 | if (isset($_POST['SessionCoursesListDestination'])) { |
366 | 366 | $arr_course_destination = $_POST['SessionCoursesListDestination']; |
367 | 367 | } |
368 | 368 | if (isset($_POST['sessions_list_destination'])) { |
369 | - $destination_session = $_POST['sessions_list_destination']; |
|
369 | + $destination_session = $_POST['sessions_list_destination']; |
|
370 | 370 | } |
371 | 371 | if (isset($_POST['sessions_list_origin'])) { |
372 | - $origin_session = $_POST['sessions_list_origin']; |
|
372 | + $origin_session = $_POST['sessions_list_origin']; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | if ((is_array($arr_course_origin) && count($arr_course_origin) > 0) && !empty($destination_session)) { |
@@ -378,10 +378,10 @@ discard block |
||
378 | 378 | $cb = new CourseBuilder('', $course_origin); |
379 | 379 | $course = $cb->build($origin_session, $arr_course_origin[0], $with_base_content); |
380 | 380 | //$hiddenFields['same_file_name_option'] = $_POST['same_file_name_option']; |
381 | - $hiddenFields['destination_course'] = $arr_course_destination[0]; |
|
382 | - $hiddenFields['origin_course'] = $arr_course_origin[0]; |
|
383 | - $hiddenFields['destination_session'] = $destination_session; |
|
384 | - $hiddenFields['origin_session'] = $origin_session; |
|
381 | + $hiddenFields['destination_course'] = $arr_course_destination[0]; |
|
382 | + $hiddenFields['origin_course'] = $arr_course_origin[0]; |
|
383 | + $hiddenFields['destination_session'] = $destination_session; |
|
384 | + $hiddenFields['origin_session'] = $origin_session; |
|
385 | 385 | // Add token to Course select form |
386 | 386 | $hiddenFields['sec_token'] = Security::get_token(); |
387 | 387 |
@@ -65,6 +65,9 @@ |
||
65 | 65 | |
66 | 66 | /* FUNCTIONS */ |
67 | 67 | |
68 | +/** |
|
69 | + * @param string $name |
|
70 | + */ |
|
68 | 71 | function make_select_session_list($name, $sessions, $attr = array()) |
69 | 72 | { |
70 | 73 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $nameTools = get_lang('CopyCourse'); |
49 | 49 | $returnLink = api_get_path( |
50 | 50 | WEB_CODE_PATH |
51 | - ) . 'course_info/maintenance_coach.php?' . api_get_cidreq(); |
|
51 | + ).'course_info/maintenance_coach.php?'.api_get_cidreq(); |
|
52 | 52 | $interbreadcrumb[] = array( |
53 | 53 | 'url' => $returnLink, |
54 | 54 | 'name' => get_lang('Maintenance') |
@@ -71,29 +71,29 @@ discard block |
||
71 | 71 | $attrs = ''; |
72 | 72 | if (count($attr) > 0) { |
73 | 73 | foreach ($attr as $key => $value) { |
74 | - $attrs .= ' ' . $key . '="' . $value . '"'; |
|
74 | + $attrs .= ' '.$key.'="'.$value.'"'; |
|
75 | 75 | } |
76 | 76 | } |
77 | - $output = '<select name="' . $name . '" ' . $attrs . '>'; |
|
77 | + $output = '<select name="'.$name.'" '.$attrs.'>'; |
|
78 | 78 | |
79 | 79 | if (count($sessions) == 0) { |
80 | - $output .= '<option value = "0">' . get_lang( |
|
80 | + $output .= '<option value = "0">'.get_lang( |
|
81 | 81 | 'ThereIsNotStillASession' |
82 | - ) . '</option>'; |
|
82 | + ).'</option>'; |
|
83 | 83 | } else { |
84 | - $output .= '<option value = "0">' . get_lang( |
|
84 | + $output .= '<option value = "0">'.get_lang( |
|
85 | 85 | 'SelectASession' |
86 | - ) . '</option>'; |
|
86 | + ).'</option>'; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | if (is_array($sessions)) { |
90 | 90 | foreach ($sessions as $session) { |
91 | 91 | $category_name = ''; |
92 | 92 | if (!empty($session['category_name'])) { |
93 | - $category_name = ' (' . $session['category_name'] . ')'; |
|
93 | + $category_name = ' ('.$session['category_name'].')'; |
|
94 | 94 | } |
95 | 95 | |
96 | - $output .= '<option value="' . $session['id'] . '">' . $session['name'] . ' ' . $category_name . '</option>'; |
|
96 | + $output .= '<option value="'.$session['id'].'">'.$session['name'].' '.$category_name.'</option>'; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | $output .= '</select>'; |
@@ -118,43 +118,43 @@ discard block |
||
118 | 118 | // Actions |
119 | 119 | $html .= '<div class="actions">'; |
120 | 120 | // Link back to the documents overview |
121 | - $html .= '<a href="' . $returnLink . '">' . Display::return_icon( |
|
122 | - 'back.png', get_lang('BackTo') . ' ' . get_lang('Maintenance'), '', ICON_SIZE_MEDIUM |
|
123 | - ) . '</a>'; |
|
121 | + $html .= '<a href="'.$returnLink.'">'.Display::return_icon( |
|
122 | + 'back.png', get_lang('BackTo').' '.get_lang('Maintenance'), '', ICON_SIZE_MEDIUM |
|
123 | + ).'</a>'; |
|
124 | 124 | $html .= '</div>'; |
125 | 125 | |
126 | 126 | $html .= Display::return_message( |
127 | 127 | get_lang('CopyCourseFromSessionToSessionExplanation') |
128 | 128 | ); |
129 | 129 | |
130 | - $html .= '<form name="formulaire" method="post" action="' . api_get_self( |
|
131 | - ) . '?' . api_get_cidreq() . '" >'; |
|
130 | + $html .= '<form name="formulaire" method="post" action="'.api_get_self( |
|
131 | + ).'?'.api_get_cidreq().'" >'; |
|
132 | 132 | $html .= '<table border="0" cellpadding="5" cellspacing="0" width="100%">'; |
133 | 133 | |
134 | 134 | // Source |
135 | - $html .= '<tr><td width="15%"><b>' . get_lang( |
|
135 | + $html .= '<tr><td width="15%"><b>'.get_lang( |
|
136 | 136 | 'OriginCoursesFromSession' |
137 | - ) . ':</b></td>'; |
|
138 | - $html .= '<td width="10%" align="left">' . api_get_session_name( |
|
137 | + ).':</b></td>'; |
|
138 | + $html .= '<td width="10%" align="left">'.api_get_session_name( |
|
139 | 139 | $sessionId |
140 | - ) . '</td>'; |
|
140 | + ).'</td>'; |
|
141 | 141 | $html .= '<td width="50%">'; |
142 | - $html .= "{$courseInfo['title']} ({$courseInfo['code']})" . '</td></tr>'; |
|
142 | + $html .= "{$courseInfo['title']} ({$courseInfo['code']})".'</td></tr>'; |
|
143 | 143 | |
144 | 144 | // Destination |
145 | - $html .= '<tr><td width="15%"><b>' . get_lang( |
|
145 | + $html .= '<tr><td width="15%"><b>'.get_lang( |
|
146 | 146 | 'DestinationCoursesFromSession' |
147 | - ) . ':</b></td>'; |
|
147 | + ).':</b></td>'; |
|
148 | 148 | $html .= '<td width="10%" align="left"><div id="ajax_sessions_list_destination">'; |
149 | 149 | $html .= '<select name="sessions_list_destination" onchange="javascript: xajax_searchCourses(this.value,\'destination\');">'; |
150 | 150 | if (empty($sessions)) { |
151 | - $html .= '<option value = "0">' . get_lang( |
|
151 | + $html .= '<option value = "0">'.get_lang( |
|
152 | 152 | 'ThereIsNotStillASession' |
153 | - ) . '</option>'; |
|
153 | + ).'</option>'; |
|
154 | 154 | } else { |
155 | - $html .= '<option value = "0">' . get_lang( |
|
155 | + $html .= '<option value = "0">'.get_lang( |
|
156 | 156 | 'SelectASession' |
157 | - ) . '</option>'; |
|
157 | + ).'</option>'; |
|
158 | 158 | foreach ($sessions as $session) { |
159 | 159 | if ($session['id'] == $sessionId) { |
160 | 160 | continue; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | continue; |
165 | 165 | } |
166 | 166 | |
167 | - $html .= '<option value="' . $session['id'] . '">' . $session['name'] . '</option>'; |
|
167 | + $html .= '<option value="'.$session['id'].'">'.$session['name'].'</option>'; |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
@@ -176,17 +176,17 @@ discard block |
||
176 | 176 | $html .= '</tr></table>'; |
177 | 177 | |
178 | 178 | $html .= "<fieldset>"; |
179 | - $html .= '<legend>' . get_lang('TypeOfCopy') . ' <small>(' . get_lang('CopyOnlySessionItems') . ')</small></legend>'; |
|
179 | + $html .= '<legend>'.get_lang('TypeOfCopy').' <small>('.get_lang('CopyOnlySessionItems').')</small></legend>'; |
|
180 | 180 | $html .= '<label class="radio"><input type="radio" id="copy_option_1" name="copy_option" value="full_copy" checked="checked"/>'; |
181 | - $html .= get_lang('FullCopy') . '</label>'; |
|
181 | + $html .= get_lang('FullCopy').'</label>'; |
|
182 | 182 | $html .= '<label class="radio"><input type="radio" id="copy_option_2" name="copy_option" value="select_items"/>'; |
183 | - $html .= ' ' . get_lang('LetMeSelectItems') . '</label><br/>'; |
|
183 | + $html .= ' '.get_lang('LetMeSelectItems').'</label><br/>'; |
|
184 | 184 | |
185 | 185 | $html .= "</fieldset>"; |
186 | 186 | |
187 | - $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm(' . "'" . addslashes( |
|
187 | + $html .= '<button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes( |
|
188 | 188 | api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES) |
189 | - ) . "'" . ')) return false;">' . get_lang('CopyCourse') . '</button>'; |
|
189 | + )."'".')) return false;">'.get_lang('CopyCourse').'</button>'; |
|
190 | 190 | $html .= '</form>'; |
191 | 191 | echo $html; |
192 | 192 | } |
@@ -212,10 +212,10 @@ discard block |
||
212 | 212 | |
213 | 213 | $courseTitle = str_replace("'", "\'", $course['title']); |
214 | 214 | |
215 | - $return .= '<option value="' . $course['code'] . '" title="' . @htmlspecialchars( |
|
216 | - $course['title'] . ' (' . $course['visual_code'] . ')', ENT_QUOTES, api_get_system_encoding() |
|
217 | - ) . '">' . |
|
218 | - $course['title'] . ' (' . $course['visual_code'] . ')</option>'; |
|
215 | + $return .= '<option value="'.$course['code'].'" title="'.@htmlspecialchars( |
|
216 | + $course['title'].' ('.$course['visual_code'].')', ENT_QUOTES, api_get_system_encoding() |
|
217 | + ).'">'. |
|
218 | + $course['title'].' ('.$course['visual_code'].')</option>'; |
|
219 | 219 | } |
220 | 220 | $return .= '</select>'; |
221 | 221 | $_SESSION['course_list_destination'] = $course_list_destination; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | /* HTML head extra */ |
234 | 234 | |
235 | 235 | $htmlHeadXtra[] = $xajax->getJavascript( |
236 | - api_get_path(WEB_LIBRARY_PATH) . 'xajax/' |
|
236 | + api_get_path(WEB_LIBRARY_PATH).'xajax/' |
|
237 | 237 | ); |
238 | 238 | $htmlHeadXtra[] = '<script> |
239 | 239 | function checkSelected(id_select,id_radio,id_title,id_destination) { |
@@ -378,13 +378,13 @@ discard block |
||
378 | 378 | |
379 | 379 | CourseSelectForm :: display_form($course, $hiddenFields, true); |
380 | 380 | |
381 | - echo '<div style="float:right"><a href="javascript:window.history.go(-1);">' . |
|
381 | + echo '<div style="float:right"><a href="javascript:window.history.go(-1);">'. |
|
382 | 382 | Display::return_icon( |
383 | - 'back.png', get_lang('Back') . ' ' . get_lang('To') . ' ' . get_lang( |
|
383 | + 'back.png', get_lang('Back').' '.get_lang('To').' '.get_lang( |
|
384 | 384 | 'PlatformAdmin' |
385 | 385 | ), array('style' => 'vertical-align:middle') |
386 | - ) . |
|
387 | - get_lang('Back') . '</a></div>'; |
|
386 | + ). |
|
387 | + get_lang('Back').'</a></div>'; |
|
388 | 388 | } else { |
389 | 389 | Display::display_error_message( |
390 | 390 | get_lang('You must select a course from original session and select a destination session') |
@@ -98,21 +98,21 @@ discard block |
||
98 | 98 | $cr->set_file_option($_POST['same_file_name_option']); |
99 | 99 | $cr->restore(); |
100 | 100 | Display::display_normal_message(get_lang('ImportFinished')); |
101 | - echo '<a class="btn btn-default" href="' . api_get_path(WEB_COURSE_PATH) . api_get_course_path() . '/index.php">' . get_lang('CourseHomepage') . '</a>'; |
|
101 | + echo '<a class="btn btn-default" href="'.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/index.php">'.get_lang('CourseHomepage').'</a>'; |
|
102 | 102 | } else { |
103 | 103 | if (!$error) { |
104 | 104 | Display::display_warning_message(get_lang('NoResourcesInBackupFile')); |
105 | - echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>'; |
|
105 | + echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>'; |
|
106 | 106 | } elseif ($filename === false) { |
107 | 107 | Display::display_error_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin')); |
108 | - echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>'; |
|
108 | + echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>'; |
|
109 | 109 | } else { |
110 | 110 | if ($filename == '') { |
111 | 111 | Display::display_error_message(get_lang('SelectBackupFile')); |
112 | - echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>'; |
|
112 | + echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>'; |
|
113 | 113 | } else { |
114 | 114 | Display::display_error_message(get_lang('UploadError')); |
115 | - echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>'; |
|
115 | + echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>'; |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | } |
@@ -142,10 +142,10 @@ discard block |
||
142 | 142 | CourseSelectForm::display_form($course, $hiddenFields); |
143 | 143 | } elseif ($filename === false) { |
144 | 144 | Display::display_error_message(get_lang('ArchivesDirectoryNotWriteableContactAdmin')); |
145 | - echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>'; |
|
145 | + echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>'; |
|
146 | 146 | } else { |
147 | 147 | Display::display_warning_message(get_lang('NoResourcesInBackupFile')); |
148 | - echo '<a class="btn btn-default" href="import_backup.php?' . api_get_cidreq() . '">' . get_lang('TryAgain') . '</a>'; |
|
148 | + echo '<a class="btn btn-default" href="import_backup.php?'.api_get_cidreq().'">'.get_lang('TryAgain').'</a>'; |
|
149 | 149 | } |
150 | 150 | } else { |
151 | 151 | $user = api_get_user_info(); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $form = new FormValidator( |
158 | 158 | 'import_backup_form', |
159 | 159 | 'post', |
160 | - api_get_path(WEB_CODE_PATH) . 'coursecopy/import_backup.php?' . api_get_cidreq(), |
|
160 | + api_get_path(WEB_CODE_PATH).'coursecopy/import_backup.php?'.api_get_cidreq(), |
|
161 | 161 | '', |
162 | 162 | array('enctype' => 'multipart/form-data') |
163 | 163 | ); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | ); |
190 | 190 | $options['null'] = '-'; |
191 | 191 | foreach ($backups as $index => $backup) { |
192 | - $options[$backup['file']] = $backup['course_code'] . ' (' . $backup['date'] . ')'; |
|
192 | + $options[$backup['file']] = $backup['course_code'].' ('.$backup['date'].')'; |
|
193 | 193 | } |
194 | 194 | $form->addElement( |
195 | 195 | 'select', |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | 'radio', |
208 | 208 | '', |
209 | 209 | '', |
210 | - '<i>' . get_lang('NoBackupsAvailable') . '</i>', |
|
210 | + '<i>'.get_lang('NoBackupsAvailable').'</i>', |
|
211 | 211 | '', |
212 | 212 | 'disabled="true"' |
213 | 213 | ); |
@@ -10,7 +10,7 @@ |
||
10 | 10 | $this_section = SECTION_COURSES; |
11 | 11 | |
12 | 12 | if (extension_loaded('xapian')) { |
13 | - require '../newscorm/lp_list_search.php'; |
|
13 | + require '../newscorm/lp_list_search.php'; |
|
14 | 14 | } else { |
15 | 15 | Display::display_header(get_lang('Search')); |
16 | 16 | Display::display_error_message(get_lang('SearchXapianModuleNotInstalled')); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | require_once '../inc/global.inc.php'; |
10 | -$this_section = SECTION_COURSES; |
|
10 | +$this_section = SECTION_COURSES; |
|
11 | 11 | |
12 | 12 | if (extension_loaded('xapian')) { |
13 | 13 | require '../newscorm/lp_list_search.php'; |
@@ -104,6 +104,8 @@ |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | $q = strtolower($_GET["q"]); |
107 | -if (!$q) return; |
|
107 | +if (!$q) { |
|
108 | + return; |
|
109 | +} |
|
108 | 110 | //echo $q . "| value\n"; |
109 | 111 | get_suggestions_from_search_engine($q); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package chamilo.search |
7 | 7 | */ |
8 | 8 | |
9 | -require_once dirname(__FILE__) . '/../inc/global.inc.php'; |
|
9 | +require_once dirname(__FILE__).'/../inc/global.inc.php'; |
|
10 | 10 | |
11 | 11 | function get_suggestions_from_search_engine($q) |
12 | 12 | { |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | global $charset; |
15 | 15 | |
16 | 16 | $json = []; |
17 | - $table_sfv = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES); |
|
17 | + $table_sfv = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES); |
|
18 | 18 | $q = Database::escape_string($q); |
19 | 19 | $cid = api_get_course_id(); |
20 | 20 | $sql_add = ''; |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | $i = 0; |
29 | 29 | while ($row = Database::fetch_array($sql_result)) { |
30 | 30 | $json[] = [ |
31 | - 'id' => api_convert_encoding($row['value'],'UTF-8',$charset), |
|
32 | - 'value' => api_convert_encoding($row['value'],'UTF-8',$charset), |
|
33 | - 'label' => api_convert_encoding($row['value'],'UTF-8',$charset) |
|
31 | + 'id' => api_convert_encoding($row['value'], 'UTF-8', $charset), |
|
32 | + 'value' => api_convert_encoding($row['value'], 'UTF-8', $charset), |
|
33 | + 'label' => api_convert_encoding($row['value'], 'UTF-8', $charset) |
|
34 | 34 | ]; |
35 | 35 | |
36 | - if ($i<20) { |
|
37 | - $data[ $row['course_code'] ] [ $row['tool_id'] ] [ $row['ref_id'] ] = 1; |
|
36 | + if ($i < 20) { |
|
37 | + $data[$row['course_code']] [$row['tool_id']] [$row['ref_id']] = 1; |
|
38 | 38 | } |
39 | 39 | $i++; |
40 | 40 | } |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | // will create a copy as Yannick - Car - Speed |
79 | 79 | // in $output[3] |
80 | 80 | $c = count($output); |
81 | - for ($i=0;$i<$c; $i++) { |
|
82 | - $output[($c+$i)] = $current_field_val; |
|
81 | + for ($i = 0; $i < $c; $i++) { |
|
82 | + $output[($c + $i)] = $current_field_val; |
|
83 | 83 | } |
84 | 84 | } else { |
85 | 85 | //no identical field id, continue as usual |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | } |
97 | 97 | } |
98 | 98 | foreach ($output as $i=>$out) { |
99 | - if (api_stristr($out,$q) === false) {continue;} |
|
99 | + if (api_stristr($out, $q) === false) {continue; } |
|
100 | 100 | $s = api_convert_encoding(substr($out, 0, -3), 'UTF-8', $charset); |
101 | - if (!in_array($s,$more_sugg)) { |
|
101 | + if (!in_array($s, $more_sugg)) { |
|
102 | 102 | $more_sugg[] = $s; |
103 | 103 | $json[] = [ |
104 | 104 | 'id' => $s, |
@@ -101,8 +101,8 @@ |
||
101 | 101 | $group_url = "group_view.php?id=$id"; |
102 | 102 | |
103 | 103 | $result['name'] = '<div class="group-name">'.Display::url( |
104 | - api_ucwords(cut($result['name'], 40, true)), $group_url) |
|
105 | - .'</div><div class="count-username">'. |
|
104 | + api_ucwords(cut($result['name'], 40, true)), $group_url) |
|
105 | + .'</div><div class="count-username">'. |
|
106 | 106 | Display::returnFontAwesomeIcon('user').$result['count'].'</div>'; |
107 | 107 | |
108 | 108 | $picture = $userGroup->get_picture_group( |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | api_block_anonymous_users(); |
21 | 21 | |
22 | 22 | if (api_get_setting('allow_social_tool') != 'true') { |
23 | - $url = api_get_path(WEB_CODE_PATH) . 'auth/profile.php'; |
|
24 | - header('Location: ' . $url); |
|
23 | + $url = api_get_path(WEB_CODE_PATH).'auth/profile.php'; |
|
24 | + header('Location: '.$url); |
|
25 | 25 | exit; |
26 | 26 | } |
27 | 27 | |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | $allowed_picture_types = api_get_supported_image_extensions(); |
46 | 46 | $form->addRule( |
47 | 47 | 'picture', |
48 | - get_lang('OnlyImagesAllowed') . ' (' . implode( |
|
48 | + get_lang('OnlyImagesAllowed').' ('.implode( |
|
49 | 49 | ',', |
50 | 50 | $allowed_picture_types |
51 | - ) . ')', |
|
51 | + ).')', |
|
52 | 52 | 'filetype', |
53 | 53 | $allowed_picture_types |
54 | 54 | ); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $table_user = Database :: get_main_table(TABLE_MAIN_USER); |
68 | 68 | |
69 | 69 | $sql = "UPDATE $table_user |
70 | - SET picture_uri = '$new_picture' WHERE user_id = " . api_get_user_id(); |
|
70 | + SET picture_uri = '$new_picture' WHERE user_id = ".api_get_user_id(); |
|
71 | 71 | |
72 | 72 | $result = Database::query($sql); |
73 | 73 | } |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | $result['name'] = Security::remove_XSS($result['name'], STUDENT, true); |
94 | 94 | |
95 | 95 | if ($result['count'] == 1) { |
96 | - $result['count'] = '1 ' . get_lang('Member'); |
|
96 | + $result['count'] = '1 '.get_lang('Member'); |
|
97 | 97 | } else { |
98 | - $result['count'] = $result['count'] . ' ' . get_lang('Members'); |
|
98 | + $result['count'] = $result['count'].' '.get_lang('Members'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $group_url = "group_view.php?id=$id"; |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | 80 |
112 | 112 | ); |
113 | 113 | |
114 | - $result['picture'] = '<img class="group-image" src="' . $picture['file'] . '" />'; |
|
115 | - $group_actions = '<div class="group-more"><a href="groups.php?#tab_browse-2">' . get_lang('SeeMore') . '</a></div>'; |
|
116 | - $group_info= '<div class="description"><p>' . cut($result['description'], 120, true) . "</p></div>"; |
|
114 | + $result['picture'] = '<img class="group-image" src="'.$picture['file'].'" />'; |
|
115 | + $group_actions = '<div class="group-more"><a href="groups.php?#tab_browse-2">'.get_lang('SeeMore').'</a></div>'; |
|
116 | + $group_info = '<div class="description"><p>'.cut($result['description'], 120, true)."</p></div>"; |
|
117 | 117 | $groups_newest[] = array( |
118 | 118 | Display::url( |
119 | 119 | $result['picture'], |
@@ -140,12 +140,12 @@ discard block |
||
140 | 140 | $group_url = "group_view.php?id=$id"; |
141 | 141 | |
142 | 142 | if ($result['count'] == 1) { |
143 | - $result['count'] = '1 ' . get_lang('Member'); |
|
143 | + $result['count'] = '1 '.get_lang('Member'); |
|
144 | 144 | } else { |
145 | - $result['count'] = $result['count'] . ' ' . get_lang('Members'); |
|
145 | + $result['count'] = $result['count'].' '.get_lang('Members'); |
|
146 | 146 | } |
147 | 147 | $result['name'] = '<div class="group-name">'.Display::url( |
148 | - api_ucwords(cut($result['name'], 40, true)),$group_url) |
|
148 | + api_ucwords(cut($result['name'], 40, true)), $group_url) |
|
149 | 149 | .'</div><div class="count-username">'.Display::returnFontAwesomeIcon('user').$result['count'].'</div>'; |
150 | 150 | |
151 | 151 | $picture = $userGroup->get_picture_group( |
@@ -153,42 +153,42 @@ discard block |
||
153 | 153 | $result['picture'], |
154 | 154 | 80 |
155 | 155 | ); |
156 | - $result['picture_uri'] = '<img class="group-image" src="' . $picture['file'] . '" />'; |
|
157 | - $group_actions = '<div class="group-more" ><a href="groups.php?#tab_browse-3">' . get_lang('SeeMore') . '</a></div>'; |
|
158 | - $group_info= '<div class="description"><p>' . cut($result['description'], 120, true) . "</p></div>"; |
|
156 | + $result['picture_uri'] = '<img class="group-image" src="'.$picture['file'].'" />'; |
|
157 | + $group_actions = '<div class="group-more" ><a href="groups.php?#tab_browse-3">'.get_lang('SeeMore').'</a></div>'; |
|
158 | + $group_info = '<div class="description"><p>'.cut($result['description'], 120, true)."</p></div>"; |
|
159 | 159 | $groups_pop[] = array( |
160 | 160 | Display::url($result['picture_uri'], $group_url), |
161 | - $result['name'],$group_info. $group_actions |
|
161 | + $result['name'], $group_info.$group_actions |
|
162 | 162 | ); |
163 | 163 | } |
164 | 164 | |
165 | -$list=count($groups_newest); |
|
165 | +$list = count($groups_newest); |
|
166 | 166 | $social_group_block = null; |
167 | 167 | if ($list > 0) { |
168 | 168 | $social_group_block .= '<div class="list-group-newest">'; |
169 | - $social_group_block .= '<div class="group-title">' . get_lang('Newest') . '</div>'; |
|
170 | - for($i = 0;$i < $list; $i++){ |
|
171 | - $social_group_block.='<div class="row">'; |
|
172 | - $social_group_block.='<div class="col-md-2">' . $groups_newest[$i][0] . '</div>'; |
|
173 | - $social_group_block.='<div class="col-md-10">' . $groups_newest[$i][1]; |
|
174 | - $social_group_block.= $groups_newest[$i][2] . '</div>'; |
|
175 | - $social_group_block.="</div>"; |
|
169 | + $social_group_block .= '<div class="group-title">'.get_lang('Newest').'</div>'; |
|
170 | + for ($i = 0; $i < $list; $i++) { |
|
171 | + $social_group_block .= '<div class="row">'; |
|
172 | + $social_group_block .= '<div class="col-md-2">'.$groups_newest[$i][0].'</div>'; |
|
173 | + $social_group_block .= '<div class="col-md-10">'.$groups_newest[$i][1]; |
|
174 | + $social_group_block .= $groups_newest[$i][2].'</div>'; |
|
175 | + $social_group_block .= "</div>"; |
|
176 | 176 | } |
177 | - $social_group_block.= "</div>"; |
|
177 | + $social_group_block .= "</div>"; |
|
178 | 178 | } |
179 | -$list=count($groups_pop); |
|
179 | +$list = count($groups_pop); |
|
180 | 180 | if ($list > 0) { |
181 | 181 | $social_group_block .= '<div class="list-group-newest">'; |
182 | - $social_group_block .= '<div class="group-title">' . get_lang('Popular') . '</div>'; |
|
183 | - |
|
184 | - for($i = 0;$i < $list; $i++){ |
|
185 | - $social_group_block.='<div class="row">'; |
|
186 | - $social_group_block.='<div class="col-md-2">' . $groups_pop[$i][0] . '</div>'; |
|
187 | - $social_group_block.='<div class="col-md-10">' . $groups_pop[$i][1]; |
|
188 | - $social_group_block.= $groups_pop[$i][2] . '</div>'; |
|
189 | - $social_group_block.="</div>"; |
|
182 | + $social_group_block .= '<div class="group-title">'.get_lang('Popular').'</div>'; |
|
183 | + |
|
184 | + for ($i = 0; $i < $list; $i++) { |
|
185 | + $social_group_block .= '<div class="row">'; |
|
186 | + $social_group_block .= '<div class="col-md-2">'.$groups_pop[$i][0].'</div>'; |
|
187 | + $social_group_block .= '<div class="col-md-10">'.$groups_pop[$i][1]; |
|
188 | + $social_group_block .= $groups_pop[$i][2].'</div>'; |
|
189 | + $social_group_block .= "</div>"; |
|
190 | 190 | } |
191 | - $social_group_block.= "</div>"; |
|
191 | + $social_group_block .= "</div>"; |
|
192 | 192 | } |
193 | 193 | // My friends |
194 | 194 | $friend_html = SocialManager::listMyFriendsBlock( |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $isDRH = api_is_drh(); |
13 | 13 | |
14 | 14 | if (!$isStudent && !$isStudentBoss && !$isDRH) { |
15 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/skills_wheel.php'); |
|
15 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/skills_wheel.php'); |
|
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | $tpl->assign('rows', $tableRows); |
193 | 193 | |
194 | -$contentTemplate = $tpl->fetch("default/" . $tplPath); |
|
194 | +$contentTemplate = $tpl->fetch("default/".$tplPath); |
|
195 | 195 | |
196 | 196 | $tpl->assign('content', $contentTemplate); |
197 | 197 | $tpl->display_one_col_template(); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | api_block_anonymous_users(); |
15 | 15 | |
16 | 16 | if (isset($_REQUEST['userId'])) { |
17 | - $userId = intval($_REQUEST['userId']); |
|
17 | + $userId = intval($_REQUEST['userId']); |
|
18 | 18 | } else { |
19 | 19 | api_not_allowed(); |
20 | 20 | } |
@@ -10,14 +10,14 @@ discard block |
||
10 | 10 | |
11 | 11 | api_block_anonymous_users(); |
12 | 12 | |
13 | -if (api_get_setting('allow_social_tool') !='true') { |
|
13 | +if (api_get_setting('allow_social_tool') != 'true') { |
|
14 | 14 | api_not_allowed(); |
15 | 15 | } |
16 | 16 | |
17 | 17 | $this_section = SECTION_SOCIAL; |
18 | 18 | |
19 | -$interbreadcrumb[] = array ('url' =>'profile.php','name' => get_lang('SocialNetwork')); |
|
20 | -$interbreadcrumb[] = array ('url' =>'#','name' => get_lang('Invitations')); |
|
19 | +$interbreadcrumb[] = array('url' =>'profile.php', 'name' => get_lang('SocialNetwork')); |
|
20 | +$interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Invitations')); |
|
21 | 21 | |
22 | 22 | if (is_array($_GET) && count($_GET) > 0) { |
23 | 23 | foreach ($_GET as $key => $value) { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | Display::return_message(get_lang('UserIsSubscribedToThisGroup'), 'success') |
39 | 39 | ); |
40 | 40 | |
41 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php'); |
|
41 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php'); |
|
42 | 42 | exit; |
43 | 43 | } |
44 | 44 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | Display::return_message(get_lang('UserIsAlreadySubscribedToThisGroup'), 'warning') |
55 | 55 | ); |
56 | 56 | |
57 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php'); |
|
57 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php'); |
|
58 | 58 | exit; |
59 | 59 | } |
60 | 60 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | Display::return_message(get_lang('UserIsNotSubscribedToThisGroup'), 'warning') |
63 | 63 | ); |
64 | 64 | |
65 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php'); |
|
65 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php'); |
|
66 | 66 | exit; |
67 | 67 | break; |
68 | 68 | case 'deny': |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | Display::return_message(get_lang('GroupInvitationWasDeny')) |
73 | 73 | ); |
74 | 74 | |
75 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php'); |
|
75 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php'); |
|
76 | 76 | exit; |
77 | 77 | } |
78 | 78 | } |
@@ -133,24 +133,24 @@ discard block |
||
133 | 133 | $invitationHtml .= '<div class="btn-group" role="group">'; |
134 | 134 | $invitationHtml .= Display::toolbarButton( |
135 | 135 | get_lang('AcceptInvitation'), |
136 | - api_get_path(WEB_AJAX_PATH) . 'social.ajax.php?' . http_build_query([ |
|
136 | + api_get_path(WEB_AJAX_PATH).'social.ajax.php?'.http_build_query([ |
|
137 | 137 | 'a' => 'add_friend', |
138 | 138 | 'friend_id' => $sender_user_id, |
139 | 139 | 'is_my_friend' => 'friend' |
140 | 140 | ]), |
141 | 141 | 'check', |
142 | 142 | 'success', |
143 | - ['id' => 'btn-accept-' . $sender_user_id] |
|
143 | + ['id' => 'btn-accept-'.$sender_user_id] |
|
144 | 144 | ); |
145 | 145 | $invitationHtml .= Display::toolbarButton( |
146 | 146 | get_lang('DenyInvitation'), |
147 | - api_get_path(WEB_AJAX_PATH) . 'social.ajax.php?' . http_build_query([ |
|
147 | + api_get_path(WEB_AJAX_PATH).'social.ajax.php?'.http_build_query([ |
|
148 | 148 | 'a' => 'deny_friend', |
149 | 149 | 'denied_friend_id' => $sender_user_id, |
150 | 150 | ]), |
151 | 151 | 'times', |
152 | 152 | 'danger', |
153 | - ['id' => 'btn-deny-' . $sender_user_id] |
|
153 | + ['id' => 'btn-deny-'.$sender_user_id] |
|
154 | 154 | ); |
155 | 155 | $invitationHtml .= '</div>'; |
156 | 156 | $invitationHtml .= '</div>'; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $invitationSentHtml .= '<div class="col-md-9">'; |
179 | 179 | $invitationSentHtml .= '<h4 class="title-profile"><a class="profile_link" href="profile.php?u='.$sender_user_id.'">'.$user_info['complete_name'].'</a></h4>'; |
180 | 180 | $invitationSentHtml .= '<div class="content-invitation">'.$title.' : '.$content.'</div>'; |
181 | - $invitationSentHtml .= '<div class="date-invitation">'. get_lang('DateSend').' : '.$date.'</div>'; |
|
181 | + $invitationSentHtml .= '<div class="date-invitation">'.get_lang('DateSend').' : '.$date.'</div>'; |
|
182 | 182 | $invitationSentHtml .= '</div>'; |
183 | 183 | $invitationSentHtml .= '</div></div>'; |
184 | 184 | } |
@@ -196,9 +196,9 @@ discard block |
||
196 | 196 | ); |
197 | 197 | $img = '<img class="social-groups-image" src="'.$picture['file'].'" />'; |
198 | 198 | $invitation['picture_uri'] = '<a href="group_view.php?id='.$invitation['id'].'">'.$img.'</a>'; |
199 | - $invitation['name'] = '<a href="group_view.php?id='.$invitation['id'].'">'.cut($invitation['name'],120,true).'</a>'; |
|
200 | - $invitation['description'] = cut($invitation['description'],220,true); |
|
201 | - $new_invitation[]=$invitation; |
|
199 | + $invitation['name'] = '<a href="group_view.php?id='.$invitation['id'].'">'.cut($invitation['name'], 120, true).'</a>'; |
|
200 | + $invitation['description'] = cut($invitation['description'], 220, true); |
|
201 | + $new_invitation[] = $invitation; |
|
202 | 202 | |
203 | 203 | $waitingInvitation .= '<div class="well"><div class="row">'; |
204 | 204 | $waitingInvitation .= '<div class="col-md-3">'.$invitation['picture_uri'].'</div>'; |
@@ -208,19 +208,19 @@ discard block |
||
208 | 208 | $waitingInvitation .= '<div class="btn-group" role="group">'; |
209 | 209 | $waitingInvitation .= Display::toolbarButton( |
210 | 210 | get_lang('AcceptInvitation'), |
211 | - api_get_path(WEB_CODE_PATH) . 'social/invitations.php?' . http_build_query(['accept' => $invitation['id']]), |
|
211 | + api_get_path(WEB_CODE_PATH).'social/invitations.php?'.http_build_query(['accept' => $invitation['id']]), |
|
212 | 212 | 'check', |
213 | 213 | 'success', |
214 | - ['id' => 'accept-invitation-' . $invitation['id']] |
|
214 | + ['id' => 'accept-invitation-'.$invitation['id']] |
|
215 | 215 | ); |
216 | 216 | $waitingInvitation .= Display::toolbarButton( |
217 | 217 | get_lang('DenyInvitation'), |
218 | - api_get_path(WEB_CODE_PATH) . 'social/invitations.php?' . http_build_query(['deny' => $invitation['id']]), |
|
218 | + api_get_path(WEB_CODE_PATH).'social/invitations.php?'.http_build_query(['deny' => $invitation['id']]), |
|
219 | 219 | 'times', |
220 | 220 | 'danger', |
221 | - ['id' => 'deny-invitation-' . $invitation['id']] |
|
221 | + ['id' => 'deny-invitation-'.$invitation['id']] |
|
222 | 222 | ); |
223 | - $waitingInvitation .='</div>'; |
|
223 | + $waitingInvitation .= '</div>'; |
|
224 | 224 | $waitingInvitation .= '</div></div>'; |
225 | 225 | } |
226 | 226 | $socialInvitationsBlock .= Display::panel($waitingInvitation, get_lang('GroupsWaitingApproval')); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $tpl = new Template(null); |
230 | 230 | SocialManager::setSocialUserBlock($tpl, $user_id, 'invitations'); |
231 | 231 | $tpl->assign('social_menu_block', $social_menu_block); |
232 | -$tpl->assign('social_invitations_block',$socialInvitationsBlock); |
|
232 | +$tpl->assign('social_invitations_block', $socialInvitationsBlock); |
|
233 | 233 | $tpl->assign('content', $content); |
234 | 234 | $social_layout = $tpl->get_template('social/invitations.tpl'); |
235 | 235 | $tpl->display($social_layout); |