e350a093 by Jeff Balicki

DD

1 parent 7328a660
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 use Tz\WordPress\Tools; 2 use Tz\WordPress\Tools;
3 use Tz\WordPress\Tools\Notifications; 3 use Tz\WordPress\Tools\Notifications;
4 use Tz\WordPress\Tools\Notifications\Settings; 4 use Tz\WordPress\Tools\Notifications\Settings;
5 5 use Tz\WordPress\UAM;
6 6
7 $user_ID = get_current_user_id(); 7 $user_ID = get_current_user_id();
8 $AAL = get_user_meta($user_ID, '_AAL', false); 8 $AAL = get_user_meta($user_ID, '_AAL', false);
...@@ -75,7 +75,7 @@ use Tz\WordPress\Tools\Notifications\Settings; ...@@ -75,7 +75,7 @@ use Tz\WordPress\Tools\Notifications\Settings;
75 <?php foreach ($notifications['newsletter'] as $entry): 75 <?php foreach ($notifications['newsletter'] as $entry):
76 $sendto = $entry->sendto; 76 $sendto = $entry->sendto;
77 if (is_numeric($sendto)) { 77 if (is_numeric($sendto)) {
78 $sendto = Notifications\getGroups($sendto)." Group"; 78 $sendto = UAM\getGroups($sendto)." Group";
79 } else { 79 } else {
80 $sendto = Notifications\get_field_lookup($sendto); 80 $sendto = Notifications\get_field_lookup($sendto);
81 } 81 }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
3 use Tz\WordPress\Tools; 3 use Tz\WordPress\Tools;
4 use Tz\WordPress\Tools\Notifications; 4 use Tz\WordPress\Tools\Notifications;
5 use Tz\WordPress\Tools\Notifications\Settings; 5 use Tz\WordPress\Tools\Notifications\Settings;
6 use Tz\WordPress\UAM;
6 7
7 function getInputFormValues($validation, $name) 8 function getInputFormValues($validation, $name)
8 { 9 {
...@@ -93,12 +94,14 @@ $newsletterFr = get_post($newsletterFrId); ...@@ -93,12 +94,14 @@ $newsletterFr = get_post($newsletterFrId);
93 ? 'selected="selected"' : ""; ?>>All Users 94 ? 'selected="selected"' : ""; ?>>All Users
94 </option> 95 </option>
95 <optgroup label="By Group:"> 96 <optgroup label="By Group:">
96 <?php foreach (Notifications\getGroups() as $group_id => $group_name): ?> 97 <?php $groups = UAM\getGroups();
97 <option value="<?php echo $group_id ?>" <?php echo ($validation->set_value( 98 foreach ($groups as $group){
99 ?>
100 <option value="<?php echo $group->getID(); ?>" <?php echo ($validation->set_value(
98 'sendto' 101 'sendto'
99 ) == $group_id) ? 'selected="selected"' 102 ) == $group->getID()) ? 'selected="selected"'
100 : ""; ?>><?php echo $group_name; ?></option> 103 : ""; ?>><?php echo $group->getName(); ?></option>
101 <?php endforeach;?> 104 <?php };?>
102 </optgroup> 105 </optgroup>
103 </select> 106 </select>
104 <?php echo $validation->form_error('sendto'); ?> 107 <?php echo $validation->form_error('sendto'); ?>
......