diff --git a/.gitignore b/.gitignore index 1ab6c7b20..f6d44c481 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ composer.phar *.sublime-workspace *.sublime-project .codeintel +error_log diff --git a/addons/member_communication/conf/info.xml b/addons/member_communication/conf/info.xml index 667368f27..3ae24aac0 100644 --- a/addons/member_communication/conf/info.xml +++ b/addons/member_communication/conf/info.xml @@ -5,12 +5,12 @@ 会员交流 Communication Truyền thông - 커뮤니케이션 - 커뮤니케이션 + Communication + Communication Общение 交流 - 이 애드온은 더 이상 역활을 하지 않습니다. 이 애드온의 기능은 커뮤니케이션 모듈로 흡수되었습니다. + 이 애드온은 빈 애드온입니다. 모든 기능은 커뮤니케이션 모듈로 이전되었습니다. 1.7 2013-11-27 diff --git a/addons/member_communication/member_communication.addon.php b/addons/member_communication/member_communication.addon.php index 739abc3d3..c6498c297 100644 --- a/addons/member_communication/member_communication.addon.php +++ b/addons/member_communication/member_communication.addon.php @@ -1,6 +1,6 @@ */ -/* 이 애드온은 communication 모둘로 흡수 되었습니다. */ +/* 이 애드온의 기능은 communication 모듈로 이전되었습니다. */ /* End of file member_communication.addon.php */ /* Location: ./addons/member_communication/member_communication.addon.php */ diff --git a/addons/point_level_icon/conf/info.xml b/addons/point_level_icon/conf/info.xml index 174175fca..3597262b9 100644 --- a/addons/point_level_icon/conf/info.xml +++ b/addons/point_level_icon/conf/info.xml @@ -59,4 +59,19 @@ NAVER NAVER + + + + 아이콘 중복 방지 + 그룹아이콘이 있을 경우 중복으로 레벨 아이콘을 달지 않습니다. + + 사용함 + Enabled + + + 사용하지 않음 + Disabled + + + diff --git a/addons/point_level_icon/point_level_icon.addon.php b/addons/point_level_icon/point_level_icon.addon.php index 69f7eb8d9..fd3b2919e 100644 --- a/addons/point_level_icon/point_level_icon.addon.php +++ b/addons/point_level_icon/point_level_icon.addon.php @@ -19,7 +19,9 @@ if($called_position != "before_display_content" || Context::get('act') == 'dispP require_once(_XE_PATH_ . 'addons/point_level_icon/point_level_icon.lib.php'); -$temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'pointLevelIconTrans', $output); +$temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', function($matches) use($addon_info) { + return pointLevelIconTrans($matches, $addon_info); +}, $output); if($temp_output) { $output = $temp_output; diff --git a/addons/point_level_icon/point_level_icon.lib.php b/addons/point_level_icon/point_level_icon.lib.php index 9dd9e3054..2e6c6ff7c 100644 --- a/addons/point_level_icon/point_level_icon.lib.php +++ b/addons/point_level_icon/point_level_icon.lib.php @@ -4,7 +4,7 @@ /** * @brief Function to change point icon. */ -function pointLevelIconTrans($matches) +function pointLevelIconTrans($matches, $addon_info) { $member_srl = $matches[3]; // If anonymous or not member_srl go to Hide Point Icon @@ -13,16 +13,18 @@ function pointLevelIconTrans($matches) return $matches[0]; } - $orig_text = preg_replace('/' . preg_quote($matches[5], '/') . '<\/' . $matches[6] . '>$/', '', $matches[0]); - - $oMemberModel = getModel('member'); - - // Check Group Image Mark - if($oMemberModel->getGroupImageMark($member_srl)) + if($addon_info->icon_duplication != 'N') { - return $orig_text . $matches[5] . ''; + // Check Group Image Mark + $oMemberModel = getModel('member'); + if($oMemberModel->getGroupImageMark($member_srl)) + { + return $matches[0]; + } } + $orig_text = preg_replace('/' . preg_quote($matches[5], '/') . '<\/' . $matches[6] . '>$/', '', $matches[0]); + if(!isset($GLOBALS['_pointLevelIcon'][$member_srl])) { // Get point configuration diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 1479efabe..3be9dc4d9 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -157,6 +157,11 @@ class Context */ public $isSuccessInit = TRUE; + /** + * Plugin blacklist cache + */ + private static $_blacklist = null; + /** * Singleton instance * @var object @@ -222,7 +227,6 @@ class Context // Set global variables for backward compatibility. $GLOBALS['__Context__'] = $this; - $GLOBALS['lang'] = &$this->lang; $this->_COOKIE = $_COOKIE; // Set information about the current request. @@ -299,6 +303,7 @@ class Context $this->lang = Rhymix\Framework\Lang::getInstance($this->lang_type); $this->lang->loadDirectory(RX_BASEDIR . 'common/lang', 'common'); $this->lang->loadDirectory(RX_BASEDIR . 'modules/module/lang', 'module'); + $GLOBALS['lang'] = $this->lang; // set session handler if(self::isInstalled() && config('session.use_db')) @@ -476,12 +481,13 @@ class Context } if (!count($config)) { + self::$_instance->db_info = self::$_instance->db_info ?: new stdClass; return; } // Copy to old format for backward compatibility. self::$_instance->db_info = self::convertDBInfo($config); - self::$_instance->allow_rewrite = self::$_instance->db_info->use_rewrite; + self::$_instance->allow_rewrite = self::$_instance->db_info->use_rewrite === 'Y'; self::set('_http_port', self::$_instance->db_info->http_port ?: null); self::set('_https_port', self::$_instance->db_info->https_port ?: null); self::set('_use_ssl', self::$_instance->db_info->use_ssl); @@ -871,7 +877,14 @@ class Context { $plugin_name = null; } - return self::$_instance->lang->loadDirectory($path, $plugin_name); + + if (!$GLOBALS['lang'] instanceof Rhymix\Framework\Lang) + { + $GLOBALS['lang'] = Rhymix\Framework\Lang::getInstance(self::$_instance->lang_type ?: config('locale.default_lang') ?: 'ko'); + $GLOBALS['lang']->loadDirectory(RX_BASEDIR . 'common/lang', 'common'); + } + + return $GLOBALS['lang']->loadDirectory($path, $plugin_name); } /** @@ -914,14 +927,13 @@ class Context */ public static function getLang($code) { - if (self::$_instance->lang) + if (!$GLOBALS['lang'] instanceof Rhymix\Framework\Lang) { - return self::$_instance->lang->get($code); - } - else - { - return $code; + $GLOBALS['lang'] = Rhymix\Framework\Lang::getInstance(self::$_instance->lang_type ?: config('locale.default_lang') ?: 'ko'); + $GLOBALS['lang']->loadDirectory(RX_BASEDIR . 'common/lang', 'common'); } + + return $GLOBALS['lang']->get($code); } /** @@ -933,10 +945,13 @@ class Context */ public static function setLang($code, $val) { - if (self::$_instance->lang) + if (!$GLOBALS['lang'] instanceof Rhymix\Framework\Lang) { - self::$_instance->lang->set($code, $val); + $GLOBALS['lang'] = Rhymix\Framework\Lang::getInstance(self::$_instance->lang_type ?: config('locale.default_lang') ?: 'ko'); + $GLOBALS['lang']->loadDirectory(RX_BASEDIR . 'common/lang', 'common'); } + + $GLOBALS['lang']->set($code, $val); } /** @@ -1172,7 +1187,7 @@ class Context { continue; } - $key = htmlentities($key); + $key = escape($key); $val = $this->_filterRequestVar($key, $val); if($requestMethod == 'GET' && isset($_GET[$key])) @@ -1348,7 +1363,7 @@ class Context $result = array(); foreach($val as $k => $v) { - $k = htmlentities($k); + $k = escape($k); if($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0) { $result[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int) $v : $v; @@ -1367,10 +1382,21 @@ class Context if($do_stripslashes && version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc()) { - $result[$k] = stripslashes($result[$k]); + if (is_array($result[$k])) + { + array_walk_recursive($result[$k], function(&$val) { $val = stripslashes($val); }); + } + else + { + $result[$k] = stripslashes($result[$k]); + } } - if(!is_array($result[$k])) + if(is_array($result[$k])) + { + array_walk_recursive($result[$k], function(&$val) { $val = trim($val); }); + } + else { $result[$k] = trim($result[$k]); } @@ -1874,7 +1900,7 @@ class Context self::$_user_vars->{$key} = $val; self::$_instance->{$key} = $val; - if($set_to_get_vars) + if($set_to_get_vars || isset(self::$_instance->get_vars->{$key})) { if($val === NULL || $val === '') { @@ -2032,6 +2058,10 @@ class Context { return self::$_instance->ssl_actions; } + else + { + return array(); + } } /** @@ -2541,6 +2571,26 @@ class Context return self::$_instance->allow_rewrite; } + /** + * Check whether an addon, module, or widget is blacklisted + * + * @param string $plugin_name + * @return bool + */ + public static function isBlacklistedPlugin($plugin_name) + { + if (self::$_blacklist === null) + { + self::$_blacklist = (include RX_BASEDIR . 'common/defaults/blacklist.php'); + if (!is_array(self::$_blacklist)) + { + self::$_blacklist = array(); + } + } + + return isset(self::$_blacklist[$plugin_name]); + } + /** * Converts a local path into an URL * diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index 0373d5510..cf2556c27 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -223,17 +223,17 @@ class HTMLDisplayHandler // convert the final layout Context::set('content', $output); + Context::set('m', $is_mobile = Mobile::isFromMobilePhone() ? 1 : 0); $oTemplate = TemplateHandler::getInstance(); - if(Mobile::isFromMobilePhone()) + if($is_mobile) { $this->_loadMobileJSCSS(); - $output = $oTemplate->compile('./common/tpl', 'mobile_layout'); } else { $this->_loadDesktopJSCSS(); - $output = $oTemplate->compile('./common/tpl', 'common_layout'); } + $output = $oTemplate->compile('./common/tpl', 'common_layout'); // replace the user-defined-language $oModuleController = getController('module'); @@ -394,7 +394,6 @@ class HTMLDisplayHandler if(Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) { Context::loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true); - Context::loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true); Context::loadFile(array("./modules/admin/tpl/css/admin.iefix.css", '', 'ie', 10), true); Context::loadFile('./modules/admin/tpl/js/admin.js', true); Context::loadFile(array('./modules/admin/tpl/css/admin.bootstrap.css', '', '', 1), true); diff --git a/classes/display/JSONDisplayHandler.php b/classes/display/JSONDisplayHandler.php index 069b6464e..7e7fc61a1 100644 --- a/classes/display/JSONDisplayHandler.php +++ b/classes/display/JSONDisplayHandler.php @@ -15,20 +15,41 @@ class JSONDisplayHandler $variables['error'] = $oModule->getError(); $variables['message'] = $oModule->getMessage(); - $temp = array(); - foreach ($variables as $key => $value) + self::_convertCompat($variables, Context::getRequestMethod()); + return json_encode($variables); + } + + /** + * Convert arrays in a format that is compatible with XE. + * + * @param array $array + * @param string $compat_type + * @return array + */ + protected static function _convertCompat(&$array, $compat_type = 'JSON') + { + foreach ($array as $key => &$value) { - if (self::_isNumericArray($value)) + if (is_object($value)) { - $temp[$key] = array_values($value); + $value = get_object_vars($value); } - else + if (is_array($value)) { - $temp[$key] = $value; + self::_convertCompat($value, $compat_type); + if (self::_isNumericArray($value)) + { + if ($compat_type === 'XMLRPC') + { + $value = array('item' => array_values($value)); + } + else + { + $value = array_values($value); + } + } } } - - return json_encode($temp); } /** diff --git a/classes/display/VirtualXMLDisplayHandler.php b/classes/display/VirtualXMLDisplayHandler.php index aa67ee21d..124818aaa 100644 --- a/classes/display/VirtualXMLDisplayHandler.php +++ b/classes/display/VirtualXMLDisplayHandler.php @@ -24,11 +24,6 @@ class VirtualXMLDisplayHandler if($error === 0) { - if($message != 'success') - { - $output->message = $message; - } - if($redirect_url) { $output->url = $redirect_url; @@ -40,29 +35,32 @@ class VirtualXMLDisplayHandler } else { - if($message != 'fail') - { - $output->message = $message; - } + $output->message = $message; } $html = array(); - $html[] = ''; - + $html[] = ''; + return join(PHP_EOL, $html); } diff --git a/classes/extravar/Extravar.class.php b/classes/extravar/Extravar.class.php index 224de5255..3960d4d94 100644 --- a/classes/extravar/Extravar.class.php +++ b/classes/extravar/Extravar.class.php @@ -224,6 +224,10 @@ class ExtraItem { $values = explode(',', $value); } + else + { + $values = array($value); + } $values = array_values($values); for($i = 0, $c = count($values); $i < $c; $i++) diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 1567df78b..9feee0660 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -1191,6 +1191,12 @@ class ModuleHandler extends Handler $type = $item->type; $called_method = $item->called_method; + // do not call if module is blacklisted + if (Context::isBlacklistedPlugin($module)) + { + continue; + } + // todo why don't we call a normal class object ? $oModule = getModule($module, $type); if(!$oModule || !method_exists($oModule, $called_method)) diff --git a/common/constants.php b/common/constants.php index 06f4e1810..31f4a7333 100644 --- a/common/constants.php +++ b/common/constants.php @@ -3,7 +3,7 @@ /** * RX_VERSION is the version number of the Rhymix CMS. */ -define('RX_VERSION', '1.8.15'); +define('RX_VERSION', '1.8.17'); /** * RX_MICROTIME is the startup time of the current script, in microseconds since the Unix epoch. diff --git a/common/defaults/blacklist.php b/common/defaults/blacklist.php new file mode 100644 index 000000000..bcbe7904f --- /dev/null +++ b/common/defaults/blacklist.php @@ -0,0 +1,12 @@ + true, + 'smartphone' => true, + 'zipperupper' => true, +); diff --git a/common/framework/compat/langparser.php b/common/framework/compat/langparser.php index 6f4c299da..582019c81 100644 --- a/common/framework/compat/langparser.php +++ b/common/framework/compat/langparser.php @@ -70,7 +70,7 @@ class LangParser unset($xml); // Save the array as a cache file. - $buff = " $value) { if (is_array($value)) diff --git a/common/framework/debug.php b/common/framework/debug.php index 0ed9bfb59..ea1dec766 100644 --- a/common/framework/debug.php +++ b/common/framework/debug.php @@ -137,7 +137,7 @@ class Debug $entry = (object)array( 'type' => 'Debug', 'time' => microtime(true), - 'message' => $message, + 'message' => unserialize(serialize($message)), 'file' => isset($backtrace[0]['file']) ? $backtrace[0]['file'] : null, 'line' => isset($backtrace[0]['line']) ? $backtrace[0]['line'] : 0, 'backtrace' => $backtrace, diff --git a/common/framework/lang.php b/common/framework/lang.php index ae6021a1b..ffbaa86cb 100644 --- a/common/framework/lang.php +++ b/common/framework/lang.php @@ -102,25 +102,21 @@ class Lang { $filename = $dir . '/' . $this->_language . '.php'; } - elseif (file_exists($dir . '/' . ($this->_language === 'ja' ? 'jp' : $this->_language) . '.lang.php')) - { - $filename = $dir . '/' . ($this->_language === 'ja' ? 'jp' : $this->_language) . '.lang.php'; - } elseif (($hyphen = strpos($this->_language, '-')) !== false) { if (file_exists($dir . '/' . substr($this->_language, 0, $hyphen) . '.php')) { $filename = $dir . '/' . substr($this->_language, 0, $hyphen) . '.php'; } - elseif (file_exists($dir . '/' . substr($this->_language, 0, $hyphen) . '.lang.php')) - { - $filename = $dir . '/' . substr($this->_language, 0, $hyphen) . '.lang.php'; - } } elseif (file_exists("$dir/lang.xml")) { $filename = Compat\LangParser::compileXMLtoPHP("$dir/lang.xml", $this->_language === 'ja' ? 'jp' : $this->_language); } + elseif (file_exists($dir . '/' . ($this->_language === 'ja' ? 'jp' : $this->_language) . '.lang.php')) + { + $filename = $dir . '/' . ($this->_language === 'ja' ? 'jp' : $this->_language) . '.lang.php'; + } // Load the language file. if ($filename) diff --git a/common/js/common.js b/common/js/common.js index ab14e21c7..08b0d6688 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -933,7 +933,7 @@ function getCookie(name) { } function is_def(v) { - return (typeof(v)!='undefined'); + return typeof(v) != 'undefined' && v !== null; } function ucfirst(str) { diff --git a/common/js/xml_handler.js b/common/js/xml_handler.js index 5e2ee7f8e..0b4f03775 100644 --- a/common/js/xml_handler.js +++ b/common/js/xml_handler.js @@ -54,7 +54,7 @@ waiting_obj.css("opacity", 0.0); var wfsr_timeout = setTimeout(function() { if (show_waiting_message) { - waiting_obj.css("opacity", "").html(waiting_message).show(); + waiting_obj.css("opacity", "").show(); } }, 1000); @@ -69,11 +69,7 @@ var result = {}; $.each(data, function(key, val) { if ($.inArray(key, ["error", "message", "act", "redirect_url"]) >= 0 || $.inArray(key, return_fields) >= 0) { - if ($.isArray(val)) { - result[key] = { item: val }; - } else { - result[key] = val; - } + result[key] = val; } }); @@ -134,8 +130,15 @@ // Hide the waiting message and display an error notice. clearTimeout(wfsr_timeout); waiting_obj.hide().trigger("cancel_confirm"); - var error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")"; - alert("AJAX communication error while requesting " + params.module + "." + params.act + "\n\n" + error_info); + var error_info; + + if ($(".x_modal-body").size()) { + error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")" + "

" + xhr.responseText + "
"; + alert("AJAX communication error while requesting " + params.module + "." + params.act + "

" + error_info); + } else { + error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")" + "\n\n" + xhr.responseText; + alert("AJAX communication error while requesting " + params.module + "." + params.act + "\n\n" + error_info); + } }; // Send the AJAX request. @@ -175,7 +178,7 @@ waiting_obj.css("opacity", 0.0); var wfsr_timeout = setTimeout(function() { if (show_waiting_message) { - waiting_obj.css("opacity", "").html(waiting_message).show(); + waiting_obj.css("opacity", "").show(); } }, 1000); @@ -227,8 +230,15 @@ var errorHandler = function(xhr, textStatus) { clearTimeout(wfsr_timeout); waiting_obj.hide().trigger("cancel_confirm"); - var error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")"; - alert("AJAX communication error while requesting " + params.module + "." + params.act + "\n\n" + error_info); + var error_info; + + if ($(".x_modal-body").size()) { + error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")" + "

