merge from 1.5.3 (~r10943)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@10951 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-07-27 02:47:10 +00:00
parent 7aa4798373
commit 54e3a72065
334 changed files with 13011 additions and 5561 deletions

View file

@ -2,8 +2,9 @@
class HTMLDisplayHandler {
/**
* @brief Produce HTML compliant content given a module object.\n
* @param[in] $oModule the module object
* Produce HTML compliant content given a module object.\n
* @param ModuleObject $oModule the module object
* @return string compiled template string
**/
function toDoc(&$oModule)
{
@ -79,6 +80,11 @@ class HTMLDisplayHandler {
return $output;
}
/**
* when display mode is HTML, prepare code before print.
* @param string $output compiled template string
* @return void
**/
function prepareToPrint(&$output) {
if(Context::getResponseMethod() != 'HTML') return;
@ -151,6 +157,11 @@ class HTMLDisplayHandler {
$oModuleController->replaceDefinedLangCode($output);
}
/**
* when display mode is HTML, prepare code before print about <input> tag value.
* @param array $match input value.
* @return string input value.
**/
function _preserveValue($match)
{
$INPUT_ERROR = Context::get('INPUT_ERROR');
@ -164,7 +175,7 @@ class HTMLDisplayHandler {
switch($type){
case 'text':
case 'hidden':
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str).' value="'.htmlspecialchars($INPUT_ERROR[$match[3]]).'"';
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str).' value="'.@htmlspecialchars($INPUT_ERROR[$match[3]]).'"';
break;
case 'password':
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str);
@ -172,7 +183,7 @@ class HTMLDisplayHandler {
case 'radio':
case 'checkbox':
$str = preg_replace('@\schecked(="[^"]*?")?@', ' ', $str);
if(preg_match('@\s(?i:value)="'.$INPUT_ERROR[$match[3]].'"@', $str)) {
if(@preg_match('@\s(?i:value)="'.$INPUT_ERROR[$match[3]].'"@', $str)) {
$str .= ' checked="checked"';
}
break;
@ -181,6 +192,11 @@ class HTMLDisplayHandler {
return $str.' />';
}
/**
* when display mode is HTML, prepare code before print about <select> tag value.
* @param array $matches select tag.
* @return string select tag.
**/
function _preserveSelectValue($matches)
{
$INPUT_ERROR = Context::get('INPUT_ERROR');
@ -200,6 +216,11 @@ class HTMLDisplayHandler {
return $mm[0].implode('', $m[0]).'</select>';
}
/**
* when display mode is HTML, prepare code before print about <textarea> tag value.
* @param array $matches textarea tag information.
* @return string textarea tag
**/
function _preserveTextAreaValue($matches)
{
$INPUT_ERROR = Context::get('INPUT_ERROR');
@ -208,23 +229,29 @@ class HTMLDisplayHandler {
}
/**
* @brief add html style code extracted from html body to Context, which will be
* add html style code extracted from html body to Context, which will be
* printed inside <header></header> later.
* @param[in] $oModule the module object
* @param array $matches
* @return void
**/
function _moveStyleToHeader($matches) {
Context::addHtmlHeader($matches[0]);
}
/**
* @brief add given .css or .js file names in widget code to Context
* @param[in] $oModule the module object
* add given .css or .js file names in widget code to Context
* @param array $matches
* @return void
**/
function _transMeta($matches) {
if($matches[1]) return '';
Context::loadFile($matches[2]);
}
/**
* import basic .js files.
* @return void
**/
function _loadJSCSS()
{
$oContext =& Context::getInstance();
@ -260,6 +287,10 @@ class HTMLDisplayHandler {
}
}
/**
* add meta tag.
* @return void
**/
function _addMetaTag()
{
$oContext =& Context::getInstance();