summaryrefslogtreecommitdiff
path: root/includes/theme.maintenance.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-15 21:19:31 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-10-15 21:19:31 +0000
commit6abcc47e25e936aea84c2f1e287bc5e1a045fff4 (patch)
tree800c3c256246f6c0399b9f3ec89d8a8aa83f5005 /includes/theme.maintenance.inc
parent945fd9e269fd1ddee861a079660862c56ee54f74 (diff)
downloadbrdo-6abcc47e25e936aea84c2f1e287bc5e1a045fff4.tar.gz
brdo-6abcc47e25e936aea84c2f1e287bc5e1a045fff4.tar.bz2
#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
Diffstat (limited to 'includes/theme.maintenance.inc')
-rw-r--r--includes/theme.maintenance.inc45
1 files changed, 45 insertions, 0 deletions
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 .= '<div id="authorize-results">';
+ foreach ($messages as $heading => $logs) {
+ $output .= '<h3>' . check_plain($heading) . '</h3>';
+ foreach ($logs as $number => $log_message) {
+ if ($number === '#abort') {
+ continue;
+ }
+ $output .= theme('authorize_message', array('message' => $log_message['message'], 'success' => $log_message['success']));
+ }
+ }
+ $output .= '</div>';
+ }
+ 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 .= '<li class="success">' . $message . '</li>';
+ }
+ else {
+ $output .= '<li class="failure"><strong>' . t('Failed') . ':</strong> ' . $message . '</li>';
+ }
+ return $output;
+}