Fixed some merge issues
This commit is contained in:
parent
39e4dd2259
commit
d09f0958c6
61
Classes/PHPWord.php
Normal file → Executable file
61
Classes/PHPWord.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,9 +20,9 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version Beta 0.6.3, 08.07.2011
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
/** PHPWORD_BASE_PATH */
|
||||
@ -35,12 +35,9 @@ if(!defined('PHPWORD_BASE_PATH')) {
|
||||
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* @category PHPWord
|
||||
* @package PHPWord
|
||||
* @copyright Copyright (c) 2011 PHPWord
|
||||
*/
|
||||
class PHPWord {
|
||||
class PHPWord
|
||||
{
|
||||
|
||||
/**
|
||||
* Document properties
|
||||
@ -74,7 +71,8 @@ class PHPWord {
|
||||
/**
|
||||
* Create a new PHPWord Document
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->_properties = new PHPWord_DocumentProperties();
|
||||
$this->_defaultFontName = 'Arial';
|
||||
$this->_defaultFontSize = 20;
|
||||
@ -84,7 +82,8 @@ class PHPWord {
|
||||
* Get properties
|
||||
* @return PHPWord_DocumentProperties
|
||||
*/
|
||||
public function getProperties() {
|
||||
public function getProperties()
|
||||
{
|
||||
return $this->_properties;
|
||||
}
|
||||
|
||||
@ -94,7 +93,8 @@ class PHPWord {
|
||||
* @param PHPWord_DocumentProperties $value
|
||||
* @return PHPWord
|
||||
*/
|
||||
public function setProperties(PHPWord_DocumentProperties $value) {
|
||||
public function setProperties(PHPWord_DocumentProperties $value)
|
||||
{
|
||||
$this->_properties = $value;
|
||||
return $this;
|
||||
}
|
||||
@ -105,7 +105,8 @@ class PHPWord {
|
||||
* @param PHPWord_Section_Settings $settings
|
||||
* @return PHPWord_Section
|
||||
*/
|
||||
public function createSection($settings = null) {
|
||||
public function createSection($settings = null)
|
||||
{
|
||||
$sectionCount = $this->_countSections() + 1;
|
||||
|
||||
$section = new PHPWord_Section($sectionCount, $settings);
|
||||
@ -117,7 +118,8 @@ class PHPWord {
|
||||
* Get default Font name
|
||||
* @return string
|
||||
*/
|
||||
public function getDefaultFontName() {
|
||||
public function getDefaultFontName()
|
||||
{
|
||||
return $this->_defaultFontName;
|
||||
}
|
||||
|
||||
@ -125,7 +127,8 @@ class PHPWord {
|
||||
* Set default Font name
|
||||
* @param string $pValue
|
||||
*/
|
||||
public function setDefaultFontName($pValue) {
|
||||
public function setDefaultFontName($pValue)
|
||||
{
|
||||
$this->_defaultFontName = $pValue;
|
||||
}
|
||||
|
||||
@ -133,7 +136,8 @@ class PHPWord {
|
||||
* Get default Font size
|
||||
* @return string
|
||||
*/
|
||||
public function getDefaultFontSize() {
|
||||
public function getDefaultFontSize()
|
||||
{
|
||||
return $this->_defaultFontSize;
|
||||
}
|
||||
|
||||
@ -141,7 +145,8 @@ class PHPWord {
|
||||
* Set default Font size
|
||||
* @param int $pValue
|
||||
*/
|
||||
public function setDefaultFontSize($pValue) {
|
||||
public function setDefaultFontSize($pValue)
|
||||
{
|
||||
$pValue = $pValue * 2;
|
||||
$this->_defaultFontSize = $pValue;
|
||||
}
|
||||
@ -152,7 +157,8 @@ class PHPWord {
|
||||
* @param $styleName string
|
||||
* @param $styles array
|
||||
*/
|
||||
public function addParagraphStyle($styleName, $styles) {
|
||||
public function addParagraphStyle($styleName, $styles)
|
||||
{
|
||||
PHPWord_Style::addParagraphStyle($styleName, $styles);
|
||||
}
|
||||
|
||||
@ -162,7 +168,8 @@ class PHPWord {
|
||||
* @param $styleName string
|
||||
* @param $styles array
|
||||
*/
|
||||
public function addFontStyle($styleName, $styleFont, $styleParagraph = null) {
|
||||
public function addFontStyle($styleName, $styleFont, $styleParagraph = null)
|
||||
{
|
||||
PHPWord_Style::addFontStyle($styleName, $styleFont, $styleParagraph);
|
||||
}
|
||||
|
||||
@ -172,7 +179,8 @@ class PHPWord {
|
||||
* @param $styleName string
|
||||
* @param $styles array
|
||||
*/
|
||||
public function addTableStyle($styleName, $styleTable, $styleFirstRow = null) {
|
||||
public function addTableStyle($styleName, $styleTable, $styleFirstRow = null)
|
||||
{
|
||||
PHPWord_Style::addTableStyle($styleName, $styleTable, $styleFirstRow);
|
||||
}
|
||||
|
||||
@ -182,7 +190,8 @@ class PHPWord {
|
||||
* @param $titleCount int
|
||||
* @param $styles array
|
||||
*/
|
||||
public function addTitleStyle($titleCount, $styleFont, $styleParagraph = null) {
|
||||
public function addTitleStyle($titleCount, $styleFont, $styleParagraph = null)
|
||||
{
|
||||
PHPWord_Style::addTitleStyle($titleCount, $styleFont, $styleParagraph);
|
||||
}
|
||||
|
||||
@ -192,7 +201,8 @@ class PHPWord {
|
||||
* @param $styleName string
|
||||
* @param $styles array
|
||||
*/
|
||||
public function addLinkStyle($styleName, $styles) {
|
||||
public function addLinkStyle($styleName, $styles)
|
||||
{
|
||||
PHPWord_Style::addLinkStyle($styleName, $styles);
|
||||
}
|
||||
|
||||
@ -200,7 +210,8 @@ class PHPWord {
|
||||
* Get sections
|
||||
* @return PHPWord_Section[]
|
||||
*/
|
||||
public function getSections() {
|
||||
public function getSections()
|
||||
{
|
||||
return $this->_sectionCollection;
|
||||
}
|
||||
|
||||
@ -208,7 +219,8 @@ class PHPWord {
|
||||
* Get section count
|
||||
* @return int
|
||||
*/
|
||||
private function _countSections() {
|
||||
private function _countSections()
|
||||
{
|
||||
return count($this->_sectionCollection);
|
||||
}
|
||||
|
||||
@ -218,7 +230,8 @@ class PHPWord {
|
||||
* @param string $strFilename
|
||||
* @return PHPWord_Template
|
||||
*/
|
||||
public function loadTemplate($strFilename) {
|
||||
public function loadTemplate($strFilename)
|
||||
{
|
||||
if (file_exists($strFilename)) {
|
||||
$template = new PHPWord_Template($strFilename);
|
||||
return $template;
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
5
Classes/PHPWord/DocumentProperties.php
Normal file → Executable file
5
Classes/PHPWord/DocumentProperties.php
Normal file → Executable file
@ -20,14 +20,13 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPWord_DocumentProperties
|
||||
* Class PHPWord_DocumentProperties
|
||||
*/
|
||||
class PHPWord_DocumentProperties
|
||||
{
|
||||
|
||||
17
Classes/PHPWord/Exception.php
Normal file → Executable file
17
Classes/PHPWord/Exception.php
Normal file → Executable file
@ -20,20 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version ##VERSION##, ##DATE##
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPWord_Exception
|
||||
*
|
||||
* @category PHPWord
|
||||
* @package PHPWord
|
||||
* @copyright Copyright (c) 2006 - 2013 PHPWord (http://www.codeplex.com/PHPWord)
|
||||
* Class PHPWord_Exception
|
||||
*/
|
||||
class PHPWord_Exception extends Exception {
|
||||
class PHPWord_Exception extends Exception
|
||||
{
|
||||
/**
|
||||
* Error handler callback
|
||||
*
|
||||
@ -43,7 +39,8 @@ class PHPWord_Exception extends Exception {
|
||||
* @param mixed $line
|
||||
* @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->line = $line;
|
||||
$e->file = $file;
|
||||
|
||||
3
Classes/PHPWord/HashTable.php
Normal file → Executable file
3
Classes/PHPWord/HashTable.php
Normal file → Executable file
@ -20,12 +20,11 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPWord_HashTable
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/IOFactory.php
Normal file → Executable file
2
Classes/PHPWord/IOFactory.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Media.php
Normal file → Executable file
2
Classes/PHPWord/Media.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
77
Classes/PHPWord/Section.php
Normal file → Executable file
77
Classes/PHPWord/Section.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,20 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version Beta 0.6.3, 08.07.2011
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPWord_Section
|
||||
*
|
||||
* @category PHPWord
|
||||
* @package PHPWord_Section
|
||||
* @copyright Copyright (c) 2011 PHPWord
|
||||
* Class PHPWord_Section
|
||||
*/
|
||||
class PHPWord_Section {
|
||||
class PHPWord_Section
|
||||
{
|
||||
|
||||
/**
|
||||
* Section count
|
||||
@ -77,7 +73,8 @@ class PHPWord_Section {
|
||||
* @param int $sectionCount
|
||||
* @param mixed $settings
|
||||
*/
|
||||
public function __construct($sectionCount, $settings = null) {
|
||||
public function __construct($sectionCount, $settings = null)
|
||||
{
|
||||
$this->_sectionCount = $sectionCount;
|
||||
$this->_settings = new PHPWord_Section_Settings();
|
||||
|
||||
@ -96,7 +93,8 @@ class PHPWord_Section {
|
||||
*
|
||||
* @return PHPWord_Section_Settings
|
||||
*/
|
||||
public function getSettings() {
|
||||
public function getSettings()
|
||||
{
|
||||
return $this->_settings;
|
||||
}
|
||||
|
||||
@ -108,7 +106,8 @@ class PHPWord_Section {
|
||||
* @param mixed $styleParagraph
|
||||
* @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)) {
|
||||
$text = utf8_encode($text);
|
||||
}
|
||||
@ -126,7 +125,8 @@ class PHPWord_Section {
|
||||
* @param mixed $styleParagraph
|
||||
* @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)) {
|
||||
$linkSrc = utf8_encode($linkSrc);
|
||||
}
|
||||
@ -149,7 +149,8 @@ class PHPWord_Section {
|
||||
*
|
||||
* @param int $count
|
||||
*/
|
||||
public function addTextBreak($count = 1) {
|
||||
public function addTextBreak($count = 1)
|
||||
{
|
||||
for ($i = 1; $i <= $count; $i++) {
|
||||
$this->_elementCollection[] = new PHPWord_Section_TextBreak();
|
||||
}
|
||||
@ -158,7 +159,8 @@ class PHPWord_Section {
|
||||
/**
|
||||
* Add a PageBreak Element
|
||||
*/
|
||||
public function addPageBreak() {
|
||||
public function addPageBreak()
|
||||
{
|
||||
$this->_elementCollection[] = new PHPWord_Section_PageBreak();
|
||||
}
|
||||
|
||||
@ -168,7 +170,8 @@ class PHPWord_Section {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_Table
|
||||
*/
|
||||
public function addTable($style = null) {
|
||||
public function addTable($style = null)
|
||||
{
|
||||
$table = new PHPWord_Section_Table('section', $this->_sectionCount, $style);
|
||||
$this->_elementCollection[] = $table;
|
||||
return $table;
|
||||
@ -184,7 +187,8 @@ class PHPWord_Section {
|
||||
* @param mixed $styleParagraph
|
||||
* @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)) {
|
||||
$text = utf8_encode($text);
|
||||
}
|
||||
@ -200,7 +204,8 @@ class PHPWord_Section {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_Object
|
||||
*/
|
||||
public function addObject($src, $style = null) {
|
||||
public function addObject($src, $style = null)
|
||||
{
|
||||
$object = new PHPWord_Section_Object($src, $style);
|
||||
|
||||
if (!is_null($object->getSource())) {
|
||||
@ -240,7 +245,8 @@ class PHPWord_Section {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_Image
|
||||
*/
|
||||
public function addImage($src, $style = null) {
|
||||
public function addImage($src, $style = null)
|
||||
{
|
||||
$image = new PHPWord_Section_Image($src, $style);
|
||||
|
||||
if (!is_null($image->getSource())) {
|
||||
@ -261,7 +267,8 @@ class PHPWord_Section {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_MemoryImage
|
||||
*/
|
||||
public function addMemoryImage($link, $style = null) {
|
||||
public function addMemoryImage($link, $style = null)
|
||||
{
|
||||
$memoryImage = new PHPWord_Section_MemoryImage($link, $style);
|
||||
if (!is_null($memoryImage->getSource())) {
|
||||
$rID = PHPWord_Media::addSectionMediaElement($link, 'image', $memoryImage);
|
||||
@ -281,7 +288,8 @@ class PHPWord_Section {
|
||||
* @param mixed $styleTOC
|
||||
* @return PHPWord_TOC
|
||||
*/
|
||||
public function addTOC($styleFont = null, $styleTOC = null) {
|
||||
public function addTOC($styleFont = null, $styleTOC = null)
|
||||
{
|
||||
$toc = new PHPWord_TOC($styleFont, $styleTOC);
|
||||
$this->_elementCollection[] = $toc;
|
||||
return $toc;
|
||||
@ -294,7 +302,8 @@ class PHPWord_Section {
|
||||
* @param int $depth
|
||||
* @return PHPWord_Section_Title
|
||||
*/
|
||||
public function addTitle($text, $depth = 1) {
|
||||
public function addTitle($text, $depth = 1)
|
||||
{
|
||||
if (!PHPWord_Shared_String::IsUTF8($text)) {
|
||||
$text = utf8_encode($text);
|
||||
}
|
||||
@ -323,7 +332,8 @@ class PHPWord_Section {
|
||||
*
|
||||
* @return PHPWord_Section_TextRun
|
||||
*/
|
||||
public function createTextRun($styleParagraph = null) {
|
||||
public function createTextRun($styleParagraph = null)
|
||||
{
|
||||
$textRun = new PHPWord_Section_TextRun($styleParagraph);
|
||||
$this->_elementCollection[] = $textRun;
|
||||
return $textRun;
|
||||
@ -334,7 +344,8 @@ class PHPWord_Section {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getElements() {
|
||||
public function getElements()
|
||||
{
|
||||
return $this->_elementCollection;
|
||||
}
|
||||
|
||||
@ -343,7 +354,8 @@ class PHPWord_Section {
|
||||
*
|
||||
* @return PHPWord_Section_Header
|
||||
*/
|
||||
public function createHeader() {
|
||||
public function createHeader()
|
||||
{
|
||||
$header = new PHPWord_Section_Header($this->_sectionCount);
|
||||
$this->_headers[] = $header;
|
||||
return $header;
|
||||
@ -354,7 +366,8 @@ class PHPWord_Section {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getHeaders() {
|
||||
public function getHeaders()
|
||||
{
|
||||
return $this->_headers;
|
||||
}
|
||||
|
||||
@ -367,7 +380,8 @@ class PHPWord_Section {
|
||||
*
|
||||
* @return Boolean
|
||||
*/
|
||||
public function hasDifferentFirstPage() {
|
||||
public function hasDifferentFirstPage()
|
||||
{
|
||||
$value = array_filter($this->_headers, function (PHPWord_Section_Header &$header) {
|
||||
return $header->getType() == PHPWord_Section_Header::FIRST;
|
||||
});
|
||||
@ -379,7 +393,8 @@ class PHPWord_Section {
|
||||
*
|
||||
* @return PHPWord_Section_Footer
|
||||
*/
|
||||
public function createFooter() {
|
||||
public function createFooter()
|
||||
{
|
||||
$footer = new PHPWord_Section_Footer($this->_sectionCount);
|
||||
$this->_footer = $footer;
|
||||
return $footer;
|
||||
@ -390,8 +405,8 @@ class PHPWord_Section {
|
||||
*
|
||||
* @return PHPWord_Section_Footer
|
||||
*/
|
||||
public function getFooter() {
|
||||
public function getFooter()
|
||||
{
|
||||
return $this->_footer;
|
||||
}
|
||||
}
|
||||
?>
|
||||
51
Classes/PHPWord/Section/Footer.php
Normal file → Executable file
51
Classes/PHPWord/Section/Footer.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,20 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version Beta 0.6.3, 08.07.2011
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPWord_Section_Footer
|
||||
*
|
||||
* @category PHPWord
|
||||
* @package PHPWord_Section
|
||||
* @copyright Copyright (c) 2011 PHPWord
|
||||
*/
|
||||
class PHPWord_Section_Footer {
|
||||
class PHPWord_Section_Footer
|
||||
{
|
||||
|
||||
/**
|
||||
* Footer Count
|
||||
@ -59,7 +55,8 @@ class PHPWord_Section_Footer {
|
||||
/**
|
||||
* Create a new Footer
|
||||
*/
|
||||
public function __construct($sectionCount) {
|
||||
public function __construct($sectionCount)
|
||||
{
|
||||
$this->_footerCount = $sectionCount;
|
||||
}
|
||||
|
||||
@ -71,7 +68,8 @@ class PHPWord_Section_Footer {
|
||||
* @param mixed $styleParagraph
|
||||
* @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)) {
|
||||
$text = utf8_encode($text);
|
||||
}
|
||||
@ -85,7 +83,8 @@ class PHPWord_Section_Footer {
|
||||
*
|
||||
* @param int $count
|
||||
*/
|
||||
public function addTextBreak($count = 1) {
|
||||
public function addTextBreak($count = 1)
|
||||
{
|
||||
for ($i = 1; $i <= $count; $i++) {
|
||||
$this->_elementCollection[] = new PHPWord_Section_TextBreak();
|
||||
}
|
||||
@ -96,7 +95,8 @@ class PHPWord_Section_Footer {
|
||||
*
|
||||
* @return PHPWord_Section_TextRun
|
||||
*/
|
||||
public function createTextRun($styleParagraph = null) {
|
||||
public function createTextRun($styleParagraph = null)
|
||||
{
|
||||
$textRun = new PHPWord_Section_TextRun($styleParagraph);
|
||||
$this->_elementCollection[] = $textRun;
|
||||
return $textRun;
|
||||
@ -108,7 +108,8 @@ class PHPWord_Section_Footer {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_Table
|
||||
*/
|
||||
public function addTable($style = null) {
|
||||
public function addTable($style = null)
|
||||
{
|
||||
$table = new PHPWord_Section_Table('footer', $this->_footerCount, $style);
|
||||
$this->_elementCollection[] = $table;
|
||||
return $table;
|
||||
@ -121,7 +122,8 @@ class PHPWord_Section_Footer {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_Image
|
||||
*/
|
||||
public function addImage($src, $style = null) {
|
||||
public function addImage($src, $style = null)
|
||||
{
|
||||
$image = new PHPWord_Section_Image($src, $style);
|
||||
|
||||
if (!is_null($image->getSource())) {
|
||||
@ -142,7 +144,8 @@ class PHPWord_Section_Footer {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_MemoryImage
|
||||
*/
|
||||
public function addMemoryImage($link, $style = null) {
|
||||
public function addMemoryImage($link, $style = null)
|
||||
{
|
||||
$memoryImage = new PHPWord_Section_MemoryImage($link, $style);
|
||||
if (!is_null($memoryImage->getSource())) {
|
||||
$rID = PHPWord_Media::addFooterMediaElement($this->_footerCount, $link, $memoryImage);
|
||||
@ -163,7 +166,8 @@ class PHPWord_Section_Footer {
|
||||
* @param mixed $styleParagraph
|
||||
* @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)) {
|
||||
$text = utf8_encode($text);
|
||||
}
|
||||
@ -175,7 +179,8 @@ class PHPWord_Section_Footer {
|
||||
/**
|
||||
* Get Footer Relation ID
|
||||
*/
|
||||
public function getRelationId() {
|
||||
public function getRelationId()
|
||||
{
|
||||
return $this->_rId;
|
||||
}
|
||||
|
||||
@ -184,22 +189,24 @@ class PHPWord_Section_Footer {
|
||||
*
|
||||
* @param int $rId
|
||||
*/
|
||||
public function setRelationId($rId) {
|
||||
public function setRelationId($rId)
|
||||
{
|
||||
$this->_rId = $rId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Footer Elements
|
||||
*/
|
||||
public function getElements() {
|
||||
public function getElements()
|
||||
{
|
||||
return $this->_elementCollection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Footer Count
|
||||
*/
|
||||
public function getFooterCount() {
|
||||
public function getFooterCount()
|
||||
{
|
||||
return $this->_footerCount;
|
||||
}
|
||||
}
|
||||
?>
|
||||
2
Classes/PHPWord/Section/Footer/PreserveText.php
Normal file → Executable file
2
Classes/PHPWord/Section/Footer/PreserveText.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
66
Classes/PHPWord/Section/Header.php
Normal file → Executable file
66
Classes/PHPWord/Section/Header.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,20 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version Beta 0.6.3, 08.07.2011
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPWord_Section_Header
|
||||
*
|
||||
* @category PHPWord
|
||||
* @package PHPWord_Section
|
||||
* @copyright Copyright (c) 2011 PHPWord
|
||||
*/
|
||||
class PHPWord_Section_Header {
|
||||
class PHPWord_Section_Header
|
||||
{
|
||||
|
||||
/**
|
||||
* Header Count
|
||||
@ -88,7 +84,8 @@ class PHPWord_Section_Header {
|
||||
/**
|
||||
* Create a new Header
|
||||
*/
|
||||
public function __construct($sectionCount) {
|
||||
public function __construct($sectionCount)
|
||||
{
|
||||
$this->_headerCount = $sectionCount;
|
||||
}
|
||||
|
||||
@ -100,7 +97,8 @@ class PHPWord_Section_Header {
|
||||
* @param mixed $styleParagraph
|
||||
* @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)) {
|
||||
$text = utf8_encode($text);
|
||||
}
|
||||
@ -114,7 +112,8 @@ class PHPWord_Section_Header {
|
||||
*
|
||||
* @param int $count
|
||||
*/
|
||||
public function addTextBreak($count = 1) {
|
||||
public function addTextBreak($count = 1)
|
||||
{
|
||||
for ($i = 1; $i <= $count; $i++) {
|
||||
$this->_elementCollection[] = new PHPWord_Section_TextBreak();
|
||||
}
|
||||
@ -125,7 +124,8 @@ class PHPWord_Section_Header {
|
||||
*
|
||||
* @return PHPWord_Section_TextRun
|
||||
*/
|
||||
public function createTextRun($styleParagraph = null) {
|
||||
public function createTextRun($styleParagraph = null)
|
||||
{
|
||||
$textRun = new PHPWord_Section_TextRun($styleParagraph);
|
||||
$this->_elementCollection[] = $textRun;
|
||||
return $textRun;
|
||||
@ -137,7 +137,8 @@ class PHPWord_Section_Header {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_Table
|
||||
*/
|
||||
public function addTable($style = null) {
|
||||
public function addTable($style = null)
|
||||
{
|
||||
$table = new PHPWord_Section_Table('header', $this->_headerCount, $style);
|
||||
$this->_elementCollection[] = $table;
|
||||
return $table;
|
||||
@ -150,7 +151,8 @@ class PHPWord_Section_Header {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_Image
|
||||
*/
|
||||
public function addImage($src, $style = null) {
|
||||
public function addImage($src, $style = null)
|
||||
{
|
||||
$image = new PHPWord_Section_Image($src, $style);
|
||||
|
||||
if (!is_null($image->getSource())) {
|
||||
@ -171,7 +173,8 @@ class PHPWord_Section_Header {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_MemoryImage
|
||||
*/
|
||||
public function addMemoryImage($link, $style = null) {
|
||||
public function addMemoryImage($link, $style = null)
|
||||
{
|
||||
$memoryImage = new PHPWord_Section_MemoryImage($link, $style);
|
||||
if (!is_null($memoryImage->getSource())) {
|
||||
$rID = PHPWord_Media::addHeaderMediaElement($this->_headerCount, $link, $memoryImage);
|
||||
@ -192,7 +195,8 @@ class PHPWord_Section_Header {
|
||||
* @param mixed $styleParagraph
|
||||
* @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)) {
|
||||
$text = utf8_encode($text);
|
||||
}
|
||||
@ -208,7 +212,8 @@ class PHPWord_Section_Header {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_Image
|
||||
*/
|
||||
public function addWatermark($src, $style = null) {
|
||||
public function addWatermark($src, $style = null)
|
||||
{
|
||||
$image = new PHPWord_Section_Image($src, $style, true);
|
||||
|
||||
if (!is_null($image->getSource())) {
|
||||
@ -225,7 +230,8 @@ class PHPWord_Section_Header {
|
||||
/**
|
||||
* Get Header Relation ID
|
||||
*/
|
||||
public function getRelationId() {
|
||||
public function getRelationId()
|
||||
{
|
||||
return $this->_rId;
|
||||
}
|
||||
|
||||
@ -234,51 +240,57 @@ class PHPWord_Section_Header {
|
||||
*
|
||||
* @param int $rId
|
||||
*/
|
||||
public function setRelationId($rId) {
|
||||
public function setRelationId($rId)
|
||||
{
|
||||
$this->_rId = $rId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Header Elements
|
||||
*/
|
||||
public function getElements() {
|
||||
public function getElements()
|
||||
{
|
||||
return $this->_elementCollection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Header Count
|
||||
*/
|
||||
public function getHeaderCount() {
|
||||
public function getHeaderCount()
|
||||
{
|
||||
return $this->_headerCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Header Type
|
||||
*/
|
||||
public function getType() {
|
||||
public function getType()
|
||||
{
|
||||
return $this->_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset back to default
|
||||
*/
|
||||
public function resetType() {
|
||||
public function resetType()
|
||||
{
|
||||
return $this->_type = PHPWord_Section_Header::AUTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* First page only header
|
||||
*/
|
||||
public function firstPage() {
|
||||
public function firstPage()
|
||||
{
|
||||
return $this->_type = PHPWord_Section_Header::FIRST;
|
||||
}
|
||||
|
||||
/**
|
||||
* Even numbered Pages only
|
||||
*/
|
||||
public function evenPage() {
|
||||
public function evenPage()
|
||||
{
|
||||
return $this->_type = PHPWord_Section_Header::EVEN;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
2
Classes/PHPWord/Section/Image.php
Normal file → Executable file
2
Classes/PHPWord/Section/Image.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Section/Link.php
Normal file → Executable file
2
Classes/PHPWord/Section/Link.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Section/ListItem.php
Normal file → Executable file
2
Classes/PHPWord/Section/ListItem.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Section/MemoryImage.php
Normal file → Executable file
2
Classes/PHPWord/Section/MemoryImage.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Section/Object.php
Normal file → Executable file
2
Classes/PHPWord/Section/Object.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Section/PageBreak.php
Normal file → Executable file
2
Classes/PHPWord/Section/PageBreak.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Section/Settings.php
Normal file → Executable file
2
Classes/PHPWord/Section/Settings.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Section/Table.php
Normal file → Executable file
2
Classes/PHPWord/Section/Table.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
54
Classes/PHPWord/Section/Table/Cell.php
Normal file → Executable file
54
Classes/PHPWord/Section/Table/Cell.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,20 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version Beta 0.6.3, 08.07.2011
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
@ -79,7 +75,8 @@ class PHPWord_Section_Table_Cell {
|
||||
* @param int $width
|
||||
* @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->_pCount = $pCount;
|
||||
$this->_width = $width;
|
||||
@ -107,7 +104,8 @@ class PHPWord_Section_Table_Cell {
|
||||
* @param mixed $style
|
||||
* @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)) {
|
||||
$text = utf8_encode($text);
|
||||
}
|
||||
@ -124,7 +122,8 @@ class PHPWord_Section_Table_Cell {
|
||||
* @param mixed $style
|
||||
* @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 (!PHPWord_Shared_String::IsUTF8($linkSrc)) {
|
||||
$linkSrc = utf8_encode($linkSrc);
|
||||
@ -152,7 +151,8 @@ class PHPWord_Section_Table_Cell {
|
||||
*
|
||||
* @param int $count
|
||||
*/
|
||||
public function addTextBreak() {
|
||||
public function addTextBreak()
|
||||
{
|
||||
$this->_elementCollection[] = new PHPWord_Section_TextBreak();
|
||||
}
|
||||
|
||||
@ -165,7 +165,8 @@ class PHPWord_Section_Table_Cell {
|
||||
* @param mixed $styleList
|
||||
* @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)) {
|
||||
$text = utf8_encode($text);
|
||||
}
|
||||
@ -181,7 +182,8 @@ class PHPWord_Section_Table_Cell {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_Image
|
||||
*/
|
||||
public function addImage($src, $style = null) {
|
||||
public function addImage($src, $style = null)
|
||||
{
|
||||
$image = new PHPWord_Section_Image($src, $style);
|
||||
|
||||
if (!is_null($image->getSource())) {
|
||||
@ -208,7 +210,8 @@ class PHPWord_Section_Table_Cell {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_MemoryImage
|
||||
*/
|
||||
public function addMemoryImage($link, $style = null) {
|
||||
public function addMemoryImage($link, $style = null)
|
||||
{
|
||||
$memoryImage = new PHPWord_Section_MemoryImage($link, $style);
|
||||
if (!is_null($memoryImage->getSource())) {
|
||||
if ($this->_insideOf == 'section') {
|
||||
@ -234,7 +237,8 @@ class PHPWord_Section_Table_Cell {
|
||||
* @param mixed $style
|
||||
* @return PHPWord_Section_Object
|
||||
*/
|
||||
public function addObject($src, $style = null) {
|
||||
public function addObject($src, $style = null)
|
||||
{
|
||||
$object = new PHPWord_Section_Object($src, $style);
|
||||
|
||||
if (!is_null($object->getSource())) {
|
||||
@ -275,7 +279,8 @@ class PHPWord_Section_Table_Cell {
|
||||
* @param mixed $styleParagraph
|
||||
* @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 (!PHPWord_Shared_String::IsUTF8($text)) {
|
||||
$text = utf8_encode($text);
|
||||
@ -293,7 +298,8 @@ class PHPWord_Section_Table_Cell {
|
||||
*
|
||||
* @return PHPWord_Section_TextRun
|
||||
*/
|
||||
public function createTextRun($styleParagraph = null) {
|
||||
public function createTextRun($styleParagraph = null)
|
||||
{
|
||||
$textRun = new PHPWord_Section_TextRun($styleParagraph);
|
||||
$this->_elementCollection[] = $textRun;
|
||||
return $textRun;
|
||||
@ -304,7 +310,8 @@ class PHPWord_Section_Table_Cell {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getElements() {
|
||||
public function getElements()
|
||||
{
|
||||
return $this->_elementCollection;
|
||||
}
|
||||
|
||||
@ -313,7 +320,8 @@ class PHPWord_Section_Table_Cell {
|
||||
*
|
||||
* @return PHPWord_Style_Cell
|
||||
*/
|
||||
public function getStyle() {
|
||||
public function getStyle()
|
||||
{
|
||||
return $this->_style;
|
||||
}
|
||||
|
||||
@ -322,8 +330,8 @@ class PHPWord_Section_Table_Cell {
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getWidth() {
|
||||
public function getWidth()
|
||||
{
|
||||
return $this->_width;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
2
Classes/PHPWord/Section/Text.php
Normal file → Executable file
2
Classes/PHPWord/Section/Text.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Section/TextBreak.php
Normal file → Executable file
2
Classes/PHPWord/Section/TextBreak.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
30
Classes/PHPWord/Section/TextRun.php
Normal file → Executable file
30
Classes/PHPWord/Section/TextRun.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,20 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version Beta 0.6.3, 08.07.2011
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPWord_Section_TextRun
|
||||
*
|
||||
* @category PHPWord
|
||||
* @package PHPWord_Section
|
||||
* @copyright Copyright (c) 2011 PHPWord
|
||||
*/
|
||||
class PHPWord_Section_TextRun {
|
||||
class PHPWord_Section_TextRun
|
||||
{
|
||||
|
||||
/**
|
||||
* Paragraph style
|
||||
@ -53,7 +49,8 @@ class PHPWord_Section_TextRun {
|
||||
/**
|
||||
* Create a new TextRun Element
|
||||
*/
|
||||
public function __construct($styleParagraph = null) {
|
||||
public function __construct($styleParagraph = null)
|
||||
{
|
||||
$this->_elementCollection = array();
|
||||
|
||||
// Set paragraph style
|
||||
@ -79,7 +76,8 @@ class PHPWord_Section_TextRun {
|
||||
* @var mixed $styleFont
|
||||
* @return PHPWord_Section_Text
|
||||
*/
|
||||
public function addText($text = null, $styleFont = null) {
|
||||
public function addText($text = null, $styleFont = null)
|
||||
{
|
||||
if (!PHPWord_Shared_String::IsUTF8($text)) {
|
||||
$text = utf8_encode($text);
|
||||
}
|
||||
@ -96,7 +94,8 @@ class PHPWord_Section_TextRun {
|
||||
* @param mixed $styleFont
|
||||
* @return PHPWord_Section_Link
|
||||
*/
|
||||
public function addLink($linkSrc, $linkName = null, $styleFont = null) {
|
||||
public function addLink($linkSrc, $linkName = null, $styleFont = null)
|
||||
{
|
||||
$linkSrc = utf8_encode($linkSrc);
|
||||
if (!is_null($linkName)) {
|
||||
$linkName = utf8_encode($linkName);
|
||||
@ -115,7 +114,8 @@ class PHPWord_Section_TextRun {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getElements() {
|
||||
public function getElements()
|
||||
{
|
||||
return $this->_elementCollection;
|
||||
}
|
||||
|
||||
@ -124,8 +124,8 @@ class PHPWord_Section_TextRun {
|
||||
*
|
||||
* @return PHPWord_Style_Paragraph
|
||||
*/
|
||||
public function getParagraphStyle() {
|
||||
public function getParagraphStyle()
|
||||
{
|
||||
return $this->_styleParagraph;
|
||||
}
|
||||
}
|
||||
?>
|
||||
2
Classes/PHPWord/Section/Title.php
Normal file → Executable file
2
Classes/PHPWord/Section/Title.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Shared/Drawing.php
Normal file → Executable file
2
Classes/PHPWord/Shared/Drawing.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Shared/File.php
Normal file → Executable file
2
Classes/PHPWord/Shared/File.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Shared/Font.php
Normal file → Executable file
2
Classes/PHPWord/Shared/Font.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
25
Classes/PHPWord/Shared/String.php
Normal file → Executable file
25
Classes/PHPWord/Shared/String.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,12 +20,14 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version Beta 0.6.3, 08.07.2011
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Class PHPWord_Shared_String
|
||||
*/
|
||||
class PHPWord_Shared_String
|
||||
{
|
||||
/**
|
||||
@ -52,7 +54,8 @@ class PHPWord_Shared_String
|
||||
/**
|
||||
* Build control characters array
|
||||
*/
|
||||
private static function _buildControlCharacters() {
|
||||
private static function _buildControlCharacters()
|
||||
{
|
||||
for ($i = 0; $i <= 19; ++$i) {
|
||||
if ($i != 9 && $i != 10 && $i != 13) {
|
||||
$find = '_x' . sprintf('%04s', strtoupper(dechex($i))) . '_';
|
||||
@ -110,7 +113,8 @@ class PHPWord_Shared_String
|
||||
* @param string $value Value to unescape
|
||||
* @return string
|
||||
*/
|
||||
public static function ControlCharacterOOXML2PHP($value = '') {
|
||||
public static function ControlCharacterOOXML2PHP($value = '')
|
||||
{
|
||||
if (empty(self::$_controlCharacters)) {
|
||||
self::_buildControlCharacters();
|
||||
}
|
||||
@ -132,7 +136,8 @@ class PHPWord_Shared_String
|
||||
* @param string $value Value to escape
|
||||
* @return string
|
||||
*/
|
||||
public static function ControlCharacterPHP2OOXML($value = '') {
|
||||
public static function ControlCharacterPHP2OOXML($value = '')
|
||||
{
|
||||
if (empty(self::$_controlCharacters)) {
|
||||
self::_buildControlCharacters();
|
||||
}
|
||||
@ -146,7 +151,8 @@ class PHPWord_Shared_String
|
||||
* @param string $value
|
||||
* @return boolean
|
||||
*/
|
||||
public static function IsUTF8($value = '') {
|
||||
public static function IsUTF8($value = '')
|
||||
{
|
||||
return $value === '' || preg_match('/^./su', $value) === 1;
|
||||
}
|
||||
|
||||
@ -156,7 +162,8 @@ class PHPWord_Shared_String
|
||||
* @param mixed $value
|
||||
* @return string
|
||||
*/
|
||||
public static function FormatNumber($value) {
|
||||
public static function FormatNumber($value)
|
||||
{
|
||||
return number_format($value, 2, '.', '');
|
||||
}
|
||||
|
||||
|
||||
2
Classes/PHPWord/Shared/XMLWriter.php
Normal file → Executable file
2
Classes/PHPWord/Shared/XMLWriter.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Shared/ZipStreamWrapper.php
Normal file → Executable file
2
Classes/PHPWord/Shared/ZipStreamWrapper.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Style.php
Normal file → Executable file
2
Classes/PHPWord/Style.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
117
Classes/PHPWord/Style/Cell.php
Normal file → Executable file
117
Classes/PHPWord/Style/Cell.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,20 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version Beta 0.6.3, 08.07.2011
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 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_TBRL = 'tbRl';
|
||||
@ -139,7 +135,8 @@ class PHPWord_Style_Cell {
|
||||
/**
|
||||
* Create a new Cell Style
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->_valign = null;
|
||||
$this->_textDirection = null;
|
||||
$this->_bgColor = null;
|
||||
@ -160,7 +157,8 @@ class PHPWord_Style_Cell {
|
||||
* @var string $key
|
||||
* @var mixed $value
|
||||
*/
|
||||
public function setStyleValue($key, $value) {
|
||||
public function setStyleValue($key, $value)
|
||||
{
|
||||
if ($key == '_borderSize') {
|
||||
$this->setBorderSize($value);
|
||||
} elseif ($key == '_borderColor') {
|
||||
@ -170,42 +168,51 @@ class PHPWord_Style_Cell {
|
||||
}
|
||||
}
|
||||
|
||||
public function getVAlign() {
|
||||
public function getVAlign()
|
||||
{
|
||||
return $this->_valign;
|
||||
}
|
||||
|
||||
public function setVAlign($pValue = null) {
|
||||
public function setVAlign($pValue = null)
|
||||
{
|
||||
$this->_valign = $pValue;
|
||||
}
|
||||
|
||||
public function getTextDirection() {
|
||||
public function getTextDirection()
|
||||
{
|
||||
return $this->_textDirection;
|
||||
}
|
||||
|
||||
public function setTextDirection($pValue = null) {
|
||||
public function setTextDirection($pValue = null)
|
||||
{
|
||||
$this->_textDirection = $pValue;
|
||||
}
|
||||
|
||||
public function getBgColor() {
|
||||
public function getBgColor()
|
||||
{
|
||||
return $this->_bgColor;
|
||||
}
|
||||
|
||||
public function setBgColor($pValue = null) {
|
||||
public function setBgColor($pValue = null)
|
||||
{
|
||||
$this->_bgColor = $pValue;
|
||||
}
|
||||
|
||||
public function setHeight($pValue = null) {
|
||||
public function setHeight($pValue = null)
|
||||
{
|
||||
$this->_height = $pValue;
|
||||
}
|
||||
|
||||
public function setBorderSize($pValue = null) {
|
||||
public function setBorderSize($pValue = null)
|
||||
{
|
||||
$this->_borderTopSize = $pValue;
|
||||
$this->_borderLeftSize = $pValue;
|
||||
$this->_borderRightSize = $pValue;
|
||||
$this->_borderBottomSize = $pValue;
|
||||
}
|
||||
|
||||
public function getBorderSize() {
|
||||
public function getBorderSize()
|
||||
{
|
||||
$t = $this->getBorderTopSize();
|
||||
$l = $this->getBorderLeftSize();
|
||||
$r = $this->getBorderRightSize();
|
||||
@ -214,14 +221,16 @@ class PHPWord_Style_Cell {
|
||||
return array($t, $l, $r, $b);
|
||||
}
|
||||
|
||||
public function setBorderColor($pValue = null) {
|
||||
public function setBorderColor($pValue = null)
|
||||
{
|
||||
$this->_borderTopColor = $pValue;
|
||||
$this->_borderLeftColor = $pValue;
|
||||
$this->_borderRightColor = $pValue;
|
||||
$this->_borderBottomColor = $pValue;
|
||||
}
|
||||
|
||||
public function getBorderColor() {
|
||||
public function getBorderColor()
|
||||
{
|
||||
$t = $this->getBorderTopColor();
|
||||
$l = $this->getBorderLeftColor();
|
||||
$r = $this->getBorderRightColor();
|
||||
@ -230,89 +239,109 @@ class PHPWord_Style_Cell {
|
||||
return array($t, $l, $r, $b);
|
||||
}
|
||||
|
||||
public function setBorderTopSize($pValue = null) {
|
||||
public function setBorderTopSize($pValue = null)
|
||||
{
|
||||
$this->_borderTopSize = $pValue;
|
||||
}
|
||||
|
||||
public function getBorderTopSize() {
|
||||
public function getBorderTopSize()
|
||||
{
|
||||
return $this->_borderTopSize;
|
||||
}
|
||||
|
||||
public function setBorderTopColor($pValue = null) {
|
||||
public function setBorderTopColor($pValue = null)
|
||||
{
|
||||
$this->_borderTopColor = $pValue;
|
||||
}
|
||||
|
||||
public function getBorderTopColor() {
|
||||
public function getBorderTopColor()
|
||||
{
|
||||
return $this->_borderTopColor;
|
||||
}
|
||||
|
||||
public function setBorderLeftSize($pValue = null) {
|
||||
public function setBorderLeftSize($pValue = null)
|
||||
{
|
||||
$this->_borderLeftSize = $pValue;
|
||||
}
|
||||
|
||||
public function getBorderLeftSize() {
|
||||
public function getBorderLeftSize()
|
||||
{
|
||||
return $this->_borderLeftSize;
|
||||
}
|
||||
|
||||
public function setBorderLeftColor($pValue = null) {
|
||||
public function setBorderLeftColor($pValue = null)
|
||||
{
|
||||
$this->_borderLeftColor = $pValue;
|
||||
}
|
||||
|
||||
public function getBorderLeftColor() {
|
||||
public function getBorderLeftColor()
|
||||
{
|
||||
return $this->_borderLeftColor;
|
||||
}
|
||||
|
||||
public function setBorderRightSize($pValue = null) {
|
||||
public function setBorderRightSize($pValue = null)
|
||||
{
|
||||
$this->_borderRightSize = $pValue;
|
||||
}
|
||||
|
||||
public function getBorderRightSize() {
|
||||
public function getBorderRightSize()
|
||||
{
|
||||
return $this->_borderRightSize;
|
||||
}
|
||||
|
||||
public function setBorderRightColor($pValue = null) {
|
||||
public function setBorderRightColor($pValue = null)
|
||||
{
|
||||
$this->_borderRightColor = $pValue;
|
||||
}
|
||||
|
||||
public function getBorderRightColor() {
|
||||
public function getBorderRightColor()
|
||||
{
|
||||
return $this->_borderRightColor;
|
||||
}
|
||||
|
||||
|
||||
public function setBorderBottomSize($pValue = null) {
|
||||
public function setBorderBottomSize($pValue = null)
|
||||
{
|
||||
$this->_borderBottomSize = $pValue;
|
||||
}
|
||||
|
||||
public function getBorderBottomSize() {
|
||||
public function getBorderBottomSize()
|
||||
{
|
||||
return $this->_borderBottomSize;
|
||||
}
|
||||
|
||||
public function setBorderBottomColor($pValue = null) {
|
||||
public function setBorderBottomColor($pValue = null)
|
||||
{
|
||||
$this->_borderBottomColor = $pValue;
|
||||
}
|
||||
|
||||
public function getBorderBottomColor() {
|
||||
public function getBorderBottomColor()
|
||||
{
|
||||
return $this->_borderBottomColor;
|
||||
}
|
||||
|
||||
public function getDefaultBorderColor() {
|
||||
public function getDefaultBorderColor()
|
||||
{
|
||||
return $this->_defaultBorderColor;
|
||||
}
|
||||
|
||||
public function setGridSpan($pValue = null) {
|
||||
public function setGridSpan($pValue = null)
|
||||
{
|
||||
$this->_gridSpan = $pValue;
|
||||
}
|
||||
|
||||
public function getGridSpan() {
|
||||
public function getGridSpan()
|
||||
{
|
||||
return $this->_gridSpan;
|
||||
}
|
||||
|
||||
public function setVMerge($pValue = null) {
|
||||
public function setVMerge($pValue = null)
|
||||
{
|
||||
$this->_vMerge = $pValue;
|
||||
}
|
||||
|
||||
public function getVMerge() {
|
||||
public function getVMerge()
|
||||
{
|
||||
return $this->_vMerge;
|
||||
}
|
||||
}
|
||||
?>
|
||||
2
Classes/PHPWord/Style/Font.php
Normal file → Executable file
2
Classes/PHPWord/Style/Font.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Style/Image.php
Normal file → Executable file
2
Classes/PHPWord/Style/Image.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Style/ListItem.php
Normal file → Executable file
2
Classes/PHPWord/Style/ListItem.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
54
Classes/PHPWord/Style/Paragraph.php
Normal file → Executable file
54
Classes/PHPWord/Style/Paragraph.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,20 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version Beta 0.6.3, 08.07.2011
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPWord_Style_Paragraph
|
||||
*
|
||||
* @category PHPWord
|
||||
* @package PHPWord_Style
|
||||
* @copyright Copyright (c) 2011 PHPWord
|
||||
*/
|
||||
class PHPWord_Style_Paragraph {
|
||||
class PHPWord_Style_Paragraph
|
||||
{
|
||||
|
||||
/**
|
||||
* Paragraph alignment
|
||||
@ -81,7 +77,8 @@ class PHPWord_Style_Paragraph {
|
||||
/**
|
||||
* New Paragraph Style
|
||||
*/
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
$this->_align = null;
|
||||
$this->_spaceBefore = null;
|
||||
$this->_spaceAfter = null;
|
||||
@ -96,7 +93,8 @@ class PHPWord_Style_Paragraph {
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setStyleValue($key, $value) {
|
||||
public function setStyleValue($key, $value)
|
||||
{
|
||||
if ($key == '_indent') {
|
||||
$value = (int)$value * 720; // 720 twips per indent
|
||||
}
|
||||
@ -114,7 +112,8 @@ class PHPWord_Style_Paragraph {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAlign() {
|
||||
public function getAlign()
|
||||
{
|
||||
return $this->_align;
|
||||
}
|
||||
|
||||
@ -124,7 +123,8 @@ class PHPWord_Style_Paragraph {
|
||||
* @param string $pValue
|
||||
* @return PHPWord_Style_Paragraph
|
||||
*/
|
||||
public function setAlign($pValue = null) {
|
||||
public function setAlign($pValue = null)
|
||||
{
|
||||
if (strtolower($pValue) == 'justify') {
|
||||
// justify becames both
|
||||
$pValue = 'both';
|
||||
@ -138,7 +138,8 @@ class PHPWord_Style_Paragraph {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSpaceBefore() {
|
||||
public function getSpaceBefore()
|
||||
{
|
||||
return $this->_spaceBefore;
|
||||
}
|
||||
|
||||
@ -148,7 +149,8 @@ class PHPWord_Style_Paragraph {
|
||||
* @param int $pValue
|
||||
* @return PHPWord_Style_Paragraph
|
||||
*/
|
||||
public function setSpaceBefore($pValue = null) {
|
||||
public function setSpaceBefore($pValue = null)
|
||||
{
|
||||
$this->_spaceBefore = $pValue;
|
||||
return $this;
|
||||
}
|
||||
@ -158,7 +160,8 @@ class PHPWord_Style_Paragraph {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSpaceAfter() {
|
||||
public function getSpaceAfter()
|
||||
{
|
||||
return $this->_spaceAfter;
|
||||
}
|
||||
|
||||
@ -168,7 +171,8 @@ class PHPWord_Style_Paragraph {
|
||||
* @param int $pValue
|
||||
* @return PHPWord_Style_Paragraph
|
||||
*/
|
||||
public function setSpaceAfter($pValue = null) {
|
||||
public function setSpaceAfter($pValue = null)
|
||||
{
|
||||
$this->_spaceAfter = $pValue;
|
||||
return $this;
|
||||
}
|
||||
@ -178,7 +182,8 @@ class PHPWord_Style_Paragraph {
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSpacing() {
|
||||
public function getSpacing()
|
||||
{
|
||||
return $this->_spacing;
|
||||
}
|
||||
|
||||
@ -188,7 +193,8 @@ class PHPWord_Style_Paragraph {
|
||||
* @param int $pValue
|
||||
* @return PHPWord_Style_Paragraph
|
||||
*/
|
||||
public function setSpacing($pValue = null) {
|
||||
public function setSpacing($pValue = null)
|
||||
{
|
||||
$this->_spacing = $pValue;
|
||||
return $this;
|
||||
}
|
||||
@ -198,7 +204,8 @@ class PHPWord_Style_Paragraph {
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getIndent() {
|
||||
public function getIndent()
|
||||
{
|
||||
return $this->_indent;
|
||||
}
|
||||
|
||||
@ -208,7 +215,8 @@ class PHPWord_Style_Paragraph {
|
||||
* @param int $pValue
|
||||
* @return PHPWord_Style_Paragraph
|
||||
*/
|
||||
public function setIndent($pValue = null) {
|
||||
public function setIndent($pValue = null)
|
||||
{
|
||||
$this->_indent = $pValue;
|
||||
return $this;
|
||||
}
|
||||
@ -218,8 +226,8 @@ class PHPWord_Style_Paragraph {
|
||||
*
|
||||
* @return PHPWord_Style_Tabs
|
||||
*/
|
||||
public function getTabs() {
|
||||
public function getTabs()
|
||||
{
|
||||
return $this->_tabs;
|
||||
}
|
||||
}
|
||||
?>
|
||||
2
Classes/PHPWord/Style/TOC.php
Normal file → Executable file
2
Classes/PHPWord/Style/TOC.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
27
Classes/PHPWord/Style/Tab.php
Normal file → Executable file
27
Classes/PHPWord/Style/Tab.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,20 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version {something}
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 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
|
||||
@ -96,7 +92,8 @@ class PHPWord_Style_Tab {
|
||||
* @param int $position Must be an integer; otherwise defaults to 0.
|
||||
* @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
|
||||
$this->_val = (self::isStopType($val)) ? $val : 'clear';
|
||||
|
||||
@ -112,7 +109,8 @@ class PHPWord_Style_Tab {
|
||||
*
|
||||
* @param PHPWord_Shared_XMLWriter $objWriter
|
||||
*/
|
||||
public function toXml(PHPWord_Shared_XMLWriter &$objWriter = NULL) {
|
||||
public function toXml(PHPWord_Shared_XMLWriter &$objWriter = NULL)
|
||||
{
|
||||
if (isset($objWriter)) {
|
||||
$objWriter->startElement("w:tab");
|
||||
$objWriter->writeAttribute("w:val", $this->_val);
|
||||
@ -130,7 +128,8 @@ class PHPWord_Style_Tab {
|
||||
* @param string $attribute
|
||||
* @return bool True if it is; false otherwise.
|
||||
*/
|
||||
private static function isStopType($attribute) {
|
||||
private static function isStopType($attribute)
|
||||
{
|
||||
return in_array($attribute, self::$_possibleStopTypes);
|
||||
}
|
||||
|
||||
@ -140,8 +139,8 @@ class PHPWord_Style_Tab {
|
||||
* @param string $attribute
|
||||
* @return bool True if it is; false otherwise.
|
||||
*/
|
||||
private static function isLeaderType($attribute) {
|
||||
private static function isLeaderType($attribute)
|
||||
{
|
||||
return in_array($attribute, self::$_possibleLeaders);
|
||||
}
|
||||
}
|
||||
?>
|
||||
2
Classes/PHPWord/Style/Table.php
Normal file → Executable file
2
Classes/PHPWord/Style/Table.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Style/TableFull.php
Normal file → Executable file
2
Classes/PHPWord/Style/TableFull.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
21
Classes/PHPWord/Style/Tabs.php
Normal file → Executable file
21
Classes/PHPWord/Style/Tabs.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,20 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version {something}
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 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
|
||||
@ -46,7 +42,8 @@ class PHPWord_Style_Tabs {
|
||||
*
|
||||
* @param array $tabs
|
||||
*/
|
||||
public function __construct(array $tabs) {
|
||||
public function __construct(array $tabs)
|
||||
{
|
||||
$this->_tabs = $tabs;
|
||||
}
|
||||
|
||||
@ -54,7 +51,8 @@ class PHPWord_Style_Tabs {
|
||||
*
|
||||
* @param PHPWord_Shared_XMLWriter $objWriter
|
||||
*/
|
||||
public function toXml(PHPWord_Shared_XMLWriter &$objWriter = NULL) {
|
||||
public function toXml(PHPWord_Shared_XMLWriter &$objWriter = NULL)
|
||||
{
|
||||
if (isset($objWriter)) {
|
||||
$objWriter->startElement("w:tabs");
|
||||
foreach ($this->_tabs as &$tab) {
|
||||
@ -64,4 +62,3 @@ class PHPWord_Style_Tabs {
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
2
Classes/PHPWord/TOC.php
Normal file → Executable file
2
Classes/PHPWord/TOC.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
24
Classes/PHPWord/Template.php
Normal file → Executable file
24
Classes/PHPWord/Template.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,20 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version Beta 0.6.3, 08.07.2011
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* PHPWord_DocumentProperties
|
||||
*
|
||||
* @category PHPWord
|
||||
* @package PHPWord
|
||||
* @copyright Copyright (c) 2009 - 2011 PHPWord (http://www.codeplex.com/PHPWord)
|
||||
*/
|
||||
class PHPWord_Template {
|
||||
class PHPWord_Template
|
||||
{
|
||||
|
||||
/**
|
||||
* ZipArchive
|
||||
@ -62,7 +58,8 @@ class PHPWord_Template {
|
||||
*
|
||||
* @param string $strFilename
|
||||
*/
|
||||
public function __construct($strFilename) {
|
||||
public function __construct($strFilename)
|
||||
{
|
||||
$this->_tempFileName = tempnam(sys_get_temp_dir(), '');
|
||||
if ($this->_tempFileName !== false) {
|
||||
// Copy the source File to the temp File
|
||||
@ -85,7 +82,8 @@ class PHPWord_Template {
|
||||
* @param mixed $search
|
||||
* @param mixed $replace
|
||||
*/
|
||||
public function setValue($search, $replace) {
|
||||
public function setValue($search, $replace)
|
||||
{
|
||||
$pattern = '|\$\{([^\}]+)\}|U';
|
||||
preg_match_all($pattern, $this->_documentXML, $matches);
|
||||
foreach ($matches[0] as $value) {
|
||||
@ -121,7 +119,8 @@ class PHPWord_Template {
|
||||
*
|
||||
* @param string $strFilename
|
||||
*/
|
||||
public function save($strFilename) {
|
||||
public function save($strFilename)
|
||||
{
|
||||
if (file_exists($strFilename)) {
|
||||
unlink($strFilename);
|
||||
}
|
||||
@ -136,4 +135,3 @@ class PHPWord_Template {
|
||||
rename($this->_tempFileName, $strFilename);
|
||||
}
|
||||
}
|
||||
?>
|
||||
2
Classes/PHPWord/Writer/IWriter.php
Normal file → Executable file
2
Classes/PHPWord/Writer/IWriter.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
4
Classes/PHPWord/Writer/ODText.php
Normal file → Executable file
4
Classes/PHPWord/Writer/ODText.php
Normal file → Executable file
@ -19,8 +19,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPWord
|
||||
* @package PHPWord_Writer_PowerPoint2007
|
||||
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord)
|
||||
* @package PHPWord
|
||||
* @copyright Copyright (c) 2013 PHPWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/ODText/Content.php
Normal file → Executable file
2
Classes/PHPWord/Writer/ODText/Content.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/ODText/Manifest.php
Normal file → Executable file
2
Classes/PHPWord/Writer/ODText/Manifest.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/ODText/Meta.php
Normal file → Executable file
2
Classes/PHPWord/Writer/ODText/Meta.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/ODText/Mimetype.php
Normal file → Executable file
2
Classes/PHPWord/Writer/ODText/Mimetype.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/ODText/Styles.php
Normal file → Executable file
2
Classes/PHPWord/Writer/ODText/Styles.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/ODText/WriterPart.php
Normal file → Executable file
2
Classes/PHPWord/Writer/ODText/WriterPart.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
4
Classes/PHPWord/Writer/RTF.php
Normal file → Executable file
4
Classes/PHPWord/Writer/RTF.php
Normal file → Executable file
@ -19,8 +19,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* @category PHPWord
|
||||
* @package PHPWord_Writer_RTF
|
||||
* @copyright Copyright (c) 2013 PHPWord (http://www.codeplex.com/PHPWord)
|
||||
* @package PHPWord
|
||||
* @copyright Copyright (c) 2013 PHPWord
|
||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
36
Classes/PHPWord/Writer/Word2007.php
Normal file → Executable file
36
Classes/PHPWord/Writer/Word2007.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,13 +20,16 @@
|
||||
*
|
||||
* @category 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
|
||||
* @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 $_writerParts;
|
||||
@ -35,7 +38,8 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter {
|
||||
private $_imageTypes = array();
|
||||
private $_objectTypes = array();
|
||||
|
||||
public function __construct(PHPWord $PHPWord = null) {
|
||||
public function __construct(PHPWord $PHPWord = null)
|
||||
{
|
||||
$this->_document = $PHPWord;
|
||||
|
||||
$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 $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;
|
||||
$_cFtrs = 0;
|
||||
$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);
|
||||
$extension = strtolower($srcInfo['extension']);
|
||||
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)])) {
|
||||
return $this->_writerParts[strtolower($pPartName)];
|
||||
} else {
|
||||
@ -202,11 +208,13 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter {
|
||||
}
|
||||
}
|
||||
|
||||
public function getUseDiskCaching() {
|
||||
public function getUseDiskCaching()
|
||||
{
|
||||
return $this->_useDiskCaching;
|
||||
}
|
||||
|
||||
public function setUseDiskCaching($pValue = false, $pDirectory = null) {
|
||||
public function setUseDiskCaching($pValue = false, $pDirectory = null)
|
||||
{
|
||||
$this->_useDiskCaching = $pValue;
|
||||
|
||||
if (!is_null($pDirectory)) {
|
||||
@ -220,7 +228,8 @@ class PHPWord_Writer_Word2007 implements PHPWord_Writer_IWriter {
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function _addFileToPackage($objZip, $element) {
|
||||
private function _addFileToPackage($objZip, $element)
|
||||
{
|
||||
if (isset($element['isMemImage']) && $element['isMemImage']) {
|
||||
$image = call_user_func($element['createfunction'], $element['source']);
|
||||
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
111
Classes/PHPWord/Writer/Word2007/Base.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,15 +20,19 @@
|
||||
*
|
||||
* @category 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
|
||||
* @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();
|
||||
|
||||
$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();
|
||||
$styleParagraph = $textrun->getParagraphStyle();
|
||||
|
||||
@ -108,7 +113,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
$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();
|
||||
$spaceBefore = $style->getSpaceBefore();
|
||||
$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();
|
||||
$linkName = $link->getLinkName();
|
||||
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();
|
||||
$styleParagraph = $textrun->getParagraphStyle();
|
||||
|
||||
@ -302,7 +310,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
$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();
|
||||
$bold = $style->getBold();
|
||||
$italic = $style->getItalic();
|
||||
@ -373,11 +382,13 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
$objWriter->endElement();
|
||||
}
|
||||
|
||||
protected function _writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = null) {
|
||||
protected function _writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = 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();
|
||||
$_cRows = count($_rows);
|
||||
|
||||
@ -443,7 +454,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
} elseif ($element instanceof PHPWord_Section_ListItem) {
|
||||
$this->_writeListItem($objWriter, $element);
|
||||
} elseif ($element instanceof PHPWord_Section_Image ||
|
||||
$element instanceof PHPWord_Section_MemoryImage) {
|
||||
$element instanceof PHPWord_Section_MemoryImage
|
||||
) {
|
||||
$this->_writeImage($objWriter, $element);
|
||||
} elseif ($element instanceof PHPWord_Section_Object) {
|
||||
$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();
|
||||
$mTop = (!is_null($margins[0])) ? 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();
|
||||
$valign = $style->getVAlign();
|
||||
$textDir = $style->getTextDirection();
|
||||
@ -548,7 +562,9 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
|
||||
$objWriter->startElement('w:tcBorders');
|
||||
if ($bTop) {
|
||||
if(is_null($brdCol[0])) { $brdCol[0] = $_defaultColor; }
|
||||
if (is_null($brdCol[0])) {
|
||||
$brdCol[0] = $_defaultColor;
|
||||
}
|
||||
$objWriter->startElement('w:top');
|
||||
$objWriter->writeAttribute('w:val', 'single');
|
||||
$objWriter->writeAttribute('w:sz', $brdSz[0]);
|
||||
@ -557,7 +573,9 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
}
|
||||
|
||||
if ($bLeft) {
|
||||
if(is_null($brdCol[1])) { $brdCol[1] = $_defaultColor; }
|
||||
if (is_null($brdCol[1])) {
|
||||
$brdCol[1] = $_defaultColor;
|
||||
}
|
||||
$objWriter->startElement('w:left');
|
||||
$objWriter->writeAttribute('w:val', 'single');
|
||||
$objWriter->writeAttribute('w:sz', $brdSz[1]);
|
||||
@ -566,7 +584,9 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
}
|
||||
|
||||
if ($bRight) {
|
||||
if(is_null($brdCol[2])) { $brdCol[2] = $_defaultColor; }
|
||||
if (is_null($brdCol[2])) {
|
||||
$brdCol[2] = $_defaultColor;
|
||||
}
|
||||
$objWriter->startElement('w:right');
|
||||
$objWriter->writeAttribute('w:val', 'single');
|
||||
$objWriter->writeAttribute('w:sz', $brdSz[2]);
|
||||
@ -575,7 +595,9 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
}
|
||||
|
||||
if ($bBottom) {
|
||||
if(is_null($brdCol[3])) { $brdCol[3] = $_defaultColor; }
|
||||
if (is_null($brdCol[3])) {
|
||||
$brdCol[3] = $_defaultColor;
|
||||
}
|
||||
$objWriter->startElement('w:bottom');
|
||||
$objWriter->writeAttribute('w:val', 'single');
|
||||
$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();
|
||||
|
||||
$style = $image->getStyle();
|
||||
$width = $style->getWidth();
|
||||
$height = $style->getHeight();
|
||||
$align = $style->getAlign();
|
||||
$marginTop = $style->getMarginTop();
|
||||
$marginLeft = $style->getMarginLeft();
|
||||
$wrappingStyle = $style->getWrappingStyle();
|
||||
|
||||
$objWriter->startElement('w:p');
|
||||
|
||||
@ -625,7 +655,37 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
|
||||
$objWriter->startElement('v:shape');
|
||||
$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->writeAttribute('r:id', 'rId' . $rId);
|
||||
@ -640,7 +700,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
$objWriter->endElement();
|
||||
}
|
||||
|
||||
protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $image) {
|
||||
protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $image)
|
||||
{
|
||||
$rId = $image->getRelationId();
|
||||
|
||||
$style = $image->getStyle();
|
||||
@ -683,7 +744,8 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
$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 = PHPWord_Shared_String::ControlCharacterPHP2OOXML($text);
|
||||
$anchor = $title->getAnchor();
|
||||
@ -724,4 +786,3 @@ class PHPWord_Writer_Word2007_Base extends PHPWord_Writer_Word2007_WriterPart {
|
||||
$objWriter->endElement();
|
||||
}
|
||||
}
|
||||
?>
|
||||
2
Classes/PHPWord/Writer/Word2007/ContentTypes.php
Normal file → Executable file
2
Classes/PHPWord/Writer/Word2007/ContentTypes.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/Word2007/DocProps.php
Normal file → Executable file
2
Classes/PHPWord/Writer/Word2007/DocProps.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
37
Classes/PHPWord/Writer/Word2007/Document.php
Normal file → Executable file
37
Classes/PHPWord/Writer/Word2007/Document.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* PHPWord
|
||||
*
|
||||
* Copyright (c) 2011 PHPWord
|
||||
* Copyright (c) 2013 PHPWord
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -20,15 +20,19 @@
|
||||
*
|
||||
* @category 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
|
||||
* @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
|
||||
|
||||
if ($this->getParentWriter()->getUseDiskCaching()) {
|
||||
@ -83,7 +87,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
|
||||
} elseif ($element instanceof PHPWord_Section_ListItem) {
|
||||
$this->_writeListItem($objWriter, $element);
|
||||
} elseif ($element instanceof PHPWord_Section_Image ||
|
||||
$element instanceof PHPWord_Section_MemoryImage) {
|
||||
$element instanceof PHPWord_Section_MemoryImage
|
||||
) {
|
||||
$this->_writeImage($objWriter, $element);
|
||||
} elseif ($element instanceof PHPWord_Section_Object) {
|
||||
$this->_writeObject($objWriter, $element);
|
||||
@ -107,7 +112,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
|
||||
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:pPr');
|
||||
$this->_writeEndSection($objWriter, $section, 3);
|
||||
@ -115,7 +121,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
|
||||
$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();
|
||||
$_headers = $section->getHeaders();
|
||||
$_footer = $section->getFooter();
|
||||
@ -227,7 +234,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
|
||||
$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:r');
|
||||
$objWriter->startElement('w:br');
|
||||
@ -237,7 +245,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
|
||||
$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();
|
||||
$text = $textObject->getText();
|
||||
$styleParagraph = $textObject->getParagraphStyle();
|
||||
@ -275,7 +284,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
|
||||
$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();
|
||||
$rIdImage = $object->getImageRelationId();
|
||||
$shapeId = md5($rIdObject . '_' . $rIdImage);
|
||||
@ -333,7 +343,8 @@ class PHPWord_Writer_Word2007_Document extends PHPWord_Writer_Word2007_Base {
|
||||
$objWriter->endElement(); // w:p
|
||||
}
|
||||
|
||||
private function _writeTOC(PHPWord_Shared_XMLWriter $objWriter = null) {
|
||||
private function _writeTOC(PHPWord_Shared_XMLWriter $objWriter = null)
|
||||
{
|
||||
$titles = PHPWord_TOC::getTitles();
|
||||
$styleFont = PHPWord_TOC::getStyleFont();
|
||||
|
||||
|
||||
2
Classes/PHPWord/Writer/Word2007/DocumentRels.php
Normal file → Executable file
2
Classes/PHPWord/Writer/Word2007/DocumentRels.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/Word2007/Footer.php
Normal file → Executable file
2
Classes/PHPWord/Writer/Word2007/Footer.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/Word2007/Header.php
Normal file → Executable file
2
Classes/PHPWord/Writer/Word2007/Header.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/Word2007/Rels.php
Normal file → Executable file
2
Classes/PHPWord/Writer/Word2007/Rels.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/Word2007/Styles.php
Normal file → Executable file
2
Classes/PHPWord/Writer/Word2007/Styles.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
Classes/PHPWord/Writer/Word2007/WriterPart.php
Normal file → Executable file
2
Classes/PHPWord/Writer/Word2007/WriterPart.php
Normal file → Executable file
@ -20,7 +20,7 @@
|
||||
*
|
||||
* @category 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
|
||||
* @version 0.7.0
|
||||
*/
|
||||
|
||||
2
README.md
Normal file → Executable file
2
README.md
Normal file → Executable file
@ -59,7 +59,7 @@ $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('helloWorld.docx');
|
||||
```
|
||||
|
||||
## Image
|
||||
## Images
|
||||
|
||||
You can add images easily using the following example.
|
||||
|
||||
|
||||
5
changelog.txt
Normal file → Executable file
5
changelog.txt
Normal file → Executable file
@ -22,7 +22,7 @@
|
||||
* @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-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
|
||||
@ -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) - IMPROVED : Moved examples out of Classes directory
|
||||
- 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
1
samples/Sample_01_SimpleText.php
Normal file → Executable file
@ -49,4 +49,3 @@ echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 102
|
||||
|
||||
// Echo done
|
||||
echo date('H:i:s') , " Done writing file" , EOL;
|
||||
?>
|
||||
1
samples/Sample_02_TabStops.php
Normal file → Executable file
1
samples/Sample_02_TabStops.php
Normal file → Executable file
@ -61,4 +61,3 @@ echo date('H:i:s') , ' Peak memory usage: ' , (memory_get_peak_usage(true) / 102
|
||||
|
||||
// Echo done
|
||||
echo date('H:i:s') , ' Done writing file' , EOL;
|
||||
?>
|
||||
1
samples/old/AdvancedTable.php
Normal file → Executable file
1
samples/old/AdvancedTable.php
Normal file → Executable file
@ -50,4 +50,3 @@ for($i = 1; $i <= 10; $i++) {
|
||||
// Save File
|
||||
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('AdvancedTable.docx');
|
||||
?>
|
||||
1
samples/old/BasicTable.php
Normal file → Executable file
1
samples/old/BasicTable.php
Normal file → Executable file
@ -23,4 +23,3 @@ for($r = 1; $r <= 10; $r++) { // Loop through rows
|
||||
// Save File
|
||||
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('BasicTable.docx');
|
||||
?>
|
||||
1
samples/old/HeaderFooter.php
Normal file → Executable file
1
samples/old/HeaderFooter.php
Normal file → Executable file
@ -54,4 +54,3 @@ $section2->addText('Some text...');
|
||||
// Save File
|
||||
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('HeaderFooter.docx');
|
||||
?>
|
||||
1
samples/old/Image.php
Normal file → Executable file
1
samples/old/Image.php
Normal file → Executable file
@ -21,4 +21,3 @@ $section->addImage('_mars.jpg', array('width'=>100, 'height'=>100, 'align'=>'rig
|
||||
// Save File
|
||||
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('Image.docx');
|
||||
?>
|
||||
1
samples/old/Link.php
Normal file → Executable file
1
samples/old/Link.php
Normal file → Executable file
@ -21,4 +21,3 @@ $section->addLink('http://www.yahoo.com', null, 'myOwnLinkStyle');
|
||||
// Save File
|
||||
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('Link.docx');
|
||||
?>
|
||||
1
samples/old/ListItem.php
Normal file → Executable file
1
samples/old/ListItem.php
Normal file → Executable file
@ -44,4 +44,3 @@ $section->addListItem('List Item 7', 0, 'myOwnStyle', $listStyle, 'P-Style');
|
||||
// Save File
|
||||
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('ListItem.docx');
|
||||
?>
|
||||
1
samples/old/Object.php
Normal file → Executable file
1
samples/old/Object.php
Normal file → Executable file
@ -17,4 +17,3 @@ $section->addObject('_sheet.xls');
|
||||
// Save File
|
||||
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('Object.docx');
|
||||
?>
|
||||
|
||||
1
samples/old/Section.php
Normal file → Executable file
1
samples/old/Section.php
Normal file → Executable file
@ -23,4 +23,3 @@ $section->addText('This section uses other margins.');
|
||||
// Save File
|
||||
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('Section.docx');
|
||||
?>
|
||||
1
samples/old/Template.php
Normal file → Executable file
1
samples/old/Template.php
Normal file → Executable file
@ -20,4 +20,3 @@ $document->setValue('weekday', date('l'));
|
||||
$document->setValue('time', date('H:i'));
|
||||
|
||||
$document->save('Solarsystem.docx');
|
||||
?>
|
||||
1
samples/old/Textrun.php
Normal file → Executable file
1
samples/old/Textrun.php
Normal file → Executable file
@ -29,4 +29,3 @@ $textrun->addLink('http://www.bing.com', null, 'NLink');
|
||||
// Save File
|
||||
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('Textrun.docx');
|
||||
?>
|
||||
1
samples/old/TitleTOC.php
Normal file → Executable file
1
samples/old/TitleTOC.php
Normal file → Executable file
@ -46,4 +46,3 @@ echo 'Note: The pagenumbers in the TOC doesnt refresh automatically.';
|
||||
// Save File
|
||||
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('TitleTOC.docx');
|
||||
?>
|
||||
|
||||
1
samples/old/Watermark.php
Normal file → Executable file
1
samples/old/Watermark.php
Normal file → Executable file
@ -18,4 +18,3 @@ $section->addText('The header reference to the current section includes a waterm
|
||||
// Save File
|
||||
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
|
||||
$objWriter->save('Watermark.docx');
|
||||
?>
|
||||
2
test/PHPWord/Tests/ImageTest.php
Normal file → Executable file
2
test/PHPWord/Tests/ImageTest.php
Normal file → Executable file
@ -4,8 +4,6 @@ namespace PHPWord\Tests;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
use PHPWord;
|
||||
|
||||
require_once __DIR__ . '/../../../src/PHPWord.php';
|
||||
|
||||
class ImageTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function tearDown()
|
||||
|
||||
2
test/bootstrap.php
Normal file → Executable file
2
test/bootstrap.php
Normal file → Executable file
@ -2,7 +2,7 @@
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
require_once __DIR__ . "/../src/PHPWord/Autoloader.php";
|
||||
require_once __DIR__ . "/../Classes/PHPWord/Autoloader.php";
|
||||
PHPWord_Autoloader::Register();
|
||||
|
||||
require_once __DIR__ . "/PHPWord/TestHelper.php";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user