NOISSUE PHP 버전 호환성 개선

This commit is contained in:
bnu 2013-12-17 18:41:11 +09:00
parent cd1dfda2a2
commit 0ccf7bb6a8
7 changed files with 57 additions and 35 deletions

View file

@ -913,6 +913,7 @@ class documentModel extends document
{
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('document');
if(!$config) $config = new stdClass;
if(!$config->thumbnail_type) $config->thumbnail_type = 'crop';
$GLOBALS['__document_config__'] = $config;
}

View file

@ -43,6 +43,7 @@ class image_gallery extends EditorHandler
*/
function transHTML($xml_obj)
{
$gallery_info = new stdClass;
$gallery_info->srl = rand(111111,999999);
$gallery_info->border_thickness = $xml_obj->attrs->border_thickness;
$gallery_info->gallery_style = $xml_obj->attrs->gallery_style;
@ -57,12 +58,13 @@ class image_gallery extends EditorHandler
// If you set the output to output the XML code generated a list of the image
if(Context::getResponseMethod() == 'XMLRPC')
{
$output = '';
$output = array();
for($i=0;$i<count($gallery_info->images_list);$i++)
{
$output .= sprintf('<img src="%s" alt="" /><br />', $gallery_info->images_list[$i]);
$output[] = sprintf('<img src="%s" alt="" />', $gallery_info->images_list[$i]);
}
return $output;
$output[] = '<br />';
return implode('<br />', $output);
}
// HTML gallery output, the output settings via the template for the conversion to generate the html code should
preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);

View file

