Version Notes
Started
Download this release
Release Info
Developer | Magento Core Team |
Extension | Dexxtz_Store_maintenance |
Version | 2.0.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.3 to 2.0.0
- app/code/community/Dexxtz/Storemaintenance/Block/System/Config/Source/Enddate.php +0 -33
- app/code/community/Dexxtz/Storemaintenance/Block/System/Config/Source/Ip.php +0 -19
- app/code/community/Dexxtz/Storemaintenance/Block/System/Config/Source/Ipgrid.php +0 -26
- app/code/community/Dexxtz/Storemaintenance/Helper/Data.php +1 -29
- app/code/community/Dexxtz/Storemaintenance/Model/Observer.php +24 -7
- app/code/community/Dexxtz/Storemaintenance/Model/System/Config/Source/Blockstatic.php +0 -30
- app/code/community/Dexxtz/Storemaintenance/etc/config.xml +20 -14
- app/code/community/Dexxtz/Storemaintenance/etc/system.xml +4 -4
- app/design/frontend/base/default/template/dexxtz/{storemaintenance/maintenance.phtml → store_maintenance.phtml} +3 -2
- app/locale/en_US/Dexxtz_Storemaintenance.csv +0 -24
- package.xml +4 -4
app/code/community/Dexxtz/Storemaintenance/Block/System/Config/Source/Enddate.php
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Copyright [2014] [Dexxtz]
|
5 |
-
*
|
6 |
-
* @package Dexxtz_StoreMaintenance
|
7 |
-
* @author Dexxtz
|
8 |
-
* @license http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
class Dexxtz_Storemaintenance_Block_System_Config_Source_Enddate extends Mage_Adminhtml_Block_System_Config_Form_Field
|
12 |
-
{
|
13 |
-
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
14 |
-
{
|
15 |
-
$date = new Varien_Data_Form_Element_Date;
|
16 |
-
$format = 'MM/d/y';
|
17 |
-
|
18 |
-
$data = array(
|
19 |
-
'name' => $element->getName(),
|
20 |
-
'html_id' => $element->getId(),
|
21 |
-
'image' => $this->getSkinUrl('images/grid-cal.gif'),
|
22 |
-
);
|
23 |
-
|
24 |
-
$date->setData($data);
|
25 |
-
$date->setValue($element->getValue(), $format);
|
26 |
-
$date->setFormat($format);
|
27 |
-
|
28 |
-
//$date->setClass($element->getFieldConfig()->validate->asArray());
|
29 |
-
$date->setForm($element->getForm());
|
30 |
-
|
31 |
-
return $date->getElementHtml();
|
32 |
-
}
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dexxtz/Storemaintenance/Block/System/Config/Source/Ip.php
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Copyright [2014] [Dexxtz]
|
5 |
-
*
|
6 |
-
* @package Dexxtz_StoreMaintenance
|
7 |
-
* @author Dexxtz
|
8 |
-
* @license http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
class Dexxtz_Storemaintenance_Block_System_Config_Source_Ip extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
12 |
-
{
|
13 |
-
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
14 |
-
{
|
15 |
-
$ipAdress = $_SERVER['REMOTE_ADDR'];
|
16 |
-
|
17 |
-
return $ipAdress;
|
18 |
-
}
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dexxtz/Storemaintenance/Block/System/Config/Source/Ipgrid.php
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Copyright [2014] [Dexxtz]
|
5 |
-
*
|
6 |
-
* @package Dexxtz_StoreMaintenance
|
7 |
-
* @author Dexxtz
|
8 |
-
* @license http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
class Dexxtz_Storemaintenance_Block_System_Config_Source_Ipgrid extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
|
12 |
-
{
|
13 |
-
protected $_addAfter = false;
|
14 |
-
|
15 |
-
public function __construct()
|
16 |
-
{
|
17 |
-
$this->addColumn('ip_address', array(
|
18 |
-
'label' => Mage::helper('storemaintenance')->__('IP Address'),
|
19 |
-
'style' => 'width:120px',
|
20 |
-
));
|
21 |
-
|
22 |
-
$this->_addButtonLabel = Mage::helper('storemaintenance')->__('add IP');
|
23 |
-
|
24 |
-
parent::__construct();
|
25 |
-
}
|
26 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dexxtz/Storemaintenance/Helper/Data.php
CHANGED
@@ -10,33 +10,5 @@
|
|
10 |
|
11 |
class Dexxtz_Storemaintenance_Helper_Data extends Mage_Core_Helper_Abstract
|
12 |
{
|
13 |
-
|
14 |
-
{
|
15 |
-
$ips = unserialize(Mage::getStoreConfig('storemaintenance/dexxtz/ip_grid'));
|
16 |
-
|
17 |
-
return $ips;
|
18 |
-
}
|
19 |
-
|
20 |
-
public function getActivateLog()
|
21 |
-
{
|
22 |
-
$log = Mage::getStoreConfig('storemaintenance/dexxtz/activate_log');
|
23 |
-
|
24 |
-
return $log;
|
25 |
-
}
|
26 |
-
|
27 |
-
public function getArchiveLog()
|
28 |
-
{
|
29 |
-
$archive = Mage::getStoreConfig('storemaintenance/dexxtz/archive_log');
|
30 |
-
|
31 |
-
return $archive;
|
32 |
-
}
|
33 |
-
|
34 |
-
public function getEndDate()
|
35 |
-
{
|
36 |
-
$date = Mage::getStoreConfig('storemaintenance/dexxtz/end_date');
|
37 |
-
|
38 |
-
return $date;
|
39 |
-
|
40 |
-
}
|
41 |
-
|
42 |
}
|
10 |
|
11 |
class Dexxtz_Storemaintenance_Helper_Data extends Mage_Core_Helper_Abstract
|
12 |
{
|
13 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
app/code/community/Dexxtz/Storemaintenance/Model/Observer.php
CHANGED
@@ -12,26 +12,30 @@ class Dexxtz_Storemaintenance_Model_Observer
|
|
12 |
{
|
13 |
public function initControllerStoremaintenance($request)
|
14 |
{
|
15 |
-
|
16 |
date_default_timezone_set(Mage::getStoreConfig('general/locale/timezone'));
|
17 |
|
18 |
$url = Mage::helper('core/url')->getCurrentUrl();
|
19 |
$adminArea = 0;
|
20 |
|
|
|
21 |
if (strpos($url, '/admin') || strpos($url, '/adminhtml') || strpos($url, '/downloader')) {
|
22 |
$adminArea = 1;
|
23 |
}
|
24 |
|
|
|
25 |
if ($adminArea == 0) {
|
26 |
|
27 |
$storeId = Mage::app()->getStore()->getStoreId();
|
28 |
$isEnabled = Mage::getStoreConfig('storemaintenance/dexxtz/activate',$storeId);
|
29 |
|
|
|
30 |
if ($isEnabled == 1) {
|
31 |
$allowedIPs = Mage::getStoreConfig('storemaintenance/dexxtz/allowedIPs',$storeId);
|
32 |
$allowedIPs = preg_replace('/ /', '', $allowedIPs);
|
33 |
-
$array =
|
34 |
|
|
|
35 |
foreach ($array as $key => $value) {
|
36 |
$IPs[] = $value['ip_address'];
|
37 |
}
|
@@ -40,35 +44,45 @@ class Dexxtz_Storemaintenance_Model_Observer
|
|
40 |
$allowForAdmin = Mage::getStoreConfig('storemaintenance/dexxtz/activate_admin',$storeId);
|
41 |
$adminIp = null;
|
42 |
|
|
|
43 |
if ($allowForAdmin == 1) {
|
44 |
Mage::getSingleton('core/session', array('name' => 'adminhtml'));
|
45 |
$adminSession = Mage::getSingleton('admin/session');
|
46 |
|
|
|
47 |
if ($adminSession->isLoggedIn()) {
|
48 |
$adminIp = $adminSession['_session_validator_data']['remote_addr'];
|
49 |
}
|
50 |
}
|
51 |
|
52 |
-
$endDate =
|
53 |
$checkDate = 0;
|
54 |
|
|
|
55 |
if ($endDate) {
|
56 |
$timestamp_endDate = strtotime($endDate);
|
57 |
$currentDate = date('m/d/Y');
|
58 |
$timestamp_currentDate = strtotime($currentDate);
|
59 |
-
|
|
|
60 |
if ($timestamp_currentDate > $timestamp_endDate) {
|
61 |
$checkDate = 1;
|
62 |
}
|
63 |
}
|
64 |
|
|
|
65 |
if ($currentIP != $adminIp) {
|
|
|
|
|
66 |
if (!in_array($currentIP, $IPs) && $checkDate == 0) {
|
67 |
-
|
68 |
-
|
|
|
|
|
69 |
|
|
|
70 |
if ($activate_log == 1) {
|
71 |
-
$archive_log =
|
72 |
$file = ($archive_log == '') ? 'MaintenanceLog.txt' : $archive_log;
|
73 |
$date = date('m/d/Y h:i A');
|
74 |
$urlBase = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
@@ -77,9 +91,11 @@ class Dexxtz_Storemaintenance_Model_Observer
|
|
77 |
$accessedArea = ($accessedArea == '') ? 'home' : $accessedArea;
|
78 |
$log = 'array("Date" => "' . $date . '", "IP" => "' . $currentIP . '", "Accessed Area" => "' . $accessedArea . '")' . PHP_EOL;
|
79 |
|
|
|
80 |
file_put_contents($file, $log, FILE_APPEND);
|
81 |
}
|
82 |
|
|
|
83 |
if ('' !== $html) {
|
84 |
Mage::getSingleton('core/session', array('name' => 'front'));
|
85 |
$response = $request->getEvent()->getFront()->getResponse();
|
@@ -91,6 +107,7 @@ class Dexxtz_Storemaintenance_Model_Observer
|
|
91 |
$response->outputBody();
|
92 |
}
|
93 |
|
|
|
94 |
exit();
|
95 |
}
|
96 |
}
|
12 |
{
|
13 |
public function initControllerStoremaintenance($request)
|
14 |
{
|
15 |
+
// Sets the timezone selected by shopkeeper
|
16 |
date_default_timezone_set(Mage::getStoreConfig('general/locale/timezone'));
|
17 |
|
18 |
$url = Mage::helper('core/url')->getCurrentUrl();
|
19 |
$adminArea = 0;
|
20 |
|
21 |
+
// checks whether the current page belongs to the administrator
|
22 |
if (strpos($url, '/admin') || strpos($url, '/adminhtml') || strpos($url, '/downloader')) {
|
23 |
$adminArea = 1;
|
24 |
}
|
25 |
|
26 |
+
// Performs if not is administrative area
|
27 |
if ($adminArea == 0) {
|
28 |
|
29 |
$storeId = Mage::app()->getStore()->getStoreId();
|
30 |
$isEnabled = Mage::getStoreConfig('storemaintenance/dexxtz/activate',$storeId);
|
31 |
|
32 |
+
// verifies if the module is enabled
|
33 |
if ($isEnabled == 1) {
|
34 |
$allowedIPs = Mage::getStoreConfig('storemaintenance/dexxtz/allowedIPs',$storeId);
|
35 |
$allowedIPs = preg_replace('/ /', '', $allowedIPs);
|
36 |
+
$array = unserialize(Mage::getStoreConfig('storemaintenance/dexxtz/ip_grid'));
|
37 |
|
38 |
+
// assembles an array with informed ips
|
39 |
foreach ($array as $key => $value) {
|
40 |
$IPs[] = $value['ip_address'];
|
41 |
}
|
44 |
$allowForAdmin = Mage::getStoreConfig('storemaintenance/dexxtz/activate_admin',$storeId);
|
45 |
$adminIp = null;
|
46 |
|
47 |
+
// verifies if the administrator can view the frontend
|
48 |
if ($allowForAdmin == 1) {
|
49 |
Mage::getSingleton('core/session', array('name' => 'adminhtml'));
|
50 |
$adminSession = Mage::getSingleton('admin/session');
|
51 |
|
52 |
+
// checks if the admin is logged in and capture your ip
|
53 |
if ($adminSession->isLoggedIn()) {
|
54 |
$adminIp = $adminSession['_session_validator_data']['remote_addr'];
|
55 |
}
|
56 |
}
|
57 |
|
58 |
+
$endDate = Mage::getStoreConfig('storemaintenance/dexxtz/end_date');
|
59 |
$checkDate = 0;
|
60 |
|
61 |
+
// Checks if a date was set for the end of maintenance
|
62 |
if ($endDate) {
|
63 |
$timestamp_endDate = strtotime($endDate);
|
64 |
$currentDate = date('m/d/Y');
|
65 |
$timestamp_currentDate = strtotime($currentDate);
|
66 |
+
|
67 |
+
// checks whether the current date is greater than the date specified in the module
|
68 |
if ($timestamp_currentDate > $timestamp_endDate) {
|
69 |
$checkDate = 1;
|
70 |
}
|
71 |
}
|
72 |
|
73 |
+
// checks if the ip current is different from ip of admin logged
|
74 |
if ($currentIP != $adminIp) {
|
75 |
+
|
76 |
+
// checks if the ip can access or if the date will access
|
77 |
if (!in_array($currentIP, $IPs) && $checkDate == 0) {
|
78 |
+
|
79 |
+
// stores the html of the page maintenance
|
80 |
+
$html = Mage::getSingleton('core/layout')->createBlock('core/template')->setTemplate('dexxtz/store_maintenance.phtml')->toHtml();
|
81 |
+
$activate_log = Mage::getStoreConfig('storemaintenance/dexxtz/activate_log');
|
82 |
|
83 |
+
// create log
|
84 |
if ($activate_log == 1) {
|
85 |
+
$archive_log = Mage::getStoreConfig('storemaintenance/dexxtz/archive_log');
|
86 |
$file = ($archive_log == '') ? 'MaintenanceLog.txt' : $archive_log;
|
87 |
$date = date('m/d/Y h:i A');
|
88 |
$urlBase = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
|
91 |
$accessedArea = ($accessedArea == '') ? 'home' : $accessedArea;
|
92 |
$log = 'array("Date" => "' . $date . '", "IP" => "' . $currentIP . '", "Accessed Area" => "' . $accessedArea . '")' . PHP_EOL;
|
93 |
|
94 |
+
// adds a new line to the log file
|
95 |
file_put_contents($file, $log, FILE_APPEND);
|
96 |
}
|
97 |
|
98 |
+
// mounts the display of the page of maintenance on page current
|
99 |
if ('' !== $html) {
|
100 |
Mage::getSingleton('core/session', array('name' => 'front'));
|
101 |
$response = $request->getEvent()->getFront()->getResponse();
|
107 |
$response->outputBody();
|
108 |
}
|
109 |
|
110 |
+
// break page display
|
111 |
exit();
|
112 |
}
|
113 |
}
|
app/code/community/Dexxtz/Storemaintenance/Model/System/Config/Source/Blockstatic.php
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Copyright [2014] [Dexxtz]
|
5 |
-
*
|
6 |
-
* @package Dexxtz_StoreMaintenance
|
7 |
-
* @author Dexxtz
|
8 |
-
* @license http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*/
|
10 |
-
|
11 |
-
class Dexxtz_Storemaintenance_Model_System_Config_Source_Blockstatic
|
12 |
-
{
|
13 |
-
protected $_options;
|
14 |
-
public function toOptionArray()
|
15 |
-
{
|
16 |
-
if(!$this -> _options){
|
17 |
-
$this -> _options = array(
|
18 |
-
array(
|
19 |
-
'value' => 0,
|
20 |
-
'label' => Mage::helper('catalog')->__('Please select one static block ...'),
|
21 |
-
)
|
22 |
-
);
|
23 |
-
|
24 |
-
$options = Mage::getResourceModel('cms/block_collection') -> load() -> toOptionArray();
|
25 |
-
$this -> _options = array_merge($this -> _options, $options);
|
26 |
-
}
|
27 |
-
|
28 |
-
return $this->_options;
|
29 |
-
}
|
30 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Dexxtz/Storemaintenance/etc/config.xml
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
<config>
|
12 |
<modules>
|
13 |
<Dexxtz_Storemaintenance>
|
14 |
-
<version>
|
15 |
</Dexxtz_Storemaintenance>
|
16 |
</modules>
|
17 |
<frontend>
|
@@ -48,16 +48,22 @@
|
|
48 |
<adminhtml>
|
49 |
<acl>
|
50 |
<resources>
|
|
|
|
|
|
|
51 |
<admin>
|
52 |
<children>
|
|
|
|
|
|
|
|
|
53 |
<system>
|
54 |
<children>
|
55 |
<config>
|
56 |
<children>
|
57 |
-
<
|
58 |
-
<title>
|
59 |
-
|
60 |
-
</dexxtz_storemainteance>
|
61 |
</children>
|
62 |
</config>
|
63 |
</children>
|
@@ -76,7 +82,12 @@
|
|
76 |
</modules>
|
77 |
</translate>
|
78 |
</adminhtml>
|
79 |
-
<global>
|
|
|
|
|
|
|
|
|
|
|
80 |
<resources>
|
81 |
<dexxtz_storemaintenance_setup>
|
82 |
<setup>
|
@@ -88,15 +99,10 @@
|
|
88 |
</dexxtz_storemaintenance_setup>
|
89 |
</resources>
|
90 |
<blocks>
|
91 |
-
<
|
92 |
<class>Dexxtz_Storemaintenance_Block</class>
|
93 |
-
</
|
94 |
</blocks>
|
95 |
-
<models>
|
96 |
-
<dexxtz_storemaintenance>
|
97 |
-
<class>Dexxtz_Storemaintenance_Model</class>
|
98 |
-
</dexxtz_storemaintenance>
|
99 |
-
</models>
|
100 |
<helpers>
|
101 |
<storemaintenance>
|
102 |
<class>Dexxtz_Storemaintenance_Helper</class>
|
@@ -107,7 +113,7 @@
|
|
107 |
<observers>
|
108 |
<storemaintenance>
|
109 |
<type>singleton</type>
|
110 |
-
<class>
|
111 |
<method>initControllerStoremaintenance</method>
|
112 |
</storemaintenance>
|
113 |
</observers>
|
11 |
<config>
|
12 |
<modules>
|
13 |
<Dexxtz_Storemaintenance>
|
14 |
+
<version>2.0.0</version>
|
15 |
</Dexxtz_Storemaintenance>
|
16 |
</modules>
|
17 |
<frontend>
|
48 |
<adminhtml>
|
49 |
<acl>
|
50 |
<resources>
|
51 |
+
<all>
|
52 |
+
<title>Allow Everything</title>
|
53 |
+
</all>
|
54 |
<admin>
|
55 |
<children>
|
56 |
+
<Dexxtz_Storemaintenance>
|
57 |
+
<title>Storemaintenance Module</title>
|
58 |
+
<sort_order>10</sort_order>
|
59 |
+
</Dexxtz_Storemaintenance>
|
60 |
<system>
|
61 |
<children>
|
62 |
<config>
|
63 |
<children>
|
64 |
+
<storemaintenance>
|
65 |
+
<title>Storemaintenance</title>
|
66 |
+
</storemaintenance>
|
|
|
67 |
</children>
|
68 |
</config>
|
69 |
</children>
|
82 |
</modules>
|
83 |
</translate>
|
84 |
</adminhtml>
|
85 |
+
<global>
|
86 |
+
<models>
|
87 |
+
<storemaintenance>
|
88 |
+
<class>Dexxtz_Storemaintenance_Model</class>
|
89 |
+
</storemaintenance>
|
90 |
+
</models>
|
91 |
<resources>
|
92 |
<dexxtz_storemaintenance_setup>
|
93 |
<setup>
|
99 |
</dexxtz_storemaintenance_setup>
|
100 |
</resources>
|
101 |
<blocks>
|
102 |
+
<storemaintenance>
|
103 |
<class>Dexxtz_Storemaintenance_Block</class>
|
104 |
+
</storemaintenance>
|
105 |
</blocks>
|
|
|
|
|
|
|
|
|
|
|
106 |
<helpers>
|
107 |
<storemaintenance>
|
108 |
<class>Dexxtz_Storemaintenance_Helper</class>
|
113 |
<observers>
|
114 |
<storemaintenance>
|
115 |
<type>singleton</type>
|
116 |
+
<class>storemaintenance/observer</class>
|
117 |
<method>initControllerStoremaintenance</method>
|
118 |
</storemaintenance>
|
119 |
</observers>
|
app/code/community/Dexxtz/Storemaintenance/etc/system.xml
CHANGED
@@ -65,7 +65,7 @@
|
|
65 |
<label>Select the static block</label>
|
66 |
<comment>It is the maintenance page to be displayed</comment>
|
67 |
<frontend_type>select</frontend_type>
|
68 |
-
<source_model>
|
69 |
<sort_order>40</sort_order>
|
70 |
<show_in_default>1</show_in_default>
|
71 |
<show_in_website>0</show_in_website>
|
@@ -85,7 +85,7 @@
|
|
85 |
<label>End date to be accessed</label>
|
86 |
<comment>m/d/Y - After the date the frontend can be viewed</comment>
|
87 |
<frontend_type>text</frontend_type>
|
88 |
-
<frontend_model>
|
89 |
<sort_order>60</sort_order>
|
90 |
<show_in_default>1</show_in_default>
|
91 |
<show_in_website>1</show_in_website>
|
@@ -95,7 +95,7 @@
|
|
95 |
<ip_current translate="label">
|
96 |
<label>Your current IP is</label>
|
97 |
<frontend_type>label</frontend_type>
|
98 |
-
<frontend_model>
|
99 |
<sort_order>70</sort_order>
|
100 |
<show_in_default>1</show_in_default>
|
101 |
<show_in_website>1</show_in_website>
|
@@ -104,7 +104,7 @@
|
|
104 |
<ip_grid translate="label">
|
105 |
<label>IP Adresses</label>
|
106 |
<comment>IP addresses allowed pair to access the frontend</comment>
|
107 |
-
<frontend_model>
|
108 |
<backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
|
109 |
<sort_order>80</sort_order>
|
110 |
<show_in_default>1</show_in_default>
|
65 |
<label>Select the static block</label>
|
66 |
<comment>It is the maintenance page to be displayed</comment>
|
67 |
<frontend_type>select</frontend_type>
|
68 |
+
<source_model>storemaintenance/blockstatic</source_model>
|
69 |
<sort_order>40</sort_order>
|
70 |
<show_in_default>1</show_in_default>
|
71 |
<show_in_website>0</show_in_website>
|
85 |
<label>End date to be accessed</label>
|
86 |
<comment>m/d/Y - After the date the frontend can be viewed</comment>
|
87 |
<frontend_type>text</frontend_type>
|
88 |
+
<frontend_model>storemaintenance/enddate</frontend_model>
|
89 |
<sort_order>60</sort_order>
|
90 |
<show_in_default>1</show_in_default>
|
91 |
<show_in_website>1</show_in_website>
|
95 |
<ip_current translate="label">
|
96 |
<label>Your current IP is</label>
|
97 |
<frontend_type>label</frontend_type>
|
98 |
+
<frontend_model>storemaintenance/ip</frontend_model>
|
99 |
<sort_order>70</sort_order>
|
100 |
<show_in_default>1</show_in_default>
|
101 |
<show_in_website>1</show_in_website>
|
104 |
<ip_grid translate="label">
|
105 |
<label>IP Adresses</label>
|
106 |
<comment>IP addresses allowed pair to access the frontend</comment>
|
107 |
+
<frontend_model>storemaintenance/ipgrid</frontend_model>
|
108 |
<backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
|
109 |
<sort_order>80</sort_order>
|
110 |
<show_in_default>1</show_in_default>
|
app/design/frontend/base/default/template/dexxtz/{storemaintenance/maintenance.phtml → store_maintenance.phtml}
RENAMED
@@ -28,9 +28,10 @@ $css = Mage::getStoreConfig('storemaintenance/dexxtz/css');
|
|
28 |
</head>
|
29 |
<body>
|
30 |
<?php
|
31 |
-
|
32 |
$blockStatic = Mage::getStoreConfig('storemaintenance/dexxtz/block_static');
|
33 |
-
|
|
|
34 |
echo Mage::getSingleton('core/layout')->createBlock('cms/block')->setBlockId($blockStatic)->toHtml() . "\n";
|
35 |
?>
|
36 |
</body>
|
28 |
</head>
|
29 |
<body>
|
30 |
<?php
|
31 |
+
// capturing the identification of the selected static block
|
32 |
$blockStatic = Mage::getStoreConfig('storemaintenance/dexxtz/block_static');
|
33 |
+
|
34 |
+
//displays the contents of the static block
|
35 |
echo Mage::getSingleton('core/layout')->createBlock('cms/block')->setBlockId($blockStatic)->toHtml() . "\n";
|
36 |
?>
|
37 |
</body>
|
app/locale/en_US/Dexxtz_Storemaintenance.csv
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
"Store Maintenance","Store Maintenance"
|
2 |
-
"Maintenance settings","Maintenance settings"
|
3 |
-
"Enabled","Enabled"
|
4 |
-
"Enables or disables the maintenance page","Enables or disables the maintenance page"
|
5 |
-
"Title of page","Title of page"
|
6 |
-
"Will be added to the html title tag","Will be added to the html title tag"
|
7 |
-
"CSS","CSS"
|
8 |
-
"Example: css/styles.css","Example: css/styles.css"
|
9 |
-
"Store Maintenance","Store Maintenance"
|
10 |
-
"Select the static block","Select the static block"
|
11 |
-
"It is the maintenance page to be displayed","It is the maintenance page to be displayed"
|
12 |
-
"Please select one static block ...","Please select one static block ..."
|
13 |
-
"Administrator can view frontend","Administrator can view frontend"
|
14 |
-
"Only logged administrators, can they have access","Only logged administrators, can they have access"
|
15 |
-
"End date to be accessed","End date to be accessed"
|
16 |
-
"m/d/Y - After the date the frontend can be viewed","m/d/Y - After the date the frontend can be viewed"
|
17 |
-
"Your current IP is","Your current IP is"
|
18 |
-
"IP Adresses","IP Adresses"
|
19 |
-
"IP addresses allowed pair to access the frontend","IP addresses allowed pair to access the frontend"
|
20 |
-
"add IP","add IP"
|
21 |
-
"Enable log of attempt of access","Enable log of attempt of access"
|
22 |
-
"Saves the ip, date and page attempt of access in log","Saves the ip, date and page attempt of access in log"
|
23 |
-
"Name and extension of log","Name and extension of log"
|
24 |
-
"Example: log.txt to root or var/log/maintenance.txt","Example: log.txt to root or var/log/maintenance.txt"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Dexxtz_Store_maintenance</name>
|
4 |
-
<version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/apachepl.php">Apache Software License</license>
|
7 |
<channel>community</channel>
|
@@ -22,9 +22,9 @@ O módulo permite escolher um bloco estático como página de manute
|
|
22 |
A página de manutenção segue a estrutura básica de SEO - Sistema/Configurações/Visual/Cabeçalho HTML</description>
|
23 |
<notes>Started</notes>
|
24 |
<authors><author><name>Décio Mattos</name><user>auto-converted</user><email>dexxtz@gmail.com</email></author></authors>
|
25 |
-
<date>
|
26 |
-
<time>12:
|
27 |
-
<contents><target name="magecommunity"><dir name="Dexxtz"><dir name="Storemaintenance"><dir name="Block"><
|
28 |
<compatible/>
|
29 |
<dependencies/>
|
30 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Dexxtz_Store_maintenance</name>
|
4 |
+
<version>2.0.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/apachepl.php">Apache Software License</license>
|
7 |
<channel>community</channel>
|
22 |
A página de manutenção segue a estrutura básica de SEO - Sistema/Configurações/Visual/Cabeçalho HTML</description>
|
23 |
<notes>Started</notes>
|
24 |
<authors><author><name>Décio Mattos</name><user>auto-converted</user><email>dexxtz@gmail.com</email></author></authors>
|
25 |
+
<date>2015-02-15</date>
|
26 |
+
<time>13:12:12</time>
|
27 |
+
<contents><target name="magecommunity"><dir name="Dexxtz"><dir name="Storemaintenance"><dir name="Block"><file name="Enddate.php" hash="60bd71dace9bfa6cdd14f09e88f72634"/><file name="Ip.php" hash="818c18d5fa9c6526a46d699f1b1a89e9"/><file name="Ipgrid.php" hash="0f29268d966d16d6e749d8a0a1c2fa51"/></dir><dir name="Helper"><file name="Data.php" hash="ff90181c672edbcbf79f6adbcef70422"/></dir><dir name="Model"><file name="Blockstatic.php" hash="351a05ac0c594f04a6e75d3e6c646dab"/><file name="Observer.php" hash="cf718b26a3bfae1a032b22ba8c8f080d"/></dir><dir name="etc"><file name="config.xml" hash="182c0c86a4d31456b282e6718df54d48"/><file name="system.xml" hash="6541b4aedfd5263928ecc45dd02765f4"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Dexxtz_Storemaintenance.xml" hash="deba2af2c0241c2500b48bc810909d35"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="dexxtz"><file name="store_maintenance.phtml" hash="f3fe4d88bdd1410e27d21a46690ac043"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="pt_BR"><file name="Dexxtz_Storemaintenance.csv" hash="df613bf2246c3626ee2c128bc721cc70"/></dir></target></contents>
|
28 |
<compatible/>
|
29 |
<dependencies/>
|
30 |
</package>
|