Attached Files |
maintenance_mode_65.patch [^] (10,701 bytes) 2011-12-12 04:34
[Show Content]
Index: admin_templates/login.tpl
===================================================================
--- admin_templates/login.tpl (revision 14858)
+++ admin_templates/login.tpl (working copy)
@@ -123,6 +123,14 @@
</div>
<div id="form" align="center">
+
+ <inp2:m_if check="m_GetConfig" name="MaintenanceModeEnabled">
+ <inp2:m_Phrase label="la_SiteIsInMaintenanceMode"/><br/>
+ <inp2:m_GetConfig name="MaintenanceModeSystemMessage"/><br/>
+ <br/>
+ </inp2:m_if>
+
+ <inp2:m_ifnot check="m_IsMaintenanceActual">
<inp2:m_if check="m_Param" name="http_auth">
<inp2:u.login-admin_FormName name="login"/>
@@ -171,6 +179,7 @@
<inp2:m_else/>
<h1 style="color: red;">401 Authentication Required</h1>
</inp2:m_if>
+ </inp2:m_ifnot>
</div>
</div>
Index: install/english.lang
===================================================================
--- install/english.lang (revision 14858)
+++ install/english.lang (working copy)
@@ -168,6 +168,10 @@
<PHRASE Label="la_config_MailFunctionHeaderSeparator" Module="Core" Type="1">TWFpbCBGdW5jdGlvbiBIZWFkZXIgU2VwYXJhdG9y</PHRASE>
<PHRASE Label="la_config_MailingListQueuePerStep" Module="Core" Type="1">TWFpbGluZyBMaXN0IFF1ZXVlIFBlciBTdGVw</PHRASE>
<PHRASE Label="la_config_MailingListSendPerStep" Module="Core" Type="1">TWFpbGluZyBMaXN0IFNlbmQgUGVyIFN0ZXA=</PHRASE>
+ <PHRASE Label="la_config_MaintenanceModeEnabled" Module="Core" Type="1">RW5hYmxlIE1haW50ZW5hbmNlIE1vZGU=</PHRASE>
+ <PHRASE Label="la_config_MaintenanceModeExceptions" Module="Core" Type="1">RXhjZXB0aW9ucw==</PHRASE>
+ <PHRASE Label="la_config_MaintenanceModeSystemMessage" Module="Core" Type="1">U3lzdGVtIE1lc3NhZ2U=</PHRASE>
+ <PHRASE Label="la_config_MaintenanceModeTemplate" Module="Core" Type="1">VGVtcGxhdGU=</PHRASE>
<PHRASE Label="la_config_MaxImageCount" Module="Core" Type="1">TWF4aW11bSBudW1iZXIgb2YgaW1hZ2Vz</PHRASE>
<PHRASE Label="la_config_ModRewriteUrlEnding" Module="Core" Type="1">RGVmYXVsdCBVUkwgRW5kaW5nIGluIFNFTy1mcmllbmRseSBtb2Rl</PHRASE>
<PHRASE Label="la_config_nopermission_template" Module="Core" Type="1">VGVtcGxhdGUgZm9yICJJbnN1ZmZpY2llbnQgUGVybWlzc2lvbnMiIEVycm9y</PHRASE>
@@ -656,6 +660,9 @@
<PHRASE Label="la_hint_ExportPhrases" Module="Core" Type="1">U2luZ2xlIFBocmFzZSBMYWJlbCBwZXIgbGluZSAoZm9ybWF0czogbGFfU2FtcGxlTGFiZWwsIGx1X0Zyb250RW5kTGFiZWwp</PHRASE>
<PHRASE Label="la_hint_ForceModRewriteUrlEnding" Module="Core" Type="1">VXNlciB3aWxsIGJlIGF1dG9tYXRpY2FsbHkgcmVkaXJlY3RlZCB0byB0aGUgc2VsZWN0ZWQgVXJsIEVuZGluZyBpbiBjYXNlIHdoZW4gY3VycmVudCBwYWdlIHVybCBoYXMgYSBkaWZmZXJlbnQgZW5kaW5n</PHRASE>
<PHRASE Label="la_hint_ImageFiles" Module="Core" Type="1">SW1hZ2UgRmlsZXM=</PHRASE>
+ <PHRASE Label="la_hint_MaintenanceModeExceptions" Module="Core" Type="1">SVBzIHNlcGFyYXRlZCB3aXRoIHNlbWktY29sdW1uIDs=</PHRASE>
+ <PHRASE Label="la_hint_MaintenanceModeSystemMessage" Module="Core" Type="1">dG8gYmUgZGlzcGxheWVkIG9uIEFkbWluIExvZ2luIHNjcmVlbg==</PHRASE>
+ <PHRASE Label="la_hint_MaintenanceModeTemplate" Module="Core" Type="1">dG8gYmUgc2hvd24gb24gRnJvbnQgRW5kLCBpZS4gbm9fcGVybWlzc2lvbg==</PHRASE>
<PHRASE Label="la_hint_PageExpiration" Module="Core" Type="1">SG93IHNvb24gKGluIHNlY29uZHMpIHRoZSBzZWN0aW9uIGNhY2hlIHNob3VsZCBhdXRvLWV4cGlyZSBhZnRlciBpdCdzIGNyZWF0aW9uLiBCeSBkZWZhdWx0IHN5c3RlbSB0ZW5kcyB0byByZWJ1aWxkIHRoZSBjYWNoZSBvbmx5IHdoZW4gaXQncyBwcm9wZXJ0aWVzIG9yIGVsZW1lbnRzIGhhdmUgY2hhbmdlZC4=</PHRASE>
<PHRASE Label="la_hint_PerformExactSearch" Module="Core" Type="1">U2VhcmNoIGZvciBhbGwgZW50ZXJlZCBrZXl3b3JkcywgaW5zdGVhZCBvZiBhbnkgb25lIG9mIHRoZW0=</PHRASE>
<PHRASE Label="la_hint_PopPort" Module="Core" Type="1">UE9QMyBTZXJ2ZXIgUG9ydC4gRm9yIGV4LiAiMTEwIiBmb3IgcmVndWxhciBjb25uZWN0aW9uLCAiOTk1IiBmb3Igc2VjdXJlIGNvbm5lY3Rpb24u</PHRASE>
@@ -1082,6 +1089,7 @@
<PHRASE Label="la_ShortToolTip_SynchronizeLanguages" Module="Core" Type="1">U3luY2hyb25pemU=</PHRASE>
<PHRASE Label="la_ShortToolTip_View" Module="Core" Type="1">Vmlldw==</PHRASE>
<PHRASE Label="la_Show" Module="Core" Type="1">U2hvdw==</PHRASE>
+ <PHRASE Label="la_SiteIsInMaintenanceMode" Module="Core" Type="1">U2l0ZSBpcyBpbiAiTWFpbnRlbmFuY2UgTW9kZSI=</PHRASE>
<PHRASE Label="la_SQLAffectedRows" Module="Core" Type="1">QWZmZWN0ZWQgcm93cw==</PHRASE>
<PHRASE Label="la_SQLRuntime" Module="Core" Type="1">RXhlY3V0ZWQgaW46</PHRASE>
<PHRASE Label="la_step" Module="Core" Type="1">U3RlcA==</PHRASE>
Index: install/install_data.sql
===================================================================
--- install/install_data.sql (revision 14858)
+++ install/install_data.sql (working copy)
@@ -137,6 +137,12 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CategoriesRebuildSerial', '0', 'In-Portal', '', '', '', '', NULL, NULL, 0, 0, 0, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceModeEnabled', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_MaintenanceMode', 'la_config_MaintenanceModeEnabled', 'checkbox', NULL, NULL, 80.01, 0, 1, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceModeExceptions', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_MaintenanceMode', 'la_config_MaintenanceModeExceptions', 'textarea', NULL, 'COLS=40 ROWS=5', 80.02, 0, 1, 'la_hint_MaintenanceModeExceptions');
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceModeTemplate', 'maintenance_template', 'In-Portal', 'in-portal:configure_advanced', 'la_section_MaintenanceMode', 'la_config_MaintenanceModeTemplate', 'text', '', '', 80.03, 0, 1, 'la_hint_MaintenanceModeTemplate');
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceModeSystemMessage', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_MaintenanceMode', 'la_config_MaintenanceModeSystemMessage', 'textarea', NULL, 'COLS=40 ROWS=5', 80.04, 0, 1, 'la_hint_MaintenanceModeSystemMessage');
+
+
INSERT INTO ItemTypes VALUES (1, 'In-Portal', 'c', 'Category', 'Name', 'CreatedById', NULL, NULL, 'la_ItemTab_Categories', 1, 'admin/category/addcategory.php', 'clsCategory', 'Category');
INSERT INTO ItemTypes VALUES (6, 'In-Portal', 'u', 'PortalUser', 'Username', 'PortalUserId', NULL, NULL, '', 0, '', 'clsPortalUser', 'User');
Index: install/upgrades.sql
===================================================================
--- install/upgrades.sql (revision 14858)
+++ install/upgrades.sql (working copy)
@@ -2377,4 +2377,9 @@
INSERT INTO Permissions VALUES(DEFAULT, 'CATEGORY.REVISION.ADD', 11, 1, 0, 1);
INSERT INTO Permissions VALUES(DEFAULT, 'CATEGORY.REVISION.HISTORY.VIEW', 11, 1, 0, 1);
-INSERT INTO Permissions VALUES(DEFAULT, 'CATEGORY.REVISION.HISTORY.RESTORE', 11, 1, 0, 1);
\ No newline at end of file
+INSERT INTO Permissions VALUES(DEFAULT, 'CATEGORY.REVISION.HISTORY.RESTORE', 11, 1, 0, 1);
+
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceModeEnabled', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_MaintenanceMode', 'la_config_MaintenanceModeEnabled', 'checkbox', NULL, NULL, 80.01, 0, 1, NULL);
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceModeExceptions', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_MaintenanceMode', 'la_config_MaintenanceModeExceptions', 'textarea', NULL, 'COLS=40 ROWS=5', 80.02, 0, 1, 'la_hint_MaintenanceModeExceptions');
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceModeTemplate', 'maintenance_template', 'In-Portal', 'in-portal:configure_advanced', 'la_section_MaintenanceMode', 'la_config_MaintenanceModeTemplate', 'text', '', '', 80.03, 0, 1, 'la_hint_MaintenanceModeTemplate');
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceModeSystemMessage', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_MaintenanceMode', 'la_config_MaintenanceModeSystemMessage', 'textarea', NULL, 'COLS=40 ROWS=5', 80.04, 0, 1, 'la_hint_MaintenanceModeSystemMessage');
Index: kernel/application.php
===================================================================
--- kernel/application.php (revision 14858)
+++ kernel/application.php (working copy)
@@ -970,8 +970,16 @@
$this->EventManager->ProcessRequest();
$this->InitParser();
+
$t = $this->GetVar('render_template', $this->GetVar('t'));
+ if ( $this->IsMaintenanceActual() ) {
+ $maintenance_mode_template = $this->isAdmin ? 'login' : $this->ConfigValue('MaintenanceModeTemplate');
+ if ( $t != $maintenance_mode_template ) {
+ $this->Redirect($maintenance_mode_template);
+ }
+ }
+
if ( !$this->TemplatesCache->TemplateExists($t) && !$this->isAdmin ) {
$cms_handler =& $this->recallObject('st_EventHandler');
/* @var $cms_handler CategoriesEventHandler */
@@ -997,6 +1005,22 @@
}
}
+ /**
+ * Checks if Maintenance Mode is Enabled and is Actual for current IP
+ *
+ * @return bool
+ * @access public
+ */
+
+ public function IsMaintenanceActual()
+ {
+ if ( !$this->ConfigValue('MaintenanceModeEnabled') ) {
+ return 0;
+ }
+
+ return kUtil::ipMatch( $this->ConfigValue('MaintenanceModeExceptions') ) ? 0 : 1;
+ }
+
function InitParser($theme_name = false)
{
if( !is_object($this->Parser) ) {
Index: kernel/processors/main_processor.php
===================================================================
--- kernel/processors/main_processor.php (revision 14858)
+++ kernel/processors/main_processor.php (working copy)
@@ -1248,4 +1248,17 @@
return $_SERVER['REQUEST_URI'];
}
+
+ /**
+ * Checks if Maintenance Mode is Enabled and is Actual for current IP
+ *
+ * @param Array $params
+ * @return bool
+ * @access protected
+ */
+ protected function IsMaintenanceActual($params)
+ {
+ return $this->Application->IsMaintenanceActual();
+ }
+
}
Index: units/configuration/configuration_event_handler.php
===================================================================
--- units/configuration/configuration_event_handler.php (revision 14858)
+++ units/configuration/configuration_event_handler.php (working copy)
@@ -172,6 +172,12 @@
if ( $object->GetDBField('VariableValue') != $object->GetOriginalField('VariableValue') ) {
$changed[] = $variable_name;
$this->Application->SetVar($event->getPrefixSpecial() . '_changed', $changed);
+
+ if ( ($object->GetDBField('VariableValue') == 1) && $object->GetDBField('VariableName') == 'MaintenanceModeEnabled' ) {
+ // destroy all sessions, except current (current will be restored in Application::Done)
+ $sql = 'UPDATE '.TABLE_PREFIX.'UserSession SET LastAccessed = 0';
+ $this->Conn->Query($sql);
+ }
}
if ( $variable_name == 'Require_AdminSSL' || $variable_name == 'AdminSSL_URL' ) {
maintenance_mode_core_v2.patch [^] (28,020 bytes) 2011-12-28 12:03
[Show Content]
Index: core/admin_templates/config/custom_variables.tpl
===================================================================
--- core/admin_templates/config/custom_variables.tpl (revision 14917)
+++ core/admin_templates/config/custom_variables.tpl (working copy)
@@ -82,3 +82,21 @@
<inp2:m_DefineElement name="cf_MaxUserName_value">
- <inp2:m_RenderElement name="cf_default_value" pass_params="1"/>
</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="cf_HardMaintenanceTemplate_value">
+ <inp2:m_RenderElement name="cf_default_value" pass_params="1"/>
+
+ <input type="button" class="button" id="generate-maintenance-template" value="<inp2:m_Phrase name='la_btn_GeneratePage' html_escape='1'/>"/>
+
+ <script type="text/javascript">
+ $(document).ready(
+ function () {
+ $('#generate-maintenance-template').click(
+ function ($e) {
+ submit_event('conf', 'OnGenerateMaintenancePage');
+ }
+ );
+ }
+ );
+ </script>
+</inp2:m_DefineElement>
\ No newline at end of file
Index: core/admin_templates/login.tpl
===================================================================
--- core/admin_templates/login.tpl (revision 14917)
+++ core/admin_templates/login.tpl (working copy)
@@ -126,33 +126,37 @@
<inp2:m_if check="m_Param" name="http_auth">
<inp2:u.login-admin_FormName name="login"/>
- <table class="login-table">
- <tr>
- <td colspan="2" style="text-align: center">
- <inp2:m_if check="u.login-admin_HasError" field="any">
- <span class="error-cell"><inp2:u.login-admin_Error field="UserLogin"/></span>
- </inp2:m_if><br/>
- </td>
- </tr>
- <tr>
- <td class="text"><inp2:m_phrase name="la_fld_EmailOrUsername"/>:</td>
- <td><input type="text" name="<inp2:u.login-admin_InputName name='UserLogin'/>" class="text" value="<inp2:u.login-admin_CookieUsername field='UserLogin'/>" style="width: 150px;"></td>
- </tr>
- <tr>
- <td class="text"><inp2:m_phrase name="la_fld_Password"/>:</td>
- <td><input type="password" name="<inp2:u.login-admin_InputName name='UserPassword'/>" class="text" style="width: 150px;"></td>
- </tr>
- <tr>
- <td colspan="2">
- <input type="checkbox" id="save_username" name="cb_save_username"<inp2:m_if check="m_GetEquals" name="save_username" value="" inverse="inverse"> checked="checked"</inp2:m_if>/>
- <label for="save_username"><inp2:m_Phrase label="la_SaveLogin"/></label>
- </td>
- </tr>
- <tr>
- <td colspan="2" align="center" style="padding: 5px 15px 10px 15px;">
- <input type="submit" name="login_button" value="<inp2:m_phrase name='la_Login' no_editing='1'/>" class="kx-login-button roundbutton"></td>
- </tr>
- </table>
+ <inp2:m_if check="m_MaintenanceMode">
+ <inp2:m_GetConfig name="MaintenanceMessageAdmin"/>
+ <inp2:m_else/>
+ <table class="login-table">
+ <tr>
+ <td colspan="2" style="text-align: center">
+ <inp2:m_if check="u.login-admin_HasError" field="any">
+ <span class="error-cell"><inp2:u.login-admin_Error field="UserLogin"/></span>
+ </inp2:m_if><br/>
+ </td>
+ </tr>
+ <tr>
+ <td class="text"><inp2:m_phrase name="la_fld_EmailOrUsername"/>:</td>
+ <td><input type="text" name="<inp2:u.login-admin_InputName name='UserLogin'/>" class="text" value="<inp2:u.login-admin_CookieUsername field='UserLogin'/>" style="width: 150px;"></td>
+ </tr>
+ <tr>
+ <td class="text"><inp2:m_phrase name="la_fld_Password"/>:</td>
+ <td><input type="password" name="<inp2:u.login-admin_InputName name='UserPassword'/>" class="text" style="width: 150px;"></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <input type="checkbox" id="save_username" name="cb_save_username"<inp2:m_if check="m_GetEquals" name="save_username" value="" inverse="inverse"> checked="checked"</inp2:m_if>/>
+ <label for="save_username"><inp2:m_Phrase label="la_SaveLogin"/></label>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" align="center" style="padding: 5px 15px 10px 15px;">
+ <input type="submit" name="login_button" value="<inp2:m_phrase name='la_Login' no_editing='1'/>" class="kx-login-button roundbutton"></td>
+ </tr>
+ </table>
+ </inp2:m_if>
<inp2:m_if check="m_GetConst" name="DBG_RESET_ROOT">
<inp2:m_if check="m_Get" var="reset">
Index: core/install/english.lang
===================================================================
--- core/install/english.lang (revision 14929)
+++ core/install/english.lang (working copy)
@@ -33,6 +33,7 @@
<PHRASE Label="la_btn_EditContent" Module="Core" Type="1">RWRpdCBDb250ZW50</PHRASE>
<PHRASE Label="la_btn_EditDesign" Module="Core" Type="1">RWRpdCBEZXNpZ24=</PHRASE>
<PHRASE Label="la_btn_Generate" Module="Core" Type="1">R2VuZXJhdGU=</PHRASE>
+ <PHRASE Label="la_btn_GeneratePage" Module="Core" Type="1">R2VuZXJhdGUgUGFnZQ==</PHRASE>
<PHRASE Label="la_btn_GetValue" Module="Core" Type="1">R2V0IFZhbHVl</PHRASE>
<PHRASE Label="la_btn_Locate" Module="Core" Type="1">TG9jYXRl</PHRASE>
<PHRASE Label="la_btn_MoveDown" Module="Core" Type="1">TW92ZSBEb3du</PHRASE>
@@ -162,6 +163,7 @@
<PHRASE Label="la_config_force_http" Module="Core" Type="1">UmVkaXJlY3QgdG8gSFRUUCB3aGVuIFNTTCBpcyBub3QgcmVxdWlyZWQ=</PHRASE>
<PHRASE Label="la_config_FullImageHeight" Module="Core" Type="1">RnVsbCBpbWFnZSBIZWlnaHQ=</PHRASE>
<PHRASE Label="la_config_FullImageWidth" Module="Core" Type="1">RnVsbCBpbWFnZSBXaWR0aA==</PHRASE>
+ <PHRASE Label="la_config_HardMaintenanceTemplate" Module="Core" Type="1" Hint="VGhpcyB0ZW1wbGF0ZSB3aWxsIGJlIHVzZWQgdG8gc3RhdGljIEhUTUwgZmlsZSB1bmRlciAvc3lzdGVtIGZvbGRlciB0byBiZSBzaG93biBvbiBGcm9udC1lbmQgb3IgQWRtaW4gd2hlbiBIYXJkIE1haW50ZW5hbmNlIG1vZGUgaXMgYWN0aXZlLiBTdGF0aWMgcGFnZSBzaG91bGQgYmUgZ2VuZXJhdGVkIGZyb20gc3BlY2lmaWVkIGhlcmUgdGVtcGxhdGUgYnkgY2xpY2tpbmcgIkdlbmVyYXRlIFBhZ2UiIGJ1dHRvbi4=">VGVtcGxhdGUgZm9yIEhhcmQgTWFpbnRlbmFuY2U=</PHRASE>
<PHRASE Label="la_config_HTTPAuthBypassIPs" Module="Core" Type="1">QnlwYXNzIEhUVFAgQXV0aGVudGljYXRpb24gZnJvbSBJUHMgKHNlcGFyYXRlZCBieSBzZW1pY29sb25zKQ==</PHRASE>
<PHRASE Label="la_config_HTTPAuthPassword" Module="Core" Type="1">UGFzc3dvcmQgZm9yIEhUVFAgQXV0aGVudGljYXRpb24=</PHRASE>
<PHRASE Label="la_config_HTTPAuthUsername" Module="Core" Type="1">VXNlcm5hbWUgZm9yIEhUVFAgQXV0aGVudGljYXRpb24=</PHRASE>
@@ -169,6 +171,8 @@
<PHRASE Label="la_config_MailFunctionHeaderSeparator" Module="Core" Type="1">TWFpbCBGdW5jdGlvbiBIZWFkZXIgU2VwYXJhdG9y</PHRASE>
<PHRASE Label="la_config_MailingListQueuePerStep" Module="Core" Type="1">TWFpbGluZyBMaXN0IFF1ZXVlIFBlciBTdGVw</PHRASE>
<PHRASE Label="la_config_MailingListSendPerStep" Module="Core" Type="1">TWFpbGluZyBMaXN0IFNlbmQgUGVyIFN0ZXA=</PHRASE>
+ <PHRASE Label="la_config_MaintenanceMessageAdmin" Module="Core" Type="1" Hint="VGhpcyBtZXNzYWdlIHdpbGwgYmUgc2hvd24gb24gQWRtaW4gaW5zdGVhZCBvZiBMb2dpbiBmb3JtIGVpdGhlciB3aGVuIFNvZnQgb3IgSGFyZCBNYWludGVuYW5jZSBtb2RlcyBhcmUgZW5hYmxlZCB2aWEgZGVidWcucGhwIGZpbGUgb3IgdGhlcmUgbm8gRGF0YWJhc2UgY29ubmVjdGlvbi4=">TWFpbnRlbmFuY2UgTWVzc2FnZSBmb3IgQWRtaW4=</PHRASE>
+ <PHRASE Label="la_config_MaintenanceMessageFront" Module="Core" Type="1" Hint="VGhpcyBtZXNzYWdlIHdpbGwgYmUgc2hvd24gb24gRnJvbnQgRW5kIHdoZW4gZWl0aGVyIFNvZnQgb3IgSGFyZCBNYWludGVuYW5jZSBtb2RlcyBhcmUgZW5hYmxlZCB2aWEgZGVidWcucGhwIGZpbGUgb3IgdGhlcmUgbm8gRGF0YWJhc2UgY29ubmVjdGlvbi4=">TWFpbnRlbmFuY2UgTWVzc2FnZSBmb3IgRnJvbnQgRW5k</PHRASE>
<PHRASE Label="la_config_MaxImageCount" Module="Core" Type="1">TWF4aW11bSBudW1iZXIgb2YgaW1hZ2Vz</PHRASE>
<PHRASE Label="la_config_ModRewriteUrlEnding" Module="Core" Type="1">RGVmYXVsdCBVUkwgRW5kaW5nIGluIFNFTy1mcmllbmRseSBtb2Rl</PHRASE>
<PHRASE Label="la_config_nopermission_template" Module="Core" Type="1">VGVtcGxhdGUgZm9yICJJbnN1ZmZpY2llbnQgUGVybWlzc2lvbnMiIEVycm9y</PHRASE>
@@ -189,6 +193,7 @@
<PHRASE Label="la_config_SessionIPAddressCheck" Module="Core" Type="1">U2Vzc2lvbiBTZWN1cml0eSBDaGVjayBiYXNlZCBvbiBJUA==</PHRASE>
<PHRASE Label="la_config_SiteNameSubTitle" Module="Core" Type="1">V2Vic2l0ZSBTdWJ0aXRsZQ==</PHRASE>
<PHRASE Label="la_config_site_zone" Module="Core" Type="1">VGltZSB6b25lIG9mIHRoZSBzaXRl</PHRASE>
+ <PHRASE Label="la_config_SoftMaintenanceTemplate" Module="Core" Type="1" Hint="VGhpcyB0ZW1wbGF0ZSB3aWxsIGJlIHNob3duIHRvIHRoZSBGcm9udCBFbmQgdXNlcnMgd2hlbiBTb2Z0IE1haW50ZW5hbmNlIG1vZGUgaXMgYWN0aXZlLg==">VGVtcGxhdGUgZm9yIFNvZnQgTWFpbnRlbmFuY2U=</PHRASE>
<PHRASE Label="la_config_ssl_url" Module="Core" Type="1">U1NMIEZ1bGwgVVJMIChodHRwczovL3d3dy5kb21haW4uY29tL3BhdGgp</PHRASE>
<PHRASE Label="la_config_StickyGridSelection" Module="Core" Type="1">VXNlIFN0aWNreSBHcmlkIFNlbGVjdGlvbg==</PHRASE>
<PHRASE Label="la_config_ThumbnailImageHeight" Module="Core" Type="1">VGh1bWJuYWlsIEhlaWdodA==</PHRASE>
@@ -1038,6 +1043,7 @@
<PHRASE Label="la_section_SettingsAdmin" Module="Core" Type="1">QWRtaW4gQ29uc29sZSBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_section_SettingsCSVExport" Module="Core" Type="1">Q1NWIEV4cG9ydCBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_section_SettingsMailling" Module="Core" Type="1">TWFpbGluZyBTZXR0aW5ncw==</PHRASE>
+ <PHRASE Label="la_section_SettingsMaintenance" Module="Core" Type="1">TWFpbnRlbmFuY2UgU2V0dGluZ3M=</PHRASE>
<PHRASE Label="la_section_SettingsSession" Module="Core" Type="1">U2Vzc2lvbiBTZXR0aW5ncw==</PHRASE>
<PHRASE Label="la_section_SettingsSSL" Module="Core" Type="1">U1NMIFNldHRpbmdz</PHRASE>
<PHRASE Label="la_section_SettingsSystem" Module="Core" Type="1">U3lzdGVtIFNldHRpbmdz</PHRASE>
Index: core/install/install_data.sql
===================================================================
--- core/install/install_data.sql (revision 14929)
+++ core/install/install_data.sql (working copy)
@@ -42,6 +42,10 @@
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'UseVisitorTracking', '0', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_UseVisitorTracking', 'checkbox', '', '', 10.08, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'cms_DefaultTrackingCode', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_DefaultTrackingCode', 'textarea', NULL, 'COLS=40 ROWS=5', 10.09, 0, 0, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'PerformExactSearch', '1', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsWebsite', 'la_config_PerformExactSearch', 'checkbox', '', '', '10.10', 0, 0, 'hint:la_config_PerformExactSearch');
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceMessageFront', 'Website is currently undergoing the upgrades. Please come back shortly!', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_MaintenanceMessageFront', 'textarea', '', 'style="width: 100%; height: 100px;"', '15.01', 0, 0, 'hint:la_config_MaintenanceMessageFront');
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceMessageAdmin', 'Website is currently undergoing the upgrades. Please come back shortly!', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_MaintenanceMessageAdmin', 'textarea', '', 'style="width: 100%; height: 100px;"', '15.02', 0, 0, 'hint:la_config_MaintenanceMessageAdmin');
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SoftMaintenanceTemplate', 'maintenance', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_SoftMaintenanceTemplate', 'text', '', 'style="width: 200px;"', '15.03', 0, 0, 'hint:la_config_SoftMaintenanceTemplate');
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HardMaintenanceTemplate', 'maintenance', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_HardMaintenanceTemplate', 'text', '', 'style="width: 200px;"', '15.04', 0, 0, 'hint:la_config_HardMaintenanceTemplate');
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'CookieSessions', '2', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSession', 'la_prompt_session_management', 'select', NULL, '0=lu_opt_QueryString||1=lu_opt_Cookies||2=lu_opt_AutoDetect', 20.01, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SessionCookieName', 'sid', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSession', 'la_prompt_session_cookie_name', 'text', '', '', 20.02, 0, 1, NULL);
INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SessionCookieDomains', '', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsSession', 'la_config_SessionCookieDomains', 'textarea', '', 'rows="5" cols="40"', 20.021, 0, 0, NULL);
Index: core/install/upgrades.sql
===================================================================
--- core/install/upgrades.sql (revision 14929)
+++ core/install/upgrades.sql (working copy)
@@ -2473,3 +2473,8 @@
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-portal:promo_block_groups.delete', 11, 1, 1, 0);
+
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceMessageFront', 'Website is currently undergoing the upgrades. Please come back shortly!', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_MaintenanceMessageFront', 'textarea', '', 'style="width: 100%; height: 100px;"', '15.01', 0, 0, 'hint:la_config_MaintenanceMessageFront');
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'MaintenanceMessageAdmin', 'Website is currently undergoing the upgrades. Please come back shortly!', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_MaintenanceMessageAdmin', 'textarea', '', 'style="width: 100%; height: 100px;"', '15.02', 0, 0, 'hint:la_config_MaintenanceMessageAdmin');
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'SoftMaintenanceTemplate', 'maintenance', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_SoftMaintenanceTemplate', 'text', '', 'style="width: 200px;"', '15.03', 0, 0, 'hint:la_config_SoftMaintenanceTemplate');
+INSERT INTO ConfigurationValues VALUES(DEFAULT, 'HardMaintenanceTemplate', 'maintenance', 'In-Portal', 'in-portal:configure_advanced', 'la_section_SettingsMaintenance', 'la_config_HardMaintenanceTemplate', 'text', '', 'style="width: 200px;"', '15.04', 0, 0, 'hint:la_config_HardMaintenanceTemplate');
Index: core/kernel/application.php
===================================================================
--- core/kernel/application.php (revision 14921)
+++ core/kernel/application.php (working copy)
@@ -921,6 +921,21 @@
}
/**
+ * Performs redirect to hard maintenance template
+ *
+ * @access public
+ */
+ public function redirectToMaintenance()
+ {
+ $maintenance_page = WRITEBALE_BASE . '/maintenance.html';
+
+ if ( file_exists(FULL_PATH . $maintenance_page) ) {
+ header('Location: ' . BASE_PATH . $maintenance_page, true, 301);
+ exit;
+ }
+ }
+
+ /**
* Actually runs the parser against current template and stores parsing result
*
* This method gets t variable passed to the script, loads the template given in t variable and
@@ -930,6 +945,27 @@
*/
function Run()
{
+ // process maintenance mode redirect: begin
+ $maintenance_mode = $this->getMaintenanceMode();
+
+ if ( $maintenance_mode == MaintenanceMode::HARD ) {
+ $this->redirectToMaintenance();
+ }
+ elseif ( $maintenance_mode == MaintenanceMode::SOFT ) {
+ $maintenance_template = $this->isAdmin ? 'login' : $this->ConfigValue('SoftMaintenanceTemplate');
+
+ if ( $this->GetVar('t') != $maintenance_template ) {
+ $redirect_params = Array ('response_code' => 301);
+
+ if (!$this->isAdmin) {
+ $redirect_params['next_template'] = urlencode($_SERVER['REQUEST_URI']);
+ }
+
+ $this->Redirect($maintenance_template, $redirect_params);
+ }
+ }
+ // process maintenance mode redirect: end
+
if ( defined('DEBUG_MODE') && $this->isDebugMode() && kUtil::constOn('DBG_PROFILE_MEMORY') ) {
$this->Debugger->appendMemoryUsage('Application before Run:');
}
@@ -1016,19 +1052,19 @@
*/
function Done()
{
- $this->HandleEvent( new kEvent('adm:OnBeforeShutdown') );
+ $this->HandleEvent(new kEvent('adm:OnBeforeShutdown'));
$debug_mode = defined('DEBUG_MODE') && $this->isDebugMode();
- if ($debug_mode && kUtil::constOn('DBG_PROFILE_MEMORY')) {
+ if ( $debug_mode && kUtil::constOn('DBG_PROFILE_MEMORY') ) {
$this->Debugger->appendMemoryUsage('Application before Done:');
}
- if ($debug_mode) {
+ if ( $debug_mode ) {
$this->EventManager->runScheduledTasks(reAFTER);
$this->Session->SaveData();
- if (kUtil::constOn('DBG_CACHE')) {
+ if ( kUtil::constOn('DBG_CACHE') ) {
$this->cacheManager->printStatistics();
}
@@ -1041,10 +1077,10 @@
$this->HTML = ob_get_clean() . $this->HTML;
}
- if ($this->UseOutputCompression()) {
+ if ( $this->UseOutputCompression() ) {
$compression_level = $this->ConfigValue('OutputCompressionLevel');
- if (!$compression_level || $compression_level < 0 || $compression_level > 9) {
+ if ( !$compression_level || $compression_level < 0 || $compression_level > 9 ) {
$compression_level = 7;
}
@@ -1058,12 +1094,12 @@
$this->cacheManager->UpdateApplicationCache();
flush();
- if (!$debug_mode) {
+ if ( !$debug_mode ) {
$this->EventManager->runScheduledTasks(reAFTER);
$this->Session->SaveData();
}
- if (defined('DBG_CAPTURE_STATISTICS') && DBG_CAPTURE_STATISTICS && !$this->isAdmin) {
+ if ( defined('DBG_CAPTURE_STATISTICS') && DBG_CAPTURE_STATISTICS && !$this->isAdmin ) {
$this->_storeStatistics();
}
}
@@ -1720,9 +1756,18 @@
return $this->cacheManager->ConfigValue($name);
}
- function SetConfigValue($name, $value)
+ /**
+ * Changes value of individual configuration variable (+resets cache, when needed)
+ *
+ * @param string $name
+ * @param string $value
+ * @param bool $local_cache_only
+ * @return string
+ * @access public
+ */
+ public function SetConfigValue($name, $value, $local_cache_only = false)
{
- return $this->cacheManager->SetConfigValue($name, $value);
+ return $this->cacheManager->SetConfigValue($name, $value, $local_cache_only);
}
/**
@@ -2795,4 +2840,27 @@
{
$this->cacheManager->delayUnitProcessing($method, $params);
}
+
+ /**
+ * Returns current maintenance mode state
+ *
+ * @param bool $check_ips
+ * @return int
+ * @access public
+ */
+ public function getMaintenanceMode($check_ips = true)
+ {
+ $exception_ips = defined('MAINTENANCE_MODE_IPS') ? MAINTENANCE_MODE_IPS : '';
+ $setting_name = $this->isAdmin ? 'MAINTENANCE_MODE_ADMIN' : 'MAINTENANCE_MODE_FRONT';
+
+ if ( defined($setting_name) && constant($setting_name) > MaintenanceMode::NONE ) {
+ $exception_ip = $check_ips ? kUtil::ipMatch($exception_ips) : false;
+
+ if ( !$exception_ip ) {
+ return constant($setting_name);
+ }
+ }
+
+ return MaintenanceMode::NONE;
+ }
}
\ No newline at end of file
Index: core/kernel/db/db_connection.php
===================================================================
--- core/kernel/db/db_connection.php (revision 14917)
+++ core/kernel/db/db_connection.php (working copy)
@@ -303,6 +303,8 @@
trigger_error($error_msg, E_USER_WARNING);
}
else {
+ $this->Application->redirectToMaintenance();
+
throw new Exception($error_msg);
}
Index: core/kernel/db/db_load_balancer.php
===================================================================
--- core/kernel/db/db_load_balancer.php (revision 14917)
+++ core/kernel/db/db_load_balancer.php (working copy)
@@ -430,7 +430,7 @@
else {
$server = $this->servers[$i];
$server['serverIndex'] = $i;
- $conn =& $this->reallyOpenConnection($server);
+ $conn =& $this->reallyOpenConnection($server, $i == $this->getMasterIndex());
if ( $conn->connectionOpened ) {
$this->connections[$i] =& $conn;
@@ -454,15 +454,16 @@
* Returns a database object whether or not the connection was successful.
*
* @param Array $server
+ * @param bool $is_master
* @return kDBConnection
*/
- protected function &reallyOpenConnection($server)
+ protected function &reallyOpenConnection($server, $is_master)
{
$db =& $this->Application->makeClass( 'kDBConnection', Array ($this->dbType, $this->errorHandler, $server['serverIndex']) );
/* @var $db kDBConnection */
$db->debugMode = $this->Application->isDebugMode();
- $db->Connect($server['DBHost'], $server['DBUser'], $server['DBUserPassword'], $this->servers[0]['DBName'], true, true);
+ $db->Connect($server['DBHost'], $server['DBUser'], $server['DBUserPassword'], $this->servers[0]['DBName'], true, !$is_master);
return $db;
}
Index: core/kernel/managers/cache_manager.php
===================================================================
--- core/kernel/managers/cache_manager.php (revision 14917)
+++ core/kernel/managers/cache_manager.php (working copy)
@@ -203,10 +203,23 @@
return false;
}
- function SetConfigValue($name, $value)
+ /**
+ * Changes value of individual configuration variable (+resets cache, when needed)
+ *
+ * @param string $name
+ * @param string $value
+ * @param bool $local_cache_only
+ * @return string
+ * @access public
+ */
+ public function SetConfigValue($name, $value, $local_cache_only = false)
{
$this->configVariables[$name] = $value;
+ if ( $local_cache_only ) {
+ return;
+ }
+
$fields_hash = Array ('VariableValue' => $value);
$this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'ConfigurationValues', 'VariableName = ' . $this->Conn->qstr($name));
Index: core/kernel/processors/main_processor.php
===================================================================
--- core/kernel/processors/main_processor.php (revision 14917)
+++ core/kernel/processors/main_processor.php (working copy)
@@ -1248,4 +1248,18 @@
return $_SERVER['REQUEST_URI'];
}
+
+ /**
+ * Returns current maintenance mode state
+ *
+ * @param Array $params
+ * @return int
+ * @access protected
+ */
+ protected function MaintenanceMode($params)
+ {
+ $check_ips = isset($params['check_ips']) ? $params['check_ips'] : true;
+
+ return $this->Application->getMaintenanceMode($check_ips);
+ }
}
Index: core/kernel/startup.php
===================================================================
--- core/kernel/startup.php (revision 14917)
+++ core/kernel/startup.php (working copy)
@@ -133,6 +133,12 @@
CacheSettings::$sectionsParsedRebuildTime = isset($vars['SectionsParsedRebuildTime']) ? $vars['SectionsParsedRebuildTime'] : 10;
CacheSettings::$domainsParsedRebuildTime = isset($vars['DomainsParsedRebuildTime']) ? $vars['DomainsParsedRebuildTime'] : 2;
+ class MaintenanceMode {
+ const NONE = 0;
+ const SOFT = 1;
+ const HARD = 2;
+ }
+
unset($vars); // just in case someone will be still using it
if (ini_get('safe_mode')) {
Index: core/units/configuration/configuration_event_handler.php
===================================================================
--- core/units/configuration/configuration_event_handler.php (revision 14917)
+++ core/units/configuration/configuration_event_handler.php (working copy)
@@ -16,6 +16,17 @@
class ConfigurationEventHandler extends kDBEventHandler {
+ function mapPermissions()
+ {
+ parent::mapPermissions();
+
+ $permissions = Array (
+ 'OnGenerateMaintenancePage' => Array ('self' => 'add|edit'),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
/**
* Changes permission section to one from REQUEST, not from config
*
@@ -136,13 +147,24 @@
}
}
- if ( $object->GetDBField('VariableName') == 'AdminConsoleInterface' ) {
+ $variable_name = $object->GetDBField('VariableName');
+ $new_value = $object->GetDBField('VariableValue');
+
+ if ( $variable_name == 'AdminConsoleInterface' ) {
$can_change = $this->Application->ConfigValue('AllowAdminConsoleInterfaceChange');
- if ( ($object->GetDBField('VariableValue') != $object->GetOriginalField('VariableValue')) && !$can_change ) {
+ if ( ($new_value != $object->GetOriginalField('VariableValue')) && !$can_change ) {
$object->SetError('VariableValue', 'not_allowed', 'la_error_OperationNotAllowed');
}
}
+ elseif ( $variable_name == 'HardMaintenanceTemplate' ) {
+ $compile = $event->MasterEvent->getEventParam('compile_maintenance_template');
+ $compile = $compile || $new_value != $object->GetOriginalField('VariableValue');
+
+ if ( $compile && !$this->generateMaintenancePage($new_value) ) {
+ $object->SetError('VariableValue', 'template_file_missing', 'la_error_TemplateFileMissing');
+ }
+ }
}
/**
@@ -172,6 +194,9 @@
if ( $object->GetDBField('VariableValue') != $object->GetOriginalField('VariableValue') ) {
$changed[] = $variable_name;
$this->Application->SetVar($event->getPrefixSpecial() . '_changed', $changed);
+
+ // update value in cache, so other code (during this script run) would use new value
+ $this->Application->SetConfigValue($variable_name, $object->GetDBField('VariableValue'), true);
}
if ( $variable_name == 'Require_AdminSSL' || $variable_name == 'AdminSSL_URL' ) {
@@ -289,4 +314,44 @@
$event->SetRedirectParam('opener', 'u');
}
+ /**
+ * Generates maintenance page
+ *
+ * @param kEvent $event
+ * @return void
+ * @access protected
+ */
+ protected function OnGenerateMaintenancePage(kEvent &$event)
+ {
+ $event->setEventParam('compile_maintenance_template', 1);
+
+ $event->CallSubEvent('OnUpdate');
+ }
+
+ /**
+ * Generates HTML version of hard maintenance template
+ *
+ * @param string $template
+ * @return bool
+ * @access protected
+ */
+ protected function generateMaintenancePage($template = null)
+ {
+ if ( !isset($template) ) {
+ $template = $this->Application->ConfigValue('HardMaintenanceTemplate');
+ }
+
+ $curl_helper =& $this->Application->recallObject('CurlHelper');
+ /* @var $curl_helper kCurlHelper */
+
+ $html = $curl_helper->Send($this->Application->BaseURL() . '?t=' . $template);
+
+ if ( $curl_helper->isGoodResponseCode() ) {
+ file_put_contents(WRITEABLE . DIRECTORY_SEPARATOR . 'maintenance.html', $html);
+
+ return true;
+ }
+
+ return false;
+ }
}
\ No newline at end of file
Index: tools/debug_sample.php
===================================================================
--- tools/debug_sample.php (revision 14917)
+++ tools/debug_sample.php (working copy)
@@ -12,6 +12,9 @@
* See http://www.in-portal.org/license for copyright notices and details.
*/
+// define('MAINTENANCE_MODE_FRONT', MaintenanceMode::NONE); // Set to MaintenanceMode::SOFT for SOFT Maintenance mode, set to MaintenanceMode::HARD for HARD Maintenance mode (no DB load)
+// define('MAINTENANCE_MODE_ADMIN', MaintenanceMode::NONE); // Set to MaintenanceMode::SOFT for SOFT Maintenance mode, set to MaintenanceMode::HARD for HARD Maintenance mode (no DB load)
+// define('MAINTENANCE_MODE_IPS', ''); // Define IP addresses/hosts, which will be able to continue accessing website
// define('SILENT_LOG', 1); // Log all php errors on site to separate file (/silent_log.txt)
// define('DBG_REQUREST_LOG', '/path/to/file');// Log all user requests to site into filename specified
// define('DBG_ZEND_PRESENT', 0); // Set to 0 to debug debugger (because debugger automatically got disabled during zend debug sessions)
maintenance_mode_themes_v2.patch [^] (23,762 bytes) 2011-12-28 12:03
[Show Content]
Index: advanced/_install/english.lang
===================================================================
--- advanced/_install/english.lang (revision 14917)
+++ advanced/_install/english.lang (working copy)
@@ -323,6 +323,7 @@
<PHRASE Label="lu_title_ForgotPasswordNotification" Module="Core" Type="0">Rm9yZ290IFBhc3N3b3JkIE5vdGlmaWNhdGlvbg==</PHRASE>
<PHRASE Label="lu_title_LoginBox" Module="Core" Type="0">TG9naW4gQm94</PHRASE>
<PHRASE Label="lu_title_mailinglist" Module="Core" Type="0">TWFpbGluZyBMaXN0</PHRASE>
+ <PHRASE Label="lu_title_MaintenanceMode" Module="Core" Type="0">TWFpbnRlbmFuY2UgTW9kZQ==</PHRASE>
<PHRASE Label="lu_title_Members" Module="Core" Type="0">TWVtYmVycw==</PHRASE>
<PHRASE Label="lu_title_MissingPhraseAdding" Module="Core" Type="0">TWlzc2luZyBQaHJhc2UgQWRkaW5n</PHRASE>
<PHRASE Label="lu_title_MyAccount" Module="Core" Type="0">TXkgQWNjb3VudA==</PHRASE>
Index: advanced/maintenance.tpl
===================================================================
--- advanced/maintenance.tpl (revision 0)
+++ advanced/maintenance.tpl (revision 0)
@@ -0,0 +1,189 @@
+<!--##
+<NAME>Maintenance Mode</NAME>
+<DESC></DESC>
+<SECTION>Platform</SECTION>
+##-->
+
+<!--## PAGE TITLE ELEMENT ##-->
+<inp2:m_DefineElement name="page_title">
+ <inp2:m_phrase name="lu_title_MaintenanceMode" no_editing="1"/>
+</inp2:m_DefineElement>
+<!--## //PAGE TITLE ELEMENT ##-->
+
+<!--## SIDE-BAR ELEMENT ##-->
+<inp2:m_DefineElement name="sidebar">
+ <div class="movable-area">
+ <div class="movable-element">
+ <inp2:m_RenderElement name="platform/elements/side_boxes/login.elm" design="blue_box"/>
+ </div>
+ <div class="movable-element">
+ <inp2:m_RenderElement name="platform/elements/side_boxes/search.elm" design="blue_box"/>
+ </div>
+ <div class="movable-element">
+ <inp2:m_RenderElement name="platform/elements/side_boxes/recommend_site.elm" design="blue_box"/>
+ </div>
+ <div class="movable-element">
+ <inp2:m_RenderElement name="platform/elements/side_boxes/mailing_list.elm" design="blue_box"/>
+ </div>
+ </div>
+</inp2:m_DefineElement>
+<!--## //SIDE-BAR ELEMENT ##-->
+
+<inp2:m_DefineElement name="add_to_head">
+ <script type="text/javascript">
+ var a_parent = window.parent,
+ to_close = new Array (),
+ $modal_windows = <inp2:m_if check="adm_UsePopups" mode="modal">true<inp2:m_else/>false</inp2:m_if>;
+
+ function getFrame($name) {
+ var $main_window = window;
+
+ // 1. cycle through popups to get main window
+ try {
+ // will be error, when other site is opened in parent window
+ var $i = 0;
+ var $opener;
+
+ do {
+ if ( $i == 10 ) {
+ break;
+ }
+
+ // get popup opener
+ $opener = $main_window.opener;
+
+ if ( !$opener ) {
+ // when no opener found, then try parent window
+ $opener = $main_window.parent;
+ }
+
+ if ( $opener ) {
+ $main_window = $opener;
+ }
+
+ $i++;
+ } while ($opener);
+ }
+ catch (err) {
+ // catch Access/Permission Denied error
+ return window;
+ }
+
+ var $frameset = $main_window.parent.frames;
+ for ($i = 0; $i < $frameset.length; $i++) {
+ if ( $frameset[$i].name == $name ) {
+ return $frameset[$i];
+ }
+ }
+
+ return $main_window.parent;
+ }
+
+ function getWindowOpener($window) {
+ // use this instead of "window.opener"
+ if ( !$modal_windows ) {
+ return $window.opener;
+ }
+
+ if ( $window.name == 'main' || $window.name == 'main_frame' ) {
+ return null;
+ }
+
+ return getFrame('main').TB.findWindow($window.name, -1);
+ }
+
+ function redirect() {
+ var $main_frame = getFrame('main');
+ a_parent = window;
+
+ try {
+ var i = 0;
+ while (i < 10) {
+ i++;
+ var $opener = $main_frame.getWindowOpener(a_parent);
+
+ if ( $opener ) {
+ to_close.push(a_parent);
+ a_parent = $opener;
+ continue;
+ }
+
+ if ( a_parent.name == 'main_frame' ) {
+ break;
+ }
+
+ if ( a_parent.parent && a_parent.parent.name != a_parent.name ) {
+ a_parent = a_parent.parent;
+ continue;
+ }
+ }
+ }
+ catch (err) {
+ // another website is opened in parent window
+ alert('Error while trying to access window opener: [' + err.message + ']');
+ i = 10;
+ }
+
+ if ( i < 10 ) {
+ setTimeout(close_windows, 100);
+ }
+ }
+
+ function window_close($close_callback) {
+ // use this instead of "window.close();"
+ if ( !$modal_windows ) {
+ if ( $.isFunction($close_callback) ) {
+ // use close callback, because iframe will be removed later in this method
+ $close_callback();
+ }
+
+ window.close();
+ return;
+ }
+
+ if ( window.name == 'main' ) {
+ return;
+ }
+
+ if ( $close_callback !== undefined ) {
+ return getFrame('main').TB.remove(null, $close_callback);
+ }
+
+ return getFrame('main').TB.remove();
+ }
+
+ function close_windows() {
+ page = '<inp2:m_Link template="login" js_escape="1" no_amp="1" index_file="admin/index.php" __NO_REWRITE__="1" m_cat_id="0" m_wid=""/>';
+ a_parent.location.href = page;
+
+ for (var c = (to_close.length - 1); c >= 0; c--) {
+ window_close(to_close[c]);
+ }
+ }
+
+ if ( window.top.frames.length > 0 ) {
+ redirect();
+ }
+ </script>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="content">
+ <div class="movable-area">
+ <div class="movable-element">
+ <inp2:m_include template="platform/elements/navigation_bar.elm" titles="lu_title_MaintenanceMode" templates="maintenance"/>
+ </div>
+ <div class="movable-element">
+ <!-- MAINTENANCE MODE -->
+ <inp2:m_RenderElement design="content_box">
+ <inp2:m_Capture to_var="header">
+ <inp2:m_phrase name="lu_title_MaintenanceMode"/>
+ </inp2:m_Capture>
+
+ <inp2:m_GetConfig name="MaintenanceMessageFront"/>
+ </inp2:m_RenderElement>
+ <!-- // MAINTENANCE MODE -->
+ </div>
+ </div>
+</inp2:m_DefineElement>
+
+<inp2:m_include template="platform/designs/default_design.des" pass_params="1"/>
\ No newline at end of file
Index: advanced/platform/designs/default_design.des.tpl
===================================================================
--- advanced/platform/designs/default_design.des.tpl (revision 14917)
+++ advanced/platform/designs/default_design.des.tpl (working copy)
@@ -17,20 +17,23 @@
<link rel="stylesheet" rev="stylesheet" href="<inp2:m_Compress from='all_css'/>" type="text/css" />
<script type="text/javascript" src="<inp2:m_Compress from='all_js'/>"></script>
-
+
<script type="text/javascript">
- var aRatingManager = new RatingManager('<inp2:m_Link template="index" events[#PREFIX#]="OnMakeVote" rating="#VOTE#" id="#ID#" no_amp="1" size="#SIZE#"/>');
-
+ var aRatingManager = new RatingManager('<inp2:m_Link template="index" events[#PREFIX#]="OnMakeVote" rating="#VOTE#" id="#ID#" no_amp="1" size="#SIZE#"/>');
+
<inp2:m_Cache key="prefix:lang;skip_var:t,page,per_page,sort_by">
<inp2:m_DefineElement name="ml_selector_language_element">
<inp2:Field name="LanguageId"/>: {'on': '<inp2:Field name="IconURL" js_ecape="1"/>', 'off': '<inp2:Field name="IconDisabledURL" js_ecape="1"/>'}
<inp2:m_ifnot check="m_Param" name="is_last">,</inp2:m_ifnot>
</inp2:m_DefineElement>
-
- var aMultiLanguageSelector = new MultiLanguageSelector({<inp2:lang.enabled_PrintList render_as="ml_selector_language_element" per_page="-1" no_editing="1" strip_nl="2"/>}, <inp2:m_Get name="m_lang"/>);
+
+ var aMultiLanguageSelector = new MultiLanguageSelector({<inp2:lang.enabled_PrintList render_as="ml_selector_language_element" per_page="-1" no_editing="1" strip_nl="2"/>}, <inp2:m_Get name="m_lang"/>);
</inp2:m_Cache>
</script>
+ <inp2:m_DefineElement name="default_add_to_head"></inp2:m_DefineElement>
+ <inp2:m_RenderElement name="add_to_head" default_element="default_add_to_head"/>
+
<inp2:st_EditingScripts/>
<!--## /Include module specific HEADER template ##-->
</head>
Index: default/_install/english.lang
===================================================================
--- default/_install/english.lang (revision 14917)
+++ default/_install/english.lang (working copy)
@@ -17,6 +17,7 @@
<PHRASE Label="lu_text_PromoHeader2" Module="Core" Type="0">JnF1b3Q7SW4tUG9ydGFsIC0gU2V0dGluZyBFeGNlbGxlbmNlPGJyLz4NCmluIENvbnRlbnQgTWFuYWdlbWVudCZxdW90Ow==</PHRASE>
<PHRASE Label="lu_text_Thankyou" Module="Core" Type="0">VGhhbmsgeW91IGZvciBjb250YWN0aW5nIHdpdGggdXMh</PHRASE>
<PHRASE Label="lu_title_Address" Module="Core" Type="0">QWRkcmVzcw==</PHRASE>
+ <PHRASE Label="lu_title_MaintenanceMode" Module="Core" Type="0">TWFpbnRlbmFuY2UgTW9kZQ==</PHRASE>
<PHRASE Label="lu_title_RequestInformation" Module="Core" Type="0">SW5mb3JtYXRpb24gUmVxdWVzdCBGb3Jt</PHRASE>
</PHRASES>
</LANGUAGE>
Index: default/designs/default_design.des.tpl
===================================================================
--- default/designs/default_design.des.tpl (revision 14917)
+++ default/designs/default_design.des.tpl (working copy)
@@ -8,6 +8,9 @@
<inp2:st_PageInfo type="title"/> (<inp2:m_GetConfig name="Site_Name"/>)
</title>
<inp2:m_Include template="elements/html_head.elm" />
+
+ <inp2:m_DefineElement name="default_add_to_head"></inp2:m_DefineElement>
+ <inp2:m_RenderElement name="add_to_head" default_element="default_add_to_head"/>
</head>
<body>
Index: default/maintenance.tpl
===================================================================
--- default/maintenance.tpl (revision 0)
+++ default/maintenance.tpl (revision 0)
@@ -0,0 +1,159 @@
+<!--##
+<NAME>Maintenance Mode</NAME>
+<DESC></DESC>
+<SECTION>Pages</SECTION>
+##-->
+
+<inp2:m_DefineElement name="add_to_head">
+ <script type="text/javascript">
+ var a_parent = window.parent,
+ to_close = new Array (),
+ $modal_windows = <inp2:m_if check="adm_UsePopups" mode="modal">true<inp2:m_else/>false</inp2:m_if>;
+
+ function getFrame($name) {
+ var $main_window = window;
+
+ // 1. cycle through popups to get main window
+ try {
+ // will be error, when other site is opened in parent window
+ var $i = 0;
+ var $opener;
+
+ do {
+ if ( $i == 10 ) {
+ break;
+ }
+
+ // get popup opener
+ $opener = $main_window.opener;
+
+ if ( !$opener ) {
+ // when no opener found, then try parent window
+ $opener = $main_window.parent;
+ }
+
+ if ( $opener ) {
+ $main_window = $opener;
+ }
+
+ $i++;
+ } while ($opener);
+ }
+ catch (err) {
+ // catch Access/Permission Denied error
+ return window;
+ }
+
+ var $frameset = $main_window.parent.frames;
+ for ($i = 0; $i < $frameset.length; $i++) {
+ if ( $frameset[$i].name == $name ) {
+ return $frameset[$i];
+ }
+ }
+
+ return $main_window.parent;
+ }
+
+ function getWindowOpener($window) {
+ // use this instead of "window.opener"
+ if ( !$modal_windows ) {
+ return $window.opener;
+ }
+
+ if ( $window.name == 'main' || $window.name == 'main_frame' ) {
+ return null;
+ }
+
+ return getFrame('main').TB.findWindow($window.name, -1);
+ }
+
+ function redirect() {
+ var $main_frame = getFrame('main');
+ a_parent = window;
+
+ try {
+ var i = 0;
+ while (i < 10) {
+ i++;
+ var $opener = $main_frame.getWindowOpener(a_parent);
+
+ if ( $opener ) {
+ to_close.push(a_parent);
+ a_parent = $opener;
+ continue;
+ }
+
+ if ( a_parent.name == 'main_frame' ) {
+ break;
+ }
+
+ if ( a_parent.parent && a_parent.parent.name != a_parent.name ) {
+ a_parent = a_parent.parent;
+ continue;
+ }
+ }
+ }
+ catch (err) {
+ // another website is opened in parent window
+ alert('Error while trying to access window opener: [' + err.message + ']');
+ i = 10;
+ }
+
+ if ( i < 10 ) {
+ setTimeout(close_windows, 100);
+ }
+ }
+
+ function window_close($close_callback) {
+ // use this instead of "window.close();"
+ if ( !$modal_windows ) {
+ if ( $.isFunction($close_callback) ) {
+ // use close callback, because iframe will be removed later in this method
+ $close_callback();
+ }
+
+ window.close();
+ return;
+ }
+
+ if ( window.name == 'main' ) {
+ return;
+ }
+
+ if ( $close_callback !== undefined ) {
+ return getFrame('main').TB.remove(null, $close_callback);
+ }
+
+ return getFrame('main').TB.remove();
+ }
+
+ function close_windows() {
+ page = '<inp2:m_Link template="login" js_escape="1" no_amp="1" index_file="admin/index.php" __NO_REWRITE__="1" m_cat_id="0" m_wid=""/>';
+ a_parent.location.href = page;
+
+ for (var c = (to_close.length - 1); c >= 0; c--) {
+ window_close(to_close[c]);
+ }
+ }
+
+ if ( window.top.frames.length > 0 ) {
+ redirect();
+ }
+ </script>
+</inp2:m_DefineElement>
+
+<!--## DEFINE MAIN CONTENT ELEMENT ##-->
+<inp2:m_DefineElement name="content">
+
+ <inp2:m_RenderElement design="content_box">
+ <inp2:m_Capture to_var="header">
+ <inp2:st_PageInfo type="title"/>
+ </inp2:m_Capture>
+
+ <inp2:m_GetConfig name="MaintenanceMessageFront"/>
+ </inp2:m_RenderElement>
+
+</inp2:m_DefineElement>
+<!--## /DEFINE MAIN CONTENT ELEMENT ##-->
+
+<inp2:m_include template="designs/default_design.des" page_class="inner"/>
Index: modern-store/_install/english.lang
===================================================================
--- modern-store/_install/english.lang (revision 14917)
+++ modern-store/_install/english.lang (working copy)
@@ -29,6 +29,7 @@
<PHRASE Label="lu_text_RedirectLink" Module="Core" Type="0">UGxlYXNlIGNsaWNrIG9uIHRoaXMgbGluayE=</PHRASE>
<PHRASE Label="lu_text_Thankyou" Module="Core" Type="0">VGhhbmsgeW91IGZvciBjb250YWN0aW5nIHdpdGggdXMh</PHRASE>
<PHRASE Label="lu_title_Address" Module="Core" Type="0">QWRkcmVzcw==</PHRASE>
+ <PHRASE Label="lu_title_MaintenanceMode" Module="Core" Type="0">TWFpbnRlbmFuY2UgTW9kZQ==</PHRASE>
<PHRASE Label="lu_title_RequestInformation" Module="Core" Type="0">SW5mb3JtYXRpb24gUmVxdWVzdCBGb3Jt</PHRASE>
<PHRASE Label="lu_title_SiteName" Module="Core" Type="0">U21hcnQgQml6</PHRASE>
</PHRASES>
Index: modern-store/maintenance.tpl
===================================================================
--- modern-store/maintenance.tpl (revision 0)
+++ modern-store/maintenance.tpl (revision 0)
@@ -0,0 +1,161 @@
+<!--##
+<NAME>Maintenance Mode</NAME>
+<DESC></DESC>
+<SECTION>Pages</SECTION>
+##-->
+
+<inp2:m_DefineElement name="add_to_head">
+ <script type="text/javascript">
+ var a_parent = window.parent,
+ to_close = new Array (),
+ $modal_windows = <inp2:m_if check="adm_UsePopups" mode="modal">true<inp2:m_else/>false</inp2:m_if>;
+
+ function getFrame($name) {
+ var $main_window = window;
+
+ // 1. cycle through popups to get main window
+ try {
+ // will be error, when other site is opened in parent window
+ var $i = 0;
+ var $opener;
+
+ do {
+ if ( $i == 10 ) {
+ break;
+ }
+
+ // get popup opener
+ $opener = $main_window.opener;
+
+ if ( !$opener ) {
+ // when no opener found, then try parent window
+ $opener = $main_window.parent;
+ }
+
+ if ( $opener ) {
+ $main_window = $opener;
+ }
+
+ $i++;
+ } while ($opener);
+ }
+ catch (err) {
+ // catch Access/Permission Denied error
+ return window;
+ }
+
+ var $frameset = $main_window.parent.frames;
+ for ($i = 0; $i < $frameset.length; $i++) {
+ if ( $frameset[$i].name == $name ) {
+ return $frameset[$i];
+ }
+ }
+
+ return $main_window.parent;
+ }
+
+ function getWindowOpener($window) {
+ // use this instead of "window.opener"
+ if ( !$modal_windows ) {
+ return $window.opener;
+ }
+
+ if ( $window.name == 'main' || $window.name == 'main_frame' ) {
+ return null;
+ }
+
+ return getFrame('main').TB.findWindow($window.name, -1);
+ }
+
+ function redirect() {
+ var $main_frame = getFrame('main');
+ a_parent = window;
+
+ try {
+ var i = 0;
+ while (i < 10) {
+ i++;
+ var $opener = $main_frame.getWindowOpener(a_parent);
+
+ if ( $opener ) {
+ to_close.push(a_parent);
+ a_parent = $opener;
+ continue;
+ }
+
+ if ( a_parent.name == 'main_frame' ) {
+ break;
+ }
+
+ if ( a_parent.parent && a_parent.parent.name != a_parent.name ) {
+ a_parent = a_parent.parent;
+ continue;
+ }
+ }
+ }
+ catch (err) {
+ // another website is opened in parent window
+ alert('Error while trying to access window opener: [' + err.message + ']');
+ i = 10;
+ }
+
+ if ( i < 10 ) {
+ setTimeout(close_windows, 100);
+ }
+ }
+
+ function window_close($close_callback) {
+ // use this instead of "window.close();"
+ if ( !$modal_windows ) {
+ if ( $.isFunction($close_callback) ) {
+ // use close callback, because iframe will be removed later in this method
+ $close_callback();
+ }
+
+ window.close();
+ return;
+ }
+
+ if ( window.name == 'main' ) {
+ return;
+ }
+
+ if ( $close_callback !== undefined ) {
+ return getFrame('main').TB.remove(null, $close_callback);
+ }
+
+ return getFrame('main').TB.remove();
+ }
+
+ function close_windows() {
+ page = '<inp2:m_Link template="login" js_escape="1" no_amp="1" index_file="admin/index.php" __NO_REWRITE__="1" m_cat_id="0" m_wid=""/>';
+ a_parent.location.href = page;
+
+ for (var c = (to_close.length - 1); c >= 0; c--) {
+ window_close(to_close[c]);
+ }
+ }
+
+ if ( window.top.frames.length > 0 ) {
+ redirect();
+ }
+ </script>
+</inp2:m_DefineElement>
+
+<!--## MAIN CONTENT ##-->
+<inp2:m_DefineElement name="content">
+
+ <inp2:m_RenderElement design="content_box">
+ <inp2:m_Capture to_var="header">
+ <inp2:st_PageInfo type="title"/>
+ </inp2:m_Capture>
+
+ <inp2:m_GetConfig name="MaintenanceMessageFront"/>
+ </inp2:m_RenderElement>
+
+</inp2:m_DefineElement>
+<!--## /MAIN CONTENT ##-->
+
+<!--## DESIGN TEMPLATE ##-->
+<inp2:m_include template="designs/default_design.des" pass_params="1"/>
+<!--## /DESIGN TEMPLATE ##-->
\ No newline at end of file
Index: simple/_install/english.lang
===================================================================
--- simple/_install/english.lang (revision 14917)
+++ simple/_install/english.lang (working copy)
@@ -326,6 +326,7 @@
<PHRASE Label="lu_title_ForgotPasswordNotification" Module="Core" Type="0">Rm9yZ290IFBhc3N3b3JkIE5vdGlmaWNhdGlvbg==</PHRASE>
<PHRASE Label="lu_title_LoginBox" Module="Core" Type="0">TG9naW4gQm94</PHRASE>
<PHRASE Label="lu_title_mailinglist" Module="Core" Type="0">TWFpbGluZyBMaXN0</PHRASE>
+ <PHRASE Label="lu_title_MaintenanceMode" Module="Core" Type="0">TWFpbnRlbmFuY2UgTW9kZQ==</PHRASE>
<PHRASE Label="lu_title_Members" Module="Core" Type="0">TWVtYmVycw==</PHRASE>
<PHRASE Label="lu_title_MissingPhraseAdding" Module="Core" Type="0">TWlzc2luZyBQaHJhc2UgQWRkaW5n</PHRASE>
<PHRASE Label="lu_title_MyAccount" Module="Core" Type="0">TXkgQWNjb3VudA==</PHRASE>
Index: simple/designs/default_design.des.tpl
===================================================================
--- simple/designs/default_design.des.tpl (revision 14917)
+++ simple/designs/default_design.des.tpl (working copy)
@@ -13,6 +13,9 @@
<inp2:m_Include template="elements/html_head.elm" />
+
+ <inp2:m_DefineElement name="default_add_to_head"></inp2:m_DefineElement>
+ <inp2:m_RenderElement name="add_to_head" default_element="default_add_to_head"/>
</head>
<body>
Index: simple/maintenance.tpl
===================================================================
--- simple/maintenance.tpl (revision 0)
+++ simple/maintenance.tpl (revision 0)
@@ -0,0 +1,162 @@
+<!--##
+<NAME>Maintenance Mode</NAME>
+<DESC></DESC>
+<SECTION></SECTION>
+##-->
+
+<inp2:m_DefineElement name="add_to_head">
+ <script type="text/javascript">
+ var a_parent = window.parent,
+ to_close = new Array (),
+ $modal_windows = <inp2:m_if check="adm_UsePopups" mode="modal">true<inp2:m_else/>false</inp2:m_if>;
+
+ function getFrame($name) {
+ var $main_window = window;
+
+ // 1. cycle through popups to get main window
+ try {
+ // will be error, when other site is opened in parent window
+ var $i = 0;
+ var $opener;
+
+ do {
+ if ( $i == 10 ) {
+ break;
+ }
+
+ // get popup opener
+ $opener = $main_window.opener;
+
+ if ( !$opener ) {
+ // when no opener found, then try parent window
+ $opener = $main_window.parent;
+ }
+
+ if ( $opener ) {
+ $main_window = $opener;
+ }
+
+ $i++;
+ } while ($opener);
+ }
+ catch (err) {
+ // catch Access/Permission Denied error
+ return window;
+ }
+
+ var $frameset = $main_window.parent.frames;
+ for ($i = 0; $i < $frameset.length; $i++) {
+ if ( $frameset[$i].name == $name ) {
+ return $frameset[$i];
+ }
+ }
+
+ return $main_window.parent;
+ }
+
+ function getWindowOpener($window) {
+ // use this instead of "window.opener"
+ if ( !$modal_windows ) {
+ return $window.opener;
+ }
+
+ if ( $window.name == 'main' || $window.name == 'main_frame' ) {
+ return null;
+ }
+
+ return getFrame('main').TB.findWindow($window.name, -1);
+ }
+
+ function redirect() {
+ var $main_frame = getFrame('main');
+ a_parent = window;
+
+ try {
+ var i = 0;
+ while (i < 10) {
+ i++;
+ var $opener = $main_frame.getWindowOpener(a_parent);
+
+ if ( $opener ) {
+ to_close.push(a_parent);
+ a_parent = $opener;
+ continue;
+ }
+
+ if ( a_parent.name == 'main_frame' ) {
+ break;
+ }
+
+ if ( a_parent.parent && a_parent.parent.name != a_parent.name ) {
+ a_parent = a_parent.parent;
+ continue;
+ }
+ }
+ }
+ catch (err) {
+ // another website is opened in parent window
+ alert('Error while trying to access window opener: [' + err.message + ']');
+ i = 10;
+ }
+
+ if ( i < 10 ) {
+ setTimeout(close_windows, 100);
+ }
+ }
+
+ function window_close($close_callback) {
+ // use this instead of "window.close();"
+ if ( !$modal_windows ) {
+ if ( $.isFunction($close_callback) ) {
+ // use close callback, because iframe will be removed later in this method
+ $close_callback();
+ }
+
+ window.close();
+ return;
+ }
+
+ if ( window.name == 'main' ) {
+ return;
+ }
+
+ if ( $close_callback !== undefined ) {
+ return getFrame('main').TB.remove(null, $close_callback);
+ }
+
+ return getFrame('main').TB.remove();
+ }
+
+ function close_windows() {
+ page = '<inp2:m_Link template="login" js_escape="1" no_amp="1" index_file="admin/index.php" __NO_REWRITE__="1" m_cat_id="0" m_wid=""/>';
+ a_parent.location.href = page;
+
+ for (var c = (to_close.length - 1); c >= 0; c--) {
+ window_close(to_close[c]);
+ }
+ }
+
+ if ( window.top.frames.length > 0 ) {
+ redirect();
+ }
+ </script>
+</inp2:m_DefineElement>
+
+<!--## DEFINE MAIN CONTENT ELEMENT ##-->
+<inp2:m_DefineElement name="content">
+ <div class="movable-element">
+
+ <div id="block-latest" class="block">
+ <div class="round-top"></div>
+ <div class="content">
+ <h1 class="movable-header"><inp2:m_Phrase name="lu_title_MaintenanceMode"/></h1>
+ <inp2:m_GetConfig name="MaintenanceMessageFront"/>
+ </div>
+ <div class="round-bottom"></div>
+ </div>
+
+ </div>
+</inp2:m_DefineElement>
+<!--## /DEFINE MAIN CONTENT ELEMENT ##-->
+
+<inp2:m_include template="designs/default_design.des" pass_params="1"/>
maintenance_mode_core_v2-additions.patch [^] (1,203 bytes) 2011-12-29 16:32
[Show Content]
Index: kernel/application.php
===================================================================
--- kernel/application.php (revision 14944)
+++ kernel/application.php (working copy)
@@ -927,12 +927,13 @@
*/
public function redirectToMaintenance()
{
- $maintenance_page = WRITEBALE_BASE . '/maintenance.html';
+ $maintenance_page = WRITEBALE_BASE . '/maintenance.html';
+ // $query_string = $this->isAdmin ? '' : '?next_template=' . urlencode($_SERVER['REQUEST_URI']); // get next_template from query string if needed
- if ( file_exists(FULL_PATH . $maintenance_page) ) {
- header('Location: ' . BASE_PATH . $maintenance_page, true, 301);
- exit;
- }
+ if ( file_exists(FULL_PATH . $maintenance_page) ) {
+ header('Location: ' . BASE_PATH . $maintenance_page);
+ exit;
+ }
}
/**
@@ -955,7 +956,6 @@
$maintenance_template = $this->isAdmin ? 'login' : $this->ConfigValue('SoftMaintenanceTemplate');
if ( $this->GetVar('t') != $maintenance_template ) {
- $redirect_params = Array ('response_code' => 301);
if (!$this->isAdmin) {
$redirect_params['next_template'] = urlencode($_SERVER['REQUEST_URI']);
maintenance_mode_themes_v2-additions.patch [^] (2,833 bytes) 2011-12-29 16:33
[Show Content]
Index: advanced/maintenance.tpl
===================================================================
--- advanced/maintenance.tpl (revision 14944)
+++ advanced/maintenance.tpl (working copy)
@@ -3,6 +3,7 @@
<DESC></DESC>
<SECTION>Platform</SECTION>
##-->
+<inp2:m_NoDebug/>
<!--## PAGE TITLE ELEMENT ##-->
<inp2:m_DefineElement name="page_title">
@@ -30,6 +31,9 @@
<!--## //SIDE-BAR ELEMENT ##-->
<inp2:m_DefineElement name="add_to_head">
+ <meta name="robots" content="noindex, nofollow">
+ <meta http-equiv="refresh" content="120; url=<inp2:m_if check='m_Get' name='next_template'><inp2:m_Get name='next_template'/><inp2:m_else/><inp2:m_Link template='index' m_cat_id='0'/></inp2:m_if>">
+
<script type="text/javascript">
var a_parent = window.parent,
to_close = new Array (),
Index: default/maintenance.tpl
===================================================================
--- default/maintenance.tpl (revision 14944)
+++ default/maintenance.tpl (working copy)
@@ -3,8 +3,12 @@
<DESC></DESC>
<SECTION>Pages</SECTION>
##-->
+<inp2:m_NoDebug/>
<inp2:m_DefineElement name="add_to_head">
+ <meta name="robots" content="noindex, nofollow">
+ <meta http-equiv="refresh" content="120; url=<inp2:m_if check='m_Get' name='next_template'><inp2:m_Get name='next_template'/><inp2:m_else/><inp2:m_Link template='index' m_cat_id='0'/></inp2:m_if>">
+
<script type="text/javascript">
var a_parent = window.parent,
to_close = new Array (),
Index: modern-store/maintenance.tpl
===================================================================
--- modern-store/maintenance.tpl (revision 14944)
+++ modern-store/maintenance.tpl (working copy)
@@ -3,8 +3,12 @@
<DESC></DESC>
<SECTION>Pages</SECTION>
##-->
+<inp2:m_NoDebug/>
<inp2:m_DefineElement name="add_to_head">
+ <meta name="robots" content="noindex, nofollow">
+ <meta http-equiv="refresh" content="120; url=<inp2:m_if check='m_Get' name='next_template'><inp2:m_Get name='next_template'/><inp2:m_else/><inp2:m_Link template='index' m_cat_id='0'/></inp2:m_if>">
+
<script type="text/javascript">
var a_parent = window.parent,
to_close = new Array (),
Index: simple/maintenance.tpl
===================================================================
--- simple/maintenance.tpl (revision 14944)
+++ simple/maintenance.tpl (working copy)
@@ -3,8 +3,12 @@
<DESC></DESC>
<SECTION></SECTION>
##-->
+<inp2:m_NoDebug/>
<inp2:m_DefineElement name="add_to_head">
+ <meta name="robots" content="noindex, nofollow">
+ <meta http-equiv="refresh" content="120; url=<inp2:m_if check='m_Get' name='next_template'><inp2:m_Get name='next_template'/><inp2:m_else/><inp2:m_Link template='index' m_cat_id='0'/></inp2:m_if>">
+
<script type="text/javascript">
var a_parent = window.parent,
to_close = new Array (),
GeneratePageButtonIssue.png [^] (224,485 bytes) 2011-12-29 16:51
maintenance_mode_addon_fix.patch [^] (1,329 bytes) 2011-12-30 02:15
[Show Content]
Index: kernel/application.php
===================================================================
--- kernel/application.php (revision 14949)
+++ kernel/application.php (working copy)
@@ -927,13 +927,13 @@
*/
public function redirectToMaintenance()
{
- $maintenance_page = WRITEBALE_BASE . '/maintenance.html';
- // $query_string = $this->isAdmin ? '' : '?next_template=' . urlencode($_SERVER['REQUEST_URI']); // get next_template from query string if needed
+ $maintenance_page = WRITEBALE_BASE . '/maintenance.html';
+ $query_string = ''; // $this->isAdmin ? '' : '?next_template=' . urlencode($_SERVER['REQUEST_URI']);
- if ( file_exists(FULL_PATH . $maintenance_page) ) {
- header('Location: ' . BASE_PATH . $maintenance_page);
- exit;
- }
+ if ( file_exists(FULL_PATH . $maintenance_page) ) {
+ header('Location: ' . BASE_PATH . $maintenance_page . $query_string);
+ exit;
+ }
}
/**
@@ -956,8 +956,9 @@
$maintenance_template = $this->isAdmin ? 'login' : $this->ConfigValue('SoftMaintenanceTemplate');
if ( $this->GetVar('t') != $maintenance_template ) {
+ $redirect_params = Array ();
- if (!$this->isAdmin) {
+ if ( !$this->isAdmin ) {
$redirect_params['next_template'] = urlencode($_SERVER['REQUEST_URI']);
}
|