Completed
Push — gcconnex ( ee5ffc...718fe4 )
by Ilia
09:37 queued 04:29
created
mod/missions/views/default/page/elements/unfinished-feedback.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 $mission_list = $vars['entity_list'];
15
-foreach($mission_list as $key => $mission) {
16
-	if($mission->state != 'completed') {
15
+foreach ($mission_list as $key => $mission) {
16
+	if ($mission->state != 'completed') {
17 17
 		unset($mission_list[$key]);
18 18
 	}
19 19
 }
20 20
 
21 21
 $feedback_required = '';
22 22
 $count = 0;
23
-foreach($mission_list as $mission) {
23
+foreach ($mission_list as $mission) {
24 24
 	$feedback_search = elgg_get_entities_from_metadata(array(
25 25
 			'type' => 'object',
26 26
 			'subtype' => 'mission-feedback',
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
 	$feedback_search = array_filter($feedback_search);
34 34
 	
35 35
 	$participants = get_entity_relationships($mission->guid);
36
-	foreach($participants as $key => $relation) {
37
-		if($relation->relationship != 'mission_accepted') {
36
+	foreach ($participants as $key => $relation) {
37
+		if ($relation->relationship != 'mission_accepted') {
38 38
 			unset($participants[$key]);
39 39
 		}
40 40
 	}
41 41
 
42
-	if((elgg_get_logged_in_user_guid() == $mission->owner_guid || elgg_get_logged_in_user_guid() == $mission->account) && count($feedback_search) < count($participants)) {
42
+	if ((elgg_get_logged_in_user_guid() == $mission->owner_guid || elgg_get_logged_in_user_guid() == $mission->account) && count($feedback_search) < count($participants)) {
43 43
 		$feedback_required .= '<div name="mission-unfinished-feedback-' . $mission->guid . '">';
44 44
 		
45 45
 		$feedback_required .= elgg_view('output/url', array(
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		$feedback_required .= '</div>';
52 52
 		$count++;
53 53
 	}
54
-	elseif(check_entity_relationship($mission->guid, 'mission_accepted', elgg_get_logged_in_user_guid()) 
54
+	elseif (check_entity_relationship($mission->guid, 'mission_accepted', elgg_get_logged_in_user_guid()) 
55 55
 			&& !count($feedback_search) && elgg_get_logged_in_user_guid() != $mission->owner_guid && elgg_get_logged_in_user_guid() != $mission->account) {
56 56
 		$feedback_required .= '<div name="mission-unfinished-feedback-' . $mission->guid . '">';
57 57
 		
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 }
68 68
 
69
-if($count > 0) {
69
+if ($count > 0) {
70 70
 	echo '<h4>' . elgg_echo('missions:require_feedback') . ':</h4>';
71 71
 	echo '<div>' . $feedback_required . '</div>';
72 72
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@
 block discarded – undo
50 50
 		
51 51
 		$feedback_required .= '</div>';
52 52
 		$count++;
53
-	}
54
-	elseif(check_entity_relationship($mission->guid, 'mission_accepted', elgg_get_logged_in_user_guid()) 
53
+	} elseif(check_entity_relationship($mission->guid, 'mission_accepted', elgg_get_logged_in_user_guid()) 
55 54
 			&& !count($feedback_search) && elgg_get_logged_in_user_guid() != $mission->owner_guid && elgg_get_logged_in_user_guid() != $mission->account) {
56 55
 		$feedback_required .= '<div name="mission-unfinished-feedback-' . $mission->guid . '">';
57 56
 		
Please login to merge, or discard this patch.
mod/missions/views/default/page/elements/histogram-inputs.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,14 +10,14 @@  discard block
 block discarded – undo
10 10
 /*
11 11
  * The set of inputs necessary to create a Histogram.
12 12
  */
13
-if($bin_number == '') {
13
+if ($bin_number == '') {
14 14
 	$bin_number = 9;
15 15
 }
16 16
 
17 17
 $input_bin_number = elgg_view('input/dropdown', array(
18 18
 		'name' => 'bin_number',
19 19
 		'value' => $bin_number,
20
-		'options' => array(5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21),
20
+		'options' => array(5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21),
21 21
 		'id' => 'data-analytics-bin-number-input',
22 22
 		'onchange' => 'wipe_away_graph()'
23 23
 ));
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 <div class="col-sm-12" style="margin:4px;">
44 44
 	<label for='data-analytics-bin-number-input' class="col-sm-3" style="text-align:right;">
45
-		<?php echo elgg_echo('missions:number_of_intervals') . ':';?>
45
+		<?php echo elgg_echo('missions:number_of_intervals') . ':'; ?>
46 46
 	</label>
47 47
 	<div class="col-sm-3">
48 48
 		<?php echo $input_bin_number; ?>
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 </div>
51 51
 <div class="col-sm-12" style="margin:4px;">
52 52
 	<label for='data-analytics-target-value-dropdown-input' class="col-sm-3" style="text-align:right;"">
53
-		<?php echo elgg_echo('missions:target_value') . ':';?>
53
+		<?php echo elgg_echo('missions:target_value') . ':'; ?>
54 54
 	</label>
55 55
 	<div class="col-sm-4">
56 56
 		<?php echo $input_target_value; ?>
Please login to merge, or discard this patch.
mod/missions/views/default/page/elements/main-find.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 		'limit' => $max,
75 75
 		'pagination' => true,
76 76
 		'list_type' => 'gallery',
77
-        'gallery_class'=>'wb-eqht clearfix',
78
-        'item_class'=>'col-sm-6 col-md-4 hght-inhrt',
77
+		'gallery_class'=>'wb-eqht clearfix',
78
+		'item_class'=>'col-sm-6 col-md-4 hght-inhrt',
79 79
 		
80 80
 		'mission_full_view' => false
81 81
 ), $offset, $max);
@@ -96,24 +96,24 @@  discard block
 block discarded – undo
96 96
 $role_type_field = $_SESSION['missions_role_field_value'];
97 97
 
98 98
 if ($opp_type_field || $role_type_field) {
99
-    $clear_link = elgg_view('output/url', array(
100
-        'text' => elgg_echo('missions:clear_filter'),
101
-        'href' => 'action/missions/sort-missions-form?opp_filter=&role_filter=',
102
-        'class' => 'mrgn-lft-sm',
103
-        'is_action' => true,
104
-        'is_trusted' => true,
105
-    ));
99
+	$clear_link = elgg_view('output/url', array(
100
+		'text' => elgg_echo('missions:clear_filter'),
101
+		'href' => 'action/missions/sort-missions-form?opp_filter=&role_filter=',
102
+		'class' => 'mrgn-lft-sm',
103
+		'is_action' => true,
104
+		'is_trusted' => true,
105
+	));
106 106
 }
107 107
 
108 108
 // Links to the post opportunity pages.
109 109
 //if($last_segment != 'members' && $last_segment != 'archive' && $last_segment != 'analytics') {
110 110
 $create_button .= elgg_view('output/url', array(
111
-        'href' => elgg_get_site_url() . 'action/missions/pre-create-opportunity',
112
-        'text' => elgg_echo('missions:create_opportunity'),
113
-        'is_action' => true,
114
-        'class' => 'elgg-button btn btn-primary',
115
-        'style' => 'float:right;',
116
-        'id' => 'mission-create-opportunity-button'
111
+		'href' => elgg_get_site_url() . 'action/missions/pre-create-opportunity',
112
+		'text' => elgg_echo('missions:create_opportunity'),
113
+		'is_action' => true,
114
+		'class' => 'elgg-button btn btn-primary',
115
+		'style' => 'float:right;',
116
+		'id' => 'mission-create-opportunity-button'
117 117
 )) . '</br>';
118 118
 	//}
119 119
 
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
 
124 124
 <div class="col-sm-12">
125 125
     <?php
126
-    /* Nick - just testing what the job type actually outputs
126
+	/* Nick - just testing what the job type actually outputs
127 127
 foreach($entity_list as $entity){
128 128
     echo $entity->job_type . ' - ';  
129 129
 }*/
130
-    ?>
130
+	?>
131 131
     <div class="col-sm-8">
132 132
 	<h2 class="h4 mrgn-tp-md mrgn-bttm-0"><?php echo elgg_echo('missions:search_for_opportunities') . ':'; ?></h2>
133 133
 	<?php 
134 134
 		//echo $simple_search_form;
135 135
 		echo $advanced_field;
136
-    ?>
136
+	?>
137 137
     </div>
138 138
 
139 139
     <div class="col-sm-4">
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 /*
11 11
  * Page content for finding missions and a link to create them.
12 12
  */ 
13
-if($_SESSION['mission_entities_per_page']) {
13
+if ($_SESSION['mission_entities_per_page']) {
14 14
 	$entities_per_page = $_SESSION['mission_entities_per_page'];
15 15
 }
16 16
 
17 17
 $_SESSION['mission_search_switch_subtype'] = 'open';
18 18
 
19
-if($_GET['clear'] == true){
19
+if ($_GET['clear'] == true) {
20 20
 elgg_clear_sticky_form('searchsimplefill');
21 21
 elgg_clear_sticky_form('advancedfill');
22 22
 }
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 $entity_list = elgg_get_entities_from_metadata($options);
51 51
 
52 52
 $offset = (int) get_input('offset', 0);
53
-if($entities_per_page) {
53
+if ($entities_per_page) {
54 54
 	$max = $entities_per_page;
55 55
 }
56 56
 else {
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
 }
59 59
 
60 60
 $entity_list = mm_sort_mission_decider($_SESSION['missions_sort_field_value'], $_SESSION['missions_order_field_value'], $entity_list, $_SESSION['missions_type_field_value'], $_SESSION['missions_role_field_value']);
61
-$count = count($entity_list);		// count the filtered list
62
-if ( $offset >= $count )			// reset offset if it no longer makes sense after filtering
61
+$count = count($entity_list); // count the filtered list
62
+if ($offset >= $count)			// reset offset if it no longer makes sense after filtering
63 63
 	$offset = 0;
64 64
 
65 65
 $max_reached = '';
66
-if(($offset + $max) >= elgg_get_plugin_setting('search_limit', 'missions') && $count >= elgg_get_plugin_setting('search_limit', 'missions')) {
66
+if (($offset + $max) >= elgg_get_plugin_setting('search_limit', 'missions') && $count >= elgg_get_plugin_setting('search_limit', 'missions')) {
67 67
 	$max_reached = '<div class="col-sm-12" style="font-style:italic;">' . elgg_echo('missions:reached_maximum_entities') . '</div>';
68 68
 }
69 69
 
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,15 +52,16 @@
 block discarded – undo
52 52
 $offset = (int) get_input('offset', 0);
53 53
 if($entities_per_page) {
54 54
 	$max = $entities_per_page;
55
-}
56
-else {
55
+} else {
57 56
 	$max = elgg_get_plugin_setting('search_result_per_page', 'missions');
58 57
 }
59 58
 
60 59
 $entity_list = mm_sort_mission_decider($_SESSION['missions_sort_field_value'], $_SESSION['missions_order_field_value'], $entity_list, $_SESSION['missions_type_field_value'], $_SESSION['missions_role_field_value']);
61 60
 $count = count($entity_list);		// count the filtered list
62
-if ( $offset >= $count )			// reset offset if it no longer makes sense after filtering
61
+if ( $offset >= $count ) {
62
+	// reset offset if it no longer makes sense after filtering
63 63
 	$offset = 0;
64
+}
64 65
 
65 66
 $max_reached = '';
66 67
 if(($offset + $max) >= elgg_get_plugin_setting('search_limit', 'missions') && $count >= elgg_get_plugin_setting('search_limit', 'missions')) {
Please login to merge, or discard this patch.
mod/missions/views/default/page/elements/mission-graph-bar.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 $subtitle_count = count($department_results) - 1;
18 18
 
19 19
 // For when the graph has no data passed to it.
20
-if($vars['dummy_graph']) {
20
+if ($vars['dummy_graph']) {
21 21
 	$dummy_array = array();
22
-	for($i=0;$i<$interval_number;$i++) {
23
-		for($k=0;$k<$state_count;$k++) {
22
+	for ($i = 0; $i < $interval_number; $i++) {
23
+		for ($k = 0; $k < $state_count; $k++) {
24 24
 			$dummy_array[$i][$k] = 0;
25 25
 		}
26 26
 	}
27 27
 	
28
-	for($k=0;$k<$state_count;$k++) {
29
-		$names[$k+1] = '';
28
+	for ($k = 0; $k < $state_count; $k++) {
29
+		$names[$k + 1] = '';
30 30
 	}
31 31
 	
32 32
 	$department_results[1] = $dummy_array;
@@ -39,17 +39,17 @@  discard block
 block discarded – undo
39 39
 $formatted_result_array = array();
40 40
 $max_value = 0;
41 41
 $it_count = 0;
42
-for($i=0;$i<$interval_number;$i++) {
42
+for ($i = 0; $i < $interval_number; $i++) {
43 43
 	$temp_format_array = array();
44 44
 	$temp_format_array[0] = $department_results[0][$i];
45
-	for($j=0;$j<$department_count;$j++) {
45
+	for ($j = 0; $j < $department_count; $j++) {
46 46
 		$temp_max = 0;
47
-		for($k=0;$k<$state_count;$k++) {
48
-			$temp_format_array[$state_count*$j+$k+1] = $department_results[$j+1][$i][$k];
49
-			$temp_max += $department_results[$j+1][$i][$k];
47
+		for ($k = 0; $k < $state_count; $k++) {
48
+			$temp_format_array[$state_count * $j + $k + 1] = $department_results[$j + 1][$i][$k];
49
+			$temp_max += $department_results[$j + 1][$i][$k];
50 50
 			$it_count++;
51 51
 		}
52
-		if($temp_max > $max_value) {
52
+		if ($temp_max > $max_value) {
53 53
 			$max_value = $temp_max;
54 54
 		}
55 55
 	}
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 }
58 58
 
59 59
 // If the max value in the y-axis is 0 then it defaults to 1.
60
-if($max_value == 0) {
60
+if ($max_value == 0) {
61 61
 	$max_value = 1;
62 62
 }
63 63
 
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
 
66 66
 $subtitle = $subtitle_count . ' ' . strtolower(elgg_echo('missions:department'));
67 67
 $legend_display = 'right';
68
-if($subtitle_count != 1) {
68
+if ($subtitle_count != 1) {
69 69
 	$subtitle = $subtitle . 's';
70 70
 }
71
-if($subtitle_count == 0) {
71
+if ($subtitle_count == 0) {
72 72
 	$legend_display = 'none';
73 73
 }
74 74
 
Please login to merge, or discard this patch.
mod/missions/views/default/page/elements/invitable-missions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 ));
21 21
 
22 22
 $count = 0;
23
-foreach($entity_list as $entity) {
23
+foreach ($entity_list as $entity) {
24 24
 	$candidates = elgg_get_entities_from_relationship(array(
25 25
 			'relationship' => 'mission_accepted',
26 26
 			'relationship_guid' => $entity->guid
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
 	$number_of_candidates = count($candidates);
29 29
 	
30 30
 	$not_invited_already = true;
31
-	foreach($candidates as $candidate) {
32
-		if($candidate->guid == $user_guid) {
31
+	foreach ($candidates as $candidate) {
32
+		if ($candidate->guid == $user_guid) {
33 33
 			$not_invited_already = false;
34 34
 		}
35 35
 	}
36 36
 
37 37
 	// Does not display missions which have filled all the available spots.
38
-	if($number_of_candidates < $entity->number && $not_invited_already) {
38
+	if ($number_of_candidates < $entity->number && $not_invited_already) {
39 39
 		echo '<div class="col-sm-12">';
40 40
 		echo '<div class="col-sm-5">' . elgg_view('output/url', array(
41 41
 				'href' => $entity->getURL(),
Please login to merge, or discard this patch.
mod/missions/views/default/page/elements/skill-match-interlude.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 <script>
21 21
 	$('document').ready(function() {
22 22
 		$(document.body).css({ 'cursor': 'wait' });
23
-		$('#<?php echo $vars['submit_button_id'];?>').prop('disabled', true);
23
+		$('#<?php echo $vars['submit_button_id']; ?>').prop('disabled', true);
24 24
 		elgg.action('missions/post-mission-skill-match', {
25 25
 			success: function(returner) {
26 26
 				elgg.forward(returner.forward_url);
Please login to merge, or discard this patch.
mod/missions/views/default/page/elements/mission-manager-info.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,8 +78,8 @@
 block discarded – undo
78 78
 		<div>
79 79
 			<span name="mission-manager-department">
80 80
             <?php //echo ucwords(strtolower($department));
81
-            echo $job_title;
82
-            ?></span>
81
+			echo $job_title;
82
+			?></span>
83 83
 		</div>
84 84
 	</div>
85 85
 </div>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -18,27 +18,27 @@  discard block
 block discarded – undo
18 18
 $accounts = get_user_by_email($email);
19 19
 //Compare email and username for user with more than one account
20 20
 foreach ($accounts as $key) {
21
-	if($key->name == $mission->name){
21
+	if ($key->name == $mission->name) {
22 22
 		$guid_account = $key->guid;
23 23
 	}
24 24
 }
25 25
 
26
-if($guid_account){
26
+if ($guid_account) {
27 27
 	$manager_account = get_user($guid_account);
28
-}else{
28
+} else {
29 29
 	$manager_account = get_user($mission->account); //Nick changed to owner_guid then back to account
30 30
 }
31 31
 
32
-if(!$manager_account) {
32
+if (!$manager_account) {
33 33
 	$manager_account_by_email = get_user_by_email($mission->email);
34 34
 	$manager_account = array_pop($manager_account_by_email);
35 35
 }
36 36
 
37 37
 $manager_name = $mission->name;
38 38
 $manager_icon = elgg_view_entity_icon(get_entity(1), 'small');
39
-if($manager_account) {
39
+if ($manager_account) {
40 40
 	$manager_name = elgg_view('output/url', array(
41
-			'href' => elgg_get_site_url().'profile/'.$manager_account->username,
41
+			'href' => elgg_get_site_url() . 'profile/' . $manager_account->username,
42 42
 			'text' => $manager_name,
43 43
 			'class' => 'mission-user-link-' . $mission->owner_guid
44 44
 	));
@@ -47,18 +47,18 @@  discard block
 block discarded – undo
47 47
 }
48 48
 
49 49
 $department_node = get_entity(mo_extract_node_guid($mission->department));
50
-if($department_node == '') {
50
+if ($department_node == '') {
51 51
 	$department = $mission->department;
52 52
 }
53 53
 else {
54 54
 	$department = $department_node->name;
55
-	if(get_current_language() == 'fr') {
55
+	if (get_current_language() == 'fr') {
56 56
 		$department = $department_node->name_french;
57 57
 	}
58 58
 }
59 59
 
60 60
 $department_other = mo_extract_other_input($mission->department);
61
-if($department_other) {
61
+if ($department_other) {
62 62
 	$department = $department_other;
63 63
 }
64 64
 
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
 
70 70
 
71 71
 	<div class="col-xs-<?php echo $grid_number; ?>">
72
-		<?php echo $manager_icon;?>
72
+		<?php echo $manager_icon; ?>
73 73
 	</div>
74 74
 	<div class="col-xs-<?php echo (12 - $grid_number); ?>" name="mission-manager" style="text-align:left;">
75 75
 		<div>
76
-			<span name="mission-manager-name"><?php echo $manager_name;?></span>
76
+			<span name="mission-manager-name"><?php echo $manager_name; ?></span>
77 77
 		</div>
78 78
 		<div>
79 79
 			<span name="mission-manager-department">
Please login to merge, or discard this patch.
Braces   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 if($guid_account){
27 27
 	$manager_account = get_user($guid_account);
28
-}else{
28
+} else{
29 29
 	$manager_account = get_user($mission->account); //Nick changed to owner_guid then back to account
30 30
 }
31 31
 
@@ -49,8 +49,7 @@  discard block
 block discarded – undo
49 49
 $department_node = get_entity(mo_extract_node_guid($mission->department));
50 50
 if($department_node == '') {
51 51
 	$department = $mission->department;
52
-}
53
-else {
52
+} else {
54 53
 	$department = $department_node->name;
55 54
 	if(get_current_language() == 'fr') {
56 55
 		$department = $department_node->name_french;
Please login to merge, or discard this patch.
mod/missions/views/default/missions/analytics-generator.php 2 patches
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -25,29 +25,29 @@  discard block
 block discarded – undo
25 25
 $time_format = false;
26 26
 
27 27
 // Graph type needs to be set or nothing gets generated.
28
-if($graph_type == '') {
28
+if ($graph_type == '') {
29 29
 	$error_returner = elgg_echo('missions:error:analytics:select_graph_type');
30 30
 }
31 31
 else {
32 32
 	// Formats the department guid so it can be searched for in the database.
33
-	if(elgg_entity_exists($department_guid)) {
33
+	if (elgg_entity_exists($department_guid)) {
34 34
 		$department_identifier = 'MOrg:' . $department_guid;
35 35
 	}
36 36
 
37 37
 	$target = '';
38
-	if($graph_type == 'missions:stacked_graph') {
38
+	if ($graph_type == 'missions:stacked_graph') {
39 39
 		$target = $target_date;
40 40
 		$time_interval = $interval;
41 41
 
42
-		if($separator == 'missions:average_number_of_applicants' || $separator == 'missions:reason_to_decline') {
42
+		if ($separator == 'missions:average_number_of_applicants' || $separator == 'missions:reason_to_decline') {
43 43
 			$target = 'missions:date_posted';
44 44
 		}
45 45
 
46 46
 		// Sets start and end date to default if the user did not enter any dates.
47
-		if($start_date == '') {
47
+		if ($start_date == '') {
48 48
 			$start_date = '2016-06-19';
49 49
 		}
50
-		if($end_date == '') {
50
+		if ($end_date == '') {
51 51
 			$end_date = date('Y-m-d', time());
52 52
 		}
53 53
 
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 		$timescale_array = mm_analytics_generate_time_scale_timestamps($start_date, $end_date, $interval);
56 56
 
57 57
 		// Gets the set of missions between the start date and end date. The search checks against the user given target date.
58
-		if($separator == 'missions:reason_to_decline') {
58
+		if ($separator == 'missions:reason_to_decline') {
59 59
 			$mission_set = mm_analytics_get_declinations_by_dates($timescale_array[0], $timescale_array[count($timescale_array) - 1]);
60 60
 		}
61
-		else if($separator == 'missions:average_number_of_applicants') {
61
+		else if ($separator == 'missions:average_number_of_applicants') {
62 62
 			$mission_set = mm_analytics_get_missions_by_posting_and_closure($timescale_array[0], $timescale_array[count($timescale_array) - 1]);
63 63
 		}
64 64
 		else {
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		}
67 67
 
68 68
 		// Removes the missions that are not within the department or that department's children.
69
-		if($department_identifier != '' && $separator != 'missions:reason_to_decline') {
69
+		if ($department_identifier != '' && $separator != 'missions:reason_to_decline') {
70 70
 			$mission_set = mm_analytics_cull_missions_by_department($mission_set, $department_identifier);
71 71
 		}
72 72
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 		}
123 123
 		$alignment = 'center';
124 124
 	}
125
-	else if($graph_type == 'missions:histogram') {
125
+	else if ($graph_type == 'missions:histogram') {
126 126
 		$target = $target_value;
127 127
 		$time_interval = $target;
128 128
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		$mission_set = mm_analytics_get_missions_by_value($target);
131 131
 
132 132
 		// Removes the missions that are not within the department or that department's children.
133
-		if($department_identifier != '') {
133
+		if ($department_identifier != '') {
134 134
 			$mission_set = mm_analytics_cull_missions_by_department($mission_set, $department_identifier);
135 135
 		}
136 136
 
@@ -164,12 +164,12 @@  discard block
 block discarded – undo
164 164
 	$target_lower = $target;
165 165
 	$target_upper = $target;
166 166
 
167
-	if($separator == 'missions:average_number_of_applicants') {
167
+	if ($separator == 'missions:average_number_of_applicants') {
168 168
 		$relation_set = array(array());
169
-		foreach($mission_set[0] as $mission) {
169
+		foreach ($mission_set[0] as $mission) {
170 170
 			$relations_from_missions = get_entity_relationships($mission->guid);
171
-			foreach($relations_from_missions as $relation) {
172
-				if($relation->relationship == 'mission_accepted' ||
171
+			foreach ($relations_from_missions as $relation) {
172
+				if ($relation->relationship == 'mission_accepted' ||
173 173
 						$relation->relationship == 'mission_offered' ||
174 174
 						$relation->relationship == 'mission_applied') {
175 175
 					array_push($relation_set[0], $relation);
@@ -187,14 +187,14 @@  discard block
 block discarded – undo
187 187
 	// Transforms the separated set of missions into a format readable by flot.
188 188
 	$mission_set_final = array();
189 189
 	$is_set_empty = true;
190
-	foreach($mission_set as $y => $bar) {
190
+	foreach ($mission_set as $y => $bar) {
191 191
 		$mission_set_final[$y] = array('label' => elgg_echo($bar_labels[$y]), 'data' => array());
192
-		foreach($bar as $x => $time) {
193
-			if($separator == 'missions:average_number_of_applicants') {
192
+		foreach ($bar as $x => $time) {
193
+			if ($separator == 'missions:average_number_of_applicants') {
194 194
 				$applicant_count = count($relation_set[$y][$x]);
195 195
 				$mission_count = count($mission_set[$y][$x]);
196 196
 
197
-				if($mission_count == 0) {
197
+				if ($mission_count == 0) {
198 198
 					$value = 0;
199 199
 				}
200 200
 				else {
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 			}
212 212
 
213 213
 			$mission_set_final[$y]['data'][] = array($x_label, $value);
214
-			if($value > 0 && $is_set_empty) {
214
+			if ($value > 0 && $is_set_empty) {
215 215
 				$is_set_empty = false;
216 216
 			}
217 217
 		}
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 	$ticks_array = array();
222 222
 	$percentages = array();
223 223
 	$error_message = '';
224
-	foreach($bin_labels as $x => $label) {
224
+	foreach ($bin_labels as $x => $label) {
225 225
 		$current_bin_label = $label;
226 226
 		if ($graph_type == 'missions:stacked_graph') {
227 227
 			$current_bin_label = $label[0];
@@ -229,17 +229,17 @@  discard block
 block discarded – undo
229 229
 		$ticks_array[$x] = array($x, $current_bin_label);
230 230
 
231 231
 		$total_x = 0;
232
-		foreach($mission_set as $y => $bar) {
232
+		foreach ($mission_set as $y => $bar) {
233 233
 			$total_x += count($bar[$x]);
234 234
 		}
235 235
 
236
-		foreach($mission_set as $y => $bar) {
236
+		foreach ($mission_set as $y => $bar) {
237 237
 			$x_label = $label;
238 238
 			if ($graph_type == 'missions:stacked_graph') {
239 239
 				$x_label = $x_label[1];
240 240
 			}
241 241
 
242
-			if($total_x > 0) {
242
+			if ($total_x > 0) {
243 243
 				$percentages[elgg_echo($bar_labels[$y])][$x_label] = array($total_x, 100 * round((count($bar[$x]) / $total_x), 4));
244 244
 			}
245 245
 			else {
@@ -248,11 +248,11 @@  discard block
 block discarded – undo
248 248
 		}
249 249
 	}
250 250
 
251
-	if($is_set_empty) {
251
+	if ($is_set_empty) {
252 252
 		$error_returner = elgg_echo('missions:error:analytics:no_opportunities_in_data');
253 253
 	}
254 254
 	else {
255
-		if(empty($ticks_array)) {
255
+		if (empty($ticks_array)) {
256 256
 			$error_returner = elgg_echo('missions:error:analytics:no_intervals_in_x_axis');
257 257
 		}
258 258
 	}
@@ -301,18 +301,18 @@  discard block
 block discarded – undo
301 301
 			);
302 302
 			unset($json_returner['options']['xaxis']['ticks']);
303 303
 
304
-			$json_returner['options']['zoom'] = array( 'interactive' => true );
305
-			$json_returner['options']['pan'] = array( 'interactive' => true );
304
+			$json_returner['options']['zoom'] = array('interactive' => true);
305
+			$json_returner['options']['pan'] = array('interactive' => true);
306 306
 			$json_returner['options']['yaxis']['zoomRange'] = false;
307 307
 			$json_returner['options']['yaxis']['panRange'] = false;
308 308
 
309 309
 			$json_returner['options']['xaxis']['panRange'] = array(
310 310
 				($timescale_array[0] * 1000) - $bar_width,
311
-				($timescale_array[count($timescale_array)-1] * 1000) + $bar_width
311
+				($timescale_array[count($timescale_array) - 1] * 1000) + $bar_width
312 312
 			);
313 313
 
314 314
 			$json_returner['options']['xaxis']['zoomRange'] = array(
315
-				$bar_width * 4 , null
315
+				$bar_width * 4, null
316 316
 			);
317 317
 
318 318
 			// $json_returner['options']['selection'] = array(
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@  discard block
 block discarded – undo
27 27
 // Graph type needs to be set or nothing gets generated.
28 28
 if($graph_type == '') {
29 29
 	$error_returner = elgg_echo('missions:error:analytics:select_graph_type');
30
-}
31
-else {
30
+} else {
32 31
 	// Formats the department guid so it can be searched for in the database.
33 32
 	if(elgg_entity_exists($department_guid)) {
34 33
 		$department_identifier = 'MOrg:' . $department_guid;
@@ -57,11 +56,9 @@  discard block
 block discarded – undo
57 56
 		// Gets the set of missions between the start date and end date. The search checks against the user given target date.
58 57
 		if($separator == 'missions:reason_to_decline') {
59 58
 			$mission_set = mm_analytics_get_declinations_by_dates($timescale_array[0], $timescale_array[count($timescale_array) - 1]);
60
-		}
61
-		else if($separator == 'missions:average_number_of_applicants') {
59
+		} else if($separator == 'missions:average_number_of_applicants') {
62 60
 			$mission_set = mm_analytics_get_missions_by_posting_and_closure($timescale_array[0], $timescale_array[count($timescale_array) - 1]);
63
-		}
64
-		else {
61
+		} else {
65 62
 			$mission_set = mm_analytics_get_missions_by_dates($timescale_array[0], $timescale_array[count($timescale_array) - 1], $target);
66 63
 		}
67 64
 
@@ -121,8 +118,7 @@  discard block
 block discarded – undo
121 118
 				$bar_width = 1;
122 119
 		}
123 120
 		$alignment = 'center';
124
-	}
125
-	else if($graph_type == 'missions:histogram') {
121
+	} else if($graph_type == 'missions:histogram') {
126 122
 		$target = $target_value;
127 123
 		$time_interval = $target;
128 124
 
@@ -196,12 +192,10 @@  discard block
 block discarded – undo
196 192
 
197 193
 				if($mission_count == 0) {
198 194
 					$value = 0;
199
-				}
200
-				else {
195
+				} else {
201 196
 					$value = round(($applicant_count / $mission_count), 2);
202 197
 				}
203
-			}
204
-			else {
198
+			} else {
205 199
 				$value = count($mission_set[$y][$x]);
206 200
 			}
207 201
 
@@ -241,8 +235,7 @@  discard block
 block discarded – undo
241 235
 
242 236
 			if($total_x > 0) {
243 237
 				$percentages[elgg_echo($bar_labels[$y])][$x_label] = array($total_x, 100 * round((count($bar[$x]) / $total_x), 4));
244
-			}
245
-			else {
238
+			} else {
246 239
 				$percentages[elgg_echo($bar_labels[$y])][$x_label] = 0;
247 240
 			}
248 241
 		}
@@ -250,8 +243,7 @@  discard block
 block discarded – undo
250 243
 
251 244
 	if($is_set_empty) {
252 245
 		$error_returner = elgg_echo('missions:error:analytics:no_opportunities_in_data');
253
-	}
254
-	else {
246
+	} else {
255 247
 		if(empty($ticks_array)) {
256 248
 			$error_returner = elgg_echo('missions:error:analytics:no_intervals_in_x_axis');
257 249
 		}
Please login to merge, or discard this patch.
mod/missions/views/default/missions/element-select.php 3 patches
Indentation   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -35,200 +35,200 @@
 block discarded – undo
35 35
 // This handles input fields for mission and candidate searching.
36 36
 if($second == 'true') {
37 37
 	// This section handles second javascript type selection.
38
-    switch ($dropdown_value) {
39
-        case elgg_echo('missions:publication_date'):
40
-        case elgg_echo('missions:end_year'):
41
-            $content .= '<div>' . elgg_view('input/dropdown', array(
42
-                'name' => $dropdown_name . '_operand',
43
-                'value' => '=',
44
-                'options' => array('=', '>=', '<=')
45
-            )) . '</div>';
38
+	switch ($dropdown_value) {
39
+		case elgg_echo('missions:publication_date'):
40
+		case elgg_echo('missions:end_year'):
41
+			$content .= '<div>' . elgg_view('input/dropdown', array(
42
+				'name' => $dropdown_name . '_operand',
43
+				'value' => '=',
44
+				'options' => array('=', '>=', '<=')
45
+			)) . '</div>';
46 46
             
47
-            $content .= '<div>' . elgg_view('input/date', array(
48
-            		'name' => $dropdown_name . '_value',
49
-            		'value' => ''
50
-            )) . '</div>';
51
-            break;
47
+			$content .= '<div>' . elgg_view('input/date', array(
48
+					'name' => $dropdown_name . '_value',
49
+					'value' => ''
50
+			)) . '</div>';
51
+			break;
52 52
             
53
-        default:
54
-            $content .= elgg_view('input/text', array(
55
-                'name' => $dropdown_name . '_value',
56
-                'value' => ''
57
-            ));
58
-            break;
59
-    }
53
+		default:
54
+			$content .= elgg_view('input/text', array(
55
+				'name' => $dropdown_name . '_value',
56
+				'value' => ''
57
+			));
58
+			break;
59
+	}
60 60
 }
61 61
 else {
62 62
 	// This section handles first javascript type selection.
63
-    switch ($dropdown_value) {
64
-        case '':
65
-            break;
63
+	switch ($dropdown_value) {
64
+		case '':
65
+			break;
66 66
         
67
-        /*case 'missions:user_department':
67
+		/*case 'missions:user_department':
68 68
         	
69 69
         	break;*/
70 70
             
71
-        case elgg_echo('missions:portfolio'):
72
-            $content .= elgg_view('input/dropdown', array(
73
-                'name' => $dropdown_name . '_element',
74
-                'value' => '',
75
-                'options' => array('', elgg_echo('missions:title'), /*elgg_echo('missions:publication_date')*/),
76
-                'onchange' => 'element_switch(this)'
77
-            ));
78
-            break;
71
+		case elgg_echo('missions:portfolio'):
72
+			$content .= elgg_view('input/dropdown', array(
73
+				'name' => $dropdown_name . '_element',
74
+				'value' => '',
75
+				'options' => array('', elgg_echo('missions:title'), /*elgg_echo('missions:publication_date')*/),
76
+				'onchange' => 'element_switch(this)'
77
+			));
78
+			break;
79 79
             
80
-        case elgg_echo('missions:education'):
81
-            $content .= elgg_view('input/dropdown', array(
82
-                'name' => $dropdown_name . '_element',
83
-                'value' => '',
84
-                'options' => array('', elgg_echo('missions:title'), elgg_echo('missions:degree'), elgg_echo('missions:field'), elgg_echo('missions:end_year')),
85
-                'onchange' => 'element_switch(this)'
86
-            ));
87
-            break;
80
+		case elgg_echo('missions:education'):
81
+			$content .= elgg_view('input/dropdown', array(
82
+				'name' => $dropdown_name . '_element',
83
+				'value' => '',
84
+				'options' => array('', elgg_echo('missions:title'), elgg_echo('missions:degree'), elgg_echo('missions:field'), elgg_echo('missions:end_year')),
85
+				'onchange' => 'element_switch(this)'
86
+			));
87
+			break;
88 88
             
89
-        case elgg_echo('missions:experience'):
90
-            $content .= elgg_view('input/dropdown', array(
91
-                'name' => $dropdown_name . '_element',
92
-                'value' => '',
93
-                'options' => array('', elgg_echo('missions:title'), elgg_echo('missions:organization'), elgg_echo('missions:end_year')),
94
-                'onchange' => 'element_switch(this)'
95
-            ));
96
-            break;
89
+		case elgg_echo('missions:experience'):
90
+			$content .= elgg_view('input/dropdown', array(
91
+				'name' => $dropdown_name . '_element',
92
+				'value' => '',
93
+				'options' => array('', elgg_echo('missions:title'), elgg_echo('missions:organization'), elgg_echo('missions:end_year')),
94
+				'onchange' => 'element_switch(this)'
95
+			));
96
+			break;
97 97
         
98
-        case elgg_echo('missions:duration'):
99
-        case elgg_echo('missions:start_time'):
100
-        	$content .= elgg_view('input/dropdown', array(
101
-        			'name' => $dropdown_name . '_operand',
102
-        			'value' => htmlspecialchars_decode($all_values['operand']),
103
-        			'options' => array('=', '>=', '<='),
104
-        			'style' => 'display:inline-block'
105
-        	));
98
+		case elgg_echo('missions:duration'):
99
+		case elgg_echo('missions:start_time'):
100
+			$content .= elgg_view('input/dropdown', array(
101
+					'name' => $dropdown_name . '_operand',
102
+					'value' => htmlspecialchars_decode($all_values['operand']),
103
+					'options' => array('=', '>=', '<='),
104
+					'style' => 'display:inline-block'
105
+			));
106 106
         	
107
-            $content .= elgg_view('input/text', array(
108
-                	'name' => $dropdown_name . '_element',
109
-                	'value' => $all_values['value_answer'],
110
-                	'placeholder' => 'HH:mm',
111
-        			'style' => 'display:inline-block'
112
-            ));
107
+			$content .= elgg_view('input/text', array(
108
+					'name' => $dropdown_name . '_element',
109
+					'value' => $all_values['value_answer'],
110
+					'placeholder' => 'HH:mm',
111
+					'style' => 'display:inline-block'
112
+			));
113 113
             
114
-            $content .= elgg_view('input/dropdown', array(
115
-            		'name' => $dropdown_name . '_element_day',
116
-            		'value' => $all_values['day'],
117
-            		'options' => $array_day
118
-            ));
119
-            break;
114
+			$content .= elgg_view('input/dropdown', array(
115
+					'name' => $dropdown_name . '_element_day',
116
+					'value' => $all_values['day'],
117
+					'options' => $array_day
118
+			));
119
+			break;
120 120
             
121
-        case elgg_echo('missions:time'):
122
-        	$content .= elgg_view('input/dropdown', array(
123
-        			'name' => $dropdown_name . '_operand',
124
-        			'value' => htmlspecialchars_decode($all_values['operand']),
125
-        			'options' => array('=', '>=', '<='),
126
-        			'style' => 'display:inline-block'
127
-        	));
121
+		case elgg_echo('missions:time'):
122
+			$content .= elgg_view('input/dropdown', array(
123
+					'name' => $dropdown_name . '_operand',
124
+					'value' => htmlspecialchars_decode($all_values['operand']),
125
+					'options' => array('=', '>=', '<='),
126
+					'style' => 'display:inline-block'
127
+			));
128 128
         	 
129
-        	$content .= elgg_view('input/text', array(
130
-        			'name' => $dropdown_name . '_element',
131
-        			'value' => $all_values['value_answer'],
132
-        			'style' => 'display:inline-block'
133
-        	));
134
-        	break;
129
+			$content .= elgg_view('input/text', array(
130
+					'name' => $dropdown_name . '_element',
131
+					'value' => $all_values['value_answer'],
132
+					'style' => 'display:inline-block'
133
+			));
134
+			break;
135 135
         	
136
-        case elgg_echo('missions:period'):
137
-        	$content .= elgg_view('input/dropdown', array(
138
-        			'name' => $dropdown_name . '_element',
139
-        			'value' => $all_values['value_answer'],
140
-        			'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('time_rate_string', 'missions'))
141
-        	));
142
-        	break;
136
+		case elgg_echo('missions:period'):
137
+			$content .= elgg_view('input/dropdown', array(
138
+					'name' => $dropdown_name . '_element',
139
+					'value' => $all_values['value_answer'],
140
+					'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('time_rate_string', 'missions'))
141
+			));
142
+			break;
143 143
         
144
-        case elgg_echo('missions:language'):
145
-            $content .= elgg_view('input/dropdown', array(
146
-                'name' => $dropdown_name . '_element',
147
-                'value' => $all_values['value_answer'],
148
-                'options' => array( elgg_echo('missions:english'),elgg_echo('missions:french'))
149
-            ));
150
-            $content .= '<br>';
144
+		case elgg_echo('missions:language'):
145
+			$content .= elgg_view('input/dropdown', array(
146
+				'name' => $dropdown_name . '_element',
147
+				'value' => $all_values['value_answer'],
148
+				'options' => array( elgg_echo('missions:english'),elgg_echo('missions:french'))
149
+			));
150
+			$content .= '<br>';
151 151
             
152
-            $content .= '<div class="col-sm-6">' . elgg_echo('missions:reading') . ':</div>';
153
-            $content .= '<div class="col-sm-6">' . elgg_view('input/dropdown', array(
154
-                'name' => $dropdown_name . '_element_lwc',
155
-                'value' => $all_values['reading'],
156
-                'options_values' => $array_lang
157
-            )) . '</div>';
152
+			$content .= '<div class="col-sm-6">' . elgg_echo('missions:reading') . ':</div>';
153
+			$content .= '<div class="col-sm-6">' . elgg_view('input/dropdown', array(
154
+				'name' => $dropdown_name . '_element_lwc',
155
+				'value' => $all_values['reading'],
156
+				'options_values' => $array_lang
157
+			)) . '</div>';
158 158
             
159
-            $content .= '<div class="col-sm-6">' . elgg_echo('missions:writing') . ':</div>';
160
-            $content .= '<div class="col-sm-6">' . elgg_view('input/dropdown', array(
161
-                'name' => $dropdown_name . '_element_lwe',
162
-                'value' => $all_values['writing'],
163
-                'options_values' => $array_lang
164
-            )) . '</div>';
159
+			$content .= '<div class="col-sm-6">' . elgg_echo('missions:writing') . ':</div>';
160
+			$content .= '<div class="col-sm-6">' . elgg_view('input/dropdown', array(
161
+				'name' => $dropdown_name . '_element_lwe',
162
+				'value' => $all_values['writing'],
163
+				'options_values' => $array_lang
164
+			)) . '</div>';
165 165
             
166
-            $content .= '<div class="col-sm-6">' . elgg_echo('missions:oral') . ':</div>';
167
-            $content .= '<div class="col-sm-6">' . elgg_view('input/dropdown', array(
168
-                'name' => $dropdown_name . '_element_lop',
169
-                'value' => $all_values['oral'],
170
-                'options_values' => $array_lang
171
-            )) . '</div>';
172
-            break;
166
+			$content .= '<div class="col-sm-6">' . elgg_echo('missions:oral') . ':</div>';
167
+			$content .= '<div class="col-sm-6">' . elgg_view('input/dropdown', array(
168
+				'name' => $dropdown_name . '_element_lop',
169
+				'value' => $all_values['oral'],
170
+				'options_values' => $array_lang
171
+			)) . '</div>';
172
+			break;
173 173
         
174
-        case elgg_echo('missions:security_clearance'):
175
-            $content .= elgg_view('input/dropdown', array(
176
-                'name' => $dropdown_name . '_element',
177
-                'value' => $all_values['value_answer'],
178
-                'options_values' => $array_sec
179
-            ));
180
-            break;
174
+		case elgg_echo('missions:security_clearance'):
175
+			$content .= elgg_view('input/dropdown', array(
176
+				'name' => $dropdown_name . '_element',
177
+				'value' => $all_values['value_answer'],
178
+				'options_values' => $array_sec
179
+			));
180
+			break;
181 181
             
182
-        case elgg_echo('missions:type'):
183
-        	$content .= elgg_view('input/dropdown', array(
184
-        			'name' => $dropdown_name . '_element',
185
-        			'value' => '',
186
-        			'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('opportunity_type_string', 'missions'))
187
-        	));
188
-        	break;
182
+		case elgg_echo('missions:type'):
183
+			$content .= elgg_view('input/dropdown', array(
184
+					'name' => $dropdown_name . '_element',
185
+					'value' => '',
186
+					'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('opportunity_type_string', 'missions'))
187
+			));
188
+			break;
189 189
             
190
-        case elgg_echo('missions:program_area'):
191
-        	$content .= elgg_view('input/dropdown', array(
192
-        			'name' => $dropdown_name . '_element',
193
-        			'value' => $all_values['value_answer'],
194
-        			'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('program_area_string', 'missions'))
195
-        	));
196
-        	break;
190
+		case elgg_echo('missions:program_area'):
191
+			$content .= elgg_view('input/dropdown', array(
192
+					'name' => $dropdown_name . '_element',
193
+					'value' => $all_values['value_answer'],
194
+					'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('program_area_string', 'missions'))
195
+			));
196
+			break;
197 197
             
198
-        case elgg_echo('missions:work_remotely'):
199
-        if ($all_values['value_answer'] == 'on')
200
-            $checked = 'checked';
198
+		case elgg_echo('missions:work_remotely'):
199
+		if ($all_values['value_answer'] == 'on')
200
+			$checked = 'checked';
201 201
         
202
-        	$content .= elgg_view('input/checkbox', array(
203
-        			'name' => $dropdown_name . '_element',
204
-                    'checked' => $checked
205
-        	));
206
-        	break;
202
+			$content .= elgg_view('input/checkbox', array(
203
+					'name' => $dropdown_name . '_element',
204
+					'checked' => $checked
205
+			));
206
+			break;
207 207
             
208
-        case elgg_echo('missions:location'):
209
-        	$content .= elgg_view('input/dropdown', array(
210
-        			'name' => $dropdown_name . '_element',
211
-				    'value' => $all_values['value_answer'],
212
-				    'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('province_string', 'missions')),
213
-        	));
214
-        	break;
208
+		case elgg_echo('missions:location'):
209
+			$content .= elgg_view('input/dropdown', array(
210
+					'name' => $dropdown_name . '_element',
211
+					'value' => $all_values['value_answer'],
212
+					'options_values' => mm_echo_explode_setting_string(elgg_get_plugin_setting('province_string', 'missions')),
213
+			));
214
+			break;
215 215
             
216
-        case elgg_echo('missions:skill'):
217
-        case elgg_echo('missions:key_skills'):
218
-        	$content .= elgg_view('missions/add-skill', array(
219
-        			'name_override' => $dropdown_name . '_element',
220
-        			'no_delete' => true,
221
-                    'value' => $all_values['value_answer'],
222
-        	));
223
-        	break;
216
+		case elgg_echo('missions:skill'):
217
+		case elgg_echo('missions:key_skills'):
218
+			$content .= elgg_view('missions/add-skill', array(
219
+					'name_override' => $dropdown_name . '_element',
220
+					'no_delete' => true,
221
+					'value' => $all_values['value_answer'],
222
+			));
223
+			break;
224 224
         
225
-        default:
225
+		default:
226 226
 
227
-            $content .= elgg_view('input/text', array(
228
-                'name' => $dropdown_name . '_element',
229
-                'value' => $all_values['value_answer'],
230
-            ));
231
-    }
227
+			$content .= elgg_view('input/text', array(
228
+				'name' => $dropdown_name . '_element',
229
+				'value' => $all_values['value_answer'],
230
+			));
231
+	}
232 232
 }
233 233
 
234 234
 echo $content;
235 235
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 // Builds input field content depending on what type the user selected.
35 35
 // This handles input fields for mission and candidate searching.
36
-if($second == 'true') {
36
+if ($second == 'true') {
37 37
 	// This section handles second javascript type selection.
38 38
     switch ($dropdown_value) {
39 39
         case elgg_echo('missions:publication_date'):
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             $content .= elgg_view('input/dropdown', array(
146 146
                 'name' => $dropdown_name . '_element',
147 147
                 'value' => $all_values['value_answer'],
148
-                'options' => array( elgg_echo('missions:english'),elgg_echo('missions:french'))
148
+                'options' => array(elgg_echo('missions:english'), elgg_echo('missions:french'))
149 149
             ));
150 150
             $content .= '<br>';
151 151
             
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
57 57
             ));
58 58
             break;
59 59
     }
60
-}
61
-else {
60
+} else {
62 61
 	// This section handles first javascript type selection.
63 62
     switch ($dropdown_value) {
64 63
         case '':
@@ -196,8 +195,9 @@  discard block
 block discarded – undo
196 195
         	break;
197 196
             
198 197
         case elgg_echo('missions:work_remotely'):
199
-        if ($all_values['value_answer'] == 'on')
200
-            $checked = 'checked';
198
+        if ($all_values['value_answer'] == 'on') {
199
+                    $checked = 'checked';
200
+        }
201 201
         
202 202
         	$content .= elgg_view('input/checkbox', array(
203 203
         			'name' => $dropdown_name . '_element',
Please login to merge, or discard this patch.