点击回首页
我的浏览记录 | | 帮助?
当前位置:
首页>> 企业应用>> 新翔网络OA系统V1.0>> 源文件浏览
[商业版 200RMB] WebForm,下载次数:1 次 | 关键字: PHP MYSQL OA 办公 网络办公

源码截图

源码目录树

;
当前路径:Classes/PHPExcel/Writer/Excel2007/Theme.php
<?php
/**
 * PHPExcel
 *
 * Copyright (c) 2006 - 2015 PHPExcel
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * @category   PHPExcel
 * @package    PHPExcel_Writer_Excel2007
 * @copyright  Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
 * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
 * @version    ##VERSION##, ##DATE##
 */


/**
 * PHPExcel_Writer_Excel2007_Theme
 *
 * @category   PHPExcel
 * @package    PHPExcel_Writer_Excel2007
 * @copyright  Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
 */
class PHPExcel_Writer_Excel2007_Theme extends PHPExcel_Writer_Excel2007_WriterPart
{
    /**
     * Map of Major fonts to write
     * @static    array of string
     *
     */
    private static $majorFonts = array(
        'Jpan' => 'MS Pゴシック',
        'Hang' => '맑은 고딕',
        'Hans' => '宋体',
        'Hant' => '新細明體',
        'Arab' => 'Times New Roman',
        'Hebr' => 'Times New Roman',
        'Thai' => 'Tahoma',
        'Ethi' => 'Nyala',
        'Beng' => 'Vrinda',
        'Gujr' => 'Shruti',
        'Khmr' => 'MoolBoran',
        'Knda' => 'Tunga',
        'Guru' => 'Raavi',
        'Cans' => 'Euphemia',
        'Cher' => 'Plantagenet Cherokee',
        'Yiii' => 'Microsoft Yi Baiti',
        'Tibt' => 'Microsoft Himalaya',
        'Thaa' => 'MV Boli',
        'Deva' => 'Mangal',
        'Telu' => 'Gautami',
        'Taml' => 'Latha',
        'Syrc' => 'Estrangelo Edessa',
        'Orya' => 'Kalinga',
        'Mlym' => 'Kartika',
        'Laoo' => 'DokChampa',
        'Sinh' => 'Iskoola Pota',
        'Mong' => 'Mongolian Baiti',
        'Viet' => 'Times New Roman',
        'Uigh' => 'Microsoft Uighur',
        'Geor' => 'Sylfaen',
    );

    /**
     * Map of Minor fonts to write
     * @static    array of string
     *
     */
    private static $minorFonts = array(
        'Jpan' => 'MS Pゴシック',
        'Hang' => '맑은 고딕',
        'Hans' => '宋体',
        'Hant' => '新細明體',
        'Arab' => 'Arial',
        'Hebr' => 'Arial',
        'Thai' => 'Tahoma',
        'Ethi' => 'Nyala',
        'Beng' => 'Vrinda',
        'Gujr' => 'Shruti',
        'Khmr' => 'DaunPenh',
        'Knda' => 'Tunga',
        'Guru' => 'Raavi',
        'Cans' => 'Euphemia',
        'Cher' => 'Plantagenet Cherokee',
        'Yiii' => 'Microsoft Yi Baiti',
        'Tibt' => 'Microsoft Himalaya',
        'Thaa' => 'MV Boli',
        'Deva' => 'Mangal',
        'Telu' => 'Gautami',
        'Taml' => 'Latha',
        'Syrc' => 'Estrangelo Edessa',
        'Orya' => 'Kalinga',
        'Mlym' => 'Kartika',
        'Laoo' => 'DokChampa',
        'Sinh' => 'Iskoola Pota',
        'Mong' => 'Mongolian Baiti',
        'Viet' => 'Arial',
        'Uigh' => 'Microsoft Uighur',
        'Geor' => 'Sylfaen',
    );

    /**
     * Map of core colours
     * @static    array of string
     *
     */
    private static $colourScheme = array(
        'dk2'        => '1F497D',
        'lt2'        => 'EEECE1',
        'accent1'    => '4F81BD',
        'accent2'    => 'C0504D',
        'accent3'    => '9BBB59',
        'accent4'    => '8064A2',
        'accent5'    => '4BACC6',
        'accent6'    => 'F79646',
        'hlink'        => '0000FF',
        'folHlink'    => '800080',
    );
            
    /**
     * Write theme to XML format
     *
     * @param     PHPExcel    $pPHPExcel
     * @return     string         XML Output
     * @throws     PHPExcel_Writer_Exception
     */
    public function writeTheme(PHPExcel $pPHPExcel = null)
    {
        // Create XML writer
        $objWriter = null;
        if ($this->getParentWriter()->getUseDiskCaching()) {
            $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
        } else {
            $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
        }

        // XML header
        $objWriter->startDocument('1.0', 'UTF-8', 'yes');

        // a:theme
        $objWriter->startElement('a:theme');
        $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
        $objWriter->writeAttribute('name', 'Office Theme');

            // a:themeElements
            $objWriter->startElement('a:themeElements');

                // a:clrScheme
                $objWriter->startElement('a:clrScheme');
                $objWriter->writeAttribute('name', 'Office');

                    // a:dk1
                    $objWriter->startElement('a:dk1');

                        // a:sysClr
                        $objWriter->startElement('a:sysClr');
                        $objWriter->writeAttribute('val', 'windowText');
                        $objWriter->writeAttribute('lastClr', '000000');
                        $objWriter->endElement();

                    $objWriter->endElement();

                    // a:lt1
                    $objWriter->startElement('a:lt1');

                        // a:sysClr
                        $objWriter->startElement('a:sysClr');
                        $objWriter->writeAttribute('val', 'window');
                        $objWriter->writeAttribute('lastClr', 'FFFFFF');
                        $objWriter->endElement();

                    $objWriter->endElement();

                    // a:dk2
                    $this->writeColourScheme($objWriter);

                $objWriter->endElement();

                // a:fontScheme
                $objWriter->startElement('a:fontScheme');
                $objWriter->writeAttribute('name', 'Office');

                    // a:majorFont
                    $objWriter->startElement('a:majorFont');
                        $this->writeFonts($objWriter, 'Cambria', self::$majorFonts);
                    $objWriter->endElement();

                    // a:minorFont
                    $objWriter->startElement('a:minorFont');
                        $this->writeFonts($objWriter, 'Calibri', self::$minorFonts);
                    $objWriter->endElement();

                $objWriter->endElement();

                // a:fmtScheme
                $objWriter->startElement('a:fmtScheme');
                $objWriter->writeAttribute('name', 'Office');

                    // a:fillStyleLst
                    $objWriter->startElement('a:fillStyleLst');

                        // a:solidFill
                        $objWriter->startElement('a:solidFill');

                            // a:schemeClr
    ...
完整源码文件,请先购买后再查看
关于我们 | 顾问团队 | 发展历程 | 联系我们 | 源码上传
联系电话(Tel):4008-010-151(免长途)
地址:北京市海淀区大恒科技大厦五层 邮编:100080
Floor 5th,Daheng Building,Zhongguancun,Beijing,China,100080
51Aspx.com 版权所有 CopyRight © 2006-2022. 京ICP备09089570号 | 京公网安备11010702000869号