]> git.mxchange.org Git - friendica.git/commitdiff
Initial plugins admin page
authorFabio Comuni <fabrix.xm@gmail.com>
Tue, 14 Jun 2011 08:35:56 +0000 (10:35 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Tue, 14 Jun 2011 08:35:56 +0000 (10:35 +0200)
mod/admin.php
view/admin_plugins.tpl [new file with mode: 0644]
view/theme/duepuntozero/style.css

index 73da3814ba3e58e9dca795e9cfe24253642cb4c4..f9d248210d414e9fd4323b0b129fd9b2cb40306a 100644 (file)
@@ -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
+       ));
+}
+
diff --git a/view/admin_plugins.tpl b/view/admin_plugins.tpl
new file mode 100644 (file)
index 0000000..d29665a
--- /dev/null
@@ -0,0 +1,14 @@
+<div id='adminpage'>
+       <h1>$title - $page</h1>
+       
+               <ul id='pluginslist'>
+               {{ for $plugins as $p }}
+                       <li class='plugin $p.1'>
+                               <a class='toggle' href='$baseurl/admin/plugins/$p.0?a=t'><span class='icon $p.1'></span></a>
+                               <a href='$baseurl/admin/plugins/$p.0'>
+                                       <span class='name'>$p.0</span>
+                               </a>
+                       </li>
+               {{ endfor }}
+               </ul>
+</div>
index 294a86690a633359883b8e9c9437ffce777d3d2e..8799726c7bb6623ea0f65e42e0fb9cecf30741b3 100644 (file)
@@ -2520,6 +2520,21 @@ a.mail-list-link {
        text-align: right;
 }
 
+#adminpage #pluginslist {
+       margin: 0px; padding: 0px;
+}
+#adminpage .plugin {
+       list-style: none;
+       display: block;
+       border: 1px solid #888888;
+       padding: 1em;
+       margin-bottom: 5px;
+       clear: left;
+}
+#adminpage .plugin .toggle {
+       float:left;
+       margin-right: 1em;
+}
 
 /**
  * ICONS
@@ -2557,7 +2572,8 @@ a.mail-list-link {
 .youtube { background-position: -64px -32px;}
 .attach { background-position: -80px -32px; }
 .language { background-position: -96px -32px; }
-
+.on { background-position: -112px -32px; }
+.off { background-position: -128px -32px; }
 
 .attachtype {
        display: block; width: 20px; height: 23px;