original_string: public function move_plugin($plugintomove, $dir) {
          // Get a list of the current plugins.
          $plugins = $this->get_sorted_plugins_list();
  
          $currentindex = 0;
  
          // Throw away the keys.
          $plugins = array_values($plugins);
  
          // Find this plugin in the list.
          foreach ($plugins as $key => $plugin) {
              if ($plugin == $plugintomove) {
                  $currentindex = $key;
                  break;
              }
          }
  
          // Make the switch.
          if ($dir == 'up') {
              if ($currentindex > 0) {
                  $tempplugin = $plugins[$currentindex - 1];
                  $plugins[$currentindex - 1] = $plugins[$currentindex];
                  $plugins[$currentindex] = $tempplugin;
              }
          } else if ($dir == 'down') {
              if ($currentindex < (count($plugins) - 1)) {
                  $tempplugin = $plugins[$currentindex + 1];
                  $plugins[$currentindex + 1] = $plugins[$currentindex];
                  $plugins[$currentindex] = $tempplugin;
              }
          }
  
          // Save the new normal order.
          foreach ($plugins as $key => $plugin) {
              set_config('sortorder', $key, $this->subtype . '_' . $plugin);
          }
          return 'view';
      }
code: public function move_plugin($plugintomove, $dir) {
          // Get a list of the current plugins.
          $plugins = $this->get_sorted_plugins_list();
  
          $currentindex = 0;
  
          // Throw away the keys.
          $plugins = array_values($plugins);
  
          // Find this plugin in the list.
          foreach ($plugins as $key => $plugin) {
              if ($plugin == $plugintomove) {
                  $currentindex = $key;
                  break;
              }
          }
  
          // Make the switch.
          if ($dir == 'up') {
              if ($currentindex > 0) {
                  $tempplugin = $plugins[$currentindex - 1];
                  $plugins[$currentindex - 1] = $plugins[$currentindex];
                  $plugins[$currentindex] = $tempplugin;
              }
          } else if ($dir == 'down') {
              if ($currentindex < (count($plugins) - 1)) {
                  $tempplugin = $plugins[$currentindex + 1];
                  $plugins[$currentindex + 1] = $plugins[$currentindex];
                  $plugins[$currentindex] = $tempplugin;
              }
          }
  
          // Save the new normal order.
          foreach ($plugins as $key => $plugin) {
              set_config('sortorder', $key, $this->subtype . '_' . $plugin);
          }
          return 'view';
      }
code_tokens: public function move_plugin ( $ plugintomove , $ dir ) { // Get a list of the current plugins. $ plugins = $ this -> get_sorted_plugins_list ( ) ; $ currentindex = 0 ; // Throw away the keys. $ plugins = array_values ( $ plugins ) ; // Find this plugin in the list. foreach ( $ plugins as $ key => $ plugin ) { if ( $ plugin == $ plugintomove ) { $ currentindex = $ key ; break ; } } // Make the switch. if ( $ dir == 'up' ) { if ( $ currentindex > 0 ) { $ tempplugin = $ plugins [ $ currentindex - 1 ] ; $ plugins [ $ currentindex - 1 ] = $ plugins [ $ currentindex ] ; $ plugins [ $ currentindex ] = $ tempplugin ; } } else if ( $ dir == 'down' ) { if ( $ currentindex < ( count ( $ plugins ) - 1 ) ) { $ tempplugin = $ plugins [ $ currentindex + 1 ] ; $ plugins [ $ currentindex + 1 ] = $ plugins [ $ currentindex ] ; $ plugins [ $ currentindex ] = $ tempplugin ; } } // Save the new normal order. foreach ( $ plugins as $ key => $ plugin ) { set_config ( 'sortorder' , $ key , $ this -> subtype . '_' . $ plugin ) ; } return 'view' ; }
docstring: Change the order of this plugin.
  
  @param string $plugintomove - The plugin to move
  @param string $dir - up or down
  @return string The next page to display
docstring_tokens: Change the order of this plugin .