You are here

public function WorkflowTransitionListBuilder::render in Workflow 8

Builds the entity listing as renderable array for table.html.twig.

Overrides EntityListBuilder::render

File

src/WorkflowTransitionListBuilder.php, line 179

Class

WorkflowTransitionListBuilder
Defines a class to build a draggable listing of Workflow State entities.

Namespace

Drupal\workflow

Code

public function render() {
  $build = [];

  // @todo D8: get pager working.
  $this->limit = \Drupal::config('workflow.settings')
    ->get('workflow_states_per_page');

  // @todo D8-port.
  // $output .= theme('pager', array('tags' => $limit)); // @todo D8-port.
  $build += parent::render();

  // Add a footer. This is not yet added in EntityListBuilder::render()
  if ($this->footer_needed) {

    // @todo D8-port: test this.
    // Two variants. First variant is official, but I like 2nd better.

    /*
          $build['table']['#footer'] = [
     [
       'class' => ['footer-class'],
       'data' => [
         [
           'data' => self::WORKFLOW_MARK_STATE_IS_DELETED . ' ' . $this->t('State is no longer available.'),
           'colspan' => count($build['table']['#header']),
         ],
       ],
     ],
          ];
    */
    $build['workflow_footer'] = [
      '#markup' => self::WORKFLOW_MARK_STATE_IS_DELETED . ' ' . $this
        ->t('State is no longer available.'),
      '#weight' => 500,
    ];
  }
  return $build;
}