Index: branches/5.2.x/core/kernel/managers/request_manager.php
===================================================================
diff -u -r14664 -r14665
--- branches/5.2.x/core/kernel/managers/request_manager.php (.../request_manager.php) (revision 14664)
+++ branches/5.2.x/core/kernel/managers/request_manager.php (.../request_manager.php) (revision 14665)
@@ -1,6 +1,6 @@
samePageRedirect($event) && ($event->getEventParam('pass_category') === false) && $this->Application->GetVar('m_cat_id') ) {
$event->SetRedirectParam('pass_category', 1);
}
$wid = $this->Application->GetVar('m_wid');
+ $redirect_params = $event->getRedirectParams();
- if ($wid && $event->getRedirectParam('opener') == 'u') {
- $event->SetRedirectParam('opener', 's'); // because Application->HREF will react differently when 'opener' = 'u'
+ if ( $wid && $event->getRedirectParam('opener') == 'u' ) {
+ // update last element in current opener stack
+ unset($redirect_params['opener']);
+ $redirect_template = is_string($event->redirect) ? $event->redirect : null;
+ $this->openerStackChange($redirect_template, $redirect_params);
+
+ // reset opener, because kApplication::HREF will react differently when 'opener' => 'u'
+ $event->SetRedirectParam('opener', 's');
$event->redirect = defined('CLOSE_POPUP_TPL') ? CLOSE_POPUP_TPL : 'incs/close_popup';
}
@@ -413,9 +420,9 @@
*
* @param string $new_template
* @param Array $new_params
- * @access public
+ * @access protected
*/
- public function openerStackChange($new_template = null, $new_params = null)
+ protected function openerStackChange($new_template = null, $new_params = null)
{
$opener_stack =& $this->Application->makeClass('kOpenerStack');
/* @var $opener_stack kOpenerStack */
Index: branches/5.2.x/core/kernel/application.php
===================================================================
diff -u -r14664 -r14665
--- branches/5.2.x/core/kernel/application.php (.../application.php) (revision 14664)
+++ branches/5.2.x/core/kernel/application.php (.../application.php) (revision 14665)
@@ -1,6 +1,6 @@
isDebugMode() && kUtil::constOn('DBG_PROFILE_MEMORY')) {
+ if ( defined('DEBUG_MODE') && $this->isDebugMode() && kUtil::constOn('DBG_PROFILE_MEMORY') ) {
$this->Debugger->appendMemoryUsage('Application before Run:');
}
- if ($this->isAdminUser) {
+ if ( $this->isAdminUser ) {
// for permission checking in events & templates
$this->LinkVar('module'); // for common configuration templates
$this->LinkVar('module_key'); // for common search templates
@@ -966,7 +967,7 @@
kUtil::safeDefine('DBG_SKIP_REPORTING', 1); // safeDefine, because debugger also defines it
}
}
- elseif ($this->GetVar('admin')) {
+ elseif ( $this->GetVar('admin') ) {
// viewing front-end through admin's frame
$admin_session =& $this->recallObject('Session.admin');
/* @var $admin_session Session */
@@ -976,7 +977,7 @@
$perm_helper =& $this->recallObject('PermissionsHelper');
/* @var $perm_helper kPermissionsHelper */
- if ($perm_helper->CheckUserPermission($user, 'CATEGORY.MODIFY', 0, $this->getBaseCategory())) {
+ if ( $perm_helper->CheckUserPermission($user, 'CATEGORY.MODIFY', 0, $this->getBaseCategory()) ) {
// user can edit cms blocks
$editing_mode = $this->GetVar('editing_mode');
define('EDITING_MODE', $editing_mode ? $editing_mode : EDITING_MODE_BROWSE);
@@ -986,32 +987,34 @@
kUtil::safeDefine('EDITING_MODE', ''); // user can't edit anything
$this->Phrases->setPhraseEditing();
- if (!$this->RequestProcessed) $this->ProcessRequest();
+ if ( !$this->RequestProcessed ) {
+ $this->ProcessRequest();
+ }
$this->InitParser();
$t = $this->GetVar('t');
- if (!$this->TemplatesCache->TemplateExists($t) && !$this->isAdmin) {
+ if ( !$this->TemplatesCache->TemplateExists($t) && !$this->isAdmin ) {
$cms_handler =& $this->recallObject('st_EventHandler');
/* @var $cms_handler CategoriesEventHandler */
$t = ltrim($cms_handler->GetDesignTemplate(), '/');
- if (defined('DEBUG_MODE') && $this->isDebugMode()) {
+ if ( defined('DEBUG_MODE') && $this->isDebugMode() ) {
$this->Debugger->appendHTML('Design Template: ' . $t . '; CategoryID: ' . $this->GetVar('m_cat_id'));
}
}
/*else {
$cms_handler->SetCatByTemplate();
}*/
- if (defined('DEBUG_MODE') && $this->isDebugMode() && kUtil::constOn('DBG_PROFILE_MEMORY')) {
+ if ( defined('DEBUG_MODE') && $this->isDebugMode() && kUtil::constOn('DBG_PROFILE_MEMORY') ) {
$this->Debugger->appendMemoryUsage('Application before Parsing:');
}
$this->HTML = $this->Parser->Run($t);
- if (defined('DEBUG_MODE') && $this->isDebugMode() && kUtil::constOn('DBG_PROFILE_MEMORY')) {
+ if ( defined('DEBUG_MODE') && $this->isDebugMode() && kUtil::constOn('DBG_PROFILE_MEMORY') ) {
$this->Debugger->appendMemoryUsage('Application after Parsing:');
}
}
Index: branches/5.2.x/core/kernel/event_manager.php
===================================================================
diff -u -r14664 -r14665
--- branches/5.2.x/core/kernel/event_manager.php (.../event_manager.php) (revision 14664)
+++ branches/5.2.x/core/kernel/event_manager.php (.../event_manager.php) (revision 14665)
@@ -1,6 +1,6 @@
Request->openerStackChange($new_template, $new_params);
- }
-
- /**
* Set's new event for $prefix_special
* passed
*