diff --git a/.gitignore b/.gitignore index 81767f6bfb..2ea4fd9d4f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ Thumbs.db Desktop.ini .idea +_build phpunit.xml composer.lock composer.phar @@ -12,10 +13,4 @@ vendor /report /.settings /.buildpath -/.project -/docs -*.odt -*.docx -*.rtf -*.txt -*.xml \ No newline at end of file +/.project \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 77b9ca0d2c..8ed7a45feb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,46 +1,49 @@ language: php + php: + - 5.3.3 - 5.3 - 5.4 - 5.5 - ## @reference https://github.com/travis-ci/travis-ci/issues/1749 + - 5.6 - hhvm + matrix: allow_failures: + - php: 5.3.3 + - php: 5.6 - php: hhvm - + before_script: ## Composer - - curl -s http://getcomposer.org/installer | php - - php composer.phar install --prefer-source + # - curl -s http://getcomposer.org/installer | php + # - php composer.phar install --prefer-source + - composer install --prefer-source + - composer selfupdate --quiet ## PHP_CodeSniffer - pyrus install pear/PHP_CodeSniffer - phpenv rehash ## PHP Copy/Paste Detector - - curl -o phpcpd.phar https://phar.phpunit.de/phpcpd.phar + #- curl -o phpcpd.phar https://phar.phpunit.de/phpcpd.phar ## PHP Mess Detector - - pear config-set preferred_state beta - - printf "\n" | pecl install imagick + #- pear config-set preferred_state beta + #- printf "\n" | pecl install imagick #- pear channel-discover pear.phpmd.org #- pear channel-discover pear.pdepend.org #- pear install --alldeps phpmd/PHP_PMD - - phpenv rehash + #- phpenv rehash ## PHPLOC - - curl -o phploc.phar https://phar.phpunit.de/phploc.phar + #- curl -o phploc.phar https://phar.phpunit.de/phploc.phar script: ## PHP_CodeSniffer - - phpcs --standard=PSR1 Classes/ - - phpcs --standard=PSR2 Classes/ + - phpcs --standard=PSR2 -n src/ + - phpcs --standard=PSR2 -n tests/ ## PHP Copy/Paste Detector - - php phpcpd.phar --verbose Classes/ + #- php phpcpd.phar --verbose src/ ## PHP Mess Detector - #- phpmd Classes/ text unusedcode,naming,design + #- phpmd src/ text unusedcode,naming,design ## PHPLOC - - php phploc.phar Classes/ + #- php phploc.phar src/ ## PHPUnit - phpunit -c ./ --coverage-text - -notifications: - email: - - progi1984@gmail.com diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100755 index 0000000000..867bb2aade --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,111 @@ +# Changelog + +This is the changelog between releases of PHPWord. Releases are listed in reverse chronological order with the latest version listed on top, while additions/changes in each release are listed in chronological order. Changes in each release are divided into three parts: added or change features, bugfixes, and miscellaneous improvements. Each line contains short information about the change made, the person who made it, and the related issue number(s) in GitHub. + +## 0.9.0 - Not yet released + +This release marked the transformation to namespaces (PHP 5.3+). + +### Features + +- Image: Ability to use remote or GD images using `addImage()` on sections, headers, footer, cells, and textruns - @ivanlanin +- Header: Ability to use remote or GD images using `addWatermark()` - @ivanlanin + +### Bugfixes + +- Preserve text doesn't render correctly when the text is not the first word, e.g. 'Page {PAGE}' - @ivanlanin + +### Miscellaneous + +- Move documentation to [Read The Docs](http://phpword.readthedocs.org/en/develop/) - @Progi1984 @ivanlanin GH-82 +- Reorganize and redesign samples folder - @ivanlanin GH-137 +- Use `PhpOffice\PhpWord` namespace for PSR compliance - @RomanSyroeshko @gabrielbull GH-159 GH-58 +- Restructure folders and change folder name `Classes` to `src` and `Tests` to `test` for PSR compliance - @RomanSyroeshko @gabrielbull +- Compliance to phpDocumentor - @ivanlanin +- Merge Style\TableFull into Style\Table. Style\TableFull is deprecated - @ivanlanin GH-160 +- Merge Section\MemoryImage into Section\Image. Section\Image is deprecated - @ivanlanin GH-160 + +## 0.8.1 - 17 Mar 2014 + +This is a bugfix release for image detection functionality. + +- Added fallback for computers that do not have exif_imagetype - @bskrtich, @gabrielbull + +## 0.8.0 - 15 Mar 2014 + +This release merged a lot of improvements from the community. Unit tests introduced in this release and has reached 90% code coverage. + +### Features + +- Template: Permit to save a template generated as a file (PHPWord_Template::saveAs()) - @RomanSyroeshko GH-56 GH-57 +- Word2007: Support sections page numbering - @gabrielbull +- Word2007: Added line height methods to mirror the line height settings in Word in the paragraph styling - @gabrielbull +- Word2007: Added support for page header & page footer height - @JillElaine GH-5 +- General: Add ability to manage line breaks after image insertion - @bskrtich GH-6 GH-66 GH-84 +- Template: Ability to limit number of replacements performed by setValue() method of Template class - @RomanSyroeshko GH-52 GH-53 GH-85 +- Table row: Repeat as header row & allow row to break across pages - @ivanlanin GH-48 GH-86 +- Table: Table width in percentage - @ivanlanin GH-48 GH-86 +- Font: Superscript and subscript - @ivanlanin GH-48 GH-86 +- Paragraph: Hanging paragraph - @ivanlanin GH-48 GH-86 +- Section: Multicolumn and section break - @ivanlanin GH-48 GH-86 +- Template: Ability to apply XSL style sheet to Template - @RomanSyroeshko GH-46 GH-47 GH-83 +- General: PHPWord_Shared_Font::pointSizeToTwips() converter - @ivanlanin GH-87 +- Paragraph: Ability to define normal paragraph style with PHPWord::setNormalStyle() - @ivanlanin GH-87 +- Paragraph: Ability to define parent style (basedOn) and style for following paragraph (next) - @ivanlanin GH-87 +- Clone table rows on the fly when using a template document - @jeroenmoors GH-44 GH-88 +- Initial addition of basic footnote support - @deds GH-16 +- Paragraph: Ability to define paragraph pagination: widow control, keep next, keep lines, and page break before - @ivanlanin GH-92 +- General: PHPWord_Style_Font refactoring - @ivanlanin GH-93 +- Font: Use points instead of halfpoints internally. Conversion to halfpoints done during XML Writing. - @ivanlanin GH-93 +- Paragraph: setTabs() function - @ivanlanin GH-92 +- General: Basic support for TextRun on ODT and RTF - @ivanlanin GH-99 +- Reader: Basic Reader for Word2007 - @ivanlanin GH-104 +- TextRun: Allow Text Break in Text Run - @bskrtich GH-109 +- General: Support for East Asian fontstyle - @jhfangying GH-111 GH-118 +- Image: Use exif_imagetype to check image format instead of extension name - @gabrielbull GH-114 +- General: Setting for XMLWriter Compatibility option - @bskrtich GH-103 +- MemoryImage: Allow remote image when allow_url_open = on - @ivanlanin GH-122 +- TextBreak: Allow font and paragraph style for text break - @ivanlanin GH-18 + +### Bugfixes + +- Fixed bug with cell styling - @gabrielbull +- Fixed bug list items inside of cells - @gabrielbull +- Adding a value that contains "&" in a template breaks it - @SiebelsTim GH-51 +- Example in README.md is broken - @Progi1984 GH-89 +- General: PHPWord_Shared_Drawing::centimetersToPixels() conversion - @ivanlanin GH-94 +- Footnote: Corrupt DOCX reported by MS Word when sections > 1 and not every sections have footnote - @ivanlanin GH-125 + +### Miscellaneous + +- UnitTests - @Progi1984 + +## 0.7.0 - 28 Jan 2014 + +This is the first release after a long development hiatus in [CodePlex](https://phpword.codeplex.com/). This release initialized ODT and RTF Writer, along with some other new features for the existing Word2007 Writer, e.g. tab, multiple header, rowspan and colspan. [Composer](https://packagist.org/packages/phpoffice/phpword) and [Travis](https://travis-ci.org/PHPOffice/PHPWord) were added. + +### Features + +- Implement RTF Writer - @Progi1984 GH-1 +- Implement ODT Writer - @Progi1984 GH-2 +- Word2007: Add rowspan and colspan to cells - @kaystrobach +- Word2007: Support for tab stops - @RLovelett +- Word2007: Support Multiple headers - @RLovelett +- Word2007: Wrapping Styles to Images - @gabrielbull +- Added support for image wrapping style - @gabrielbull + +### Bugfixes + +- "Warning: Invalid error type specified in ...\PHPWord.php on line 226" is thrown when the specified template file is not found - @RomanSyroeshko GH-32 +- PHPWord_Shared_String.IsUTF8 returns FALSE for Cyrillic UTF-8 input - @RomanSyroeshko GH-34 +- Temporary files naming logic in PHPWord_Template can lead to a collision - @RomanSyroeshko GH-38 + +### Miscellaneous + +- Add superscript/subscript styling in Excel2007 Writer - @MarkBaker +- add indentation support to paragraphs - @deds +- Support for Composer - @Progi1984 GH-27 +- Basic CI with Travis - @Progi1984 +- Added PHPWord_Exception and exception when could not copy the template - @Progi1984 +- IMPROVED: Moved examples out of Classes directory - @Progi1984 +- IMPROVED: Advanced string replace in setValue for Template - @Esmeraldo CP-49 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..34985610b0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,14 @@ +# Contributing to PHPWord + +PHPWord is build by the crowd and for the crowd. Every contributions are welcomed; either by [submitting](https://github.com/PHPOffice/PHPWord/issues) bug issues or suggesting improvements, or in a more active form like [requesting](https://github.com/PHPOffice/PHPWord/pulls) a pull. + +We want to create a high quality document writer and reader library that people can use with more confidence and less bugs. We want to collaborate happily, code joyfully, and get a life merrily. Thus, below are some guidelines that we expect to be followed by each contributor. + +- **Be brief, but be bold**: State your issues briefly, but speak out your ideas loudly, even if you can't or don't know how to implement it right away. The world will be better with limitless innovations. +- **Code in PSR**: We use PHP Standards Recommendation (PSR) from as the PHP Framework Interoperability Group (PHP-FIG). If you're not familiar with this standard, please [familiarize yourself now](https://github.com/php-fig/fig-standards). Use [PHPCodeSniffer](http://pear.php.net/package/PHP_CodeSniffer/) to check your code against this standard. +- **Test your code**: Nobody else knows your code better than you. So, please, test your own code before submitting your pull request. PHPWord uses [PHPUnit](http://phpunit.de/) as our testing framework. +- **Request pull in separate branch**: Do not submit your request to the master branch, but create a separate branch named specifically for the issue that you addressed. Read [GitHub manual](https://help.github.com/articles/using-pull-requests) to find out more about this. If you are new to GitHub, read [this short manual](https://help.github.com/articles/fork-a-repo) to get you familiar with forks and how git works in general. + +That's it. Thank you for your interest in PHPWord, and welcome! + +May the Force be with you. \ No newline at end of file diff --git a/Classes/PHPWord.php b/Classes/PHPWord.php deleted file mode 100755 index 43ba3e7ea7..0000000000 --- a/Classes/PHPWord.php +++ /dev/null @@ -1,276 +0,0 @@ -_properties = new PHPWord_DocumentProperties(); - $this->_defaultFontName = PHPWord::DEFAULT_FONT_NAME; - $this->_defaultFontSize = PHPWord::DEFAULT_FONT_SIZE; - } - - /** - * Get properties - * @return PHPWord_DocumentProperties - */ - public function getProperties() - { - return $this->_properties; - } - - /** - * Set properties - * - * @param PHPWord_DocumentProperties $value - * @return PHPWord - */ - public function setProperties(PHPWord_DocumentProperties $value) - { - $this->_properties = $value; - return $this; - } - - /** - * Create a new Section - * - * @param PHPWord_Section_Settings $settings - * @return PHPWord_Section - */ - public function createSection($settings = null) - { - $sectionCount = $this->_countSections() + 1; - - $section = new PHPWord_Section($sectionCount, $settings); - $this->_sectionCollection[] = $section; - return $section; - } - - /** - * Get default Font name - * @return string - */ - public function getDefaultFontName() - { - return $this->_defaultFontName; - } - - /** - * Set default Font name - * @param string $pValue - */ - public function setDefaultFontName($pValue) - { - $this->_defaultFontName = $pValue; - } - - /** - * Get default Font size (in points) - * @return string - */ - public function getDefaultFontSize() - { - return $this->_defaultFontSize; - } - - /** - * Set default Font size (in points) - * @param int $pValue - */ - public function setDefaultFontSize($pValue) - { - $this->_defaultFontSize = $pValue; - } - - /** - * Set default paragraph style definition to styles.xml - * - * @param array $styles Paragraph style definition - */ - public function setDefaultParagraphStyle($styles) - { - PHPWord_Style::setDefaultParagraphStyle($styles); - } - - /** - * Adds a paragraph style definition to styles.xml - * - * @param $styleName string - * @param $styles array - */ - public function addParagraphStyle($styleName, $styles) - { - PHPWord_Style::addParagraphStyle($styleName, $styles); - } - - /** - * Adds a font style definition to styles.xml - * - * @param $styleName string - * @param $styles array - */ - public function addFontStyle($styleName, $styleFont, $styleParagraph = null) - { - PHPWord_Style::addFontStyle($styleName, $styleFont, $styleParagraph); - } - - /** - * Adds a table style definition to styles.xml - * - * @param $styleName string - * @param $styles array - */ - public function addTableStyle($styleName, $styleTable, $styleFirstRow = null) - { - PHPWord_Style::addTableStyle($styleName, $styleTable, $styleFirstRow); - } - - /** - * Adds a heading style definition to styles.xml - * - * @param $titleCount int - * @param $styles array - */ - public function addTitleStyle($titleCount, $styleFont, $styleParagraph = null) - { - PHPWord_Style::addTitleStyle($titleCount, $styleFont, $styleParagraph); - } - - /** - * Adds a hyperlink style to styles.xml - * - * @param $styleName string - * @param $styles array - */ - public function addLinkStyle($styleName, $styles) - { - PHPWord_Style::addLinkStyle($styleName, $styles); - } - - /** - * Get sections - * @return PHPWord_Section[] - */ - public function getSections() - { - return $this->_sectionCollection; - } - - /** - * Load a Template File - * - * @param string $strFilename - * @return PHPWord_Template - */ - public function loadTemplate($strFilename) - { - if (file_exists($strFilename)) { - $template = new PHPWord_Template($strFilename); - return $template; - } else { - throw new PHPWord_Exception( - "Template file {$strFilename} not found." - ); - } - } - - /** - * Get section count - * @return int - */ - private function _countSections() - { - return count($this->_sectionCollection); - } -} diff --git a/Classes/PHPWord/Exceptions/InvalidImageException.php b/Classes/PHPWord/Exceptions/InvalidImageException.php deleted file mode 100644 index eda84a8d19..0000000000 --- a/Classes/PHPWord/Exceptions/InvalidImageException.php +++ /dev/null @@ -1,15 +0,0 @@ - 'IWriter', 'path' => 'PHPWord/Writer/{0}.php', 'class' => 'PHPWord_Writer_{0}'), - array('type' => 'IReader', 'path' => 'PHPWord/Reader/{0}.php', 'class' => 'PHPWord_Reader_{0}' ), - ); - - /** - * Autoresolve classes - * - * @var array - */ - private static $_autoResolveClasses = array( - 'Serialized' - ); - - /** - * Private constructor for PHPWord_IOFactory - */ - private function __construct() - { - } - - /** - * Get search locations - * - * @return array - */ - public static function getSearchLocations() - { - return self::$_searchLocations; - } - - /** - * Set search locations - * - * @param array $value - * @throws Exception - */ - public static function setSearchLocations($value) - { - if (is_array($value)) { - self::$_searchLocations = $value; - } else { - throw new Exception('Invalid parameter passed.'); - } - } - - /** - * Add search location - * - * @param string $type Example: IWriter - * @param string $location Example: PHPWord/Writer/{0}.php - * @param string $classname Example: PHPWord_Writer_{0} - */ - public static function addSearchLocation($type = '', $location = '', $classname = '') - { - self::$_searchLocations[] = array('type' => $type, 'path' => $location, 'class' => $classname); - } - - /** - * Create PHPWord_Writer_IWriter - * - * @param PHPWord $PHPWord - * @param string $writerType Example: Word2007 - * @return PHPWord_Writer_IWriter - */ - public static function createWriter(PHPWord $PHPWord, $writerType = '') - { - $searchType = 'IWriter'; - - foreach (self::$_searchLocations as $searchLocation) { - if ($searchLocation['type'] == $searchType) { - $className = str_replace('{0}', $writerType, $searchLocation['class']); - $classFile = str_replace('{0}', $writerType, $searchLocation['path']); - - $instance = new $className($PHPWord); - if (!is_null($instance)) { - return $instance; - } - } - } - - throw new Exception("No $searchType found for type $writerType"); - } - - /** - * Create PHPWord_Reader_IReader - * - * @param string $readerType Example: Word2007 - * @return PHPWord_Reader_IReader - */ - public static function createReader($readerType = '') - { - $searchType = 'IReader'; - - foreach (self::$_searchLocations as $searchLocation) { - if ($searchLocation['type'] == $searchType) { - $className = str_replace('{0}', $readerType, $searchLocation['class']); - - $instance = new $className(); - if ($instance !== null) { - return $instance; - } - } - } - - throw new PHPWord_Exception("No $searchType found for type $readerType"); - } - - /** - * Loads PHPWord from file - * - * @param string $pFilename The name of the file - * @return PHPWord - */ - public static function load($pFilename, $readerType = 'Word2007') - { - $reader = self::createReader($readerType); - return $reader->load($pFilename); - } -} diff --git a/Classes/PHPWord/Section/Image.php b/Classes/PHPWord/Section/Image.php deleted file mode 100755 index 30a1044962..0000000000 --- a/Classes/PHPWord/Section/Image.php +++ /dev/null @@ -1,175 +0,0 @@ -_src = $src; - $this->_isWatermark = $isWatermark; - $this->_style = new PHPWord_Style_Image(); - - if (!is_null($style) && is_array($style)) { - foreach ($style as $key => $value) { - if (substr($key, 0, 1) != '_') { - $key = '_' . $key; - } - $this->_style->setStyleValue($key, $value); - } - } - - if (isset($style['wrappingStyle'])) { - $this->_style->setWrappingStyle($style['wrappingStyle']); - } - - if ($this->_style->getWidth() == null && $this->_style->getHeight() == null) { - $imgData = getimagesize($this->_src); - $this->_style->setWidth($imgData[0]); - $this->_style->setHeight($imgData[1]); - } - } - - /** - * Get Image style - * - * @return PHPWord_Style_Image - */ - public function getStyle() - { - return $this->_style; - } - - /** - * Get Image Relation ID - * - * @return int - */ - public function getRelationId() - { - return $this->_rId; - } - - /** - * Set Image Relation ID - * - * @param int $rId - */ - public function setRelationId($rId) - { - $this->_rId = $rId; - } - - /** - * Get Image Source - * - * @return string - */ - public function getSource() - { - return $this->_src; - } - - /** - * Get Image Media ID - * - * @return string - */ - public function getMediaId() - { - return md5($this->_src); - } - - /** - * Get IsWatermark - * - * @return int - */ - public function getIsWatermark() - { - return $this->_isWatermark; - } - - /** - * Set IsWatermark - * - * @param bool $pValue - */ - public function setIsWatermark($pValue) - { - $this->_isWatermark = $pValue; - } -} diff --git a/Classes/PHPWord/Section/MemoryImage.php b/Classes/PHPWord/Section/MemoryImage.php deleted file mode 100755 index 9d4ed97c0e..0000000000 --- a/Classes/PHPWord/Section/MemoryImage.php +++ /dev/null @@ -1,232 +0,0 @@ -_imageType = $imgData['mime']; - - $_supportedImageTypes = array('image/jpeg', 'image/gif', 'image/png'); - - if (in_array($this->_imageType, $_supportedImageTypes)) { - $this->_src = $src; - $this->_style = new PHPWord_Style_Image(); - - if (!is_null($style) && is_array($style)) { - foreach ($style as $key => $value) { - if (substr($key, 0, 1) != '_') { - $key = '_' . $key; - } - $this->_style->setStyleValue($key, $value); - } - } - - if ($this->_style->getWidth() == null && $this->_style->getHeight() == null) { - $this->_style->setWidth($imgData[0]); - $this->_style->setHeight($imgData[1]); - } - - $this->_setFunctions(); - } - } - - /** - * Set Functions - */ - private function _setFunctions() - { - switch ($this->_imageType) { - case 'image/png': - $this->_imageCreateFunc = 'imagecreatefrompng'; - $this->_imageFunc = 'imagepng'; - $this->_imageExtension = 'png'; - break; - case 'image/gif': - $this->_imageCreateFunc = 'imagecreatefromgif'; - $this->_imageFunc = 'imagegif'; - $this->_imageExtension = 'gif'; - break; - case 'image/jpeg': - case 'image/jpg': - $this->_imageCreateFunc = 'imagecreatefromjpeg'; - $this->_imageFunc = 'imagejpeg'; - $this->_imageExtension = 'jpg'; - break; - } - } - - /** - * Get Image style - * - * @return PHPWord_Style_Image - */ - public function getStyle() - { - return $this->_style; - } - - /** - * Get Image Relation ID - * - * @return int - */ - public function getRelationId() - { - return $this->_rId; - } - - /** - * Set Image Relation ID - * - * @param int $rId - */ - public function setRelationId($rId) - { - $this->_rId = $rId; - } - - /** - * Get Image Source - * - * @return string - */ - public function getSource() - { - return $this->_src; - } - - /** - * Get Image Media ID - * - * @return string - */ - public function getMediaId() - { - return md5($this->_src); - } - - /** - * Get Image Type - * - * @return string - */ - public function getImageType() - { - return $this->_imageType; - } - - /** - * Get Image Create Function - * - * @return string - */ - public function getImageCreateFunction() - { - return $this->_imageCreateFunc; - } - - /** - * Get Image Function - * - * @return string - */ - public function getImageFunction() - { - return $this->_imageFunc; - } - - /** - * Get Image Extension - * - * @return string - */ - public function getImageExtension() - { - return $this->_imageExtension; - } -} diff --git a/Classes/PHPWord/Shared/File.php b/Classes/PHPWord/Shared/File.php deleted file mode 100755 index 4ed0e72530..0000000000 --- a/Classes/PHPWord/Shared/File.php +++ /dev/null @@ -1,128 +0,0 @@ - 0) { - unset($pathArray[$i]); - unset($pathArray[$i - 1]); - break; - } - } - } - $returnValue = implode('/', $pathArray); - } - - return $returnValue; - } - - /** - * PHP Words version of exif_imagetype to return the Image Type from a file - * - * @param string $filename - * @return int|bool - */ - private static function fallbackImagetype($filename) - { - if ((list($width, $height, $type, $attr) = getimagesize($filename)) !== false) { - if ($type === 2) { - return self::IMAGETYPE_JPEG; - } elseif ($type === 1) { - return self::IMAGETYPE_GIF; - } elseif ($type === 3) { - return self::IMAGETYPE_PNG; - } elseif ($type === 6) { - return self::IMAGETYPE_BMP; - } elseif ($type === 7 || $type === 8) { - return self::IMAGETYPE_TIFF; - } - } - return false; - } - - /** - * Return the Image Type from a file - * - * @param string $filename - * @param bool $userFallbackFunction - * @return int|bool - */ - public static function imagetype($filename, $userFallbackFunction = false) - { - if ($userFallbackFunction || !function_exists('exif_imagetype')) { - return self::fallbackImagetype($filename); - } - - $imagetype = exif_imagetype($filename); - if ($imagetype === IMAGETYPE_JPEG) { - return self::IMAGETYPE_JPEG; - } elseif ($imagetype === IMAGETYPE_GIF) { - return self::IMAGETYPE_GIF; - } elseif ($imagetype === IMAGETYPE_PNG) { - return self::IMAGETYPE_PNG; - } elseif ($imagetype === IMAGETYPE_BMP) { - return self::IMAGETYPE_BMP; - } elseif ($imagetype === IMAGETYPE_TIFF_II || $imagetype === IMAGETYPE_TIFF_MM) { - return self::IMAGETYPE_TIFF; - } - return false; - } -} \ No newline at end of file diff --git a/Classes/PHPWord/Style/Table.php b/Classes/PHPWord/Style/Table.php deleted file mode 100755 index c3ef2e0140..0000000000 --- a/Classes/PHPWord/Style/Table.php +++ /dev/null @@ -1,96 +0,0 @@ -_cellMarginTop = null; - $this->_cellMarginLeft = null; - $this->_cellMarginRight = null; - $this->_cellMarginBottom = null; - } - - public function setStyleValue($key, $value) - { - $this->$key = $value; - } - - public function setCellMarginTop($pValue = null) - { - $this->_cellMarginTop = $pValue; - } - - public function getCellMarginTop() - { - return $this->_cellMarginTop; - } - - public function setCellMarginLeft($pValue = null) - { - $this->_cellMarginLeft = $pValue; - } - - public function getCellMarginLeft() - { - return $this->_cellMarginLeft; - } - - public function setCellMarginRight($pValue = null) - { - $this->_cellMarginRight = $pValue; - } - - public function getCellMarginRight() - { - return $this->_cellMarginRight; - } - - public function setCellMarginBottom($pValue = null) - { - $this->_cellMarginBottom = $pValue; - } - - public function getCellMarginBottom() - { - return $this->_cellMarginBottom; - } - - public function getCellMargin() - { - return array($this->_cellMarginTop, $this->_cellMarginLeft, $this->_cellMarginRight, $this->_cellMarginBottom); - } -} diff --git a/Classes/PHPWord/Writer/ODText/Content.php b/Classes/PHPWord/Writer/ODText/Content.php deleted file mode 100755 index 0899990b16..0000000000 --- a/Classes/PHPWord/Writer/ODText/Content.php +++ /dev/null @@ -1,397 +0,0 @@ -getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0', 'UTF-8'); - - // office:document-content - $objWriter->startElement('office:document-content'); - $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0'); - $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0'); - $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0'); - $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0'); - $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0'); - $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0'); - $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); - $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); - $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0'); - $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0'); - $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0'); - $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0'); - $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0'); - $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML'); - $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0'); - $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0'); - $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office'); - $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer'); - $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc'); - $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events'); - $objWriter->writeAttribute('xmlns:xforms', 'http://www.w3.org/2002/xforms'); - $objWriter->writeAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema'); - $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report'); - $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2'); - $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml'); - $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#'); - $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table'); - $objWriter->writeAttribute('xmlns:field', 'urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0'); - $objWriter->writeAttribute('xmlns:formx', 'urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0'); - $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/'); - $objWriter->writeAttribute('office:version', '1.2'); - - // We firstly search all fonts used - $_sections = $pPHPWord->getSections(); - $countSections = count($_sections); - if ($countSections > 0) { - $pSection = 0; - $numPStyles = 0; - $numFStyles = 0; - - foreach ($_sections as $section) { - $pSection++; - $_elements = $section->getElements(); - - foreach ($_elements as $element) { - if ($element instanceof PHPWord_Section_Text) { - $fStyle = $element->getFontStyle(); - $pStyle = $element->getParagraphStyle(); - - if ($fStyle instanceof PHPWord_Style_Font) { - $numFStyles++; - - $arrStyle = array( - 'color' => $fStyle->getColor(), - 'name' => $fStyle->getName() - ); - $pPHPWord->addFontStyle('T' . $numFStyles, $arrStyle); - $element->setFontStyle('T' . $numFStyles); - } elseif ($pStyle instanceof PHPWord_Style_Paragraph) { - $numPStyles++; - - $pPHPWord->addParagraphStyle('P' . $numPStyles, array()); - $element->setParagraphStyle('P' . $numPStyles); - } - } - } - } - } - - // office:font-face-decls - $objWriter->startElement('office:font-face-decls'); - $arrFonts = array(); - - $styles = PHPWord_Style::getStyles(); - $numFonts = 0; - if (count($styles) > 0) { - foreach ($styles as $styleName => $style) { - // PHPWord_Style_Font - if ($style instanceof PHPWord_Style_Font) { - $numFonts++; - $name = $style->getName(); - if (!in_array($name, $arrFonts)) { - $arrFonts[] = $name; - - // style:font-face - $objWriter->startElement('style:font-face'); - $objWriter->writeAttribute('style:name', $name); - $objWriter->writeAttribute('svg:font-family', $name); - $objWriter->endElement(); - } - } - } - if (!in_array(PHPWord::DEFAULT_FONT_NAME, $arrFonts)) { - $objWriter->startElement('style:font-face'); - $objWriter->writeAttribute('style:name', PHPWord::DEFAULT_FONT_NAME); - $objWriter->writeAttribute('svg:font-family', PHPWord::DEFAULT_FONT_NAME); - $objWriter->endElement(); - } - } - $objWriter->endElement(); - - $objWriter->startElement('office:automatic-styles'); - $styles = PHPWord_Style::getStyles(); - $numPStyles = 0; - if (count($styles) > 0) { - foreach ($styles as $styleName => $style) { - if (preg_match('#^T[0-9]+$#', $styleName) != 0 - || preg_match('#^P[0-9]+$#', $styleName) != 0 - ) { - // PHPWord_Style_Font - if ($style instanceof PHPWord_Style_Font) { - $objWriter->startElement('style:style'); - $objWriter->writeAttribute('style:name', $styleName); - $objWriter->writeAttribute('style:family', 'text'); - // style:text-properties - $objWriter->startElement('style:text-properties'); - $objWriter->writeAttribute('fo:color', '#' . $style->getColor()); - $objWriter->writeAttribute('style:font-name', $style->getName()); - $objWriter->writeAttribute('style:font-name-complex', $style->getName()); - $objWriter->endElement(); - $objWriter->endElement(); - } - if ($style instanceof PHPWord_Style_Paragraph) { - $numPStyles++; - // style:style - $objWriter->startElement('style:style'); - $objWriter->writeAttribute('style:name', $styleName); - $objWriter->writeAttribute('style:family', 'paragraph'); - $objWriter->writeAttribute('style:parent-style-name', 'Standard'); - $objWriter->writeAttribute('style:master-page-name', 'Standard'); - // style:paragraph-properties - $objWriter->startElement('style:paragraph-properties'); - $objWriter->writeAttribute('style:page-number', 'auto'); - $objWriter->endElement(); - $objWriter->endElement(); - } - } - } - - if ($numPStyles == 0) { - // style:style - $objWriter->startElement('style:style'); - $objWriter->writeAttribute('style:name', 'P1'); - $objWriter->writeAttribute('style:family', 'paragraph'); - $objWriter->writeAttribute('style:parent-style-name', 'Standard'); - $objWriter->writeAttribute('style:master-page-name', 'Standard'); - // style:paragraph-properties - $objWriter->startElement('style:paragraph-properties'); - $objWriter->writeAttribute('style:page-number', 'auto'); - $objWriter->endElement(); - $objWriter->endElement(); - } - } - $objWriter->endElement(); - - // office:body - $objWriter->startElement('office:body'); - // office:text - $objWriter->startElement('office:text'); - // text:sequence-decls - $objWriter->startElement('text:sequence-decls'); - // text:sequence-decl - $objWriter->startElement('text:sequence-decl'); - $objWriter->writeAttribute('text:display-outline-level', 0); - $objWriter->writeAttribute('text:name', 'Illustration'); - $objWriter->endElement(); - // text:sequence-decl - $objWriter->startElement('text:sequence-decl'); - $objWriter->writeAttribute('text:display-outline-level', 0); - $objWriter->writeAttribute('text:name', 'Table'); - $objWriter->endElement(); - // text:sequence-decl - $objWriter->startElement('text:sequence-decl'); - $objWriter->writeAttribute('text:display-outline-level', 0); - $objWriter->writeAttribute('text:name', 'Text'); - $objWriter->endElement(); - // text:sequence-decl - $objWriter->startElement('text:sequence-decl'); - $objWriter->writeAttribute('text:display-outline-level', 0); - $objWriter->writeAttribute('text:name', 'Drawing'); - $objWriter->endElement(); - $objWriter->endElement(); - - $_sections = $pPHPWord->getSections(); - $countSections = count($_sections); - $pSection = 0; - - if ($countSections > 0) { - foreach ($_sections as $section) { - $pSection++; - - $_elements = $section->getElements(); - - foreach ($_elements as $element) { - if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_TextRun) { - $this->_writeTextRun($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_TextBreak) { - $this->_writeTextBreak($objWriter); - } elseif ($element instanceof PHPWord_Section_Link) { - $this->writeUnsupportedElement($objWriter, 'Link'); - } elseif ($element instanceof PHPWord_Section_Title) { - $this->writeUnsupportedElement($objWriter, 'Title'); - } elseif ($element instanceof PHPWord_Section_PageBreak) { - $this->writeUnsupportedElement($objWriter, 'Page Break'); - } elseif ($element instanceof PHPWord_Section_Table) { - $this->writeUnsupportedElement($objWriter, 'Table'); - } elseif ($element instanceof PHPWord_Section_ListItem) { - $this->writeUnsupportedElement($objWriter, 'List Item'); - } elseif ($element instanceof PHPWord_Section_Image || - $element instanceof PHPWord_Section_MemoryImage) { - $this->writeUnsupportedElement($objWriter, 'Image'); - } elseif ($element instanceof PHPWord_Section_Object) { - $this->writeUnsupportedElement($objWriter, 'Object'); - } elseif ($element instanceof PHPWord_TOC) { - $this->writeUnsupportedElement($objWriter, 'TOC'); - } else { - $this->writeUnsupportedElement($objWriter, 'Element'); - } - } - - if ($pSection == $countSections) { - $this->_writeEndSection($objWriter, $section); - } else { - $this->_writeSection($objWriter, $section); - } - } - } - $objWriter->endElement(); - $objWriter->endElement(); - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - /** - * Write text - * - * @param PHPWord_Shared_XMLWriter $objWriter - * @param PHPWord_Section_Text $text - * @param bool $withoutP - */ - protected function _writeText( - PHPWord_Shared_XMLWriter $objWriter = null, - PHPWord_Section_Text $text, - $withoutP = false - ) { - $styleFont = $text->getFontStyle(); - $styleParagraph = $text->getParagraphStyle(); - - // @todo Commented for TextRun. Should really checkout this value - // $SfIsObject = ($styleFont instanceof PHPWord_Style_Font) ? true : false; - $SfIsObject = false; - - if ($SfIsObject) { - // Don't never be the case, because I browse all sections for cleaning all styles not declared - die('PHPWord : $SfIsObject wouldn\'t be an object'); - } else { - if (!$withoutP) { - $objWriter->startElement('text:p'); // text:p - } - if (empty($styleFont)) { - if (empty($styleParagraph)) { - $objWriter->writeAttribute('text:style-name', 'P1'); - } else { - $objWriter->writeAttribute('text:style-name', $text->getParagraphStyle()); - } - $objWriter->writeRaw($text->getText()); - } else { - if (empty($styleParagraph)) { - $objWriter->writeAttribute('text:style-name', 'Standard'); - } else { - $objWriter->writeAttribute('text:style-name', $text->getParagraphStyle()); - } - // text:span - $objWriter->startElement('text:span'); - $objWriter->writeAttribute('text:style-name', $styleFont); - $objWriter->writeRaw($text->getText()); - $objWriter->endElement(); - } - if (!$withoutP) { - $objWriter->endElement(); // text:p - } - } - } - - /** - * Write TextRun section - * - * @param PHPWord_Shared_XMLWriter $objWriter - * @param PHPWord_Section_TextRun $textrun - * @todo Enable all other section types - */ - protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_TextRun $textrun) - { - $elements = $textrun->getElements(); - $objWriter->startElement('text:p'); - if (count($elements) > 0) { - foreach ($elements as $element) { - if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element, true); - } - } - } - $objWriter->endElement(); - } - - /** - * Write TextBreak - */ - protected function _writeTextBreak(PHPWord_Shared_XMLWriter $objWriter = null) - { - $objWriter->startElement('text:p'); - $objWriter->writeAttribute('text:style-name', 'Standard'); - $objWriter->endElement(); - } - - // @codeCoverageIgnoreStart - private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section = null) - { - } - - private function _writeSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section = null) - { - } - // @codeCoverageIgnoreEnd - - /** - * Write unsupported element - * - * @param PHPWord_Shared_XMLWriter $objWriter - * @param string $element - */ - private function writeUnsupportedElement($objWriter, $element) - { - $objWriter->startElement('text:p'); - $objWriter->writeRaw("{$element}"); - $objWriter->endElement(); - } -} diff --git a/Classes/PHPWord/Writer/ODText/Meta.php b/Classes/PHPWord/Writer/ODText/Meta.php deleted file mode 100755 index 5397861496..0000000000 --- a/Classes/PHPWord/Writer/ODText/Meta.php +++ /dev/null @@ -1,94 +0,0 @@ -getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0', 'UTF-8'); - - // office:document-meta - $objWriter->startElement('office:document-meta'); - $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0'); - $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); - $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); - $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0'); - $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office'); - $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#'); - $objWriter->writeAttribute('office:version', '1.2'); - - // office:meta - $objWriter->startElement('office:meta'); - - // dc:creator - $objWriter->writeElement('dc:creator', $pPHPWord->getProperties()->getLastModifiedBy()); - // dc:date - $objWriter->writeElement('dc:date', gmdate('Y-m-d\TH:i:s.000', $pPHPWord->getProperties()->getModified())); - // dc:description - $objWriter->writeElement('dc:description', $pPHPWord->getProperties()->getDescription()); - // dc:subject - $objWriter->writeElement('dc:subject', $pPHPWord->getProperties()->getSubject()); - // dc:title - $objWriter->writeElement('dc:title', $pPHPWord->getProperties()->getTitle()); - // meta:creation-date - $objWriter->writeElement('meta:creation-date', gmdate('Y-m-d\TH:i:s.000', $pPHPWord->getProperties()->getCreated())); - // meta:initial-creator - $objWriter->writeElement('meta:initial-creator', $pPHPWord->getProperties()->getCreator()); - // meta:keyword - $objWriter->writeElement('meta:keyword', $pPHPWord->getProperties()->getKeywords()); - - // @todo : Where these properties are written ? - // $pPHPWord->getProperties()->getCategory() - // $pPHPWord->getProperties()->getCompany() - - $objWriter->endElement(); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } -} diff --git a/Classes/PHPWord/Writer/ODText/Styles.php b/Classes/PHPWord/Writer/ODText/Styles.php deleted file mode 100755 index b5f87332d6..0000000000 --- a/Classes/PHPWord/Writer/ODText/Styles.php +++ /dev/null @@ -1,267 +0,0 @@ -getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0', 'UTF-8'); - - // Styles:Styles - $objWriter->startElement('office:document-styles'); - $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0'); - $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0'); - $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0'); - $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0'); - $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0'); - $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0'); - $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); - $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); - $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0'); - $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0'); - $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0'); - $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0'); - $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0'); - $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML'); - $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0'); - $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0'); - $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office'); - $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer'); - $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc'); - $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events'); - $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report'); - $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2'); - $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml'); - $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#'); - $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table'); - $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/'); - $objWriter->writeAttribute('office:version', '1.2'); - - - // office:font-face-decls - $objWriter->startElement('office:font-face-decls'); - $arrFonts = array(); - $styles = PHPWord_Style::getStyles(); - $numFonts = 0; - if (count($styles) > 0) { - foreach ($styles as $styleName => $style) { - // PHPWord_Style_Font - if ($style instanceof PHPWord_Style_Font) { - $numFonts++; - $name = $style->getName(); - if (!in_array($name, $arrFonts)) { - $arrFonts[] = $name; - - // style:font-face - $objWriter->startElement('style:font-face'); - $objWriter->writeAttribute('style:name', $name); - $objWriter->writeAttribute('svg:font-family', $name); - $objWriter->endElement(); - } - } - } - } - if (!in_array(PHPWord::DEFAULT_FONT_NAME, $arrFonts)) { - $objWriter->startElement('style:font-face'); - $objWriter->writeAttribute('style:name', PHPWord::DEFAULT_FONT_NAME); - $objWriter->writeAttribute('svg:font-family', PHPWord::DEFAULT_FONT_NAME); - $objWriter->endElement(); - } - $objWriter->endElement(); - - // office:styles - $objWriter->startElement('office:styles'); - - // style:default-style - $objWriter->startElement('style:default-style'); - $objWriter->writeAttribute('style:family', 'paragraph'); - - // style:paragraph-properties - $objWriter->startElement('style:paragraph-properties'); - $objWriter->writeAttribute('fo:hyphenation-ladder-count', 'no-limit'); - $objWriter->writeAttribute('style:text-autospace', 'ideograph-alpha'); - $objWriter->writeAttribute('style:punctuation-wrap', 'hanging'); - $objWriter->writeAttribute('style:line-break', 'strict'); - $objWriter->writeAttribute('style:tab-stop-distance', '1.249cm'); - $objWriter->writeAttribute('style:writing-mode', 'page'); - $objWriter->endElement(); - - // style:text-properties - $objWriter->startElement('style:text-properties'); - $objWriter->writeAttribute('style:use-window-font-color', 'true'); - $objWriter->writeAttribute('style:font-name', PHPWord::DEFAULT_FONT_NAME); - $objWriter->writeAttribute('fo:font-size', PHPWord::DEFAULT_FONT_SIZE . 'pt'); - $objWriter->writeAttribute('fo:language', 'fr'); - $objWriter->writeAttribute('fo:country', 'FR'); - $objWriter->writeAttribute('style:letter-kerning', 'true'); - $objWriter->writeAttribute('style:font-name-asian', PHPWord::DEFAULT_FONT_NAME . '2'); - $objWriter->writeAttribute('style:font-size-asian', PHPWord::DEFAULT_FONT_SIZE . 'pt'); - $objWriter->writeAttribute('style:language-asian', 'zh'); - $objWriter->writeAttribute('style:country-asian', 'CN'); - $objWriter->writeAttribute('style:font-name-complex', PHPWord::DEFAULT_FONT_NAME . '2'); - $objWriter->writeAttribute('style:font-size-complex', PHPWord::DEFAULT_FONT_SIZE . 'pt'); - $objWriter->writeAttribute('style:language-complex', 'hi'); - $objWriter->writeAttribute('style:country-complex', 'IN'); - $objWriter->writeAttribute('fo:hyphenate', 'false'); - $objWriter->writeAttribute('fo:hyphenation-remain-char-count', '2'); - $objWriter->writeAttribute('fo:hyphenation-push-char-count', '2'); - $objWriter->endElement(); - - $objWriter->endElement(); - - // Write Style Definitions - $styles = PHPWord_Style::getStyles(); - if (count($styles) > 0) { - foreach ($styles as $styleName => $style) { - if (preg_match('#^T[0-9]+$#', $styleName) == 0 - && preg_match('#^P[0-9]+$#', $styleName) == 0 - ) { - // PHPWord_Style_Font - if ($style instanceof PHPWord_Style_Font) { - // style:style - $objWriter->startElement('style:style'); - $objWriter->writeAttribute('style:name', $styleName); - $objWriter->writeAttribute('style:family', 'text'); - - // style:text-properties - $objWriter->startElement('style:text-properties'); - $objWriter->writeAttribute('fo:font-size', ($style->getSize()) . 'pt'); - $objWriter->writeAttribute('style:font-size-asian', ($style->getSize()) . 'pt'); - $objWriter->writeAttribute('style:font-size-complex', ($style->getSize()) . 'pt'); - if ($style->getItalic()) { - $objWriter->writeAttribute('fo:font-style', 'italic'); - $objWriter->writeAttribute('style:font-style-asian', 'italic'); - $objWriter->writeAttribute('style:font-style-complex', 'italic'); - } - if ($style->getBold()) { - $objWriter->writeAttribute('fo:font-weight', 'bold'); - $objWriter->writeAttribute('style:font-weight-asian', 'bold'); - } - $objWriter->endElement(); - $objWriter->endElement(); - } elseif ($style instanceof PHPWord_Style_Paragraph) { - // PHPWord_Style_Paragraph - // style:style - $objWriter->startElement('style:style'); - $objWriter->writeAttribute('style:name', $styleName); - $objWriter->writeAttribute('style:family', 'paragraph'); - - //style:paragraph-properties - $objWriter->startElement('style:paragraph-properties'); - $objWriter->writeAttribute('fo:margin-top', ((is_null($style->getSpaceBefore())) ? '0' : round(17.6 / $style->getSpaceBefore(), 2)) . 'cm'); - $objWriter->writeAttribute('fo:margin-bottom', ((is_null($style->getSpaceAfter())) ? '0' : round(17.6 / $style->getSpaceAfter(), 2)) . 'cm'); - $objWriter->writeAttribute('fo:text-align', $style->getAlign()); - $objWriter->endElement(); - - $objWriter->endElement(); - } elseif ($style instanceof PHPWord_Style_TableFull) { - // PHPWord_Style_TableFull - } - } - } - } - $objWriter->endElement(); - - // office:automatic-styles - $objWriter->startElement('office:automatic-styles'); - // style:page-layout - $objWriter->startElement('style:page-layout'); - $objWriter->writeAttribute('style:name', 'Mpm1'); - // style:page-layout-properties - $objWriter->startElement('style:page-layout-properties'); - $objWriter->writeAttribute('fo:page-width', "21.001cm"); - $objWriter->writeAttribute('fo:page-height', '29.7cm'); - $objWriter->writeAttribute('style:num-format', '1'); - $objWriter->writeAttribute('style:print-orientation', 'portrait'); - $objWriter->writeAttribute('fo:margin-top', '2.501cm'); - $objWriter->writeAttribute('fo:margin-bottom', '2cm'); - $objWriter->writeAttribute('fo:margin-left', '2.501cm'); - $objWriter->writeAttribute('fo:margin-right', '2.501cm'); - $objWriter->writeAttribute('style:writing-mode', 'lr-tb'); - $objWriter->writeAttribute('style:layout-grid-color', '#c0c0c0'); - $objWriter->writeAttribute('style:layout-grid-lines', '25199'); - $objWriter->writeAttribute('style:layout-grid-base-height', '0.423cm'); - $objWriter->writeAttribute('style:layout-grid-ruby-height', '0cm'); - $objWriter->writeAttribute('style:layout-grid-mode', 'none'); - $objWriter->writeAttribute('style:layout-grid-ruby-below', 'false'); - $objWriter->writeAttribute('style:layout-grid-print', 'false'); - $objWriter->writeAttribute('style:layout-grid-display', 'false'); - $objWriter->writeAttribute('style:layout-grid-base-width', '0.37cm'); - $objWriter->writeAttribute('style:layout-grid-snap-to', 'true'); - $objWriter->writeAttribute('style:footnote-max-height', '0cm'); - //style:footnote-sep - $objWriter->startElement('style:footnote-sep'); - $objWriter->writeAttribute('style:width', '0.018cm'); - $objWriter->writeAttribute('style:line-style', 'solid'); - $objWriter->writeAttribute('style:adjustment', 'left'); - $objWriter->writeAttribute('style:rel-width', '25%'); - $objWriter->writeAttribute('style:color', '#000000'); - $objWriter->endElement(); - $objWriter->endElement(); - // style:header-style - $objWriter->startElement('style:header-style'); - $objWriter->endElement(); - // style:footer-style - $objWriter->startElement('style:footer-style'); - $objWriter->endElement(); - $objWriter->endElement(); - $objWriter->endElement(); - - // office:master-styles - $objWriter->startElement('office:master-styles'); - // style:master-page - $objWriter->startElement('style:master-page'); - $objWriter->writeAttribute('style:name', 'Standard'); - $objWriter->writeAttribute('style:page-layout-name', 'Mpm1'); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } -} diff --git a/Classes/PHPWord/Writer/Word2007/Base.php b/Classes/PHPWord/Writer/Word2007/Base.php deleted file mode 100755 index e9249120e5..0000000000 --- a/Classes/PHPWord/Writer/Word2007/Base.php +++ /dev/null @@ -1,1025 +0,0 @@ -getFontStyle(); - - $SfIsObject = ($styleFont instanceof PHPWord_Style_Font) ? true : false; - - if (!$withoutP) { - $objWriter->startElement('w:p'); - - $styleParagraph = $text->getParagraphStyle(); - $SpIsObject = ($styleParagraph instanceof PHPWord_Style_Paragraph) ? true : false; - - if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph); - } elseif (!$SpIsObject && !is_null($styleParagraph)) { - $objWriter->startElement('w:pPr'); - $objWriter->startElement('w:pStyle'); - $objWriter->writeAttribute('w:val', $styleParagraph); - $objWriter->endElement(); - $objWriter->endElement(); - } - } - - $strText = htmlspecialchars($text->getText()); - $strText = PHPWord_Shared_String::ControlCharacterPHP2OOXML($strText); - - $objWriter->startElement('w:r'); - - if ($SfIsObject) { - $this->_writeTextStyle($objWriter, $styleFont); - } elseif (!$SfIsObject && !is_null($styleFont)) { - $objWriter->startElement('w:rPr'); - $objWriter->startElement('w:rStyle'); - $objWriter->writeAttribute('w:val', $styleFont); - $objWriter->endElement(); - $objWriter->endElement(); - } - - $objWriter->startElement('w:t'); - $objWriter->writeAttribute('xml:space', 'preserve'); // needed because of drawing spaces before and after text - $objWriter->writeRaw($strText); - $objWriter->endElement(); - - $objWriter->endElement(); // w:r - - if (!$withoutP) { - $objWriter->endElement(); // w:p - } - } - - /** - * Write text run - */ - protected function _writeTextRun(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_TextRun $textrun) - { - $elements = $textrun->getElements(); - $styleParagraph = $textrun->getParagraphStyle(); - - $SpIsObject = ($styleParagraph instanceof PHPWord_Style_Paragraph) ? true : false; - - $objWriter->startElement('w:p'); - - if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph); - } elseif (!$SpIsObject && !is_null($styleParagraph)) { - $objWriter->startElement('w:pPr'); - $objWriter->startElement('w:pStyle'); - $objWriter->writeAttribute('w:val', $styleParagraph); - $objWriter->endElement(); - $objWriter->endElement(); - } - - if (count($elements) > 0) { - foreach ($elements as $element) { - if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element, true); - } elseif ($element instanceof PHPWord_Section_Link) { - $this->_writeLink($objWriter, $element, true); - } elseif ($element instanceof PHPWord_Section_Image) { - $this->_writeImage($objWriter, $element, true); - } elseif ($element instanceof PHPWord_Section_Footnote) { - $this->_writeFootnoteReference($objWriter, $element, true); - } elseif ($element instanceof PHPWord_Section_TextBreak) { - $objWriter->writeElement('w:br'); - } - } - } - - $objWriter->endElement(); - } - - /** - * Write paragraph style - * - * @param PHPWord_Shared_XMLWriter $objWriter - * @param PHPWord_Style_Paragraph $style - * @param bool $withoutPPR - * @return void - */ - protected function _writeParagraphStyle( - PHPWord_Shared_XMLWriter $objWriter = null, - PHPWord_Style_Paragraph $style, - $withoutPPR = false - ) { - - $align = $style->getAlign(); - $spacing = $style->getSpacing(); - $spaceBefore = $style->getSpaceBefore(); - $spaceAfter = $style->getSpaceAfter(); - $indent = $style->getIndent(); - $hanging = $style->getHanging(); - $tabs = $style->getTabs(); - $widowControl = $style->getWidowControl(); - $keepNext = $style->getKeepNext(); - $keepLines = $style->getKeepLines(); - $pageBreakBefore = $style->getPageBreakBefore(); - - if (!is_null($align) || !is_null($spacing) || !is_null($spaceBefore) || - !is_null($spaceAfter) || !is_null($indent) || !is_null($hanging) || - !is_null($tabs) || !is_null($widowControl) || !is_null($keepNext) || - !is_null($keepLines) || !is_null($pageBreakBefore)) { - if (!$withoutPPR) { - $objWriter->startElement('w:pPr'); - } - - // Alignment - if (!is_null($align)) { - $objWriter->startElement('w:jc'); - $objWriter->writeAttribute('w:val', $align); - $objWriter->endElement(); - } - - // Indentation - if (!is_null($indent) || !is_null($hanging)) { - $objWriter->startElement('w:ind'); - $objWriter->writeAttribute('w:firstLine', 0); - if (!is_null($indent)) { - $objWriter->writeAttribute('w:left', $indent); - } - if (!is_null($hanging)) { - $objWriter->writeAttribute('w:hanging', $hanging); - } - $objWriter->endElement(); - } - - // Spacing - if (!is_null($spaceBefore) || !is_null($spaceAfter) || - !is_null($spacing)) { - $objWriter->startElement('w:spacing'); - if (!is_null($spaceBefore)) { - $objWriter->writeAttribute('w:before', $spaceBefore); - } - if (!is_null($spaceAfter)) { - $objWriter->writeAttribute('w:after', $spaceAfter); - } - if (!is_null($spacing)) { - $objWriter->writeAttribute('w:line', $spacing); - $objWriter->writeAttribute('w:lineRule', 'auto'); - } - $objWriter->endElement(); - } - - // Pagination - if (!$widowControl) { - $objWriter->startElement('w:widowControl'); - $objWriter->writeAttribute('w:val', '0'); - $objWriter->endElement(); - } - if ($keepNext) { - $objWriter->startElement('w:keepNext'); - $objWriter->writeAttribute('w:val', '1'); - $objWriter->endElement(); - } - if ($keepLines) { - $objWriter->startElement('w:keepLines'); - $objWriter->writeAttribute('w:val', '1'); - $objWriter->endElement(); - } - if ($pageBreakBefore) { - $objWriter->startElement('w:pageBreakBefore'); - $objWriter->writeAttribute('w:val', '1'); - $objWriter->endElement(); - } - - // Tabs - if (!is_null($tabs)) { - $tabs->toXml($objWriter); - } - - if (!$withoutPPR) { - $objWriter->endElement(); // w:pPr - } - } - } - - /** - * Write link - */ - protected function _writeLink(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Link $link, $withoutP = false) - { - $rID = $link->getRelationId(); - $linkName = $link->getLinkName(); - if (is_null($linkName)) { - $linkName = $link->getLinkSrc(); - } - - $styleFont = $link->getFontStyle(); - $SfIsObject = ($styleFont instanceof PHPWord_Style_Font) ? true : false; - - if (!$withoutP) { - $objWriter->startElement('w:p'); - - $styleParagraph = $link->getParagraphStyle(); - $SpIsObject = ($styleParagraph instanceof PHPWord_Style_Paragraph) ? true : false; - - if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph); - } elseif (!$SpIsObject && !is_null($styleParagraph)) { - $objWriter->startElement('w:pPr'); - $objWriter->startElement('w:pStyle'); - $objWriter->writeAttribute('w:val', $styleParagraph); - $objWriter->endElement(); - $objWriter->endElement(); - } - } - - $objWriter->startElement('w:hyperlink'); - $objWriter->writeAttribute('r:id', 'rId' . $rID); - $objWriter->writeAttribute('w:history', '1'); - - $objWriter->startElement('w:r'); - if ($SfIsObject) { - $this->_writeTextStyle($objWriter, $styleFont); - } elseif (!$SfIsObject && !is_null($styleFont)) { - $objWriter->startElement('w:rPr'); - $objWriter->startElement('w:rStyle'); - $objWriter->writeAttribute('w:val', $styleFont); - $objWriter->endElement(); - $objWriter->endElement(); - } - - $objWriter->startElement('w:t'); - $objWriter->writeAttribute('xml:space', 'preserve'); // needed because of drawing spaces before and after text - $objWriter->writeRaw($linkName); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->endElement(); - - if (!$withoutP) { - $objWriter->endElement(); // w:p - } - } - - /** - * Write preserve text - */ - protected function _writePreserveText(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footer_PreserveText $textrun) - { - $styleFont = $textrun->getFontStyle(); - $styleParagraph = $textrun->getParagraphStyle(); - - $SfIsObject = ($styleFont instanceof PHPWord_Style_Font) ? true : false; - $SpIsObject = ($styleParagraph instanceof PHPWord_Style_Paragraph) ? true : false; - - $arrText = $textrun->getText(); - if (!is_array($arrText)) { - $arrText = array($arrText); - } - - $objWriter->startElement('w:p'); - - if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph); - } elseif (!$SpIsObject && !is_null($styleParagraph)) { - $objWriter->startElement('w:pPr'); - $objWriter->startElement('w:pStyle'); - $objWriter->writeAttribute('w:val', $styleParagraph); - $objWriter->endElement(); - $objWriter->endElement(); - } - - foreach ($arrText as $text) { - - if (substr($text, 0, 1) == '{') { - $text = substr($text, 1, -1); - - $objWriter->startElement('w:r'); - $objWriter->startElement('w:fldChar'); - $objWriter->writeAttribute('w:fldCharType', 'begin'); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->startElement('w:r'); - - if ($SfIsObject) { - $this->_writeTextStyle($objWriter, $styleFont); - } elseif (!$SfIsObject && !is_null($styleFont)) { - $objWriter->startElement('w:rPr'); - $objWriter->startElement('w:rStyle'); - $objWriter->writeAttribute('w:val', $styleFont); - $objWriter->endElement(); - $objWriter->endElement(); - } - - $objWriter->startElement('w:instrText'); - $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeRaw($text); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->startElement('w:r'); - $objWriter->startElement('w:fldChar'); - $objWriter->writeAttribute('w:fldCharType', 'separate'); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->startElement('w:r'); - $objWriter->startElement('w:fldChar'); - $objWriter->writeAttribute('w:fldCharType', 'end'); - $objWriter->endElement(); - $objWriter->endElement(); - } else { - $text = htmlspecialchars($text); - $text = PHPWord_Shared_String::ControlCharacterPHP2OOXML($text); - - $objWriter->startElement('w:r'); - - if ($SfIsObject) { - $this->_writeTextStyle($objWriter, $styleFont); - } elseif (!$SfIsObject && !is_null($styleFont)) { - $objWriter->startElement('w:rPr'); - $objWriter->startElement('w:rStyle'); - $objWriter->writeAttribute('w:val', $styleFont); - $objWriter->endElement(); - $objWriter->endElement(); - } - - $objWriter->startElement('w:t'); - $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeRaw($text); - $objWriter->endElement(); - $objWriter->endElement(); - } - } - - $objWriter->endElement(); // p - } - - /** - * Write text style - */ - protected function _writeTextStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Font $style) - { - $font = $style->getName(); - $bold = $style->getBold(); - $italic = $style->getItalic(); - $color = $style->getColor(); - $size = $style->getSize(); - $fgColor = $style->getFgColor(); - $strikethrough = $style->getStrikethrough(); - $underline = $style->getUnderline(); - $superscript = $style->getSuperScript(); - $subscript = $style->getSubScript(); - $hint = $style->getHint(); - - $objWriter->startElement('w:rPr'); - - // Font - if ($font != PHPWord::DEFAULT_FONT_NAME) { - $objWriter->startElement('w:rFonts'); - $objWriter->writeAttribute('w:ascii', $font); - $objWriter->writeAttribute('w:hAnsi', $font); - $objWriter->writeAttribute('w:eastAsia', $font); - $objWriter->writeAttribute('w:cs', $font); - //Font Content Type - if ($hint != PHPWord::DEFAULT_FONT_CONTENT_TYPE) { - $objWriter->writeAttribute('w:hint', $hint); - } - $objWriter->endElement(); - } - - - // Color - if ($color != PHPWord::DEFAULT_FONT_COLOR) { - $objWriter->startElement('w:color'); - $objWriter->writeAttribute('w:val', $color); - $objWriter->endElement(); - } - - // Size - if ($size != PHPWord::DEFAULT_FONT_SIZE) { - $objWriter->startElement('w:sz'); - $objWriter->writeAttribute('w:val', $size * 2); - $objWriter->endElement(); - $objWriter->startElement('w:szCs'); - $objWriter->writeAttribute('w:val', $size * 2); - $objWriter->endElement(); - } - - // Bold - if ($bold) { - $objWriter->writeElement('w:b', null); - } - - // Italic - if ($italic) { - $objWriter->writeElement('w:i', null); - $objWriter->writeElement('w:iCs', null); - } - - // Underline - if (!is_null($underline) && $underline != 'none') { - $objWriter->startElement('w:u'); - $objWriter->writeAttribute('w:val', $underline); - $objWriter->endElement(); - } - - // Strikethrough - if ($strikethrough) { - $objWriter->writeElement('w:strike', null); - } - - // Foreground-Color - if (!is_null($fgColor)) { - $objWriter->startElement('w:highlight'); - $objWriter->writeAttribute('w:val', $fgColor); - $objWriter->endElement(); - } - - // Superscript/subscript - if ($superscript || $subscript) { - $objWriter->startElement('w:vertAlign'); - $objWriter->writeAttribute('w:val', $superscript ? 'superscript' : 'subscript'); - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - - /** - * Write text break - * - * @param PHPWord_Shared_XMLWriter $objWriter - * @param PHPWord_Section_TextBreak $element - */ - protected function _writeTextBreak($objWriter, $element = null) - { - $hasStyle = false; - if (!is_null($element)) { - $fontStyle = $element->getFontStyle(); - $sfIsObject = ($fontStyle instanceof PHPWord_Style_Font) ? true : false; - $paragraphStyle = $element->getParagraphStyle(); - $spIsObject = ($paragraphStyle instanceof PHPWord_Style_Paragraph) ? true : false; - $hasStyle = !is_null($fontStyle) || !is_null($paragraphStyle); - } - if ($hasStyle) { - // Paragraph style - $objWriter->startElement('w:p'); - if ($spIsObject) { - $this->_writeParagraphStyle($objWriter, $paragraphStyle); - } elseif (!$spIsObject && !is_null($paragraphStyle)) { - $objWriter->startElement('w:pPr'); - $objWriter->startElement('w:pStyle'); - $objWriter->writeAttribute('w:val', $paragraphStyle); - $objWriter->endElement(); // w:pStyle - $objWriter->endElement(); // w:pPr - } - // Font style - if (!is_null($fontStyle)) { - $objWriter->startElement('w:pPr'); - if ($sfIsObject) { - $this->_writeTextStyle($objWriter, $fontStyle); - } elseif (!$sfIsObject && !is_null($fontStyle)) { - $objWriter->startElement('w:rPr'); - $objWriter->startElement('w:rStyle'); - $objWriter->writeAttribute('w:val', $fontStyle); - $objWriter->endElement(); // w:rStyle - $objWriter->endElement(); // w:rPr - } - $objWriter->endElement(); // w:pPr - } - $objWriter->endElement(); // w:p - } else { - // Null element. No paragraph nor font style - $objWriter->writeElement('w:p', null); - } - } - - /** - * Write table - */ - protected function _writeTable(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Table $table) - { - $_rows = $table->getRows(); - $_cRows = count($_rows); - - if ($_cRows > 0) { - $objWriter->startElement('w:tbl'); - $tblStyle = $table->getStyle(); - $tblWidth = $table->getWidth(); - if ($tblStyle instanceof PHPWord_Style_Table) { - $this->_writeTableStyle($objWriter, $tblStyle); - } else { - if (!empty($tblStyle)) { - $objWriter->startElement('w:tblPr'); - $objWriter->startElement('w:tblStyle'); - $objWriter->writeAttribute('w:val', $tblStyle); - $objWriter->endElement(); - if (!is_null($tblWidth)) { - $objWriter->startElement('w:tblW'); - $objWriter->writeAttribute('w:w', $tblWidth); - $objWriter->writeAttribute('w:type', 'pct'); - $objWriter->endElement(); - } - $objWriter->endElement(); - } - } - - for ($i = 0; $i < $_cRows; $i++) { - $row = $_rows[$i]; - $height = $row->getHeight(); - $rowStyle = $row->getStyle(); - $tblHeader = $rowStyle->getTblHeader(); - $cantSplit = $rowStyle->getCantSplit(); - - $objWriter->startElement('w:tr'); - - if (!is_null($height) || !is_null($tblHeader) || !is_null($cantSplit)) { - $objWriter->startElement('w:trPr'); - if (!is_null($height)) { - $objWriter->startElement('w:trHeight'); - $objWriter->writeAttribute('w:val', $height); - $objWriter->endElement(); - } - if ($tblHeader) { - $objWriter->startElement('w:tblHeader'); - $objWriter->writeAttribute('w:val', '1'); - $objWriter->endElement(); - } - if ($cantSplit) { - $objWriter->startElement('w:cantSplit'); - $objWriter->writeAttribute('w:val', '1'); - $objWriter->endElement(); - } - $objWriter->endElement(); - } - - foreach ($row->getCells() as $cell) { - $objWriter->startElement('w:tc'); - - $cellStyle = $cell->getStyle(); - $width = $cell->getWidth(); - - $objWriter->startElement('w:tcPr'); - $objWriter->startElement('w:tcW'); - $objWriter->writeAttribute('w:w', $width); - $objWriter->writeAttribute('w:type', 'dxa'); - $objWriter->endElement(); - - if ($cellStyle instanceof PHPWord_Style_Cell) { - $this->_writeCellStyle($objWriter, $cellStyle); - } - - $objWriter->endElement(); - - $_elements = $cell->getElements(); - if (count($_elements) > 0) { - foreach ($_elements as $element) { - if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_TextRun) { - $this->_writeTextRun($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Link) { - $this->_writeLink($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_TextBreak) { - $this->_writeTextBreak($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_ListItem) { - $this->_writeListItem($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Image || - $element instanceof PHPWord_Section_MemoryImage - ) { - $this->_writeImage($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Object) { - $this->_writeObject($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Footer_PreserveText) { - $this->_writePreserveText($objWriter, $element); - } - } - } else { - $this->_writeTextBreak($objWriter); - } - - $objWriter->endElement(); - } - $objWriter->endElement(); - } - $objWriter->endElement(); - } - } - - /** - * Write table style - */ - 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; - $mRight = (!is_null($margins[2])) ? true : false; - $mBottom = (!is_null($margins[3])) ? true : false; - - if ($mTop || $mLeft || $mRight || $mBottom) { - $objWriter->startElement('w:tblPr'); - $objWriter->startElement('w:tblCellMar'); - - if ($mTop) { - $objWriter->startElement('w:top'); - $objWriter->writeAttribute('w:w', $margins[0]); - $objWriter->writeAttribute('w:type', 'dxa'); - $objWriter->endElement(); - } - - if ($mLeft) { - $objWriter->startElement('w:left'); - $objWriter->writeAttribute('w:w', $margins[1]); - $objWriter->writeAttribute('w:type', 'dxa'); - $objWriter->endElement(); - } - - if ($mRight) { - $objWriter->startElement('w:right'); - $objWriter->writeAttribute('w:w', $margins[2]); - $objWriter->writeAttribute('w:type', 'dxa'); - $objWriter->endElement(); - } - - if ($mBottom) { - $objWriter->startElement('w:bottom'); - $objWriter->writeAttribute('w:w', $margins[3]); - $objWriter->writeAttribute('w:type', 'dxa'); - $objWriter->endElement(); - } - - $objWriter->endElement(); - $objWriter->endElement(); - } - } - - /** - * Write cell style - */ - protected function _writeCellStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_Cell $style = null) - { - $bgColor = $style->getBgColor(); - $valign = $style->getVAlign(); - $textDir = $style->getTextDirection(); - $brdSz = $style->getBorderSize(); - $brdCol = $style->getBorderColor(); - - $bTop = (!is_null($brdSz[0])) ? true : false; - $bLeft = (!is_null($brdSz[1])) ? true : false; - $bRight = (!is_null($brdSz[2])) ? true : false; - $bBottom = (!is_null($brdSz[3])) ? true : false; - $borders = ($bTop || $bLeft || $bRight || $bBottom) ? true : false; - - $styles = (!is_null($bgColor) || !is_null($valign) || !is_null($textDir) || $borders) ? true : false; - - if ($styles) { - if (!is_null($textDir)) { - $objWriter->startElement('w:textDirection'); - $objWriter->writeAttribute('w:val', $textDir); - $objWriter->endElement(); - } - - if (!is_null($bgColor)) { - $objWriter->startElement('w:shd'); - $objWriter->writeAttribute('w:val', 'clear'); - $objWriter->writeAttribute('w:color', 'auto'); - $objWriter->writeAttribute('w:fill', $bgColor); - $objWriter->endElement(); - } - - if (!is_null($valign)) { - $objWriter->startElement('w:vAlign'); - $objWriter->writeAttribute('w:val', $valign); - $objWriter->endElement(); - } - - if ($borders) { - $_defaultColor = $style->getDefaultBorderColor(); - - $objWriter->startElement('w:tcBorders'); - if ($bTop) { - if (is_null($brdCol[0])) { - $brdCol[0] = $_defaultColor; - } - $objWriter->startElement('w:top'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[0]); - $objWriter->writeAttribute('w:color', $brdCol[0]); - $objWriter->endElement(); - } - - if ($bLeft) { - if (is_null($brdCol[1])) { - $brdCol[1] = $_defaultColor; - } - $objWriter->startElement('w:left'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[1]); - $objWriter->writeAttribute('w:color', $brdCol[1]); - $objWriter->endElement(); - } - - if ($bRight) { - if (is_null($brdCol[2])) { - $brdCol[2] = $_defaultColor; - } - $objWriter->startElement('w:right'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[2]); - $objWriter->writeAttribute('w:color', $brdCol[2]); - $objWriter->endElement(); - } - - if ($bBottom) { - if (is_null($brdCol[3])) { - $brdCol[3] = $_defaultColor; - } - $objWriter->startElement('w:bottom'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[3]); - $objWriter->writeAttribute('w:color', $brdCol[3]); - $objWriter->endElement(); - } - - $objWriter->endElement(); - } - } - $gridSpan = $style->getGridSpan(); - if (!is_null($gridSpan)) { - $objWriter->startElement('w:gridSpan'); - $objWriter->writeAttribute('w:val', $gridSpan); - $objWriter->endElement(); - } - - $vMerge = $style->getVMerge(); - if (!is_null($vMerge)) { - $objWriter->startElement('w:vMerge'); - $objWriter->writeAttribute('w:val', $vMerge); - $objWriter->endElement(); - } - } - - /** - * @param \PHPWord_Shared_XMLWriter $objWriter - * @param \PHPWord_Section_Image|\PHPWord_Section_MemoryImage $image - */ - protected function _writeImage(PHPWord_Shared_XMLWriter $objWriter = null, $image, $withoutP = false) - { - $rId = $image->getRelationId(); - - $style = $image->getStyle(); - $width = $style->getWidth(); - $height = $style->getHeight(); - $align = $style->getAlign(); - $marginTop = $style->getMarginTop(); - $marginLeft = $style->getMarginLeft(); - $wrappingStyle = $style->getWrappingStyle(); - - if (!$withoutP) { - $objWriter->startElement('w:p'); - - if (!is_null($align)) { - $objWriter->startElement('w:pPr'); - $objWriter->startElement('w:jc'); - $objWriter->writeAttribute('w:val', $align); - $objWriter->endElement(); - $objWriter->endElement(); - } - } - - $objWriter->startElement('w:r'); - - $objWriter->startElement('w:pict'); - - $objWriter->startElement('v:shape'); - $objWriter->writeAttribute('type', '#_x0000_t75'); - - $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); - $objWriter->writeAttribute('o:title', ''); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - if (!$withoutP) { - $objWriter->endElement(); // w:p - } - } - - /** - * Write watermark - */ - protected function _writeWatermark(PHPWord_Shared_XMLWriter $objWriter = null, $image) - { - $rId = $image->getRelationId(); - - $style = $image->getStyle(); - $width = $style->getWidth(); - $height = $style->getHeight(); - $marginLeft = $style->getMarginLeft(); - $marginTop = $style->getMarginTop(); - - $objWriter->startElement('w:p'); - - $objWriter->startElement('w:r'); - - $objWriter->startElement('w:pict'); - - $objWriter->startElement('v:shape'); - $objWriter->writeAttribute('type', '#_x0000_t75'); - - $strStyle = 'position:absolute;'; - $strStyle .= ' width:' . $width . 'px;'; - $strStyle .= ' height:' . $height . 'px;'; - if (!is_null($marginTop)) { - $strStyle .= ' margin-top:' . $marginTop . 'px;'; - } - if (!is_null($marginLeft)) { - $strStyle .= ' margin-left:' . $marginLeft . 'px;'; - } - - $objWriter->writeAttribute('style', $strStyle); - - $objWriter->startElement('v:imagedata'); - $objWriter->writeAttribute('r:id', 'rId' . $rId); - $objWriter->writeAttribute('o:title', ''); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - } - - /** - * Write 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(); - $bookmarkId = $title->getBookmarkId(); - $style = $title->getStyle(); - - $objWriter->startElement('w:p'); - - if (!empty($style)) { - $objWriter->startElement('w:pPr'); - $objWriter->startElement('w:pStyle'); - $objWriter->writeAttribute('w:val', $style); - $objWriter->endElement(); - $objWriter->endElement(); - } - - $objWriter->startElement('w:r'); - $objWriter->startElement('w:fldChar'); - $objWriter->writeAttribute('w:fldCharType', 'end'); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->startElement('w:bookmarkStart'); - $objWriter->writeAttribute('w:id', $bookmarkId); - $objWriter->writeAttribute('w:name', $anchor); - $objWriter->endElement(); - - $objWriter->startElement('w:r'); - $objWriter->startElement('w:t'); - $objWriter->writeRaw($text); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->startElement('w:bookmarkEnd'); - $objWriter->writeAttribute('w:id', $bookmarkId); - $objWriter->endElement(); - - $objWriter->endElement(); - } - - /** - * Write footnote - */ - protected function _writeFootnote(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footnote $footnote) - { - $objWriter->startElement('w:footnote'); - $objWriter->writeAttribute('w:id', $footnote->getReferenceId()); - - $styleParagraph = $footnote->getParagraphStyle(); - $SpIsObject = ($styleParagraph instanceof PHPWord_Style_Paragraph) ? true : false; - - $objWriter->startElement('w:p'); - - if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph); - } elseif (!$SpIsObject && !is_null($styleParagraph)) { - $objWriter->startElement('w:pPr'); - $objWriter->startElement('w:pStyle'); - $objWriter->writeAttribute('w:val', $styleParagraph); - $objWriter->endElement(); - $objWriter->endElement(); - } - - $elements = $footnote->getElements(); - if (count($elements) > 0) { - foreach ($elements as $element) { - if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element, true); - } elseif ($element instanceof PHPWord_Section_Link) { - $this->_writeLink($objWriter, $element, true); - } - } - } - - $objWriter->endElement(); // w:p - $objWriter->endElement(); // w:footnote - } - - /** - * Write footnote reference - */ - protected function _writeFootnoteReference(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Footnote $footnote, $withoutP = false) - { - if (!$withoutP) { - $objWriter->startElement('w:p'); - } - - $objWriter->startElement('w:r'); - - $objWriter->startElement('w:footnoteReference'); - $objWriter->writeAttribute('w:id', $footnote->getReferenceId()); - $objWriter->endElement(); // w:footnoteReference - - $objWriter->endElement(); // w:r - - if (!$withoutP) { - $objWriter->endElement(); // w:p - } - } -} diff --git a/Classes/PHPWord/Writer/Word2007/DocProps.php b/Classes/PHPWord/Writer/Word2007/DocProps.php deleted file mode 100755 index 2e8f8b5a63..0000000000 --- a/Classes/PHPWord/Writer/Word2007/DocProps.php +++ /dev/null @@ -1,185 +0,0 @@ -getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0', 'UTF-8', 'yes'); - - // Properties - $objWriter->startElement('Properties'); - $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties'); - $objWriter->writeAttribute('xmlns:vt', 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes'); - - // Application - $objWriter->writeElement('Application', 'Microsoft Office Word'); - - // ScaleCrop - $objWriter->writeElement('ScaleCrop', 'false'); - - // HeadingPairs - $objWriter->startElement('HeadingPairs'); - - // Vector - $objWriter->startElement('vt:vector'); - $objWriter->writeAttribute('size', '4'); - $objWriter->writeAttribute('baseType', 'variant'); - - // Variant - $objWriter->startElement('vt:variant'); - $objWriter->writeElement('vt:lpstr', 'Theme'); - $objWriter->endElement(); - - // Variant - $objWriter->startElement('vt:variant'); - $objWriter->writeElement('vt:i4', '1'); - $objWriter->endElement(); - - // Variant - $objWriter->startElement('vt:variant'); - $objWriter->writeElement('vt:lpstr', 'Slide Titles'); - $objWriter->endElement(); - - // Variant - $objWriter->startElement('vt:variant'); - $objWriter->writeElement('vt:i4', '1'); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // TitlesOfParts - $objWriter->startElement('TitlesOfParts'); - - // Vector - $objWriter->startElement('vt:vector'); - $objWriter->writeAttribute('size', '1'); - $objWriter->writeAttribute('baseType', 'lpstr'); - - $objWriter->writeElement('vt:lpstr', 'Office Theme'); - - $objWriter->endElement(); - - $objWriter->endElement(); - - // Company - $objWriter->writeElement('Company', $pPHPWord->getProperties()->getCompany()); - - // LinksUpToDate - $objWriter->writeElement('LinksUpToDate', 'false'); - - // SharedDoc - $objWriter->writeElement('SharedDoc', 'false'); - - // HyperlinksChanged - $objWriter->writeElement('HyperlinksChanged', 'false'); - - // AppVersion - $objWriter->writeElement('AppVersion', '12.0000'); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } - - - public function writeDocPropsCore(PHPWord $pPHPWord = null) - { - // Create XML writer - $objWriter = null; - if ($this->getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0', 'UTF-8', 'yes'); - - // cp:coreProperties - $objWriter->startElement('cp:coreProperties'); - $objWriter->writeAttribute('xmlns:cp', 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties'); - $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/'); - $objWriter->writeAttribute('xmlns:dcterms', 'http://purl.org/dc/terms/'); - $objWriter->writeAttribute('xmlns:dcmitype', 'http://purl.org/dc/dcmitype/'); - $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); - - // dc:creator - $objWriter->writeElement('dc:creator', $pPHPWord->getProperties()->getCreator()); - - // cp:lastModifiedBy - $objWriter->writeElement('cp:lastModifiedBy', $pPHPWord->getProperties()->getLastModifiedBy()); - - // dcterms:created - $objWriter->startElement('dcterms:created'); - $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF'); - $objWriter->writeRaw(date(DATE_W3C, $pPHPWord->getProperties()->getCreated())); - $objWriter->endElement(); - - // dcterms:modified - $objWriter->startElement('dcterms:modified'); - $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF'); - $objWriter->writeRaw(date(DATE_W3C, $pPHPWord->getProperties()->getModified())); - $objWriter->endElement(); - - // dc:title - $objWriter->writeElement('dc:title', $pPHPWord->getProperties()->getTitle()); - - // dc:description - $objWriter->writeElement('dc:description', $pPHPWord->getProperties()->getDescription()); - - // dc:subject - $objWriter->writeElement('dc:subject', $pPHPWord->getProperties()->getSubject()); - - // cp:keywords - $objWriter->writeElement('cp:keywords', $pPHPWord->getProperties()->getKeywords()); - - // cp:category - $objWriter->writeElement('cp:category', $pPHPWord->getProperties()->getCategory()); - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } -} diff --git a/Classes/PHPWord/Writer/Word2007/Document.php b/Classes/PHPWord/Writer/Word2007/Document.php deleted file mode 100755 index abdd92cc75..0000000000 --- a/Classes/PHPWord/Writer/Word2007/Document.php +++ /dev/null @@ -1,491 +0,0 @@ -getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0', 'UTF-8', 'yes'); - - // w:document - $objWriter->startElement('w:document'); - - $objWriter->writeAttribute('xmlns:ve', 'http://schemas.openxmlformats.org/markup-compatibility/2006'); - $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office'); - $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - $objWriter->writeAttribute('xmlns:m', 'http://schemas.openxmlformats.org/officeDocument/2006/math'); - $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml'); - $objWriter->writeAttribute('xmlns:wp', 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing'); - $objWriter->writeAttribute('xmlns:w10', 'urn:schemas-microsoft-com:office:word'); - $objWriter->writeAttribute('xmlns:w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'); - $objWriter->writeAttribute('xmlns:wne', 'http://schemas.microsoft.com/office/word/2006/wordml'); - - $objWriter->startElement('w:body'); - - $_sections = $pPHPWord->getSections(); - $countSections = count($_sections); - $pSection = 0; - - if ($countSections > 0) { - foreach ($_sections as $section) { - $pSection++; - - $_elements = $section->getElements(); - - foreach ($_elements as $element) { - if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_TextRun) { - $this->_writeTextRun($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Link) { - $this->_writeLink($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Title) { - $this->_writeTitle($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_TextBreak) { - $this->_writeTextBreak($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_PageBreak) { - $this->_writePageBreak($objWriter); - } elseif ($element instanceof PHPWord_Section_Table) { - $this->_writeTable($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_ListItem) { - $this->_writeListItem($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Image || - $element instanceof PHPWord_Section_MemoryImage - ) { - $this->_writeImage($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Object) { - $this->_writeObject($objWriter, $element); - } elseif ($element instanceof PHPWord_TOC) { - $this->_writeTOC($objWriter); - } elseif ($element instanceof PHPWord_Section_Footnote) { - $this->_writeFootnoteReference($objWriter, $element); - } - } - - if ($pSection == $countSections) { - $this->_writeEndSection($objWriter, $section); - } else { - $this->_writeSection($objWriter, $section); - } - } - } - - $objWriter->endElement(); // End w:body - $objWriter->endElement(); // End w:document - - // Return - return $objWriter->getData(); - } - - private function _writeSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section) - { - $objWriter->startElement('w:p'); - $objWriter->startElement('w:pPr'); - $this->_writeEndSection($objWriter, $section, 3); - $objWriter->endElement(); - $objWriter->endElement(); - } - - private function _writeEndSection(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section $section) - { - $settings = $section->getSettings(); - $_headers = $section->getHeaders(); - $_footer = $section->getFooter(); - $pgSzW = $settings->getPageSizeW(); - $pgSzH = $settings->getPageSizeH(); - $orientation = $settings->getOrientation(); - - $marginTop = $settings->getMarginTop(); - $marginLeft = $settings->getMarginLeft(); - $marginRight = $settings->getMarginRight(); - $marginBottom = $settings->getMarginBottom(); - - $headerHeight = $settings->getHeaderHeight(); - $footerHeight = $settings->getFooterHeight(); - - $borders = $settings->getBorderSize(); - - $colsNum = $settings->getColsNum(); - $colsSpace = $settings->getColsSpace(); - $breakType = $settings->getBreakType(); - - $objWriter->startElement('w:sectPr'); - - foreach ($_headers as &$_header) { - $rId = $_header->getRelationId(); - $objWriter->startElement('w:headerReference'); - $objWriter->writeAttribute('w:type', $_header->getType()); - $objWriter->writeAttribute('r:id', 'rId' . $rId); - $objWriter->endElement(); - } - - if ($section->hasDifferentFirstPage()) { - $objWriter->startElement('w:titlePg'); - $objWriter->endElement(); - } - - if (!is_null($breakType)) { - $objWriter->startElement('w:type'); - $objWriter->writeAttribute('w:val', $breakType); - $objWriter->endElement(); - } - - if (!is_null($_footer)) { - $rId = $_footer->getRelationId(); - $objWriter->startElement('w:footerReference'); - $objWriter->writeAttribute('w:type', 'default'); - $objWriter->writeAttribute('r:id', 'rId' . $rId); - $objWriter->endElement(); - } - - $objWriter->startElement('w:pgSz'); - $objWriter->writeAttribute('w:w', $pgSzW); - $objWriter->writeAttribute('w:h', $pgSzH); - - if (!is_null($orientation) && strtolower($orientation) != 'portrait') { - $objWriter->writeAttribute('w:orient', $orientation); - } - - $objWriter->endElement(); - - $objWriter->startElement('w:pgMar'); - $objWriter->writeAttribute('w:top', $marginTop); - $objWriter->writeAttribute('w:right', $marginRight); - $objWriter->writeAttribute('w:bottom', $marginBottom); - $objWriter->writeAttribute('w:left', $marginLeft); - $objWriter->writeAttribute('w:header', $headerHeight); - $objWriter->writeAttribute('w:footer', $footerHeight); - $objWriter->writeAttribute('w:gutter', '0'); - $objWriter->endElement(); - - - if (!is_null($borders[0]) || !is_null($borders[1]) || !is_null($borders[2]) || !is_null($borders[3])) { - $borderColor = $settings->getBorderColor(); - - $objWriter->startElement('w:pgBorders'); - $objWriter->writeAttribute('w:offsetFrom', 'page'); - - if (!is_null($borders[0])) { - $objWriter->startElement('w:top'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $borders[0]); - $objWriter->writeAttribute('w:space', '24'); - $objWriter->writeAttribute('w:color', $borderColor[0]); - $objWriter->endElement(); - } - - if (!is_null($borders[1])) { - $objWriter->startElement('w:left'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $borders[1]); - $objWriter->writeAttribute('w:space', '24'); - $objWriter->writeAttribute('w:color', $borderColor[1]); - $objWriter->endElement(); - } - - if (!is_null($borders[2])) { - $objWriter->startElement('w:right'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $borders[2]); - $objWriter->writeAttribute('w:space', '24'); - $objWriter->writeAttribute('w:color', $borderColor[2]); - $objWriter->endElement(); - } - - if (!is_null($borders[3])) { - $objWriter->startElement('w:bottom'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $borders[3]); - $objWriter->writeAttribute('w:space', '24'); - $objWriter->writeAttribute('w:color', $borderColor[3]); - $objWriter->endElement(); - } - $objWriter->endElement(); - } - - // Page numbering - if (null !== $settings->getPageNumberingStart()) { - $objWriter->startElement('w:pgNumType'); - $objWriter->writeAttribute('w:start', $section->getSettings()->getPageNumberingStart()); - $objWriter->endElement(); - } - - $objWriter->startElement('w:cols'); - $objWriter->writeAttribute('w:num', $colsNum); - $objWriter->writeAttribute('w:space', $colsSpace); - $objWriter->endElement(); - - - $objWriter->endElement(); - } - - private function _writePageBreak(PHPWord_Shared_XMLWriter $objWriter = null) - { - $objWriter->startElement('w:p'); - $objWriter->startElement('w:r'); - $objWriter->startElement('w:br'); - $objWriter->writeAttribute('w:type', 'page'); - $objWriter->endElement(); - $objWriter->endElement(); - $objWriter->endElement(); - } - - public function _writeListItem(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_ListItem $listItem) - { - $textObject = $listItem->getTextObject(); - $text = $textObject->getText(); - $styleParagraph = $textObject->getParagraphStyle(); - $SpIsObject = ($styleParagraph instanceof PHPWord_Style_Paragraph) ? true : false; - - $depth = $listItem->getDepth(); - $listType = $listItem->getStyle()->getListType(); - - $objWriter->startElement('w:p'); - $objWriter->startElement('w:pPr'); - - if ($SpIsObject) { - $this->_writeParagraphStyle($objWriter, $styleParagraph, true); - } elseif (!$SpIsObject && !is_null($styleParagraph)) { - $objWriter->startElement('w:pStyle'); - $objWriter->writeAttribute('w:val', $styleParagraph); - $objWriter->endElement(); - } - - $objWriter->startElement('w:numPr'); - - $objWriter->startElement('w:ilvl'); - $objWriter->writeAttribute('w:val', $depth); - $objWriter->endElement(); - - $objWriter->startElement('w:numId'); - $objWriter->writeAttribute('w:val', $listType); - $objWriter->endElement(); - - $objWriter->endElement(); - $objWriter->endElement(); - - $this->_writeText($objWriter, $textObject, true); - - $objWriter->endElement(); - } - - protected function _writeObject(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Section_Object $object) - { - $rIdObject = $object->getRelationId(); - $rIdImage = $object->getImageRelationId(); - $shapeId = md5($rIdObject . '_' . $rIdImage); - - $objectId = $object->getObjectId(); - - $style = $object->getStyle(); - $width = $style->getWidth(); - $height = $style->getHeight(); - $align = $style->getAlign(); - - - $objWriter->startElement('w:p'); - - if (!is_null($align)) { - $objWriter->startElement('w:pPr'); - $objWriter->startElement('w:jc'); - $objWriter->writeAttribute('w:val', $align); - $objWriter->endElement(); - $objWriter->endElement(); - } - - $objWriter->startElement('w:r'); - - $objWriter->startElement('w:object'); - $objWriter->writeAttribute('w:dxaOrig', '249'); - $objWriter->writeAttribute('w:dyaOrig', '160'); - - $objWriter->startElement('v:shape'); - $objWriter->writeAttribute('id', $shapeId); - $objWriter->writeAttribute('type', '#_x0000_t75'); - $objWriter->writeAttribute('style', 'width:104px;height:67px'); - $objWriter->writeAttribute('o:ole', ''); - - $objWriter->startElement('v:imagedata'); - $objWriter->writeAttribute('r:id', 'rId' . $rIdImage); - $objWriter->writeAttribute('o:title', ''); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->startElement('o:OLEObject'); - $objWriter->writeAttribute('Type', 'Embed'); - $objWriter->writeAttribute('ProgID', 'Package'); - $objWriter->writeAttribute('ShapeID', $shapeId); - $objWriter->writeAttribute('DrawAspect', 'Icon'); - $objWriter->writeAttribute('ObjectID', '_' . $objectId); - $objWriter->writeAttribute('r:id', 'rId' . $rIdObject); - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); // w:r - - $objWriter->endElement(); // w:p - } - - private function _writeTOC(PHPWord_Shared_XMLWriter $objWriter = null) - { - $titles = PHPWord_TOC::getTitles(); - $styleFont = PHPWord_TOC::getStyleFont(); - - $styleTOC = PHPWord_TOC::getStyleTOC(); - $fIndent = $styleTOC->getIndent(); - $tabLeader = $styleTOC->getTabLeader(); - $tabPos = $styleTOC->getTabPos(); - - $isObject = ($styleFont instanceof PHPWord_Style_Font) ? true : false; - - for ($i = 0; $i < count($titles); $i++) { - $title = $titles[$i]; - $indent = ($title['depth'] - 1) * $fIndent; - - $objWriter->startElement('w:p'); - - $objWriter->startElement('w:pPr'); - - if ($isObject && !is_null($styleFont->getParagraphStyle())) { - $this->_writeParagraphStyle($objWriter, $styleFont->getParagraphStyle()); - } - - if ($indent > 0) { - $objWriter->startElement('w:ind'); - $objWriter->writeAttribute('w:left', $indent); - $objWriter->endElement(); - } - - if (!empty($styleFont) && !$isObject) { - $objWriter->startElement('w:pPr'); - $objWriter->startElement('w:pStyle'); - $objWriter->writeAttribute('w:val', $styleFont); - $objWriter->endElement(); - $objWriter->endElement(); - } - - $objWriter->startElement('w:tabs'); - $objWriter->startElement('w:tab'); - $objWriter->writeAttribute('w:val', 'right'); - if (!empty($tabLeader)) { - $objWriter->writeAttribute('w:leader', $tabLeader); - } - $objWriter->writeAttribute('w:pos', $tabPos); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->endElement(); // w:pPr - - - if ($i == 0) { - $objWriter->startElement('w:r'); - $objWriter->startElement('w:fldChar'); - $objWriter->writeAttribute('w:fldCharType', 'begin'); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->startElement('w:r'); - $objWriter->startElement('w:instrText'); - $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeRaw('TOC \o "1-9" \h \z \u'); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->startElement('w:r'); - $objWriter->startElement('w:fldChar'); - $objWriter->writeAttribute('w:fldCharType', 'separate'); - $objWriter->endElement(); - $objWriter->endElement(); - } - - $objWriter->startElement('w:hyperlink'); - $objWriter->writeAttribute('w:anchor', $title['anchor']); - $objWriter->writeAttribute('w:history', '1'); - - $objWriter->startElement('w:r'); - - if ($isObject) { - $this->_writeTextStyle($objWriter, $styleFont); - } - - $objWriter->startElement('w:t'); - $objWriter->writeRaw($title['text']); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->startElement('w:r'); - $objWriter->writeElement('w:tab', null); - $objWriter->endElement(); - - $objWriter->startElement('w:r'); - $objWriter->startElement('w:fldChar'); - $objWriter->writeAttribute('w:fldCharType', 'begin'); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->startElement('w:r'); - $objWriter->startElement('w:instrText'); - $objWriter->writeAttribute('xml:space', 'preserve'); - $objWriter->writeRaw('PAGEREF ' . $title['anchor'] . ' \h'); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->startElement('w:r'); - $objWriter->startElement('w:fldChar'); - $objWriter->writeAttribute('w:fldCharType', 'end'); - $objWriter->endElement(); - $objWriter->endElement(); - - $objWriter->endElement(); // w:hyperlink - - $objWriter->endElement(); // w:p - } - - $objWriter->startElement('w:p'); - $objWriter->startElement('w:r'); - $objWriter->startElement('w:fldChar'); - $objWriter->writeAttribute('w:fldCharType', 'end'); - $objWriter->endElement(); - $objWriter->endElement(); - $objWriter->endElement(); - } -} diff --git a/Classes/PHPWord/Writer/Word2007/Footer.php b/Classes/PHPWord/Writer/Word2007/Footer.php deleted file mode 100755 index 6ee18d66c7..0000000000 --- a/Classes/PHPWord/Writer/Word2007/Footer.php +++ /dev/null @@ -1,83 +0,0 @@ -getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0', 'UTF-8', 'yes'); - - $objWriter->startElement('w:ftr'); - $objWriter->writeAttribute('xmlns:ve', 'http://schemas.openxmlformats.org/markup-compatibility/2006'); - $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office'); - $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - $objWriter->writeAttribute('xmlns:m', 'http://schemas.openxmlformats.org/officeDocument/2006/math'); - $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml'); - $objWriter->writeAttribute('xmlns:wp', 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing'); - $objWriter->writeAttribute('xmlns:w10', 'urn:schemas-microsoft-com:office:word'); - $objWriter->writeAttribute('xmlns:w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'); - $objWriter->writeAttribute('xmlns:wne', 'http://schemas.microsoft.com/office/word/2006/wordml'); - - $_elements = $footer->getElements(); - - foreach ($_elements as $element) { - if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_TextRun) { - $this->_writeTextRun($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_TextBreak) { - $this->_writeTextBreak($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Table) { - $this->_writeTable($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Image || - $element instanceof PHPWord_Section_MemoryImage - ) { - $this->_writeImage($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Footer_PreserveText) { - $this->_writePreserveText($objWriter, $element); - } - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } -} diff --git a/Classes/PHPWord/Writer/Word2007/Footnotes.php b/Classes/PHPWord/Writer/Word2007/Footnotes.php deleted file mode 100644 index 28d087c7d2..0000000000 --- a/Classes/PHPWord/Writer/Word2007/Footnotes.php +++ /dev/null @@ -1,83 +0,0 @@ -getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0', 'UTF-8', 'yes'); - - $objWriter->startElement('w:footnotes'); - $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - $objWriter->writeAttribute('xmlns:w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'); - - // write separator and continuation separator - $objWriter->startElement('w:footnote'); - $objWriter->writeAttribute('w:id', 0); - $objWriter->writeAttribute('w:type', 'separator'); - $objWriter->startElement('w:p'); - $objWriter->startElement('w:r'); - $objWriter->startElement('w:separator'); - $objWriter->endElement(); // w:separator - $objWriter->endElement(); // w:r - $objWriter->endElement(); // w:p - $objWriter->endElement(); // w:footnote - - $objWriter->startElement('w:footnote'); - $objWriter->writeAttribute('w:id', 1); - $objWriter->writeAttribute('w:type', 'continuationSeparator'); - $objWriter->startElement('w:p'); - $objWriter->startElement('w:r'); - $objWriter->startElement('w:continuationSeparator'); - $objWriter->endElement(); // w:continuationSeparator - $objWriter->endElement(); // w:r - $objWriter->endElement(); // w:p - $objWriter->endElement(); // w:footnote - - - foreach ($allFootnotesCollection as $footnote) { - if ($footnote instanceof PHPWord_Section_Footnote) { - $this->_writeFootnote($objWriter, $footnote); - } - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } -} diff --git a/Classes/PHPWord/Writer/Word2007/Header.php b/Classes/PHPWord/Writer/Word2007/Header.php deleted file mode 100755 index 59eebd9178..0000000000 --- a/Classes/PHPWord/Writer/Word2007/Header.php +++ /dev/null @@ -1,87 +0,0 @@ -getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY); - } - - // XML header - $objWriter->startDocument('1.0', 'UTF-8', 'yes'); - - $objWriter->startElement('w:hdr'); - $objWriter->writeAttribute('xmlns:ve', 'http://schemas.openxmlformats.org/markup-compatibility/2006'); - $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office'); - $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - $objWriter->writeAttribute('xmlns:m', 'http://schemas.openxmlformats.org/officeDocument/2006/math'); - $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml'); - $objWriter->writeAttribute('xmlns:wp', 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing'); - $objWriter->writeAttribute('xmlns:w10', 'urn:schemas-microsoft-com:office:word'); - $objWriter->writeAttribute('xmlns:w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'); - $objWriter->writeAttribute('xmlns:wne', 'http://schemas.microsoft.com/office/word/2006/wordml'); - - - $_elements = $header->getElements(); - - foreach ($_elements as $element) { - if ($element instanceof PHPWord_Section_Text) { - $this->_writeText($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_TextRun) { - $this->_writeTextRun($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_TextBreak) { - $this->_writeTextBreak($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Table) { - $this->_writeTable($objWriter, $element); - } elseif ($element instanceof PHPWord_Section_Image || - $element instanceof PHPWord_Section_MemoryImage - ) { - if (!$element->getIsWatermark()) { - $this->_writeImage($objWriter, $element); - } else { - $this->_writeWatermark($objWriter, $element); - } - } elseif ($element instanceof PHPWord_Section_Footer_PreserveText) { - $this->_writePreserveText($objWriter, $element); - } - } - - $objWriter->endElement(); - - // Return - return $objWriter->getData(); - } -} diff --git a/Classes/PHPWord/Writer/Word2007/Styles.php b/Classes/PHPWord/Writer/Word2007/Styles.php deleted file mode 100755 index 3724323e10..0000000000 --- a/Classes/PHPWord/Writer/Word2007/Styles.php +++ /dev/null @@ -1,394 +0,0 @@ -getParentWriter()->getUseDiskCaching()) { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); - } else { - $objWriter = new PHPWord_Shared_XMLWriter(PHPWord_Shared_XMLWriter::STORAGE_MEMORY); - } - - $this->_document = $pPHPWord; - - // XML header - $objWriter->startDocument('1.0', 'UTF-8', 'yes'); - - $objWriter->startElement('w:styles'); - - $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); - $objWriter->writeAttribute('xmlns:w', 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'); - - // Write DocDefaults - $this->_writeDocDefaults($objWriter); - - - // Write Style Definitions - $styles = PHPWord_Style::getStyles(); - - // Write normal paragraph style - $normalStyle = null; - if (array_key_exists('Normal', $styles)) { - $normalStyle = $styles['Normal']; - } - $objWriter->startElement('w:style'); - $objWriter->writeAttribute('w:type', 'paragraph'); - $objWriter->writeAttribute('w:default', '1'); - $objWriter->writeAttribute('w:styleId', 'Normal'); - $objWriter->startElement('w:name'); - $objWriter->writeAttribute('w:val', 'Normal'); - $objWriter->endElement(); - if (!is_null($normalStyle)) { - $this->_writeParagraphStyle($objWriter, $normalStyle); - } - $objWriter->endElement(); - - // Write other styles - if (count($styles) > 0) { - foreach ($styles as $styleName => $style) { - if ($styleName == 'Normal') { - continue; - } - if ($style instanceof PHPWord_Style_Font) { - - $paragraphStyle = $style->getParagraphStyle(); - $styleType = $style->getStyleType(); - - $type = ($styleType == 'title') ? 'paragraph' : 'character'; - - if (!is_null($paragraphStyle)) { - $type = 'paragraph'; - } - - $objWriter->startElement('w:style'); - $objWriter->writeAttribute('w:type', $type); - - if ($styleType == 'title') { - $arrStyle = explode('_', $styleName); - $styleId = 'Heading' . $arrStyle[1]; - $styleName = 'heading ' . $arrStyle[1]; - $styleLink = 'Heading' . $arrStyle[1] . 'Char'; - $objWriter->writeAttribute('w:styleId', $styleId); - - $objWriter->startElement('w:link'); - $objWriter->writeAttribute('w:val', $styleLink); - $objWriter->endElement(); - } - - $objWriter->startElement('w:name'); - $objWriter->writeAttribute('w:val', $styleName); - $objWriter->endElement(); - - if (!is_null($paragraphStyle)) { - // Point parent style to Normal - $objWriter->startElement('w:basedOn'); - $objWriter->writeAttribute('w:val', 'Normal'); - $objWriter->endElement(); - $this->_writeParagraphStyle($objWriter, $paragraphStyle); - } - - $this->_writeTextStyle($objWriter, $style); - - $objWriter->endElement(); - - } elseif ($style instanceof PHPWord_Style_Paragraph) { - $objWriter->startElement('w:style'); - $objWriter->writeAttribute('w:type', 'paragraph'); - $objWriter->writeAttribute('w:customStyle', '1'); - $objWriter->writeAttribute('w:styleId', $styleName); - - $objWriter->startElement('w:name'); - $objWriter->writeAttribute('w:val', $styleName); - $objWriter->endElement(); - - // Parent style - $basedOn = $style->getBasedOn(); - if (!is_null($basedOn)) { - $objWriter->startElement('w:basedOn'); - $objWriter->writeAttribute('w:val', $basedOn); - $objWriter->endElement(); - } - - // Next paragraph style - $next = $style->getNext(); - if (!is_null($next)) { - $objWriter->startElement('w:next'); - $objWriter->writeAttribute('w:val', $next); - $objWriter->endElement(); - } - - $this->_writeParagraphStyle($objWriter, $style); - $objWriter->endElement(); - - } elseif ($style instanceof PHPWord_Style_TableFull) { - $objWriter->startElement('w:style'); - $objWriter->writeAttribute('w:type', 'table'); - $objWriter->writeAttribute('w:customStyle', '1'); - $objWriter->writeAttribute('w:styleId', $styleName); - - $objWriter->startElement('w:name'); - $objWriter->writeAttribute('w:val', $styleName); - $objWriter->endElement(); - - $objWriter->startElement('w:uiPriority'); - $objWriter->writeAttribute('w:val', '99'); - $objWriter->endElement(); - - $this->_writeFullTableStyle($objWriter, $style); - - $objWriter->endElement(); - } - } - } - - $objWriter->endElement(); // w:styles - - // Return - return $objWriter->getData(); - } - - private function _writeFullTableStyle(PHPWord_Shared_XMLWriter $objWriter = null, PHPWord_Style_TableFull $style) - { - - $brdSz = $style->getBorderSize(); - $brdCol = $style->getBorderColor(); - $bgColor = $style->getBgColor(); - $cellMargin = $style->getCellMargin(); - - $bTop = (!is_null($brdSz[0])) ? true : false; - $bLeft = (!is_null($brdSz[1])) ? true : false; - $bRight = (!is_null($brdSz[2])) ? true : false; - $bBottom = (!is_null($brdSz[3])) ? true : false; - $bInsH = (!is_null($brdSz[4])) ? true : false; - $bInsV = (!is_null($brdSz[5])) ? true : false; - $borders = ($bTop || $bLeft || $bRight || $bBottom || $bInsH || $bInsV) ? true : false; - - $mTop = (!is_null($cellMargin[0])) ? true : false; - $mLeft = (!is_null($cellMargin[1])) ? true : false; - $mRight = (!is_null($cellMargin[2])) ? true : false; - $mBottom = (!is_null($cellMargin[3])) ? true : false; - $margins = ($mTop || $mLeft || $mRight || $mBottom) ? true : false; - - $objWriter->startElement('w:tblPr'); - - if ($margins) { - $objWriter->startElement('w:tblCellMar'); - if ($mTop) { - echo $margins[0]; - $objWriter->startElement('w:top'); - $objWriter->writeAttribute('w:w', $cellMargin[0]); - $objWriter->writeAttribute('w:type', 'dxa'); - $objWriter->endElement(); - } - if ($mLeft) { - $objWriter->startElement('w:left'); - $objWriter->writeAttribute('w:w', $cellMargin[1]); - $objWriter->writeAttribute('w:type', 'dxa'); - $objWriter->endElement(); - } - if ($mRight) { - $objWriter->startElement('w:right'); - $objWriter->writeAttribute('w:w', $cellMargin[2]); - $objWriter->writeAttribute('w:type', 'dxa'); - $objWriter->endElement(); - } - if ($mBottom) { - $objWriter->startElement('w:bottom'); - $objWriter->writeAttribute('w:w', $cellMargin[3]); - $objWriter->writeAttribute('w:type', 'dxa'); - $objWriter->endElement(); - } - $objWriter->endElement(); - } - - if ($borders) { - $objWriter->startElement('w:tblBorders'); - if ($bTop) { - $objWriter->startElement('w:top'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[0]); - $objWriter->writeAttribute('w:color', $brdCol[0]); - $objWriter->endElement(); - } - if ($bLeft) { - $objWriter->startElement('w:left'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[1]); - $objWriter->writeAttribute('w:color', $brdCol[1]); - $objWriter->endElement(); - } - if ($bRight) { - $objWriter->startElement('w:right'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[2]); - $objWriter->writeAttribute('w:color', $brdCol[2]); - $objWriter->endElement(); - } - if ($bBottom) { - $objWriter->startElement('w:bottom'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[3]); - $objWriter->writeAttribute('w:color', $brdCol[3]); - $objWriter->endElement(); - } - if ($bInsH) { - $objWriter->startElement('w:insideH'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[4]); - $objWriter->writeAttribute('w:color', $brdCol[4]); - $objWriter->endElement(); - } - if ($bInsV) { - $objWriter->startElement('w:insideV'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[5]); - $objWriter->writeAttribute('w:color', $brdCol[5]); - $objWriter->endElement(); - } - $objWriter->endElement(); - } - - $objWriter->endElement(); - - if (!is_null($bgColor)) { - $objWriter->startElement('w:tcPr'); - $objWriter->startElement('w:shd'); - $objWriter->writeAttribute('w:val', 'clear'); - $objWriter->writeAttribute('w:color', 'auto'); - $objWriter->writeAttribute('w:fill', $bgColor); - $objWriter->endElement(); - $objWriter->endElement(); - } - - - // First Row - $firstRow = $style->getFirstRow(); - if (!is_null($firstRow)) { - $this->_writeRowStyle($objWriter, 'firstRow', $firstRow); - } - } - - private function _writeRowStyle(PHPWord_Shared_XMLWriter $objWriter = null, $type, PHPWord_Style_TableFull $style) - { - $brdSz = $style->getBorderSize(); - $brdCol = $style->getBorderColor(); - $bgColor = $style->getBgColor(); - - $bTop = (!is_null($brdSz[0])) ? true : false; - $bLeft = (!is_null($brdSz[1])) ? true : false; - $bRight = (!is_null($brdSz[2])) ? true : false; - $bBottom = (!is_null($brdSz[3])) ? true : false; - $borders = ($bTop || $bLeft || $bRight || $bBottom) ? true : false; - - $objWriter->startElement('w:tblStylePr'); - $objWriter->writeAttribute('w:type', $type); - - $objWriter->startElement('w:tcPr'); - if (!is_null($bgColor)) { - $objWriter->startElement('w:shd'); - $objWriter->writeAttribute('w:val', 'clear'); - $objWriter->writeAttribute('w:color', 'auto'); - $objWriter->writeAttribute('w:fill', $bgColor); - $objWriter->endElement(); - } - - $objWriter->startElement('w:tcBorders'); - if ($bTop) { - $objWriter->startElement('w:top'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[0]); - $objWriter->writeAttribute('w:color', $brdCol[0]); - $objWriter->endElement(); - } - if ($bLeft) { - $objWriter->startElement('w:left'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[1]); - $objWriter->writeAttribute('w:color', $brdCol[1]); - $objWriter->endElement(); - } - if ($bRight) { - $objWriter->startElement('w:right'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[2]); - $objWriter->writeAttribute('w:color', $brdCol[2]); - $objWriter->endElement(); - } - if ($bBottom) { - $objWriter->startElement('w:bottom'); - $objWriter->writeAttribute('w:val', 'single'); - $objWriter->writeAttribute('w:sz', $brdSz[3]); - $objWriter->writeAttribute('w:color', $brdCol[3]); - $objWriter->endElement(); - } - $objWriter->endElement(); - - $objWriter->endElement(); - - $objWriter->endElement(); - } - - - private function _writeDocDefaults(PHPWord_Shared_XMLWriter $objWriter = null) - { - $fontName = $this->_document->getDefaultFontName(); - $fontSize = $this->_document->getDefaultFontSize(); - - $objWriter->startElement('w:docDefaults'); - $objWriter->startElement('w:rPrDefault'); - $objWriter->startElement('w:rPr'); - - $objWriter->startElement('w:rFonts'); - $objWriter->writeAttribute('w:ascii', $fontName); - $objWriter->writeAttribute('w:hAnsi', $fontName); - $objWriter->writeAttribute('w:eastAsia', $fontName); - $objWriter->writeAttribute('w:cs', $fontName); - $objWriter->endElement(); - - $objWriter->startElement('w:sz'); - $objWriter->writeAttribute('w:val', $fontSize * 2); - $objWriter->endElement(); - - $objWriter->startElement('w:szCs'); - $objWriter->writeAttribute('w:val', $fontSize * 2); - $objWriter->endElement(); - - $objWriter->endElement(); - $objWriter->endElement(); - $objWriter->endElement(); - } -} diff --git a/README.md b/README.md index 5eb8d74c01..5e319d33bc 100755 --- a/README.md +++ b/README.md @@ -1,19 +1,15 @@ -# PHPWord +# ![PHPWord](https://raw.githubusercontent.com/PHPOffice/PHPWord/develop/docs/images/phpword.svg "PHPWord") -[![Build Status](https://travis-ci.org/PHPOffice/PHPWord.png?branch=master)](https://travis-ci.org/PHPOffice/PHPWord) -[![Latest Stable Version](https://poser.pugx.org/phpoffice/phpword/v/stable.png)](https://packagist.org/packages/phpoffice/phpword) [![Total Downloads](https://poser.pugx.org/phpoffice/phpword/downloads.png)](https://packagist.org/packages/phpoffice/phpword) [![Latest Unstable Version](https://poser.pugx.org/phpoffice/phpword/v/unstable.png)](https://packagist.org/packages/phpoffice/phpword) [![License](https://poser.pugx.org/phpoffice/phpword/license.png)](https://packagist.org/packages/phpoffice/phpword) +[![Build Status](https://travis-ci.org/PHPOffice/PHPWord.svg?branch=master)](https://travis-ci.org/PHPOffice/PHPWord) +[![Latest Stable Version](https://poser.pugx.org/phpoffice/phpword/v/stable.png)](https://packagist.org/packages/phpoffice/phpword) +[![Total Downloads](https://poser.pugx.org/phpoffice/phpword/downloads.png)](https://packagist.org/packages/phpoffice/phpword) +[![Latest Unstable Version](https://poser.pugx.org/phpoffice/phpword/v/unstable.png)](https://packagist.org/packages/phpoffice/phpword) +[![License](https://poser.pugx.org/phpoffice/phpword/license.png)](https://packagist.org/packages/phpoffice/phpword) -__OpenXML - Read, Write and Create Word documents in PHP.__ -PHPWord is a library written in pure PHP and providing a set of classes that allow you to write to and read from different document file formats, like Word (.docx), WordPad (.rtf), Libre/OpenOffice Writer (.odt). +PHPWord is a library written in pure PHP that provides a set of classes to write to and read from different document file formats. The current version of PHPWord supports Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML), OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF), and [Rich Text Format](http://en.wikipedia.org/wiki/Rich_Text_Format) (RTF). -No Windows operating system is needed for usage because the resulting DOCX, ODT, or RTF files can be opened by all major [word processing softwares](http://en.wikipedia.org/wiki/List_of_word_processors). - -PHPWord is an open source project licensed under [LGPL](license.md). PHPWord is unit tested to make sure that the released versions are stable. - -__Want to contribute?__ Fork us! - -## Features +With PHPWord, you can create DOCX, ODT, or RTF documents dynamically using your PHP 5.3+ scripts. Below are some of the things that you can do with PHPWord library: * Set document properties, e.g. title, subject, and creator. * Create document sections with different settings, e.g. portrait/landscape, page size, and page numbering @@ -38,10 +34,10 @@ __Want to contribute?__ Fork us! * PHP [Zip](http://php.net/manual/en/book.zip.php) extension * PHP [XML Parser](http://www.php.net/manual/en/xml.installation.php) extension -## Optional PHP extensions -* [GD](http://php.net/manual/en/book.image.php) -* [XMLWriter](http://php.net/manual/en/book.xmlwriter.php) -* [XSL](http://php.net/manual/en/book.xsl.php) +### Optional PHP extensions +* PHP [GD](http://php.net/manual/en/book.image.php) extension +* PHP [XMLWriter](http://php.net/manual/en/book.xmlwriter.php) extension +* PHP [XSL](http://php.net/manual/en/book.xsl.php) extension ## Installation @@ -56,37 +52,19 @@ the following lines to your ``composer.json``. } ``` -## Documentation - -We're reorganizing our documentation. Below are some of the most important things that you needed to get PHPWord creates document for you in no time. - -### Table of contents - -1. [Basic usage](#basic-usage) - * [Measurement units](#measurement-units) -2. [Sections](#sections) - * [Section settings](#section-settings) - * [Section page numbering](#section-page-numbering) -3. [Texts](#texts) - * [Attributes](#text-attributes) -4. [Paragraph Style](#paragraph-style) - * [Attributes](#paragraph-style-attributes) -5. [Tables](#tables) - * [Cell Style](#tables-cell-style) -6. [Images](#images) - * [Attributes](#images-attributes) - - -#### Basic usage +## Basic usage The following is a basic example of the PHPWord library. More examples are provided in the [samples folder](samples/). ```php -$PHPWord = new PHPWord(); +require_once 'src/PhpWord/Autoloader.php'; +PhpOffice\PhpWord\Autoloader::register(); + +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // Every element you want to append to the word document is placed in a section. // To create a basic section: -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); // After creating a section, you can append elements: $section->addText('Hello world!'); @@ -97,13 +75,13 @@ $section->addText('Hello world! I am formatted.', // If you often need the same style again you can create a user defined style // to the word document and give the addText function the name of the style: -$PHPWord->addFontStyle('myOwnStyle', +$phpWord->addFontStyle('myOwnStyle', array('name'=>'Verdana', 'size'=>14, 'color'=>'1B2232')); $section->addText('Hello world! I am formatted by a user defined style', 'myOwnStyle'); // You can also put the appended element to local object like this: -$fontStyle = new PHPWord_Style_Font(); +$fontStyle = new \PhpOffice\PhpWord\Style\Font(); $fontStyle->setBold(true); $fontStyle->setName('Verdana'); $fontStyle->setSize(22); @@ -111,191 +89,16 @@ $myTextElement = $section->addText('Hello World!'); $myTextElement->setFontStyle($fontStyle); // Finally, write the document: -$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); +$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007'); $objWriter->save('helloWorld.docx'); -``` - -##### Measurement units +$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'ODText'); +$objWriter->save('helloWorld.odt'); -The base length unit in Open Office XML is twip. Twip means "TWentieth of an Inch Point", i.e. 1 twip = 1/1440 inch. - -You can use PHPWord helper functions to convert inches, centimeters, or points to twips. - -```php -// Paragraph with 6 points space after -$PHPWord->addParagraphStyle('My Style', array( - 'spaceAfter' => PHPWord_Shared_Font::pointSizeToTwips(6)) -); - -$section = $PHPWord->createSection(); -$sectionStyle = $section->getSettings(); -// half inch left margin -$sectionStyle->setMarginLeft(PHPWord_Shared_Font::inchSizeToTwips(.5)); -// 2 cm right margin -$sectionStyle->setMarginRight(PHPWord_Shared_Font::centimeterSizeToTwips(2)); +$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF'); +$objWriter->save('helloWorld.rtf'); ``` - -#### Sections - -Every visible element in word is placed inside of a section. To create a section, use the following code: - -```php -$section = $PHPWord->createSection($sectionSettings); -``` -The `$sectionSettings` is an optional associative array that sets the section. Example: +__Want to contribute?__ [Fork us](https://github.com/PHPOffice/PHPWord/fork) or [submit](https://github.com/PHPOffice/PHPWord/issues) your bug reports or feature requests to us. -```php -$sectionSettings = array( - 'orientation' => 'landscape', - 'marginTop' => 600, - 'colsNum' => 2, -); -``` - -##### Section settings - -Below are the available settings for section: - -* `orientation` Page orientation, i.e. 'portrait' (default) or 'landscape' -* `marginTop` Page margin top in twips -* `marginLeft` Page margin left in twips -* `marginRight` Page margin right in twips -* `marginBottom` Page margin bottom in twips -* `borderTopSize` Border top size in twips -* `borderTopColor` Border top color -* `borderLeftSize` Border left size in twips -* `borderLeftColor` Border left color -* `borderRightSize` Border right size in twips -* `borderRightColor` Border right color -* `borderBottomSize` Border bottom size in twips -* `borderBottomColor` Border bottom color -* `headerHeight` Spacing to top of header -* `footerHeight` Spacing to bottom of footer -* `colsNum` Number of columns -* `colsSpace` Spacing between columns -* `breakType` Section break type (nextPage, nextColumn, continuous, evenPage, oddPage) - -The following two settings are automatically set by the use of the `orientation` setting. You can alter them but that's not recommended. - -* `pageSizeW` Page width in twips -* `pageSizeH` Page height in twips - - -##### Section page numbering - -You can change a section page numbering. - -```php -$section = $PHPWord->createSection(); -$section->getSettings()->setPageNumberingStart(1); -``` - - -#### Texts - -Text can be added by using `addText` and `createTextRun` method. `addText` is used for creating simple paragraphs that only contain texts with the same style. `createTextRun` is used for creating complex paragraphs that contain text with different style (some bold, other italics, etc) or other elements, e.g. images or links. - -`addText` sample: - -```php -$fontStyle = array('name' => 'Times New Roman', 'size' => 9); -$paragraphStyle = array('align' => 'both'); -$section->addText('I am simple paragraph', $fontStyle, $paragraphStyle); -``` - -`createTextRun` sample: - -```php -$textrun = $section->createTextRun(); -$textrun->addText('I am bold', array('bold' => true)); -$textrun->addText('I am italic', array('italic' => true)); -$textrun->addText('I am colored', array('color' => 'AACC00')); -``` - - -##### Attributes - -* ``size`` text size, e.g. _20_, _22_, -* ``name`` font name, e.g. _Arial_ -* ``bold`` text is bold, _true_ or _false_ -* ``italic`` text is italic, _true_ or _false_ -* ``superScript`` text is super script, _true_ or _false_ -* ``subScript`` text is sub script, _true_ or _false_ -* ``underline`` text is underline, _true_ or _false_ -* ``strikethrough`` text is strikethrough, _true_ or _false_ -* ``color`` text color, e.g. _FF0000_ -* ``fgColor`` fgColor -* ``line-height`` text line height, e.g. _1.0_, _1.5_, ect... - - -#### Paragraph Style - - -##### Attributes - -* ``line-height`` text line height, e.g. _1.0_, _1.5_, ect... -* ``align`` paragraph alignment, _left_, _right_ or _center_ -* ``spaceBefore`` space before Paragraph -* ``spaceAfter`` space after Paragraph -* ``tabs`` set of Custom Tab Stops -* ``indent`` indent by how much - - -#### Tables - -The following illustrates how to create a table. - -```php -$table = $section->addTable(); -$table->addRow(); -$table->addCell(); -``` - - -##### Cell Style - -###### Cell Span - -You can span a cell on multiple columms. - -```php -$cell = $table->addCell(200); -$cell->getStyle()->setGridSpan(5); -``` - - -#### Images - -You can add images easily using the following example. - -```php -$section = $PHPWord->createSection(); -$section->addImage('mars.jpg'); -``` - - -##### Attributes - -* ``width`` width in pixels -* ``height`` height in pixels -* ``align`` image alignment, _left_, _right_ or _center_ -* ``marginTop`` top margin in inches, can be negative -* ``marginLeft`` left margin in inches, can be negative -* ``wrappingStyle`` can be _inline_, _square_, _tight_, _behind_, _infront_ - -To add an image with attributes, consider the following example. - -```php -$section->addImage( - 'mars.jpg', - array( - 'width' => 100, - 'height' => 100, - 'marginTop' => -1, - 'marginLeft' => -1, - 'wrappingStyle' => 'behind' - ) -); -``` +__Want to know more?__ Read the full documentation of PHPWord on [Read The Docs](http://phpword.readthedocs.org/en/develop/). diff --git a/Tests/PHPWord/AutoloaderTest.php b/Tests/PHPWord/AutoloaderTest.php deleted file mode 100644 index 03e16db073..0000000000 --- a/Tests/PHPWord/AutoloaderTest.php +++ /dev/null @@ -1,49 +0,0 @@ -assertContains(array('PHPWord_Autoloader', 'load'), spl_autoload_functions()); - $this->assertContains(array('PHPWord_Autoloader', 'autoload'), spl_autoload_functions()); - } - - public function testAutoloadLegacy() - { - $this->assertNull( - PHPWord_Autoloader::load('Foo'), - 'PHPWord_Autoloader::load() is trying to load classes outside of the PHPWord namespace' - ); - $this->assertTrue( - PHPWord_Autoloader::load('PHPWord'), - 'PHPWord_Autoloader::load() failed to autoload the PHPWord class' - ); - } - - public function testAutoload() - { - $declared = get_declared_classes(); - $declaredCount = count($declared); - Autoloader::autoload('Foo'); - $this->assertEquals( - $declaredCount, - count(get_declared_classes()), - 'PhpOffice\\PhpWord\\Autoloader::autoload() is trying to load classes ' . - 'outside of the PhpOffice\\PhpWord namespace' - ); - // TODO change this class to the main PHPWord class when it is namespaced - Autoloader::autoload( - 'PhpOffice\\PhpWord\\Exceptions\\InvalidStyleException' - ); - $this->assertTrue( - in_array('PhpOffice\\PhpWord\\Exceptions\\InvalidStyleException', get_declared_classes()), - 'PhpOffice\\PhpWord\\Autoloader::autoload() failed to autoload the ' . - 'PhpOffice\\PhpWord\\Exceptions\\InvalidStyleException class' - ); - } -} diff --git a/Tests/PHPWord/IOFactoryTest.php b/Tests/PHPWord/IOFactoryTest.php deleted file mode 100644 index 7b15fbb876..0000000000 --- a/Tests/PHPWord/IOFactoryTest.php +++ /dev/null @@ -1,72 +0,0 @@ -assertAttributeEquals( - PHPWord_IOFactory::getSearchLocations(), - '_searchLocations', - 'PHPWord_IOFactory' - ); - } - - public function testSetSearchLocationsWithArray() - { - PHPWord_IOFactory::setSearchLocations(array()); - $this->assertAttributeEquals(array(), '_searchLocations', 'PHPWord_IOFactory'); - } - - /** - * @expectedException Exception - * @expectedExceptionMessage Invalid parameter passed. - */ - public function testSetSearchLocationsWithNotArray() - { - PHPWord_IOFactory::setSearchLocations('String'); - } - - public function testAddSearchLocation() - { - PHPWord_IOFactory::setSearchLocations(array()); - PHPWord_IOFactory::addSearchLocation('type', 'location', 'classname'); - $this->assertAttributeEquals( - array(array('type' => 'type', 'path' => 'location', 'class' => 'classname')), - '_searchLocations', - 'PHPWord_IOFactory' - ); - } - - /** - * @expectedException Exception - * @expectedExceptionMessage No IWriter found for type - */ - public function testCreateWriterException() - { - $oPHPWord = new PHPWord(); - - PHPWord_IOFactory::setSearchLocations(array()); - PHPWord_IOFactory::createWriter($oPHPWord); - } - - public function testCreateWriter() - { - $oPHPWord = new PHPWord(); - - $this->assertEquals( - PHPWord_IOFactory::createWriter($oPHPWord, 'Word2007'), - new PHPWord_Writer_Word2007($oPHPWord) - ); - } -} diff --git a/Tests/PHPWord/MediaTest.php b/Tests/PHPWord/MediaTest.php deleted file mode 100644 index b2ebd6ae89..0000000000 --- a/Tests/PHPWord/MediaTest.php +++ /dev/null @@ -1,50 +0,0 @@ -assertEquals(PHPWord_Media::getSectionMediaElements(), array()); - } - - public function testCountSectionMediaElementsWithNull() - { - $this->assertEquals(PHPWord_Media::countSectionMediaElements(), 0); - } - - public function testGetHeaderMediaElements() - { - $this->assertAttributeEquals(PHPWord_Media::getHeaderMediaElements(), '_headerMedia', 'PHPWord_Media'); - } - - public function testGetFooterMediaElements() - { - $this->assertAttributeEquals(PHPWord_Media::getFooterMediaElements(), '_footerMedia', 'PHPWord_Media'); - } - - /** - * Todo: add memory image to this test - * - * @covers PHPWord_Media::addSectionMediaElement - */ - public function testAddSectionMediaElement() - { - $section = new PHPWord_Section(0); - $section->addImage(PHPWORD_TESTS_DIR_ROOT . "/_files/images/mars_noext_jpg"); - $section->addImage(PHPWORD_TESTS_DIR_ROOT . "/_files/images/mars.jpg"); - $section->addImage(PHPWORD_TESTS_DIR_ROOT . "/_files/images/mario.gif"); - $section->addImage(PHPWORD_TESTS_DIR_ROOT . "/_files/images/firefox.png"); - $section->addImage(PHPWORD_TESTS_DIR_ROOT . "/_files/images/duke_nukem.bmp"); - $section->addImage(PHPWORD_TESTS_DIR_ROOT . "/_files/images/angela_merkel.tif"); - - $elements = $section->getElements(); - $this->assertEquals(6, count($elements)); - foreach ($elements as $element) { - $this->assertInstanceOf('PHPWord_Section_Image', $element); - } - } -} diff --git a/Tests/PHPWord/Reader/Word2007Test.php b/Tests/PHPWord/Reader/Word2007Test.php deleted file mode 100644 index 6fb6684609..0000000000 --- a/Tests/PHPWord/Reader/Word2007Test.php +++ /dev/null @@ -1,68 +0,0 @@ -assertTrue($object->canRead($file)); - } - - /** - * Test canRead() failure - * - * @expectedException Exception - */ - public function testCanReadFailed() - { - $dir = join( - DIRECTORY_SEPARATOR, - array(PHPWORD_TESTS_DIR_ROOT, '_files', 'documents') - ); - $object = new PHPWord_Reader_Word2007; - $file = $dir . DIRECTORY_SEPARATOR . 'foo.docx'; - $this->assertFalse($object->canRead($file)); - $object = PHPWord_IOFactory::load($file); - } - - /** - * Test load document - */ - public function testLoad() - { - $dir = join( - DIRECTORY_SEPARATOR, - array(PHPWORD_TESTS_DIR_ROOT, '_files', 'documents') - ); - $file = $dir . DIRECTORY_SEPARATOR . 'reader.docx'; - $object = PHPWord_IOFactory::load($file); - $this->assertInstanceOf('PHPWord', $object); - } -} diff --git a/Tests/PHPWord/Section/ImageTest.php b/Tests/PHPWord/Section/ImageTest.php deleted file mode 100644 index 50cc4d2acc..0000000000 --- a/Tests/PHPWord/Section/ImageTest.php +++ /dev/null @@ -1,102 +0,0 @@ -assertInstanceOf('PHPWord_Section_Image', $oImage); - $this->assertEquals($oImage->getSource(), $src); - $this->assertEquals($oImage->getMediaId(), md5($src)); - $this->assertEquals($oImage->getIsWatermark(), false); - $this->assertInstanceOf('PHPWord_Style_Image', $oImage->getStyle()); - } - - public function testConstructWithStyle() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'firefox.png') - ); - $oImage = new PHPWord_Section_Image( - $src, - array('width' => 210, 'height' => 210, 'align' => 'center', - 'wrappingStyle' => \PHPWord_Style_Image::WRAPPING_STYLE_BEHIND) - ); - - $this->assertInstanceOf('PHPWord_Style_Image', $oImage->getStyle()); - } - - /** - * @covers PHPWord_Section_Image::__construct - */ - public function testValidImageTypes() - { - new PHPWord_Section_Image(PHPWORD_TESTS_DIR_ROOT . "/_files/images/mars_noext_jpg"); - new PHPWord_Section_Image(PHPWORD_TESTS_DIR_ROOT . "/_files/images/mars.jpg"); - new PHPWord_Section_Image(PHPWORD_TESTS_DIR_ROOT . "/_files/images/mario.gif"); - new PHPWord_Section_Image(PHPWORD_TESTS_DIR_ROOT . "/_files/images/firefox.png"); - new PHPWord_Section_Image(PHPWORD_TESTS_DIR_ROOT . "/_files/images/duke_nukem.bmp"); - new PHPWord_Section_Image(PHPWORD_TESTS_DIR_ROOT . "/_files/images/angela_merkel.tif"); - } - - /** - * @expectedException \PhpOffice\PhpWord\Exceptions\InvalidImageException - * @covers PHPWord_Section_Image::__construct - */ - public function testImageNotFound() - { - new PHPWord_Section_Image(PHPWORD_TESTS_DIR_ROOT . "/_files/images/thisisnotarealimage"); - } - - /** - * @expectedException \PhpOffice\PhpWord\Exceptions\UnsupportedImageTypeException - * @covers PHPWord_Section_Image::__construct - */ - public function testInvalidImageTypes() - { - new PHPWord_Section_Image(PHPWORD_TESTS_DIR_ROOT . "/_files/images/alexz-johnson.pcx"); - } - - public function testStyle() - { - $oImage = new PHPWord_Section_Image(\join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'earth.jpg') - ), array('width' => 210, 'height' => 210, 'align' => 'center')); - - $this->assertInstanceOf('PHPWord_Style_Image', $oImage->getStyle()); - } - - public function testRelationID() - { - $oImage = new PHPWord_Section_Image(\join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'earth.jpg') - )); - - $iVal = rand(1, 1000); - $oImage->setRelationId($iVal); - $this->assertEquals($oImage->getRelationId(), $iVal); - } - - public function testWatermark() - { - $oImage = new PHPWord_Section_Image(\join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'earth.jpg') - )); - - $oImage->setIsWatermark(true); - $this->assertEquals($oImage->getIsWatermark(), true); - } -} diff --git a/Tests/PHPWord/Section/ListItemTest.php b/Tests/PHPWord/Section/ListItemTest.php deleted file mode 100644 index a2a4d43832..0000000000 --- a/Tests/PHPWord/Section/ListItemTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertInstanceOf('PHPWord_Section_Text', $oListItem->getTextObject()); - } - - public function testStyle() - { - $oListItem = new PHPWord_Section_ListItem( - 'text', - 1, - null, - array('listType' => PHPWord_Style_ListItem::TYPE_NUMBER) - ); - - $this->assertInstanceOf('PHPWord_Style_ListItem', $oListItem->getStyle()); - $this->assertEquals($oListItem->getStyle()->getListType(), PHPWord_Style_ListItem::TYPE_NUMBER); - } - - public function testDepth() - { - $iVal = rand(1, 1000); - $oListItem = new PHPWord_Section_ListItem('text', $iVal); - - $this->assertEquals($oListItem->getDepth(), $iVal); - } -} diff --git a/Tests/PHPWord/Section/MemoryImageTest.php b/Tests/PHPWord/Section/MemoryImageTest.php deleted file mode 100644 index 3bfb39e358..0000000000 --- a/Tests/PHPWord/Section/MemoryImageTest.php +++ /dev/null @@ -1,94 +0,0 @@ -assertInstanceOf('PHPWord_Section_MemoryImage', $oMemoryImage); - $this->assertEquals($oMemoryImage->getSource(), $src); - $this->assertEquals($oMemoryImage->getMediaId(), md5($src)); - $this->assertEquals($oMemoryImage->getImageCreateFunction(), 'imagecreatefrompng'); - $this->assertEquals($oMemoryImage->getImageFunction(), 'imagepng'); - $this->assertEquals($oMemoryImage->getImageExtension(), 'png'); - $this->assertEquals($oMemoryImage->getImageType(), 'image/png'); - } - - public function testGIF() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'mario.gif') - ); - $oMemoryImage = new PHPWord_Section_MemoryImage($src); - - $this->assertInstanceOf('PHPWord_Section_MemoryImage', $oMemoryImage); - $this->assertEquals($oMemoryImage->getSource(), $src); - $this->assertEquals($oMemoryImage->getMediaId(), md5($src)); - $this->assertEquals($oMemoryImage->getImageCreateFunction(), 'imagecreatefromgif'); - $this->assertEquals($oMemoryImage->getImageFunction(), 'imagegif'); - $this->assertEquals($oMemoryImage->getImageExtension(), 'gif'); - $this->assertEquals($oMemoryImage->getImageType(), 'image/gif'); - } - - public function testJPG() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'earth.jpg') - ); - $oMemoryImage = new PHPWord_Section_MemoryImage($src); - - $this->assertInstanceOf('PHPWord_Section_MemoryImage', $oMemoryImage); - $this->assertEquals($oMemoryImage->getSource(), $src); - $this->assertEquals($oMemoryImage->getMediaId(), md5($src)); - $this->assertEquals($oMemoryImage->getImageCreateFunction(), 'imagecreatefromjpeg'); - $this->assertEquals($oMemoryImage->getImageFunction(), 'imagejpeg'); - $this->assertEquals($oMemoryImage->getImageExtension(), 'jpg'); - $this->assertEquals($oMemoryImage->getImageType(), 'image/jpeg'); - } - - public function testBMP() - { - $oMemoryImage = new PHPWord_Section_MemoryImage(\join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'duke_nukem.bmp') - )); - - $this->assertInstanceOf('PHPWord_Section_MemoryImage', $oMemoryImage); - $this->assertEquals($oMemoryImage->getImageCreateFunction(), null); - $this->assertEquals($oMemoryImage->getImageFunction(), null); - $this->assertEquals($oMemoryImage->getImageExtension(), null); - $this->assertEquals($oMemoryImage->getImageType(), 'image/x-ms-bmp'); - } - - public function testStyle() - { - $oMemoryImage = new PHPWord_Section_MemoryImage(\join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'earth.jpg') - ), array('width' => 210, 'height' => 210, 'align' => 'center')); - - $this->assertInstanceOf('PHPWord_Style_Image', $oMemoryImage->getStyle()); - } - - public function testRelationID() - { - $oMemoryImage = new PHPWord_Section_MemoryImage(\join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'earth.jpg') - )); - - $iVal = rand(1, 1000); - $oMemoryImage->setRelationId($iVal); - $this->assertEquals($oMemoryImage->getRelationId(), $iVal); - } -} diff --git a/Tests/PHPWord/Section/ObjectTest.php b/Tests/PHPWord/Section/ObjectTest.php deleted file mode 100644 index b72f2484c8..0000000000 --- a/Tests/PHPWord/Section/ObjectTest.php +++ /dev/null @@ -1,85 +0,0 @@ -assertInstanceOf('PHPWord_Section_Object', $oObject); - $this->assertInstanceOf('PHPWord_Style_Image', $oObject->getStyle()); - $this->assertEquals($oObject->getSource(), $src); - } - - public function testConstructWithNotSupportedFiles() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'xsl', 'passthrough.xsl') - ); - $oObject = new PHPWord_Section_Object($src); - - $this->assertInstanceOf('PHPWord_Section_Object', $oObject); - $this->assertEquals($oObject->getSource(), null); - $this->assertEquals($oObject->getStyle(), null); - } - - public function testConstructWithSupportedFilesAndStyle() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'documents', 'sheet.xls') - ); - $oObject = new PHPWord_Section_Object($src, array('width' => '230px')); - - $this->assertInstanceOf('PHPWord_Section_Object', $oObject); - $this->assertInstanceOf('PHPWord_Style_Image', $oObject->getStyle()); - $this->assertEquals($oObject->getSource(), $src); - } - - public function testRelationId() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'documents', 'sheet.xls') - ); - $oObject = new PHPWord_Section_Object($src); - - $iVal = rand(1, 1000); - $oObject->setRelationId($iVal); - $this->assertEquals($oObject->getRelationId(), $iVal); - } - - public function testImageRelationId() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'documents', 'sheet.xls') - ); - $oObject = new PHPWord_Section_Object($src); - - $iVal = rand(1, 1000); - $oObject->setImageRelationId($iVal); - $this->assertEquals($oObject->getImageRelationId(), $iVal); - } - - public function testObjectId() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'documents', 'sheet.xls') - ); - $oObject = new PHPWord_Section_Object($src); - - $iVal = rand(1, 1000); - $oObject->setObjectId($iVal); - $this->assertEquals($oObject->getObjectId(), $iVal); - } -} diff --git a/Tests/PHPWord/Section/PageBreakTest.php b/Tests/PHPWord/Section/PageBreakTest.php deleted file mode 100644 index 5efd0fe944..0000000000 --- a/Tests/PHPWord/Section/PageBreakTest.php +++ /dev/null @@ -1,18 +0,0 @@ -assertInstanceOf('PHPWord_Section_PageBreak', $oPageBreak); - } -} diff --git a/Tests/PHPWord/Section/Table/CellTest.php b/Tests/PHPWord/Section/Table/CellTest.php deleted file mode 100644 index 30a7fcdb7a..0000000000 --- a/Tests/PHPWord/Section/Table/CellTest.php +++ /dev/null @@ -1,209 +0,0 @@ -assertInstanceOf('PHPWord_Section_Table_Cell', $oCell); - $this->assertEquals($oCell->getWidth(), null); - } - - public function testConstructWithStyleArray() - { - $iVal = rand(1, 1000); - $oCell = new PHPWord_Section_Table_Cell('section', $iVal, null, array('valign' => 'center')); - - $this->assertInstanceOf('PHPWord_Style_Cell', $oCell->getStyle()); - $this->assertEquals($oCell->getWidth(), null); - } - - public function testConstructWithStyleString() - { - $iVal = rand(1, 1000); - $oCell = new PHPWord_Section_Table_Cell('section', $iVal, null, 'cellStyle'); - - $this->assertEquals($oCell->getStyle(), 'cellStyle'); - } - - public function testAddText() - { - $oCell = new PHPWord_Section_Table_Cell('section', 1); - $element = $oCell->addText('text'); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_Text', $element); - } - - public function testAddTextNotUTF8() - { - $oCell = new PHPWord_Section_Table_Cell('section', 1); - $element = $oCell->addText(utf8_decode('ééé')); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_Text', $element); - $this->assertEquals($element->getText(), 'ééé'); - } - - public function testAddLink() - { - $oCell = new PHPWord_Section_Table_Cell('section', 1); - $element = $oCell->addLink('http://www.google.fr', 'Nom'); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_Link', $element); - } - - public function testAddTextBreak() - { - $oCell = new PHPWord_Section_Table_Cell('section', 1); - $oCell->addTextBreak(); - - $this->assertCount(1, $oCell->getElements()); - } - - public function testAddListItem() - { - $oCell = new PHPWord_Section_Table_Cell('section', 1); - $element = $oCell->addListItem('text'); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_ListItem', $element); - $this->assertEquals($element->getTextObject()->getText(), 'text'); - } - - public function testAddListItemNotUTF8() - { - $oCell = new PHPWord_Section_Table_Cell('section', 1); - $element = $oCell->addListItem(utf8_decode('ééé')); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_ListItem', $element); - $this->assertEquals($element->getTextObject()->getText(), 'ééé'); - } - - public function testAddImageSection() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'earth.jpg') - ); - $oCell = new PHPWord_Section_Table_Cell('section', 1); - $element = $oCell->addImage($src); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_Image', $element); - } - - public function testAddImageHeader() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'earth.jpg') - ); - $oCell = new PHPWord_Section_Table_Cell('header', 1); - $element = $oCell->addImage($src); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_Image', $element); - } - - public function testAddImageFooter() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'earth.jpg') - ); - $oCell = new PHPWord_Section_Table_Cell('footer', 1); - $element = $oCell->addImage($src); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_Image', $element); - } - - public function testAddMemoryImageSection() - { - $oCell = new PHPWord_Section_Table_Cell('section', 1); - $element = $oCell->addMemoryImage( - 'https://assets.mozillalabs.com/Brands-Logos/Thunderbird/logo-only/thunderbird_logo-only_RGB.png' - ); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_MemoryImage', $element); - } - - public function testAddMemoryImageHeader() - { - $oCell = new PHPWord_Section_Table_Cell('header', 1); - $element = $oCell->addMemoryImage( - 'https://assets.mozillalabs.com/Brands-Logos/Thunderbird/logo-only/thunderbird_logo-only_RGB.png' - ); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_MemoryImage', $element); - } - - public function testAddMemoryImageFooter() - { - $oCell = new PHPWord_Section_Table_Cell('footer', 1); - $element = $oCell->addMemoryImage( - 'https://assets.mozillalabs.com/Brands-Logos/Thunderbird/logo-only/thunderbird_logo-only_RGB.png' - ); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_MemoryImage', $element); - } - - public function testAddObjectXLS() - { - $src = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'documents', 'sheet.xls') - ); - $oCell = new PHPWord_Section_Table_Cell('section', 1); - $element = $oCell->addObject($src); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_Object', $element); - } - - public function testAddPreserveText() - { - $oCell = new PHPWord_Section_Table_Cell('header', 1); - $element = $oCell->addPreserveText('text'); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_Footer_PreserveText', $element); - } - - public function testAddPreserveTextNotUTF8() - { - $oCell = new PHPWord_Section_Table_Cell('header', 1); - $element = $oCell->addPreserveText(utf8_decode('ééé')); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_Footer_PreserveText', $element); - $this->assertEquals($element->getText(), 'ééé'); - } - - public function testCreateTextRun() - { - $oCell = new PHPWord_Section_Table_Cell('section', 1); - $element = $oCell->createTextRun(); - - $this->assertCount(1, $oCell->getElements()); - $this->assertInstanceOf('PHPWord_Section_TextRun', $element); - } - - public function testGetElements() - { - $oCell = new PHPWord_Section_Table_Cell('section', 1); - - $this->assertInternalType('array', $oCell->getElements()); - } -} diff --git a/Tests/PHPWord/Section/TextTest.php b/Tests/PHPWord/Section/TextTest.php deleted file mode 100644 index 1a33a730d7..0000000000 --- a/Tests/PHPWord/Section/TextTest.php +++ /dev/null @@ -1,42 +0,0 @@ -assertInstanceOf('PHPWord_Section_Text', $oText); - $this->assertEquals(null, $oText->getText()); - $this->assertInstanceOf('PHPWord_Style_Font', $oText->getFontStyle()); - $this->assertInstanceOf('PHPWord_Style_Paragraph', $oText->getParagraphStyle()); - } - - public function testText() - { - $oText = new PHPWord_Section_Text('text'); - - $this->assertEquals($oText->getText(), 'text'); - } - - public function testFont() - { - $oText = new PHPWord_Section_Text('text', 'fontStyle'); - $this->assertEquals($oText->getFontStyle(), 'fontStyle'); - - $oText->setFontStyle(array('bold' => true, 'italic' => true, 'size' => 16)); - $this->assertInstanceOf('PHPWord_Style_Font', $oText->getFontStyle()); - } - - public function testParagraph() - { - $oText = new PHPWord_Section_Text('text', 'fontStyle', 'paragraphStyle'); - $this->assertEquals($oText->getParagraphStyle(), 'paragraphStyle'); - - $oText->setParagraphStyle(array('align' => 'center', 'spaceAfter' => 100)); - $this->assertInstanceOf('PHPWord_Style_Paragraph', $oText->getParagraphStyle()); - } -} diff --git a/Tests/PHPWord/SectionTest.php b/Tests/PHPWord/SectionTest.php deleted file mode 100644 index ac540d06a8..0000000000 --- a/Tests/PHPWord/SectionTest.php +++ /dev/null @@ -1,133 +0,0 @@ -assertAttributeEquals($oSection->getSettings(), '_settings', new PHPWord_Section(0)); - } - - /** - * @covers PHPWord_Section::getElements - */ - public function testGetElements() - { - $oSection = new PHPWord_Section(0); - $this->assertAttributeEquals($oSection->getElements(), '_elementCollection', new PHPWord_Section(0)); - } - - /** - * @covers PHPWord_Section::getFooter - */ - public function testGetFooter() - { - $oSection = new PHPWord_Section(0); - $this->assertAttributeEquals($oSection->getFooter(), '_footer', new PHPWord_Section(0)); - } - - /** - * @covers PHPWord_Section::getHeaders - */ - public function testGetHeaders() - { - $oSection = new PHPWord_Section(0); - $this->assertAttributeEquals($oSection->getHeaders(), '_headers', new PHPWord_Section(0)); - } - - /** - * @covers PHPWord_Section::setSettings - */ - public function testSetSettings() - { - $expected = 'landscape'; - $object = new PHPWord_Section(0); - $object->setSettings(array('orientation' => $expected)); - $this->assertEquals($expected, $object->getSettings()->getOrientation()); - } - - /** - * @covers PHPWord_Section::addText - * @covers PHPWord_Section::addLink - * @covers PHPWord_Section::addTextBreak - * @covers PHPWord_Section::addPageBreak - * @covers PHPWord_Section::addTable - * @covers PHPWord_Section::addListItem - * @covers PHPWord_Section::addObject - * @covers PHPWord_Section::addImage - * @covers PHPWord_Section::addMemoryImage - * @covers PHPWord_Section::addTOC - * @covers PHPWord_Section::addTitle - * @covers PHPWord_Section::createTextRun - * @covers PHPWord_Section::createFootnote - */ - public function testAddElements() - { - $objectSource = join( - DIRECTORY_SEPARATOR, - array(PHPWORD_TESTS_DIR_ROOT, '_files', 'documents', 'sheet.xls') - ); - $imageSource = join( - DIRECTORY_SEPARATOR, - array(PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'PHPWord.png') - ); - $imageUrl = 'http://php.net//images/logos/php-med-trans-light.gif'; - - $section = new PHPWord_Section(0); - $section->addText(utf8_decode('ä')); - $section->addLink(utf8_decode('http://äää.com'), utf8_decode('ä')); - $section->addTextBreak(); - $section->addPageBreak(); - $section->addTable(); - $section->addListItem(utf8_decode('ä')); - $section->addObject($objectSource); - $section->addImage($imageSource); - $section->addMemoryImage($imageUrl); - $section->addTOC(); - $section->addTitle(utf8_decode('ä'), 1); - $section->createTextRun(); - $section->createFootnote(); - - $elementCollection = $section->getElements(); - $elementType = 'Link'; - $objectType = "PHPWord_Section_{$elementType}"; - $this->assertInstanceOf($objectType, $elementCollection[1]); - // $elementTypes = array('Text', 'Link', 'TextBreak', 'PageBreak', - // 'Table', 'ListItem', 'Object', 'Image', 'MemoryImage', 'TOC', - // 'Title', 'TextRun'); - // $i = 0; - // foreach ($elementTypes as $elementType) { - // $objectType = "PHPWord_Section_{$elementType}"; - // $this->assertInstanceOf($objectType, $elementCollection[$i]); - // $i++; - // } - } - - /** - * @covers PHPWord_Section::createHeader - * @covers PHPWord_Section::createFooter - */ - public function testCreateHeaderFooter() - { - $object = new PHPWord_Section(0); - $elements = array('Header', 'Footer'); - foreach ($elements as $element) { - $objectType = "PHPWord_Section_{$element}"; - $method = "create{$element}"; - $this->assertInstanceOf($objectType, $object->$method()); - } - } -} diff --git a/Tests/PHPWord/SettingsTest.php b/Tests/PHPWord/SettingsTest.php deleted file mode 100644 index e61a212915..0000000000 --- a/Tests/PHPWord/SettingsTest.php +++ /dev/null @@ -1,26 +0,0 @@ -assertTrue(PHPWord_Settings::getCompatibility()); - $this->assertTrue(PHPWord_Settings::setCompatibility(false)); - $this->assertFalse(PHPWord_Settings::getCompatibility()); - $this->assertFalse(PHPWord_Settings::setCompatibility('Non boolean')); - } -} diff --git a/Tests/PHPWord/Shared/FileTest.php b/Tests/PHPWord/Shared/FileTest.php deleted file mode 100644 index fe825b8f8d..0000000000 --- a/Tests/PHPWord/Shared/FileTest.php +++ /dev/null @@ -1,92 +0,0 @@ -assertTrue(PHPWord_Shared_File::file_exists('blank.docx')); - } - /** - * Test file_exists() - */ - public function testNoFileExists() - { - $dir = join(DIRECTORY_SEPARATOR, array( - PHPWORD_TESTS_DIR_ROOT, - '_files', - 'templates' - )); - chdir($dir); - $this->assertFalse(PHPWord_Shared_File::file_exists('404.docx')); - } - - /** - * Test realpath() - */ - public function testRealpath() - { - $dir = join(DIRECTORY_SEPARATOR, array( - PHPWORD_TESTS_DIR_ROOT, - '_files', - 'templates' - )); - chdir($dir); - $file = 'blank.docx'; - $expected = $dir . DIRECTORY_SEPARATOR . $file; - $this->assertEquals($expected, PHPWord_Shared_File::realpath($file)); - } - - /** - * @covers PHPWord_Shared_File::imagetype - * @covers PHPWord_Shared_File::fallbackImagetype - */ - public function testImagetype() - { - $filename = PHPWORD_TESTS_DIR_ROOT . "/_files/images/mars_noext_jpg"; - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_JPEG, PHPWord_Shared_File::imagetype($filename, true)); - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_JPEG, PHPWord_Shared_File::imagetype($filename)); - - $filename = PHPWORD_TESTS_DIR_ROOT . "/_files/images/mars.jpg"; - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_JPEG, PHPWord_Shared_File::imagetype($filename, true)); - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_JPEG, PHPWord_Shared_File::imagetype($filename)); - - $filename = PHPWORD_TESTS_DIR_ROOT . "/_files/images/mario.gif"; - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_GIF, PHPWord_Shared_File::imagetype($filename, true)); - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_GIF, PHPWord_Shared_File::imagetype($filename)); - - $filename = PHPWORD_TESTS_DIR_ROOT . "/_files/images/firefox.png"; - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_PNG, PHPWord_Shared_File::imagetype($filename, true)); - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_PNG, PHPWord_Shared_File::imagetype($filename)); - - $filename = PHPWORD_TESTS_DIR_ROOT . "/_files/images/duke_nukem.bmp"; - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_BMP, PHPWord_Shared_File::imagetype($filename, true)); - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_BMP, PHPWord_Shared_File::imagetype($filename)); - - $filename = PHPWORD_TESTS_DIR_ROOT . "/_files/images/angela_merkel.tif"; - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_TIFF, PHPWord_Shared_File::imagetype($filename, true)); - $this->assertEquals(PHPWord_Shared_File::IMAGETYPE_TIFF, PHPWord_Shared_File::imagetype($filename)); - - $filename = PHPWORD_TESTS_DIR_ROOT . "/_files/images/alexz-johnson.pcx"; - $this->assertFalse(PHPWord_Shared_File::imagetype($filename, true)); - $this->assertFalse(PHPWord_Shared_File::imagetype($filename)); - } -} \ No newline at end of file diff --git a/Tests/PHPWord/Shared/StringTest.php b/Tests/PHPWord/Shared/StringTest.php deleted file mode 100644 index 3698e2e0e1..0000000000 --- a/Tests/PHPWord/Shared/StringTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertTrue(PHPWord_Shared_String::IsUTF8('')); - $this->assertTrue(PHPWord_Shared_String::IsUTF8('éééé')); - $this->assertFalse(PHPWord_Shared_String::IsUTF8(utf8_decode('éééé'))); - } - - public function testControlCharacterOOXML2PHP() - { - $this->assertEquals('', PHPWord_Shared_String::ControlCharacterOOXML2PHP('')); - $this->assertEquals(chr(0x08), PHPWord_Shared_String::ControlCharacterOOXML2PHP('_x0008_')); - } - - public function testControlCharacterPHP2OOXML() - { - $this->assertEquals('', PHPWord_Shared_String::ControlCharacterPHP2OOXML('')); - $this->assertEquals('_x0008_', PHPWord_Shared_String::ControlCharacterPHP2OOXML(chr(0x08))); - } -} diff --git a/Tests/PHPWord/Style/TableTest.php b/Tests/PHPWord/Style/TableTest.php deleted file mode 100644 index 439aa5ae8b..0000000000 --- a/Tests/PHPWord/Style/TableTest.php +++ /dev/null @@ -1,51 +0,0 @@ -setStyleValue($property, $value); - $this->assertEquals($value, $object->$get()); - } - } - - /** - * Test cell margin - */ - public function testCellMargin() - { - $object = new PHPWord_Style_Table(); - $parts = array('Top', 'Left', 'Right', 'Bottom'); - - // Set cell margin and test if each part has the same margin - // While looping, push values array to be asserted with getCellMargin - $value = 240; // In twips - foreach ($parts as $part) { - $set = "setCellMargin{$part}"; - $get = "getCellMargin{$part}"; - $values[] = $value; - $object->$set($value); - $this->assertEquals($value, $object->$get()); - } - $this->assertEquals($values, $object->getCellMargin()); - } -} diff --git a/Tests/PHPWord/StyleTest.php b/Tests/PHPWord/StyleTest.php deleted file mode 100644 index 9e442cb13e..0000000000 --- a/Tests/PHPWord/StyleTest.php +++ /dev/null @@ -1,44 +0,0 @@ - 'center'); - $font = array('italic' => true); - $table = array('bgColor' => 'CCCCCC'); - $styles = array('Paragraph' => 'Paragraph', 'Font' => 'Font', - 'Link' => 'Font', 'Table' => 'TableFull', - 'Heading_1' => 'Font', 'Normal' => 'Paragraph'); - $elementCount = 6; - PHPWord_Style::addParagraphStyle('Paragraph', $paragraph); - PHPWord_Style::addFontStyle('Font', $font); - PHPWord_Style::addLinkStyle('Link', $font); - PHPWord_Style::addTableStyle('Table', $table); - PHPWord_Style::addTitleStyle(1, $font); - PHPWord_Style::setDefaultParagraphStyle($paragraph); - - $this->assertEquals($elementCount, count(PHPWord_Style::getStyles())); - foreach ($styles as $name => $style) { - $expected = "PHPWord_Style_{$style}"; - $this->assertInstanceOf($expected, PHPWord_Style::getStyle($name)); - } - $this->assertNull(PHPWord_Style::getStyle('Unknown')); - } -} diff --git a/Tests/PHPWord/Writer/ODTextTest.php b/Tests/PHPWord/Writer/ODTextTest.php deleted file mode 100644 index ef92d249fd..0000000000 --- a/Tests/PHPWord/Writer/ODTextTest.php +++ /dev/null @@ -1,154 +0,0 @@ -assertInstanceOf('PHPWord', $object->getPHPWord()); - $this->assertInstanceOf("PHPWord_HashTable", $object->getDrawingHashTable()); - - $this->assertEquals('./', $object->getDiskCachingDirectory()); - $writerParts = array('Content', 'Manifest', 'Meta', 'Mimetype', 'Styles'); - foreach ($writerParts as $part) { - $this->assertInstanceOf( - "PHPWord_Writer_ODText_{$part}", - $object->getWriterPart($part) - ); - $this->assertInstanceOf( - "PHPWord_Writer_ODText", - $object->getWriterPart($part)->getParentWriter() - ); - } - } - - /** - * @covers ::getPHPWord - * @expectedException Exception - * @expectedExceptionMessage No PHPWord assigned. - */ - public function testConstructWithNull() - { - $object = new PHPWord_Writer_ODText(); - $object->getPHPWord(); - } - - /** - * @covers ::save - */ - public function testSave() - { - $imageSrc = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'PHPWord.png') - ); - $objectSrc = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'documents', 'sheet.xls') - ); - $file = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'temp.odt') - ); - - $phpWord = new PHPWord(); - $phpWord->addFontStyle('Font', array('size' => 11)); - $phpWord->addParagraphStyle('Paragraph', array('align' => 'center')); - $section = $phpWord->createSection(); - $section->addText('Test 1', 'Font'); - $section->addTextBreak(); - $section->addText('Test 2', null, 'Paragraph'); - $section->addLink('http://test.com'); - $section->addTitle('Test', 1); - $section->addPageBreak(); - $section->addTable(); - $section->addListItem('Test'); - $section->addImage($imageSrc); - $section->addObject($objectSrc); - $section->addTOC(); - $section = $phpWord->createSection(); - $textrun = $section->createTextRun(); - $textrun->addText('Test 3'); - $writer = new PHPWord_Writer_ODText($phpWord); - $writer->save($file); - - $this->assertTrue(file_exists($file)); - - unlink($file); - } - - /** - * @covers ::save - * @todo Haven't got any method to test this - */ - public function testSavePhpOutput() - { - $phpWord = new PHPWord(); - $section = $phpWord->createSection(); - $section->addText('Test'); - $writer = new PHPWord_Writer_ODText($phpWord); - $writer->save('php://output'); - } - - /** - * @covers ::save - * @expectedException Exception - * @expectedExceptionMessage PHPWord object unassigned. - */ - public function testSaveException() - { - $writer = new PHPWord_Writer_ODText(); - $writer->save(); - } - - /** - * @covers ::getWriterPart - */ - public function testGetWriterPartNull() - { - $object = new PHPWord_Writer_ODText(); - $this->assertNull($object->getWriterPart('foo')); - } - - /** - * @covers ::setUseDiskCaching - * @covers ::getUseDiskCaching - */ - public function testSetGetUseDiskCaching() - { - $object = new PHPWord_Writer_ODText(); - $object->setUseDiskCaching(true, PHPWORD_TESTS_DIR_ROOT); - $this->assertTrue($object->getUseDiskCaching()); - $this->assertEquals(PHPWORD_TESTS_DIR_ROOT, $object->getDiskCachingDirectory()); - } - - /** - * @covers ::setUseDiskCaching - * @expectedException Exception - */ - public function testSetUseDiskCachingException() - { - $dir = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, 'foo') - ); - - $object = new PHPWord_Writer_ODText($phpWord); - $object->setUseDiskCaching(true, $dir); - } -} diff --git a/Tests/PHPWord/Writer/RTFTest.php b/Tests/PHPWord/Writer/RTFTest.php deleted file mode 100644 index d071def78f..0000000000 --- a/Tests/PHPWord/Writer/RTFTest.php +++ /dev/null @@ -1,107 +0,0 @@ -assertInstanceOf('PHPWord', $object->getPHPWord()); - $this->assertInstanceOf("PHPWord_HashTable", $object->getDrawingHashTable()); - } - - /** - * covers ::__construct - * @expectedException Exception - * @expectedExceptionMessage No PHPWord assigned. - */ - public function testConstructWithNull() - { - $object = new PHPWord_Writer_RTF(); - $object->getPHPWord(); - } - - /** - * @covers ::save - * @todo Haven't got any method to test this - */ - public function testSavePhpOutput() - { - $phpWord = new PHPWord(); - $section = $phpWord->createSection(); - $section->addText('Test'); - $writer = new PHPWord_Writer_RTF($phpWord); - $writer->save('php://output'); - } - - /** - * @covers ::save - * @expectedException Exception - * @expectedExceptionMessage PHPWord object unassigned. - */ - public function testSaveException() - { - $writer = new PHPWord_Writer_RTF(); - $writer->save(); - } - - /** - * @covers ::save - * @covers :: - */ - public function testSave() - { - $imageSrc = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'images', 'PHPWord.png') - ); - $objectSrc = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'documents', 'sheet.xls') - ); - $file = \join( - \DIRECTORY_SEPARATOR, - array(\PHPWORD_TESTS_DIR_ROOT, '_files', 'temp.rtf') - ); - - $phpWord = new PHPWord(); - $phpWord->addFontStyle('Font', array('size' => 11)); - $phpWord->addParagraphStyle('Paragraph', array('align' => 'center')); - $section = $phpWord->createSection(); - $section->addText('Test 1', 'Font'); - $section->addTextBreak(); - $section->addText('Test 2', null, 'Paragraph'); - $section->addLink('http://test.com'); - $section->addTitle('Test', 1); - $section->addPageBreak(); - $section->addTable(); - $section->addListItem('Test'); - $section->addImage($imageSrc); - $section->addObject($objectSrc); - $section->addTOC(); - $section = $phpWord->createSection(); - $textrun = $section->createTextRun(); - $textrun->addText('Test 3'); - $textrun->addTextBreak(); - $writer = new PHPWord_Writer_RTF($phpWord); - $writer->save($file); - - $this->assertTrue(file_exists($file)); - - unlink($file); - } -} diff --git a/Tests/PHPWordTest.php b/Tests/PHPWordTest.php deleted file mode 100644 index 15106af6bb..0000000000 --- a/Tests/PHPWordTest.php +++ /dev/null @@ -1,186 +0,0 @@ -assertEquals( - new PHPWord_DocumentProperties(), - $object->getProperties() - ); - $this->assertEquals( - PHPWord::DEFAULT_FONT_NAME, - $object->getDefaultFontName() - ); - $this->assertEquals( - PHPWord::DEFAULT_FONT_SIZE, - $object->getDefaultFontSize() - ); - } - - /** - * @covers PHPWord::setProperties - * @covers PHPWord::getProperties - */ - public function testSetGetProperties() - { - $object = new PHPWord(); - $creator = 'PHPWord'; - $properties = $object->getProperties(); - $properties->setCreator($creator); - $object->setProperties($properties); - $this->assertEquals($creator, $object->getProperties()->getCreator()); - } - - /** - * @covers PHPWord::createSection - * @covers PHPWord::getSections - */ - public function testCreateGetSections() - { - $object = new PHPWord(); - $this->assertEquals(new PHPWord_Section(1), $object->createSection()); - $object->createSection(); - $this->assertEquals(2, count($object->getSections())); - } - - /** - * @covers PHPWord::setDefaultFontName - * @covers PHPWord::getDefaultFontName - */ - public function testSetGetDefaultFontName() - { - $object = new PHPWord(); - $fontName = 'Times New Roman'; - $this->assertEquals( - PHPWord::DEFAULT_FONT_NAME, - $object->getDefaultFontName() - ); - $object->setDefaultFontName($fontName); - $this->assertEquals($fontName, $object->getDefaultFontName()); - } - - /** - * @covers PHPWord::setDefaultFontSize - * @covers PHPWord::getDefaultFontSize - */ - public function testSetGetDefaultFontSize() - { - $object = new PHPWord(); - $fontSize = 16; - $this->assertEquals( - PHPWord::DEFAULT_FONT_SIZE, - $object->getDefaultFontSize() - ); - $object->setDefaultFontSize($fontSize); - $this->assertEquals($fontSize, $object->getDefaultFontSize()); - } - - /** - * @covers PHPWord::setDefaultParagraphStyle - * @covers PHPWord::loadTemplate - */ - public function testSetDefaultParagraphStyle() - { - $object = new PHPWord(); - $object->setDefaultParagraphStyle(array()); - $this->assertInstanceOf( - 'PHPWord_Style_Paragraph', - PHPWord_Style::getStyle('Normal') - ); - } - - /** - * @covers PHPWord::addParagraphStyle - * @covers PHPWord::addFontStyle - * @covers PHPWord::addTableStyle - * @covers PHPWord::addLinkStyle - */ - public function testAddStyles() - { - $object = new PHPWord(); - $styles = array('Paragraph' => 'Paragraph', 'Font' => 'Font', - 'Table' => 'TableFull', 'Link' => 'Font'); - foreach ($styles as $key => $value) { - $method = "add{$key}Style"; - $styleId = "{$key} Style"; - $styleType = "PHPWord_Style_{$value}"; - $object->$method($styleId, array()); - $this->assertInstanceOf( - $styleType, - PHPWord_Style::getStyle($styleId) - ); - } - - } - - /** - * @covers PHPWord::addTitleStyle - */ - public function testAddTitleStyle() - { - $object = new PHPWord(); - $titleLevel = 1; - $titleName = "Heading_{$titleLevel}"; - $object->addTitleStyle($titleLevel, array()); - $this->assertInstanceOf( - 'PHPWord_Style_Font', - PHPWord_Style::getStyle($titleName) - ); - } - - /** - * @covers PHPWord::loadTemplate - */ - public function testLoadTemplate() - { - $file = join( - DIRECTORY_SEPARATOR, - array(PHPWORD_TESTS_DIR_ROOT, '_files', 'templates', 'blank.docx') - ); - $object = new PHPWord(); - $this->assertInstanceOf( - 'PHPWord_Template', - $object->loadTemplate($file) - ); - } - - /** - * @covers PHPWord::loadTemplate - * @expectedException PHPWord_Exception - */ - public function testLoadTemplateException() - { - $file = join( - DIRECTORY_SEPARATOR, - array(PHPWORD_TESTS_DIR_ROOT, '_files', 'templates', 'blanks.docx') - ); - $object = new PHPWord(); - $object->loadTemplate($file); - } -} diff --git a/Tests/_inc/TestHelperDOCX.php b/Tests/_inc/TestHelperDOCX.php deleted file mode 100644 index ba5dcf07f6..0000000000 --- a/Tests/_inc/TestHelperDOCX.php +++ /dev/null @@ -1,73 +0,0 @@ -save(self::$file); - - $zip = new \ZipArchive; - $res = $zip->open(self::$file); - if ($res === true) { - $zip->extractTo(sys_get_temp_dir() . '/PHPWord_Unit_Test/'); - $zip->close(); - } - - return new XmlDocument(sys_get_temp_dir() . '/PHPWord_Unit_Test/'); - } - - public static function clear() - { - if (file_exists(self::$file)) { - unlink(self::$file); - } - if (is_dir(sys_get_temp_dir() . '/PHPWord_Unit_Test/')) { - self::deleteDir(sys_get_temp_dir() . '/PHPWord_Unit_Test/'); - } - } - - /** - * @param string $dir - */ - public static function deleteDir($dir) - { - foreach (scandir($dir) as $file) { - if ($file === '.' || $file === '..') { - continue; - } elseif (is_file($dir . "/" . $file)) { - unlink($dir . "/" . $file); - } elseif (is_dir($dir . "/" . $file)) { - self::deleteDir($dir . "/" . $file); - } - } - - rmdir($dir); - } - - /** - * @return string - */ - public static function getFile() - { - return self::$file; - } -} \ No newline at end of file diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php deleted file mode 100755 index 1066a0d42c..0000000000 --- a/Tests/bootstrap.php +++ /dev/null @@ -1,15 +0,0 @@ - 1 and not every sections have footnote -- Feature: (ivanlanin) GH-18 - TextBreak: Allow font and paragraph style for text break -- QA: (Progi1984) - UnitTests - -Changes 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 -- Feature: (Progi1984) GH-1 - Implement RTF Writer -- Feature: (Progi1984) GH-2 - Implement ODT Writer -- Feature: (kaystrobach) - Word2007 : Add rowspan and colspan to cells -- Feature: (RLovelett) - Word2007 : Support for tab stops -- Feature: (RLovelett) - Word2007 : Support Multiple headers -- Feature: (gabrielbull) - Word2007 : Wrapping Styles to Images -- General: (MarkBaker) - Add superscript/subscript styling in Excel2007 Writer -- General: (deds) - add indentation support to paragraphs -- General: (Progi1984) GH-27 - Support for Composer -- General: (Progi1984) - Basic CI with Travis -- 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: (gabrielbull) - Added support for image wrapping style diff --git a/composer.json b/composer.json index 962ed78ef6..1559ad7b2f 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,14 @@ { "name": "phpoffice/phpword", - "description": "PHPWord - Read, Create and Write Word documents in PHP", - "keywords": ["PHP", "Word", "Writer", "docx", "doc", "rtf"], + "description": "PHPWord - Read, Create, and Write DOCX, ODT, and RTF documents in PHP", + "keywords": [ + "PHP", "PhpOffice", "office", "PhpWord", "word", "template", "reader", "writer", + "docx", "OOXML", "OpenXML", "Office Open XML", "ISO IEC 29500", "WordprocessingML", + "RTF", "Rich Text Format", "doc", "odt", "OpenDocument" + ], "homepage": "http://phpoffice.github.io", "type": "library", - "license": "LGPL", + "license": "LGPL-3.0+", "authors": [ { "name": "Mark Baker" @@ -17,26 +21,28 @@ { "name": "Franck Lefevre", "homepage": "http://blog.rootslabs.net" + }, + { + "name": "Ivan Lanin", + "homepage": "http://ivan.lanin.org" } ], "require": { - "php": ">=5.3.0", + "php": ">=5.3.3", "ext-xml": "*", "ext-zip": "*" }, "require-dev": { "phpunit/phpunit": "3.7.*" }, - "recommend": { - "ext-gd2": "*" - }, "suggest": { + "ext-gd2": "*", "ext-xmlwriter": "*", "ext-xsl": "*" }, "autoload": { - "psr-0": { - "PHPWord": "Classes/" + "psr-4": { + "PhpOffice\\PhpWord\\": "src/" } } -} +} \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000000..5631b06028 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,153 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PhpWord.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PhpWord.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/PhpWord" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PhpWord" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000000..f5c38581f1 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,290 @@ +# -*- coding: utf-8 -*- +# +# PhpWord documentation build configuration file, created by +# sphinx-quickstart on Fri Mar 14 23:09:26 2014. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'PhpWord' +copyright = u'2014, Progi1984' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '0.9.0' +# The full version, including alpha/beta/rc tags. +release = version + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'PhpWorddoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'PhpWord.tex', u'PhpWord Documentation', + u'The PhpWord Team', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'PhpWord', u'PhpWord Documentation', + [u'The PhpWord Team'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'PhpWord', u'PhpWord Documentation', + u'The PhpWord Team', 'PhpWord', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# -- Options for Epub output --------------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = u'PhpWord' +epub_author = u'The PhpWord Team' +epub_publisher = u'The PhpWord Team' +epub_copyright = copyright + +# The language of the text. It defaults to the language option +# or en if the language is not set. +#epub_language = '' + +# The scheme of the identifier. Typical schemes are ISBN or URL. +#epub_scheme = '' + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +#epub_identifier = '' + +# A unique identification for the text. +#epub_uid = '' + +# A tuple containing the cover image and cover page html template filenames. +#epub_cover = () + +# HTML files that should be inserted before the pages created by sphinx. +# The format is a list of tuples containing the path and title. +#epub_pre_files = [] + +# HTML files shat should be inserted after the pages created by sphinx. +# The format is a list of tuples containing the path and title. +#epub_post_files = [] + +# A list of files that should not be packed into the epub file. +#epub_exclude_files = [] + +# The depth of the table of contents in toc.ncx. +#epub_tocdepth = 3 + +# Allow duplicate toc entries. +#epub_tocdup = True + +# Highlight PHP without starting createSection($sectionSettings); + +The ``$sectionSettings`` is an optional associative array that sets the +section. Example: + +.. code-block:: php + + $sectionSettings = array( + 'orientation' => 'landscape', + 'marginTop' => 600, + 'colsNum' => 2, + ); + +Section settings +~~~~~~~~~~~~~~~~ + +Below are the available settings for section: + +- ``orientation`` Page orientation, i.e. 'portrait' (default) or + 'landscape' +- ``marginTop`` Page margin top in twips +- ``marginLeft`` Page margin left in twips +- ``marginRight`` Page margin right in twips +- ``marginBottom`` Page margin bottom in twips +- ``borderTopSize`` Border top size in twips +- ``borderTopColor`` Border top color +- ``borderLeftSize`` Border left size in twips +- ``borderLeftColor`` Border left color +- ``borderRightSize`` Border right size in twips +- ``borderRightColor`` Border right color +- ``borderBottomSize`` Border bottom size in twips +- ``borderBottomColor`` Border bottom color +- ``headerHeight`` Spacing to top of header +- ``footerHeight`` Spacing to bottom of footer +- ``colsNum`` Number of columns +- ``colsSpace`` Spacing between columns +- ``breakType`` Section break type (nextPage, nextColumn, continuous, + evenPage, oddPage) + +The following two settings are automatically set by the use of the +``orientation`` setting. You can alter them but that's not recommended. + +- ``pageSizeW`` Page width in twips +- ``pageSizeH`` Page height in twips + +Page number +~~~~~~~~~~~ + +You can change a section page number by using the ``pageNumberingStart`` +property of the section. + +.. code-block:: php + + // Method 1 + $section = $phpWord->createSection(array('pageNumberingStart' => 1)); + + // Method 2 + $section = $phpWord->createSection(); + $section->getSettings()->setPageNumberingStart(1); + +Multicolumn +~~~~~~~~~~~ + +You can change a section layout to multicolumn (like in a newspaper) by +using the ``breakType`` and ``colsNum`` property of the section. + +.. code-block:: php + + // Method 1 + $section = $phpWord->createSection(array('breakType' => 'continuous', 'colsNum' => 2)); + + // Method 2 + $section = $phpWord->createSection(); + $section->getSettings()->setBreakType('continuous'); + $section->getSettings()->setColsNum(2); + +Headers +------- + +Each section can have its own header reference. To create a header use +the ``createHeader`` method: + +.. code-block:: php + + $header = $section->createHeader(); + +Be sure to save the result in a local object. You can use all elements +that are available for the footer. See "Footer" section for detail. +Additionally, only inside of the header reference you can add watermarks +or background pictures. See "Watermarks" section. + +Footers +------- + +Each section can have its own footer reference. To create a footer, use +the ``createFooter`` method: + +.. code-block:: php + + $footer = $section->createFooter(); + +Be sure to save the result in a local object to add elements to a +footer. You can add the following elements to footers: + +- Texts ``addText`` and ``createTextrun`` +- Text breaks +- Images +- Tables +- Preserve text + +See the "Elements" section for the detail of each elements. + +Other containers +---------------- + +Textruns, table cells, and footnotes are elements that can also act as +containers. See the corresponding "Elements" section for the detail of +each elements. diff --git a/docs/credits.rst b/docs/credits.rst new file mode 100644 index 0000000000..9b6e46c68c --- /dev/null +++ b/docs/credits.rst @@ -0,0 +1,4 @@ +.. _credits: + +Credits +======= diff --git a/docs/elements.rst b/docs/elements.rst new file mode 100644 index 0000000000..d0f78d2e50 --- /dev/null +++ b/docs/elements.rst @@ -0,0 +1,347 @@ +.. _elements: + +Elements +======== + +Texts +----- + +Text can be added by using ``addText`` and ``createTextRun`` method. +``addText`` is used for creating simple paragraphs that only contain +texts with the same style. ``createTextRun`` is used for creating +complex paragraphs that contain text with different style (some bold, +other italics, etc) or other elements, e.g. images or links. The +syntaxes are as follow: + +.. code-block:: php + + $section->addText($text, [$fontStyle], [$paragraphStyle]); + $textrun = $section->createTextRun([$paragraphStyle]); + +Text styles +~~~~~~~~~~~ + +You can use the ``$fontStyle`` and ``$paragraphStyle`` variable to +define text formatting. There are 2 options to style the inserted text +elements, i.e. inline style by using array or defined style by adding +style definition. + +Inline style examples: + +.. code-block:: php + + $fontStyle = array('name' => 'Times New Roman', 'size' => 9); + $paragraphStyle = array('align' => 'both'); + $section->addText('I am simple paragraph', $fontStyle, $paragraphStyle); + + $textrun = $section->createTextRun(); + $textrun->addText('I am bold', array('bold' => true)); + $textrun->addText('I am italic', array('italic' => true)); + $textrun->addText('I am colored, array('color' => 'AACC00')); + +Defined style examples: + +.. code-block:: php + + $fontStyle = array('color' => '006699', 'size' => 18, 'bold' => true); + $phpWord->addFontStyle('fStyle', $fontStyle); + $text = $section->addText('Hello world!', 'fStyle'); + + $paragraphStyle = array('align' => 'center'); + $phpWord->addParagraphStyle('pStyle', $paragraphStyle); + $text = $section->addText('Hello world!', 'pStyle'); + +Font style +^^^^^^^^^^ + +Available font styles: + +- ``name`` Font name, e.g. *Arial* +- ``size`` Font size, e.g. *20*, *22*, +- ``hint`` Font content type, *default*, *eastAsia*, or *cs* +- ``bold`` Bold, *true* or *false* +- ``italic`` Italic, *true* or *false* +- ``superScript`` Superscript, *true* or *false* +- ``subScript`` Subscript, *true* or *false* +- ``underline`` Underline, *dash*, *dotted*, etc. +- ``strikethrough`` Strikethrough, *true* or *false* +- ``color`` Font color, e.g. *FF0000* +- ``fgColor`` Font highlight color, e.g. *yellow*, *green*, *blue* + +Paragraph style +^^^^^^^^^^^^^^^ + +Available paragraph styles: + +- ``align`` Paragraph alignment, *left*, *right* or *center* +- ``spaceBefore`` Space before paragraph +- ``spaceAfter`` Space after paragraph +- ``indent`` Indent by how much +- ``hanging`` Hanging by how much +- ``basedOn`` Parent style +- ``next`` Style for next paragraph +- ``widowControl`` Allow first/last line to display on a separate page, + *true* or *false* +- ``keepNext`` Keep paragraph with next paragraph, *true* or *false* +- ``keepLines`` Keep all lines on one page, *true* or *false* +- ``pageBreakBefore`` Start paragraph on next page, *true* or *false* +- ``lineHeight`` text line height, e.g. *1.0*, *1.5*, ect... +- ``tabs`` Set of custom tab stops + +Titles +~~~~~~ + +If you want to structure your document or build table of contents, you +need titles or headings. To add a title to the document, use the +``addTitleStyle`` and ``addTitle`` method. + +.. code-block:: php + + $phpWord->addTitleStyle($depth, [$fontStyle], [$paragraphStyle]); + $section->addTitle($text, [$depth]); + +Its necessary to add a title style to your document because otherwise +the title won't be detected as a real title. + +Links +~~~~~ + +You can add Hyperlinks to the document by using the function addLink: + +.. code-block:: php + + $section->addLink($linkSrc, [$linkName], [$fontStyle], [$paragraphStyle]); + +- ``$linkSrc`` The URL of the link. +- ``$linkName`` Placeholder of the URL that appears in the document. +- ``$fontStyle`` See "Font style" section. +- ``$paragraphStyle`` See "Paragraph style" section. + +Preserve texts +~~~~~~~~~~~~~~ + +The ``addPreserveText`` method is used to add a page number or page +count to headers or footers. + +.. code-block:: php + + $footer->addPreserveText('Page {PAGE} of {NUMPAGES}.'); + +Breaks +------ + +Text breaks +~~~~~~~~~~~ + +Text breaks are empty new lines. To add text breaks, use the following +syntax. All paramaters are optional. + +.. code-block:: php + + $section->addTextBreak([$breakCount], [$fontStyle], [$paragraphStyle]); + +- ``$breakCount`` How many lines +- ``$fontStyle`` See "Font style" section. +- ``$paragraphStyle`` See "Paragraph style" section. + +Page breaks +~~~~~~~~~~~ + +There are two ways to insert a page breaks, using the ``addPageBreak`` +method or using the ``pageBreakBefore`` style of paragraph. + +:: code-block:: php + + $section->addPageBreak(); + +Lists +----- + +To add a list item use the function ``addListItem``. + +.. code-block:: php + + $section->addListItem($text, [$depth], [$fontStyle], [$listStyle], [$paragraphStyle]); + +- ``$text`` Text that appears in the document. +- ``$depth`` Depth of list item. +- ``$fontStyle`` See "Font style" section. +- ``$listStyle`` List style of the current element TYPE\_NUMBER, + TYPE\_ALPHANUM, TYPE\_BULLET\_FILLED, etc. See list of constants in + PHPWord\_Style\_ListItem. +- ``$paragraphStyle`` See "Paragraph style" section. + +Tables +------ + +To add tables, rows, and cells, use the ``addTable``, ``addRow``, and +``addCell`` methods: + +.. code-block:: php + + $table = $section->addTable([$tableStyle]); + $table->addRow([$height], [$rowStyle]); + $cell = $table->addCell($width, [$cellStyle]); + +Table style can be defined with ``addTableStyle``: + +.. code-block:: php + + $tableStyle = array( + 'borderColor' => '006699', + 'borderSize' => 6, + 'cellMargin' => 50 + ); + $firstRowStyle = array('bgColor' => '66BBFF'); + $phpWord->addTableStyle('myTable', $tableStyle, $firstRowStyle); + $table = $section->addTable('myTable'); + +Table, row, and cell styles +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Table styles: + +- ``$width`` Table width in percent +- ``$bgColor`` Background color, e.g. '9966CC' +- ``$border(Top|Right|Bottom|Left)Size`` Border size in twips +- ``$border(Top|Right|Bottom|Left)Color`` Border color, e.g. '9966CC' +- ``$cellMargin(Top|Right|Bottom|Left)`` Cell margin in twips + +Row styles: + +- ``tblHeader`` Repeat table row on every new page, *true* or *false* +- ``cantSplit`` Table row cannot break across pages, *true* or *false* + +Cell styles: + +- ``$width`` Cell width in twips +- ``$valign`` Vertical alignment, *top*, *center*, *both*, *bottom* +- ``$textDirection`` Direction of text +- ``$bgColor`` Background color, e.g. '9966CC' +- ``$border(Top|Right|Bottom|Left)Size`` Border size in twips +- ``$border(Top|Right|Bottom|Left)Color`` Border color, e.g. '9966CC' +- ``$gridSpan`` Number of columns spanned +- ``$vMerge`` *restart* or *continue* + +Cell span +~~~~~~~~~ + +You can span a cell on multiple columns by using ``gridSpan`` or +multiple rows by using ``vMerge``. + +.. code-block:: php + + $cell = $table->addCell(200); + $cell->getStyle()->setGridSpan(5); + +See ``Sample_09_Tables.php`` for more code sample. + +Images +------ + +To add an image, use the ``addImage`` method to sections, headers, footers, +textruns, or table cells. + +.. code-block:: php + + $section->addImage($src, [$style]); + +- `source` String path to a local image or URL of a remote image +- `styles` Array fo styles for the image. See below. + +Examples: + +.. code-block:: php + + $section = $phpWord->createSection(); + $section->addImage( + 'mars.jpg', + array( + 'width' => 100, + 'height' => 100, + 'marginTop' => -1, + 'marginLeft' => -1, + 'wrappingStyle' => 'behind' + ) + ); + $footer = $section->createFooter(); + $footer->addImage('http://example.com/image.php'); + $textrun = $section->createTextRun(); + $textrun->addImage('http://php.net/logo.jpg'); + +Image styles +~~~~~~~~~~~~ + +Available image styles: + +- ``width`` Width in pixels +- ``height`` Height in pixels +- ``align`` Image alignment, *left*, *right*, or *center* +- ``marginTop`` Top margin in inches, can be negative +- ``marginLeft`` Left margin in inches, can be negative +- ``wrappingStyle`` Wrapping style, *inline*, *square*, *tight*, + *behind*, or *infront* + +Watermarks +~~~~~~~~~~ + +To add a watermark (or page background image), your section needs a +header reference. After creating a header, you can use the +``addWatermark`` method to add a watermark. + +.. code-block:: php + + $section = $phpWord->createSection(); + $header = $section->createHeader(); + $header->addWatermark('resources/_earth.jpg', array('marginTop' => 200, 'marginLeft' => 55)); + +Objects +------- + +You can add OLE embeddings, such as Excel spreadsheets or PowerPoint +presentations to the document by using ``addObject`` method. + +.. code-block:: php + + $section->addObject($src, [$style]); + +Table of contents +----------------- + +To add a table of contents (TOC), you can use the ``addTOC`` method. +Your TOC can only be generated if you have add at least one title (See +"Titles"). + +.. code-block:: php + + $section->addTOC([$fontStyle], [$tocStyle]); + +- ``tabLeader`` Fill type between the title text and the page number. + Use the defined constants in PHPWord\_Style\_TOC. +- ``tabPos`` The position of the tab where the page number appears in + twips. +- ``indent`` The indent factor of the titles in twips. + +Footnotes +--------- + +You can create footnotes in texts or textruns, but it's recommended to +use textrun to have better layout. + +On textrun: + +.. code-block:: php + + $textrun = $section->createTextRun(); + $textrun->addText('Lead text.'); + $footnote = $textrun->createFootnote(); + $footnote->addText('Footnote text.'); + $textrun->addText('Trailing text.'); + +On text: + +.. code-block:: php + + $section->addText('Lead text.'); + $footnote = $section->createFootnote(); + $footnote->addText('Footnote text.'); diff --git a/docs/faq.rst b/docs/faq.rst new file mode 100644 index 0000000000..ec158356e7 --- /dev/null +++ b/docs/faq.rst @@ -0,0 +1,20 @@ +.. _faq: + +Frequently asked questions +========================== + +Is this the same with PHPWord that I found in CodePlex? +------------------------------------------------------- + +No. This one is much better with tons of new features that you can’t +find in PHPWord 0.6.3. The development in CodePlex is halted and +switched to GitHub to allow more participation from the crowd. The more +the merrier, right? + +I’ve been running PHPWord from CodePlex flawlessly, but I can’t use the latest PHPWord from GitHub. Why? +-------------------------------------------------------------------------------------------------------- + +PHPWord requires PHP 5.3+ since 0.8, while PHPWord 0.6.3 from CodePlex +can run with PHP 5.2. There’s a lot of new features that we can get from +PHP 5.3 and it’s been around since 2009! You should upgrade your PHP +version to use PHPWord 0.8+. diff --git a/docs/general.rst b/docs/general.rst new file mode 100644 index 0000000000..9b25551a7c --- /dev/null +++ b/docs/general.rst @@ -0,0 +1,107 @@ +.. _general: + +General usage +============= + +Basic example +------------- + +The following is a basic example of the PHPWord library. More examples +are provided in the `samples folder `__. + +.. code-block:: php + + require_once 'src/PhpWord/Autoloader.php'; + PhpOffice\PhpWord\Autoloader::register(); + + $phpWord = new \PhpOffice\PhpWord\PhpWord(); + + // Every element you want to append to the word document is placed in a section. + // To create a basic section: + $section = $phpWord->createSection(); + + // After creating a section, you can append elements: + $section->addText('Hello world!'); + + // You can directly style your text by giving the addText function an array: + $section->addText('Hello world! I am formatted.', + array('name'=>'Tahoma', 'size'=>16, 'bold'=>true)); + + // If you often need the same style again you can create a user defined style + // to the word document and give the addText function the name of the style: + $phpWord->addFontStyle('myOwnStyle', + array('name'=>'Verdana', 'size'=>14, 'color'=>'1B2232')); + $section->addText('Hello world! I am formatted by a user defined style', + 'myOwnStyle'); + + // You can also put the appended element to local object like this: + $fontStyle = new \PhpOffice\PhpWord\Style\Font(); + $fontStyle->setBold(true); + $fontStyle->setName('Verdana'); + $fontStyle->setSize(22); + $myTextElement = $section->addText('Hello World!'); + $myTextElement->setFontStyle($fontStyle); + + // Finally, write the document: + $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007'); + $objWriter->save('helloWorld.docx'); + + $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'ODText'); + $objWriter->save('helloWorld.odt'); + + $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'RTF'); + $objWriter->save('helloWorld.rtf'); + +Default font +------------ + +By default, every text appears in Arial 10 point. You can alter the +default font by using the following two functions: + +.. code-block:: php + + $phpWord->setDefaultFontName('Times New Roman'); + $phpWord->setDefaultFontSize(12); + +Document properties +------------------- + +You can set the document properties such as title, creator, and company +name. Use the following functions: + +.. code-block:: php + + $properties = $phpWord->getProperties(); + $properties->setCreator('My name'); + $properties->setCompany('My factory'); + $properties->setTitle('My title'); + $properties->setDescription('My description'); + $properties->setCategory('My category'); + $properties->setLastModifiedBy('My name'); + $properties->setCreated(mktime(0, 0, 0, 3, 12, 2014)); + $properties->setModified(mktime(0, 0, 0, 3, 14, 2014)); + $properties->setSubject('My subject'); + $properties->setKeywords('my, key, word'); + +Measurement units +----------------- + +The base length unit in Open Office XML is twip. Twip means "TWentieth +of an Inch Point", i.e. 1 twip = 1/1440 inch. + +You can use PHPWord helper functions to convert inches, centimeters, or +points to twips. + +.. code-block:: php + + // Paragraph with 6 points space after + $phpWord->addParagraphStyle('My Style', array( + 'spaceAfter' => \PhpOffice\PhpWord\Shared\Font::pointSizeToTwips(6)) + ); + + $section = $phpWord->createSection(); + $sectionStyle = $section->getSettings(); + // half inch left margin + $sectionStyle->setMarginLeft(\PhpOffice\PhpWord\Shared\Font::inchSizeToTwips(.5)); + // 2 cm right margin + $sectionStyle->setMarginRight(\PhpOffice\PhpWord\Shared\Font::centimeterSizeToTwips(2)); diff --git a/docs/images/phpword.png b/docs/images/phpword.png new file mode 100644 index 0000000000..7c1dd69ad8 Binary files /dev/null and b/docs/images/phpword.png differ diff --git a/docs/images/phpword.svg b/docs/images/phpword.svg new file mode 100644 index 0000000000..2fbeeb4af0 --- /dev/null +++ b/docs/images/phpword.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000000..700694a56c --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,38 @@ +.. PHPWord documentation master file, created by + sphinx-quickstart on Fri Mar 14 23:09:26 2014. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to PHPWord's documentation +================================== + +|PHPWord| + +PHPWord is a library written in pure PHP that provides a set of classes to +write to and read from different document file formats. The current version of +PHPWord supports Microsoft Office Open XML (OOXML or OpenXML), OASIS Open +Document Format for Office Applications (OpenDocument or ODF), and Rich Text +Format (RTF). + +.. toctree:: + :maxdepth: 2 + + intro + setup + general + containers + elements + templates + recipes + faq + credits + references + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + +.. |PHPWord| image:: images/phpword.png diff --git a/docs/intro.rst b/docs/intro.rst new file mode 100644 index 0000000000..a30dc55331 --- /dev/null +++ b/docs/intro.rst @@ -0,0 +1,182 @@ +.. _intro: + +Introduction +============ + +PHPWord is a library written in pure PHP that provides a set of classes +to write to and read from different document file formats. The current +version of PHPWord supports Microsoft `Office Open +XML `__ (OOXML or +OpenXML), OASIS `Open Document Format for Office +Applications `__ +(OpenDocument or ODF), and `Rich Text +Format `__ (RTF). + +No Windows operating system is needed for usage because the resulting +DOCX, ODT, or RTF files can be opened by all major `word processing +softwares `__. + +PHPWord is an open source project licensed under LGPL. +PHPWord is `unit tested `__ to +make sure that the released versions are stable. + +**Want to contribute?** `Fork +us `__ or +`submit `__ your bug +reports or feature requests to us. + +Features +-------- + +- Set document properties, e.g. title, subject, and creator. +- Create document sections with different settings, e.g. + portrait/landscape, page size, and page numbering +- Create header and footer for each sections +- Set default font type, font size, and paragraph style +- Use UTF-8 and East Asia fonts/characters +- Define custom font styles (e.g. bold, italic, color) and paragraph + styles (e.g. centered, multicolumns, spacing) either as named style + or inline in text +- Insert paragraphs, either as a simple text or complex one (a text + run) that contains other elements +- Insert titles (headers) and table of contents +- Insert text breaks and page breaks +- Insert and format images, either local, remote, or as page watermarks +- Insert binary OLE Objects such as Excel or Visio +- Insert and format table with customized properties for each rows + (e.g. repeat as header row) and cells (e.g. background color, + rowspan, colspan) +- Insert list items as bulleted, numbered, or multilevel +- Insert hyperlinks +- Create document from templates +- Use XSL 1.0 style sheets to transform main document part of OOXML + template +- ... and many more features on progress + +File formats +------------ + +Below are the supported features for each file formats. + +Writers +~~~~~~~ + ++-------------------------------------------------+--------+-------+-------+ +| Features | DOCX | ODT | RTF | ++=========================+=======================+========+=======+=======+ +| **Document Properties** | Standard | | | | ++ +-----------------------+--------+-------+-------+ +| | Extended | | | | ++ +-----------------------+--------+-------+-------+ +| | UserDefined | | | | ++-------------------------+-----------------------+--------+-------+-------+ +| **Element Type** | Text | ✓ | ✓ | ✓ | ++ +-----------------------+--------+-------+-------+ +| | Text Run | ✓ | ✓ | ✓ | ++ +-----------------------+--------+-------+-------+ +| | Title | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Link | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Preserve Text | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Text Break | ✓ | ✓ | ✓ | ++ +-----------------------+--------+-------+-------+ +| | Page Break | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | List | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Table | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Image | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | MemoryImage | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Object | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Watermark | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Table of Contents | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Header | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Footer | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Footnote | ✓ | | | ++-------------------------+-----------------------+--------+-------+-------+ +| **Graphs** | 2D basic graphs | | | | ++ +-----------------------+--------+-------+-------+ +| | 2D advanced graphs | | | | ++ +-----------------------+--------+-------+-------+ +| | 3D graphs | | | | ++-------------------------+-----------------------+--------+-------+-------+ +| **Math** | OMML support | | | | ++ +-----------------------+--------+-------+-------+ +| | MathML support | | | | ++-------------------------+-----------------------+--------+-------+-------+ +| **Bonus** | Encryption | | | | ++ +-----------------------+--------+-------+-------+ +| | Protection | | | | ++-------------------------+-----------------------+--------+-------+-------+ + + +Readers +~~~~~~~ + ++-------------------------------------------------+--------+-------+-------+ +| Features | DOCX | ODT | RTF | ++=========================+=======================+========+=======+=======+ +| **Document Properties** | Standard | | | | ++ +-----------------------+--------+-------+-------+ +| | Extended | | | | ++ +-----------------------+--------+-------+-------+ +| | UserDefined | | | | ++-------------------------+-----------------------+--------+-------+-------+ +| **Element Type** | Text | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Text Run | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Title | | | | ++ +-----------------------+--------+-------+-------+ +| | Link | | | | ++ +-----------------------+--------+-------+-------+ +| | Preserve Text | | | | ++ +-----------------------+--------+-------+-------+ +| | Text Break | ✓ | | | ++ +-----------------------+--------+-------+-------+ +| | Page Break | | | | ++ +-----------------------+--------+-------+-------+ +| | List | | | | ++ +-----------------------+--------+-------+-------+ +| | Table | | | | ++ +-----------------------+--------+-------+-------+ +| | Image | | | | ++ +-----------------------+--------+-------+-------+ +| | MemoryImage | | | | ++ +-----------------------+--------+-------+-------+ +| | Object | | | | ++ +-----------------------+--------+-------+-------+ +| | Watermark | | | | ++ +-----------------------+--------+-------+-------+ +| | Table of Contents | | | | ++ +-----------------------+--------+-------+-------+ +| | Header | | | | ++ +-----------------------+--------+-------+-------+ +| | Footer | | | | ++ +-----------------------+--------+-------+-------+ +| | Footnote | | | | ++-------------------------+-----------------------+--------+-------+-------+ +| **Graphs** | 2D basic graphs | | | | ++ +-----------------------+--------+-------+-------+ +| | 2D advanced graphs | | | | ++ +-----------------------+--------+-------+-------+ +| | 3D graphs | | | | ++-------------------------+-----------------------+--------+-------+-------+ +| **Math** | OMML support | | | | ++ +-----------------------+--------+-------+-------+ +| | MathML support | | | | ++-------------------------+-----------------------+--------+-------+-------+ +| **Bonus** | Encryption | | | | ++ +-----------------------+--------+-------+-------+ +| | Protection | | | | ++-------------------------+-----------------------+--------+-------+-------+ diff --git a/docs/recipes.rst b/docs/recipes.rst new file mode 100644 index 0000000000..033452b3de --- /dev/null +++ b/docs/recipes.rst @@ -0,0 +1,4 @@ +.. _recipes: + +Recipes +======= diff --git a/docs/references.rst b/docs/references.rst new file mode 100644 index 0000000000..4f19a8173a --- /dev/null +++ b/docs/references.rst @@ -0,0 +1,20 @@ +.. _references: + +References +========== + +Formal specifications +--------------------- + +- `Office Open XML (OOXML) (ECMA-376) + Schema `__ +- `Oasis OpenDocument Standard Version + 1.2 `__ +- `Rich Text Format (RTF) Specification, version + 1.9.1 `__ + +Other resources +--------------- + +- `DocumentFormat.OpenXml.Wordprocessing Namespace on + MSDN `__ diff --git a/docs/setup.rst b/docs/setup.rst new file mode 100644 index 0000000000..c773756f31 --- /dev/null +++ b/docs/setup.rst @@ -0,0 +1,64 @@ +.. _setup: + +Installing/Configuring +====================== + +Requirements +------------ + +Mandatory: + +- PHP 5.3+ +- PHP `Zip `__ extension +- PHP `XML + Parser `__ + extension + +Optional PHP extensions: + +- `GD `__ +- `XMLWriter `__ +- `XSL `__ + +Installation +------------ + +There are two ways to install PHPWord, i.e. via +`Composer `__ or manually by downloading the +library. + +Using Composer +~~~~~~~~~~~~~~ + +To install via Composer, add the following lines to your +``composer.json``: + +.. code-block:: json + + { + "require": { + "phpoffice/phpword": "dev-master" + } + } + +Manual install +~~~~~~~~~~~~~~ + +To install manually, `download PHPWord package from +github `__. +Extract the package and put the contents to your machine. To use the +library, include ``src/PhpWord/Autoloader.php`` in your script and +invoke ``Autoloader::register``. + +.. code-block:: php + + require_once '/path/to/src/PhpWord/Autoloader.php'; + PhpOffice\PhpWord\Autoloader::register(); + +Using samples +------------- + +After installation, you can browse and use the samples that we've +provided, either by command line or using browser. If you can access +your PHPWord library folder using browser, point your browser to the +``samples`` folder, e.g. ``http://localhost/PhpWord/samples/``. diff --git a/docs/templates.rst b/docs/templates.rst new file mode 100644 index 0000000000..6b627b06be --- /dev/null +++ b/docs/templates.rst @@ -0,0 +1,24 @@ +.. _templates: + +Templates +========= + +You can create a docx template with included search-patterns that can be +replaced by any value you wish. Only single-line values can be replaced. +To load a template file, use the ``loadTemplate`` method. After loading +the docx template, you can use the ``setValue`` method to change the +value of a search pattern. The search-pattern model is: +``${search-pattern}``. It is not possible to add new PHPWord elements to +a loaded template file. + +Example: + +.. code-block:: php + + $template = $phpWord->loadTemplate('Template.docx'); + $template->setValue('Name', 'Somebody someone'); + $template->setValue('Street', 'Coming-Undone-Street 32'); + +See ``Sample_07_TemplateCloneRow.php`` for more code sample, including +how to create multirow from a single row in a template by using +``cloneRow``. diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 908304adea..05b0844246 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,6 @@ - - ./Tests/PHPWord/ + + ./tests/PhpWord/ - ./Classes + ./src - + \ No newline at end of file diff --git a/samples/Sample_01_SimpleText.php b/samples/Sample_01_SimpleText.php index 10f129dbfa..7ada399ada 100755 --- a/samples/Sample_01_SimpleText.php +++ b/samples/Sample_01_SimpleText.php @@ -1,21 +1,18 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word Document -echo date('H:i:s') , " Create new PHPWord object" , EOL; -$PHPWord = new PHPWord(); -$PHPWord->addFontStyle('rStyle', array('bold' => true, 'italic' => true, 'size' => 16)); -$PHPWord->addParagraphStyle('pStyle', array('align' => 'center', 'spaceAfter' => 100)); -$PHPWord->addTitleStyle(1, array('bold' => true), array('spaceAfter' => 240)); +echo date('H:i:s') , " Create new PhpWord object" , \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); +$phpWord->addFontStyle('rStyle', array('bold' => true, 'italic' => true, 'size' => 16)); +$phpWord->addParagraphStyle('pStyle', array('align' => 'center', 'spaceAfter' => 100)); +$phpWord->addTitleStyle(1, array('bold' => true), array('spaceAfter' => 240)); // New portrait section -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); // Simple text -$section->addTitle('Welcome to PHPWord', 1); +$section->addTitle('Welcome to PhpWord', 1); $section->addText('Hello World!'); // Two text break @@ -51,12 +48,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_02_TabStops.php b/samples/Sample_02_TabStops.php index e9e2d84bcb..f08f1e15de 100755 --- a/samples/Sample_02_TabStops.php +++ b/samples/Sample_02_TabStops.php @@ -1,34 +1,31 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word Document -echo date('H:i:s') , ' Create new PHPWord object' , EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s') , ' Create new PhpWord object' , \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // Ads styles -$PHPWord->addParagraphStyle('multipleTab', array( +$phpWord->addParagraphStyle('multipleTab', array( 'tabs' => array( - new PHPWord_Style_Tab('left', 1550), - new PHPWord_Style_Tab('center', 3200), - new PHPWord_Style_Tab('right', 5300) + new \PhpOffice\PhpWord\Style\Tab('left', 1550), + new \PhpOffice\PhpWord\Style\Tab('center', 3200), + new \PhpOffice\PhpWord\Style\Tab('right', 5300) ) )); -$PHPWord->addParagraphStyle('rightTab', array( +$phpWord->addParagraphStyle('rightTab', array( 'tabs' => array( - new PHPWord_Style_Tab('right', 9090) + new \PhpOffice\PhpWord\Style\Tab('right', 9090) ) )); -$PHPWord->addParagraphStyle('centerTab', array( +$phpWord->addParagraphStyle('centerTab', array( 'tabs' => array( - new PHPWord_Style_Tab('center', 4680) + new \PhpOffice\PhpWord\Style\Tab('center', 4680) ) )); // New portrait section -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); // Add listitem elements $section->addText("Multiple Tabs:\tOne\tTwo\tThree", NULL, 'multipleTab'); @@ -39,12 +36,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_03_Sections.php b/samples/Sample_03_Sections.php index 1e49629e9c..c16b73dbee 100755 --- a/samples/Sample_03_Sections.php +++ b/samples/Sample_03_Sections.php @@ -1,29 +1,26 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word Document -echo date('H:i:s') , ' Create new PHPWord object' , EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s') , ' Create new PhpWord object' , \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // New portrait section -$section = $PHPWord->createSection(array('borderColor' => '00FF00', 'borderSize' => 12)); +$section = $phpWord->createSection(array('borderColor' => '00FF00', 'borderSize' => 12)); $section->addText('I am placed on a default section.'); // New landscape section -$section = $PHPWord->createSection(array('orientation' => 'landscape')); +$section = $phpWord->createSection(array('orientation' => 'landscape')); $section->addText('I am placed on a landscape section. Every page starting from this section will be landscape style.'); $section->addPageBreak(); $section->addPageBreak(); // New portrait section -$section = $PHPWord->createSection(array('marginLeft' => 600, 'marginRight' => 600, 'marginTop' => 600, 'marginBottom' => 600)); +$section = $phpWord->createSection(array('marginLeft' => 600, 'marginRight' => 600, 'marginTop' => 600, 'marginBottom' => 600)); $section->addText('This section uses other margins.'); // New portrait section with Header & Footer -$section = $PHPWord->createSection(array('marginLeft' => 200, 'marginRight' => 200, 'marginTop' => 200, 'marginBottom' => 200, 'headerHeight' => 50, 'footerHeight' => 50,)); +$section = $phpWord->createSection(array('marginLeft' => 200, 'marginRight' => 200, 'marginTop' => 200, 'marginBottom' => 200, 'headerHeight' => 50, 'footerHeight' => 50,)); $section->addText('This section and we play with header/footer height.'); $section->createHeader()->addText('Header'); $section->createFooter()->addText('Footer'); @@ -32,12 +29,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_04_Textrun.php b/samples/Sample_04_Textrun.php index b30db7a56f..94bc3d5bb2 100644 --- a/samples/Sample_04_Textrun.php +++ b/samples/Sample_04_Textrun.php @@ -1,22 +1,18 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word Document -echo date('H:i:s') , ' Create new PHPWord object' , EOL; -$PHPWord = new PHPWord(); - +echo date('H:i:s') , ' Create new PhpWord object' , \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // Ads styles -$PHPWord->addParagraphStyle('pStyle', array('spacing'=>100)); -$PHPWord->addFontStyle('BoldText', array('bold'=>true)); -$PHPWord->addFontStyle('ColoredText', array('color'=>'FF8080')); -$PHPWord->addLinkStyle('NLink', array('color'=>'0000FF', 'underline'=>PHPWord_Style_Font::UNDERLINE_SINGLE)); +$phpWord->addParagraphStyle('pStyle', array('spacing'=>100)); +$phpWord->addFontStyle('BoldText', array('bold'=>true)); +$phpWord->addFontStyle('ColoredText', array('color'=>'FF8080')); +$phpWord->addLinkStyle('NLink', array('color'=>'0000FF', 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE)); // New portrait section -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); // Add text run $textrun = $section->createTextRun('pStyle'); @@ -39,12 +35,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_05_Multicolumn.php b/samples/Sample_05_Multicolumn.php index 3877defeff..541e2e8aa0 100644 --- a/samples/Sample_05_Multicolumn.php +++ b/samples/Sample_05_Multicolumn.php @@ -1,53 +1,48 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word Document -echo date('H:i:s') , " Create new PHPWord object" , EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s') , " Create new PhpWord object" , \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); $filler = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' . 'Nulla fermentum, tortor id adipiscing adipiscing, tortor turpis commodo. ' . 'Donec vulputate iaculis metus, vel luctus dolor hendrerit ac. ' . 'Suspendisse congue congue leo sed pellentesque.'; // Normal -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); $section->addText('Normal paragraph. ' . $filler); // Two columns -$section = $PHPWord->createSection(array( +$section = $phpWord->createSection(array( 'colsNum' => 2, 'colsSpace' => 1440, 'breakType' => 'continuous')); $section->addText('Three columns, one inch (1440 twips) spacing. ' . $filler); // Normal -$section = $PHPWord->createSection(array('breakType' => 'continuous')); +$section = $phpWord->createSection(array('breakType' => 'continuous')); $section->addText('Normal paragraph again. ' . $filler); // Three columns -$section = $PHPWord->createSection(array( +$section = $phpWord->createSection(array( 'colsNum' => 3, 'colsSpace' => 720, 'breakType' => 'continuous')); $section->addText('Three columns, half inch (720 twips) spacing. ' . $filler); // Normal -$section = $PHPWord->createSection(array('breakType' => 'continuous')); +$section = $phpWord->createSection(array('breakType' => 'continuous')); $section->addText('Normal paragraph again.'); // Save file $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_06_Footnote.php b/samples/Sample_06_Footnote.php index daaa6b4636..c430e54802 100755 --- a/samples/Sample_06_Footnote.php +++ b/samples/Sample_06_Footnote.php @@ -1,21 +1,18 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word Document -echo date('H:i:s') , " Create new PHPWord object" , EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s') , " Create new PhpWord object" , \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // New portrait section -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); // Add style definitions -$PHPWord->addParagraphStyle('pStyle', array('spacing'=>100)); -$PHPWord->addFontStyle('BoldText', array('bold'=>true)); -$PHPWord->addFontStyle('ColoredText', array('color'=>'FF8080')); -$PHPWord->addLinkStyle('NLink', array('color'=>'0000FF', 'underline'=>PHPWord_Style_Font::UNDERLINE_SINGLE)); +$phpWord->addParagraphStyle('pStyle', array('spacing'=>100)); +$phpWord->addFontStyle('BoldText', array('bold'=>true)); +$phpWord->addFontStyle('ColoredText', array('color'=>'FF8080')); +$phpWord->addLinkStyle('NLink', array('color'=>'0000FF', 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE)); // Add text elements $textrun = $section->createTextRun('pStyle'); @@ -40,12 +37,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_07_TemplateCloneRow.php b/samples/Sample_07_TemplateCloneRow.php index f797b986e5..4344fafc2f 100755 --- a/samples/Sample_07_TemplateCloneRow.php +++ b/samples/Sample_07_TemplateCloneRow.php @@ -1,14 +1,11 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word document -echo date('H:i:s') , " Create new PHPWord object" , EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s') , " Create new PhpWord object" , \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); -$document = $PHPWord->loadTemplate('resources/Sample_07_TemplateCloneRow.docx'); +$document = $phpWord->loadTemplate('resources/Sample_07_TemplateCloneRow.docx'); // Simple table $document->cloneRow('rowValue', 10); @@ -56,11 +53,9 @@ $document->setValue('userName#3', 'Ray'); $document->setValue('userPhone#3', '+1 428 889 775'); -$name = 'Sample_07_TemplateCloneRow_result.docx'; -echo date('H:i:s'), " Write to Word2007 format", EOL; +$name = 'Sample_07_TemplateCloneRow.docx'; +echo date('H:i:s'), " Write to Word2007 format", \EOL; $document->saveAs($name); rename($name, "results/{$name}"); -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_08_ParagraphPagination.php b/samples/Sample_08_ParagraphPagination.php index edd1992c43..eeef605863 100644 --- a/samples/Sample_08_ParagraphPagination.php +++ b/samples/Sample_08_ParagraphPagination.php @@ -1,20 +1,17 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word document -echo date('H:i:s') , " Create new PHPWord object" , EOL; -$PHPWord = new PHPWord(); -$PHPWord->setDefaultParagraphStyle(array( +echo date('H:i:s') , " Create new PhpWord object" , \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); +$phpWord->setDefaultParagraphStyle(array( 'align' => 'both', - 'spaceAfter' => PHPWord_Shared_Font::pointSizeToTwips(12), + 'spaceAfter' => \PhpOffice\PhpWord\Shared\Font::pointSizeToTwips(12), 'spacing' => 120, )); // Sample -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); $section->addText('Below are the samples on how to control your paragraph ' . 'pagination. See "Line and Page Break" tab on paragraph properties ' . @@ -52,12 +49,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_09_Tables.php b/samples/Sample_09_Tables.php index 96e411a020..ea10eec9f7 100644 --- a/samples/Sample_09_Tables.php +++ b/samples/Sample_09_Tables.php @@ -1,13 +1,10 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word Document -echo date('H:i:s') , ' Create new PHPWord object' , EOL; -$PHPWord = new PHPWord(); -$section = $PHPWord->createSection(); +echo date('H:i:s') , ' Create new PhpWord object' , \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); +$section = $phpWord->createSection(); $header = array('size' => 16, 'bold' => true); // 1. Basic table @@ -32,9 +29,9 @@ $styleTable = array('borderSize' => 6, 'borderColor' => '006699', 'cellMargin' => 80); $styleFirstRow = array('borderBottomSize' => 18, 'borderBottomColor' => '0000FF', 'bgColor' => '66BBFF'); $styleCell = array('valign' => 'center'); -$styleCellBTLR = array('valign' => 'center', 'textDirection' => PHPWord_Style_Cell::TEXT_DIR_BTLR); +$styleCellBTLR = array('valign' => 'center', 'textDirection' => \PhpOffice\PhpWord\Style\Cell::TEXT_DIR_BTLR); $fontStyle = array('bold' => true, 'align' => 'center'); -$PHPWord->addTableStyle('Fancy Table', $styleTable, $styleFirstRow); +$phpWord->addTableStyle('Fancy Table', $styleTable, $styleFirstRow); $table = $section->addTable('Fancy Table'); $table->addRow(900); $table->addCell(2000, $styleCell)->addText('Row 1', $fontStyle); @@ -64,7 +61,7 @@ $cellHCentered = array('align' => 'center'); $cellVCentered = array('valign' => 'center'); -$PHPWord->addTableStyle('Colspan Rowspan', $styleTable); +$phpWord->addTableStyle('Colspan Rowspan', $styleTable); $table = $section->addTable('Colspan Rowspan'); $table->addRow(); $table->addCell(2000, $cellRowSpan)->addText('A', null, $cellHCentered); @@ -80,12 +77,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_10_EastAsianFontStyle.php b/samples/Sample_10_EastAsianFontStyle.php index 8be721091c..6e8b26a0d6 100644 --- a/samples/Sample_10_EastAsianFontStyle.php +++ b/samples/Sample_10_EastAsianFontStyle.php @@ -1,13 +1,10 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word Document -echo date('H:i:s') , ' Create new PHPWord object' , EOL; -$PHPWord = new PHPWord(); -$section = $PHPWord->createSection(); +echo date('H:i:s') , ' Create new PhpWord object' , \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); +$section = $phpWord->createSection(); $header = array('size' => 16, 'bold' => true); //1.Use EastAisa FontStyle $section->addText('中文楷体样式测试',array('name' => '楷体', 'size' => 16, 'color' => '1B2232')); @@ -16,12 +13,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_11_ReadWord2007.php b/samples/Sample_11_ReadWord2007.php index d96e92644c..b2420a53d8 100644 --- a/samples/Sample_11_ReadWord2007.php +++ b/samples/Sample_11_ReadWord2007.php @@ -1,24 +1,19 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // Read contents $name = basename(__FILE__, '.php'); $source = "resources/{$name}.docx"; -echo date('H:i:s'), " Reading contents from `{$source}`", EOL; -$PHPWord = PHPWord_IOFactory::load($source); +echo date('H:i:s'), " Reading contents from `{$source}`", \EOL; +$phpWord = \PhpOffice\PhpWord\IOFactory::load($source); // (Re)write contents $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_12_HeaderFooter.php b/samples/Sample_12_HeaderFooter.php index b0d0e13792..3c5775ef6b 100644 --- a/samples/Sample_12_HeaderFooter.php +++ b/samples/Sample_12_HeaderFooter.php @@ -1,15 +1,12 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word document -echo date('H:i:s') , " Create new PHPWord object" , EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s') , " Create new PhpWord object" , \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // New portrait section -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); // Add first page header $header = $section->createHeader(); @@ -18,7 +15,7 @@ $table->addRow(); $table->addCell(4500)->addText('This is the header.'); $table->addCell(4500)->addImage( - 'resources/PHPWord.png', + 'resources/PhpWord.png', array('width' => 80, 'height' => 80, 'align' => 'right') ); @@ -49,7 +46,7 @@ $section->addText('Some text...'); // New portrait section -$section2 = $PHPWord->createSection(); +$section2 = $phpWord->createSection(); $sec2Header = $section2->createHeader(); $sec2Header->addText("All pages in Section 2 will Have this!"); @@ -63,12 +60,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_13_Images.php b/samples/Sample_13_Images.php index 0f64cb7bb8..6841ed64ca 100644 --- a/samples/Sample_13_Images.php +++ b/samples/Sample_13_Images.php @@ -1,19 +1,12 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word document -echo date('H:i:s'), " Create new PHPWord object", EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s'), " Create new PhpWord object", \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // Begin code -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); $section->addText('Local image without any styles:'); $section->addImage('resources/_mars.jpg'); $section->addTextBreak(2); @@ -31,12 +24,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_14_ListItem.php b/samples/Sample_14_ListItem.php index fa64878407..45cb73ab20 100644 --- a/samples/Sample_14_ListItem.php +++ b/samples/Sample_14_ListItem.php @@ -1,19 +1,12 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word document -echo date('H:i:s'), " Create new PHPWord object", EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s'), " Create new PhpWord object", \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // Begin code -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); // Add listitem elements $section->addListItem('List Item 1', 0); @@ -31,16 +24,16 @@ $section->addTextBreak(2); // Add listitem elements -$listStyle = array('listType'=>PHPWord_Style_ListItem::TYPE_NUMBER); +$listStyle = array('listType' => \PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER); $section->addListItem('List Item 1', 0, null, $listStyle); $section->addListItem('List Item 2', 0, null, $listStyle); $section->addListItem('List Item 3', 0, null, $listStyle); $section->addTextBreak(2); // Add listitem elements -$PHPWord->addFontStyle('myOwnStyle', array('color'=>'FF0000')); -$PHPWord->addParagraphStyle('P-Style', array('spaceAfter'=>95)); -$listStyle = array('listType'=>PHPWord_Style_ListItem::TYPE_NUMBER_NESTED); +$phpWord->addFontStyle('myOwnStyle', array('color'=>'FF0000')); +$phpWord->addParagraphStyle('P-Style', array('spaceAfter'=>95)); +$listStyle = array('listType' => \PhpOffice\PhpWord\Style\ListItem::TYPE_NUMBER_NESTED); $section->addListItem('List Item 1', 0, 'myOwnStyle', $listStyle, 'P-Style'); $section->addListItem('List Item 2', 0, 'myOwnStyle', $listStyle, 'P-Style'); $section->addListItem('List Item 3', 1, 'myOwnStyle', $listStyle, 'P-Style'); @@ -55,12 +48,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_15_Link.php b/samples/Sample_15_Link.php index ef631906d9..06628de54a 100644 --- a/samples/Sample_15_Link.php +++ b/samples/Sample_15_Link.php @@ -1,25 +1,18 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word document -echo date('H:i:s'), " Create new PHPWord object", EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s'), " Create new PhpWord object", \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // Begin code -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); // Add hyperlink elements -$section->addLink('http://www.google.com', 'Best search engine', array('color'=>'0000FF', 'underline'=>PHPWord_Style_Font::UNDERLINE_SINGLE)); +$section->addLink('http://www.google.com', 'Best search engine', array('color'=>'0000FF', 'underline' => \PhpOffice\PhpWord\Style\Font::UNDERLINE_SINGLE)); $section->addTextBreak(2); -$PHPWord->addLinkStyle('myOwnLinkStyle', array('bold'=>true, 'color'=>'808000')); +$phpWord->addLinkStyle('myOwnLinkStyle', array('bold'=>true, 'color'=>'808000')); $section->addLink('http://www.bing.com', null, 'myOwnLinkStyle'); $section->addLink('http://www.yahoo.com', null, 'myOwnLinkStyle'); @@ -29,12 +22,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_16_Object.php b/samples/Sample_16_Object.php index e04c49e54d..1a7f557ab8 100644 --- a/samples/Sample_16_Object.php +++ b/samples/Sample_16_Object.php @@ -1,19 +1,12 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word document -echo date('H:i:s'), " Create new PHPWord object", EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s'), " Create new PhpWord object", \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // Begin code -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); $section->addText('You can open this OLE object by double clicking on the icon:'); $section->addTextBreak(2); $section->addObject('resources/_sheet.xls'); @@ -24,12 +17,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_17_TitleTOC.php b/samples/Sample_17_TitleTOC.php index efa756e4df..27982921b5 100644 --- a/samples/Sample_17_TitleTOC.php +++ b/samples/Sample_17_TitleTOC.php @@ -1,26 +1,19 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word document -echo date('H:i:s'), " Create new PHPWord object", EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s'), " Create new PhpWord object", \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // Begin code -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); // Define the TOC font style $fontStyle = array('spaceAfter'=>60, 'size'=>12); // Add title styles -$PHPWord->addTitleStyle(1, array('size'=>20, 'color'=>'333333', 'bold'=>true)); -$PHPWord->addTitleStyle(2, array('size'=>16, 'color'=>'666666')); +$phpWord->addTitleStyle(1, array('size'=>20, 'color'=>'333333', 'bold'=>true)); +$phpWord->addTitleStyle(2, array('size'=>16, 'color'=>'666666')); // Add text elements $section->addText('Table of contents:'); @@ -49,19 +42,17 @@ $section->addTitle('I am a Subtitle of Title 3', 2); $section->addText('Again and again, more text...'); -echo date('H:i:s'), " Note: Please refresh TOC manually.", EOL; +echo date('H:i:s'), " Note: Please refresh TOC manually.", \EOL; // End code // Save file $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_18_Watermark.php b/samples/Sample_18_Watermark.php index 8332bd0330..ff299c97ba 100644 --- a/samples/Sample_18_Watermark.php +++ b/samples/Sample_18_Watermark.php @@ -1,20 +1,13 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word document -echo date('H:i:s'), " Create new PHPWord object", EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s'), " Create new PhpWord object", \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // Begin code -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); $header = $section->createHeader(); $header->addWatermark('resources/_earth.jpg', array('marginTop' => 200, 'marginLeft' => 55)); $section->addText('The header reference to the current section includes a watermark image.'); @@ -25,12 +18,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_19_TextBreak.php b/samples/Sample_19_TextBreak.php index 17299601c6..9433222c93 100644 --- a/samples/Sample_19_TextBreak.php +++ b/samples/Sample_19_TextBreak.php @@ -1,25 +1,18 @@ '); -require_once '../Classes/PHPWord.php'; +include_once 'Sample_Header.php'; // New Word document -echo date('H:i:s'), " Create new PHPWord object", EOL; -$PHPWord = new PHPWord(); +echo date('H:i:s'), " Create new PhpWord object", \EOL; +$phpWord = new \PhpOffice\PhpWord\PhpWord(); // Begin code $fontStyle = array('size' => 24); $paragraphStyle = array('spacing' => 240, 'size' => 24); -$PHPWord->addFontStyle('fontStyle', array('size' => 9)); -$PHPWord->addParagraphStyle('paragraphStyle', array('spacing' => 480)); +$phpWord->addFontStyle('fontStyle', array('size' => 9)); +$phpWord->addParagraphStyle('paragraphStyle', array('spacing' => 480)); $fontStyle = array('size' => 24); -$section = $PHPWord->createSection(); +$section = $phpWord->createSection(); $section->addText('Text break with no style:'); $section->addTextBreak(); $section->addText('Text break with defined font style:'); @@ -38,12 +31,10 @@ $name = basename(__FILE__, '.php'); $writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { - echo date('H:i:s'), " Write to {$writer} format", EOL; - $objWriter = PHPWord_IOFactory::createWriter($PHPWord, $writer); - $objWriter->save("{$name}.{$extension}"); + echo date('H:i:s'), " Write to {$writer} format", \EOL; + $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); + $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); } -// Done -echo date('H:i:s'), " Done writing file(s)", EOL; -echo date('H:i:s'), " Peak memory usage: ", (memory_get_peak_usage(true) / 1024 / 1024), " MB", EOL; +include_once 'Sample_Footer.php'; diff --git a/samples/Sample_Footer.php b/samples/Sample_Footer.php new file mode 100644 index 0000000000..5c7d7da161 --- /dev/null +++ b/samples/Sample_Footer.php @@ -0,0 +1,34 @@ + 

