issue 2119. supporting php 5.4. modules and widgets.

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12706 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2013-02-05 09:45:04 +00:00
parent ff75082eee
commit 8a7c28babc
90 changed files with 572 additions and 83 deletions

View file

@ -104,6 +104,7 @@ class documentController extends document
*/
function deleteDocumentAliasByModule($module_srl)
{
$args = new stdClass();
$args->module_srl = $module_srl;
executeQuery("document.deleteAlias", $args);
}
@ -115,6 +116,7 @@ class documentController extends document
*/
function deleteDocumentAliasByDocument($document_srl)
{
$args =new stdClass();
$args->document_srl = $document_srl;
executeQuery("document.deleteAlias", $args);
}
@ -128,6 +130,7 @@ class documentController extends document
*/
function deleteDocumentHistory($history_srl, $document_srl, $module_srl)
{
$args = new stdClass();
$args->history_srl = $history_srl;
$args->module_srl = $module_srl;
$args->document_srl = $document_srl;
@ -199,7 +202,7 @@ class documentController extends document
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
if($obj->homepage && !preg_match('/^[a-z]+:\/\//i',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
if($obj->notify_message != 'Y') $obj->notify_message = 'N';
if(!$isRestore) $obj->ipaddress = $_SERVER['REMOTE_ADDR']; //board?<3F>서 form keyê°ìœ¼ë¡?ipaddressë¥??¬ìš©?˜ë©´ ?„한 ipê°€ ?±ë¡<C3AB>?? ?„í„°?€???<3F>ê??†ìŠ´
if(!$isRestore) $obj->ipaddress = $_SERVER['REMOTE_ADDR']; //board?<3F>서 form key값으<EAB092>?ipaddress<73>??<3F>용?<3F>면 ?<3F>한 ip가 ?<3F>록?? ?<3F>터?<3F>???<3F><>??<3F>
// Serialize the $extra_vars, check the extra_vars type, because duplicate serialized avoid
if(!is_string($obj->extra_vars)) $obj->extra_vars = serialize($obj->extra_vars);
@ -353,6 +356,10 @@ class documentController extends document
if(!$obj->module_srl) $obj->module_srl = $source_obj->get('module_srl');
$module_srl = $obj->module_srl;
$document_config = $oModuleModel->getModulePartConfig('document', $module_srl);
if(!$document_config)
{
$document_config = new stdClass();
}
if(!isset($document_config->use_history)) $document_config->use_history = 'N';
$bUseHistory = $document_config->use_history == 'Y' || $document_config->use_history == 'Trace';
@ -537,6 +544,7 @@ class documentController extends document
function deleteDocument($document_srl, $is_admin = false, $isEmptyTrash = false, $oDocument = null)
{
// Call a trigger (before)
$trigger_obj =new stdClass();
$trigger_obj->document_srl = $document_srl;
$output = ModuleHandler::triggerCall('document.deleteDocument', 'before', $trigger_obj);
if(!$output->toBool()) return $output;
@ -559,6 +567,7 @@ class documentController extends document
if(!$oDocument->isGranted()) return new Object(-1, 'msg_not_permitted');
//if empty trash, document already deleted, therefore document not delete
$args = new stdClass();
$args->document_srl = $document_srl;
if(!$isEmptyTrash)
{
@ -656,6 +665,7 @@ class documentController extends document
*/
function moveDocumentToTrash($obj)
{
$trash_args = new stdClass();
// Get trash_srl if a given trash_srl doesn't exist
if(!$obj->trash_srl) $trash_args->trash_srl = getNextSequence();
else $trash_args->trash_srl = $obj->trash_srl;
@ -680,6 +690,7 @@ class documentController extends document
$trash_args->nick_name = $logged_info->nick_name;
}
// Date setting for updating documents
$doucment_args = new stdClass();
$document_args->module_srl = 0;
$document_args->document_srl = $obj->document_srl;
@ -731,6 +742,7 @@ class documentController extends document
// Set the attachment to be invalid state
if($oDocument->hasUploadedFiles())
{
$args = new stdClass();
$args->upload_target_srl = $oDocument->document_srl;
$args->isvalid = 'N';
executeQuery('file.updateFileValid', $args);
@ -824,6 +836,7 @@ class documentController extends document
{
if(!$module_srl || !$var_idx || !$var_name || !$var_type || !$eid) return new Object(-1,'msg_invalid_request');
$obj = new stdClass();
$obj->module_srl = $module_srl;
$obj->var_idx = $var_idx;
$obj->var_name = $var_name;
@ -852,6 +865,7 @@ class documentController extends document
function deleteDocumentExtraKeys($module_srl, $var_idx = null)
{
if(!$module_srl) return new Object(-1,'msg_invalid_request');
$obj = new stdClass();
$obj->module_srl = $module_srl;
if(!is_null($var_idx)) $obj->var_idx = $var_idx;
@ -933,6 +947,7 @@ class documentController extends document
*/
function deleteDocumentExtraVars($module_srl, $document_srl = null, $var_idx = null, $lang_code = null, $eid = null)
{
$obj =new stdClass();
$obj->module_srl = $module_srl;
if(!is_null($document_srl)) $obj->document_srl = $document_srl;
if(!is_null($var_idx)) $obj->var_idx = $var_idx;
@ -1072,6 +1087,7 @@ class documentController extends document
}
// Check if previously reported
$args = new stdClass();
$args->document_srl = $document_srl;
$output = executeQuery('document.getDeclaredDocument', $args);
if(!$output->toBool()) return $output;
@ -1166,6 +1182,7 @@ class documentController extends document
*/
function updateCommentCount($document_srl, $comment_count, $last_updater, $comment_inserted = false)
{
$args = new stdClass();
$args->document_srl = $document_srl;
$args->comment_count = $comment_count;
@ -1289,6 +1306,7 @@ class documentController extends document
*/
function deleteCategory($category_srl)
{
$args = new stdClass();
$args->category_srl = $category_srl;
$oDocumentModel = &getModel('document');
$category_info = $oDocumentModel->getCategory($category_srl);
@ -1302,8 +1320,7 @@ class documentController extends document
$this->makeCategoryFile($category_info->module_srl);
// Update category_srl of the documents in the same category to 0
unset($args);
$args = new stdClass();
$args->target_category_srl = 0;
$args->source_category_srl = $category_srl;
$output = executeQuery('document.updateDocumentCategory', $args);
@ -1318,6 +1335,7 @@ class documentController extends document
*/
function deleteModuleCategory($module_srl)
{
$args = new stdClass();
$args->module_srl = $module_srl;
$output = executeQuery('document.deleteModuleCategory', $args);
return $output;
@ -1666,6 +1684,7 @@ class documentController extends document
$xml_file = sprintf("./files/cache/document_category/%s.xml.php", $module_srl);
$php_file = sprintf("./files/cache/document_category/%s.php", $module_srl);
// Get a category list
$args = new stdClass();
$args->module_srl = $module_srl;
$args->sort_index = 'list_order';
$output = executeQuery('document.getCategoryList', $args);
@ -1900,6 +1919,7 @@ class documentController extends document
$document_popup_menu_list = Context::get('document_popup_menu_list');
if(!is_array($document_popup_menu_list)) $document_popup_menu_list = array();
$obj = new stdClass();
$obj->url = $url;
$obj->str = $str;
$obj->icon = $icon;
@ -2074,6 +2094,7 @@ class documentController extends document
}
else if($type == 'trash')
{
$args = new stdClass();
$args->description = $message_content;
$oDB = &DB::getInstance();