Version Notes
Few small changes
Download this release
Release Info
Developer | Magento Core Team |
Extension | ArtsOnIT_OfflineMaintenance |
Version | 1.0.4 |
Comparing to | |
See all releases |
Code changes from version 1.0.3 to 1.0.4
app/code/community/Mage/OfflineMaintenance/Controller/Router/Standard.php
CHANGED
@@ -1,50 +1,50 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* Magento ArtsOnIt Offline Maintenance Page
|
4 |
-
*
|
5 |
-
* @category ArtsOnIt
|
6 |
-
* @package Mage_OfflineMaintenance
|
7 |
-
* @copyright Copyright (c) 2008 ArtsOn.IT (http://www.ArtsOn.it)
|
8 |
-
* @author Calore Luca Erico (l.calore@ArtsOn.it)
|
9 |
-
*/
|
10 |
-
class Mage_OfflineMaintenance_Controller_Router_Standard extends Mage_Core_Controller_Varien_Router_Standard
|
11 |
-
{
|
12 |
-
|
13 |
-
public function match(Zend_Controller_Request_Http $request)
|
14 |
-
{
|
15 |
-
|
16 |
-
$storeenabled = Mage::getStoreConfig('offlineMaintenance/settings/enabled', $request->getStoreCodeFromPath());
|
17 |
-
$showreminder = Mage::getStoreConfig('offlineMaintenance/settings/showreminder', $request->getStoreCodeFromPath());
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
if ($storeenabled)
|
22 |
-
{
|
23 |
-
if (!Mage::getSingleton('admin/session')->isLoggedIn())
|
24 |
-
{
|
25 |
-
Mage::getSingleton('core/session', array('name' => 'front'));
|
26 |
-
|
27 |
-
$front = $this->getFront();
|
28 |
-
$response = $front->getResponse();
|
29 |
-
$response->setHeader('HTTP/1.1','503 Service Temporarily Unavailable');
|
30 |
-
$response->setHeader('Status','503 Service Temporarily Unavailable');
|
31 |
-
$response->setHeader('Retry-After','5000');
|
32 |
-
|
33 |
-
$response->setBody(html_entity_decode( Mage::getStoreConfig('offlineMaintenance/settings/message', $request->getStoreCodeFromPath()), ENT_QUOTES, "utf-8" )); $response->sendHeaders();
|
34 |
-
$response->outputBody();
|
35 |
-
|
36 |
-
exit;
|
37 |
-
}
|
38 |
-
else if ($showreminder)
|
39 |
-
{
|
40 |
-
$front = $this->getFront();
|
41 |
-
$response = $front->getResponse()->appendBody('<div style="height:12px; background:red; color: white; position:relative; width:100%;padding:3px; z-index:100000;text-trasform:capitalize;">Offline</div>');
|
42 |
-
}
|
43 |
-
}
|
44 |
-
return parent::match($request);
|
45 |
-
|
46 |
-
}
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
}
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Magento ArtsOnIt Offline Maintenance Page
|
4 |
+
*
|
5 |
+
* @category ArtsOnIt
|
6 |
+
* @package Mage_OfflineMaintenance
|
7 |
+
* @copyright Copyright (c) 2008 ArtsOn.IT (http://www.ArtsOn.it)
|
8 |
+
* @author Calore Luca Erico (l.calore@ArtsOn.it)
|
9 |
+
*/
|
10 |
+
class Mage_OfflineMaintenance_Controller_Router_Standard extends Mage_Core_Controller_Varien_Router_Standard
|
11 |
+
{
|
12 |
+
|
13 |
+
public function match(Zend_Controller_Request_Http $request)
|
14 |
+
{
|
15 |
+
|
16 |
+
$storeenabled = Mage::getStoreConfig('offlineMaintenance/settings/enabled', $request->getStoreCodeFromPath());
|
17 |
+
$showreminder = Mage::getStoreConfig('offlineMaintenance/settings/showreminder', $request->getStoreCodeFromPath());
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
if ($storeenabled)
|
22 |
+
{ Mage::getSingleton('core/session', array('name' => 'adminhtml'));
|
23 |
+
if (!Mage::getSingleton('admin/session')->isLoggedIn())
|
24 |
+
{
|
25 |
+
Mage::getSingleton('core/session', array('name' => 'front'));
|
26 |
+
|
27 |
+
$front = $this->getFront();
|
28 |
+
$response = $front->getResponse();
|
29 |
+
$response->setHeader('HTTP/1.1','503 Service Temporarily Unavailable');
|
30 |
+
$response->setHeader('Status','503 Service Temporarily Unavailable');
|
31 |
+
$response->setHeader('Retry-After','5000');
|
32 |
+
|
33 |
+
$response->setBody(html_entity_decode( Mage::getStoreConfig('offlineMaintenance/settings/message', $request->getStoreCodeFromPath()), ENT_QUOTES, "utf-8" )); $response->sendHeaders();
|
34 |
+
$response->outputBody();
|
35 |
+
|
36 |
+
exit;
|
37 |
+
}
|
38 |
+
else if ($showreminder)
|
39 |
+
{
|
40 |
+
$front = $this->getFront();
|
41 |
+
$response = $front->getResponse()->appendBody('<div style="height:12px; background:red; color: white; position:relative; width:100%;padding:3px; z-index:100000;text-trasform:capitalize;">Offline</div>');
|
42 |
+
}
|
43 |
+
}
|
44 |
+
return parent::match($request);
|
45 |
+
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
}
|
app/code/community/Mage/OfflineMaintenance/etc/config.xml
CHANGED
@@ -1,87 +1,87 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Mage_OfflineMaintenance>
|
5 |
-
<version>1.0.
|
6 |
-
</Mage_OfflineMaintenance>
|
7 |
-
</modules>
|
8 |
-
<default>
|
9 |
-
<web>
|
10 |
-
<routers>
|
11 |
-
<standard><area>frontend</area><class>Mage_OfflineMaintenance_Controller_Router_Standard</class></standard>
|
12 |
-
</routers>
|
13 |
-
</web>
|
14 |
-
<offlineMaintenance>
|
15 |
-
<settings>
|
16 |
-
<enabled>0</enabled>
|
17 |
-
<message><![CDATA[
|
18 |
-
<style>
|
19 |
-
body {
|
20 |
-
background:#777777 none repeat scroll 0 0;
|
21 |
-
color:#FFFFFF;
|
22 |
-
font-family:Helvetica,Arial,Verdana,sans-serif;
|
23 |
-
font-size:12px;
|
24 |
-
|
25 |
-
margin:0;
|
26 |
-
padding:0;
|
27 |
-
text-align:center;
|
28 |
-
}
|
29 |
-
h1
|
30 |
-
{
|
31 |
-
margin:0px;
|
32 |
-
padding:0px;
|
33 |
-
margin-top:30%;
|
34 |
-
font-size: 25pt;
|
35 |
-
display:block;
|
36 |
-
}
|
37 |
-
h2
|
38 |
-
{
|
39 |
-
padding:0px;
|
40 |
-
margin-top: 5px;
|
41 |
-
font-size: 18pt;
|
42 |
-
}
|
43 |
-
|
44 |
-
</style>
|
45 |
-
</head>
|
46 |
-
|
47 |
-
<body>
|
48 |
-
<h1>We're sorry, but our website is under maintenance.</h1>
|
49 |
-
<h2>Please enjoy a quick cup of espresso and then try refreshing this page</h2>
|
50 |
-
]]>
|
51 |
-
</message>
|
52 |
-
</settings>
|
53 |
-
</offlineMaintenance>
|
54 |
-
</default>
|
55 |
-
|
56 |
-
<adminhtml>
|
57 |
-
<translate>
|
58 |
-
<modules>
|
59 |
-
<Mage_OfflineMaintenance>
|
60 |
-
<files>
|
61 |
-
<default>Mage_OfflineMaintenance.csv</default>
|
62 |
-
</files>
|
63 |
-
</Mage_OfflineMaintenance>
|
64 |
-
</modules>
|
65 |
-
</translate>
|
66 |
-
<acl>
|
67 |
-
<resources>
|
68 |
-
<admin>
|
69 |
-
<children>
|
70 |
-
<system>
|
71 |
-
<children>
|
72 |
-
<config>
|
73 |
-
<children>
|
74 |
-
<offlineMaintenance>
|
75 |
-
<title>Maintenance</title>
|
76 |
-
</offlineMaintenance>
|
77 |
-
</children>
|
78 |
-
</config>
|
79 |
-
</children>
|
80 |
-
</system>
|
81 |
-
</children>
|
82 |
-
</admin>
|
83 |
-
</resources>
|
84 |
-
</acl>
|
85 |
-
</adminhtml>
|
86 |
-
|
87 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mage_OfflineMaintenance>
|
5 |
+
<version>1.0.4</version>
|
6 |
+
</Mage_OfflineMaintenance>
|
7 |
+
</modules>
|
8 |
+
<default>
|
9 |
+
<web>
|
10 |
+
<routers>
|
11 |
+
<standard><area>frontend</area><class>Mage_OfflineMaintenance_Controller_Router_Standard</class></standard>
|
12 |
+
</routers>
|
13 |
+
</web>
|
14 |
+
<offlineMaintenance>
|
15 |
+
<settings>
|
16 |
+
<enabled>0</enabled>
|
17 |
+
<message><![CDATA[
|
18 |
+
<style>
|
19 |
+
body {
|
20 |
+
background:#777777 none repeat scroll 0 0;
|
21 |
+
color:#FFFFFF;
|
22 |
+
font-family:Helvetica,Arial,Verdana,sans-serif;
|
23 |
+
font-size:12px;
|
24 |
+
|
25 |
+
margin:0;
|
26 |
+
padding:0;
|
27 |
+
text-align:center;
|
28 |
+
}
|
29 |
+
h1
|
30 |
+
{
|
31 |
+
margin:0px;
|
32 |
+
padding:0px;
|
33 |
+
margin-top:30%;
|
34 |
+
font-size: 25pt;
|
35 |
+
display:block;
|
36 |
+
}
|
37 |
+
h2
|
38 |
+
{
|
39 |
+
padding:0px;
|
40 |
+
margin-top: 5px;
|
41 |
+
font-size: 18pt;
|
42 |
+
}
|
43 |
+
|
44 |
+
</style>
|
45 |
+
</head>
|
46 |
+
|
47 |
+
<body>
|
48 |
+
<h1>We're sorry, but our website is under maintenance.</h1>
|
49 |
+
<h2>Please enjoy a quick cup of espresso and then try refreshing this page</h2>
|
50 |
+
]]>
|
51 |
+
</message>
|
52 |
+
</settings>
|
53 |
+
</offlineMaintenance>
|
54 |
+
</default>
|
55 |
+
|
56 |
+
<adminhtml>
|
57 |
+
<translate>
|
58 |
+
<modules>
|
59 |
+
<Mage_OfflineMaintenance>
|
60 |
+
<files>
|
61 |
+
<default>Mage_OfflineMaintenance.csv</default>
|
62 |
+
</files>
|
63 |
+
</Mage_OfflineMaintenance>
|
64 |
+
</modules>
|
65 |
+
</translate>
|
66 |
+
<acl>
|
67 |
+
<resources>
|
68 |
+
<admin>
|
69 |
+
<children>
|
70 |
+
<system>
|
71 |
+
<children>
|
72 |
+
<config>
|
73 |
+
<children>
|
74 |
+
<offlineMaintenance>
|
75 |
+
<title>Maintenance</title>
|
76 |
+
</offlineMaintenance>
|
77 |
+
</children>
|
78 |
+
</config>
|
79 |
+
</children>
|
80 |
+
</system>
|
81 |
+
</children>
|
82 |
+
</admin>
|
83 |
+
</resources>
|
84 |
+
</acl>
|
85 |
+
</adminhtml>
|
86 |
+
|
87 |
</config>
|
app/code/community/Mage/OfflineMaintenance/etc/system.xml
CHANGED
@@ -1,53 +1,53 @@
|
|
1 |
-
<config>
|
2 |
-
<sections>
|
3 |
-
<offlineMaintenance translate="label" module="offlineMaintenance">
|
4 |
-
<label>Offline Maintenance</label>
|
5 |
-
<tab>advanced</tab>
|
6 |
-
<frontend_type>text</frontend_type>
|
7 |
-
<sort_order>991</sort_order>
|
8 |
-
<show_in_default>1</show_in_default>
|
9 |
-
<show_in_website>1</show_in_website>
|
10 |
-
<show_in_store>1</show_in_store>
|
11 |
-
<groups>
|
12 |
-
<settings translate="label">
|
13 |
-
<label>Offline Settings</label>
|
14 |
-
<frontend_type>text</frontend_type>
|
15 |
-
<sort_order>1</sort_order>
|
16 |
-
<show_in_default>1</show_in_default>
|
17 |
-
<show_in_website>0</show_in_website>
|
18 |
-
<show_in_store>1</show_in_store>
|
19 |
-
<fields>
|
20 |
-
|
21 |
-
<enabled translate="label">
|
22 |
-
<label>Store Offline</label>
|
23 |
-
<frontend_type>select</frontend_type>
|
24 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
25 |
-
<sort_order>1</sort_order>
|
26 |
-
<show_in_default>1</show_in_default>
|
27 |
-
<show_in_website>0</show_in_website>
|
28 |
-
<show_in_store>1</show_in_store>
|
29 |
-
</enabled>
|
30 |
-
<message translate="label">
|
31 |
-
<label>Message</label>
|
32 |
-
<frontend_type>textarea</frontend_type>
|
33 |
-
<sort_order>3</sort_order>
|
34 |
-
<show_in_default>
|
35 |
-
<show_in_website>0</show_in_website>
|
36 |
-
<show_in_store>1</show_in_store>
|
37 |
-
</message>
|
38 |
-
<showreminder translate="label">
|
39 |
-
<label>Show Website Status </label>
|
40 |
-
<frontend_type>select</frontend_type>
|
41 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
42 |
-
<sort_order>1</sort_order>
|
43 |
-
<show_in_default>1</show_in_default>
|
44 |
-
<show_in_website>0</show_in_website>
|
45 |
-
<show_in_store>1</show_in_store>
|
46 |
-
</showreminder>
|
47 |
-
|
48 |
-
</fields>
|
49 |
-
</settings>
|
50 |
-
</groups>
|
51 |
-
</offlineMaintenance>
|
52 |
-
</sections>
|
53 |
-
</config>
|
1 |
+
<config>
|
2 |
+
<sections>
|
3 |
+
<offlineMaintenance translate="label" module="offlineMaintenance">
|
4 |
+
<label>Offline Maintenance</label>
|
5 |
+
<tab>advanced</tab>
|
6 |
+
<frontend_type>text</frontend_type>
|
7 |
+
<sort_order>991</sort_order>
|
8 |
+
<show_in_default>1</show_in_default>
|
9 |
+
<show_in_website>1</show_in_website>
|
10 |
+
<show_in_store>1</show_in_store>
|
11 |
+
<groups>
|
12 |
+
<settings translate="label">
|
13 |
+
<label>Offline Settings</label>
|
14 |
+
<frontend_type>text</frontend_type>
|
15 |
+
<sort_order>1</sort_order>
|
16 |
+
<show_in_default>1</show_in_default>
|
17 |
+
<show_in_website>0</show_in_website>
|
18 |
+
<show_in_store>1</show_in_store>
|
19 |
+
<fields>
|
20 |
+
|
21 |
+
<enabled translate="label">
|
22 |
+
<label>Store Offline</label>
|
23 |
+
<frontend_type>select</frontend_type>
|
24 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
25 |
+
<sort_order>1</sort_order>
|
26 |
+
<show_in_default>1</show_in_default>
|
27 |
+
<show_in_website>0</show_in_website>
|
28 |
+
<show_in_store>1</show_in_store>
|
29 |
+
</enabled>
|
30 |
+
<message translate="label">
|
31 |
+
<label>Message</label>
|
32 |
+
<frontend_type>textarea</frontend_type>
|
33 |
+
<sort_order>3</sort_order>
|
34 |
+
<show_in_default>1</show_in_default>
|
35 |
+
<show_in_website>0</show_in_website>
|
36 |
+
<show_in_store>1</show_in_store>
|
37 |
+
</message>
|
38 |
+
<showreminder translate="label">
|
39 |
+
<label>Show Website Status </label>
|
40 |
+
<frontend_type>select</frontend_type>
|
41 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
42 |
+
<sort_order>1</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>0</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
</showreminder>
|
47 |
+
|
48 |
+
</fields>
|
49 |
+
</settings>
|
50 |
+
</groups>
|
51 |
+
</offlineMaintenance>
|
52 |
+
</sections>
|
53 |
+
</config>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ArtsOnIT_OfflineMaintenance</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>N/A</license>
|
7 |
<channel>community</channel>
|
@@ -15,11 +15,11 @@
|
|
15 |
- Visual reminder of maintenance mode
|
16 |
- SEO Build-in optimization: page status is set as 503
|
17 |
- Courtesy page is showed in every single front page</description>
|
18 |
-
<notes>
|
19 |
<authors><author><name>Luca</name><user>auto-converted</user><email>l.calore@artson.it</email></author></authors>
|
20 |
-
<date>2008-
|
21 |
-
<time>
|
22 |
-
<contents><target name="magecommunity"><dir name="Mage"><dir name="OfflineMaintenance"><dir name="Controller"><dir name="Router"><file name="Standard.php" hash="
|
23 |
<compatible/>
|
24 |
<dependencies/>
|
25 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>ArtsOnIT_OfflineMaintenance</name>
|
4 |
+
<version>1.0.4</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>N/A</license>
|
7 |
<channel>community</channel>
|
15 |
- Visual reminder of maintenance mode
|
16 |
- SEO Build-in optimization: page status is set as 503
|
17 |
- Courtesy page is showed in every single front page</description>
|
18 |
+
<notes>Few small changes</notes>
|
19 |
<authors><author><name>Luca</name><user>auto-converted</user><email>l.calore@artson.it</email></author></authors>
|
20 |
+
<date>2008-11-13</date>
|
21 |
+
<time>01:24:19</time>
|
22 |
+
<contents><target name="magecommunity"><dir name="Mage"><dir name="OfflineMaintenance"><dir name="Controller"><dir name="Router"><file name="Standard.php" hash="27fd25c72c4f8954b9de671e78ad5a13"/></dir></dir><dir name="etc"><file name="config.xml" hash="c588c03ee6996e910b073e52324fa8b3"/><file name="system.xml" hash="1ba2075e51e6c36053001d4f4ec9493e"/></dir><dir name="Helper"><file name="Data.php" hash="7cc5de2a72ae5f613fadfdcaf500b8cf"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_OfflineMaintenance.xml" hash="2f662f17bf17645423b34bfdad183492"/></dir></target></contents>
|
23 |
<compatible/>
|
24 |
<dependencies/>
|
25 |
</package>
|