Subversion Repositories enhancedezbinaryfile

[/] [datatypes/] [enhancedezbinaryfile/] [enhancedezbinaryfiletype.php] - Diff between revs 1 and 3

Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | View Log

Rev 1 Rev 3
Line 1... Line 1...
<?php
<?php
//
//
// Definition of EnhancedeZBinaryFileType class
// Definition of EnhancedeZBinaryFileType class
//
//
// SOFTWARE NAME: eZ Publish
// SOFTWARE NAME: eZ Publish
// SOFTWARE RELEASE: 4.0.1rc1
// SOFTWARE RELEASE: 4.1.0
// BUILD VERSION: 21995
// BUILD VERSION: 21995
// COPYRIGHT NOTICE: Copyright (C) 1999-2008 eZ Systems AS
// COPYRIGHT NOTICE: Copyright (C) 1999-2008 eZ Systems AS
// SOFTWARE LICENSE: GNU General Public License v2.0
// SOFTWARE LICENSE: GNU General Public License v2.0
// NOTICE: >
// NOTICE: >
//   This program is free software; you can redistribute it and/or
//   This program is free software; you can redistribute it and/or
Line 450... Line 450...
                                     "EnhancedeZBinaryFileType" );
                                     "EnhancedeZBinaryFileType" );
                return false;
                return false;
            }
            }
 
 
        //Adds xmltext to collection attribute with file info to data_text attribute
        //Adds xmltext to collection attribute with file info to data_text attribute
        $doc = new eZDOMDocument( 'FileInfo' );
        $doc = new DOMDocument( '1.0', 'utf-8' );
        $root = $doc->createElementNode( 'binaryfile-info' );
        $root = $doc->createElement( 'binaryfile-info' );
        $binaryFileList = $doc->createElementNode( 'binaryfile-attributes' );
        $binaryFileList = $doc->createElement( 'binaryfile-attributes' );
        foreach ( $binaryFile as $key => $binaryFileItem )
        foreach ( $binaryFile as $key => $binaryFileItem )
        {
        {
                $binaryFileElement[$key] = $doc->createElementNode( $key, array( 'value' => $binaryFileItem ) );
                $binaryFileElement = $doc->createElement(  $key, $binaryFileItem );
                $binaryFileList->appendChild( $binaryFileElement[$key] );
                $binaryFileList->appendChild( $binaryFileElement );
        }
        }
        $root->appendChild( $binaryFileList );
        $root->appendChild( $binaryFileList );
        $doc->setRoot( $root );
        $doc->appendChild( $root );
        $docText = EnhancedeZBinaryFileType::domString( $doc );
        $docText = EnhancedeZBinaryFileType::domString( $doc );
        $collectionAttribute->setAttribute( 'data_text', $docText );
        $collectionAttribute->setAttribute( 'data_text', $docText );
        }
        }
        return true;
        return true;
    }
    }
Line 565... Line 565...
       -2 (eZHTTPFile::UPLOADEDFILE_EXCEEDS_PHP_LIMIT) if the file was uploaded but size
       -2 (eZHTTPFile::UPLOADEDFILE_EXCEEDS_PHP_LIMIT) if the file was uploaded but size
          exceeds the upload_max_size limit (set in the PHP configuration),
          exceeds the upload_max_size limit (set in the PHP configuration),
       -3 (eZHTTPFile::UPLOADEDFILE_EXCEEDS_MAX_SIZE) if the file was uploaded but size
       -3 (eZHTTPFile::UPLOADEDFILE_EXCEEDS_MAX_SIZE) if the file was uploaded but size
          exceeds $maxSize or MAX_FILE_SIZE variable in the form.
          exceeds $maxSize or MAX_FILE_SIZE variable in the form.
    */
    */
    static function canFetch( $http_name, $maxSize = false )
    function canFetch( $http_name, $maxSize = false )
    {
    {
       if ( isset( $GLOBALS["eZHTTPFile-$http_name"] ) AND
       if ( isset( $GLOBALS["eZHTTPFile-$http_name"] ) AND
           $GLOBALS["eZHTTPFile-$http_name"] instanceof eZHTTPFile  )
           $GLOBALS["eZHTTPFile-$http_name"] instanceof eZHTTPFile  )
        {
        {
        //No idea why it's the opposite from ezHTTPFile::canfetch
        //No idea why it's the opposite from ezHTTPFile::canfetch
Line 634... Line 634...
            $charset = $xmlCharset;
            $charset = $xmlCharset;
        if ( $charset !== true )
        if ( $charset !== true )
        {
        {
            $charset = eZCharsetInfo::realCharsetCode( $charset );
            $charset = eZCharsetInfo::realCharsetCode( $charset );
        }
        }
        $domString = $domDocument->toString( $charset );
        $domString = $domDocument->saveXML();
        return $domString;
        return $domString;
    }
    }
 
 
    function metaData( $contentObjectAttribute )
    function metaData( $contentObjectAttribute )
    {
    {