Index: branches/5.1.x/core/kernel/event_manager.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/kernel/event_manager.php (.../event_manager.php) (revision 12127) +++ branches/5.1.x/core/kernel/event_manager.php (.../event_manager.php) (revision 12657) @@ -1,6 +1,6 @@ (int)$agent_data['RunInterval'], 'LastRunOn' => (int)$agent_data['LastRunOn'], 'NextRunOn' => (int)$agent_data['NextRunOn'], + 'Status' => $agent_data['Status'], ); } } @@ -202,15 +205,15 @@ * @param int $run_interval run interval in seconds * @param int $type before or after regular event */ - function registerRegularEvent($short_name, $event_name, $run_interval, $type = reBEFORE) + function registerRegularEvent($short_name, $event_name, $run_interval, $type = reBEFORE, $status = STATUS_ACTIVE) { if($type == reBEFORE) { - $this->beforeRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval); + $this->beforeRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval, 'Status' => $status); } else { - $this->afterRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval); + $this->afterRegularEvents[$short_name] = Array('EventName' => $event_name, 'RunInterval' => $run_interval, 'Status' => $status); } } @@ -436,7 +439,7 @@ if ( ($event->status == erSUCCESS || $event->status == erPERM_FAIL) && ($event->redirect === true || strlen($event->redirect) > 0)) { // we need to pass category if the action was submitted to self-template, with the category passed // and it has not explicly set redirect template or pass_cateogry param - if ($event->redirect === true && !isset($event->redirect_params['pass_category']) && $this->Application->GetVar('m_cat_id')) { + if ($event->redirect === true && !array_key_exists('pass_category', $event->redirect_params) && $this->Application->GetVar('m_cat_id')) { $event->redirect_params['pass_category'] = 1; } @@ -529,7 +532,7 @@ $this->Application->SetVar('m_opener', 's'); - $this->Application->StoreVar(rtrim('opener_stack_'.$wid, '_'), serialize($opener_stack)); + $this->Application->StoreVar(rtrim('opener_stack_'.$wid, '_'), serialize($opener_stack), !$opener_stack); // empty stack is optional } /** @@ -557,6 +560,23 @@ // change opener stack $default_params = Array ('m_opener' => 'u', '__URLENCODE__' => 1); + + if (!$this->Application->ConfigValue('UsePopups') && $wid) { + // remove wid to show combined header block in editing window + $default_params['m_wid'] = ''; + + // move last popup's opener stack elemenent to main window's opener stack + if ($opener_stack) { + list ($index_file, $env) = explode('|', $opener_stack[ count($opener_stack) - 1 ], 2); + $main_params = $this->Application->HttpQuery->processQueryString($env, 'pass'); + $main_template = $main_params['t']; + unset($main_params['t']); + + $main_params = array_merge($main_params, $default_params); + $this->openerStackPush($main_template, $main_params, $main_params['pass'], ''); + } + } + $redirect_params = array_merge_recursive2($default_params, $params); $new_level = $this->Application->BuildEnv($template, $redirect_params, $pass, true); array_push($opener_stack, 'index.php|' . ltrim($new_level, ENV_VAR_NAME . '=') ); @@ -787,7 +807,5 @@ { return array_search($event_key, $this->recursionStack) !== false; } - } - -?> \ No newline at end of file + } \ No newline at end of file