@@ -16,34 +16,34 @@ discard block |
||
16 | 16 | $is_allowedToTrack = $is_courseAdmin || $is_platformAdmin || $is_courseCoach || $is_sessionAdmin; |
17 | 17 | |
18 | 18 | if (!$is_allowedToTrack) { |
19 | - Display :: display_header(null); |
|
20 | - api_not_allowed(); |
|
21 | - Display :: display_footer(); |
|
19 | + Display :: display_header(null); |
|
20 | + api_not_allowed(); |
|
21 | + Display :: display_footer(); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | $export_to_csv = false; |
25 | 25 | if (isset($_GET['export'])) { |
26 | - $export_to_csv = true; |
|
26 | + $export_to_csv = true; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | if (api_is_platform_admin() ) { |
30 | - $global = true; |
|
30 | + $global = true; |
|
31 | 31 | } else { |
32 | - $global = false; |
|
32 | + $global = false; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | if ($global) { |
36 | - $temp_course_list = CourseManager :: get_courses_list(); |
|
37 | - foreach($temp_course_list as $temp_course_item) { |
|
38 | - $course_item = CourseManager ::get_course_information($temp_course_item['code']); |
|
36 | + $temp_course_list = CourseManager :: get_courses_list(); |
|
37 | + foreach($temp_course_list as $temp_course_item) { |
|
38 | + $course_item = CourseManager ::get_course_information($temp_course_item['code']); |
|
39 | 39 | $course_list[] = array( |
40 | 40 | 'code' => $course_item['code'], |
41 | 41 | 'title' => $course_item['title'], |
42 | 42 | ); |
43 | - } |
|
43 | + } |
|
44 | 44 | } else { |
45 | 45 | $current_course['code'] = $_course['id']; |
46 | - $course_list = array($current_course); |
|
46 | + $course_list = array($current_course); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $new_course_select = array(); |
@@ -54,20 +54,20 @@ discard block |
||
54 | 54 | $form = new FormValidator('search_simple', 'POST', '', '', null, false); |
55 | 55 | $form->addElement('select','course_code',get_lang('Course'), $new_course_select); |
56 | 56 | if ($global) { |
57 | - $form->addElement('hidden','view','admin'); |
|
57 | + $form->addElement('hidden','view','admin'); |
|
58 | 58 | } else { |
59 | - //Get exam lists |
|
59 | + //Get exam lists |
|
60 | 60 | $course_id = api_get_course_int_id(); |
61 | - $t_quiz = Database::get_course_table(TABLE_QUIZ_TEST); |
|
62 | - $sqlExercices = "SELECT quiz.title,id FROM ".$t_quiz." AS quiz |
|
61 | + $t_quiz = Database::get_course_table(TABLE_QUIZ_TEST); |
|
62 | + $sqlExercices = "SELECT quiz.title,id FROM ".$t_quiz." AS quiz |
|
63 | 63 | WHERE c_id = $course_id AND active='1' |
64 | 64 | ORDER BY quiz.title ASC"; |
65 | - $resultExercices = Database::query($sqlExercices); |
|
66 | - $exercise_list[0] = get_lang('All'); |
|
67 | - while($a_exercices = Database::fetch_array($resultExercices)) { |
|
68 | - $exercise_list[$a_exercices['id']] = $a_exercices['title']; |
|
69 | - } |
|
70 | - $form->addElement('select', 'exercise_id', get_lang('Exercise'), $exercise_list); |
|
65 | + $resultExercices = Database::query($sqlExercices); |
|
66 | + $exercise_list[0] = get_lang('All'); |
|
67 | + while($a_exercices = Database::fetch_array($resultExercices)) { |
|
68 | + $exercise_list[$a_exercices['id']] = $a_exercices['title']; |
|
69 | + } |
|
70 | + $form->addElement('select', 'exercise_id', get_lang('Exercise'), $exercise_list); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | //$form->addElement('submit','submit',get_lang('Filter')); |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | if (!$export_to_csv) { |
84 | - Display :: display_header(get_lang('Reporting')); |
|
85 | - echo '<div class="actions" style ="font-size:10pt;">'; |
|
86 | - if ($global) { |
|
84 | + Display :: display_header(get_lang('Reporting')); |
|
85 | + echo '<div class="actions" style ="font-size:10pt;">'; |
|
86 | + if ($global) { |
|
87 | 87 | |
88 | 88 | echo '<div style="float:right"> <a href="'.api_get_self().'?export=1&score='.$filter_score.'&exercise_id='.$exercise_id.'"> |
89 | 89 | '.Display::return_icon('csv.gif').' |
@@ -93,81 +93,81 @@ discard block |
||
93 | 93 | '.get_lang('Print').'</a> |
94 | 94 | </div>'; |
95 | 95 | |
96 | - $menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher">'.get_lang('TeacherInterface').'</a>'; |
|
96 | + $menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=teacher">'.get_lang('TeacherInterface').'</a>'; |
|
97 | 97 | if (api_is_platform_admin()) { |
98 | - $menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=admin">'.get_lang('AdminInterface').'</a>'; |
|
98 | + $menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=admin">'.get_lang('AdminInterface').'</a>'; |
|
99 | 99 | } else { |
100 | 100 | $menu_items[] = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/?view=coach">'.get_lang('AdminInterface').'</a>'; |
101 | 101 | } |
102 | - $menu_items[] = get_lang('ExamTracking'); |
|
103 | - $nb_menu_items = count($menu_items); |
|
104 | - if($nb_menu_items>1) { |
|
105 | - foreach($menu_items as $key=> $item) { |
|
106 | - echo $item; |
|
107 | - if($key!=$nb_menu_items-1) { |
|
108 | - echo ' | '; |
|
109 | - } |
|
110 | - } |
|
111 | - echo '<br />'; |
|
112 | - } |
|
113 | - } else { |
|
114 | - echo '<a href="courseLog.php?'.api_get_cidreq().'&studentlist=true">'.get_lang('StudentsTracking').'</a> | |
|
102 | + $menu_items[] = get_lang('ExamTracking'); |
|
103 | + $nb_menu_items = count($menu_items); |
|
104 | + if($nb_menu_items>1) { |
|
105 | + foreach($menu_items as $key=> $item) { |
|
106 | + echo $item; |
|
107 | + if($key!=$nb_menu_items-1) { |
|
108 | + echo ' | '; |
|
109 | + } |
|
110 | + } |
|
111 | + echo '<br />'; |
|
112 | + } |
|
113 | + } else { |
|
114 | + echo '<a href="courseLog.php?'.api_get_cidreq().'&studentlist=true">'.get_lang('StudentsTracking').'</a> | |
|
115 | 115 | <a href="courseLog.php?'.api_get_cidreq().'&studentlist=false">'.get_lang('CourseTracking').'</a> | '; |
116 | 116 | echo '<a href="courseLog.php?'.api_get_cidreq().'&studentlist=resources">'.get_lang('ResourcesTracking').'</a>'; |
117 | - echo ' | '.get_lang('ExamTracking').''; |
|
117 | + echo ' | '.get_lang('ExamTracking').''; |
|
118 | 118 | echo '<a href="'.api_get_self().'?export=1&score='.$filter_score.'&exercise_id='.$exercise_id.'"> |
119 | 119 | '.Display::return_icon('excel.gif').' |
120 | 120 | '.get_lang('ExportAsXLS').'</a><br /><br />'; |
121 | 121 | |
122 | - } |
|
122 | + } |
|
123 | 123 | echo '</div>'; |
124 | - echo '<br /><br />'; |
|
125 | - $form->display(); |
|
124 | + echo '<br /><br />'; |
|
125 | + $form->display(); |
|
126 | 126 | } |
127 | 127 | $main_result = array(); |
128 | 128 | $session_id = 0; |
129 | 129 | $user_list = array(); |
130 | 130 | // Getting course list |
131 | 131 | foreach ($course_list as $current_course ) { |
132 | - $course_info = api_get_course_info($current_course['code']); |
|
133 | - $_course = $course_info; |
|
134 | - |
|
135 | - // Getting LP list |
|
136 | - $list = new LearnpathList('', $current_course['code'], $session_id); |
|
137 | - $lp_list = $list->get_flat_list(); |
|
138 | - |
|
139 | - // Looping LPs |
|
140 | - $lps = array(); |
|
141 | - foreach ($lp_list as $lp_id =>$lp) { |
|
142 | - $exercise_list = Event::get_all_exercises_from_lp($lp_id, $course_info['real_id']); |
|
143 | - $attempt_result = array(); |
|
144 | - // Looping Chamilo Exercises in LP |
|
145 | - foreach ($exercise_list as $exercise) { |
|
146 | - $exercise_stats = Event::get_all_exercise_event_from_lp( |
|
147 | - $exercise['path'], |
|
148 | - $course_info['real_id'], |
|
149 | - $session_id |
|
150 | - ); |
|
151 | - // Looping Exercise Attempts |
|
152 | - foreach ($exercise_stats as $stats) { |
|
153 | - $attempt_result[$exercise['id']]['users'][$stats['exe_user_id']][$stats['exe_id']] = $stats; |
|
154 | - $user_list[$stats['exe_user_id']] = $stats['exe_user_id']; |
|
155 | - } |
|
156 | - $exercise_list_name[$exercise['id']] = $exercise['title']; |
|
157 | - } |
|
158 | - $lps[$lp_id] = array('lp_name' =>$lp['lp_name'], 'exercises' =>$attempt_result); |
|
159 | - $lp_list_name[$lp_id] = $lp['lp_name']; |
|
160 | - } |
|
161 | - $main_result[$current_course['code']] = $lps; |
|
132 | + $course_info = api_get_course_info($current_course['code']); |
|
133 | + $_course = $course_info; |
|
134 | + |
|
135 | + // Getting LP list |
|
136 | + $list = new LearnpathList('', $current_course['code'], $session_id); |
|
137 | + $lp_list = $list->get_flat_list(); |
|
138 | + |
|
139 | + // Looping LPs |
|
140 | + $lps = array(); |
|
141 | + foreach ($lp_list as $lp_id =>$lp) { |
|
142 | + $exercise_list = Event::get_all_exercises_from_lp($lp_id, $course_info['real_id']); |
|
143 | + $attempt_result = array(); |
|
144 | + // Looping Chamilo Exercises in LP |
|
145 | + foreach ($exercise_list as $exercise) { |
|
146 | + $exercise_stats = Event::get_all_exercise_event_from_lp( |
|
147 | + $exercise['path'], |
|
148 | + $course_info['real_id'], |
|
149 | + $session_id |
|
150 | + ); |
|
151 | + // Looping Exercise Attempts |
|
152 | + foreach ($exercise_stats as $stats) { |
|
153 | + $attempt_result[$exercise['id']]['users'][$stats['exe_user_id']][$stats['exe_id']] = $stats; |
|
154 | + $user_list[$stats['exe_user_id']] = $stats['exe_user_id']; |
|
155 | + } |
|
156 | + $exercise_list_name[$exercise['id']] = $exercise['title']; |
|
157 | + } |
|
158 | + $lps[$lp_id] = array('lp_name' =>$lp['lp_name'], 'exercises' =>$attempt_result); |
|
159 | + $lp_list_name[$lp_id] = $lp['lp_name']; |
|
160 | + } |
|
161 | + $main_result[$current_course['code']] = $lps; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | if (!empty($user_list)) { |
165 | 165 | foreach($user_list as $user_id) { |
166 | 166 | $user_data = api_get_user_info($user_id); |
167 | - $user_list_name[$user_id] = api_get_person_name( |
|
168 | - $user_data['firstname'], |
|
169 | - $user_data['lastname'] |
|
170 | - ); |
|
167 | + $user_list_name[$user_id] = api_get_person_name( |
|
168 | + $user_data['firstname'], |
|
169 | + $user_data['lastname'] |
|
170 | + ); |
|
171 | 171 | } |
172 | 172 | } |
173 | 173 | $export_array = array(); |
@@ -207,15 +207,15 @@ discard block |
||
207 | 207 | $html_result .= Display::tag('td', $result); |
208 | 208 | |
209 | 209 | $html_result .= '</tr>'; |
210 | - $export_array[] = array( |
|
211 | - $course_code, |
|
212 | - $lp_list_name[$lp_id], |
|
213 | - $exercise_list_name[$exercise_id], |
|
214 | - $user_list_name[$user_id], |
|
215 | - $attempt, |
|
216 | - api_get_local_time($attempt_data['exe_date']), |
|
217 | - $result, |
|
218 | - ); |
|
210 | + $export_array[] = array( |
|
211 | + $course_code, |
|
212 | + $lp_list_name[$lp_id], |
|
213 | + $exercise_list_name[$exercise_id], |
|
214 | + $user_list_name[$user_id], |
|
215 | + $attempt, |
|
216 | + api_get_local_time($attempt_data['exe_date']), |
|
217 | + $result, |
|
218 | + ); |
|
219 | 219 | $attempt++; |
220 | 220 | } |
221 | 221 | } |
@@ -226,30 +226,30 @@ discard block |
||
226 | 226 | } |
227 | 227 | |
228 | 228 | if (!$export_to_csv) { |
229 | - echo $html_result; |
|
229 | + echo $html_result; |
|
230 | 230 | } |
231 | 231 | $filename = 'learning_path_results-'.date('Y-m-d-h:i:s').'.xls'; |
232 | 232 | if ($export_to_csv) { |
233 | 233 | export_complete_report_csv($filename, $export_array); |
234 | - exit; |
|
234 | + exit; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | function export_complete_report_csv($filename, $array) |
238 | 238 | { |
239 | - $header[] = array( |
|
240 | - get_lang('Course'), |
|
241 | - get_lang('LearningPath'), |
|
242 | - get_lang('Exercise'), |
|
243 | - get_lang('User'), |
|
244 | - get_lang('Attempt'), |
|
245 | - get_lang('Date'), |
|
246 | - get_lang('Results'), |
|
247 | - ); |
|
248 | - if (!empty($array)) { |
|
249 | - $array = array_merge($header, $array); |
|
250 | - Export :: arrayToCsv($array, $filename); |
|
251 | - } |
|
252 | - exit; |
|
239 | + $header[] = array( |
|
240 | + get_lang('Course'), |
|
241 | + get_lang('LearningPath'), |
|
242 | + get_lang('Exercise'), |
|
243 | + get_lang('User'), |
|
244 | + get_lang('Attempt'), |
|
245 | + get_lang('Date'), |
|
246 | + get_lang('Results'), |
|
247 | + ); |
|
248 | + if (!empty($array)) { |
|
249 | + $array = array_merge($header, $array); |
|
250 | + Export :: arrayToCsv($array, $filename); |
|
251 | + } |
|
252 | + exit; |
|
253 | 253 | |
254 | 254 | } |
255 | 255 | Display :: display_footer(); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $tool_name = get_lang('AddSpecificSearchField'); |
28 | 28 | |
29 | 29 | if (isset($_GET['action']) && $_GET['action'] === 'edit') { |
30 | - $tool_name = get_lang('EditSpecificSearchField'); |
|
30 | + $tool_name = get_lang('EditSpecificSearchField'); |
|
31 | 31 | } |
32 | 32 | // Create the form |
33 | 33 | $form = new FormValidator('specific_fields_add'); |
@@ -1875,11 +1875,11 @@ discard block |
||
1875 | 1875 | return $this->locale; |
1876 | 1876 | } |
1877 | 1877 | |
1878 | - /** |
|
1879 | - * @param string $timezone |
|
1880 | - * |
|
1881 | - * @return User |
|
1882 | - */ |
|
1878 | + /** |
|
1879 | + * @param string $timezone |
|
1880 | + * |
|
1881 | + * @return User |
|
1882 | + */ |
|
1883 | 1883 | public function setTimezone($timezone) |
1884 | 1884 | { |
1885 | 1885 | $this->timezone = $timezone; |
@@ -2048,11 +2048,11 @@ discard block |
||
2048 | 2048 | return $this->plainPassword; |
2049 | 2049 | } |
2050 | 2050 | |
2051 | - /** |
|
2052 | - * Returns the user roles |
|
2053 | - * |
|
2054 | - * @return array The roles |
|
2055 | - */ |
|
2051 | + /** |
|
2052 | + * Returns the user roles |
|
2053 | + * |
|
2054 | + * @return array The roles |
|
2055 | + */ |
|
2056 | 2056 | public function getRoles() |
2057 | 2057 | { |
2058 | 2058 | $roles = $this->roles; |
@@ -1875,11 +1875,11 @@ discard block |
||
1875 | 1875 | return $this->locale; |
1876 | 1876 | } |
1877 | 1877 | |
1878 | - /** |
|
1879 | - * @param string $timezone |
|
1880 | - * |
|
1881 | - * @return User |
|
1882 | - */ |
|
1878 | + /** |
|
1879 | + * @param string $timezone |
|
1880 | + * |
|
1881 | + * @return User |
|
1882 | + */ |
|
1883 | 1883 | public function setTimezone($timezone) |
1884 | 1884 | { |
1885 | 1885 | $this->timezone = $timezone; |
@@ -2048,11 +2048,11 @@ discard block |
||
2048 | 2048 | return $this->plainPassword; |
2049 | 2049 | } |
2050 | 2050 | |
2051 | - /** |
|
2052 | - * Returns the user roles |
|
2053 | - * |
|
2054 | - * @return array The roles |
|
2055 | - */ |
|
2051 | + /** |
|
2052 | + * Returns the user roles |
|
2053 | + * |
|
2054 | + * @return array The roles |
|
2055 | + */ |
|
2056 | 2056 | public function getRoles() |
2057 | 2057 | { |
2058 | 2058 | $roles = $this->roles; |
@@ -6,19 +6,19 @@ |
||
6 | 6 | */ |
7 | 7 | class SelectTheme extends HTML_QuickForm_select |
8 | 8 | { |
9 | - /** |
|
10 | - * Class constructor |
|
11 | - */ |
|
12 | - public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) |
|
13 | - { |
|
14 | - parent::__construct($elementName, $elementLabel, $options, $attributes); |
|
15 | - // Get all languages |
|
16 | - $themes = api_get_themes(); |
|
17 | - $this->_options = array(); |
|
18 | - $this->_values = array(); |
|
19 | - $this->addOption('--',''); // no theme select |
|
20 | - for ($i=0; $i< count($themes[0]); $i++) { |
|
21 | - $this->addOption($themes[1][$i],$themes[0][$i]); |
|
22 | - } |
|
23 | - } |
|
9 | + /** |
|
10 | + * Class constructor |
|
11 | + */ |
|
12 | + public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null) |
|
13 | + { |
|
14 | + parent::__construct($elementName, $elementLabel, $options, $attributes); |
|
15 | + // Get all languages |
|
16 | + $themes = api_get_themes(); |
|
17 | + $this->_options = array(); |
|
18 | + $this->_values = array(); |
|
19 | + $this->addOption('--',''); // no theme select |
|
20 | + for ($i=0; $i< count($themes[0]); $i++) { |
|
21 | + $this->addOption($themes[1][$i],$themes[0][$i]); |
|
22 | + } |
|
23 | + } |
|
24 | 24 | } |
@@ -27,22 +27,22 @@ |
||
27 | 27 | |
28 | 28 | if (!empty($_POST)) |
29 | 29 | { |
30 | - foreach ( $_POST as $key => $value ) |
|
31 | - { |
|
32 | - if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
33 | - continue; |
|
30 | + foreach ( $_POST as $key => $value ) |
|
31 | + { |
|
32 | + if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
33 | + continue; |
|
34 | 34 | |
35 | - if ( get_magic_quotes_gpc() ) |
|
36 | - $value = htmlspecialchars( stripslashes((string)$value) ); |
|
37 | - else |
|
38 | - $value = htmlspecialchars( (string)$value ); |
|
35 | + if ( get_magic_quotes_gpc() ) |
|
36 | + $value = htmlspecialchars( stripslashes((string)$value) ); |
|
37 | + else |
|
38 | + $value = htmlspecialchars( (string)$value ); |
|
39 | 39 | ?> |
40 | 40 | <tr> |
41 | 41 | <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> |
42 | 42 | <td><pre class="samples"><?php echo $value; ?></pre></td> |
43 | 43 | </tr> |
44 | 44 | <?php |
45 | - } |
|
45 | + } |
|
46 | 46 | } |
47 | 47 | ?> |
48 | 48 | </table> |
@@ -26,7 +26,7 @@ |
||
26 | 26 | parent::__construct('1.1', 'Valery Fremaux'); |
27 | 27 | } |
28 | 28 | |
29 | - function pix_url($pixname, $size = 16) { |
|
29 | + function pix_url($pixname, $size = 16) { |
|
30 | 30 | global $_configuration; |
31 | 31 | |
32 | 32 | if (file_exists($_configuration['root_sys'].'/plugin/customplugin/pix/'.$pixname.'.png')){ |
@@ -50,26 +50,26 @@ discard block |
||
50 | 50 | // Please, do not modify this dirname formatting |
51 | 51 | |
52 | 52 | if (strstr($dir, '..')) { |
53 | - $dir = '/'; |
|
53 | + $dir = '/'; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | if ($dir[0] == '.') { |
57 | - $dir = substr($dir, 1); |
|
57 | + $dir = substr($dir, 1); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($dir[0] != '/') { |
61 | - $dir = '/'.$dir; |
|
61 | + $dir = '/'.$dir; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | if ($dir[strlen($dir) - 1] != '/') { |
65 | - $dir .= '/'; |
|
65 | + $dir .= '/'; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
69 | 69 | |
70 | 70 | if (!is_dir($filepath)) { |
71 | - $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
72 | - $dir = '/'; |
|
71 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
72 | + $dir = '/'; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | $groupId = api_get_group_id(); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || |
100 | - DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir), api_get_session_id())) |
|
100 | + DocumentManager::is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir), api_get_session_id())) |
|
101 | 101 | ) { |
102 | 102 | api_not_allowed(true); |
103 | 103 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | // Interbreadcrumb for the current directory root path |
116 | 116 | if (empty($document_data['parents'])) { |
117 | - $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']); |
|
117 | + $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']); |
|
118 | 118 | } else { |
119 | 119 | foreach ($document_data['parents'] as $document_sub_data) { |
120 | 120 | $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']); |
@@ -147,17 +147,17 @@ discard block |
||
147 | 147 | $locktitle="false"; |
148 | 148 | |
149 | 149 | if ($_SERVER['HTTP_HOST']=="localhost") { |
150 | - $path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml'; |
|
151 | - if (!file_exists($path_and_file)) { |
|
152 | - $crossdomain='<?xml version="1.0"?> |
|
150 | + $path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml'; |
|
151 | + if (!file_exists($path_and_file)) { |
|
152 | + $crossdomain='<?xml version="1.0"?> |
|
153 | 153 | <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> |
154 | 154 | <cross-domain-policy> |
155 | 155 | <allow-access-from domain="cdn.pixlr.com" /> |
156 | 156 | <site-control permitted-cross-domain-policies="master-only"/> |
157 | 157 | <allow-http-request-headers-from domain="cnd.pixlr.com" headers="*" secure="true"/> |
158 | 158 | </cross-domain-policy>';//more open domain="*" |
159 | - @file_put_contents($path_and_file, $crossdomain); |
|
160 | - } |
|
159 | + @file_put_contents($path_and_file, $crossdomain); |
|
160 | + } |
|
161 | 161 | $credentials = "true"; |
162 | 162 | } else { |
163 | 163 | $credentials = "false"; |
@@ -61,44 +61,44 @@ discard block |
||
61 | 61 | /* Please, do not modify this dirname formatting */ |
62 | 62 | |
63 | 63 | if (strstr($dir, '..')) { |
64 | - $dir = '/'; |
|
64 | + $dir = '/'; |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | if ($dir[0] == '.') { |
68 | - $dir = substr($dir, 1); |
|
68 | + $dir = substr($dir, 1); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | if ($dir[0] != '/') { |
72 | - $dir = '/'.$dir; |
|
72 | + $dir = '/'.$dir; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if ($dir[strlen($dir) - 1] != '/') { |
76 | - $dir .= '/'; |
|
76 | + $dir .= '/'; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
80 | 80 | |
81 | 81 | if (!is_dir($filepath)) { |
82 | - $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
83 | - $dir = '/'; |
|
82 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
83 | + $dir = '/'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | //groups //TODO:clean |
87 | 87 | if (!empty($groupId)) { |
88 | - $interbreadcrumb[] = array( |
|
89 | - 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), |
|
90 | - 'name' => get_lang('GroupSpace'), |
|
91 | - ); |
|
92 | - $group_document = true; |
|
93 | - $noPHP_SELF = true; |
|
88 | + $interbreadcrumb[] = array( |
|
89 | + 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), |
|
90 | + 'name' => get_lang('GroupSpace'), |
|
91 | + ); |
|
92 | + $group_document = true; |
|
93 | + $noPHP_SELF = true; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | $is_certificate_mode = DocumentManager::is_certificate_mode($dir); |
97 | 97 | |
98 | 98 | if (!$is_certificate_mode) |
99 | - $interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents')); |
|
99 | + $interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents')); |
|
100 | 100 | else |
101 | - $interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook')); |
|
101 | + $interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook')); |
|
102 | 102 | |
103 | 103 | // Interbreadcrumb for the current directory root path |
104 | 104 | if (empty($document_data['parents'])) { |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | $is_allowedToEdit = api_is_allowed_to_edit(null, true) || $_SESSION['group_member_with_upload_rights'] || |
116 | - DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $current_session_id); |
|
116 | + DocumentManager::is_my_shared_folder(api_get_user_id(), $dir, $current_session_id); |
|
117 | 117 | |
118 | 118 | if (!$is_allowedToEdit) { |
119 | - api_not_allowed(true); |
|
119 | + api_not_allowed(true); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | Event::event_access_tool(TOOL_DOCUMENT); |
@@ -148,21 +148,21 @@ discard block |
||
148 | 148 | $locktitle="false"; |
149 | 149 | |
150 | 150 | if ($_SERVER['HTTP_HOST']=="localhost") { |
151 | - $path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml'; |
|
152 | - if (!file_exists($path_and_file)) { |
|
153 | - $crossdomain='<?xml version="1.0"?> |
|
151 | + $path_and_file= api_get_path(SYS_PATH).'/crossdomain.xml'; |
|
152 | + if (!file_exists($path_and_file)) { |
|
153 | + $crossdomain='<?xml version="1.0"?> |
|
154 | 154 | <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> |
155 | 155 | <cross-domain-policy> |
156 | 156 | <allow-access-from domain="cdn.pixlr.com" /> |
157 | 157 | <site-control permitted-cross-domain-policies="master-only"/> |
158 | 158 | <allow-http-request-headers-from domain="cnd.pixlr.com" headers="*" secure="true"/> |
159 | 159 | </cross-domain-policy>';//more open domain="*" |
160 | - @file_put_contents($path_and_file, $crossdomain); |
|
161 | - } |
|
162 | - $credentials="true"; |
|
160 | + @file_put_contents($path_and_file, $crossdomain); |
|
161 | + } |
|
162 | + $credentials="true"; |
|
163 | 163 | } |
164 | 164 | else { |
165 | - $credentials="false"; |
|
165 | + $credentials="false"; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | //make temp images |
@@ -175,23 +175,23 @@ discard block |
||
175 | 175 | $htaccess=api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess'; |
176 | 176 | if (!file_exists($htaccess)) { |
177 | 177 | |
178 | - $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes"; |
|
178 | + $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes"; |
|
179 | 179 | |
180 | - $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w'); |
|
181 | - if ($fp) { |
|
182 | - fwrite($fp, $htaccess_content); |
|
183 | - fclose($fp); |
|
184 | - } |
|
180 | + $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w'); |
|
181 | + if ($fp) { |
|
182 | + fwrite($fp, $htaccess_content); |
|
183 | + fclose($fp); |
|
184 | + } |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | $html_index=api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html'; |
188 | 188 | if (!file_exists($html_index)) { |
189 | - $html_index_content="<html><head></head><body></body></html>"; |
|
190 | - $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w'); |
|
191 | - if ($fp) { |
|
192 | - fwrite($fp, $html_index_content); |
|
193 | - fclose($fp); |
|
194 | - } |
|
189 | + $html_index_content="<html><head></head><body></body></html>"; |
|
190 | + $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w'); |
|
191 | + if ($fp) { |
|
192 | + fwrite($fp, $html_index_content); |
|
193 | + fclose($fp); |
|
194 | + } |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | //encript temp name file |