@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | // Setting the section (for the tabs). |
16 | 16 | $this_section = SECTION_PLATFORM_ADMIN; |
17 | -$_SESSION['this_section']=$this_section; |
|
17 | +$_SESSION['this_section'] = $this_section; |
|
18 | 18 | |
19 | 19 | $action = isset($_GET['action']) ? $_GET['action'] : null; |
20 | 20 | $action_todo = false; |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | if (!empty($action)) { |
38 | - $interbreadcrumb[] = array ("url" => "system_announcements.php", "name" => get_lang('SystemAnnouncements')); |
|
38 | + $interbreadcrumb[] = array("url" => "system_announcements.php", "name" => get_lang('SystemAnnouncements')); |
|
39 | 39 | if ($action == 'add') { |
40 | - $interbreadcrumb[] = array ("url" => '#', "name" => get_lang('AddAnnouncement')); |
|
40 | + $interbreadcrumb[] = array("url" => '#', "name" => get_lang('AddAnnouncement')); |
|
41 | 41 | } |
42 | 42 | if ($action == 'edit') { |
43 | - $interbreadcrumb[] = array ("url" => '#', "name" => get_lang('Edit')); |
|
43 | + $interbreadcrumb[] = array("url" => '#', "name" => get_lang('Edit')); |
|
44 | 44 | } |
45 | 45 | } else { |
46 | 46 | $tool_name = get_lang('SystemAnnouncements'); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | // Actions |
69 | -switch($action) { |
|
69 | +switch ($action) { |
|
70 | 70 | case 'make_visible': |
71 | 71 | case 'make_invisible': |
72 | 72 | $status = false; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | Display :: display_confirmation_message(get_lang('AnnouncementDeleted')); |
82 | 82 | break; |
83 | 83 | case 'delete_selected': |
84 | - foreach($_POST['id'] as $index => $id) { |
|
84 | + foreach ($_POST['id'] as $index => $id) { |
|
85 | 85 | SystemAnnouncementManager :: delete_announcement($id); |
86 | 86 | } |
87 | 87 | Display :: display_confirmation_message(get_lang('AnnouncementDeleted')); |
@@ -137,11 +137,11 @@ discard block |
||
137 | 137 | $language_list = api_get_languages(); |
138 | 138 | $language_list_with_keys = array(); |
139 | 139 | $language_list_with_keys['all'] = get_lang('All'); |
140 | - for ($i=0; $i<count($language_list['name']) ; $i++) { |
|
140 | + for ($i = 0; $i < count($language_list['name']); $i++) { |
|
141 | 141 | $language_list_with_keys[$language_list['folder'][$i]] = $language_list['name'][$i]; |
142 | 142 | } |
143 | 143 | |
144 | - $form->addElement('select', 'lang',get_lang('Language'), $language_list_with_keys); |
|
144 | + $form->addElement('select', 'lang', get_lang('Language'), $language_list_with_keys); |
|
145 | 145 | $form->addHtmlEditor( |
146 | 146 | 'content', |
147 | 147 | get_lang('Content'), |
@@ -157,9 +157,9 @@ discard block |
||
157 | 157 | |
158 | 158 | $group = array(); |
159 | 159 | |
160 | - $group[]= $form->createElement('checkbox', 'visible_teacher', null, get_lang('Teacher')); |
|
161 | - $group[]= $form->createElement('checkbox', 'visible_student', null, get_lang('Student')); |
|
162 | - $group[]= $form->createElement('checkbox', 'visible_guest', null, get_lang('Guest')); |
|
160 | + $group[] = $form->createElement('checkbox', 'visible_teacher', null, get_lang('Teacher')); |
|
161 | + $group[] = $form->createElement('checkbox', 'visible_student', null, get_lang('Student')); |
|
162 | + $group[] = $form->createElement('checkbox', 'visible_guest', null, get_lang('Guest')); |
|
163 | 163 | |
164 | 164 | $form->addGroup($group, null, get_lang('Visible'), ''); |
165 | 165 | |
@@ -182,15 +182,15 @@ discard block |
||
182 | 182 | |
183 | 183 | $form->addElement('checkbox', 'send_mail', null, get_lang('SendMail')); |
184 | 184 | |
185 | - if (isset($_REQUEST['action']) && $_REQUEST['action']=='add') { |
|
185 | + if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') { |
|
186 | 186 | $form->addElement('checkbox', 'add_to_calendar', null, get_lang('AddToCalendar')); |
187 | - $text=get_lang('AddNews'); |
|
188 | - $class='add'; |
|
187 | + $text = get_lang('AddNews'); |
|
188 | + $class = 'add'; |
|
189 | 189 | $form->addElement('hidden', 'action', 'add'); |
190 | 190 | |
191 | 191 | } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') { |
192 | - $text=get_lang('EditNews'); |
|
193 | - $class='save'; |
|
192 | + $text = get_lang('EditNews'); |
|
193 | + $class = 'save'; |
|
194 | 194 | $form->addElement('hidden', 'action', 'edit'); |
195 | 195 | } |
196 | 196 | $form->addElement('checkbox', 'send_email_test', null, get_lang('SendOnlyAnEmailToMySelfToTest')); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | if ($show_announcement_list) { |
282 | 282 | $announcements = SystemAnnouncementManager :: get_all_announcements(); |
283 | - $announcement_data = array (); |
|
283 | + $announcement_data = array(); |
|
284 | 284 | foreach ($announcements as $index => $announcement) { |
285 | 285 | $row = array(); |
286 | 286 | $row[] = $announcement->id; |
@@ -288,9 +288,9 @@ discard block |
||
288 | 288 | $row[] = $announcement->title; |
289 | 289 | $row[] = api_convert_and_format_date($announcement->date_start); |
290 | 290 | $row[] = api_convert_and_format_date($announcement->date_end); |
291 | - $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_TEACHER."&action=". ($announcement->visible_teacher ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_teacher ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
292 | - $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_STUDENT."&action=". ($announcement->visible_student ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_student ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
293 | - $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_GUEST."&action=". ($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
291 | + $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_TEACHER."&action=".($announcement->visible_teacher ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_teacher ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
292 | + $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_STUDENT."&action=".($announcement->visible_student ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_student ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
293 | + $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_GUEST."&action=".($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
294 | 294 | |
295 | 295 | $row[] = $announcement->lang; |
296 | 296 | $row[] = "<a href=\"?action=edit&id=".$announcement->id."\">".Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL)."</a> <a href=\"?action=delete&id=".$announcement->id."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."')) return false;\">".Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL)."</a>"; |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | ) { |
32 | 32 | deleteNode($categoryId); |
33 | 33 | Display::addFlash(Display::return_message(get_lang('Deleted'))); |
34 | - header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category)); |
|
34 | + header('Location: '.api_get_self().'?category='.Security::remove_XSS($category)); |
|
35 | 35 | exit(); |
36 | 36 | } |
37 | 37 | } else { |
38 | 38 | deleteNode($categoryId); |
39 | 39 | Display::addFlash(Display::return_message(get_lang('Deleted'))); |
40 | - header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category)); |
|
40 | + header('Location: '.api_get_self().'?category='.Security::remove_XSS($category)); |
|
41 | 41 | exit(); |
42 | 42 | } |
43 | 43 | } elseif (($action == 'add' || $action == 'edit') && isset($_POST['formSent']) && $_POST['formSent']) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | } elseif ($action == 'moveUp') { |
68 | 68 | moveNodeUp($categoryId, $_GET['tree_pos'], $category); |
69 | - header('Location: ' . api_get_self() . '?category=' . Security::remove_XSS($category)); |
|
69 | + header('Location: '.api_get_self().'?category='.Security::remove_XSS($category)); |
|
70 | 70 | Display::addFlash(Display::return_message(get_lang('Updated'))); |
71 | 71 | exit(); |
72 | 72 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $form_title = ($action == 'add') ? get_lang('AddACategory') : get_lang('EditNode'); |
97 | 97 | if (!empty($category)) { |
98 | - $form_title .= ' ' . get_lang('Into') . ' ' . Security::remove_XSS($category); |
|
98 | + $form_title .= ' '.get_lang('Into').' '.Security::remove_XSS($category); |
|
99 | 99 | } |
100 | 100 | $url = api_get_self().'?action='.Security::remove_XSS($action).'&category='.Security::remove_XSS($category).'&id='.Security::remove_XSS($categoryId); |
101 | 101 | $form = new FormValidator('course_category', 'post', $url); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $skill_profile = new SkillProfile(); |
25 | 25 | $skill_rel_user = new SkillRelUser(); |
26 | 26 | |
27 | -$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php'; |
|
27 | +$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php'; |
|
28 | 28 | |
29 | 29 | $tpl = new Template(get_lang('Skills')); |
30 | 30 | |
@@ -55,16 +55,16 @@ discard block |
||
55 | 55 | $_SESSION['skills'] = $skills; |
56 | 56 | |
57 | 57 | } else { |
58 | - $skills = isset($_SESSION['skills']) ? $_SESSION['skills']: array(); |
|
58 | + $skills = isset($_SESSION['skills']) ? $_SESSION['skills'] : array(); |
|
59 | 59 | } |
60 | 60 | } else { |
61 | - $skills = isset($_SESSION['skills']) ? $_SESSION['skills']: array(); |
|
61 | + $skills = isset($_SESSION['skills']) ? $_SESSION['skills'] : array(); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $user_list = array(); |
65 | 65 | $count_skills = count($skills); |
66 | 66 | |
67 | -$users = $skill_rel_user->get_user_by_skills($skills); |
|
67 | +$users = $skill_rel_user->get_user_by_skills($skills); |
|
68 | 68 | |
69 | 69 | if (!empty($users)) { |
70 | 70 | foreach ($users as $user) { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $user_list[$user['user_id']]['user'] = $user_info; |
73 | 73 | $my_user_skills = $skill_rel_user->get_user_skills($user['user_id']); |
74 | 74 | $user_skills = array(); |
75 | - $found_counts = 0 ; |
|
75 | + $found_counts = 0; |
|
76 | 76 | foreach ($my_user_skills as $my_skill) { |
77 | 77 | $found = false; |
78 | 78 | if (in_array($my_skill['skill_id'], $skills)) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $user_list[$user['user_id']]['total_found_skills'] = $found_counts; |
90 | 90 | } |
91 | 91 | $ordered_user_list = array(); |
92 | - foreach($user_list as $user_id => $user_data) { |
|
92 | + foreach ($user_list as $user_id => $user_data) { |
|
93 | 93 | $ordered_user_list[$user_data['total_found_skills']][] = $user_data; |
94 | 94 | } |
95 | 95 | if (!empty($ordered_user_list)) { |
@@ -103,14 +103,14 @@ discard block |
||
103 | 103 | |
104 | 104 | if (!empty($skills)) { |
105 | 105 | $counter = 0; |
106 | - foreach($skills as $hidden_skill_id) { |
|
106 | + foreach ($skills as $hidden_skill_id) { |
|
107 | 107 | $form->addElement('hidden', 'hidden_skills[]', $hidden_skill_id); |
108 | 108 | $counter++; |
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
112 | 112 | if (!empty($skills)) { |
113 | - foreach($skills as $my_skill) { |
|
113 | + foreach ($skills as $my_skill) { |
|
114 | 114 | $total_skills_to_search[$my_skill] = $my_skill; |
115 | 115 | } |
116 | 116 | } |
@@ -4,11 +4,11 @@ discard block |
||
4 | 4 | * Edition of extensions configuration |
5 | 5 | * @package chamilo.admin |
6 | 6 | */ |
7 | -$cidReset=true; |
|
7 | +$cidReset = true; |
|
8 | 8 | require_once '../inc/global.inc.php'; |
9 | -$this_section=SECTION_PLATFORM_ADMIN; |
|
9 | +$this_section = SECTION_PLATFORM_ADMIN; |
|
10 | 10 | api_protect_admin_script(); |
11 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
11 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
12 | 12 | // Database Table Definitions |
13 | 13 | $tbl_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT); |
14 | 14 | $message = ''; |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | WHERE variable="service_visio" |
22 | 22 | AND subkey="active"'; |
23 | 23 | $rs = Database::query($sql); |
24 | - if (Database::affected_rows($rs)>0) { |
|
24 | + if (Database::affected_rows($rs) > 0) { |
|
25 | 25 | // select all the courses and insert the tool inside |
26 | 26 | $sql = 'SELECT id FROM '.Database::get_main_table(TABLE_MAIN_COURSE); |
27 | 27 | $rs = Database::query($sql); |
28 | - while($row = Database::fetch_array($rs)){ |
|
29 | - if(!empty($_POST['visio_host'])) { |
|
28 | + while ($row = Database::fetch_array($rs)) { |
|
29 | + if (!empty($_POST['visio_host'])) { |
|
30 | 30 | $tool_table = Database::get_course_table(TABLE_TOOL_LIST); |
31 | 31 | $select = "SELECT id FROM $tool_table WHERE c_id =".$row['id']." AND name='".TOOL_VISIO_CONFERENCE."'"; |
32 | 32 | $selectres = Database::query($select); |
33 | - if (Database::num_rows($selectres)<1) { |
|
33 | + if (Database::num_rows($selectres) < 1) { |
|
34 | 34 | $sql = 'INSERT INTO '.$tool_table.' SET |
35 | 35 | c_id = '.$row['id'].', |
36 | 36 | name="'.TOOL_VISIO_CONFERENCE.'", |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | $select = "SELECT id FROM $tool_table WHERE c_id =".$row['id']." AND name='".TOOL_VISIO_CLASSROOM."'"; |
47 | 47 | $selectres = Database::query($select); |
48 | - if(Database::num_rows($selectres)<1) { |
|
48 | + if (Database::num_rows($selectres) < 1) { |
|
49 | 49 | $sql = 'INSERT INTO '.$tool_table.' SET |
50 | 50 | c_id = '.$row['id'].', |
51 | 51 | name="'.TOOL_VISIO_CLASSROOM.'", |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | $rs = Database::query($sql); |
83 | 83 | |
84 | 84 | $sql = 'UPDATE '.$tbl_settings_current.' SET |
85 | - selected_value="'.($_POST['visio_use_rtmpt']=='true'?'true':'false').'" |
|
85 | + selected_value="'.($_POST['visio_use_rtmpt'] == 'true' ? 'true' : 'false').'" |
|
86 | 86 | WHERE variable="service_visio" |
87 | 87 | AND subkey="visio_use_rtmpt"'; |
88 | 88 | $rs = Database::query($sql); |
89 | 89 | |
90 | - if(empty($message)) { |
|
90 | + if (empty($message)) { |
|
91 | 91 | $message = get_lang('ServiceReconfigured'); |
92 | 92 | } |
93 | 93 | break; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | $rs = Database::query($sql); |
102 | 102 | |
103 | - if (Database::affected_rows($rs)>0){ |
|
103 | + if (Database::affected_rows($rs) > 0) { |
|
104 | 104 | $message = get_lang('ServiceActivated'); |
105 | 105 | } |
106 | 106 | |
@@ -153,20 +153,20 @@ discard block |
||
153 | 153 | WHERE variable LIKE "service_%" AND subkey="active" and selected_value="true"'; |
154 | 154 | |
155 | 155 | $rs = Database::query($sql); |
156 | -while($row = Database::fetch_array($rs)){ |
|
156 | +while ($row = Database::fetch_array($rs)) { |
|
157 | 157 | $listActiveServices[] = $row['variable']; |
158 | 158 | } |
159 | 159 | |
160 | 160 | // javascript to handle accordion behaviour |
161 | 161 | $javascript_message = ''; |
162 | -if(!empty($message)){ |
|
162 | +if (!empty($message)) { |
|
163 | 163 | $javascript_message = |
164 | 164 | ' |
165 | 165 | document.getElementById("message").style.display = "block"; |
166 | 166 | var timer = setTimeout(hideMessage,5000); |
167 | 167 | '; |
168 | 168 | } |
169 | -$htmlHeadXtra[]= ' |
|
169 | +$htmlHeadXtra[] = ' |
|
170 | 170 | <script type="text/javascript"> |
171 | 171 | var listeDiv; |
172 | 172 | var extensionsHeader = new Array(); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | ?> |
216 | 216 | <div id="message" style="display: none"> |
217 | 217 | <?php |
218 | - if(!empty($message)) |
|
218 | + if (!empty($message)) |
|
219 | 219 | Display::display_normal_message($message) |
220 | 220 | ?> |
221 | 221 | </div> |
@@ -330,13 +330,13 @@ discard block |
||
330 | 330 | $renderer = $form -> defaultRenderer(); |
331 | 331 | $renderer -> setElementTemplate('<div style="text-align:left">{label}</div><div style="text-align:left">{element}</div>'); |
332 | 332 | //$form -> addElement('html','<br /><br />'); |
333 | - if(in_array('service_ppt2lp',$listActiveServices)) |
|
333 | + if (in_array('service_ppt2lp', $listActiveServices)) |
|
334 | 334 | { |
335 | 335 | $sql = 'SELECT subkey, selected_value FROM '.$tbl_settings_current.' |
336 | 336 | WHERE variable = "service_ppt2lp" |
337 | 337 | AND subkey <> "active"'; |
338 | 338 | $rs = Database::query($sql); |
339 | - while($row = Database::fetch_array($rs,'ASSOC')) |
|
339 | + while ($row = Database::fetch_array($rs, 'ASSOC')) |
|
340 | 340 | { |
341 | 341 | $defaults[$row['subkey']] = $row['selected_value']; |
342 | 342 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $htmlHeadXtra[] = api_get_jqgrid_js(); |
19 | 19 | |
20 | 20 | // setting breadcrumbs |
21 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
21 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | 22 | |
23 | 23 | $tool_name = null; |
24 | 24 | |
@@ -39,23 +39,23 @@ discard block |
||
39 | 39 | $token = Security::get_token(); |
40 | 40 | |
41 | 41 | if ($action == 'add') { |
42 | - $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName); |
|
43 | - $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],'name' => $extra_field_info['display_text']); |
|
44 | - $interbreadcrumb[]=array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions')); |
|
45 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add')); |
|
42 | + $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName); |
|
43 | + $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], 'name' => $extra_field_info['display_text']); |
|
44 | + $interbreadcrumb[] = array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions')); |
|
45 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add')); |
|
46 | 46 | } elseif ($action == 'edit') { |
47 | - $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName); |
|
48 | - $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'],'name' => $extra_field_info['display_text']); |
|
49 | - $interbreadcrumb[]=array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions')); |
|
47 | + $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName); |
|
48 | + $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], 'name' => $extra_field_info['display_text']); |
|
49 | + $interbreadcrumb[] = array('url' => 'extra_field_options.php?type='.$extra_field->type.'&field_id='.$extra_field_info['id'], 'name' => get_lang('EditExtraFieldOptions')); |
|
50 | 50 | |
51 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit')); |
|
51 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit')); |
|
52 | 52 | } else { |
53 | - $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extra_field->type,'name' => $extra_field->pageName); |
|
54 | - $interbreadcrumb[]=array( |
|
53 | + $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extra_field->type, 'name' => $extra_field->pageName); |
|
54 | + $interbreadcrumb[] = array( |
|
55 | 55 | 'url' => 'extra_fields.php?type='.$extra_field->type.'&action=edit&id='.$extra_field_info['id'], |
56 | 56 | 'name' => $extra_field_info['display_text'] |
57 | 57 | ); |
58 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('EditExtraFieldOptions')); |
|
58 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditExtraFieldOptions')); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | //jqgrid will use this URL to do the selects |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | |
109 | 109 | //With this function we can add actions to the jgrid (edit, delete, etc) |
110 | 110 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
111 | - return \'<a href="?action=edit&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'. |
|
112 | - ' <a onclick="javascript:if(!confirm('."\'".addslashes(get_lang("ConfirmYourChoice"))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. |
|
111 | + return \'<a href="?action=edit&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'. |
|
112 | + ' <a onclick="javascript:if(!confirm('."\'".addslashes(get_lang("ConfirmYourChoice"))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&'.$params.'&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'. |
|
113 | 113 | '\'; |
114 | 114 | }'; |
115 | 115 | |
116 | -$htmlHeadXtra[]='<script> |
|
116 | +$htmlHeadXtra[] = '<script> |
|
117 | 117 | $(function() { |
118 | 118 | // grid definition see the $obj->display() function |
119 | 119 | '.Display::grid_js( |
@@ -11,7 +11,7 @@ |
||
11 | 11 | $this_section = SECTION_PLATFORM_ADMIN; |
12 | 12 | // User permissions |
13 | 13 | api_protect_admin_script(); |
14 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
14 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
15 | 15 | Display :: display_header(get_lang('SystemStatus')); |
16 | 16 | $diag = new Diagnoser(); |
17 | 17 | $diag->show_html(); |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | if ($existsBadgesDirectory) { |
47 | 47 | |
48 | 48 | if (!empty($skill['icon'])) { |
49 | - $iconFileAbsolutePath = $badgePath . $skill['icon']; |
|
49 | + $iconFileAbsolutePath = $badgePath.$skill['icon']; |
|
50 | 50 | |
51 | 51 | if (Security::check_abs_path($iconFileAbsolutePath, $badgePath)) { |
52 | - unlink($badgePath . $skill['icon']); |
|
52 | + unlink($badgePath.$skill['icon']); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
@@ -72,24 +72,24 @@ discard block |
||
72 | 72 | |
73 | 73 | $objSkill->update($params); |
74 | 74 | |
75 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php'); |
|
75 | + header('Location: '.api_get_path(WEB_CODE_PATH).'admin/skill_badge_list.php'); |
|
76 | 76 | exit; |
77 | 77 | } |
78 | 78 | |
79 | 79 | $interbreadcrumb = array( |
80 | 80 | array( |
81 | - 'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php', |
|
81 | + 'url' => api_get_path(WEB_CODE_PATH).'admin/index.php', |
|
82 | 82 | 'name' => get_lang('Administration') |
83 | 83 | ), |
84 | 84 | array( |
85 | - 'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php', |
|
85 | + 'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php', |
|
86 | 86 | 'name' => get_lang('Badges') |
87 | 87 | ) |
88 | 88 | ); |
89 | 89 | |
90 | 90 | $toolbar = Display::toolbarButton( |
91 | 91 | get_lang('ManageSkills'), |
92 | - api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php', |
|
92 | + api_get_path(WEB_CODE_PATH).'admin/skill_list.php', |
|
93 | 93 | 'list', |
94 | 94 | 'primary', |
95 | 95 | ['title' => get_lang('ManageSkills')] |
@@ -14,10 +14,10 @@ discard block |
||
14 | 14 | */ |
15 | 15 | function validate_data($user_classes) { |
16 | 16 | global $purification_option_for_usernames; |
17 | - $errors = array (); |
|
18 | - $classcodes = array (); |
|
17 | + $errors = array(); |
|
18 | + $classcodes = array(); |
|
19 | 19 | |
20 | - if (!isset($_POST['subscribe']) && !isset($_POST['subscribe'])) { |
|
20 | + if (!isset($_POST['subscribe']) && !isset($_POST['subscribe'])) { |
|
21 | 21 | $user_class['error'] = get_lang('SelectAnAction'); |
22 | 22 | $errors[] = $user_class; |
23 | 23 | return $errors; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | foreach ($user_classes as $index => $user_class) { |
26 | 26 | $user_class['line'] = $index + 1; |
27 | 27 | // 1. Check whether mandatory fields are set. |
28 | - $mandatory_fields = array ('UserName', 'ClassName'); |
|
28 | + $mandatory_fields = array('UserName', 'ClassName'); |
|
29 | 29 | |
30 | 30 | foreach ($mandatory_fields as $key => $field) { |
31 | 31 | if (!isset ($user_class[$field]) || strlen($user_class[$field]) == 0) { |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | global $purification_option_for_usernames; |
77 | 77 | |
78 | 78 | // Table definitions. |
79 | - $user_table = Database :: get_main_table(TABLE_MAIN_USER); |
|
80 | - $class_user_table = Database :: get_main_table(TABLE_MAIN_CLASS_USER); |
|
81 | - $class_table = Database :: get_main_table(TABLE_MAIN_CLASS); |
|
79 | + $user_table = Database :: get_main_table(TABLE_MAIN_USER); |
|
80 | + $class_user_table = Database :: get_main_table(TABLE_MAIN_CLASS_USER); |
|
81 | + $class_table = Database :: get_main_table(TABLE_MAIN_CLASS); |
|
82 | 82 | |
83 | 83 | // Data parsing: purification + conversion (UserName, ClassName) --> (user_is, class_id) |
84 | - $csv_data = array (); |
|
84 | + $csv_data = array(); |
|
85 | 85 | foreach ($users_classes as $index => $user_class) { |
86 | 86 | |
87 | 87 | $sql1 = "SELECT user_id FROM $user_table WHERE username = '".Database::escape_string(UserManager::purify_username($user_class['UserName'], $purification_option_for_usernames))."'"; |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | |
141 | 141 | $tool_name = get_lang('AddUsersToAClass').' CSV'; |
142 | 142 | |
143 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
144 | -$interbreadcrumb[] = array ('url' => 'class_list.php', 'name' => get_lang('Classes')); |
|
143 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
144 | +$interbreadcrumb[] = array('url' => 'class_list.php', 'name' => get_lang('Classes')); |
|
145 | 145 | |
146 | 146 | // Set this option to true to enforce strict purification for usenames. |
147 | 147 | $purification_option_for_usernames = false; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | // setting the section (for the tabs) |
16 | 16 | $this_section = SECTION_PLATFORM_ADMIN; |
17 | 17 | // setting breadcrumbs |
18 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
18 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
19 | 19 | // Access restrictions |
20 | 20 | api_protect_admin_script(true); |
21 | 21 | $nameTools = get_lang('SpecialExports'); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | if (function_exists('ini_set')) { |
31 | 31 | api_set_memory_limit('256M'); |
32 | - ini_set('max_execution_time',0); |
|
32 | + ini_set('max_execution_time', 0); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | // Displaying the header |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if (count($_POST) == 0) { |
42 | 42 | Display::display_normal_message(get_lang('SpecialExportsIntroduction')); |
43 | 43 | } |
44 | -$error =0; |
|
44 | +$error = 0; |
|
45 | 45 | /* MAIN CODE */ |
46 | 46 | |
47 | 47 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
@@ -66,17 +66,17 @@ discard block |
||
66 | 66 | $groupCondition = " (props.to_group_id = 0 OR props.to_group_id IS NULL)"; |
67 | 67 | } |
68 | 68 | |
69 | - $zip_folder=new PclZip($FileZip['TEMP_FILE_ZIP']); |
|
70 | - if(!isset($_POST['resource']) || count($_POST['resource']) == 0 ) { |
|
69 | + $zip_folder = new PclZip($FileZip['TEMP_FILE_ZIP']); |
|
70 | + if (!isset($_POST['resource']) || count($_POST['resource']) == 0) { |
|
71 | 71 | Display::display_error_message(get_lang('ErrorMsgSpecialExport')); |
72 | 72 | } else { |
73 | 73 | $Resource = $_POST['resource']; |
74 | 74 | |
75 | 75 | foreach ($Resource as $Code_course => $Sessions) { |
76 | - $_course = api_get_course_info($Code_course); |
|
76 | + $_course = api_get_course_info($Code_course); |
|
77 | 77 | $tbl_document = Database::get_course_table(TABLE_DOCUMENT); |
78 | 78 | $tbl_property = Database::get_course_table(TABLE_ITEM_PROPERTY); |
79 | - $course_id = $_course['real_id']; |
|
79 | + $course_id = $_course['real_id']; |
|
80 | 80 | |
81 | 81 | //Add item to the zip file course |
82 | 82 | $sql = "SELECT path FROM $tbl_document AS docs, $tbl_property AS props |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | AND $groupCondition |
90 | 90 | AND docs.c_id = $course_id |
91 | 91 | AND props.c_id = $course_id"; |
92 | - $query = Database::query($sql ); |
|
92 | + $query = Database::query($sql); |
|
93 | 93 | while ($rows_course_file = Database::fetch_assoc($query)) { |
94 | 94 | $zip_folder->add( |
95 | 95 | $FileZip['PATH_COURSE'].$_course['directory']."/document".$rows_course_file['path'], |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | ); |
101 | 101 | } |
102 | 102 | |
103 | - foreach ($Sessions as $IdSession => $value){ |
|
103 | + foreach ($Sessions as $IdSession => $value) { |
|
104 | 104 | $session_id = Security::remove_XSS($IdSession); |
105 | 105 | //Add tem to the zip file session course |
106 | 106 | $sql_session_doc = "SELECT path FROM $tbl_document AS docs, $tbl_property AS props |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | if (isset ($_POST['backup_option']) && $_POST['backup_option'] == 'select_items') { |
151 | 151 | $cb = new CourseBuilder(); |
152 | 152 | $course = $cb->build_session_course(); |
153 | - if($course === false){ |
|
153 | + if ($course === false) { |
|
154 | 154 | Display::display_error_message(get_lang('ErrorMsgSpecialExport')); |
155 | 155 | form_special_export(); |
156 | 156 | } else { |
@@ -166,12 +166,12 @@ discard block |
||
166 | 166 | Display::display_footer(); |
167 | 167 | |
168 | 168 | function form_special_export() { |
169 | - $form = new FormValidator('special_exports','post'); |
|
169 | + $form = new FormValidator('special_exports', 'post'); |
|
170 | 170 | $renderer = $form->defaultRenderer(); |
171 | 171 | $renderer->setCustomElementTemplate('<div>{element}</div> '); |
172 | - $form->addElement('radio', 'backup_option', '', get_lang('SpecialCreateFullBackup'), 'full_backup'); |
|
173 | - $form->addElement('radio', 'backup_option', '', get_lang('SpecialLetMeSelectItems'), 'select_items'); |
|
174 | - $form->addElement('html','<br />'); |
|
172 | + $form->addElement('radio', 'backup_option', '', get_lang('SpecialCreateFullBackup'), 'full_backup'); |
|
173 | + $form->addElement('radio', 'backup_option', '', get_lang('SpecialLetMeSelectItems'), 'select_items'); |
|
174 | + $form->addElement('html', '<br />'); |
|
175 | 175 | $form->addButtonExport(get_lang('CreateBackup')); |
176 | 176 | $form->add_progress_bar(); |
177 | 177 | $values['backup_option'] = 'full_backup'; |
@@ -179,26 +179,26 @@ discard block |
||
179 | 179 | $form->display(); |
180 | 180 | } |
181 | 181 | |
182 | -function create_zip(){ |
|
182 | +function create_zip() { |
|
183 | 183 | $path = ''; |
184 | - if(empty($path)) { $path='/'; } |
|
185 | - $remove_dir = ($path!='/') ? substr($path,0,strlen($path) - strlen(basename($path))) : '/'; |
|
184 | + if (empty($path)) { $path = '/'; } |
|
185 | + $remove_dir = ($path != '/') ? substr($path, 0, strlen($path) - strlen(basename($path))) : '/'; |
|
186 | 186 | $sys_archive_path = api_get_path(SYS_ARCHIVE_PATH); |
187 | 187 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
188 | 188 | $temp_zip_dir = $sys_archive_path."temp"; |
189 | - if(!is_dir($temp_zip_dir)) { |
|
189 | + if (!is_dir($temp_zip_dir)) { |
|
190 | 190 | mkdir($temp_zip_dir, api_get_permissions_for_new_directories()); |
191 | 191 | } else { |
192 | - $handle=opendir($temp_zip_dir); |
|
193 | - while (false!==($file = readdir($handle))) { |
|
192 | + $handle = opendir($temp_zip_dir); |
|
193 | + while (false !== ($file = readdir($handle))) { |
|
194 | 194 | if ($file != "." && $file != "..") { |
195 | - $Diff = (time() - filemtime("$temp_zip_dir/$file"))/60/60; //the "age" of the file in hours |
|
196 | - if ($Diff > 4) unlink("$temp_zip_dir/$file"); //delete files older than 4 hours |
|
195 | + $Diff = (time() - filemtime("$temp_zip_dir/$file")) / 60 / 60; //the "age" of the file in hours |
|
196 | + if ($Diff > 4) unlink("$temp_zip_dir/$file"); //delete files older than 4 hours |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 | closedir($handle); |
200 | 200 | } |
201 | - $temp_zip_file = $temp_zip_dir."/".md5(time()).".zip"; //create zipfile of given directory |
|
201 | + $temp_zip_file = $temp_zip_dir."/".md5(time()).".zip"; //create zipfile of given directory |
|
202 | 202 | return array('PATH' => $path, |
203 | 203 | 'PATH_TEMP_ARCHIVE' => $temp_zip_dir, |
204 | 204 | 'PATH_COURSE' => $sys_course_path, |
@@ -207,17 +207,17 @@ discard block |
||
207 | 207 | } |
208 | 208 | |
209 | 209 | function rename_zip($FileZip) { |
210 | - Event::event_download(($FileZip['PATH'] == '/')?'full_export_'.date('Ymd').'.zip (folder)': basename($FileZip['PATH']).'.zip (folder)'); |
|
211 | - $name = ($FileZip['PATH']=='/')? 'full_export_'.date('Ymd').'.zip':basename($FileZip['PATH']).'.zip'; |
|
212 | - if(file_exists($FileZip['PATH_TEMP_ARCHIVE'].'/'.$name)){ unlink($FileZip['PATH_TEMP_ARCHIVE'].'/'.$name); } |
|
213 | - if(file_exists($FileZip['TEMP_FILE_ZIP'])) { |
|
210 | + Event::event_download(($FileZip['PATH'] == '/') ? 'full_export_'.date('Ymd').'.zip (folder)' : basename($FileZip['PATH']).'.zip (folder)'); |
|
211 | + $name = ($FileZip['PATH'] == '/') ? 'full_export_'.date('Ymd').'.zip' : basename($FileZip['PATH']).'.zip'; |
|
212 | + if (file_exists($FileZip['PATH_TEMP_ARCHIVE'].'/'.$name)) { unlink($FileZip['PATH_TEMP_ARCHIVE'].'/'.$name); } |
|
213 | + if (file_exists($FileZip['TEMP_FILE_ZIP'])) { |
|
214 | 214 | rename($FileZip['TEMP_FILE_ZIP'], $FileZip['PATH_TEMP_ARCHIVE'].'/'.$name); |
215 | 215 | return $name; |
216 | 216 | } else { return false; } |
217 | 217 | |
218 | 218 | } |
219 | 219 | |
220 | -function fullexportspecial(){ |
|
220 | +function fullexportspecial() { |
|
221 | 221 | global $tbl_session, $tbl_session_course, $export; |
222 | 222 | $FileZip = create_zip(); |
223 | 223 | $to_group_id = 0; |
@@ -235,10 +235,10 @@ discard block |
||
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | - if (count($list_course) >0 ) { |
|
239 | - foreach($list_course as $_course) { |
|
240 | - if($FileZip['PATH'] == '/') { |
|
241 | - $querypath=''; // to prevent ...path LIKE '//%'... in query |
|
238 | + if (count($list_course) > 0) { |
|
239 | + foreach ($list_course as $_course) { |
|
240 | + if ($FileZip['PATH'] == '/') { |
|
241 | + $querypath = ''; // to prevent ...path LIKE '//%'... in query |
|
242 | 242 | } else { |
243 | 243 | $querypath = $FileZip['PATH']; |
244 | 244 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | AND $groupCondition |
256 | 256 | AND docs.c_id = $course_id |
257 | 257 | AND props.c_id = $course_id"; |
258 | - $query = Database::query($sql ); |
|
258 | + $query = Database::query($sql); |
|
259 | 259 | while ($rows_course_file = Database::fetch_assoc($query)) { |
260 | 260 | $rows_course_file['path']; |
261 | 261 | $zip_folder->add($FileZip['PATH_COURSE'].$_course['directory']."/document".$rows_course_file['path'], |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | } |
296 | 296 | |
297 | 297 | $name = rename_zip($FileZip); |
298 | - if ($name === false){ |
|
298 | + if ($name === false) { |
|
299 | 299 | $export = false; |
300 | 300 | return false; |
301 | 301 | } else { |