" + xhr.responseText + "
"; + alert("AJAX communication error while requesting " + params.module + "." + params.act + "

" + error_info); + } else { + error_info = xhr.status + " " + xhr.statusText + " (" + textStatus + ")" + "\n\n" + xhr.responseText; + alert("AJAX communication error while requesting " + params.module + "." + params.act + "\n\n" + error_info); + } }; // Send the AJAX request. @@ -270,7 +280,7 @@ waiting_obj.css("opacity", 0.0); var wfsr_timeout = setTimeout(function() { if (show_waiting_message) { - waiting_obj.css("opacity", "").html(waiting_message).show(); + waiting_obj.css("opacity", "").show(); } }, 1000); diff --git a/common/lang/ko.php b/common/lang/ko.php index 69835c2fd..0e6e43253 100644 --- a/common/lang/ko.php +++ b/common/lang/ko.php @@ -203,10 +203,10 @@ $lang->about_tag = '쉼표(,)를 이용하여 복수 등록'; $lang->about_layout = '레이아웃은 콘텐츠의 겉모습을 꾸며줍니다. 상단 레이아웃 메뉴에서 관리할 수 있습니다.'; $lang->about_ipaddress_input = 'IP주소 입력형식
1. 와일드카드(*) 사용가능(예: 192.168.0.*)
2. 하이픈(-)을 사용하여 대역으로 입력가능
(단, 대역폭으로 입력할 경우 와일드카드 사용불가. 예: 192.168.0.1-192.168.0.254)
3.여러개의 항목은 줄을 바꾸어 입력하세요'; $lang->msg_invalid_ip = '잘못된 IP주소 형식입니다.'; -$lang->msg_no_root = '루트는 선택 할 수 없습니다.'; -$lang->msg_no_shortcut = '바로가기는 선택 할 수 없습니다.'; +$lang->msg_no_root = '루트는 선택할 수 없습니다.'; +$lang->msg_no_shortcut = '바로가기는 선택할 수 없습니다.'; $lang->msg_select_menu = '대상 메뉴 선택'; -$lang->msg_call_server = '서버에 요청 중입니다. 잠시만 기다려주세요.'; +$lang->msg_call_server = '서버에 요청 중입니다. 잠시만 기다려 주십시오...'; $lang->msg_db_not_setted = 'DB 설정이 되어 있지 않습니다.'; $lang->msg_dbconnect_failed = 'DB 접속 오류가 발생했습니다. DB정보를 다시 확인해주세요.'; $lang->msg_invalid_queryid = 'Query ID값이 잘못 지정되었습니다.'; diff --git a/common/tpl/common_layout.html b/common/tpl/common_layout.html index c68945e8f..d2859c612 100644 --- a/common/tpl/common_layout.html +++ b/common/tpl/common_layout.html @@ -1,33 +1,31 @@ -{@ - $db_info = Context::getDBInfo(); - $lang_type = Context::getLangType(); - $ssl_actions = Context::getSSLActions(); - $css_files = Context::getCssFile(); - $js_files = Context::getJsFile(); -} - + + - + + + {Context::getBrowserTitle()} + - + - +{"\n"} + - + - +{"\n"} @@ -35,48 +33,47 @@ - + + -{Context::getHtmlHeader()} - -{@$isAdminKind = false} - -{@$isAdminKind = true} - + + + + {Context::getBodyHeader()} {$content} {Context::getHtmlFooter()} + -
+
{$lang->msg_call_server}
-{@ $js_body_files = Context::getJsFile('body') } - - + + + +{"\n"} diff --git a/common/tpl/mobile_layout.html b/common/tpl/mobile_layout.html deleted file mode 100644 index f957cc7ef..000000000 --- a/common/tpl/mobile_layout.html +++ /dev/null @@ -1,73 +0,0 @@ -{@ - $lang_type = Context::getLangType(); - $ssl_actions = Context::getSSLActions(); - $css_files=Context::getCssFile(); - $js_files=Context::getJsFile(); -} - - - - - - - - - -{Context::getBrowserTitle()} - - - - - - - - - - - - - - - - - - - - - - - - - - -{Context::getHtmlHeader()} - - - -{Context::getBodyHeader()} -{$content} -{Context::getHtmlFooter()} -
-
- -{@ $js_body_files = Context::getJsFile('body') } - - - - - - - diff --git a/common/tpl/sitelock.html b/common/tpl/sitelock.html deleted file mode 100644 index ca4a4f981..000000000 --- a/common/tpl/sitelock.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - <?php echo _XE_SITELOCK_TITLE_?> - - - - -
-
-

