diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:48:09 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 14:48:09 -0300 |
commit | bd1864363fada1c3122b053b83c4d8b9526bbfa3 (patch) | |
tree | d9384adec24d864e71c169f3b52605a53228e02c /views/default/bulk_user_admin/email_domain_stats.php | |
download | elgg-bd1864363fada1c3122b053b83c4d8b9526bbfa3.tar.gz elgg-bd1864363fada1c3122b053b83c4d8b9526bbfa3.tar.bz2 |
Squashed 'mod/bulk_user_admin/' content from commit 17664c9
git-subtree-dir: mod/bulk_user_admin
git-subtree-split: 17664c9c5af5ee2d74b7c378ccc52ee65074ad6c
Diffstat (limited to 'views/default/bulk_user_admin/email_domain_stats.php')
-rw-r--r-- | views/default/bulk_user_admin/email_domain_stats.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/views/default/bulk_user_admin/email_domain_stats.php b/views/default/bulk_user_admin/email_domain_stats.php new file mode 100644 index 000000000..3936eb0ea --- /dev/null +++ b/views/default/bulk_user_admin/email_domain_stats.php @@ -0,0 +1,49 @@ +<?php + +$domains = $vars['domains']; + +?> +<table class="bulk_user_admin_email_domains"> + <tr> + <th>Domain</th> + <th>Registered users</th> + </tr> +<?php + + +$i = 0; +foreach ($domains as $domain_info) { + if (!$domain_info->domain) { + continue; + } + + $domain = elgg_view('output/url', array( + 'text' => $domain_info->domain, + 'href' => $domain_info->domain + )); + + $url = elgg_http_add_url_query_elements($vars['url'] . 'admin/user', array('domain' => $domain_info->domain)); + + // can't use $_GET variables in admin + // otherwise admin_page_handler() tries to call the view: view/name?variable=value + // which clearly doesn't work + // so we'll pass the domain via post + $users = '<form id="domain:' . $domain_info->domain . '" action="' . elgg_get_site_url() . 'admin/user" method="post">'; + $users .= elgg_view('input/hidden', array('name' => 'domain', 'value' => $domain_info->domain)); + $users .= '</form>'; + $users .= '<a href="javascript:document.forms[\'domain:' . $domain_info->domain . '\'].submit();">' . $domain_info->count . '</a>'; + + $class = ($i % 2) ? 'odd' : 'even'; + + echo <<<___HTML + <tr class="$class"> + <td>$domain</td> + <td class="center">$users</td> + </tr> +___HTML; + + $i++; +} + +?> +</table>
\ No newline at end of file |