aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-06-14 14:21:43 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-06-14 14:21:43 +0200
commit00e142e4f753005a8b4003585c6a88548f006315 (patch)
tree95ff3c0c6a7ad53be0d4e0042a93b8720f5c9941 /mod
parent283160901fcb5670b48c7897ccce615872cb956e (diff)
downloadvolse-hubzilla-00e142e4f753005a8b4003585c6a88548f006315.tar.gz
volse-hubzilla-00e142e4f753005a8b4003585c6a88548f006315.tar.bz2
volse-hubzilla-00e142e4f753005a8b4003585c6a88548f006315.zip
Load plugin info from plugin file. Show README.md or README from plugin dir in plugin details page
Diffstat (limited to 'mod')
-rw-r--r--mod/admin.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/mod/admin.php b/mod/admin.php
index e40c50396..6386e6ebc 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -340,7 +340,7 @@ function admin_page_plugins(&$a){
return; // NOTREACHED
}
// display plugin details
-
+ require_once('library/markdown.php');
if (in_array($plugin, $a->plugins)){
$status="on"; $action= t("Disable");
@@ -348,6 +348,14 @@ function admin_page_plugins(&$a){
$status="off"; $action= t("Enable");
}
+ $readme=Null;
+ if (is_file("addon/$plugin/README.md")){
+ $readme = file_get_contents("addon/$plugin/README.md");
+ $readme = Markdown($readme);
+ } else if (is_file("addon/$plugin/README")){
+ $readme = "<pre>". file_get_contents("addon/$plugin/README") ."</pre>";
+ }
+
$t = get_markup_template("admin_plugins_details.tpl");
return replace_macros($t, array(
'$title' => t('Administration'),
@@ -357,7 +365,10 @@ function admin_page_plugins(&$a){
'$plugin' => $plugin,
'$status' => $status,
- '$action' => $action
+ '$action' => $action,
+ '$info' => get_plugin_info($plugin),
+
+ '$readme' => $readme
));
}
@@ -373,9 +384,8 @@ function admin_page_plugins(&$a){
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);
+ $info = get_plugin_info($id);
+ $plugins[] = array( $id, (in_array($id, $a->plugins)?"on":"off") , $info);
}
}
}