@@ -3,28 +3,28 @@ discard block |
||
| 3 | 3 | elgg_register_event_handler('init', 'system', 'b_extended_profile_collab_init'); |
| 4 | 4 | |
| 5 | 5 | function b_extended_profile_collab_init() { |
| 6 | - // Register the endorsements js library |
|
| 7 | - $url = 'mod/b_extended_profile_collab/js/endorsements/'; |
|
| 8 | - // js file containing code for edit, save, cancel toggles and the events that they trigger, plus more |
|
| 9 | - elgg_register_js('gcconnex-profile', $url . "gcconnex-profile.js"); |
|
| 6 | + // Register the endorsements js library |
|
| 7 | + $url = 'mod/b_extended_profile_collab/js/endorsements/'; |
|
| 8 | + // js file containing code for edit, save, cancel toggles and the events that they trigger, plus more |
|
| 9 | + elgg_register_js('gcconnex-profile', $url . "gcconnex-profile.js"); |
|
| 10 | 10 | |
| 11 | 11 | // register the action for saving profile fields |
| 12 | 12 | $action_path = elgg_get_plugins_path() . 'b_extended_profile_collab/actions/b_extended_profile/'; |
| 13 | 13 | elgg_register_action('b_extended_profile/edit_profile', $action_path . 'edit_profile.php'); |
| 14 | 14 | |
| 15 | 15 | // The new views used for the Opt-In section. |
| 16 | - elgg_register_ajax_view('b_extended_profile/opt-in'); |
|
| 17 | - elgg_register_ajax_view('b_extended_profile/edit_opt-in'); |
|
| 16 | + elgg_register_ajax_view('b_extended_profile/opt-in'); |
|
| 17 | + elgg_register_ajax_view('b_extended_profile/edit_opt-in'); |
|
| 18 | 18 | |
| 19 | - // Register the gcconnex profile css libraries |
|
| 20 | - $css_url = 'mod/b_extended_profile_collab/css/gcconnex-profile.css'; |
|
| 21 | - elgg_register_css('gcconnex-css', $css_url); |
|
| 19 | + // Register the gcconnex profile css libraries |
|
| 20 | + $css_url = 'mod/b_extended_profile_collab/css/gcconnex-profile.css'; |
|
| 21 | + elgg_register_css('gcconnex-css', $css_url); |
|
| 22 | 22 | |
| 23 | - elgg_register_page_handler('email_change_confirmation', 'email_change_confirmation'); |
|
| 23 | + elgg_register_page_handler('email_change_confirmation', 'email_change_confirmation'); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | function email_change_confirmation($page) { |
| 27 | - include elgg_get_plugins_path() . 'b_extended_profile_collab/pages/confirm.php'; |
|
| 27 | + include elgg_get_plugins_path() . 'b_extended_profile_collab/pages/confirm.php'; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -36,17 +36,17 @@ discard block |
||
| 36 | 36 | * @return string|false the validation code or false |
| 37 | 37 | */ |
| 38 | 38 | function generate_email_code(ElggUser $user, $email) { |
| 39 | - if (!($user instanceof ElggUser)) { |
|
| 40 | - return false; |
|
| 41 | - } |
|
| 39 | + if (!($user instanceof ElggUser)) { |
|
| 40 | + return false; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - if (empty($email) && !is_email_address($email)) { |
|
| 44 | - return false; |
|
| 45 | - } |
|
| 43 | + if (empty($email) && !is_email_address($email)) { |
|
| 44 | + return false; |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - $site_secret = get_site_secret(); |
|
| 47 | + $site_secret = get_site_secret(); |
|
| 48 | 48 | |
| 49 | - return hash_hmac('sha256', ($user->getGUID() . '|' . $email . '|' . $user->time_created), $site_secret); |
|
| 49 | + return hash_hmac('sha256', ($user->getGUID() . '|' . $email . '|' . $user->time_created), $site_secret); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -55,67 +55,67 @@ discard block |
||
| 55 | 55 | * @return void |
| 56 | 56 | */ |
| 57 | 57 | function prepare_email_change($user_guid, $email) { |
| 58 | - $user = get_user($user_guid); |
|
| 58 | + $user = get_user($user_guid); |
|
| 59 | 59 | |
| 60 | - if (empty($user) || !is_email_address($email)) { |
|
| 61 | - register_error(elgg_echo('email:save:fail')); |
|
| 62 | - return; |
|
| 63 | - } |
|
| 60 | + if (empty($user) || !is_email_address($email)) { |
|
| 61 | + register_error(elgg_echo('email:save:fail')); |
|
| 62 | + return; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - if (strcmp($email, $user->email) === 0) { |
|
| 66 | - // no change is email address |
|
| 67 | - return; |
|
| 68 | - } |
|
| 65 | + if (strcmp($email, $user->email) === 0) { |
|
| 66 | + // no change is email address |
|
| 67 | + return; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - if (get_user_by_email($email)) { |
|
| 71 | - register_error(elgg_echo('registration:dupeemail')); |
|
| 72 | - return; |
|
| 73 | - } |
|
| 70 | + if (get_user_by_email($email)) { |
|
| 71 | + register_error(elgg_echo('registration:dupeemail')); |
|
| 72 | + return; |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - // generate validation code |
|
| 76 | - $validation_code = generate_email_code($user, $email); |
|
| 77 | - if (empty($validation_code)) { |
|
| 78 | - return; |
|
| 79 | - } |
|
| 80 | - $site = elgg_get_site_entity(); |
|
| 81 | - $current_email = $user->email; |
|
| 75 | + // generate validation code |
|
| 76 | + $validation_code = generate_email_code($user, $email); |
|
| 77 | + if (empty($validation_code)) { |
|
| 78 | + return; |
|
| 79 | + } |
|
| 80 | + $site = elgg_get_site_entity(); |
|
| 81 | + $current_email = $user->email; |
|
| 82 | 82 | |
| 83 | - // make sure notification goes to new email |
|
| 84 | - $user->email = $email; |
|
| 85 | - $user->save(); |
|
| 83 | + // make sure notification goes to new email |
|
| 84 | + $user->email = $email; |
|
| 85 | + $user->save(); |
|
| 86 | 86 | |
| 87 | - // build notification |
|
| 88 | - $validation_url = elgg_normalize_url(elgg_http_add_url_query_elements('email_change_confirmation', array( |
|
| 89 | - 'u' => $user->getGUID(), |
|
| 90 | - 'c' => $validation_code, |
|
| 91 | - ))); |
|
| 87 | + // build notification |
|
| 88 | + $validation_url = elgg_normalize_url(elgg_http_add_url_query_elements('email_change_confirmation', array( |
|
| 89 | + 'u' => $user->getGUID(), |
|
| 90 | + 'c' => $validation_code, |
|
| 91 | + ))); |
|
| 92 | 92 | |
| 93 | - $subject = elgg_echo('email_change_confirmation:request:subject', array($site->name), 'en') . " | " . elgg_echo('email_change_confirmation:request:subject', array($site->name), 'fr'); |
|
| 94 | - $message = elgg_echo('email_change_confirmation:request:message', array( |
|
| 95 | - $user->name, |
|
| 96 | - $site->name, |
|
| 97 | - $validation_url, |
|
| 98 | - )); |
|
| 93 | + $subject = elgg_echo('email_change_confirmation:request:subject', array($site->name), 'en') . " | " . elgg_echo('email_change_confirmation:request:subject', array($site->name), 'fr'); |
|
| 94 | + $message = elgg_echo('email_change_confirmation:request:message', array( |
|
| 95 | + $user->name, |
|
| 96 | + $site->name, |
|
| 97 | + $validation_url, |
|
| 98 | + )); |
|
| 99 | 99 | |
| 100 | - if( elgg_is_active_plugin('cp_notifications') ){ |
|
| 101 | - $message = elgg_view('cp_notifications/site_template', array("cp_msg_title_en" => $subject, "cp_msg_title_fr" => elgg_echo('email_change_confirmation:request:subject', array($site->name), 'fr'), "cp_msg_description_en" => $message, "cp_msg_description_fr" => elgg_echo('email_change_confirmation:request:message', array($user->name, $site->name, $validation_url), 'fr'))); |
|
| 102 | - } |
|
| 100 | + if( elgg_is_active_plugin('cp_notifications') ){ |
|
| 101 | + $message = elgg_view('cp_notifications/site_template', array("cp_msg_title_en" => $subject, "cp_msg_title_fr" => elgg_echo('email_change_confirmation:request:subject', array($site->name), 'fr'), "cp_msg_description_en" => $message, "cp_msg_description_fr" => elgg_echo('email_change_confirmation:request:message', array($user->name, $site->name, $validation_url), 'fr'))); |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - if( elgg_is_active_plugin('phpmailer') ){ |
|
| 105 | - phpmailer_send($user->email, $user->name, $subject, $message); |
|
| 106 | - } else { |
|
| 107 | - mail($user->email, $subject, $message, cp_get_headers()); |
|
| 108 | - } |
|
| 104 | + if( elgg_is_active_plugin('phpmailer') ){ |
|
| 105 | + phpmailer_send($user->email, $user->name, $subject, $message); |
|
| 106 | + } else { |
|
| 107 | + mail($user->email, $subject, $message, cp_get_headers()); |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | - // save the validation request |
|
| 111 | - // but first revoke previous request |
|
| 112 | - $user->deleteAnnotations('email_change_confirmation'); |
|
| 110 | + // save the validation request |
|
| 111 | + // but first revoke previous request |
|
| 112 | + $user->deleteAnnotations('email_change_confirmation'); |
|
| 113 | 113 | |
| 114 | - $user->annotate('email_change_confirmation', $email, ACCESS_PRIVATE, $user->getGUID()); |
|
| 114 | + $user->annotate('email_change_confirmation', $email, ACCESS_PRIVATE, $user->getGUID()); |
|
| 115 | 115 | |
| 116 | - // restore current email address |
|
| 117 | - $user->email = $current_email; |
|
| 118 | - $user->save(); |
|
| 116 | + // restore current email address |
|
| 117 | + $user->email = $current_email; |
|
| 118 | + $user->save(); |
|
| 119 | 119 | |
| 120 | - system_message(elgg_echo('email_change_confirmation:request', array($email))); |
|
| 120 | + system_message(elgg_echo('email_change_confirmation:request', array($email))); |
|
| 121 | 121 | } |
@@ -22,61 +22,61 @@ discard block |
||
| 22 | 22 | echo '<div class="gcconnex-profile-name">'; |
| 23 | 23 | //edit button |
| 24 | 24 | if ($user->canEdit()) { |
| 25 | - echo '<a role="button" class="btn btn-primary gcconnex-edit-profile overlay-lnk" href="#editProfile">' . elgg_echo('gcconnex_profile:edit_profile') . ' <span class="wb-inv">' . elgg_echo('profile:contactinfo') . '</span></a><script>$(".gcconnex-edit-profile").on("click", function(){ $("#editProfile").focus(); });</script>'; |
|
| 26 | - echo '<!-- Modal --> |
|
| 25 | + echo '<a role="button" class="btn btn-primary gcconnex-edit-profile overlay-lnk" href="#editProfile">' . elgg_echo('gcconnex_profile:edit_profile') . ' <span class="wb-inv">' . elgg_echo('profile:contactinfo') . '</span></a><script>$(".gcconnex-edit-profile").on("click", function(){ $("#editProfile").focus(); });</script>'; |
|
| 26 | + echo '<!-- Modal --> |
|
| 27 | 27 | <div id="editProfile" class="wb-overlay modal-content overlay-def wb-popup-mid" tabindex="-1"> |
| 28 | 28 | <div class=""> |
| 29 | 29 | <div class=""> |
| 30 | 30 | <header class="modal-header profile-edit-header">'; |
| 31 | - echo '<h2 class="modal-title">' . elgg_echo('gcconnex_profile:basic:header') . '</h2>'; |
|
| 32 | - echo '</header>'; |
|
| 33 | - echo '<div class="panel-body overflow-body" style="padding-top: 15px; padding-bottom: 0;">'; |
|
| 34 | - echo '<div class="basic-profile-standard-field-wrapper col-md-6 col-xs-12">'; // container for css styling, used to group profile content and display them seperately from other fields |
|
| 31 | + echo '<h2 class="modal-title">' . elgg_echo('gcconnex_profile:basic:header') . '</h2>'; |
|
| 32 | + echo '</header>'; |
|
| 33 | + echo '<div class="panel-body overflow-body" style="padding-top: 15px; padding-bottom: 0;">'; |
|
| 34 | + echo '<div class="basic-profile-standard-field-wrapper col-md-6 col-xs-12">'; // container for css styling, used to group profile content and display them seperately from other fields |
|
| 35 | 35 | |
| 36 | - $fields = array('Name', 'user_type', 'Federal', 'Provincial', 'Institution', 'University', 'College', 'Highschool', 'Municipal', 'International', 'NGO', 'Community', 'Business', 'Media', 'Retired', 'Other', 'Job', 'Location', 'Phone', 'Mobile', 'Email', 'Website'); |
|
| 36 | + $fields = array('Name', 'user_type', 'Federal', 'Provincial', 'Institution', 'University', 'College', 'Highschool', 'Municipal', 'International', 'NGO', 'Community', 'Business', 'Media', 'Retired', 'Other', 'Job', 'Location', 'Phone', 'Mobile', 'Email', 'Website'); |
|
| 37 | 37 | |
| 38 | - foreach ($fields as $field) { |
|
| 38 | + foreach ($fields as $field) { |
|
| 39 | 39 | |
| 40 | - // create a label and input box for each field on the basic profile (see $fields above) |
|
| 41 | - $field = strtolower($field); |
|
| 42 | - $value = htmlspecialchars_decode($user->get($field)); |
|
| 40 | + // create a label and input box for each field on the basic profile (see $fields above) |
|
| 41 | + $field = strtolower($field); |
|
| 42 | + $value = htmlspecialchars_decode($user->get($field)); |
|
| 43 | 43 | |
| 44 | - if(in_array($field, array("federal", "institution", "provincial", "municipal", "international", "ngo", "community", "business", "media", "retired", "other"))) { |
|
| 45 | - echo "<div class='form-group col-xs-12 occupation-choices' id='{$field}-wrapper'>"; |
|
| 46 | - } else if(in_array($field, array("university", "college", "highschool"))) { |
|
| 47 | - echo "<div class='form-group col-xs-12 occupation-choices student-choices' id='{$field}-wrapper'>"; |
|
| 48 | - } else { |
|
| 49 | - echo "<div class='form-group col-xs-12 {$field}'>"; |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - // occupation input |
|
| 53 | - if (strcmp($field, 'user_type') == 0) { |
|
| 44 | + if(in_array($field, array("federal", "institution", "provincial", "municipal", "international", "ngo", "community", "business", "media", "retired", "other"))) { |
|
| 45 | + echo "<div class='form-group col-xs-12 occupation-choices' id='{$field}-wrapper'>"; |
|
| 46 | + } else if(in_array($field, array("university", "college", "highschool"))) { |
|
| 47 | + echo "<div class='form-group col-xs-12 occupation-choices student-choices' id='{$field}-wrapper'>"; |
|
| 48 | + } else { |
|
| 49 | + echo "<div class='form-group col-xs-12 {$field}'>"; |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + // occupation input |
|
| 53 | + if (strcmp($field, 'user_type') == 0) { |
|
| 54 | 54 | |
| 55 | - echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 56 | - echo '<div class="col-sm-8">'; |
|
| 57 | - echo elgg_view('input/select', array( |
|
| 58 | - 'name' => $field, |
|
| 59 | - 'id' => $field, |
|
| 60 | - 'class' => "gcconnex-basic-{$field}", |
|
| 61 | - 'value' => $value, |
|
| 62 | - 'options_values' => array( |
|
| 63 | - 'academic' => elgg_echo('gcconnex-profile-card:academic'), |
|
| 64 | - 'student' => elgg_echo('gcconnex-profile-card:student'), |
|
| 65 | - 'federal' => elgg_echo('gcconnex-profile-card:federal'), |
|
| 66 | - 'provincial' => elgg_echo('gcconnex-profile-card:provincial'), |
|
| 67 | - 'municipal' => elgg_echo('gcconnex-profile-card:municipal'), |
|
| 68 | - 'international' => elgg_echo('gcconnex-profile-card:international'), |
|
| 69 | - 'ngo' => elgg_echo('gcconnex-profile-card:ngo'), |
|
| 70 | - 'community' => elgg_echo('gcconnex-profile-card:community'), |
|
| 71 | - 'business' => elgg_echo('gcconnex-profile-card:business'), |
|
| 72 | - 'media' => elgg_echo('gcconnex-profile-card:media'), |
|
| 73 | - 'retired' => elgg_echo('gcconnex-profile-card:retired'), |
|
| 74 | - 'other' => elgg_echo('gcconnex-profile-card:other') |
|
| 75 | - ), |
|
| 76 | - )); |
|
| 77 | - |
|
| 78 | - // jquery for the occupation dropdown - institution |
|
| 79 | - ?> |
|
| 55 | + echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 56 | + echo '<div class="col-sm-8">'; |
|
| 57 | + echo elgg_view('input/select', array( |
|
| 58 | + 'name' => $field, |
|
| 59 | + 'id' => $field, |
|
| 60 | + 'class' => "gcconnex-basic-{$field}", |
|
| 61 | + 'value' => $value, |
|
| 62 | + 'options_values' => array( |
|
| 63 | + 'academic' => elgg_echo('gcconnex-profile-card:academic'), |
|
| 64 | + 'student' => elgg_echo('gcconnex-profile-card:student'), |
|
| 65 | + 'federal' => elgg_echo('gcconnex-profile-card:federal'), |
|
| 66 | + 'provincial' => elgg_echo('gcconnex-profile-card:provincial'), |
|
| 67 | + 'municipal' => elgg_echo('gcconnex-profile-card:municipal'), |
|
| 68 | + 'international' => elgg_echo('gcconnex-profile-card:international'), |
|
| 69 | + 'ngo' => elgg_echo('gcconnex-profile-card:ngo'), |
|
| 70 | + 'community' => elgg_echo('gcconnex-profile-card:community'), |
|
| 71 | + 'business' => elgg_echo('gcconnex-profile-card:business'), |
|
| 72 | + 'media' => elgg_echo('gcconnex-profile-card:media'), |
|
| 73 | + 'retired' => elgg_echo('gcconnex-profile-card:retired'), |
|
| 74 | + 'other' => elgg_echo('gcconnex-profile-card:other') |
|
| 75 | + ), |
|
| 76 | + )); |
|
| 77 | + |
|
| 78 | + // jquery for the occupation dropdown - institution |
|
| 79 | + ?> |
|
| 80 | 80 | |
| 81 | 81 | <script> |
| 82 | 82 | $(document).ready(function () { |
@@ -141,337 +141,337 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | <?php |
| 143 | 143 | |
| 144 | - // federal input field |
|
| 145 | - } else if ($field == 'federal') { |
|
| 144 | + // federal input field |
|
| 145 | + } else if ($field == 'federal') { |
|
| 146 | 146 | |
| 147 | - echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 148 | - echo '<div class="col-sm-8">'; |
|
| 147 | + echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 148 | + echo '<div class="col-sm-8">'; |
|
| 149 | 149 | |
| 150 | - $obj = elgg_get_entities(array( |
|
| 151 | - 'type' => 'object', |
|
| 152 | - 'subtype' => 'federal_departments', |
|
| 153 | - )); |
|
| 154 | - $departments = get_entity($obj[0]->guid); |
|
| 150 | + $obj = elgg_get_entities(array( |
|
| 151 | + 'type' => 'object', |
|
| 152 | + 'subtype' => 'federal_departments', |
|
| 153 | + )); |
|
| 154 | + $departments = get_entity($obj[0]->guid); |
|
| 155 | 155 | |
| 156 | - $federal_departments = array(); |
|
| 157 | - if (get_current_language() == 'en'){ |
|
| 158 | - $federal_departments = json_decode($departments->federal_departments_en, true); |
|
| 159 | - } else { |
|
| 160 | - $federal_departments = json_decode($departments->federal_departments_fr, true); |
|
| 161 | - } |
|
| 162 | - |
|
| 163 | - echo elgg_view('input/select', array( |
|
| 164 | - 'name' => $field, |
|
| 165 | - 'id' => $field, |
|
| 166 | - 'class' => ' gcconnex-basic-' . $field, |
|
| 167 | - 'value' => $value, |
|
| 168 | - 'options_values' => $federal_departments, |
|
| 169 | - )); |
|
| 156 | + $federal_departments = array(); |
|
| 157 | + if (get_current_language() == 'en'){ |
|
| 158 | + $federal_departments = json_decode($departments->federal_departments_en, true); |
|
| 159 | + } else { |
|
| 160 | + $federal_departments = json_decode($departments->federal_departments_fr, true); |
|
| 161 | + } |
|
| 162 | + |
|
| 163 | + echo elgg_view('input/select', array( |
|
| 164 | + 'name' => $field, |
|
| 165 | + 'id' => $field, |
|
| 166 | + 'class' => ' gcconnex-basic-' . $field, |
|
| 167 | + 'value' => $value, |
|
| 168 | + 'options_values' => $federal_departments, |
|
| 169 | + )); |
|
| 170 | 170 | |
| 171 | - } else if (strcmp($field, 'institution') == 0) { |
|
| 172 | - |
|
| 173 | - echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 174 | - echo '<div class="col-sm-8">'; |
|
| 175 | - |
|
| 176 | - $institution_list = array("university" => elgg_echo('gcconnex-profile-card:university'), "college" => elgg_echo('gcconnex-profile-card:college'), "highschool" => elgg_echo('gcconnex-profile-card:highschool')); |
|
| 177 | - |
|
| 178 | - echo elgg_view('input/select', array( |
|
| 179 | - 'name' => $field, |
|
| 180 | - 'id' => $field, |
|
| 181 | - 'class' => "gcconnex-basic-{$field}", |
|
| 182 | - 'value' => $value, |
|
| 183 | - 'options_values' => $institution_list, |
|
| 184 | - )); |
|
| 185 | - |
|
| 186 | - } else if (strcmp($field, 'university') == 0) { |
|
| 187 | - |
|
| 188 | - echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 189 | - echo '<div class="col-sm-8">'; |
|
| 190 | - |
|
| 191 | - $uniObj = elgg_get_entities(array( |
|
| 192 | - 'type' => 'object', |
|
| 193 | - 'subtype' => 'universities', |
|
| 194 | - )); |
|
| 195 | - $unis = get_entity($uniObj[0]->guid); |
|
| 196 | - |
|
| 197 | - $universities = array(); |
|
| 198 | - if (get_current_language() == 'en'){ |
|
| 199 | - $universities = json_decode($unis->universities_en, true); |
|
| 200 | - } else { |
|
| 201 | - $universities = json_decode($unis->universities_fr, true); |
|
| 202 | - } |
|
| 203 | - |
|
| 204 | - echo elgg_view('input/select', array( |
|
| 205 | - 'name' => $field, |
|
| 206 | - 'id' => $field, |
|
| 207 | - 'class' => "gcconnex-basic-{$field}", |
|
| 208 | - 'value' => $value, |
|
| 209 | - 'options_values' => $universities, |
|
| 210 | - )); |
|
| 211 | - |
|
| 212 | - } else if (strcmp($field, 'college') == 0) { |
|
| 213 | - |
|
| 214 | - echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 215 | - echo '<div class="col-sm-8">'; |
|
| 216 | - |
|
| 217 | - $colObj = elgg_get_entities(array( |
|
| 218 | - 'type' => 'object', |
|
| 219 | - 'subtype' => 'colleges', |
|
| 220 | - )); |
|
| 221 | - $cols = get_entity($colObj[0]->guid); |
|
| 222 | - |
|
| 223 | - $colleges = array(); |
|
| 224 | - if (get_current_language() == 'en'){ |
|
| 225 | - $colleges = json_decode($cols->colleges_en, true); |
|
| 226 | - } else { |
|
| 227 | - $colleges = json_decode($cols->colleges_fr, true); |
|
| 228 | - } |
|
| 229 | - |
|
| 230 | - echo elgg_view('input/select', array( |
|
| 231 | - 'name' => $field, |
|
| 232 | - 'id' => $field, |
|
| 233 | - 'class' => "gcconnex-basic-{$field}", |
|
| 234 | - 'value' => $value, |
|
| 235 | - 'options_values' => $colleges, |
|
| 236 | - )); |
|
| 237 | - |
|
| 238 | - // provincial input field |
|
| 239 | - } else if ($field == 'provincial') { |
|
| 240 | - |
|
| 241 | - echo "<label for='{$field}' class='col-sm-4 {$field}'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 242 | - echo '<div class="col-sm-8">'; |
|
| 243 | - |
|
| 244 | - $provObj = elgg_get_entities(array( |
|
| 245 | - 'type' => 'object', |
|
| 246 | - 'subtype' => 'provinces', |
|
| 247 | - )); |
|
| 248 | - $provs = get_entity($provObj[0]->guid); |
|
| 249 | - |
|
| 250 | - $provincial_departments = array(); |
|
| 251 | - if (get_current_language() == 'en'){ |
|
| 252 | - $provincial_departments = json_decode($provs->provinces_en, true); |
|
| 253 | - } else { |
|
| 254 | - $provincial_departments = json_decode($provs->provinces_fr, true); |
|
| 255 | - } |
|
| 256 | - |
|
| 257 | - echo elgg_view('input/select', array( |
|
| 258 | - 'name' => $field, |
|
| 259 | - 'id' => $field, |
|
| 260 | - 'class' => ' gcconnex-basic-' . $field, |
|
| 261 | - 'value' => $value, |
|
| 262 | - 'options_values' => $provincial_departments, |
|
| 263 | - )); |
|
| 264 | - |
|
| 265 | - echo "</div></div>"; |
|
| 266 | - |
|
| 267 | - $minObj = elgg_get_entities(array( |
|
| 268 | - 'type' => 'object', |
|
| 269 | - 'subtype' => 'ministries', |
|
| 270 | - )); |
|
| 271 | - $mins = get_entity($minObj[0]->guid); |
|
| 272 | - |
|
| 273 | - $ministries = array(); |
|
| 274 | - if (get_current_language() == 'en'){ |
|
| 275 | - $ministries = json_decode($mins->ministries_en, true); |
|
| 276 | - } else { |
|
| 277 | - $ministries = json_decode($mins->ministries_fr, true); |
|
| 278 | - } |
|
| 279 | - |
|
| 280 | - foreach($provincial_departments as $province => $name){ |
|
| 281 | - $prov_value = ($user->get('provincial') == $province) ? $user->get('ministry'): ""; |
|
| 282 | - $prov_id = str_replace(" ", "-", strtolower($province)); |
|
| 283 | - echo '<div class="form-group col-xs-12 occupation-choices provincial-choices" id="' . $prov_id . '-wrapper"><label for="' . $prov_id . '-choices" class="col-sm-4">' . elgg_echo('gcconnex_profile:basic:ministry') . '</label><div class="col-sm-8">'; |
|
| 284 | - echo elgg_view('input/select', array( |
|
| 285 | - 'name' => 'ministry', |
|
| 286 | - 'id' => $prov_id . '-choices', |
|
| 287 | - 'class' => 'form-control gcconnex-basic-ministry', |
|
| 288 | - 'value' => $prov_value, |
|
| 289 | - 'options_values' => $ministries[$province], |
|
| 290 | - )); |
|
| 291 | - if($province != "Yukon"){ echo '</div></div>'; } |
|
| 292 | - } |
|
| 171 | + } else if (strcmp($field, 'institution') == 0) { |
|
| 172 | + |
|
| 173 | + echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 174 | + echo '<div class="col-sm-8">'; |
|
| 175 | + |
|
| 176 | + $institution_list = array("university" => elgg_echo('gcconnex-profile-card:university'), "college" => elgg_echo('gcconnex-profile-card:college'), "highschool" => elgg_echo('gcconnex-profile-card:highschool')); |
|
| 177 | + |
|
| 178 | + echo elgg_view('input/select', array( |
|
| 179 | + 'name' => $field, |
|
| 180 | + 'id' => $field, |
|
| 181 | + 'class' => "gcconnex-basic-{$field}", |
|
| 182 | + 'value' => $value, |
|
| 183 | + 'options_values' => $institution_list, |
|
| 184 | + )); |
|
| 185 | + |
|
| 186 | + } else if (strcmp($field, 'university') == 0) { |
|
| 187 | + |
|
| 188 | + echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 189 | + echo '<div class="col-sm-8">'; |
|
| 190 | + |
|
| 191 | + $uniObj = elgg_get_entities(array( |
|
| 192 | + 'type' => 'object', |
|
| 193 | + 'subtype' => 'universities', |
|
| 194 | + )); |
|
| 195 | + $unis = get_entity($uniObj[0]->guid); |
|
| 196 | + |
|
| 197 | + $universities = array(); |
|
| 198 | + if (get_current_language() == 'en'){ |
|
| 199 | + $universities = json_decode($unis->universities_en, true); |
|
| 200 | + } else { |
|
| 201 | + $universities = json_decode($unis->universities_fr, true); |
|
| 202 | + } |
|
| 203 | + |
|
| 204 | + echo elgg_view('input/select', array( |
|
| 205 | + 'name' => $field, |
|
| 206 | + 'id' => $field, |
|
| 207 | + 'class' => "gcconnex-basic-{$field}", |
|
| 208 | + 'value' => $value, |
|
| 209 | + 'options_values' => $universities, |
|
| 210 | + )); |
|
| 211 | + |
|
| 212 | + } else if (strcmp($field, 'college') == 0) { |
|
| 213 | + |
|
| 214 | + echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 215 | + echo '<div class="col-sm-8">'; |
|
| 216 | + |
|
| 217 | + $colObj = elgg_get_entities(array( |
|
| 218 | + 'type' => 'object', |
|
| 219 | + 'subtype' => 'colleges', |
|
| 220 | + )); |
|
| 221 | + $cols = get_entity($colObj[0]->guid); |
|
| 222 | + |
|
| 223 | + $colleges = array(); |
|
| 224 | + if (get_current_language() == 'en'){ |
|
| 225 | + $colleges = json_decode($cols->colleges_en, true); |
|
| 226 | + } else { |
|
| 227 | + $colleges = json_decode($cols->colleges_fr, true); |
|
| 228 | + } |
|
| 229 | + |
|
| 230 | + echo elgg_view('input/select', array( |
|
| 231 | + 'name' => $field, |
|
| 232 | + 'id' => $field, |
|
| 233 | + 'class' => "gcconnex-basic-{$field}", |
|
| 234 | + 'value' => $value, |
|
| 235 | + 'options_values' => $colleges, |
|
| 236 | + )); |
|
| 237 | + |
|
| 238 | + // provincial input field |
|
| 239 | + } else if ($field == 'provincial') { |
|
| 240 | + |
|
| 241 | + echo "<label for='{$field}' class='col-sm-4 {$field}'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 242 | + echo '<div class="col-sm-8">'; |
|
| 243 | + |
|
| 244 | + $provObj = elgg_get_entities(array( |
|
| 245 | + 'type' => 'object', |
|
| 246 | + 'subtype' => 'provinces', |
|
| 247 | + )); |
|
| 248 | + $provs = get_entity($provObj[0]->guid); |
|
| 249 | + |
|
| 250 | + $provincial_departments = array(); |
|
| 251 | + if (get_current_language() == 'en'){ |
|
| 252 | + $provincial_departments = json_decode($provs->provinces_en, true); |
|
| 253 | + } else { |
|
| 254 | + $provincial_departments = json_decode($provs->provinces_fr, true); |
|
| 255 | + } |
|
| 256 | + |
|
| 257 | + echo elgg_view('input/select', array( |
|
| 258 | + 'name' => $field, |
|
| 259 | + 'id' => $field, |
|
| 260 | + 'class' => ' gcconnex-basic-' . $field, |
|
| 261 | + 'value' => $value, |
|
| 262 | + 'options_values' => $provincial_departments, |
|
| 263 | + )); |
|
| 264 | + |
|
| 265 | + echo "</div></div>"; |
|
| 266 | + |
|
| 267 | + $minObj = elgg_get_entities(array( |
|
| 268 | + 'type' => 'object', |
|
| 269 | + 'subtype' => 'ministries', |
|
| 270 | + )); |
|
| 271 | + $mins = get_entity($minObj[0]->guid); |
|
| 272 | + |
|
| 273 | + $ministries = array(); |
|
| 274 | + if (get_current_language() == 'en'){ |
|
| 275 | + $ministries = json_decode($mins->ministries_en, true); |
|
| 276 | + } else { |
|
| 277 | + $ministries = json_decode($mins->ministries_fr, true); |
|
| 278 | + } |
|
| 279 | + |
|
| 280 | + foreach($provincial_departments as $province => $name){ |
|
| 281 | + $prov_value = ($user->get('provincial') == $province) ? $user->get('ministry'): ""; |
|
| 282 | + $prov_id = str_replace(" ", "-", strtolower($province)); |
|
| 283 | + echo '<div class="form-group col-xs-12 occupation-choices provincial-choices" id="' . $prov_id . '-wrapper"><label for="' . $prov_id . '-choices" class="col-sm-4">' . elgg_echo('gcconnex_profile:basic:ministry') . '</label><div class="col-sm-8">'; |
|
| 284 | + echo elgg_view('input/select', array( |
|
| 285 | + 'name' => 'ministry', |
|
| 286 | + 'id' => $prov_id . '-choices', |
|
| 287 | + 'class' => 'form-control gcconnex-basic-ministry', |
|
| 288 | + 'value' => $prov_value, |
|
| 289 | + 'options_values' => $ministries[$province], |
|
| 290 | + )); |
|
| 291 | + if($province != "Yukon"){ echo '</div></div>'; } |
|
| 292 | + } |
|
| 293 | 293 | |
| 294 | - } else if (strcmp($field, 'municipal') == 0) { |
|
| 295 | - |
|
| 296 | - echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 297 | - echo '<div class="col-sm-8">'; |
|
| 298 | - |
|
| 299 | - $munObj = elgg_get_entities(array( |
|
| 300 | - 'type' => 'object', |
|
| 301 | - 'subtype' => 'municipal', |
|
| 302 | - )); |
|
| 303 | - $municipals = get_entity($munObj[0]->guid); |
|
| 304 | - |
|
| 305 | - $municipal = array(); |
|
| 306 | - if (get_current_language() == 'en'){ |
|
| 307 | - $municipal = json_decode($municipals->other_en, true); |
|
| 308 | - } else { |
|
| 309 | - $municipal = json_decode($municipals->other_fr, true); |
|
| 310 | - } |
|
| 311 | - |
|
| 312 | - echo elgg_view('input/text', array( |
|
| 313 | - 'name' => $field, |
|
| 314 | - 'id' => $field, |
|
| 315 | - 'class' => "gcconnex-basic-{$field}", |
|
| 316 | - 'value' => $value, |
|
| 317 | - 'list' => $field . '-list' |
|
| 318 | - )); |
|
| 319 | - |
|
| 320 | - echo '<datalist id="municipal-list">'; |
|
| 321 | - if( !empty($municipal) ){ |
|
| 322 | - foreach($municipal as $municipal_name => $value){ |
|
| 323 | - echo '<option value="' . $municipal_name . '">' . $value . '</option>'; |
|
| 324 | - } |
|
| 325 | - } |
|
| 326 | - echo '</datalist>'; |
|
| 327 | - |
|
| 328 | - } else if (strcmp($field, 'retired') == 0) { |
|
| 329 | - |
|
| 330 | - echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 331 | - echo '<div class="col-sm-8">'; |
|
| 332 | - |
|
| 333 | - $deptObj = elgg_get_entities(array( |
|
| 334 | - 'type' => 'object', |
|
| 335 | - 'subtype' => 'federal_departments', |
|
| 336 | - )); |
|
| 337 | - $depts = get_entity($deptObj[0]->guid); |
|
| 338 | - |
|
| 339 | - $federal_departments = array(); |
|
| 340 | - if (get_current_language() == 'en'){ |
|
| 341 | - $federal_departments = json_decode($depts->federal_departments_en, true); |
|
| 342 | - } else { |
|
| 343 | - $federal_departments = json_decode($depts->federal_departments_fr, true); |
|
| 344 | - } |
|
| 345 | - |
|
| 346 | - echo elgg_view('input/text', array( |
|
| 347 | - 'name' => $field, |
|
| 348 | - 'id' => $field, |
|
| 349 | - 'class' => "gcconnex-basic-{$field}", |
|
| 350 | - 'value' => $value, |
|
| 351 | - 'list' => $field . '-list' |
|
| 352 | - )); |
|
| 353 | - |
|
| 354 | - echo '<datalist id="retired-list">'; |
|
| 355 | - if( !empty($federal_departments) ){ |
|
| 356 | - foreach($federal_departments as $federal_name => $value){ |
|
| 357 | - echo '<option value="' . $federal_name . '">' . $value . '</option>'; |
|
| 358 | - } |
|
| 359 | - } |
|
| 360 | - echo '</datalist>'; |
|
| 361 | - |
|
| 362 | - } else if (strcmp($field, 'other') == 0) { |
|
| 363 | - |
|
| 364 | - echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 365 | - echo '<div class="col-sm-8">'; |
|
| 366 | - |
|
| 367 | - $otherObj = elgg_get_entities(array( |
|
| 368 | - 'type' => 'object', |
|
| 369 | - 'subtype' => 'other', |
|
| 370 | - )); |
|
| 371 | - $others = get_entity($otherObj[0]->guid); |
|
| 372 | - |
|
| 373 | - $other = array(); |
|
| 374 | - if (get_current_language() == 'en'){ |
|
| 375 | - $other = json_decode($others->other_en, true); |
|
| 376 | - } else { |
|
| 377 | - $other = json_decode($others->other_fr, true); |
|
| 378 | - } |
|
| 379 | - |
|
| 380 | - echo elgg_view('input/text', array( |
|
| 381 | - 'name' => $field, |
|
| 382 | - 'id' => $field, |
|
| 383 | - 'class' => "gcconnex-basic-{$field}", |
|
| 384 | - 'value' => $value, |
|
| 385 | - 'list' => $field . '-list' |
|
| 386 | - )); |
|
| 387 | - |
|
| 388 | - echo '<datalist id="other-list">'; |
|
| 389 | - if( !empty($other) ){ |
|
| 390 | - foreach($other as $other_name => $value){ |
|
| 391 | - echo '<option value="' . $other_name . '">' . $value . '</option>'; |
|
| 392 | - } |
|
| 393 | - } |
|
| 394 | - echo '</datalist>'; |
|
| 395 | - |
|
| 396 | - } else { |
|
| 397 | - |
|
| 398 | - $params = array( |
|
| 399 | - 'name' => $field, |
|
| 400 | - 'id' => $field, |
|
| 401 | - 'class' => 'gcconnex-basic-'.$field, |
|
| 402 | - 'value' => $value, |
|
| 403 | - ); |
|
| 404 | - |
|
| 405 | - // set up label and input field for the basic profile stuff |
|
| 406 | - echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 407 | - echo '<div class="col-sm-8">'; // field wrapper for css styling |
|
| 408 | - echo elgg_view("input/text", $params); |
|
| 409 | - |
|
| 410 | - } // input field |
|
| 411 | - |
|
| 412 | - echo '</div>'; //close div class = basic-profile-field |
|
| 413 | - echo '</div>'; //close div class = basic-profile-field-wrapper |
|
| 414 | - |
|
| 415 | - } // end for-loop |
|
| 416 | - |
|
| 417 | - echo '</div>'; // close div class="basic-profile-standard-field-wrapper" |
|
| 418 | - echo '<div class="basic-profile-social-media-wrapper col-md-6 col-xs-12">'; // container for css styling, used to group profile content and display them seperately from other fields |
|
| 419 | - |
|
| 420 | - // pre-populate the social media fields and their prepended link for user profiles |
|
| 421 | - |
|
| 422 | - $fields = array('Facebook' => "http://www.facebook.com/", |
|
| 423 | - 'Google Plus' => "http://www.google.com/", |
|
| 424 | - 'GitHub' => "https://github.com/", |
|
| 425 | - 'Twitter' => "https://twitter.com/", |
|
| 426 | - 'Linkedin' => "http://ca.linkedin.com/in/", |
|
| 427 | - 'Pinterest' => "http://www.pinterest.com/", |
|
| 428 | - 'Tumblr' => "https://www.tumblr.com/blog/", |
|
| 429 | - 'Instagram' => "http://instagram.com/", |
|
| 430 | - 'Flickr' => "http://flickr.com/", |
|
| 431 | - 'Youtube' => "http://www.youtube.com/"); |
|
| 432 | - |
|
| 433 | - foreach ($fields as $field => $field_link) { // create a label and input box for each social media field on the basic profile |
|
| 434 | - |
|
| 435 | - echo '<div class="basic-profile-field-wrapper social-media-field-wrapper">'; //field wrapper for css styling |
|
| 436 | - |
|
| 437 | - $field = str_replace(' ', '-', $field); // create a css friendly version of the section name |
|
| 438 | - $field = strtolower($field); |
|
| 439 | - |
|
| 440 | - if ($field == "google-plus") { $field = "google"; } |
|
| 441 | - $value = $user->get($field); |
|
| 442 | - |
|
| 443 | - echo '<div class="input-group">'; // input wrapper for prepended link and input box, excludes the input label |
|
| 444 | - echo '<label for="' . $field . 'Input" class="input-group-addon clearfix">' . $field_link . "</label>"; // prepended link |
|
| 445 | - |
|
| 446 | - // setup the input for this field |
|
| 447 | - $placeholder = "test"; |
|
| 448 | - if ($field == "facebook") { $placeholder = "User.Name"; } |
|
| 449 | - if ($field == "google") { $placeholder = "############"; } |
|
| 450 | - if ($field == "github") { $placeholder = "User"; } |
|
| 451 | - if ($field == "twitter") { $placeholder = "@user"; } |
|
| 452 | - if ($field == "linkedin") { $placeholder = "CustomURL"; } |
|
| 453 | - if ($field == "pinterest") { $placeholder = "Username"; } |
|
| 454 | - if ($field == "tumblr") { $placeholder = "Username"; } |
|
| 455 | - if ($field == "instagram") { $placeholder = "@user"; } |
|
| 456 | - if ($field == "flickr") { $placeholder = "Username"; } |
|
| 457 | - if ($field == "youtube") { $placeholder = "Username"; } |
|
| 458 | - |
|
| 459 | - $params = array( |
|
| 460 | - 'name' => $field, |
|
| 461 | - 'id' => $field . 'Input', |
|
| 462 | - 'class' => 'editProfileFields gcconnex-basic-field gcconnex-social-media gcconnex-basic-' . $field, |
|
| 463 | - 'placeholder' => $placeholder, |
|
| 464 | - 'value' => $value |
|
| 465 | - ); |
|
| 466 | - |
|
| 467 | - echo elgg_view("input/text", $params); // input field |
|
| 468 | - |
|
| 469 | - echo '</div>'; // close div class="input-group" |
|
| 470 | - echo '</div>'; // close div class = basic-profile-field-wrapper |
|
| 471 | - } |
|
| 472 | - |
|
| 473 | - echo '</div>'; // close div class="basic-profile-social-media-wrapper" |
|
| 474 | - echo ' |
|
| 294 | + } else if (strcmp($field, 'municipal') == 0) { |
|
| 295 | + |
|
| 296 | + echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 297 | + echo '<div class="col-sm-8">'; |
|
| 298 | + |
|
| 299 | + $munObj = elgg_get_entities(array( |
|
| 300 | + 'type' => 'object', |
|
| 301 | + 'subtype' => 'municipal', |
|
| 302 | + )); |
|
| 303 | + $municipals = get_entity($munObj[0]->guid); |
|
| 304 | + |
|
| 305 | + $municipal = array(); |
|
| 306 | + if (get_current_language() == 'en'){ |
|
| 307 | + $municipal = json_decode($municipals->other_en, true); |
|
| 308 | + } else { |
|
| 309 | + $municipal = json_decode($municipals->other_fr, true); |
|
| 310 | + } |
|
| 311 | + |
|
| 312 | + echo elgg_view('input/text', array( |
|
| 313 | + 'name' => $field, |
|
| 314 | + 'id' => $field, |
|
| 315 | + 'class' => "gcconnex-basic-{$field}", |
|
| 316 | + 'value' => $value, |
|
| 317 | + 'list' => $field . '-list' |
|
| 318 | + )); |
|
| 319 | + |
|
| 320 | + echo '<datalist id="municipal-list">'; |
|
| 321 | + if( !empty($municipal) ){ |
|
| 322 | + foreach($municipal as $municipal_name => $value){ |
|
| 323 | + echo '<option value="' . $municipal_name . '">' . $value . '</option>'; |
|
| 324 | + } |
|
| 325 | + } |
|
| 326 | + echo '</datalist>'; |
|
| 327 | + |
|
| 328 | + } else if (strcmp($field, 'retired') == 0) { |
|
| 329 | + |
|
| 330 | + echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 331 | + echo '<div class="col-sm-8">'; |
|
| 332 | + |
|
| 333 | + $deptObj = elgg_get_entities(array( |
|
| 334 | + 'type' => 'object', |
|
| 335 | + 'subtype' => 'federal_departments', |
|
| 336 | + )); |
|
| 337 | + $depts = get_entity($deptObj[0]->guid); |
|
| 338 | + |
|
| 339 | + $federal_departments = array(); |
|
| 340 | + if (get_current_language() == 'en'){ |
|
| 341 | + $federal_departments = json_decode($depts->federal_departments_en, true); |
|
| 342 | + } else { |
|
| 343 | + $federal_departments = json_decode($depts->federal_departments_fr, true); |
|
| 344 | + } |
|
| 345 | + |
|
| 346 | + echo elgg_view('input/text', array( |
|
| 347 | + 'name' => $field, |
|
| 348 | + 'id' => $field, |
|
| 349 | + 'class' => "gcconnex-basic-{$field}", |
|
| 350 | + 'value' => $value, |
|
| 351 | + 'list' => $field . '-list' |
|
| 352 | + )); |
|
| 353 | + |
|
| 354 | + echo '<datalist id="retired-list">'; |
|
| 355 | + if( !empty($federal_departments) ){ |
|
| 356 | + foreach($federal_departments as $federal_name => $value){ |
|
| 357 | + echo '<option value="' . $federal_name . '">' . $value . '</option>'; |
|
| 358 | + } |
|
| 359 | + } |
|
| 360 | + echo '</datalist>'; |
|
| 361 | + |
|
| 362 | + } else if (strcmp($field, 'other') == 0) { |
|
| 363 | + |
|
| 364 | + echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 365 | + echo '<div class="col-sm-8">'; |
|
| 366 | + |
|
| 367 | + $otherObj = elgg_get_entities(array( |
|
| 368 | + 'type' => 'object', |
|
| 369 | + 'subtype' => 'other', |
|
| 370 | + )); |
|
| 371 | + $others = get_entity($otherObj[0]->guid); |
|
| 372 | + |
|
| 373 | + $other = array(); |
|
| 374 | + if (get_current_language() == 'en'){ |
|
| 375 | + $other = json_decode($others->other_en, true); |
|
| 376 | + } else { |
|
| 377 | + $other = json_decode($others->other_fr, true); |
|
| 378 | + } |
|
| 379 | + |
|
| 380 | + echo elgg_view('input/text', array( |
|
| 381 | + 'name' => $field, |
|
| 382 | + 'id' => $field, |
|
| 383 | + 'class' => "gcconnex-basic-{$field}", |
|
| 384 | + 'value' => $value, |
|
| 385 | + 'list' => $field . '-list' |
|
| 386 | + )); |
|
| 387 | + |
|
| 388 | + echo '<datalist id="other-list">'; |
|
| 389 | + if( !empty($other) ){ |
|
| 390 | + foreach($other as $other_name => $value){ |
|
| 391 | + echo '<option value="' . $other_name . '">' . $value . '</option>'; |
|
| 392 | + } |
|
| 393 | + } |
|
| 394 | + echo '</datalist>'; |
|
| 395 | + |
|
| 396 | + } else { |
|
| 397 | + |
|
| 398 | + $params = array( |
|
| 399 | + 'name' => $field, |
|
| 400 | + 'id' => $field, |
|
| 401 | + 'class' => 'gcconnex-basic-'.$field, |
|
| 402 | + 'value' => $value, |
|
| 403 | + ); |
|
| 404 | + |
|
| 405 | + // set up label and input field for the basic profile stuff |
|
| 406 | + echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>"; |
|
| 407 | + echo '<div class="col-sm-8">'; // field wrapper for css styling |
|
| 408 | + echo elgg_view("input/text", $params); |
|
| 409 | + |
|
| 410 | + } // input field |
|
| 411 | + |
|
| 412 | + echo '</div>'; //close div class = basic-profile-field |
|
| 413 | + echo '</div>'; //close div class = basic-profile-field-wrapper |
|
| 414 | + |
|
| 415 | + } // end for-loop |
|
| 416 | + |
|
| 417 | + echo '</div>'; // close div class="basic-profile-standard-field-wrapper" |
|
| 418 | + echo '<div class="basic-profile-social-media-wrapper col-md-6 col-xs-12">'; // container for css styling, used to group profile content and display them seperately from other fields |
|
| 419 | + |
|
| 420 | + // pre-populate the social media fields and their prepended link for user profiles |
|
| 421 | + |
|
| 422 | + $fields = array('Facebook' => "http://www.facebook.com/", |
|
| 423 | + 'Google Plus' => "http://www.google.com/", |
|
| 424 | + 'GitHub' => "https://github.com/", |
|
| 425 | + 'Twitter' => "https://twitter.com/", |
|
| 426 | + 'Linkedin' => "http://ca.linkedin.com/in/", |
|
| 427 | + 'Pinterest' => "http://www.pinterest.com/", |
|
| 428 | + 'Tumblr' => "https://www.tumblr.com/blog/", |
|
| 429 | + 'Instagram' => "http://instagram.com/", |
|
| 430 | + 'Flickr' => "http://flickr.com/", |
|
| 431 | + 'Youtube' => "http://www.youtube.com/"); |
|
| 432 | + |
|
| 433 | + foreach ($fields as $field => $field_link) { // create a label and input box for each social media field on the basic profile |
|
| 434 | + |
|
| 435 | + echo '<div class="basic-profile-field-wrapper social-media-field-wrapper">'; //field wrapper for css styling |
|
| 436 | + |
|
| 437 | + $field = str_replace(' ', '-', $field); // create a css friendly version of the section name |
|
| 438 | + $field = strtolower($field); |
|
| 439 | + |
|
| 440 | + if ($field == "google-plus") { $field = "google"; } |
|
| 441 | + $value = $user->get($field); |
|
| 442 | + |
|
| 443 | + echo '<div class="input-group">'; // input wrapper for prepended link and input box, excludes the input label |
|
| 444 | + echo '<label for="' . $field . 'Input" class="input-group-addon clearfix">' . $field_link . "</label>"; // prepended link |
|
| 445 | + |
|
| 446 | + // setup the input for this field |
|
| 447 | + $placeholder = "test"; |
|
| 448 | + if ($field == "facebook") { $placeholder = "User.Name"; } |
|
| 449 | + if ($field == "google") { $placeholder = "############"; } |
|
| 450 | + if ($field == "github") { $placeholder = "User"; } |
|
| 451 | + if ($field == "twitter") { $placeholder = "@user"; } |
|
| 452 | + if ($field == "linkedin") { $placeholder = "CustomURL"; } |
|
| 453 | + if ($field == "pinterest") { $placeholder = "Username"; } |
|
| 454 | + if ($field == "tumblr") { $placeholder = "Username"; } |
|
| 455 | + if ($field == "instagram") { $placeholder = "@user"; } |
|
| 456 | + if ($field == "flickr") { $placeholder = "Username"; } |
|
| 457 | + if ($field == "youtube") { $placeholder = "Username"; } |
|
| 458 | + |
|
| 459 | + $params = array( |
|
| 460 | + 'name' => $field, |
|
| 461 | + 'id' => $field . 'Input', |
|
| 462 | + 'class' => 'editProfileFields gcconnex-basic-field gcconnex-social-media gcconnex-basic-' . $field, |
|
| 463 | + 'placeholder' => $placeholder, |
|
| 464 | + 'value' => $value |
|
| 465 | + ); |
|
| 466 | + |
|
| 467 | + echo elgg_view("input/text", $params); // input field |
|
| 468 | + |
|
| 469 | + echo '</div>'; // close div class="input-group" |
|
| 470 | + echo '</div>'; // close div class = basic-profile-field-wrapper |
|
| 471 | + } |
|
| 472 | + |
|
| 473 | + echo '</div>'; // close div class="basic-profile-social-media-wrapper" |
|
| 474 | + echo ' |
|
| 475 | 475 | |
| 476 | 476 | </div> |
| 477 | 477 | <div class="panel-footer text-right profile-edit-footer"> |
@@ -490,62 +490,62 @@ discard block |
||
| 490 | 490 | echo '</div>'; // close div class="gcconnex-profile-name" |
| 491 | 491 | //actions dropdown |
| 492 | 492 | if (elgg_get_page_owner_guid() != elgg_get_logged_in_user_guid()) { |
| 493 | - $menu = elgg_trigger_plugin_hook('register', "menu:user_hover", array('entity' => $user), array()); |
|
| 494 | - $builder = new ElggMenuBuilder($menu); |
|
| 495 | - $menu = $builder->getMenu(); |
|
| 496 | - $actions = elgg_extract('action', $menu, array()); |
|
| 497 | - $admin = elgg_extract('admin', $menu, array()); |
|
| 498 | - $profile_actions = ''; |
|
| 499 | - |
|
| 500 | - // cyu - GCCON-151 : Add colleague in FR not there (inconsistent FR and EN menu layout) & other issues |
|
| 501 | - if (elgg_is_logged_in() && $actions) { |
|
| 502 | - $btn_friend_request = ''; |
|
| 503 | - foreach ($actions as $action) { |
|
| 504 | - |
|
| 505 | - if (strcmp($action->getName(),'add_friend') == 0 || strcmp($action->getName(),'remove_friend') == 0) { |
|
| 506 | - if (!check_entity_relationship(elgg_get_logged_in_user_guid(),'friendrequest',$user->getGUID())) { |
|
| 507 | - if ($user->isFriend() && strcmp($action->getName(),'remove_friend') == 0) { |
|
| 508 | - $btn_friend_request = $action->getContent(); |
|
| 509 | - $btn_friend_request_link = $action->getHref(); |
|
| 510 | - } |
|
| 511 | - if (!$user->isFriend() && strcmp($action->getName(),'add_friend') == 0) { |
|
| 512 | - $btn_friend_request = $action->getContent(array('class' => 'asdfasdasfad')); |
|
| 513 | - $btn_friend_request_link = $action->getHref(); |
|
| 514 | - } |
|
| 515 | - } |
|
| 516 | - } else { |
|
| 517 | - |
|
| 518 | - if (check_entity_relationship(elgg_get_logged_in_user_guid(),'friendrequest',$user->getGUID()) && strcmp($action->getName(),'friend_request') == 0) { |
|
| 519 | - $btn_friend_request_link = $action->getHref(); |
|
| 520 | - $btn_friend_request = $action->getContent(); |
|
| 521 | - } else |
|
| 522 | - $profile_actions .= '<li>' . $action->getContent(array('class' => 'gcconnex-basic-profile-actions')) . '</li>'; |
|
| 523 | - } |
|
| 524 | - } |
|
| 525 | - } |
|
| 526 | - if(elgg_is_logged_in()){ |
|
| 527 | - echo "<button type='button' class='btn btn-primary' onclick='location.href=\"{$btn_friend_request_link}\"'>{$btn_friend_request}</button>"; // cyu - added button and removed from actions toggle |
|
| 528 | - |
|
| 529 | - echo $add . '<div class="btn-group"><button type="button" class="btn btn-custom mrgn-rght-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
|
| 493 | + $menu = elgg_trigger_plugin_hook('register', "menu:user_hover", array('entity' => $user), array()); |
|
| 494 | + $builder = new ElggMenuBuilder($menu); |
|
| 495 | + $menu = $builder->getMenu(); |
|
| 496 | + $actions = elgg_extract('action', $menu, array()); |
|
| 497 | + $admin = elgg_extract('admin', $menu, array()); |
|
| 498 | + $profile_actions = ''; |
|
| 499 | + |
|
| 500 | + // cyu - GCCON-151 : Add colleague in FR not there (inconsistent FR and EN menu layout) & other issues |
|
| 501 | + if (elgg_is_logged_in() && $actions) { |
|
| 502 | + $btn_friend_request = ''; |
|
| 503 | + foreach ($actions as $action) { |
|
| 504 | + |
|
| 505 | + if (strcmp($action->getName(),'add_friend') == 0 || strcmp($action->getName(),'remove_friend') == 0) { |
|
| 506 | + if (!check_entity_relationship(elgg_get_logged_in_user_guid(),'friendrequest',$user->getGUID())) { |
|
| 507 | + if ($user->isFriend() && strcmp($action->getName(),'remove_friend') == 0) { |
|
| 508 | + $btn_friend_request = $action->getContent(); |
|
| 509 | + $btn_friend_request_link = $action->getHref(); |
|
| 510 | + } |
|
| 511 | + if (!$user->isFriend() && strcmp($action->getName(),'add_friend') == 0) { |
|
| 512 | + $btn_friend_request = $action->getContent(array('class' => 'asdfasdasfad')); |
|
| 513 | + $btn_friend_request_link = $action->getHref(); |
|
| 514 | + } |
|
| 515 | + } |
|
| 516 | + } else { |
|
| 517 | + |
|
| 518 | + if (check_entity_relationship(elgg_get_logged_in_user_guid(),'friendrequest',$user->getGUID()) && strcmp($action->getName(),'friend_request') == 0) { |
|
| 519 | + $btn_friend_request_link = $action->getHref(); |
|
| 520 | + $btn_friend_request = $action->getContent(); |
|
| 521 | + } else |
|
| 522 | + $profile_actions .= '<li>' . $action->getContent(array('class' => 'gcconnex-basic-profile-actions')) . '</li>'; |
|
| 523 | + } |
|
| 524 | + } |
|
| 525 | + } |
|
| 526 | + if(elgg_is_logged_in()){ |
|
| 527 | + echo "<button type='button' class='btn btn-primary' onclick='location.href=\"{$btn_friend_request_link}\"'>{$btn_friend_request}</button>"; // cyu - added button and removed from actions toggle |
|
| 528 | + |
|
| 529 | + echo $add . '<div class="btn-group"><button type="button" class="btn btn-custom mrgn-rght-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
|
| 530 | 530 | ' . elgg_echo('profile:actions') . ' <span class="caret"></span> |
| 531 | 531 | </button> |
| 532 | 532 | <ul class="dropdown-menu pull-right clearfix">'; |
| 533 | - echo $profile_actions; |
|
| 534 | - echo '</ul></div>'; |
|
| 535 | - } |
|
| 533 | + echo $profile_actions; |
|
| 534 | + echo '</ul></div>'; |
|
| 535 | + } |
|
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | // if admin, display admin links |
| 539 | 539 | $admin_links = ''; |
| 540 | 540 | if (elgg_is_admin_logged_in() && elgg_get_logged_in_user_guid() != elgg_get_page_owner_guid()) { |
| 541 | - $text = elgg_echo('admin:options'); |
|
| 541 | + $text = elgg_echo('admin:options'); |
|
| 542 | 542 | |
| 543 | - foreach ($admin as $menu_item) { |
|
| 544 | - $admin_links .= '<li>' . elgg_view('navigation/menu/elements/item', array('item' => $menu_item)) . '</li>'; |
|
| 545 | - } |
|
| 543 | + foreach ($admin as $menu_item) { |
|
| 544 | + $admin_links .= '<li>' . elgg_view('navigation/menu/elements/item', array('item' => $menu_item)) . '</li>'; |
|
| 545 | + } |
|
| 546 | 546 | |
| 547 | - echo '<div class="pull-right btn-group"><button type="button" class="btn btn-custom pull-right dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' . |
|
| 548 | - $text . '<span class="caret"></span> |
|
| 547 | + echo '<div class="pull-right btn-group"><button type="button" class="btn btn-custom pull-right dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' . |
|
| 548 | + $text . '<span class="caret"></span> |
|
| 549 | 549 | </button> |
| 550 | 550 | <ul class="dropdown-menu pull-right clearfix">' . $admin_links . '</ul></div>'; |
| 551 | 551 | } |
@@ -560,92 +560,92 @@ discard block |
||
| 560 | 560 | |
| 561 | 561 | // if user is public servant |
| 562 | 562 | if(strcmp($user->user_type, 'federal') == 0 ) { |
| 563 | - $deptObj = elgg_get_entities(array( |
|
| 564 | - 'type' => 'object', |
|
| 565 | - 'subtype' => 'federal_departments', |
|
| 566 | - )); |
|
| 567 | - $depts = get_entity($deptObj[0]->guid); |
|
| 568 | - |
|
| 569 | - $federal_departments = array(); |
|
| 570 | - if (get_current_language() == 'en'){ |
|
| 571 | - $federal_departments = json_decode($depts->federal_departments_en, true); |
|
| 572 | - } else { |
|
| 573 | - $federal_departments = json_decode($depts->federal_departments_fr, true); |
|
| 574 | - } |
|
| 575 | - |
|
| 576 | - echo '<h3 class="mrgn-tp-0">' . $user->job . '</h3>'; |
|
| 577 | - echo '<div class="gcconnex-profile-dept">' . $federal_departments[$user->federal] . '</div>'; |
|
| 563 | + $deptObj = elgg_get_entities(array( |
|
| 564 | + 'type' => 'object', |
|
| 565 | + 'subtype' => 'federal_departments', |
|
| 566 | + )); |
|
| 567 | + $depts = get_entity($deptObj[0]->guid); |
|
| 568 | + |
|
| 569 | + $federal_departments = array(); |
|
| 570 | + if (get_current_language() == 'en'){ |
|
| 571 | + $federal_departments = json_decode($depts->federal_departments_en, true); |
|
| 572 | + } else { |
|
| 573 | + $federal_departments = json_decode($depts->federal_departments_fr, true); |
|
| 574 | + } |
|
| 575 | + |
|
| 576 | + echo '<h3 class="mrgn-tp-0">' . $user->job . '</h3>'; |
|
| 577 | + echo '<div class="gcconnex-profile-dept">' . $federal_departments[$user->federal] . '</div>'; |
|
| 578 | 578 | |
| 579 | 579 | // otherwise if user is student or academic |
| 580 | 580 | } else if (strcmp($user->user_type, 'student') == 0 || strcmp($user->user_type, 'academic') == 0 ) { |
| 581 | - echo '<h3 class="mrgn-tp-0">'.elgg_echo("gcconnex-profile-card:{$user->user_type}", array($user->user_type)).'</h3>'; |
|
| 582 | - $institution = ($user->institution == 'university') ? $user->university : ($user->institution == 'college' ? $user->college : $user->highschool); |
|
| 583 | - $job = ($user->job != "") ? $user->job : ""; |
|
| 584 | - echo '<div class="gcconnex-profile-dept">' . ($institution != "default_invalid_value" ? $institution : $job) . '</div>'; |
|
| 581 | + echo '<h3 class="mrgn-tp-0">'.elgg_echo("gcconnex-profile-card:{$user->user_type}", array($user->user_type)).'</h3>'; |
|
| 582 | + $institution = ($user->institution == 'university') ? $user->university : ($user->institution == 'college' ? $user->college : $user->highschool); |
|
| 583 | + $job = ($user->job != "") ? $user->job : ""; |
|
| 584 | + echo '<div class="gcconnex-profile-dept">' . ($institution != "default_invalid_value" ? $institution : $job) . '</div>'; |
|
| 585 | 585 | |
| 586 | 586 | // otherwise if user is provincial employee |
| 587 | 587 | } else if (strcmp($user->user_type, 'provincial') == 0 ) { |
| 588 | - $provObj = elgg_get_entities(array( |
|
| 589 | - 'type' => 'object', |
|
| 590 | - 'subtype' => 'provinces', |
|
| 591 | - )); |
|
| 592 | - $provs = get_entity($provObj[0]->guid); |
|
| 593 | - |
|
| 594 | - $provinces = array(); |
|
| 595 | - if (get_current_language() == 'en'){ |
|
| 596 | - $provinces = json_decode($provs->provinces_en, true); |
|
| 597 | - } else { |
|
| 598 | - $provinces = json_decode($provs->provinces_fr, true); |
|
| 599 | - } |
|
| 600 | - |
|
| 601 | - $minObj = elgg_get_entities(array( |
|
| 602 | - 'type' => 'object', |
|
| 603 | - 'subtype' => 'ministries', |
|
| 604 | - )); |
|
| 605 | - $mins = get_entity($minObj[0]->guid); |
|
| 606 | - |
|
| 607 | - $ministries = array(); |
|
| 608 | - if (get_current_language() == 'en'){ |
|
| 609 | - $ministries = json_decode($mins->ministries_en, true); |
|
| 610 | - } else { |
|
| 611 | - $ministries = json_decode($mins->ministries_fr, true); |
|
| 612 | - } |
|
| 613 | - |
|
| 614 | - echo '<h3 class="mrgn-tp-0">' . elgg_echo("gcconnex-profile-card:{$user->user_type}") . '</h3>'; |
|
| 615 | - echo '<div class="gcconnex-profile-job">' . $user->job . '</div>'; |
|
| 616 | - $provString = $provinces[$user->provincial]; |
|
| 617 | - if($user->ministry && $user->ministry !== "default_invalid_value"){ $provString .= ' / ' . $ministries[$user->provincial][$user->ministry]; } |
|
| 618 | - echo '<div class="gcconnex-profile-dept">' . $provString . '</div>'; |
|
| 588 | + $provObj = elgg_get_entities(array( |
|
| 589 | + 'type' => 'object', |
|
| 590 | + 'subtype' => 'provinces', |
|
| 591 | + )); |
|
| 592 | + $provs = get_entity($provObj[0]->guid); |
|
| 593 | + |
|
| 594 | + $provinces = array(); |
|
| 595 | + if (get_current_language() == 'en'){ |
|
| 596 | + $provinces = json_decode($provs->provinces_en, true); |
|
| 597 | + } else { |
|
| 598 | + $provinces = json_decode($provs->provinces_fr, true); |
|
| 599 | + } |
|
| 600 | + |
|
| 601 | + $minObj = elgg_get_entities(array( |
|
| 602 | + 'type' => 'object', |
|
| 603 | + 'subtype' => 'ministries', |
|
| 604 | + )); |
|
| 605 | + $mins = get_entity($minObj[0]->guid); |
|
| 606 | + |
|
| 607 | + $ministries = array(); |
|
| 608 | + if (get_current_language() == 'en'){ |
|
| 609 | + $ministries = json_decode($mins->ministries_en, true); |
|
| 610 | + } else { |
|
| 611 | + $ministries = json_decode($mins->ministries_fr, true); |
|
| 612 | + } |
|
| 613 | + |
|
| 614 | + echo '<h3 class="mrgn-tp-0">' . elgg_echo("gcconnex-profile-card:{$user->user_type}") . '</h3>'; |
|
| 615 | + echo '<div class="gcconnex-profile-job">' . $user->job . '</div>'; |
|
| 616 | + $provString = $provinces[$user->provincial]; |
|
| 617 | + if($user->ministry && $user->ministry !== "default_invalid_value"){ $provString .= ' / ' . $ministries[$user->provincial][$user->ministry]; } |
|
| 618 | + echo '<div class="gcconnex-profile-dept">' . $provString . '</div>'; |
|
| 619 | 619 | |
| 620 | 620 | // otherwise show basic info |
| 621 | 621 | } else { |
| 622 | - echo '<h3 class="mrgn-tp-0">' . elgg_echo("gcconnex-profile-card:{$user->user_type}") . '</h3>'; |
|
| 623 | - echo '<div class="gcconnex-profile-job">' . $user->job . '</div>'; |
|
| 624 | - echo '<div class="gcconnex-profile-dept">' . $user->{$user->user_type} . '</div>'; |
|
| 622 | + echo '<h3 class="mrgn-tp-0">' . elgg_echo("gcconnex-profile-card:{$user->user_type}") . '</h3>'; |
|
| 623 | + echo '<div class="gcconnex-profile-job">' . $user->job . '</div>'; |
|
| 624 | + echo '<div class="gcconnex-profile-dept">' . $user->{$user->user_type} . '</div>'; |
|
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | echo '<div class="gcconnex-profile-location">' . $user->location . '</div>'; |
| 628 | 628 | echo '<div class="gcconnex-profile-contact-info">'; |
| 629 | 629 | |
| 630 | 630 | if ($user->phone != null) { |
| 631 | - echo '<p class="mrgn-bttm-sm"><i class="fa fa-phone fa-lg"></i> ' . $user->phone . '</p>'; |
|
| 631 | + echo '<p class="mrgn-bttm-sm"><i class="fa fa-phone fa-lg"></i> ' . $user->phone . '</p>'; |
|
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 | if ($user->mobile != null) { |
| 635 | - echo '<p class="mrgn-bttm-sm"><i class="fa fa-mobile fa-lg"></i> ' . $user->mobile . '</p>'; |
|
| 635 | + echo '<p class="mrgn-bttm-sm"><i class="fa fa-mobile fa-lg"></i> ' . $user->mobile . '</p>'; |
|
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | if ($user->email != null) { |
| 639 | - echo '<p class="mrgn-bttm-sm"><i class="fa fa-envelope fa-lg"></i> <a href="mailto:' . $user->email . '">' . $user->email . '</a></p>'; |
|
| 639 | + echo '<p class="mrgn-bttm-sm"><i class="fa fa-envelope fa-lg"></i> <a href="mailto:' . $user->email . '">' . $user->email . '</a></p>'; |
|
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | if ($user->website != null) { |
| 643 | - echo '<p class="mrgn-bttm-sm"><i class="fa fa-globe fa-lg"></i> '; |
|
| 644 | - echo elgg_view('output/url', array( |
|
| 645 | - 'href' => $user->website, |
|
| 646 | - 'text' => $user->website |
|
| 647 | - )); |
|
| 648 | - echo '</p>'; |
|
| 643 | + echo '<p class="mrgn-bttm-sm"><i class="fa fa-globe fa-lg"></i> '; |
|
| 644 | + echo elgg_view('output/url', array( |
|
| 645 | + 'href' => $user->website, |
|
| 646 | + 'text' => $user->website |
|
| 647 | + )); |
|
| 648 | + echo '</p>'; |
|
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | echo '</div></div>'; // close div class="gcconnex-profile-contact-info" |
@@ -656,22 +656,22 @@ discard block |
||
| 656 | 656 | echo '<div class="gcconnex-profile-social-media-links mrgn-bttm-sm mrgn-lft-md">'; |
| 657 | 657 | foreach ($social as $media) { |
| 658 | 658 | |
| 659 | - if ($link = $user->get($media)) { |
|
| 659 | + if ($link = $user->get($media)) { |
|
| 660 | 660 | |
| 661 | - if ($media == 'facebook') { $link = "http://www.facebook.com/" . $link; $class = "fa-facebook";} |
|
| 662 | - if ($media == 'google') { $link = "http://plus.google.com/" . $link; $class = "fa-google-plus";} |
|
| 663 | - if ($media == 'github') { $link = "https://github.com/" . $link; $class = "fa-github";} |
|
| 664 | - if ($media == 'twitter') { $link = "https://twitter.com/" . $link; $class = "fa-twitter";} |
|
| 665 | - if ($media == 'linkedin') { $link = "http://ca.linkedin.com/in/" . $link; $class = "fa-linkedin";} |
|
| 666 | - if ($media == 'pinterest') { $link = "http://www.pinterest.com/" . $link; $class = "fa-pinterest";} |
|
| 667 | - if ($media == 'tumblr') { $link = "https://www.tumblr.com/blog/" . $link; $class = "fa-tumblr";} |
|
| 668 | - if ($media == 'instagram') { $link = "http://instagram.com/" . $link; $class = "fa-instagram";} |
|
| 669 | - if ($media == 'flickr') { $link = "http://flickr.com/" . $link; $class = "fa-flickr"; } |
|
| 670 | - if ($media == 'youtube') { $link = "http://www.youtube.com/" . $link; $class = "fa-youtube";} |
|
| 661 | + if ($media == 'facebook') { $link = "http://www.facebook.com/" . $link; $class = "fa-facebook";} |
|
| 662 | + if ($media == 'google') { $link = "http://plus.google.com/" . $link; $class = "fa-google-plus";} |
|
| 663 | + if ($media == 'github') { $link = "https://github.com/" . $link; $class = "fa-github";} |
|
| 664 | + if ($media == 'twitter') { $link = "https://twitter.com/" . $link; $class = "fa-twitter";} |
|
| 665 | + if ($media == 'linkedin') { $link = "http://ca.linkedin.com/in/" . $link; $class = "fa-linkedin";} |
|
| 666 | + if ($media == 'pinterest') { $link = "http://www.pinterest.com/" . $link; $class = "fa-pinterest";} |
|
| 667 | + if ($media == 'tumblr') { $link = "https://www.tumblr.com/blog/" . $link; $class = "fa-tumblr";} |
|
| 668 | + if ($media == 'instagram') { $link = "http://instagram.com/" . $link; $class = "fa-instagram";} |
|
| 669 | + if ($media == 'flickr') { $link = "http://flickr.com/" . $link; $class = "fa-flickr"; } |
|
| 670 | + if ($media == 'youtube') { $link = "http://www.youtube.com/" . $link; $class = "fa-youtube";} |
|
| 671 | 671 | |
| 672 | - echo '<a href="' . $link . '" target="_blank"><i class="socialMediaIcons fa ' . $class . ' fa-2x"></i></a>'; |
|
| 672 | + echo '<a href="' . $link . '" target="_blank"><i class="socialMediaIcons fa ' . $class . ' fa-2x"></i></a>'; |
|
| 673 | 673 | |
| 674 | - } |
|
| 674 | + } |
|
| 675 | 675 | } |
| 676 | 676 | echo '</div>'; // close div class="gcconnex-profile-social-media-links" |
| 677 | 677 | echo '</div>'; |
@@ -688,16 +688,16 @@ discard block |
||
| 688 | 688 | |
| 689 | 689 | $profile_actions = ''; |
| 690 | 690 | if (elgg_is_logged_in() && $actions) { |
| 691 | - $profile_actions = '<ul class="elgg-menu profile-action-menu mvm">'; |
|
| 692 | - foreach ($actions as $action) { |
|
| 693 | - $profile_actions .= '<li>' . $action->getContent(array('class' => 'elgg-button elgg-button-action')) . '</li>'; |
|
| 694 | - } |
|
| 695 | - $profile_actions .= '</ul>'; |
|
| 691 | + $profile_actions = '<ul class="elgg-menu profile-action-menu mvm">'; |
|
| 692 | + foreach ($actions as $action) { |
|
| 693 | + $profile_actions .= '<li>' . $action->getContent(array('class' => 'elgg-button elgg-button-action')) . '</li>'; |
|
| 694 | + } |
|
| 695 | + $profile_actions .= '</ul>'; |
|
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | // content links |
| 699 | 699 | $content_menu_title = elgg_echo('gcconnex_profile:user_content'); |
| 700 | 700 | $content_menu = elgg_view_menu('owner_block', array( |
| 701 | - 'entity' => elgg_get_page_owner_entity(), |
|
| 702 | - 'class' => 'profile-content-menu', |
|
| 701 | + 'entity' => elgg_get_page_owner_entity(), |
|
| 702 | + 'class' => 'profile-content-menu', |
|
| 703 | 703 | )); |
@@ -25,18 +25,18 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | <div class="gcconnex-profile-wire-post"> |
| 27 | 27 | <?php $user = get_user(elgg_get_page_owner_guid()); |
| 28 | - $params = array( |
|
| 29 | - 'type' => 'object', |
|
| 30 | - 'subtype' => 'thewire', |
|
| 31 | - 'owner_guid' => $user->guid, |
|
| 32 | - 'limit' => 1, |
|
| 33 | - ); |
|
| 34 | - $latest_wire = elgg_get_entities($params); |
|
| 35 | - if ($latest_wire && count($latest_wire) > 0) { |
|
| 36 | - //echo '<img class="profile-icons double-quotes" src="' . elgg_get_site_url() . 'mod/b_extended_profile/img/double-quotes.png">'; |
|
| 37 | - //echo elgg_view("profile/status", array("entity" => $user)); |
|
| 38 | - } |
|
| 39 | - ?> |
|
| 28 | + $params = array( |
|
| 29 | + 'type' => 'object', |
|
| 30 | + 'subtype' => 'thewire', |
|
| 31 | + 'owner_guid' => $user->guid, |
|
| 32 | + 'limit' => 1, |
|
| 33 | + ); |
|
| 34 | + $latest_wire = elgg_get_entities($params); |
|
| 35 | + if ($latest_wire && count($latest_wire) > 0) { |
|
| 36 | + //echo '<img class="profile-icons double-quotes" src="' . elgg_get_site_url() . 'mod/b_extended_profile/img/double-quotes.png">'; |
|
| 37 | + //echo elgg_view("profile/status", array("entity" => $user)); |
|
| 38 | + } |
|
| 39 | + ?> |
|
| 40 | 40 | </div> |
| 41 | 41 | |
| 42 | 42 | <?php //echo elgg_get_context(); |
@@ -48,59 +48,59 @@ discard block |
||
| 48 | 48 | <div class="b_extended_profile"> |
| 49 | 49 | <?php |
| 50 | 50 | |
| 51 | - echo '<div>'; |
|
| 52 | - |
|
| 53 | - //add additional tabs |
|
| 54 | - echo elgg_view('profile/profile_tab_menu'); |
|
| 55 | - |
|
| 56 | - echo '<div class="tab-content">'; |
|
| 57 | - if (empty($_GET['pg'])) { |
|
| 58 | - $pg = ''; |
|
| 59 | - echo '<div role="tabpanel" class="tab-pane active" tabindex="-1" id="profile-display">'; |
|
| 60 | - } |
|
| 61 | - else{ |
|
| 62 | - $pg = $_GET['pg']; |
|
| 63 | - echo '<div role="tabpanel" class="tab-pane " tabindex="-1" id="profile-display">'; |
|
| 64 | - } |
|
| 65 | - |
|
| 66 | - if ( has_content($user, 'description') ) { |
|
| 67 | - init_ajax_block(elgg_echo('gcconnex_profile:about_me'), 'about-me', $user); |
|
| 68 | - echo elgg_view('b_extended_profile/about-me'); |
|
| 69 | - finit_ajax_block('about-me'); |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - if ( has_content($user, 'education') ) { |
|
| 73 | - init_ajax_block(elgg_echo('gcconnex_profile:education'), 'education', $user); |
|
| 74 | - echo elgg_view('b_extended_profile/education'); |
|
| 75 | - finit_ajax_block('education'); |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - if ( has_content($user, 'work') ) { |
|
| 79 | - init_ajax_block(elgg_echo('gcconnex_profile:experience'), 'work-experience', $user); |
|
| 80 | - echo elgg_view('b_extended_profile/work-experience'); |
|
| 81 | - finit_ajax_block('work-experience'); |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - //if(elgg_is_logged_in()){ |
|
| 85 | - if ( has_content($user, 'gc_skills') ) { |
|
| 86 | - init_ajax_block(elgg_echo('gcconnex_profile:gc_skills'), 'skills', $user); |
|
| 87 | - echo elgg_view('b_extended_profile/skills'); |
|
| 88 | - finit_ajax_block('skills'); |
|
| 89 | - } |
|
| 90 | - //} |
|
| 91 | - |
|
| 92 | - /* |
|
| 51 | + echo '<div>'; |
|
| 52 | + |
|
| 53 | + //add additional tabs |
|
| 54 | + echo elgg_view('profile/profile_tab_menu'); |
|
| 55 | + |
|
| 56 | + echo '<div class="tab-content">'; |
|
| 57 | + if (empty($_GET['pg'])) { |
|
| 58 | + $pg = ''; |
|
| 59 | + echo '<div role="tabpanel" class="tab-pane active" tabindex="-1" id="profile-display">'; |
|
| 60 | + } |
|
| 61 | + else{ |
|
| 62 | + $pg = $_GET['pg']; |
|
| 63 | + echo '<div role="tabpanel" class="tab-pane " tabindex="-1" id="profile-display">'; |
|
| 64 | + } |
|
| 65 | + |
|
| 66 | + if ( has_content($user, 'description') ) { |
|
| 67 | + init_ajax_block(elgg_echo('gcconnex_profile:about_me'), 'about-me', $user); |
|
| 68 | + echo elgg_view('b_extended_profile/about-me'); |
|
| 69 | + finit_ajax_block('about-me'); |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + if ( has_content($user, 'education') ) { |
|
| 73 | + init_ajax_block(elgg_echo('gcconnex_profile:education'), 'education', $user); |
|
| 74 | + echo elgg_view('b_extended_profile/education'); |
|
| 75 | + finit_ajax_block('education'); |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + if ( has_content($user, 'work') ) { |
|
| 79 | + init_ajax_block(elgg_echo('gcconnex_profile:experience'), 'work-experience', $user); |
|
| 80 | + echo elgg_view('b_extended_profile/work-experience'); |
|
| 81 | + finit_ajax_block('work-experience'); |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + //if(elgg_is_logged_in()){ |
|
| 85 | + if ( has_content($user, 'gc_skills') ) { |
|
| 86 | + init_ajax_block(elgg_echo('gcconnex_profile:gc_skills'), 'skills', $user); |
|
| 87 | + echo elgg_view('b_extended_profile/skills'); |
|
| 88 | + finit_ajax_block('skills'); |
|
| 89 | + } |
|
| 90 | + //} |
|
| 91 | + |
|
| 92 | + /* |
|
| 93 | 93 | * MODIFIED CODE |
| 94 | 94 | * Constructs the opt-in section according to the original plugin methodology. |
| 95 | 95 | */ |
| 96 | - if(elgg_is_active_plugin('missions') && $user->opt_in_missions == 'gcconnex_profile:opt:yes') { |
|
| 97 | - echo elgg_view('missions/completed-missions'); |
|
| 98 | - } |
|
| 99 | - /* |
|
| 96 | + if(elgg_is_active_plugin('missions') && $user->opt_in_missions == 'gcconnex_profile:opt:yes') { |
|
| 97 | + echo elgg_view('missions/completed-missions'); |
|
| 98 | + } |
|
| 99 | + /* |
|
| 100 | 100 | * END MODIFIED CODE |
| 101 | 101 | */ |
| 102 | 102 | |
| 103 | - /* |
|
| 103 | + /* |
|
| 104 | 104 | if ( has_content($user, 'english') || has_content($user, 'french') ) { |
| 105 | 105 | init_ajax_block(elgg_echo('gcconnex_profile:sle'), 'languages', $user); |
| 106 | 106 | echo elgg_view('b_extended_profile/languages'); |
@@ -108,104 +108,104 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | */ |
| 110 | 110 | |
| 111 | - /* |
|
| 111 | + /* |
|
| 112 | 112 | * MODIFIED CODE |
| 113 | 113 | * Constructs the opt-in section according to the original plugin methodology. |
| 114 | 114 | */ |
| 115 | - if(has_content($user, 'opt-in')) { |
|
| 116 | - init_ajax_block(elgg_echo('gcconnex_profile:opt:opt-in'), 'opt-in', $user); |
|
| 117 | - echo elgg_view('b_extended_profile/opt-in'); |
|
| 118 | - finit_ajax_block('opt-in'); |
|
| 119 | - } |
|
| 120 | - /* |
|
| 115 | + if(has_content($user, 'opt-in')) { |
|
| 116 | + init_ajax_block(elgg_echo('gcconnex_profile:opt:opt-in'), 'opt-in', $user); |
|
| 117 | + echo elgg_view('b_extended_profile/opt-in'); |
|
| 118 | + finit_ajax_block('opt-in'); |
|
| 119 | + } |
|
| 120 | + /* |
|
| 121 | 121 | * END MODIFIED CODE |
| 122 | 122 | */ |
| 123 | 123 | |
| 124 | - // create the div wrappers and edit/save/cancel toggles for each profile section |
|
| 125 | - |
|
| 126 | - echo '</div>'; //close div id=#profile-display |
|
| 127 | - |
|
| 128 | - if (empty($_GET['pg'])) { |
|
| 129 | - $pg = ''; |
|
| 130 | - echo '<div role="tabpanel" class="tab-pane clearfix" tabindex="-1" id="splashboard">'; |
|
| 131 | - } |
|
| 132 | - else{ |
|
| 133 | - $pg = $_GET['pg']; |
|
| 134 | - echo '<div role="tabpanel" class="tab-pane active clearfix" tabindex="-1" id="splashboard">'; |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - echo '<h2 class="wb-inv">'.$user->name."'s widgets</h2>"; |
|
| 138 | - |
|
| 139 | - $num_columns = elgg_extract('num_columns', $vars, 2); |
|
| 140 | - $show_add_widgets = elgg_extract('show_add_widgets', $vars, true); |
|
| 141 | - $exact_match = elgg_extract('exact_match', $vars, false); |
|
| 142 | - $show_access = elgg_extract('show_access', $vars, true); |
|
| 143 | - |
|
| 144 | - $owner = elgg_get_page_owner_entity(); |
|
| 145 | - |
|
| 146 | - $widget_types = elgg_get_widget_types(); |
|
| 147 | - |
|
| 148 | - $context = elgg_get_context(); |
|
| 149 | - elgg_push_context('widgets'); |
|
| 150 | - |
|
| 151 | - $widgets = elgg_get_widgets($owner->guid, $context); |
|
| 152 | - |
|
| 153 | - if (elgg_can_edit_widget_layout($context)) { |
|
| 154 | - |
|
| 155 | - $params = array( |
|
| 156 | - 'widgets' => $widgets, |
|
| 157 | - 'context' => $context, |
|
| 158 | - 'exact_match' => $exact_match, |
|
| 159 | - 'show_access' => $show_access, |
|
| 160 | - ); |
|
| 161 | - echo elgg_view('page/layouts/widgets/add_panel', $params); |
|
| 162 | - } |
|
| 163 | - if (elgg_can_edit_widget_layout($context)) { |
|
| 164 | - if ($show_add_widgets) { |
|
| 165 | - echo elgg_view('page/layouts/widgets/add_button'); |
|
| 166 | - } |
|
| 167 | - |
|
| 168 | - $params = array( |
|
| 169 | - 'widgets' => $widgets, |
|
| 170 | - 'context' => $context, |
|
| 171 | - 'exact_match' => $exact_match, |
|
| 172 | - ); |
|
| 173 | - echo elgg_view('page/layouts/widgets/add_panel', $params); |
|
| 174 | - } |
|
| 175 | - $widget_class = "elgg-col-1of{$num_columns}"; |
|
| 176 | - for ($column_index = 1; $column_index <= $num_columns; $column_index++) { |
|
| 177 | - if (isset($widgets[$column_index])) { |
|
| 178 | - $column_widgets = $widgets[$column_index]; |
|
| 179 | - } else { |
|
| 180 | - $column_widgets = array(); |
|
| 181 | - } |
|
| 182 | - |
|
| 183 | - echo "<div class=\"$widget_class elgg-widgets col-sm-6 col-xs-12 widget-area-col\" id=\"elgg-widget-col-$column_index\">"; |
|
| 184 | - if (sizeof($column_widgets) > 0) { |
|
| 185 | - foreach ($column_widgets as $widget) { |
|
| 186 | - if (array_key_exists($widget->handler, $widget_types)) { |
|
| 187 | - echo elgg_view_entity($widget, array('show_access' => $show_access)); |
|
| 188 | - } |
|
| 189 | - } |
|
| 190 | - } |
|
| 191 | - echo '</div>'; |
|
| 192 | - } |
|
| 193 | - elgg_pop_context(); |
|
| 194 | - echo '</div>'; // close div id="splashboard" |
|
| 195 | - |
|
| 196 | - |
|
| 197 | - echo '<div role="tabpanel" class="tab-pane" tabindex="-1" id="portfolio">'; |
|
| 198 | - |
|
| 199 | - init_ajax_block(elgg_echo('gcconnex_profile:portfolio'), 'portfolio', $user); |
|
| 200 | - echo elgg_view('b_extended_profile/portfolio'); // call the proper view for the section |
|
| 201 | - finit_ajax_block('portfolio'); |
|
| 202 | - echo '</div>'; // close div id="#portfolio" |
|
| 203 | - |
|
| 204 | - //add tab panels with preview content |
|
| 205 | - echo elgg_view('profile/tab-content'); |
|
| 206 | - |
|
| 207 | - echo '</div>'; // close div class="tab-content' |
|
| 208 | - echo '</div>'; // close div role="tabpanel" |
|
| 209 | - ?> |
|
| 124 | + // create the div wrappers and edit/save/cancel toggles for each profile section |
|
| 125 | + |
|
| 126 | + echo '</div>'; //close div id=#profile-display |
|
| 127 | + |
|
| 128 | + if (empty($_GET['pg'])) { |
|
| 129 | + $pg = ''; |
|
| 130 | + echo '<div role="tabpanel" class="tab-pane clearfix" tabindex="-1" id="splashboard">'; |
|
| 131 | + } |
|
| 132 | + else{ |
|
| 133 | + $pg = $_GET['pg']; |
|
| 134 | + echo '<div role="tabpanel" class="tab-pane active clearfix" tabindex="-1" id="splashboard">'; |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + echo '<h2 class="wb-inv">'.$user->name."'s widgets</h2>"; |
|
| 138 | + |
|
| 139 | + $num_columns = elgg_extract('num_columns', $vars, 2); |
|
| 140 | + $show_add_widgets = elgg_extract('show_add_widgets', $vars, true); |
|
| 141 | + $exact_match = elgg_extract('exact_match', $vars, false); |
|
| 142 | + $show_access = elgg_extract('show_access', $vars, true); |
|
| 143 | + |
|
| 144 | + $owner = elgg_get_page_owner_entity(); |
|
| 145 | + |
|
| 146 | + $widget_types = elgg_get_widget_types(); |
|
| 147 | + |
|
| 148 | + $context = elgg_get_context(); |
|
| 149 | + elgg_push_context('widgets'); |
|
| 150 | + |
|
| 151 | + $widgets = elgg_get_widgets($owner->guid, $context); |
|
| 152 | + |
|
| 153 | + if (elgg_can_edit_widget_layout($context)) { |
|
| 154 | + |
|
| 155 | + $params = array( |
|
| 156 | + 'widgets' => $widgets, |
|
| 157 | + 'context' => $context, |
|
| 158 | + 'exact_match' => $exact_match, |
|
| 159 | + 'show_access' => $show_access, |
|
| 160 | + ); |
|
| 161 | + echo elgg_view('page/layouts/widgets/add_panel', $params); |
|
| 162 | + } |
|
| 163 | + if (elgg_can_edit_widget_layout($context)) { |
|
| 164 | + if ($show_add_widgets) { |
|
| 165 | + echo elgg_view('page/layouts/widgets/add_button'); |
|
| 166 | + } |
|
| 167 | + |
|
| 168 | + $params = array( |
|
| 169 | + 'widgets' => $widgets, |
|
| 170 | + 'context' => $context, |
|
| 171 | + 'exact_match' => $exact_match, |
|
| 172 | + ); |
|
| 173 | + echo elgg_view('page/layouts/widgets/add_panel', $params); |
|
| 174 | + } |
|
| 175 | + $widget_class = "elgg-col-1of{$num_columns}"; |
|
| 176 | + for ($column_index = 1; $column_index <= $num_columns; $column_index++) { |
|
| 177 | + if (isset($widgets[$column_index])) { |
|
| 178 | + $column_widgets = $widgets[$column_index]; |
|
| 179 | + } else { |
|
| 180 | + $column_widgets = array(); |
|
| 181 | + } |
|
| 182 | + |
|
| 183 | + echo "<div class=\"$widget_class elgg-widgets col-sm-6 col-xs-12 widget-area-col\" id=\"elgg-widget-col-$column_index\">"; |
|
| 184 | + if (sizeof($column_widgets) > 0) { |
|
| 185 | + foreach ($column_widgets as $widget) { |
|
| 186 | + if (array_key_exists($widget->handler, $widget_types)) { |
|
| 187 | + echo elgg_view_entity($widget, array('show_access' => $show_access)); |
|
| 188 | + } |
|
| 189 | + } |
|
| 190 | + } |
|
| 191 | + echo '</div>'; |
|
| 192 | + } |
|
| 193 | + elgg_pop_context(); |
|
| 194 | + echo '</div>'; // close div id="splashboard" |
|
| 195 | + |
|
| 196 | + |
|
| 197 | + echo '<div role="tabpanel" class="tab-pane" tabindex="-1" id="portfolio">'; |
|
| 198 | + |
|
| 199 | + init_ajax_block(elgg_echo('gcconnex_profile:portfolio'), 'portfolio', $user); |
|
| 200 | + echo elgg_view('b_extended_profile/portfolio'); // call the proper view for the section |
|
| 201 | + finit_ajax_block('portfolio'); |
|
| 202 | + echo '</div>'; // close div id="#portfolio" |
|
| 203 | + |
|
| 204 | + //add tab panels with preview content |
|
| 205 | + echo elgg_view('profile/tab-content'); |
|
| 206 | + |
|
| 207 | + echo '</div>'; // close div class="tab-content' |
|
| 208 | + echo '</div>'; // close div role="tabpanel" |
|
| 209 | + ?> |
|
| 210 | 210 | </div> |
| 211 | 211 | </div> |
@@ -8,164 +8,164 @@ |
||
| 8 | 8 | $user_display_name = elgg_get_page_owner_entity()->name; |
| 9 | 9 | foreach($fields as $field){ |
| 10 | 10 | |
| 11 | - echo '<div role="tabpanel" tabindex="-1" class="tab-pane fade-in" id="' . strtolower($field) . '">'; |
|
| 12 | - |
|
| 13 | - $options = array( |
|
| 14 | - 'type' => 'object', |
|
| 15 | - 'subtype' => strtolower($field), |
|
| 16 | - 'container_guid' => elgg_get_page_owner_entity()->guid, |
|
| 17 | - 'limit' => 5, |
|
| 18 | - 'full_view' => false, |
|
| 19 | - 'pagination' => false, |
|
| 20 | - 'distinct' => false, |
|
| 21 | - ); |
|
| 22 | - |
|
| 23 | - $content = elgg_list_entities($options); |
|
| 24 | - |
|
| 25 | - //fix field to allow proper URLs |
|
| 26 | - //pick appropriate messages |
|
| 27 | - switch($field){ |
|
| 28 | - case 'File': |
|
| 29 | - $title = elgg_echo('file:user', array($user_display_name)); |
|
| 30 | - $add = elgg_echo('file:add'); |
|
| 31 | - $message = elgg_echo('file:none'); |
|
| 32 | - break; |
|
| 33 | - case 'Blog': |
|
| 34 | - $title = elgg_echo('blog:title:user_blogs', array($user_display_name)); |
|
| 35 | - $add = elgg_echo('blog:add'); |
|
| 36 | - $message = elgg_echo('blog:noblogs'); |
|
| 37 | - break; |
|
| 38 | - case 'Bookmarks': |
|
| 39 | - $title = elgg_echo('bookmarks:owner', array($user_display_name)); |
|
| 40 | - $add = elgg_echo('bookmarks:add'); |
|
| 41 | - $message = elgg_echo('bookmarks:none'); |
|
| 42 | - break; |
|
| 43 | - case 'Thewire': |
|
| 44 | - $title = elgg_echo('thewire:user', array($user_display_name)); |
|
| 45 | - $message = elgg_echo('thewire:noposts'); |
|
| 46 | - break; |
|
| 47 | - case 'page_top': |
|
| 48 | - $title = elgg_echo('pages:owner', array($user_display_name)); |
|
| 49 | - $add = elgg_echo('pages:add'); |
|
| 50 | - $message = elgg_echo('pages:none'); |
|
| 51 | - $field = "pages"; |
|
| 52 | - break; |
|
| 53 | - case 'task_top': |
|
| 54 | - $title = elgg_echo('tasks:user', array($user_display_name)); |
|
| 55 | - $add = elgg_echo('tasks:add'); |
|
| 56 | - $message = elgg_echo('tasks:none'); |
|
| 57 | - $field = "tasks"; |
|
| 58 | - break; |
|
| 59 | - case 'Poll': |
|
| 60 | - $title = elgg_echo('polls:user', array($user_display_name)); |
|
| 61 | - $add = elgg_echo('polls:add'); |
|
| 62 | - $message = elgg_echo('polls:none'); |
|
| 63 | - $field = "polls"; |
|
| 64 | - break; |
|
| 65 | - case 'Album': |
|
| 66 | - $title = elgg_echo('album:user', array($user_display_name)); |
|
| 67 | - $add = elgg_echo('photos:add'); |
|
| 68 | - $message = elgg_echo('tidypics:widget:no_albums'); |
|
| 69 | - $field = "photos"; |
|
| 70 | - break; |
|
| 71 | - case 'question': |
|
| 72 | - $title = elgg_echo('questions:owner', array($user_display_name)); |
|
| 73 | - $add = elgg_echo('questions:add'); |
|
| 74 | - $message = elgg_echo('questions:none'); |
|
| 75 | - $field = 'questions'; |
|
| 76 | - break; |
|
| 77 | - case 'etherpad': |
|
| 78 | - $title = elgg_echo('etherpad:owner', array($user_display_name)); |
|
| 79 | - $add = elgg_echo('etherpad:add'); |
|
| 80 | - $message = elgg_echo('etherpad:none'); |
|
| 81 | - $field = 'docs'; |
|
| 82 | - break; |
|
| 83 | - } |
|
| 84 | - |
|
| 85 | - if(elgg_get_page_owner_entity()->canEdit()){ |
|
| 86 | - |
|
| 87 | - echo '<h2 class="wb-invisible" tabindex="-1">'.$title.'</h2>'; |
|
| 88 | - |
|
| 89 | - //dont display add button on The Wire panel |
|
| 90 | - if($field == 'Thewire'){ |
|
| 91 | - //do nothing |
|
| 92 | - } else { |
|
| 93 | - |
|
| 94 | - //display add button |
|
| 95 | - echo '<div class="text-right">'; |
|
| 96 | - $action = strtolower($field) . "/add/" . elgg_get_page_owner_entity()->guid; |
|
| 97 | - $addButton = elgg_view('output/url', array( |
|
| 98 | - 'href' => $action, |
|
| 99 | - 'text' => $add, |
|
| 100 | - 'is_trusted' => true, |
|
| 101 | - 'class' => 'btn btn-primary', |
|
| 102 | - )); |
|
| 103 | - |
|
| 104 | - //for files we want an additional add folder button |
|
| 105 | - if($field == 'File' && elgg_get_plugin_setting("user_folder_structure", "file_tools") == 'yes'){ |
|
| 106 | - //create new foldr button |
|
| 107 | - $new_folder = elgg_view('output/url', array( |
|
| 108 | - 'name' => 'new_folder', |
|
| 109 | - 'text' => elgg_echo("file_tools:new:title"), |
|
| 110 | - 'href' => "#", |
|
| 111 | - "id" => "file_tools_list_new_folder_toggle", |
|
| 112 | - 'class' => 'btn btn-default mrgn-rght-sm', |
|
| 113 | - )); |
|
| 114 | - |
|
| 115 | - //add new folder to add button |
|
| 116 | - $addButton = $new_folder.$addButton; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - echo $addButton; |
|
| 120 | - echo '</div>'; |
|
| 121 | - |
|
| 122 | - } |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - if(!$content){ |
|
| 126 | - echo '<div class="mrgn-lft-sm mrgn-bttm-md">' . $message . '</div>'; |
|
| 127 | - } else { |
|
| 128 | - echo $content; |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - $url = strtolower($field) . "/owner/" . elgg_get_page_owner_entity()->username; |
|
| 132 | - $more_link = elgg_view('output/url', array( |
|
| 133 | - 'href' => $url, |
|
| 134 | - 'text' => elgg_echo('link:view:all'), |
|
| 135 | - 'is_trusted' => true, |
|
| 136 | - 'class' => 'text-center btn btn-default center-block', |
|
| 137 | - )); |
|
| 138 | - |
|
| 139 | - echo '<div class="panel-footer text-right">' . $more_link . '</div>'; |
|
| 140 | - echo '</div>'; |
|
| 11 | + echo '<div role="tabpanel" tabindex="-1" class="tab-pane fade-in" id="' . strtolower($field) . '">'; |
|
| 12 | + |
|
| 13 | + $options = array( |
|
| 14 | + 'type' => 'object', |
|
| 15 | + 'subtype' => strtolower($field), |
|
| 16 | + 'container_guid' => elgg_get_page_owner_entity()->guid, |
|
| 17 | + 'limit' => 5, |
|
| 18 | + 'full_view' => false, |
|
| 19 | + 'pagination' => false, |
|
| 20 | + 'distinct' => false, |
|
| 21 | + ); |
|
| 22 | + |
|
| 23 | + $content = elgg_list_entities($options); |
|
| 24 | + |
|
| 25 | + //fix field to allow proper URLs |
|
| 26 | + //pick appropriate messages |
|
| 27 | + switch($field){ |
|
| 28 | + case 'File': |
|
| 29 | + $title = elgg_echo('file:user', array($user_display_name)); |
|
| 30 | + $add = elgg_echo('file:add'); |
|
| 31 | + $message = elgg_echo('file:none'); |
|
| 32 | + break; |
|
| 33 | + case 'Blog': |
|
| 34 | + $title = elgg_echo('blog:title:user_blogs', array($user_display_name)); |
|
| 35 | + $add = elgg_echo('blog:add'); |
|
| 36 | + $message = elgg_echo('blog:noblogs'); |
|
| 37 | + break; |
|
| 38 | + case 'Bookmarks': |
|
| 39 | + $title = elgg_echo('bookmarks:owner', array($user_display_name)); |
|
| 40 | + $add = elgg_echo('bookmarks:add'); |
|
| 41 | + $message = elgg_echo('bookmarks:none'); |
|
| 42 | + break; |
|
| 43 | + case 'Thewire': |
|
| 44 | + $title = elgg_echo('thewire:user', array($user_display_name)); |
|
| 45 | + $message = elgg_echo('thewire:noposts'); |
|
| 46 | + break; |
|
| 47 | + case 'page_top': |
|
| 48 | + $title = elgg_echo('pages:owner', array($user_display_name)); |
|
| 49 | + $add = elgg_echo('pages:add'); |
|
| 50 | + $message = elgg_echo('pages:none'); |
|
| 51 | + $field = "pages"; |
|
| 52 | + break; |
|
| 53 | + case 'task_top': |
|
| 54 | + $title = elgg_echo('tasks:user', array($user_display_name)); |
|
| 55 | + $add = elgg_echo('tasks:add'); |
|
| 56 | + $message = elgg_echo('tasks:none'); |
|
| 57 | + $field = "tasks"; |
|
| 58 | + break; |
|
| 59 | + case 'Poll': |
|
| 60 | + $title = elgg_echo('polls:user', array($user_display_name)); |
|
| 61 | + $add = elgg_echo('polls:add'); |
|
| 62 | + $message = elgg_echo('polls:none'); |
|
| 63 | + $field = "polls"; |
|
| 64 | + break; |
|
| 65 | + case 'Album': |
|
| 66 | + $title = elgg_echo('album:user', array($user_display_name)); |
|
| 67 | + $add = elgg_echo('photos:add'); |
|
| 68 | + $message = elgg_echo('tidypics:widget:no_albums'); |
|
| 69 | + $field = "photos"; |
|
| 70 | + break; |
|
| 71 | + case 'question': |
|
| 72 | + $title = elgg_echo('questions:owner', array($user_display_name)); |
|
| 73 | + $add = elgg_echo('questions:add'); |
|
| 74 | + $message = elgg_echo('questions:none'); |
|
| 75 | + $field = 'questions'; |
|
| 76 | + break; |
|
| 77 | + case 'etherpad': |
|
| 78 | + $title = elgg_echo('etherpad:owner', array($user_display_name)); |
|
| 79 | + $add = elgg_echo('etherpad:add'); |
|
| 80 | + $message = elgg_echo('etherpad:none'); |
|
| 81 | + $field = 'docs'; |
|
| 82 | + break; |
|
| 83 | + } |
|
| 84 | + |
|
| 85 | + if(elgg_get_page_owner_entity()->canEdit()){ |
|
| 86 | + |
|
| 87 | + echo '<h2 class="wb-invisible" tabindex="-1">'.$title.'</h2>'; |
|
| 88 | + |
|
| 89 | + //dont display add button on The Wire panel |
|
| 90 | + if($field == 'Thewire'){ |
|
| 91 | + //do nothing |
|
| 92 | + } else { |
|
| 93 | + |
|
| 94 | + //display add button |
|
| 95 | + echo '<div class="text-right">'; |
|
| 96 | + $action = strtolower($field) . "/add/" . elgg_get_page_owner_entity()->guid; |
|
| 97 | + $addButton = elgg_view('output/url', array( |
|
| 98 | + 'href' => $action, |
|
| 99 | + 'text' => $add, |
|
| 100 | + 'is_trusted' => true, |
|
| 101 | + 'class' => 'btn btn-primary', |
|
| 102 | + )); |
|
| 103 | + |
|
| 104 | + //for files we want an additional add folder button |
|
| 105 | + if($field == 'File' && elgg_get_plugin_setting("user_folder_structure", "file_tools") == 'yes'){ |
|
| 106 | + //create new foldr button |
|
| 107 | + $new_folder = elgg_view('output/url', array( |
|
| 108 | + 'name' => 'new_folder', |
|
| 109 | + 'text' => elgg_echo("file_tools:new:title"), |
|
| 110 | + 'href' => "#", |
|
| 111 | + "id" => "file_tools_list_new_folder_toggle", |
|
| 112 | + 'class' => 'btn btn-default mrgn-rght-sm', |
|
| 113 | + )); |
|
| 114 | + |
|
| 115 | + //add new folder to add button |
|
| 116 | + $addButton = $new_folder.$addButton; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + echo $addButton; |
|
| 120 | + echo '</div>'; |
|
| 121 | + |
|
| 122 | + } |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + if(!$content){ |
|
| 126 | + echo '<div class="mrgn-lft-sm mrgn-bttm-md">' . $message . '</div>'; |
|
| 127 | + } else { |
|
| 128 | + echo $content; |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + $url = strtolower($field) . "/owner/" . elgg_get_page_owner_entity()->username; |
|
| 132 | + $more_link = elgg_view('output/url', array( |
|
| 133 | + 'href' => $url, |
|
| 134 | + 'text' => elgg_echo('link:view:all'), |
|
| 135 | + 'is_trusted' => true, |
|
| 136 | + 'class' => 'text-center btn btn-default center-block', |
|
| 137 | + )); |
|
| 138 | + |
|
| 139 | + echo '<div class="panel-footer text-right">' . $more_link . '</div>'; |
|
| 140 | + echo '</div>'; |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | //event calendar tab |
| 144 | 144 | echo '<div role="tabpanel" tabindex="-1" class="tab-pane fade-in" id="events">'; |
| 145 | - echo '<div class="clearfix">'; |
|
| 146 | - echo '<h2 class="wb-invisible" tabindex="-1">'.elgg_echo('event_calendar:listing_title:mine', array($user_display_name)).'</h2>'; |
|
| 147 | - if(elgg_is_active_plugin('event_calendar')){ |
|
| 148 | - $events = event_calendar_get_personal_events_for_user(elgg_get_page_owner_guid(), 5); |
|
| 149 | - } |
|
| 150 | - |
|
| 151 | - if(!$events){ |
|
| 152 | - echo '<div class="mrgn-lft-sm mrgn-bttm-md">' . elgg_echo('event_calendar:no_events_found') . '</div>'; |
|
| 153 | - } |
|
| 154 | - |
|
| 155 | - foreach($events as $event) { |
|
| 156 | - echo elgg_view("object/event_calendar", array('entity' => $event)); |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - $date = date('Y-m-d'/*, strtotime("-1 days")*/); |
|
| 160 | - $event_url = "event_calendar/owner/". elgg_get_page_owner_entity()->username; |
|
| 161 | - $viewall_link = elgg_view('output/url', array( |
|
| 162 | - 'href' => $event_url, |
|
| 163 | - 'text' => elgg_echo('link:view:all'), |
|
| 164 | - 'is_trusted' => true, |
|
| 165 | - 'class' => 'text-center btn btn-default center-block', |
|
| 166 | - )); |
|
| 167 | - echo '</div>'; |
|
| 168 | - echo "<div class=\"elgg-widget-more panel-footer text-right\">$viewall_link</div>"; |
|
| 145 | + echo '<div class="clearfix">'; |
|
| 146 | + echo '<h2 class="wb-invisible" tabindex="-1">'.elgg_echo('event_calendar:listing_title:mine', array($user_display_name)).'</h2>'; |
|
| 147 | + if(elgg_is_active_plugin('event_calendar')){ |
|
| 148 | + $events = event_calendar_get_personal_events_for_user(elgg_get_page_owner_guid(), 5); |
|
| 149 | + } |
|
| 150 | + |
|
| 151 | + if(!$events){ |
|
| 152 | + echo '<div class="mrgn-lft-sm mrgn-bttm-md">' . elgg_echo('event_calendar:no_events_found') . '</div>'; |
|
| 153 | + } |
|
| 154 | + |
|
| 155 | + foreach($events as $event) { |
|
| 156 | + echo elgg_view("object/event_calendar", array('entity' => $event)); |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + $date = date('Y-m-d'/*, strtotime("-1 days")*/); |
|
| 160 | + $event_url = "event_calendar/owner/". elgg_get_page_owner_entity()->username; |
|
| 161 | + $viewall_link = elgg_view('output/url', array( |
|
| 162 | + 'href' => $event_url, |
|
| 163 | + 'text' => elgg_echo('link:view:all'), |
|
| 164 | + 'is_trusted' => true, |
|
| 165 | + 'class' => 'text-center btn btn-default center-block', |
|
| 166 | + )); |
|
| 167 | + echo '</div>'; |
|
| 168 | + echo "<div class=\"elgg-widget-more panel-footer text-right\">$viewall_link</div>"; |
|
| 169 | 169 | echo '</div>'; |
| 170 | 170 | elgg_pop_context(); |
| 171 | 171 | ?> |
| 172 | 172 | \ No newline at end of file |
@@ -10,21 +10,21 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | // if skills isn't empty, display them so that the user can use them as a guide |
| 12 | 12 | if ($user->skills != NULL && $user->skillsupgraded == NULL) { |
| 13 | - if(elgg_get_logged_in_user_entity() == elgg_get_page_owner_entity()){ |
|
| 14 | - echo '<div class="gcconnex-old-skills">'; |
|
| 15 | - echo '<div class="gcconnex-old-skills-message">' . elgg_echo('gcconnex_profile:gc_skill:leftover') . '</div>'; |
|
| 16 | - echo '<div class="gcconnex-old-skills-display">'; |
|
| 13 | + if(elgg_get_logged_in_user_entity() == elgg_get_page_owner_entity()){ |
|
| 14 | + echo '<div class="gcconnex-old-skills">'; |
|
| 15 | + echo '<div class="gcconnex-old-skills-message">' . elgg_echo('gcconnex_profile:gc_skill:leftover') . '</div>'; |
|
| 16 | + echo '<div class="gcconnex-old-skills-display">'; |
|
| 17 | 17 | |
| 18 | - if (is_array($user->skills)) { |
|
| 19 | - foreach ($user->skills as $oldskill) |
|
| 20 | - echo $oldskill . '<br>'; |
|
| 21 | - } |
|
| 18 | + if (is_array($user->skills)) { |
|
| 19 | + foreach ($user->skills as $oldskill) |
|
| 20 | + echo $oldskill . '<br>'; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - echo '</div><br>'; // close div class="gcconnex-old-skills-display |
|
| 24 | - echo '<span class="gcconnex-old-skills-stop-showing gcconnex-profile-button" onclick="removeOldSkills()">Stop showing me this message.</span>'; |
|
| 25 | - echo '</div>'; // close div class="gcconnex-old-skills" |
|
| 23 | + echo '</div><br>'; // close div class="gcconnex-old-skills-display |
|
| 24 | + echo '<span class="gcconnex-old-skills-stop-showing gcconnex-profile-button" onclick="removeOldSkills()">Stop showing me this message.</span>'; |
|
| 25 | + echo '</div>'; // close div class="gcconnex-old-skills" |
|
| 26 | 26 | |
| 27 | - } |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | 29 | } |
| 30 | 30 | |
@@ -33,164 +33,164 @@ discard block |
||
| 33 | 33 | echo '<div class="gcconnex-profile-skills-display">'; |
| 34 | 34 | echo '<div class="gcconnex-skills-skills-list-wrapper">'; |
| 35 | 35 | if (elgg_is_logged_in()){ |
| 36 | - //elgg_get_logged_in_user_entity()->isFriendsWith($user->guid) |
|
| 37 | - //if ( elgg_get_logged_in_user_guid() != elgg_get_page_owner_guid() ) { |
|
| 38 | - if((elgg_get_logged_in_user_guid() != elgg_get_page_owner_guid()) && ($user->skill_access == ACCESS_PUBLIC || elgg_get_logged_in_user_entity()->isFriendsWith($user->guid) ) && ($user->skill_access != ACCESS_PRIVATE)) |
|
| 39 | - echo '<div class="gcconnex-skill-limit">' . elgg_echo('gcconnex_profile:gc_skill:click') . '</div>'; |
|
| 40 | - //} |
|
| 36 | + //elgg_get_logged_in_user_entity()->isFriendsWith($user->guid) |
|
| 37 | + //if ( elgg_get_logged_in_user_guid() != elgg_get_page_owner_guid() ) { |
|
| 38 | + if((elgg_get_logged_in_user_guid() != elgg_get_page_owner_guid()) && ($user->skill_access == ACCESS_PUBLIC || elgg_get_logged_in_user_entity()->isFriendsWith($user->guid) ) && ($user->skill_access != ACCESS_PRIVATE)) |
|
| 39 | + echo '<div class="gcconnex-skill-limit">' . elgg_echo('gcconnex_profile:gc_skill:click') . '</div>'; |
|
| 40 | + //} |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | if ($user->canEdit() && ($skill_guids == NULL || empty($skill_guids))) { |
| 44 | - echo elgg_echo('gcconnex_profile:gc_skill:empty'); |
|
| 44 | + echo elgg_echo('gcconnex_profile:gc_skill:empty'); |
|
| 45 | 45 | } |
| 46 | 46 | else { |
| 47 | - echo '<div class="gcconnex-skill-limit hidden">' . elgg_echo('gcconnex_profile:gc_skill:limit') . '</div>'; |
|
| 48 | - if (!(is_array($skill_guids))) { |
|
| 49 | - $skill_guids = array($skill_guids); |
|
| 50 | - } |
|
| 47 | + echo '<div class="gcconnex-skill-limit hidden">' . elgg_echo('gcconnex_profile:gc_skill:limit') . '</div>'; |
|
| 48 | + if (!(is_array($skill_guids))) { |
|
| 49 | + $skill_guids = array($skill_guids); |
|
| 50 | + } |
|
| 51 | 51 | // if the skill list isn't empty, and a logged-in user is viewing this page... show skills |
| 52 | - elgg_set_ignore_access(true); |
|
| 53 | - //if (elgg_is_logged_in()) { |
|
| 52 | + elgg_set_ignore_access(true); |
|
| 53 | + //if (elgg_is_logged_in()) { |
|
| 54 | 54 | |
| 55 | - |
|
| 56 | - for ($i=0; $i<20; $i++) { |
|
| 57 | - |
|
| 58 | - $skill_guid = $skill_guids[$i]; |
|
| 59 | - //error_log(get_entity($skill_guid)); |
|
| 60 | - if ($skill = get_entity($skill_guid)) { |
|
| 61 | - |
|
| 62 | - $skill_class = str_replace(' ', '-', strtolower($skill->title)); |
|
| 63 | - $endorsements = $skill->endorsements; |
|
| 64 | - $endorse_count = count($skill->endorsements); |
|
| 65 | - |
|
| 66 | - if (!(is_array($endorsements))) { |
|
| 67 | - $endorsements = array($endorsements); |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - if ($user->skill_access == ACCESS_PUBLIC || $user->skill_access == ACCESS_LOGGED_IN){ |
|
| 71 | - if (!elgg_is_logged_in() || elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()){ |
|
| 72 | - echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"><div class="skill-container clearfix" style="display:inline-block">'; |
|
| 73 | - echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 74 | - echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 75 | - |
|
| 76 | - }else{ |
|
| 77 | - if (in_array(elgg_get_logged_in_user_guid(), $endorsements) == false || empty($endorsements)) { |
|
| 78 | - // user has not yet endorsed this skill for this user.. present the option to endorse |
|
| 79 | - |
|
| 80 | - echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"> <div class="skill-container pointer gcconnex-endorsement-add clearfix" tabIndex="0" onclick="addEndorsement(this)" title="Endorse / Valider" style="display:inline-block" data-guid="' . $skill->guid . '" data-skill="' . $skill->title . '">'; |
|
| 81 | - echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 82 | - echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 83 | - |
|
| 84 | - |
|
| 85 | - } else { |
|
| 86 | - // user has endorsed this skill for this user.. present the option to retract endorsement |
|
| 87 | - |
|
| 88 | - echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"> <div class="skill-container pointer gcconnex-endorsement-retract clearfix" tabIndex="0" onclick="retractEndorsement(this)" title="Retract" style="display:inline-block" data-guid="' . $skill->guid . '" data-skill="' . $skill->title . '">'; |
|
| 89 | - echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 90 | - echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 91 | - |
|
| 92 | - } |
|
| 93 | - } |
|
| 94 | - echo '</div>'; // close div class="skill-container" |
|
| 95 | - |
|
| 96 | - if($endorse_count > 0){ |
|
| 97 | - echo '<div class="gcconnex-skill-endorsements clearfix" style="display:inline-block"><span class="wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:who').'</span>'; |
|
| 98 | - echo list_avatars(array( |
|
| 99 | - 'guids' => $skill->endorsements, |
|
| 100 | - 'size' => 'tiny', |
|
| 101 | - 'limit' => 4, |
|
| 102 | - 'id' => "myModal" . $i, |
|
| 103 | - 'skill_guid' => $skill_guid |
|
| 104 | - )); |
|
| 105 | - |
|
| 106 | - echo '</div>'; // close div class="gcconnex-skill-endorsements" |
|
| 107 | - } |
|
| 108 | - echo '</div>'; // close div class=gcconnex-skill-entry |
|
| 109 | - } |
|
| 110 | - if ($user->skill_access == ACCESS_FRIENDS){ |
|
| 111 | - if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()){ |
|
| 112 | - echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"><div class="skill-container clearfix" style="display:inline-block">'; |
|
| 113 | - |
|
| 114 | - echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 115 | - echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 116 | - |
|
| 117 | - echo '</div>'; // close div class="skill-container" |
|
| 118 | - |
|
| 119 | - if($endorse_count > 0){ |
|
| 120 | - echo '<div class="gcconnex-skill-endorsements clearfix" style="display:inline-block"><span class="wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:who').'</span>'; |
|
| 121 | - echo list_avatars(array( |
|
| 122 | - 'guids' => $skill->endorsements, |
|
| 123 | - 'size' => 'tiny', |
|
| 124 | - 'limit' => 4, |
|
| 125 | - 'id' => "myModal" . $i, |
|
| 126 | - 'skill_guid' => $skill_guid |
|
| 127 | - )); |
|
| 128 | - |
|
| 129 | - echo '</div>'; // close div class="gcconnex-skill-endorsements" |
|
| 130 | - } |
|
| 131 | - echo '</div>'; // close div class=gcconnex-skill-entry |
|
| 132 | - |
|
| 133 | - }elseif(elgg_is_logged_in()&& elgg_get_logged_in_user_entity()->isFriendsWith($user->guid)){ |
|
| 134 | - if (in_array(elgg_get_logged_in_user_guid(), $endorsements) == false || empty($endorsements)) { |
|
| 135 | - // user has not yet endorsed this skill for this user.. present the option to endorse |
|
| 136 | - |
|
| 137 | - echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"> <div class="skill-container pointer gcconnex-endorsement-add clearfix" tabIndex="0" onclick="addEndorsement(this)" title="Endorse / Valider" style="display:inline-block" data-guid="' . $skill->guid . '" data-skill="' . $skill->title . '">'; |
|
| 138 | - |
|
| 139 | - echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 140 | - echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 141 | - |
|
| 142 | - } else { |
|
| 143 | - // user has endorsed this skill for this user.. present the option to retract endorsement |
|
| 144 | - |
|
| 145 | - echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"> <div class="skill-container pointer gcconnex-endorsement-retract clearfix" tabIndex="0" onclick="retractEndorsement(this)" title="Retract" style="display:inline-block" data-guid="' . $skill->guid . '" data-skill="' . $skill->title . '">'; |
|
| 146 | - |
|
| 147 | - echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 148 | - echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 149 | - } |
|
| 150 | - echo '</div>'; // close div class="skill-container" |
|
| 151 | - |
|
| 152 | - if($endorse_count > 0){ |
|
| 153 | - echo '<div class="gcconnex-skill-endorsements clearfix" style="display:inline-block"><span class="wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:who').'</span>'; |
|
| 154 | - echo list_avatars(array( |
|
| 155 | - 'guids' => $skill->endorsements, |
|
| 156 | - 'size' => 'tiny', |
|
| 157 | - 'limit' => 4, |
|
| 158 | - 'id' => "myModal" . $i, |
|
| 159 | - 'skill_guid' => $skill_guid |
|
| 160 | - )); |
|
| 161 | - |
|
| 162 | - echo '</div>'; // close div class="gcconnex-skill-endorsements" |
|
| 163 | - } |
|
| 164 | - echo '</div>'; // close div class=gcconnex-skill-entry |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - } |
|
| 168 | - if ($user->skill_access == ACCESS_PRIVATE){ |
|
| 169 | - if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()){ |
|
| 170 | - echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"><div class="skill-container clearfix" style="display:inline-block">'; |
|
| 171 | - |
|
| 172 | - echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 173 | - echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 174 | - |
|
| 175 | - echo '</div>'; // close div class="skill-container" |
|
| 176 | - |
|
| 177 | - if($endorse_count > 0){ |
|
| 178 | - echo '<div class="gcconnex-skill-endorsements clearfix" style="display:inline-block"><span class="wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:who').'</span>'; |
|
| 179 | - echo list_avatars(array( |
|
| 180 | - 'guids' => $skill->endorsements, |
|
| 181 | - 'size' => 'tiny', |
|
| 182 | - 'limit' => 4, |
|
| 183 | - 'id' => "myModal" . $i, |
|
| 184 | - 'skill_guid' => $skill_guid |
|
| 185 | - )); |
|
| 186 | - |
|
| 187 | - echo '</div>'; // close div class="gcconnex-skill-endorsements" |
|
| 188 | - } |
|
| 189 | - echo '</div>'; // close div class=gcconnex-skill-entry |
|
| 190 | - |
|
| 191 | - } |
|
| 192 | - } |
|
| 193 | - /*if ( elgg_get_logged_in_user_guid() != elgg_get_page_owner_guid() ) { |
|
| 55 | + |
|
| 56 | + for ($i=0; $i<20; $i++) { |
|
| 57 | + |
|
| 58 | + $skill_guid = $skill_guids[$i]; |
|
| 59 | + //error_log(get_entity($skill_guid)); |
|
| 60 | + if ($skill = get_entity($skill_guid)) { |
|
| 61 | + |
|
| 62 | + $skill_class = str_replace(' ', '-', strtolower($skill->title)); |
|
| 63 | + $endorsements = $skill->endorsements; |
|
| 64 | + $endorse_count = count($skill->endorsements); |
|
| 65 | + |
|
| 66 | + if (!(is_array($endorsements))) { |
|
| 67 | + $endorsements = array($endorsements); |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + if ($user->skill_access == ACCESS_PUBLIC || $user->skill_access == ACCESS_LOGGED_IN){ |
|
| 71 | + if (!elgg_is_logged_in() || elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()){ |
|
| 72 | + echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"><div class="skill-container clearfix" style="display:inline-block">'; |
|
| 73 | + echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 74 | + echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 75 | + |
|
| 76 | + }else{ |
|
| 77 | + if (in_array(elgg_get_logged_in_user_guid(), $endorsements) == false || empty($endorsements)) { |
|
| 78 | + // user has not yet endorsed this skill for this user.. present the option to endorse |
|
| 79 | + |
|
| 80 | + echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"> <div class="skill-container pointer gcconnex-endorsement-add clearfix" tabIndex="0" onclick="addEndorsement(this)" title="Endorse / Valider" style="display:inline-block" data-guid="' . $skill->guid . '" data-skill="' . $skill->title . '">'; |
|
| 81 | + echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 82 | + echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 83 | + |
|
| 84 | + |
|
| 85 | + } else { |
|
| 86 | + // user has endorsed this skill for this user.. present the option to retract endorsement |
|
| 87 | + |
|
| 88 | + echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"> <div class="skill-container pointer gcconnex-endorsement-retract clearfix" tabIndex="0" onclick="retractEndorsement(this)" title="Retract" style="display:inline-block" data-guid="' . $skill->guid . '" data-skill="' . $skill->title . '">'; |
|
| 89 | + echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 90 | + echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 91 | + |
|
| 92 | + } |
|
| 93 | + } |
|
| 94 | + echo '</div>'; // close div class="skill-container" |
|
| 95 | + |
|
| 96 | + if($endorse_count > 0){ |
|
| 97 | + echo '<div class="gcconnex-skill-endorsements clearfix" style="display:inline-block"><span class="wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:who').'</span>'; |
|
| 98 | + echo list_avatars(array( |
|
| 99 | + 'guids' => $skill->endorsements, |
|
| 100 | + 'size' => 'tiny', |
|
| 101 | + 'limit' => 4, |
|
| 102 | + 'id' => "myModal" . $i, |
|
| 103 | + 'skill_guid' => $skill_guid |
|
| 104 | + )); |
|
| 105 | + |
|
| 106 | + echo '</div>'; // close div class="gcconnex-skill-endorsements" |
|
| 107 | + } |
|
| 108 | + echo '</div>'; // close div class=gcconnex-skill-entry |
|
| 109 | + } |
|
| 110 | + if ($user->skill_access == ACCESS_FRIENDS){ |
|
| 111 | + if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()){ |
|
| 112 | + echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"><div class="skill-container clearfix" style="display:inline-block">'; |
|
| 113 | + |
|
| 114 | + echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 115 | + echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 116 | + |
|
| 117 | + echo '</div>'; // close div class="skill-container" |
|
| 118 | + |
|
| 119 | + if($endorse_count > 0){ |
|
| 120 | + echo '<div class="gcconnex-skill-endorsements clearfix" style="display:inline-block"><span class="wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:who').'</span>'; |
|
| 121 | + echo list_avatars(array( |
|
| 122 | + 'guids' => $skill->endorsements, |
|
| 123 | + 'size' => 'tiny', |
|
| 124 | + 'limit' => 4, |
|
| 125 | + 'id' => "myModal" . $i, |
|
| 126 | + 'skill_guid' => $skill_guid |
|
| 127 | + )); |
|
| 128 | + |
|
| 129 | + echo '</div>'; // close div class="gcconnex-skill-endorsements" |
|
| 130 | + } |
|
| 131 | + echo '</div>'; // close div class=gcconnex-skill-entry |
|
| 132 | + |
|
| 133 | + }elseif(elgg_is_logged_in()&& elgg_get_logged_in_user_entity()->isFriendsWith($user->guid)){ |
|
| 134 | + if (in_array(elgg_get_logged_in_user_guid(), $endorsements) == false || empty($endorsements)) { |
|
| 135 | + // user has not yet endorsed this skill for this user.. present the option to endorse |
|
| 136 | + |
|
| 137 | + echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"> <div class="skill-container pointer gcconnex-endorsement-add clearfix" tabIndex="0" onclick="addEndorsement(this)" title="Endorse / Valider" style="display:inline-block" data-guid="' . $skill->guid . '" data-skill="' . $skill->title . '">'; |
|
| 138 | + |
|
| 139 | + echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 140 | + echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 141 | + |
|
| 142 | + } else { |
|
| 143 | + // user has endorsed this skill for this user.. present the option to retract endorsement |
|
| 144 | + |
|
| 145 | + echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"> <div class="skill-container pointer gcconnex-endorsement-retract clearfix" tabIndex="0" onclick="retractEndorsement(this)" title="Retract" style="display:inline-block" data-guid="' . $skill->guid . '" data-skill="' . $skill->title . '">'; |
|
| 146 | + |
|
| 147 | + echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 148 | + echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 149 | + } |
|
| 150 | + echo '</div>'; // close div class="skill-container" |
|
| 151 | + |
|
| 152 | + if($endorse_count > 0){ |
|
| 153 | + echo '<div class="gcconnex-skill-endorsements clearfix" style="display:inline-block"><span class="wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:who').'</span>'; |
|
| 154 | + echo list_avatars(array( |
|
| 155 | + 'guids' => $skill->endorsements, |
|
| 156 | + 'size' => 'tiny', |
|
| 157 | + 'limit' => 4, |
|
| 158 | + 'id' => "myModal" . $i, |
|
| 159 | + 'skill_guid' => $skill_guid |
|
| 160 | + )); |
|
| 161 | + |
|
| 162 | + echo '</div>'; // close div class="gcconnex-skill-endorsements" |
|
| 163 | + } |
|
| 164 | + echo '</div>'; // close div class=gcconnex-skill-entry |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + } |
|
| 168 | + if ($user->skill_access == ACCESS_PRIVATE){ |
|
| 169 | + if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()){ |
|
| 170 | + echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"><div class="skill-container clearfix" style="display:inline-block">'; |
|
| 171 | + |
|
| 172 | + echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
|
| 173 | + echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . $endorse_count . '<span class="gc-endorse-skill wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:endorsement').'</span></div>'; |
|
| 174 | + |
|
| 175 | + echo '</div>'; // close div class="skill-container" |
|
| 176 | + |
|
| 177 | + if($endorse_count > 0){ |
|
| 178 | + echo '<div class="gcconnex-skill-endorsements clearfix" style="display:inline-block"><span class="wb-invisible">'.elgg_echo('gcconnex_profile:gc_skill:who').'</span>'; |
|
| 179 | + echo list_avatars(array( |
|
| 180 | + 'guids' => $skill->endorsements, |
|
| 181 | + 'size' => 'tiny', |
|
| 182 | + 'limit' => 4, |
|
| 183 | + 'id' => "myModal" . $i, |
|
| 184 | + 'skill_guid' => $skill_guid |
|
| 185 | + )); |
|
| 186 | + |
|
| 187 | + echo '</div>'; // close div class="gcconnex-skill-endorsements" |
|
| 188 | + } |
|
| 189 | + echo '</div>'; // close div class=gcconnex-skill-entry |
|
| 190 | + |
|
| 191 | + } |
|
| 192 | + } |
|
| 193 | + /*if ( elgg_get_logged_in_user_guid() != elgg_get_page_owner_guid() ) { |
|
| 194 | 194 | |
| 195 | 195 | if (in_array(elgg_get_logged_in_user_guid(), $endorsements) == false || empty($endorsements)) { |
| 196 | 196 | // user has not yet endorsed this skill for this user.. present the option to endorse |
@@ -209,11 +209,11 @@ discard block |
||
| 209 | 209 | echo '<div class="gcconnex-endorsements-count gcconnex-endorsements-count-' . $skill_class . '">' . count($skill->endorsements) . '</div><div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>'; |
| 210 | 210 | }*/ |
| 211 | 211 | |
| 212 | - } |
|
| 213 | - } |
|
| 212 | + } |
|
| 213 | + } |
|
| 214 | 214 | |
| 215 | - //} |
|
| 216 | - elgg_set_ignore_access(false); |
|
| 215 | + //} |
|
| 216 | + elgg_set_ignore_access(false); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | echo '</div>'; |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if (elgg_is_xhr()) { |
| 3 | - $user_guid = $_GET["guid"]; |
|
| 3 | + $user_guid = $_GET["guid"]; |
|
| 4 | 4 | } |
| 5 | 5 | else { |
| 6 | - $user_guid = elgg_get_page_owner_guid(); |
|
| 6 | + $user_guid = elgg_get_page_owner_guid(); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | $user = get_user($user_guid); |
@@ -12,66 +12,66 @@ discard block |
||
| 12 | 12 | echo '<div class="gcconnex-profile-work-experience-display pull-left clearfix">'; |
| 13 | 13 | |
| 14 | 14 | if ($user->canEdit() && ($work_experience_guid == NULL || empty($work_experience_guid))) { |
| 15 | - echo elgg_echo('gcconnex_profile:experience:empty'); |
|
| 15 | + echo elgg_echo('gcconnex_profile:experience:empty'); |
|
| 16 | 16 | } |
| 17 | 17 | else { |
| 18 | - if (!(is_array($work_experience_guid))) { |
|
| 19 | - $work_experience_guid = array($work_experience_guid); |
|
| 20 | - } |
|
| 18 | + if (!(is_array($work_experience_guid))) { |
|
| 19 | + $work_experience_guid = array($work_experience_guid); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - usort($work_experience_guid, "sortDate"); |
|
| 22 | + usort($work_experience_guid, "sortDate"); |
|
| 23 | 23 | |
| 24 | - foreach ($work_experience_guid as $guid) { |
|
| 24 | + foreach ($work_experience_guid as $guid) { |
|
| 25 | 25 | |
| 26 | - if ($experience = get_entity($guid)) { |
|
| 27 | - echo '<div class="gcconnex-profile-label work-experience-title">' . htmlspecialchars_decode($experience->title) . '</div>'; |
|
| 28 | - echo '<div class="gcconnex-profile-label work-experience-organization">' . htmlspecialchars_decode($experience->organization) . '</div>'; |
|
| 26 | + if ($experience = get_entity($guid)) { |
|
| 27 | + echo '<div class="gcconnex-profile-label work-experience-title">' . htmlspecialchars_decode($experience->title) . '</div>'; |
|
| 28 | + echo '<div class="gcconnex-profile-label work-experience-organization">' . htmlspecialchars_decode($experience->organization) . '</div>'; |
|
| 29 | 29 | |
| 30 | - $cal_month = array( |
|
| 31 | - 1 => elgg_echo('gcconnex_profile:month:january'), |
|
| 32 | - 2 => elgg_echo('gcconnex_profile:month:february'), |
|
| 33 | - 3 => elgg_echo('gcconnex_profile:month:march'), |
|
| 34 | - 4 => elgg_echo('gcconnex_profile:month:april'), |
|
| 35 | - 5 => elgg_echo('gcconnex_profile:month:may'), |
|
| 36 | - 6 => elgg_echo('gcconnex_profile:month:june'), |
|
| 37 | - 7 => elgg_echo('gcconnex_profile:month:july'), |
|
| 38 | - 8 => elgg_echo('gcconnex_profile:month:august'), |
|
| 39 | - 9 => elgg_echo('gcconnex_profile:month:september'), |
|
| 40 | - 10 => elgg_echo('gcconnex_profile:month:october'), |
|
| 41 | - 11 => elgg_echo('gcconnex_profile:month:november'), |
|
| 42 | - 12 => elgg_echo('gcconnex_profile:month:december') |
|
| 43 | - ); |
|
| 44 | - echo '<div class="gcconnex-profile-work-experience-display gcconnex-work-experience-' . $experience->guid . '">'; |
|
| 45 | - echo '<div class="gcconnex-profile-label timeStamp mrgn-tp-sm">'; |
|
| 30 | + $cal_month = array( |
|
| 31 | + 1 => elgg_echo('gcconnex_profile:month:january'), |
|
| 32 | + 2 => elgg_echo('gcconnex_profile:month:february'), |
|
| 33 | + 3 => elgg_echo('gcconnex_profile:month:march'), |
|
| 34 | + 4 => elgg_echo('gcconnex_profile:month:april'), |
|
| 35 | + 5 => elgg_echo('gcconnex_profile:month:may'), |
|
| 36 | + 6 => elgg_echo('gcconnex_profile:month:june'), |
|
| 37 | + 7 => elgg_echo('gcconnex_profile:month:july'), |
|
| 38 | + 8 => elgg_echo('gcconnex_profile:month:august'), |
|
| 39 | + 9 => elgg_echo('gcconnex_profile:month:september'), |
|
| 40 | + 10 => elgg_echo('gcconnex_profile:month:october'), |
|
| 41 | + 11 => elgg_echo('gcconnex_profile:month:november'), |
|
| 42 | + 12 => elgg_echo('gcconnex_profile:month:december') |
|
| 43 | + ); |
|
| 44 | + echo '<div class="gcconnex-profile-work-experience-display gcconnex-work-experience-' . $experience->guid . '">'; |
|
| 45 | + echo '<div class="gcconnex-profile-label timeStamp mrgn-tp-sm">'; |
|
| 46 | 46 | |
| 47 | - if ($experience->not_applicable != 'true') { |
|
| 48 | - echo $cal_month[$experience->startdate] . ' ' . $experience->startyear . '<span aria-hidden="true"> - </span><span class="wb-invisible"> '.elgg_echo('profile:content:to').' </span>'; |
|
| 49 | - } |
|
| 47 | + if ($experience->not_applicable != 'true') { |
|
| 48 | + echo $cal_month[$experience->startdate] . ' ' . $experience->startyear . '<span aria-hidden="true"> - </span><span class="wb-invisible"> '.elgg_echo('profile:content:to').' </span>'; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - if ($experience->ongoing == 'true') { |
|
| 52 | - echo elgg_echo('gcconnex_profile:experience:present'); |
|
| 53 | - } else { |
|
| 54 | - echo $cal_month[$experience->enddate] . ' ' . $experience->endyear; |
|
| 55 | - } |
|
| 51 | + if ($experience->ongoing == 'true') { |
|
| 52 | + echo elgg_echo('gcconnex_profile:experience:present'); |
|
| 53 | + } else { |
|
| 54 | + echo $cal_month[$experience->enddate] . ' ' . $experience->endyear; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - echo '</div>'; |
|
| 58 | - echo '<div class="gcconnex-profile-label work-experience-responsibilities mrgn-tp-md">' . $experience->responsibilities . '</div>'; |
|
| 59 | - echo '<div class="gcconnex-profile-label work-experience-colleagues">'; |
|
| 57 | + echo '</div>'; |
|
| 58 | + echo '<div class="gcconnex-profile-label work-experience-responsibilities mrgn-tp-md">' . $experience->responsibilities . '</div>'; |
|
| 59 | + echo '<div class="gcconnex-profile-label work-experience-colleagues">'; |
|
| 60 | 60 | |
| 61 | - $colleagues = $experience->colleagues; |
|
| 62 | - if (!(is_array($colleagues))) { |
|
| 63 | - $colleagues = array($colleagues); |
|
| 64 | - } |
|
| 65 | - echo list_avatars(array( |
|
| 66 | - 'guids' => $colleagues, |
|
| 67 | - 'size' => 'small', |
|
| 68 | - 'limit' => 0, |
|
| 69 | - )); |
|
| 61 | + $colleagues = $experience->colleagues; |
|
| 62 | + if (!(is_array($colleagues))) { |
|
| 63 | + $colleagues = array($colleagues); |
|
| 64 | + } |
|
| 65 | + echo list_avatars(array( |
|
| 66 | + 'guids' => $colleagues, |
|
| 67 | + 'size' => 'small', |
|
| 68 | + 'limit' => 0, |
|
| 69 | + )); |
|
| 70 | 70 | |
| 71 | - echo '</div>'; // close div class="gcconnex-profile-label work-experience-colleagues" |
|
| 72 | - echo '</div>'; |
|
| 73 | - } |
|
| 74 | - } |
|
| 71 | + echo '</div>'; // close div class="gcconnex-profile-label work-experience-colleagues" |
|
| 72 | + echo '</div>'; |
|
| 73 | + } |
|
| 74 | + } |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | echo '</div>'; // close div class="gcconnex-profile-work-experience-display |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (elgg_is_xhr()) { |
| 4 | - $user_guid = $_GET["guid"]; |
|
| 4 | + $user_guid = $_GET["guid"]; |
|
| 5 | 5 | }else { |
| 6 | - $user_guid = elgg_get_page_owner_guid(); |
|
| 6 | + $user_guid = elgg_get_page_owner_guid(); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | $user = get_user($user_guid); |
@@ -12,48 +12,48 @@ discard block |
||
| 12 | 12 | echo '<div class="gcconnex-profile-education-display ">'; |
| 13 | 13 | |
| 14 | 14 | if ($user->canEdit() && ($education_guid == NULL || empty($education_guid))) { |
| 15 | - echo elgg_echo('gcconnex_profile:education:empty'); |
|
| 15 | + echo elgg_echo('gcconnex_profile:education:empty'); |
|
| 16 | 16 | |
| 17 | 17 | }else { |
| 18 | 18 | |
| 19 | - if (!(is_array($education_guid))) { |
|
| 20 | - $education_guid = array($education_guid); |
|
| 21 | - } |
|
| 22 | - usort($education_guid, "sortDate"); |
|
| 19 | + if (!(is_array($education_guid))) { |
|
| 20 | + $education_guid = array($education_guid); |
|
| 21 | + } |
|
| 22 | + usort($education_guid, "sortDate"); |
|
| 23 | 23 | |
| 24 | - foreach ($education_guid as $guid) { |
|
| 24 | + foreach ($education_guid as $guid) { |
|
| 25 | 25 | |
| 26 | - if ($education = get_entity($guid)) { |
|
| 26 | + if ($education = get_entity($guid)) { |
|
| 27 | 27 | |
| 28 | - echo '<div class="gcconnex-profile-education-display gcconnex-education-' . $education->guid . '">'; |
|
| 29 | - echo '<div class="gcconnex-profile-label education-school">' . htmlspecialchars_decode($education->school) . '</div>'; |
|
| 30 | - echo '<div class="gcconnex-profile-label education-degree">' . htmlspecialchars_decode($education->degree) . '<span aria-hidden="true"> - </span><span class="wb-invisible"> '.elgg_echo('profile:content:for').' </span>' . htmlspecialchars_decode($education->field) . '</div>'; |
|
| 28 | + echo '<div class="gcconnex-profile-education-display gcconnex-education-' . $education->guid . '">'; |
|
| 29 | + echo '<div class="gcconnex-profile-label education-school">' . htmlspecialchars_decode($education->school) . '</div>'; |
|
| 30 | + echo '<div class="gcconnex-profile-label education-degree">' . htmlspecialchars_decode($education->degree) . '<span aria-hidden="true"> - </span><span class="wb-invisible"> '.elgg_echo('profile:content:for').' </span>' . htmlspecialchars_decode($education->field) . '</div>'; |
|
| 31 | 31 | |
| 32 | - $cal_month = array( |
|
| 33 | - 1 => elgg_echo('gcconnex_profile:month:january'), |
|
| 34 | - 2 => elgg_echo('gcconnex_profile:month:february'), |
|
| 35 | - 3 => elgg_echo('gcconnex_profile:month:march'), |
|
| 36 | - 4 => elgg_echo('gcconnex_profile:month:april'), |
|
| 37 | - 5 => elgg_echo('gcconnex_profile:month:may'), |
|
| 38 | - 6 => elgg_echo('gcconnex_profile:month:june'), |
|
| 39 | - 7 => elgg_echo('gcconnex_profile:month:july'), |
|
| 40 | - 8 => elgg_echo('gcconnex_profile:month:august'), |
|
| 41 | - 9 => elgg_echo('gcconnex_profile:month:september'), |
|
| 42 | - 10 => elgg_echo('gcconnex_profile:month:october'), |
|
| 43 | - 11 => elgg_echo('gcconnex_profile:month:november'), |
|
| 44 | - 12 => elgg_echo('gcconnex_profile:month:december') |
|
| 45 | - ); |
|
| 46 | - echo '<div class="gcconnex-profile-label timeStamp">' . $cal_month[$education->startdate] . ', ' . $education->startyear . '<span aria-hidden="true"> - </span><span class="wb-invisible"> '.elgg_echo('profile:content:to').' </span>'; |
|
| 47 | - |
|
| 48 | - if ($education->ongoing == 'true') { |
|
| 49 | - echo elgg_echo('gcconnex_profile:education:present'); |
|
| 50 | - } else { |
|
| 51 | - echo $cal_month[$education->enddate] . ', ' . $education->endyear; |
|
| 52 | - } |
|
| 53 | - echo '</div>'; |
|
| 54 | - echo '</div>'; |
|
| 55 | - } |
|
| 56 | - } |
|
| 32 | + $cal_month = array( |
|
| 33 | + 1 => elgg_echo('gcconnex_profile:month:january'), |
|
| 34 | + 2 => elgg_echo('gcconnex_profile:month:february'), |
|
| 35 | + 3 => elgg_echo('gcconnex_profile:month:march'), |
|
| 36 | + 4 => elgg_echo('gcconnex_profile:month:april'), |
|
| 37 | + 5 => elgg_echo('gcconnex_profile:month:may'), |
|
| 38 | + 6 => elgg_echo('gcconnex_profile:month:june'), |
|
| 39 | + 7 => elgg_echo('gcconnex_profile:month:july'), |
|
| 40 | + 8 => elgg_echo('gcconnex_profile:month:august'), |
|
| 41 | + 9 => elgg_echo('gcconnex_profile:month:september'), |
|
| 42 | + 10 => elgg_echo('gcconnex_profile:month:october'), |
|
| 43 | + 11 => elgg_echo('gcconnex_profile:month:november'), |
|
| 44 | + 12 => elgg_echo('gcconnex_profile:month:december') |
|
| 45 | + ); |
|
| 46 | + echo '<div class="gcconnex-profile-label timeStamp">' . $cal_month[$education->startdate] . ', ' . $education->startyear . '<span aria-hidden="true"> - </span><span class="wb-invisible"> '.elgg_echo('profile:content:to').' </span>'; |
|
| 47 | + |
|
| 48 | + if ($education->ongoing == 'true') { |
|
| 49 | + echo elgg_echo('gcconnex_profile:education:present'); |
|
| 50 | + } else { |
|
| 51 | + echo $cal_month[$education->enddate] . ', ' . $education->endyear; |
|
| 52 | + } |
|
| 53 | + echo '</div>'; |
|
| 54 | + echo '</div>'; |
|
| 55 | + } |
|
| 56 | + } |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | echo '</div>'; // close div class="gcconnex-profile-education-display" |
@@ -48,14 +48,14 @@ discard block |
||
| 48 | 48 | }*/ |
| 49 | 49 | |
| 50 | 50 | |
| 51 | - $opt_in_set = array($user->opt_in_missions, $user->opt_in_swap, $user->opt_in_mentored, $user->opt_in_mentoring, $user->opt_in_shadowed, $user->opt_in_shadowing, $user->opt_in_jobshare, $user->opt_in_pcSeek, $user->opt_in_pcCreate, $user->opt_in_ssSeek, $user->opt_in_ssCreate, $user->opt_in_rotation, $user->opt_in_assignSeek, $user->opt_in_assignCreate, $user->opt_in_deploySeek, $user->opt_in_deployCreate, $user->opt_in_missionCreate, $user->opt_in_casual_seek, $user->opt_in_casual_create, $user->opt_in_student_seek, $user->opt_in_student_create); |
|
| 52 | - //Nick - Loop through array of selected things and change their value to match the meta data |
|
| 51 | + $opt_in_set = array($user->opt_in_missions, $user->opt_in_swap, $user->opt_in_mentored, $user->opt_in_mentoring, $user->opt_in_shadowed, $user->opt_in_shadowing, $user->opt_in_jobshare, $user->opt_in_pcSeek, $user->opt_in_pcCreate, $user->opt_in_ssSeek, $user->opt_in_ssCreate, $user->opt_in_rotation, $user->opt_in_assignSeek, $user->opt_in_assignCreate, $user->opt_in_deploySeek, $user->opt_in_deployCreate, $user->opt_in_missionCreate, $user->opt_in_casual_seek, $user->opt_in_casual_create, $user->opt_in_student_seek, $user->opt_in_student_create); |
|
| 52 | + //Nick - Loop through array of selected things and change their value to match the meta data |
|
| 53 | 53 | foreach($opt_in_set as $k => $v){ |
| 54 | - if($v == 'gcconnex_profile:opt:yes'){ |
|
| 55 | - $opt_in_set[$k] = true; |
|
| 56 | - }else{ |
|
| 57 | - $opt_in_set[$k] = false; |
|
| 58 | - } |
|
| 54 | + if($v == 'gcconnex_profile:opt:yes'){ |
|
| 55 | + $opt_in_set[$k] = true; |
|
| 56 | + }else{ |
|
| 57 | + $opt_in_set[$k] = false; |
|
| 58 | + } |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /*if($user->opt_in_peer_coached == 'gcconnex_profile:opt:yes') { |
@@ -154,23 +154,23 @@ discard block |
||
| 154 | 154 | <ul class="brdr-lft clearfix mrgn-lft-md list-unstyled"> |
| 155 | 155 | <li class="clearfix pull-left mrgn-lft-md"> |
| 156 | 156 | <?php |
| 157 | - echo elgg_view("input/checkbox", array( |
|
| 158 | - 'name' => 'casualseek_check', |
|
| 159 | - 'checked' => $opt_in_set[17], |
|
| 160 | - 'id' => 'gcconnex-opt-in-casualseek-check', |
|
| 161 | - 'label' => elgg_echo('gcconnex_profile:opt:seeking') |
|
| 162 | - )); |
|
| 163 | - ?> |
|
| 157 | + echo elgg_view("input/checkbox", array( |
|
| 158 | + 'name' => 'casualseek_check', |
|
| 159 | + 'checked' => $opt_in_set[17], |
|
| 160 | + 'id' => 'gcconnex-opt-in-casualseek-check', |
|
| 161 | + 'label' => elgg_echo('gcconnex_profile:opt:seeking') |
|
| 162 | + )); |
|
| 163 | + ?> |
|
| 164 | 164 | </li> |
| 165 | 165 | <li class="clearfix pull-left mrgn-lft-md"> |
| 166 | 166 | <?php |
| 167 | - echo elgg_view("input/checkbox", array( |
|
| 168 | - 'name' => 'casualcreate_check', |
|
| 169 | - 'checked' => $opt_in_set[18], |
|
| 170 | - 'id' => 'gcconnex-opt-in-casualcreate-check', |
|
| 171 | - 'label' => elgg_echo('gcconnex_profile:opt:offering') |
|
| 172 | - )); |
|
| 173 | - ?> |
|
| 167 | + echo elgg_view("input/checkbox", array( |
|
| 168 | + 'name' => 'casualcreate_check', |
|
| 169 | + 'checked' => $opt_in_set[18], |
|
| 170 | + 'id' => 'gcconnex-opt-in-casualcreate-check', |
|
| 171 | + 'label' => elgg_echo('gcconnex_profile:opt:offering') |
|
| 172 | + )); |
|
| 173 | + ?> |
|
| 174 | 174 | </li> |
| 175 | 175 | </ul> |
| 176 | 176 | </li> |
@@ -179,23 +179,23 @@ discard block |
||
| 179 | 179 | <ul class="brdr-lft clearfix mrgn-lft-md list-unstyled"> |
| 180 | 180 | <li class="clearfix pull-left mrgn-lft-md"> |
| 181 | 181 | <?php |
| 182 | - echo elgg_view("input/checkbox", array( |
|
| 183 | - 'name' => 'studentseek_check', |
|
| 184 | - 'checked' => $opt_in_set[19], |
|
| 185 | - 'id' => 'gcconnex-opt-in-studentseek-check', |
|
| 186 | - 'label' => elgg_echo('gcconnex_profile:opt:seeking') |
|
| 187 | - )); |
|
| 188 | - ?> |
|
| 182 | + echo elgg_view("input/checkbox", array( |
|
| 183 | + 'name' => 'studentseek_check', |
|
| 184 | + 'checked' => $opt_in_set[19], |
|
| 185 | + 'id' => 'gcconnex-opt-in-studentseek-check', |
|
| 186 | + 'label' => elgg_echo('gcconnex_profile:opt:seeking') |
|
| 187 | + )); |
|
| 188 | + ?> |
|
| 189 | 189 | </li> |
| 190 | 190 | <li class="clearfix pull-left mrgn-lft-md"> |
| 191 | 191 | <?php |
| 192 | - echo elgg_view("input/checkbox", array( |
|
| 193 | - 'name' => 'studentcreate_check', |
|
| 194 | - 'checked' => $opt_in_set[20], |
|
| 195 | - 'id' => 'gcconnex-opt-in-studentcreate-check', |
|
| 196 | - 'label' => elgg_echo('gcconnex_profile:opt:offering') |
|
| 197 | - )); |
|
| 198 | - ?> |
|
| 192 | + echo elgg_view("input/checkbox", array( |
|
| 193 | + 'name' => 'studentcreate_check', |
|
| 194 | + 'checked' => $opt_in_set[20], |
|
| 195 | + 'id' => 'gcconnex-opt-in-studentcreate-check', |
|
| 196 | + 'label' => elgg_echo('gcconnex_profile:opt:offering') |
|
| 197 | + )); |
|
| 198 | + ?> |
|
| 199 | 199 | </li> |
| 200 | 200 | </ul> |
| 201 | 201 | </li> |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | 'id' => 'gcconnex-opt-in-mentored-check', |
| 342 | 342 | 'label' => elgg_echo('gcconnex_profile:opt:mentored'), |
| 343 | 343 | )); |
| 344 | - ?> |
|
| 344 | + ?> |
|
| 345 | 345 | </li> |
| 346 | 346 | |
| 347 | 347 | <li class="clearfix pull-left mrgn-lft-md"> |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | 'id' => 'gcconnex-opt-in-mentoring-check', |
| 353 | 353 | 'label' => elgg_echo('gcconnex_profile:opt:mentoring'), |
| 354 | 354 | )); |
| 355 | - ?> |
|
| 355 | + ?> |
|
| 356 | 356 | </li> |
| 357 | 357 | </ul> |
| 358 | 358 | </li> |
@@ -14,10 +14,10 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | 16 | if (elgg_is_xhr()) { |
| 17 | - $user_guid = $_GET["guid"]; |
|
| 17 | + $user_guid = $_GET["guid"]; |
|
| 18 | 18 | } |
| 19 | 19 | else { |
| 20 | - $user_guid = elgg_get_logged_in_user_guid(); |
|
| 20 | + $user_guid = elgg_get_logged_in_user_guid(); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | // Gets the opt_in_set from the user's profile. |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | else { |
| 34 | 34 | echo '<div class="gcconnex-profile-opt-in-display-table" style="margin: 10px;">'; |
| 35 | - echo '<div class="col-sm-6 "><h3 class="h4 mrgn-tp-0">'. elgg_echo('gcconnex_profile:opt:career').'</h3>'; |
|
| 35 | + echo '<div class="col-sm-6 "><h3 class="h4 mrgn-tp-0">'. elgg_echo('gcconnex_profile:opt:career').'</h3>'; |
|
| 36 | 36 | echo '<ul class="list-unstyled">'; |
| 37 | 37 | echo '<li class="left-col casual-tooltip" title="' . elgg_echo('gcconnex_profile:opt:casual_tooltip') . '">' . elgg_echo('gcconnex_profile:opt:casual_seek'); |
| 38 | 38 | echo '<span class="mrgn-lft-md">' . elgg_echo($user->opt_in_casual_seek) . '</span></li>'; |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | */ |
| 73 | - echo '</ul></div>'; |
|
| 73 | + echo '</ul></div>'; |
|
| 74 | 74 | |
| 75 | - echo '<div class="col-sm-6 "><h3 class="h4 mrgn-tp-0">'. elgg_echo('gcconnex_profile:opt:development').'</h3>'; |
|
| 76 | - echo '<ul class="list-unstyled">'; |
|
| 75 | + echo '<div class="col-sm-6 "><h3 class="h4 mrgn-tp-0">'. elgg_echo('gcconnex_profile:opt:development').'</h3>'; |
|
| 76 | + echo '<ul class="list-unstyled">'; |
|
| 77 | 77 | |
| 78 | 78 | |
| 79 | - echo '<li class="left-col">' . elgg_echo('gcconnex_profile:opt:mentored'); |
|
| 79 | + echo '<li class="left-col">' . elgg_echo('gcconnex_profile:opt:mentored'); |
|
| 80 | 80 | echo '<span class="mrgn-lft-md">' . elgg_echo($user->opt_in_mentored) . '</span></li>'; |
| 81 | 81 | echo '<li class="left-col">' . elgg_echo('gcconnex_profile:opt:mentoring'); |
| 82 | 82 | echo '<span class="mrgn-lft-md">' . elgg_echo($user->opt_in_mentoring) . '</span></li>'; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | |
| 106 | - echo '</ul></div>'; |
|
| 106 | + echo '</ul></div>'; |
|
| 107 | 107 | /*echo '</tr><tr>'; |
| 108 | 108 | echo '<div class="left-col">' . elgg_echo('gcconnex_profile:opt:peer_coached') . '</div>'; |
| 109 | 109 | echo '<div>' . elgg_echo($user->opt_in_peer_coached) . '</div>'; |