Fixed some merge issues

This commit is contained in:
Gabriel Bull 2013-12-16 06:40:30 -05:00
parent 39e4dd2259
commit d09f0958c6
81 changed files with 3826 additions and 3675 deletions

61
Classes/PHPWord.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,9 +20,9 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/** PHPWORD_BASE_PATH */ /** PHPWORD_BASE_PATH */
@ -35,12 +35,9 @@ if(!defined('PHPWORD_BASE_PATH')) {
/** /**
* PHPWord * PHPWord
*
* @category PHPWord
* @package PHPWord
* @copyright Copyright (c) 2011 PHPWord
*/ */
class PHPWord { class PHPWord
{
/** /**
* Document properties * Document properties
@ -74,7 +71,8 @@ class PHPWord {
/** /**
* Create a new PHPWord Document * Create a new PHPWord Document
*/ */
public function __construct() { public function __construct()
{
$this->_properties = new PHPWord_DocumentProperties(); $this->_properties = new PHPWord_DocumentProperties();
$this->_defaultFontName = 'Arial'; $this->_defaultFontName = 'Arial';
$this->_defaultFontSize = 20; $this->_defaultFontSize = 20;
@ -84,7 +82,8 @@ class PHPWord {
* Get properties * Get properties
* @return PHPWord_DocumentProperties * @return PHPWord_DocumentProperties
*/ */
public function getProperties() { public function getProperties()
{
return $this->_properties; return $this->_properties;
} }
@ -94,7 +93,8 @@ class PHPWord {
* @param PHPWord_DocumentProperties $value * @param PHPWord_DocumentProperties $value
* @return PHPWord * @return PHPWord
*/ */
public function setProperties(PHPWord_DocumentProperties $value) { public function setProperties(PHPWord_DocumentProperties $value)
{
$this->_properties = $value; $this->_properties = $value;
return $this; return $this;
} }
@ -105,7 +105,8 @@ class PHPWord {
* @param PHPWord_Section_Settings $settings * @param PHPWord_Section_Settings $settings
* @return PHPWord_Section * @return PHPWord_Section
*/ */
public function createSection($settings = null) { public function createSection($settings = null)
{
$sectionCount = $this->_countSections() + 1; $sectionCount = $this->_countSections() + 1;
$section = new PHPWord_Section($sectionCount, $settings); $section = new PHPWord_Section($sectionCount, $settings);
@ -117,7 +118,8 @@ class PHPWord {
* Get default Font name * Get default Font name
* @return string * @return string
*/ */
public function getDefaultFontName() { public function getDefaultFontName()
{
return $this->_defaultFontName; return $this->_defaultFontName;
} }
@ -125,7 +127,8 @@ class PHPWord {
* Set default Font name * Set default Font name
* @param string $pValue * @param string $pValue
*/ */
public function setDefaultFontName($pValue) { public function setDefaultFontName($pValue)
{
$this->_defaultFontName = $pValue; $this->_defaultFontName = $pValue;
} }
@ -133,7 +136,8 @@ class PHPWord {
* Get default Font size * Get default Font size
* @return string * @return string
*/ */
public function getDefaultFontSize() { public function getDefaultFontSize()
{
return $this->_defaultFontSize; return $this->_defaultFontSize;
} }
@ -141,7 +145,8 @@ class PHPWord {
* Set default Font size * Set default Font size
* @param int $pValue * @param int $pValue
*/ */
public function setDefaultFontSize($pValue) { public function setDefaultFontSize($pValue)
{
$pValue = $pValue * 2; $pValue = $pValue * 2;
$this->_defaultFontSize = $pValue; $this->_defaultFontSize = $pValue;
} }
@ -152,7 +157,8 @@ class PHPWord {
* @param $styleName string * @param $styleName string
* @param $styles array * @param $styles array
*/ */
public function addParagraphStyle($styleName, $styles) { public function addParagraphStyle($styleName, $styles)
{
PHPWord_Style::addParagraphStyle($styleName, $styles); PHPWord_Style::addParagraphStyle($styleName, $styles);
} }
@ -162,7 +168,8 @@ class PHPWord {
* @param $styleName string * @param $styleName string
* @param $styles array * @param $styles array
*/ */
public function addFontStyle($styleName, $styleFont, $styleParagraph = null) { public function addFontStyle($styleName, $styleFont, $styleParagraph = null)
{
PHPWord_Style::addFontStyle($styleName, $styleFont, $styleParagraph); PHPWord_Style::addFontStyle($styleName, $styleFont, $styleParagraph);
} }
@ -172,7 +179,8 @@ class PHPWord {
* @param $styleName string * @param $styleName string
* @param $styles array * @param $styles array
*/ */
public function addTableStyle($styleName, $styleTable, $styleFirstRow = null) { public function addTableStyle($styleName, $styleTable, $styleFirstRow = null)
{
PHPWord_Style::addTableStyle($styleName, $styleTable, $styleFirstRow); PHPWord_Style::addTableStyle($styleName, $styleTable, $styleFirstRow);
} }
@ -182,7 +190,8 @@ class PHPWord {
* @param $titleCount int * @param $titleCount int
* @param $styles array * @param $styles array
*/ */
public function addTitleStyle($titleCount, $styleFont, $styleParagraph = null) { public function addTitleStyle($titleCount, $styleFont, $styleParagraph = null)
{
PHPWord_Style::addTitleStyle($titleCount, $styleFont, $styleParagraph); PHPWord_Style::addTitleStyle($titleCount, $styleFont, $styleParagraph);
} }
@ -192,7 +201,8 @@ class PHPWord {
* @param $styleName string * @param $styleName string
* @param $styles array * @param $styles array
*/ */
public function addLinkStyle($styleName, $styles) { public function addLinkStyle($styleName, $styles)
{
PHPWord_Style::addLinkStyle($styleName, $styles); PHPWord_Style::addLinkStyle($styleName, $styles);
} }
@ -200,7 +210,8 @@ class PHPWord {
* Get sections * Get sections
* @return PHPWord_Section[] * @return PHPWord_Section[]
*/ */
public function getSections() { public function getSections()
{
return $this->_sectionCollection; return $this->_sectionCollection;
} }
@ -208,7 +219,8 @@ class PHPWord {
* Get section count * Get section count
* @return int * @return int
*/ */
private function _countSections() { private function _countSections()
{
return count($this->_sectionCollection); return count($this->_sectionCollection);
} }
@ -218,7 +230,8 @@ class PHPWord {
* @param string $strFilename * @param string $strFilename
* @return PHPWord_Template * @return PHPWord_Template
*/ */
public function loadTemplate($strFilename) { public function loadTemplate($strFilename)
{
if (file_exists($strFilename)) { if (file_exists($strFilename)) {
$template = new PHPWord_Template($strFilename); $template = new PHPWord_Template($strFilename);
return $template; return $template;

View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

5
Classes/PHPWord/DocumentProperties.php Normal file → Executable file
View File

@ -20,14 +20,13 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */
/** /**
* PHPWord_DocumentProperties * Class PHPWord_DocumentProperties
*/ */
class PHPWord_DocumentProperties class PHPWord_DocumentProperties
{ {

17
Classes/PHPWord/Exception.php Normal file → Executable file
View File

@ -20,20 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2009 - 2010 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version 0.7.0
*/ */
/** /**
* PHPWord_Exception * Class PHPWord_Exception
*
* @category PHPWord
* @package PHPWord
* @copyright Copyright (c) 2006 - 2013 PHPWord (http://www.codeplex.com/PHPWord)
*/ */
class PHPWord_Exception extends Exception { class PHPWord_Exception extends Exception
{
/** /**
* Error handler callback * Error handler callback
* *
@ -43,7 +39,8 @@ class PHPWord_Exception extends Exception {
* @param mixed $line * @param mixed $line
* @param mixed $context * @param mixed $context
*/ */
public static function errorHandlerCallback($code, $string, $file, $line, $context) { public static function errorHandlerCallback($code, $string, $file, $line, $context)
{
$e = new self($string, $code); $e = new self($string, $code);
$e->line = $line; $e->line = $line;
$e->file = $file; $e->file = $file;

3
Classes/PHPWord/HashTable.php Normal file → Executable file
View File

@ -20,12 +20,11 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */
/** /**
* PHPWord_HashTable * PHPWord_HashTable
*/ */

2
Classes/PHPWord/IOFactory.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Media.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

77
Classes/PHPWord/Section.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,20 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/** /**
* PHPWord_Section * Class PHPWord_Section
*
* @category PHPWord
* @package PHPWord_Section
* @copyright Copyright (c) 2011 PHPWord
*/ */
class PHPWord_Section { class PHPWord_Section
{
/** /**
* Section count * Section count
@ -77,7 +73,8 @@ class PHPWord_Section {
* @param int $sectionCount * @param int $sectionCount
* @param mixed $settings * @param mixed $settings
*/ */
public function __construct($sectionCount, $settings = null) { public function __construct($sectionCount, $settings = null)
{
$this->_sectionCount = $sectionCount; $this->_sectionCount = $sectionCount;
$this->_settings = new PHPWord_Section_Settings(); $this->_settings = new PHPWord_Section_Settings();
@ -96,7 +93,8 @@ class PHPWord_Section {
* *
* @return PHPWord_Section_Settings * @return PHPWord_Section_Settings
*/ */
public function getSettings() { public function getSettings()
{
return $this->_settings; return $this->_settings;
} }
@ -108,7 +106,8 @@ class PHPWord_Section {
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PHPWord_Section_Text * @return PHPWord_Section_Text
*/ */
public function addText($text, $styleFont = null, $styleParagraph = null) { public function addText($text, $styleFont = null, $styleParagraph = null)
{
if (!PHPWord_Shared_String::IsUTF8($text)) { if (!PHPWord_Shared_String::IsUTF8($text)) {
$text = utf8_encode($text); $text = utf8_encode($text);
} }
@ -126,7 +125,8 @@ class PHPWord_Section {
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PHPWord_Section_Link * @return PHPWord_Section_Link
*/ */
public function addLink($linkSrc, $linkName = null, $styleFont = null, $styleParagraph = null) { public function addLink($linkSrc, $linkName = null, $styleFont = null, $styleParagraph = null)
{
if (!PHPWord_Shared_String::IsUTF8($linkSrc)) { if (!PHPWord_Shared_String::IsUTF8($linkSrc)) {
$linkSrc = utf8_encode($linkSrc); $linkSrc = utf8_encode($linkSrc);
} }
@ -149,7 +149,8 @@ class PHPWord_Section {
* *
* @param int $count * @param int $count
*/ */
public function addTextBreak($count = 1) { public function addTextBreak($count = 1)
{
for ($i = 1; $i <= $count; $i++) { for ($i = 1; $i <= $count; $i++) {
$this->_elementCollection[] = new PHPWord_Section_TextBreak(); $this->_elementCollection[] = new PHPWord_Section_TextBreak();
} }
@ -158,7 +159,8 @@ class PHPWord_Section {
/** /**
* Add a PageBreak Element * Add a PageBreak Element
*/ */
public function addPageBreak() { public function addPageBreak()
{
$this->_elementCollection[] = new PHPWord_Section_PageBreak(); $this->_elementCollection[] = new PHPWord_Section_PageBreak();
} }
@ -168,7 +170,8 @@ class PHPWord_Section {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Table * @return PHPWord_Section_Table
*/ */
public function addTable($style = null) { public function addTable($style = null)
{
$table = new PHPWord_Section_Table('section', $this->_sectionCount, $style); $table = new PHPWord_Section_Table('section', $this->_sectionCount, $style);
$this->_elementCollection[] = $table; $this->_elementCollection[] = $table;
return $table; return $table;
@ -184,7 +187,8 @@ class PHPWord_Section {
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PHPWord_Section_ListItem * @return PHPWord_Section_ListItem
*/ */
public function addListItem($text, $depth = 0, $styleFont = null, $styleList = null, $styleParagraph = null) { public function addListItem($text, $depth = 0, $styleFont = null, $styleList = null, $styleParagraph = null)
{
if (!PHPWord_Shared_String::IsUTF8($text)) { if (!PHPWord_Shared_String::IsUTF8($text)) {
$text = utf8_encode($text); $text = utf8_encode($text);
} }
@ -200,7 +204,8 @@ class PHPWord_Section {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Object * @return PHPWord_Section_Object
*/ */
public function addObject($src, $style = null) { public function addObject($src, $style = null)
{
$object = new PHPWord_Section_Object($src, $style); $object = new PHPWord_Section_Object($src, $style);
if (!is_null($object->getSource())) { if (!is_null($object->getSource())) {
@ -240,7 +245,8 @@ class PHPWord_Section {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Image * @return PHPWord_Section_Image
*/ */
public function addImage($src, $style = null) { public function addImage($src, $style = null)
{
$image = new PHPWord_Section_Image($src, $style); $image = new PHPWord_Section_Image($src, $style);
if (!is_null($image->getSource())) { if (!is_null($image->getSource())) {
@ -261,7 +267,8 @@ class PHPWord_Section {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_MemoryImage * @return PHPWord_Section_MemoryImage
*/ */
public function addMemoryImage($link, $style = null) { public function addMemoryImage($link, $style = null)
{
$memoryImage = new PHPWord_Section_MemoryImage($link, $style); $memoryImage = new PHPWord_Section_MemoryImage($link, $style);
if (!is_null($memoryImage->getSource())) { if (!is_null($memoryImage->getSource())) {
$rID = PHPWord_Media::addSectionMediaElement($link, 'image', $memoryImage); $rID = PHPWord_Media::addSectionMediaElement($link, 'image', $memoryImage);
@ -281,7 +288,8 @@ class PHPWord_Section {
* @param mixed $styleTOC * @param mixed $styleTOC
* @return PHPWord_TOC * @return PHPWord_TOC
*/ */
public function addTOC($styleFont = null, $styleTOC = null) { public function addTOC($styleFont = null, $styleTOC = null)
{
$toc = new PHPWord_TOC($styleFont, $styleTOC); $toc = new PHPWord_TOC($styleFont, $styleTOC);
$this->_elementCollection[] = $toc; $this->_elementCollection[] = $toc;
return $toc; return $toc;
@ -294,7 +302,8 @@ class PHPWord_Section {
* @param int $depth * @param int $depth
* @return PHPWord_Section_Title * @return PHPWord_Section_Title
*/ */
public function addTitle($text, $depth = 1) { public function addTitle($text, $depth = 1)
{
if (!PHPWord_Shared_String::IsUTF8($text)) { if (!PHPWord_Shared_String::IsUTF8($text)) {
$text = utf8_encode($text); $text = utf8_encode($text);
} }
@ -323,7 +332,8 @@ class PHPWord_Section {
* *
* @return PHPWord_Section_TextRun * @return PHPWord_Section_TextRun
*/ */
public function createTextRun($styleParagraph = null) { public function createTextRun($styleParagraph = null)
{
$textRun = new PHPWord_Section_TextRun($styleParagraph); $textRun = new PHPWord_Section_TextRun($styleParagraph);
$this->_elementCollection[] = $textRun; $this->_elementCollection[] = $textRun;
return $textRun; return $textRun;
@ -334,7 +344,8 @@ class PHPWord_Section {
* *
* @return array * @return array
*/ */
public function getElements() { public function getElements()
{
return $this->_elementCollection; return $this->_elementCollection;
} }
@ -343,7 +354,8 @@ class PHPWord_Section {
* *
* @return PHPWord_Section_Header * @return PHPWord_Section_Header
*/ */
public function createHeader() { public function createHeader()
{
$header = new PHPWord_Section_Header($this->_sectionCount); $header = new PHPWord_Section_Header($this->_sectionCount);
$this->_headers[] = $header; $this->_headers[] = $header;
return $header; return $header;
@ -354,7 +366,8 @@ class PHPWord_Section {
* *
* @return array * @return array
*/ */
public function getHeaders() { public function getHeaders()
{
return $this->_headers; return $this->_headers;
} }
@ -367,7 +380,8 @@ class PHPWord_Section {
* *
* @return Boolean * @return Boolean
*/ */
public function hasDifferentFirstPage() { public function hasDifferentFirstPage()
{
$value = array_filter($this->_headers, function (PHPWord_Section_Header &$header) { $value = array_filter($this->_headers, function (PHPWord_Section_Header &$header) {
return $header->getType() == PHPWord_Section_Header::FIRST; return $header->getType() == PHPWord_Section_Header::FIRST;
}); });
@ -379,7 +393,8 @@ class PHPWord_Section {
* *
* @return PHPWord_Section_Footer * @return PHPWord_Section_Footer
*/ */
public function createFooter() { public function createFooter()
{
$footer = new PHPWord_Section_Footer($this->_sectionCount); $footer = new PHPWord_Section_Footer($this->_sectionCount);
$this->_footer = $footer; $this->_footer = $footer;
return $footer; return $footer;
@ -390,8 +405,8 @@ class PHPWord_Section {
* *
* @return PHPWord_Section_Footer * @return PHPWord_Section_Footer
*/ */
public function getFooter() { public function getFooter()
{
return $this->_footer; return $this->_footer;
} }
} }
?>

51
Classes/PHPWord/Section/Footer.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,20 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/** /**
* PHPWord_Section_Footer * PHPWord_Section_Footer
*
* @category PHPWord
* @package PHPWord_Section
* @copyright Copyright (c) 2011 PHPWord
*/ */
class PHPWord_Section_Footer { class PHPWord_Section_Footer
{
/** /**
* Footer Count * Footer Count
@ -59,7 +55,8 @@ class PHPWord_Section_Footer {
/** /**
* Create a new Footer * Create a new Footer
*/ */
public function __construct($sectionCount) { public function __construct($sectionCount)
{
$this->_footerCount = $sectionCount; $this->_footerCount = $sectionCount;
} }
@ -71,7 +68,8 @@ class PHPWord_Section_Footer {
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PHPWord_Section_Text * @return PHPWord_Section_Text
*/ */
public function addText($text, $styleFont = null, $styleParagraph = null) { public function addText($text, $styleFont = null, $styleParagraph = null)
{
if (!PHPWord_Shared_String::IsUTF8($text)) { if (!PHPWord_Shared_String::IsUTF8($text)) {
$text = utf8_encode($text); $text = utf8_encode($text);
} }
@ -85,7 +83,8 @@ class PHPWord_Section_Footer {
* *
* @param int $count * @param int $count
*/ */
public function addTextBreak($count = 1) { public function addTextBreak($count = 1)
{
for ($i = 1; $i <= $count; $i++) { for ($i = 1; $i <= $count; $i++) {
$this->_elementCollection[] = new PHPWord_Section_TextBreak(); $this->_elementCollection[] = new PHPWord_Section_TextBreak();
} }
@ -96,7 +95,8 @@ class PHPWord_Section_Footer {
* *
* @return PHPWord_Section_TextRun * @return PHPWord_Section_TextRun
*/ */
public function createTextRun($styleParagraph = null) { public function createTextRun($styleParagraph = null)
{
$textRun = new PHPWord_Section_TextRun($styleParagraph); $textRun = new PHPWord_Section_TextRun($styleParagraph);
$this->_elementCollection[] = $textRun; $this->_elementCollection[] = $textRun;
return $textRun; return $textRun;
@ -108,7 +108,8 @@ class PHPWord_Section_Footer {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Table * @return PHPWord_Section_Table
*/ */
public function addTable($style = null) { public function addTable($style = null)
{
$table = new PHPWord_Section_Table('footer', $this->_footerCount, $style); $table = new PHPWord_Section_Table('footer', $this->_footerCount, $style);
$this->_elementCollection[] = $table; $this->_elementCollection[] = $table;
return $table; return $table;
@ -121,7 +122,8 @@ class PHPWord_Section_Footer {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Image * @return PHPWord_Section_Image
*/ */
public function addImage($src, $style = null) { public function addImage($src, $style = null)
{
$image = new PHPWord_Section_Image($src, $style); $image = new PHPWord_Section_Image($src, $style);
if (!is_null($image->getSource())) { if (!is_null($image->getSource())) {
@ -142,7 +144,8 @@ class PHPWord_Section_Footer {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_MemoryImage * @return PHPWord_Section_MemoryImage
*/ */
public function addMemoryImage($link, $style = null) { public function addMemoryImage($link, $style = null)
{
$memoryImage = new PHPWord_Section_MemoryImage($link, $style); $memoryImage = new PHPWord_Section_MemoryImage($link, $style);
if (!is_null($memoryImage->getSource())) { if (!is_null($memoryImage->getSource())) {
$rID = PHPWord_Media::addFooterMediaElement($this->_footerCount, $link, $memoryImage); $rID = PHPWord_Media::addFooterMediaElement($this->_footerCount, $link, $memoryImage);
@ -163,7 +166,8 @@ class PHPWord_Section_Footer {
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PHPWord_Section_Footer_PreserveText * @return PHPWord_Section_Footer_PreserveText
*/ */
public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { public function addPreserveText($text, $styleFont = null, $styleParagraph = null)
{
if (!PHPWord_Shared_String::IsUTF8($text)) { if (!PHPWord_Shared_String::IsUTF8($text)) {
$text = utf8_encode($text); $text = utf8_encode($text);
} }
@ -175,7 +179,8 @@ class PHPWord_Section_Footer {
/** /**
* Get Footer Relation ID * Get Footer Relation ID
*/ */
public function getRelationId() { public function getRelationId()
{
return $this->_rId; return $this->_rId;
} }
@ -184,22 +189,24 @@ class PHPWord_Section_Footer {
* *
* @param int $rId * @param int $rId
*/ */
public function setRelationId($rId) { public function setRelationId($rId)
{
$this->_rId = $rId; $this->_rId = $rId;
} }
/** /**
* Get all Footer Elements * Get all Footer Elements
*/ */
public function getElements() { public function getElements()
{
return $this->_elementCollection; return $this->_elementCollection;
} }
/** /**
* Get Footer Count * Get Footer Count
*/ */
public function getFooterCount() { public function getFooterCount()
{
return $this->_footerCount; return $this->_footerCount;
} }
} }
?>

2
Classes/PHPWord/Section/Footer/PreserveText.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

66
Classes/PHPWord/Section/Header.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,20 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/** /**
* PHPWord_Section_Header * PHPWord_Section_Header
*
* @category PHPWord
* @package PHPWord_Section
* @copyright Copyright (c) 2011 PHPWord
*/ */
class PHPWord_Section_Header { class PHPWord_Section_Header
{
/** /**
* Header Count * Header Count
@ -88,7 +84,8 @@ class PHPWord_Section_Header {
/** /**
* Create a new Header * Create a new Header
*/ */
public function __construct($sectionCount) { public function __construct($sectionCount)
{
$this->_headerCount = $sectionCount; $this->_headerCount = $sectionCount;
} }
@ -100,7 +97,8 @@ class PHPWord_Section_Header {
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PHPWord_Section_Text * @return PHPWord_Section_Text
*/ */
public function addText($text, $styleFont = null, $styleParagraph = null) { public function addText($text, $styleFont = null, $styleParagraph = null)
{
if (!PHPWord_Shared_String::IsUTF8($text)) { if (!PHPWord_Shared_String::IsUTF8($text)) {
$text = utf8_encode($text); $text = utf8_encode($text);
} }
@ -114,7 +112,8 @@ class PHPWord_Section_Header {
* *
* @param int $count * @param int $count
*/ */
public function addTextBreak($count = 1) { public function addTextBreak($count = 1)
{
for ($i = 1; $i <= $count; $i++) { for ($i = 1; $i <= $count; $i++) {
$this->_elementCollection[] = new PHPWord_Section_TextBreak(); $this->_elementCollection[] = new PHPWord_Section_TextBreak();
} }
@ -125,7 +124,8 @@ class PHPWord_Section_Header {
* *
* @return PHPWord_Section_TextRun * @return PHPWord_Section_TextRun
*/ */
public function createTextRun($styleParagraph = null) { public function createTextRun($styleParagraph = null)
{
$textRun = new PHPWord_Section_TextRun($styleParagraph); $textRun = new PHPWord_Section_TextRun($styleParagraph);
$this->_elementCollection[] = $textRun; $this->_elementCollection[] = $textRun;
return $textRun; return $textRun;
@ -137,7 +137,8 @@ class PHPWord_Section_Header {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Table * @return PHPWord_Section_Table
*/ */
public function addTable($style = null) { public function addTable($style = null)
{
$table = new PHPWord_Section_Table('header', $this->_headerCount, $style); $table = new PHPWord_Section_Table('header', $this->_headerCount, $style);
$this->_elementCollection[] = $table; $this->_elementCollection[] = $table;
return $table; return $table;
@ -150,7 +151,8 @@ class PHPWord_Section_Header {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Image * @return PHPWord_Section_Image
*/ */
public function addImage($src, $style = null) { public function addImage($src, $style = null)
{
$image = new PHPWord_Section_Image($src, $style); $image = new PHPWord_Section_Image($src, $style);
if (!is_null($image->getSource())) { if (!is_null($image->getSource())) {
@ -171,7 +173,8 @@ class PHPWord_Section_Header {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_MemoryImage * @return PHPWord_Section_MemoryImage
*/ */
public function addMemoryImage($link, $style = null) { public function addMemoryImage($link, $style = null)
{
$memoryImage = new PHPWord_Section_MemoryImage($link, $style); $memoryImage = new PHPWord_Section_MemoryImage($link, $style);
if (!is_null($memoryImage->getSource())) { if (!is_null($memoryImage->getSource())) {
$rID = PHPWord_Media::addHeaderMediaElement($this->_headerCount, $link, $memoryImage); $rID = PHPWord_Media::addHeaderMediaElement($this->_headerCount, $link, $memoryImage);
@ -192,7 +195,8 @@ class PHPWord_Section_Header {
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PHPWord_Section_Footer_PreserveText * @return PHPWord_Section_Footer_PreserveText
*/ */
public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { public function addPreserveText($text, $styleFont = null, $styleParagraph = null)
{
if (!PHPWord_Shared_String::IsUTF8($text)) { if (!PHPWord_Shared_String::IsUTF8($text)) {
$text = utf8_encode($text); $text = utf8_encode($text);
} }
@ -208,7 +212,8 @@ class PHPWord_Section_Header {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Image * @return PHPWord_Section_Image
*/ */
public function addWatermark($src, $style = null) { public function addWatermark($src, $style = null)
{
$image = new PHPWord_Section_Image($src, $style, true); $image = new PHPWord_Section_Image($src, $style, true);
if (!is_null($image->getSource())) { if (!is_null($image->getSource())) {
@ -225,7 +230,8 @@ class PHPWord_Section_Header {
/** /**
* Get Header Relation ID * Get Header Relation ID
*/ */
public function getRelationId() { public function getRelationId()
{
return $this->_rId; return $this->_rId;
} }
@ -234,51 +240,57 @@ class PHPWord_Section_Header {
* *
* @param int $rId * @param int $rId
*/ */
public function setRelationId($rId) { public function setRelationId($rId)
{
$this->_rId = $rId; $this->_rId = $rId;
} }
/** /**
* Get all Header Elements * Get all Header Elements
*/ */
public function getElements() { public function getElements()
{
return $this->_elementCollection; return $this->_elementCollection;
} }
/** /**
* Get Header Count * Get Header Count
*/ */
public function getHeaderCount() { public function getHeaderCount()
{
return $this->_headerCount; return $this->_headerCount;
} }
/** /**
* Get Header Type * Get Header Type
*/ */
public function getType() { public function getType()
{
return $this->_type; return $this->_type;
} }
/** /**
* Reset back to default * Reset back to default
*/ */
public function resetType() { public function resetType()
{
return $this->_type = PHPWord_Section_Header::AUTO; return $this->_type = PHPWord_Section_Header::AUTO;
} }
/** /**
* First page only header * First page only header
*/ */
public function firstPage() { public function firstPage()
{
return $this->_type = PHPWord_Section_Header::FIRST; return $this->_type = PHPWord_Section_Header::FIRST;
} }
/** /**
* Even numbered Pages only * Even numbered Pages only
*/ */
public function evenPage() { public function evenPage()
{
return $this->_type = PHPWord_Section_Header::EVEN; return $this->_type = PHPWord_Section_Header::EVEN;
} }
} }
?>

2
Classes/PHPWord/Section/Image.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Section/Link.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Section/ListItem.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Section/MemoryImage.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Section/Object.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Section/PageBreak.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Section/Settings.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Section/Table.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

54
Classes/PHPWord/Section/Table/Cell.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,20 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/** /**
* PHPWord_Section_Table_Cell * PHPWord_Section_Table_Cell
*
* @category PHPWord
* @package PHPWord_Section_Table
* @copyright Copyright (c) 2011 PHPWord
*/ */
class PHPWord_Section_Table_Cell { class PHPWord_Section_Table_Cell
{
/** /**
* Cell Width * Cell Width
@ -79,7 +75,8 @@ class PHPWord_Section_Table_Cell {
* @param int $width * @param int $width
* @param mixed $style * @param mixed $style
*/ */
public function __construct($insideOf, $pCount, $width = null, $style = null) { public function __construct($insideOf, $pCount, $width = null, $style = null)
{
$this->_insideOf = $insideOf; $this->_insideOf = $insideOf;
$this->_pCount = $pCount; $this->_pCount = $pCount;
$this->_width = $width; $this->_width = $width;
@ -107,7 +104,8 @@ class PHPWord_Section_Table_Cell {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Text * @return PHPWord_Section_Text
*/ */
public function addText($text, $styleFont = null, $styleParagraph = null) { public function addText($text, $styleFont = null, $styleParagraph = null)
{
if (!PHPWord_Shared_String::IsUTF8($text)) { if (!PHPWord_Shared_String::IsUTF8($text)) {
$text = utf8_encode($text); $text = utf8_encode($text);
} }
@ -124,7 +122,8 @@ class PHPWord_Section_Table_Cell {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Link * @return PHPWord_Section_Link
*/ */
public function addLink($linkSrc, $linkName = null, $style = null) { public function addLink($linkSrc, $linkName = null, $style = null)
{
if ($this->_insideOf == 'section') { if ($this->_insideOf == 'section') {
if (!PHPWord_Shared_String::IsUTF8($linkSrc)) { if (!PHPWord_Shared_String::IsUTF8($linkSrc)) {
$linkSrc = utf8_encode($linkSrc); $linkSrc = utf8_encode($linkSrc);
@ -152,7 +151,8 @@ class PHPWord_Section_Table_Cell {
* *
* @param int $count * @param int $count
*/ */
public function addTextBreak() { public function addTextBreak()
{
$this->_elementCollection[] = new PHPWord_Section_TextBreak(); $this->_elementCollection[] = new PHPWord_Section_TextBreak();
} }
@ -165,7 +165,8 @@ class PHPWord_Section_Table_Cell {
* @param mixed $styleList * @param mixed $styleList
* @return PHPWord_Section_ListItem * @return PHPWord_Section_ListItem
*/ */
public function addListItem($text, $depth = 0, $styleText = null, $styleList = null) { public function addListItem($text, $depth = 0, $styleText = null, $styleList = null)
{
if (!PHPWord_Shared_String::IsUTF8($text)) { if (!PHPWord_Shared_String::IsUTF8($text)) {
$text = utf8_encode($text); $text = utf8_encode($text);
} }
@ -181,7 +182,8 @@ class PHPWord_Section_Table_Cell {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Image * @return PHPWord_Section_Image
*/ */
public function addImage($src, $style = null) { public function addImage($src, $style = null)
{
$image = new PHPWord_Section_Image($src, $style); $image = new PHPWord_Section_Image($src, $style);
if (!is_null($image->getSource())) { if (!is_null($image->getSource())) {
@ -208,7 +210,8 @@ class PHPWord_Section_Table_Cell {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_MemoryImage * @return PHPWord_Section_MemoryImage
*/ */
public function addMemoryImage($link, $style = null) { public function addMemoryImage($link, $style = null)
{
$memoryImage = new PHPWord_Section_MemoryImage($link, $style); $memoryImage = new PHPWord_Section_MemoryImage($link, $style);
if (!is_null($memoryImage->getSource())) { if (!is_null($memoryImage->getSource())) {
if ($this->_insideOf == 'section') { if ($this->_insideOf == 'section') {
@ -234,7 +237,8 @@ class PHPWord_Section_Table_Cell {
* @param mixed $style * @param mixed $style
* @return PHPWord_Section_Object * @return PHPWord_Section_Object
*/ */
public function addObject($src, $style = null) { public function addObject($src, $style = null)
{
$object = new PHPWord_Section_Object($src, $style); $object = new PHPWord_Section_Object($src, $style);
if (!is_null($object->getSource())) { if (!is_null($object->getSource())) {
@ -275,7 +279,8 @@ class PHPWord_Section_Table_Cell {
* @param mixed $styleParagraph * @param mixed $styleParagraph
* @return PHPWord_Section_Footer_PreserveText * @return PHPWord_Section_Footer_PreserveText
*/ */
public function addPreserveText($text, $styleFont = null, $styleParagraph = null) { public function addPreserveText($text, $styleFont = null, $styleParagraph = null)
{
if ($this->_insideOf == 'footer' || $this->_insideOf == 'header') { if ($this->_insideOf == 'footer' || $this->_insideOf == 'header') {
if (!PHPWord_Shared_String::IsUTF8($text)) { if (!PHPWord_Shared_String::IsUTF8($text)) {
$text = utf8_encode($text); $text = utf8_encode($text);
@ -293,7 +298,8 @@ class PHPWord_Section_Table_Cell {
* *
* @return PHPWord_Section_TextRun * @return PHPWord_Section_TextRun
*/ */
public function createTextRun($styleParagraph = null) { public function createTextRun($styleParagraph = null)
{
$textRun = new PHPWord_Section_TextRun($styleParagraph); $textRun = new PHPWord_Section_TextRun($styleParagraph);
$this->_elementCollection[] = $textRun; $this->_elementCollection[] = $textRun;
return $textRun; return $textRun;
@ -304,7 +310,8 @@ class PHPWord_Section_Table_Cell {
* *
* @return array * @return array
*/ */
public function getElements() { public function getElements()
{
return $this->_elementCollection; return $this->_elementCollection;
} }
@ -313,7 +320,8 @@ class PHPWord_Section_Table_Cell {
* *
* @return PHPWord_Style_Cell * @return PHPWord_Style_Cell
*/ */
public function getStyle() { public function getStyle()
{
return $this->_style; return $this->_style;
} }
@ -322,8 +330,8 @@ class PHPWord_Section_Table_Cell {
* *
* @return int * @return int
*/ */
public function getWidth() { public function getWidth()
{
return $this->_width; return $this->_width;
} }
} }
?>

2
Classes/PHPWord/Section/Text.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Section/TextBreak.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

30
Classes/PHPWord/Section/TextRun.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,20 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/** /**
* PHPWord_Section_TextRun * PHPWord_Section_TextRun
*
* @category PHPWord
* @package PHPWord_Section
* @copyright Copyright (c) 2011 PHPWord
*/ */
class PHPWord_Section_TextRun { class PHPWord_Section_TextRun
{
/** /**
* Paragraph style * Paragraph style
@ -53,7 +49,8 @@ class PHPWord_Section_TextRun {
/** /**
* Create a new TextRun Element * Create a new TextRun Element
*/ */
public function __construct($styleParagraph = null) { public function __construct($styleParagraph = null)
{
$this->_elementCollection = array(); $this->_elementCollection = array();
// Set paragraph style // Set paragraph style
@ -79,7 +76,8 @@ class PHPWord_Section_TextRun {
* @var mixed $styleFont * @var mixed $styleFont
* @return PHPWord_Section_Text * @return PHPWord_Section_Text
*/ */
public function addText($text = null, $styleFont = null) { public function addText($text = null, $styleFont = null)
{
if (!PHPWord_Shared_String::IsUTF8($text)) { if (!PHPWord_Shared_String::IsUTF8($text)) {
$text = utf8_encode($text); $text = utf8_encode($text);
} }
@ -96,7 +94,8 @@ class PHPWord_Section_TextRun {
* @param mixed $styleFont * @param mixed $styleFont
* @return PHPWord_Section_Link * @return PHPWord_Section_Link
*/ */
public function addLink($linkSrc, $linkName = null, $styleFont = null) { public function addLink($linkSrc, $linkName = null, $styleFont = null)
{
$linkSrc = utf8_encode($linkSrc); $linkSrc = utf8_encode($linkSrc);
if (!is_null($linkName)) { if (!is_null($linkName)) {
$linkName = utf8_encode($linkName); $linkName = utf8_encode($linkName);
@ -115,7 +114,8 @@ class PHPWord_Section_TextRun {
* *
* @return string * @return string
*/ */
public function getElements() { public function getElements()
{
return $this->_elementCollection; return $this->_elementCollection;
} }
@ -124,8 +124,8 @@ class PHPWord_Section_TextRun {
* *
* @return PHPWord_Style_Paragraph * @return PHPWord_Style_Paragraph
*/ */
public function getParagraphStyle() { public function getParagraphStyle()
{
return $this->_styleParagraph; return $this->_styleParagraph;
} }
} }
?>

2
Classes/PHPWord/Section/Title.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Shared/Drawing.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Shared/File.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Shared/Font.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

25
Classes/PHPWord/Shared/String.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,12 +20,14 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/**
* Class PHPWord_Shared_String
*/
class PHPWord_Shared_String class PHPWord_Shared_String
{ {
/** /**
@ -52,7 +54,8 @@ class PHPWord_Shared_String
/** /**
* Build control characters array * Build control characters array
*/ */
private static function _buildControlCharacters() { private static function _buildControlCharacters()
{
for ($i = 0; $i <= 19; ++$i) { for ($i = 0; $i <= 19; ++$i) {
if ($i != 9 && $i != 10 && $i != 13) { if ($i != 9 && $i != 10 && $i != 13) {
$find = '_x' . sprintf('%04s', strtoupper(dechex($i))) . '_'; $find = '_x' . sprintf('%04s', strtoupper(dechex($i))) . '_';
@ -110,7 +113,8 @@ class PHPWord_Shared_String
* @param string $value Value to unescape * @param string $value Value to unescape
* @return string * @return string
*/ */
public static function ControlCharacterOOXML2PHP($value = '') { public static function ControlCharacterOOXML2PHP($value = '')
{
if (empty(self::$_controlCharacters)) { if (empty(self::$_controlCharacters)) {
self::_buildControlCharacters(); self::_buildControlCharacters();
} }
@ -132,7 +136,8 @@ class PHPWord_Shared_String
* @param string $value Value to escape * @param string $value Value to escape
* @return string * @return string
*/ */
public static function ControlCharacterPHP2OOXML($value = '') { public static function ControlCharacterPHP2OOXML($value = '')
{
if (empty(self::$_controlCharacters)) { if (empty(self::$_controlCharacters)) {
self::_buildControlCharacters(); self::_buildControlCharacters();
} }
@ -146,7 +151,8 @@ class PHPWord_Shared_String
* @param string $value * @param string $value
* @return boolean * @return boolean
*/ */
public static function IsUTF8($value = '') { public static function IsUTF8($value = '')
{
return $value === '' || preg_match('/^./su', $value) === 1; return $value === '' || preg_match('/^./su', $value) === 1;
} }
@ -156,7 +162,8 @@ class PHPWord_Shared_String
* @param mixed $value * @param mixed $value
* @return string * @return string
*/ */
public static function FormatNumber($value) { public static function FormatNumber($value)
{
return number_format($value, 2, '.', ''); return number_format($value, 2, '.', '');
} }

2
Classes/PHPWord/Shared/XMLWriter.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Shared/ZipStreamWrapper.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Style.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

117
Classes/PHPWord/Style/Cell.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,20 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/** /**
* PHPWord_Style_Cell * PHPWord_Style_Cell
*
* @category PHPWord
* @package PHPWord_Style
* @copyright Copyright (c) 2011 PHPWord
*/ */
class PHPWord_Style_Cell { class PHPWord_Style_Cell
{
const TEXT_DIR_BTLR = 'btLr'; const TEXT_DIR_BTLR = 'btLr';
const TEXT_DIR_TBRL = 'tbRl'; const TEXT_DIR_TBRL = 'tbRl';
@ -139,7 +135,8 @@ class PHPWord_Style_Cell {
/** /**
* Create a new Cell Style * Create a new Cell Style
*/ */
public function __construct() { public function __construct()
{
$this->_valign = null; $this->_valign = null;
$this->_textDirection = null; $this->_textDirection = null;
$this->_bgColor = null; $this->_bgColor = null;
@ -160,7 +157,8 @@ class PHPWord_Style_Cell {
* @var string $key * @var string $key
* @var mixed $value * @var mixed $value
*/ */
public function setStyleValue($key, $value) { public function setStyleValue($key, $value)
{
if ($key == '_borderSize') { if ($key == '_borderSize') {
$this->setBorderSize($value); $this->setBorderSize($value);
} elseif ($key == '_borderColor') { } elseif ($key == '_borderColor') {
@ -170,42 +168,51 @@ class PHPWord_Style_Cell {
} }
} }
public function getVAlign() { public function getVAlign()
{
return $this->_valign; return $this->_valign;
} }
public function setVAlign($pValue = null) { public function setVAlign($pValue = null)
{
$this->_valign = $pValue; $this->_valign = $pValue;
} }
public function getTextDirection() { public function getTextDirection()
{
return $this->_textDirection; return $this->_textDirection;
} }
public function setTextDirection($pValue = null) { public function setTextDirection($pValue = null)
{
$this->_textDirection = $pValue; $this->_textDirection = $pValue;
} }
public function getBgColor() { public function getBgColor()
{
return $this->_bgColor; return $this->_bgColor;
} }
public function setBgColor($pValue = null) { public function setBgColor($pValue = null)
{
$this->_bgColor = $pValue; $this->_bgColor = $pValue;
} }
public function setHeight($pValue = null) { public function setHeight($pValue = null)
{
$this->_height = $pValue; $this->_height = $pValue;
} }
public function setBorderSize($pValue = null) { public function setBorderSize($pValue = null)
{
$this->_borderTopSize = $pValue; $this->_borderTopSize = $pValue;
$this->_borderLeftSize = $pValue; $this->_borderLeftSize = $pValue;
$this->_borderRightSize = $pValue; $this->_borderRightSize = $pValue;
$this->_borderBottomSize = $pValue; $this->_borderBottomSize = $pValue;
} }
public function getBorderSize() { public function getBorderSize()
{
$t = $this->getBorderTopSize(); $t = $this->getBorderTopSize();
$l = $this->getBorderLeftSize(); $l = $this->getBorderLeftSize();
$r = $this->getBorderRightSize(); $r = $this->getBorderRightSize();
@ -214,14 +221,16 @@ class PHPWord_Style_Cell {
return array($t, $l, $r, $b); return array($t, $l, $r, $b);
} }
public function setBorderColor($pValue = null) { public function setBorderColor($pValue = null)
{
$this->_borderTopColor = $pValue; $this->_borderTopColor = $pValue;
$this->_borderLeftColor = $pValue; $this->_borderLeftColor = $pValue;
$this->_borderRightColor = $pValue; $this->_borderRightColor = $pValue;
$this->_borderBottomColor = $pValue; $this->_borderBottomColor = $pValue;
} }
public function getBorderColor() { public function getBorderColor()
{
$t = $this->getBorderTopColor(); $t = $this->getBorderTopColor();
$l = $this->getBorderLeftColor(); $l = $this->getBorderLeftColor();
$r = $this->getBorderRightColor(); $r = $this->getBorderRightColor();
@ -230,89 +239,109 @@ class PHPWord_Style_Cell {
return array($t, $l, $r, $b); return array($t, $l, $r, $b);
} }
public function setBorderTopSize($pValue = null) { public function setBorderTopSize($pValue = null)
{
$this->_borderTopSize = $pValue; $this->_borderTopSize = $pValue;
} }
public function getBorderTopSize() { public function getBorderTopSize()
{
return $this->_borderTopSize; return $this->_borderTopSize;
} }
public function setBorderTopColor($pValue = null) { public function setBorderTopColor($pValue = null)
{
$this->_borderTopColor = $pValue; $this->_borderTopColor = $pValue;
} }
public function getBorderTopColor() { public function getBorderTopColor()
{
return $this->_borderTopColor; return $this->_borderTopColor;
} }
public function setBorderLeftSize($pValue = null) { public function setBorderLeftSize($pValue = null)
{
$this->_borderLeftSize = $pValue; $this->_borderLeftSize = $pValue;
} }
public function getBorderLeftSize() { public function getBorderLeftSize()
{
return $this->_borderLeftSize; return $this->_borderLeftSize;
} }
public function setBorderLeftColor($pValue = null) { public function setBorderLeftColor($pValue = null)
{
$this->_borderLeftColor = $pValue; $this->_borderLeftColor = $pValue;
} }
public function getBorderLeftColor() { public function getBorderLeftColor()
{
return $this->_borderLeftColor; return $this->_borderLeftColor;
} }
public function setBorderRightSize($pValue = null) { public function setBorderRightSize($pValue = null)
{
$this->_borderRightSize = $pValue; $this->_borderRightSize = $pValue;
} }
public function getBorderRightSize() { public function getBorderRightSize()
{
return $this->_borderRightSize; return $this->_borderRightSize;
} }
public function setBorderRightColor($pValue = null) { public function setBorderRightColor($pValue = null)
{
$this->_borderRightColor = $pValue; $this->_borderRightColor = $pValue;
} }
public function getBorderRightColor() { public function getBorderRightColor()
{
return $this->_borderRightColor; return $this->_borderRightColor;
} }
public function setBorderBottomSize($pValue = null) { public function setBorderBottomSize($pValue = null)
{
$this->_borderBottomSize = $pValue; $this->_borderBottomSize = $pValue;
} }
public function getBorderBottomSize() { public function getBorderBottomSize()
{
return $this->_borderBottomSize; return $this->_borderBottomSize;
} }
public function setBorderBottomColor($pValue = null) { public function setBorderBottomColor($pValue = null)
{
$this->_borderBottomColor = $pValue; $this->_borderBottomColor = $pValue;
} }
public function getBorderBottomColor() { public function getBorderBottomColor()
{
return $this->_borderBottomColor; return $this->_borderBottomColor;
} }
public function getDefaultBorderColor() { public function getDefaultBorderColor()
{
return $this->_defaultBorderColor; return $this->_defaultBorderColor;
} }
public function setGridSpan($pValue = null) { public function setGridSpan($pValue = null)
{
$this->_gridSpan = $pValue; $this->_gridSpan = $pValue;
} }
public function getGridSpan() { public function getGridSpan()
{
return $this->_gridSpan; return $this->_gridSpan;
} }
public function setVMerge($pValue = null) { public function setVMerge($pValue = null)
{
$this->_vMerge = $pValue; $this->_vMerge = $pValue;
} }
public function getVMerge() { public function getVMerge()
{
return $this->_vMerge; return $this->_vMerge;
} }
} }
?>

2
Classes/PHPWord/Style/Font.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Style/Image.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Style/ListItem.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

54
Classes/PHPWord/Style/Paragraph.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,20 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/** /**
* PHPWord_Style_Paragraph * PHPWord_Style_Paragraph
*
* @category PHPWord
* @package PHPWord_Style
* @copyright Copyright (c) 2011 PHPWord
*/ */
class PHPWord_Style_Paragraph { class PHPWord_Style_Paragraph
{
/** /**
* Paragraph alignment * Paragraph alignment
@ -81,7 +77,8 @@ class PHPWord_Style_Paragraph {
/** /**
* New Paragraph Style * New Paragraph Style
*/ */
public function __construct() { public function __construct()
{
$this->_align = null; $this->_align = null;
$this->_spaceBefore = null; $this->_spaceBefore = null;
$this->_spaceAfter = null; $this->_spaceAfter = null;
@ -96,7 +93,8 @@ class PHPWord_Style_Paragraph {
* @param string $key * @param string $key
* @param mixed $value * @param mixed $value
*/ */
public function setStyleValue($key, $value) { public function setStyleValue($key, $value)
{
if ($key == '_indent') { if ($key == '_indent') {
$value = (int)$value * 720; // 720 twips per indent $value = (int)$value * 720; // 720 twips per indent
} }
@ -114,7 +112,8 @@ class PHPWord_Style_Paragraph {
* *
* @return string * @return string
*/ */
public function getAlign() { public function getAlign()
{
return $this->_align; return $this->_align;
} }
@ -124,7 +123,8 @@ class PHPWord_Style_Paragraph {
* @param string $pValue * @param string $pValue
* @return PHPWord_Style_Paragraph * @return PHPWord_Style_Paragraph
*/ */
public function setAlign($pValue = null) { public function setAlign($pValue = null)
{
if (strtolower($pValue) == 'justify') { if (strtolower($pValue) == 'justify') {
// justify becames both // justify becames both
$pValue = 'both'; $pValue = 'both';
@ -138,7 +138,8 @@ class PHPWord_Style_Paragraph {
* *
* @return string * @return string
*/ */
public function getSpaceBefore() { public function getSpaceBefore()
{
return $this->_spaceBefore; return $this->_spaceBefore;
} }
@ -148,7 +149,8 @@ class PHPWord_Style_Paragraph {
* @param int $pValue * @param int $pValue
* @return PHPWord_Style_Paragraph * @return PHPWord_Style_Paragraph
*/ */
public function setSpaceBefore($pValue = null) { public function setSpaceBefore($pValue = null)
{
$this->_spaceBefore = $pValue; $this->_spaceBefore = $pValue;
return $this; return $this;
} }
@ -158,7 +160,8 @@ class PHPWord_Style_Paragraph {
* *
* @return string * @return string
*/ */
public function getSpaceAfter() { public function getSpaceAfter()
{
return $this->_spaceAfter; return $this->_spaceAfter;
} }
@ -168,7 +171,8 @@ class PHPWord_Style_Paragraph {
* @param int $pValue * @param int $pValue
* @return PHPWord_Style_Paragraph * @return PHPWord_Style_Paragraph
*/ */
public function setSpaceAfter($pValue = null) { public function setSpaceAfter($pValue = null)
{
$this->_spaceAfter = $pValue; $this->_spaceAfter = $pValue;
return $this; return $this;
} }
@ -178,7 +182,8 @@ class PHPWord_Style_Paragraph {
* *
* @return int * @return int
*/ */
public function getSpacing() { public function getSpacing()
{
return $this->_spacing; return $this->_spacing;
} }
@ -188,7 +193,8 @@ class PHPWord_Style_Paragraph {
* @param int $pValue * @param int $pValue
* @return PHPWord_Style_Paragraph * @return PHPWord_Style_Paragraph
*/ */
public function setSpacing($pValue = null) { public function setSpacing($pValue = null)
{
$this->_spacing = $pValue; $this->_spacing = $pValue;
return $this; return $this;
} }
@ -198,7 +204,8 @@ class PHPWord_Style_Paragraph {
* *
* @return int * @return int
*/ */
public function getIndent() { public function getIndent()
{
return $this->_indent; return $this->_indent;
} }
@ -208,7 +215,8 @@ class PHPWord_Style_Paragraph {
* @param int $pValue * @param int $pValue
* @return PHPWord_Style_Paragraph * @return PHPWord_Style_Paragraph
*/ */
public function setIndent($pValue = null) { public function setIndent($pValue = null)
{
$this->_indent = $pValue; $this->_indent = $pValue;
return $this; return $this;
} }
@ -218,8 +226,8 @@ class PHPWord_Style_Paragraph {
* *
* @return PHPWord_Style_Tabs * @return PHPWord_Style_Tabs
*/ */
public function getTabs() { public function getTabs()
{
return $this->_tabs; return $this->_tabs;
} }
} }
?>

2
Classes/PHPWord/Style/TOC.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

27
Classes/PHPWord/Style/Tab.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,20 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version {something} * @version 0.7.0
*/ */
/** /**
* PHPWord_Style_Tabs * PHPWord_Style_Tabs
*
* @category PHPWord
* @package PHPWord_Style_Paragraph
* @copyright Copyright (c) 2011 PHPWord
* @link http://www.schemacentral.com/sc/ooxml/e-w_tab-1.html w:tab
*/ */
class PHPWord_Style_Tab { class PHPWord_Style_Tab
{
/** /**
* Tab Stop Type * Tab Stop Type
@ -96,7 +92,8 @@ class PHPWord_Style_Tab {
* @param int $position Must be an integer; otherwise defaults to 0. * @param int $position Must be an integer; otherwise defaults to 0.
* @param string $leader Defaults to NULL if value is not possible. * @param string $leader Defaults to NULL if value is not possible.
*/ */
public function __construct($val = NULL, $position = 0, $leader = NULL) { public function __construct($val = NULL, $position = 0, $leader = NULL)
{
// Default to clear if the stop type is not matched // Default to clear if the stop type is not matched
$this->_val = (self::isStopType($val)) ? $val : 'clear'; $this->_val = (self::isStopType($val)) ? $val : 'clear';
@ -112,7 +109,8 @@ class PHPWord_Style_Tab {
* *
* @param PHPWord_Shared_XMLWriter $objWriter * @param PHPWord_Shared_XMLWriter $objWriter
*/ */
public function toXml(PHPWord_Shared_XMLWriter &$objWriter = NULL) { public function toXml(PHPWord_Shared_XMLWriter &$objWriter = NULL)
{
if (isset($objWriter)) { if (isset($objWriter)) {
$objWriter->startElement("w:tab"); $objWriter->startElement("w:tab");
$objWriter->writeAttribute("w:val", $this->_val); $objWriter->writeAttribute("w:val", $this->_val);
@ -130,7 +128,8 @@ class PHPWord_Style_Tab {
* @param string $attribute * @param string $attribute
* @return bool True if it is; false otherwise. * @return bool True if it is; false otherwise.
*/ */
private static function isStopType($attribute) { private static function isStopType($attribute)
{
return in_array($attribute, self::$_possibleStopTypes); return in_array($attribute, self::$_possibleStopTypes);
} }
@ -140,8 +139,8 @@ class PHPWord_Style_Tab {
* @param string $attribute * @param string $attribute
* @return bool True if it is; false otherwise. * @return bool True if it is; false otherwise.
*/ */
private static function isLeaderType($attribute) { private static function isLeaderType($attribute)
{
return in_array($attribute, self::$_possibleLeaders); return in_array($attribute, self::$_possibleLeaders);
} }
} }
?>

2
Classes/PHPWord/Style/Table.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Style/TableFull.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

21
Classes/PHPWord/Style/Tabs.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,20 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version {something} * @version 0.7.0
*/ */
/** /**
* PHPWord_Style_Tabs * PHPWord_Style_Tabs
*
* @category PHPWord
* @package PHPWord_Style_Paragraph
* @copyright Copyright (c) 2011 PHPWord
* @link http://www.schemacentral.com/sc/ooxml/e-w_tabs-1.html w:tabs
*/ */
class PHPWord_Style_Tabs { class PHPWord_Style_Tabs
{
/** /**
* Tabs * Tabs
@ -46,7 +42,8 @@ class PHPWord_Style_Tabs {
* *
* @param array $tabs * @param array $tabs
*/ */
public function __construct(array $tabs) { public function __construct(array $tabs)
{
$this->_tabs = $tabs; $this->_tabs = $tabs;
} }
@ -54,7 +51,8 @@ class PHPWord_Style_Tabs {
* *
* @param PHPWord_Shared_XMLWriter $objWriter * @param PHPWord_Shared_XMLWriter $objWriter
*/ */
public function toXml(PHPWord_Shared_XMLWriter &$objWriter = NULL) { public function toXml(PHPWord_Shared_XMLWriter &$objWriter = NULL)
{
if (isset($objWriter)) { if (isset($objWriter)) {
$objWriter->startElement("w:tabs"); $objWriter->startElement("w:tabs");
foreach ($this->_tabs as &$tab) { foreach ($this->_tabs as &$tab) {
@ -64,4 +62,3 @@ class PHPWord_Style_Tabs {
} }
} }
} }
?>

2
Classes/PHPWord/TOC.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

24
Classes/PHPWord/Template.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,20 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/** /**
* PHPWord_DocumentProperties * PHPWord_DocumentProperties
*
* @category PHPWord
* @package PHPWord
* @copyright Copyright (c) 2009 - 2011 PHPWord (http://www.codeplex.com/PHPWord)
*/ */
class PHPWord_Template { class PHPWord_Template
{
/** /**
* ZipArchive * ZipArchive
@ -62,7 +58,8 @@ class PHPWord_Template {
* *
* @param string $strFilename * @param string $strFilename
*/ */
public function __construct($strFilename) { public function __construct($strFilename)
{
$this->_tempFileName = tempnam(sys_get_temp_dir(), ''); $this->_tempFileName = tempnam(sys_get_temp_dir(), '');
if ($this->_tempFileName !== false) { if ($this->_tempFileName !== false) {
// Copy the source File to the temp File // Copy the source File to the temp File
@ -85,7 +82,8 @@ class PHPWord_Template {
* @param mixed $search * @param mixed $search
* @param mixed $replace * @param mixed $replace
*/ */
public function setValue($search, $replace) { public function setValue($search, $replace)
{
$pattern = '|\$\{([^\}]+)\}|U'; $pattern = '|\$\{([^\}]+)\}|U';
preg_match_all($pattern, $this->_documentXML, $matches); preg_match_all($pattern, $this->_documentXML, $matches);
foreach ($matches[0] as $value) { foreach ($matches[0] as $value) {
@ -121,7 +119,8 @@ class PHPWord_Template {
* *
* @param string $strFilename * @param string $strFilename
*/ */
public function save($strFilename) { public function save($strFilename)
{
if (file_exists($strFilename)) { if (file_exists($strFilename)) {
unlink($strFilename); unlink($strFilename);
} }
@ -136,4 +135,3 @@ class PHPWord_Template {
rename($this->_tempFileName, $strFilename); rename($this->_tempFileName, $strFilename);
} }
} }
?>

2
Classes/PHPWord/Writer/IWriter.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

4
Classes/PHPWord/Writer/ODText.php Normal file → Executable file
View File

@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPWord * @category PHPWord
* @package PHPWord_Writer_PowerPoint2007 * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/ODText/Content.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/ODText/Manifest.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/ODText/Meta.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/ODText/Mimetype.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/ODText/Styles.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/ODText/WriterPart.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

4
Classes/PHPWord/Writer/RTF.php Normal file → Executable file
View File

@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPWord * @category PHPWord
* @package PHPWord_Writer_RTF * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

36
Classes/PHPWord/Writer/Word2007.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,13 +20,16 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/**
class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter { * Class PHPWord_Writer_Word2007
*/
class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter
{
private $_document; private $_document;
private $_writerParts; private $_writerParts;
@ -35,7 +38,8 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter {
private $_imageTypes = array(); private $_imageTypes = array();
private $_objectTypes = array(); private $_objectTypes = array();
public function __construct(PHPWord $PHPWord = null) { public function __construct(PHPWord $PHPWord = null)
{
$this->_document = $PHPWord; $this->_document = $PHPWord;
$this->_diskCachingDirectory = './'; $this->_diskCachingDirectory = './';
@ -54,7 +58,8 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter {
} }
} }
public function save($pFilename = null) { public function save($pFilename = null)
{
if (!is_null($this->_document)) { if (!is_null($this->_document)) {
// If $pFilename is php://output or php://stdout, make it a temporary file... // If $pFilename is php://output or php://stdout, make it a temporary file...
@ -107,7 +112,6 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter {
} }
$_cHdrs = 0; $_cHdrs = 0;
$_cFtrs = 0; $_cFtrs = 0;
$rID = PHPWord_Media::countSectionMediaElements() + 6; $rID = PHPWord_Media::countSectionMediaElements() + 6;
@ -169,7 +173,8 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter {
} }
} }
private function _chkContentTypes($src) { private function _chkContentTypes($src)
{
$srcInfo = pathinfo($src); $srcInfo = pathinfo($src);
$extension = strtolower($srcInfo['extension']); $extension = strtolower($srcInfo['extension']);
if (substr($extension, 0, 3) == 'php') { if (substr($extension, 0, 3) == 'php') {
@ -194,7 +199,8 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter {
} }
} }
public function getWriterPart($pPartName = '') { public function getWriterPart($pPartName = '')
{
if ($pPartName != '' && isset($this->_writerParts[strtolower($pPartName)])) { if ($pPartName != '' && isset($this->_writerParts[strtolower($pPartName)])) {
return $this->_writerParts[strtolower($pPartName)]; return $this->_writerParts[strtolower($pPartName)];
} else { } else {
@ -202,11 +208,13 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter {
} }
} }
public function getUseDiskCaching() { public function getUseDiskCaching()
{
return $this->_useDiskCaching; return $this->_useDiskCaching;
} }
public function setUseDiskCaching($pValue = false, $pDirectory = null) { public function setUseDiskCaching($pValue = false, $pDirectory = null)
{
$this->_useDiskCaching = $pValue; $this->_useDiskCaching = $pValue;
if (!is_null($pDirectory)) { if (!is_null($pDirectory)) {
@ -220,7 +228,8 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter {
return $this; return $this;
} }
private function _addFileToPackage($objZip, $element) { private function _addFileToPackage($objZip, $element)
{
if (isset($element['isMemImage']) && $element['isMemImage']) { if (isset($element['isMemImage']) && $element['isMemImage']) {
$image = call_user_func($element['createfunction'], $element['source']); $image = call_user_func($element['createfunction'], $element['source']);
ob_start(); ob_start();
@ -237,4 +246,3 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter {
} }
} }
} }
?>

111
Classes/PHPWord/Writer/Word2007/Base.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,15 +20,19 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/**
* Class PHPWord_Writer_Word2007_Base
*/
class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart
{
class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart { protected function _writeText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Text $text, $withoutP = false)
{
protected function _writeText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Text $text, $withoutP = false) {
$styleFont = $text->getFontStyle(); $styleFont = $text->getFontStyle();
$SfIsObject = ($styleFont instanceof PHPWord_Style_Font) ? true : false; $SfIsObject = ($styleFont instanceof PHPWord_Style_Font) ? true : false;
@ -77,7 +81,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
} }
} }
protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_TextRun $textrun) { protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_TextRun $textrun)
{
$elements = $textrun->getElements(); $elements = $textrun->getElements();
$styleParagraph = $textrun->getParagraphStyle(); $styleParagraph = $textrun->getParagraphStyle();
@ -108,7 +113,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
$objWriter->endElement(); $objWriter->endElement();
} }
protected function _writeParagraphStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Paragraph $style, $withoutPPR = false) { protected function _writeParagraphStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Paragraph $style, $withoutPPR = false)
{
$align = $style->getAlign(); $align = $style->getAlign();
$spaceBefore = $style->getSpaceBefore(); $spaceBefore = $style->getSpaceBefore();
$spaceAfter = $style->getSpaceAfter(); $spaceAfter = $style->getSpaceAfter();
@ -159,7 +165,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
} }
} }
protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Link $link, $withoutP = false) { protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Link $link, $withoutP = false)
{
$rID = $link->getRelationId(); $rID = $link->getRelationId();
$linkName = $link->getLinkName(); $linkName = $link->getLinkName();
if (is_null($linkName)) { if (is_null($linkName)) {
@ -214,7 +221,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
} }
} }
protected function _writePreserveText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footer_PreserveText $textrun) { protected function _writePreserveText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footer_PreserveText $textrun)
{
$styleFont = $textrun->getFontStyle(); $styleFont = $textrun->getFontStyle();
$styleParagraph = $textrun->getParagraphStyle(); $styleParagraph = $textrun->getParagraphStyle();
@ -302,7 +310,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
$objWriter->endElement(); // p $objWriter->endElement(); // p
} }
protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Font $style) { protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Font $style)
{
$font = $style->getName(); $font = $style->getName();
$bold = $style->getBold(); $bold = $style->getBold();
$italic = $style->getItalic(); $italic = $style->getItalic();
@ -373,11 +382,13 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
$objWriter->endElement(); $objWriter->endElement();
} }
protected function _writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = null) { protected function _writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = null)
{
$objWriter->writeElement('w:p', null); $objWriter->writeElement('w:p', null);
} }
protected function _writeTable(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Table $table) { protected function _writeTable(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Table $table)
{
$_rows = $table->getRows(); $_rows = $table->getRows();
$_cRows = count($_rows); $_cRows = count($_rows);
@ -443,7 +454,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
} elseif ($element instanceof PHPWord_Section_ListItem) { } elseif ($element instanceof PHPWord_Section_ListItem) {
$this->_writeListItem($objWriter, $element); $this->_writeListItem($objWriter, $element);
} elseif ($element instanceof PHPWord_Section_Image || } elseif ($element instanceof PHPWord_Section_Image ||
$element instanceof PHPWord_Section_MemoryImage) { $element instanceof PHPWord_Section_MemoryImage
) {
$this->_writeImage($objWriter, $element); $this->_writeImage($objWriter, $element);
} elseif ($element instanceof PHPWord_Section_Object) { } elseif ($element instanceof PHPWord_Section_Object) {
$this->_writeObject($objWriter, $element); $this->_writeObject($objWriter, $element);
@ -463,7 +475,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
} }
} }
protected function _writeTableStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Table $style = null) { protected function _writeTableStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Table $style = null)
{
$margins = $style->getCellMargin(); $margins = $style->getCellMargin();
$mTop = (!is_null($margins[0])) ? true : false; $mTop = (!is_null($margins[0])) ? true : false;
$mLeft = (!is_null($margins[1])) ? true : false; $mLeft = (!is_null($margins[1])) ? true : false;
@ -507,7 +520,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
} }
} }
protected function _writeCellStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Cell $style = null) { protected function _writeCellStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Cell $style = null)
{
$bgColor = $style->getBgColor(); $bgColor = $style->getBgColor();
$valign = $style->getVAlign(); $valign = $style->getVAlign();
$textDir = $style->getTextDirection(); $textDir = $style->getTextDirection();
@ -548,7 +562,9 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
$objWriter->startElement('w:tcBorders'); $objWriter->startElement('w:tcBorders');
if ($bTop) { if ($bTop) {
if(is_null($brdCol[0])) { $brdCol[0] = $_defaultColor; } if (is_null($brdCol[0])) {
$brdCol[0] = $_defaultColor;
}
$objWriter->startElement('w:top'); $objWriter->startElement('w:top');
$objWriter->writeAttribute('w:val', 'single'); $objWriter->writeAttribute('w:val', 'single');
$objWriter->writeAttribute('w:sz', $brdSz[0]); $objWriter->writeAttribute('w:sz', $brdSz[0]);
@ -557,7 +573,9 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
} }
if ($bLeft) { if ($bLeft) {
if(is_null($brdCol[1])) { $brdCol[1] = $_defaultColor; } if (is_null($brdCol[1])) {
$brdCol[1] = $_defaultColor;
}
$objWriter->startElement('w:left'); $objWriter->startElement('w:left');
$objWriter->writeAttribute('w:val', 'single'); $objWriter->writeAttribute('w:val', 'single');
$objWriter->writeAttribute('w:sz', $brdSz[1]); $objWriter->writeAttribute('w:sz', $brdSz[1]);
@ -566,7 +584,9 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
} }
if ($bRight) { if ($bRight) {
if(is_null($brdCol[2])) { $brdCol[2] = $_defaultColor; } if (is_null($brdCol[2])) {
$brdCol[2] = $_defaultColor;
}
$objWriter->startElement('w:right'); $objWriter->startElement('w:right');
$objWriter->writeAttribute('w:val', 'single'); $objWriter->writeAttribute('w:val', 'single');
$objWriter->writeAttribute('w:sz', $brdSz[2]); $objWriter->writeAttribute('w:sz', $brdSz[2]);
@ -575,7 +595,9 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
} }
if ($bBottom) { if ($bBottom) {
if(is_null($brdCol[3])) { $brdCol[3] = $_defaultColor; } if (is_null($brdCol[3])) {
$brdCol[3] = $_defaultColor;
}
$objWriter->startElement('w:bottom'); $objWriter->startElement('w:bottom');
$objWriter->writeAttribute('w:val', 'single'); $objWriter->writeAttribute('w:val', 'single');
$objWriter->writeAttribute('w:sz', $brdSz[3]); $objWriter->writeAttribute('w:sz', $brdSz[3]);
@ -601,13 +623,21 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
} }
} }
protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, $image) { /**
* @param \PHPWord_Shared_XMLWriter $objWriter
* @param \PHPWord_Section_Image $image
*/
protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Image $image)
{
$rId = $image->getRelationId(); $rId = $image->getRelationId();
$style = $image->getStyle(); $style = $image->getStyle();
$width = $style->getWidth(); $width = $style->getWidth();
$height = $style->getHeight(); $height = $style->getHeight();
$align = $style->getAlign(); $align = $style->getAlign();
$marginTop = $style->getMarginTop();
$marginLeft = $style->getMarginLeft();
$wrappingStyle = $style->getWrappingStyle();
$objWriter->startElement('w:p'); $objWriter->startElement('w:p');
@ -625,7 +655,37 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
$objWriter->startElement('v:shape'); $objWriter->startElement('v:shape');
$objWriter->writeAttribute('type', '#_x0000_t75'); $objWriter->writeAttribute('type', '#_x0000_t75');
$objWriter->writeAttribute('style', 'width:'.$width.'px;height:'.$height.'px');
$imgStyle = '';
if (null !== $width) {
$imgStyle .= 'width:' . $width . 'px;';
}
if (null !== $height) {
$imgStyle .= 'height:' . $height . 'px;';
}
if (null !== $marginTop) {
$imgStyle .= 'margin-top:' . $marginTop . 'in;';
}
if (null !== $marginLeft) {
$imgStyle .= 'margin-left:' . $marginLeft . 'in;';
}
switch ($wrappingStyle) {
case PHPWord_Style_Image::WRAPPING_STYLE_BEHIND:
$imgStyle .= 'position:absolute;z-index:-251658752;';
break;
case PHPWord_Style_Image::WRAPPING_STYLE_SQUARE:
$imgStyle .= 'position:absolute;z-index:251659264;mso-position-horizontal:absolute;mso-position-vertical:absolute;';
break;
case PHPWord_Style_Image::WRAPPING_STYLE_TIGHT:
$imgStyle .= 'position:absolute;z-index:251659264;mso-wrap-edited:f;mso-position-horizontal:absolute;mso-position-vertical:absolute';
break;
case PHPWord_Style_Image::WRAPPING_STYLE_INFRONT:
$imgStyle .= 'position:absolute;zz-index:251659264;mso-position-horizontal:absolute;mso-position-vertical:absolute;';
break;
}
$objWriter->writeAttribute('style', $imgStyle);
$objWriter->startElement('v:imagedata'); $objWriter->startElement('v:imagedata');
$objWriter->writeAttribute('r:id', 'rId' . $rId); $objWriter->writeAttribute('r:id', 'rId' . $rId);
@ -640,7 +700,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
$objWriter->endElement(); $objWriter->endElement();
} }
protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $image) { protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $image)
{
$rId = $image->getRelationId(); $rId = $image->getRelationId();
$style = $image->getStyle(); $style = $image->getStyle();
@ -683,7 +744,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
$objWriter->endElement(); $objWriter->endElement();
} }
protected function _writeTitle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Title $title) { protected function _writeTitle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Title $title)
{
$text = htmlspecialchars($title->getText()); $text = htmlspecialchars($title->getText());
$text = PHPWord_Shared_String::ControlCharacterPHP2OOXML($text); $text = PHPWord_Shared_String::ControlCharacterPHP2OOXML($text);
$anchor = $title->getAnchor(); $anchor = $title->getAnchor();
@ -724,4 +786,3 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
$objWriter->endElement(); $objWriter->endElement();
} }
} }
?>

2
Classes/PHPWord/Writer/Word2007/ContentTypes.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/Word2007/DocProps.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

37
Classes/PHPWord/Writer/Word2007/Document.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
/** /**
* PHPWord * PHPWord
* *
* Copyright (c) 2011 PHPWord * Copyright (c) 2013 PHPWord
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,15 +20,19 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 010 PHPWord * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version Beta 0.6.3, 08.07.2011 * @version 0.7.0
*/ */
/**
* Class PHPWord_Writer_Word2007_Document
*/
class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base
{
class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base { public function writeDocument(PHPWord $pPHPWord = null)
{
public function writeDocument(PHPWord $pPHPWord = null) {
// Create XML writer // Create XML writer
if ($this->getParentWriter()->getUseDiskCaching()) { if ($this->getParentWriter()->getUseDiskCaching()) {
@ -83,7 +87,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
} elseif ($element instanceof PHPWord_Section_ListItem) { } elseif ($element instanceof PHPWord_Section_ListItem) {
$this->_writeListItem($objWriter, $element); $this->_writeListItem($objWriter, $element);
} elseif ($element instanceof PHPWord_Section_Image || } elseif ($element instanceof PHPWord_Section_Image ||
$element instanceof PHPWord_Section_MemoryImage) { $element instanceof PHPWord_Section_MemoryImage
) {
$this->_writeImage($objWriter, $element); $this->_writeImage($objWriter, $element);
} elseif ($element instanceof PHPWord_Section_Object) { } elseif ($element instanceof PHPWord_Section_Object) {
$this->_writeObject($objWriter, $element); $this->_writeObject($objWriter, $element);
@ -107,7 +112,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
return $objWriter->getData(); return $objWriter->getData();
} }
private function _writeSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section) { private function _writeSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section)
{
$objWriter->startElement('w:p'); $objWriter->startElement('w:p');
$objWriter->startElement('w:pPr'); $objWriter->startElement('w:pPr');
$this->_writeEndSection($objWriter, $section, 3); $this->_writeEndSection($objWriter, $section, 3);
@ -115,7 +121,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
$objWriter->endElement(); $objWriter->endElement();
} }
private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section) { private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section)
{
$_settings = $section->getSettings(); $_settings = $section->getSettings();
$_headers = $section->getHeaders(); $_headers = $section->getHeaders();
$_footer = $section->getFooter(); $_footer = $section->getFooter();
@ -227,7 +234,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
$objWriter->endElement(); $objWriter->endElement();
} }
private function _writePageBreak(PHPWord_Shared_XMLWriter $objWriter = null) { private function _writePageBreak(PHPWord_Shared_XMLWriter $objWriter = null)
{
$objWriter->startElement('w:p'); $objWriter->startElement('w:p');
$objWriter->startElement('w:r'); $objWriter->startElement('w:r');
$objWriter->startElement('w:br'); $objWriter->startElement('w:br');
@ -237,7 +245,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
$objWriter->endElement(); $objWriter->endElement();
} }
private function _writeListItem(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_ListItem $listItem) { private function _writeListItem(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_ListItem $listItem)
{
$textObject = $listItem->getTextObject(); $textObject = $listItem->getTextObject();
$text = $textObject->getText(); $text = $textObject->getText();
$styleParagraph = $textObject->getParagraphStyle(); $styleParagraph = $textObject->getParagraphStyle();
@ -275,7 +284,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
$objWriter->endElement(); $objWriter->endElement();
} }
protected function _writeObject(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Object $object) { protected function _writeObject(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Object $object)
{
$rIdObject = $object->getRelationId(); $rIdObject = $object->getRelationId();
$rIdImage = $object->getImageRelationId(); $rIdImage = $object->getImageRelationId();
$shapeId = md5($rIdObject . '_' . $rIdImage); $shapeId = md5($rIdObject . '_' . $rIdImage);
@ -333,7 +343,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
$objWriter->endElement(); // w:p $objWriter->endElement(); // w:p
} }
private function _writeTOC(PHPWord_Shared_XMLWriter $objWriter = null) { private function _writeTOC(PHPWord_Shared_XMLWriter $objWriter = null)
{
$titles = PHPWord_TOC::getTitles(); $titles = PHPWord_TOC::getTitles();
$styleFont = PHPWord_TOC::getStyleFont(); $styleFont = PHPWord_TOC::getStyleFont();

2
Classes/PHPWord/Writer/Word2007/DocumentRels.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/Word2007/Footer.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/Word2007/Header.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/Word2007/Rels.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/Word2007/Styles.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
Classes/PHPWord/Writer/Word2007/WriterPart.php Normal file → Executable file
View File

@ -20,7 +20,7 @@
* *
* @category PHPWord * @category PHPWord
* @package PHPWord * @package PHPWord
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord) * @copyright Copyright (c) 2013 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.7.0 * @version 0.7.0
*/ */

2
README.md Normal file → Executable file
View File

@ -59,7 +59,7 @@ $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('helloWorld.docx'); $objWriter->save('helloWorld.docx');
``` ```
## Image ## Images
You can add images easily using the following example. You can add images easily using the following example.

5
changelog.txt Normal file → Executable file
View File

@ -22,7 +22,7 @@
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
************************************************************************************** **************************************************************************************
Fixed in branch for release 0.7 : Fixed in branch for release 0.7.0 :
- Bugfix: (RomanSyroeshko) GH-32 - "Warning: Invalid error type specified in ...\PHPWord.php on line 226" is thrown when the specified template file is not found - Bugfix: (RomanSyroeshko) GH-32 - "Warning: Invalid error type specified in ...\PHPWord.php on line 226" is thrown when the specified template file is not found
- Bugfix: (RomanSyroeshko) GH-34 - PHPWord_Shared_String.IsUTF8 returns FALSE for Cyrillic UTF-8 input - Bugfix: (RomanSyroeshko) GH-34 - PHPWord_Shared_String.IsUTF8 returns FALSE for Cyrillic UTF-8 input
- Bugfix: (RomanSyroeshko) GH-38 - Temporary files naming logic in PHPWord_Template can lead to a collision - Bugfix: (RomanSyroeshko) GH-38 - Temporary files naming logic in PHPWord_Template can lead to a collision
@ -38,5 +38,4 @@ Fixed in branch for release 0.7 :
- General: (Progi1984) - Added PHPWord_Exception and exception when could not copy the template - General: (Progi1984) - Added PHPWord_Exception and exception when could not copy the template
- General: (Progi1984) - IMPROVED : Moved examples out of Classes directory - General: (Progi1984) - IMPROVED : Moved examples out of Classes directory
- General: (Esmeraldo) CP-49 - IMPROVED : Advanced string replace in setValue for Template - General: (Esmeraldo) CP-49 - IMPROVED : Advanced string replace in setValue for Template
- Feature: (gavroche) Added composer file - Feature: (gavroche) - Added support for image wrapping style
- Feature: (gavroche) Added support for image wrapping style

1
samples/Sample_01_SimpleText.php Normal file → Executable file
View File

@ -49,4 +49,3 @@ echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 102
// Echo done // Echo done
echo date('H:i:s') , " Done writing file" , EOL; echo date('H:i:s') , " Done writing file" , EOL;
?>

1
samples/Sample_02_TabStops.php Normal file → Executable file
View File

@ -61,4 +61,3 @@ echo date('H:i:s') , ' Peak memory usage: ' , (memory_get_peak_usage(true) / 102
// Echo done // Echo done
echo date('H:i:s') , ' Done writing file' , EOL; echo date('H:i:s') , ' Done writing file' , EOL;
?>

1
samples/old/AdvancedTable.php Normal file → Executable file
View File

@ -50,4 +50,3 @@ for($i = 1; $i <= 10; $i++) {
// Save File // Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('AdvancedTable.docx'); $objWriter->save('AdvancedTable.docx');
?>

1
samples/old/BasicTable.php Normal file → Executable file
View File

@ -23,4 +23,3 @@ for($r = 1; $r <= 10; $r++) { // Loop through rows
// Save File // Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('BasicTable.docx'); $objWriter->save('BasicTable.docx');
?>

1
samples/old/HeaderFooter.php Normal file → Executable file
View File

@ -54,4 +54,3 @@ $section2->addText('Some text...');
// Save File // Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('HeaderFooter.docx'); $objWriter->save('HeaderFooter.docx');
?>

1
samples/old/Image.php Normal file → Executable file
View File

@ -21,4 +21,3 @@ $section->addImage('_mars.jpg', array('width'=>100, 'height'=>100, 'align'=>'rig
// Save File // Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('Image.docx'); $objWriter->save('Image.docx');
?>

1
samples/old/Link.php Normal file → Executable file
View File

@ -21,4 +21,3 @@ $section->addLink('http://www.yahoo.com', null, 'myOwnLinkStyle');
// Save File // Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('Link.docx'); $objWriter->save('Link.docx');
?>

1
samples/old/ListItem.php Normal file → Executable file
View File

@ -44,4 +44,3 @@ $section->addListItem('List Item 7', 0, 'myOwnStyle', $listStyle, 'P-Style');
// Save File // Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('ListItem.docx'); $objWriter->save('ListItem.docx');
?>

1
samples/old/Object.php Normal file → Executable file
View File

@ -17,4 +17,3 @@ $section->addObject('_sheet.xls');
// Save File // Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('Object.docx'); $objWriter->save('Object.docx');
?>

1
samples/old/Section.php Normal file → Executable file
View File

@ -23,4 +23,3 @@ $section->addText('This section uses other margins.');
// Save File // Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('Section.docx'); $objWriter->save('Section.docx');
?>

1
samples/old/Template.php Normal file → Executable file
View File

@ -20,4 +20,3 @@ $document->setValue('weekday', date('l'));
$document->setValue('time', date('H:i')); $document->setValue('time', date('H:i'));
$document->save('Solarsystem.docx'); $document->save('Solarsystem.docx');
?>

1
samples/old/Textrun.php Normal file → Executable file
View File

@ -29,4 +29,3 @@ $textrun->addLink('http://www.bing.com', null, 'NLink');
// Save File // Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('Textrun.docx'); $objWriter->save('Textrun.docx');
?>

1
samples/old/TitleTOC.php Normal file → Executable file
View File

@ -46,4 +46,3 @@ echo 'Note: The pagenumbers in the TOC doesnt refresh automatically.';
// Save File // Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('TitleTOC.docx'); $objWriter->save('TitleTOC.docx');
?>

1
samples/old/Watermark.php Normal file → Executable file
View File

@ -18,4 +18,3 @@ $section->addText('The header reference to the current section includes a waterm
// Save File // Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save('Watermark.docx'); $objWriter->save('Watermark.docx');
?>

2
test/PHPWord/Tests/ImageTest.php Normal file → Executable file
View File

@ -4,8 +4,6 @@ namespace PHPWord\Tests;
use PHPUnit_Framework_TestCase; use PHPUnit_Framework_TestCase;
use PHPWord; use PHPWord;
require_once __DIR__ . '/../../../src/PHPWord.php';
class ImageTest extends PHPUnit_Framework_TestCase class ImageTest extends PHPUnit_Framework_TestCase
{ {
public function tearDown() public function tearDown()

2
test/bootstrap.php Normal file → Executable file
View File

@ -2,7 +2,7 @@
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
require_once __DIR__ . "/../src/PHPWord/Autoloader.php"; require_once __DIR__ . "/../Classes/PHPWord/Autoloader.php";
PHPWord_Autoloader::Register(); PHPWord_Autoloader::Register();
require_once __DIR__ . "/PHPWord/TestHelper.php"; require_once __DIR__ . "/PHPWord/TestHelper.php";