- case "move_up": case "move_down":
- if ($this->readonly) die("Sorry, this plugin view is read-only.");
-
- $delta = ($action == "move_down") ? 1 : -1;
- //$page->info("moving plugin '$target'..");
- $plugcache_a = $globals->plugins->cacheGet($cache, $this->plug_barrel, $this->plug_page, $target);
- $plug_a =& $globals->plugins->load($plugcache_a);
- //$plug_a =& $globals->plugins->get($target);
-
- if (is_object($plug_a) && ($plug_a->active)) {
- $old_pos = $plug_a->pos;
- //$plug_b =& $globals->plugins->getAtPos($old_pos + $delta);
- $plugcache_b = $globals->plugins->cacheGetAtPos($cache, $this->plug_barrel, $this->plug_page, $old_pos + $delta);
-
- if (is_array($plugcache_b))
- {
- $plug_b =& $globals->plugins->load($plugcache_b);
-
- // swap the current plugin and the next plugin
- if (is_object($plug_b) && ($plug_b->active))
- {
- $plug_a->writeParams($this->plug_barrel, $this->plug_page, $old_pos + $delta);
- $plug_b->writeParams($this->plug_barrel, $this->plug_page, $old_pos);
- }
- }
- }
- $globals->plugins->compileCache($cachefile, $this->plug_barrel);
- $cache = $globals->plugins->readCache($cachefile, $this->plug_barrel);
- $available = $globals->plugins->cachedAvailable($cache, $this->plug_barrel, $this->plug_page);
- break;
-