libraries/tbs/plugins/tbs_plugin_opentbs.php
function MsWord_GetHeaderFooterFile($TbsCmd, $TbsType, $Offset = 0) {

		$this->MsWord_InitHeaderFooter();

		$Place = 'header';
		if ($TbsCmd==OPENTBS_SELECT_FOOTER) {
			$Place = 'footer';
		}

		$Type = 'default';
		if ($TbsType==OPENTBS_FIRST) {
			$Type = 'first';
		} elseif ($TbsType==OPENTBS_EVEN) {
			$Type = 'even';
		}

		$nb = 0;
		foreach($this->MsWord_HeaderFooter as $info) {
			if ( ($info['type']==$Type) && ($info['place']==$Place) ) {
				if ($nb==$Offset) {
					return $info['file'];
				} else {
					$nb++;
				}
			}
		}
		
		return false;
		
	}
function MsWord_GetHeaderFooterFile($TbsCmd, $TbsType, $Offset = 0) {

		$this->MsWord_InitHeaderFooter();

		$Place = 'header';
		if ($TbsCmd==OPENTBS_SELECT_FOOTER) {
			$Place = 'footer';
		}

		$Type = 'default';
		if ($TbsType==OPENTBS_FIRST) {
			$Type = 'first';
		} elseif ($TbsType==OPENTBS_EVEN) {
			$Type = 'even';
		}

		$nb = 0;
		foreach($this->MsWord_HeaderFooter as $info) {
			if ( ($info['type']==$Type) && ($info['place']==$Place) ) {
				if ($nb==$Offset) {
					return $info['file'];
				} else {
					$nb++;
				}
			}
		}
		
		return false;
		
	}
function MsWord_GetHeaderFooterFile ( $ TbsCmd , $ TbsType , $ Offset = 0 ) { $ this -> MsWord_InitHeaderFooter ( ) ; $ Place = 'header' ; if ( $ TbsCmd == OPENTBS_SELECT_FOOTER ) { $ Place = 'footer' ; } $ Type = 'default' ; if ( $ TbsType == OPENTBS_FIRST ) { $ Type = 'first' ; } elseif ( $ TbsType == OPENTBS_EVEN ) { $ Type = 'even' ; } $ nb = 0 ; foreach ( $ this -> MsWord_HeaderFooter as $ info ) { if ( ( $ info [ 'type' ] == $ Type ) && ( $ info [ 'place' ] == $ Place ) ) { if ( $ nb == $ Offset ) { return $ info [ 'file' ] ; } else { $ nb ++ ; } } } return false ; }
Retrieve the header/footer sub-file.
@param mixed $TbsCmd  OPENTBS_SELECT_HEADER or OPENTBS_SELECT_FOOTER.
@param mixed $TbsType OPENTBS_DEFAULT, OPENTBS_FIRST or OPENTBS_EVEN.
@param int [$Offset] Since a DCX can have several sections, and each section can have its own header/footer, this options
@return mixed The name of the file of false if no file is found.
Retrieve the header / footer sub - file .