You are here

public function HackedController::hackedStatus in Hacked! 8.2

Page callback to build up a full report.

1 string reference to 'HackedController::hackedStatus'
hacked.routing.yml in ./hacked.routing.yml
hacked.routing.yml

File

src/Controller/HackedController.php, line 34

Class

HackedController
Controller routines for hacked routes.

Namespace

Drupal\hacked\Controller

Code

public function hackedStatus() {

  // We're going to be borrowing heavily from the update module
  $build = [
    '#theme' => 'update_report',
  ];
  if ($available = update_get_available(TRUE)) {
    $build = [
      '#theme' => 'hacked_report',
    ];
    $this
      ->moduleHandler()
      ->loadInclude('update', 'compare.inc');
    $data = update_calculate_project_data($available);
    $build['#data'] = $this
      ->getProjectData($data);
    if (!is_array($build['#data'])) {
      return $build['#data'];
    }
  }
  return $build;
}