Location: PHPKode > scripts > xmlSiteMaker > xmlsitemaker/include/Element/ElementFromFile.php
<?php

load_class( 'Element/Element.php' );
load_class( 'Content/Content.php' );


class ElementFromFile extends Element{

  var $objContent;

  function ElementFromFile( $arg ){
    $this->Element( $arg );
    $this->objContent = new Content();
  }

  function makeContent(){
    $this->content = $this->objContent->getContent( $this->params[ 'fileName' ] );
    if ( $this->isXmlFile( $this->params[ 'fileName' ] ) ){
      $this->deleteFirstLineFromContent();
    }
  }

  function isXmlFile( $fileName ){
    if ( strstr( $fileName, '.xml' ) ){
      return true;
    }
    else{
      return false;
    }
  }

  function deleteFirstLineFromContent(){
    $lines = explode( "\n", $this->content );
    array_shift( $lines );
    $this->content = join( "\n", $lines );
  }

} // end class

?>
Return current item: xmlSiteMaker