From 6abcc47e25e936aea84c2f1e287bc5e1a045fff4 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 15 Oct 2009 21:19:31 +0000 Subject: #538660 by JacobSingh, dww, JoshuaRogers, adrian, Crell, chx, anarcat, and cwgordon7: Add a functioning Plugin Manager to core. Can you say module installation and updates through the UI? I knew you could! :D --- includes/theme.maintenance.inc | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'includes/theme.maintenance.inc') diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc index e2ebc9342..a625e15c0 100644 --- a/includes/theme.maintenance.inc +++ b/includes/theme.maintenance.inc @@ -202,3 +202,48 @@ function theme_update_page($variables) { return theme_render_template('themes/garland/maintenance-page.tpl.php', $variables); } + +/** + * Generate a report of the results from an operation run via authorize.php. + * + * @param array $variables + * - messages: An array of result messages. + */ +function theme_authorize_report($variables) { + $messages = $variables['messages']; + $output = ''; + if (!empty($messages)) { + $output .= '
'; + foreach ($messages as $heading => $logs) { + $output .= '

' . check_plain($heading) . '

'; + foreach ($logs as $number => $log_message) { + if ($number === '#abort') { + continue; + } + $output .= theme('authorize_message', array('message' => $log_message['message'], 'success' => $log_message['success'])); + } + } + $output .= '
'; + } + return $output; +} + +/** + * Render a single log message from the authorize.php batch operation. + * + * @param $variables + * - message: The log message. + * - success: A boolean indicating failure or success. + */ +function theme_authorize_message($variables) { + $output = ''; + $message = $variables['message']; + $success = $variables['success']; + if ($success) { + $output .= '
  • ' . $message . '
  • '; + } + else { + $output .= '
  • ' . t('Failed') . ': ' . $message . '
  • '; + } + return $output; +} -- cgit v1.2.3