function setAjaxStubContext() { $GLOBALS["stub_context"] = KT_Rel2AbsUrl(KT_getUri(), "", $this->file_name, true); if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") { $GLOBALS["stub_context"] .= "?" . $_SERVER['QUERY_STRING']; } }
/** * Add these fields/values to transaction: kt_login_user, kt_login_password, kt_login_page, kt_login_redirect; * Register the trigger Trigger_ForgotPassword_RemoveDynamicFields on ERROR * @param object tNG transaction object * @return nothing * @access public */ function Trigger_ForgotPassword_AddDynamicFields(&$tNG) { $tNG->addColumn("kt_login_user", "STRING_TYPE", "VALUE", $tNG->kt_login_user); $tNG->addColumn("kt_login_password", "STRING_TYPE", "VALUE", $tNG->kt_login_password); $tmpRelPath = KT_makeIncludedURL($tNG->dispatcher->relPath); $login_page = KT_Rel2AbsUrl(KT_getUri(), $tmpRelPath, $GLOBALS['tNG_login_config']['login_page'], true); $tNG->addColumn("kt_login_page", "STRING_TYPE", "VALUE", $login_page); $redirect_page = KT_addReplaceParam($tmpRelPath . $GLOBALS['tNG_login_config']['login_page'], "info", "FORGOT"); $tNG->addColumn("kt_login_redirect", "STRING_TYPE", "VALUE", $redirect_page); $tNG->registerTrigger("ERROR", "Trigger_ForgotPassword_RemoveDynamicFields", -100); return null; }
/** * Return the URL of the page in which the script is called and the query string if exists. * @return string return the URL (ex. http://server.com/dir/papa.php?mod=return ); */ function KT_getFullUri() { $ret = KT_getUri(); if (strpos($_SERVER['REQUEST_URI'], '?') !== false) { $pos = strpos($_SERVER['REQUEST_URI'], '?'); $query_string = substr($_SERVER['REQUEST_URI'], $pos); if (trim($query_string) != '') { $ret = $ret . $query_string; } } return $ret; }
/** * Constructor. Set transaction. * @param object $tNG the transaction * @access public */ function tNG_Email(&$tNG) { $this->tNG =& $tNG; $this->from = ''; $this->to = ''; $this->cc = ''; $this->bcc = ''; $this->subject = ''; $this->content = ''; $this->contentFile = ''; $this->file = basename(KT_getUri()); $this->encoding = ''; $this->priority = 3; $this->escapeMethod = 'none'; }
/** * returns a string script with the entire panel parameters * @return null */ function serializeConfigToJs() { $toret = '<!--' . "\n"; $toret .= ' $app_path = "' . KT_getUri() . '";' . "\n"; $toret .= ' $ctrl = new Controller(function() {' . "\n"; foreach ($this->panels as $panelId => $notused) { $panelObj =& $this->panels[$panelId]; $toret .= ' $panel_' . $panelId . ' = $ctrl.createPanel(\'' . KT_escapeJS($panelId) . '\');' . "\n"; $toret .= ' $panel_' . $panelId . '.setUpdateEffect(\'' . KT_escapeJS($panelObj->updateEffect) . '\');' . "\n"; foreach ($panelObj->states as $panelState => $o) { $toret .= ' $panel_' . $panelId . '.addState(\'' . KT_escapeJS($panelState) . '\', \'' . KT_escapeJS($o['file_name']) . '\', \'' . KT_escapeJS($o['title']) . '\');' . "\n"; } $toret .= ' $panel_' . $panelId . '.setCurrentState(\'' . KT_escapeJS($panelObj->currentState) . '\');' . "\n"; } if ($this->getMasterPanel() !== null) { $toret .= ' $ctrl.setMasterPanel(\'' . KT_escapeJS($this->getMasterPanel()) . '\');' . "\n"; } $toret .= ' Controller.initializeHistory();' . "\n"; $toret .= ' });' . "\n"; $toret .= '//-->' . "\n"; return $toret; }
/** * Getter. Get htmlBody. * prepend to the content the html header tags with any CSS if found, and * add the html footer; * @return string the content of the email (can have any html tags but <script>) * @access protected */ function getHtmlBody() { if ($this->format != 'text') { $content = $this->getHeader(); $content .= $this->content; $content .= $this->getFooter(); return KT_transformsPaths(KT_getUri(), $content, true); } else { return; } }