Load plugin info from plugin file. Show README.md or README from plugin dir in plugin details page
This commit is contained in:
parent
283160901f
commit
00e142e4f7
5 changed files with 88 additions and 16 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue