Completed
Push — gcconnex ( ee5ffc...718fe4 )
by Ilia
09:37 queued 04:29
created
mod/widget_manager/lib/widgets.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 		return $result;
109 109
 	}
110 110
 	
111
-	switch($widget->handler) {
111
+	switch ($widget->handler) {
112 112
 		case "index_activity":
113 113
 			$result = "/activity";
114 114
 			break;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -144,8 +144,9 @@
 block discarded – undo
144 144
  * @return void
145 145
  */
146 146
 function widget_manager_widgets_twitter_widget_settings_save_hook($hook, $type, $return, $params) {
147
-	if (empty($params) || !is_array($params))
148
-		return;
147
+	if (empty($params) || !is_array($params)) {
148
+			return;
149
+	}
149 150
 	
150 151
 	$widget = elgg_extract("widget", $params);
151 152
 	$embed_code = elgg_extract("embed_code", get_input("params", array(), false)); 
Please login to merge, or discard this patch.
mod/b_extended_profile_collab/languages/fr.php 1 patch
Indentation   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -7,114 +7,114 @@
 block discarded – undo
7 7
  */
8 8
 
9 9
 $french = array(
10
-    'temp:languages:disabled:message' => "<br />Nous sommes en train de re-travailler comment les compétences linguistiques apparaîtront dans les profils GCcollab.<br />Restez à l'écoute pour des mises à jour.",
10
+	'temp:languages:disabled:message' => "<br />Nous sommes en train de re-travailler comment les compétences linguistiques apparaîtront dans les profils GCcollab.<br />Restez à l'écoute pour des mises à jour.",
11 11
 
12
-    'gcconnex_profile:basic:user_type' => "Occupation : ",
13
-    'gcconnex_profile:basic:institution' => "Institution : ",
14
-    'gcconnex_profile:basic:current_occupation' => "Current Occupation as %s at %s (Translate please)",
12
+	'gcconnex_profile:basic:user_type' => "Occupation : ",
13
+	'gcconnex_profile:basic:institution' => "Institution : ",
14
+	'gcconnex_profile:basic:current_occupation' => "Current Occupation as %s at %s (Translate please)",
15 15
     
16
-    'gcconnex-profile-card:academic' => 'Milieu universitaire',
17
-    'gcconnex-profile-card:student' => 'Étudiant',
18
-    'gcconnex-profile-card:federal' => 'Gouvernement fédéral',
19
-    'gcconnex-profile-card:provincial' => 'Gouvernement provincial / territorial',
20
-    'gcconnex-profile-card:municipal' => 'Administration municipale',
21
-    'gcconnex-profile-card:international' => 'International / Gouvernement étranger',
22
-    'gcconnex-profile-card:ngo' => 'Organismes non gouvernementaux',
23
-    'gcconnex-profile-card:community' => 'Collectivité / Sans but lucratif',
24
-    'gcconnex-profile-card:business' => 'Entreprise',
25
-    'gcconnex-profile-card:media' => 'Média',
26
-    'gcconnex-profile-card:retired' => 'Fonctionnaire à la retraité(e)',
27
-    'gcconnex-profile-card:other' => 'Autres renseignements',
28
-
29
-    'gcconnex-profile-card:university' => 'Université',
30
-    'gcconnex-profile-card:college' => 'Collège',
31
-    'gcconnex-profile-card:highschool' => 'École secondaire',
32
-    'gcconnex-profile-card:province' => 'Province / territoire',
33
-    'gcconnex-profile-card:ministry' => 'Ministère',
34
-
35
-    'gcc_profile:notaccepted' => "Vous devez donner une adresse de courriel approuvée",
36
-
37
-    'gcconnex_profile:about_me:access' => 'Accès aux renseignements à mon sujet : ',
38
-
39
-    // BASIC PROFILE FORM
40
-    'gcconnex_profile:basic:name' => 'Nom : ',
41
-    'gcconnex_profile:basic:job' => 'Titre : ',
42
-    'gcconnex_profile:basic:federal' => 'Organisation : ',
43
-    'gcconnex_profile:basic:ministry' => 'Ministère : ',
44
-    'gcconnex_profile:basic:university' => 'Université : ',
45
-    'gcconnex_profile:basic:college' => 'Collège : ',
46
-    'gcconnex_profile:basic:highschool' => 'École secondaire : ',
47
-    'gcconnex_profile:basic:provincial' => 'Province / territoire : ',
48
-    'gcconnex_profile:basic:municipal' => 'Organisation : ',
49
-    'gcconnex_profile:basic:international' => 'Organisation : ',
50
-    'gcconnex_profile:basic:ngo' => 'Organisation : ',
51
-    'gcconnex_profile:basic:community' => 'Organisation : ',
52
-    'gcconnex_profile:basic:business' => 'Organisation : ',
53
-    'gcconnex_profile:basic:media' => 'Organisation : ',
54
-    'gcconnex_profile:basic:retired' => 'Organisation : ',
55
-    'gcconnex_profile:basic:other' => 'Organisation : ',
56
-    'gcconnex_profile:basic:location' => 'Adresse : ',
57
-    'gcconnex_profile:basic:phone' => 'Téléphone : ',
58
-    'gcconnex_profile:basic:mobile' => 'Cellulaire : ',
59
-    'gcconnex_profile:basic:email' => 'Courriel : ',
60
-    'gcconnex_profile:basic:website' =>  'Site Web : ',
61
-    'gcconnex_profile:basic:micro_confirmation' => 'Les micro-affectations sont des affectations de courte durée publiées sur GCcollab et offertes à tous les fonctionnaires, sans égard à leur ministère. Elles sont de courte durée et de portée restreinte.<p>Avant de présenter votre candidature pour participer à des micro-affectations, vous devez d\'abord obtenir l\'autorisation de votre gestionnaire, puis cliquer sur la case à cocher ci-dessous.', //Micro affectation ou micro-mission?
62
-
63
-    // EDUCATION
64
-    'gcconnex_profile:education:school' => 'Nom de l\'établissement : ',
65
-    'gcconnex_profile:education:start_month' => 'Mois de début : ',
66
-    'gcconnex_profile:education:start_year' => 'Année de début : ',
67
-    'gcconnex_profile:education:end_year' => 'Année de fin : ',
68
-    'gcconnex_profile:education:end_month' => 'Mois de fin : ',
69
-    'gcconnex_profile:education:degree' => 'Diplôme obtenu : ',
70
-    'gcconnex_profile:education:program' => 'Programme : ',
71
-    'gcconnex_profile:education:field' =>  'Domaine d\'études : ',
72
-    'gcconnex_profile:education:access' => 'Accès aux renseignements sur mes études : ',
73
-
74
-    // WORK EXPERIENCE
75
-    'gcconnex_profile:experience:organization' => 'Nom de l’organisation : ',
76
-    'gcconnex_profile:experience:title' => 'Titre : ',
77
-    'gcconnex_profile:experience:start_month' => 'Mois de début : ',
78
-    'gcconnex_profile:experience:year' => 'Année : ',
79
-    'gcconnex_profile:experience:end_month' => 'Mois de fin : ',
80
-    'gcconnex_profile:experience:not_applicable' => 'N\'est pas applicable',
81
-    'gcconnex_profile:experience:colleagues' =>  'Collègues : ',
82
-    'gcconnex_profile:experience:colleague_suggest' => 'Pour lier un ou une collègue à cette entrée, cette personne doit faire partie de votre liste de collègues GCcollab',
83
-
84
-    // leftover skills
85
-    'gcconnex_profile:gc_skill:leftover' => 'Vous avez précédemment ajouté des compétences à votre profil GCcollab. Veuillez passer en revue les compétences ci-dessous et les verser dans ce nouveau gabarit, au besoin. Lorsque vous ajoutez des compétences à votre profil, assurez-vous qu\'il s\'agit de compétences que vous croyez réellement posséder, qu\'elles sont précises, qu\'ils s\'agit de comptéences professionnelles, et qu’elles permettent aux personnes qui consultent votre profil d’obtenir de l’information claire, utile et pertinente à votre sujet (essayez d’éviter les expressions comme « plein d’choses » et « accomplir plein de tâches »). ',
86
-
87
-    // PORTFOLIO
88
-    'gcconnex_profile:portfolio:access' => 'Accès aux renseignements de mon portfolio : ',
89
-    'gcconnex_profile:portfolio:title' => 'Titre : ',
90
-    'gcconnex_profile:portfolio:link' => 'Hyperlien : ',
91
-    'gcconnex_profile:portfolio:publication_date' => 'Date de publication : ',
92
-    'gcconnex_profile:portfolio:description' => 'Description : ',
93
-
94
-    'gcconnex_profile:opt:career' => 'Possibilités de carrière',
95
-    'gcconnex_profile:opt:mentored' => 'Mentoré',
96
-    'gcconnex_profile:opt:mentoring' => 'Mentor',
97
-    'gcconnex_profile:opt:seeking' => 'Recherche',
98
-    'gcconnex_profile:opt:offering' => 'Offre',
99
-    'gcconnex_profile:opt:casual_seek' => 'Emploi occasionnel participant',
100
-    'gcconnex_profile:opt:casual_create' => 'Emploi occasionnel hôte',
101
-    'gcconnex_profile:opt:student_seek' => 'Intégration des étudiants participant',
102
-    'gcconnex_profile:opt:student_create' => 'Intégration des étudiants hôte',
103
-
104
-    'gcconnex_profile:opt:casual_tooltip' => 'Les employés occasionnels sont des travailleurs embauchés pour une période déterminée ne dépassant pas 90 jours ouvrables par année civile dans un ministère ou organisme pour lequel la Commission de la fonction publique (CFP) a le pouvoir exclusif de faire des nominations. La période d\'emploi temporaire peut être pour une ou plusieurs périodes déterminées, mais elle ne doit pas dépasser 90 jours ouvrables dans un ministère ou organisme par année civile.',
105
-    'gcconnex_profile:opt:student_tooltip' => 'Tout diplômé d\'un programme postsecondaire qui a travaillé comme étudiant salarié à la fonction publique fédérale, via PFETE, COOP ou PAR, peut être considéré pour intégration.',
106
-
107
-    'email_change_confirmation:request' => "Pour terminer la modification de votre adresse de courriel, veuillez vérifier les mails de votre votre compte %s",
108
-
109
-    'email_change_confirmation:error:user' => "Vous n'êtes pas le membre pour lequel cette demande a été faite",
110
-    'email_change_confirmation:error:request' => "Aucune demande de changement d'adresse de courriel en attente",
111
-    'email_change_confirmation:error:code' => "Le code de confirmation fourni est incorrect, veuillez vérifier le courriel reçu",
112
-
113
-    'email_change_confirmation:request:subject' => "Demande de changement d'adresse de courriel pour %s",
114
-    'email_change_confirmation:request:message' => "Bonjour %s,<br/><br/>Vous avez demandé le changement de votre adresse de courriel sur %s vers cette adresse de courriel. Pour confirmer et terminer le changement, veuillez cliquer sur le lien suivant :<br/><br/>%s",
115
-
116
-    'email_change_confirmation:success:subject' => "Adresse de courriel changée pour %s",
117
-    'email_change_confirmation:success:message' => "Bonjour %s,<br/><br/>Votre adresse de courriel sur %s a été changée. Si vous n'êtes pas à l'origine de ce changement ou ne l'avez pas demandé, veuillez contacter l'un des administrateurs du site."
16
+	'gcconnex-profile-card:academic' => 'Milieu universitaire',
17
+	'gcconnex-profile-card:student' => 'Étudiant',
18
+	'gcconnex-profile-card:federal' => 'Gouvernement fédéral',
19
+	'gcconnex-profile-card:provincial' => 'Gouvernement provincial / territorial',
20
+	'gcconnex-profile-card:municipal' => 'Administration municipale',
21
+	'gcconnex-profile-card:international' => 'International / Gouvernement étranger',
22
+	'gcconnex-profile-card:ngo' => 'Organismes non gouvernementaux',
23
+	'gcconnex-profile-card:community' => 'Collectivité / Sans but lucratif',
24
+	'gcconnex-profile-card:business' => 'Entreprise',
25
+	'gcconnex-profile-card:media' => 'Média',
26
+	'gcconnex-profile-card:retired' => 'Fonctionnaire à la retraité(e)',
27
+	'gcconnex-profile-card:other' => 'Autres renseignements',
28
+
29
+	'gcconnex-profile-card:university' => 'Université',
30
+	'gcconnex-profile-card:college' => 'Collège',
31
+	'gcconnex-profile-card:highschool' => 'École secondaire',
32
+	'gcconnex-profile-card:province' => 'Province / territoire',
33
+	'gcconnex-profile-card:ministry' => 'Ministère',
34
+
35
+	'gcc_profile:notaccepted' => "Vous devez donner une adresse de courriel approuvée",
36
+
37
+	'gcconnex_profile:about_me:access' => 'Accès aux renseignements à mon sujet : ',
38
+
39
+	// BASIC PROFILE FORM
40
+	'gcconnex_profile:basic:name' => 'Nom : ',
41
+	'gcconnex_profile:basic:job' => 'Titre : ',
42
+	'gcconnex_profile:basic:federal' => 'Organisation : ',
43
+	'gcconnex_profile:basic:ministry' => 'Ministère : ',
44
+	'gcconnex_profile:basic:university' => 'Université : ',
45
+	'gcconnex_profile:basic:college' => 'Collège : ',
46
+	'gcconnex_profile:basic:highschool' => 'École secondaire : ',
47
+	'gcconnex_profile:basic:provincial' => 'Province / territoire : ',
48
+	'gcconnex_profile:basic:municipal' => 'Organisation : ',
49
+	'gcconnex_profile:basic:international' => 'Organisation : ',
50
+	'gcconnex_profile:basic:ngo' => 'Organisation : ',
51
+	'gcconnex_profile:basic:community' => 'Organisation : ',
52
+	'gcconnex_profile:basic:business' => 'Organisation : ',
53
+	'gcconnex_profile:basic:media' => 'Organisation : ',
54
+	'gcconnex_profile:basic:retired' => 'Organisation : ',
55
+	'gcconnex_profile:basic:other' => 'Organisation : ',
56
+	'gcconnex_profile:basic:location' => 'Adresse : ',
57
+	'gcconnex_profile:basic:phone' => 'Téléphone : ',
58
+	'gcconnex_profile:basic:mobile' => 'Cellulaire : ',
59
+	'gcconnex_profile:basic:email' => 'Courriel : ',
60
+	'gcconnex_profile:basic:website' =>  'Site Web : ',
61
+	'gcconnex_profile:basic:micro_confirmation' => 'Les micro-affectations sont des affectations de courte durée publiées sur GCcollab et offertes à tous les fonctionnaires, sans égard à leur ministère. Elles sont de courte durée et de portée restreinte.<p>Avant de présenter votre candidature pour participer à des micro-affectations, vous devez d\'abord obtenir l\'autorisation de votre gestionnaire, puis cliquer sur la case à cocher ci-dessous.', //Micro affectation ou micro-mission?
62
+
63
+	// EDUCATION
64
+	'gcconnex_profile:education:school' => 'Nom de l\'établissement : ',
65
+	'gcconnex_profile:education:start_month' => 'Mois de début : ',
66
+	'gcconnex_profile:education:start_year' => 'Année de début : ',
67
+	'gcconnex_profile:education:end_year' => 'Année de fin : ',
68
+	'gcconnex_profile:education:end_month' => 'Mois de fin : ',
69
+	'gcconnex_profile:education:degree' => 'Diplôme obtenu : ',
70
+	'gcconnex_profile:education:program' => 'Programme : ',
71
+	'gcconnex_profile:education:field' =>  'Domaine d\'études : ',
72
+	'gcconnex_profile:education:access' => 'Accès aux renseignements sur mes études : ',
73
+
74
+	// WORK EXPERIENCE
75
+	'gcconnex_profile:experience:organization' => 'Nom de l’organisation : ',
76
+	'gcconnex_profile:experience:title' => 'Titre : ',
77
+	'gcconnex_profile:experience:start_month' => 'Mois de début : ',
78
+	'gcconnex_profile:experience:year' => 'Année : ',
79
+	'gcconnex_profile:experience:end_month' => 'Mois de fin : ',
80
+	'gcconnex_profile:experience:not_applicable' => 'N\'est pas applicable',
81
+	'gcconnex_profile:experience:colleagues' =>  'Collègues : ',
82
+	'gcconnex_profile:experience:colleague_suggest' => 'Pour lier un ou une collègue à cette entrée, cette personne doit faire partie de votre liste de collègues GCcollab',
83
+
84
+	// leftover skills
85
+	'gcconnex_profile:gc_skill:leftover' => 'Vous avez précédemment ajouté des compétences à votre profil GCcollab. Veuillez passer en revue les compétences ci-dessous et les verser dans ce nouveau gabarit, au besoin. Lorsque vous ajoutez des compétences à votre profil, assurez-vous qu\'il s\'agit de compétences que vous croyez réellement posséder, qu\'elles sont précises, qu\'ils s\'agit de comptéences professionnelles, et qu’elles permettent aux personnes qui consultent votre profil d’obtenir de l’information claire, utile et pertinente à votre sujet (essayez d’éviter les expressions comme « plein d’choses » et « accomplir plein de tâches »). ',
86
+
87
+	// PORTFOLIO
88
+	'gcconnex_profile:portfolio:access' => 'Accès aux renseignements de mon portfolio : ',
89
+	'gcconnex_profile:portfolio:title' => 'Titre : ',
90
+	'gcconnex_profile:portfolio:link' => 'Hyperlien : ',
91
+	'gcconnex_profile:portfolio:publication_date' => 'Date de publication : ',
92
+	'gcconnex_profile:portfolio:description' => 'Description : ',
93
+
94
+	'gcconnex_profile:opt:career' => 'Possibilités de carrière',
95
+	'gcconnex_profile:opt:mentored' => 'Mentoré',
96
+	'gcconnex_profile:opt:mentoring' => 'Mentor',
97
+	'gcconnex_profile:opt:seeking' => 'Recherche',
98
+	'gcconnex_profile:opt:offering' => 'Offre',
99
+	'gcconnex_profile:opt:casual_seek' => 'Emploi occasionnel participant',
100
+	'gcconnex_profile:opt:casual_create' => 'Emploi occasionnel hôte',
101
+	'gcconnex_profile:opt:student_seek' => 'Intégration des étudiants participant',
102
+	'gcconnex_profile:opt:student_create' => 'Intégration des étudiants hôte',
103
+
104
+	'gcconnex_profile:opt:casual_tooltip' => 'Les employés occasionnels sont des travailleurs embauchés pour une période déterminée ne dépassant pas 90 jours ouvrables par année civile dans un ministère ou organisme pour lequel la Commission de la fonction publique (CFP) a le pouvoir exclusif de faire des nominations. La période d\'emploi temporaire peut être pour une ou plusieurs périodes déterminées, mais elle ne doit pas dépasser 90 jours ouvrables dans un ministère ou organisme par année civile.',
105
+	'gcconnex_profile:opt:student_tooltip' => 'Tout diplômé d\'un programme postsecondaire qui a travaillé comme étudiant salarié à la fonction publique fédérale, via PFETE, COOP ou PAR, peut être considéré pour intégration.',
106
+
107
+	'email_change_confirmation:request' => "Pour terminer la modification de votre adresse de courriel, veuillez vérifier les mails de votre votre compte %s",
108
+
109
+	'email_change_confirmation:error:user' => "Vous n'êtes pas le membre pour lequel cette demande a été faite",
110
+	'email_change_confirmation:error:request' => "Aucune demande de changement d'adresse de courriel en attente",
111
+	'email_change_confirmation:error:code' => "Le code de confirmation fourni est incorrect, veuillez vérifier le courriel reçu",
112
+
113
+	'email_change_confirmation:request:subject' => "Demande de changement d'adresse de courriel pour %s",
114
+	'email_change_confirmation:request:message' => "Bonjour %s,<br/><br/>Vous avez demandé le changement de votre adresse de courriel sur %s vers cette adresse de courriel. Pour confirmer et terminer le changement, veuillez cliquer sur le lien suivant :<br/><br/>%s",
115
+
116
+	'email_change_confirmation:success:subject' => "Adresse de courriel changée pour %s",
117
+	'email_change_confirmation:success:message' => "Bonjour %s,<br/><br/>Votre adresse de courriel sur %s a été changée. Si vous n'êtes pas à l'origine de ce changement ou ne l'avez pas demandé, veuillez contacter l'un des administrateurs du site."
118 118
 );
119 119
 
120 120
 add_translation("fr", $french);
Please login to merge, or discard this patch.
mod/b_extended_profile_collab/languages/en.php 1 patch
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -7,110 +7,110 @@
 block discarded – undo
7 7
  */
8 8
 
9 9
 $english = array(
10
-    'gcconnex_profile:basic:user_type' => "Occupation: ", // new
11
-    'gcconnex_profile:basic:institution' => "Institution: ", // new
12
-    'gcconnex_profile:basic:current_occupation' => "Currently %s at %s",
13
-
14
-    'gcconnex-profile-card:academic' => 'Academic',
15
-    'gcconnex-profile-card:student' => 'Student',
16
-    'gcconnex-profile-card:federal' => 'Federal Government',
17
-    'gcconnex-profile-card:provincial' => 'Provincial/Territorial Government',
18
-    'gcconnex-profile-card:municipal' => 'Municipal Government',
19
-    'gcconnex-profile-card:international' => 'International/Foreign Government',
20
-    'gcconnex-profile-card:ngo' => 'Non-Governmental Organization',
21
-    'gcconnex-profile-card:community' => 'Community/Non-profit',
22
-    'gcconnex-profile-card:business' => 'Business',
23
-    'gcconnex-profile-card:media' => 'Media',
24
-    'gcconnex-profile-card:retired' => 'Retired Public Servant',
25
-    'gcconnex-profile-card:other' => 'Other',
26
-
27
-    'gcconnex-profile-card:university' => 'University',
28
-    'gcconnex-profile-card:college' => 'College',
29
-    'gcconnex-profile-card:highschool' => 'High School',
30
-    'gcconnex-profile-card:province' => 'Province/Territory',
31
-    'gcconnex-profile-card:ministry' => 'Ministry',
32
-
33
-    'gcc_profile:notaccepted' => 'An approved email address is required',
34
-
35
-    'gcconnex_profile:about_me:access' => 'Who can see my description:',
36
-
37
-    // BASIC INFORMATION PROFILE FORM
38
-    'gcconnex_profile:basic:name' => 'Name: ',
39
-    'gcconnex_profile:basic:job' => 'Job Title: ',
40
-    'gcconnex_profile:basic:federal' => 'Organization: ',
41
-    'gcconnex_profile:basic:ministry' => 'Ministry: ',
42
-    'gcconnex_profile:basic:university' => 'University: ',
43
-    'gcconnex_profile:basic:college' => 'College: ',
44
-    'gcconnex_profile:basic:highschool' => 'High School: ',
45
-    'gcconnex_profile:basic:provincial' => 'Province/Territory: ',
46
-    'gcconnex_profile:basic:municipal' => 'Organization: ',
47
-    'gcconnex_profile:basic:international' => 'Organization: ',
48
-    'gcconnex_profile:basic:ngo' => 'Organization: ',
49
-    'gcconnex_profile:basic:community' => 'Organization: ',
50
-    'gcconnex_profile:basic:business' => 'Organization: ',
51
-    'gcconnex_profile:basic:media' => 'Organization: ',
52
-    'gcconnex_profile:basic:retired' => 'Organization: ',
53
-    'gcconnex_profile:basic:other' => 'Organization: ',
54
-    'gcconnex_profile:basic:location' => 'Location: ',
55
-    'gcconnex_profile:basic:phone' => 'Phone: ',
56
-    'gcconnex_profile:basic:mobile' => 'Mobile: ',
57
-    'gcconnex_profile:basic:email' => 'Email: ',
58
-    'gcconnex_profile:basic:website' => 'Website: ',
59
-
60
-    // EDUCATION
61
-    'gcconnex_profile:education:school' => 'Institution Name: ',
62
-    'gcconnex_profile:education:start_month' => 'Start Month: ',
63
-    'gcconnex_profile:education:start_year' => 'Start Year: ',
64
-    'gcconnex_profile:education:end_year' => 'End Year: ',
65
-    'gcconnex_profile:education:end_month' => 'End Month: ',
66
-    'gcconnex_profile:education:degree' => 'Degree: ',
67
-    'gcconnex_profile:education:program' => 'Program: ',
68
-    'gcconnex_profile:education:field' => 'Field of Study: ',
69
-    'gcconnex_profile:education:access' => 'Who can see my education entries:',
70
-
71
-    // WORK EXPERIENCE
72
-    'gcconnex_profile:experience:organization' => 'Name of Organization: ',
73
-    'gcconnex_profile:experience:title' => 'Title: ',
74
-    'gcconnex_profile:experience:start_month' => 'Start Month: ',
75
-    'gcconnex_profile:experience:year' => 'Year: ',
76
-    'gcconnex_profile:experience:end_month' => 'End Month: ',
77
-    'gcconnex_profile:experience:not_applicable' => 'Not Applicable',
78
-    'gcconnex_profile:experience:access' => 'Who can see my work experience entries: ',
79
-    'gcconnex_profile:experience:colleagues' => 'Colleagues: ',
80
-
81
-    // SKILLS
82
-    'gcconnex_profile:gc_skill:access' => 'Who can see my skills:',
83
-
84
-    // PORTFOLIO
85
-    'gcconnex_profile:portfolio:title' => 'Title: ',
86
-    'gcconnex_profile:portfolio:link' => 'Link: ',
87
-    'gcconnex_profile:portfolio:publication_date' => 'Published on: ',
88
-    'gcconnex_profile:portfolio:description' => 'Description: ',
89
-
90
-    'gcconnex_profile:opt:career' => 'Career Opportunities',
91
-    'gcconnex_profile:opt:mentored' => 'Mentee',
92
-    'gcconnex_profile:opt:mentoring' => 'Mentor',
93
-    'gcconnex_profile:opt:seeking' => 'Seeking',
94
-    'gcconnex_profile:opt:offering' => 'Offering',
95
-    'gcconnex_profile:opt:casual_seek' => 'Casual Work Seeker',
96
-    'gcconnex_profile:opt:casual_create' => 'Casual Work Opportunity Creator',
97
-    'gcconnex_profile:opt:student_seek' => 'Student Integration Seeker',
98
-    'gcconnex_profile:opt:student_create' => 'Student Integration Opportunity Creator',
99
-
100
-    'gcconnex_profile:opt:casual_tooltip' => 'Casual workers are hired for specified periods that may not exceed 90 working days in one calendar year, in a department or in an agency to which the Public Service Commission (PSC) has exclusive authority to make appointments. The period of casual employment may be for one or more than one term, but is not to exceed 90 working days in a department or agency in a calendar year.',
101
-    'gcconnex_profile:opt:student_tooltip' => 'Any graduate of a post-secondary program who worked as a student employee for the Federal Public Service, via FSEWP, COOP, or RAP, may be considered for integration.',
102
-
103
-    'email_change_confirmation:request' => "In order to complete your email address change, please check the inbox of your %s account",
104
-
105
-    'email_change_confirmation:error:user' => "You're not the user for whom this request was made",
106
-    'email_change_confirmation:error:request' => "There is no pending email address change",
107
-    'email_change_confirmation:error:code' => "The supplied validation code is incorrect, please check your email message",
108
-
109
-    'email_change_confirmation:request:subject' => "Email address change request for %s",
110
-    'email_change_confirmation:request:message' => "Hi %s,<br/><br/>You requested to change your email address on %s to this email address. In order to complete the request click on this link:<br/><br/>%s",
111
-
112
-    'email_change_confirmation:success:subject' => "Email address changed for %s",
113
-    'email_change_confirmation:success:message' => "Hi %s,<br/><br/>Your email address on %s has been changed. If you didn't do this or request this, please contact a site administrator."
10
+	'gcconnex_profile:basic:user_type' => "Occupation: ", // new
11
+	'gcconnex_profile:basic:institution' => "Institution: ", // new
12
+	'gcconnex_profile:basic:current_occupation' => "Currently %s at %s",
13
+
14
+	'gcconnex-profile-card:academic' => 'Academic',
15
+	'gcconnex-profile-card:student' => 'Student',
16
+	'gcconnex-profile-card:federal' => 'Federal Government',
17
+	'gcconnex-profile-card:provincial' => 'Provincial/Territorial Government',
18
+	'gcconnex-profile-card:municipal' => 'Municipal Government',
19
+	'gcconnex-profile-card:international' => 'International/Foreign Government',
20
+	'gcconnex-profile-card:ngo' => 'Non-Governmental Organization',
21
+	'gcconnex-profile-card:community' => 'Community/Non-profit',
22
+	'gcconnex-profile-card:business' => 'Business',
23
+	'gcconnex-profile-card:media' => 'Media',
24
+	'gcconnex-profile-card:retired' => 'Retired Public Servant',
25
+	'gcconnex-profile-card:other' => 'Other',
26
+
27
+	'gcconnex-profile-card:university' => 'University',
28
+	'gcconnex-profile-card:college' => 'College',
29
+	'gcconnex-profile-card:highschool' => 'High School',
30
+	'gcconnex-profile-card:province' => 'Province/Territory',
31
+	'gcconnex-profile-card:ministry' => 'Ministry',
32
+
33
+	'gcc_profile:notaccepted' => 'An approved email address is required',
34
+
35
+	'gcconnex_profile:about_me:access' => 'Who can see my description:',
36
+
37
+	// BASIC INFORMATION PROFILE FORM
38
+	'gcconnex_profile:basic:name' => 'Name: ',
39
+	'gcconnex_profile:basic:job' => 'Job Title: ',
40
+	'gcconnex_profile:basic:federal' => 'Organization: ',
41
+	'gcconnex_profile:basic:ministry' => 'Ministry: ',
42
+	'gcconnex_profile:basic:university' => 'University: ',
43
+	'gcconnex_profile:basic:college' => 'College: ',
44
+	'gcconnex_profile:basic:highschool' => 'High School: ',
45
+	'gcconnex_profile:basic:provincial' => 'Province/Territory: ',
46
+	'gcconnex_profile:basic:municipal' => 'Organization: ',
47
+	'gcconnex_profile:basic:international' => 'Organization: ',
48
+	'gcconnex_profile:basic:ngo' => 'Organization: ',
49
+	'gcconnex_profile:basic:community' => 'Organization: ',
50
+	'gcconnex_profile:basic:business' => 'Organization: ',
51
+	'gcconnex_profile:basic:media' => 'Organization: ',
52
+	'gcconnex_profile:basic:retired' => 'Organization: ',
53
+	'gcconnex_profile:basic:other' => 'Organization: ',
54
+	'gcconnex_profile:basic:location' => 'Location: ',
55
+	'gcconnex_profile:basic:phone' => 'Phone: ',
56
+	'gcconnex_profile:basic:mobile' => 'Mobile: ',
57
+	'gcconnex_profile:basic:email' => 'Email: ',
58
+	'gcconnex_profile:basic:website' => 'Website: ',
59
+
60
+	// EDUCATION
61
+	'gcconnex_profile:education:school' => 'Institution Name: ',
62
+	'gcconnex_profile:education:start_month' => 'Start Month: ',
63
+	'gcconnex_profile:education:start_year' => 'Start Year: ',
64
+	'gcconnex_profile:education:end_year' => 'End Year: ',
65
+	'gcconnex_profile:education:end_month' => 'End Month: ',
66
+	'gcconnex_profile:education:degree' => 'Degree: ',
67
+	'gcconnex_profile:education:program' => 'Program: ',
68
+	'gcconnex_profile:education:field' => 'Field of Study: ',
69
+	'gcconnex_profile:education:access' => 'Who can see my education entries:',
70
+
71
+	// WORK EXPERIENCE
72
+	'gcconnex_profile:experience:organization' => 'Name of Organization: ',
73
+	'gcconnex_profile:experience:title' => 'Title: ',
74
+	'gcconnex_profile:experience:start_month' => 'Start Month: ',
75
+	'gcconnex_profile:experience:year' => 'Year: ',
76
+	'gcconnex_profile:experience:end_month' => 'End Month: ',
77
+	'gcconnex_profile:experience:not_applicable' => 'Not Applicable',
78
+	'gcconnex_profile:experience:access' => 'Who can see my work experience entries: ',
79
+	'gcconnex_profile:experience:colleagues' => 'Colleagues: ',
80
+
81
+	// SKILLS
82
+	'gcconnex_profile:gc_skill:access' => 'Who can see my skills:',
83
+
84
+	// PORTFOLIO
85
+	'gcconnex_profile:portfolio:title' => 'Title: ',
86
+	'gcconnex_profile:portfolio:link' => 'Link: ',
87
+	'gcconnex_profile:portfolio:publication_date' => 'Published on: ',
88
+	'gcconnex_profile:portfolio:description' => 'Description: ',
89
+
90
+	'gcconnex_profile:opt:career' => 'Career Opportunities',
91
+	'gcconnex_profile:opt:mentored' => 'Mentee',
92
+	'gcconnex_profile:opt:mentoring' => 'Mentor',
93
+	'gcconnex_profile:opt:seeking' => 'Seeking',
94
+	'gcconnex_profile:opt:offering' => 'Offering',
95
+	'gcconnex_profile:opt:casual_seek' => 'Casual Work Seeker',
96
+	'gcconnex_profile:opt:casual_create' => 'Casual Work Opportunity Creator',
97
+	'gcconnex_profile:opt:student_seek' => 'Student Integration Seeker',
98
+	'gcconnex_profile:opt:student_create' => 'Student Integration Opportunity Creator',
99
+
100
+	'gcconnex_profile:opt:casual_tooltip' => 'Casual workers are hired for specified periods that may not exceed 90 working days in one calendar year, in a department or in an agency to which the Public Service Commission (PSC) has exclusive authority to make appointments. The period of casual employment may be for one or more than one term, but is not to exceed 90 working days in a department or agency in a calendar year.',
101
+	'gcconnex_profile:opt:student_tooltip' => 'Any graduate of a post-secondary program who worked as a student employee for the Federal Public Service, via FSEWP, COOP, or RAP, may be considered for integration.',
102
+
103
+	'email_change_confirmation:request' => "In order to complete your email address change, please check the inbox of your %s account",
104
+
105
+	'email_change_confirmation:error:user' => "You're not the user for whom this request was made",
106
+	'email_change_confirmation:error:request' => "There is no pending email address change",
107
+	'email_change_confirmation:error:code' => "The supplied validation code is incorrect, please check your email message",
108
+
109
+	'email_change_confirmation:request:subject' => "Email address change request for %s",
110
+	'email_change_confirmation:request:message' => "Hi %s,<br/><br/>You requested to change your email address on %s to this email address. In order to complete the request click on this link:<br/><br/>%s",
111
+
112
+	'email_change_confirmation:success:subject' => "Email address changed for %s",
113
+	'email_change_confirmation:success:message' => "Hi %s,<br/><br/>Your email address on %s has been changed. If you didn't do this or request this, please contact a site administrator."
114 114
 );
115 115
 
116 116
 add_translation("en", $english);
Please login to merge, or discard this patch.
mod/b_extended_profile_collab/actions/b_extended_profile/edit_profile.php 3 patches
Indentation   +477 added lines, -477 removed lines patch added patch discarded remove patch
@@ -1,543 +1,543 @@
 block discarded – undo
1 1
 <?php
2 2
 if (elgg_is_xhr()) {  //This is an Ajax call!
3
-    $user_guid = get_input('guid');
4
-    $user = get_user($user_guid);
5
-    $section = get_input('section');
6
-    $error = false;
7
-    switch ($section) {
8
-        case "profile":
9
-            $profile_fields = get_input('profile');
10
-            $social_media = get_input('social_media');
11
-            $error_message = '';
12
-            foreach ( $profile_fields as $f => $v ) {
13
-                // cyu - check if email field is empty
14
-                if ($f === "email") {
15
-                    trim($v);   // remove white spaces from both sides of string
16
-                    if (!$v) {
17
-                        register_error(elgg_echo('gcc_profile:error').elgg_echo('gcc_profile:missingemail'));
18
-                        return true;
19
-                    }
3
+	$user_guid = get_input('guid');
4
+	$user = get_user($user_guid);
5
+	$section = get_input('section');
6
+	$error = false;
7
+	switch ($section) {
8
+		case "profile":
9
+			$profile_fields = get_input('profile');
10
+			$social_media = get_input('social_media');
11
+			$error_message = '';
12
+			foreach ( $profile_fields as $f => $v ) {
13
+				// cyu - check if email field is empty
14
+				if ($f === "email") {
15
+					trim($v);   // remove white spaces from both sides of string
16
+					if (!$v) {
17
+						register_error(elgg_echo('gcc_profile:error').elgg_echo('gcc_profile:missingemail'));
18
+						return true;
19
+					}
20 20
 
21
-                    elgg_load_library('c_ext_lib');
22
-                    $isValid = false;
21
+					elgg_load_library('c_ext_lib');
22
+					$isValid = false;
23 23
 
24
-                    if ($v) {
25
-                        // cyu - check if the email is in the list of exceptions
26
-                        $user_email = explode('@',$v);
27
-                        $list_of_domains = getExtension();
24
+					if ($v) {
25
+						// cyu - check if the email is in the list of exceptions
26
+						$user_email = explode('@',$v);
27
+						$list_of_domains = getExtension();
28 28
 
29
-                        if( elgg_is_active_plugin('c_email_extensions') ){
30
-                            // Checks against the domain manager list...
31
-                            $wildcard_query = "SELECT ext FROM email_extensions WHERE ext LIKE '%*%'";
32
-                            $wildcard_emails = get_data($wildcard_query);
29
+						if( elgg_is_active_plugin('c_email_extensions') ){
30
+							// Checks against the domain manager list...
31
+							$wildcard_query = "SELECT ext FROM email_extensions WHERE ext LIKE '%*%'";
32
+							$wildcard_emails = get_data($wildcard_query);
33 33
                             
34
-                            if( $wildcard_emails ){
35
-                                foreach($wildcard_emails as $wildcard){
36
-                                    $regex = str_replace(".", "\.", $wildcard->ext);
37
-                                    $regex = str_replace("*", "[\w-.]+", $regex);
38
-                                    $regex = "/^@" . $regex . "$/";
39
-                                    if(preg_match($regex, "@".$user_email[1]) || strtolower(str_replace("*.", "", $wildcard->ext)) == strtolower($user_email[1])){
40
-                                        $isValid = true;
41
-                                        break;
42
-                                    }
43
-                                }
44
-                            }
45
-                        }
34
+							if( $wildcard_emails ){
35
+								foreach($wildcard_emails as $wildcard){
36
+									$regex = str_replace(".", "\.", $wildcard->ext);
37
+									$regex = str_replace("*", "[\w-.]+", $regex);
38
+									$regex = "/^@" . $regex . "$/";
39
+									if(preg_match($regex, "@".$user_email[1]) || strtolower(str_replace("*.", "", $wildcard->ext)) == strtolower($user_email[1])){
40
+										$isValid = true;
41
+										break;
42
+									}
43
+								}
44
+							}
45
+						}
46 46
 
47
-                        if( elgg_is_active_plugin('gcRegistration_invitation') ){
48
-                            // Checks against the email invitation list...
49
-                            $invitation_query = "SELECT email FROM email_invitations WHERE email = '{$email}'";
50
-                            $result = get_data($invitation_query);
47
+						if( elgg_is_active_plugin('gcRegistration_invitation') ){
48
+							// Checks against the email invitation list...
49
+							$invitation_query = "SELECT email FROM email_invitations WHERE email = '{$email}'";
50
+							$result = get_data($invitation_query);
51 51
 
52
-                            if( count($result) > 0 ) 
53
-                                $isValid = true;
54
-                        }
52
+							if( count($result) > 0 ) 
53
+								$isValid = true;
54
+						}
55 55
 
56
-                        if (count($list_of_domains) > 0) {
57
-                            while ($row = mysqli_fetch_array($list_of_domains)) {
58
-                                if (strtolower($row['ext']) === strtolower($user_email[1])) {
59
-                                    $isValid = true;
60
-                                    break;
61
-                                }
62
-                            }
63
-                            $error_message = elgg_echo('gcc_profile:error').elgg_echo('gcc_profile:notaccepted');
64
-                        }
56
+						if (count($list_of_domains) > 0) {
57
+							while ($row = mysqli_fetch_array($list_of_domains)) {
58
+								if (strtolower($row['ext']) === strtolower($user_email[1])) {
59
+									$isValid = true;
60
+									break;
61
+								}
62
+							}
63
+							$error_message = elgg_echo('gcc_profile:error').elgg_echo('gcc_profile:notaccepted');
64
+						}
65 65
 
66
-                        // cyu - check if domain is gc.ca
67
-                        if (!$isValid) {
68
-                            $govt_domain = explode('.',$user_email[1]);
69
-                            $govt_domain_len = count($govt_domain) - 1;
66
+						// cyu - check if domain is gc.ca
67
+						if (!$isValid) {
68
+							$govt_domain = explode('.',$user_email[1]);
69
+							$govt_domain_len = count($govt_domain) - 1;
70 70
 
71
-                            if ($govt_domain[$govt_domain_len - 1].'.'.$govt_domain[$govt_domain_len] === 'gc.ca') {
72
-                                $isValid = true;
73
-                            } else {
74
-                                $isValid = false;
75
-                                $error_message = elgg_echo('gcc_profile:error').elgg_echo('gcc_profile:notaccepted');
76
-                            }
77
-                        }
78
-                    }
71
+							if ($govt_domain[$govt_domain_len - 1].'.'.$govt_domain[$govt_domain_len] === 'gc.ca') {
72
+								$isValid = true;
73
+							} else {
74
+								$isValid = false;
75
+								$error_message = elgg_echo('gcc_profile:error').elgg_echo('gcc_profile:notaccepted');
76
+							}
77
+						}
78
+					}
79 79
 
80
-                    if (!$isValid) {
81
-                        prepare_email_change($user_guid, $v);
82
-                        // register_error($error_message);
83
-                    } else {
84
-                        $user->set($f, $v);
85
-                    }
86
-                } else if($f == 'location' && $v) {
80
+					if (!$isValid) {
81
+						prepare_email_change($user_guid, $v);
82
+						// register_error($error_message);
83
+					} else {
84
+						$user->set($f, $v);
85
+					}
86
+				} else if($f == 'location' && $v) {
87 87
 
88
-                    //check to see if addressString exists
89
-                    if($user->addressString && $user->addressStringFr){
88
+					//check to see if addressString exists
89
+					if($user->addressString && $user->addressStringFr){
90 90
 
91
-                        //split up location field value
92
-                        $address = explode(',', $v);
91
+						//split up location field value
92
+						$address = explode(',', $v);
93 93
 
94
-                        //Add cut up location field to address string
95
-                        //if user enters a proper address the address wil display nicely. If not the map will not display right
96
-                        //sadly we cannot extract all the same information from the location field properly to complete the json string
97
-                        $user->addressString = '{"street":"'.$address[0].'","city":"'.$address[1].'","province":"'.$address[2].'","country":"Canada","pc":""}';
98
-                        $user->addressStringFr = '{"street":"'.$address[0].'","city":"'.$address[1].'","province":"'.$address[2].'","country":"Canada","pc":""}';
94
+						//Add cut up location field to address string
95
+						//if user enters a proper address the address wil display nicely. If not the map will not display right
96
+						//sadly we cannot extract all the same information from the location field properly to complete the json string
97
+						$user->addressString = '{"street":"'.$address[0].'","city":"'.$address[1].'","province":"'.$address[2].'","country":"Canada","pc":""}';
98
+						$user->addressStringFr = '{"street":"'.$address[0].'","city":"'.$address[1].'","province":"'.$address[2].'","country":"Canada","pc":""}';
99 99
 
100
-                    }
100
+					}
101 101
 
102
-                    //set value like normal
103
-                    $user->set($f, $v);
102
+					//set value like normal
103
+					$user->set($f, $v);
104 104
 
105
-                } else {
106
-            		$user->set($f, $v);
107
-            	}
108
-            }
105
+				} else {
106
+					$user->set($f, $v);
107
+				}
108
+			}
109 109
             
110
-            foreach ( $social_media as $f => $v ) {
111
-                $link = $v;
112
-                if (filter_var($link, FILTER_VALIDATE_URL) == false) {
113
-                    $user->set($f, $link);
114
-                }
115
-            }
116
-            //$user->micro = get_input('micro');
117
-            $user->save();
118
-            //forward($user->getURL());
119
-            break;
120
-        case 'about-me':
121
-            //$user->description = get_input('description', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0001.');
122
-            //error_log(print_r("access: " . get_input('access')));
123
-            create_metadata($user_guid, 'description', get_input('description', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0001.'), 'text', 0, get_input('access'));
124
-            $user->save();
125
-            break;
126
-        case 'education':
127
-            $eguid = get_input('eguid', '');
128
-            $delete = get_input('delete', '');
129
-            $school = get_input('school', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0002.');
130
-            $startdate = get_input('startdate', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0003.');
131
-            $startyear = get_input('startyear');
132
-            $enddate = get_input('enddate', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0004.');
133
-            $endyear = get_input('endyear');
134
-            $ongoing = get_input('ongoing');
135
-            //$program = get_input('program', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0005.');
136
-            $degree = get_input('degree');
137
-            $field = get_input('field', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0006.');
138
-            $access = get_input('access', 'ERROR: Ask your admin to grep: 5321GDS1111661353BB.');
139
-            // create education object
140
-            $education_guids = array();
141
-            $education_list = $user->education;
142
-            if ($delete != null && !is_array($delete)) {
143
-                $delete = array( $delete );
144
-            }
145
-            if ( is_array($delete) ) {
146
-                foreach ($delete as $delete_guid) {
147
-                    if ($delete_guid != NULL) {
148
-                        if ($delete = get_entity($delete_guid)) {
149
-                            $delete->delete();
150
-                        }
151
-                        if (is_array($education_list)) {
152
-                            if (($key = array_search($delete_guid, $education_list)) !== false) {
153
-                                unset($education_list[$key]);
154
-                            }
155
-                        } elseif ($education_list == $delete_guid) {
156
-                            $education_list = null;
157
-                        }
158
-                    }
159
-                }
160
-            }
161
-            $user->education = $education_list;
162
-            if ($eguid != null && !is_array($eguid)) {
163
-                $eguid = array( $eguid );
164
-            }
165
-            //create new education entries
166
-            if (is_array($eguid)) {
167
-                foreach ($eguid as $k => $v) {
168
-                    $validInput = true;
169
-                    /*
110
+			foreach ( $social_media as $f => $v ) {
111
+				$link = $v;
112
+				if (filter_var($link, FILTER_VALIDATE_URL) == false) {
113
+					$user->set($f, $link);
114
+				}
115
+			}
116
+			//$user->micro = get_input('micro');
117
+			$user->save();
118
+			//forward($user->getURL());
119
+			break;
120
+		case 'about-me':
121
+			//$user->description = get_input('description', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0001.');
122
+			//error_log(print_r("access: " . get_input('access')));
123
+			create_metadata($user_guid, 'description', get_input('description', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0001.'), 'text', 0, get_input('access'));
124
+			$user->save();
125
+			break;
126
+		case 'education':
127
+			$eguid = get_input('eguid', '');
128
+			$delete = get_input('delete', '');
129
+			$school = get_input('school', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0002.');
130
+			$startdate = get_input('startdate', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0003.');
131
+			$startyear = get_input('startyear');
132
+			$enddate = get_input('enddate', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0004.');
133
+			$endyear = get_input('endyear');
134
+			$ongoing = get_input('ongoing');
135
+			//$program = get_input('program', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0005.');
136
+			$degree = get_input('degree');
137
+			$field = get_input('field', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0006.');
138
+			$access = get_input('access', 'ERROR: Ask your admin to grep: 5321GDS1111661353BB.');
139
+			// create education object
140
+			$education_guids = array();
141
+			$education_list = $user->education;
142
+			if ($delete != null && !is_array($delete)) {
143
+				$delete = array( $delete );
144
+			}
145
+			if ( is_array($delete) ) {
146
+				foreach ($delete as $delete_guid) {
147
+					if ($delete_guid != NULL) {
148
+						if ($delete = get_entity($delete_guid)) {
149
+							$delete->delete();
150
+						}
151
+						if (is_array($education_list)) {
152
+							if (($key = array_search($delete_guid, $education_list)) !== false) {
153
+								unset($education_list[$key]);
154
+							}
155
+						} elseif ($education_list == $delete_guid) {
156
+							$education_list = null;
157
+						}
158
+					}
159
+				}
160
+			}
161
+			$user->education = $education_list;
162
+			if ($eguid != null && !is_array($eguid)) {
163
+				$eguid = array( $eguid );
164
+			}
165
+			//create new education entries
166
+			if (is_array($eguid)) {
167
+				foreach ($eguid as $k => $v) {
168
+					$validInput = true;
169
+					/*
170 170
                     if($ongoing[$k] == true){
171 171
                         $endyear[$k] = $startyear[$k];
172 172
                     }*/
173
-                    if(trim( htmlentities($school[$k])) == '' || trim( htmlentities($degree[$k])) == '' || trim( htmlentities($field[$k])) == ''){
174
-                        $validInput = false;
175
-                        $error == true;
176
-                    }
177
-                    /*
173
+					if(trim( htmlentities($school[$k])) == '' || trim( htmlentities($degree[$k])) == '' || trim( htmlentities($field[$k])) == ''){
174
+						$validInput = false;
175
+						$error == true;
176
+					}
177
+					/*
178 178
                     if(trim( $endyear[$k]) < trim($startyear[$k])){
179 179
                         $validInput = false;
180 180
                         $error == true;
181 181
                     }
182 182
                     */
183
-                    if($validInput == true){
184
-                        if ($v == "new") {
185
-                            $education = new ElggObject();
186
-                            $education->subtype = "education";
187
-                            $education->owner_guid = $user_guid;
188
-                        } else {
189
-                            $education = get_entity($v);
190
-                        }
191
-                        $education->title = htmlentities($school[$k]);
192
-                        $education->description = htmlentities($degree[$k]);
193
-                        $education->school = htmlentities($school[$k]);
194
-                        $education->startdate = $startdate[$k];
195
-                        $education->startyear = $startyear[$k];
196
-                        $education->enddate = $enddate[$k];
197
-                        $education->endyear = $endyear[$k];
198
-                        $education->ongoing = $ongoing[$k];
199
-                        //$education->program = htmlentities($program[$k]);
200
-                        $education->degree = htmlentities($degree[$k]);
201
-                        $education->field = htmlentities($field[$k]);
202
-                        $education->access_id = $access;
203
-                        if ($v == "new") {
204
-                            $education_guids[] = $education->save();
205
-                        } else {
206
-                            $education->save();
207
-                        }
208
-                    }
209
-                }
210
-            }
211
-            if ($user->education == NULL) {
212
-                $user->education = $education_guids;
213
-            }
214
-            else {
215
-                $stack = $user->education;
216
-                if (!(is_array($stack))) { $stack = array($stack); }
217
-                if ($education_guids != NULL) {
218
-                    $user->education = array_merge($stack, $education_guids);
219
-                }
220
-            }
221
-            $user->education_access = $access;
222
-            $user->save();
223
-            break;
224
-        case 'work-experience':
225
-            $work_experience = get_input('work');
226
-            $edit = $work_experience['edit'];
227
-            $delete = $work_experience['delete_guids'];
228
-            $access = get_input('access');
229
-            $experience_list = $user->work;
230
-            if (!(is_array($delete))) { $delete = array($delete); }
231
-            foreach ($delete as $delete_guid) {
232
-                if ($delete_guid != NULL) {
233
-                    if ($delete = get_entity($delete_guid)) {
234
-                        $delete->delete();
235
-                    }
236
-                    if (is_array($experience_list)) {
237
-                        if (($key = array_search($delete_guid, $experience_list)) !== false) {
238
-                            unset($experience_list[$key]);
239
-                        }
240
-                    }
241
-                    elseif ($experience_list == $delete_guid) {
242
-                        $experience_list = null;
243
-                    }
244
-                }
245
-            }
246
-            $user->work = $experience_list;
247
-            $work_experience_guids = array();
248
-            if ($edit != null && !is_array($edit)) {
249
-                $edit = array( $edit );
250
-            }
183
+					if($validInput == true){
184
+						if ($v == "new") {
185
+							$education = new ElggObject();
186
+							$education->subtype = "education";
187
+							$education->owner_guid = $user_guid;
188
+						} else {
189
+							$education = get_entity($v);
190
+						}
191
+						$education->title = htmlentities($school[$k]);
192
+						$education->description = htmlentities($degree[$k]);
193
+						$education->school = htmlentities($school[$k]);
194
+						$education->startdate = $startdate[$k];
195
+						$education->startyear = $startyear[$k];
196
+						$education->enddate = $enddate[$k];
197
+						$education->endyear = $endyear[$k];
198
+						$education->ongoing = $ongoing[$k];
199
+						//$education->program = htmlentities($program[$k]);
200
+						$education->degree = htmlentities($degree[$k]);
201
+						$education->field = htmlentities($field[$k]);
202
+						$education->access_id = $access;
203
+						if ($v == "new") {
204
+							$education_guids[] = $education->save();
205
+						} else {
206
+							$education->save();
207
+						}
208
+					}
209
+				}
210
+			}
211
+			if ($user->education == NULL) {
212
+				$user->education = $education_guids;
213
+			}
214
+			else {
215
+				$stack = $user->education;
216
+				if (!(is_array($stack))) { $stack = array($stack); }
217
+				if ($education_guids != NULL) {
218
+					$user->education = array_merge($stack, $education_guids);
219
+				}
220
+			}
221
+			$user->education_access = $access;
222
+			$user->save();
223
+			break;
224
+		case 'work-experience':
225
+			$work_experience = get_input('work');
226
+			$edit = $work_experience['edit'];
227
+			$delete = $work_experience['delete_guids'];
228
+			$access = get_input('access');
229
+			$experience_list = $user->work;
230
+			if (!(is_array($delete))) { $delete = array($delete); }
231
+			foreach ($delete as $delete_guid) {
232
+				if ($delete_guid != NULL) {
233
+					if ($delete = get_entity($delete_guid)) {
234
+						$delete->delete();
235
+					}
236
+					if (is_array($experience_list)) {
237
+						if (($key = array_search($delete_guid, $experience_list)) !== false) {
238
+							unset($experience_list[$key]);
239
+						}
240
+					}
241
+					elseif ($experience_list == $delete_guid) {
242
+						$experience_list = null;
243
+					}
244
+				}
245
+			}
246
+			$user->work = $experience_list;
247
+			$work_experience_guids = array();
248
+			if ($edit != null && !is_array($edit)) {
249
+				$edit = array( $edit );
250
+			}
251 251
 
252
-            //create new work experience entries
253
-            if ( is_array($edit) ) {
254
-                foreach ($edit as $work) {
255
-                    $validInput = true;
256
-                    /*
252
+			//create new work experience entries
253
+			if ( is_array($edit) ) {
254
+				foreach ($edit as $work) {
255
+					$validInput = true;
256
+					/*
257 257
                     if($work['ongoing'] == true){
258 258
                         $work['endyear'] = $work['startyear'];
259 259
                     }
260 260
                     */
261
-                    //validation of work experience entry
262
-                    if(trim($work['title']) == '' || trim($work['organization']) == ''){
263
-                        $validInput = false;
264
-                        $error = true;
265
-                    }
266
-                    /*
261
+					//validation of work experience entry
262
+					if(trim($work['title']) == '' || trim($work['organization']) == ''){
263
+						$validInput = false;
264
+						$error = true;
265
+					}
266
+					/*
267 267
                     if(trim($work['endyear']) < trim($work['startyear'])){
268 268
                         $validInput = false;
269 269
                         $error = true;
270 270
                     }
271 271
                     */
272
-                    if($validInput == true) {
273
-                        if ($work['eguid'] == "new") {
274
-                            $experience = new ElggObject();
275
-                            $experience->subtype = "experience";
276
-                            $experience->owner_guid = $user_guid;
277
-                        } else {
278
-                            $experience = get_entity($work['eguid']);
279
-                        }
280
-                        $experience->title = htmlentities($work['title']);
281
-                        $experience->description = htmlentities($work['responsibilities']);
282
-                        $experience->organization = htmlentities($work['organization']);
283
-                        $experience->startdate = $work['startdate'];
284
-                        $experience->startyear = $work['startyear'];
285
-                        $experience->not_applicable = $work['not_applicable'];
286
-                        $experience->enddate = $work['enddate'];
287
-                        $experience->endyear = $work['endyear'];
288
-                        $experience->ongoing = $work['ongoing'];
289
-                        $experience->responsibilities = trim($work['responsibilities']);
290
-                        $experience->colleagues = $work['colleagues'];
291
-                        $experience->access_id = $access;
292
-                        if ($work['eguid'] == "new") {
293
-                            $work_experience_guids[] = $experience->save();
294
-                        } else {
295
-                            $experience->save();
296
-                        }
297
-                    }
298
-                }
299
-            }
300
-            if ($user->work == NULL) {
301
-                $user->work = $work_experience_guids;
302
-            }
303
-            else {
304
-                $stack = $user->work;
305
-                if (!(is_array($stack))) { $stack = array($stack); }
306
-                if ($work_experience_guids != NULL) {
307
-                    $user->work = array_merge($stack, $work_experience_guids);
308
-                }
309
-            }
310
-            $user->work_access = $access;
311
-            $user->save();
312
-            break;
313
-        case 'skills':
314
-            $skillsToAdd = get_input('skillsadded', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0021.');
315
-            $skillsToRemove = get_input('skillsremoved', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0022.');
316
-            //$access = ACCESS_LOGGED_IN;
317
-            $access = get_input('access');
318
-            //error_log('test - '.$access);
319
-            $skill_guids = array();
320
-            foreach ($skillsToAdd as $new_skill) {
321
-                $skill = new ElggObject();
322
-                $skill->subtype = "MySkill";
323
-                $skill->title = htmlentities($new_skill);
324
-                $skill->owner_guid = $user_guid;
325
-                $skill->access_id = $access;
326
-                $skill->endorsements = NULL;
327
-                $skill_guids[] = $skill->save();
328
-            }
329
-            $skill_list = $user->gc_skills;
330
-            if (!(is_array($skill_list))) { $skill_list = array($skill_list); }
331
-            if (!(is_array($skillsToRemove))) { $skillsToRemove = array($skillsToRemove); }
332
-            foreach ($skillsToRemove as $remove_guid) {
333
-                if ($remove_guid != NULL) {
334
-                    if ($remove = get_entity($remove_guid)) {
335
-                        $remove->delete();
336
-                    }
337
-                    if (($key = array_search($remove_guid, $skill_list)) !== false) {
338
-                        unset($skill_list[$key]);
339
-                    }
340
-                }
341
-            }
342
-            $user->gc_skills = $skill_list;
343
-            if ($user->gc_skills == NULL) {
344
-                $user->gc_skills = $skill_guids;
345
-            }
346
-            else {
347
-                $stack = $user->gc_skills;
348
-                if (!(is_array($stack))) { $stack = array($stack); }
349
-                if ($skill_guids != NULL) {
350
-                    $user->gc_skills = array_merge($stack, $skill_guids);
351
-                }
352
-            }
353
-            //$user->gc_skills = null; // dev stuff... delete me
354
-            //$user->skillsupgraded = NULL; // dev stuff.. delete me
355
-            $user->skill_access = $access;
356
-            $user->save();
272
+					if($validInput == true) {
273
+						if ($work['eguid'] == "new") {
274
+							$experience = new ElggObject();
275
+							$experience->subtype = "experience";
276
+							$experience->owner_guid = $user_guid;
277
+						} else {
278
+							$experience = get_entity($work['eguid']);
279
+						}
280
+						$experience->title = htmlentities($work['title']);
281
+						$experience->description = htmlentities($work['responsibilities']);
282
+						$experience->organization = htmlentities($work['organization']);
283
+						$experience->startdate = $work['startdate'];
284
+						$experience->startyear = $work['startyear'];
285
+						$experience->not_applicable = $work['not_applicable'];
286
+						$experience->enddate = $work['enddate'];
287
+						$experience->endyear = $work['endyear'];
288
+						$experience->ongoing = $work['ongoing'];
289
+						$experience->responsibilities = trim($work['responsibilities']);
290
+						$experience->colleagues = $work['colleagues'];
291
+						$experience->access_id = $access;
292
+						if ($work['eguid'] == "new") {
293
+							$work_experience_guids[] = $experience->save();
294
+						} else {
295
+							$experience->save();
296
+						}
297
+					}
298
+				}
299
+			}
300
+			if ($user->work == NULL) {
301
+				$user->work = $work_experience_guids;
302
+			}
303
+			else {
304
+				$stack = $user->work;
305
+				if (!(is_array($stack))) { $stack = array($stack); }
306
+				if ($work_experience_guids != NULL) {
307
+					$user->work = array_merge($stack, $work_experience_guids);
308
+				}
309
+			}
310
+			$user->work_access = $access;
311
+			$user->save();
312
+			break;
313
+		case 'skills':
314
+			$skillsToAdd = get_input('skillsadded', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0021.');
315
+			$skillsToRemove = get_input('skillsremoved', 'ERROR: Ask your admin to grep: 5FH13GAHHHS0022.');
316
+			//$access = ACCESS_LOGGED_IN;
317
+			$access = get_input('access');
318
+			//error_log('test - '.$access);
319
+			$skill_guids = array();
320
+			foreach ($skillsToAdd as $new_skill) {
321
+				$skill = new ElggObject();
322
+				$skill->subtype = "MySkill";
323
+				$skill->title = htmlentities($new_skill);
324
+				$skill->owner_guid = $user_guid;
325
+				$skill->access_id = $access;
326
+				$skill->endorsements = NULL;
327
+				$skill_guids[] = $skill->save();
328
+			}
329
+			$skill_list = $user->gc_skills;
330
+			if (!(is_array($skill_list))) { $skill_list = array($skill_list); }
331
+			if (!(is_array($skillsToRemove))) { $skillsToRemove = array($skillsToRemove); }
332
+			foreach ($skillsToRemove as $remove_guid) {
333
+				if ($remove_guid != NULL) {
334
+					if ($remove = get_entity($remove_guid)) {
335
+						$remove->delete();
336
+					}
337
+					if (($key = array_search($remove_guid, $skill_list)) !== false) {
338
+						unset($skill_list[$key]);
339
+					}
340
+				}
341
+			}
342
+			$user->gc_skills = $skill_list;
343
+			if ($user->gc_skills == NULL) {
344
+				$user->gc_skills = $skill_guids;
345
+			}
346
+			else {
347
+				$stack = $user->gc_skills;
348
+				if (!(is_array($stack))) { $stack = array($stack); }
349
+				if ($skill_guids != NULL) {
350
+					$user->gc_skills = array_merge($stack, $skill_guids);
351
+				}
352
+			}
353
+			//$user->gc_skills = null; // dev stuff... delete me
354
+			//$user->skillsupgraded = NULL; // dev stuff.. delete me
355
+			$user->skill_access = $access;
356
+			$user->save();
357 357
 
358
-            break;
359
-        case 'old-skills':
360
-            $user->skillsupgraded = TRUE;
361
-            break;
362
-        case 'languages':
363
-            $firstlang = get_input('firstlang', '');
364
-            $french = get_input('french', 'ERROR: Ask your admin to grep: ASFDJKGJKG333616.');
365
-            $english = get_input('english', 'ERROR: Ask your admin to grep: SDFANLVNVNVNVNVNAA31566.');
366
-            $languagesToAdd = get_input('langadded', 'ERROR: Ask your admin to grep: 5FH13FFSSGAHHHS0021.');
367
-            $languagesToRemove = get_input('langremoved', 'ERROR: Ask your admin to grep: 5AAAAGGFH13GAH0022.');
368
-            //$access = get_input('access');    // not used
358
+			break;
359
+		case 'old-skills':
360
+			$user->skillsupgraded = TRUE;
361
+			break;
362
+		case 'languages':
363
+			$firstlang = get_input('firstlang', '');
364
+			$french = get_input('french', 'ERROR: Ask your admin to grep: ASFDJKGJKG333616.');
365
+			$english = get_input('english', 'ERROR: Ask your admin to grep: SDFANLVNVNVNVNVNAA31566.');
366
+			$languagesToAdd = get_input('langadded', 'ERROR: Ask your admin to grep: 5FH13FFSSGAHHHS0021.');
367
+			$languagesToRemove = get_input('langremoved', 'ERROR: Ask your admin to grep: 5AAAAGGFH13GAH0022.');
368
+			//$access = get_input('access');    // not used
369 369
 			$access = get_input('access_id');
370
-            $user->english = $english;
371
-            $user->french = $french;
372
-            $user->officialLanguage = $firstlang;
373
-            $user->save();
370
+			$user->english = $english;
371
+			$user->french = $french;
372
+			$user->officialLanguage = $firstlang;
373
+			$user->save();
374 374
 
375 375
 			$metadata = elgg_get_metadata(array(
376
-                'metadata_names' => array('english'),
377
-                'metadata_owner_guids' => array(elgg_get_logged_in_user_guid()),
378
-            ));
379
-            if ($metadata){
380
-                foreach ($metadata as $data){
376
+				'metadata_names' => array('english'),
377
+				'metadata_owner_guids' => array(elgg_get_logged_in_user_guid()),
378
+			));
379
+			if ($metadata){
380
+				foreach ($metadata as $data){
381 381
 
382
-                    update_metadata($data->id, $data->name, $data->value, $data->value_type, $data->owner_guid, $access);
383
-                    //error_log('id '.$data->id .' name '. $data->name.' value '. $data->value.' value type '. $data->value_type.' owner_guid '.$data->owner_guid.' $access '. $access);
384
-                }
385
-                //$metadata[0]->save();
386
-            }
387
-            $metadata = elgg_get_metadata(array(
388
-                'metadata_names' => array('french'),
389
-                'metadata_owner_guids' => array(elgg_get_logged_in_user_guid()),
390
-            ));
391
-            if ($metadata){
392
-                foreach ($metadata as $data){
382
+					update_metadata($data->id, $data->name, $data->value, $data->value_type, $data->owner_guid, $access);
383
+					//error_log('id '.$data->id .' name '. $data->name.' value '. $data->value.' value type '. $data->value_type.' owner_guid '.$data->owner_guid.' $access '. $access);
384
+				}
385
+				//$metadata[0]->save();
386
+			}
387
+			$metadata = elgg_get_metadata(array(
388
+				'metadata_names' => array('french'),
389
+				'metadata_owner_guids' => array(elgg_get_logged_in_user_guid()),
390
+			));
391
+			if ($metadata){
392
+				foreach ($metadata as $data){
393 393
 
394
-                    update_metadata($data->id, $data->name, $data->value, $data->value_type, $data->owner_guid, $access);
395
-                }
396
-                //$metadata[0]->save();
397
-            }
394
+					update_metadata($data->id, $data->name, $data->value, $data->value_type, $data->owner_guid, $access);
395
+				}
396
+				//$metadata[0]->save();
397
+			}
398 398
 			$metadata = elgg_get_metadata(array(
399
-                'metadata_names' => array('officialLanguage'),
400
-                'metadata_owner_guids' => array(elgg_get_logged_in_user_guid()),
401
-            ));
402
-            if ($metadata){
403
-                foreach ($metadata as $data){
399
+				'metadata_names' => array('officialLanguage'),
400
+				'metadata_owner_guids' => array(elgg_get_logged_in_user_guid()),
401
+			));
402
+			if ($metadata){
403
+				foreach ($metadata as $data){
404 404
 
405
-                    update_metadata($data->id, $data->name, $data->value, $data->value_type, $data->owner_guid, $access);
406
-                }
407
-                //$metadata[0]->save();
408
-            }
405
+					update_metadata($data->id, $data->name, $data->value, $data->value_type, $data->owner_guid, $access);
406
+				}
407
+				//$metadata[0]->save();
408
+			}
409 409
 
410
-            break;
411
-        case 'portfolio':
412
-            $portfolio = get_input('portfolio');
413
-            $edit = $portfolio['edit'];
414
-            $delete = $portfolio['delete_guids'];
415
-            $access = get_input('access');
416
-            $portfolio_list = $user->portfolio;
417
-            if (!(is_array($delete))) { $delete = array($delete); }
418
-            foreach ($delete as $delete_guid) {
419
-                if ($delete_guid != NULL) {
420
-                    if ($delete = get_entity($delete_guid)) {
421
-                        $delete->delete();
422
-                    }
423
-                    if (is_array($portfolio_list)) {
424
-                        if (($key = array_search($delete_guid, $portfolio_list)) !== false) {
425
-                            unset($portfolio_list[$key]);
426
-                        }
427
-                    }
428
-                    elseif ($portfolio_list == $delete_guid) {
429
-                        $portfolio_list = null;
430
-                    }
431
-                }
432
-            }
433
-            $user->portfolio = $portfolio_list;
434
-            $portfolio_list_guids = array();
435
-            //create new work experience entries
436
-            foreach ($edit as $portfolio_edit) {
437
-                $validInput = true;
438
-                if(trim($portfolio_edit['title']) == '' || trim($portfolio_edit['description']) == '' || trim($portfolio_edit['link']) == ''){
439
-                    $validInput = false;
440
-                    $error = true;
441
-                }
442
-                if($portfolio_edit['datestamped'] == false && trim( $portfolio_edit['pubdate']) == ''){
443
-                    $validInput = false;
444
-                    $error = true;
445
-                }
446
-                if($validInput == true){
447
-                    if ($portfolio_edit['eguid'] == "new") {
448
-                        $entry = new ElggObject();
449
-                        $entry->subtype = "portfolio";
450
-                        $entry->owner_guid = $user_guid;
451
-                    }
452
-                    else {
453
-                        $entry = get_entity($portfolio_edit['eguid']);
454
-                    }
455
-                    $entry->title = htmlentities($portfolio_edit['title']);
456
-                    $entry->description = htmlentities($portfolio_edit['description']);
457
-                    $entry->link = $portfolio_edit['link'];
458
-                    $entry->pubdate = $portfolio_edit['pubdate'];
459
-                    $entry->datestamped = $portfolio_edit['datestamped'];
460
-                    $entry->access_id = $access;
461
-                    if($portfolio_edit['eguid'] == "new") {
462
-                        $portfolio_list_guids[] = $entry->save();
463
-                    }
464
-                    else {
465
-                        $entry->save();
466
-                    }
467
-                }
468
-            }
469
-            if ($user->portfolio == NULL) {
470
-                $user->portfolio = $portfolio_list_guids;
471
-            }
472
-            else {
473
-                $stack = $user->portfolio;
474
-                if (!(is_array($stack))) { $stack = array($stack); }
475
-                if ($portfolio_list_guids != NULL) {
476
-                    $user->portfolio = array_merge($stack, $portfolio_list_guids);
477
-                }
478
-            }
479
-            //$user->portfolio = null;
480
-            $user->portfolio_access = $access;
481
-            $user->save();
482
-            break;
410
+			break;
411
+		case 'portfolio':
412
+			$portfolio = get_input('portfolio');
413
+			$edit = $portfolio['edit'];
414
+			$delete = $portfolio['delete_guids'];
415
+			$access = get_input('access');
416
+			$portfolio_list = $user->portfolio;
417
+			if (!(is_array($delete))) { $delete = array($delete); }
418
+			foreach ($delete as $delete_guid) {
419
+				if ($delete_guid != NULL) {
420
+					if ($delete = get_entity($delete_guid)) {
421
+						$delete->delete();
422
+					}
423
+					if (is_array($portfolio_list)) {
424
+						if (($key = array_search($delete_guid, $portfolio_list)) !== false) {
425
+							unset($portfolio_list[$key]);
426
+						}
427
+					}
428
+					elseif ($portfolio_list == $delete_guid) {
429
+						$portfolio_list = null;
430
+					}
431
+				}
432
+			}
433
+			$user->portfolio = $portfolio_list;
434
+			$portfolio_list_guids = array();
435
+			//create new work experience entries
436
+			foreach ($edit as $portfolio_edit) {
437
+				$validInput = true;
438
+				if(trim($portfolio_edit['title']) == '' || trim($portfolio_edit['description']) == '' || trim($portfolio_edit['link']) == ''){
439
+					$validInput = false;
440
+					$error = true;
441
+				}
442
+				if($portfolio_edit['datestamped'] == false && trim( $portfolio_edit['pubdate']) == ''){
443
+					$validInput = false;
444
+					$error = true;
445
+				}
446
+				if($validInput == true){
447
+					if ($portfolio_edit['eguid'] == "new") {
448
+						$entry = new ElggObject();
449
+						$entry->subtype = "portfolio";
450
+						$entry->owner_guid = $user_guid;
451
+					}
452
+					else {
453
+						$entry = get_entity($portfolio_edit['eguid']);
454
+					}
455
+					$entry->title = htmlentities($portfolio_edit['title']);
456
+					$entry->description = htmlentities($portfolio_edit['description']);
457
+					$entry->link = $portfolio_edit['link'];
458
+					$entry->pubdate = $portfolio_edit['pubdate'];
459
+					$entry->datestamped = $portfolio_edit['datestamped'];
460
+					$entry->access_id = $access;
461
+					if($portfolio_edit['eguid'] == "new") {
462
+						$portfolio_list_guids[] = $entry->save();
463
+					}
464
+					else {
465
+						$entry->save();
466
+					}
467
+				}
468
+			}
469
+			if ($user->portfolio == NULL) {
470
+				$user->portfolio = $portfolio_list_guids;
471
+			}
472
+			else {
473
+				$stack = $user->portfolio;
474
+				if (!(is_array($stack))) { $stack = array($stack); }
475
+				if ($portfolio_list_guids != NULL) {
476
+					$user->portfolio = array_merge($stack, $portfolio_list_guids);
477
+				}
478
+			}
479
+			//$user->portfolio = null;
480
+			$user->portfolio_access = $access;
481
+			$user->save();
482
+			break;
483 483
 
484
-        /*
484
+		/*
485 485
          * MODIFIED CODE!
486 486
          * optset is the array of opt-in choices and gets directly saved as a metadata array (cannot be associative).
487 487
          * access is not currently being used for anything.
488 488
          */
489
-        case 'opt-in':
490
-            $opt_in_set = get_input('opt_in_set');
491
-            $access = get_input('access');
489
+		case 'opt-in':
490
+			$opt_in_set = get_input('opt_in_set');
491
+			$access = get_input('access');
492 492
 
493
-            $user->opt_in_missions = $opt_in_set[0];
494
-            $user->opt_in_swap = $opt_in_set[1];
495
-            $user->opt_in_mentored = $opt_in_set[2];
496
-            $user->opt_in_mentoring = $opt_in_set[3];
497
-            $user->opt_in_shadowed = $opt_in_set[4];
498
-            $user->opt_in_shadowing = $opt_in_set[5];
499
-            $user->opt_in_jobshare = $opt_in_set[6];
500
-            $user->opt_in_pcSeek = $opt_in_set[7];
501
-            $user->opt_in_pcCreate = $opt_in_set[8];
502
-            $user->opt_in_ssSeek = $opt_in_set[9];
503
-            $user->opt_in_ssCreate = $opt_in_set[10];
504
-            $user->opt_in_rotation = $opt_in_set[11];
505
-            $user->opt_in_assignSeek = $opt_in_set[12];
506
-            $user->opt_in_assignCreate = $opt_in_set[13];
507
-            $user->opt_in_deploySeek = $opt_in_set[14];
508
-            $user->opt_in_deployCreate = $opt_in_set[15];
509
-            $user->opt_in_missionCreate = $opt_in_set[16];
493
+			$user->opt_in_missions = $opt_in_set[0];
494
+			$user->opt_in_swap = $opt_in_set[1];
495
+			$user->opt_in_mentored = $opt_in_set[2];
496
+			$user->opt_in_mentoring = $opt_in_set[3];
497
+			$user->opt_in_shadowed = $opt_in_set[4];
498
+			$user->opt_in_shadowing = $opt_in_set[5];
499
+			$user->opt_in_jobshare = $opt_in_set[6];
500
+			$user->opt_in_pcSeek = $opt_in_set[7];
501
+			$user->opt_in_pcCreate = $opt_in_set[8];
502
+			$user->opt_in_ssSeek = $opt_in_set[9];
503
+			$user->opt_in_ssCreate = $opt_in_set[10];
504
+			$user->opt_in_rotation = $opt_in_set[11];
505
+			$user->opt_in_assignSeek = $opt_in_set[12];
506
+			$user->opt_in_assignCreate = $opt_in_set[13];
507
+			$user->opt_in_deploySeek = $opt_in_set[14];
508
+			$user->opt_in_deployCreate = $opt_in_set[15];
509
+			$user->opt_in_missionCreate = $opt_in_set[16];
510 510
 
511
-            /* MW - Added for GCcollab only */
512
-            $user->opt_in_casual_seek = $opt_in_set[17];
513
-            $user->opt_in_casual_create = $opt_in_set[18];
514
-            $user->opt_in_student_seek = $opt_in_set[19];
515
-            $user->opt_in_student_create = $opt_in_set[20];
511
+			/* MW - Added for GCcollab only */
512
+			$user->opt_in_casual_seek = $opt_in_set[17];
513
+			$user->opt_in_casual_create = $opt_in_set[18];
514
+			$user->opt_in_student_seek = $opt_in_set[19];
515
+			$user->opt_in_student_create = $opt_in_set[20];
516 516
             
517
-            /*$user->opt_in_peer_coached = $opt_in_set[6];
517
+			/*$user->opt_in_peer_coached = $opt_in_set[6];
518 518
               $user->opt_in_peer_coaching = $opt_in_set[7];
519 519
               $user->opt_in_skill_sharing = $opt_in_set[8];
520 520
               $user->opt_in_job_sharing = $opt_in_set[9];*/
521 521
 
522
-            // Not saving this at the moment because it is not in use.
523
-            //$user->optaccess = $access;
522
+			// Not saving this at the moment because it is not in use.
523
+			//$user->optaccess = $access;
524 524
 
525
-            $user->save();
525
+			$user->save();
526 526
 
527
-            break;
528
-        /*
527
+			break;
528
+		/*
529 529
          * END MODIFIED CODE
530 530
          */
531 531
 
532
-        default:
533
-            system_message(elgg_echo("profile:saved"));
534
-    }
535
-    //system_message(elgg_echo("profile:saved"));
536
-    if($error == true){
537
-       register_error(elgg_echo('Not all information could be saved, empty fields are not allowed'));
538
-    } else {
539
-        system_message(elgg_echo("profile:saved"));
540
-    }
532
+		default:
533
+			system_message(elgg_echo("profile:saved"));
534
+	}
535
+	//system_message(elgg_echo("profile:saved"));
536
+	if($error == true){
537
+	   register_error(elgg_echo('Not all information could be saved, empty fields are not allowed'));
538
+	} else {
539
+		system_message(elgg_echo("profile:saved"));
540
+	}
541 541
 }
542 542
 else {  // In case this view will be called via the elgg_view_form() action, then we know it's the basic profile only
543 543
 }
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
             $profile_fields = get_input('profile');
10 10
             $social_media = get_input('social_media');
11 11
             $error_message = '';
12
-            foreach ( $profile_fields as $f => $v ) {
12
+            foreach ($profile_fields as $f => $v) {
13 13
                 // cyu - check if email field is empty
14 14
                 if ($f === "email") {
15
-                    trim($v);   // remove white spaces from both sides of string
15
+                    trim($v); // remove white spaces from both sides of string
16 16
                     if (!$v) {
17
-                        register_error(elgg_echo('gcc_profile:error').elgg_echo('gcc_profile:missingemail'));
17
+                        register_error(elgg_echo('gcc_profile:error') . elgg_echo('gcc_profile:missingemail'));
18 18
                         return true;
19 19
                     }
20 20
 
@@ -23,20 +23,20 @@  discard block
 block discarded – undo
23 23
 
24 24
                     if ($v) {
25 25
                         // cyu - check if the email is in the list of exceptions
26
-                        $user_email = explode('@',$v);
26
+                        $user_email = explode('@', $v);
27 27
                         $list_of_domains = getExtension();
28 28
 
29
-                        if( elgg_is_active_plugin('c_email_extensions') ){
29
+                        if (elgg_is_active_plugin('c_email_extensions')) {
30 30
                             // Checks against the domain manager list...
31 31
                             $wildcard_query = "SELECT ext FROM email_extensions WHERE ext LIKE '%*%'";
32 32
                             $wildcard_emails = get_data($wildcard_query);
33 33
                             
34
-                            if( $wildcard_emails ){
35
-                                foreach($wildcard_emails as $wildcard){
34
+                            if ($wildcard_emails) {
35
+                                foreach ($wildcard_emails as $wildcard) {
36 36
                                     $regex = str_replace(".", "\.", $wildcard->ext);
37 37
                                     $regex = str_replace("*", "[\w-.]+", $regex);
38 38
                                     $regex = "/^@" . $regex . "$/";
39
-                                    if(preg_match($regex, "@".$user_email[1]) || strtolower(str_replace("*.", "", $wildcard->ext)) == strtolower($user_email[1])){
39
+                                    if (preg_match($regex, "@" . $user_email[1]) || strtolower(str_replace("*.", "", $wildcard->ext)) == strtolower($user_email[1])) {
40 40
                                         $isValid = true;
41 41
                                         break;
42 42
                                     }
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
                             }
45 45
                         }
46 46
 
47
-                        if( elgg_is_active_plugin('gcRegistration_invitation') ){
47
+                        if (elgg_is_active_plugin('gcRegistration_invitation')) {
48 48
                             // Checks against the email invitation list...
49 49
                             $invitation_query = "SELECT email FROM email_invitations WHERE email = '{$email}'";
50 50
                             $result = get_data($invitation_query);
51 51
 
52
-                            if( count($result) > 0 ) 
52
+                            if (count($result) > 0) 
53 53
                                 $isValid = true;
54 54
                         }
55 55
 
@@ -60,19 +60,19 @@  discard block
 block discarded – undo
60 60
                                     break;
61 61
                                 }
62 62
                             }
63
-                            $error_message = elgg_echo('gcc_profile:error').elgg_echo('gcc_profile:notaccepted');
63
+                            $error_message = elgg_echo('gcc_profile:error') . elgg_echo('gcc_profile:notaccepted');
64 64
                         }
65 65
 
66 66
                         // cyu - check if domain is gc.ca
67 67
                         if (!$isValid) {
68
-                            $govt_domain = explode('.',$user_email[1]);
68
+                            $govt_domain = explode('.', $user_email[1]);
69 69
                             $govt_domain_len = count($govt_domain) - 1;
70 70
 
71
-                            if ($govt_domain[$govt_domain_len - 1].'.'.$govt_domain[$govt_domain_len] === 'gc.ca') {
71
+                            if ($govt_domain[$govt_domain_len - 1] . '.' . $govt_domain[$govt_domain_len] === 'gc.ca') {
72 72
                                 $isValid = true;
73 73
                             } else {
74 74
                                 $isValid = false;
75
-                                $error_message = elgg_echo('gcc_profile:error').elgg_echo('gcc_profile:notaccepted');
75
+                                $error_message = elgg_echo('gcc_profile:error') . elgg_echo('gcc_profile:notaccepted');
76 76
                             }
77 77
                         }
78 78
                     }
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
                     } else {
84 84
                         $user->set($f, $v);
85 85
                     }
86
-                } else if($f == 'location' && $v) {
86
+                } else if ($f == 'location' && $v) {
87 87
 
88 88
                     //check to see if addressString exists
89
-                    if($user->addressString && $user->addressStringFr){
89
+                    if ($user->addressString && $user->addressStringFr) {
90 90
 
91 91
                         //split up location field value
92 92
                         $address = explode(',', $v);
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
                         //Add cut up location field to address string
95 95
                         //if user enters a proper address the address wil display nicely. If not the map will not display right
96 96
                         //sadly we cannot extract all the same information from the location field properly to complete the json string
97
-                        $user->addressString = '{"street":"'.$address[0].'","city":"'.$address[1].'","province":"'.$address[2].'","country":"Canada","pc":""}';
98
-                        $user->addressStringFr = '{"street":"'.$address[0].'","city":"'.$address[1].'","province":"'.$address[2].'","country":"Canada","pc":""}';
97
+                        $user->addressString = '{"street":"' . $address[0] . '","city":"' . $address[1] . '","province":"' . $address[2] . '","country":"Canada","pc":""}';
98
+                        $user->addressStringFr = '{"street":"' . $address[0] . '","city":"' . $address[1] . '","province":"' . $address[2] . '","country":"Canada","pc":""}';
99 99
 
100 100
                     }
101 101
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             	}
108 108
             }
109 109
             
110
-            foreach ( $social_media as $f => $v ) {
110
+            foreach ($social_media as $f => $v) {
111 111
                 $link = $v;
112 112
                 if (filter_var($link, FILTER_VALIDATE_URL) == false) {
113 113
                     $user->set($f, $link);
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
             $education_guids = array();
141 141
             $education_list = $user->education;
142 142
             if ($delete != null && !is_array($delete)) {
143
-                $delete = array( $delete );
143
+                $delete = array($delete);
144 144
             }
145
-            if ( is_array($delete) ) {
145
+            if (is_array($delete)) {
146 146
                 foreach ($delete as $delete_guid) {
147 147
                     if ($delete_guid != NULL) {
148 148
                         if ($delete = get_entity($delete_guid)) {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             }
161 161
             $user->education = $education_list;
162 162
             if ($eguid != null && !is_array($eguid)) {
163
-                $eguid = array( $eguid );
163
+                $eguid = array($eguid);
164 164
             }
165 165
             //create new education entries
166 166
             if (is_array($eguid)) {
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                     if($ongoing[$k] == true){
171 171
                         $endyear[$k] = $startyear[$k];
172 172
                     }*/
173
-                    if(trim( htmlentities($school[$k])) == '' || trim( htmlentities($degree[$k])) == '' || trim( htmlentities($field[$k])) == ''){
173
+                    if (trim(htmlentities($school[$k])) == '' || trim(htmlentities($degree[$k])) == '' || trim(htmlentities($field[$k])) == '') {
174 174
                         $validInput = false;
175 175
                         $error == true;
176 176
                     }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                         $error == true;
181 181
                     }
182 182
                     */
183
-                    if($validInput == true){
183
+                    if ($validInput == true) {
184 184
                         if ($v == "new") {
185 185
                             $education = new ElggObject();
186 186
                             $education->subtype = "education";
@@ -246,11 +246,11 @@  discard block
 block discarded – undo
246 246
             $user->work = $experience_list;
247 247
             $work_experience_guids = array();
248 248
             if ($edit != null && !is_array($edit)) {
249
-                $edit = array( $edit );
249
+                $edit = array($edit);
250 250
             }
251 251
 
252 252
             //create new work experience entries
253
-            if ( is_array($edit) ) {
253
+            if (is_array($edit)) {
254 254
                 foreach ($edit as $work) {
255 255
                     $validInput = true;
256 256
                     /*
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                     }
260 260
                     */
261 261
                     //validation of work experience entry
262
-                    if(trim($work['title']) == '' || trim($work['organization']) == ''){
262
+                    if (trim($work['title']) == '' || trim($work['organization']) == '') {
263 263
                         $validInput = false;
264 264
                         $error = true;
265 265
                     }
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
                         $error = true;
270 270
                     }
271 271
                     */
272
-                    if($validInput == true) {
272
+                    if ($validInput == true) {
273 273
                         if ($work['eguid'] == "new") {
274 274
                             $experience = new ElggObject();
275 275
                             $experience->subtype = "experience";
@@ -376,8 +376,8 @@  discard block
 block discarded – undo
376 376
                 'metadata_names' => array('english'),
377 377
                 'metadata_owner_guids' => array(elgg_get_logged_in_user_guid()),
378 378
             ));
379
-            if ($metadata){
380
-                foreach ($metadata as $data){
379
+            if ($metadata) {
380
+                foreach ($metadata as $data) {
381 381
 
382 382
                     update_metadata($data->id, $data->name, $data->value, $data->value_type, $data->owner_guid, $access);
383 383
                     //error_log('id '.$data->id .' name '. $data->name.' value '. $data->value.' value type '. $data->value_type.' owner_guid '.$data->owner_guid.' $access '. $access);
@@ -388,8 +388,8 @@  discard block
 block discarded – undo
388 388
                 'metadata_names' => array('french'),
389 389
                 'metadata_owner_guids' => array(elgg_get_logged_in_user_guid()),
390 390
             ));
391
-            if ($metadata){
392
-                foreach ($metadata as $data){
391
+            if ($metadata) {
392
+                foreach ($metadata as $data) {
393 393
 
394 394
                     update_metadata($data->id, $data->name, $data->value, $data->value_type, $data->owner_guid, $access);
395 395
                 }
@@ -399,8 +399,8 @@  discard block
 block discarded – undo
399 399
                 'metadata_names' => array('officialLanguage'),
400 400
                 'metadata_owner_guids' => array(elgg_get_logged_in_user_guid()),
401 401
             ));
402
-            if ($metadata){
403
-                foreach ($metadata as $data){
402
+            if ($metadata) {
403
+                foreach ($metadata as $data) {
404 404
 
405 405
                     update_metadata($data->id, $data->name, $data->value, $data->value_type, $data->owner_guid, $access);
406 406
                 }
@@ -435,15 +435,15 @@  discard block
 block discarded – undo
435 435
             //create new work experience entries
436 436
             foreach ($edit as $portfolio_edit) {
437 437
                 $validInput = true;
438
-                if(trim($portfolio_edit['title']) == '' || trim($portfolio_edit['description']) == '' || trim($portfolio_edit['link']) == ''){
438
+                if (trim($portfolio_edit['title']) == '' || trim($portfolio_edit['description']) == '' || trim($portfolio_edit['link']) == '') {
439 439
                     $validInput = false;
440 440
                     $error = true;
441 441
                 }
442
-                if($portfolio_edit['datestamped'] == false && trim( $portfolio_edit['pubdate']) == ''){
442
+                if ($portfolio_edit['datestamped'] == false && trim($portfolio_edit['pubdate']) == '') {
443 443
                     $validInput = false;
444 444
                     $error = true;
445 445
                 }
446
-                if($validInput == true){
446
+                if ($validInput == true) {
447 447
                     if ($portfolio_edit['eguid'] == "new") {
448 448
                         $entry = new ElggObject();
449 449
                         $entry->subtype = "portfolio";
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                     $entry->pubdate = $portfolio_edit['pubdate'];
459 459
                     $entry->datestamped = $portfolio_edit['datestamped'];
460 460
                     $entry->access_id = $access;
461
-                    if($portfolio_edit['eguid'] == "new") {
461
+                    if ($portfolio_edit['eguid'] == "new") {
462 462
                         $portfolio_list_guids[] = $entry->save();
463 463
                     }
464 464
                     else {
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
             system_message(elgg_echo("profile:saved"));
534 534
     }
535 535
     //system_message(elgg_echo("profile:saved"));
536
-    if($error == true){
536
+    if ($error == true) {
537 537
        register_error(elgg_echo('Not all information could be saved, empty fields are not allowed'));
538 538
     } else {
539 539
         system_message(elgg_echo("profile:saved"));
Please login to merge, or discard this patch.
Braces   +12 added lines, -20 removed lines patch added patch discarded remove patch
@@ -49,8 +49,9 @@  discard block
 block discarded – undo
49 49
                             $invitation_query = "SELECT email FROM email_invitations WHERE email = '{$email}'";
50 50
                             $result = get_data($invitation_query);
51 51
 
52
-                            if( count($result) > 0 ) 
53
-                                $isValid = true;
52
+                            if( count($result) > 0 ) {
53
+                                                            $isValid = true;
54
+                            }
54 55
                         }
55 56
 
56 57
                         if (count($list_of_domains) > 0) {
@@ -210,8 +211,7 @@  discard block
 block discarded – undo
210 211
             }
211 212
             if ($user->education == NULL) {
212 213
                 $user->education = $education_guids;
213
-            }
214
-            else {
214
+            } else {
215 215
                 $stack = $user->education;
216 216
                 if (!(is_array($stack))) { $stack = array($stack); }
217 217
                 if ($education_guids != NULL) {
@@ -237,8 +237,7 @@  discard block
 block discarded – undo
237 237
                         if (($key = array_search($delete_guid, $experience_list)) !== false) {
238 238
                             unset($experience_list[$key]);
239 239
                         }
240
-                    }
241
-                    elseif ($experience_list == $delete_guid) {
240
+                    } elseif ($experience_list == $delete_guid) {
242 241
                         $experience_list = null;
243 242
                     }
244 243
                 }
@@ -299,8 +298,7 @@  discard block
 block discarded – undo
299 298
             }
300 299
             if ($user->work == NULL) {
301 300
                 $user->work = $work_experience_guids;
302
-            }
303
-            else {
301
+            } else {
304 302
                 $stack = $user->work;
305 303
                 if (!(is_array($stack))) { $stack = array($stack); }
306 304
                 if ($work_experience_guids != NULL) {
@@ -342,8 +340,7 @@  discard block
 block discarded – undo
342 340
             $user->gc_skills = $skill_list;
343 341
             if ($user->gc_skills == NULL) {
344 342
                 $user->gc_skills = $skill_guids;
345
-            }
346
-            else {
343
+            } else {
347 344
                 $stack = $user->gc_skills;
348 345
                 if (!(is_array($stack))) { $stack = array($stack); }
349 346
                 if ($skill_guids != NULL) {
@@ -424,8 +421,7 @@  discard block
 block discarded – undo
424 421
                         if (($key = array_search($delete_guid, $portfolio_list)) !== false) {
425 422
                             unset($portfolio_list[$key]);
426 423
                         }
427
-                    }
428
-                    elseif ($portfolio_list == $delete_guid) {
424
+                    } elseif ($portfolio_list == $delete_guid) {
429 425
                         $portfolio_list = null;
430 426
                     }
431 427
                 }
@@ -448,8 +444,7 @@  discard block
 block discarded – undo
448 444
                         $entry = new ElggObject();
449 445
                         $entry->subtype = "portfolio";
450 446
                         $entry->owner_guid = $user_guid;
451
-                    }
452
-                    else {
447
+                    } else {
453 448
                         $entry = get_entity($portfolio_edit['eguid']);
454 449
                     }
455 450
                     $entry->title = htmlentities($portfolio_edit['title']);
@@ -460,16 +455,14 @@  discard block
 block discarded – undo
460 455
                     $entry->access_id = $access;
461 456
                     if($portfolio_edit['eguid'] == "new") {
462 457
                         $portfolio_list_guids[] = $entry->save();
463
-                    }
464
-                    else {
458
+                    } else {
465 459
                         $entry->save();
466 460
                     }
467 461
                 }
468 462
             }
469 463
             if ($user->portfolio == NULL) {
470 464
                 $user->portfolio = $portfolio_list_guids;
471
-            }
472
-            else {
465
+            } else {
473 466
                 $stack = $user->portfolio;
474 467
                 if (!(is_array($stack))) { $stack = array($stack); }
475 468
                 if ($portfolio_list_guids != NULL) {
@@ -538,6 +531,5 @@  discard block
 block discarded – undo
538 531
     } else {
539 532
         system_message(elgg_echo("profile:saved"));
540 533
     }
541
-}
542
-else {  // In case this view will be called via the elgg_view_form() action, then we know it's the basic profile only
534
+} else {  // In case this view will be called via the elgg_view_form() action, then we know it's the basic profile only
543 535
 }
Please login to merge, or discard this patch.
mod/b_extended_profile_collab/start.php 2 patches
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -3,28 +3,28 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,11 +97,11 @@
 block discarded – undo
97 97
         $validation_url,
98 98
     ));
99 99
 
100
-    if( elgg_is_active_plugin('cp_notifications') ){
100
+    if (elgg_is_active_plugin('cp_notifications')) {
101 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 102
     }
103 103
 
104
-    if( elgg_is_active_plugin('phpmailer') ){
104
+    if (elgg_is_active_plugin('phpmailer')) {
105 105
         phpmailer_send($user->email, $user->name, $subject, $message);
106 106
     } else {
107 107
         mail($user->email, $subject, $message, cp_get_headers());
Please login to merge, or discard this patch.
mod/b_extended_profile_collab/views/default/profile/details.php 3 patches
Indentation   +500 added lines, -500 removed lines patch added patch discarded remove patch
@@ -22,61 +22,61 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 ));
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
         $field = strtolower($field);
42 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"))) {
44
+        if (in_array($field, array("federal", "institution", "provincial", "municipal", "international", "ngo", "community", "business", "media", "retired", "other"))) {
45 45
             echo "<div class='form-group col-xs-12 occupation-choices' id='{$field}-wrapper'>";
46
-        } else if(in_array($field, array("university", "college", "highschool"))) {
46
+        } else if (in_array($field, array("university", "college", "highschool"))) {
47 47
             echo "<div class='form-group col-xs-12 occupation-choices student-choices' id='{$field}-wrapper'>";
48 48
         } else {
49 49
             echo "<div class='form-group col-xs-12 {$field}'>";
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         // occupation input
53 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>";
55
+            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}") . "</label>";
56 56
             echo '<div class="col-sm-8">';
57 57
             echo elgg_view('input/select', array(
58 58
                 'name' => $field,
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         // federal input field
145 145
         } else if ($field == 'federal') {
146 146
 
147
-            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>";
147
+            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}") . "</label>";
148 148
             echo '<div class="col-sm-8">';
149 149
 
150 150
             $obj = elgg_get_entities(array(
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             $departments = get_entity($obj[0]->guid);
155 155
             
156 156
             $federal_departments = array();
157
-            if (get_current_language() == 'en'){
157
+            if (get_current_language() == 'en') {
158 158
                 $federal_departments = json_decode($departments->federal_departments_en, true);
159 159
             } else {
160 160
                 $federal_departments = json_decode($departments->federal_departments_fr, true);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         
171 171
         } else if (strcmp($field, 'institution') == 0) {
172 172
 
173
-            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>";
173
+            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}") . "</label>";
174 174
             echo '<div class="col-sm-8">';
175 175
 
176 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'));
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
         } else if (strcmp($field, 'university') == 0) {
187 187
 
188
-            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>";
188
+            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}") . "</label>";
189 189
             echo '<div class="col-sm-8">';
190 190
 
191 191
             $uniObj = elgg_get_entities(array(
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
             $unis = get_entity($uniObj[0]->guid);
196 196
 
197 197
             $universities = array();
198
-            if (get_current_language() == 'en'){
198
+            if (get_current_language() == 'en') {
199 199
                 $universities = json_decode($unis->universities_en, true);
200 200
             } else {
201 201
                 $universities = json_decode($unis->universities_fr, true);
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 
212 212
         } else if (strcmp($field, 'college') == 0) {
213 213
 
214
-            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>";
214
+            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}") . "</label>";
215 215
             echo '<div class="col-sm-8">';
216 216
 
217 217
             $colObj = elgg_get_entities(array(
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             $cols = get_entity($colObj[0]->guid);
222 222
 
223 223
             $colleges = array();
224
-            if (get_current_language() == 'en'){
224
+            if (get_current_language() == 'en') {
225 225
                 $colleges = json_decode($cols->colleges_en, true);
226 226
             } else {
227 227
                 $colleges = json_decode($cols->colleges_fr, true);
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
         // provincial input field
239 239
         } else if ($field == 'provincial') {
240 240
 
241
-            echo "<label for='{$field}' class='col-sm-4 {$field}'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>";
241
+            echo "<label for='{$field}' class='col-sm-4 {$field}'>" . elgg_echo("gcconnex_profile:basic:{$field}") . "</label>";
242 242
             echo '<div class="col-sm-8">';
243 243
 
244 244
             $provObj = elgg_get_entities(array(
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             $provs = get_entity($provObj[0]->guid);
249 249
 
250 250
             $provincial_departments = array();
251
-            if (get_current_language() == 'en'){
251
+            if (get_current_language() == 'en') {
252 252
                 $provincial_departments = json_decode($provs->provinces_en, true);
253 253
             } else {
254 254
                 $provincial_departments = json_decode($provs->provinces_fr, true);
@@ -271,14 +271,14 @@  discard block
 block discarded – undo
271 271
             $mins = get_entity($minObj[0]->guid);
272 272
 
273 273
             $ministries = array();
274
-            if (get_current_language() == 'en'){
274
+            if (get_current_language() == 'en') {
275 275
                 $ministries = json_decode($mins->ministries_en, true);
276 276
             } else {
277 277
                 $ministries = json_decode($mins->ministries_fr, true);
278 278
             }
279 279
 
280
-            foreach($provincial_departments as $province => $name){
281
-                $prov_value = ($user->get('provincial') == $province) ? $user->get('ministry'): "";
280
+            foreach ($provincial_departments as $province => $name) {
281
+                $prov_value = ($user->get('provincial') == $province) ? $user->get('ministry') : "";
282 282
                 $prov_id = str_replace(" ", "-", strtolower($province));
283 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 284
                 echo elgg_view('input/select', array(
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
                     'value' => $prov_value,
289 289
                     'options_values' => $ministries[$province],
290 290
                 ));
291
-                if($province != "Yukon"){ echo '</div></div>'; }
291
+                if ($province != "Yukon") { echo '</div></div>'; }
292 292
             }
293 293
             
294 294
         } else if (strcmp($field, 'municipal') == 0) {
295 295
 
296
-            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>";
296
+            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}") . "</label>";
297 297
             echo '<div class="col-sm-8">';
298 298
 
299 299
             $munObj = elgg_get_entities(array(
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
             $municipals = get_entity($munObj[0]->guid);
304 304
 
305 305
             $municipal = array();
306
-            if (get_current_language() == 'en'){
306
+            if (get_current_language() == 'en') {
307 307
                 $municipal = json_decode($municipals->other_en, true);
308 308
             } else {
309 309
                 $municipal = json_decode($municipals->other_fr, true);
@@ -318,8 +318,8 @@  discard block
 block discarded – undo
318 318
             ));
319 319
 
320 320
             echo '<datalist id="municipal-list">';
321
-                if( !empty($municipal) ){
322
-                    foreach($municipal as $municipal_name => $value){
321
+                if (!empty($municipal)) {
322
+                    foreach ($municipal as $municipal_name => $value) {
323 323
                         echo '<option value="' . $municipal_name . '">' . $value . '</option>';
324 324
                     }
325 325
                 }
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 
328 328
         } else if (strcmp($field, 'retired') == 0) {
329 329
 
330
-            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>";
330
+            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}") . "</label>";
331 331
             echo '<div class="col-sm-8">';
332 332
 
333 333
             $deptObj = elgg_get_entities(array(
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
             $depts = get_entity($deptObj[0]->guid);
338 338
 
339 339
             $federal_departments = array();
340
-            if (get_current_language() == 'en'){
340
+            if (get_current_language() == 'en') {
341 341
                 $federal_departments = json_decode($depts->federal_departments_en, true);
342 342
             } else {
343 343
                 $federal_departments = json_decode($depts->federal_departments_fr, true);
@@ -352,8 +352,8 @@  discard block
 block discarded – undo
352 352
             ));
353 353
 
354 354
             echo '<datalist id="retired-list">';
355
-                if( !empty($federal_departments) ){
356
-                    foreach($federal_departments as $federal_name => $value){
355
+                if (!empty($federal_departments)) {
356
+                    foreach ($federal_departments as $federal_name => $value) {
357 357
                         echo '<option value="' . $federal_name . '">' . $value . '</option>';
358 358
                     }
359 359
                 }
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
         } else if (strcmp($field, 'other') == 0) {
363 363
 
364
-            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}")."</label>";
364
+            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}") . "</label>";
365 365
             echo '<div class="col-sm-8">';
366 366
 
367 367
             $otherObj = elgg_get_entities(array(
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
             $others = get_entity($otherObj[0]->guid);
372 372
 
373 373
             $other = array();
374
-            if (get_current_language() == 'en'){
374
+            if (get_current_language() == 'en') {
375 375
                 $other = json_decode($others->other_en, true);
376 376
             } else {
377 377
                 $other = json_decode($others->other_fr, true);
@@ -386,8 +386,8 @@  discard block
 block discarded – undo
386 386
             ));
387 387
 
388 388
             echo '<datalist id="other-list">';
389
-                if( !empty($other) ){
390
-                    foreach($other as $other_name => $value){
389
+                if (!empty($other)) {
390
+                    foreach ($other as $other_name => $value) {
391 391
                         echo '<option value="' . $other_name . '">' . $value . '</option>';
392 392
                     }
393 393
                 }
@@ -398,12 +398,12 @@  discard block
 block discarded – undo
398 398
             $params = array(
399 399
                 'name' => $field,
400 400
                 'id' => $field,
401
-                'class' => 'gcconnex-basic-'.$field,
401
+                'class' => 'gcconnex-basic-' . $field,
402 402
                 'value' => $value,
403 403
             );
404 404
 
405 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>";
406
+            echo "<label for='{$field}' class='col-sm-4'>" . elgg_echo("gcconnex_profile:basic:{$field}") . "</label>";
407 407
             echo '<div class="col-sm-8">'; // field wrapper for css styling
408 408
             echo elgg_view("input/text", $params);
409 409
 
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 
476 476
     </div>
477 477
             <div class="panel-footer text-right profile-edit-footer">
478
-                <a href="'.elgg_get_site_url(). 'avatar/edit/' . $user->username.'" class="btn btn-primary pull-left">'. elgg_echo('gcconnex_profile:profile:edit_avatar') .'</a>
478
+                <a href="'.elgg_get_site_url() . 'avatar/edit/' . $user->username . '" class="btn btn-primary pull-left">' . elgg_echo('gcconnex_profile:profile:edit_avatar') . '</a>
479 479
                 <button type="button" class="btn btn-default overlay-close" style="background-color: #eaebed;">' . elgg_echo('gcconnex_profile:cancel') . '</button>
480 480
                 <button type="button" class="btn btn-primary save-profile">' . elgg_echo('gcconnex_profile:basic:save') . '</button>
481 481
             </div>
@@ -502,20 +502,20 @@  discard block
 block discarded – undo
502 502
         $btn_friend_request = '';
503 503
         foreach ($actions as $action) {
504 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) {
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 508
                         $btn_friend_request = $action->getContent();
509 509
                         $btn_friend_request_link = $action->getHref();
510 510
                     }
511
-                    if (!$user->isFriend() && strcmp($action->getName(),'add_friend') == 0) {
511
+                    if (!$user->isFriend() && strcmp($action->getName(), 'add_friend') == 0) {
512 512
                         $btn_friend_request = $action->getContent(array('class' => 'asdfasdasfad'));
513 513
                         $btn_friend_request_link = $action->getHref();
514 514
                     }
515 515
                 }
516 516
             } else {
517 517
 
518
-                if (check_entity_relationship(elgg_get_logged_in_user_guid(),'friendrequest',$user->getGUID()) && strcmp($action->getName(),'friend_request') == 0) {
518
+                if (check_entity_relationship(elgg_get_logged_in_user_guid(), 'friendrequest', $user->getGUID()) && strcmp($action->getName(), 'friend_request') == 0) {
519 519
                     $btn_friend_request_link = $action->getHref();
520 520
                     $btn_friend_request = $action->getContent();
521 521
                 } else
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
             }
524 524
         }
525 525
     }
526
-    if(elgg_is_logged_in()){
526
+    if (elgg_is_logged_in()) {
527 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 528
 
529 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">
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
     }
546 546
 
547 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>
548
+    $text . '<span class="caret"></span>
549 549
                 </button>
550 550
                 <ul class="dropdown-menu pull-right clearfix">' . $admin_links . '</ul></div>';
551 551
 }
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 echo '<div class="col-xs-9 col-md-8 clearfix"><div class="mrgn-lft-md">';
560 560
 
561 561
 // if user is public servant
562
-if(strcmp($user->user_type, 'federal') == 0 ) {
562
+if (strcmp($user->user_type, 'federal') == 0) {
563 563
     $deptObj = elgg_get_entities(array(
564 564
         'type' => 'object',
565 565
         'subtype' => 'federal_departments',
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
     $depts = get_entity($deptObj[0]->guid);
568 568
 
569 569
     $federal_departments = array();
570
-    if (get_current_language() == 'en'){
570
+    if (get_current_language() == 'en') {
571 571
         $federal_departments = json_decode($depts->federal_departments_en, true);
572 572
     } else {
573 573
         $federal_departments = json_decode($depts->federal_departments_fr, true);
@@ -577,14 +577,14 @@  discard block
 block discarded – undo
577 577
     echo '<div class="gcconnex-profile-dept">' . $federal_departments[$user->federal] . '</div>';
578 578
 
579 579
 // otherwise if user is student or academic
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>';
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 582
     $institution = ($user->institution == 'university') ? $user->university : ($user->institution == 'college' ? $user->college : $user->highschool);
583 583
     $job = ($user->job != "") ? $user->job : "";
584 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
-} else if (strcmp($user->user_type, 'provincial') == 0 ) {
587
+} else if (strcmp($user->user_type, 'provincial') == 0) {
588 588
     $provObj = elgg_get_entities(array(
589 589
         'type' => 'object',
590 590
         'subtype' => 'provinces',
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
     $provs = get_entity($provObj[0]->guid);
593 593
 
594 594
     $provinces = array();
595
-    if (get_current_language() == 'en'){
595
+    if (get_current_language() == 'en') {
596 596
         $provinces = json_decode($provs->provinces_en, true);
597 597
     } else {
598 598
         $provinces = json_decode($provs->provinces_fr, true);
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
     $mins = get_entity($minObj[0]->guid);
606 606
 
607 607
     $ministries = array();
608
-    if (get_current_language() == 'en'){
608
+    if (get_current_language() == 'en') {
609 609
         $ministries = json_decode($mins->ministries_en, true);
610 610
     } else {
611 611
         $ministries = json_decode($mins->ministries_fr, true);
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
     echo '<h3 class="mrgn-tp-0">' . elgg_echo("gcconnex-profile-card:{$user->user_type}") . '</h3>';
615 615
     echo '<div class="gcconnex-profile-job">' . $user->job . '</div>';
616 616
     $provString = $provinces[$user->provincial];
617
-    if($user->ministry && $user->ministry !== "default_invalid_value"){ $provString .= ' / ' . $ministries[$user->provincial][$user->ministry]; }
617
+    if ($user->ministry && $user->ministry !== "default_invalid_value") { $provString .= ' / ' . $ministries[$user->provincial][$user->ministry]; }
618 618
     echo '<div class="gcconnex-profile-dept">' . $provString . '</div>';
619 619
 
620 620
 // otherwise show basic info
@@ -658,16 +658,16 @@  discard block
 block discarded – undo
658 658
 
659 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";}
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 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";}
670
+        if ($media == 'youtube') { $link = "http://www.youtube.com/" . $link; $class = "fa-youtube"; }
671 671
 
672 672
         echo '<a href="' . $link . '" target="_blank"><i class="socialMediaIcons fa ' . $class . ' fa-2x"></i></a>';
673 673
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -518,8 +518,9 @@
 block discarded – undo
518 518
                 if (check_entity_relationship(elgg_get_logged_in_user_guid(),'friendrequest',$user->getGUID()) && strcmp($action->getName(),'friend_request') == 0) {
519 519
                     $btn_friend_request_link = $action->getHref();
520 520
                     $btn_friend_request = $action->getContent();
521
-                } else
522
-                    $profile_actions .= '<li>' . $action->getContent(array('class' => 'gcconnex-basic-profile-actions')) . '</li>';
521
+                } else {
522
+                                    $profile_actions .= '<li>' . $action->getContent(array('class' => 'gcconnex-basic-profile-actions')) . '</li>';
523
+                }
523 524
             }
524 525
         }
525 526
     }
Please login to merge, or discard this patch.
mod/b_extended_profile_collab/views/default/profile/wrapper.php 3 patches
Indentation   +152 added lines, -152 removed lines patch added patch discarded remove patch
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -54,35 +54,35 @@  discard block
 block discarded – undo
54 54
         echo elgg_view('profile/profile_tab_menu');
55 55
 
56 56
         echo '<div class="tab-content">';
57
-        if (empty($_GET['pg']))  {
57
+        if (empty($_GET['pg'])) {
58 58
             $pg = '';
59 59
             echo '<div role="tabpanel" class="tab-pane active" tabindex="-1" id="profile-display">';
60 60
         }
61
-        else{
61
+        else {
62 62
             $pg = $_GET['pg'];
63 63
             echo '<div role="tabpanel" class="tab-pane " tabindex="-1" id="profile-display">';
64 64
         }
65 65
 
66
-        if ( has_content($user, 'description') ) {
66
+        if (has_content($user, 'description')) {
67 67
             init_ajax_block(elgg_echo('gcconnex_profile:about_me'), 'about-me', $user);
68 68
             echo elgg_view('b_extended_profile/about-me');
69 69
             finit_ajax_block('about-me');
70 70
         }
71 71
 
72
-        if ( has_content($user, 'education') ) {
72
+        if (has_content($user, 'education')) {
73 73
             init_ajax_block(elgg_echo('gcconnex_profile:education'), 'education', $user);
74 74
             echo elgg_view('b_extended_profile/education');
75 75
             finit_ajax_block('education');
76 76
         }
77 77
 
78
-        if ( has_content($user, 'work') ) {
78
+        if (has_content($user, 'work')) {
79 79
             init_ajax_block(elgg_echo('gcconnex_profile:experience'), 'work-experience', $user);
80 80
             echo elgg_view('b_extended_profile/work-experience');
81 81
             finit_ajax_block('work-experience');
82 82
         }
83 83
 
84 84
         //if(elgg_is_logged_in()){
85
-            if ( has_content($user, 'gc_skills') ) {
85
+            if (has_content($user, 'gc_skills')) {
86 86
                 init_ajax_block(elgg_echo('gcconnex_profile:gc_skills'), 'skills', $user);
87 87
                 echo elgg_view('b_extended_profile/skills');
88 88
                 finit_ajax_block('skills');
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
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') {
96
+        if (elgg_is_active_plugin('missions') && $user->opt_in_missions == 'gcconnex_profile:opt:yes') {
97 97
             echo elgg_view('missions/completed-missions');
98 98
         }
99 99
         /*
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
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')) {
115
+        if (has_content($user, 'opt-in')) {
116 116
             init_ajax_block(elgg_echo('gcconnex_profile:opt:opt-in'), 'opt-in', $user);
117 117
             echo elgg_view('b_extended_profile/opt-in');
118 118
             finit_ajax_block('opt-in');
@@ -125,16 +125,16 @@  discard block
 block discarded – undo
125 125
 
126 126
             echo '</div>'; //close div id=#profile-display
127 127
 
128
-            if (empty($_GET['pg']))  {
128
+            if (empty($_GET['pg'])) {
129 129
                 $pg = '';
130 130
                 echo '<div role="tabpanel" class="tab-pane clearfix" tabindex="-1" id="splashboard">';
131 131
             }
132
-            else{
132
+            else {
133 133
                 $pg = $_GET['pg'];
134 134
                 echo '<div role="tabpanel" class="tab-pane active clearfix" tabindex="-1" id="splashboard">';
135 135
             }
136 136
 
137
-                echo '<h2 class="wb-inv">'.$user->name."'s widgets</h2>";
137
+                echo '<h2 class="wb-inv">' . $user->name . "'s widgets</h2>";
138 138
 
139 139
                 $num_columns = elgg_extract('num_columns', $vars, 2);
140 140
                 $show_add_widgets = elgg_extract('show_add_widgets', $vars, true);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
57 57
         if (empty($_GET['pg']))  {
58 58
             $pg = '';
59 59
             echo '<div role="tabpanel" class="tab-pane active" tabindex="-1" id="profile-display">';
60
-        }
61
-        else{
60
+        } else{
62 61
             $pg = $_GET['pg'];
63 62
             echo '<div role="tabpanel" class="tab-pane " tabindex="-1" id="profile-display">';
64 63
         }
@@ -128,8 +127,7 @@  discard block
 block discarded – undo
128 127
             if (empty($_GET['pg']))  {
129 128
                 $pg = '';
130 129
                 echo '<div role="tabpanel" class="tab-pane clearfix" tabindex="-1" id="splashboard">';
131
-            }
132
-            else{
130
+            } else{
133 131
                 $pg = $_GET['pg'];
134 132
                 echo '<div role="tabpanel" class="tab-pane active clearfix" tabindex="-1" id="splashboard">';
135 133
             }
Please login to merge, or discard this patch.
mod/b_extended_profile_collab/views/default/profile/tab-content.php 2 patches
Indentation   +154 added lines, -154 removed lines patch added patch discarded remove patch
@@ -8,164 +8,164 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 elgg_push_context('profile');
7 7
 $fields = array('File', 'Blog', 'page_top', 'Bookmarks', 'Poll', 'Thewire', 'Album', 'task_top', 'question', 'etherpad');
8 8
 $user_display_name = elgg_get_page_owner_entity()->name;
9
-foreach($fields as $field){
9
+foreach ($fields as $field) {
10 10
 
11 11
     echo '<div role="tabpanel" tabindex="-1" class="tab-pane fade-in" id="' . strtolower($field) . '">';
12 12
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
         //fix field to allow proper URLs
26 26
         //pick appropriate messages
27
-        switch($field){
27
+        switch ($field) {
28 28
             case 'File':
29 29
                 $title = elgg_echo('file:user', array($user_display_name));
30 30
                 $add = elgg_echo('file:add');
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
                 break;
83 83
         }
84 84
 
85
-        if(elgg_get_page_owner_entity()->canEdit()){
85
+        if (elgg_get_page_owner_entity()->canEdit()) {
86 86
 
87
-            echo '<h2 class="wb-invisible" tabindex="-1">'.$title.'</h2>';
87
+            echo '<h2 class="wb-invisible" tabindex="-1">' . $title . '</h2>';
88 88
 
89 89
             //dont display add button on The Wire panel
90
-            if($field == 'Thewire'){
90
+            if ($field == 'Thewire') {
91 91
                 //do nothing
92 92
             } else {
93 93
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                 ));
103 103
 
104 104
                 //for files we want an additional add folder button
105
-                if($field == 'File' && elgg_get_plugin_setting("user_folder_structure", "file_tools") == 'yes'){
105
+                if ($field == 'File' && elgg_get_plugin_setting("user_folder_structure", "file_tools") == 'yes') {
106 106
                   //create new foldr button
107 107
                     $new_folder = elgg_view('output/url', array(
108 108
                       'name' => 'new_folder',
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                     ));
114 114
 
115 115
                     //add new folder to add button
116
-                    $addButton = $new_folder.$addButton;
116
+                    $addButton = $new_folder . $addButton;
117 117
                 }
118 118
 
119 119
                 echo $addButton;
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             }
123 123
         }
124 124
 
125
-        if(!$content){
125
+        if (!$content) {
126 126
             echo '<div class="mrgn-lft-sm mrgn-bttm-md">' . $message . '</div>';
127 127
         } else {
128 128
             echo $content;
@@ -143,21 +143,21 @@  discard block
 block discarded – undo
143 143
 //event calendar tab
144 144
 echo '<div role="tabpanel" tabindex="-1" class="tab-pane fade-in" id="events">';
145 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')){
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 148
         $events = event_calendar_get_personal_events_for_user(elgg_get_page_owner_guid(), 5);
149 149
     }
150 150
 
151
-    if(!$events){
151
+    if (!$events) {
152 152
         echo '<div class="mrgn-lft-sm mrgn-bttm-md">' . elgg_echo('event_calendar:no_events_found') . '</div>';
153 153
     }
154 154
 
155
-    foreach($events as $event) {
155
+    foreach ($events as $event) {
156 156
         echo elgg_view("object/event_calendar", array('entity' => $event));
157 157
     }
158 158
 
159 159
     $date = date('Y-m-d'/*, strtotime("-1 days")*/);
160
-    $event_url = "event_calendar/owner/". elgg_get_page_owner_entity()->username;
160
+    $event_url = "event_calendar/owner/" . elgg_get_page_owner_entity()->username;
161 161
     $viewall_link = elgg_view('output/url', array(
162 162
         'href' => $event_url,
163 163
         'text' => elgg_echo('link:view:all'),
Please login to merge, or discard this patch.
mod/b_extended_profile_collab/views/default/b_extended_profile/skills.php 3 patches
Indentation   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -10,21 +10,21 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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>';
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
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()){
13
+    if (elgg_get_logged_in_user_entity() == elgg_get_page_owner_entity()) {
14 14
         echo '<div class="gcconnex-old-skills">';
15 15
         echo '<div class="gcconnex-old-skills-message">' . elgg_echo('gcconnex_profile:gc_skill:leftover') . '</div>';
16 16
         echo '<div class="gcconnex-old-skills-display">';
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
 
33 33
 echo '<div class="gcconnex-profile-skills-display">';
34 34
 echo '<div class="gcconnex-skills-skills-list-wrapper">';
35
-if (elgg_is_logged_in()){
35
+if (elgg_is_logged_in()) {
36 36
     //elgg_get_logged_in_user_entity()->isFriendsWith($user->guid)
37 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))
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 39
         echo '<div class="gcconnex-skill-limit">' . elgg_echo('gcconnex_profile:gc_skill:click') . '</div>';
40 40
     //}
41 41
 }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     //if (elgg_is_logged_in()) {
54 54
 
55 55
 
56
-        for ($i=0; $i<20; $i++) {
56
+        for ($i = 0; $i < 20; $i++) {
57 57
 
58 58
             $skill_guid = $skill_guids[$i];
59 59
             //error_log(get_entity($skill_guid));
@@ -67,19 +67,19 @@  discard block
 block discarded – undo
67 67
                     $endorsements = array($endorsements);
68 68
                 }
69 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()){
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 72
                         echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"><div class="skill-container clearfix" style="display:inline-block">';
73 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>';
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 75
 
76
-                    }else{
76
+                    } else {
77 77
                         if (in_array(elgg_get_logged_in_user_guid(), $endorsements) == false || empty($endorsements)) {
78 78
                             // user has not yet endorsed this skill for this user.. present the option to endorse
79 79
 
80 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 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>';
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 83
 
84 84
 
85 85
                         } else {
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
 
88 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 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>';
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 91
 
92 92
                         }
93 93
                     }
94 94
                     echo '</div>'; // close div class="skill-container"
95 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>';
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 98
                         echo list_avatars(array(
99 99
                             'guids' => $skill->endorsements,
100 100
                             'size' => 'tiny',
@@ -107,17 +107,17 @@  discard block
 block discarded – undo
107 107
                     }
108 108
                     echo '</div>'; // close div class=gcconnex-skill-entry
109 109
                 }
110
-                if ($user->skill_access == ACCESS_FRIENDS){
111
-                    if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()){
110
+                if ($user->skill_access == ACCESS_FRIENDS) {
111
+                    if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) {
112 112
                         echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"><div class="skill-container clearfix" style="display:inline-block">';
113 113
 
114 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>';
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 116
 
117 117
                         echo '</div>'; // close div class="skill-container"
118 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>';
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 121
                             echo list_avatars(array(
122 122
                                 'guids' => $skill->endorsements,
123 123
                                 'size' => 'tiny',
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
                         }
131 131
                         echo '</div>'; // close div class=gcconnex-skill-entry
132 132
 
133
-                    }elseif(elgg_is_logged_in()&& elgg_get_logged_in_user_entity()->isFriendsWith($user->guid)){
133
+                    }elseif (elgg_is_logged_in() && elgg_get_logged_in_user_entity()->isFriendsWith($user->guid)) {
134 134
                         if (in_array(elgg_get_logged_in_user_guid(), $endorsements) == false || empty($endorsements)) {
135 135
                             // user has not yet endorsed this skill for this user.. present the option to endorse
136 136
 
137 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 138
 
139 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>';
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 141
 
142 142
                         } else {
143 143
                             // user has endorsed this skill for this user.. present the option to retract endorsement
@@ -145,12 +145,12 @@  discard block
 block discarded – undo
145 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 146
 
147 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>';
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 149
                         }
150 150
                         echo '</div>'; // close div class="skill-container"
151 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>';
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 154
                             echo list_avatars(array(
155 155
                                 'guids' => $skill->endorsements,
156 156
                                 'size' => 'tiny',
@@ -165,17 +165,17 @@  discard block
 block discarded – undo
165 165
                     }
166 166
 
167 167
                 }
168
-                if ($user->skill_access == ACCESS_PRIVATE){
169
-                    if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()){
168
+                if ($user->skill_access == ACCESS_PRIVATE) {
169
+                    if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) {
170 170
                         echo '<div tabindex="-1" class="gcconnex-skill-entry clearfix" data-guid="' . $skill_guid . '"><div class="skill-container clearfix" style="display:inline-block">';
171 171
 
172 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>';
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 174
 
175 175
                         echo '</div>'; // close div class="skill-container"
176 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>';
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 179
                             echo list_avatars(array(
180 180
                                 'guids' => $skill->endorsements,
181 181
                                 'size' => 'tiny',
Please login to merge, or discard this patch.
Braces   +9 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@  discard block
 block discarded – undo
16 16
         echo '<div class="gcconnex-old-skills-display">';
17 17
 
18 18
         if (is_array($user->skills)) {
19
-            foreach ($user->skills as $oldskill)
20
-                echo $oldskill . '<br>';
19
+            foreach ($user->skills as $oldskill) {
20
+                            echo $oldskill . '<br>';
21
+            }
21 22
         }
22 23
 
23 24
         echo '</div><br>'; // close div class="gcconnex-old-skills-display
@@ -35,15 +36,15 @@  discard block
 block discarded – undo
35 36
 if (elgg_is_logged_in()){
36 37
     //elgg_get_logged_in_user_entity()->isFriendsWith($user->guid)
37 38
     //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>';
39
+    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)) {
40
+            echo '<div class="gcconnex-skill-limit">' . elgg_echo('gcconnex_profile:gc_skill:click') . '</div>';
41
+    }
40 42
     //}
41 43
 }
42 44
 
43 45
 if ($user->canEdit() && ($skill_guids == NULL || empty($skill_guids))) {
44 46
     echo elgg_echo('gcconnex_profile:gc_skill:empty');
45
-}
46
-else {
47
+} else {
47 48
     echo '<div class="gcconnex-skill-limit hidden">' . elgg_echo('gcconnex_profile:gc_skill:limit') . '</div>';
48 49
     if (!(is_array($skill_guids))) {
49 50
         $skill_guids = array($skill_guids);
@@ -73,7 +74,7 @@  discard block
 block discarded – undo
73 74
                         echo '<div class="gcconnex-endorsements-skill" data-type="skill">' . $skill->title . '</div>';
74 75
                         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
 
76
-                    }else{
77
+                    } else{
77 78
                         if (in_array(elgg_get_logged_in_user_guid(), $endorsements) == false || empty($endorsements)) {
78 79
                             // user has not yet endorsed this skill for this user.. present the option to endorse
79 80
 
@@ -130,7 +131,7 @@  discard block
 block discarded – undo
130 131
                         }
131 132
                         echo '</div>'; // close div class=gcconnex-skill-entry
132 133
 
133
-                    }elseif(elgg_is_logged_in()&& elgg_get_logged_in_user_entity()->isFriendsWith($user->guid)){
134
+                    } elseif(elgg_is_logged_in()&& elgg_get_logged_in_user_entity()->isFriendsWith($user->guid)){
134 135
                         if (in_array(elgg_get_logged_in_user_guid(), $endorsements) == false || empty($endorsements)) {
135 136
                             // user has not yet endorsed this skill for this user.. present the option to endorse
136 137
 
Please login to merge, or discard this patch.