/** * {@inheritdoc} */ public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); $item_list = array('#theme' => 'item_list', '#items' => array('@start -- the initial record number in the set', '@end -- the last record number in the set', '@total -- the total records in the set', '@label -- the human-readable name of the view', '@per_page -- the number of items per page', '@current_page -- the current page number', '@current_record_count -- the current page record count', '@page_count -- the total page count')); $list = drupal_render($item_list); $form['content'] = array('#title' => t('Display'), '#type' => 'textarea', '#rows' => 3, '#default_value' => $this->options['content'], '#description' => t('You may use HTML code in this field. The following tokens are supported:') . $list); }
/** * {@inheritdoc} */ public function preRender(array $results) { parent::preRender($results); // If a title is provided, process it. if (!empty($this->options['title'])) { $value = $this->globalTokenReplace($this->options['title']); $this->view->setTitle($this->sanitizeValue($value, 'xss_admin'), UtilityTitle::PASS_THROUGH); } }
/** * {@inheritdoc} */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); // Get all possible status codes defined by symfony. $options = Response::$statusTexts; // Move 403/404/500 to the top. $options = array('404' => $options['404'], '403' => $options['403'], '500' => $options['500']) + $options; // Add the HTTP status code, so it's easier for people to find it. array_walk($options, function ($title, $code) use(&$options) { $options[$code] = $this->t('@code (!title)', array('@code' => $code, '!title' => $title)); }); $form['status_code'] = array('#title' => $this->t('HTTP status code'), '#type' => 'select', '#default_value' => $this->options['status_code'], '#options' => $options); }
/** * {@inheritdoc} */ public function isEmpty() { if (isset($this->isEmpty)) { return $this->isEmpty; } else { return parent::isEmpty(); } }
/** * {@inheritdoc} */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $this->globalTokenForm($form, $form_state); }
/** * {@inheritdoc} */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); // Add tokenization form elements. $this->tokenForm($form, $form_state); }
/** * Constructs a new ListingEmpty. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin ID for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Access\AccessManagerInterface $access_manager * The access manager. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, AccessManagerInterface $access_manager) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->accessManager = $access_manager; }
/** * {@inheritdoc} */ public function calculateDependencies() { $dependencies = parent::calculateDependencies(); list($view_id) = explode(':', $this->options['view_to_insert'], 2); // Don't call the current view, as it would result into an infinite recursion. if ($view_id && $this->view->storage->id() != $view_id) { $view = $this->viewStorage->load($view_id); $dependencies[$view->getConfigDependencyKey()][] = $view->getConfigDependencyName(); } return $dependencies; }
/** * {@inheritdoc} */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); }