original_string: public function onLoadMovePopup()
      {
          $this->abortIfReadOnly();
  
          $exclude = Input::get('exclude', []);
          if (!is_array($exclude)) {
              throw new ApplicationException('Invalid input data');
          }
  
          $folders = MediaLibrary::instance()->listAllDirectories($exclude);
  
          $folderList = [];
          foreach ($folders as $folder) {
              $path = $folder;
  
              if ($folder == '/') {
                  $name = Lang::get('backend::lang.media.library');
              }
              else {
                  $segments = explode('/', $folder);
                  $name = str_repeat('&nbsp;', (count($segments)-1)*4).basename($folder);
              }
  
              $folderList[$path] = $name;
          }
  
          $this->vars['folders'] = $folderList;
          $this->vars['originalPath'] = Input::get('path');
  
          return $this->makePartial('move-form');
      }
code: public function onLoadMovePopup()
      {
          $this->abortIfReadOnly();
  
          $exclude = Input::get('exclude', []);
          if (!is_array($exclude)) {
              throw new ApplicationException('Invalid input data');
          }
  
          $folders = MediaLibrary::instance()->listAllDirectories($exclude);
  
          $folderList = [];
          foreach ($folders as $folder) {
              $path = $folder;
  
              if ($folder == '/') {
                  $name = Lang::get('backend::lang.media.library');
              }
              else {
                  $segments = explode('/', $folder);
                  $name = str_repeat('&nbsp;', (count($segments)-1)*4).basename($folder);
              }
  
              $folderList[$path] = $name;
          }
  
          $this->vars['folders'] = $folderList;
          $this->vars['originalPath'] = Input::get('path');
  
          return $this->makePartial('move-form');
      }
code_tokens: public function onLoadMovePopup ( ) { $ this -> abortIfReadOnly ( ) ; $ exclude = Input :: get ( 'exclude' , [ ] ) ; if ( ! is_array ( $ exclude ) ) { throw new ApplicationException ( 'Invalid input data' ) ; } $ folders = MediaLibrary :: instance ( ) -> listAllDirectories ( $ exclude ) ; $ folderList = [ ] ; foreach ( $ folders as $ folder ) { $ path = $ folder ; if ( $ folder == '/' ) { $ name = Lang :: get ( 'backend::lang.media.library' ) ; } else { $ segments = explode ( '/' , $ folder ) ; $ name = str_repeat ( '&nbsp;' , ( count ( $ segments ) - 1 ) * 4 ) . basename ( $ folder ) ; } $ folderList [ $ path ] = $ name ; } $ this -> vars [ 'folders' ] = $ folderList ; $ this -> vars [ 'originalPath' ] = Input :: get ( 'path' ) ; return $ this -> makePartial ( 'move-form' ) ; }
docstring: Show move item popup AJAX handler
  @return array
docstring_tokens: Show move item popup AJAX handler