reverse merge from 1.6.0 (r10578)

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10689 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2012-05-16 09:02:50 +00:00
parent 2b7a348eae
commit ac1783e77f
3 changed files with 9 additions and 5 deletions

View file

@ -695,8 +695,11 @@
/**
* @brief Change user-defined language
**/
function replaceDefinedLangCode(&$output) {
$output = preg_replace_callback('!\$user\_lang\-\>([A-Za-z0-9\_]+)!s', array($this,'_replaceLangCode'), $output);
function replaceDefinedLangCode(&$output, $isReplaceLangCode = true) {
if($isReplaceLangCode)
{
$output = preg_replace_callback('!\$user_lang->([a-z0-9\_]+)!is', array($this,'_replaceLangCode'), $output);
}
}
function _replaceLangCode($matches) {
static $lang = null;

View file

@ -254,7 +254,8 @@
Context::set('content', $content);
// Convert them to teach the widget
$oWidgetController = &getController('widget');
$content = $oWidgetController->transWidgetCode($content, true);
$content = $oWidgetController->transWidgetCode($content, true, false);
$content = str_replace('$', '$', $content);
Context::set('page_content', $content);
// Set widget list
$oWidgetModel = &getModel('widget');

View file

@ -230,10 +230,10 @@
/**
* @breif By converting the specific content of the widget tag return
**/
function transWidgetCode($content, $javascript_mode = false) {
function transWidgetCode($content, $javascript_mode = false, $isReplaceLangCode = true) {
// Changing user-defined language
$oModuleController = &getController('module');
$oModuleController->replaceDefinedLangCode($content);
$oModuleController->replaceDefinedLangCode($content, $isReplaceLangCode);
// Check whether to include information about editing
$this->javascript_mode = $javascript_mode;
// Widget code box change