static public function treeConfig( $args )
    {
        $returnArray = array(
            'status' => 'success',
            'message' => '',
            'config' => array(
                'hideRootTag' => false,
                'rootTag' => array()
            )
        );

        if ( !isset( $args[1] ) )
        {
            return $returnArray;
        }

        $attributeID = (int)$args[0];
        $version = (int)$args[1];

        $contentAttribute = eZContentObjectAttribute::fetch( $attributeID, $version );
        if ( !$contentAttribute instanceof eZContentObjectAttribute || $contentAttribute->attribute( 'data_type_string' ) !== 'eztags' )
        {
            return $returnArray;
        }

        $tagsIni = eZINI::instance( 'eztags.ini' );
        $classAttribute = $contentAttribute->attribute( 'contentclass_attribute' );
        $rootTagID = (int)$classAttribute->attribute( 'data_int1' );

        if ( $rootTagID > 0 )
        {
            $rootTag = eZTagsObject::fetch( $rootTagID );
            if ( !$rootTag instanceof eZTagsObject )
            {
                return $returnArray;
            }

            $returnArray['config']['rootTag'] = array(
                'id' => (int) $rootTag->attribute( 'id' ),
                'parent' => '#',
                'text' => $rootTag->attribute( 'keyword' ),
                'icon' => eZTagsTemplateFunctions::getTagIcon( $rootTag->getIcon() ),
                'children' => $rootTag->getChildrenCount() > 0 ? true : false,
                'a_attr' => array(
                    'data-id' => (int) $rootTag->attribute( 'id' ),
                    'data-name' => $rootTag->attribute( 'keyword' ),
                    'data-parent_id' => (int) $rootTag->attribute( 'parent_id' ),
                    'data-locale' => $rootTag->attribute( 'current_language' )
                ),
                'state' => array(
                    'opened' => true,
                    'selected' => false
                )
            );
        }
        else
        {
            $returnArray['config']['rootTag'] = array(
                'id' => 0,
                'parent' => '#',
                'text' => ezpI18n::tr( 'extension/eztags/tags/treemenu', 'Top level tags' ),
                'icon' => eZTagsTemplateFunctions::getTagIcon( $tagsIni->variable( 'Icons', 'Default' ) ),
                'children' => true,
                'state' => array(
                    'opened' => true,
                    'disabled' => true,
                    'selected' => false
                )
            );
        }

        $returnArray['config']['hideRootTag'] = (int)$classAttribute->attribute( 'data_int3' ) > 0;

        return $returnArray;
    }
static public function treeConfig( $args )
    {
        $returnArray = array(
            'status' => 'success',
            'message' => '',
            'config' => array(
                'hideRootTag' => false,
                'rootTag' => array()
            )
        );

        if ( !isset( $args[1] ) )
        {
            return $returnArray;
        }

        $attributeID = (int)$args[0];
        $version = (int)$args[1];

        $contentAttribute = eZContentObjectAttribute::fetch( $attributeID, $version );
        if ( !$contentAttribute instanceof eZContentObjectAttribute || $contentAttribute->attribute( 'data_type_string' ) !== 'eztags' )
        {
            return $returnArray;
        }

        $tagsIni = eZINI::instance( 'eztags.ini' );
        $classAttribute = $contentAttribute->attribute( 'contentclass_attribute' );
        $rootTagID = (int)$classAttribute->attribute( 'data_int1' );

        if ( $rootTagID > 0 )
        {
            $rootTag = eZTagsObject::fetch( $rootTagID );
            if ( !$rootTag instanceof eZTagsObject )
            {
                return $returnArray;
            }

            $returnArray['config']['rootTag'] = array(
                'id' => (int) $rootTag->attribute( 'id' ),
                'parent' => '#',
                'text' => $rootTag->attribute( 'keyword' ),
                'icon' => eZTagsTemplateFunctions::getTagIcon( $rootTag->getIcon() ),
                'children' => $rootTag->getChildrenCount() > 0 ? true : false,
                'a_attr' => array(
                    'data-id' => (int) $rootTag->attribute( 'id' ),
                    'data-name' => $rootTag->attribute( 'keyword' ),
                    'data-parent_id' => (int) $rootTag->attribute( 'parent_id' ),
                    'data-locale' => $rootTag->attribute( 'current_language' )
                ),
                'state' => array(
                    'opened' => true,
                    'selected' => false
                )
            );
        }
        else
        {
            $returnArray['config']['rootTag'] = array(
                'id' => 0,
                'parent' => '#',
                'text' => ezpI18n::tr( 'extension/eztags/tags/treemenu', 'Top level tags' ),
                'icon' => eZTagsTemplateFunctions::getTagIcon( $tagsIni->variable( 'Icons', 'Default' ) ),
                'children' => true,
                'state' => array(
                    'opened' => true,
                    'disabled' => true,
                    'selected' => false
                )
            );
        }

        $returnArray['config']['hideRootTag'] = (int)$classAttribute->attribute( 'data_int3' ) > 0;

        return $returnArray;
    }
