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');
    }
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');
    }
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' ) ; }
Show move item popup AJAX handler
@return array
Show move item popup AJAX handler