code/model/EditableCustomRule.php 1 location
|
@@ 111-123 (lines=13) @@
|
| 108 |
|
* @param array $args List of arguments passed to canCreate |
| 109 |
|
* @return DataObject Some parent dataobject to inherit permissions from |
| 110 |
|
*/ |
| 111 |
|
protected function getCanCreateContext($args) { |
| 112 |
|
// Inspect second parameter to canCreate for a 'Parent' context |
| 113 |
|
if(isset($args[1]['Parent'])) { |
| 114 |
|
return $args[1]['Parent']; |
| 115 |
|
} |
| 116 |
|
// Hack in currently edited page if context is missing |
| 117 |
|
if(Controller::has_curr() && Controller::curr() instanceof CMSMain) { |
| 118 |
|
return Controller::curr()->currentPage(); |
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
// No page being edited |
| 122 |
|
return null; |
| 123 |
|
} |
| 124 |
|
|
| 125 |
|
/** |
| 126 |
|
* @param Member $member |
code/model/recipients/UserDefinedForm_EmailRecipientCondition.php 1 location
|
@@ 81-93 (lines=13) @@
|
| 78 |
|
* @param array $args List of arguments passed to canCreate |
| 79 |
|
* @return SiteTree Parent page instance |
| 80 |
|
*/ |
| 81 |
|
protected function getCanCreateContext($args) { |
| 82 |
|
// Inspect second parameter to canCreate for a 'Parent' context |
| 83 |
|
if(isset($args[1]['Parent'])) { |
| 84 |
|
return $args[1]['Parent']; |
| 85 |
|
} |
| 86 |
|
// Hack in currently edited page if context is missing |
| 87 |
|
if(Controller::has_curr() && Controller::curr() instanceof CMSMain) { |
| 88 |
|
return Controller::curr()->currentPage(); |
| 89 |
|
} |
| 90 |
|
|
| 91 |
|
// No page being edited |
| 92 |
|
return null; |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
/** |
| 96 |
|
* @param Member |
code/model/recipients/UserDefinedForm_EmailRecipient.php 1 location
|
@@ 297-309 (lines=13) @@
|
| 294 |
|
* @param array $args List of arguments passed to canCreate |
| 295 |
|
* @return SiteTree Parent page instance |
| 296 |
|
*/ |
| 297 |
|
protected function getCanCreateContext($args) { |
| 298 |
|
// Inspect second parameter to canCreate for a 'Parent' context |
| 299 |
|
if(isset($args[1]['Form'])) { |
| 300 |
|
return $args[1]['Form']; |
| 301 |
|
} |
| 302 |
|
// Hack in currently edited page if context is missing |
| 303 |
|
if(Controller::has_curr() && Controller::curr() instanceof CMSMain) { |
| 304 |
|
return Controller::curr()->currentPage(); |
| 305 |
|
} |
| 306 |
|
|
| 307 |
|
// No page being edited |
| 308 |
|
return null; |
| 309 |
|
} |
| 310 |
|
|
| 311 |
|
/** |
| 312 |
|
* @param Member |
code/model/editableformfields/EditableFormField.php 1 location
|
@@ 414-426 (lines=13) @@
|
| 411 |
|
* @param array $args List of arguments passed to canCreate |
| 412 |
|
* @return SiteTree Parent page instance |
| 413 |
|
*/ |
| 414 |
|
protected function getCanCreateContext($args) { |
| 415 |
|
// Inspect second parameter to canCreate for a 'Parent' context |
| 416 |
|
if(isset($args[1]['Parent'])) { |
| 417 |
|
return $args[1]['Parent']; |
| 418 |
|
} |
| 419 |
|
// Hack in currently edited page if context is missing |
| 420 |
|
if(Controller::has_curr() && Controller::curr() instanceof CMSMain) { |
| 421 |
|
return Controller::curr()->currentPage(); |
| 422 |
|
} |
| 423 |
|
|
| 424 |
|
// No page being edited |
| 425 |
|
return null; |
| 426 |
|
} |
| 427 |
|
|
| 428 |
|
/** |
| 429 |
|
* Check if can publish |
code/model/editableformfields/EditableOption.php 1 location
|
@@ 109-121 (lines=13) @@
|
| 106 |
|
* @param array $args List of arguments passed to canCreate |
| 107 |
|
* @return DataObject Some parent dataobject to inherit permissions from |
| 108 |
|
*/ |
| 109 |
|
protected function getCanCreateContext($args) { |
| 110 |
|
// Inspect second parameter to canCreate for a 'Parent' context |
| 111 |
|
if(isset($args[1]['Parent'])) { |
| 112 |
|
return $args[1]['Parent']; |
| 113 |
|
} |
| 114 |
|
// Hack in currently edited page if context is missing |
| 115 |
|
if(Controller::has_curr() && Controller::curr() instanceof CMSMain) { |
| 116 |
|
return Controller::curr()->currentPage(); |
| 117 |
|
} |
| 118 |
|
|
| 119 |
|
// No page being edited |
| 120 |
|
return null; |
| 121 |
|
} |
| 122 |
|
|
| 123 |
|
/** |
| 124 |
|
* @param Member $member |