1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- use Drupal\Core\Render\Element;
- use Drupal\Core\Link;
- use Drupal\Core\Url;
- function template_preprocess_status(array &$variables) {
-
- $status = $variables['elements']['#status'];
-
- foreach (Element::children($variables['elements']) as $key) {
- $variables['content'][$key] = $variables['elements'][$key];
- }
- $variables['content']['status_message'] = $status->getMessage()->view();
- }
- function template_preprocess_status_content_add_list(&$variables) {
- $variables['types'] = array();
- $query = \Drupal::request()->query->all();
- foreach ($variables['content'] as $type) {
- $variables['types'][$type->id()] = array(
- 'link' => Link::fromTextAndUrl($type->label(), new Url('entity.status.add_form', array(
- 'status_type' => $type->id()
- ), array('query' => $query))),
- 'description' => array(
- '#markup' => $type->label(),
- ),
- 'title' => $type->label(),
- 'localized_options' => array(
- 'query' => $query,
- ),
- );
- }
- }
|