AccessConfigure.php in Page Manager 8
File
page_manager_ui/src/Form/AccessConfigure.php
View source
<?php
namespace Drupal\page_manager_ui\Form;
use Drupal\Core\Form\FormStateInterface;
use Drupal\ctools\Form\ConditionConfigure;
use Drupal\page_manager\PageInterface;
class AccessConfigure extends ConditionConfigure {
protected function getParentRouteInfo($cached_values) {
$page = $cached_values['page'];
$route_name = $page
->isNew() ? 'entity.page.add_step_form' : 'entity.page.edit_form';
return [
$route_name,
[
'machine_name' => $this->machine_name,
'step' => 'access',
],
];
}
protected function getConditions($cached_values) {
$page = $cached_values['page'];
return $page
->get('access_conditions');
}
protected function setConditions($cached_values, $conditions) {
$page = $cached_values['page'];
$page
->set('access_conditions', $conditions);
$cached_values['page'] = $page;
return $cached_values;
}
protected function getContexts($cached_values) {
$page = $cached_values['page'];
return $page
->getContexts();
}
}