7 function admin_init(&$a) {
9 notice( t('Permission denied.') . EOL);
15 function admin_content(&$a) {
17 if(!is_site_admin()) {
25 // array( url, name, extra css classes )
27 'site' => Array($a->get_baseurl()."/admin/site/", t("Site") , "site"),
28 'users' => Array($a->get_baseurl()."/admin/users/", t("Users") , "users"),
29 'plugins'=> Array($a->get_baseurl()."/admin/plugins/", t("Plugins") , "plugins")
32 /* get plugins admin page */
34 $r = q("SELECT * FROM `hook` WHERE `hook`='plugin_admin'");
35 $aside['plugins_admin']=Array();
37 $plugin = explode("/",$h['file']); $plugin = $plugin[1];
38 $aside['plugins_admin'][] = Array($a->get_baseurl()."/admin/plugins/".$plugin, $plugin, "plugin");
41 $aside['logs'] = Array($a->get_baseurl()."/admin/logs/", t("Logs"), "logs");
43 $t = get_markup_template("admin_aside.tpl");
44 $a->page['aside'] = replace_macros( $t, array('$admin' => $aside) );
57 $o = admin_page_site($a);
61 notice( t("Item not found.") );
64 $o = admin_page_summary($a);
73 function admin_page_summary(&$a) {
74 $r = q("SELECT `page-flags`, COUNT(uid) as `count` FROM `user` GROUP BY `page-flags`");
76 Array( t('Normal Account'), 0),
77 Array( t('Soapbox Account'), 0),
78 Array( t('Community/Celebrity Account'), 0),
79 Array( t('Automatic Friend Account'), 0)
82 foreach ($r as $u){ $accounts[$u['page-flags']][1] = $u['count']; $users+=$u['count']; }
84 //echo "<pre>"; var_dump($a->plugins); die("</pre>");
87 $r = q("SELECT COUNT(id) as `count` FROM `register`");
88 $pending = $r[0]['count'];
94 $t = get_markup_template("admin_summary.tpl");
95 return replace_macros($t, array(
96 '$title' => t('Administration'),
97 '$page' => t('Summary'),
98 '$users' => Array( t('Registered users'), $users),
99 '$accounts' => $accounts,
100 '$pending' => Array( t('Pending registrations'), $pending),
101 '$version' => Array( t('Version'), FRIENDIKA_VERSION),
102 '$build' => get_config('system','build'),
103 '$plugins' => Array( t('Active plugins'), $a->plugins )