From fb55a3dea369ee2d294a5723ab4899a87e38a16a Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 16 Dec 2009 10:18:05 +0100 Subject: show component name in plugin infos Ignore-this: 9ca4c177b16580a13acf334d78570bd7 darcs-hash:20091216091805-6e07b-14394dcf6800210af85067b1214bc8dbb340d3b4.gz --- lib/plugins/plugin/classes/ap_info.class.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'lib/plugins/plugin/classes') diff --git a/lib/plugins/plugin/classes/ap_info.class.php b/lib/plugins/plugin/classes/ap_info.class.php index dd1765f6c..fcadb4599 100644 --- a/lib/plugins/plugin/classes/ap_info.class.php +++ b/lib/plugins/plugin/classes/ap_info.class.php @@ -13,10 +13,23 @@ class ap_info extends ap_manage { $component_list = $this->get_plugin_components($this->manager->plugin); usort($component_list, array($this,'component_sort')); + foreach ($component_list as $component) { if ($obj = & plugin_load($component['type'],$component['name']) === NULL) continue; - $this->details[] = array_merge($obj->getInfo(), array('type' => $component['type'])); + $compname = explode('_',$component['name']); + if($compname[1]){ + $compname = '['.$compname[1].']'; + }else{ + $compname = ''; + } + + $this->details[] = array_merge( + $obj->getInfo(), + array( + 'type' => $component['type'], + 'compname' => $compname + )); unset($obj); } @@ -72,7 +85,7 @@ class ap_info extends ap_manage { foreach ($this->details as $info) { ptln("
",4); - ptln("
".$this->manager->getLang('name')."
".$this->out($info['name'])."
",6); + ptln("
".$this->manager->getLang('name')."
".$this->out($info['name'].' '.$info['compname'])."
",6); if (!$this->plugin_info['date']) ptln("
".$this->manager->getLang('date')."
".$this->out($info['date'])."
",6); if (!$this->plugin_info['type']) ptln("
".$this->manager->getLang('type')."
".$this->out($info['type'])."
",6); if (!$this->plugin_info['desc']) ptln("
".$this->manager->getLang('desc')."
".$this->out($info['desc'])."
",6); @@ -111,11 +124,13 @@ class ap_info extends ap_manage { if ($dh = @opendir($path.$type.'/')) { while (false !== ($cp = readdir($dh))) { if ($cp == '.' || $cp == '..' || strtolower(substr($cp,-4)) != '.php') continue; + $components[] = array('name'=>$plugin.'_'.substr($cp, 0, -4), 'type'=>$type); } closedir($dh); } } + return $components; } -- cgit v1.2.3