Index: kernel/application.php
===================================================================
--- kernel/application.php (revision 14664)
+++ kernel/application.php (working copy)
@@ -49,12 +49,13 @@
var $HTML;
/**
- * Prevents request from beeing proceeded twice in case if application init is called mere then one time
+ * Prevents request from being proceeded twice in case if application init is called mere then one time
*
* @var bool
+ * @access protected
* @todo This is not good anyway (by Alex)
*/
- var $RequestProcessed = false;
+ protected $RequestProcessed = false;
/**
* The main Factory used to create
@@ -946,11 +947,11 @@
*/
function Run()
{
- 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 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,18 +987,20 @@
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'));
}
}
@@ -1005,13 +1008,13 @@
$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: kernel/event_manager.php
===================================================================
--- kernel/event_manager.php (revision 14664)
+++ kernel/event_manager.php (working copy)
@@ -326,18 +326,6 @@
}
/**
- * Allows to change last element in opener stack
- *
- * @param string $new_template
- * @param Array $new_params
- * @access public
- */
- public function openerStackChange($new_template = null, $new_params = null)
- {
- $this->Request->openerStackChange($new_template, $new_params);
- }
-
- /**
* Set's new event for $prefix_special
* passed
*
Index: kernel/managers/request_manager.php
===================================================================
--- kernel/managers/request_manager.php (revision 14664)
+++ kernel/managers/request_manager.php (working copy)
@@ -167,15 +167,22 @@
protected function performRedirect(&$event)
{
// we need to pass category if the action was submitted to self-template, with the category passed
- // and it has not explicitly set redirect template or pass_cateogry param
+ // and it has not explicitly set redirect template or pass_category param
if ( $this->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 */