@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | <option value = "%">--</option> |
201 | 201 | <?php |
202 | 202 | echo Display :: get_alphabet_options(); |
203 | - ?> |
|
203 | + ?> |
|
204 | 204 | </select> |
205 | 205 | <?php echo '<br />'; ?> |
206 | 206 | </td> |
@@ -211,31 +211,31 @@ discard block |
||
211 | 211 | <td align="center"> |
212 | 212 | <div id="content_source"> |
213 | 213 | <?php |
214 | - if (!($add_type=='multiple')) { |
|
214 | + if (!($add_type=='multiple')) { |
|
215 | 215 | ?> |
216 | 216 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
217 | 217 | <div id="ajax_list_users_single"></div> |
218 | 218 | <?php |
219 | - } else { |
|
220 | - ?> |
|
219 | + } else { |
|
220 | + ?> |
|
221 | 221 | <div id="ajax_list_multiple"> |
222 | 222 | <?php echo Display::select('elements_not_in_name',$elements_not_in, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?> |
223 | 223 | </div> |
224 | 224 | <?php |
225 | - } |
|
226 | - ?> |
|
225 | + } |
|
226 | + ?> |
|
227 | 227 | </div> |
228 | 228 | </td> |
229 | 229 | <td width="10%" valign="middle" align="center"> |
230 | 230 | <?php |
231 | - if ($ajax_search) { |
|
232 | - ?> |
|
231 | + if ($ajax_search) { |
|
232 | + ?> |
|
233 | 233 | <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('elements_in'))" > |
234 | 234 | <em class="fa fa-arrow-left"></em> |
235 | 235 | </button> |
236 | 236 | <?php |
237 | - } else { |
|
238 | - ?> |
|
237 | + } else { |
|
238 | + ?> |
|
239 | 239 | <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))"> |
240 | 240 | <em class="fa fa-arrow-right"></em> |
241 | 241 | </button> |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | <em class="fa fa-arrow-left"></em> |
245 | 245 | </button> |
246 | 246 | <?php |
247 | - } |
|
248 | - ?> |
|
247 | + } |
|
248 | + ?> |
|
249 | 249 | <br /><br /><br /><br /><br /><br /> |
250 | 250 | </td> |
251 | 251 | <td align="center"> |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | set_time_limit(0); |
38 | 38 | |
39 | 39 | if (isset($_POST['formSent'])) { |
40 | - $formSent = $_POST['formSent']; |
|
41 | - $file_type = isset($_POST['file_type']) ? $_POST['file_type'] : 'csv'; |
|
42 | - $session_id = $_POST['session_id']; |
|
43 | - if (empty($session_id)) { |
|
44 | - $sql = "SELECT |
|
40 | + $formSent = $_POST['formSent']; |
|
41 | + $file_type = isset($_POST['file_type']) ? $_POST['file_type'] : 'csv'; |
|
42 | + $session_id = $_POST['session_id']; |
|
43 | + if (empty($session_id)) { |
|
44 | + $sql = "SELECT |
|
45 | 45 | s.id, |
46 | 46 | name, |
47 | 47 | id_coach, |
@@ -55,84 +55,84 @@ discard block |
||
55 | 55 | ON $tbl_user.user_id = s.id_coach |
56 | 56 | ORDER BY id"; |
57 | 57 | |
58 | - if (api_is_multiple_url_enabled()) { |
|
59 | - $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
60 | - $access_url_id = api_get_current_access_url_id(); |
|
61 | - if ($access_url_id != -1){ |
|
62 | - $sql = "SELECT s.id, name,id_coach,username,access_start_date,access_end_date,visibility,session_category_id |
|
58 | + if (api_is_multiple_url_enabled()) { |
|
59 | + $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
60 | + $access_url_id = api_get_current_access_url_id(); |
|
61 | + if ($access_url_id != -1){ |
|
62 | + $sql = "SELECT s.id, name,id_coach,username,access_start_date,access_end_date,visibility,session_category_id |
|
63 | 63 | FROM $tbl_session s |
64 | 64 | INNER JOIN $tbl_session_rel_access_url as session_rel_url |
65 | 65 | ON (s.id= session_rel_url.session_id) |
66 | 66 | INNER JOIN $tbl_user u ON (u.user_id = s.id_coach) |
67 | 67 | WHERE access_url_id = $access_url_id |
68 | 68 | ORDER BY id"; |
69 | - } |
|
70 | - } |
|
69 | + } |
|
70 | + } |
|
71 | 71 | |
72 | - $result = Database::query($sql); |
|
73 | - } else { |
|
74 | - $sql = "SELECT s.id,name,username,access_start_date,access_end_date,visibility,session_category_id |
|
72 | + $result = Database::query($sql); |
|
73 | + } else { |
|
74 | + $sql = "SELECT s.id,name,username,access_start_date,access_end_date,visibility,session_category_id |
|
75 | 75 | FROM $tbl_session s |
76 | 76 | INNER JOIN $tbl_user |
77 | 77 | ON $tbl_user.user_id = s.id_coach |
78 | 78 | WHERE s.id='$session_id'"; |
79 | - $result = Database::query($sql); |
|
80 | - } |
|
79 | + $result = Database::query($sql); |
|
80 | + } |
|
81 | 81 | |
82 | - if (Database::num_rows($result)) { |
|
82 | + if (Database::num_rows($result)) { |
|
83 | 83 | |
84 | 84 | |
85 | 85 | |
86 | - $sessionListToExport = []; |
|
86 | + $sessionListToExport = []; |
|
87 | 87 | |
88 | - if (in_array($file_type, ['csv', 'xls'])) { |
|
88 | + if (in_array($file_type, ['csv', 'xls'])) { |
|
89 | 89 | |
90 | - $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time(); |
|
90 | + $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time(); |
|
91 | 91 | |
92 | - $cvs = true; |
|
93 | - $sessionListToExport[] = [ |
|
94 | - 'SessionName', |
|
95 | - 'Coach', |
|
96 | - 'DateStart', |
|
97 | - 'DateEnd', |
|
98 | - 'Visibility', |
|
99 | - 'SessionCategory', |
|
100 | - 'Users', |
|
101 | - 'Courses' |
|
102 | - ]; |
|
103 | - } else { |
|
104 | - if (!file_exists($archivePath)) { |
|
105 | - mkdir($archivePath, api_get_permissions_for_new_directories(), true); |
|
106 | - } |
|
92 | + $cvs = true; |
|
93 | + $sessionListToExport[] = [ |
|
94 | + 'SessionName', |
|
95 | + 'Coach', |
|
96 | + 'DateStart', |
|
97 | + 'DateEnd', |
|
98 | + 'Visibility', |
|
99 | + 'SessionCategory', |
|
100 | + 'Users', |
|
101 | + 'Courses' |
|
102 | + ]; |
|
103 | + } else { |
|
104 | + if (!file_exists($archivePath)) { |
|
105 | + mkdir($archivePath, api_get_permissions_for_new_directories(), true); |
|
106 | + } |
|
107 | 107 | |
108 | - if (!file_exists($archivePath.'index.html')) { |
|
109 | - $fp = fopen($archivePath.'index.html', 'w'); |
|
110 | - fputs($fp, '<html><head></head><body></body></html>'); |
|
111 | - fclose($fp); |
|
112 | - } |
|
108 | + if (!file_exists($archivePath.'index.html')) { |
|
109 | + $fp = fopen($archivePath.'index.html', 'w'); |
|
110 | + fputs($fp, '<html><head></head><body></body></html>'); |
|
111 | + fclose($fp); |
|
112 | + } |
|
113 | 113 | |
114 | - $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time().'.'.$file_type; |
|
115 | - while (file_exists($archivePath.$archiveFile)) { |
|
116 | - $archiveFile ='export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type; |
|
117 | - } |
|
114 | + $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time().'.'.$file_type; |
|
115 | + while (file_exists($archivePath.$archiveFile)) { |
|
116 | + $archiveFile ='export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type; |
|
117 | + } |
|
118 | 118 | |
119 | - $cvs = false; |
|
120 | - $fp = fopen($archivePath.$archiveFile, 'w'); |
|
121 | - fputs($fp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Sessions>\n"); |
|
122 | - } |
|
119 | + $cvs = false; |
|
120 | + $fp = fopen($archivePath.$archiveFile, 'w'); |
|
121 | + fputs($fp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Sessions>\n"); |
|
122 | + } |
|
123 | 123 | |
124 | 124 | |
125 | - while ($row = Database::fetch_array($result)) { |
|
126 | - $row['name'] = str_replace(';',',',$row['name']); |
|
127 | - $row['username'] = str_replace(';',',',$row['username']); |
|
128 | - $row['access_start_date'] = str_replace(';',',',$row['access_start_date']); |
|
129 | - $row['access_end_date'] = str_replace(';',',',$row['access_end_date']); |
|
130 | - $row['visibility'] = str_replace(';',',',$row['visibility']); |
|
131 | - $row['session_category'] = str_replace(';',',',$row['session_category_id']); |
|
125 | + while ($row = Database::fetch_array($result)) { |
|
126 | + $row['name'] = str_replace(';',',',$row['name']); |
|
127 | + $row['username'] = str_replace(';',',',$row['username']); |
|
128 | + $row['access_start_date'] = str_replace(';',',',$row['access_start_date']); |
|
129 | + $row['access_end_date'] = str_replace(';',',',$row['access_end_date']); |
|
130 | + $row['visibility'] = str_replace(';',',',$row['visibility']); |
|
131 | + $row['session_category'] = str_replace(';',',',$row['session_category_id']); |
|
132 | 132 | |
133 | 133 | |
134 | - // users |
|
135 | - $sql = "SELECT DISTINCT $tbl_user.username |
|
134 | + // users |
|
135 | + $sql = "SELECT DISTINCT $tbl_user.username |
|
136 | 136 | FROM $tbl_user |
137 | 137 | INNER JOIN $tbl_session_user |
138 | 138 | ON |
@@ -140,33 +140,33 @@ discard block |
||
140 | 140 | $tbl_session_user.relation_type<>".SESSION_RELATION_TYPE_RRHH." AND |
141 | 141 | $tbl_session_user.session_id = '".$row['id']."'"; |
142 | 142 | |
143 | - $rsUsers = Database::query($sql); |
|
144 | - $users = ''; |
|
145 | - while ($rowUsers = Database::fetch_array($rsUsers)){ |
|
146 | - if($cvs){ |
|
147 | - $users .= str_replace(';',',',$rowUsers['username']).'|'; |
|
148 | - } else { |
|
149 | - $users .= "\t\t<User>$rowUsers[username]</User>\n"; |
|
150 | - } |
|
151 | - } |
|
152 | - |
|
153 | - if (!empty($users) && $cvs) { |
|
154 | - $users = api_substr($users, 0, api_strlen($users) - 1); |
|
155 | - } |
|
156 | - |
|
157 | - // Courses |
|
158 | - $sql = "SELECT DISTINCT c.code, sc.id, c_id |
|
143 | + $rsUsers = Database::query($sql); |
|
144 | + $users = ''; |
|
145 | + while ($rowUsers = Database::fetch_array($rsUsers)){ |
|
146 | + if($cvs){ |
|
147 | + $users .= str_replace(';',',',$rowUsers['username']).'|'; |
|
148 | + } else { |
|
149 | + $users .= "\t\t<User>$rowUsers[username]</User>\n"; |
|
150 | + } |
|
151 | + } |
|
152 | + |
|
153 | + if (!empty($users) && $cvs) { |
|
154 | + $users = api_substr($users, 0, api_strlen($users) - 1); |
|
155 | + } |
|
156 | + |
|
157 | + // Courses |
|
158 | + $sql = "SELECT DISTINCT c.code, sc.id, c_id |
|
159 | 159 | FROM $tbl_course c |
160 | 160 | INNER JOIN $tbl_session_course_user sc |
161 | 161 | ON c.id = sc.c_id |
162 | 162 | AND sc.session_id = '".$row['id']."'"; |
163 | 163 | |
164 | - $rsCourses = Database::query($sql); |
|
164 | + $rsCourses = Database::query($sql); |
|
165 | 165 | |
166 | - $courses = ''; |
|
167 | - while ($rowCourses = Database::fetch_array($rsCourses)) { |
|
168 | - // get coachs from a course |
|
169 | - $sql = "SELECT u.username |
|
166 | + $courses = ''; |
|
167 | + while ($rowCourses = Database::fetch_array($rsCourses)) { |
|
168 | + // get coachs from a course |
|
169 | + $sql = "SELECT u.username |
|
170 | 170 | FROM $tbl_session_course_user scu |
171 | 171 | INNER JOIN $tbl_user u |
172 | 172 | ON u.user_id = scu.user_id |
@@ -175,25 +175,25 @@ discard block |
||
175 | 175 | scu.session_id = '".$row['id']."' AND |
176 | 176 | scu.status = 2 "; |
177 | 177 | |
178 | - $rs_coachs = Database::query($sql); |
|
179 | - $coachs = array(); |
|
180 | - while ($row_coachs = Database::fetch_array($rs_coachs)) { |
|
181 | - $coachs[] = $row_coachs['username']; |
|
182 | - } |
|
183 | - |
|
184 | - $coachs = implode(",", $coachs); |
|
185 | - |
|
186 | - if ($cvs) { |
|
187 | - $courses .= str_replace(';',',',$rowCourses['code']); |
|
188 | - $courses .= '['.str_replace(';',',',$coachs).']['; |
|
189 | - } else { |
|
190 | - $courses .= "\t\t<Course>\n"; |
|
191 | - $courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n"; |
|
192 | - $courses .= "\t\t\t<Coach>$coachs</Coach>\n"; |
|
193 | - } |
|
194 | - |
|
195 | - // rel user courses |
|
196 | - $sql = "SELECT DISTINCT u.username |
|
178 | + $rs_coachs = Database::query($sql); |
|
179 | + $coachs = array(); |
|
180 | + while ($row_coachs = Database::fetch_array($rs_coachs)) { |
|
181 | + $coachs[] = $row_coachs['username']; |
|
182 | + } |
|
183 | + |
|
184 | + $coachs = implode(",", $coachs); |
|
185 | + |
|
186 | + if ($cvs) { |
|
187 | + $courses .= str_replace(';',',',$rowCourses['code']); |
|
188 | + $courses .= '['.str_replace(';',',',$coachs).']['; |
|
189 | + } else { |
|
190 | + $courses .= "\t\t<Course>\n"; |
|
191 | + $courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n"; |
|
192 | + $courses .= "\t\t\t<Coach>$coachs</Coach>\n"; |
|
193 | + } |
|
194 | + |
|
195 | + // rel user courses |
|
196 | + $sql = "SELECT DISTINCT u.username |
|
197 | 197 | FROM $tbl_session_course_user scu |
198 | 198 | INNER JOIN $tbl_session_user su |
199 | 199 | ON |
@@ -206,79 +206,79 @@ discard block |
||
206 | 206 | scu.c_id='".$rowCourses['c_id']."' AND |
207 | 207 | scu.session_id='".$row['id']."'"; |
208 | 208 | |
209 | - $rsUsersCourse = Database::query($sql); |
|
210 | - $userscourse = ''; |
|
211 | - while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)){ |
|
212 | - if ($cvs) { |
|
213 | - $userscourse .= str_replace(';',',',$rowUsersCourse['username']).','; |
|
214 | - } else { |
|
215 | - $courses .= "\t\t\t<User>$rowUsersCourse[username]</User>\n"; |
|
216 | - } |
|
217 | - } |
|
218 | - |
|
219 | - if ($cvs) { |
|
220 | - if (!empty($userscourse)) { |
|
221 | - $userscourse = api_substr( |
|
222 | - $userscourse, |
|
223 | - 0, |
|
224 | - api_strlen($userscourse) - 1 |
|
225 | - ); |
|
226 | - } |
|
227 | - |
|
228 | - $courses .= $userscourse.']|'; |
|
229 | - } else { |
|
230 | - $courses .= "\t\t</Course>\n"; |
|
231 | - } |
|
232 | - } |
|
233 | - |
|
234 | - if (!empty($courses) && $cvs) { |
|
235 | - $courses = api_substr($courses, 0, api_strlen($courses) - 1); |
|
236 | - } |
|
237 | - $add = $courses; |
|
238 | - |
|
239 | - if (in_array($file_type, ['csv', 'xls'])) { |
|
240 | - $sessionListToExport[] = [ |
|
241 | - $row['name'], |
|
242 | - $row['username'], |
|
243 | - $row['access_start_date'], |
|
244 | - $row['access_end_date'], |
|
245 | - $row['visibility'], |
|
246 | - $row['session_category'], |
|
247 | - $users, |
|
248 | - $courses |
|
249 | - ]; |
|
250 | - } else { |
|
251 | - $add = "\t<Session>\n" |
|
252 | - ."\t\t<SessionName>$row[name]</SessionName>\n" |
|
253 | - ."\t\t<Coach>$row[username]</Coach>\n" |
|
254 | - ."\t\t<DateStart>$row[access_start_date]</DateStart>\n" |
|
255 | - ."\t\t<DateEnd>$row[access_end_date]</DateEnd>\n" |
|
256 | - ."\t\t<Visibility>$row[visibility]</Visibility>\n" |
|
257 | - ."\t\t<SessionCategory>$row[session_category]</SessionCategory>\n"; |
|
258 | - } |
|
259 | - |
|
260 | - if (!$cvs) { |
|
261 | - $add .= "\t</Session>\n"; |
|
262 | - fputs($fp, $add); |
|
263 | - } |
|
264 | - } |
|
265 | - |
|
266 | - switch ($file_type) { |
|
267 | - case 'xml': |
|
268 | - fputs($fp, "</Sessions>\n"); |
|
269 | - fclose($fp); |
|
270 | - $errorMsg = get_lang('UserListHasBeenExported').'<br/> |
|
209 | + $rsUsersCourse = Database::query($sql); |
|
210 | + $userscourse = ''; |
|
211 | + while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)){ |
|
212 | + if ($cvs) { |
|
213 | + $userscourse .= str_replace(';',',',$rowUsersCourse['username']).','; |
|
214 | + } else { |
|
215 | + $courses .= "\t\t\t<User>$rowUsersCourse[username]</User>\n"; |
|
216 | + } |
|
217 | + } |
|
218 | + |
|
219 | + if ($cvs) { |
|
220 | + if (!empty($userscourse)) { |
|
221 | + $userscourse = api_substr( |
|
222 | + $userscourse, |
|
223 | + 0, |
|
224 | + api_strlen($userscourse) - 1 |
|
225 | + ); |
|
226 | + } |
|
227 | + |
|
228 | + $courses .= $userscourse.']|'; |
|
229 | + } else { |
|
230 | + $courses .= "\t\t</Course>\n"; |
|
231 | + } |
|
232 | + } |
|
233 | + |
|
234 | + if (!empty($courses) && $cvs) { |
|
235 | + $courses = api_substr($courses, 0, api_strlen($courses) - 1); |
|
236 | + } |
|
237 | + $add = $courses; |
|
238 | + |
|
239 | + if (in_array($file_type, ['csv', 'xls'])) { |
|
240 | + $sessionListToExport[] = [ |
|
241 | + $row['name'], |
|
242 | + $row['username'], |
|
243 | + $row['access_start_date'], |
|
244 | + $row['access_end_date'], |
|
245 | + $row['visibility'], |
|
246 | + $row['session_category'], |
|
247 | + $users, |
|
248 | + $courses |
|
249 | + ]; |
|
250 | + } else { |
|
251 | + $add = "\t<Session>\n" |
|
252 | + ."\t\t<SessionName>$row[name]</SessionName>\n" |
|
253 | + ."\t\t<Coach>$row[username]</Coach>\n" |
|
254 | + ."\t\t<DateStart>$row[access_start_date]</DateStart>\n" |
|
255 | + ."\t\t<DateEnd>$row[access_end_date]</DateEnd>\n" |
|
256 | + ."\t\t<Visibility>$row[visibility]</Visibility>\n" |
|
257 | + ."\t\t<SessionCategory>$row[session_category]</SessionCategory>\n"; |
|
258 | + } |
|
259 | + |
|
260 | + if (!$cvs) { |
|
261 | + $add .= "\t</Session>\n"; |
|
262 | + fputs($fp, $add); |
|
263 | + } |
|
264 | + } |
|
265 | + |
|
266 | + switch ($file_type) { |
|
267 | + case 'xml': |
|
268 | + fputs($fp, "</Sessions>\n"); |
|
269 | + fclose($fp); |
|
270 | + $errorMsg = get_lang('UserListHasBeenExported').'<br/> |
|
271 | 271 | <a class="btn btn-default" href="'.$archiveURL.$archiveFile.'">'.get_lang('ClickHereToDownloadTheFile').'</a>'; |
272 | - break; |
|
273 | - case 'csv': |
|
274 | - Export::arrayToCsv($sessionListToExport, $archiveFile); |
|
275 | - exit; |
|
276 | - case 'xls': |
|
277 | - Export::arrayToXls($sessionListToExport, $archiveFile); |
|
278 | - exit; |
|
279 | - break; |
|
280 | - } |
|
281 | - } |
|
272 | + break; |
|
273 | + case 'csv': |
|
274 | + Export::arrayToCsv($sessionListToExport, $archiveFile); |
|
275 | + exit; |
|
276 | + case 'xls': |
|
277 | + Export::arrayToXls($sessionListToExport, $archiveFile); |
|
278 | + exit; |
|
279 | + break; |
|
280 | + } |
|
281 | + } |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | // display the header |
@@ -288,26 +288,26 @@ discard block |
||
288 | 288 | $sql = "SELECT id, name FROM $tbl_session ORDER BY name"; |
289 | 289 | |
290 | 290 | if (api_is_multiple_url_enabled()) { |
291 | - $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
292 | - $access_url_id = api_get_current_access_url_id(); |
|
293 | - if ($access_url_id != -1){ |
|
294 | - $sql = "SELECT s.id, name FROM $tbl_session s |
|
291 | + $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
292 | + $access_url_id = api_get_current_access_url_id(); |
|
293 | + if ($access_url_id != -1){ |
|
294 | + $sql = "SELECT s.id, name FROM $tbl_session s |
|
295 | 295 | INNER JOIN $tbl_session_rel_access_url as session_rel_url |
296 | 296 | ON (s.id = session_rel_url.session_id) |
297 | 297 | WHERE access_url_id = $access_url_id |
298 | 298 | ORDER BY name"; |
299 | - } |
|
299 | + } |
|
300 | 300 | } |
301 | 301 | $result = Database::query($sql); |
302 | 302 | $Sessions = Database::store_result($result); |
303 | 303 | |
304 | 304 | echo '<div class="actions">'; |
305 | 305 | echo '<a href="../session/session_list.php">'. |
306 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
306 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
307 | 307 | echo '</div>'; |
308 | 308 | |
309 | 309 | if (!empty($errorMsg)) { |
310 | - Display::display_normal_message($errorMsg, false); //main API |
|
310 | + Display::display_normal_message($errorMsg, false); //main API |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | $form = new FormValidator('session_export', 'post', api_get_self()); |
@@ -167,9 +167,9 @@ |
||
167 | 167 | // possible : number_groups_left > 0 and is group member |
168 | 168 | $possible_users = array(); |
169 | 169 | foreach ($complete_user_list as $index => $user) { |
170 | - if ($user['number_groups_left'] > 0 || in_array($user['user_id'], $selected_users)) { |
|
170 | + if ($user['number_groups_left'] > 0 || in_array($user['user_id'], $selected_users)) { |
|
171 | 171 | $possible_users[$user['user_id']] = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; |
172 | - } |
|
172 | + } |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | $group_members_element = $form->addElement( |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $message .= '<p><a class="btn btn-primary" href="'.api_get_path(WEB_CODE_PATH).'course_info/maintenance.php?'.api_get_cidreq().'">'. |
45 | 45 | get_lang('No').'</a> <a class="btn btn-danger" href="'.api_get_self().'?delete=yes&'.api_get_cidreq().'">'. |
46 | 46 | get_lang('Yes').'</a></p>'; |
47 | - $interbreadcrumb[] = array('url' => 'maintenance.php', 'name' => get_lang('Maintenance')); |
|
47 | + $interbreadcrumb[] = array('url' => 'maintenance.php', 'name' => get_lang('Maintenance')); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $tpl = new Template($tool_name); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | //path for svg-edit save |
47 | 47 | $_SESSION['draw_dir'] = Security::remove_XSS($dir); |
48 | 48 | if ($_SESSION['draw_dir'] == '/') { |
49 | - $_SESSION['draw_dir'] = ''; |
|
49 | + $_SESSION['draw_dir'] = ''; |
|
50 | 50 | } |
51 | 51 | $_SESSION['draw_file'] = basename(Security::remove_XSS($file_path)); |
52 | 52 | $get_file = Security::remove_XSS($file_path); |
@@ -62,26 +62,26 @@ discard block |
||
62 | 62 | /* Please, do not modify this dirname formatting */ |
63 | 63 | |
64 | 64 | if (strstr($dir, '..')) { |
65 | - $dir = '/'; |
|
65 | + $dir = '/'; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | if ($dir[0] == '.') { |
69 | - $dir = substr($dir, 1); |
|
69 | + $dir = substr($dir, 1); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | if ($dir[0] != '/') { |
73 | - $dir = '/'.$dir; |
|
73 | + $dir = '/'.$dir; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | if ($dir[strlen($dir) - 1] != '/') { |
77 | - $dir .= '/'; |
|
77 | + $dir .= '/'; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
81 | 81 | |
82 | 82 | if (!is_dir($filepath)) { |
83 | - $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
84 | - $dir = '/'; |
|
83 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
84 | + $dir = '/'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | //groups //TODO:clean |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), |
91 | 91 | 'name' => get_lang('GroupSpace'), |
92 | 92 | ); |
93 | - $group_document = true; |
|
94 | - $noPHP_SELF = true; |
|
93 | + $group_document = true; |
|
94 | + $noPHP_SELF = true; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | $is_certificate_mode = DocumentManager::is_certificate_mode($dir); |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | $is_allowedToEdit = api_is_allowed_to_edit(null, true) || $groupRights || |
120 | - DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $current_session_id); |
|
120 | + DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $current_session_id); |
|
121 | 121 | |
122 | 122 | if (!$is_allowedToEdit) { |
123 | - api_not_allowed(true); |
|
123 | + api_not_allowed(true); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | Event::event_access_tool(TOOL_DOCUMENT); |
@@ -134,13 +134,13 @@ discard block |
||
134 | 134 | echo '</div>'; |
135 | 135 | |
136 | 136 | if (api_browser_support('svg')) { |
137 | - //automatic loading the course language |
|
138 | - $svgedit_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn'); |
|
139 | - $langsvgedit = api_get_language_isocode(); |
|
140 | - $langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit; |
|
141 | - $langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'javascript/svgedit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en'; |
|
142 | - $svg_url = api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/svg-editor.php?url=../../../../../courses/'.$courseDir.$dir.$file.'&lang='.$langsvgedit; |
|
143 | - ?> |
|
137 | + //automatic loading the course language |
|
138 | + $svgedit_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn'); |
|
139 | + $langsvgedit = api_get_language_isocode(); |
|
140 | + $langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit; |
|
141 | + $langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'javascript/svgedit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en'; |
|
142 | + $svg_url = api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/svg-editor.php?url=../../../../../courses/'.$courseDir.$dir.$file.'&lang='.$langsvgedit; |
|
143 | + ?> |
|
144 | 144 | <script> |
145 | 145 | document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo $svg_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>'); |
146 | 146 | function resizeIframe() { |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | |
159 | 159 | <?php |
160 | 160 | echo '<noscript>'; |
161 | - echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0\' src="'.$svg_url.'"<noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>'; |
|
162 | - echo '</noscript>'; |
|
161 | + echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0\' src="'.$svg_url.'"<noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>'; |
|
162 | + echo '</noscript>'; |
|
163 | 163 | } else { |
164 | - Display::display_error_message(get_lang('BrowserDontSupportsSVG')); |
|
164 | + Display::display_error_message(get_lang('BrowserDontSupportsSVG')); |
|
165 | 165 | } |
166 | 166 | Display::display_footer(); |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | |
23 | 23 | $document_data = DocumentManager::get_document_data_by_id($_GET['id'], api_get_course_id(), true); |
24 | 24 | if (empty($document_data)) { |
25 | - if (api_is_in_group()) { |
|
26 | - $group_properties = GroupManager::get_group_properties(api_get_group_id()); |
|
27 | - $document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']); |
|
28 | - $document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id()); |
|
29 | - } |
|
25 | + if (api_is_in_group()) { |
|
26 | + $group_properties = GroupManager::get_group_properties(api_get_group_id()); |
|
27 | + $document_id = DocumentManager::get_document_id(api_get_course_info(), $group_properties['directory']); |
|
28 | + $document_data = DocumentManager::get_document_data_by_id($document_id, api_get_course_id()); |
|
29 | + } |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | $document_id = $document_data['id']; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | //make some vars |
36 | 36 | $wamidir = $dir; |
37 | 37 | if ($wamidir == "/") { |
38 | - $wamidir = ""; |
|
38 | + $wamidir = ""; |
|
39 | 39 | } |
40 | 40 | $wamiurlplay = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document'.$wamidir."/"; |
41 | 41 | $groupId = api_get_group_id(); |
@@ -45,48 +45,48 @@ discard block |
||
45 | 45 | // Please, do not modify this dirname formatting |
46 | 46 | |
47 | 47 | if (strstr($dir, '..')) { |
48 | - $dir = '/'; |
|
48 | + $dir = '/'; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if ($dir[0] == '.') { |
52 | - $dir = substr($dir, 1); |
|
52 | + $dir = substr($dir, 1); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | if ($dir[0] != '/') { |
56 | - $dir = '/'.$dir; |
|
56 | + $dir = '/'.$dir; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | if ($dir[strlen($dir) - 1] != '/') { |
60 | - $dir .= '/'; |
|
60 | + $dir .= '/'; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
64 | 64 | |
65 | 65 | if (!is_dir($filepath)) { |
66 | - $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
67 | - $dir = '/'; |
|
66 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
67 | + $dir = '/'; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | //groups //TODO: clean |
71 | 71 | if (!empty($groupId)) { |
72 | - $interbreadcrumb[] = array ("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace')); |
|
73 | - $noPHP_SELF = true; |
|
74 | - $group = GroupManager :: get_group_properties($groupId); |
|
75 | - $path = explode('/', $dir); |
|
76 | - if ('/'.$path[1] != $group['directory']) { |
|
77 | - api_not_allowed(true); |
|
78 | - } |
|
72 | + $interbreadcrumb[] = array ("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace')); |
|
73 | + $noPHP_SELF = true; |
|
74 | + $group = GroupManager :: get_group_properties($groupId); |
|
75 | + $path = explode('/', $dir); |
|
76 | + if ('/'.$path[1] != $group['directory']) { |
|
77 | + api_not_allowed(true); |
|
78 | + } |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | $interbreadcrumb[] = array("url" => "./document.php?id=".$document_id.'&'.api_get_cidreq(), "name" => get_lang('Documents')); |
82 | 82 | |
83 | 83 | if (!api_is_allowed_in_course()) { |
84 | - api_not_allowed(true); |
|
84 | + api_not_allowed(true); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | if (!($is_allowed_to_edit || $groupRights || |
88 | - DocumentManager::is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) { |
|
89 | - api_not_allowed(true); |
|
88 | + DocumentManager::is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) { |
|
89 | + api_not_allowed(true); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /* Header */ |
@@ -94,26 +94,26 @@ discard block |
||
94 | 94 | |
95 | 95 | $display_dir = $dir; |
96 | 96 | if (isset ($group)) { |
97 | - $display_dir = explode('/', $dir); |
|
98 | - unset ($display_dir[0]); |
|
99 | - unset ($display_dir[1]); |
|
100 | - $display_dir = implode('/', $display_dir); |
|
97 | + $display_dir = explode('/', $dir); |
|
98 | + unset ($display_dir[0]); |
|
99 | + unset ($display_dir[1]); |
|
100 | + $display_dir = implode('/', $display_dir); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | // Interbreadcrumb for the current directory root path |
104 | 104 | $counter = 0; |
105 | 105 | if (isset($document_data['parents'])) { |
106 | - foreach($document_data['parents'] as $document_sub_data) { |
|
107 | - //fixing double group folder in breadcrumb |
|
108 | - if (api_get_group_id()) { |
|
109 | - if ($counter == 0) { |
|
110 | - $counter++; |
|
111 | - continue; |
|
112 | - } |
|
113 | - } |
|
114 | - $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']); |
|
115 | - $counter++; |
|
116 | - } |
|
106 | + foreach($document_data['parents'] as $document_sub_data) { |
|
107 | + //fixing double group folder in breadcrumb |
|
108 | + if (api_get_group_id()) { |
|
109 | + if ($counter == 0) { |
|
110 | + $counter++; |
|
111 | + continue; |
|
112 | + } |
|
113 | + } |
|
114 | + $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']); |
|
115 | + $counter++; |
|
116 | + } |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | //make some vars |
@@ -125,12 +125,12 @@ discard block |
||
125 | 125 | $htmlHeadXtra[] = '<script type="text/javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'swfobject/swfobject.js"></script>'; |
126 | 126 | |
127 | 127 | $actions = Display::toolbarButton( |
128 | - get_lang('BackTo') . ' ' . get_lang('DocumentsOverview'), |
|
129 | - 'document.php?' . api_get_cidreq() . "&id=$document_id", |
|
130 | - 'arrow-left', |
|
131 | - 'default', |
|
132 | - [], |
|
133 | - false |
|
128 | + get_lang('BackTo') . ' ' . get_lang('DocumentsOverview'), |
|
129 | + 'document.php?' . api_get_cidreq() . "&id=$document_id", |
|
130 | + 'arrow-left', |
|
131 | + 'default', |
|
132 | + [], |
|
133 | + false |
|
134 | 134 | ); |
135 | 135 | |
136 | 136 | $template = new Template($nameTools); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | //make some vars |
38 | 38 | $webcamdir=$dir; |
39 | 39 | if($webcamdir=="/"){ |
40 | - $webcamdir=""; |
|
40 | + $webcamdir=""; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -46,49 +46,49 @@ discard block |
||
46 | 46 | // Please, do not modify this dirname formatting |
47 | 47 | |
48 | 48 | if (strstr($dir, '..')) { |
49 | - $dir = '/'; |
|
49 | + $dir = '/'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | if ($dir[0] == '.') { |
53 | - $dir = substr($dir, 1); |
|
53 | + $dir = substr($dir, 1); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | if ($dir[0] != '/') { |
57 | - $dir = '/'.$dir; |
|
57 | + $dir = '/'.$dir; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($dir[strlen($dir) - 1] != '/') { |
61 | - $dir .= '/'; |
|
61 | + $dir .= '/'; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
65 | 65 | |
66 | 66 | if (!is_dir($filepath)) { |
67 | - $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
68 | - $dir = '/'; |
|
67 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
68 | + $dir = '/'; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $groupId = api_get_group_id(); |
72 | 72 | |
73 | 73 | if (!empty($groupId)) { |
74 | - $interbreadcrumb[] = array ("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace')); |
|
75 | - $noPHP_SELF = true; |
|
76 | - $group = GroupManager :: get_group_properties($groupId); |
|
77 | - $path = explode('/', $dir); |
|
78 | - if ('/'.$path[1] != $group['directory']) { |
|
79 | - api_not_allowed(true); |
|
80 | - } |
|
74 | + $interbreadcrumb[] = array ("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace')); |
|
75 | + $noPHP_SELF = true; |
|
76 | + $group = GroupManager :: get_group_properties($groupId); |
|
77 | + $path = explode('/', $dir); |
|
78 | + if ('/'.$path[1] != $group['directory']) { |
|
79 | + api_not_allowed(true); |
|
80 | + } |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $interbreadcrumb[] = array ("url" => "./document.php?id=".$document_id."&".api_get_cidreq(), "name" => get_lang('Documents')); |
84 | 84 | |
85 | 85 | if (!api_is_allowed_in_course()) { |
86 | - api_not_allowed(true); |
|
86 | + api_not_allowed(true); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | if (!($is_allowed_to_edit || $groupRights || |
90 | - DocumentManager::is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) { |
|
91 | - api_not_allowed(true); |
|
90 | + DocumentManager::is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) { |
|
91 | + api_not_allowed(true); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /* Header */ |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | |
97 | 97 | $display_dir = $dir; |
98 | 98 | if (isset ($group)) { |
99 | - $display_dir = explode('/', $dir); |
|
100 | - unset ($display_dir[0]); |
|
101 | - unset ($display_dir[1]); |
|
102 | - $display_dir = implode('/', $display_dir); |
|
99 | + $display_dir = explode('/', $dir); |
|
100 | + unset ($display_dir[0]); |
|
101 | + unset ($display_dir[1]); |
|
102 | + $display_dir = implode('/', $display_dir); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | // Interbreadcrumb for the current directory root path |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | Display :: display_header($nameTools, 'Doc'); |
125 | 125 | echo '<div class="actions">'; |
126 | 126 | echo '<a href="document.php?id='.$document_id.'">'. |
127 | - Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
127 | + Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
128 | 128 | echo '</div>'; |
129 | 129 | ?> |
130 | 130 |
@@ -52,26 +52,26 @@ discard block |
||
52 | 52 | // Please, do not modify this dirname formatting |
53 | 53 | |
54 | 54 | if (strstr($dir, '..')) { |
55 | - $dir = '/'; |
|
55 | + $dir = '/'; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | if ($dir[0] == '.') { |
59 | - $dir = substr($dir, 1); |
|
59 | + $dir = substr($dir, 1); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | if ($dir[0] != '/') { |
63 | - $dir = '/'.$dir; |
|
63 | + $dir = '/'.$dir; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | if ($dir[strlen($dir) - 1] != '/') { |
67 | - $dir .= '/'; |
|
67 | + $dir .= '/'; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
71 | 71 | |
72 | 72 | if (!is_dir($filepath)) { |
73 | - $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
74 | - $dir = '/'; |
|
73 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
74 | + $dir = '/'; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | $groupId = api_get_group_id(); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | if (!($is_allowed_to_edit || $groupRights || |
102 | - DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir), api_get_session_id())) |
|
102 | + DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir), api_get_session_id())) |
|
103 | 103 | ) { |
104 | 104 | api_not_allowed(true); |
105 | 105 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // Interbreadcrumb for the current directory root path |
118 | 118 | if (empty($document_data['parents'])) { |
119 | - $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']); |
|
119 | + $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']); |
|
120 | 120 | } else { |
121 | 121 | foreach ($document_data['parents'] as $document_sub_data) { |
122 | 122 | $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']); |
@@ -149,17 +149,17 @@ discard block |
||
149 | 149 | $locktitle="false"; |
150 | 150 | |
151 | 151 | if ($_SERVER['HTTP_HOST']=="localhost") { |
152 | - $path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml'; |
|
153 | - if (!file_exists($path_and_file)) { |
|
154 | - $crossdomain='<?xml version="1.0"?> |
|
152 | + $path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml'; |
|
153 | + if (!file_exists($path_and_file)) { |
|
154 | + $crossdomain='<?xml version="1.0"?> |
|
155 | 155 | <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> |
156 | 156 | <cross-domain-policy> |
157 | 157 | <allow-access-from domain="cdn.pixlr.com" /> |
158 | 158 | <site-control permitted-cross-domain-policies="master-only"/> |
159 | 159 | <allow-http-request-headers-from domain="cnd.pixlr.com" headers="*" secure="true"/> |
160 | 160 | </cross-domain-policy>';//more open domain="*" |
161 | - @file_put_contents($path_and_file, $crossdomain); |
|
162 | - } |
|
161 | + @file_put_contents($path_and_file, $crossdomain); |
|
162 | + } |
|
163 | 163 | $credentials = "true"; |
164 | 164 | } else { |
165 | 165 | $credentials = "false"; |
@@ -65,44 +65,44 @@ discard block |
||
65 | 65 | /* Please, do not modify this dirname formatting */ |
66 | 66 | |
67 | 67 | if (strstr($dir, '..')) { |
68 | - $dir = '/'; |
|
68 | + $dir = '/'; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | if ($dir[0] == '.') { |
72 | - $dir = substr($dir, 1); |
|
72 | + $dir = substr($dir, 1); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if ($dir[0] != '/') { |
76 | - $dir = '/'.$dir; |
|
76 | + $dir = '/'.$dir; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | if ($dir[strlen($dir) - 1] != '/') { |
80 | - $dir .= '/'; |
|
80 | + $dir .= '/'; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
84 | 84 | |
85 | 85 | if (!is_dir($filepath)) { |
86 | - $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
87 | - $dir = '/'; |
|
86 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
87 | + $dir = '/'; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | //groups //TODO:clean |
91 | 91 | if (!empty($groupId)) { |
92 | - $interbreadcrumb[] = array( |
|
93 | - 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), |
|
94 | - 'name' => get_lang('GroupSpace'), |
|
95 | - ); |
|
96 | - $group_document = true; |
|
97 | - $noPHP_SELF = true; |
|
92 | + $interbreadcrumb[] = array( |
|
93 | + 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), |
|
94 | + 'name' => get_lang('GroupSpace'), |
|
95 | + ); |
|
96 | + $group_document = true; |
|
97 | + $noPHP_SELF = true; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | $is_certificate_mode = DocumentManager::is_certificate_mode($dir); |
101 | 101 | |
102 | 102 | if (!$is_certificate_mode) |
103 | - $interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents')); |
|
103 | + $interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents')); |
|
104 | 104 | else |
105 | - $interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook')); |
|
105 | + $interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook')); |
|
106 | 106 | |
107 | 107 | // Interbreadcrumb for the current directory root path |
108 | 108 | if (empty($document_data['parents'])) { |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | $is_allowedToEdit = api_is_allowed_to_edit(null, true) || $groupRights || |
120 | - DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $current_session_id); |
|
120 | + DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $current_session_id); |
|
121 | 121 | |
122 | 122 | if (!$is_allowedToEdit) { |
123 | - api_not_allowed(true); |
|
123 | + api_not_allowed(true); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | Event::event_access_tool(TOOL_DOCUMENT); |
@@ -152,21 +152,21 @@ discard block |
||
152 | 152 | $locktitle="false"; |
153 | 153 | |
154 | 154 | if ($_SERVER['HTTP_HOST']=="localhost") { |
155 | - $path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml'; |
|
156 | - if (!file_exists($path_and_file)) { |
|
157 | - $crossdomain='<?xml version="1.0"?> |
|
155 | + $path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml'; |
|
156 | + if (!file_exists($path_and_file)) { |
|
157 | + $crossdomain='<?xml version="1.0"?> |
|
158 | 158 | <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> |
159 | 159 | <cross-domain-policy> |
160 | 160 | <allow-access-from domain="cdn.pixlr.com" /> |
161 | 161 | <site-control permitted-cross-domain-policies="master-only"/> |
162 | 162 | <allow-http-request-headers-from domain="cnd.pixlr.com" headers="*" secure="true"/> |
163 | 163 | </cross-domain-policy>';//more open domain="*" |
164 | - @file_put_contents($path_and_file, $crossdomain); |
|
165 | - } |
|
166 | - $credentials="true"; |
|
164 | + @file_put_contents($path_and_file, $crossdomain); |
|
165 | + } |
|
166 | + $credentials="true"; |
|
167 | 167 | } |
168 | 168 | else { |
169 | - $credentials="false"; |
|
169 | + $credentials="false"; |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | //make temp images |
@@ -179,23 +179,23 @@ discard block |
||
179 | 179 | $htaccess=api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess'; |
180 | 180 | if (!file_exists($htaccess)) { |
181 | 181 | |
182 | - $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes"; |
|
182 | + $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes"; |
|
183 | 183 | |
184 | - $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w'); |
|
185 | - if ($fp) { |
|
186 | - fwrite($fp, $htaccess_content); |
|
187 | - fclose($fp); |
|
188 | - } |
|
184 | + $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w'); |
|
185 | + if ($fp) { |
|
186 | + fwrite($fp, $htaccess_content); |
|
187 | + fclose($fp); |
|
188 | + } |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | $html_index=api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html'; |
192 | 192 | if (!file_exists($html_index)) { |
193 | - $html_index_content="<html><head></head><body></body></html>"; |
|
194 | - $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w'); |
|
195 | - if ($fp) { |
|
196 | - fwrite($fp, $html_index_content); |
|
197 | - fclose($fp); |
|
198 | - } |
|
193 | + $html_index_content="<html><head></head><body></body></html>"; |
|
194 | + $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w'); |
|
195 | + if ($fp) { |
|
196 | + fwrite($fp, $html_index_content); |
|
197 | + fclose($fp); |
|
198 | + } |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | //encript temp name file |