Version Notes
N/A
Download this release
Release Info
Developer | Magento Core Team |
Extension | ArtsOnIT_OfflineMaintenance |
Version | 1.0.1 |
Comparing to | |
See all releases |
Version 1.0.1
- app/code/community/Mage/OfflineMaintenance/Helper/Data.php +14 -0
- app/code/community/Mage/OfflineMaintenance/controller/Router/Standard.php +50 -0
- app/code/community/Mage/OfflineMaintenance/etc/config.xml +87 -0
- app/code/community/Mage/OfflineMaintenance/etc/system.xml +53 -0
- app/etc/modules/Mage_OfflineMaintenance.xml +9 -0
- package.xml +25 -0
app/code/community/Mage/OfflineMaintenance/Helper/Data.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
11 |
+
class Mage_Offlinemaintenance_Helper_Data extends Mage_Core_Helper_Abstract
|
12 |
+
{
|
13 |
+
|
14 |
+
}
|
app/code/community/Mage/OfflineMaintenance/controller/Router/Standard.php
ADDED
@@ -0,0 +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 |
+
Mage::getSingleton('core/session', array('name' => 'adminhtml'));
|
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 |
+
}
|
app/code/community/Mage/OfflineMaintenance/etc/config.xml
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mage_OfflineMaintenance>
|
5 |
+
<version>1.0.1</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
ADDED
@@ -0,0 +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>0</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>
|
app/etc/modules/Mage_OfflineMaintenance.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Mage_OfflineMaintenance>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</Mage_OfflineMaintenance>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>ArtsOnIT_OfflineMaintenance</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>N/A</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Allow administrators to switch off any store view during mantenance operation.</summary>
|
10 |
+
<description>Allow administrators to switch off any store view during maintenance operations.
|
11 |
+
|
12 |
+
|
13 |
+
- Administrators are able use all Magento functions during maintenance operations
|
14 |
+
- Message is customizable (Global or each store view)
|
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>N/A</notes>
|
19 |
+
<authors><author><name>Luca</name><user>auto-converted</user><email>l.calore@artson.it</email></author></authors>
|
20 |
+
<date>2008-09-20</date>
|
21 |
+
<time>03:13:43</time>
|
22 |
+
<contents><target name="magecommunity"><dir name="Mage"><dir name="OfflineMaintenance"><dir name="controller"><dir name="Router"><file name="Standard.php" hash="1c30af30aad30db948955eb605cf4f2a"/></dir></dir><dir name="etc"><file name="config.xml" hash="4f2966d4f20c6d8d8a8a18abeff61f33"/><file name="system.xml" hash="bbffc6cee93375821e67e940483c3844"/></dir><dir name="Helper"><file name="Data.php" hash="134b3ba8c6c2ce63e652e417d2b768b7"/></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>
|