commit 602e5fcede42d1069c51b64090903af3f3dc8db3 Author: Joel Pittet Date: Sun Mar 31 01:38:42 2013 -0700 start for update_report diff --git a/core/modules/update/templates/update-last-check.html.twig b/core/modules/update/templates/update-last-check.html.twig index 2ee8b89..86ed1ff 100644 --- a/core/modules/update/templates/update-last-check.html.twig +++ b/core/modules/update/templates/update-last-check.html.twig @@ -18,6 +18,5 @@ {% else %} {{ 'Last checked: never'|t }} {% endif %} - ({{ link }}) diff --git a/core/modules/update/templates/update-manager-update-form.html.twig b/core/modules/update/templates/update-manager-update-form.html.twig deleted file mode 100644 index e69de29..0000000 diff --git a/core/modules/update/templates/update-report.html.twig b/core/modules/update/templates/update-report.html.twig index e69de29..90e1c80 100644 --- a/core/modules/update/templates/update-report.html.twig +++ b/core/modules/update/templates/update-report.html.twig @@ -0,0 +1,14 @@ +{# +/** + * @file + * Default theme implementation for the project status report. + * + * Available variables: + * - data: An array of data about each project's status. + * + * @see template_preprocess() + * @see template_preprocess_update_report() + * + * @ingroup themeable + */ +#} diff --git a/core/modules/update/update.module b/core/modules/update/update.module index bebbb3c..21d317c 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -269,9 +269,11 @@ function update_theme() { // @see http://drupal.org/node/1938934. 'update_version' => array( 'variables' => array('version' => NULL, 'tag' => NULL, 'class' => array()), + 'file' => 'update.report.inc', ), 'update_status_label' => array( 'variables' => array('status' => NULL), + 'file' => 'update.report.inc', 'template' => 'update-status-label', ), ); diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc index 8ff956e..b56e615 100644 --- a/core/modules/update/update.report.inc +++ b/core/modules/update/update.report.inc @@ -13,36 +13,51 @@ * @see update_menu() */ function update_status() { + $build = array(); + $last = state()->get('update.last_check') ?: 0; + $build['last_check'] = array( + '#theme' => 'update_last_check', + '#last' => $last, + ); if ($available = update_get_available(TRUE)) { module_load_include('inc', 'update', 'update.compare'); $data = update_calculate_project_data($available); - return theme('update_report', array('data' => $data)); } else { - return theme('update_report', array('data' => _update_no_data())); + $data = _update_no_data(); } + + if (!is_array($data)) { + $build['data'] = array( + '#markup' => $data, + '#prefix' => '

', + '#suffix' => '

', + ); + return $build; + } + + + $build['report'] = array( + '#theme' => 'update_report', + '#data' => $data, + ); + return $build; } /** - * Returns HTML for the project status report. + * Prepares variables the project status report. + * + * Default template: container.html.twig. * * @param array $variables * An associative array containing: * - data: An array of data about each project's status. * - * @ingroup themeable */ function theme_update_report($variables) { $data = $variables['data']; - $last = state()->get('update.last_check') ?: 0; - $output = theme('update_last_check', array('last' => $last)); - - if (!is_array($data)) { - $output .= '

' . $data . '

'; - return $output; - } - + $output = ''; $header = array(); $rows = array();