aboutsummaryrefslogtreecommitdiffstats
path: root/mod/admin.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-06-14 10:35:56 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-06-14 10:35:56 +0200
commit5882d8d022c14a12ba7b314c96289061bd195ed4 (patch)
tree82ab01ac9fbc469ca52fe40bac455c3b564d31c4 /mod/admin.php
parent4ba23df20a46bec640177df0555b5d98486c8540 (diff)
downloadvolse-hubzilla-5882d8d022c14a12ba7b314c96289061bd195ed4.tar.gz
volse-hubzilla-5882d8d022c14a12ba7b314c96289061bd195ed4.tar.bz2
volse-hubzilla-5882d8d022c14a12ba7b314c96289061bd195ed4.zip
Initial plugins admin page
Diffstat (limited to 'mod/admin.php')
-rw-r--r--mod/admin.php51
1 files changed, 49 insertions, 2 deletions
diff --git a/mod/admin.php b/mod/admin.php
index 73da3814b..f9d248210 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -74,10 +74,15 @@ function admin_content(&$a) {
// urls
if ($a->argc > 1){
switch ($a->argv[1]){
- case 'site': {
+ case 'site':
$o = admin_page_site($a);
break;
- }
+ case 'users':
+ $o = admin_page_users($a);
+ break;
+ case 'plugins':
+ $o = admin_page_plugins($a);
+ break;
default:
notice( t("Item not found.") );
}
@@ -288,3 +293,45 @@ function admin_page_site(&$a) {
));
}
+
+
+/**
+ * Users admin page
+ */
+
+function admin_page_users(&$a){
+ return ":)";
+}
+
+
+/*
+ * Plugins admin page
+ */
+
+function admin_page_plugins(&$a){
+
+ /* all plugins */
+ $plugins = array();
+ $files = glob("addon/*/");
+ if($files) {
+ foreach($files as $file) {
+ if (is_dir($file)){
+ list($tmp, $id)=array_map("trim", explode("/",$file));
+ // TODO: plugins info
+ $name=$author=$description=$homepage="";
+ $plugins[] = array( $id, (in_array($id, $a->plugins)?"on":"off") , $name, $author, $description, $homepage);
+ }
+ }
+ }
+
+ $t = get_markup_template("admin_plugins.tpl");
+ return replace_macros($t, array(
+ '$title' => t('Administration'),
+ '$page' => t('Plugins'),
+ '$submit' => t('Submit'),
+ '$baseurl' => $a->get_baseurl(),
+
+ '$plugins' => $plugins
+ ));
+}
+