_xml; } /** * * @return CreateFooter * @access public * @static */ public static function getInstance() { if (self::$_instance == NULL) { self::$_instance = new CreateFooter(); } return self::$_instance; } /** * Create footer * * @access public * @param string args[0] * @param array args[1] */ public function createFooter() { $this->_xml = ''; $args = func_get_args(); $this->generateFTR(); if ($args[1]['pager'] == 'true') { $this->generateP(); $this->generateR(); $this->generatePTAB('margin', $args[1]['pagerAlignment']); $this->generateFLDSIMPLE(); } $text = CreateText::getInstance(); $text->createText($args[0], $args[1]); $obj = preg_replace('/__[A-Z]+__/', '', (string) $text); $xml = $obj . '__GENERATEFTR__'; $this->_xml = str_replace('__GENERATEFTR__', $xml, $this->_xml); } /** * Generate ftr token * * @access protected */ protected function generateFTR() { //$this->_xml = '__GENERATEFTR____GENERATEIMGFTR__'; $this->_xml = ''; } /** * Generate w:p * * @access protected */ protected function generateP() { $xml = '<' . CreateElement::NAMESPACEWORD . ':p>__GENERATEP____GENERATEFTR__'; $this->_xml = str_replace('__GENERATEFTR__', $xml, $this->_xml); } /** * Generate w:r * * @access protected */ protected function generateR() { if (!empty($this->_xml)) { if (preg_match("/__GENERATEP__/", $this->_xml)) { $xml = '<' . CreateElement::NAMESPACEWORD . ':r>__GENERATER____GENERATERSUB__'; $this->_xml = str_replace('__GENERATEP__', $xml, $this->_xml); } elseif (preg_match("/__GENERATER__/", $this->_xml)) { $xml = '<' . CreateElement::NAMESPACEWORD . ':r>__GENERATER____GENERATERSUB__'; $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml); } elseif (preg_match("/__GENERATERSUB__/", $this->_xml)) { $xml = '<' . CreateElement::NAMESPACEWORD . ':r>__GENERATER____GENERATERSUB__'; $this->_xml = str_replace( '__GENERATERSUB__', $xml, $this->_xml ); } } else { $this->_xml = '<' . CreateElement::NAMESPACEWORD . ':r>__GENERATER____GENERATERSUB__'; } } /** * Generate w:ptab * * @param string $relativeTo * @param string $alignment * @param string $leader * @access protected */ protected function generatePTAB($relativeTo = 'margin', $alignment = 'right', $leader = 'none') { $xml = '<' . CreateElement::NAMESPACEWORD . ':ptab ' . CreateElement::NAMESPACEWORD . ':relativeTo="' . $relativeTo . '" ' . CreateElement::NAMESPACEWORD . ':alignment="' . $alignment . '" ' . CreateElement::NAMESPACEWORD . ':leader="' . $leader . '">'; $this->_xml = str_replace('__GENERATER__', $xml, $this->_xml); } /** * Generate w:fldsimple * * @access protected */ protected function generateFLDSIMPLE() { $xml = '<' . CreateElement::NAMESPACEWORD . ':fldSimple ' . CreateElement::NAMESPACEWORD . ':instr=" PAGE \* MERGEFORMAT ">'; $this->_xml = str_replace('__GENERATERSUB__', $xml, $this->_xml); } }