@@ -15,16 +15,16 @@ discard block |
||
15 | 15 | class TableSort |
16 | 16 | { |
17 | 17 | /** |
18 | - * Sorts 2-dimensional table. |
|
19 | - * @param array $data The data to be sorted. |
|
20 | - * @param int $column The column on which the data should be sorted (default = 0) |
|
21 | - * @param int $direction The direction to sort (SORT_ASC (default) or SORT_DESC) |
|
22 | - * @param int $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, |
|
23 | - * SORT_STRING,SORT_DATE,SORT_IMAGE) |
|
24 | - * @return array The sorted dataset |
|
25 | - * @author [email protected] |
|
26 | - */ |
|
27 | - public static function sort_table($data, $column = 0, $direction = SORT_ASC, $type = SORT_REGULAR) |
|
18 | + * Sorts 2-dimensional table. |
|
19 | + * @param array $data The data to be sorted. |
|
20 | + * @param int $column The column on which the data should be sorted (default = 0) |
|
21 | + * @param int $direction The direction to sort (SORT_ASC (default) or SORT_DESC) |
|
22 | + * @param int $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, |
|
23 | + * SORT_STRING,SORT_DATE,SORT_IMAGE) |
|
24 | + * @return array The sorted dataset |
|
25 | + * @author [email protected] |
|
26 | + */ |
|
27 | + public static function sort_table($data, $column = 0, $direction = SORT_ASC, $type = SORT_REGULAR) |
|
28 | 28 | { |
29 | 29 | if (!is_array($data) || empty($data)) { |
30 | 30 | return array(); |
@@ -71,20 +71,20 @@ discard block |
||
71 | 71 | usort($data, create_function('$a, $b', $compare_function)); |
72 | 72 | |
73 | 73 | return $data; |
74 | - } |
|
74 | + } |
|
75 | 75 | |
76 | - /** |
|
77 | - * Sorts 2-dimensional table. It is possile changing the columns that will be shown and the way that the columns are to be sorted. |
|
78 | - * @param array $data The data to be sorted. |
|
79 | - * @param int $column The column on which the data should be sorted (default = 0) |
|
80 | - * @param string $direction The direction to sort (SORT_ASC (default) orSORT_DESC) |
|
81 | - * @param array $column_show The columns that we will show in the table i.e: $column_show = array('1','0','1') we will show the 1st and the 3th column. |
|
82 | - * @param array $column_order Changes how the columns will be sorted ie. $column_order = array('0','3','2','3') The column [1] will be sorted like the column [3] |
|
83 | - * @param constant $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_DATE, SORT_IMAGE) |
|
84 | - * @return array The sorted dataset |
|
85 | - * @author [email protected] |
|
86 | - */ |
|
87 | - public static function sort_table_config( |
|
76 | + /** |
|
77 | + * Sorts 2-dimensional table. It is possile changing the columns that will be shown and the way that the columns are to be sorted. |
|
78 | + * @param array $data The data to be sorted. |
|
79 | + * @param int $column The column on which the data should be sorted (default = 0) |
|
80 | + * @param string $direction The direction to sort (SORT_ASC (default) orSORT_DESC) |
|
81 | + * @param array $column_show The columns that we will show in the table i.e: $column_show = array('1','0','1') we will show the 1st and the 3th column. |
|
82 | + * @param array $column_order Changes how the columns will be sorted ie. $column_order = array('0','3','2','3') The column [1] will be sorted like the column [3] |
|
83 | + * @param constant $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_DATE, SORT_IMAGE) |
|
84 | + * @return array The sorted dataset |
|
85 | + * @author [email protected] |
|
86 | + */ |
|
87 | + public static function sort_table_config( |
|
88 | 88 | $data, |
89 | 89 | $column = 0, |
90 | 90 | $direction = SORT_ASC, |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | if (!empty($data)) { |
133 | 133 | foreach ($data as $document) { |
134 | 134 | if ($document['type'] == 'folder') { |
135 | - $docs_to_sort[$document['id']] = api_strtolower($document['name']); |
|
135 | + $docs_to_sort[$document['id']] = api_strtolower($document['name']); |
|
136 | 136 | } else { |
137 | - $folder_to_sort[$document['id']] = api_strtolower($document['name']); |
|
137 | + $folder_to_sort[$document['id']] = api_strtolower($document['name']); |
|
138 | 138 | } |
139 | 139 | $new_data[$document['id']] = $document; |
140 | 140 | } |
@@ -196,91 +196,91 @@ discard block |
||
196 | 196 | usort($data, create_function('$a, $b', $compare_function)); |
197 | 197 | } |
198 | 198 | |
199 | - if (is_array($column_show) && !empty($column_show)) { |
|
199 | + if (is_array($column_show) && !empty($column_show)) { |
|
200 | 200 | |
201 | - // We show only the columns data that were set up on the $column_show array |
|
202 | - $new_order_data = array(); |
|
203 | - $count_data = count($data); |
|
204 | - $count_column_show = count($column_show); |
|
205 | - for ($j = 0; $j < $count_data; $j++) { |
|
206 | - $k = 0; |
|
207 | - for ($i = 0; $i < $count_column_show; $i++) { |
|
208 | - if ($column_show[$i]) { |
|
209 | - $new_order_data[$j][$k] = $data[$j][$i]; |
|
210 | - } |
|
211 | - $k++; |
|
212 | - } |
|
213 | - } |
|
214 | - // Replace the multi-arrays |
|
215 | - $data = $new_order_data; |
|
216 | - } |
|
201 | + // We show only the columns data that were set up on the $column_show array |
|
202 | + $new_order_data = array(); |
|
203 | + $count_data = count($data); |
|
204 | + $count_column_show = count($column_show); |
|
205 | + for ($j = 0; $j < $count_data; $j++) { |
|
206 | + $k = 0; |
|
207 | + for ($i = 0; $i < $count_column_show; $i++) { |
|
208 | + if ($column_show[$i]) { |
|
209 | + $new_order_data[$j][$k] = $data[$j][$i]; |
|
210 | + } |
|
211 | + $k++; |
|
212 | + } |
|
213 | + } |
|
214 | + // Replace the multi-arrays |
|
215 | + $data = $new_order_data; |
|
216 | + } |
|
217 | 217 | |
218 | - return $data; |
|
219 | - } |
|
218 | + return $data; |
|
219 | + } |
|
220 | 220 | |
221 | - /** |
|
222 | - * Checks whether a column of a 2D-array contains only numeric values |
|
223 | - * @param array $data The data-array |
|
224 | - * @param int $column The index of the column to check |
|
225 | - * @return bool TRUE if column contains only dates, FALSE otherwise |
|
226 | - * @todo Take locale into account (eg decimal point or comma ?) |
|
227 | - * @author [email protected] |
|
228 | - */ |
|
229 | - private static function is_numeric_column(& $data, $column) |
|
221 | + /** |
|
222 | + * Checks whether a column of a 2D-array contains only numeric values |
|
223 | + * @param array $data The data-array |
|
224 | + * @param int $column The index of the column to check |
|
225 | + * @return bool TRUE if column contains only dates, FALSE otherwise |
|
226 | + * @todo Take locale into account (eg decimal point or comma ?) |
|
227 | + * @author [email protected] |
|
228 | + */ |
|
229 | + private static function is_numeric_column(& $data, $column) |
|
230 | 230 | { |
231 | - $is_numeric = true; |
|
232 | - foreach ($data as $index => & $row) { |
|
233 | - $is_numeric &= is_numeric(strip_tags($row[$column])); |
|
234 | - if (!$is_numeric) { |
|
235 | - break; |
|
236 | - } |
|
237 | - } |
|
238 | - return $is_numeric; |
|
239 | - } |
|
231 | + $is_numeric = true; |
|
232 | + foreach ($data as $index => & $row) { |
|
233 | + $is_numeric &= is_numeric(strip_tags($row[$column])); |
|
234 | + if (!$is_numeric) { |
|
235 | + break; |
|
236 | + } |
|
237 | + } |
|
238 | + return $is_numeric; |
|
239 | + } |
|
240 | 240 | |
241 | - /** |
|
242 | - * Checks whether a column of a 2D-array contains only dates (GNU date syntax) |
|
243 | - * @param array $data The data-array |
|
244 | - * @param int $column The index of the column to check |
|
245 | - * @return bool TRUE if column contains only dates, FALSE otherwise |
|
246 | - * @author [email protected] |
|
247 | - */ |
|
248 | - private static function is_date_column(& $data, $column) |
|
241 | + /** |
|
242 | + * Checks whether a column of a 2D-array contains only dates (GNU date syntax) |
|
243 | + * @param array $data The data-array |
|
244 | + * @param int $column The index of the column to check |
|
245 | + * @return bool TRUE if column contains only dates, FALSE otherwise |
|
246 | + * @author [email protected] |
|
247 | + */ |
|
248 | + private static function is_date_column(& $data, $column) |
|
249 | 249 | { |
250 | - $is_date = true; |
|
251 | - foreach ($data as $index => & $row) { |
|
252 | - if (strlen(strip_tags($row[$column])) != 0) { |
|
253 | - $check_date = strtotime(strip_tags($row[$column])); |
|
254 | - // strtotime Returns a timestamp on success, FALSE otherwise. |
|
255 | - // Previous to PHP 5.1.0, this function would return -1 on failure. |
|
256 | - $is_date &= ($check_date != -1 && $check_date); |
|
257 | - } else { |
|
258 | - $is_date &= false; |
|
259 | - } |
|
260 | - if (!$is_date) { |
|
261 | - break; |
|
262 | - } |
|
263 | - } |
|
264 | - return $is_date; |
|
265 | - } |
|
250 | + $is_date = true; |
|
251 | + foreach ($data as $index => & $row) { |
|
252 | + if (strlen(strip_tags($row[$column])) != 0) { |
|
253 | + $check_date = strtotime(strip_tags($row[$column])); |
|
254 | + // strtotime Returns a timestamp on success, FALSE otherwise. |
|
255 | + // Previous to PHP 5.1.0, this function would return -1 on failure. |
|
256 | + $is_date &= ($check_date != -1 && $check_date); |
|
257 | + } else { |
|
258 | + $is_date &= false; |
|
259 | + } |
|
260 | + if (!$is_date) { |
|
261 | + break; |
|
262 | + } |
|
263 | + } |
|
264 | + return $is_date; |
|
265 | + } |
|
266 | 266 | |
267 | - /** |
|
268 | - * Checks whether a column of a 2D-array contains only images (<img src="path/file.ext" alt=".."/>) |
|
269 | - * @param array $data The data-array |
|
270 | - * @param int $column The index of the column to check |
|
271 | - * @return bool TRUE if column contains only images, FALSE otherwise |
|
272 | - * @author [email protected] |
|
273 | - */ |
|
274 | - private static function is_image_column(& $data, $column) |
|
267 | + /** |
|
268 | + * Checks whether a column of a 2D-array contains only images (<img src="path/file.ext" alt=".."/>) |
|
269 | + * @param array $data The data-array |
|
270 | + * @param int $column The index of the column to check |
|
271 | + * @return bool TRUE if column contains only images, FALSE otherwise |
|
272 | + * @author [email protected] |
|
273 | + */ |
|
274 | + private static function is_image_column(& $data, $column) |
|
275 | 275 | { |
276 | - $is_image = true; |
|
277 | - foreach ($data as $index => & $row) { |
|
278 | - $is_image &= strlen(trim(strip_tags($row[$column], '<img>'))) > 0; // at least one img-tag |
|
279 | - $is_image &= strlen(trim(strip_tags($row[$column]))) == 0; // and no text outside attribute-values |
|
280 | - if (!$is_image) { |
|
281 | - break; |
|
282 | - } |
|
283 | - } |
|
284 | - return $is_image; |
|
285 | - } |
|
276 | + $is_image = true; |
|
277 | + foreach ($data as $index => & $row) { |
|
278 | + $is_image &= strlen(trim(strip_tags($row[$column], '<img>'))) > 0; // at least one img-tag |
|
279 | + $is_image &= strlen(trim(strip_tags($row[$column]))) == 0; // and no text outside attribute-values |
|
280 | + if (!$is_image) { |
|
281 | + break; |
|
282 | + } |
|
283 | + } |
|
284 | + return $is_image; |
|
285 | + } |
|
286 | 286 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $file = $path.'/'.$entry; |
20 | 20 | if (is_file($file)) { |
21 | 21 | $terms = array_merge($terms,SubLanguageManager::get_all_language_variable_in_file($file,true)); |
22 | - } |
|
22 | + } |
|
23 | 23 | } |
24 | 24 | // get only the array keys (the language variables defined in language files) |
25 | 25 | $defined_terms = array_flip(array_keys($terms)); |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | foreach ($files as $file) { |
33 | 33 | //echo 'Analyzing '.$file."<br />"; |
34 | 34 | $shortfile = substr($file,$l); |
35 | - $lines = file($file); |
|
35 | + $lines = file($file); |
|
36 | 36 | foreach ($lines as $line) { |
37 | - $myterms = array(); |
|
37 | + $myterms = array(); |
|
38 | 38 | $res = preg_match_all('/get_lang\(\'(\\w*)\'\)/',$line,$myterms); |
39 | 39 | if ($res > 0) { |
40 | 40 | foreach($myterms[1] as $term) { |
41 | 41 | if (!isset($defined_terms[$term]) && !isset($defined_terms['lang'.$term])) { |
42 | - $undefined_terms[$term] = $shortfile; |
|
42 | + $undefined_terms[$term] = $shortfile; |
|
43 | 43 | //echo "Undefined: $term<br />"; |
44 | 44 | } |
45 | 45 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | if ($res > 0) { |
50 | 50 | foreach($myterms[1] as $term) { |
51 | 51 | if (!isset($defined_terms[$term]) && !isset($defined_terms['lang'.$term])) { |
52 | - $undefined_terms[$term] = $shortfile; |
|
52 | + $undefined_terms[$term] = $shortfile; |
|
53 | 53 | //echo "Undefined: $term<br />"; |
54 | 54 | } |
55 | 55 | } |
@@ -73,17 +73,17 @@ discard block |
||
73 | 73 | $list = scandir($base_path); |
74 | 74 | $files = array(); |
75 | 75 | foreach ($list as $item) { |
76 | - if (substr($item,0,1)=='.') {continue;} |
|
76 | + if (substr($item,0,1)=='.') {continue;} |
|
77 | 77 | $special_dirs = array(api_get_path(SYS_TEST_PATH),api_get_path(SYS_COURSE_PATH),api_get_path(SYS_LANG_PATH),api_get_path(SYS_ARCHIVE_PATH)); |
78 | 78 | if (in_array($base_path.$item.'/',$special_dirs)) {continue;} |
79 | 79 | if (is_dir($base_path.$item)) { |
80 | - $files = array_merge($files,get_all_php_files($base_path.$item.'/')); |
|
80 | + $files = array_merge($files,get_all_php_files($base_path.$item.'/')); |
|
81 | 81 | } else { |
82 | 82 | //only analyse php files |
83 | 83 | $sub = substr($item,-4); |
84 | - if ($sub == '.php' or $sub == '.tpl') { |
|
84 | + if ($sub == '.php' or $sub == '.tpl') { |
|
85 | 85 | $files[] = $base_path.$item; |
86 | - } |
|
86 | + } |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | $list = null; |
@@ -40,11 +40,11 @@ |
||
40 | 40 | // search users where username or firstname or lastname begins likes $needle |
41 | 41 | $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; |
42 | 42 | $sql = 'SELECT u.user_id, username, lastname, firstname FROM '.$tbl_user.' u '. |
43 | - ' WHERE (username LIKE "'.$needle.'%" '. |
|
44 | - ' OR firstname LIKE "'.$needle.'%" '. |
|
45 | - ' OR lastname LIKE "'.$needle.'%") '. |
|
43 | + ' WHERE (username LIKE "'.$needle.'%" '. |
|
44 | + ' OR firstname LIKE "'.$needle.'%" '. |
|
45 | + ' OR lastname LIKE "'.$needle.'%") '. |
|
46 | 46 | $order_clause . |
47 | - ' LIMIT 11'; |
|
47 | + ' LIMIT 11'; |
|
48 | 48 | |
49 | 49 | $rs = Database::query($sql); |
50 | 50 | $i=0; |
@@ -68,18 +68,18 @@ discard block |
||
68 | 68 | // defined terms, and this should prove the concept that there are much |
69 | 69 | // more variables than what we really use |
70 | 70 | if (count($usedTerms)<1) { |
71 | - die("No used terms<br />\n"); |
|
71 | + die("No used terms<br />\n"); |
|
72 | 72 | } else { |
73 | - echo "The following terms were defined but never used: <br />\n<table>"; |
|
73 | + echo "The following terms were defined but never used: <br />\n<table>"; |
|
74 | 74 | } |
75 | 75 | $i = 1; |
76 | 76 | foreach ($defined_terms as $term => $file) { |
77 | - // remove "lang" prefix just in case |
|
78 | - if (substr($term,0,4)=='lang') { $term = substr($term,4); } |
|
79 | - if (!isset($usedTerms[$term])) { |
|
77 | + // remove "lang" prefix just in case |
|
78 | + if (substr($term,0,4)=='lang') { $term = substr($term,4); } |
|
79 | + if (!isset($usedTerms[$term])) { |
|
80 | 80 | echo "<tr><td>$i</td><td>$term</td></tr>\n"; |
81 | 81 | $i++; |
82 | - } |
|
82 | + } |
|
83 | 83 | } |
84 | 84 | echo "</table>\n"; |
85 | 85 | |
@@ -88,17 +88,17 @@ discard block |
||
88 | 88 | $list = scandir($base_path); |
89 | 89 | $files = array(); |
90 | 90 | foreach ($list as $item) { |
91 | - if (substr($item,0,1)=='.') {continue;} |
|
91 | + if (substr($item,0,1)=='.') {continue;} |
|
92 | 92 | $special_dirs = array(api_get_path(SYS_TEST_PATH),api_get_path(SYS_COURSE_PATH),api_get_path(SYS_LANG_PATH),api_get_path(SYS_ARCHIVE_PATH)); |
93 | 93 | if (in_array($base_path.$item.'/',$special_dirs)) {continue;} |
94 | 94 | if (is_dir($base_path.$item)) { |
95 | - $files = array_merge($files,get_all_php_files($base_path.$item.'/')); |
|
95 | + $files = array_merge($files,get_all_php_files($base_path.$item.'/')); |
|
96 | 96 | } else { |
97 | 97 | //only analyse php files |
98 | 98 | $sub = substr($item,-4); |
99 | - if ($sub == '.php' or $sub == '.tpl') { |
|
99 | + if ($sub == '.php' or $sub == '.tpl') { |
|
100 | 100 | $files[] = $base_path.$item; |
101 | - } |
|
101 | + } |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | $list = null; |
@@ -351,9 +351,9 @@ |
||
351 | 351 | . '&externalRoomType=' . $room->externalRoomType; |
352 | 352 | if ($room->allowRecording) { |
353 | 353 | $url .= '&allowUserQuestions=' . $this->var_to_str($room->allowUserQuestions) |
354 | - . '&isAudioOnly=' . $this->var_to_str($room->isAudioOnly) |
|
355 | - . '&waitForRecording=' . $this->var_to_str($room->waitForRecording) |
|
356 | - . '&allowRecording=' . $this->var_to_str($room->allowRecording); |
|
354 | + . '&isAudioOnly=' . $this->var_to_str($room->isAudioOnly) |
|
355 | + . '&waitForRecording=' . $this->var_to_str($room->waitForRecording) |
|
356 | + . '&allowRecording=' . $this->var_to_str($room->allowRecording); |
|
357 | 357 | } elseif ($room->isAudioOnly) { |
358 | 358 | $url .= '&isAudioOnly=' . $this->var_to_str($room->isAudioOnly); |
359 | 359 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | public function getUser() |
42 | 42 | { |
43 | 43 | if (!$this->container->has('security.context')) { |
44 | - return false; |
|
44 | + return false; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | if (null === $token = $this->container->get('security.context')->getToken()) { |
@@ -24,32 +24,32 @@ discard block |
||
24 | 24 | private $path; |
25 | 25 | private $permission = array(DRH); |
26 | 26 | |
27 | - /** |
|
28 | - * Controller |
|
29 | - */ |
|
27 | + /** |
|
28 | + * Controller |
|
29 | + */ |
|
30 | 30 | public function __construct ($user_id) |
31 | 31 | { |
32 | - $this->user_id = $user_id; |
|
33 | - $this->path = 'block_teacher'; |
|
34 | - if ($this->is_block_visible_for_user($user_id)) { |
|
35 | - $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER); |
|
36 | - } |
|
32 | + $this->user_id = $user_id; |
|
33 | + $this->path = 'block_teacher'; |
|
34 | + if ($this->is_block_visible_for_user($user_id)) { |
|
35 | + $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER); |
|
36 | + } |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
40 | - * This method check if a user is allowed to see the block inside dashboard interface |
|
41 | - * @param int User id |
|
42 | - * @return bool Is block visible for user |
|
43 | - */ |
|
40 | + * This method check if a user is allowed to see the block inside dashboard interface |
|
41 | + * @param int User id |
|
42 | + * @return bool Is block visible for user |
|
43 | + */ |
|
44 | 44 | public function is_block_visible_for_user($user_id) |
45 | 45 | { |
46 | - $user_info = api_get_user_info($user_id); |
|
47 | - $user_status = $user_info['status']; |
|
48 | - $is_block_visible_for_user = false; |
|
49 | - if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
50 | - $is_block_visible_for_user = true; |
|
51 | - } |
|
52 | - return $is_block_visible_for_user; |
|
46 | + $user_info = api_get_user_info($user_id); |
|
47 | + $user_status = $user_info['status']; |
|
48 | + $is_block_visible_for_user = false; |
|
49 | + if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) { |
|
50 | + $is_block_visible_for_user = true; |
|
51 | + } |
|
52 | + return $is_block_visible_for_user; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | public function get_block() |
61 | 61 | { |
62 | 62 | |
63 | - global $charset; |
|
64 | - $column = 1; |
|
65 | - $data = array(); |
|
66 | - $teacher_content_html = $this->get_teachers_content_html_for_drh(); |
|
63 | + global $charset; |
|
64 | + $column = 1; |
|
65 | + $data = array(); |
|
66 | + $teacher_content_html = $this->get_teachers_content_html_for_drh(); |
|
67 | 67 | |
68 | - $html = ' |
|
68 | + $html = ' |
|
69 | 69 | <div class="panel panel-default" id="intro"> |
70 | 70 | <div class="panel-heading"> |
71 | 71 | '.get_lang('TeachersInformationsList').' |
@@ -79,27 +79,27 @@ discard block |
||
79 | 79 | </div> |
80 | 80 | '; |
81 | 81 | |
82 | - $data['column'] = $column; |
|
83 | - $data['content_html'] = $html; |
|
82 | + $data['column'] = $column; |
|
83 | + $data['content_html'] = $html; |
|
84 | 84 | |
85 | - return $data; |
|
85 | + return $data; |
|
86 | 86 | |
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
90 | - * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
91 | - * @return string content html |
|
92 | - */ |
|
90 | + * This method return a content html, it's used inside get_block method for showing it inside dashboard interface |
|
91 | + * @return string content html |
|
92 | + */ |
|
93 | 93 | public function get_teachers_content_html_for_platform_admin() |
94 | 94 | { |
95 | - $teachers = $this->teachers; |
|
96 | - //$content = '<div style="margin:10px;">'; |
|
97 | - $content = '<h4>'.get_lang('YourTeachers').'</h4>'; |
|
95 | + $teachers = $this->teachers; |
|
96 | + //$content = '<div style="margin:10px;">'; |
|
97 | + $content = '<h4>'.get_lang('YourTeachers').'</h4>'; |
|
98 | 98 | |
99 | 99 | $teachers_table = null; |
100 | - if (count($teachers) > 0) { |
|
101 | - $teachers_table .= '<table class="data_table" width:"95%">'; |
|
102 | - $teachers_table .= ' |
|
100 | + if (count($teachers) > 0) { |
|
101 | + $teachers_table .= '<table class="data_table" width:"95%">'; |
|
102 | + $teachers_table .= ' |
|
103 | 103 | <tr> |
104 | 104 | <th>'.get_lang('User').'</th> |
105 | 105 | <th>'.get_lang('TimeSpentOnThePlatform').'</th> |
@@ -107,103 +107,103 @@ discard block |
||
107 | 107 | </tr> |
108 | 108 | '; |
109 | 109 | |
110 | - $i = 1; |
|
111 | - foreach ($teachers as $teacher) { |
|
110 | + $i = 1; |
|
111 | + foreach ($teachers as $teacher) { |
|
112 | 112 | |
113 | - $teacher_id = $teacher['user_id']; |
|
114 | - $firstname = $teacher['firstname']; |
|
115 | - $lastname = $teacher['lastname']; |
|
116 | - $username = $teacher['username']; |
|
113 | + $teacher_id = $teacher['user_id']; |
|
114 | + $firstname = $teacher['firstname']; |
|
115 | + $lastname = $teacher['lastname']; |
|
116 | + $username = $teacher['username']; |
|
117 | 117 | |
118 | - $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id)); |
|
119 | - $last_connection = Tracking :: get_last_connection_date($teacher_id); |
|
118 | + $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id)); |
|
119 | + $last_connection = Tracking :: get_last_connection_date($teacher_id); |
|
120 | 120 | |
121 | - if ($i%2 == 0) $class_tr = 'row_odd'; |
|
122 | - else $class_tr = 'row_even'; |
|
121 | + if ($i%2 == 0) $class_tr = 'row_odd'; |
|
122 | + else $class_tr = 'row_even'; |
|
123 | 123 | |
124 | - $teachers_table .= ' |
|
124 | + $teachers_table .= ' |
|
125 | 125 | <tr class="'.$class_tr.'"> |
126 | 126 | <td>'.api_get_person_name($firstname,$lastname).' ('.$username.')</td> |
127 | 127 | <td align="right">'.$time_on_platform.'</td> |
128 | 128 | <td align="right">'.$last_connection.'</td> |
129 | 129 | </tr> |
130 | 130 | '; |
131 | - $i++; |
|
132 | - } |
|
133 | - $teachers_table .= '</table>'; |
|
134 | - } else { |
|
135 | - $teachers_table .= get_lang('ThereIsNoInformationAboutYourTeachers'); |
|
136 | - } |
|
131 | + $i++; |
|
132 | + } |
|
133 | + $teachers_table .= '</table>'; |
|
134 | + } else { |
|
135 | + $teachers_table .= get_lang('ThereIsNoInformationAboutYourTeachers'); |
|
136 | + } |
|
137 | 137 | |
138 | - $content .= $teachers_table; |
|
138 | + $content .= $teachers_table; |
|
139 | 139 | |
140 | - if (count($teachers) > 0) { |
|
141 | - $content .= '<div style="text-align:right;margin-top:10px;"> |
|
140 | + if (count($teachers) > 0) { |
|
141 | + $content .= '<div style="text-align:right;margin-top:10px;"> |
|
142 | 142 | <a href="'.api_get_path(WEB_CODE_PATH).'mySpace/index.php?view=admin">'.get_lang('SeeMore').'</a></div>'; |
143 | - } |
|
143 | + } |
|
144 | 144 | |
145 | - //$content .= '</div>'; |
|
145 | + //$content .= '</div>'; |
|
146 | 146 | |
147 | - return $content; |
|
148 | - } |
|
147 | + return $content; |
|
148 | + } |
|
149 | 149 | |
150 | - public function get_teachers_content_html_for_drh() |
|
150 | + public function get_teachers_content_html_for_drh() |
|
151 | 151 | { |
152 | - $teachers = $this->teachers; |
|
153 | - //$content = '<div style="margin:10px;">'; |
|
154 | - $content = '<h4>'.get_lang('YourTeachers').'</h4>'; |
|
152 | + $teachers = $this->teachers; |
|
153 | + //$content = '<div style="margin:10px;">'; |
|
154 | + $content = '<h4>'.get_lang('YourTeachers').'</h4>'; |
|
155 | 155 | $teachers_table = null; |
156 | - if (count($teachers) > 0) { |
|
157 | - $a_last_week = get_last_week(); |
|
158 | - $last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); |
|
156 | + if (count($teachers) > 0) { |
|
157 | + $a_last_week = get_last_week(); |
|
158 | + $last_week = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]); |
|
159 | 159 | |
160 | - $teachers_table .= '<table class="data_table" width:"95%">'; |
|
161 | - $teachers_table .= ' |
|
160 | + $teachers_table .= '<table class="data_table" width:"95%">'; |
|
161 | + $teachers_table .= ' |
|
162 | 162 | <tr> |
163 | 163 | <th>'.get_lang('User').'</th> |
164 | 164 | <th>'.get_lang('TimeSpentLastWeek').'<br />'.$last_week.'</th> |
165 | 165 | </tr> |
166 | 166 | '; |
167 | 167 | |
168 | - $i = 1; |
|
169 | - foreach ($teachers as $teacher) { |
|
168 | + $i = 1; |
|
169 | + foreach ($teachers as $teacher) { |
|
170 | 170 | |
171 | - $teacher_id = $teacher['user_id']; |
|
172 | - $firstname = $teacher['firstname']; |
|
173 | - $lastname = $teacher['lastname']; |
|
174 | - $username = $teacher['username']; |
|
175 | - $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id,true)); |
|
171 | + $teacher_id = $teacher['user_id']; |
|
172 | + $firstname = $teacher['firstname']; |
|
173 | + $lastname = $teacher['lastname']; |
|
174 | + $username = $teacher['username']; |
|
175 | + $time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($teacher_id,true)); |
|
176 | 176 | |
177 | - if ($i%2 == 0) $class_tr = 'row_odd'; |
|
178 | - else $class_tr = 'row_even'; |
|
179 | - $teachers_table .= '<tr class="'.$class_tr.'"> |
|
177 | + if ($i%2 == 0) $class_tr = 'row_odd'; |
|
178 | + else $class_tr = 'row_even'; |
|
179 | + $teachers_table .= '<tr class="'.$class_tr.'"> |
|
180 | 180 | <td>'.api_get_person_name($firstname,$lastname).' ('.$username.')</td> |
181 | 181 | <td align="right">'.$time_on_platform.'</td> |
182 | 182 | </tr>'; |
183 | 183 | |
184 | - $i++; |
|
185 | - } |
|
186 | - $teachers_table .= '</table>'; |
|
187 | - } else { |
|
188 | - $teachers_table .= get_lang('ThereIsNoInformationAboutYourTeachers'); |
|
189 | - } |
|
184 | + $i++; |
|
185 | + } |
|
186 | + $teachers_table .= '</table>'; |
|
187 | + } else { |
|
188 | + $teachers_table .= get_lang('ThereIsNoInformationAboutYourTeachers'); |
|
189 | + } |
|
190 | 190 | |
191 | - $content .= $teachers_table; |
|
191 | + $content .= $teachers_table; |
|
192 | 192 | |
193 | - if (count($teachers) > 0) { |
|
194 | - $content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/teachers.php">'.get_lang('SeeMore').'</a></div>'; |
|
195 | - } |
|
196 | - //$content .= '</div>'; |
|
193 | + if (count($teachers) > 0) { |
|
194 | + $content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/teachers.php">'.get_lang('SeeMore').'</a></div>'; |
|
195 | + } |
|
196 | + //$content .= '</div>'; |
|
197 | 197 | |
198 | - return $content; |
|
199 | - } |
|
198 | + return $content; |
|
199 | + } |
|
200 | 200 | |
201 | 201 | /** |
202 | - * Get number of teachers |
|
203 | - * @return int |
|
204 | - */ |
|
205 | - function get_number_of_teachers() |
|
202 | + * Get number of teachers |
|
203 | + * @return int |
|
204 | + */ |
|
205 | + function get_number_of_teachers() |
|
206 | 206 | { |
207 | - return count($this->teachers); |
|
208 | - } |
|
207 | + return count($this->teachers); |
|
208 | + } |
|
209 | 209 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | while ($session = Database :: fetch_array($rs)) { |
49 | 49 | $i++; |
50 | 50 | if ($i<=10) { |
51 | - $return .= '<a href="#" onclick="add_user_to_url(\''.addslashes($session['id']).'\',\''.addslashes($session['name']).' ('.addslashes($session['id']).')'.'\')">'.$session['name'].' </a><br />'; |
|
51 | + $return .= '<a href="#" onclick="add_user_to_url(\''.addslashes($session['id']).'\',\''.addslashes($session['name']).' ('.addslashes($session['id']).')'.'\')">'.$session['name'].' </a><br />'; |
|
52 | 52 | } else { |
53 | 53 | $return .= '...<br />'; |
54 | 54 | } |
@@ -26,9 +26,9 @@ |
||
26 | 26 | protected function getTasks() |
27 | 27 | { |
28 | 28 | return array( |
29 | - new TaskModel('make stuff', 30, TaskModel::COLOR_GREEN), |
|
30 | - new TaskModel('make more stuff', 60), |
|
31 | - new TaskModel('some more tasks to do', 10, TaskModel::COLOR_RED) |
|
29 | + new TaskModel('make stuff', 30, TaskModel::COLOR_GREEN), |
|
30 | + new TaskModel('make more stuff', 60), |
|
31 | + new TaskModel('some more tasks to do', 10, TaskModel::COLOR_RED) |
|
32 | 32 | ); |
33 | 33 | |
34 | 34 | } |