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,7 +2,7 @@
/**
* @class DisplayHandler
* @author NHN (developers@xpressengine.com)
* @brief DisplayHandler is responsible for displaying the execution result. \n
* DisplayHandler is responsible for displaying the execution result. \n
* Depending on the request type, it can display either HTML or XML content.\n
* Xml content is simple xml presentation of variables in oModule while html content
* is the combination of the variables of oModue and template files/.
@ -16,11 +16,11 @@
var $handler = null;
/**
* @brief print either html or xml content given oModule object
* @remark addon execution and the trigger execution are included within this method, which
* might create inflexibility for the fine grained caching
* @param[in] $oModule the module object
**/
* print either html or xml content given oModule object
* @remark addon execution and the trigger execution are included within this method, which might create inflexibility for the fine grained caching
* @param ModuleObject $oModule the module object
* @return void
**/
function printContent(&$oModule) {
// Check if the gzip encoding supported
if(
@ -82,9 +82,10 @@
/**
* @brief Print debugging message to designated output source depending on the value set to __DEBUG_OUTPUT_. \n
* This method only functions when __DEBUG__ variable is set to 1.
* __DEBUG_OUTPUT__ == 0, messages are written in ./files/_debug_message.php
* Print debugging message to designated output source depending on the value set to __DEBUG_OUTPUT_. \n
* This method only functions when __DEBUG__ variable is set to 1.
* __DEBUG_OUTPUT__ == 0, messages are written in ./files/_debug_message.php
* @return void
**/
function _debugOutput() {
if(!__DEBUG__) return;
@ -221,7 +222,8 @@
}
/**
* @brief print a HTTP HEADER for XML, which is encoded in UTF-8
* print a HTTP HEADER for XML, which is encoded in UTF-8
* @return void
**/
function _printXMLHeader() {
header("Content-Type: text/xml; charset=UTF-8");
@ -234,7 +236,8 @@
/**
* @brief print a HTTP HEADER for HTML, which is encoded in UTF-8
* print a HTTP HEADER for HTML, which is encoded in UTF-8
* @return void
**/
function _printHTMLHeader() {
header("Content-Type: text/html; charset=UTF-8");
@ -247,7 +250,8 @@
/**
* @brief print a HTTP HEADER for JSON, which is encoded in UTF-8
* print a HTTP HEADER for JSON, which is encoded in UTF-8
* @return void
**/
function _printJSONHeader() {
header("Content-Type: text/html; charset=UTF-8");
@ -260,7 +264,8 @@
/**
* @brief print a HTTP HEADER for HTML, which is encoded in UTF-8
* print a HTTP HEADER for HTML, which is encoded in UTF-8
* @return void
**/
function _printHttpStatusCode($code) {
$statusMessage = Context::get('http_status_message');

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();

View file

@ -1,6 +1,11 @@
<?php
class JSONDisplayHandler {
/**
* Produce JSON compliant content given a module object.\n
* @param ModuleObject $oModule the module object
* @return string
**/
function toDoc(&$oModule)
{
$variables = $oModule->getVariables();

View file

@ -2,8 +2,9 @@
class VirtualXMLDisplayHandler {
/**
* @brief Produce virtualXML compliant content given a module object.\n
* @param[in] $oModule the module object
* Produce virtualXML compliant content given a module object.\n
* @param ModuleObject $oModule the module object
* @return string
**/
function toDoc(&$oModule)

View file

@ -2,8 +2,9 @@
class XMLDisplayHandler {
/**
* @brief Produce XML compliant content given a module object.\n
* @param[in] $oModule the module object
* Produce XML compliant content given a module object.\n
* @param ModuleObject $oModule the module object
* @return string
**/
function toDoc(&$oModule)
{
@ -21,8 +22,9 @@ class XMLDisplayHandler {
}
/**
* @brief produce XML code given variable object\n
* @param[in] $oModule the module object
* produce XML code given variable object\n
* @param object $obj
* @return string
**/
function _makeXmlDoc($obj) {
if(!count($obj)) return;