This file is part of PhpRtf Lite. PhpRtf Lite is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. PhpRtf Lite is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with PhpRtf Lite. If not, see . */ /** * Class for creating footers of document. * @package Rtf */ class Footer extends Container { /**#@+ @access private */ var $type; var $headery; /**#@-*/ /** * Constructor. Internal use. * @param Rtf &$rtf * @param string $type * @access public */ function Footer(&$rtf, $type) { $this->rtf = &$rtf; switch ($type) { case 'all': $this->type = 'footer'; break; case 'left': $this->type = 'footerl'; break; case 'right': $this->type = 'footerr'; break; case 'first': $this->type = 'footerf'; break; } } /** * Set footer position from page bottom. * @param float $height * @access public */ function setPosition($height) { $this->footery = $height; } /** * Gets rtf code of footer. Internal use. * @return string * @access public */ function getContent() { $content = isSet($this->footery) ? '\footery'.round(TWIPS_IN_CM * $this->footery).' ' : ''; $content .= '{\\'.$this->type.' '; $content .= parent::getContent(); $content .= '\par '; $content .= '}'; return $content."\r\n"; } } ?>