2010-08-26 19:14:53 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* PHPExcel
|
|
|
|
*
|
2015-05-02 22:50:37 +00:00
|
|
|
* Copyright (c) 2006 - 2015 PHPExcel
|
2010-08-26 19:14:53 +00:00
|
|
|
*
|
|
|
|
* 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_Worksheet
|
2015-05-02 22:50:37 +00:00
|
|
|
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
2015-05-12 09:22:06 +00:00
|
|
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
2010-08-26 19:14:53 +00:00
|
|
|
* @version ##VERSION##, ##DATE##
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PHPExcel_Worksheet_Protection
|
|
|
|
*
|
|
|
|
* @category PHPExcel
|
|
|
|
* @package PHPExcel_Worksheet
|
2015-05-02 22:50:37 +00:00
|
|
|
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
|
2010-08-26 19:14:53 +00:00
|
|
|
*/
|
|
|
|
class PHPExcel_Worksheet_Protection
|
|
|
|
{
|
2015-05-12 09:22:06 +00:00
|
|
|
/**
|
|
|
|
* Sheet
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $sheet = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Objects
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $objects = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Scenarios
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $scenarios = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Format cells
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $formatCells = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Format columns
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $formatColumns = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Format rows
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $formatRows = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Insert columns
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $insertColumns = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Insert rows
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $insertRows = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Insert hyperlinks
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $insertHyperlinks = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete columns
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $deleteColumns = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete rows
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $deleteRows = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Select locked cells
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $selectLockedCells = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sort
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $sort = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* AutoFilter
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $autoFilter = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Pivot tables
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $pivotTables = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Select unlocked cells
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $selectUnlockedCells = false;
|
2015-05-12 09:22:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Password
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2015-05-19 23:20:20 +00:00
|
|
|
private $password = '';
|
2010-08-26 19:14:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is some sort of protection enabled?
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function isProtectionEnabled()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->sheet ||
|
|
|
|
$this->objects ||
|
|
|
|
$this->scenarios ||
|
|
|
|
$this->formatCells ||
|
|
|
|
$this->formatColumns ||
|
|
|
|
$this->formatRows ||
|
|
|
|
$this->insertColumns ||
|
|
|
|
$this->insertRows ||
|
|
|
|
$this->insertHyperlinks ||
|
|
|
|
$this->deleteColumns ||
|
|
|
|
$this->deleteRows ||
|
|
|
|
$this->selectLockedCells ||
|
|
|
|
$this->sort ||
|
|
|
|
$this->autoFilter ||
|
|
|
|
$this->pivotTables ||
|
|
|
|
$this->selectUnlockedCells;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get Sheet
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getSheet()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->sheet;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set Sheet
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setSheet($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->sheet = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get Objects
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getObjects()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->objects;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set Objects
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setObjects($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->objects = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get Scenarios
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getScenarios()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->scenarios;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set Scenarios
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setScenarios($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->scenarios = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get FormatCells
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getFormatCells()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->formatCells;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set FormatCells
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setFormatCells($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->formatCells = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get FormatColumns
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getFormatColumns()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->formatColumns;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set FormatColumns
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setFormatColumns($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->formatColumns = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get FormatRows
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getFormatRows()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->formatRows;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set FormatRows
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setFormatRows($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->formatRows = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get InsertColumns
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getInsertColumns()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->insertColumns;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set InsertColumns
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setInsertColumns($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->insertColumns = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get InsertRows
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getInsertRows()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->insertRows;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set InsertRows
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setInsertRows($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->insertRows = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get InsertHyperlinks
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getInsertHyperlinks()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->insertHyperlinks;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set InsertHyperlinks
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setInsertHyperlinks($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->insertHyperlinks = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get DeleteColumns
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getDeleteColumns()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->deleteColumns;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set DeleteColumns
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setDeleteColumns($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->deleteColumns = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get DeleteRows
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getDeleteRows()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->deleteRows;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set DeleteRows
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setDeleteRows($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->deleteRows = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get SelectLockedCells
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getSelectLockedCells()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->selectLockedCells;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set SelectLockedCells
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setSelectLockedCells($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->selectLockedCells = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get Sort
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getSort()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->sort;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set Sort
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setSort($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->sort = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get AutoFilter
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getAutoFilter()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->autoFilter;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set AutoFilter
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setAutoFilter($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->autoFilter = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get PivotTables
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getPivotTables()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->pivotTables;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set PivotTables
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setPivotTables($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->pivotTables = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get SelectUnlockedCells
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getSelectUnlockedCells()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->selectUnlockedCells;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set SelectUnlockedCells
|
|
|
|
*
|
|
|
|
* @param boolean $pValue
|
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setSelectUnlockedCells($pValue = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->selectUnlockedCells = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get Password (hashed)
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function getPassword()
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-19 23:20:20 +00:00
|
|
|
return $this->password;
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set Password
|
|
|
|
*
|
2015-05-12 09:22:06 +00:00
|
|
|
* @param string $pValue
|
|
|
|
* @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
|
2010-08-26 19:14:53 +00:00
|
|
|
* @return PHPExcel_Worksheet_Protection
|
|
|
|
*/
|
2015-05-17 18:00:00 +00:00
|
|
|
public function setPassword($pValue = '', $pAlreadyHashed = false)
|
2015-05-15 11:17:40 +00:00
|
|
|
{
|
2015-05-12 09:22:06 +00:00
|
|
|
if (!$pAlreadyHashed) {
|
|
|
|
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
|
|
|
|
}
|
2015-05-19 23:20:20 +00:00
|
|
|
$this->password = $pValue;
|
2015-05-12 09:22:06 +00:00
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implement PHP __clone to create a deep clone, not just a shallow copy.
|
|
|
|
*/
|
2015-05-15 11:17:40 +00:00
|
|
|
public function __clone()
|
|
|
|
{
|
2015-05-12 09:22:06 +00:00
|
|
|
$vars = get_object_vars($this);
|
|
|
|
foreach ($vars as $key => $value) {
|
|
|
|
if (is_object($value)) {
|
|
|
|
$this->$key = clone $value;
|
|
|
|
} else {
|
|
|
|
$this->$key = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-08-26 19:14:53 +00:00
|
|
|
}
|