@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | if (!empty($jquery_ready_content)) { |
84 | 84 | $htmlHeadXtra[] = '<script> |
85 | 85 | $(document).ready(function(){ |
86 | - ' . $jquery_ready_content . ' |
|
86 | + ' . $jquery_ready_content.' |
|
87 | 87 | }); |
88 | 88 | </script>'; |
89 | 89 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | ); |
113 | 113 | } |
114 | 114 | |
115 | - header('Location: '.api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php'); |
|
115 | + header('Location: '.api_get_path(WEB_CODE_PATH).'admin/skill_list.php'); |
|
116 | 116 | exit; |
117 | 117 | } |
118 | 118 |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | if (!empty($jquery_ready_content)) { |
84 | 84 | $htmlHeadXtra[] = '<script> |
85 | 85 | $(document).ready(function(){ |
86 | - ' . $jquery_ready_content . ' |
|
86 | + ' . $jquery_ready_content.' |
|
87 | 87 | }); |
88 | 88 | </script>'; |
89 | 89 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | ); |
113 | 113 | } |
114 | 114 | |
115 | - header('Location: '.api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php'); |
|
115 | + header('Location: '.api_get_path(WEB_CODE_PATH).'admin/skill_list.php'); |
|
116 | 116 | exit; |
117 | 117 | } |
118 | 118 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | Display::return_message(get_lang('MailingTestSent'), 'warning') |
50 | 50 | ); |
51 | 51 | |
52 | - header('Location: ' . api_get_self()); |
|
52 | + header('Location: '.api_get_self()); |
|
53 | 53 | exit; |
54 | 54 | } |
55 | 55 |
@@ -6,7 +6,7 @@ |
||
6 | 6 | echo ' |
7 | 7 | <div class="well well-sm"> |
8 | 8 | <!-- AddThis Button BEGIN --> |
9 | - <div class="addthis_toolbox addthis_default_style ' . $plugin_info['icon_class'] . '"> |
|
9 | + <div class="addthis_toolbox addthis_default_style ' . $plugin_info['icon_class'].'"> |
|
10 | 10 | <a class="addthis_button_preferred_1"></a> |
11 | 11 | <a class="addthis_button_preferred_2"></a> |
12 | 12 | <a class="addthis_button_preferred_3"></a> |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $nameTools = get_lang('PlatformAdmin'); |
20 | 20 | |
21 | 21 | $accessUrlId = 0; |
22 | -$adminExtraContentDir = api_get_path(SYS_APP_PATH) . "home/admin/"; |
|
22 | +$adminExtraContentDir = api_get_path(SYS_APP_PATH)."home/admin/"; |
|
23 | 23 | |
24 | 24 | if (api_is_multiple_url_enabled()) { |
25 | 25 | $accessUrlId = api_get_current_access_url_id(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $urlInfo = api_get_access_url($accessUrlId); |
29 | 29 | $url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $urlInfo['url'])); |
30 | 30 | $cleanUrl = str_replace('/', '-', $url); |
31 | - $adminExtraContentDir = api_get_path(SYS_APP_PATH) . "home/$cleanUrl/admin/"; |
|
31 | + $adminExtraContentDir = api_get_path(SYS_APP_PATH)."home/$cleanUrl/admin/"; |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | <div class="form-group"> |
97 | 97 | <input class="form-control" type="text" name="keyword" value=""> |
98 | 98 | <button class="btn btn-default" type="submit"> |
99 | - <em class="fa fa-search"></em> ' . get_lang('Search') . ' |
|
99 | + <em class="fa fa-search"></em> ' . get_lang('Search').' |
|
100 | 100 | </button> |
101 | 101 | </div> |
102 | 102 | </form>'; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | <div class="form-group"> |
150 | 150 | <input class="form-control" type="text" name="keyword" value=""> |
151 | 151 | <button class="btn btn-default" type="submit"> |
152 | - <em class="fa fa-search"></em> ' . get_lang('Search') . ' |
|
152 | + <em class="fa fa-search"></em> ' . get_lang('Search').' |
|
153 | 153 | </button> |
154 | 154 | </div> |
155 | 155 | </form>'; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | <input class="form-control" type="text" name="search_field" value="" > |
210 | 210 | <input type="hidden" value="search_setting" name="category"> |
211 | 211 | <button class="btn btn-default" type="submit"> |
212 | - <em class="fa fa-search"></em> ' . get_lang('Search') . ' |
|
212 | + <em class="fa fa-search"></em> ' . get_lang('Search').' |
|
213 | 213 | </button> |
214 | 214 | </div> |
215 | 215 | </form>'; |
@@ -222,24 +222,24 @@ discard block |
||
222 | 222 | $items[] = array('url' => 'settings.php?category=Regions', 'label' => get_lang('Regions')); |
223 | 223 | $items[] = array('url' => 'system_announcements.php', 'label' => get_lang('SystemAnnouncements')); |
224 | 224 | $items[] = array( |
225 | - 'url' => api_get_path(WEB_CODE_PATH) . 'calendar/agenda_js.php?type=admin', |
|
225 | + 'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?type=admin', |
|
226 | 226 | 'label' => get_lang('GlobalAgenda') |
227 | 227 | ); |
228 | 228 | $items[] = array('url' => 'configure_homepage.php', 'label' => get_lang('ConfigureHomePage')); |
229 | 229 | $items[] = array('url' => 'configure_inscription.php', 'label' => get_lang('ConfigureInscription')); |
230 | 230 | $items[] = array('url' => 'statistics/index.php', 'label' => get_lang('Statistics')); |
231 | 231 | $items[] = array( |
232 | - 'url' => api_get_path(WEB_CODE_PATH) . 'mySpace/company_reports.php', |
|
232 | + 'url' => api_get_path(WEB_CODE_PATH).'mySpace/company_reports.php', |
|
233 | 233 | 'label' => get_lang('Reports') |
234 | 234 | ); |
235 | 235 | $items[] = array( |
236 | - 'url' => api_get_path(WEB_CODE_PATH) . 'admin/teacher_time_report.php', |
|
236 | + 'url' => api_get_path(WEB_CODE_PATH).'admin/teacher_time_report.php', |
|
237 | 237 | 'label' => get_lang('TeacherTimeReport') |
238 | 238 | ); |
239 | 239 | |
240 | 240 | if (api_get_configuration_value('chamilo_cms')) { |
241 | 241 | $items[] = array( |
242 | - 'url' => api_get_path(WEB_PATH) . 'web/app_dev.php/administration/dashboard', |
|
242 | + 'url' => api_get_path(WEB_PATH).'web/app_dev.php/administration/dashboard', |
|
243 | 243 | 'label' => get_lang('CMS') |
244 | 244 | ); |
245 | 245 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | <div class="form-group"> |
290 | 290 | <input class="form-control" type="text" name="keyword" value=""> |
291 | 291 | <button class="btn btn-default" type="submit"> |
292 | - <em class="fa fa-search"></em> ' . get_lang('Search') . ' |
|
292 | + <em class="fa fa-search"></em> ' . get_lang('Search').' |
|
293 | 293 | </button> |
294 | 294 | </div> |
295 | 295 | </form>'; |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | |
318 | 318 | if (api_is_platform_admin()) { |
319 | 319 | // option only visible in development mode. Enable through code if required |
320 | - if (is_dir(api_get_path(SYS_TEST_PATH) . 'datafiller/')) { |
|
320 | + if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) { |
|
321 | 321 | $items[] = array('url' => 'user_move_stats.php', 'label' => get_lang('MoveUserStats')); |
322 | 322 | } |
323 | 323 | $items[] = array('url' => 'career_dashboard.php', 'label' => get_lang('CareersAndPromotions')); |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $items = array(); |
345 | 345 | $items[] = array('url' => 'special_exports.php', 'label' => get_lang('SpecialExports')); |
346 | 346 | $items[] = array('url' => 'system_status.php', 'label' => get_lang('SystemStatus')); |
347 | - if (is_dir(api_get_path(SYS_TEST_PATH) . 'datafiller/')) { |
|
347 | + if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) { |
|
348 | 348 | $items[] = array('url' => 'filler.php', 'label' => get_lang('DataFiller')); |
349 | 349 | } |
350 | 350 | |
@@ -384,15 +384,15 @@ discard block |
||
384 | 384 | $items[] = array('url' => 'skills_wheel.php', 'label' => get_lang('SkillsWheel')); |
385 | 385 | $items[] = array('url' => 'skills_import.php', 'label' => get_lang('SkillsImport')); |
386 | 386 | $items[] = array('url' => 'skill_list.php', 'label' => get_lang('ManageSkills')); |
387 | - $items[] = array('url'=>'skill.php', 'label' => get_lang('ManageSkillsLevels')); |
|
387 | + $items[] = array('url'=>'skill.php', 'label' => get_lang('ManageSkillsLevels')); |
|
388 | 388 | //$items[] = array('url'=>'skills_profile.php', 'label' => get_lang('SkillsProfile')); |
389 | 389 | $items[] = array( |
390 | - 'url' => api_get_path(WEB_CODE_PATH) . 'social/skills_ranking.php', |
|
390 | + 'url' => api_get_path(WEB_CODE_PATH).'social/skills_ranking.php', |
|
391 | 391 | 'label' => get_lang('SkillsRanking') |
392 | 392 | ); |
393 | 393 | $items[] = array('url' => 'skills_gradebook.php', 'label' => get_lang('SkillsAndGradebooks')); |
394 | 394 | $items[] = array( |
395 | - 'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php', |
|
395 | + 'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php', |
|
396 | 396 | 'label' => get_lang('Badges') |
397 | 397 | ); |
398 | 398 | $blocks['skills']['items'] = $items; |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $menuAdministratorItems = []; |
407 | 407 | |
408 | 408 | foreach ($_plugins['menu_administrator'] as $pluginName) { |
409 | - if (!file_exists(api_get_path(SYS_PLUGIN_PATH) . $pluginName . '/start.php')) { |
|
409 | + if (!file_exists(api_get_path(SYS_PLUGIN_PATH).$pluginName.'/start.php')) { |
|
410 | 410 | continue; |
411 | 411 | } |
412 | 412 | |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | foreach ($menuAdministratorItems as $plugin_name) { |
432 | 432 | $plugin_info = $plugin_obj->getPluginInfo($plugin_name); |
433 | 433 | $items[] = array( |
434 | - 'url' => api_get_path(WEB_PLUGIN_PATH) . $plugin_name . '/start.php', |
|
434 | + 'url' => api_get_path(WEB_PLUGIN_PATH).$plugin_name.'/start.php', |
|
435 | 435 | 'label' => $plugin_info['title'] |
436 | 436 | ); |
437 | 437 | } |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | } |
511 | 511 | //end hack |
512 | 512 | } |
513 | -$admin_ajax_url = api_get_path(WEB_AJAX_PATH) . 'admin.ajax.php'; |
|
513 | +$admin_ajax_url = api_get_path(WEB_AJAX_PATH).'admin.ajax.php'; |
|
514 | 514 | |
515 | 515 | $tpl = new Template(); |
516 | 516 | |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | die; |
564 | 564 | } |
565 | 565 | |
566 | - $fullFilePath = $adminExtraContentDir . $extraData['block']; |
|
566 | + $fullFilePath = $adminExtraContentDir.$extraData['block']; |
|
567 | 567 | $fullFilePath .= "_extra.html"; |
568 | 568 | |
569 | 569 | file_put_contents($fullFilePath, $extraData['extra_content']); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | Display::return_message(get_lang('NoUser'), 'error') |
34 | 34 | ); |
35 | 35 | |
36 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
36 | + header('Location: '.api_get_path(WEB_PATH)); |
|
37 | 37 | exit; |
38 | 38 | } |
39 | 39 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $htmlHeadXtra[] = '<script> |
47 | 47 | $( document ).ready(function() { |
48 | 48 | $("#skill").on("change", function() { |
49 | - $(location).attr("href", "'. $url .'"+$(this).val()); |
|
49 | + $(location).attr("href", "'. $url.'"+$(this).val()); |
|
50 | 50 | }); |
51 | 51 | }); |
52 | 52 | </script>'; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | Display::return_message(get_lang('SkillNotFound'), 'error') |
130 | 130 | ); |
131 | 131 | |
132 | - header('Location: ' . api_get_self() . '?' . http_build_query(['user' => $user->getId()])); |
|
132 | + header('Location: '.api_get_self().'?'.http_build_query(['user' => $user->getId()])); |
|
133 | 133 | exit; |
134 | 134 | } |
135 | 135 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | ) |
142 | 142 | ); |
143 | 143 | |
144 | - header('Location: ' . api_get_self() . '?' . http_build_query(['user' => $user->getId()])); |
|
144 | + header('Location: '.api_get_self().'?'.http_build_query(['user' => $user->getId()])); |
|
145 | 145 | exit; |
146 | 146 | } |
147 | 147 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | ) |
166 | 166 | ); |
167 | 167 | |
168 | - header('Location: ' . api_get_path(WEB_PATH) . "badge/{$skillUser->getId()}"); |
|
168 | + header('Location: '.api_get_path(WEB_PATH)."badge/{$skillUser->getId()}"); |
|
169 | 169 | exit; |
170 | 170 | } |
171 | 171 |
@@ -11,10 +11,10 @@ discard block |
||
11 | 11 | * Please edit the facebook.conf.php file to adapt it to your fb application parameter |
12 | 12 | */ |
13 | 13 | |
14 | -require_once dirname(__FILE__) . '/../../inc/global.inc.php'; |
|
15 | -require_once dirname(__FILE__) . '/facebook.init.php'; |
|
14 | +require_once dirname(__FILE__).'/../../inc/global.inc.php'; |
|
15 | +require_once dirname(__FILE__).'/facebook.init.php'; |
|
16 | 16 | |
17 | -require_once dirname(__FILE__) . '/functions.inc.php'; |
|
17 | +require_once dirname(__FILE__).'/functions.inc.php'; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * This function connect to facebook and retrieves the user info |
@@ -33,19 +33,19 @@ discard block |
||
33 | 33 | |
34 | 34 | try { |
35 | 35 | $accessToken = $helper->getAccessToken(); |
36 | - } catch(Facebook\Exceptions\FacebookResponseException $e) { |
|
36 | + } catch (Facebook\Exceptions\FacebookResponseException $e) { |
|
37 | 37 | Display::addFlash( |
38 | - Display::return_message('Facebook Graph returned an error: ' . $e->getMessage(), 'error') |
|
38 | + Display::return_message('Facebook Graph returned an error: '.$e->getMessage(), 'error') |
|
39 | 39 | ); |
40 | 40 | |
41 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
41 | + header('Location: '.api_get_path(WEB_PATH)); |
|
42 | 42 | exit; |
43 | - } catch(Facebook\Exceptions\FacebookSDKException $e) { |
|
43 | + } catch (Facebook\Exceptions\FacebookSDKException $e) { |
|
44 | 44 | Display::addFlash( |
45 | - Display::return_message('Facebook SDK returned an error: ' . $e->getMessage(), 'error') |
|
45 | + Display::return_message('Facebook SDK returned an error: '.$e->getMessage(), 'error') |
|
46 | 46 | ); |
47 | 47 | |
48 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
48 | + header('Location: '.api_get_path(WEB_PATH)); |
|
49 | 49 | exit; |
50 | 50 | } |
51 | 51 | |
@@ -59,17 +59,17 @@ discard block |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | $error = implode('<br>', [ |
62 | - 'Error: ' . $helper->getError(), |
|
63 | - 'Error Code: ' . $helper->getErrorCode(), |
|
64 | - 'Error Reason: ' . $helper->getErrorReason(), |
|
65 | - 'Error Description: ' . $helper->getErrorDescription() |
|
62 | + 'Error: '.$helper->getError(), |
|
63 | + 'Error Code: '.$helper->getErrorCode(), |
|
64 | + 'Error Reason: '.$helper->getErrorReason(), |
|
65 | + 'Error Description: '.$helper->getErrorDescription() |
|
66 | 66 | ]); |
67 | 67 | |
68 | 68 | Display::addFlash( |
69 | 69 | Display::return_message($error, 'error', false) |
70 | 70 | ); |
71 | 71 | |
72 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
72 | + header('Location: '.api_get_path(WEB_PATH)); |
|
73 | 73 | exit; |
74 | 74 | } |
75 | 75 | |
@@ -83,29 +83,29 @@ discard block |
||
83 | 83 | $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); |
84 | 84 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
85 | 85 | Display::addFlash( |
86 | - Display::return_message('Error getting long-lived access token: ' . $e->getMessage(), 'error') |
|
86 | + Display::return_message('Error getting long-lived access token: '.$e->getMessage(), 'error') |
|
87 | 87 | ); |
88 | 88 | |
89 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
89 | + header('Location: '.api_get_path(WEB_PATH)); |
|
90 | 90 | exit; |
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | 94 | try { |
95 | 95 | $response = $fb->get('/me?fields=id,first_name,last_name,locale,email', $accessToken->getValue()); |
96 | - } catch(Facebook\Exceptions\FacebookResponseException $e) { |
|
96 | + } catch (Facebook\Exceptions\FacebookResponseException $e) { |
|
97 | 97 | Display::addFlash( |
98 | - Display::return_message('Graph returned an error: ' . $e->getMessage(), 'error') |
|
98 | + Display::return_message('Graph returned an error: '.$e->getMessage(), 'error') |
|
99 | 99 | ); |
100 | 100 | |
101 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
101 | + header('Location: '.api_get_path(WEB_PATH)); |
|
102 | 102 | exit; |
103 | - } catch(Facebook\Exceptions\FacebookSDKException $e) { |
|
103 | + } catch (Facebook\Exceptions\FacebookSDKException $e) { |
|
104 | 104 | Display::addFlash( |
105 | - Display::return_message('Facebook SDK returned an error: ' . $e->getMessage(), 'error') |
|
105 | + Display::return_message('Facebook SDK returned an error: '.$e->getMessage(), 'error') |
|
106 | 106 | ); |
107 | 107 | |
108 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
108 | + header('Location: '.api_get_path(WEB_PATH)); |
|
109 | 109 | exit; |
110 | 110 | } |
111 | 111 | |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | Display::return_message(get_lang('UserNotRegistered'), 'error') |
142 | 142 | ); |
143 | 143 | |
144 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
144 | + header('Location: '.api_get_path(WEB_PATH)); |
|
145 | 145 | exit; |
146 | 146 | } |
147 | 147 | |
148 | 148 | $_user['user_id'] = $chamilo_uid; |
149 | 149 | $_SESSION['_user'] = $_user; |
150 | 150 | |
151 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
151 | + header('Location: '.api_get_path(WEB_PATH)); |
|
152 | 152 | exit(); |
153 | 153 | } |
154 | 154 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $_user['user_id'] = $chamilo_uid; |
160 | 160 | $_SESSION['_user'] = $_user; |
161 | 161 | |
162 | - header('Location: ' . api_get_path(WEB_PATH)); |
|
162 | + header('Location: '.api_get_path(WEB_PATH)); |
|
163 | 163 | exit(); |
164 | 164 | } |
165 | 165 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | ]); |
177 | 177 | |
178 | 178 | $helper = $fb->getRedirectLoginHelper(); |
179 | - $loginUrl = $helper->getLoginUrl(api_get_path(WEB_PATH) . '?action=fbconnect', [ |
|
179 | + $loginUrl = $helper->getLoginUrl(api_get_path(WEB_PATH).'?action=fbconnect', [ |
|
180 | 180 | 'email' |
181 | 181 | ]); |
182 | 182 |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | api_block_anonymous_users(); |
18 | 18 | $htmlHeadXtra[] = api_get_jqgrid_js(); |
19 | -$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace')); |
|
19 | +$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace')); |
|
20 | 20 | Display::display_header(get_lang('Sessions')); |
21 | 21 | |
22 | 22 | $export_csv = false; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | if (!api_is_session_admin()) { |
41 | 41 | $menu_items[] = Display::url( |
42 | 42 | Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), |
43 | - api_get_path(WEB_CODE_PATH) . "auth/my_progress.php" |
|
43 | + api_get_path(WEB_CODE_PATH)."auth/my_progress.php" |
|
44 | 44 | ); |
45 | 45 | $menu_items[] = Display::url( |
46 | 46 | Display::return_icon('user.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | |
63 | 63 | $menu_items[] = Display::url( |
64 | 64 | Display::return_icon('works.png', get_lang('WorksReport'), [], ICON_SIZE_MEDIUM), |
65 | - api_get_path(WEB_CODE_PATH) . 'mySpace/works_in_session_report.php' |
|
65 | + api_get_path(WEB_CODE_PATH).'mySpace/works_in_session_report.php' |
|
66 | 66 | ); |
67 | 67 | $menu_items[] = Display::url( |
68 | 68 | Display::return_icon('clock.png', get_lang('TeacherTimeReportBySession'), [], ICON_SIZE_MEDIUM), |
69 | - api_get_path(WEB_CODE_PATH) . 'admin/teachers_time_by_session_report.php' |
|
69 | + api_get_path(WEB_CODE_PATH).'admin/teachers_time_by_session_report.php' |
|
70 | 70 | ); |
71 | 71 | |
72 | 72 | $actionsLeft = ''; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ); |
86 | 86 | $actionsRight .= Display::url( |
87 | 87 | Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), 32), |
88 | - api_get_self() . '?export=csv' |
|
88 | + api_get_self().'?export=csv' |
|
89 | 89 | ); |
90 | 90 | } |
91 | 91 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } elseif (api_is_teacher()) { |
101 | 101 | $actionsRight = Display::url( |
102 | 102 | Display::return_icon('clock.png', get_lang('TeacherTimeReportBySession'), [], ICON_SIZE_MEDIUM), |
103 | - api_get_path(WEB_CODE_PATH) . 'admin/teachers_time_by_session_report.php' |
|
103 | + api_get_path(WEB_CODE_PATH).'admin/teachers_time_by_session_report.php' |
|
104 | 104 | ); |
105 | 105 | |
106 | 106 | $toolbar = Display::toolbarAction( |
@@ -140,10 +140,10 @@ discard block |
||
140 | 140 | // Column config |
141 | 141 | $columnModel = array( |
142 | 142 | array('name'=>'name', 'index'=>'name', 'width'=>'255', 'align'=>'left'), |
143 | - array('name'=>'date', 'index'=>'date', 'width'=>'150', 'align'=>'left','sortable'=>'false'), |
|
144 | - array('name'=>'course_per_session', 'index'=>'course_per_session', 'width'=>'150','sortable'=>'false'), |
|
145 | - array('name'=>'student_per_session', 'index'=>'student_per_session', 'width'=>'100','sortable'=>'false'), |
|
146 | - array('name'=>'details', 'index'=>'details', 'width'=>'100','sortable'=>'false') |
|
143 | + array('name'=>'date', 'index'=>'date', 'width'=>'150', 'align'=>'left', 'sortable'=>'false'), |
|
144 | + array('name'=>'course_per_session', 'index'=>'course_per_session', 'width'=>'150', 'sortable'=>'false'), |
|
145 | + array('name'=>'student_per_session', 'index'=>'student_per_session', 'width'=>'100', 'sortable'=>'false'), |
|
146 | + array('name'=>'details', 'index'=>'details', 'width'=>'100', 'sortable'=>'false') |
|
147 | 147 | ); |
148 | 148 | |
149 | 149 | $extraParams = array( |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $sessionId = api_get_session_id(); |
70 | 70 | |
71 | 71 | if (api_is_in_group()) { |
72 | - $group_properties = GroupManager::get_group_properties($group_id); |
|
72 | + $group_properties = GroupManager::get_group_properties($group_id); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | $dir = '/'; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $_GET['id'], |
82 | 82 | api_get_course_id(), |
83 | 83 | true, |
84 | - 0 |
|
84 | + 0 |
|
85 | 85 | ); |
86 | 86 | |
87 | 87 | if (!empty($sessionId) && empty($document_data)) { |
@@ -93,13 +93,13 @@ discard block |
||
93 | 93 | ); |
94 | 94 | } |
95 | 95 | |
96 | - $document_id = $document_data['id']; |
|
97 | - $file = $document_data['path']; |
|
98 | - $parent_id = DocumentManager::get_document_id($course_info, dirname($file)); |
|
99 | - $dir = dirname($document_data['path']); |
|
100 | - $dir_original = $dir; |
|
101 | - $doc = basename($file); |
|
102 | - $readonly = $document_data['readonly']; |
|
96 | + $document_id = $document_data['id']; |
|
97 | + $file = $document_data['path']; |
|
98 | + $parent_id = DocumentManager::get_document_id($course_info, dirname($file)); |
|
99 | + $dir = dirname($document_data['path']); |
|
100 | + $dir_original = $dir; |
|
101 | + $doc = basename($file); |
|
102 | + $readonly = $document_data['readonly']; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | if (empty($document_data)) { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | // Level correction for group documents. |
123 | 123 | if (!empty($group_properties['directory'])) { |
124 | - $count_dir = $count_dir > 0 ? $count_dir - 1 : 0; |
|
124 | + $count_dir = $count_dir > 0 ? $count_dir - 1 : 0; |
|
125 | 125 | } |
126 | 126 | $relative_url = ''; |
127 | 127 | for ($i = 0; $i < ($count_dir); $i++) { |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | ); |
144 | 144 | |
145 | 145 | if ($is_certificate_mode) { |
146 | - $editorConfig['CreateDocumentDir'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/'; |
|
147 | - $editorConfig['CreateDocumentWebDir'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/'; |
|
148 | - $editorConfig['BaseHref'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$dir; |
|
146 | + $editorConfig['CreateDocumentDir'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/'; |
|
147 | + $editorConfig['CreateDocumentWebDir'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document/'; |
|
148 | + $editorConfig['BaseHref'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$dir; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | $is_allowed_to_edit = api_is_allowed_to_edit(null, true) || $_SESSION['group_member_with_upload_rights']|| |
152 | - DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $sessionId); |
|
152 | + DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $sessionId); |
|
153 | 153 | $noPHP_SELF = true; |
154 | 154 | |
155 | 155 | /* Other initialization code */ |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), |
163 | 163 | 'name' => get_lang('GroupSpace'), |
164 | 164 | ); |
165 | - $group_document = true; |
|
166 | - $noPHP_SELF = true; |
|
165 | + $group_document = true; |
|
166 | + $noPHP_SELF = true; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | if (!$is_certificate_mode) { |
@@ -197,9 +197,9 @@ discard block |
||
197 | 197 | |
198 | 198 | //TODO:check the below code and his funcionality |
199 | 199 | if (!api_is_allowed_to_edit()) { |
200 | - if (DocumentManager::check_readonly($course_info, $user_id, $file)) { |
|
201 | - api_not_allowed(); |
|
202 | - } |
|
200 | + if (DocumentManager::check_readonly($course_info, $user_id, $file)) { |
|
201 | + api_not_allowed(); |
|
202 | + } |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | /* MAIN TOOL CODE */ |
@@ -207,18 +207,18 @@ discard block |
||
207 | 207 | /* Code to change the comment */ |
208 | 208 | |
209 | 209 | if (isset($_POST['comment'])) { |
210 | - // Fixing the path if it is wrong |
|
211 | - $comment = trim($_POST['comment']); |
|
212 | - $title = trim($_POST['title']); |
|
210 | + // Fixing the path if it is wrong |
|
211 | + $comment = trim($_POST['comment']); |
|
212 | + $title = trim($_POST['title']); |
|
213 | 213 | |
214 | 214 | // Just in case see BT#3525 |
215 | 215 | if (empty($title)) { |
216 | - $title = $document_data['title']; |
|
217 | - } |
|
216 | + $title = $document_data['title']; |
|
217 | + } |
|
218 | 218 | |
219 | - if (empty($title)) { |
|
220 | - $title = get_document_title($_POST['filename']); |
|
221 | - } |
|
219 | + if (empty($title)) { |
|
220 | + $title = get_document_title($_POST['filename']); |
|
221 | + } |
|
222 | 222 | |
223 | 223 | if (!empty($document_id)) { |
224 | 224 | $params = [ |
@@ -230,43 +230,43 @@ discard block |
||
230 | 230 | $params, |
231 | 231 | ['c_id = ? AND id = ?' => [$course_id, $document_id]] |
232 | 232 | ); |
233 | - Display::addFlash(Display::return_message(get_lang('fileModified'))); |
|
233 | + Display::addFlash(Display::return_message(get_lang('fileModified'))); |
|
234 | 234 | } |
235 | 235 | } |
236 | 236 | |
237 | 237 | /* WYSIWYG HTML EDITOR - Program Logic */ |
238 | 238 | if ($is_allowed_to_edit) { |
239 | - if (isset($_POST['formSent']) && $_POST['formSent'] == 1) { |
|
239 | + if (isset($_POST['formSent']) && $_POST['formSent'] == 1) { |
|
240 | 240 | |
241 | - $filename = stripslashes($_POST['filename']); |
|
241 | + $filename = stripslashes($_POST['filename']); |
|
242 | 242 | $extension = $_POST['extension']; |
243 | - $content = isset($_POST['content']) ? trim(str_replace(array("\r", "\n"), '', stripslashes($_POST['content']))) : null; |
|
244 | - $content = Security::remove_XSS($content, COURSEMANAGERLOWSECURITY); |
|
243 | + $content = isset($_POST['content']) ? trim(str_replace(array("\r", "\n"), '', stripslashes($_POST['content']))) : null; |
|
244 | + $content = Security::remove_XSS($content, COURSEMANAGERLOWSECURITY); |
|
245 | 245 | |
246 | 246 | if ($dir == '/') { |
247 | 247 | $dir = ''; |
248 | 248 | } |
249 | 249 | |
250 | - $file = $dir.'/'.$filename.'.'.$extension; |
|
251 | - $read_only_flag = isset($_POST['readonly']) ? $_POST['readonly'] : null; |
|
252 | - $read_only_flag = empty($read_only_flag) ? 0 : 1; |
|
250 | + $file = $dir.'/'.$filename.'.'.$extension; |
|
251 | + $read_only_flag = isset($_POST['readonly']) ? $_POST['readonly'] : null; |
|
252 | + $read_only_flag = empty($read_only_flag) ? 0 : 1; |
|
253 | 253 | |
254 | - if (empty($filename)) { |
|
254 | + if (empty($filename)) { |
|
255 | 255 | Display::addFlash(Display::return_message(get_lang('NoFileName'), 'warning')); |
256 | - } else { |
|
256 | + } else { |
|
257 | 257 | |
258 | - $file_size = filesize($document_data['absolute_path']); |
|
258 | + $file_size = filesize($document_data['absolute_path']); |
|
259 | 259 | |
260 | - if ($read_only_flag == 0) { |
|
261 | - if (!empty($content)) { |
|
262 | - if ($fp = @fopen($document_data['absolute_path'], 'w')) { |
|
263 | - // For flv player, change absolute path temporarily to prevent from erasing it in the following lines |
|
264 | - $content = str_replace(array('flv=h', 'flv=/'), array('flv=h|', 'flv=/|'), $content); |
|
265 | - fputs($fp, $content); |
|
266 | - fclose($fp); |
|
260 | + if ($read_only_flag == 0) { |
|
261 | + if (!empty($content)) { |
|
262 | + if ($fp = @fopen($document_data['absolute_path'], 'w')) { |
|
263 | + // For flv player, change absolute path temporarily to prevent from erasing it in the following lines |
|
264 | + $content = str_replace(array('flv=h', 'flv=/'), array('flv=h|', 'flv=/|'), $content); |
|
265 | + fputs($fp, $content); |
|
266 | + fclose($fp); |
|
267 | 267 | |
268 | 268 | $filepath = $document_data['absolute_parent_path']; |
269 | - /* |
|
269 | + /* |
|
270 | 270 | if (!is_dir($filepath.'css')) { |
271 | 271 | mkdir($filepath.'css', api_get_permissions_for_new_directories()); |
272 | 272 | $doc_id = add_document($_course, $dir.'css', 'folder', 0, 'css'); |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | ); |
297 | 297 | }*/ |
298 | 298 | |
299 | - /*if (!is_file($filepath.'css/frames.css')) { |
|
299 | + /*if (!is_file($filepath.'css/frames.css')) { |
|
300 | 300 | $platform_theme = api_get_setting('stylesheets'); |
301 | 301 | if (file_exists(api_get_path(SYS_CODE_PATH).'css/'.$platform_theme.'/frames.css')) { |
302 | 302 | copy(api_get_path(SYS_CODE_PATH).'css/'.$platform_theme.'/frames.css', $filepath.'css/frames.css'); |
@@ -334,54 +334,54 @@ discard block |
||
334 | 334 | } |
335 | 335 | }*/ |
336 | 336 | |
337 | - // "WHAT'S NEW" notification: update table item_property |
|
338 | - $document_id = DocumentManager::get_document_id($_course, $file); |
|
339 | - |
|
340 | - if ($document_id) { |
|
341 | - update_existing_document( |
|
342 | - $_course, |
|
343 | - $document_id, |
|
344 | - $file_size, |
|
345 | - $read_only_flag |
|
346 | - ); |
|
347 | - api_item_property_update( |
|
348 | - $_course, |
|
349 | - TOOL_DOCUMENT, |
|
350 | - $document_id, |
|
351 | - 'DocumentUpdated', |
|
352 | - api_get_user_id(), |
|
353 | - null, |
|
354 | - null, |
|
355 | - null, |
|
356 | - null, |
|
357 | - $sessionId |
|
358 | - ); |
|
359 | - // Update parent folders |
|
360 | - item_property_update_on_folder( |
|
361 | - $_course, |
|
362 | - $dir, |
|
363 | - api_get_user_id() |
|
364 | - ); |
|
365 | - header('Location: document.php?id=' . $document_data['parent_id'] . '&' . api_get_cidreq() . ($is_certificate_mode?'&curdirpath=/certificates&selectcat=1':'')); |
|
366 | - exit; |
|
367 | - } else { |
|
337 | + // "WHAT'S NEW" notification: update table item_property |
|
338 | + $document_id = DocumentManager::get_document_id($_course, $file); |
|
339 | + |
|
340 | + if ($document_id) { |
|
341 | + update_existing_document( |
|
342 | + $_course, |
|
343 | + $document_id, |
|
344 | + $file_size, |
|
345 | + $read_only_flag |
|
346 | + ); |
|
347 | + api_item_property_update( |
|
348 | + $_course, |
|
349 | + TOOL_DOCUMENT, |
|
350 | + $document_id, |
|
351 | + 'DocumentUpdated', |
|
352 | + api_get_user_id(), |
|
353 | + null, |
|
354 | + null, |
|
355 | + null, |
|
356 | + null, |
|
357 | + $sessionId |
|
358 | + ); |
|
359 | + // Update parent folders |
|
360 | + item_property_update_on_folder( |
|
361 | + $_course, |
|
362 | + $dir, |
|
363 | + api_get_user_id() |
|
364 | + ); |
|
365 | + header('Location: document.php?id=' . $document_data['parent_id'] . '&' . api_get_cidreq() . ($is_certificate_mode?'&curdirpath=/certificates&selectcat=1':'')); |
|
366 | + exit; |
|
367 | + } else { |
|
368 | 368 | Display::addFlash(Display::return_message(get_lang('Impossible'), 'warning')); |
369 | - } |
|
370 | - } else { |
|
369 | + } |
|
370 | + } else { |
|
371 | 371 | Display::addFlash(Display::return_message(get_lang('Impossible'), 'warning')); |
372 | - } |
|
373 | - } else { |
|
374 | - if ($document_id) { |
|
372 | + } |
|
373 | + } else { |
|
374 | + if ($document_id) { |
|
375 | 375 | update_existing_document($_course, $document_id, $file_size, $read_only_flag); |
376 | - } |
|
377 | - } |
|
378 | - } else { |
|
376 | + } |
|
377 | + } |
|
378 | + } else { |
|
379 | 379 | if ($document_id) { |
380 | 380 | update_existing_document($_course, $document_id, $file_size, $read_only_flag); |
381 | 381 | } |
382 | - } |
|
383 | - } |
|
384 | - } |
|
382 | + } |
|
383 | + } |
|
384 | + } |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | // Replace relative paths by absolute web paths (e.g. './' => 'http://www.chamilo.org/courses/ABC/document/') |
@@ -435,35 +435,35 @@ discard block |
||
435 | 435 | api_get_group_id() |
436 | 436 | ) |
437 | 437 | ) { |
438 | - $action = api_get_self().'?id='.$document_data['id'].'&'.api_get_cidreq(); |
|
438 | + $action = api_get_self().'?id='.$document_data['id'].'&'.api_get_cidreq(); |
|
439 | 439 | if ($is_certificate_mode) { |
440 | 440 | $action .= '&curdirpath=/certificates&selectcat=1'; |
441 | 441 | } |
442 | - $form = new FormValidator('formEdit', 'post', $action, null, array('class' => 'form-vertical')); |
|
443 | - |
|
444 | - // Form title |
|
445 | - $form->addElement('header', $nameTools); |
|
446 | - $form->addElement('hidden', 'filename'); |
|
447 | - $form->addElement('hidden', 'extension'); |
|
448 | - $form->addElement('hidden', 'file_path'); |
|
449 | - $form->addElement('hidden', 'commentPath'); |
|
450 | - $form->addElement('hidden', 'showedit'); |
|
451 | - $form->addElement('hidden', 'origin'); |
|
452 | - $form->addElement('hidden', 'origin_opt'); |
|
442 | + $form = new FormValidator('formEdit', 'post', $action, null, array('class' => 'form-vertical')); |
|
443 | + |
|
444 | + // Form title |
|
445 | + $form->addElement('header', $nameTools); |
|
446 | + $form->addElement('hidden', 'filename'); |
|
447 | + $form->addElement('hidden', 'extension'); |
|
448 | + $form->addElement('hidden', 'file_path'); |
|
449 | + $form->addElement('hidden', 'commentPath'); |
|
450 | + $form->addElement('hidden', 'showedit'); |
|
451 | + $form->addElement('hidden', 'origin'); |
|
452 | + $form->addElement('hidden', 'origin_opt'); |
|
453 | 453 | $form->addText('title', get_lang('Title'), true, array('cols-size' => [2, 10, 0], 'autofocus')); |
454 | 454 | |
455 | - $defaults['title'] = $document_data['title']; |
|
455 | + $defaults['title'] = $document_data['title']; |
|
456 | 456 | |
457 | - $form->addElement('hidden', 'formSent'); |
|
458 | - $defaults['formSent'] = 1; |
|
457 | + $form->addElement('hidden', 'formSent'); |
|
458 | + $defaults['formSent'] = 1; |
|
459 | 459 | |
460 | - $read_only_flag = isset($_POST['readonly']) ? $_POST['readonly'] : null; |
|
460 | + $read_only_flag = isset($_POST['readonly']) ? $_POST['readonly'] : null; |
|
461 | 461 | |
462 | - // Desactivation of IE proprietary commenting tags inside the text before loading it on the online editor. |
|
463 | - // This fix has been proposed by Hubert Borderiou, see Bug #573, http://support.chamilo.org/issues/573 |
|
464 | - $defaults['content'] = str_replace('<!--[', '<!-- [', $content); |
|
462 | + // Desactivation of IE proprietary commenting tags inside the text before loading it on the online editor. |
|
463 | + // This fix has been proposed by Hubert Borderiou, see Bug #573, http://support.chamilo.org/issues/573 |
|
464 | + $defaults['content'] = str_replace('<!--[', '<!-- [', $content); |
|
465 | 465 | |
466 | - // HotPotatoes tests are html files, but they should not be edited in order their functionality to be preserved. |
|
466 | + // HotPotatoes tests are html files, but they should not be edited in order their functionality to be preserved. |
|
467 | 467 | |
468 | 468 | $showSystemFolders = api_get_course_setting('show_system_folders'); |
469 | 469 | $condition = stripos($dir, '/HotPotatoes_files') === false; |
@@ -471,44 +471,44 @@ discard block |
||
471 | 471 | $condition = true; |
472 | 472 | } |
473 | 473 | |
474 | - if (($extension == 'htm' || $extension == 'html') && $condition) { |
|
475 | - if (empty($readonly) && $readonly == 0) { |
|
474 | + if (($extension == 'htm' || $extension == 'html') && $condition) { |
|
475 | + if (empty($readonly) && $readonly == 0) { |
|
476 | 476 | $form->addHtmlEditor('content', '', true, true, $editorConfig); |
477 | - } |
|
478 | - } |
|
477 | + } |
|
478 | + } |
|
479 | 479 | |
480 | - if (!$group_document && !DocumentManager::is_my_shared_folder(api_get_user_id(), $currentDirPath, $sessionId)) { |
|
481 | - // Updated on field |
|
480 | + if (!$group_document && !DocumentManager::is_my_shared_folder(api_get_user_id(), $currentDirPath, $sessionId)) { |
|
481 | + // Updated on field |
|
482 | 482 | $display_date = date_to_str_ago($last_edit_date). |
483 | - ' <span class="dropbox_date">'.api_format_date(api_get_local_time($last_edit_date)).'</span>'; |
|
484 | - $form->addElement('static', null, get_lang('UpdatedOn'), $display_date); |
|
485 | - } |
|
483 | + ' <span class="dropbox_date">'.api_format_date(api_get_local_time($last_edit_date)).'</span>'; |
|
484 | + $form->addElement('static', null, get_lang('UpdatedOn'), $display_date); |
|
485 | + } |
|
486 | 486 | |
487 | - $form->addElement('textarea', 'comment', get_lang('Comment'), ['cols-size' => [2, 10, 0]]); |
|
487 | + $form->addElement('textarea', 'comment', get_lang('Comment'), ['cols-size' => [2, 10, 0]]); |
|
488 | 488 | |
489 | - if ($owner_id == api_get_user_id() || api_is_platform_admin()) { |
|
490 | - $checked =& $form->addElement('checkbox', 'readonly', null, get_lang('ReadOnly')); |
|
491 | - if ($readonly == 1) { |
|
492 | - $checked->setChecked(true); |
|
493 | - } |
|
494 | - } |
|
489 | + if ($owner_id == api_get_user_id() || api_is_platform_admin()) { |
|
490 | + $checked =& $form->addElement('checkbox', 'readonly', null, get_lang('ReadOnly')); |
|
491 | + if ($readonly == 1) { |
|
492 | + $checked->setChecked(true); |
|
493 | + } |
|
494 | + } |
|
495 | 495 | |
496 | - if ($is_certificate_mode) { |
|
497 | - $form->addButtonUpdate(get_lang('SaveCertificate')); |
|
496 | + if ($is_certificate_mode) { |
|
497 | + $form->addButtonUpdate(get_lang('SaveCertificate')); |
|
498 | 498 | } else { |
499 | - $form->addButtonUpdate(get_lang('SaveDocument')); |
|
499 | + $form->addButtonUpdate(get_lang('SaveDocument')); |
|
500 | 500 | } |
501 | 501 | |
502 | - $defaults['filename'] = $filename; |
|
503 | - $defaults['extension'] = $extension; |
|
504 | - $defaults['file_path'] = isset($_GET['file']) ? Security::remove_XSS($_GET['file']) : null; |
|
505 | - $defaults['commentPath'] = $file; |
|
506 | - $defaults['renameTo'] = $file_name; |
|
507 | - $defaults['comment'] = $document_data['comment']; |
|
508 | - $defaults['origin'] = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : null; |
|
509 | - $defaults['origin_opt'] = isset($_GET['origin_opt']) ? Security::remove_XSS($_GET['origin_opt']) : null; |
|
502 | + $defaults['filename'] = $filename; |
|
503 | + $defaults['extension'] = $extension; |
|
504 | + $defaults['file_path'] = isset($_GET['file']) ? Security::remove_XSS($_GET['file']) : null; |
|
505 | + $defaults['commentPath'] = $file; |
|
506 | + $defaults['renameTo'] = $file_name; |
|
507 | + $defaults['comment'] = $document_data['comment']; |
|
508 | + $defaults['origin'] = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : null; |
|
509 | + $defaults['origin_opt'] = isset($_GET['origin_opt']) ? Security::remove_XSS($_GET['origin_opt']) : null; |
|
510 | 510 | |
511 | - $form->setDefaults($defaults); |
|
511 | + $form->setDefaults($defaults); |
|
512 | 512 | |
513 | 513 | show_return( |
514 | 514 | $parent_id, |
@@ -518,25 +518,25 @@ discard block |
||
518 | 518 | $is_certificate_mode |
519 | 519 | ); |
520 | 520 | |
521 | - if ($is_certificate_mode) { |
|
522 | - $all_information_by_create_certificate = DocumentManager::get_all_info_to_certificate( |
|
523 | - api_get_user_id(), |
|
524 | - api_get_course_id() |
|
525 | - ); |
|
526 | - $str_info = ''; |
|
527 | - foreach ($all_information_by_create_certificate[0] as $info_value) { |
|
528 | - $str_info .= $info_value.'<br/>'; |
|
529 | - } |
|
530 | - $create_certificate=get_lang('CreateCertificateWithTags'); |
|
531 | - Display::display_normal_message( |
|
532 | - $create_certificate.': <br /><br />'.$str_info, |
|
533 | - false |
|
534 | - ); |
|
535 | - } |
|
536 | - |
|
537 | - if ($extension=='svg' && !api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true'){ |
|
538 | - Display::display_warning_message(get_lang('BrowserDontSupportsSVG')); |
|
539 | - } |
|
521 | + if ($is_certificate_mode) { |
|
522 | + $all_information_by_create_certificate = DocumentManager::get_all_info_to_certificate( |
|
523 | + api_get_user_id(), |
|
524 | + api_get_course_id() |
|
525 | + ); |
|
526 | + $str_info = ''; |
|
527 | + foreach ($all_information_by_create_certificate[0] as $info_value) { |
|
528 | + $str_info .= $info_value.'<br/>'; |
|
529 | + } |
|
530 | + $create_certificate=get_lang('CreateCertificateWithTags'); |
|
531 | + Display::display_normal_message( |
|
532 | + $create_certificate.': <br /><br />'.$str_info, |
|
533 | + false |
|
534 | + ); |
|
535 | + } |
|
536 | + |
|
537 | + if ($extension=='svg' && !api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true'){ |
|
538 | + Display::display_warning_message(get_lang('BrowserDontSupportsSVG')); |
|
539 | + } |
|
540 | 540 | // HTML-editor |
541 | 541 | echo '<div class="page-create"> |
542 | 542 | <div class="row" style="overflow:hidden"> |
@@ -563,26 +563,26 @@ discard block |
||
563 | 563 | */ |
564 | 564 | function change_name($base_work_dir, $source_file, $rename_to, $dir, $doc) |
565 | 565 | { |
566 | - $file_name_for_change = $base_work_dir.$dir.$source_file; |
|
566 | + $file_name_for_change = $base_work_dir.$dir.$source_file; |
|
567 | 567 | $rename_to = disable_dangerous_file($rename_to); // Avoid renaming to .htaccess file |
568 | - $rename_to = my_rename($file_name_for_change, stripslashes($rename_to)); // fileManage API |
|
569 | - |
|
570 | - if ($rename_to) { |
|
571 | - if (isset($dir) && $dir != '') { |
|
572 | - $source_file = $dir.$source_file; |
|
573 | - $new_full_file_name = dirname($source_file).'/'.$rename_to; |
|
574 | - } else { |
|
575 | - $source_file = '/'.$source_file; |
|
576 | - $new_full_file_name = '/'.$rename_to; |
|
577 | - } |
|
578 | - |
|
579 | - update_db_info('update', $source_file, $new_full_file_name); // fileManage API |
|
568 | + $rename_to = my_rename($file_name_for_change, stripslashes($rename_to)); // fileManage API |
|
569 | + |
|
570 | + if ($rename_to) { |
|
571 | + if (isset($dir) && $dir != '') { |
|
572 | + $source_file = $dir.$source_file; |
|
573 | + $new_full_file_name = dirname($source_file).'/'.$rename_to; |
|
574 | + } else { |
|
575 | + $source_file = '/'.$source_file; |
|
576 | + $new_full_file_name = '/'.$rename_to; |
|
577 | + } |
|
578 | + |
|
579 | + update_db_info('update', $source_file, $new_full_file_name); // fileManage API |
|
580 | 580 | Display::addFlash(Display::return_message(get_lang('fileModified'))); |
581 | 581 | |
582 | - return true; |
|
583 | - } else { |
|
582 | + return true; |
|
583 | + } else { |
|
584 | 584 | Display::addFlash(Display::return_message(get_lang('FileExists'))); |
585 | - } |
|
585 | + } |
|
586 | 586 | } |
587 | 587 | |
588 | 588 | //return button back to |
@@ -595,32 +595,32 @@ discard block |
||
595 | 595 | global $parent_id; |
596 | 596 | $url = api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq().'&id='.$parent_id; |
597 | 597 | |
598 | - if ($is_certificate_mode) { |
|
599 | - $selectedCategory = (isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : ''); |
|
600 | - $actionsLeft .= '<a href="document.php?curdirpath='. $selectedCategory .'&selectcat=' . $selectedCategory .'">'. |
|
598 | + if ($is_certificate_mode) { |
|
599 | + $selectedCategory = (isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : ''); |
|
600 | + $actionsLeft .= '<a href="document.php?curdirpath='. $selectedCategory .'&selectcat=' . $selectedCategory .'">'. |
|
601 | 601 | Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
602 | 602 | $actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>'; |
603 | - } elseif($call_from_tool=='slideshow') { |
|
604 | - $actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/document/slideshow.php?slide_id='.$slide_id.'&curdirpath='.Security::remove_XSS(urlencode($_GET['curdirpath'])).'">'. |
|
603 | + } elseif($call_from_tool=='slideshow') { |
|
604 | + $actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/document/slideshow.php?slide_id='.$slide_id.'&curdirpath='.Security::remove_XSS(urlencode($_GET['curdirpath'])).'">'. |
|
605 | 605 | Display::return_icon('slideshow.png', get_lang('BackTo').' '.get_lang('ViewSlideshow'),'',ICON_SIZE_MEDIUM).'</a>'; |
606 | - } elseif($call_from_tool=='editdraw') { |
|
607 | - $actionsLeft .= '<a href="'.$url.'">'. |
|
606 | + } elseif($call_from_tool=='editdraw') { |
|
607 | + $actionsLeft .= '<a href="'.$url.'">'. |
|
608 | 608 | Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
609 | - $actionsLeft .= '<a href="javascript:history.back(1)">'.Display::return_icon('draw.png', get_lang('BackTo').' '.get_lang('Draw'), array(), 32).'</a>'; |
|
610 | - } elseif($call_from_tool=='editodf') { |
|
609 | + $actionsLeft .= '<a href="javascript:history.back(1)">'.Display::return_icon('draw.png', get_lang('BackTo').' '.get_lang('Draw'), array(), 32).'</a>'; |
|
610 | + } elseif($call_from_tool=='editodf') { |
|
611 | 611 | $actionsLeft .= '<a href="'.$url.'">'. |
612 | 612 | Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
613 | 613 | $actionsLeft .= '<a href="javascript:history.back(1)">'.Display::return_icon('draw.png', get_lang('BackTo').' '.get_lang('Write'), array(), 32).'</a>'; |
614 | 614 | $actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>'; |
615 | 615 | } elseif($call_from_tool=='editpaint'){ |
616 | - $actionsLeft .= '<a href="'.$url.'">'. |
|
616 | + $actionsLeft .= '<a href="'.$url.'">'. |
|
617 | 617 | Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), array(), ICON_SIZE_MEDIUM).'</a>'; |
618 | - $actionsLeft .= '<a href="javascript:history.back(1)">'.Display::return_icon('paint.png', get_lang('BackTo').' '.get_lang('Paint'), array(), 32).'</a>'; |
|
619 | - } else { |
|
620 | - $actionsLeft .= '<a href="'.$url.'">'. |
|
618 | + $actionsLeft .= '<a href="javascript:history.back(1)">'.Display::return_icon('paint.png', get_lang('BackTo').' '.get_lang('Paint'), array(), 32).'</a>'; |
|
619 | + } else { |
|
620 | + $actionsLeft .= '<a href="'.$url.'">'. |
|
621 | 621 | Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
622 | 622 | $actionsLeft .= '<a id="hide_bar_template" href="#">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>'; |
623 | - } |
|
623 | + } |
|
624 | 624 | |
625 | 625 | echo $toolbar = Display::toolbarAction('actions-documents', array(0 => $actionsLeft, 1 => '')); |
626 | 626 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | $editorConfig = array( |
124 | - 'ToolbarSet' => (api_is_allowed_to_edit(null, true) ? 'Documents' :'DocumentsStudent'), |
|
124 | + 'ToolbarSet' => (api_is_allowed_to_edit(null, true) ? 'Documents' : 'DocumentsStudent'), |
|
125 | 125 | 'Width' => '100%', |
126 | 126 | 'Height' => '400', |
127 | 127 | 'cols-size' => [2, 10, 0], |
@@ -164,13 +164,13 @@ discard block |
||
164 | 164 | "name" => get_lang('Documents'), |
165 | 165 | ); |
166 | 166 | } else { |
167 | - $interbreadcrumb[]= array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook')); |
|
167 | + $interbreadcrumb[] = array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook')); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | if (empty($document_data['parents'])) { |
171 | 171 | $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']); |
172 | 172 | } else { |
173 | - foreach($document_data['parents'] as $document_sub_data) { |
|
173 | + foreach ($document_data['parents'] as $document_sub_data) { |
|
174 | 174 | if ($document_data['title'] == $document_sub_data['title']) { |
175 | 175 | continue; |
176 | 176 | } |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $dir, |
355 | 355 | api_get_user_id() |
356 | 356 | ); |
357 | - header('Location: document.php?id=' . $document_data['parent_id'] . '&' . api_get_cidreq() . ($is_certificate_mode?'&curdirpath=/certificates&selectcat=1':'')); |
|
357 | + header('Location: document.php?id='.$document_data['parent_id'].'&'.api_get_cidreq().($is_certificate_mode ? '&curdirpath=/certificates&selectcat=1' : '')); |
|
358 | 358 | exit; |
359 | 359 | } else { |
360 | 360 | Display::addFlash(Display::return_message(get_lang('Impossible'), 'warning')); |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | /* Display user interface */ |
398 | 398 | |
399 | 399 | // Display the header |
400 | -$nameTools = get_lang('EditDocument') . ': '.Security::remove_XSS($document_data['title']); |
|
400 | +$nameTools = get_lang('EditDocument').': '.Security::remove_XSS($document_data['title']); |
|
401 | 401 | Display::display_header($nameTools, 'Doc'); |
402 | 402 | |
403 | 403 | $document_info = api_get_item_property_info( |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | $form->addElement('textarea', 'comment', get_lang('Comment'), ['cols-size' => [2, 10, 0]]); |
480 | 480 | |
481 | 481 | if ($owner_id == api_get_user_id() || api_is_platform_admin()) { |
482 | - $checked =& $form->addElement('checkbox', 'readonly', null, get_lang('ReadOnly')); |
|
482 | + $checked = & $form->addElement('checkbox', 'readonly', null, get_lang('ReadOnly')); |
|
483 | 483 | if ($readonly == 1) { |
484 | 484 | $checked->setChecked(true); |
485 | 485 | } |
@@ -519,14 +519,14 @@ discard block |
||
519 | 519 | foreach ($all_information_by_create_certificate[0] as $info_value) { |
520 | 520 | $str_info .= $info_value.'<br/>'; |
521 | 521 | } |
522 | - $create_certificate=get_lang('CreateCertificateWithTags'); |
|
522 | + $create_certificate = get_lang('CreateCertificateWithTags'); |
|
523 | 523 | Display::display_normal_message( |
524 | 524 | $create_certificate.': <br /><br />'.$str_info, |
525 | 525 | false |
526 | 526 | ); |
527 | 527 | } |
528 | 528 | |
529 | - if ($extension=='svg' && !api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true'){ |
|
529 | + if ($extension == 'svg' && !api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') { |
|
530 | 530 | Display::display_warning_message(get_lang('BrowserDontSupportsSVG')); |
531 | 531 | } |
532 | 532 | // HTML-editor |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | } |
579 | 579 | |
580 | 580 | //return button back to |
581 | -function show_return($document_id, $path, $call_from_tool='', $slide_id=0, $is_certificate_mode=false) |
|
581 | +function show_return($document_id, $path, $call_from_tool = '', $slide_id = 0, $is_certificate_mode = false) |
|
582 | 582 | { |
583 | 583 | $actionsLeft = null; |
584 | 584 | |
@@ -587,29 +587,29 @@ discard block |
||
587 | 587 | |
588 | 588 | if ($is_certificate_mode) { |
589 | 589 | $selectedCategory = (isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : ''); |
590 | - $actionsLeft .= '<a href="document.php?curdirpath='. $selectedCategory .'&selectcat=' . $selectedCategory .'">'. |
|
591 | - Display::return_icon('back.png',get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
592 | - $actionsLeft .= '<a id="hide_bar_template" href="#" role="button">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>'; |
|
593 | - } elseif($call_from_tool=='slideshow') { |
|
590 | + $actionsLeft .= '<a href="document.php?curdirpath='.$selectedCategory.'&selectcat='.$selectedCategory.'">'. |
|
591 | + Display::return_icon('back.png', get_lang('Back').' '.get_lang('To').' '.get_lang('CertificateOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
592 | + $actionsLeft .= '<a id="hide_bar_template" href="#" role="button">'.Display::return_icon('expand.png', get_lang('Expand'), array('id'=>'expand'), ICON_SIZE_MEDIUM).Display::return_icon('contract.png', get_lang('Collapse'), array('id'=>'contract', 'class'=>'hide'), ICON_SIZE_MEDIUM).'</a>'; |
|
593 | + } elseif ($call_from_tool == 'slideshow') { |
|
594 | 594 | $actionsLeft .= '<a href="'.api_get_path(WEB_PATH).'main/document/slideshow.php?slide_id='.$slide_id.'&curdirpath='.Security::remove_XSS(urlencode($_GET['curdirpath'])).'">'. |
595 | - Display::return_icon('slideshow.png', get_lang('BackTo').' '.get_lang('ViewSlideshow'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
596 | - } elseif($call_from_tool=='editdraw') { |
|
595 | + Display::return_icon('slideshow.png', get_lang('BackTo').' '.get_lang('ViewSlideshow'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
596 | + } elseif ($call_from_tool == 'editdraw') { |
|
597 | 597 | $actionsLeft .= '<a href="'.$url.'">'. |
598 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
598 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
599 | 599 | $actionsLeft .= '<a href="javascript:history.back(1)">'.Display::return_icon('draw.png', get_lang('BackTo').' '.get_lang('Draw'), array(), 32).'</a>'; |
600 | - } elseif($call_from_tool=='editodf') { |
|
600 | + } elseif ($call_from_tool == 'editodf') { |
|
601 | 601 | $actionsLeft .= '<a href="'.$url.'">'. |
602 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
602 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
603 | 603 | $actionsLeft .= '<a href="javascript:history.back(1)">'.Display::return_icon('draw.png', get_lang('BackTo').' '.get_lang('Write'), array(), 32).'</a>'; |
604 | - $actionsLeft .= '<a id="hide_bar_template" href="#" role="button">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>'; |
|
605 | - } elseif($call_from_tool=='editpaint'){ |
|
604 | + $actionsLeft .= '<a id="hide_bar_template" href="#" role="button">'.Display::return_icon('expand.png', get_lang('Expand'), array('id'=>'expand'), ICON_SIZE_MEDIUM).Display::return_icon('contract.png', get_lang('Collapse'), array('id'=>'contract', 'class'=>'hide'), ICON_SIZE_MEDIUM).'</a>'; |
|
605 | + } elseif ($call_from_tool == 'editpaint') { |
|
606 | 606 | $actionsLeft .= '<a href="'.$url.'">'. |
607 | 607 | Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), array(), ICON_SIZE_MEDIUM).'</a>'; |
608 | 608 | $actionsLeft .= '<a href="javascript:history.back(1)">'.Display::return_icon('paint.png', get_lang('BackTo').' '.get_lang('Paint'), array(), 32).'</a>'; |
609 | 609 | } else { |
610 | 610 | $actionsLeft .= '<a href="'.$url.'">'. |
611 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
612 | - $actionsLeft .= '<a id="hide_bar_template" href="#" role="button">'.Display::return_icon('expand.png',get_lang('Expand'),array('id'=>'expand'),ICON_SIZE_MEDIUM).Display::return_icon('contract.png',get_lang('Collapse'),array('id'=>'contract', 'class'=>'hide'),ICON_SIZE_MEDIUM).'</a>'; |
|
611 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
612 | + $actionsLeft .= '<a id="hide_bar_template" href="#" role="button">'.Display::return_icon('expand.png', get_lang('Expand'), array('id'=>'expand'), ICON_SIZE_MEDIUM).Display::return_icon('contract.png', get_lang('Collapse'), array('id'=>'contract', 'class'=>'hide'), ICON_SIZE_MEDIUM).'</a>'; |
|
613 | 613 | } |
614 | 614 | |
615 | 615 | echo $toolbar = Display::toolbarAction('actions-documents', array($actionsLeft)); |