PageAccessForm.php in Page Manager 8
File
page_manager_ui/src/Form/PageAccessForm.php
View source
<?php
namespace Drupal\page_manager_ui\Form;
use Drupal\Core\Form\FormStateInterface;
use Drupal\ctools\Form\ManageConditions;
use Drupal\page_manager_ui\Form\AccessConfigure;
class PageAccessForm extends ManageConditions {
public function getFormId() {
return 'page_manager_access_form';
}
protected function getConditionClass() {
return AccessConfigure::class;
}
protected function getTempstoreId() {
return 'page_manager.page';
}
protected function getOperationsRouteInfo($cached_values, $machine_name, $row) {
return [
'entity.page.condition',
[
'machine_name' => $machine_name,
'condition' => $row,
],
];
}
protected function getConditions($cached_values) {
$page = $cached_values['page'];
return $page
->get('access_conditions');
}
protected function getContexts($cached_values) {
$page = $cached_values['page'];
return $page
->getContexts();
}
protected function getAddRoute($cached_values) {
return 'entity.page.condition.add';
}
public function submitForm(array &$form, FormStateInterface $form_state) {
$triggering_element = $form_state
->getTriggeringElement();
if ($triggering_element['#value']
->getUntranslatedString() == 'Update') {
return;
}
parent::submitForm($form, $form_state);
}
}