@ -22,6 +22,7 @@ class editorController extends editor
$this->deleteSavedDoc(false);
$args = new stdClass;
$args->document_srl = Context::get('document_srl');
$args->content = Context::get('content');
$args->title = Context::get('title');
@ -67,7 +68,10 @@ class editorController extends editor
$vars = $oComponent->getVariables();
if(count($vars))
{
foreach($vars as $key=>$val) $this->add($key, $val);
foreach($vars as $key => $val)
{
$this->add($key, $val);
}
}
}
@ -182,11 +186,12 @@ class editorController extends editor
$content_font_size = $editor_config->content_font_size;
if($content_font || $content_font_size)
{
$buff = '<style> .xe_content { ';
if($content_font) $buff .= 'font-family:'.$content_font.';';
if($content_font_size) $buff .= 'font-size:'.$content_font_size.';';
$buff .= ' }</style>';
Context::addHtmlHeader($buff);
$buff = array();
$buff[] = '<style> .xe_content { ';
if($content_font) $buff[] = 'font-family:'.$content_font.';';
if($content_font_size) $buff[] = 'font-size:'.$content_font_size.';';
$buff[] = ' }</style>';
Context::addHtmlHeader(implode('', $buff));
}
}
@ -213,6 +218,7 @@ class editorController extends editor
preg_match_all('/([a-z0-9_-]+)="([^"]+)"/is', $script, $m);
$xml_obj = new stdClass;
$xml_obj->attrs = new stdClass;
for($i=0,$c=count($m[0]);$i<$c;$i++)
{
$xml_obj->attrs->{$m[1][$i]} = $m[2][$i];
@ -220,6 +226,7 @@ class editorController extends editor
$xml_obj->body = $match[4];
if(!$xml_obj->attrs->editor_component) return $match[0];
// Get converted codes by using component::transHTML()
$oEditorModel = &getModel('editor');
$oComponent = &$oEditorModel->getComponentObject($xml_obj->attrs->editor_component, 0);
@ -243,6 +250,7 @@ class editorController extends editor
{
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
}
// Get the current module if module_srl doesn't exist
if(!$args->module_srl)
{
@ -345,6 +353,7 @@ class editorController extends editor
function makeCache($filter_enabled = true, $site_srl)
{
$oEditorModel = &getModel('editor');
$args = new stdClass;
if($filter_enabled) $args->enabled = "Y";
@ -355,8 +364,10 @@ class editorController extends editor
}
else $output = executeQuery('editor.getComponentList', $args);
$db_list = $output->data;
// Get a list of files
$downloaded_list = FileHandler::readDir(_XE_PATH_.'modules/editor/components');
// Get information about log-in status and its group
$is_logged = Context::get('is_logged');
if($is_logged)
@ -368,6 +379,7 @@ class editorController extends editor
}
else $group_list = array();
}
// Get xml information for looping DB list
if(!is_array($db_list)) $db_list = array($db_list);
$component_list = new stdClass();
@ -435,6 +447,7 @@ class editorController extends editor
if(file_exists($icon_file)) $component_list->{$component_name}->icon = true;
if(file_exists($component_icon_file)) $component_list->{$component_name}->component_icon = true;
}
// Return if it checks enabled only
if($filter_enabled)
{
@ -443,6 +456,7 @@ class editorController extends editor
FileHandler::writeFile($cache_file, $buff);
return $component_list;
}
// Get xml_info of downloaded list
foreach($downloaded_list as $component_name)
{

View file

@ -602,6 +602,7 @@ class fileController extends file
function insertFile($file_info, $module_srl, $upload_target_srl, $download_count = 0, $manual_insert = false)
{
// Call a trigger (before)
$trigger_obj = new stdClass;
$trigger_obj->module_srl = $module_srl;
$trigger_obj->upload_target_srl = $upload_target_srl;
$output = ModuleHandler::triggerCall('file.insertFile', 'before', $trigger_obj);
@ -626,6 +627,7 @@ class fileController extends file
// An error appears if file size exceeds a limit
if($allowed_filesize < filesize($file_info['tmp_name'])) return new Object(-1, 'msg_exceeds_limit_size');
// Get total file size of all attachements (from DB)
$size_args = new stdClass;
$size_args->upload_target_srl = $upload_target_srl;
$output = executeQuery('file.getAttachedFileSize', $size_args);
$attached_size = (int)$output->data->attached_size + filesize($file_info['tmp_name']);
@ -690,6 +692,7 @@ class fileController extends file
$oMemberModel = &getModel('member');
$member_srl = $oMemberModel->getLoggedMemberSrl();
// List file information
$args = new stdClass;
$args->file_srl = getNextSequence();
$args->upload_target_srl = $upload_target_srl;
$args->module_srl = $module_srl;
@ -879,7 +882,7 @@ class fileController extends file
// Move the file
FileHandler::rename($old_file, $new_file);
// Update DB information
unset($args);
$args = new stdClass;
$args->file_srl = $file_info->file_srl;
$args->uploaded_filename = $new_file;
$args->module_srl = $file_info->module_srl;

View file

@ -40,6 +40,7 @@ class integration_searchView extends integration_search
if(!$this->grant->access) return new Object(-1,'msg_not_permitted');
$config = $oModuleModel->getModuleConfig('integration_search');
if(!$config) $config = new stdClass;
if(!$config->skin)
{
$config->skin = 'default';
@ -60,7 +61,8 @@ class integration_searchView extends integration_search
}
// Template path
$this->setTemplatePath($template_path);
Context::set('module_info', unserialize($config->skin_vars));
$skin_vars = ($config->skin_vars) ? unserialize($config->skin_vars) : new stdClass;
Context::set('module_info', $skin_vars);
$target = $config->target;
if(!$target) $target = 'include';

View file

@ -1730,6 +1730,7 @@ class memberController extends member
if($keep_signed)
{
// Key generate for auto login
$autologin_args = new stdClass;
$autologin_args->autologin_key = md5(strtolower($user_id).$this->memberInfo->password.$_SERVER['HTTP_USER_AGENT']);
$autologin_args->member_srl = $this->memberInfo->member_srl;
executeQuery('member.deleteAutologin', $autologin_args);

View file

@ -28,6 +28,7 @@ class pollController extends poll
$logged_info = Context::get('logged_info');
$vars = Context::getRequestVars();
$args = new stdClass;
$tmp_args = array();
foreach($vars as $key => $val)
{
@ -41,6 +42,7 @@ class pollController extends poll
if($logged_info->is_admin != 'Y') $val = htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
$tmp_args[$poll_index] = new stdClass;
if($tmp_arr[0]=='title') $tmp_args[$poll_index]->title = $val;
else if($tmp_arr[0]=='checkcount') $tmp_args[$poll_index]->checkcount = $val;
else if($tmp_arr[0]=='item') $tmp_args[$poll_index]->item[] = $val;
@ -64,7 +66,6 @@ class pollController extends poll
$oDB->begin();
// Register the poll
unset($poll_args);
$poll_args = new stdClass;
$poll_args->poll_srl = $poll_srl;
$poll_args->member_srl = $member_srl;
@ -81,7 +82,6 @@ class pollController extends poll
// Individual poll registration
foreach($args->poll as $key => $val)
{
unset($title_args);
$title_args = new stdClass;
$title_args->poll_srl = $poll_srl;
$title_args->poll_index_srl = getNextSequence();
@ -101,7 +101,6 @@ class pollController extends poll
// Add the individual survey items
foreach($val->item as $k => $v)
{
unset($item_args);
$item_args = new stdClass;
$item_args->poll_srl = $poll_srl;
$item_args->poll_index_srl = $title_args->poll_index_srl;