summaryrefslogtreecommitdiff
path: root/modules/gallery/views
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-09-08 20:36:22 -0700
committerBharat Mediratta <bharat@menalto.com>2010-09-08 20:36:22 -0700
commit391a90e3cedd1cca7631f9a4d786c6c513b1dd48 (patch)
tree6d88d103a73cf9f5bdd8cd5584c80b4b9dc57e35 /modules/gallery/views
parentd7edbc211f75acf0214ee554722a4f470d92157b (diff)
Detect when a module fails to upgrade properly and put up an
informative message to help the user know that she needs to get a newer copy of the module. Fixes ticket #1189.
Diffstat (limited to 'modules/gallery/views')
-rw-r--r--modules/gallery/views/upgrader.html.php53
1 files changed, 36 insertions, 17 deletions
diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php
index 0ce24ef8..c2d8a552 100644
--- a/modules/gallery/views/upgrader.html.php
+++ b/modules/gallery/views/upgrader.html.php
@@ -10,7 +10,7 @@
</head>
<body<? if (locales::is_rtl()) { echo ' class="rtl"'; } ?>>
<div id="outer">
- <img src="<?= url::file("modules/gallery/images/gallery.png") ?>" />
+ <img id="logo" src="<?= url::file("modules/gallery/images/gallery.png") ?>" />
<div id="inner">
<? if ($can_upgrade): ?>
<div id="dialog" style="visibility: hidden">
@@ -31,6 +31,12 @@
array("url" => html::mark_clean(url::base()))) ?>
</p>
</div>
+ <div id="failed" style="display: none">
+ <h1> <?= t("Some modules failed to upgrade!") ?> </h1>
+ <p>
+ <?= t("Failed modules are <span class=\"failed\">highlighted</span>. Try getting newer versions or <a href=\"%admin_modules\">deactivating those modules</a>.", array("admin_modules" => url::site("admin/modules"))) ?>
+ </p>
+ </div>
</div>
<script type="text/javascript">
$(document).ready(function() {
@@ -41,6 +47,10 @@
<? if ($done): ?>
show_done();
<? endif ?>
+
+ <? if ($failed): ?>
+ show_failed();
+ <? endif ?>
});
var show_busy = function() {
@@ -55,10 +65,31 @@
$("#done").show();
$("#dialog_close_link").show();
}
+
+ var show_failed = function() {
+ $("#dialog").css("visibility", "visible");
+ $("#failed").show();
+ $("#dialog_close_link").show();
+ }
</script>
- <p class="<?= $done ? "muted" : "" ?>">
- <?= t("Welcome to the Gallery upgrader. One click and you're done!") ?>
- </p>
+ <div id="welcome_message">
+ <p class="<?= $done ? "muted" : "" ?>">
+ <?= t("Welcome to the Gallery upgrader. One click and you're done!") ?>
+ </p>
+ </div>
+
+ <? if ($done): ?>
+ <div id="upgrade_button" class="button muted">
+ <?= t("Upgrade all") ?>
+ </div>
+ <? else: ?>
+ <div id="upgrade_button" class="button button-active">
+ <a id="upgrade_link" href="<?= url::site("upgrader/upgrade") ?>">
+ <?= t("Upgrade all") ?>
+ </a>
+ </div>
+ <? endif ?>
+
<table>
<tr class="<?= $done ? "muted" : "" ?>">
<th class="name"> <?= t("Module name") ?> </th>
@@ -68,7 +99,7 @@
<? foreach ($available as $id => $module): ?>
<? if ($module->active): ?>
- <tr class="<?= $module->version == $module->code_version ? "current" : "upgradeable" ?>" >
+ <tr class="<?= $module->version == $module->code_version ? "current" : "upgradeable" ?> <?= in_array($id, $failed) ? "failed" : "" ?>" >
<td class="name <?= $id ?>">
<?= t($module->name) ?>
</td>
@@ -85,18 +116,6 @@
<? endforeach ?>
</table>
- <? if ($done): ?>
- <div class="button muted">
- <?= t("Upgrade all") ?>
- </div>
- <? else: ?>
- <div class="button button-active">
- <a id="upgrade_link" href="<?= url::site("upgrader/upgrade") ?>">
- <?= t("Upgrade all") ?>
- </a>
- </div>
- <? endif ?>
-
<? if (@$inactive): ?>
<p class="<?= $done ? "muted" : "" ?>">
<?= t("The following modules are inactive and don't require an upgrade.") ?>