/** * Save history entry * * @param CMbObject $object Object * @param string $type Type of view * @param array $params Parameters * * @return void */ static function save(CMbObject $object, $type = self::TYPE_VIEW, $params = array()) { global $m, $action, $actionType, $suppressHeaders, $ajax, $dialog; if ($suppressHeaders || $ajax || $dialog) { return; } $length = CAppUI::pref("navigationHistoryLength"); if ($length <= 0) { return; } $entry = new self($m, $action, $actionType, $object, $params, $type); $key = $entry->getKey(); $history = self::getHistory(); $history_key = CValue::get("_history_key"); if ($history_key) { unset($history[$history_key]); } $history[$key] = $entry; if (count($history) > min(20, $length)) { array_shift($history); } $_SESSION[self::SESSION_KEY] = $history; }
public static function staticGetKey($array, $keys, $callback = false, $other_params = array()) { $self = new self($array, $callback); $self->getKey($keys); if ($callback !== false) { $self->runCallback($other_params); } return $self->getArray(); }