- 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['name'], $plugcache_a);
-
- if (is_object($plug_a) && ($plug_a->active)) {
- $old_pos = $plug_a->pos;
- $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['name'], $plugcache_b);
-
- // swap the current plugin and the next plugin
- if (is_object($plug_b) && ($plug_b->active))
- {
- $plug_a->toDatabase($this->plug_barrel, $this->plug_page, $old_pos + $delta);
- $plug_b->toDatabase($this->plug_barrel, $this->plug_page, $old_pos);
- }
- }
- }
- $rebuild_cache = 1;
- break;
-