@@ -6,24 +6,24 @@ |
||
6 | 6 | */ |
7 | 7 | class HTML_QuickForm_Rule_UsernameAvailable extends HTML_QuickForm_Rule |
8 | 8 | { |
9 | - /** |
|
10 | - * Function to check if a username is available |
|
11 | - * @see HTML_QuickForm_Rule |
|
12 | - * @param string $username Wanted username |
|
13 | - * @param string $current_username |
|
14 | - * @return boolean True if username is available |
|
15 | - */ |
|
16 | - function validate($username, $current_username = null) { |
|
17 | - $user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
9 | + /** |
|
10 | + * Function to check if a username is available |
|
11 | + * @see HTML_QuickForm_Rule |
|
12 | + * @param string $username Wanted username |
|
13 | + * @param string $current_username |
|
14 | + * @return boolean True if username is available |
|
15 | + */ |
|
16 | + function validate($username, $current_username = null) { |
|
17 | + $user_table = Database::get_main_table(TABLE_MAIN_USER); |
|
18 | 18 | $username = Database::escape_string($username); |
19 | 19 | $current_username = Database::escape_string($current_username); |
20 | 20 | |
21 | - $sql = "SELECT * FROM $user_table WHERE username = '$username'"; |
|
22 | - if (!is_null($current_username)) { |
|
23 | - $sql .= " AND username != '$current_username'"; |
|
24 | - } |
|
25 | - $res = Database::query($sql); |
|
26 | - $number = Database::num_rows($res); |
|
27 | - return $number == 0; |
|
28 | - } |
|
21 | + $sql = "SELECT * FROM $user_table WHERE username = '$username'"; |
|
22 | + if (!is_null($current_username)) { |
|
23 | + $sql .= " AND username != '$current_username'"; |
|
24 | + } |
|
25 | + $res = Database::query($sql); |
|
26 | + $number = Database::num_rows($res); |
|
27 | + return $number == 0; |
|
28 | + } |
|
29 | 29 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @return boolean True if the 2 given dates match the operator |
13 | 13 | */ |
14 | 14 | function validate($values, $operator = null) { |
15 | - $datetime1 = api_strtotime($values[0]); |
|
15 | + $datetime1 = api_strtotime($values[0]); |
|
16 | 16 | $datetime2 = api_strtotime($values[1]); |
17 | 17 | |
18 | 18 | if (strpos($operator, 'allow_empty') !== false) { |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | return true; |
22 | 22 | } |
23 | 23 | } |
24 | - $result = parent::validate(array($datetime1, $datetime2), $operator); |
|
24 | + $result = parent::validate(array($datetime1, $datetime2), $operator); |
|
25 | 25 | return $result; |
26 | 26 | } |
27 | 27 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | return true; |
22 | 22 | } |
23 | 23 | } |
24 | - $result = parent::validate(array($datetime1, $datetime2), $operator); |
|
24 | + $result = parent::validate(array($datetime1, $datetime2), $operator); |
|
25 | 25 | return $result; |
26 | 26 | } |
27 | 27 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | function validate($html, $mode = NO_HTML) |
18 | 18 | { |
19 | - $allowed_tags = self::get_allowed_tags ($mode, $fullpage); |
|
19 | + $allowed_tags = self::get_allowed_tags($mode, $fullpage); |
|
20 | 20 | $cleaned_html = kses($html, $allowed_tags); |
21 | 21 | return $html == $cleaned_html; |
22 | 22 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // Include the allowed tags. |
34 | 34 | //include(dirname(__FILE__).'/allowed_tags.inc.php'); |
35 | 35 | global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page; |
36 | - switch($mode) |
|
36 | + switch ($mode) |
|
37 | 37 | { |
38 | 38 | case NO_HTML: |
39 | 39 | return array(); |
@@ -25,8 +25,6 @@ |
||
25 | 25 | * Get allowed tags |
26 | 26 | * @param int $mode NO_HTML, STUDENT_HTML, TEACHER_HTML, |
27 | 27 | * STUDENT_HTML_FULLPAGE or TEACHER_HTML_FULLPAGE |
28 | - * @param boolean $fullpage If true, the allowed tags for full-page editing |
|
29 | - * are returned. |
|
30 | 28 | */ |
31 | 29 | static function get_allowed_tags($mode) |
32 | 30 | { |
@@ -27,10 +27,10 @@ |
||
27 | 27 | */ |
28 | 28 | function validate($value, $options = null) |
29 | 29 | { |
30 | - if(is_array($value)) |
|
31 | - { |
|
32 | - $value = implode(null,$value); |
|
33 | - } |
|
30 | + if(is_array($value)) |
|
31 | + { |
|
32 | + $value = implode(null,$value); |
|
33 | + } |
|
34 | 34 | if ((string)$value == '') { |
35 | 35 | return false; |
36 | 36 | } |
@@ -27,11 +27,11 @@ |
||
27 | 27 | */ |
28 | 28 | function validate($value, $options = null) |
29 | 29 | { |
30 | - if(is_array($value)) |
|
30 | + if (is_array($value)) |
|
31 | 31 | { |
32 | - $value = implode(null,$value); |
|
32 | + $value = implode(null, $value); |
|
33 | 33 | } |
34 | - if ((string)$value == '') { |
|
34 | + if ((string) $value == '') { |
|
35 | 35 | return false; |
36 | 36 | } |
37 | 37 | return true; |
@@ -9,18 +9,18 @@ |
||
9 | 9 | class HTML_QuickForm_Rule_FileName extends HTML_QuickForm_Rule |
10 | 10 | { |
11 | 11 | |
12 | - /** |
|
13 | - * @param $value array Uploaded file info (from $_FILES) |
|
14 | - * @param null $options |
|
15 | - * @return bool |
|
16 | - */ |
|
17 | - public function validate($value, $options = null) |
|
18 | - { |
|
19 | - if ((isset($elementValue['error']) && $elementValue['error'] == 0) || |
|
20 | - (!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none')) { |
|
21 | - return is_uploaded_file($elementValue['tmp_name']); |
|
22 | - } else { |
|
23 | - return false; |
|
24 | - } |
|
25 | - } |
|
12 | + /** |
|
13 | + * @param $value array Uploaded file info (from $_FILES) |
|
14 | + * @param null $options |
|
15 | + * @return bool |
|
16 | + */ |
|
17 | + public function validate($value, $options = null) |
|
18 | + { |
|
19 | + if ((isset($elementValue['error']) && $elementValue['error'] == 0) || |
|
20 | + (!empty($elementValue['tmp_name']) && $elementValue['tmp_name'] != 'none')) { |
|
21 | + return is_uploaded_file($elementValue['tmp_name']); |
|
22 | + } else { |
|
23 | + return false; |
|
24 | + } |
|
25 | + } |
|
26 | 26 | } |
@@ -109,7 +109,7 @@ |
||
109 | 109 | }*/ |
110 | 110 | // If the session time has expired, refresh the starttime value, |
111 | 111 | // so we're starting to count down from a later time |
112 | - if ( $session->has('starttime') && $session->is_expired()) { |
|
112 | + if ($session->has('starttime') && $session->is_expired()) { |
|
113 | 113 | $session->destroy(); |
114 | 114 | } else { |
115 | 115 | //error_log('Time not expired, extend session for a bit more'); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | echo '<tr>'; |
54 | 54 | self::display_dashboard_plugin_checkboxes($testplugin); |
55 | - for ($i = 0 ; $i < count($table_cols); $i++) { |
|
55 | + for ($i = 0; $i < count($table_cols); $i++) { |
|
56 | 56 | if (isset($plugin_info[strtolower($table_cols[$i])])) { |
57 | 57 | echo '<td>'; |
58 | 58 | echo $plugin_info[$table_cols[$i]]; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | echo Display::tag( |
68 | 68 | 'tr', |
69 | 69 | Display::tag('td', |
70 | - get_lang('CheckFilePermissions') . ' ' . Security::remove_XSS($plugin_info_file), |
|
70 | + get_lang('CheckFilePermissions').' '.Security::remove_XSS($plugin_info_file), |
|
71 | 71 | array('colspan' => '3')) |
72 | 72 | ); |
73 | 73 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | foreach ($disabled_blocks_data as $disabled_block) { |
80 | 80 | echo '<tr style="background-color:#eee">'; |
81 | 81 | echo '<td><center><input type="checkbox" name="disabled_block" value="true" checked disabled /></center>'; |
82 | - for ($j = 0 ; $j < count($table_cols); $j++) { |
|
82 | + for ($j = 0; $j < count($table_cols); $j++) { |
|
83 | 83 | if (isset($disabled_block[strtolower($table_cols[$j])])) { |
84 | 84 | if ($j == 2) { |
85 | 85 | echo '<td>'; |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | } |
190 | 190 | // clean from block data |
191 | 191 | if (!empty($not_selected_blocks_id)) { |
192 | - $sql_check = "SELECT id FROM $tbl_block WHERE id IN(".implode(',',$not_selected_blocks_id).")"; |
|
192 | + $sql_check = "SELECT id FROM $tbl_block WHERE id IN(".implode(',', $not_selected_blocks_id).")"; |
|
193 | 193 | $rs_check = Database::query($sql_check); |
194 | 194 | if (Database::num_rows($rs_check) > 0) { |
195 | - $del = "DELETE FROM $tbl_block WHERE id IN(".implode(',',$not_selected_blocks_id).")"; |
|
195 | + $del = "DELETE FROM $tbl_block WHERE id IN(".implode(',', $not_selected_blocks_id).")"; |
|
196 | 196 | Database::query($del); |
197 | 197 | } |
198 | 198 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $affected_rows = Database::affected_rows($result); |
213 | 213 | } else { |
214 | 214 | // insert |
215 | - $plugin_info_file = $dashboard_pluginpath . $testplugin . "/$testplugin.info"; |
|
215 | + $plugin_info_file = $dashboard_pluginpath.$testplugin."/$testplugin.info"; |
|
216 | 216 | $plugin_info = array(); |
217 | 217 | if (file_exists($plugin_info_file)) { |
218 | 218 | $plugin_info = parse_info_file($plugin_info_file); |
@@ -282,10 +282,10 @@ discard block |
||
282 | 282 | // We check if plugin exists inside directory for updating active field |
283 | 283 | $sql = "SELECT * FROM $tbl_block"; |
284 | 284 | $rs = Database::query($sql); |
285 | - if (Database::num_rows($rs) > 0){ |
|
285 | + if (Database::num_rows($rs) > 0) { |
|
286 | 286 | while ($row = Database::fetch_array($rs)) { |
287 | 287 | $path = $row['path']; |
288 | - if (!in_array($row['path'],$possibleplugins)) { |
|
288 | + if (!in_array($row['path'], $possibleplugins)) { |
|
289 | 289 | $active = 0; |
290 | 290 | } else { |
291 | 291 | $active = 1; |
@@ -390,13 +390,13 @@ discard block |
||
390 | 390 | echo '<td>'.$block['description'].'</td>'; |
391 | 391 | echo '<td> |
392 | 392 | <select class="selectpicker show-tick form-control" name="columns['.$block['id'].']"> |
393 | - <option value="1" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column']==1?'selected':'').' >1</option> |
|
394 | - <option value="2" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column']==2?'selected':'').' >2</option> |
|
393 | + <option value="1" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column'] == 1 ? 'selected' : '').' >1</option> |
|
394 | + <option value="2" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column'] == 2 ? 'selected' : '').' >2</option> |
|
395 | 395 | </select> |
396 | 396 | </td>'; |
397 | 397 | echo '</tr>'; |
398 | 398 | } else { |
399 | - echo Display::tag('tr', Display::tag('td', get_lang('Error').' '.$controller_class, array('colspan'=>'3'))); |
|
399 | + echo Display::tag('tr', Display::tag('td', get_lang('Error').' '.$controller_class, array('colspan'=>'3'))); |
|
400 | 400 | } |
401 | 401 | } |
402 | 402 | |
@@ -475,10 +475,10 @@ discard block |
||
475 | 475 | $user_id = intval($user_id); |
476 | 476 | $field_variable = 'dashboard'; |
477 | 477 | $extra_user_data = UserManager::get_extra_user_data_by_field($user_id, $field_variable); |
478 | - $extra_user_data = explode(';',$extra_user_data[$field_variable]); |
|
478 | + $extra_user_data = explode(';', $extra_user_data[$field_variable]); |
|
479 | 479 | $data = array(); |
480 | 480 | foreach ($extra_user_data as $extra) { |
481 | - $split_extra = explode(':',$extra); |
|
481 | + $split_extra = explode(':', $extra); |
|
482 | 482 | if (!empty($split_extra)) { |
483 | 483 | $block_id = $split_extra[0]; |
484 | 484 | $column = isset($split_extra[1]) ? $split_extra[1] : null; |
@@ -380,7 +380,9 @@ |
||
380 | 380 | // check if user is allowed to see the block |
381 | 381 | if (method_exists($obj_block, 'is_block_visible_for_user')) { |
382 | 382 | $is_block_visible_for_user = $obj_block->is_block_visible_for_user($user_id); |
383 | - if (!$is_block_visible_for_user) continue; |
|
383 | + if (!$is_block_visible_for_user) { |
|
384 | + continue; |
|
385 | + } |
|
384 | 386 | } |
385 | 387 | |
386 | 388 | echo '<tr>'; |
@@ -249,283 +249,283 @@ |
||
249 | 249 | return $affected_rows; |
250 | 250 | } |
251 | 251 | |
252 | - /** |
|
253 | - * Get all plugins path inside dashboard directory |
|
254 | - * @return array name plugins directories |
|
255 | - */ |
|
256 | - public static function getPossibleDashboardPluginsPath() |
|
252 | + /** |
|
253 | + * Get all plugins path inside dashboard directory |
|
254 | + * @return array name plugins directories |
|
255 | + */ |
|
256 | + public static function getPossibleDashboardPluginsPath() |
|
257 | 257 | { |
258 | - // get all plugins path inside plugin directory |
|
259 | - /* We scan the plugin directory. Each folder is a potential plugin. */ |
|
260 | - $possiblePlugins = array(); |
|
261 | - $dashboard_pluginpath = api_get_path(SYS_PLUGIN_PATH).'dashboard/'; |
|
262 | - $handle = @opendir($dashboard_pluginpath); |
|
263 | - while (false !== ($file = readdir($handle))) { |
|
264 | - if ($file <> '.' AND $file <> '..' AND is_dir($dashboard_pluginpath.$file)) { |
|
265 | - $possiblePlugins[] = $file; |
|
266 | - } |
|
267 | - } |
|
268 | - @closedir($handle); |
|
269 | - |
|
270 | - return $possiblePlugins; |
|
271 | - } |
|
272 | - |
|
273 | - /** |
|
274 | - * Get all blocks data without plugin directory |
|
275 | - * @return array Block data |
|
276 | - */ |
|
277 | - public static function get_block_data_without_plugin() |
|
258 | + // get all plugins path inside plugin directory |
|
259 | + /* We scan the plugin directory. Each folder is a potential plugin. */ |
|
260 | + $possiblePlugins = array(); |
|
261 | + $dashboard_pluginpath = api_get_path(SYS_PLUGIN_PATH).'dashboard/'; |
|
262 | + $handle = @opendir($dashboard_pluginpath); |
|
263 | + while (false !== ($file = readdir($handle))) { |
|
264 | + if ($file <> '.' AND $file <> '..' AND is_dir($dashboard_pluginpath.$file)) { |
|
265 | + $possiblePlugins[] = $file; |
|
266 | + } |
|
267 | + } |
|
268 | + @closedir($handle); |
|
269 | + |
|
270 | + return $possiblePlugins; |
|
271 | + } |
|
272 | + |
|
273 | + /** |
|
274 | + * Get all blocks data without plugin directory |
|
275 | + * @return array Block data |
|
276 | + */ |
|
277 | + public static function get_block_data_without_plugin() |
|
278 | 278 | { |
279 | - $tbl_block = Database :: get_main_table(TABLE_MAIN_BLOCK); |
|
280 | - $possibleplugins = self::getPossibleDashboardPluginsPath(); |
|
281 | - |
|
282 | - // We check if plugin exists inside directory for updating active field |
|
283 | - $sql = "SELECT * FROM $tbl_block"; |
|
284 | - $rs = Database::query($sql); |
|
285 | - if (Database::num_rows($rs) > 0){ |
|
286 | - while ($row = Database::fetch_array($rs)) { |
|
287 | - $path = $row['path']; |
|
288 | - if (!in_array($row['path'],$possibleplugins)) { |
|
289 | - $active = 0; |
|
290 | - } else { |
|
291 | - $active = 1; |
|
292 | - } |
|
293 | - // update active |
|
294 | - $upd = "UPDATE $tbl_block SET active = '$active' |
|
279 | + $tbl_block = Database :: get_main_table(TABLE_MAIN_BLOCK); |
|
280 | + $possibleplugins = self::getPossibleDashboardPluginsPath(); |
|
281 | + |
|
282 | + // We check if plugin exists inside directory for updating active field |
|
283 | + $sql = "SELECT * FROM $tbl_block"; |
|
284 | + $rs = Database::query($sql); |
|
285 | + if (Database::num_rows($rs) > 0){ |
|
286 | + while ($row = Database::fetch_array($rs)) { |
|
287 | + $path = $row['path']; |
|
288 | + if (!in_array($row['path'],$possibleplugins)) { |
|
289 | + $active = 0; |
|
290 | + } else { |
|
291 | + $active = 1; |
|
292 | + } |
|
293 | + // update active |
|
294 | + $upd = "UPDATE $tbl_block SET active = '$active' |
|
295 | 295 | WHERE path = '".$row['path']."'"; |
296 | - Database::query($upd); |
|
297 | - } |
|
298 | - } |
|
299 | - |
|
300 | - // get disabled block data |
|
301 | - $block_data = array(); |
|
302 | - $sql = "SELECT * FROM $tbl_block WHERE active = 0"; |
|
303 | - $rs_block = Database::query($sql); |
|
304 | - if (Database::num_rows($rs_block) > 0) { |
|
305 | - while ($row_block = Database::fetch_array($rs_block)) { |
|
306 | - $block_data[] = $row_block; |
|
307 | - } |
|
308 | - } |
|
309 | - |
|
310 | - return $block_data; |
|
311 | - |
|
312 | - } |
|
313 | - |
|
314 | - /** |
|
315 | - * get data about enabled dashboard block (stored insise block table) |
|
316 | - * @param string plugin path |
|
317 | - * @return array data |
|
318 | - */ |
|
319 | - public static function get_enabled_dashboard_blocks($path = '') |
|
296 | + Database::query($upd); |
|
297 | + } |
|
298 | + } |
|
299 | + |
|
300 | + // get disabled block data |
|
301 | + $block_data = array(); |
|
302 | + $sql = "SELECT * FROM $tbl_block WHERE active = 0"; |
|
303 | + $rs_block = Database::query($sql); |
|
304 | + if (Database::num_rows($rs_block) > 0) { |
|
305 | + while ($row_block = Database::fetch_array($rs_block)) { |
|
306 | + $block_data[] = $row_block; |
|
307 | + } |
|
308 | + } |
|
309 | + |
|
310 | + return $block_data; |
|
311 | + |
|
312 | + } |
|
313 | + |
|
314 | + /** |
|
315 | + * get data about enabled dashboard block (stored insise block table) |
|
316 | + * @param string plugin path |
|
317 | + * @return array data |
|
318 | + */ |
|
319 | + public static function get_enabled_dashboard_blocks($path = '') |
|
320 | 320 | { |
321 | - $tbl_block = Database :: get_main_table(TABLE_MAIN_BLOCK); |
|
322 | - $condition_path = ''; |
|
323 | - if (!empty($path)) { |
|
324 | - $path = Database::escape_string($path); |
|
325 | - $condition_path = ' AND path = "'.$path.'" '; |
|
326 | - } |
|
327 | - |
|
328 | - $sql = "SELECT * FROM $tbl_block WHERE active = 1 $condition_path "; |
|
329 | - $rs = Database::query($sql); |
|
330 | - $block_data = array(); |
|
331 | - if (Database::num_rows($rs) > 0) { |
|
332 | - while ($row = Database::fetch_array($rs)) { |
|
333 | - $block_data[$row['path']] = $row; |
|
334 | - } |
|
335 | - } |
|
336 | - return $block_data; |
|
337 | - } |
|
338 | - |
|
339 | - /** |
|
340 | - * display user dashboard list |
|
341 | - * @param int User id |
|
342 | - * @return void |
|
343 | - */ |
|
344 | - public static function display_user_dashboard_list($user_id) |
|
321 | + $tbl_block = Database :: get_main_table(TABLE_MAIN_BLOCK); |
|
322 | + $condition_path = ''; |
|
323 | + if (!empty($path)) { |
|
324 | + $path = Database::escape_string($path); |
|
325 | + $condition_path = ' AND path = "'.$path.'" '; |
|
326 | + } |
|
327 | + |
|
328 | + $sql = "SELECT * FROM $tbl_block WHERE active = 1 $condition_path "; |
|
329 | + $rs = Database::query($sql); |
|
330 | + $block_data = array(); |
|
331 | + if (Database::num_rows($rs) > 0) { |
|
332 | + while ($row = Database::fetch_array($rs)) { |
|
333 | + $block_data[$row['path']] = $row; |
|
334 | + } |
|
335 | + } |
|
336 | + return $block_data; |
|
337 | + } |
|
338 | + |
|
339 | + /** |
|
340 | + * display user dashboard list |
|
341 | + * @param int User id |
|
342 | + * @return void |
|
343 | + */ |
|
344 | + public static function display_user_dashboard_list($user_id) |
|
345 | 345 | { |
346 | - $enabled_dashboard_plugins = self::get_enabled_dashboard_blocks(); |
|
347 | - $user_block_data = self::get_user_block_data($user_id); |
|
348 | - |
|
349 | - if (count($enabled_dashboard_plugins) > 0) { |
|
350 | - echo '<div style="margin-top:20px">'; |
|
351 | - echo '<div><strong>'.get_lang('SelectBlockForDisplayingInsideBlocksDashboardView').'</strong></div><br />'; |
|
352 | - echo '<form name="dashboard_list" method="post" action="index.php?action=store_user_block">'; |
|
353 | - echo '<table class="data_table">'; |
|
354 | - echo '<tr>'; |
|
355 | - echo '<th width="5%">'; |
|
356 | - echo get_lang('Enabled'); |
|
357 | - echo '</th>'; |
|
358 | - echo '<th width="30%">'; |
|
359 | - echo get_lang('Name'); |
|
360 | - echo '</th>'; |
|
361 | - echo '<th width="40%">'; |
|
362 | - echo get_lang('Description'); |
|
363 | - echo '</th>'; |
|
364 | - echo '<th>'; |
|
365 | - echo get_lang('ColumnPosition'); |
|
366 | - echo '</th>'; |
|
367 | - echo '</tr>'; |
|
368 | - |
|
369 | - // We display all enabled plugins and the checkboxes |
|
370 | - foreach ($enabled_dashboard_plugins as $block) { |
|
371 | - |
|
372 | - $path = $block['path']; |
|
373 | - $controller_class = $block['controller']; |
|
374 | - $filename_controller = $path.'.class.php'; |
|
375 | - $dashboard_plugin_path = api_get_path(SYS_PLUGIN_PATH).'dashboard/'.$path.'/'; |
|
376 | - require_once $dashboard_plugin_path.$filename_controller; |
|
377 | - if (class_exists($controller_class)) { |
|
378 | - $obj_block = new $controller_class($user_id); |
|
379 | - |
|
380 | - // check if user is allowed to see the block |
|
381 | - if (method_exists($obj_block, 'is_block_visible_for_user')) { |
|
382 | - $is_block_visible_for_user = $obj_block->is_block_visible_for_user($user_id); |
|
383 | - if (!$is_block_visible_for_user) continue; |
|
384 | - } |
|
385 | - |
|
386 | - echo '<tr>'; |
|
387 | - // checkboxes |
|
388 | - self::display_user_dashboard_list_checkboxes($user_id, $block['id']); |
|
389 | - echo '<td>'.$block['name'].'</td>'; |
|
390 | - echo '<td>'.$block['description'].'</td>'; |
|
391 | - echo '<td> |
|
346 | + $enabled_dashboard_plugins = self::get_enabled_dashboard_blocks(); |
|
347 | + $user_block_data = self::get_user_block_data($user_id); |
|
348 | + |
|
349 | + if (count($enabled_dashboard_plugins) > 0) { |
|
350 | + echo '<div style="margin-top:20px">'; |
|
351 | + echo '<div><strong>'.get_lang('SelectBlockForDisplayingInsideBlocksDashboardView').'</strong></div><br />'; |
|
352 | + echo '<form name="dashboard_list" method="post" action="index.php?action=store_user_block">'; |
|
353 | + echo '<table class="data_table">'; |
|
354 | + echo '<tr>'; |
|
355 | + echo '<th width="5%">'; |
|
356 | + echo get_lang('Enabled'); |
|
357 | + echo '</th>'; |
|
358 | + echo '<th width="30%">'; |
|
359 | + echo get_lang('Name'); |
|
360 | + echo '</th>'; |
|
361 | + echo '<th width="40%">'; |
|
362 | + echo get_lang('Description'); |
|
363 | + echo '</th>'; |
|
364 | + echo '<th>'; |
|
365 | + echo get_lang('ColumnPosition'); |
|
366 | + echo '</th>'; |
|
367 | + echo '</tr>'; |
|
368 | + |
|
369 | + // We display all enabled plugins and the checkboxes |
|
370 | + foreach ($enabled_dashboard_plugins as $block) { |
|
371 | + |
|
372 | + $path = $block['path']; |
|
373 | + $controller_class = $block['controller']; |
|
374 | + $filename_controller = $path.'.class.php'; |
|
375 | + $dashboard_plugin_path = api_get_path(SYS_PLUGIN_PATH).'dashboard/'.$path.'/'; |
|
376 | + require_once $dashboard_plugin_path.$filename_controller; |
|
377 | + if (class_exists($controller_class)) { |
|
378 | + $obj_block = new $controller_class($user_id); |
|
379 | + |
|
380 | + // check if user is allowed to see the block |
|
381 | + if (method_exists($obj_block, 'is_block_visible_for_user')) { |
|
382 | + $is_block_visible_for_user = $obj_block->is_block_visible_for_user($user_id); |
|
383 | + if (!$is_block_visible_for_user) continue; |
|
384 | + } |
|
385 | + |
|
386 | + echo '<tr>'; |
|
387 | + // checkboxes |
|
388 | + self::display_user_dashboard_list_checkboxes($user_id, $block['id']); |
|
389 | + echo '<td>'.$block['name'].'</td>'; |
|
390 | + echo '<td>'.$block['description'].'</td>'; |
|
391 | + echo '<td> |
|
392 | 392 | <select class="selectpicker show-tick form-control" name="columns['.$block['id'].']"> |
393 | 393 | <option value="1" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column']==1?'selected':'').' >1</option> |
394 | 394 | <option value="2" '.(isset($user_block_data[$block['id']]) && $user_block_data[$block['id']]['column']==2?'selected':'').' >2</option> |
395 | 395 | </select> |
396 | 396 | </td>'; |
397 | - echo '</tr>'; |
|
398 | - } else { |
|
399 | - echo Display::tag('tr', Display::tag('td', get_lang('Error').' '.$controller_class, array('colspan'=>'3'))); |
|
400 | - } |
|
401 | - } |
|
402 | - |
|
403 | - echo '</table>'; |
|
404 | - echo '<div class="row"><div class="col-md-12">'; |
|
405 | - echo '<button class="btn btn-default" type="submit" name="submit_dashboard_list" value="'.get_lang('EnableDashboardBlock').'"><em class="fa fa-check-square"></em> '. |
|
397 | + echo '</tr>'; |
|
398 | + } else { |
|
399 | + echo Display::tag('tr', Display::tag('td', get_lang('Error').' '.$controller_class, array('colspan'=>'3'))); |
|
400 | + } |
|
401 | + } |
|
402 | + |
|
403 | + echo '</table>'; |
|
404 | + echo '<div class="row"><div class="col-md-12">'; |
|
405 | + echo '<button class="btn btn-default" type="submit" name="submit_dashboard_list" value="'.get_lang('EnableDashboardBlock').'"><em class="fa fa-check-square"></em> '. |
|
406 | 406 | get_lang('EnableDashboardBlock').'</button></form>'; |
407 | - echo '</div></div>'; |
|
408 | - } else { |
|
409 | - echo '<div style="margin-top:20px">'.get_lang('ThereAreNoEnabledDashboardPlugins').'</div>'; |
|
410 | - if (api_is_platform_admin()) { |
|
411 | - echo '<a class="btn btn-default" href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">'. |
|
407 | + echo '</div></div>'; |
|
408 | + } else { |
|
409 | + echo '<div style="margin-top:20px">'.get_lang('ThereAreNoEnabledDashboardPlugins').'</div>'; |
|
410 | + if (api_is_platform_admin()) { |
|
411 | + echo '<a class="btn btn-default" href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">'. |
|
412 | 412 | get_lang('ConfigureDashboardPlugin').'</a>'; |
413 | - } |
|
414 | - } |
|
415 | - } |
|
416 | - |
|
417 | - /** |
|
418 | - * display checkboxes for user dashboard list |
|
419 | - * @param int User id |
|
420 | - * @param int Block id |
|
421 | - * @return void |
|
422 | - */ |
|
423 | - public static function display_user_dashboard_list_checkboxes($user_id, $block_id) { |
|
424 | - |
|
425 | - $user_id = intval($user_id); |
|
426 | - $user_block_data = self::get_user_block_data($user_id); |
|
427 | - $enabled_blocks_id = array_keys($user_block_data); |
|
428 | - |
|
429 | - $checked = ''; |
|
430 | - if (in_array($block_id, $enabled_blocks_id)) { |
|
431 | - $checked = "checked"; |
|
432 | - } |
|
433 | - |
|
434 | - echo "<td align=\"center\">"; |
|
435 | - echo '<input type="checkbox" name="enabled_blocks['.$block_id.']" value="true" '.$checked.'/>'; |
|
436 | - echo "</td>"; |
|
437 | - } |
|
438 | - |
|
439 | - /** |
|
440 | - * This function store enabled blocks id with its column position (block_id1:colum;block_id2:colum; ...) inside extra user fields |
|
441 | - * @param int User id |
|
442 | - * @param array selected blocks |
|
443 | - * @param array columns position |
|
444 | - * @return bool |
|
445 | - */ |
|
446 | - public static function store_user_blocks($user_id, $enabled_blocks, $columns) { |
|
447 | - $selected_blocks_id = array(); |
|
448 | - if (is_array($enabled_blocks) && count($enabled_blocks) > 0) { |
|
449 | - $selected_blocks_id = array_keys($enabled_blocks); |
|
450 | - } |
|
451 | - |
|
452 | - // build data for storing inside extra user field |
|
453 | - $fname = 'dashboard'; |
|
454 | - $fvalue = array(); |
|
455 | - foreach ($selected_blocks_id as $block_id) { |
|
456 | - $fvalue[] = $block_id.':'.$columns[$block_id]; |
|
457 | - } |
|
413 | + } |
|
414 | + } |
|
415 | + } |
|
416 | + |
|
417 | + /** |
|
418 | + * display checkboxes for user dashboard list |
|
419 | + * @param int User id |
|
420 | + * @param int Block id |
|
421 | + * @return void |
|
422 | + */ |
|
423 | + public static function display_user_dashboard_list_checkboxes($user_id, $block_id) { |
|
424 | + |
|
425 | + $user_id = intval($user_id); |
|
426 | + $user_block_data = self::get_user_block_data($user_id); |
|
427 | + $enabled_blocks_id = array_keys($user_block_data); |
|
428 | + |
|
429 | + $checked = ''; |
|
430 | + if (in_array($block_id, $enabled_blocks_id)) { |
|
431 | + $checked = "checked"; |
|
432 | + } |
|
433 | + |
|
434 | + echo "<td align=\"center\">"; |
|
435 | + echo '<input type="checkbox" name="enabled_blocks['.$block_id.']" value="true" '.$checked.'/>'; |
|
436 | + echo "</td>"; |
|
437 | + } |
|
438 | + |
|
439 | + /** |
|
440 | + * This function store enabled blocks id with its column position (block_id1:colum;block_id2:colum; ...) inside extra user fields |
|
441 | + * @param int User id |
|
442 | + * @param array selected blocks |
|
443 | + * @param array columns position |
|
444 | + * @return bool |
|
445 | + */ |
|
446 | + public static function store_user_blocks($user_id, $enabled_blocks, $columns) { |
|
447 | + $selected_blocks_id = array(); |
|
448 | + if (is_array($enabled_blocks) && count($enabled_blocks) > 0) { |
|
449 | + $selected_blocks_id = array_keys($enabled_blocks); |
|
450 | + } |
|
451 | + |
|
452 | + // build data for storing inside extra user field |
|
453 | + $fname = 'dashboard'; |
|
454 | + $fvalue = array(); |
|
455 | + foreach ($selected_blocks_id as $block_id) { |
|
456 | + $fvalue[] = $block_id.':'.$columns[$block_id]; |
|
457 | + } |
|
458 | 458 | $upd_extra_field = UserManager::update_extra_field_value( |
459 | 459 | $user_id, |
460 | 460 | $fname, |
461 | 461 | $fvalue |
462 | 462 | ); |
463 | 463 | |
464 | - return $upd_extra_field; |
|
464 | + return $upd_extra_field; |
|
465 | 465 | |
466 | - } |
|
466 | + } |
|
467 | 467 | |
468 | - /** |
|
469 | - * This function get user block data (block id with its number of column) from extra user data |
|
470 | - * @param int User id |
|
471 | - * @return array data (block_id,column) |
|
472 | - */ |
|
473 | - public static function get_user_block_data($user_id) |
|
468 | + /** |
|
469 | + * This function get user block data (block id with its number of column) from extra user data |
|
470 | + * @param int User id |
|
471 | + * @return array data (block_id,column) |
|
472 | + */ |
|
473 | + public static function get_user_block_data($user_id) |
|
474 | 474 | { |
475 | - $user_id = intval($user_id); |
|
476 | - $field_variable = 'dashboard'; |
|
477 | - $extra_user_data = UserManager::get_extra_user_data_by_field($user_id, $field_variable); |
|
478 | - $extra_user_data = explode(';',$extra_user_data[$field_variable]); |
|
479 | - $data = array(); |
|
480 | - foreach ($extra_user_data as $extra) { |
|
481 | - $split_extra = explode(':',$extra); |
|
482 | - if (!empty($split_extra)) { |
|
483 | - $block_id = $split_extra[0]; |
|
484 | - $column = isset($split_extra[1]) ? $split_extra[1] : null; |
|
485 | - $data[$block_id] = array('block_id' => $block_id, 'column' => $column); |
|
486 | - } |
|
487 | - } |
|
488 | - |
|
489 | - return $data; |
|
490 | - } |
|
491 | - |
|
492 | - /** |
|
493 | - * This function update extra user blocks data after closing a dashboard block |
|
494 | - * @param int User id |
|
495 | - * @param string plugin path |
|
496 | - * @param integer $user_id |
|
497 | - * @return bool |
|
498 | - */ |
|
499 | - public static function close_user_block($user_id, $path) |
|
475 | + $user_id = intval($user_id); |
|
476 | + $field_variable = 'dashboard'; |
|
477 | + $extra_user_data = UserManager::get_extra_user_data_by_field($user_id, $field_variable); |
|
478 | + $extra_user_data = explode(';',$extra_user_data[$field_variable]); |
|
479 | + $data = array(); |
|
480 | + foreach ($extra_user_data as $extra) { |
|
481 | + $split_extra = explode(':',$extra); |
|
482 | + if (!empty($split_extra)) { |
|
483 | + $block_id = $split_extra[0]; |
|
484 | + $column = isset($split_extra[1]) ? $split_extra[1] : null; |
|
485 | + $data[$block_id] = array('block_id' => $block_id, 'column' => $column); |
|
486 | + } |
|
487 | + } |
|
488 | + |
|
489 | + return $data; |
|
490 | + } |
|
491 | + |
|
492 | + /** |
|
493 | + * This function update extra user blocks data after closing a dashboard block |
|
494 | + * @param int User id |
|
495 | + * @param string plugin path |
|
496 | + * @param integer $user_id |
|
497 | + * @return bool |
|
498 | + */ |
|
499 | + public static function close_user_block($user_id, $path) |
|
500 | 500 | { |
501 | - $enabled_dashboard_blocks = self::get_enabled_dashboard_blocks($path); |
|
502 | - $user_block_data = self::get_user_block_data($user_id); |
|
503 | - |
|
504 | - foreach ($enabled_dashboard_blocks as $enabled_block) { |
|
505 | - unset($user_block_data[$enabled_block['id']]); |
|
506 | - } |
|
507 | - |
|
508 | - // get columns and blocks id for updating extra user data |
|
509 | - $columns = array(); |
|
510 | - $user_blocks_id = array(); |
|
511 | - foreach ($user_block_data as $data) { |
|
512 | - $user_blocks_id[$data['block_id']] = true; |
|
513 | - $columns[$data['block_id']] = $data['column']; |
|
514 | - } |
|
515 | - |
|
516 | - // update extra user blocks data |
|
517 | - $upd_extra_field = self::store_user_blocks($user_id, $user_blocks_id, $columns); |
|
518 | - |
|
519 | - return $upd_extra_field; |
|
520 | - } |
|
521 | - |
|
522 | - /** |
|
523 | - * get links for styles from dashboard plugins |
|
524 | - * @return string links |
|
525 | - */ |
|
526 | - public static function get_links_for_styles_from_dashboard_plugins() { |
|
527 | - |
|
528 | - return '<link rel="stylesheet" href="'.api_get_path(WEB_PLUGIN_PATH).'dashboard/css/default.css" type="text/css" />'.PHP_EOL; |
|
529 | - } |
|
501 | + $enabled_dashboard_blocks = self::get_enabled_dashboard_blocks($path); |
|
502 | + $user_block_data = self::get_user_block_data($user_id); |
|
503 | + |
|
504 | + foreach ($enabled_dashboard_blocks as $enabled_block) { |
|
505 | + unset($user_block_data[$enabled_block['id']]); |
|
506 | + } |
|
507 | + |
|
508 | + // get columns and blocks id for updating extra user data |
|
509 | + $columns = array(); |
|
510 | + $user_blocks_id = array(); |
|
511 | + foreach ($user_block_data as $data) { |
|
512 | + $user_blocks_id[$data['block_id']] = true; |
|
513 | + $columns[$data['block_id']] = $data['column']; |
|
514 | + } |
|
515 | + |
|
516 | + // update extra user blocks data |
|
517 | + $upd_extra_field = self::store_user_blocks($user_id, $user_blocks_id, $columns); |
|
518 | + |
|
519 | + return $upd_extra_field; |
|
520 | + } |
|
521 | + |
|
522 | + /** |
|
523 | + * get links for styles from dashboard plugins |
|
524 | + * @return string links |
|
525 | + */ |
|
526 | + public static function get_links_for_styles_from_dashboard_plugins() { |
|
527 | + |
|
528 | + return '<link rel="stylesheet" href="'.api_get_path(WEB_PLUGIN_PATH).'dashboard/css/default.css" type="text/css" />'.PHP_EOL; |
|
529 | + } |
|
530 | 530 | |
531 | 531 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | // If the mail only need to be send once (we know that thanks to the events.conf), we log it in the table |
126 | 126 | if ($event_config[$event_name]["sending_mail_once"]) { |
127 | - $sql = 'INSERT INTO ' . Database::get_main_table(TABLE_EVENT_SENT) . ' (user_from, user_to, event_type_name) |
|
127 | + $sql = 'INSERT INTO '.Database::get_main_table(TABLE_EVENT_SENT).' (user_from, user_to, event_type_name) |
|
128 | 128 | VALUES ('.$event_data["user_id"].', '.$id.' ,"'.Database::escape_string($event_name).'") |
129 | 129 | '; |
130 | 130 | Database::query($sql); |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | // Second, we send to people linked to the event |
136 | 136 | // So, we get everyone |
137 | 137 | $sql = 'SELECT u.user_id, u.language, u.email, u.firstname, u.lastname |
138 | - FROM ' . Database::get_main_table(TABLE_EVENT_TYPE_REL_USER) . ' ue |
|
138 | + FROM ' . Database::get_main_table(TABLE_EVENT_TYPE_REL_USER).' ue |
|
139 | 139 | INNER JOIN '.Database::get_main_table(TABLE_MAIN_USER).' u ON u.user_id = ue.user_id |
140 | - WHERE event_type_name = "' . $event_name . '"'; |
|
140 | + WHERE event_type_name = "' . $event_name.'"'; |
|
141 | 141 | $result = Database::store_result(Database::query($sql), 'ASSOC'); |
142 | 142 | // for each of the linked users |
143 | 143 | foreach ($result as $key => $value) { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | // If the mail only need to be send once (we know that thanks to the events.conf, we log it in the table |
179 | 179 | if ($event_config[$event_name]["sending_mail_once"]) { |
180 | - $sql = 'INSERT INTO ' . Database::get_main_table(TABLE_EVENT_SENT) . ' |
|
180 | + $sql = 'INSERT INTO '.Database::get_main_table(TABLE_EVENT_SENT).' |
|
181 | 181 | (user_from, user_to, event_type_name) |
182 | 182 | VALUES ('.$event_data["user_id"].', '.$value["user_id"].' , "'.Database::escape_string($event_name).'"); |
183 | 183 | '; |
@@ -202,16 +202,16 @@ discard block |
||
202 | 202 | $current_language = api_get_interface_language(); |
203 | 203 | |
204 | 204 | $sql = 'SELECT COUNT(*) as total |
205 | - FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE) . ' em |
|
206 | - INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE) . ' l |
|
205 | + FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE).' em |
|
206 | + INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE).' l |
|
207 | 207 | ON em.language_id = l.id |
208 | 208 | WHERE |
209 | - em.event_type_name = "' . $event_name . '" and |
|
209 | + em.event_type_name = "' . $event_name.'" and |
|
210 | 210 | l.dokeos_folder = "'.$current_language.'" and |
211 | 211 | em.activated = 1'; |
212 | 212 | |
213 | 213 | $exists = Database::store_result(Database::query($sql), 'ASSOC'); |
214 | - if ($exists[0]["total"]) { |
|
214 | + if ($exists[0]["total"]) { |
|
215 | 215 | return true; |
216 | 216 | } else { |
217 | 217 | return false; |
@@ -228,12 +228,12 @@ discard block |
||
228 | 228 | private static function getMessage($event_name, $language) |
229 | 229 | { |
230 | 230 | $sql = 'SELECT message, subject, l.dokeos_folder |
231 | - FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE) . ' em |
|
232 | - INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE) . ' l |
|
231 | + FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE).' em |
|
232 | + INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE).' l |
|
233 | 233 | ON em.language_id = l.id |
234 | 234 | WHERE |
235 | - em.event_type_name = "' . $event_name . '" AND |
|
236 | - (l.dokeos_folder = "' . $language . '" OR l.dokeos_folder = "english") AND |
|
235 | + em.event_type_name = "' . $event_name.'" AND |
|
236 | + (l.dokeos_folder = "' . $language.'" OR l.dokeos_folder = "english") AND |
|
237 | 237 | em.message <> "" |
238 | 238 | '; |
239 | 239 | return Database::store_result(Database::query($sql), 'ASSOC'); |
@@ -274,8 +274,8 @@ discard block |
||
274 | 274 | private static function formatMessage(&$message, &$subject, $event_config, $event_name, &$event_data) |
275 | 275 | { |
276 | 276 | foreach ($event_config[$event_name]["available_keyvars"] as $key => $word) { |
277 | - $message = str_replace('((' . $key . '))', $event_data[$word], $message); |
|
278 | - $subject = str_replace('((' . $key . '))', $event_data[$word], $subject); |
|
277 | + $message = str_replace('(('.$key.'))', $event_data[$word], $message); |
|
278 | + $subject = str_replace('(('.$key.'))', $event_data[$word], $subject); |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | } |
@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | /** |
13 | 13 | * Constructor |
14 | 14 | */ |
15 | - public function __construct() |
|
15 | + public function __construct() |
|
16 | 16 | { |
17 | 17 | $this->table = Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE); |
18 | - } |
|
18 | + } |
|
19 | 19 | |
20 | 20 | public function get_all($where_conditions = array()) |
21 | 21 | { |
@@ -29,19 +29,19 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * Displays the title + grid |
31 | 31 | */ |
32 | - public function display() |
|
32 | + public function display() |
|
33 | 33 | { |
34 | - // action links |
|
35 | - $content = Display::actions(array( |
|
34 | + // action links |
|
35 | + $content = Display::actions(array( |
|
36 | 36 | array( |
37 | 37 | 'url' => 'event_type.php' , |
38 | 38 | 'content' => Display::return_icon('new_document.png', get_lang('Add'), array(), ICON_SIZE_MEDIUM) |
39 | - ) |
|
39 | + ) |
|
40 | 40 | ) |
41 | 41 | ); |
42 | 42 | $content .= Display::grid_html('event_email_template'); |
43 | 43 | return $content; |
44 | - } |
|
44 | + } |
|
45 | 45 | |
46 | 46 | public function get_status_list() |
47 | 47 | { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | 'Height' => '250', |
83 | 83 | ) |
84 | 84 | ); |
85 | - $status_list = $this->get_status_list(); |
|
85 | + $status_list = $this->get_status_list(); |
|
86 | 86 | $form->addElement('select', 'status', get_lang('Status'), $status_list); |
87 | 87 | if ($action == 'edit') { |
88 | 88 | $form->addElement('text', 'created_at', get_lang('CreatedAt')); |
@@ -99,17 +99,17 @@ discard block |
||
99 | 99 | $defaults = $this->get($id); |
100 | 100 | |
101 | 101 | if (!empty($defaults['created_at'])) { |
102 | - $defaults['created_at'] = api_convert_and_format_date($defaults['created_at']); |
|
102 | + $defaults['created_at'] = api_convert_and_format_date($defaults['created_at']); |
|
103 | 103 | } |
104 | 104 | if (!empty($defaults['updated_at'])) { |
105 | - $defaults['updated_at'] = api_convert_and_format_date($defaults['updated_at']); |
|
105 | + $defaults['updated_at'] = api_convert_and_format_date($defaults['updated_at']); |
|
106 | 106 | } |
107 | 107 | $form->setDefaults($defaults); |
108 | 108 | |
109 | 109 | // Setting the rules |
110 | 110 | $form->addRule('name', get_lang('ThisFieldIsRequired'), 'required'); |
111 | 111 | |
112 | - return $form; |
|
112 | + return $form; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | public function get_count() |
@@ -84,7 +84,7 @@ |
||
84 | 84 | |
85 | 85 | /** |
86 | 86 | * Available driver list. |
87 | - * @return array |
|
87 | + * @return string[] |
|
88 | 88 | */ |
89 | 89 | private function getDefaultDriverList() |
90 | 90 | { |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function __construct() |
16 | 16 | { |
17 | - $this->table = Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE); |
|
17 | + $this->table = Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | // action links |
39 | 39 | $content = Display::actions(array( |
40 | 40 | array( |
41 | - 'url' => 'event_type.php' , |
|
41 | + 'url' => 'event_type.php', |
|
42 | 42 | 'content' => Display::return_icon('new_document.png', get_lang('Add'), array(), ICON_SIZE_MEDIUM) |
43 | 43 | ) |
44 | 44 | ) |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | public function get_count() |
123 | 123 | { |
124 | - $row = Database::select('count(*) as count', $this->table, array(),'first'); |
|
124 | + $row = Database::select('count(*) as count', $this->table, array(), 'first'); |
|
125 | 125 | |
126 | 126 | return $row['count']; |
127 | 127 | } |