'; + echo '

Results: '; + foreach ($types as $type) { + $result = "results/{$sampleFile}.{$type}"; + if (file_exists($result)) { + echo "{$type} "; + } + } + echo '

'; + } +?> + + + + + +'); + +require_once '../src/PhpWord/Autoloader.php'; +PhpOffice\PhpWord\Autoloader::register(); + +// Return to the caller script when runs by CLI +if (CLI) { + return; +} + +// Set titles and names +$sampleFile = basename($_SERVER['SCRIPT_FILENAME'], '.php'); +$isIndexFile = ($sampleFile == 'index'); +$pageHeading = str_replace('_', ' ', $sampleFile); +$pageTitle = $isIndexFile ? 'Welcome to ' : "{$pageHeading} - "; +$pageTitle .= 'PHPWord'; +$pageHeading = $isIndexFile ? '' : "

{$pageHeading}

"; +// Populate samples +$files = ''; +if ($handle = opendir('.')) { + while (false !== ($file = readdir($handle))) { + if (preg_match('/^Sample_\d+_/', $file)) { + $name = str_replace('_', ' ', preg_replace('/(Sample_|\.php)/', '', $file)); + $files .= "
  • {$name}
  • "; + } + } + closedir($handle); +} +?> +<?php echo $pageTitle; ?> + + + + + + + +
    + + diff --git a/samples/bootstrap/css/bootstrap.min.css b/samples/bootstrap/css/bootstrap.min.css new file mode 100644 index 0000000000..3deec34887 --- /dev/null +++ b/samples/bootstrap/css/bootstrap.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap v3.0.2 by @fat and @mdo + * Copyright 2013 Twitter, Inc. + * Licensed under http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world by @mdo and @fat. + */ + +/*! normalize.css v2.1.3 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a{background:transparent}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{margin:.67em 0;font-size:2em}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{height:0;-moz-box-sizing:content-box;box-sizing:content-box}mark{color:#000;background:#ff0}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid #c0c0c0}legend{padding:0;border:0}button,input,select,textarea{margin:0;font-family:inherit;font-size:100%}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{padding:0;box-sizing:border-box}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:2cm .5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.428571429;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}img{vertical-align:middle}.img-responsive{display:block;height:auto;max-width:100%}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;height:auto;max-width:100%;padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}@media(min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}.text-muted{color:#999}.text-primary{color:#428bca}.text-primary:hover{color:#3071a9}.text-warning{color:#c09853}.text-warning:hover{color:#a47e3c}.text-danger{color:#b94a48}.text-danger:hover{color:#953b39}.text-success{color:#468847}.text-success:hover{color:#356635}.text-info{color:#3a87ad}.text-info:hover{color:#2d6987}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{margin-top:20px;margin-bottom:10px}h1 small,h2 small,h3 small,h1 .small,h2 .small,h3 .small{font-size:65%}h4,h5,h6{margin-top:10px;margin-bottom:10px}h4 small,h5 small,h6 small,h4 .small,h5 .small,h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}.list-inline>li:first-child{padding-left:0}dl{margin-bottom:20px}dt,dd{line-height:1.428571429}dt{font-weight:bold}dd{margin-left:0}@media(min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{font-size:17.5px;font-weight:300;line-height:1.25}blockquote p:last-child{margin-bottom:0}blockquote small{display:block;line-height:1.428571429;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small,blockquote.pull-right .small{text-align:right}blockquote.pull-right small:before,blockquote.pull-right .small:before{content:''}blockquote.pull-right small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.428571429}code,kbd,pre,samp{font-family:Monaco,Menlo,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;white-space:nowrap;background-color:#f9f2f4;border-radius:4px}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.428571429;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.row{margin-right:-15px;margin-left:-15px}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666666666666%}.col-xs-10{width:83.33333333333334%}.col-xs-9{width:75%}.col-xs-8{width:66.66666666666666%}.col-xs-7{width:58.333333333333336%}.col-xs-6{width:50%}.col-xs-5{width:41.66666666666667%}.col-xs-4{width:33.33333333333333%}.col-xs-3{width:25%}.col-xs-2{width:16.666666666666664%}.col-xs-1{width:8.333333333333332%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666666666666%}.col-xs-pull-10{right:83.33333333333334%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666666666666%}.col-xs-pull-7{right:58.333333333333336%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666666666667%}.col-xs-pull-4{right:33.33333333333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.666666666666664%}.col-xs-pull-1{right:8.333333333333332%}.col-xs-pull-0{right:0}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666666666666%}.col-xs-push-10{left:83.33333333333334%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666666666666%}.col-xs-push-7{left:58.333333333333336%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666666666667%}.col-xs-push-4{left:33.33333333333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.666666666666664%}.col-xs-push-1{left:8.333333333333332%}.col-xs-push-0{left:0}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666666666666%}.col-xs-offset-10{margin-left:83.33333333333334%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666666666666%}.col-xs-offset-7{margin-left:58.333333333333336%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666666666667%}.col-xs-offset-4{margin-left:33.33333333333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.666666666666664%}.col-xs-offset-1{margin-left:8.333333333333332%}.col-xs-offset-0{margin-left:0}@media(min-width:768px){.container{width:750px}.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666666666666%}.col-sm-10{width:83.33333333333334%}.col-sm-9{width:75%}.col-sm-8{width:66.66666666666666%}.col-sm-7{width:58.333333333333336%}.col-sm-6{width:50%}.col-sm-5{width:41.66666666666667%}.col-sm-4{width:33.33333333333333%}.col-sm-3{width:25%}.col-sm-2{width:16.666666666666664%}.col-sm-1{width:8.333333333333332%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666666666666%}.col-sm-pull-10{right:83.33333333333334%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666666666666%}.col-sm-pull-7{right:58.333333333333336%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666666666667%}.col-sm-pull-4{right:33.33333333333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.666666666666664%}.col-sm-pull-1{right:8.333333333333332%}.col-sm-pull-0{right:0}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666666666666%}.col-sm-push-10{left:83.33333333333334%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666666666666%}.col-sm-push-7{left:58.333333333333336%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666666666667%}.col-sm-push-4{left:33.33333333333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.666666666666664%}.col-sm-push-1{left:8.333333333333332%}.col-sm-push-0{left:0}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666666666666%}.col-sm-offset-10{margin-left:83.33333333333334%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666666666666%}.col-sm-offset-7{margin-left:58.333333333333336%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666666666667%}.col-sm-offset-4{margin-left:33.33333333333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.666666666666664%}.col-sm-offset-1{margin-left:8.333333333333332%}.col-sm-offset-0{margin-left:0}}@media(min-width:992px){.container{width:970px}.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666666666666%}.col-md-10{width:83.33333333333334%}.col-md-9{width:75%}.col-md-8{width:66.66666666666666%}.col-md-7{width:58.333333333333336%}.col-md-6{width:50%}.col-md-5{width:41.66666666666667%}.col-md-4{width:33.33333333333333%}.col-md-3{width:25%}.col-md-2{width:16.666666666666664%}.col-md-1{width:8.333333333333332%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666666666666%}.col-md-pull-10{right:83.33333333333334%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666666666666%}.col-md-pull-7{right:58.333333333333336%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666666666667%}.col-md-pull-4{right:33.33333333333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.666666666666664%}.col-md-pull-1{right:8.333333333333332%}.col-md-pull-0{right:0}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666666666666%}.col-md-push-10{left:83.33333333333334%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666666666666%}.col-md-push-7{left:58.333333333333336%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666666666667%}.col-md-push-4{left:33.33333333333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.666666666666664%}.col-md-push-1{left:8.333333333333332%}.col-md-push-0{left:0}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666666666666%}.col-md-offset-10{margin-left:83.33333333333334%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666666666666%}.col-md-offset-7{margin-left:58.333333333333336%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666666666667%}.col-md-offset-4{margin-left:33.33333333333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.666666666666664%}.col-md-offset-1{margin-left:8.333333333333332%}.col-md-offset-0{margin-left:0}}@media(min-width:1200px){.container{width:1170px}.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666666666666%}.col-lg-10{width:83.33333333333334%}.col-lg-9{width:75%}.col-lg-8{width:66.66666666666666%}.col-lg-7{width:58.333333333333336%}.col-lg-6{width:50%}.col-lg-5{width:41.66666666666667%}.col-lg-4{width:33.33333333333333%}.col-lg-3{width:25%}.col-lg-2{width:16.666666666666664%}.col-lg-1{width:8.333333333333332%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666666666666%}.col-lg-pull-10{right:83.33333333333334%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666666666666%}.col-lg-pull-7{right:58.333333333333336%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666666666667%}.col-lg-pull-4{right:33.33333333333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.666666666666664%}.col-lg-pull-1{right:8.333333333333332%}.col-lg-pull-0{right:0}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666666666666%}.col-lg-push-10{left:83.33333333333334%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666666666666%}.col-lg-push-7{left:58.333333333333336%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666666666667%}.col-lg-push-4{left:33.33333333333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.666666666666664%}.col-lg-push-1{left:8.333333333333332%}.col-lg-push-0{left:0}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666666666666%}.col-lg-offset-10{margin-left:83.33333333333334%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666666666666%}.col-lg-offset-7{margin-left:58.333333333333336%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666666666667%}.col-lg-offset-4{margin-left:33.33333333333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.666666666666664%}.col-lg-offset-1{margin-left:8.333333333333332%}.col-lg-offset-0{margin-left:0}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*="col-"]{display:table-column;float:none}table td[class*="col-"],table th[class*="col-"]{display:table-cell;float:none}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}@media(max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-x:scroll;overflow-y:hidden;border:1px solid #ddd;-ms-overflow-style:-ms-autohiding-scrollbar;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}select[multiple],select[size]{height:auto}select optgroup{font-family:inherit;font-size:inherit;font-style:inherit}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}input[type="number"]::-webkit-outer-spin-button,input[type="number"]::-webkit-inner-spin-button{height:auto}output{display:block;padding-top:7px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.form-control:-moz-placeholder{color:#999}.form-control::-moz-placeholder{color:#999}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee}textarea.form-control{height:auto}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:20px;padding-left:20px;margin-top:10px;margin-bottom:10px;vertical-align:middle}.radio label,.checkbox label{display:inline;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:normal;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm{height:auto}.input-lg{height:45px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:45px;line-height:45px}textarea.input-lg{height:auto}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#c09853}.has-warning .form-control{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.has-warning .input-group-addon{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#b94a48}.has-error .form-control{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.has-error .input-group-addon{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#468847}.has-success .form-control{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.has-success .input-group-addon{color:#468847;background-color:#dff0d8;border-color:#468847}.form-control-static{margin-bottom:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media(min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block}.form-inline .radio,.form-inline .checkbox{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:none;margin-left:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-control-static{padding-top:7px}@media(min-width:768px){.form-horizontal .control-label{text-align:right}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-link{font-weight:normal;color:#428bca;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-xs{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs{padding:1px 5px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;font-weight:normal;line-height:1;-moz-osx-font-smoothing:grayscale}.glyphicon:empty{width:1em}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid #000;border-right:4px solid transparent;border-bottom:0 dotted;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.428571429;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#428bca;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.428571429;color:#999}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0 dotted;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media(min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}}.btn-default .caret{border-top-color:#333}.btn-primary .caret,.btn-success .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret{border-top-color:#fff}.dropup .btn-default .caret{border-bottom-color:#333}.dropup .btn-primary .caret,.dropup .btn-success .caret,.dropup .btn-warning .caret,.dropup .btn-danger .caret,.dropup .btn-info .caret{border-bottom-color:#fff}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar .btn-group{float:left}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group,.btn-toolbar>.btn-group+.btn-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group-xs>.btn{padding:5px 10px;padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-bottom-left-radius:4px;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child>.btn:last-child,.btn-group-vertical>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;border-collapse:separate;table-layout:fixed}.btn-group-justified .btn{display:table-cell;float:none;width:1%}[data-toggle="buttons"]>.btn>input[type="radio"],[data-toggle="buttons"]>.btn>input[type="checkbox"]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group.col{float:none;padding-right:0;padding-left:0}.input-group .form-control{width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:45px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:45px;line-height:45px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:normal;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;white-space:nowrap}.input-group-btn:first-child>.btn{margin-right:-1px}.input-group-btn:last-child>.btn{margin-left:-1px}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-4px}.input-group-btn>.btn:hover,.input-group-btn>.btn:active{z-index:2}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .open>a .caret,.nav .open>a:hover .caret,.nav .open>a:focus .caret{border-top-color:#2a6496;border-bottom-color:#2a6496}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.428571429;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media(min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media(min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-pills>li.active>a .caret,.nav-pills>li.active>a:hover .caret,.nav-pills>li.active>a:focus .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media(min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media(min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav .caret{border-top-color:#428bca;border-bottom-color:#428bca}.nav a:hover .caret{border-top-color:#2a6496;border-bottom-color:#2a6496}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}@media(min-width:768px){.navbar{border-radius:4px}}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}@media(min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;padding-right:15px;padding-left:15px;overflow-x:visible;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse.in{overflow-y:auto}@media(min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:auto}.navbar-collapse .navbar-nav.navbar-left:first-child{margin-left:-15px}.navbar-collapse .navbar-nav.navbar-right:last-child{margin-right:-15px}.navbar-collapse .navbar-text:last-child{margin-right:0}}.container>.navbar-header,.container>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media(min-width:768px){.container>.navbar-header,.container>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media(min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media(min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media(min-width:768px){.navbar>.container .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;border:1px solid transparent;border-radius:4px}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media(min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media(max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media(min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}@media(min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}@media(min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0}}@media(max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media(min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-nav.pull-right>li>.dropdown-menu,.navbar-nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-text{float:left;margin-top:15px;margin-bottom:15px}@media(min-width:768px){.navbar-text{margin-right:15px;margin-left:15px}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#ccc}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.dropdown>a:hover .caret,.navbar-default .navbar-nav>.dropdown>a:focus .caret{border-top-color:#333;border-bottom-color:#333}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.open>a .caret,.navbar-default .navbar-nav>.open>a:hover .caret,.navbar-default .navbar-nav>.open>a:focus .caret{border-top-color:#555;border-bottom-color:#555}.navbar-default .navbar-nav>.dropdown>a .caret{border-top-color:#777;border-bottom-color:#777}@media(max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#999}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .navbar-nav>li>a{color:#999}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-nav>.dropdown>a .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .navbar-nav>.open>a .caret,.navbar-inverse .navbar-nav>.open>a:hover .caret,.navbar-inverse .navbar-nav>.open>a:focus .caret{border-top-color:#fff;border-bottom-color:#fff}@media(max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#999}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.428571429;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{background-color:#eee}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#428bca;border-color:#428bca}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:#808080}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#999;border-radius:10px}.badge:empty{display:none}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.btn .badge{position:relative;top:-1px}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;font-size:21px;font-weight:200;line-height:2.1428571435;color:inherit;background-color:#eee}.jumbotron h1{line-height:1;color:inherit}.jumbotron p{line-height:1.4}.container .jumbotron{border-radius:6px}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1{font-size:63px}}.thumbnail{display:inline-block;display:block;height:auto;max-width:100%;padding:4px;margin-bottom:20px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img{display:block;height:auto;max-width:100%;margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#356635}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#2d6987}.alert-warning{color:#c09853;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#a47e3c}.alert-danger{color:#b94a48;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#953b39}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}a.list-group-item.active .list-group-item-heading,a.list-group-item.active:hover .list-group-item-heading,a.list-group-item.active:focus .list-group-item-heading{color:inherit}a.list-group-item.active .list-group-item-text,a.list-group-item.active:hover .list-group-item-text,a.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0}.panel>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel>.list-group .list-group-item:last-child{border-bottom:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table,.panel>.table-responsive{margin-bottom:0}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:last-child>th,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:last-child>td,.panel>.table-responsive>.table-bordered>thead>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-group .panel{margin-bottom:0;overflow:hidden;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-default>.panel-heading>.dropdown .caret{border-color:#333 transparent}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca}.panel-primary>.panel-heading>.dropdown .caret{border-color:#fff transparent}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading>.dropdown .caret{border-color:#468847 transparent}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#c09853;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading>.dropdown .caret{border-color:#c09853 transparent}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#b94a48;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading>.dropdown .caret{border-color:#b94a48 transparent}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ebccd1}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading>.dropdown .caret{border-color:#3a87ad transparent}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;display:none;overflow:auto;overflow-y:scroll}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.modal-dialog{position:relative;z-index:1050;width:auto;padding:10px;margin-right:auto;margin-left:auto}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);background-clip:padding-box}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1030;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{min-height:16.428571429px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.428571429}.modal-body{position:relative;padding:20px}.modal-footer{padding:19px 20px 20px;margin-top:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media screen and (min-width:768px){.modal-dialog{width:600px;padding-top:30px;padding-bottom:30px}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}}.tooltip{position:absolute;z-index:1030;display:block;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-bottom-color:#000;border-width:0 5px 5px}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0;content:" "}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0;content:" "}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0;content:" "}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0;content:" "}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;height:auto;max-width:100%;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6);opacity:.5;filter:alpha(opacity=50)}.carousel-control.left{background-image:-webkit-gradient(linear,0 top,100% top,from(rgba(0,0,0,0.5)),to(rgba(0,0,0,0.0001)));background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.5) 0),color-stop(rgba(0,0,0,0.0001) 100%));background-image:-moz-linear-gradient(left,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-image:linear-gradient(to right,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000',endColorstr='#00000000',GradientType=1)}.carousel-control.right{right:0;left:auto;background-image:-webkit-gradient(linear,0 top,100% top,from(rgba(0,0,0,0.0001)),to(rgba(0,0,0,0.5)));background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.0001) 0),color-stop(rgba(0,0,0,0.5) 100%));background-image:-moz-linear-gradient(left,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-image:linear-gradient(to right,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#80000000',GradientType=1)}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicons-chevron-left,.carousel-control .glyphicons-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after{display:table;content:" "}.clearfix:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,tr.visible-xs,th.visible-xs,td.visible-xs{display:none!important}@media(max-width:767px){.visible-xs{display:block!important}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-xs.visible-sm{display:block!important}tr.visible-xs.visible-sm{display:table-row!important}th.visible-xs.visible-sm,td.visible-xs.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-xs.visible-md{display:block!important}tr.visible-xs.visible-md{display:table-row!important}th.visible-xs.visible-md,td.visible-xs.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-xs.visible-lg{display:block!important}tr.visible-xs.visible-lg{display:table-row!important}th.visible-xs.visible-lg,td.visible-xs.visible-lg{display:table-cell!important}}.visible-sm,tr.visible-sm,th.visible-sm,td.visible-sm{display:none!important}@media(max-width:767px){.visible-sm.visible-xs{display:block!important}tr.visible-sm.visible-xs{display:table-row!important}th.visible-sm.visible-xs,td.visible-sm.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-sm{display:block!important}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-sm.visible-md{display:block!important}tr.visible-sm.visible-md{display:table-row!important}th.visible-sm.visible-md,td.visible-sm.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-sm.visible-lg{display:block!important}tr.visible-sm.visible-lg{display:table-row!important}th.visible-sm.visible-lg,td.visible-sm.visible-lg{display:table-cell!important}}.visible-md,tr.visible-md,th.visible-md,td.visible-md{display:none!important}@media(max-width:767px){.visible-md.visible-xs{display:block!important}tr.visible-md.visible-xs{display:table-row!important}th.visible-md.visible-xs,td.visible-md.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-md.visible-sm{display:block!important}tr.visible-md.visible-sm{display:table-row!important}th.visible-md.visible-sm,td.visible-md.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-md{display:block!important}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-md.visible-lg{display:block!important}tr.visible-md.visible-lg{display:table-row!important}th.visible-md.visible-lg,td.visible-md.visible-lg{display:table-cell!important}}.visible-lg,tr.visible-lg,th.visible-lg,td.visible-lg{display:none!important}@media(max-width:767px){.visible-lg.visible-xs{display:block!important}tr.visible-lg.visible-xs{display:table-row!important}th.visible-lg.visible-xs,td.visible-lg.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-lg.visible-sm{display:block!important}tr.visible-lg.visible-sm{display:table-row!important}th.visible-lg.visible-sm,td.visible-lg.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-lg.visible-md{display:block!important}tr.visible-lg.visible-md{display:table-row!important}th.visible-lg.visible-md,td.visible-lg.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-lg{display:block!important}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}.hidden-xs{display:block!important}tr.hidden-xs{display:table-row!important}th.hidden-xs,td.hidden-xs{display:table-cell!important}@media(max-width:767px){.hidden-xs,tr.hidden-xs,th.hidden-xs,td.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-xs.hidden-sm,tr.hidden-xs.hidden-sm,th.hidden-xs.hidden-sm,td.hidden-xs.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-xs.hidden-md,tr.hidden-xs.hidden-md,th.hidden-xs.hidden-md,td.hidden-xs.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-xs.hidden-lg,tr.hidden-xs.hidden-lg,th.hidden-xs.hidden-lg,td.hidden-xs.hidden-lg{display:none!important}}.hidden-sm{display:block!important}tr.hidden-sm{display:table-row!important}th.hidden-sm,td.hidden-sm{display:table-cell!important}@media(max-width:767px){.hidden-sm.hidden-xs,tr.hidden-sm.hidden-xs,th.hidden-sm.hidden-xs,td.hidden-sm.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-sm,tr.hidden-sm,th.hidden-sm,td.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-sm.hidden-md,tr.hidden-sm.hidden-md,th.hidden-sm.hidden-md,td.hidden-sm.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-sm.hidden-lg,tr.hidden-sm.hidden-lg,th.hidden-sm.hidden-lg,td.hidden-sm.hidden-lg{display:none!important}}.hidden-md{display:block!important}tr.hidden-md{display:table-row!important}th.hidden-md,td.hidden-md{display:table-cell!important}@media(max-width:767px){.hidden-md.hidden-xs,tr.hidden-md.hidden-xs,th.hidden-md.hidden-xs,td.hidden-md.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-md.hidden-sm,tr.hidden-md.hidden-sm,th.hidden-md.hidden-sm,td.hidden-md.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-md,tr.hidden-md,th.hidden-md,td.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-md.hidden-lg,tr.hidden-md.hidden-lg,th.hidden-md.hidden-lg,td.hidden-md.hidden-lg{display:none!important}}.hidden-lg{display:block!important}tr.hidden-lg{display:table-row!important}th.hidden-lg,td.hidden-lg{display:table-cell!important}@media(max-width:767px){.hidden-lg.hidden-xs,tr.hidden-lg.hidden-xs,th.hidden-lg.hidden-xs,td.hidden-lg.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-lg.hidden-sm,tr.hidden-lg.hidden-sm,th.hidden-lg.hidden-sm,td.hidden-lg.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-lg.hidden-md,tr.hidden-lg.hidden-md,th.hidden-lg.hidden-md,td.hidden-lg.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-lg,tr.hidden-lg,th.hidden-lg,td.hidden-lg{display:none!important}}.visible-print,tr.visible-print,th.visible-print,td.visible-print{display:none!important}@media print{.visible-print{display:block!important}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}.hidden-print,tr.hidden-print,th.hidden-print,td.hidden-print{display:none!important}} \ No newline at end of file diff --git a/samples/bootstrap/css/phpword.css b/samples/bootstrap/css/phpword.css new file mode 100644 index 0000000000..d747059873 --- /dev/null +++ b/samples/bootstrap/css/phpword.css @@ -0,0 +1,13 @@ +body { + padding-top: 20px; + padding-bottom: 20px; +} +.navbar { + margin-bottom: 20px; +} +.passed { + color: #339900; +} +.failed { + color: #ff0000; +} diff --git a/samples/bootstrap/js/bootstrap.min.js b/samples/bootstrap/js/bootstrap.min.js new file mode 100644 index 0000000000..0e668e85c6 --- /dev/null +++ b/samples/bootstrap/js/bootstrap.min.js @@ -0,0 +1,9 @@ +/*! + * Bootstrap v3.0.2 by @fat and @mdo + * Copyright 2013 Twitter, Inc. + * Licensed under http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world by @mdo and @fat. + */ + +if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===b.prop("type")&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); \ No newline at end of file diff --git a/samples/bootstrap/js/jquery.min.js b/samples/bootstrap/js/jquery.min.js new file mode 100644 index 0000000000..da4170647d --- /dev/null +++ b/samples/bootstrap/js/jquery.min.js @@ -0,0 +1,6 @@ +/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery-1.10.2.min.map +*/ +(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="
    ",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
    a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
    t
    ",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
    ",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t +}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:x.support.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); +u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("