/** * Will return the <html><head><base href=''> container. This method is used by core developers to add the specific container and * <base href=''> tags to the start of the header section of our generated DOM; * * @return S Will return the header container for the current page * @author Catalin Z. Alexandru <*****@*****.**> * @copyright Under the terms of the GNU General Public License v3 * @version $Id: 10_TPL.php 315 2009-10-11 07:11:31Z catalin.zamfir $ * @since Version 1.0 * @access private * @static * @final */ private static final function getHTMLHeadContainer() { // Return the <HTML><head> container; $containerHTMLHead = new FileContent(FORM_TP_DIR . _S . 'frm_web_html_head_container.tp'); return $containerHTMLHead->doToken('[%BASE_HREF_URL%]', DOCUMENT_HOST); }
/** * Will return the string made by parsing a .tp file, and replacing tokens. This method wil actually replace the tokens in the * framework error-screen template file. This will help us output debugged code to the developer so we can help him quickly find * the error he was looking for; * * @param A (native) $debugArray The debug array to be parsed * @return S (native) The array, parsed as an error screen string * @author Catalin Z. Alexandru <*****@*****.**> * @copyright Under the terms of the GNU General Public License v3 * @version $Id: 08_ERR.php 313 2009-10-09 13:27:52Z catalin.zamfir $ * @since Version 1.0 * @access private * @static */ private static function getDebugBacktrace($debugArray) { # Set the errorString, to be returned; $errorString = _NONE; foreach ($debugArray as $k => $v) { # Declare some __CODE__ variables; $codeFile = _NONE; $codeLine = 0; $debugContent = new FileContent(FORM_TP_DIR . _S . 'frm_error_debug.tp'); if (isset($debugArray[$k]['file'])) { # Replace [%FILE%] with the one given in the backtrace; $debugContent->doToken('[%FILE%]', $codeFile = str_replace(DOCUMENT_ROOT, _NONE, $debugArray[$k]['file'])); } else { # Else, determine the current __FILE__, and output something; $debugContent->doToken('[%FILE%]', $codeFile = str_replace(DOCUMENT_ROOT, _NONE, __FILE__)); } if (isset($debugArray[$k]['line'])) { # Replace [%LINE%] with the one given in the backtrace; $debugContent->doToken('[%LINE%]', $codeLine = $debugArray[$k]['line']); } else { # Set it to LINE: 20, almost near the declaration of our classes; $debugContent->doToken('[%LINE%]', $codeLine = 20); } if (isset($debugArray[$k]['class'])) { # Replace [%CLASS%] with the one in the backtrace; $debugContent->doToken('[%CLASS%]', $debugArray[$k]['class']); } else { # Set it to [no __CLASS__] ... $debugContent->doToken('[%CLASS%]', '[no __CLASS__]'); } if (isset($debugArray[$k]['function'])) { $debugContent->doToken('[%METHOD%]', $debugArray[$k]['function']); } else { $debugContent->doToken('[%METHOD%]', '[no __METHOD__]'); } # Replace [%CODE%] from error file; $debugContent->doToken('[%CODE%]', self::getDebugCode(new S($codeFile), new I($codeLine))); $debugContent->doToken('[%ID%]', $k); $errorString .= $debugContent; } # After the foreach, return the concatenated error screen; return $errorString; }
/** * Will execute necessary SQL operations on the current form ... * * This method, setSQLOperationsOnForm, you don't need to know the internal workings of it. This is because, as you can see * it is a private method, and thus, it's used internally by the class, to achieve it's goals of execution. Just pass on * and read any other 'public' or 'protected' method out there ... * * @param array $inputAttributes The core attributes (found in every HTML element) that can be set; * @param string $tp The path to the .tp file where to set those variables; */ private static function setCoreInputAttributes(A $inputAttributes, &$tp) { $coreSetAttributes = new A(); foreach ($inputAttributes as $k => $v) { switch ($k) { case 'reg_javascript_replace': // On Key Pressed ... $jssTpPath = new FileContent(FORM_TP_DIR . _S . JAVASCRIPT_DIR . _S . 'checkKeyEvent.js'); $coreSetAttributes['onkeypress'] = $jssTpPath->doToken('[%REPLACE_VALUE_EVENT%]', $v); // On Lost Focus ... $jssTpPath = new FileContent(FORM_TP_DIR . _S . JAVASCRIPT_DIR . _S . 'checkKeyEventRegExp.js'); $coreSetAttributes['onblur'] = $jssTpPath->doToken('[%REGEXP_REPLACE_JS%]', $v); self::manageJSS(new FilePath(FORM_TP_DIR . _WS . JAVASCRIPT_DIR . _WS . 'checkKey.js'), new S('RA_checkKey')); break; default: $coreSetAttributes[$k] = $v; break; } } self::tpSet($coreSetAttributes, new S('coreSetAttributes'), $tp, new S('explode')); }