-

 

-
-
- - diff --git a/modules/addon/addon.admin.controller.php b/modules/addon/addon.admin.controller.php index 9ae4a32c9..4587e9339 100644 --- a/modules/addon/addon.admin.controller.php +++ b/modules/addon/addon.admin.controller.php @@ -227,7 +227,7 @@ class addonAdminController extends addonController * @param string $isUsed Whether to use * @return Object */ - function doInsert($addon, $site_srl = 0, $gtype = 'site', $isUsed = 'N', $extra_vars) + function doInsert($addon, $site_srl = 0, $gtype = 'site', $isUsed = 'N', $extra_vars = null) { $args = new stdClass; $args->addon = $addon; diff --git a/modules/addon/addon.admin.model.php b/modules/addon/addon.admin.model.php index c49dbabd1..15ae24c50 100644 --- a/modules/addon/addon.admin.model.php +++ b/modules/addon/addon.admin.model.php @@ -46,13 +46,23 @@ class addonAdminModel extends addon $oAutoinstallModel = getModel('autoinstall'); foreach($addonList as $key => $addon) { + // check blacklist + $addonList[$key]->isBlacklisted = Context::isBlacklistedPlugin($addon->addon); + // get easyinstall remove url $packageSrl = $oAutoinstallModel->getPackageSrlByPath($addon->path); $addonList[$key]->remove_url = $oAutoinstallModel->getRemoveUrlByPackageSrl($packageSrl); // get easyinstall need update - $package = $oAutoinstallModel->getInstalledPackages($packageSrl); - $addonList[$key]->need_update = $package[$packageSrl]->need_update; + if($addonList[$key]->isBlacklisted) + { + $addonList[$key]->need_update = 'N'; + } + else + { + $package = $oAutoinstallModel->getInstalledPackages($packageSrl); + $addonList[$key]->need_update = $package[$packageSrl]->need_update; + } // get easyinstall update url if($addonList[$key]->need_update == 'Y') diff --git a/modules/addon/addon.class.php b/modules/addon/addon.class.php index bb605cd77..8eb142106 100644 --- a/modules/addon/addon.class.php +++ b/modules/addon/addon.class.php @@ -19,7 +19,6 @@ class addon extends ModuleObject $oAddonController = getAdminController('addon'); $oAddonController->doInsert('autolink', 0, 'site', 'Y'); $oAddonController->doInsert('blogapi'); - $oAddonController->doInsert('member_communication', 0, 'site', 'Y'); $oAddonController->doInsert('member_extra_info', 0, 'site', 'Y'); $oAddonController->doInsert('mobile', 0, 'site', 'Y'); $oAddonController->doInsert('resize_image', 0, 'site', 'Y'); diff --git a/modules/addon/addon.controller.php b/modules/addon/addon.controller.php index d647f62a2..c66e74338 100644 --- a/modules/addon/addon.controller.php +++ b/modules/addon/addon.controller.php @@ -84,7 +84,7 @@ class addonController extends addon $addon_list = $oAddonModel->getInsertedAddons($site_srl, $gtype); foreach($addon_list as $addon => $val) { - if($val->addon == "smartphone" + if(Context::isBlacklistedPlugin($addon) || ($type == "pc" && $val->is_used != 'Y') || ($type == "mobile" && $val->is_used_m != 'Y') || ($gtype == 'global' && $val->is_fixed != 'Y') diff --git a/modules/addon/tpl/addon_list.html b/modules/addon/tpl/addon_list.html index 11d746c9e..bed17e82a 100644 --- a/modules/addon/tpl/addon_list.html +++ b/modules/addon/tpl/addon_list.html @@ -34,23 +34,29 @@ -

{$addon->title}

+

{$addon->title}

{$addon->description}

{$lang->msg_avail_easy_update} {$lang->msg_do_you_like_update}

- {$addon->version} + {$addon->version} {$author->name} {$author->name} - {$addon->path} - {$lang->cmd_setup} - - + {$addon->path} + + + {$lang->cmd_setup} + + {$lang->cmd_setup} + + + + {$lang->cmd_delete} diff --git a/modules/admin/tpl/_footer.html b/modules/admin/tpl/_footer.html index a5689eb6c..e60075e64 100644 --- a/modules/admin/tpl/_footer.html +++ b/modules/admin/tpl/_footer.html @@ -16,11 +16,5 @@

- diff --git a/modules/admin/tpl/_header.html b/modules/admin/tpl/_header.html index bb50a84f1..e1d0fe4dd 100644 --- a/modules/admin/tpl/_header.html +++ b/modules/admin/tpl/_header.html @@ -1,5 +1,14 @@ +

{$lang->skip_to_content}

diff --git a/modules/admin/tpl/css/admin.css b/modules/admin/tpl/css/admin.css index b0180e4c0..a0d16fea2 100644 --- a/modules/admin/tpl/css/admin.css +++ b/modules/admin/tpl/css/admin.css @@ -2389,3 +2389,36 @@ html[lang="mn"] .x .g11n.active>[disabled], height: 1px; overflow: hidden; } + +/* language specific styles */ +/* English admin_en.css */ +html:lang(en) body>.x, +html:lang(en) .x table, +html:lang(en) .x input, +html:lang(en) .x textarea, +html:lang(en) .x select, +html:lang(en) .x button{font-family:Arial,Helvetica,sans-serif} +@media all and (max-width:980px){ + html:lang(en) body>.x, + html:lang(en) .x table, + html:lang(en) .x input, + html:lang(en) .x textarea, + html:lang(en) .x select, + html:lang(en) .x button{font-family:sans-serif} +} + +/* Korean admin_ko.css */ +html:lang(ko) body>.x, +html:lang(ko) .x table, +html:lang(ko) .x input, +html:lang(ko) .x textarea, +html:lang(ko) .x select, +html:lang(ko) .x button{font-family: 'NanumGothic', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Dotum', Arial, Helvetica, sans-serif} + +/* Japanese admin_jp.css */ +html:lang(ja) body>.x, +html:lang(ja) .x table, +html:lang(ja) .x input, +html:lang(ja) .x textarea, +html:lang(ja) .x select, +html:lang(ja) .x button{font-family:'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック',sans-serif} \ No newline at end of file diff --git a/modules/admin/tpl/css/admin_en.css b/modules/admin/tpl/css/admin_en.css deleted file mode 100644 index 6cbb6efe0..000000000 --- a/modules/admin/tpl/css/admin_en.css +++ /dev/null @@ -1,5 +0,0 @@ -@charset "utf-8"; -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:Arial,Helvetica,sans-serif} -@media all and (max-width:980px){ -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:sans-serif} -} \ No newline at end of file diff --git a/modules/admin/tpl/css/admin_jp.css b/modules/admin/tpl/css/admin_jp.css deleted file mode 100644 index 178114846..000000000 --- a/modules/admin/tpl/css/admin_jp.css +++ /dev/null @@ -1,5 +0,0 @@ -@charset "utf-8"; -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック',sans-serif} -@media all and (max-width:980px){ -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック',sans-serif} -} \ No newline at end of file diff --git a/modules/admin/tpl/css/admin_ko.css b/modules/admin/tpl/css/admin_ko.css deleted file mode 100644 index d16de3ca5..000000000 --- a/modules/admin/tpl/css/admin_ko.css +++ /dev/null @@ -1,5 +0,0 @@ -@charset "utf-8"; -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:나눔고딕,NanumGothic,돋움,Dotum,Arial,Helvetica,sans-serif} -@media all and (max-width:980px){ -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:sans-serif} -} \ No newline at end of file diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index e1646246c..b70f9ee7c 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -106,6 +106,11 @@ class boardController extends board } } + if($this->module_info->update_log == 'Y') + { + $obj->update_log_setting = 'Y'; + } + // update the document if it is existed if($is_update) { @@ -146,12 +151,14 @@ class boardController extends board $obj->last_update = $obj->regdate = date('YmdHis'); $obj->update_order = $obj->list_order = (getNextSequence() * -1); } - + $obj->reason_update = escape($obj->reason_update); $output = $oDocumentController->updateDocument($oDocument, $obj); $msg_code = 'success_updated'; // insert a new document otherwise - } else { + } + else + { $output = $oDocumentController->insertDocument($obj, $bAnonymous); $msg_code = 'success_registed'; $obj->document_srl = $output->get('document_srl'); diff --git a/modules/board/board.view.php b/modules/board/board.view.php index 015241e69..1e45f6978 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -333,6 +333,8 @@ class boardView extends board } } + Context::set('update_view', $this->grant->update_view); + // setup the document oject on context $oDocument->add('module_srl', $this->module_srl); Context::set('oDocument', $oDocument); @@ -1140,6 +1142,44 @@ class boardView extends board $this->setTemplateFile('message'); } + function dispBoardUpdateLog() + { + $oDocumentModel = getModel('document'); + $document_srl = Context::get('document_srl'); + + if($this->grant->update_view !== true) + { + return new Object(-1, 'msg_not_permitted'); + } + + $updatelog = $oDocumentModel->getDocumentUpdateLog($document_srl); + Context::set('total_count', $updatelog->page_navigation->total_count); + Context::set('total_page', $updatelog->page_navigation->total_page); + Context::set('page', $updatelog->page); + Context::set('page_navigation', $updatelog->page_navigation); + Context::set('updatelog', $updatelog); + + $this->setTemplateFile('update_list'); + } + + function dispBoardUpdateLogView() + { + $oDocumentModel = getModel('document'); + $update_id = Context::get('update_id'); + + if($this->grant->update_view !== true) + { + return new Object(-1, 'msg_not_permitted'); + } + $update_log = $oDocumentModel->getUpdateLog($update_id); + $extra_vars = unserialize($update_log->extra_vars); + + Context::set('extra_vars', $extra_vars); + Context::set('update_log', $update_log); + + $this->setTemplateFile('update_view'); + } + /** * @brief the method for displaying the warning messages * display an error message if it has not a special design diff --git a/modules/board/conf/module.xml b/modules/board/conf/module.xml index 72002fed7..9643ceff0 100644 --- a/modules/board/conf/module.xml +++ b/modules/board/conf/module.xml @@ -21,6 +21,9 @@ 檢視 görüş + + 수정내역 조회 + 글 작성 发表新主题 @@ -63,6 +66,7 @@ + @@ -73,6 +77,7 @@ + diff --git a/modules/board/lang/ko.php b/modules/board/lang/ko.php index ce76b6e86..9f8334b92 100644 --- a/modules/board/lang/ko.php +++ b/modules/board/lang/ko.php @@ -14,6 +14,8 @@ $lang->consultation = '상담 기능'; $lang->secret = '비밀글 기능'; $lang->thisissecret = '비밀글입니다.'; $lang->admin_mail = '관리자 메일'; +$lang->update_log = '게시글 수정 내역'; +$lang->last_updater = '수정한사람'; $lang->cmd_board_list = '게시판 목록'; $lang->cmd_module_config = '게시판 공통 설정'; $lang->cmd_board_info = '게시판 정보'; @@ -31,6 +33,7 @@ $lang->about_admin_mail = '글이나 댓글이 등록될때 등록된 메일주 $lang->about_list_config = '게시판의 목록형식 사용시 원하는 항목들로 배치를 할 수 있습니다. 단 스킨에서 지원하지 않는 경우 불가능합니다. 대상항목/ 표시항목의 항목을 더블클릭하면 추가/ 제거가 됩니다.'; $lang->about_use_status = '글 작성 시 선택할 수 있는 상태를 지정해주세요.'; $lang->about_protect_comment = '댓글의 댓글이 있을경우 해당댓글을 삭제 및 수정을 할 수 없도록 합니다.'; +$lang->about_update_log = '게시글을 수정할 경우 수정한 내역을 저장하도록 합니다.'; $lang->msg_not_enough_point = '포인트가 부족합니다'; $lang->write_comment = '댓글 쓰기'; $lang->msg_not_allow_comment = '해당 글의 댓글 쓰기가 잠겨있습니다.'; @@ -52,4 +55,8 @@ $lang->msg_admin_comment_no_modify = '최고관리자의 댓글을 수정할 권 $lang->msg_board_delete_protect_comment = '댓글이 작성된 댓글의 글을 삭제할 수 없습니다.'; $lang->msg_board_update_protect_comment = '댓글이 작성된 댓글의 글을 수정할 수 없습니다.'; $lang->msg_protect_regdate_document = '%s일 이전의 게시글은 수정 또는 삭제 할 수 없습니다.'; -$lang->msg_protect_regdate_comment = '%s일 이전의 댓글은 수정 또는 삭제 할 수 없습니다.'; \ No newline at end of file +$lang->msg_protect_regdate_comment = '%s일 이전의 댓글은 수정 또는 삭제 할 수 없습니다.'; +$lang->msg_dont_have_update_log = '업데이트 로그가 기록되어 있지 않은 게시글입니다.'; +$lang->original_letter = '원본글'; +$lang->msg_warning_update_log = '주의! 사용시 디비가 많이 늘어날 수 있습니다.'; +$lang->reason_update = '수정한 이유'; diff --git a/modules/board/skins/default/write_form.html b/modules/board/skins/default/write_form.html index f3e13930e..62301dd1a 100644 --- a/modules/board/skins/default/write_form.html +++ b/modules/board/skins/default/write_form.html @@ -10,7 +10,7 @@ {str_repeat("  ",$val->depth)} {$val->title} ({$val->document_count}) - + diff --git a/modules/board/skins/xedition/_read.html b/modules/board/skins/xedition/_read.html index 7c3e6030b..f0102cb25 100644 --- a/modules/board/skins/xedition/_read.html +++ b/modules/board/skins/xedition/_read.html @@ -114,7 +114,8 @@ Profile
{$oDocument->getSignature()}
-
+
+ {$lang->update_log} {$lang->cmd_modify} {$lang->cmd_delete} diff --git a/modules/board/skins/xedition/board.default.css b/modules/board/skins/xedition/board.default.css index 866a9f86f..30022f34c 100644 --- a/modules/board/skins/xedition/board.default.css +++ b/modules/board/skins/xedition/board.default.css @@ -263,6 +263,16 @@ right:0; border-radius: 0 2px 2px 0; } + +.update-log { + width:100%; + border-bottom:1px solid #dbdbdb; + margin: 5px auto 5px auto; + + padding:5px; + +} + /* Board Write */ /* write_form.html */ @@ -463,6 +473,9 @@ white-space: nowrap; color : #666; } +.update-log .read_header .meta { + border-bottom:0; +} .read_header .meta > span { margin-left: 8px ;} .read_header .meta > span:first-child {margin-left:0;} .read_header .meta:after { diff --git a/modules/board/skins/xedition/update_list.html b/modules/board/skins/xedition/update_list.html new file mode 100644 index 000000000..09d962bbc --- /dev/null +++ b/modules/board/skins/xedition/update_list.html @@ -0,0 +1,42 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + +
{$lang->title}{$lang->writer}{$lang->last_updater}{$lang->last_post}
+ {$val->title} + + {$val->update_nick_name} + + {$val->nick_name} + + {zdate($val->regdate, 'Y.m.d H:i:s')} +
{$lang->msg_dont_have_update_log}
+
+ diff --git a/modules/board/skins/xedition/update_view.html b/modules/board/skins/xedition/update_view.html new file mode 100644 index 000000000..390c051a2 --- /dev/null +++ b/modules/board/skins/xedition/update_view.html @@ -0,0 +1,29 @@ + +
+
+ +
+

+ {$category_list[$update_log->category_srl]->title} + {$update_log->title} +

+

+ + {zdate($update_log->regdate,'Y.m.d H:i:s')} + +

+
+ +
+ {$update_log->content} +
+

+ {$key} : {$val} +

+

+ {$lang->reason_update} : + {$update_log->reason_update} +

+ +
+
diff --git a/modules/board/skins/xedition/write_form.html b/modules/board/skins/xedition/write_form.html index e9a197a07..98455f834 100644 --- a/modules/board/skins/xedition/write_form.html +++ b/modules/board/skins/xedition/write_form.html @@ -10,7 +10,7 @@ {str_repeat("  ",$val->depth)} {$val->title} ({$val->document_count}) - + @@ -43,6 +43,7 @@ + get('status') == $key || ($key == 'PUBLIC' && !$document_srl))-->checked="checked" /> @@ -66,7 +67,11 @@ - +
+ + + +
diff --git a/modules/board/tpl/board_insert.html b/modules/board/tpl/board_insert.html index ad2e7c176..457b8a550 100644 --- a/modules/board/tpl/board_insert.html +++ b/modules/board/tpl/board_insert.html @@ -199,6 +199,13 @@
+
+ +
+ +

{$lang->msg_warning_update_log}

+
+
diff --git a/modules/communication/communication.controller.php b/modules/communication/communication.controller.php index f77b3e05f..452c61afc 100644 --- a/modules/communication/communication.controller.php +++ b/modules/communication/communication.controller.php @@ -130,7 +130,7 @@ class communicationController extends communication $view_url = Context::getRequestUri(); $content = sprintf("%s

From : %s", $content, $view_url, $view_url); $oMail = new Mail(); - $oMail->setTitle($title); + $oMail->setTitle(htmlspecialchars($title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); $oMail->setContent(utf8_mbencode(removeHackTag($content))); $oMail->setSender($logged_info->nick_name, $logged_info->email_address); $oMail->setReceiptor($receiver_member_info->nick_name, $receiver_member_info->email_address); diff --git a/modules/document/document.admin.controller.php b/modules/document/document.admin.controller.php index 6e624491b..f1f77d00b 100644 --- a/modules/document/document.admin.controller.php +++ b/modules/document/document.admin.controller.php @@ -92,6 +92,7 @@ class documentAdminController extends document $obj = $oDocument->getObjectVars(); // ISSUE https://github.com/xpressengine/xe-core/issues/32 + $args_doc_origin = new stdClass(); $args_doc_origin->document_srl = $document_srl; $output_ori = executeQuery('document.getDocument', $args_doc_origin, array('content')); $obj->content = $output_ori->data->content; @@ -144,11 +145,20 @@ class documentAdminController extends document $obj->module_srl = $module_srl; $obj->category_srl = $category_srl; $output = executeQuery('document.updateDocumentModule', $obj); - if(!$output->toBool()) { + if(!$output->toBool()) + { $oDB->rollback(); return $output; } - + else + { + $update_output = $oDocumentController->insertDocumentUpdateLog($obj); + if(!$update_output->toBool()) + { + $oDB->rollback(); + return $update_output; + } + } //Move a module of the extra vars $output = executeQuery('document.moveDocumentExtraVars', $obj); if(!$output->toBool()) { diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 9800206b7..5478d0d11 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -389,7 +389,7 @@ class documentController extends document $obj->homepage = $logged_info->homepage; } // If the tile is empty, extract string from the contents. - $obj->title = htmlspecialchars($obj->title); + $obj->title = htmlspecialchars($obj->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); settype($obj->title, "string"); if($obj->title == '') $obj->title = cut_str(trim(strip_tags(nl2br($obj->content))),20,'...'); // If no tile extracted from the contents, leave it untitled. @@ -439,6 +439,7 @@ class documentController extends document return $output; } // Insert extra variables if the document successfully inserted. + $extra_vars = array(); $extra_keys = $oDocumentModel->getExtraKeys($obj->module_srl); if(count($extra_keys)) { @@ -449,13 +450,20 @@ class documentController extends document { $tmp = $obj->{'extra_vars'.$idx}; if(is_array($tmp)) + { $value = implode('|@|', $tmp); + } else + { $value = trim($tmp); + } + } + else if(isset($obj->{$extra_item->name})) + { + $value = trim($obj->{$extra_item->name}); } - else if(isset($obj->{$extra_item->name})) $value = trim($obj->{$extra_item->name}); if($value == NULL) continue; - + $extra_vars[$extra_item->name] = $value; $this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, $idx, $value, $extra_item->eid); } } @@ -464,6 +472,16 @@ class documentController extends document // Call a trigger (after) if($output->toBool()) { + if($obj->update_log_setting === 'Y') + { + $obj->extra_vars = serialize($extra_vars); + $update_output = $this->insertDocumentUpdateLog($obj); + if(!$update_output->toBool()) + { + $oDB->rollback(); + return $update_output; + } + } $trigger_output = ModuleHandler::triggerCall('document.insertDocument', 'after', $obj); if(!$trigger_output->toBool()) { @@ -517,6 +535,8 @@ class documentController extends document $oModuleModel = getModel('module'); if(!$obj->module_srl) $obj->module_srl = $source_obj->get('module_srl'); $module_srl = $obj->module_srl; + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + $document_config = $oModuleModel->getModulePartConfig('document', $module_srl); if(!$document_config) { @@ -588,7 +608,7 @@ class documentController extends document $obj->password = getModel('member')->hashPassword($obj->password); } // If an author is identical to the modifier or history is used, use the logged-in user's information. - if(Context::get('is_logged')) + if(Context::get('is_logged') && $module_info->use_anonymous != 'Y') { $logged_info = Context::get('logged_info'); if($source_obj->get('member_srl')==$logged_info->member_srl) @@ -610,7 +630,7 @@ class documentController extends document $obj->homepage = $source_obj->get('homepage'); } // If the tile is empty, extract string from the contents. - $obj->title = htmlspecialchars($obj->title); + $obj->title = htmlspecialchars($obj->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); settype($obj->title, "string"); if($obj->title == '') $obj->title = cut_str(strip_tags($obj->content),20,'...'); // If no tile extracted from the contents, leave it untitled. @@ -647,6 +667,7 @@ class documentController extends document // Change not extra vars but language code of the original document if document's lang_code doesn't exist. if(!$source_obj->get('lang_code')) { + $lang_code_args = new stdClass(); $lang_code_args->document_srl = $source_obj->get('document_srl'); $lang_code_args->lang_code = Context::getLangType(); $output = executeQuery('document.updateDocumentsLangCode', $lang_code_args); @@ -683,7 +704,9 @@ class documentController extends document $oDB->rollback(); return $output; } + // Remove all extra variables + $extra_vars = array(); if(Context::get('act')!='procFileDelete') { $this->deleteDocumentExtraVars($source_obj->get('module_srl'), $obj->document_srl, null, Context::getLangType()); @@ -704,6 +727,7 @@ class documentController extends document } else if(isset($obj->{$extra_item->name})) $value = trim($obj->{$extra_item->name}); if($value == NULL) continue; + $extra_vars[$extra_item->name] = $value; $this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, $idx, $value, $extra_item->eid); } } @@ -720,6 +744,16 @@ class documentController extends document // Call a trigger (after) if($output->toBool()) { + if($obj->update_log_setting === 'Y') + { + $obj->extra_vars = serialize($extra_vars); + $update_output = $this->insertDocumentUpdateLog($obj, $source_obj); + if(!$update_output->toBool()) + { + $oDB->rollback(); + return $update_output; + } + } $trigger_output = ModuleHandler::triggerCall('document.updateDocument', 'after', $obj); if(!$trigger_output->toBool()) { @@ -746,6 +780,45 @@ class documentController extends document return $output; } + function insertDocumentUpdateLog($obj, $source_obj = null) + { + $update_args = new stdClass(); + $logged_info = Context::get('logged_info'); + if($source_obj === null) + { + $update_args->category_srl = $obj->category_srl; + $update_args->module_srl = $obj->module_srl; + $update_args->nick_name = $obj->nick_name; + } + else + { + if($obj->category_srl) + { + $update_args->category_srl = $obj->category_srl; + } + else + { + $update_args->category_srl = $source_obj->get('category_srl'); + } + $update_args->module_srl = $source_obj->get('module_srl'); + $update_args->nick_name = $source_obj->get('nick_name'); + } + + $update_args->document_srl = $obj->document_srl; + $update_args->update_member_srl = $logged_info->member_srl; + $update_args->title = $obj->title; + $update_args->title_bold = $obj->title_bold; + $update_args->title_color = $obj->title_color; + $update_args->content = $obj->content; + $update_args->update_nick_name = $logged_info->nick_name; + $update_args->tags = $obj->tags; + $update_args->extra_vars = $obj->extra_vars; + $update_args->reason_update = $obj->reason_update; + $update_output = executeQuery('document.insertDocumentUpdateLog', $update_args); + + return $update_output; + } + /** * Deleting Documents * @param int $document_srl @@ -829,6 +902,7 @@ class documentController extends document $this->_deleteDeclaredDocuments($args); $this->_deleteDocumentReadedLog($args); $this->_deleteDocumentVotedLog($args); + $this->_deleteDocumentUpdateLog($args); // Remove the thumbnail file FileHandler::removeDir(sprintf('files/thumbnails/%s',getNumberingPath($document_srl, 3))); @@ -878,6 +952,11 @@ class documentController extends document executeQuery('document.deleteDocumentVotedLog', $documentSrls); } + function _deleteDocumentUpdateLog($document_srl) + { + executeQuery('document.deleteDocumentUpdateLog', $document_srl); + } + /** * Move the doc into the trash * @param object $obj diff --git a/modules/document/document.model.php b/modules/document/document.model.php index c353a33a4..673d4f416 100644 --- a/modules/document/document.model.php +++ b/modules/document/document.model.php @@ -621,7 +621,7 @@ class documentModel extends document $this->_setSearchOption($opt, $args, $query_id, $use_division); - if($sort_check->isExtraVars) + if($sort_check->isExtraVars || !$opt->list_count) { return 1; } @@ -1548,6 +1548,25 @@ class documentModel extends document return $document_list; } + + function getDocumentUpdateLog($document_srl) + { + $args = new stdClass(); + $args->document_srl = $document_srl; + $output = executeQueryArray('document.getDocumentUpdateLog', $args); + + return $output; + } + + function getUpdateLog($update_id) + { + $args = new stdClass(); + $args->update_id = $update_id; + $output = exeCuteQuery('document.getUpdateLog', $args); + $updage_log = $output->data; + + return $updage_log; + } } /* End of file document.model.php */ /* Location: ./modules/document/document.model.php */ diff --git a/modules/document/queries/deleteDocumentUpdateLog.xml b/modules/document/queries/deleteDocumentUpdateLog.xml new file mode 100644 index 000000000..6f0ee246c --- /dev/null +++ b/modules/document/queries/deleteDocumentUpdateLog.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/modules/document/queries/getDocumentUpdateLog.xml b/modules/document/queries/getDocumentUpdateLog.xml new file mode 100644 index 000000000..c7ceeedc0 --- /dev/null +++ b/modules/document/queries/getDocumentUpdateLog.xml @@ -0,0 +1,22 @@ + + +
+ + + + + + + + + + + + + + + + + + + diff --git a/modules/document/queries/getUpdateLog.xml b/modules/document/queries/getUpdateLog.xml new file mode 100644 index 000000000..daae71601 --- /dev/null +++ b/modules/document/queries/getUpdateLog.xml @@ -0,0 +1,11 @@ + + +
+ + + + + + + + diff --git a/modules/document/queries/insertDocumentUpdateLog.xml b/modules/document/queries/insertDocumentUpdateLog.xml new file mode 100644 index 000000000..921dd1b51 --- /dev/null +++ b/modules/document/queries/insertDocumentUpdateLog.xml @@ -0,0 +1,22 @@ + + +
+ + + + + + + + + + + + + + + + + + + diff --git a/modules/document/schemas/document_update_log.xml b/modules/document/schemas/document_update_log.xml new file mode 100644 index 000000000..85a99283a --- /dev/null +++ b/modules/document/schemas/document_update_log.xml @@ -0,0 +1,18 @@ +
+ + + + + + + + + + + + + + + + +
diff --git a/modules/layout/tpl/layout_modify.html b/modules/layout/tpl/layout_modify.html index c355355b3..8fdcc28d2 100644 --- a/modules/layout/tpl/layout_modify.html +++ b/modules/layout/tpl/layout_modify.html @@ -1,3 +1,3 @@ -{$content} \ No newline at end of file +{$content} diff --git a/modules/member/lang/en.php b/modules/member/lang/en.php index f4c4940cd..e98843ecc 100644 --- a/modules/member/lang/en.php +++ b/modules/member/lang/en.php @@ -206,7 +206,7 @@ $lang->about_profile_image = 'Members will be able to use profile images'; $lang->about_signature_max_height = 'You can limit the signature max height. Set this as 0 or leave it blank not to limit it.'; $lang->about_accept_agreement = 'I have read the agreement and agree with it'; $lang->about_member_default = 'It will be set as the default group on sign up'; -$lang->about_find_member_account = 'lease input the email address you have entered during the registration and we will send your account info to this email address.'; +$lang->about_find_member_account = 'Please input the email address you have entered during the registration and we will send your account info to this email address.'; $lang->about_ssl_port = 'Please enter if you are using non-default SSL port'; $lang->about_resend_auth_mail = 'You can request for the activation email if you have not activated yet.'; $lang->no_article = 'No articles'; diff --git a/modules/member/member.admin.view.php b/modules/member/member.admin.view.php index ca4318ce1..21e3d6ba8 100644 --- a/modules/member/member.admin.view.php +++ b/modules/member/member.admin.view.php @@ -631,7 +631,7 @@ class memberAdminView extends member } $replace = array_merge($extentionReplace, $replace); - $inputTag = preg_replace_callback('@%(\w+)%@', function($n) { return $replace[$n[1]]; }, $template); + $inputTag = preg_replace_callback('@%(\w+)%@', function($n) use($replace) { return $replace[$n[1]]; }, $template); if($extendForm->description) $inputTag .= '

'.$extendForm->description.'

'; diff --git a/modules/member/queries/getMemberModifyNickName.xml b/modules/member/queries/getMemberModifyNickName.xml index 3dea7f6bb..c3162f109 100644 --- a/modules/member/queries/getMemberModifyNickName.xml +++ b/modules/member/queries/getMemberModifyNickName.xml @@ -12,6 +12,6 @@ - +
\ No newline at end of file diff --git a/modules/menu/tpl/sitemap.html b/modules/menu/tpl/sitemap.html index eb0515cf1..5f68736fe 100644 --- a/modules/menu/tpl/sitemap.html +++ b/modules/menu/tpl/sitemap.html @@ -685,6 +685,8 @@