$ID, 'preact' => $ACT]; //get section name when coming from section edit if ($INPUT->has('hid')) { // Use explicitly transmitted header id $opts['fragment'] = $INPUT->str('hid'); } elseif ($PRE && preg_match('/^\s*==+([^=\n]+)/', $TEXT, $match)) { // Fallback to old mechanism $check = false; //Byref $opts['fragment'] = sectionID($match[0], $check); } // execute the redirect Event::createAndTrigger('ACTION_SHOW_REDIRECT', $opts, [$this, 'redirect']); // should never be reached throw new ActionAbort('show'); } /** * Execute the redirect * * Default action for ACTION_SHOW_REDIRECT * * @param array $opts id and fragment for the redirect and the preact */ public function redirect($opts) { $go = wl($opts['id'], '', true, '&'); if (isset($opts['fragment'])) $go .= '#' . $opts['fragment']; //show it send_redirect($go); } }