@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | // cyu - 01/04/2016: as per eric cantin's advice |
| 7 | -if (elgg_is_active_plugin('gc_fedsearch_gsa') && ((!$gsa_usertest) && strcmp($gsa_agentstring,strtolower($_SERVER['HTTP_USER_AGENT'])) == 0) || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'gsa-crawler') !== false ) { |
|
| 7 | +if (elgg_is_active_plugin('gc_fedsearch_gsa') && ((!$gsa_usertest) && strcmp($gsa_agentstring, strtolower($_SERVER['HTTP_USER_AGENT'])) == 0) || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'gsa-crawler') !== false) { |
|
| 8 | 8 | // do nothing... |
| 9 | 9 | } else { |
| 10 | 10 | $loggedin_user = elgg_get_logged_in_user_entity(); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $title = elgg_echo('blog:archives'); |
| 26 | 26 | $content = '<ul class="blog-archives">'; |
| 27 | 27 | foreach ($dates as $date) { |
| 28 | - $timestamplow = mktime(0, 0, 0, substr($date,4,2) , 1, substr($date, 0, 4)); |
|
| 28 | + $timestamplow = mktime(0, 0, 0, substr($date, 4, 2), 1, substr($date, 0, 4)); |
|
| 29 | 29 | $timestamphigh = mktime(0, 0, 0, ((int) substr($date, 4, 2)) + 1, 1, substr($date, 0, 4)); |
| 30 | 30 | $link = elgg_get_site_url() . $url_segment . '/' . $timestamplow . '/' . $timestamphigh; |
| 31 | 31 | $month = elgg_echo('date:month:' . substr($date, 4, 2), array(substr($date, 0, 4))); |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | |
| 9 | 9 | // cyu - 01/04/2016: as per eric cantin's advice |
| 10 | -if (elgg_is_active_plugin('gc_fedsearch_gsa') && ((!$gsa_usertest) && strcmp($gsa_agentstring,strtolower($_SERVER['HTTP_USER_AGENT'])) == 0) || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'gsa-crawler') !== false ) { |
|
| 10 | +if (elgg_is_active_plugin('gc_fedsearch_gsa') && ((!$gsa_usertest) && strcmp($gsa_agentstring, strtolower($_SERVER['HTTP_USER_AGENT'])) == 0) || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'gsa-crawler') !== false) { |
|
| 11 | 11 | |
| 12 | 12 | } else { |
| 13 | 13 | |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | 'is_trusted' => true, |
| 55 | 55 | )); |
| 56 | 56 | |
| 57 | - $time = "<span class='elgg-subtext'>". elgg_view_friendly_time($blog->time_created) . "</span>"; |
|
| 57 | + $time = "<span class='elgg-subtext'>" . elgg_view_friendly_time($blog->time_created) . "</span>"; |
|
| 58 | 58 | $body .= "<li>$load : $time</li>"; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | foreach ($revisions as $revision) { |
| 62 | - $time = "<span class='elgg-subtext'>". elgg_view_friendly_time($revision->time_created) . "</span>"; |
|
| 62 | + $time = "<span class='elgg-subtext'>" . elgg_view_friendly_time($revision->time_created) . "</span>"; |
|
| 63 | 63 | |
| 64 | 64 | if ($revision->name == 'blog_auto_save') { |
| 65 | 65 | $revision_lang = elgg_echo('blog:auto_saved_revision'); |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | $container = $blog->getContainerEntity(); |
| 28 | 28 | |
| 29 | 29 | |
| 30 | - $return['title'] = gc_explode_translation($blog->title, $lang); |
|
| 30 | + $return['title'] = gc_explode_translation($blog->title, $lang); |
|
| 31 | 31 | |
| 32 | - if (!$container->title){ |
|
| 33 | - $crumbs_title = gc_explode_translation($container->name,$lang); |
|
| 34 | - }else{ |
|
| 35 | - $crumbs_title = gc_explode_translation($container->title,$lang); |
|
| 32 | + if (!$container->title) { |
|
| 33 | + $crumbs_title = gc_explode_translation($container->name, $lang); |
|
| 34 | + } else { |
|
| 35 | + $crumbs_title = gc_explode_translation($container->title, $lang); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | - elgg_push_breadcrumb(gc_explode_translation($blog->title,$lang)); |
|
| 47 | + elgg_push_breadcrumb(gc_explode_translation($blog->title, $lang)); |
|
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | $return['content'] = elgg_view_entity($blog, array('full_view' => true)); |
@@ -192,11 +192,11 @@ discard block |
||
| 192 | 192 | elgg_push_breadcrumb(elgg_echo('blog:archives')); |
| 193 | 193 | |
| 194 | 194 | if ($lower) { |
| 195 | - $lower = (int)$lower; |
|
| 195 | + $lower = (int) $lower; |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | if ($upper) { |
| 199 | - $upper = (int)$upper; |
|
| 199 | + $upper = (int) $upper; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | $options = array( |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $sidebar = ''; |
| 253 | 253 | |
| 254 | 254 | if ($page == 'edit') { |
| 255 | - $blog = get_entity((int)$guid); |
|
| 255 | + $blog = get_entity((int) $guid); |
|
| 256 | 256 | $title = elgg_echo('blog:edit'); |
| 257 | 257 | |
| 258 | 258 | if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) { |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $title .= ": \"$blog->title\""; |
| 261 | 261 | |
| 262 | 262 | if ($revision) { |
| 263 | - $revision = elgg_get_annotation_from_id((int)$revision); |
|
| 263 | + $revision = elgg_get_annotation_from_id((int) $revision); |
|
| 264 | 264 | $vars['revision'] = $revision; |
| 265 | 265 | $title .= ' ' . elgg_echo('blog:edit_revision_notice'); |
| 266 | 266 | |
@@ -13,24 +13,24 @@ |
||
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | $connection = mysqli_connect($read_settings["host"], $read_settings["user"], $read_settings["password"], $read_settings["database"]); |
| 16 | -if (mysqli_connect_errno($connection)) elgg_log("Failed to connect to MySQL: ".mysqli_connect_errno(), 'NOTICE'); |
|
| 17 | -$result = mysqli_query($connection,$query); |
|
| 16 | +if (mysqli_connect_errno($connection)) elgg_log("Failed to connect to MySQL: " . mysqli_connect_errno(), 'NOTICE'); |
|
| 17 | +$result = mysqli_query($connection, $query); |
|
| 18 | 18 | mysqli_close($connection); |
| 19 | 19 | |
| 20 | 20 | $tagging_members = array(); |
| 21 | 21 | while ($row = mysqli_fetch_array($result)) { |
| 22 | 22 | $department = $row['email']; |
| 23 | - $department = explode('@',$department); |
|
| 24 | - $department = explode('.',$department[1]); |
|
| 23 | + $department = explode('@', $department); |
|
| 24 | + $department = explode('.', $department[1]); |
|
| 25 | 25 | $tagging_members[$row['username']] = strtoupper($department[0]); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | $today = date("YmdHis"); |
| 29 | -$data_directory = $CONFIG->dataroot.'gc_dept'.DIRECTORY_SEPARATOR; |
|
| 29 | +$data_directory = $CONFIG->dataroot . 'gc_dept' . DIRECTORY_SEPARATOR; |
|
| 30 | 30 | if (is_array($tagging_members)) { |
| 31 | - error_log('cyu - this is an array to location: '.$data_directory.'tagged_members_'.$today); |
|
| 32 | - $write_as_backup = file_put_contents($data_directory.'tagged_members_'.$today.'.json', json_encode($tagging_members)); |
|
| 31 | + error_log('cyu - this is an array to location: ' . $data_directory . 'tagged_members_' . $today); |
|
| 32 | + $write_as_backup = file_put_contents($data_directory . 'tagged_members_' . $today . '.json', json_encode($tagging_members)); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | -error_log('cyu - write status: '.$write_as_backup.' /// size of array: '.count($tagging_members)); |
|
| 35 | +error_log('cyu - write status: ' . $write_as_backup . ' /// size of array: ' . count($tagging_members)); |
|
| 36 | 36 | forward(REFERER); |
| 37 | 37 | \ No newline at end of file |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | global $CONFIG; |
| 4 | -$data_directory = $CONFIG->dataroot.'gc_dept'.DIRECTORY_SEPARATOR; |
|
| 4 | +$data_directory = $CONFIG->dataroot . 'gc_dept' . DIRECTORY_SEPARATOR; |
|
| 5 | 5 | |
| 6 | -$information_array = json_decode(file_get_contents($data_directory.'department_directory.json')); |
|
| 6 | +$information_array = json_decode(file_get_contents($data_directory . 'department_directory.json')); |
|
| 7 | 7 | $information_array = get_object_vars($information_array); |
| 8 | 8 | |
| 9 | 9 | $last_member = elgg_get_entities(array('types' => 'user', 'limit' => '1')); |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | $connection = mysqli_connect($read_settings["host"], $read_settings["user"], $read_settings["password"], $read_settings["database"]); |
| 25 | - if (mysqli_connect_errno($connection)) elgg_log("cyu - Failed to connect to MySQL: ".mysqli_connect_errno(), 'NOTICE'); |
|
| 26 | - $result = mysqli_query($connection,$query); |
|
| 25 | + if (mysqli_connect_errno($connection)) elgg_log("cyu - Failed to connect to MySQL: " . mysqli_connect_errno(), 'NOTICE'); |
|
| 26 | + $result = mysqli_query($connection, $query); |
|
| 27 | 27 | mysqli_close($connection); |
| 28 | 28 | |
| 29 | 29 | $array_of_users = array(); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $domain = explode('@', strtolower($row['email'])); |
| 33 | 33 | $filter_domain = explode('.', $domain[1]); |
| 34 | - if ($filter_domain[count($filter_domain) - 2].'.'.$filter_domain[count($filter_domain) - 1] === 'gc.ca') |
|
| 34 | + if ($filter_domain[count($filter_domain) - 2] . '.' . $filter_domain[count($filter_domain) - 1] === 'gc.ca') |
|
| 35 | 35 | $array_of_users[$row['guid']] = $filter_domain[0]; |
| 36 | 36 | else |
| 37 | 37 | $array_of_users[$row['guid']] = $domain[1]; |
@@ -50,13 +50,13 @@ discard block |
||
| 50 | 50 | $main_json_file[$value] = array('members' => $main_json_file[$value]); |
| 51 | 51 | } |
| 52 | 52 | $user = get_user($key); |
| 53 | - $tmp_arr = array_merge($main_json_file[$value], array($key => strtolower($user->email).'|'.strtolower($user->username).'|'.$key.'|'.$user->time_created.'|'.$user->name.'|'.$user->getIconURL())); |
|
| 53 | + $tmp_arr = array_merge($main_json_file[$value], array($key => strtolower($user->email) . '|' . strtolower($user->username) . '|' . $key . '|' . $user->time_created . '|' . $user->name . '|' . $user->getIconURL())); |
|
| 54 | 54 | $main_json_file[$value] = $tmp_arr; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $write_to_json = file_put_contents($data_directory.'department_directory.json', json_encode($main_json_file)); |
|
| 57 | + $write_to_json = file_put_contents($data_directory . 'department_directory.json', json_encode($main_json_file)); |
|
| 58 | 58 | $today = date("YmdHis"); |
| 59 | - $write_as_backup = file_put_contents($data_directory.'department_directory_'.$today.'.json', json_encode($main_json_file)); |
|
| 59 | + $write_as_backup = file_put_contents($data_directory . 'department_directory_' . $today . '.json', json_encode($main_json_file)); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | forward(REFERER); |
| 63 | 63 | \ No newline at end of file |
@@ -5,12 +5,12 @@ |
||
| 5 | 5 | |
| 6 | 6 | $site_url = elgg_get_site_url(); |
| 7 | 7 | $jsLocation = $site_url . "mod/wet4/views/default/js/wet-boew.js"; |
| 8 | -$termsLink = $site_url .'terms'; |
|
| 9 | -$frenchLink = $site_url .'login'; |
|
| 10 | -$toggle_lang = $site_url .'mod/toggle_language/action/toggle_language/toggle'; |
|
| 8 | +$termsLink = $site_url . 'terms'; |
|
| 9 | +$frenchLink = $site_url . 'login'; |
|
| 10 | +$toggle_lang = $site_url . 'mod/toggle_language/action/toggle_language/toggle'; |
|
| 11 | 11 | $gccollab_text = elgg_echo('wet:login_welcome'); |
| 12 | 12 | |
| 13 | -if( _elgg_services()->session->get('language') == 'fr'){ |
|
| 13 | +if (_elgg_services()->session->get('language') == 'fr') { |
|
| 14 | 14 | $graphic_lang = 'fr'; |
| 15 | 15 | } else { |
| 16 | 16 | $graphic_lang = 'en'; |
@@ -5,14 +5,14 @@ |
||
| 5 | 5 | |
| 6 | 6 | elgg_register_event_handler('init', 'system', 'splash_collab_init'); |
| 7 | 7 | |
| 8 | -function splash_collab_init(){ |
|
| 8 | +function splash_collab_init() { |
|
| 9 | 9 | |
| 10 | 10 | //Register splash page handler |
| 11 | 11 | elgg_register_page_handler('splash', 'splash_collab_page_handler'); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | //Create splash page |
| 15 | -function splash_collab_page_handler(){ |
|
| 16 | - @include (dirname ( __FILE__ ) . "/pages/splash.php"); |
|
| 15 | +function splash_collab_page_handler() { |
|
| 16 | + @include (dirname(__FILE__) . "/pages/splash.php"); |
|
| 17 | 17 | return true; |
| 18 | 18 | } |
@@ -5,20 +5,20 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | elgg_register_event_handler('init', 'system', 'gc_profile_nudge_init'); |
| 7 | 7 | |
| 8 | -function gc_profile_nudge_init(){ |
|
| 8 | +function gc_profile_nudge_init() { |
|
| 9 | 9 | elgg_register_ajax_view('gc_profile_nudge/profile_nudge'); |
| 10 | 10 | |
| 11 | - if( elgg_is_logged_in() && !elgg_is_admin_logged_in() ){ |
|
| 11 | + if (elgg_is_logged_in() && !elgg_is_admin_logged_in()) { |
|
| 12 | 12 | |
| 13 | 13 | $reminder_time = elgg_get_plugin_setting('reminder_time', 'gc_profile_nudge'); |
| 14 | 14 | |
| 15 | - if( $reminder_time ){ |
|
| 15 | + if ($reminder_time) { |
|
| 16 | 16 | $in_days = $reminder_time * 86400; // 1 day = 86400 seconds |
| 17 | 17 | |
| 18 | 18 | $user = elgg_get_logged_in_user_entity(); |
| 19 | 19 | |
| 20 | 20 | // If user hasn't seen nudge, use their last login date as benchmark |
| 21 | - if( !isset( $user->last_profile_nudge ) ){ |
|
| 21 | + if (!isset($user->last_profile_nudge)) { |
|
| 22 | 22 | $user->last_profile_nudge = (isset($user->prev_last_login) ? $user->prev_last_login : $user->last_login); |
| 23 | 23 | $user->save(); |
| 24 | 24 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $last_profile_nudge = intval($user->last_profile_nudge); |
| 27 | 27 | |
| 28 | 28 | // Show nudge if user hasn't seen in XX days |
| 29 | - if( (time() - $last_profile_nudge) > $in_days ){ |
|
| 29 | + if ((time() - $last_profile_nudge) > $in_days) { |
|
| 30 | 30 | elgg_extend_view('page/elements/foot', 'gc_profile_nudge/include'); |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -9,9 +9,9 @@ |
||
| 9 | 9 | |
| 10 | 10 | echo '<div class="verify-content" style="max-width:600px;">'; |
| 11 | 11 | |
| 12 | -echo '<h1>'. elgg_echo('gc_profile_nudge:title') .'</h1>'; |
|
| 12 | +echo '<h1>' . elgg_echo('gc_profile_nudge:title') . '</h1>'; |
|
| 13 | 13 | |
| 14 | -echo '<p class="mrgn-tp-md mrgn-bttm-md">'. elgg_echo('gc_profile_nudge:text') .'</p>'; |
|
| 14 | +echo '<p class="mrgn-tp-md mrgn-bttm-md">' . elgg_echo('gc_profile_nudge:text') . '</p>'; |
|
| 15 | 15 | |
| 16 | 16 | echo "<p><a class='btn btn-primary' href='" . elgg_get_site_url() . "profile/" . $user->username . "'>" . elgg_echo('gc_profile_nudge:update') . "</a></p>"; |
| 17 | 17 | |