|
From: <gem...@li...> - 2011-10-20 13:30:25
|
Revision: 119
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=119&view=rev
Author: matijsdejong
Date: 2011-10-20 13:30:18 +0000 (Thu, 20 Oct 2011)
Log Message:
-----------
Maintenance mode is now a button and works a little bit nicer as per #20.
Modified Paths:
--------------
trunk/library/classes/Gems/Default/ProjectInformationAction.php
trunk/library/classes/Gems/Menu/MenuAbstract.php
trunk/library/classes/GemsEscort.php
trunk/library/languages/default-en.mo
trunk/library/languages/default-en.po
trunk/library/languages/default-nl.mo
trunk/library/languages/default-nl.po
Modified: trunk/library/classes/Gems/Default/ProjectInformationAction.php
===================================================================
--- trunk/library/classes/Gems/Default/ProjectInformationAction.php 2011-10-20 12:56:42 UTC (rev 118)
+++ trunk/library/classes/Gems/Default/ProjectInformationAction.php 2011-10-20 13:30:18 UTC (rev 119)
@@ -45,6 +45,18 @@
*/
class Gems_Default_ProjectInformationAction extends Gems_Controller_Action
{
+ /**
+ *
+ * @var GemsEscort
+ */
+ public $escort;
+
+ /**
+ *
+ * @var Gems_Menu
+ */
+ public $menu;
+
public $useHtmlView = true;
protected function _showTable($caption, $data, $nested = false)
@@ -132,18 +144,40 @@
$data[$this->_('Server OS')] = php_uname('s');
$data[$this->_('Time on server')] = date('r');
+ if (file_exists($this->escort->getMaintenanceLockFilename())) {
+ $label = $this->_('Turn Maintenance Mode OFF');
+ } else {
+ $label = $this->_('Turn Maintenance Mode ON');
+ }
+ $request = $this->getRequest();
+ $buttonList = $this->menu->getMenuList();
+ $buttonList->addParameterSources($request)
+ ->addByController($request->getControllerName(), 'maintenance', $label);
+
+ // $this->html->buttonDiv($buttonList);
+
$this->_showTable($this->_('Version information'), $data);
+
+ $this->html->buttonDiv($buttonList);
}
public function maintenanceAction()
{
- $lockFile = GEMS_ROOT_DIR . '/var/settings/lock.txt';
- if(file_exists($lockFile)) {
+ $lockFile = $this->escort->getMaintenanceLockFilename();
+ if (file_exists($lockFile)) {
unlink($lockFile);
} else {
touch($lockFile);
}
- $this->_forward('index');
+
+ // Dump the existing maintenance mode messages.
+ $this->escort->getMessenger()->clearCurrentMessages();
+ $this->escort->getMessenger()->clearMessages();
+ MUtil_Echo::out();
+
+ // Redirect
+ $request = $this->getRequest();
+ $this->_reroute(array($request->getActionKey() => 'index'));
}
public function phpAction()
Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php
===================================================================
--- trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-10-20 12:56:42 UTC (rev 118)
+++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2011-10-20 13:30:18 UTC (rev 119)
@@ -300,7 +300,7 @@
$page->addAction($this->_('PHP'), null, 'php');
$page->addAction($this->_('Project'), null, 'project');
$page->addAction($this->_('Session'), null, 'session');
- $page->addAction($this->_('Maintenance mode'), 'pr.maintenance', 'maintenance');
+ $page->addButtonOnly($this->_('Maintenance mode'), 'pr.maintenance', 'project-information', 'maintenance');
return $page;
}
Modified: trunk/library/classes/GemsEscort.php
===================================================================
--- trunk/library/classes/GemsEscort.php 2011-10-20 12:56:42 UTC (rev 118)
+++ trunk/library/classes/GemsEscort.php 2011-10-20 13:30:18 UTC (rev 119)
@@ -1133,6 +1133,15 @@
}
/**
+ *
+ * @return string Name of the file that performs the maintenance lock
+ */
+ public function getMaintenanceLockFilename()
+ {
+ return GEMS_ROOT_DIR . '/var/settings/lock.txt';
+ }
+
+ /**
* Retrieve the GemsEscort object
*
* @return GemsEscort
@@ -1523,7 +1532,7 @@
* Check if we are in maintenance mode or not. This is triggeren by a file in the var/settings
* directory with the name lock.txt
*/
- if(file_exists(GEMS_ROOT_DIR . '/var/settings/lock.txt')) {
+ if (file_exists($this->getMaintenanceLockFilename())) {
if ($this->session->user_id && $this->session->user_role !== 'super') {
//Still allow logoff so we can relogin as super
if (!('index' == $request->getControllerName() && 'logoff' == $request->getActionName())) {
@@ -1533,7 +1542,7 @@
$this->_('System is in maintenance mode'));
}
} else {
- $this->getMessenger()->addMessage($this->_('System is in maintenance mode'));
+ $this->addMessage($this->_('System is in maintenance mode'));
MUtil_Echo::r($this->_('System is in maintenance mode'));
}
}
Modified: trunk/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-en.po
===================================================================
--- trunk/library/languages/default-en.po 2011-10-20 12:56:42 UTC (rev 118)
+++ trunk/library/languages/default-en.po 2011-10-20 13:30:18 UTC (rev 119)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: Pulse EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-10-20 14:51+0100\n"
+"POT-Creation-Date: 2011-10-20 15:30+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -32,44 +32,44 @@
msgid "version"
msgstr "version"
-#: classes/GemsEscort.php:1410
+#: classes/GemsEscort.php:1419
msgid "Take note: your session has expired, your inputs where not saved. Please check the input data and try again"
msgstr "Take note: your session has expired, your inputs where not saved. Please check the input data and try again"
-#: classes/GemsEscort.php:1531
+#: classes/GemsEscort.php:1540
msgid "Please check back later."
msgstr "Please check back later."
-#: classes/GemsEscort.php:1533
-#: classes/GemsEscort.php:1536
-#: classes/GemsEscort.php:1537
+#: classes/GemsEscort.php:1542
+#: classes/GemsEscort.php:1545
+#: classes/GemsEscort.php:1546
msgid "System is in maintenance mode"
msgstr "System is in maintenance mode"
-#: classes/GemsEscort.php:1551
+#: classes/GemsEscort.php:1560
msgid "No access to site."
msgstr "No access to site."
-#: classes/GemsEscort.php:1553
-#: classes/GemsEscort.php:1589
+#: classes/GemsEscort.php:1562
+#: classes/GemsEscort.php:1598
msgid "You have no access to this site."
msgstr "You have no access to this site."
-#: classes/GemsEscort.php:1569
+#: classes/GemsEscort.php:1578
msgid "No access to page"
msgstr "No access to page"
-#: classes/GemsEscort.php:1571
+#: classes/GemsEscort.php:1580
#, php-format
msgid "Access to this page is not allowed for current role: %s."
msgstr "Access to this page is not allowed for current role: %s."
-#: classes/GemsEscort.php:1576
-#: classes/GemsEscort.php:1587
+#: classes/GemsEscort.php:1585
+#: classes/GemsEscort.php:1596
msgid "You are no longer logged in."
msgstr "You are no longer logged in."
-#: classes/GemsEscort.php:1577
+#: classes/GemsEscort.php:1586
msgid "You must login to access this page."
msgstr "You must login to access this page."
@@ -1401,107 +1401,115 @@
msgid "Planning overview"
msgstr "Planning overview"
-#: classes/Gems/Default/ProjectInformationAction.php:71
+#: classes/Gems/Default/ProjectInformationAction.php:83
msgid "empty file"
msgstr "empty file"
-#: classes/Gems/Default/ProjectInformationAction.php:75
+#: classes/Gems/Default/ProjectInformationAction.php:87
msgid "file not found"
msgstr "file not found"
-#: classes/Gems/Default/ProjectInformationAction.php:108
+#: classes/Gems/Default/ProjectInformationAction.php:120
msgid "Logged errors"
msgstr "Logged errors"
-#: classes/Gems/Default/ProjectInformationAction.php:108
+#: classes/Gems/Default/ProjectInformationAction.php:120
msgid "Empty logfile"
msgstr "Empty logfile"
-#: classes/Gems/Default/ProjectInformationAction.php:113
+#: classes/Gems/Default/ProjectInformationAction.php:125
msgid "Project information"
msgstr "Project information"
-#: classes/Gems/Default/ProjectInformationAction.php:117
+#: classes/Gems/Default/ProjectInformationAction.php:129
msgid "Project name"
msgstr "Project name"
-#: classes/Gems/Default/ProjectInformationAction.php:118
+#: classes/Gems/Default/ProjectInformationAction.php:130
msgid "Project version"
msgstr "Project version"
-#: classes/Gems/Default/ProjectInformationAction.php:119
+#: classes/Gems/Default/ProjectInformationAction.php:131
msgid "Gems version"
msgstr "Gems version"
-#: classes/Gems/Default/ProjectInformationAction.php:121
+#: classes/Gems/Default/ProjectInformationAction.php:133
msgid "Gems project"
msgstr "Gems project"
-#: classes/Gems/Default/ProjectInformationAction.php:122
+#: classes/Gems/Default/ProjectInformationAction.php:134
msgid "Gems web directory"
msgstr "Gems web directory"
-#: classes/Gems/Default/ProjectInformationAction.php:123
+#: classes/Gems/Default/ProjectInformationAction.php:135
msgid "Gems code directory"
msgstr "Gems code directory"
-#: classes/Gems/Default/ProjectInformationAction.php:124
+#: classes/Gems/Default/ProjectInformationAction.php:136
msgid "Gems project path"
msgstr "Gems project path"
-#: classes/Gems/Default/ProjectInformationAction.php:125
+#: classes/Gems/Default/ProjectInformationAction.php:137
msgid "MUtil version"
msgstr "MUtil version"
-#: classes/Gems/Default/ProjectInformationAction.php:126
+#: classes/Gems/Default/ProjectInformationAction.php:138
msgid "Zend version"
msgstr "Zend version"
-#: classes/Gems/Default/ProjectInformationAction.php:127
+#: classes/Gems/Default/ProjectInformationAction.php:139
msgid "Application environment"
msgstr "Application environment"
-#: classes/Gems/Default/ProjectInformationAction.php:128
+#: classes/Gems/Default/ProjectInformationAction.php:140
msgid "Application baseuri"
msgstr "Application baseuri"
-#: classes/Gems/Default/ProjectInformationAction.php:129
+#: classes/Gems/Default/ProjectInformationAction.php:141
msgid "Application directory"
msgstr "Application directory"
-#: classes/Gems/Default/ProjectInformationAction.php:130
+#: classes/Gems/Default/ProjectInformationAction.php:142
msgid "PHP version"
msgstr "PHP version"
-#: classes/Gems/Default/ProjectInformationAction.php:131
+#: classes/Gems/Default/ProjectInformationAction.php:143
msgid "Server Hostname"
msgstr "Server Hostname"
-#: classes/Gems/Default/ProjectInformationAction.php:132
+#: classes/Gems/Default/ProjectInformationAction.php:144
msgid "Server OS"
msgstr "Server OS"
-#: classes/Gems/Default/ProjectInformationAction.php:133
+#: classes/Gems/Default/ProjectInformationAction.php:145
msgid "Time on server"
msgstr "Time on server"
-#: classes/Gems/Default/ProjectInformationAction.php:135
+#: classes/Gems/Default/ProjectInformationAction.php:148
+msgid "Turn Maintenance Mode OFF"
+msgstr "Turn Maintenance Mode OFF"
+
+#: classes/Gems/Default/ProjectInformationAction.php:150
+msgid "Turn Maintenance Mode ON"
+msgstr "Turn Maintenance Mode ON"
+
+#: classes/Gems/Default/ProjectInformationAction.php:159
msgid "Version information"
msgstr "Version information"
-#: classes/Gems/Default/ProjectInformationAction.php:151
+#: classes/Gems/Default/ProjectInformationAction.php:185
msgid "Server PHP Info"
msgstr "Server PHP Info"
-#: classes/Gems/Default/ProjectInformationAction.php:164
+#: classes/Gems/Default/ProjectInformationAction.php:198
msgid "Project settings"
msgstr "Project settings"
-#: classes/Gems/Default/ProjectInformationAction.php:171
+#: classes/Gems/Default/ProjectInformationAction.php:205
msgid "Session content"
msgstr "Session content"
-#: classes/Gems/Default/ProjectInformationAction.php:172
+#: classes/Gems/Default/ProjectInformationAction.php:206
msgid "Session"
msgstr "Session"
Modified: trunk/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-nl.po
===================================================================
--- trunk/library/languages/default-nl.po 2011-10-20 12:56:42 UTC (rev 118)
+++ trunk/library/languages/default-nl.po 2011-10-20 13:30:18 UTC (rev 119)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: Pulse NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-10-20 14:51+0100\n"
+"POT-Creation-Date: 2011-10-20 15:30+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -32,44 +32,44 @@
msgid "version"
msgstr "versie"
-#: classes/GemsEscort.php:1410
+#: classes/GemsEscort.php:1419
msgid "Take note: your session has expired, your inputs where not saved. Please check the input data and try again"
msgstr "Let op: uw sessie is verlopen, uw invoer is niet opgeslagen. Controleer de gegevens en probeer a.u.b. opnieuw."
-#: classes/GemsEscort.php:1531
+#: classes/GemsEscort.php:1540
msgid "Please check back later."
msgstr "Probeer het later opnieuw."
-#: classes/GemsEscort.php:1533
-#: classes/GemsEscort.php:1536
-#: classes/GemsEscort.php:1537
+#: classes/GemsEscort.php:1542
+#: classes/GemsEscort.php:1545
+#: classes/GemsEscort.php:1546
msgid "System is in maintenance mode"
msgstr "Systeem is in onderhoudsmodus"
-#: classes/GemsEscort.php:1551
+#: classes/GemsEscort.php:1560
msgid "No access to site."
msgstr "Geen toegang tot website."
-#: classes/GemsEscort.php:1553
-#: classes/GemsEscort.php:1589
+#: classes/GemsEscort.php:1562
+#: classes/GemsEscort.php:1598
msgid "You have no access to this site."
msgstr "U heeft geen toegang tot deze website."
-#: classes/GemsEscort.php:1569
+#: classes/GemsEscort.php:1578
msgid "No access to page"
msgstr "Geen toegang tot pagina"
-#: classes/GemsEscort.php:1571
+#: classes/GemsEscort.php:1580
#, php-format
msgid "Access to this page is not allowed for current role: %s."
msgstr "U heeft geen toegang tot deze pagina. Uw huidige rol is: %s."
-#: classes/GemsEscort.php:1576
-#: classes/GemsEscort.php:1587
+#: classes/GemsEscort.php:1585
+#: classes/GemsEscort.php:1596
msgid "You are no longer logged in."
msgstr "U bent niet meer ingelogd."
-#: classes/GemsEscort.php:1577
+#: classes/GemsEscort.php:1586
msgid "You must login to access this page."
msgstr "U moet ingelogd zijn voor toegang tot deze pagina."
@@ -1401,107 +1401,115 @@
msgid "Planning overview"
msgstr "Planning overzicht"
-#: classes/Gems/Default/ProjectInformationAction.php:71
+#: classes/Gems/Default/ProjectInformationAction.php:83
msgid "empty file"
msgstr "leeg bestand"
-#: classes/Gems/Default/ProjectInformationAction.php:75
+#: classes/Gems/Default/ProjectInformationAction.php:87
msgid "file not found"
msgstr "bestand niet gevonden"
-#: classes/Gems/Default/ProjectInformationAction.php:108
+#: classes/Gems/Default/ProjectInformationAction.php:120
msgid "Logged errors"
msgstr "Opgeslagen foutmeldingen"
-#: classes/Gems/Default/ProjectInformationAction.php:108
+#: classes/Gems/Default/ProjectInformationAction.php:120
msgid "Empty logfile"
msgstr "Verwijder alle foutmeldingen"
-#: classes/Gems/Default/ProjectInformationAction.php:113
+#: classes/Gems/Default/ProjectInformationAction.php:125
msgid "Project information"
msgstr "Project informatie"
-#: classes/Gems/Default/ProjectInformationAction.php:117
+#: classes/Gems/Default/ProjectInformationAction.php:129
msgid "Project name"
msgstr "Project naam"
-#: classes/Gems/Default/ProjectInformationAction.php:118
+#: classes/Gems/Default/ProjectInformationAction.php:130
msgid "Project version"
msgstr "Project versie"
-#: classes/Gems/Default/ProjectInformationAction.php:119
+#: classes/Gems/Default/ProjectInformationAction.php:131
msgid "Gems version"
msgstr "Gems versie"
-#: classes/Gems/Default/ProjectInformationAction.php:121
+#: classes/Gems/Default/ProjectInformationAction.php:133
msgid "Gems project"
msgstr "Gems project"
-#: classes/Gems/Default/ProjectInformationAction.php:122
+#: classes/Gems/Default/ProjectInformationAction.php:134
msgid "Gems web directory"
msgstr "Gems web folder"
-#: classes/Gems/Default/ProjectInformationAction.php:123
+#: classes/Gems/Default/ProjectInformationAction.php:135
msgid "Gems code directory"
msgstr "Gems code folder"
-#: classes/Gems/Default/ProjectInformationAction.php:124
+#: classes/Gems/Default/ProjectInformationAction.php:136
msgid "Gems project path"
msgstr "Gems project folder"
-#: classes/Gems/Default/ProjectInformationAction.php:125
+#: classes/Gems/Default/ProjectInformationAction.php:137
msgid "MUtil version"
msgstr "MUtil versie"
-#: classes/Gems/Default/ProjectInformationAction.php:126
+#: classes/Gems/Default/ProjectInformationAction.php:138
msgid "Zend version"
msgstr "Zend versie"
-#: classes/Gems/Default/ProjectInformationAction.php:127
+#: classes/Gems/Default/ProjectInformationAction.php:139
msgid "Application environment"
msgstr "Applicatie omgeving"
-#: classes/Gems/Default/ProjectInformationAction.php:128
+#: classes/Gems/Default/ProjectInformationAction.php:140
msgid "Application baseuri"
msgstr "Applicatie baseuri"
-#: classes/Gems/Default/ProjectInformationAction.php:129
+#: classes/Gems/Default/ProjectInformationAction.php:141
msgid "Application directory"
msgstr "Applicatie folder"
-#: classes/Gems/Default/ProjectInformationAction.php:130
+#: classes/Gems/Default/ProjectInformationAction.php:142
msgid "PHP version"
msgstr "PHP versie"
-#: classes/Gems/Default/ProjectInformationAction.php:131
+#: classes/Gems/Default/ProjectInformationAction.php:143
msgid "Server Hostname"
msgstr "Webserver naam"
-#: classes/Gems/Default/ProjectInformationAction.php:132
+#: classes/Gems/Default/ProjectInformationAction.php:144
msgid "Server OS"
msgstr "Server besturingssysteem"
-#: classes/Gems/Default/ProjectInformationAction.php:133
+#: classes/Gems/Default/ProjectInformationAction.php:145
msgid "Time on server"
msgstr "De tijd op de server"
-#: classes/Gems/Default/ProjectInformationAction.php:135
+#: classes/Gems/Default/ProjectInformationAction.php:148
+msgid "Turn Maintenance Mode OFF"
+msgstr "Onderhoudsmodus UITzetten"
+
+#: classes/Gems/Default/ProjectInformationAction.php:150
+msgid "Turn Maintenance Mode ON"
+msgstr "Onderhoudsmodus AANzetten"
+
+#: classes/Gems/Default/ProjectInformationAction.php:159
msgid "Version information"
msgstr "Versie informatie"
-#: classes/Gems/Default/ProjectInformationAction.php:151
+#: classes/Gems/Default/ProjectInformationAction.php:185
msgid "Server PHP Info"
msgstr "Server PHP Info"
-#: classes/Gems/Default/ProjectInformationAction.php:164
+#: classes/Gems/Default/ProjectInformationAction.php:198
msgid "Project settings"
msgstr "Project instellingen"
-#: classes/Gems/Default/ProjectInformationAction.php:171
+#: classes/Gems/Default/ProjectInformationAction.php:205
msgid "Session content"
msgstr "Sessie inhoud"
-#: classes/Gems/Default/ProjectInformationAction.php:172
+#: classes/Gems/Default/ProjectInformationAction.php:206
msgid "Session"
msgstr "Sessie"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|