aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/control_panel
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-07-17 02:46:53 +0200
committerSem <sembrestels@riseup.net>2012-07-17 02:46:53 +0200
commitdce60b43126dcaa38e6845ae45e09db87aa7e229 (patch)
treeddb47e193ed2737c7adf338d0c87813a7ff67fb6 /views/default/widgets/control_panel
parent9590b4684d4ff87a5986742bf00ea0a91e061b0c (diff)
downloadelgg-dce60b43126dcaa38e6845ae45e09db87aa7e229.tar.gz
elgg-dce60b43126dcaa38e6845ae45e09db87aa7e229.tar.bz2
Refs #4643. Added unlock upgrade action.
Diffstat (limited to 'views/default/widgets/control_panel')
-rw-r--r--views/default/widgets/control_panel/content.php32
1 files changed, 26 insertions, 6 deletions
diff --git a/views/default/widgets/control_panel/content.php b/views/default/widgets/control_panel/content.php
index d2db54bc6..e6763d851 100644
--- a/views/default/widgets/control_panel/content.php
+++ b/views/default/widgets/control_panel/content.php
@@ -11,12 +11,32 @@ elgg_register_menu_item('admin_control_panel', array(
'link_class' => 'elgg-button elgg-button-action',
));
-elgg_register_menu_item('admin_control_panel', array(
- 'name' => 'upgrade',
- 'text' => elgg_echo('upgrade'),
- 'href' => 'upgrade.php',
- 'link_class' => 'elgg-button elgg-button-action',
-));
+// @todo Move in this in ElggUpgradeManager::isLocked() when #4682 fixed
+global $CONFIG, $DB_QUERY_CACHE;
+$is_locked = count(get_data("show tables like '{$CONFIG->dbprefix}locked'"));
+// Invalidate query cache
+if ($DB_QUERY_CACHE) {
+ $DB_QUERY_CACHE->clear();
+ elgg_log("Query cache invalidated", 'NOTICE');
+}
+
+if (!$is_locked) {
+ elgg_register_menu_item('admin_control_panel', array(
+ 'name' => 'upgrade',
+ 'text' => elgg_echo('upgrade'),
+ 'href' => 'upgrade.php',
+ 'link_class' => 'elgg-button elgg-button-action',
+ ));
+} else {
+ elgg_register_menu_item('admin_control_panel', array(
+ 'name' => 'unlock_upgrade',
+ 'text' => elgg_echo('upgrade:unlock'),
+ 'href' => 'action/admin/site/unlock_upgrade',
+ 'is_action' => true,
+ 'link_class' => 'elgg-button elgg-button-delete',
+ 'confirm' => elgg_echo('upgrade:unlock:confirm'),
+ ));
+}
echo elgg_view_menu('admin_control_panel', array(
'class' => 'elgg-menu-hz',