- if (!empty($o_plugs[$type])) {
- $plugentry['move_up'] = 1;
- $last = count($o_plugs[$type]) - 1;
- $o_plugs[$type][$last]['move_down'] = 1;
- } else {
- $o_plugs[$type] = array();
+ } else {
+
+ $plugentry = $plug_h->dump();
+ $plugentry['icon'] = $globals->icons->get_action_icon('plugins');
+ $type = $plugentry['type'];
+ if (!empty($plugs[$type])) {
+ $plugentry['move_up'] = 1;
+ $last = count($plugs[$type]) - 1;
+ $plugs[$type][$last]['move_down'] = 1;
+ } else {
+ $plugs[$type] = array();
+ }
+ array_push($plugs[$type], $plugentry);
+
+ }
+ }
+ }
+
+ // next we add the disabled plugins
+ if (!$this->readonly)
+ {
+ foreach ($available as $plugname)
+ {
+ $plugcache = $globals->plugins->cacheGet($cache, $this->plug_barrel, $this->plug_page, $plugname);
+ if (!is_array($plugcache) or !$plugcache['active'])
+ {
+ $plugcache = $globals->plugins->cacheGet($cache, $this->plug_barrel, 0, $plugname);
+ $plugcache['active'] = 0;
+ $plug_h = $globals->plugins->load($plugcache);
+ if (!is_object($plug_h)) {
+ $page->info("could not load disabled plugin '$plugname' in barrel '{$this->plug_barrel}'");
+ return;
+ }
+
+ $plugentry = $plug_h->dump();
+ $plugentry['icon'] = $globals->icons->get_action_icon('plugins');
+ $type = $plugentry['type'];
+ if (empty($plugs[$type])) {
+ $plugs[$type] = array();
+ }
+ array_push($plugs[$type], $plugentry);
+ }