lib/ezpdf/classes/class.ezpdf.php
function loadTemplate( $templateFile )
    {
        // this function will load the requested template ($file includes full or relative pathname)
        // the code for the template will be modified to make it name safe, and then stored in
        // an array for later use
        // The id of the template will be returned for the user to operate on it later
        if ( !file_exists( $templateFile ) )
        {
            return -1;
        }

        $code = implode( '', file( $templateFile ) );
        if ( !strlen( $code ) )
        {
            return;
        }

        $code = trim( $code );
        if ( substr( $code, 0, 5 ) == '<?php' )
        {
            $code = substr( $code, 5 );
        }
        if ( substr( $code, -2 ) == '?>' )
        {
            $code = substr( $code, 0, strlen( $code ) - 2 );
        }
        if ( isset( $this->ez['numTemplates'] ) )
        {
            $newNum = $this->ez['numTemplates'];
            $this->ez['numTemplates']++;
        }
        else
        {
            $newNum = 0;
            $this->ez['numTemplates'] = 1;
            $this->ez['templates'] = array();
        }

        $this->ez['templates'][$newNum]['code'] = $code;

        return $newNum;
    }
function loadTemplate( $templateFile )
    {
        // this function will load the requested template ($file includes full or relative pathname)
        // the code for the template will be modified to make it name safe, and then stored in
        // an array for later use
        // The id of the template will be returned for the user to operate on it later
        if ( !file_exists( $templateFile ) )
        {
            return -1;
        }

        $code = implode( '', file( $templateFile ) );
        if ( !strlen( $code ) )
        {
            return;
        }

        $code = trim( $code );
        if ( substr( $code, 0, 5 ) == '<?php' )
        {
            $code = substr( $code, 5 );
        }
        if ( substr( $code, -2 ) == '?>' )
        {
            $code = substr( $code, 0, strlen( $code ) - 2 );
        }
        if ( isset( $this->ez['numTemplates'] ) )
        {
            $newNum = $this->ez['numTemplates'];
            $this->ez['numTemplates']++;
        }
        else
        {
            $newNum = 0;
            $this->ez['numTemplates'] = 1;
            $this->ez['templates'] = array();
        }

        $this->ez['templates'][$newNum]['code'] = $code;

        return $newNum;
    }
function loadTemplate ( $ templateFile ) { // this function will load the requested template ($file includes full or relative pathname) // the code for the template will be modified to make it name safe, and then stored in // an array for later use // The id of the template will be returned for the user to operate on it later if ( ! file_exists ( $ templateFile ) ) { return - 1 ; } $ code = implode ( '' , file ( $ templateFile ) ) ; if ( ! strlen ( $ code ) ) { return ; } $ code = trim ( $ code ) ; if ( substr ( $ code , 0 , 5 ) == '<?php' ) { $ code = substr ( $ code , 5 ) ; } if ( substr ( $ code , - 2 ) == '?>' ) { $ code = substr ( $ code , 0 , strlen ( $ code ) - 2 ) ; } if ( isset ( $ this -> ez [ 'numTemplates' ] ) ) { $ newNum = $ this -> ez [ 'numTemplates' ] ; $ this -> ez [ 'numTemplates' ] ++ ; } else { $ newNum = 0 ; $ this -> ez [ 'numTemplates' ] = 1 ; $ this -> ez [ 'templates' ] = array ( ) ; } $ this -> ez [ 'templates' ] [ $ newNum ] [ 'code' ] = $ code ; return $ newNum ; }
out a good way of doing this yet.
out a good way of doing this yet .