static public function treeConfig ( $ args ) { $ returnArray = array ( 'status' => 'success' , 'message' => '' , 'config' => array ( 'hideRootTag' => false , 'rootTag' => array ( ) ) ) ; if ( ! isset ( $ args [ 1 ] ) ) { return $ returnArray ; } $ attributeID = ( int ) $ args [ 0 ] ; $ version = ( int ) $ args [ 1 ] ; $ contentAttribute = eZContentObjectAttribute :: fetch ( $ attributeID , $ version ) ; if ( ! $ contentAttribute instanceof eZContentObjectAttribute || $ contentAttribute -> attribute ( 'data_type_string' ) !== 'eztags' ) { return $ returnArray ; } $ tagsIni = eZINI :: instance ( 'eztags.ini' ) ; $ classAttribute = $ contentAttribute -> attribute ( 'contentclass_attribute' ) ; $ rootTagID = ( int ) $ classAttribute -> attribute ( 'data_int1' ) ; if ( $ rootTagID > 0 ) { $ rootTag = eZTagsObject :: fetch ( $ rootTagID ) ; if ( ! $ rootTag instanceof eZTagsObject ) { return $ returnArray ; } $ returnArray [ 'config' ] [ 'rootTag' ] = array ( 'id' => ( int ) $ rootTag -> attribute ( 'id' ) , 'parent' => '#' , 'text' => $ rootTag -> attribute ( 'keyword' ) , 'icon' => eZTagsTemplateFunctions :: getTagIcon ( $ rootTag -> getIcon ( ) ) , 'children' => $ rootTag -> getChildrenCount ( ) > 0 ? true : false , 'a_attr' => array ( 'data-id' => ( int ) $ rootTag -> attribute ( 'id' ) , 'data-name' => $ rootTag -> attribute ( 'keyword' ) , 'data-parent_id' => ( int ) $ rootTag -> attribute ( 'parent_id' ) , 'data-locale' => $ rootTag -> attribute ( 'current_language' ) ) , 'state' => array ( 'opened' => true , 'selected' => false ) ) ; } else { $ returnArray [ 'config' ] [ 'rootTag' ] = array ( 'id' => 0 , 'parent' => '#' , 'text' => ezpI18n :: tr ( 'extension/eztags/tags/treemenu' , 'Top level tags' ) , 'icon' => eZTagsTemplateFunctions :: getTagIcon ( $ tagsIni -> variable ( 'Icons' , 'Default' ) ) , 'children' => true , 'state' => array ( 'opened' => true , 'disabled' => true , 'selected' => false ) ) ; } $ returnArray [ 'config' ] [ 'hideRootTag' ] = ( int ) $ classAttribute -> attribute ( 'data_int3' ) > 0 ; return $ returnArray ; }
Returns config for tree view plugin

@static

@param array $args

@return array
Returns config for tree view plugin