コード例 #1
0
    /**
     * Figgure out if a custom tag is inline or not based on content.ini settings
     *
     * @param string $name Tag name
     * @return bool|string Return 'image' path if tag is inline image, otherwise true/false.
     */
    public static function customTagIsInline( $name )
    {
        if ( self::$customInlineTagList === null )
        {
            $ini = eZINI::instance( 'content.ini' );
            self::$customInlineTagList = $ini->variable( 'CustomTagSettings', 'IsInline' );
            self::$customInlineIconPath = $ini->hasVariable( 'CustomTagSettings', 'InlineImageIconPath' ) ?
                                          $ini->variable( 'CustomTagSettings', 'InlineImageIconPath' ) :
                                          array();
        }

        if ( isset( self::$customInlineTagList[ $name ] ) )
        {
            if ( self::$customInlineTagList[ $name ] === 'true' )
            {
                return true;
            }
            else if ( self::$customInlineTagList[ $name ] === 'image' )
            {
                if ( isset( self::$customInlineIconPath[ $name ] ) )
                    return self::$customInlineIconPath[ $name ];
                else
                    return 'images/tango/image-x-generic22.png';
            }
        }
        return false;
    }