extension/ezjscore/classes/ezjscserverfunctionsajaxuploader.php
static function browse( $args )
    {
        if ( count( $args ) < 2 )
        {
            throw new InvalidArgumentException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader', 'Arguments error.'
                )
            );
        }
        list( $nodeID, $classId ) = $args;
        $offset = 0;
        if ( isset( $args[2] ) )
        {
            $offset = (int) $args[2];
        }
        $node = eZContentObjectTreeNode::fetch( $nodeID );
        $class = eZContentClass::fetch( $classId );
        if ( !$node instanceof eZContentObjectTreeNode
                || !$class instanceof eZContentClass )
        {
            throw new InvalidArgumentException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader', 'Arguments error.'
                )
            );
        }
        else if ( !$node->canRead() )
        {
            throw new InvalidArgumentException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader', 'Arguments error.'
                )
            );
        }
        $browseItems = self::getBrowseItems( $node, $class, $offset );

        $tpl = eZTemplate::factory();
        $tpl->setVariable( 'browse', $browseItems );
        $tpl->setVariable( 'browse_start', $node );
        $tpl->setVariable( 'default_parent_node', array( 'node_id' => 0 ) );
        $tpl->setVariable( 'class', $class );

        return array(
            'meta_data' => false,
            'html' => $tpl->fetch( 'design:ajaxuploader/browse.tpl' )
        );
    }
static function browse( $args )
    {
        if ( count( $args ) < 2 )
        {
            throw new InvalidArgumentException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader', 'Arguments error.'
                )
            );
        }
        list( $nodeID, $classId ) = $args;
        $offset = 0;
        if ( isset( $args[2] ) )
        {
            $offset = (int) $args[2];
        }
        $node = eZContentObjectTreeNode::fetch( $nodeID );
        $class = eZContentClass::fetch( $classId );
        if ( !$node instanceof eZContentObjectTreeNode
                || !$class instanceof eZContentClass )
        {
            throw new InvalidArgumentException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader', 'Arguments error.'
                )
            );
        }
        else if ( !$node->canRead() )
        {
            throw new InvalidArgumentException(
                ezpI18n::tr(
                    'extension/ezjscore/ajaxuploader', 'Arguments error.'
                )
            );
        }
        $browseItems = self::getBrowseItems( $node, $class, $offset );

        $tpl = eZTemplate::factory();
        $tpl->setVariable( 'browse', $browseItems );
        $tpl->setVariable( 'browse_start', $node );
        $tpl->setVariable( 'default_parent_node', array( 'node_id' => 0 ) );
        $tpl->setVariable( 'class', $class );

        return array(
            'meta_data' => false,
            'html' => $tpl->fetch( 'design:ajaxuploader/browse.tpl' )
        );
    }
static function browse ( $ args ) { if ( count ( $ args ) < 2 ) { throw new InvalidArgumentException ( ezpI18n :: tr ( 'extension/ezjscore/ajaxuploader' , 'Arguments error.' ) ) ; } list ( $ nodeID , $ classId ) = $ args ; $ offset = 0 ; if ( isset ( $ args [ 2 ] ) ) { $ offset = ( int ) $ args [ 2 ] ; } $ node = eZContentObjectTreeNode :: fetch ( $ nodeID ) ; $ class = eZContentClass :: fetch ( $ classId ) ; if ( ! $ node instanceof eZContentObjectTreeNode || ! $ class instanceof eZContentClass ) { throw new InvalidArgumentException ( ezpI18n :: tr ( 'extension/ezjscore/ajaxuploader' , 'Arguments error.' ) ) ; } else if ( ! $ node -> canRead ( ) ) { throw new InvalidArgumentException ( ezpI18n :: tr ( 'extension/ezjscore/ajaxuploader' , 'Arguments error.' ) ) ; } $ browseItems = self :: getBrowseItems ( $ node , $ class , $ offset ) ; $ tpl = eZTemplate :: factory ( ) ; $ tpl -> setVariable ( 'browse' , $ browseItems ) ; $ tpl -> setVariable ( 'browse_start' , $ node ) ; $ tpl -> setVariable ( 'default_parent_node' , array ( 'node_id' => 0 ) ) ; $ tpl -> setVariable ( 'class' , $ class ) ; return array ( 'meta_data' => false , 'html' => $ tpl -> fetch ( 'design:ajaxuploader/browse.tpl' ) ) ; }
Browse AJAX action

@param array $args containing the following values:
- 0 the parent node id of the elements to display
- 1 the class id of the element that is going to be created
- 2 [optional] the offset
@return array
@throws InvalidArgumentException if the node or the class cannot be loaded
Browse AJAX action