|
18 | 18 | echo elgg_view_message('notice', elgg_echo('group_tools:group:admin_approve:notice')); |
19 | 19 | } elseif ((bool) $entity->admin_approval) { |
20 | 20 | // group profile / edit form |
21 | | - $message = elgg_echo('group_tools:group:admin_approve:notice:profile'); |
22 | 21 | $link = ''; |
23 | 22 |
|
24 | | - if ($entity->canEdit() && (bool) elgg_get_plugin_setting('creation_reason', 'group_tools')) { |
25 | | - $count = $entity->getAnnotations([ |
26 | | - 'count' => true, |
27 | | - 'wheres' => [ |
28 | | - function(QueryBuilder $qb, $main_alias) { |
29 | | - return $qb->compare("{$main_alias}.name", 'like', 'approval_reason:%', ELGG_VALUE_STRING); |
30 | | - }, |
31 | | - ], |
32 | | - ]); |
33 | | - if (!empty($count)) { |
34 | | - $link = elgg_view('output/url', [ |
35 | | - 'text' => elgg_echo('group_tools:group:admin_approve:reasons'), |
36 | | - 'href' => elgg_http_add_url_query_elements('ajax/view/group_tools/group/reasons', [ |
37 | | - 'guid' => $entity->guid, |
38 | | - ]), |
39 | | - 'class' => 'elgg-lightbox', |
| 23 | + if ($entity->canEdit()) { |
| 24 | + $message = elgg_echo('group_tools:group:admin_approve:notice:profile'); |
| 25 | + |
| 26 | + if ((bool) elgg_get_plugin_setting('creation_reason', 'group_tools')) { |
| 27 | + $count = $entity->getAnnotations([ |
| 28 | + 'count' => true, |
| 29 | + 'wheres' => [ |
| 30 | + function (QueryBuilder $qb, $main_alias) { |
| 31 | + return $qb->compare("{$main_alias}.name", 'like', 'approval_reason:%', ELGG_VALUE_STRING); |
| 32 | + }, |
| 33 | + ], |
40 | 34 | ]); |
| 35 | + if (!empty($count)) { |
| 36 | + $link = elgg_view('output/url', [ |
| 37 | + 'text' => elgg_echo('group_tools:group:admin_approve:reasons'), |
| 38 | + 'href' => elgg_http_add_url_query_elements('ajax/view/group_tools/group/reasons', [ |
| 39 | + 'guid' => $entity->guid, |
| 40 | + ]), |
| 41 | + 'class' => 'elgg-lightbox', |
| 42 | + ]); |
| 43 | + } |
41 | 44 | } |
| 45 | + } else { |
| 46 | + $message = elgg_echo('group_tools:group:admin_approve:notice:profile:user'); |
42 | 47 | } |
43 | 48 |
|
44 | 49 | echo elgg_view_message('notice', $message, ['link' => $link]); |
|
0 commit comments