function parse($str) { $ret = $this->default_json(); if ($this->mode == 'page') { $tmp = explode("QK", $str); if (count($tmp) == 2) { CoreLocal::set("qkInput", $tmp[0]); } else { CoreLocal::set("qkInput", ""); } CoreLocal::set("qkNumber", $tmp[count($tmp) - 1]); CoreLocal::set("qkCurrentId", CoreLocal::get("currentid")); $plugin_info = new QuickKeys(); $ret['main_frame'] = $plugin_info->pluginUrl() . '/QKDisplay.php'; } else { $tmp = explode('QO', $str); $num = $tmp[1]; $ret['output'] = $this->overlayKeys($num); } return $ret; }
function preprocess() { $plugin_info = new QuickKeys(); $this->plugin_url = $plugin_info->pluginUrl() . '/'; $this->offset = isset($_REQUEST['offset']) ? $_REQUEST['offset'] : 0; if (count($_POST) > 0) { $output = ""; if ($_REQUEST["clear"] == 0) { // submit process changes line break // depending on platform // apostrophes pick up slashes $choice = str_replace("\r", "", $_REQUEST["quickkey_submit"]); $choice = stripslashes($choice); $value = $_REQUEST[md5($choice)]; $output = CoreLocal::get("qkInput") . $value; CoreLocal::set("msgrepeat", 1); CoreLocal::set("strRemembered", $output); CoreLocal::set("currentid", CoreLocal::get("qkCurrentId")); } if (substr(strtoupper($output), 0, 2) == "QK") { CoreLocal::set("qkNumber", substr($output, 2)); return true; } else { $this->change_page($this->page_url . "gui-modules/pos2.php"); } return False; } return True; }