ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Protection.php
Go to the documentation of this file.
1<?php
37{
43 private $_sheet = false;
44
50 private $_objects = false;
51
57 private $_scenarios = false;
58
64 private $_formatCells = false;
65
71 private $_formatColumns = false;
72
78 private $_formatRows = false;
79
85 private $_insertColumns = false;
86
92 private $_insertRows = false;
93
99 private $_insertHyperlinks = false;
100
106 private $_deleteColumns = false;
107
113 private $_deleteRows = false;
114
120 private $_selectLockedCells = false;
121
127 private $_sort = false;
128
134 private $_autoFilter = false;
135
141 private $_pivotTables = false;
142
148 private $_selectUnlockedCells = false;
149
155 private $_password = '';
156
160 public function __construct()
161 {
162 }
163
170 return $this->_sheet ||
171 $this->_objects ||
172 $this->_scenarios ||
173 $this->_formatCells ||
174 $this->_formatColumns ||
175 $this->_formatRows ||
176 $this->_insertColumns ||
177 $this->_insertRows ||
178 $this->_insertHyperlinks ||
179 $this->_deleteColumns ||
180 $this->_deleteRows ||
181 $this->_selectLockedCells ||
182 $this->_sort ||
183 $this->_autoFilter ||
184 $this->_pivotTables ||
186 }
187
193 function getSheet() {
194 return $this->_sheet;
195 }
196
203 function setSheet($pValue = false) {
204 $this->_sheet = $pValue;
205 return $this;
206 }
207
213 function getObjects() {
214 return $this->_objects;
215 }
216
223 function setObjects($pValue = false) {
224 $this->_objects = $pValue;
225 return $this;
226 }
227
233 function getScenarios() {
234 return $this->_scenarios;
235 }
236
243 function setScenarios($pValue = false) {
244 $this->_scenarios = $pValue;
245 return $this;
246 }
247
253 function getFormatCells() {
254 return $this->_formatCells;
255 }
256
263 function setFormatCells($pValue = false) {
264 $this->_formatCells = $pValue;
265 return $this;
266 }
267
273 function getFormatColumns() {
275 }
276
283 function setFormatColumns($pValue = false) {
284 $this->_formatColumns = $pValue;
285 return $this;
286 }
287
293 function getFormatRows() {
294 return $this->_formatRows;
295 }
296
303 function setFormatRows($pValue = false) {
304 $this->_formatRows = $pValue;
305 return $this;
306 }
307
313 function getInsertColumns() {
315 }
316
323 function setInsertColumns($pValue = false) {
324 $this->_insertColumns = $pValue;
325 return $this;
326 }
327
333 function getInsertRows() {
334 return $this->_insertRows;
335 }
336
343 function setInsertRows($pValue = false) {
344 $this->_insertRows = $pValue;
345 return $this;
346 }
347
355 }
356
363 function setInsertHyperlinks($pValue = false) {
364 $this->_insertHyperlinks = $pValue;
365 return $this;
366 }
367
373 function getDeleteColumns() {
375 }
376
383 function setDeleteColumns($pValue = false) {
384 $this->_deleteColumns = $pValue;
385 return $this;
386 }
387
393 function getDeleteRows() {
394 return $this->_deleteRows;
395 }
396
403 function setDeleteRows($pValue = false) {
404 $this->_deleteRows = $pValue;
405 return $this;
406 }
407
415 }
416
423 function setSelectLockedCells($pValue = false) {
424 $this->_selectLockedCells = $pValue;
425 return $this;
426 }
427
433 function getSort() {
434 return $this->_sort;
435 }
436
443 function setSort($pValue = false) {
444 $this->_sort = $pValue;
445 return $this;
446 }
447
453 function getAutoFilter() {
454 return $this->_autoFilter;
455 }
456
463 function setAutoFilter($pValue = false) {
464 $this->_autoFilter = $pValue;
465 return $this;
466 }
467
473 function getPivotTables() {
474 return $this->_pivotTables;
475 }
476
483 function setPivotTables($pValue = false) {
484 $this->_pivotTables = $pValue;
485 return $this;
486 }
487
495 }
496
503 function setSelectUnlockedCells($pValue = false) {
504 $this->_selectUnlockedCells = $pValue;
505 return $this;
506 }
507
513 function getPassword() {
514 return $this->_password;
515 }
516
524 function setPassword($pValue = '', $pAlreadyHashed = false) {
525 if (!$pAlreadyHashed) {
527 }
528 $this->_password = $pValue;
529 return $this;
530 }
531
535 public function __clone() {
536 $vars = get_object_vars($this);
537 foreach ($vars as $key => $value) {
538 if (is_object($value)) {
539 $this->$key = clone $value;
540 } else {
541 $this->$key = $value;
542 }
543 }
544 }
545}
An exception for terminatinating execution or to throw for unit testing.
static hashPassword($pPassword='')
Create a password hash from a given string.
setScenarios($pValue=false)
Set Scenarios.
Definition: Protection.php:243
setFormatRows($pValue=false)
Set FormatRows.
Definition: Protection.php:303
getInsertHyperlinks()
Get InsertHyperlinks.
Definition: Protection.php:353
getPivotTables()
Get PivotTables.
Definition: Protection.php:473
getInsertColumns()
Get InsertColumns.
Definition: Protection.php:313
getSelectLockedCells()
Get SelectLockedCells.
Definition: Protection.php:413
setDeleteRows($pValue=false)
Set DeleteRows.
Definition: Protection.php:403
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
Definition: Protection.php:535
isProtectionEnabled()
Is some sort of protection enabled?
Definition: Protection.php:169
setDeleteColumns($pValue=false)
Set DeleteColumns.
Definition: Protection.php:383
getAutoFilter()
Get AutoFilter.
Definition: Protection.php:453
getPassword()
Get Password (hashed)
Definition: Protection.php:513
setAutoFilter($pValue=false)
Set AutoFilter.
Definition: Protection.php:463
setSheet($pValue=false)
Set Sheet.
Definition: Protection.php:203
setInsertHyperlinks($pValue=false)
Set InsertHyperlinks.
Definition: Protection.php:363
setObjects($pValue=false)
Set Objects.
Definition: Protection.php:223
getSelectUnlockedCells()
Get SelectUnlockedCells.
Definition: Protection.php:493
setFormatCells($pValue=false)
Set FormatCells.
Definition: Protection.php:263
getFormatColumns()
Get FormatColumns.
Definition: Protection.php:273
getInsertRows()
Get InsertRows.
Definition: Protection.php:333
setSelectUnlockedCells($pValue=false)
Set SelectUnlockedCells.
Definition: Protection.php:503
getDeleteRows()
Get DeleteRows.
Definition: Protection.php:393
__construct()
Create a new PHPExcel_Worksheet_Protection.
Definition: Protection.php:160
setSort($pValue=false)
Set Sort.
Definition: Protection.php:443
setInsertColumns($pValue=false)
Set InsertColumns.
Definition: Protection.php:323
setFormatColumns($pValue=false)
Set FormatColumns.
Definition: Protection.php:283
getScenarios()
Get Scenarios.
Definition: Protection.php:233
setPassword($pValue='', $pAlreadyHashed=false)
Set Password.
Definition: Protection.php:524
getFormatCells()
Get FormatCells.
Definition: Protection.php:253
getDeleteColumns()
Get DeleteColumns.
Definition: Protection.php:373
setSelectLockedCells($pValue=false)
Set SelectLockedCells.
Definition: Protection.php:423
getFormatRows()
Get FormatRows.
Definition: Protection.php:293
setPivotTables($pValue=false)
Set PivotTables.
Definition: Protection.php:483
setInsertRows($pValue=false)
Set InsertRows.
Definition: Protection.php:343