From bde13db245d6a6cfebb1d36c60b2e768b25bc198 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 20 Jan 2016 14:07:11 +0900 Subject: [PATCH 01/53] Add miscellaneous utility functions --- common/functions.php | 447 +++++++++++++++++++++++++++++++++++++++++++ common/legacy.php | 60 +----- 2 files changed, 454 insertions(+), 53 deletions(-) diff --git a/common/functions.php b/common/functions.php index 2f08f66f1..eddbcd2e6 100644 --- a/common/functions.php +++ b/common/functions.php @@ -6,6 +6,428 @@ * Copyright (c) Rhymix Developers and Contributors */ + +/** Get the first value of an array. + * + * @param array $array The input array + * @return mixed + */ +function array_first(array $array) +{ + return reset($array); +} + +/** Get the first key of an array. + * + * @param array $array The input array + * @return mixed + */ +function array_first_key(array $array) +{ + reset($array); + return key($array); +} + +/** Get the last value of an array. + * + * @param array $array The input array + * @return mixed + */ +function array_last(array $array) +{ + return end($array); +} + +/** Get the last key of an array. + * + * @param array $array The input array + * @return mixed + */ +function array_last_key(array $array) +{ + end($array); + return key($array); +} + +/** + * Flatten a multi-dimensional array into a one-dimensional array. + * Based on util.php + * Contributed by Theodore R. Smith of PHP Experts, Inc. + * + * @param array $array The array to flatten + * @param bool $preserve_keys Whether or not to preserve array keys (default: true) + * @return array + */ +function array_flatten(array $array, $preserve_keys = true) +{ + $result = array(); + array_walk_recursive($array, function($value, $key) use(&$result, $preserve_keys) { + if ($preserve_keys && !is_int($key)) + { + $result[$key] = $value; + } + else + { + $result[] = $value; + } + }); + return $result; +} + +/** + * Get the base name of a class name (without namespaces). + * Based on Laravel helper function + * + * @param string|object $class The class name + * @return string + */ +function class_basename($class) +{ + return basename(str_replace('\\', '/', is_object($class) ? get_class($class) : $class)); +} + +/** + * This function is a shortcut to htmlspecialchars(). + * + * @param string $str The string to escape + * @param bool $double_escape Set this to false to skip symbols that are already escaped (default: true) + * @return string + */ +function escape($str, $double_escape = true) +{ + $flags = defined('ENT_SUBSTITUTE') ? (ENT_QUOTES | ENT_SUBSTITUTE) : (ENT_QUOTES | ENT_IGNORE); + return htmlspecialchars($str, $flags, 'UTF-8', $double_escape); +} + +/** + * This function escapes a string to be used in a CSS property. + * + * @param string $str The string to escape + * @return string + */ +function escape_css($str) +{ + return preg_replace('/[^a-zA-Z0-9_.#\/-]/', '', $str); +} + +/** + * This function escapes a string to be used in a JavaScript string literal. + * + * @param string $str The string to escape + * @return string + */ +function escape_js($str) +{ + $flags = JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT; + if (defined('JSON_UNESCAPED_UNICODE')) $flags = $flags | JSON_UNESCAPED_UNICODE; + $str = json_encode((string)$str, $flags); + return substr($str, 1, strlen($str) - 2); +} + +/** + * This function escapes a string to be used in a 'single-quoted' PHP string literal. + * Null bytes are removed. + * + * @param string $str The string to escape + * @return string + */ +function escape_sqstr($str) +{ + return str_replace(array('\\0', '\\"'), array('', '"'), addslashes($str)); +} + +/** + * This function escapes a string to be used in a "double-quoted" PHP string literal. + * Null bytes are removed. + * + * @param string $str The string to escape + * @return string + */ +function escape_dqstr($str) +{ + return str_replace(array('\\0', "\\'", '$'), array('', "'", '\\$'), addslashes($str)); +} + +/** + * This function splits a string into an array, but allows the delimter to be escaped. + * For example, 'A|B\|C|D' will be split into 'A', 'B|C', and 'D' + * because the bar between B and C is escaped. + * + * @param string $delimiter The delimiter + * @param string $str The string to split + * @param int $limit The maximum number of items to return, 0 for unlimited (default: 0) + * @param string $escape_char The escape character (default: backslash) + * @return array + */ +function explode_with_escape($delimiter, $str, $limit = 0, $escape_char = '\\') +{ + if ($limit < 1) $limit = null; + $result = []; + $split = preg_split('/(? strlen($haystack)) return false; + if ($case_sensitive) + { + return !strncmp($needle, $haystack, strlen($needle)); + } + else + { + !strncasecmp($needle, $haystack, strlen($needle)); + } +} + +/** + * This function returns true if $haystack ends with $needle, and false otherwise. + * + * @param string $needle The needle + * @param string $haystack The haystack + * @param bool $case_sensitive Whether the search should be case-sensitive (default: true) + * @return bool + */ +function ends_with($needle, $haystack, $case_sensitive = true) +{ + if (strlen($needle) > strlen($haystack)) return false; + if ($case_sensitive) + { + return (substr($haystack, -strlen($needle)) === $needle); + } + else + { + return (strtolower(substr($haystack, -strlen($needle))) === strtolower($needle)); + } +} + +/** + * This function returns true if $haystack contains $needle, and false otherwise. + * + * @param string $needle The needle + * @param string $haystack The haystack + * @param bool $case_sensitive Whether the search should be case-sensitive (default: true) + * @return bool + */ +function contains($needle, $haystack, $case_sensitive = true) +{ + return $case_sensitive ? (strpos($haystack, $needle) !== false) : (stripos($haystack, $needle) !== false); +} + +/** + * This function returns true if $needle is between $min and $max, and false otherwise. + * Non-numeric values are compared according to PHP defaults. + * + * @param mixed $needle The needle + * @param mixed $min The minimum value + * @param mixed $max The maximum value + * @param bool $exclusive Set this to true to exclude endpoints (default: false) + * @return bool + */ +function is_between($needle, $min, $max, $exclusive = false) +{ + if ($exclusive) + { + return ($needle > $min && $needle < $max); + } + else + { + return ($needle >= $min && $needle <= $max); + } +} + +/** + * This function restricts $input to be between $min and $max. + * All values less than $min are converted to $min, and all values greater than $max are converted to $max. + * Non-numeric values are compared according to PHP defaults. + * + * @param mixed $input The value to convert + * @param mixed $min The minimum value + * @param mixed $max The maximum value + * @return mixed + */ +function force_range($input, $min, $max) +{ + if ($input < $min) $input = $min; + if ($input > $max) $input = $max; + return $input; +} + +/** + * This function encodes a string with base64, using a URL-safe character set. + * + * @param string $str The string to encode + * @return string + */ +function base64_encode_urlsafe($str) +{ + return strtr(rtrim(base64_encode($str), '='), '+/', '-_'); +} + +/** + * This function decodes a string with base64, using a URL-safe character set. + * + * @param string $str The string to decode + * @return string + */ +function base64_decode_urlsafe($str) +{ + return @base64_decode(str_pad(strtr($str, '-_', '+/'), ceil(strlen($str) / 4) * 4, '=', STR_PAD_RIGHT)); +} + +/** + * Convert hexadecimal color codes to an array of R, G, B values. + * This function can handle both 6-digit and 3-digit notations, optionally prefixed with '#'. + * If the color code is illegal, this function will return all nulls. + * + * @param string $hex The color to convert + * @return array + */ +function hex2rgb($hex) +{ + $hex = ltrim($hex, '#'); + if (strlen($hex) == 3) + { + $r = hexdec(substr($hex, 0, 1) . substr($hex, 0, 1)); + $g = hexdec(substr($hex, 1, 1) . substr($hex, 1, 1)); + $b = hexdec(substr($hex, 2, 1) . substr($hex, 2, 1)); + } + elseif (strlen($hex) == 6) + { + $r = hexdec(substr($hex, 0, 2)); + $g = hexdec(substr($hex, 2, 2)); + $b = hexdec(substr($hex, 4, 2)); + } + else + { + $r = $g = $b = null; + } + return array($r, $g, $b); +} + +/** + * Convert an array of R, G, B values to hexadecimal color codes. + * If the RGB values are illegal, this function will return #000000. + * + * @param array $rgb The color to convert + * @param bool $hash_prefix Whether or not to prefix the result with '#' (default: true) + * @return string + */ +function rgb2hex(array $rgb, $hash_prefix = true) +{ + if (!isset($rgb[0]) || !isset($rgb[1]) || !isset($rgb[2]) || $rgb[0] > 255 || $rgb[1] > 255 || $rgb[2] > 255) + { + return '#000000'; + } + $hex = $hash_prefix ? '#' : ''; + $hex .= str_pad(dechex(max(0, $rgb[0])), 2, '0', STR_PAD_LEFT); + $hex .= str_pad(dechex(max(0, $rgb[1])), 2, '0', STR_PAD_LEFT); + $hex .= str_pad(dechex(max(0, $rgb[2])), 2, '0', STR_PAD_LEFT); + return $hex; +} + +/** + * This function includes another file in a clean scope. + * This is useful if the included file tries to define global variables. + * + * @param string $filename The name of the file to include + * @return mixed + */ +function include_in_clean_scope($filename) +{ + return (include $filename); +} + +/** + * This function includes another file while ignoring all errors inside of it. + * + * @param string $filename The name of the file to include + * @return mixed + */ +function include_and_ignore_errors($filename) +{ + error_reporting(0); + $result = (include $filename); + error_reporting(~0); + return $result; +} + +/** + * This function includes another file while ignoring all output. + * + * @param string $filename The name of the file to include + * @return mixed + */ +function include_and_ignore_output($filename) +{ + ob_start(); + $result = (include $filename); + ob_end_clean(); + return $result; +} + +/** + * Polyfill for hex2bin() which does not exist in PHP 5.3. + * + * @param string $hex The hexadecimal string to convert to binary + * @return string + */ +if (!function_exists('hex2bin')) +{ + function hex2bin($hex) + { + if (strlen($hex) % 2) $hex = '0' . $hex; + return pack('H*', $hex); + } +} + +/** + * Converts any value to either true or false. + * Based on util.php + * + * @param string $input The input value + * @return bool + */ +function tobool($input) +{ + if (preg_match('/^(1|[ty].*|on|oui|si|vrai|aye)$/i', $input)) return true; + if (preg_match('/^(0|[fn].*|off)$/i', $input)) return false; + return (bool)$input; +} + +/** + * Checks if the given string contains valid UTF-8. + * + * @param string $str The input string + * @return bool + */ +function utf8_check($str) +{ + if (function_exists('mb_check_encoding')) + { + return mb_check_encoding($str, 'UTF-8'); + } + else + { + return ($str === @iconv('UTF-8', 'UTF-8', $str)); + } +} + /** * Encode UTF-8 characters outside of the Basic Multilingual Plane in the &#xxxxxx format. * This allows emoticons and other characters to be stored in MySQL without utf8mb4 support. @@ -21,3 +443,28 @@ function utf8_mbencode($str) return '&#x' . dechex($codepoint) . ';'; }, $str); } + +/** + * This function replaces all whitespace characters with a single regular space (0x20). + * Unicode whitespace characters are also replaced. + * + * @param string $str The input string + * @param bool $multiline Set this to true to permit newlines inside the string (default: false) + * @return string + */ +function utf8_normalize_spaces($str, $multiline = false) +{ + return $multiline ? preg_replace('/((?!\x0A)[\pZ\pC])+/u', ' ', $str) : preg_replace('/[\pZ\pC]+/u', ' ', $str); +} + +/** + * This function trims all space from the beginning and end of a string. + * Unicode whitespace characters are also trimmed. + * + * @param string $str The input string + * @return string + */ +function utf8_trim($str) +{ + return preg_replace('/^[\s\pZ\pC]+|[\s\pZ\pC]+$/u', '', $str); +} diff --git a/common/legacy.php b/common/legacy.php index f59931a82..03332d9b7 100644 --- a/common/legacy.php +++ b/common/legacy.php @@ -1179,63 +1179,17 @@ function removeSrcHack($match) return "<{$match[1]}{$tag}{$attr}{$match[4]}>"; } -// convert hexa value to RGB +/** + * Convert hexa value to RGB + * + * @param string $hexstr + * @return array + */ if(!function_exists('hexrgb')) { - /** - * Convert hexa value to RGB - * - * @param string $hexstr - * @return array - */ function hexrgb($hex) { - $hex = ltrim($hex, '#'); - if(strlen($hex) == 3) - { - $r = hexdec(substr($hex, 0, 1) . substr($hex, 0, 1)); - $g = hexdec(substr($hex, 1, 1) . substr($hex, 1, 1)); - $b = hexdec(substr($hex, 2, 1) . substr($hex, 2, 1)); - } - elseif(strlen($hex) == 6) - { - $r = hexdec(substr($hex, 0, 2)); - $g = hexdec(substr($hex, 2, 2)); - $b = hexdec(substr($hex, 4, 2)); - } - else - { - $r = $g = $b = null; - } - return array('red' => $r, 'green' => $g, 'blue' => $b, 'r' => $r, 'g' => $g, 'b' => $b); - } -} - -// convert RGB value to hexa -if(!function_exists('rgbhex')) -{ - /** - * convert RGB value to hexa - * - * @param array $rgb - * @param bool $hash_prefix - * @return string - */ - function rgbhex(array $rgb, $hash_prefix = true) - { - if(!isset($rgb['r']) && !isset($rgb['g']) && !isset($rgb['b']) && count($rgb) >= 3) - { - list($rgb['r'], $rgb['g'], $rgb['b']) = $rgb; - } - if(!isset($rgb['r']) || !isset($rgb['g']) || !isset($rgb['b']) || $rgb['r'] > 255 || $rgb['g'] > 255 || $rgb['b'] > 255) - { - return '#000000'; - } - $hex = $hash_prefix ? '#' : ''; - $hex .= str_pad(dechex(max(0, $rgb['r'])), 2, '0', STR_PAD_LEFT); - $hex .= str_pad(dechex(max(0, $rgb['g'])), 2, '0', STR_PAD_LEFT); - $hex .= str_pad(dechex(max(0, $rgb['b'])), 2, '0', STR_PAD_LEFT); - return $hex; + return hex2rgb($hex); } } From 8e284db3b95068f3b5b005dd4bfba8ed225833b5 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 20 Jan 2016 14:15:59 +0900 Subject: [PATCH 02/53] Add more libraries --- common/autoload.php | 3 + common/legacy.php | 31 +--- common/libraries/bmp.php | 257 ++++++++++++++++++++++++++++++ common/libraries/cryptocompat.php | 129 +++++++++++++++ common/libraries/vendorpass.php | 150 +++++++++++++++++ 5 files changed, 540 insertions(+), 30 deletions(-) create mode 100644 common/libraries/bmp.php create mode 100644 common/libraries/cryptocompat.php create mode 100644 common/libraries/vendorpass.php diff --git a/common/autoload.php b/common/autoload.php index 7db461e24..6471945d2 100644 --- a/common/autoload.php +++ b/common/autoload.php @@ -145,8 +145,11 @@ $GLOBALS['RX_AUTOLOAD_FILE_MAP'] = array_change_key_case(array( 'HintTableTag' => 'classes/xml/xmlquery/tags/table/HintTableTag.class.php', 'TableTag' => 'classes/xml/xmlquery/tags/table/TableTag.class.php', 'TablesTag' => 'classes/xml/xmlquery/tags/table/TablesTag.class.php', + 'Bmp' => 'common/libraries/bmp.php', 'Ftp' => 'common/libraries/ftp.php', 'Tar' => 'common/libraries/tar.php', + 'CryptoCompat' => 'common/libraries/cryptocompat.php', + 'VendorPass' => 'common/libraries/vendorpass.php', ), CASE_LOWER); /** diff --git a/common/legacy.php b/common/legacy.php index 03332d9b7..221f7a50d 100644 --- a/common/legacy.php +++ b/common/legacy.php @@ -1203,36 +1203,7 @@ if(!function_exists('hexrgb')) */ function mysql_pre4_hash_password($password) { - $nr = 1345345333; - $add = 7; - $nr2 = 0x12345671; - - settype($password, "string"); - - for($i = 0; $i < strlen($password); $i++) - { - if($password[$i] == ' ' || $password[$i] == '\t') - { - continue; - } - $tmp = ord($password[$i]); - $nr ^= ((($nr & 63) + $add) * $tmp) + ($nr << 8); - $nr2 += ($nr2 << 8) ^ $nr; - $add += $tmp; - } - $result1 = sprintf("%08lx", $nr & ((1 << 31) - 1)); - $result2 = sprintf("%08lx", $nr2 & ((1 << 31) - 1)); - - if($result1 == '80000000') - { - $nr += 0x80000000; - } - if($result2 == '80000000') - { - $nr2 += 0x80000000; - } - - return sprintf("%08lx%08lx", $nr, $nr2); + return VendorPass::mysql_old_password($password); } /** diff --git a/common/libraries/bmp.php b/common/libraries/bmp.php new file mode 100644 index 000000000..64a375091 --- /dev/null +++ b/common/libraries/bmp.php @@ -0,0 +1,257 @@ +=0; $y--) + { + for ($x=0; $x<$wid; $x++) + { + $rgb = imagecolorat($img, $x, $y); + fwrite($f, byte3($rgb)); + } + fwrite($f, $wid_pad); + } + fclose($f); + } + else + { + foreach ($header AS $h) + { + echo $h; + } + + //save pixels + for ($y=$hei-1; $y>=0; $y--) + { + for ($x=0; $x<$wid; $x++) + { + $rgb = imagecolorat($img, $x, $y); + echo self::byte3($rgb); + } + echo $wid_pad; + } + } + } + + public static function getimagesize($filename) + { + $f = fopen($filename, "rb"); + + //read header + $header = fread($f, 54); + $header = unpack( 'c2identifier/Vfile_size/Vreserved/Vbitmap_data/Vheader_size/' . + 'Vwidth/Vheight/vplanes/vbits_per_pixel/Vcompression/Vdata_size/'. + 'Vh_resolution/Vv_resolution/Vcolors/Vimportant_colors', $header); + + if ($header['identifier1'] != 66 or $header['identifier2'] != 77) + { + return false; + } + + if (!in_array($header['bits_per_pixel'], array(24, 32, 8, 4, 1))) + { + return false; + } + + $bps = $header['bits_per_pixel']; //bits per pixel + $wid2 = ceil(($bps/8 * $header['width']) / 4) * 4; + $colors = pow(2, $bps); + + $wid = $header['width']; + $hei = $header['height']; + + return array($wid, $hei, 'BMP'); + } + + public static function imagecreatefrombmp($filename) + { + $f = fopen($filename, "rb"); + + //read header + $header = fread($f, 54); + $header = unpack( 'c2identifier/Vfile_size/Vreserved/Vbitmap_data/Vheader_size/' . + 'Vwidth/Vheight/vplanes/vbits_per_pixel/Vcompression/Vdata_size/'. + 'Vh_resolution/Vv_resolution/Vcolors/Vimportant_colors', $header); + + if ($header['identifier1'] != 66 or $header['identifier2'] != 77) + { + return false; + } + + if (!in_array($header['bits_per_pixel'], array(24, 32, 8, 4, 1))) + { + return false; + } + + $bps = $header['bits_per_pixel']; //bits per pixel + $wid2 = ceil(($bps/8 * $header['width']) / 4) * 4; + $colors = pow(2, $bps); + + $wid = $header['width']; + $hei = $header['height']; + + $img = imagecreatetruecolor($header['width'], $header['height']); + + //read palette + if ($bps < 9) + { + for ($i=0; $i<$colors; $i++) + { + $palette[] = self::undword(fread($f, 4)); + } + } + else + { + if ($bps == 32) + { + imagealphablending($img, false); + imagesavealpha($img, true); + } + $palette = array(); + } + + //read pixels + for ($y=$hei-1; $y>=0; $y--) + { + $row = fread($f, $wid2); + $pixels = self::str_split2($row, $bps, $palette); + for ($x=0; $x<$wid; $x++) + { + self::makepixel($img, $x, $y, $pixels[$x], $bps); + } + } + fclose($f); + + return $img; + } + + private static function str_split2($row, $bps, $palette) + { + switch ($bps) + { + case 32: + case 24: return str_split($row, $bps/8); + case 8: $out = array(); + $count = strlen($row); + for ($i=0; $i<$count; $i++) + { + $out[] = $palette[ ord($row[$i]) ]; + } + return $out; + case 4: $out = array(); + $count = strlen($row); + for ($i=0; $i<$count; $i++) + { + $roww = ord($row[$i]); + $out[] = $palette[ ($roww & 240) >> 4 ]; + $out[] = $palette[ ($roww & 15) ]; + } + return $out; + case 1: $out = array(); + $count = strlen($row); + for ($i=0; $i<$count; $i++) + { + $roww = ord($row[$i]); + $out[] = $palette[ ($roww & 128) >> 7 ]; + $out[] = $palette[ ($roww & 64) >> 6 ]; + $out[] = $palette[ ($roww & 32) >> 5 ]; + $out[] = $palette[ ($roww & 16) >> 4 ]; + $out[] = $palette[ ($roww & 8) >> 3 ]; + $out[] = $palette[ ($roww & 4) >> 2 ]; + $out[] = $palette[ ($roww & 2) >> 1 ]; + $out[] = $palette[ ($roww & 1) ]; + } + return $out; + } + } + + private static function makepixel($img, $x, $y, $str, $bps) + { + switch ($bps) + { + case 32 : $a = ord($str[0]); + $b = ord($str[1]); + $c = ord($str[2]); + $d = 256 - ord($str[3]); //TODO: gives imperfect results + $pixel = $d*256*256*256 + $c*256*256 + $b*256 + $a; + imagesetpixel($img, $x, $y, $pixel); + break; + case 24 : $a = ord($str[0]); + $b = ord($str[1]); + $c = ord($str[2]); + $pixel = $c*256*256 + $b*256 + $a; + imagesetpixel($img, $x, $y, $pixel); + break; + case 8 : + case 4 : + case 1 : imagesetpixel($img, $x, $y, $str); + break; + } + } + + private static function byte3($n) + { + return chr($n & 255) . chr(($n >> 8) & 255) . chr(($n >> 16) & 255); + } + + private static function undword($n) + { + $r = unpack("V", $n); + return $r[1]; + } + + private static function dword($n) + { + return pack("V", $n); + } + + private static function word($n) + { + return pack("v", $n); + } +} diff --git a/common/libraries/cryptocompat.php b/common/libraries/cryptocompat.php new file mode 100644 index 000000000..0bebc5f2a --- /dev/null +++ b/common/libraries/cryptocompat.php @@ -0,0 +1,129 @@ + $block_size) return false; + if (substr($str, (-1 * $padding_size)) !== str_repeat(chr($padding_size), $padding_size)) return false; + return substr($str, 0, strlen($str) - $padding_size); + } + + /** + * @brief HKDF function compatible with defuse/php-encryption + * @return string + */ + protected static function _defuseCompatibleHKDF($key, $info) + { + $salt = str_repeat("\x00", self::ENCRYPTION_MAC_SIZE); + $prk = hash_hmac(self::ENCRYPTION_MAC_ALGO, $key, $salt, true); + $t = $last_block = ''; + for ($block_index = 1; strlen($t) < self::ENCRYPTION_KEY_SIZE; $block_index++) + { + $t .= $last_block = hash_hmac(self::ENCRYPTION_MAC_ALGO, ($last_block . $info . chr($block_index)), $prk, true); + } + return substr($t, 0, self::ENCRYPTION_KEY_SIZE); + } +} diff --git a/common/libraries/vendorpass.php b/common/libraries/vendorpass.php new file mode 100644 index 000000000..46e5e73c3 --- /dev/null +++ b/common/libraries/vendorpass.php @@ -0,0 +1,150 @@ + 12) + { + $iterations = intval(strpos($itoa64, substr($salt, 3, 1))); + $salt = substr($salt, 4, 8); + } + else + { + $iterations = 15; + $salt = Password::createSecureSalt(8, 'hex'); + } + $count = 1 << $iterations; + $hash = hash('sha512', $salt . $password, true); + do + { + $hash = hash('sha512', $hash . $password, true); + } while (--$count); + $hash = self::drupal_base64($hash, strlen($hash), $itoa64); + return substr('$S$' . $itoa64[$iterations] . $salt . $hash, 0, 55); + } + + // Drupal's own Base64 implementation. + + protected static function drupal_base64($input, $count, $chars) + { + $output = ''; + $i = 0; + do + { + $value = ord($input[$i++]); + $output .= $chars[$value & 0x3f]; + if ($i < $count) $value |= ord($input[$i]) << 8; + $output .= $chars[($value >> 6) & 0x3f]; + if ($i++ >= $count) break; + if ($i < $count) $value |= ord($input[$i]) << 16; + $output .= $chars[($value >> 12) & 0x3f]; + if ($i++ >= $count) break; + $output .= $chars[($value >> 18) & 0x3f]; + } while ($i < $count); + return $output; + } + + // Joomla's MD5-based password hashing algorithm. + + public static function joomla($password, $salt = null) + { + if ($salt !== null && strlen($salt) > 33) + { + $salt = substr($salt, 33); + } + else + { + $salt = Password::createSecureSalt(32, 'hex'); + } + return md5($password . $salt) . ':' . $salt; + } + + // KimsQ Rb's algorithms. + + public static function kimsqrb($password, $salt = null) + { + if (preg_match('/(\$[1-4])\$([0-9]{14})$/', $salt, $matches)) + { + $date = '$' . $matches[2]; + $fakesalt = substr(base64_encode(substr($date, 1) . 'salt'), 0, 22); + switch ($matches[1]) + { + case '$1': return self::password_hash($password, 1, ['cost' =>10, 'salt' => $fakesalt]) . '$1' . $date; + case '$2': return hash('sha512', $password . $fakesalt) . '$2' . $date; + case '$3': return hash('sha256', $password . $fakesalt) . '$3' . $date; + case '$4': return md5(sha1(md5($password . $fakesalt))) . '$4' . $date; + } + } + + $date = '$' . date('YmdHis'); + $fakesalt = substr(base64_encode(substr($date, 1) . 'salt'), 0, 22); + return self::password_hash($password, 1, ['cost' =>10, 'salt' => $fakesalt]) . '$1' . $date; + } + + // Bcrypt wrapper for PHP 5.4. + + public static function password_hash($password, $algo = 1, $options = []) + { + if (!isset($options['salt']) || !preg_match('/^[0-9a-zA-Z\.\/]{22,}$/', $options['salt'])) + { + $options['salt'] = Password::createSecureSalt(22, 'alnum'); + } + if (!isset($options['cost']) || $options['cost'] < 4 || $options['cost'] > 31) + { + $options['cost'] = 10; + } + + $salt = '$2y$' . sprintf('%02d', $options['cost']) . '$' . $options['salt']; + return @crypt($password, $salt); + } +} From 9ddf2f54f3dc65f3d4e85994af4a5df62f6a9184 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 20 Jan 2016 14:19:24 +0900 Subject: [PATCH 03/53] Fix compatibility with PHP 5.3 --- common/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/functions.php b/common/functions.php index eddbcd2e6..72193e426 100644 --- a/common/functions.php +++ b/common/functions.php @@ -162,7 +162,7 @@ function escape_dqstr($str) function explode_with_escape($delimiter, $str, $limit = 0, $escape_char = '\\') { if ($limit < 1) $limit = null; - $result = []; + $result = array(); $split = preg_split('/(? Date: Wed, 20 Jan 2016 15:45:18 +0900 Subject: [PATCH 04/53] Refactor some URL related functions to use Rhymix constants --- classes/context/Context.class.php | 54 +++++++------------------------ common/constants.php | 6 ++-- common/legacy.php | 11 ++----- 3 files changed, 16 insertions(+), 55 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index efe140a22..e8dd16218 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -1600,15 +1600,7 @@ class Context static $url = null; if(is_null($url)) { - $url = self::getRequestUri(); - if(count($_GET) > 0) - { - foreach($_GET as $key => $val) - { - $vars[] = $key . '=' . ($val ? urlencode(self::convertEncodingStr($val)) : ''); - } - $url .= '?' . join('&', $vars); - } + $url = self::getRequestUri() . '?' . http_build_query($_GET); } return $url; } @@ -1746,7 +1738,7 @@ class Context 'dispDocumentAdminManageDocument' => 'dispDocumentManageDocument', 'dispModuleAdminSelectList' => 'dispModuleSelectList' ); - if($act_alias[$act]) + if(isset($act_alias[$act])) { $get_vars['act'] = $act_alias[$act]; } @@ -1794,27 +1786,9 @@ class Context $query = $target_map[$target]; } - if(!$query) + if(!$query && count($get_vars) > 0) { - $queries = array(); - foreach($get_vars as $key => $val) - { - if(is_array($val) && count($val) > 0) - { - foreach($val as $k => $v) - { - $queries[] = $key . '[' . $k . ']=' . urlencode($v); - } - } - elseif(!is_array($val)) - { - $queries[] = $key . '=' . urlencode($val); - } - } - if(count($queries) > 0) - { - $query = 'index.php?' . join('&', $queries); - } + $query = 'index.php?' . http_build_query($get_vars); } } @@ -1823,14 +1797,14 @@ class Context if($_use_ssl == 'always') { $query = self::getRequestUri(ENFORCE_SSL, $domain) . $query; - // optional SSL use } + // optional SSL use elseif($_use_ssl == 'optional') { $ssl_mode = ((self::get('module') === 'admin') || ($get_vars['module'] === 'admin') || (isset($get_vars['act']) && self::isExistsSSLAction($get_vars['act']))) ? ENFORCE_SSL : RELEASE_SSL; $query = self::getRequestUri($ssl_mode, $domain) . $query; - // no SSL } + // no SSL else { // currently on SSL but target is not based on SSL @@ -1844,7 +1818,7 @@ class Context } else { - $query = getScriptPath() . $query; + $query = RX_BASEURL . $query; } } @@ -1910,11 +1884,9 @@ class Context return $url[$ssl_mode][$domain_key]; } - $current_use_ssl = ($_SERVER['HTTPS'] == 'on'); - switch($ssl_mode) { - case FOLLOW_REQUEST_SSL: $use_ssl = $current_use_ssl; + case FOLLOW_REQUEST_SSL: $use_ssl = RX_SSL; break; case ENFORCE_SSL: $use_ssl = TRUE; break; @@ -1924,20 +1896,16 @@ class Context if($domain) { - $target_url = trim($domain); - if(substr_compare($target_url, '/', -1) !== 0) - { - $target_url.= '/'; - } + $target_url = rtrim(trim($domain), '/') . '/'; } else { - $target_url = $_SERVER['HTTP_HOST'] . getScriptPath(); + $target_url = $_SERVER['HTTP_HOST'] . RX_BASEURL; } $url_info = parse_url('http://' . $target_url); - if($current_use_ssl != $use_ssl) + if($use_ssl != RX_SSL) { unset($url_info['port']); } diff --git a/common/constants.php b/common/constants.php index c8234bc51..57d28ea3d 100644 --- a/common/constants.php +++ b/common/constants.php @@ -18,18 +18,18 @@ define('RX_TIME', intval(RX_MICROTIME)); /** * RX_BASEDIR is the SERVER-SIDE absolute path of Rhymix (with trailing slash). */ -define('RX_BASEDIR', dirname(__DIR__) . '/'); +define('RX_BASEDIR', str_replace('\\', '/', dirname(__DIR__)) . '/'); /** * RX_BASEURL is the CLIENT-SIDE absolute path of Rhymix (with trailing slash, relative to the document root). */ -if (isset($_SERVER['DOCUMENT_ROOT']) && !strncmp(RX_BASEDIR, $_SERVER['DOCUMENT_ROOT'], strlen($_SERVER['DOCUMENT_ROOT']))) +if (isset($_SERVER['DOCUMENT_ROOT']) && !strncmp(RX_BASEDIR, str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), strlen($_SERVER['DOCUMENT_ROOT']))) { define('RX_BASEURL', rtrim(substr(RX_BASEDIR, strlen($_SERVER['DOCUMENT_ROOT'])), '/') . '/'); } elseif (isset($_SERVER['PHP_SELF']) && ($len = strlen($_SERVER['PHP_SELF'])) && $len >= 10 && substr($_SERVER['PHP_SELF'], $len - 10) === '/index.php') { - define('RX_BASEURL', rtrim(substr($_SERVER['PHP_SELF'], 0, $len - 10), '/') . '/'); + define('RX_BASEURL', rtrim(str_replace('\\', '/', substr($_SERVER['PHP_SELF'], 0, $len - 10)), '/') . '/'); } else { diff --git a/common/legacy.php b/common/legacy.php index 221f7a50d..9f95b773b 100644 --- a/common/legacy.php +++ b/common/legacy.php @@ -457,9 +457,7 @@ function getFullSiteUrl() */ function getCurrentPageUrl() { - $protocol = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'; - $url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; - return htmlspecialchars($url, ENT_COMPAT, 'UTF-8', FALSE); + return escape((RX_SSL ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); } /** @@ -1213,12 +1211,7 @@ function mysql_pre4_hash_password($password) */ function getScriptPath() { - static $url = NULL; - if($url == NULL) - { - $url = str_ireplace('/tools/', '/', preg_replace('/index.php$/i', '', str_replace('\\', '/', $_SERVER['SCRIPT_NAME']))); - } - return $url; + return RX_BASEURL; } /** From 08560f84be3705785072716571bd2d11432d08cc Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 20 Jan 2016 15:53:42 +0900 Subject: [PATCH 05/53] Refactor more URL related functions --- classes/context/Context.class.php | 12 ++++-------- classes/module/ModuleHandler.class.php | 2 +- .../components/image_link/image_link.class.php | 3 +-- modules/install/install.view.php | 4 ++-- modules/rss/rss.view.php | 3 +-- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index e8dd16218..484e891ce 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -1600,7 +1600,7 @@ class Context static $url = null; if(is_null($url)) { - $url = self::getRequestUri() . '?' . http_build_query($_GET); + $url = self::getRequestUri() . RX_REQUEST_URL; } return $url; } @@ -1670,7 +1670,7 @@ class Context $domain_info = parse_url($domain); if(is_null($current_info)) { - $current_info = parse_url(($_SERVER['HTTPS'] == 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . getScriptPath()); + $current_info = parse_url((RX_SSL ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . RX_BASEURL); } if($domain_info['host'] . $domain_info['path'] == $current_info['host'] . $current_info['path']) { @@ -1678,11 +1678,7 @@ class Context } else { - $domain = preg_replace('/^(http|https):\/\//i', '', trim($domain)); - if(substr_compare($domain, '/', -1) !== 0) - { - $domain .= '/'; - } + $domain = rtrim(preg_replace('/^(http|https):\/\//i', '', trim($domain)), '/') . '/'; } } @@ -1808,7 +1804,7 @@ class Context else { // currently on SSL but target is not based on SSL - if($_SERVER['HTTPS'] == 'on') + if(RX_SSL) { $query = self::getRequestUri(ENFORCE_SSL, $domain) . $query; } diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index d0db90beb..ca462a02e 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -89,7 +89,7 @@ class ModuleHandler extends Handler if(isset($this->act) && (strlen($this->act) >= 4 && substr_compare($this->act, 'disp', 0, 4) === 0)) { - if(Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && $_SERVER['HTTPS'] != 'on') + if(Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && RX_SSL) { if(Context::get('_https_port')!=null) { header('location:https://' . $_SERVER['HTTP_HOST'] . ':' . Context::get('_https_port') . $_SERVER['REQUEST_URI']); diff --git a/modules/editor/components/image_link/image_link.class.php b/modules/editor/components/image_link/image_link.class.php index 68b477ba6..464560c32 100644 --- a/modules/editor/components/image_link/image_link.class.php +++ b/modules/editor/components/image_link/image_link.class.php @@ -63,8 +63,7 @@ class image_link extends EditorHandler if(substr($src, 0,2)=='./') $src = Context::getRequestUri().substr($src, 2); else if(substr($src , 0, 1)=='/') { - if($_SERVER['HTTPS']=='on') $http_src = 'https://'; - else $http_src = 'http://'; + $http_src = RX_SSL ? 'https://' : 'http://'; $src = $http_src.$_SERVER['HTTP_HOST'].$src; } else if(!strpos($temp_src[0],':') && $src) $src = Context::getRequestUri().$src; diff --git a/modules/install/install.view.php b/modules/install/install.view.php index eb92f91e7..5f505ae78 100644 --- a/modules/install/install.view.php +++ b/modules/install/install.view.php @@ -153,7 +153,7 @@ class installView extends install Context::set('progressMenu', '4'); $error_return_url = getNotEncodedUrl('', 'act', Context::get('act'), 'db_type', Context::get('db_type')); - if($_SERVER['HTTPS'] == 'on') + if(RX_SSL) { // Error occured when using https protocol at "ModuleHandler::init() ' $parsedUrl = parse_url($error_return_url); @@ -182,7 +182,7 @@ class installView extends install include _XE_PATH_.'files/config/tmpDB.config.php'; Context::set('use_rewrite', $_SESSION['use_rewrite']); - Context::set('use_ssl', $_SERVER['HTTPS'] === 'on' ? 'always' : 'none'); + Context::set('use_ssl', RX_SSL ? 'always' : 'none'); Context::set('time_zone', $GLOBALS['time_zone']); Context::set('db_type', $db_info->db_type); $this->setTemplateFile('admin_form'); diff --git a/modules/rss/rss.view.php b/modules/rss/rss.view.php index 86b99b5f5..f37823cd9 100644 --- a/modules/rss/rss.view.php +++ b/modules/rss/rss.view.php @@ -157,8 +157,7 @@ class rssView extends rss break; } - if($_SERVER['HTTPS']=='on') $proctcl = 'https://'; - else $proctcl = 'http://'; + $proctcl = RX_SSL ? 'https://' : 'http://'; $temp_link = explode('/', $info->link); if($temp_link[0]=='' && $info->link) From 25585d89edf76e2b1e2c85d7f39d7d942d65a66d Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 20 Jan 2016 16:36:48 +0900 Subject: [PATCH 06/53] Make Context::setRequestMethod() easier to read --- classes/context/Context.class.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 484e891ce..9c4b327b1 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -1275,12 +1275,27 @@ class Context public static function setRequestMethod($type = '') { self::$_instance->js_callback_func = self::$_instance->getJSCallbackFunc(); - - ($type && self::$_instance->request_method = $type) or - ((strpos($_SERVER['CONTENT_TYPE'], 'json') || strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json')) && self::$_instance->request_method = 'JSON') or - ($GLOBALS['HTTP_RAW_POST_DATA'] && self::$_instance->request_method = 'XMLRPC') or - (self::$_instance->js_callback_func && self::$_instance->request_method = 'JS_CALLBACK') or - (self::$_instance->request_method = $_SERVER['REQUEST_METHOD']); + + if ($type) + { + self::$_instance->request_method = $type; + } + elseif (strpos($_SERVER['CONTENT_TYPE'], 'json') !== false || strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json') !== false) + { + self::$_instance->request_method = 'JSON'; + } + elseif ($GLOBALS['HTTP_RAW_POST_DATA']) + { + self::$_instance->request_method = 'XMLRPC'; + } + elseif (self::$_instance->js_callback_func) + { + self::$_instance->request_method = 'JS_CALLBACK'; + } + else + { + self::$_instance->request_method = $_SERVER['REQUEST_METHOD']; + } } /** From ab92e76408386f17a730220d960f06978f620430 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 21 Jan 2016 16:20:42 +0900 Subject: [PATCH 07/53] Move SSL-related Context constants to constants.php --- classes/context/Context.class.php | 4 ---- common/constants.php | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 9c4b327b1..00af3be99 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -1,10 +1,6 @@ */ -define('FOLLOW_REQUEST_SSL', 0); -define('ENFORCE_SSL', 1); -define('RELEASE_SSL', 2); - /** * Manages Context such as request arguments/environment variables * It has dual method structure, easy-to use methods which can be called as self::methodname(),and methods called with static object. diff --git a/common/constants.php b/common/constants.php index 57d28ea3d..1a0e9ae23 100644 --- a/common/constants.php +++ b/common/constants.php @@ -140,3 +140,6 @@ define('LOWER', 'abcdefghijklmnopqrstuvwxyz'); define('CR', "\r"); define('CRLF', "\r\n"); define('LF', "\n"); +define('FOLLOW_REQUEST_SSL', 0); +define('ENFORCE_SSL', 1); +define('RELEASE_SSL', 2); From 6a2dc541bb46723c302fa6cd51c6c5fa8cc5bf3b Mon Sep 17 00:00:00 2001 From: qw5414 Date: Fri, 22 Jan 2016 01:13:30 +0900 Subject: [PATCH 08/53] =?UTF-8?q?=EC=B6=94=EC=B2=9C=EC=9D=84=20=EC=B7=A8?= =?UTF-8?q?=EC=86=8C=ED=95=A0=20=EC=88=98=20=EC=9E=87=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/lang/lang.xml | 8 +++++ modules/board/skins/xedition/_read.html | 11 ++++++- .../board/skins/xedition/board.default.css | 7 +++++ modules/board/skins/xedition/skin.xml | 2 +- modules/document/conf/module.xml | 1 + modules/document/document.controller.php | 30 +++++++++++++++++-- modules/document/document.item.php | 21 +++++++++++++ modules/document/lang/lang.xml | 4 +++ 8 files changed, 80 insertions(+), 4 deletions(-) diff --git a/common/lang/lang.xml b/common/lang/lang.xml index 0afb91ef4..75e80b3cd 100644 --- a/common/lang/lang.xml +++ b/common/lang/lang.xml @@ -3014,6 +3014,10 @@ + + + + @@ -3028,6 +3032,10 @@ + + + + diff --git a/modules/board/skins/xedition/_read.html b/modules/board/skins/xedition/_read.html index 1f9920cbb..0bf48c1a3 100644 --- a/modules/board/skins/xedition/_read.html +++ b/modules/board/skins/xedition/_read.html @@ -79,7 +79,16 @@ content : sTitle }); }); - + + +
diff --git a/modules/board/skins/xedition/board.default.css b/modules/board/skins/xedition/board.default.css index 8d0097174..3037f26fb 100644 --- a/modules/board/skins/xedition/board.default.css +++ b/modules/board/skins/xedition/board.default.css @@ -570,6 +570,13 @@ .read_footer .sns a:hover{border-color:#DECA79;background-color:#f9dc5f;transition: all 0.2s ease-in-out;-webkit-transition: all 0.2s ease-in-out} .read_footer .sns a:hover {color:#747474;transition: all 0.2s ease-in-out;-webkit-transition: all 0.2s ease-in-out} +.read_footer .vote{ margin-top:51px;text-align:center; } +.read_footer .vote li{display:inline;vertical-align:top} +.read_footer .vote a{display:inline-block;width:46px;height:52px;border:1px solid #e0e0e0;background-color:#f4f4f4; border-radius:2px;} +.read_footer .vote i{font-size:22px;line-height:32px;color:#bcbcbc} +.read_footer .vote a:hover{border-color:#DECA79;background-color:#f9dc5f;transition: all 0.2s ease-in-out;-webkit-transition: all 0.2s ease-in-out} +.read_footer .vote a:hover {color:#747474;transition: all 0.2s ease-in-out;-webkit-transition: all 0.2s ease-in-out} + .read_footer .sign { clear: both; border: 1px solid #ddd; diff --git a/modules/board/skins/xedition/skin.xml b/modules/board/skins/xedition/skin.xml index d61e79ff0..603952102 100644 --- a/modules/board/skins/xedition/skin.xml +++ b/modules/board/skins/xedition/skin.xml @@ -6,7 +6,7 @@ NAVER - LGPL v2 + GPL v2 diff --git a/modules/document/conf/module.xml b/modules/document/conf/module.xml index c2177765e..b6f4a5306 100644 --- a/modules/document/conf/module.xml +++ b/modules/document/conf/module.xml @@ -29,6 +29,7 @@ + . diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index dd65abcd5..5bdad4f8c 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -44,6 +44,32 @@ class documentController extends document return $output; } + function procDocumentVoteUpCancel() + { + if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request'); + + $document_srl = Context::get('target_srl'); + if(!$document_srl) return new Object(-1, 'msg_invalid_request'); + + $oDocumentModel = getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl, false, false); + if($oDocument->get('voted_count') <= 0) + { + return new Object(-1, 'msg_document_voted_cancel_not'); + } + + $args = new stdClass(); + $d_args = new stdClass(); + $args->document_srl = $d_args->document_srl = $document_srl; + $args->voted_count = $oDocument->get('voted_count') - 1; + $output = executeQuery('document.updateVotedCount', $args); + $d_output = executeQuery('document.deleteDocumentVotedLog', $d_args); + //session reset + $_SESSION['voted_document'][$document_srl] = false; + $output->setMessage('success_voted_canceled'); + return $output; + } + /** * insert alias * @param int $module_srl @@ -1153,11 +1179,11 @@ class documentController extends document $oDocumentModel = getModel('document'); $oDocument = $oDocumentModel->getDocument($document_srl, false, false); // Pass if the author's IP address is as same as visitor's. - if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR']) + /*if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR']) { $_SESSION['voted_document'][$document_srl] = true; return new Object(-1, $failed_voted); - } + }*/ // Create a member model object $oMemberModel = getModel('member'); diff --git a/modules/document/document.item.php b/modules/document/document.item.php index 14b46e2d2..fc302d029 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -369,6 +369,27 @@ class documentItem extends Object return $title; } + function getVoted() + { + if(!$this->document_srl) return; + + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + $document_srl = $this->document_srl; + + $args = new stdClass(); + $args->member_srl = $member_srl; + $args->document_srl = $document_srl; + $output = executeQuery('document.getDocumentVotedLogInfo', $args); + + if($output->data->count) + { + return true; + } + + return false; + } + function getTitle($cut_size = 0, $tail='...') { if(!$this->document_srl) return; diff --git a/modules/document/lang/lang.xml b/modules/document/lang/lang.xml index 812ffefaa..0a2d5f3b5 100644 --- a/modules/document/lang/lang.xml +++ b/modules/document/lang/lang.xml @@ -349,6 +349,10 @@ + + + + From 19a32d195a549d1f578a924f00bd12f5a11dab63 Mon Sep 17 00:00:00 2001 From: qw5414 Date: Fri, 22 Jan 2016 01:17:27 +0900 Subject: [PATCH 09/53] =?UTF-8?q?=EB=94=94=EB=B2=84=EA=B7=B8=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/board/skins/xedition/_read.html | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/board/skins/xedition/_read.html b/modules/board/skins/xedition/_read.html index 0bf48c1a3..ef8b42aad 100644 --- a/modules/board/skins/xedition/_read.html +++ b/modules/board/skins/xedition/_read.html @@ -84,7 +84,6 @@
  • - {@ debugPrint($oDocument->getVoted())}
    {$lang->cmd_vote} {$oDocument->get('voted_count')}

    {$lang->cmd_vote} {$oDocument->get('voted_count')}
  • From 1ba633ff83e8a3d7c9142c8402be901e0b9466af Mon Sep 17 00:00:00 2001 From: qw5414 Date: Fri, 22 Jan 2016 01:20:27 +0900 Subject: [PATCH 10/53] =?UTF-8?q?=EB=94=94=EB=B2=84=EA=B7=B8=EB=A5=BC=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20=EC=BD=94=EB=93=9C=EC=99=80=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=EC=9D=98=20=EB=93=A4=EC=97=AC=EC=93=B0=EA=B8=B0?= =?UTF-8?q?=EA=B0=80=20=EC=9E=98=EB=AA=BB=EB=90=9C=20=EB=B6=80=EB=B6=84?= =?UTF-8?q?=EC=9D=84=20=EA=B3=A0=EC=B9=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/document/conf/module.xml | 2 +- modules/document/document.controller.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/document/conf/module.xml b/modules/document/conf/module.xml index b6f4a5306..95ead3bd5 100644 --- a/modules/document/conf/module.xml +++ b/modules/document/conf/module.xml @@ -29,7 +29,7 @@ - . + . diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 5bdad4f8c..c78bf8dea 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -1179,11 +1179,11 @@ class documentController extends document $oDocumentModel = getModel('document'); $oDocument = $oDocumentModel->getDocument($document_srl, false, false); // Pass if the author's IP address is as same as visitor's. - /*if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR']) + if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR']) { $_SESSION['voted_document'][$document_srl] = true; return new Object(-1, $failed_voted); - }*/ + } // Create a member model object $oMemberModel = getModel('member'); From 43a6caeb3694d3b928c5f5bc5e668f9c18b4a855 Mon Sep 17 00:00:00 2001 From: qw5414 Date: Fri, 22 Jan 2016 13:07:22 +0900 Subject: [PATCH 11/53] =?UTF-8?q?=EC=B6=94=EC=B2=9C/=EB=B9=84=EC=B6=94?= =?UTF-8?q?=EC=B2=9C=20=EC=9D=B8=EC=8B=9D=20=EB=B0=A9=EB=B2=95=EC=9D=84=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=ED=95=98=EA=B3=A0=20=EA=B7=B8=EC=97=90=20?= =?UTF-8?q?=EB=A7=9E=EA=B2=8C=20=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/board/skins/xedition/_read.html | 2 +- modules/document/document.controller.php | 12 ++++++---- modules/document/document.item.php | 24 +++++++++++++------ .../queries/deleteDocumentVotedLog.xml | 1 + .../document/queries/getDocumentVotedLog.xml | 15 ++++++++++++ 5 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 modules/document/queries/getDocumentVotedLog.xml diff --git a/modules/board/skins/xedition/_read.html b/modules/board/skins/xedition/_read.html index ef8b42aad..52d9c8c2a 100644 --- a/modules/board/skins/xedition/_read.html +++ b/modules/board/skins/xedition/_read.html @@ -85,7 +85,7 @@
diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index c78bf8dea..55893ada5 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -57,15 +57,18 @@ class documentController extends document { return new Object(-1, 'msg_document_voted_cancel_not'); } + $logged_info = Context::get('logged_info'); $args = new stdClass(); $d_args = new stdClass(); $args->document_srl = $d_args->document_srl = $document_srl; + $d_args->member_srl = $logged_info->member_srl; $args->voted_count = $oDocument->get('voted_count') - 1; $output = executeQuery('document.updateVotedCount', $args); $d_output = executeQuery('document.deleteDocumentVotedLog', $d_args); //session reset $_SESSION['voted_document'][$document_srl] = false; + $output->setMessage('success_voted_canceled'); return $output; } @@ -1201,7 +1204,7 @@ class documentController extends document } // Use member_srl for logged-in members and IP address for non-members. - $args = new stdClass; + $args = new stdClass(); if($member_srl) { $args->member_srl = $member_srl; @@ -1227,11 +1230,15 @@ class documentController extends document if($point < 0) { $args->blamed_count = $oDocument->get('blamed_count') + $point; + // Leave in the session information + $_SESSION['voted_document'][$document_srl] = -1; $output = executeQuery('document.updateBlamedCount', $args); } else { $args->voted_count = $oDocument->get('voted_count') + $point; + // Leave in the session information + $_SESSION['voted_document'][$document_srl] = 1; $output = executeQuery('document.updateVotedCount', $args); } if(!$output->toBool()) return $output; @@ -1265,9 +1272,6 @@ class documentController extends document $oCacheHandler->delete($cache_key); } - // Leave in the session information - $_SESSION['voted_document'][$document_srl] = true; - // Return result $output = new Object(); if($point > 0) diff --git a/modules/document/document.item.php b/modules/document/document.item.php index fc302d029..54cb14917 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -372,19 +372,29 @@ class documentItem extends Object function getVoted() { if(!$this->document_srl) return; + if($_SESSION['voted_document'][$this->document_srl] == '1') + { + return 'voted'; + } + else if($_SESSION['voted_document'][$this->document_srl] == '-1') + { + return 'blamed'; + } $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - $document_srl = $this->document_srl; $args = new stdClass(); - $args->member_srl = $member_srl; - $args->document_srl = $document_srl; - $output = executeQuery('document.getDocumentVotedLogInfo', $args); + $args->member_srl = $logged_info->member_srl; + $args->document_srl = $this->document_srl; + $output = executeQuery('document.getDocumentVotedLog', $args); - if($output->data->count) + if($output->data->point === '1') { - return true; + return 'voted'; + } + else if($output->data->point === '-1') + { + return 'blamed'; } return false; diff --git a/modules/document/queries/deleteDocumentVotedLog.xml b/modules/document/queries/deleteDocumentVotedLog.xml index bd550122c..04e92a317 100644 --- a/modules/document/queries/deleteDocumentVotedLog.xml +++ b/modules/document/queries/deleteDocumentVotedLog.xml @@ -4,5 +4,6 @@ + diff --git a/modules/document/queries/getDocumentVotedLog.xml b/modules/document/queries/getDocumentVotedLog.xml new file mode 100644 index 000000000..a990bc108 --- /dev/null +++ b/modules/document/queries/getDocumentVotedLog.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + From 31ea80a380224bf21146df3531001a87311d6cf9 Mon Sep 17 00:00:00 2001 From: qw5414 Date: Fri, 22 Jan 2016 13:17:47 +0900 Subject: [PATCH 12/53] =?UTF-8?q?=EB=AC=B8=EC=9E=90=EC=97=B4=EC=9D=84=20?= =?UTF-8?q?=EC=88=AB=EC=9E=90=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/board/skins/xedition/_read.html | 2 +- modules/document/document.item.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/board/skins/xedition/_read.html b/modules/board/skins/xedition/_read.html index 52d9c8c2a..a10c3562b 100644 --- a/modules/board/skins/xedition/_read.html +++ b/modules/board/skins/xedition/_read.html @@ -85,7 +85,7 @@ diff --git a/modules/document/document.item.php b/modules/document/document.item.php index 54cb14917..aa6486d21 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -374,11 +374,11 @@ class documentItem extends Object if(!$this->document_srl) return; if($_SESSION['voted_document'][$this->document_srl] == '1') { - return 'voted'; + return 1; } else if($_SESSION['voted_document'][$this->document_srl] == '-1') { - return 'blamed'; + return -1; } $logged_info = Context::get('logged_info'); @@ -390,11 +390,11 @@ class documentItem extends Object if($output->data->point === '1') { - return 'voted'; + return 1; } else if($output->data->point === '-1') { - return 'blamed'; + return -1; } return false; From e0dfa0db5be06c90d102c36ca928bfc57756c4ec Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 22 Jan 2016 14:02:32 +0900 Subject: [PATCH 13/53] Clean up some non-static methods in ModuleHandler --- classes/module/ModuleHandler.class.php | 118 +++++++++++-------------- 1 file changed, 54 insertions(+), 64 deletions(-) diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index ca462a02e..53b1aa756 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -32,7 +32,7 @@ class ModuleHandler extends Handler * @return void * */ - function __construct($module = '', $act = '', $mid = '', $document_srl = '', $module_srl = '') + public function __construct($module = '', $act = '', $mid = '', $document_srl = '', $module_srl = '') { // If XE has not installed yet, set module as install if(!Context::isInstalled()) @@ -101,7 +101,7 @@ class ModuleHandler extends Handler } // call a trigger before moduleHandler init - ModuleHandler::triggerCall('moduleHandler.init', 'before', $this); + self::triggerCall('moduleHandler.init', 'before', $this); // execute addon (before module initialization) $called_position = 'before_module_init'; @@ -114,7 +114,7 @@ class ModuleHandler extends Handler * Initialization. It finds the target module based on module, mid, document_srl, and prepares to execute an action * @return boolean true: OK, false: redirected * */ - function init() + public function init() { $oModuleModel = getModel('module'); $site_module_info = Context::get('site_module_info'); @@ -296,7 +296,7 @@ class ModuleHandler extends Handler } // Call a trigger after moduleHandler init - $output = ModuleHandler::triggerCall('moduleHandler.init', 'after', $this->module_info); + $output = self::triggerCall('moduleHandler.init', 'after', $this->module_info); if(!$output->toBool()) { $this->error = $output->getMessage(); @@ -313,7 +313,7 @@ class ModuleHandler extends Handler * get a module instance and execute an action * @return ModuleObject executed module instance * */ - function procModule() + public function procModule() { $oModuleModel = getModel('module'); $display_mode = Mobile::isFromMobilePhone() ? 'mobile' : 'view'; @@ -321,8 +321,8 @@ class ModuleHandler extends Handler // If error occurred while preparation, return a message instance if($this->error) { - $this->_setInputErrorToContext(); - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + self::_setInputErrorToContext(); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -357,8 +357,8 @@ class ModuleHandler extends Handler $this->error = 'msg_module_is_not_exists'; $this->httpStatusCode = '404'; - $this->_setInputErrorToContext(); - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + self::_setInputErrorToContext(); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -395,7 +395,7 @@ class ModuleHandler extends Handler if(!in_array(strtoupper($_SERVER['REQUEST_METHOD']), $allowedMethodList)) { $this->error = "msg_invalid_request"; - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -413,7 +413,7 @@ class ModuleHandler extends Handler // check CSRF for POST actions if(Context::getRequestMethod() === 'POST' && Context::isInstalled() && $this->act !== 'procFileUpload' && !checkCSRF()) { $this->error = 'msg_invalid_request'; - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -423,9 +423,9 @@ class ModuleHandler extends Handler // Admin ip if($kind == 'admin' && $_SESSION['denied_admin'] == 'Y') { - $this->_setInputErrorToContext(); + self::_setInputErrorToContext(); $this->error = "msg_not_permitted_act"; - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -438,24 +438,24 @@ class ModuleHandler extends Handler $orig_type = "view"; $type = "mobile"; // create a module instance - $oModule = $this->getModuleInstance($this->module, $type, $kind); + $oModule = self::getModuleInstance($this->module, $type, $kind); if(!is_object($oModule) || !method_exists($oModule, $this->act)) { $type = $orig_type; Mobile::setMobile(FALSE); - $oModule = $this->getModuleInstance($this->module, $type, $kind); + $oModule = self::getModuleInstance($this->module, $type, $kind); } } else { // create a module instance - $oModule = $this->getModuleInstance($this->module, $type, $kind); + $oModule = self::getModuleInstance($this->module, $type, $kind); } if(!is_object($oModule)) { - $this->_setInputErrorToContext(); - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + self::_setInputErrorToContext(); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -472,9 +472,9 @@ class ModuleHandler extends Handler if(!Context::isInstalled()) { - $this->_setInputErrorToContext(); + self::_setInputErrorToContext(); $this->error = 'msg_invalid_request'; - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -503,7 +503,7 @@ class ModuleHandler extends Handler else { $this->error = 'msg_invalid_request'; - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -545,7 +545,7 @@ class ModuleHandler extends Handler if(!in_array(strtoupper($_SERVER['REQUEST_METHOD']), $allowedMethodList)) { $this->error = "msg_invalid_request"; - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -558,23 +558,23 @@ class ModuleHandler extends Handler $orig_type = "view"; $type = "mobile"; // create a module instance - $oModule = $this->getModuleInstance($forward->module, $type, $kind); + $oModule = self::getModuleInstance($forward->module, $type, $kind); if(!is_object($oModule) || !method_exists($oModule, $this->act)) { $type = $orig_type; Mobile::setMobile(FALSE); - $oModule = $this->getModuleInstance($forward->module, $type, $kind); + $oModule = self::getModuleInstance($forward->module, $type, $kind); } } else { - $oModule = $this->getModuleInstance($forward->module, $type, $kind); + $oModule = self::getModuleInstance($forward->module, $type, $kind); } if(!is_object($oModule)) { - $this->_setInputErrorToContext(); - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + self::_setInputErrorToContext(); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage('msg_module_is_not_exists'); $oMessageObject->dispMessage(); @@ -599,10 +599,10 @@ class ModuleHandler extends Handler } else { - $this->_setInputErrorToContext(); + self::_setInputErrorToContext(); $this->error = 'msg_is_not_administrator'; - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -614,9 +614,9 @@ class ModuleHandler extends Handler $grant = $oModuleModel->getGrant($this->module_info, $logged_info); if(!$grant->manager) { - $this->_setInputErrorToContext(); + self::_setInputErrorToContext(); $this->error = 'msg_is_not_manager'; - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -626,9 +626,9 @@ class ModuleHandler extends Handler { if(!$grant->is_admin && $this->module != $this->orig_module->module && $xml_info->permission->{$this->act} != 'manager') { - $this->_setInputErrorToContext(); + self::_setInputErrorToContext(); $this->error = 'msg_is_not_administrator'; - $oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode); + $oMessageObject = self::getModuleInstance('message', $display_mode); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); @@ -685,7 +685,7 @@ class ModuleHandler extends Handler $_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error'; $_SESSION['XE_VALIDATOR_RETURN_URL'] = $returnUrl; $_SESSION['XE_VALIDATOR_ID'] = Context::get('xe_validator_id'); - $this->_setInputValueToSession(); + self::_setInputValueToSession(); return $oModule; } } @@ -728,7 +728,7 @@ class ModuleHandler extends Handler } // if failed message exists in session, set context - $this->_setInputErrorToContext(); + self::_setInputErrorToContext(); $procResult = $oModule->proc(); @@ -748,7 +748,7 @@ class ModuleHandler extends Handler { $redirectUrl = Context::get('error_return_url'); } - $this->_setInputValueToSession(); + self::_setInputValueToSession(); } else { @@ -782,7 +782,7 @@ class ModuleHandler extends Handler * set error message to Session. * @return void * */ - function _setInputErrorToContext() + public static function _setInputErrorToContext() { if($_SESSION['XE_VALIDATOR_ERROR'] && !Context::get('XE_VALIDATOR_ERROR')) { @@ -809,14 +809,14 @@ class ModuleHandler extends Handler Context::set('INPUT_ERROR', $_SESSION['INPUT_ERROR']); } - $this->_clearErrorSession(); + self::_clearErrorSession(); } /** * clear error message to Session. * @return void * */ - function _clearErrorSession() + public static function _clearErrorSession() { unset($_SESSION['XE_VALIDATOR_ERROR']); unset($_SESSION['XE_VALIDATOR_MESSAGE']); @@ -830,7 +830,7 @@ class ModuleHandler extends Handler * occured error when, set input values to session. * @return void * */ - function _setInputValueToSession() + public static function _setInputValueToSession() { $requestVars = Context::getRequestVars(); unset($requestVars->act, $requestVars->mid, $requestVars->vid, $requestVars->success_return_url, $requestVars->error_return_url); @@ -845,7 +845,7 @@ class ModuleHandler extends Handler * @param ModuleObject $oModule module instance * @return void * */ - function displayContent($oModule = NULL) + public function displayContent($oModule = NULL) { // If the module is not set or not an object, set error if(!$oModule || !is_object($oModule)) @@ -861,7 +861,7 @@ class ModuleHandler extends Handler } // Call trigger after moduleHandler proc - $output = ModuleHandler::triggerCall('moduleHandler.proc', 'after', $oModule); + $output = self::triggerCall('moduleHandler.proc', 'after', $oModule); if(!$output->toBool()) { $this->error = $output->getMessage(); @@ -887,14 +887,14 @@ class ModuleHandler extends Handler { // display content with message module instance $type = Mobile::isFromMobilePhone() ? 'mobile' : 'view'; - $oMessageObject = ModuleHandler::getModuleInstance('message', $type); + $oMessageObject = self::getModuleInstance('message', $type); $oMessageObject->setError(-1); $oMessageObject->setMessage($this->error); $oMessageObject->dispMessage(); if($oMessageObject->getHttpStatusCode() && $oMessageObject->getHttpStatusCode() != '200') { - $this->_setHttpStatusMessage($oMessageObject->getHttpStatusCode()); + self::_setHttpStatusMessage($oMessageObject->getHttpStatusCode()); $oMessageObject->setTemplateFile('http_status_code'); } @@ -910,7 +910,7 @@ class ModuleHandler extends Handler $oModule = $oMessageObject; } - $this->_clearErrorSession(); + self::_clearErrorSession(); } // Check if layout_srl exists for the module @@ -1034,7 +1034,7 @@ class ModuleHandler extends Handler * @param string $module module name * @return string path of the module * */ - function getModulePath($module) + public static function getModulePath($module) { return sprintf('./modules/%s/', $module); } @@ -1047,7 +1047,7 @@ class ModuleHandler extends Handler * @return ModuleObject module instance (if failed it returns null) * @remarks if there exists a module instance created before, returns it. * */ - function &getModuleInstance($module, $type = 'view', $kind = '') + public static function getModuleInstance($module, $type = 'view', $kind = '') { if(__DEBUG__ == 3) @@ -1075,12 +1075,12 @@ class ModuleHandler extends Handler // if there is no instance of the module in global variable, create a new one if(!isset($GLOBALS['_loaded_module'][$module][$type][$kind])) { - ModuleHandler::_getModuleFilePath($module, $type, $kind, $class_path, $high_class_file, $class_file, $instance_name); + self::_getModuleFilePath($module, $type, $kind, $class_path, $high_class_file, $class_file, $instance_name); if($extend_module && (!is_readable($high_class_file) || !is_readable($class_file))) { $module = $parent_module; - ModuleHandler::_getModuleFilePath($module, $type, $kind, $class_path, $high_class_file, $class_file, $instance_name); + self::_getModuleFilePath($module, $type, $kind, $class_path, $high_class_file, $class_file, $instance_name); } // Check if the base class and instance class exist @@ -1111,16 +1111,6 @@ class ModuleHandler extends Handler $oModule->setModule($module); $oModule->setModulePath($class_path); - // If the module has a constructor, run it. - if(!isset($GLOBALS['_called_constructor'][$instance_name])) - { - $GLOBALS['_called_constructor'][$instance_name] = TRUE; - if(@method_exists($oModule, $instance_name)) - { - $oModule->{$instance_name}(); - } - } - // Store the created instance into GLOBALS variable $GLOBALS['_loaded_module'][$module][$type][$kind] = $oModule; } @@ -1134,9 +1124,9 @@ class ModuleHandler extends Handler return $GLOBALS['_loaded_module'][$module][$type][$kind]; } - function _getModuleFilePath($module, $type, $kind, &$classPath, &$highClassFile, &$classFile, &$instanceName) + public static function _getModuleFilePath($module, $type, $kind, &$classPath, &$highClassFile, &$classFile, &$instanceName) { - $classPath = ModuleHandler::getModulePath($module); + $classPath = self::getModulePath($module); $highClassFile = sprintf('%s%s%s.class.php', _XE_PATH_, $classPath, $module); $highClassFile = FileHandler::getRealPath($highClassFile); @@ -1173,7 +1163,7 @@ class ModuleHandler extends Handler * @param object $obj an object as a parameter to trigger * @return Object * */ - function triggerCall($trigger_name, $called_position, &$obj) + public static function triggerCall($trigger_name, $called_position, &$obj) { // skip if not installed if(!Context::isInstalled()) @@ -1236,12 +1226,12 @@ class ModuleHandler extends Handler * @param string $code * @return string * */ - function _setHttpStatusMessage($code) + public static function _setHttpStatusMessage($code) { $statusMessageList = array( '100' => 'Continue', '101' => 'Switching Protocols', - '201' => 'OK', // todo check array key '201' + '200' => 'OK', '201' => 'Created', '202' => 'Accepted', '203' => 'Non-Authoritative Information', From e20dc5d2f9acfdab8331d30cef9b51edeb77d3f8 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 22 Jan 2016 14:10:44 +0900 Subject: [PATCH 14/53] Clean up some non-static methods in DisplayHandler --- classes/display/DisplayHandler.class.php | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php index 22ea8e35c..4e9b000d3 100644 --- a/classes/display/DisplayHandler.class.php +++ b/classes/display/DisplayHandler.class.php @@ -22,7 +22,7 @@ class DisplayHandler extends Handler * @param ModuleObject $oModule the module object * @return void */ - function printContent(&$oModule) + public function printContent(&$oModule) { // Check if the gzip encoding supported if( @@ -85,28 +85,24 @@ class DisplayHandler extends Handler $httpStatusCode = $oModule->getHttpStatusCode(); if($httpStatusCode && $httpStatusCode != 200) { - $this->_printHttpStatusCode($httpStatusCode); + self::_printHttpStatusCode($httpStatusCode); } else { if(Context::getResponseMethod() == 'JSON' || Context::getResponseMethod() == 'JS_CALLBACK') { - $this->_printJSONHeader(); + self::_printJSONHeader(); } else if(Context::getResponseMethod() != 'HTML') { - $this->_printXMLHeader(); + self::_printXMLHeader(); } else { - $this->_printHTMLHeader(); + self::_printHTMLHeader(); } } - // debugOutput output - $this->content_size = strlen($output); - $output .= $this->_debugOutput(); - // disable gzip if output already exists ob_flush(); if(headers_sent()) @@ -123,6 +119,10 @@ class DisplayHandler extends Handler // results directly output print $output; + // debugOutput output + $this->content_size = strlen($output); + print $this->_debugOutput(); + // call a trigger after display ModuleHandler::triggerCall('display', 'after', $output); @@ -135,7 +135,7 @@ class DisplayHandler extends Handler * __DEBUG_OUTPUT__ == 0, messages are written in ./files/_debug_message.php * @return void */ - function _debugOutput() + public function _debugOutput() { if(!__DEBUG__) { @@ -179,14 +179,14 @@ class DisplayHandler extends Handler ); $firephp->fb( array( - 'Elapsed time >>> Total : ' . sprintf('%0.5f sec', $end - __StartTime__), + 'Elapsed time >>> Total : ' . sprintf('%0.5f sec', $end - RX_MICROTIME), array(array('DB queries', 'class file load', 'Template compile', 'XmlParse compile', 'PHP', 'Widgets', 'Trans Content'), array( sprintf('%0.5f sec', $GLOBALS['__db_elapsed_time__']), sprintf('%0.5f sec', $GLOBALS['__elapsed_class_load__']), sprintf('%0.5f sec (%d called)', $GLOBALS['__template_elapsed__'], $GLOBALS['__TemplateHandlerCalled__']), sprintf('%0.5f sec', $GLOBALS['__xmlparse_elapsed__']), - sprintf('%0.5f sec', $end - __StartTime__ - $GLOBALS['__template_elapsed__'] - $GLOBALS['__xmlparse_elapsed__'] - $GLOBALS['__db_elapsed_time__'] - $GLOBALS['__elapsed_class_load__']), + sprintf('%0.5f sec', $end - RX_MICROTIME - $GLOBALS['__template_elapsed__'] - $GLOBALS['__xmlparse_elapsed__'] - $GLOBALS['__db_elapsed_time__'] - $GLOBALS['__elapsed_class_load__']), sprintf('%0.5f sec', $GLOBALS['__widget_excute_elapsed__']), sprintf('%0.5f sec', $GLOBALS['__trans_content_elapsed__']) ) @@ -234,12 +234,12 @@ class DisplayHandler extends Handler $buff[] = sprintf("\tResponse contents size\t: %d byte", $this->content_size); // total execution time - $buff[] = sprintf("\n- Total elapsed time : %0.5f sec", $end - __StartTime__); + $buff[] = sprintf("\n- Total elapsed time : %0.5f sec", $end - RX_MICROTIME); $buff[] = sprintf("\tclass file load elapsed time \t: %0.5f sec", $GLOBALS['__elapsed_class_load__']); $buff[] = sprintf("\tTemplate compile elapsed time\t: %0.5f sec (%d called)", $GLOBALS['__template_elapsed__'], $GLOBALS['__TemplateHandlerCalled__']); $buff[] = sprintf("\tXmlParse compile elapsed time\t: %0.5f sec", $GLOBALS['__xmlparse_elapsed__']); - $buff[] = sprintf("\tPHP elapsed time \t\t\t\t: %0.5f sec", $end - __StartTime__ - $GLOBALS['__template_elapsed__'] - $GLOBALS['__xmlparse_elapsed__'] - $GLOBALS['__db_elapsed_time__'] - $GLOBALS['__elapsed_class_load__']); + $buff[] = sprintf("\tPHP elapsed time \t\t\t\t: %0.5f sec", $end - RX_MICROTIME - $GLOBALS['__template_elapsed__'] - $GLOBALS['__xmlparse_elapsed__'] - $GLOBALS['__db_elapsed_time__'] - $GLOBALS['__elapsed_class_load__']); $buff[] = sprintf("\tDB class elapsed time \t\t\t: %0.5f sec", $GLOBALS['__dbclass_elapsed_time__'] - $GLOBALS['__db_elapsed_time__']); // widget execution time @@ -318,7 +318,7 @@ class DisplayHandler extends Handler * print a HTTP HEADER for XML, which is encoded in UTF-8 * @return void */ - function _printXMLHeader() + public static function _printXMLHeader() { header("Content-Type: text/xml; charset=UTF-8"); } @@ -327,7 +327,7 @@ class DisplayHandler extends Handler * print a HTTP HEADER for HTML, which is encoded in UTF-8 * @return void */ - function _printHTMLHeader() + public static function _printHTMLHeader() { header("Content-Type: text/html; charset=UTF-8"); } @@ -336,7 +336,7 @@ class DisplayHandler extends Handler * print a HTTP HEADER for JSON, which is encoded in UTF-8 * @return void */ - function _printJSONHeader() + public static function _printJSONHeader() { header("Content-Type: text/html; charset=UTF-8"); } @@ -345,7 +345,7 @@ class DisplayHandler extends Handler * print a HTTP HEADER for HTML, which is encoded in UTF-8 * @return void */ - function _printHttpStatusCode($code) + public static function _printHttpStatusCode($code) { $statusMessage = Context::get('http_status_message'); header("HTTP/1.0 $code $statusMessage"); From f73892de820f7d4c6ee92490dc68a4c608f6516f Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 22 Jan 2016 14:22:02 +0900 Subject: [PATCH 15/53] Fix incorrect Content-Type header when displaying JSON --- classes/display/DisplayHandler.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php index 4e9b000d3..f46008e64 100644 --- a/classes/display/DisplayHandler.class.php +++ b/classes/display/DisplayHandler.class.php @@ -338,7 +338,7 @@ class DisplayHandler extends Handler */ public static function _printJSONHeader() { - header("Content-Type: text/html; charset=UTF-8"); + header("Content-Type: text/javascript; charset=UTF-8"); } /** From acf44a3e03882d423799bc6cb5407ecec009fe65 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 22 Jan 2016 14:43:37 +0900 Subject: [PATCH 16/53] Clean up method signatures in TemplateHandler --- classes/template/TemplateHandler.class.php | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index 86776375c..dcdd16b1b 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -21,7 +21,7 @@ class TemplateHandler private $config = NULL; private $skipTags = NULL; private $handler_mtime = 0; - static private $rootTpl = NULL; + private static $rootTpl = NULL; /** * constructor @@ -38,7 +38,7 @@ class TemplateHandler * returns TemplateHandler's singleton object * @return TemplateHandler instance */ - static public function &getInstance() + public static function getInstance() { static $oTemplate = NULL; @@ -495,7 +495,7 @@ class TemplateHandler foreach($matches[1] as $n => $stmt) { $expr = $matches[2][$n]; - $expr = $this->_replaceVar($expr); + $expr = self::_replaceVar($expr); $closing++; switch($stmt) @@ -568,7 +568,7 @@ class TemplateHandler if(strpos($node, '|cond="') !== false) { $node = preg_replace('@(\s[-\w:]+(?:="[^"]+?")?)\|cond="(.+?)"@s', '$1', $node); - $node = $this->_replaceVar($node); + $node = self::_replaceVar($node); } if($nodes[$idx] != $node) @@ -600,7 +600,7 @@ class TemplateHandler if($m[1]{0} == '@') { - $m[1] = $this->_replaceVar(substr($m[1], 1)); + $m[1] = self::_replaceVar(substr($m[1], 1)); return ""; } else @@ -615,7 +615,7 @@ class TemplateHandler { $escape_option = 'noescape'; } - $m[1] = $this->_replaceVar($m[1]); + $m[1] = self::_replaceVar($m[1]); switch($escape_option) { case 'auto': @@ -674,7 +674,7 @@ class TemplateHandler return "compile('{$fileDir}','{$pathinfo['basename']}') ?>"; // case 'load_js_plugin': - $plugin = $this->_replaceVar($m[5]); + $plugin = self::_replaceVar($m[5]); $s = ""; if(strpos($plugin, '$__Context') === false) { @@ -780,7 +780,7 @@ class TemplateHandler $m[7] = substr($m[7], 1); if(!$m[7]) { - return '_replaceVar($m[8]) . '{ ?>' . $m[9]; + return '' . $m[9]; } if(!preg_match('/^(?:((?:end)?(?:if|switch|for(?:each)?|while)|end)|(else(?:if)?)|(break@)?(case|default)|(break))$/', $m[7], $mm)) { @@ -803,11 +803,11 @@ class TemplateHandler $var = preg_replace('/^\s*\(\s*(.+?) .*$/', '$1', $m[8]); $precheck = "if({$var}&&count({$var}))"; } - return '_replaceVar($precheck . $m[7] . $m[8]) . '{ ?>' . $m[9]; + return '' . $m[9]; } if($mm[2]) { - return "_replaceVar($m[8]) . "{ ?>" . $m[9]; + return "" . $m[9]; } if($mm[4]) { @@ -827,7 +827,7 @@ class TemplateHandler * @param string $path * @return string */ - function _getRelativeDir($path) + private function _getRelativeDir($path) { $_path = $path; @@ -865,7 +865,7 @@ class TemplateHandler * @param string $php * @return string $__Context->varname */ - function _replaceVar($php) + private static function _replaceVar($php) { if(!strlen($php)) { From ee585b651a36ab7bbaacf144904b08786552d7e8 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 22 Jan 2016 14:51:57 +0900 Subject: [PATCH 17/53] Clean up method signatures in Mobile class --- classes/mobile/Mobile.class.php | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/classes/mobile/Mobile.class.php b/classes/mobile/Mobile.class.php index b1a862149..4b4bc6e22 100644 --- a/classes/mobile/Mobile.class.php +++ b/classes/mobile/Mobile.class.php @@ -8,19 +8,18 @@ */ class Mobile { - /** * Whether mobile or not mobile mode * @var bool */ - var $ismobile = NULL; + public $ismobile = NULL; /** * Get instance of Mobile class(for singleton) * * @return Mobile */ - function &getInstance() + public function getInstance() { static $theInstance; if(!isset($theInstance)) @@ -35,10 +34,9 @@ class Mobile * * @return bool If mobile mode returns true or false */ - function isFromMobilePhone() + public static function isFromMobilePhone() { - $oMobile = & Mobile::getInstance(); - return $oMobile->_isFromMobilePhone(); + return self::getInstance()->_isFromMobilePhone(); } /** @@ -46,7 +44,7 @@ class Mobile * * @return bool */ - function _isFromMobilePhone() + public function _isFromMobilePhone() { if($this->ismobile !== NULL) { @@ -92,7 +90,7 @@ class Mobile $this->ismobile = FALSE; setcookie("mobile", FALSE, 0, $xe_web_path); setcookie("user-agent", FALSE, 0, $xe_web_path); - if(!$this->isMobilePadCheckByAgent() && $this->isMobileCheckByAgent()) + if(!self::isMobilePadCheckByAgent() && self::isMobileCheckByAgent()) { $this->ismobile = TRUE; } @@ -100,13 +98,13 @@ class Mobile } else { - if($this->isMobilePadCheckByAgent()) + if(self::isMobilePadCheckByAgent()) { $this->ismobile = FALSE; } else { - if($this->isMobileCheckByAgent()) + if(self::isMobileCheckByAgent()) { $this->ismobile = TRUE; } @@ -143,7 +141,7 @@ class Mobile * * @return bool Returns true on mobile device or false. */ - function isMobileCheckByAgent() + public static function isMobileCheckByAgent() { static $UACheck; if(isset($UACheck)) @@ -177,7 +175,7 @@ class Mobile * * @return bool TRUE for tablet, and FALSE for else. */ - function isMobilePadCheckByAgent() + public static function isMobilePadCheckByAgent() { static $UACheck; if(isset($UACheck)) @@ -226,15 +224,13 @@ class Mobile * @param bool $ismobile * @return void */ - function setMobile($ismobile) + public static function setMobile($ismobile) { - $oMobile = Mobile::getInstance(); - $oMobile->ismobile = $ismobile; + self::getInstance()->ismobile = (bool)$ismobile; } - function isMobileEnabled() + public static function isMobileEnabled() { - $db_info = Context::getDBInfo(); - return ($db_info->use_mobile_view === 'Y'); + return (Context::getDBInfo()->use_mobile_view === 'Y'); } } From 30246059ebea8f786b080238bf6c7ec6d6cd4dcd Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 22 Jan 2016 15:02:33 +0900 Subject: [PATCH 18/53] Remove Crypto class (was added by @kijin but not used) --- classes/security/Crypto.class.php | 357 ------------------------------ common/autoload.php | 1 - 2 files changed, 358 deletions(-) delete mode 100644 classes/security/Crypto.class.php diff --git a/classes/security/Crypto.class.php b/classes/security/Crypto.class.php deleted file mode 100644 index 0e9e06cf4..000000000 --- a/classes/security/Crypto.class.php +++ /dev/null @@ -1,357 +0,0 @@ - */ - -/** - * This class makes encryption and digital signing easy to use in XE. - * - * The encryption methods use AES-128, and is fully compatible with - * https://github.com/defuse/php-encryption - * except that it uses base64-encoded keys and ciphertexts. - * - * The digital signature methods is based on the same SHA-256 based - * key derivation function used by the encryption methods. - * - * A key is automatically generated and saved to the files/config directory - * when first invoked. The same key will be used for all subsequent - * method calls that do not specify a different key. - * The key must be a binary string exactly 16 bytes long. - * - * @file Crypto.class.php - * @author Kijin Sung (kijin@kijinsung.com) - * @package /classes/security - * @version 1.0 - */ -class Crypto -{ - /** - * @brief Default configuration - */ - const ENCRYPTION_ALGO = 'aes-128'; - const ENCRYPTION_MODE = 'cbc'; - const ENCRYPTION_BLOCK_SIZE = 16; - const ENCRYPTION_KEY_SIZE = 16; - const ENCRYPTION_KEY_INFO = 'DefusePHP|KeyForEncryption'; - const ENCRYPTION_MAC_ALGO = 'sha256'; - const ENCRYPTION_MAC_SIZE = 32; - const ENCRYPTION_MAC_INFO = 'DefusePHP|KeyForAuthentication'; - const SIGNATURE_ALGO = 'sha256'; - const SIGNATURE_SIZE = '32'; - - /** - * @brief The default key - */ - protected static $_default_key = null; - - /** - * @brief The currently selected extension - */ - protected static $_extension = null; - - /** - * @brief If this is true, encryption and signature are only valid in current session - */ - protected $_current_session_only = false; - - /** - * @brief Constructor - */ - public function __construct() - { - if(function_exists('openssl_encrypt')) - { - self::$_extension = 'openssl'; - } - elseif(function_exists('mcrypt_encrypt')) - { - self::$_extension = 'mcrypt'; - } - else - { - throw new Exception('Crypto class requires openssl or mcrypt extension.'); - } - } - - /** - * @brief Check if cryptography is supported on this server - * @return bool - */ - public static function isSupported() - { - return (function_exists('openssl_encrypt') || function_exists('mcrypt_encrypt')); - } - - /** - * @brief Make encryption and signature only valid in current session - * @return void - */ - public function currentSessionOnly() - { - $this->_current_session_only = true; - } - - /** - * @brief Encrypt a string - * @param string $plaintext The string to encrypt - * @param string $key Optional key. If empty, default key will be used. - * @return string - */ - public function encrypt($plaintext, $key = null) - { - if($key === null || $key === '') - { - $key = $this->_getSessionKey(); - } - - // Generate subkey for encryption - $enc_key = self::_defuseCompatibleHKDF($key, self::ENCRYPTION_KEY_INFO); - - // Generate IV - $iv = self::_createIV(); - - // Encrypt the plaintext - if(self::$_extension === 'openssl') - { - $openssl_method = self::ENCRYPTION_ALGO . '-' . self::ENCRYPTION_MODE; - $ciphertext = openssl_encrypt($plaintext, $openssl_method, $enc_key, OPENSSL_RAW_DATA, $iv); - } - else - { - $mcrypt_method = str_replace('aes', 'rijndael', self::ENCRYPTION_ALGO); - $plaintext = self::_applyPKCS7Padding($plaintext, self::ENCRYPTION_BLOCK_SIZE); - $ciphertext = mcrypt_encrypt($mcrypt_method, $enc_key, $plaintext, self::ENCRYPTION_MODE, $iv); - } - - // Generate MAC - $mac_key = self::_defuseCompatibleHKDF($key, self::ENCRYPTION_MAC_INFO); - $mac = hash_hmac(self::ENCRYPTION_MAC_ALGO, ($iv . $ciphertext), $mac_key, true); - - // Return the MAC, IV, and ciphertext as a base64 encoded string - return base64_encode($mac . $iv . $ciphertext); - } - - /** - * @brief Decrypt a string - * @param string $ciphertext The string to decrypt - * @param string $key Optional key. If empty, default key will be used. - * @return string - */ - public function decrypt($ciphertext, $key = null) - { - if($key === null || $key === '') - { - $key = $this->_getSessionKey(); - } - - // Base64 decode the ciphertext and check the length - $ciphertext = @base64_decode($ciphertext); - if(strlen($ciphertext) < (self::ENCRYPTION_MAC_SIZE + (self::ENCRYPTION_BLOCK_SIZE * 2))) - { - return false; - } - - // Extract MAC and IV from the remainder of the ciphertext - $mac = substr($ciphertext, 0, self::ENCRYPTION_MAC_SIZE); - $iv = substr($ciphertext, self::ENCRYPTION_MAC_SIZE, self::ENCRYPTION_BLOCK_SIZE); - $ciphertext = substr($ciphertext, self::ENCRYPTION_MAC_SIZE + self::ENCRYPTION_BLOCK_SIZE); - - // Validate MAC - $mac_key = self::_defuseCompatibleHKDF($key, self::ENCRYPTION_MAC_INFO); - $mac_compare = hash_hmac(self::ENCRYPTION_MAC_ALGO, ($iv . $ciphertext), $mac_key, true); - $oPassword = new Password(); - if(!$oPassword->strcmpConstantTime($mac, $mac_compare)) - { - return false; - } - - // Generate subkey for encryption - $enc_key = self::_defuseCompatibleHKDF($key, self::ENCRYPTION_KEY_INFO); - - // Decrypt the ciphertext - if (self::$_extension === 'openssl') - { - $openssl_method = self::ENCRYPTION_ALGO . '-' . self::ENCRYPTION_MODE; - $plaintext = openssl_decrypt($ciphertext, $openssl_method, $enc_key, OPENSSL_RAW_DATA, $iv); - } - else - { - $mcrypt_method = str_replace('aes', 'rijndael', self::ENCRYPTION_ALGO); - $plaintext = @mcrypt_decrypt($mcrypt_method, $enc_key, $ciphertext, self::ENCRYPTION_MODE, $iv); - if($plaintext === false) - { - return false; - } - $plaintext = self::_stripPKCS7Padding($plaintext, self::ENCRYPTION_BLOCK_SIZE); - if($plaintext === false) - { - return false; - } - } - - // Return the plaintext - return $plaintext; - } - - /** - * @brief Create a digital signature of a string - * @param string $plaintext The string to sign - * @param string $key Optional key. If empty, default key will be used. - * @return string - */ - public function createSignature($plaintext, $key = null) - { - if($key === null || $key === '') - { - $key = $this->_getSessionKey(); - } - - // Generate a signature using HMAC - return bin2hex(self::_defuseCompatibleHKDF($plaintext, $key)); - } - - /** - * @brief Verify a digital signature - * @param string $signature The signature to verify - * @param string $plaintext The string to verify - * @param string $key Optional key. If empty, default key will be used. - * @return bool - */ - public function verifySignature($signature, $plaintext, $key = null) - { - if($key === null || $key === '') - { - $key = $this->_getSessionKey(); - } - - // Verify the signature using HMAC - $oPassword = new Password(); - $compare = bin2hex(self::_defuseCompatibleHKDF($plaintext, $key)); - return $oPassword->strcmpConstantTime($signature, $compare); - } - - /** - * @brief Get the default key applicable to this instance - * @return string - */ - protected function _getSessionKey() - { - if($this->_current_session_only) - { - if(!isset($_SESSION['XE_CRYPTO_SESSKEY'])) - { - $_SESSION['XE_CRYPTO_SESSKEY'] = self::_createSecureKey(); - } - $session_key = base64_decode($_SESSION['XE_CRYPTO_SESSKEY']); - return strval(self::_getDefaultKey()) ^ strval($session_key); - } - else - { - return strval(self::_getDefaultKey()); - } - } - - /** - * @brief Get the default key - * @return string - */ - protected static function _getDefaultKey() - { - if(self::$_default_key !== null) - { - return base64_decode(self::$_default_key); - } - else - { - $file_name = _XE_PATH_ . 'files/config/crypto.config.php'; - if(file_exists($file_name) && is_readable($file_name)) - { - $key = (include $file_name); - } - if(!isset($key) || !is_string($key)) - { - $key = self::_createSecureKey(); - self::_setDefaultKey($key); - } - return base64_decode(self::$_default_key = $key); - } - } - - /** - * @brief Set the default key - * @param string $key The default key - * @return void - */ - protected static function _setDefaultKey($key) - { - self::$_default_key = $key = trim($key); - $file_name = _XE_PATH_ . 'files/config/crypto.config.php'; - $file_content = 'createSecureSalt(ENCRYPTION_KEY_SIZE, 'binary')); - } - - /** - * @brief Create an IV - * @return string - */ - protected static function _createIV() - { - $oPassword = new Password(); - return $oPassword->createSecureSalt(self::ENCRYPTION_BLOCK_SIZE, 'binary'); - } - - - /** - * @brief Apply PKCS#7 padding to a string - * @param string $str The string - * @param int $block_size The block size - * @return string - */ - protected static function _applyPKCS7Padding($str, $block_size) - { - $padding_size = $block_size - (strlen($str) % $block_size); - if ($padding_size === 0) $padding_size = $block_size; - return $str . str_repeat(chr($padding_size), $padding_size); - } - - /** - * @brief Remove PKCS#7 padding from a string - * @param string $str The string - * @param int $block_size The block size - * @return string - */ - protected static function _stripPKCS7Padding($str, $block_size) - { - if (strlen($str) % $block_size !== 0) return false; - $padding_size = ord(substr($str, -1)); - if ($padding_size < 1 || $padding_size > $block_size) return false; - if (substr($str, (-1 * $padding_size)) !== str_repeat(chr($padding_size), $padding_size)) return false; - return substr($str, 0, strlen($str) - $padding_size); - } - - /** - * @brief HKDF function compatible with defuse/php-encryption - * @return string - */ - protected static function _defuseCompatibleHKDF($key, $info) - { - $salt = str_repeat("\x00", self::ENCRYPTION_MAC_SIZE); - $prk = hash_hmac(self::ENCRYPTION_MAC_ALGO, $key, $salt, true); - $t = $last_block = ''; - for ($block_index = 1; strlen($t) < self::ENCRYPTION_KEY_SIZE; $block_index++) - { - $t .= $last_block = hash_hmac(self::ENCRYPTION_MAC_ALGO, ($last_block . $info . chr($block_index)), $prk, true); - } - return substr($t, 0, self::ENCRYPTION_KEY_SIZE); - } -} -/* End of file : Crypto.class.php */ -/* Location: ./classes/security/Crypto.class.php */ diff --git a/common/autoload.php b/common/autoload.php index 6471945d2..c4925cc87 100644 --- a/common/autoload.php +++ b/common/autoload.php @@ -99,7 +99,6 @@ $GLOBALS['RX_AUTOLOAD_FILE_MAP'] = array_change_key_case(array( 'ModuleObject' => 'classes/module/ModuleObject.class.php', 'Object' => 'classes/object/Object.class.php', 'PageHandler' => 'classes/page/PageHandler.class.php', - 'Crypto' => 'classes/security/Crypto.class.php', 'EmbedFilter' => 'classes/security/EmbedFilter.class.php', 'IpFilter' => 'classes/security/IpFilter.class.php', 'Password' => 'classes/security/Password.class.php', From 70c6c6a9497c02ed9d0ad764fe14610c41d8cf38 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 22 Jan 2016 16:37:35 +0900 Subject: [PATCH 19/53] Fix incorrect SSL detection --- classes/module/ModuleHandler.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index dc2656151..7f8362437 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -94,7 +94,7 @@ class ModuleHandler extends Handler if(isset($this->act) && (strlen($this->act) >= 4 && substr_compare($this->act, 'disp', 0, 4) === 0)) { - if(Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && RX_SSL) + if(Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && !RX_SSL) { if(Context::get('_https_port')!=null) { header('location:https://' . $_SERVER['HTTP_HOST'] . ':' . Context::get('_https_port') . $_SERVER['REQUEST_URI']); From d3d70317306564e8dcfbffb79c4c9f356327861e Mon Sep 17 00:00:00 2001 From: qw5414 Date: Fri, 22 Jan 2016 17:08:50 +0900 Subject: [PATCH 20/53] =?UTF-8?q?=EB=B9=84=EC=B6=94=EC=B2=9C=EB=8F=84=20?= =?UTF-8?q?=EC=B7=A8=EC=86=8C=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/board/skins/xedition/_read.html | 6 +++- .../board/skins/xedition/board.default.css | 4 +-- modules/document/document.controller.php | 33 +++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/modules/board/skins/xedition/_read.html b/modules/board/skins/xedition/_read.html index a10c3562b..d401d7239 100644 --- a/modules/board/skins/xedition/_read.html +++ b/modules/board/skins/xedition/_read.html @@ -64,7 +64,7 @@
+ + + + + + + + + + + + diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 3c9a81cae..2a8c8e55e 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -162,6 +162,10 @@ class documentController extends document //session reset $_SESSION['voted_document'][$document_srl] = false; + // begin transaction + $oDB = DB::getInstance(); + $oDB->begin(); + $obj = new stdClass(); $obj->member_srl = $oDocument->get('member_srl'); $obj->module_srl = $oDocument->get('module_srl'); diff --git a/modules/document/document.item.php b/modules/document/document.item.php index f78475e84..94bd205b1 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -371,7 +371,7 @@ class documentItem extends Object function getVoted() { - if(!$this->document_srl) return; + if(!$this->document_srl) return false; if($_SESSION['voted_document'][$this->document_srl]) { return $_SESSION['voted_document'][$this->document_srl]; From 14a922b72e27a351c7e469973f48920e6944c241 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 23 Jan 2016 23:14:41 +0900 Subject: [PATCH 29/53] Fix unit tests for HHVM on Travis CI --- .travis.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7c1edacad..f30082a47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,13 +15,14 @@ before_script: - npm install grunt grunt-cli grunt-contrib-jshint grunt-contrib-csslint grunt-phplint --save-dev - mysql -u root -e "CREATE DATABASE rhymix" - mysql -u root -e "SET PASSWORD FOR 'travis'@'localhost' = PASSWORD('travis')" -- php -S localhost:8000 & -- if [ $(phpenv version-name) == "5.3" ]; then touch codecept.phar; fi -- if [ $(phpenv version-name) == "5.4" ]; then wget http://codeception.com/releases/2.0.16/codecept.phar; fi -- if [ ! -f codecept.phar ]; then wget http://codeception.com/codecept.phar; fi +- if [[ $TRAVIS_PHP_VERSION != "hhvm" ]]; then php -S localhost:8000 & fi +- if [[ $TRAVIS_PHP_VERSION == "5.3" ]]; then touch codecept.phar; fi +- if [[ $TRAVIS_PHP_VERSION == "5.4" ]]; then wget http://codeception.com/releases/2.0.16/codecept.phar; fi +- if [[ ! -f codecept.phar ]]; then wget http://codeception.com/codecept.phar; fi script: -- if [ -f codecept.phar ]; then php codecept.phar build; fi -- if [ -f codecept.phar ]; then php codecept.phar run -d --fail-fast --env travis; fi +- if [[ -f codecept.phar ]]; then php codecept.phar build; fi +- if [[ $TRAVIS_PHP_VERSION == "hhvm" ]]; then php codecept.phar run -d --fail-fast --env travis --skip Install; fi +- if [[ $TRAVIS_PHP_VERSION != "hhvm" ]]; then php codecept.phar run -d --fail-fast --env travis; fi - grunt lint notifications: email: false From bf764b8fdbd6dba6083a1fe6ac919f0ade0c0e30 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 23 Jan 2016 23:18:53 +0900 Subject: [PATCH 30/53] Remove HHVM from allowed failure list --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f30082a47..7686fb2d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,6 @@ php: - 5.6 - 7.0 - hhvm -matrix: - allow_failures: - - php: hhvm - fast_finish: true sudo: false before_script: - npm install grunt grunt-cli grunt-contrib-jshint grunt-contrib-csslint grunt-phplint --save-dev From ecb3b419130534b40b32f51fd0fbc0be0d2988ff Mon Sep 17 00:00:00 2001 From: qw5414 Date: Sun, 24 Jan 2016 03:35:42 +0900 Subject: [PATCH 31/53] =?UTF-8?q?#56=20=EC=9A=94=EC=95=BD=EC=9D=B4=20?= =?UTF-8?q?=EC=97=86=EC=9D=84=EA=B2=BD=EC=9A=B0,=20Content=20=EB=A5=BC=20?= =?UTF-8?q?=EB=8B=A4=EC=8B=9C=20=EB=B6=88=EB=9F=AC=EC=98=AC=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=87=EB=8F=84=EB=A1=9D=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/document/document.item.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/document/document.item.php b/modules/document/document.item.php index 94bd205b1..8c4bccc3d 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -837,8 +837,19 @@ class documentItem extends Object // If not specify its height, create a square if(!$height) $height = $width; + if($this->get('content')) + { + $content = $this->get('content'); + } + else + { + $args = new stdClass(); + $args->document_srl = $this->document_srl; + $output = executeQuery('document.getDocument', $args); + $content = $output->data->content; + } // Return false if neither attachement nor image files in the document - if(!$this->get('uploaded_count') && !preg_match("!get('content'))) return; + if(!$this->get('uploaded_count') && !preg_match("!get('content'); $target_src = null; preg_match_all("!src=(\"|')([^\"' ]*?)(\"|')!is", $content, $matches, PREG_SET_ORDER); $cnt = count($matches); From 38ac0549486665d7881f9b9e68df7d6f11b12497 Mon Sep 17 00:00:00 2001 From: MinSoo Kim Date: Sun, 24 Jan 2016 04:11:29 +0900 Subject: [PATCH 32/53] =?UTF-8?q?=EC=84=A4=EB=AC=B8=EC=A1=B0=EC=82=AC=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=EC=8A=A4=ED=82=A8=EC=9D=98=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=84=B1=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 모바일에서 투표하기 편리하도록 개선. 2. 기본 스킨과 심플 스킨의 자바스크립트가 같아서 생기는 문제 수정 3. 이미지 사용 최소화 4. 스킨 모양을 살짝 다듬음 (미솔의 미적 감각?) --- modules/poll/lang/lang.xml | 91 ++++--- widgets/pollWidget/skins/default/css/poll.css | 34 ++- .../pollWidget/skins/default/css/poll.min.css | 1 - widgets/pollWidget/skins/default/js/poll.js | 64 ++--- .../pollWidget/skins/default/pollview.html | 225 +++++++----------- widgets/pollWidget/skins/default/skin.xml | 81 ++++--- .../pollWidget/skins/simple/css/poll.min.css | 1 - 7 files changed, 248 insertions(+), 249 deletions(-) delete mode 100644 widgets/pollWidget/skins/default/css/poll.min.css delete mode 100644 widgets/pollWidget/skins/simple/css/poll.min.css diff --git a/modules/poll/lang/lang.xml b/modules/poll/lang/lang.xml index bf3988f28..50e9fa6af 100644 --- a/modules/poll/lang/lang.xml +++ b/modules/poll/lang/lang.xml @@ -250,37 +250,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/widgets/pollWidget/skins/default/css/poll.css b/widgets/pollWidget/skins/default/css/poll.css index 0893f37b5..ab09f1db5 100644 --- a/widgets/pollWidget/skins/default/css/poll.css +++ b/widgets/pollWidget/skins/default/css/poll.css @@ -1,4 +1,33 @@ +.rx_poll_default_wrap{max-width:100%;} .pollWidget{padding:5px;} +.rx_poll_default{border-radius: 10px;border:1px solid #e0e0e0;overflow:auto; background-color:#ffffff; color:#000000; font-size:12px; font-family:"Open Sans","나눔바른고딕",NanumBarunGothic,"맑은 고딕","Malgun Gothic","돋움",Dotum,"애플 SD 산돌고딕 Neo","Apple SD Gothic Neo",AppleGothic,Helvetica,sans-serif;} +.rx_poll_default .rx_poll_header{padding:13px 15px 10px;overflow:auto;background: #000;background: linear-gradient(-180deg, #212121, #424242);color:#e0e0e0;} +.rx_poll_default .rx_poll_h_strong{color:#FFFFFF;font-weight:bold} +.rx_poll_default .rx_poll_content{padding: 15px;} +.rx_poll_default .rx_poll_content .title{background-color:#f5f5f5;border-top:2px solid #bdbdbd;border-bottom:2px solid #bdbdbd;font-weight:bold;padding:7px 10px;margin-bottom:10px} +.rx_poll_default .rx_poll_content .rx_poll_default_item,.rx_poll_default .rx_poll_content .poll_vote .checkcount,.rx_poll_default .rx_poll_content .poll_vote .poll_item label{padding: 10px 0px;} +.rx_poll_default .rx_poll_content .rx_poll_default_item .item_text strong{display:inline-block; padding-right:10px; margin-right:10px;border-right:2px solid #e0e0e0;} +.rx_poll_default .rx_poll_content .rx_poll_default_item>div.item_bar{height:22px;position:relative;margin:6px 0px;background-color:#eeeeee;} +.rx_poll_default .rx_poll_content .rx_poll_default_item>div.item_bar div.item_bar{position:absolute;top:0px;left:0;background-color:#66bb6a;} +.rx_poll_default .rx_poll_content .rx_poll_default_item div.item_bar .item_bar_text{position:absolute;top:0px;right:3px;} +.rx_poll_default div.poll_button{background-color:#f5f5f5;padding:10px 15px;width:auto;text-align:center} +.rx_poll_default .rx_poll_content .poll_vote{margin:5px 0px;} +.rx_poll_default .rx_poll_content .poll_vote .poll_item, .rx_poll_default .rx_poll_content .poll_vote .poll_item_add{position:relative;border-bottom:1px solid #e0e0e0;} +.rx_poll_default .rx_poll_content .poll_vote .poll_item label{display:block;width:auto} +.rx_poll_default .rx_poll_content .poll_vote .poll_item .poll_item_delete{position:absolute;right:0;top:7px;} + +.rx_poll_default .rx_poll_content .poll_vote .poll_item_add input[type="text"]{width:100%; + line-height: 25px; + font-size: 14px; + margin: 0; + padding: 8px 0; + outline: none; + border: none; + border-bottom:1px solid #e0e0e0; +} +.rx_poll_default .rx_poll_content .poll_vote .poll_item_add input[type="button"]{position:absolute;right:0;top:7px;} + + .poll_table{table-layout:fixed;width:100%;padding:0;border:none} .poll_table td{padding:0;margin:0} .poll_table td.h{background:url(../images/top_bg.png) repeat-x left top} @@ -25,7 +54,4 @@ .poll_table td.poll_content div.item{color:#636363;border-bottom:1px solid #EDEDED;padding:5px 0 8px 10px;margin-bottom:3px} .poll_table td.poll_content div.noborder{border-bottom:none;margin-bottom:10px} .poll_table td.poll_content div.checkcount{border-bottom:1px dashed #EDEDED;padding:0 0 8px 10px;margin-bottom:3px;text-align:right;color:#636363} -.poll_table tr.cap>td{font-size:0;line-height:0;height:7px;overflow:hidden} -.item.add{-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box; } -.item.add *{-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box; } -.item.add input[type='text']{width:90%;width:-webkit-calc(100% - 35px);width:-moz-calc(100% - 35px);width:calc(100% - 35px);} \ No newline at end of file +.poll_table tr.cap>td{font-size:0;line-height:0;height:7px;overflow:hidden} \ No newline at end of file diff --git a/widgets/pollWidget/skins/default/css/poll.min.css b/widgets/pollWidget/skins/default/css/poll.min.css deleted file mode 100644 index 8085235f3..000000000 --- a/widgets/pollWidget/skins/default/css/poll.min.css +++ /dev/null @@ -1 +0,0 @@ -.poll_table{table-layout:fixed;width:100%;padding:0;border:0}.poll_table td{padding:0;margin:0}.poll_table td.h{background:url(../images/top_bg.png) repeat-x left top}.poll_table td.title{height:28px;background:url(../images/top_title_bg.png) repeat-x left top;padding:0 20px;color:#C3C3C4}.poll_table td.title strong{color:#FFF;font-weight:700}.poll_table td.l{border-left:1px solid #E5E5E5}.poll_table td.r{border-right:1px solid #E5E5E5}.poll_table td.poll_content{padding:18px 13px}.poll_table td.poll_button{border:1px solid #E5E5E5;border-bottom:0;background-color:#F6F6F5}.poll_table td.poll_button div{padding:5px 0 2px;text-align:center}.poll_table td.b{background-color:#F6F6F5;height:7px}.poll_table td.b img{width:100%;height:6px;border-bottom:1px solid #E5E5E5}.poll_table td.bb{height:7px}.poll_table td.bb img{width:100%;height:6px;border-bottom:1px solid #E5E5E5}.poll_table td.poll_content div.title{color:#000;background-color:#F5F5F5;border-top:2px solid #C1C0BD;border-bottom:2px solid #C1C0BD;font-weight:700;padding:7px 0 7px 10px;margin-bottom:10px}.poll_table td.poll_content div.item_text{color:#636363;padding:0 10px;margin-top:10px}.poll_table td.poll_content div.item_text strong{font-weight:700;color:#000;font-family:돋움;font-size:12px}.poll_table td.poll_content table.item_bar_table{width:100%;table-layout:fixed;border-bottom:1px solid #EDEDED;margin-top:10px}.poll_table td.poll_content table.noborder{border-bottom:0;margin-bottom:10px}.poll_table td.poll_content table.item_bar_table td.bar{padding:0 0 5px;background:url(../images/back_bar.png) repeat-x left center}.poll_table td.poll_content table.item_bar_table td.bar img{width:100%;height:6px}.poll_table td.poll_content table.item_bar_table td.status{font-size:.9em;padding-bottom:5px;color:#636363;padding-left:15px}.poll_table td.poll_content table.item_bar_table td.status strong{font-weight:700;color:#58C011}.poll_table td.poll_content div.item{color:#636363;border-bottom:1px solid #EDEDED;padding:5px 0 8px 10px;margin-bottom:3px}.poll_table td.poll_content div.noborder{border-bottom:0;margin-bottom:10px}.poll_table td.poll_content div.checkcount{border-bottom:1px dashed #EDEDED;padding:0 0 8px 10px;margin-bottom:3px;text-align:right;color:#636363}.poll_table tr.cap>td{font-size:0;line-height:0;height:7px;overflow:hidden} \ No newline at end of file diff --git a/widgets/pollWidget/skins/default/js/poll.js b/widgets/pollWidget/skins/default/js/poll.js index e41ed8b32..c86e92b8f 100644 --- a/widgets/pollWidget/skins/default/js/poll.js +++ b/widgets/pollWidget/skins/default/js/poll.js @@ -1,25 +1,25 @@ -function initTemplete(type) +function initRxDefaultTemplete(type, poll_srl) { switch(type) { case 'poll': if(typeof window.template == 'undefined') { - var source = jQuery("#entry-template").html(); + var source = jQuery("#entry-template-" + poll_srl).html(); window.template = Handlebars.compile(source); } break; case 'result': if(typeof window.template_result == 'undefined') { - var source = jQuery("#entry-template-result").html(); + var source = jQuery("#entry-template-result-" + poll_srl).html(); window.template_result = Handlebars.compile(source); } break; case 'members': if(typeof window.template_member == 'undefined') { - var source = jQuery("#entry-template-members").html(); + var source = jQuery("#entry-template-members-" + poll_srl).html(); window.template_member = Handlebars.compile(source); } break; @@ -68,13 +68,13 @@ function doPoll(fo_obj) { if(data.error!=0) alert(data.message); else { - loadPollResult(poll_srl); + loadRxDefaultPollResult(poll_srl); jQuery("#poll_" + poll_srl + "_gotoresult_button").css({ display: "none" }); jQuery("#poll_" + poll_srl + "_result_nobutton").css({ - display: "table-row" + display: "block" }); jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ @@ -96,14 +96,14 @@ function addItem(poll_srl,poll_srl_indexes) { }); jQuery("#poll_" + poll_srl + "_result_nobutton").css({ - display: "table-row" + display: "block" }); jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ display: "none" }); - loadPoll(poll_srl); + loadRxDefaultPoll(poll_srl); } }); return false; @@ -120,32 +120,32 @@ function deleteItem(poll_srl,poll_srl_indexes,poll_item_srl) { }); jQuery("#poll_" + poll_srl + "_result_nobutton").css({ - display: "table-row" + display: "block" }); jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ display: "none" }); - loadPoll(poll_srl); + loadRxDefaultPoll(poll_srl); } }); return false; } -function loadPoll(poll_srl,data) +function loadRxDefaultPoll(poll_srl,data) { if(typeof data == 'undefined') { jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){ - loadPoll(parseInt(data.poll.poll_srl),data); + loadRxDefaultPoll(parseInt(data.poll.poll_srl),data); }); } else { jQuery("#stop_date_"+poll_srl).html(data.poll.stop_date); - initTemplete('poll'); + initRxDefaultTemplete('poll',poll_srl); var template = window.template; var context = Object; var additem = data.caniadditem; @@ -174,7 +174,7 @@ function loadPoll(poll_srl,data) } } -function showPollMemberNext(poll_srl,poll_item_srl) +function showRxDefaultPollMemberNext(poll_srl,poll_item_srl) { if(typeof window.cur_page == 'undefined') { @@ -184,7 +184,7 @@ function showPollMemberNext(poll_srl,poll_item_srl) window.cur_page++; jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl,"poll_item":poll_item_srl,"page":window.cur_page}, function(data){ - initTemplete('members'); + initRxDefaultTemplete('members',poll_srl); var template = window.template_member; var context = Object; @@ -213,12 +213,12 @@ function showPollMemberNext(poll_srl,poll_item_srl) return false; } -function showPollMember(poll_srl,poll_item_srl) +function showRxDefaultPollMember(poll_srl,poll_item_srl) { window.cur_page = 1; jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl,"poll_item":poll_item_srl,"page":window.cur_page}, function(data){ - initTemplete('members'); + initRxDefaultTemplete('members',poll_srl); var template = window.template_member; var context = Object; var title = poll_member_lang; @@ -246,7 +246,7 @@ function showPollMember(poll_srl,poll_item_srl) jQuery("#poll_content_" + poll_srl + "_result").html(html); jQuery("#poll_" + poll_srl + "_gotoresult_button").css({ - display: "table-row" + display: "block" }); jQuery("#poll_" + poll_srl + "_result_nobutton").css({ @@ -254,19 +254,19 @@ function showPollMember(poll_srl,poll_item_srl) }); jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ - display: "table-row" + display: "block" }); }); return false; } -function loadPollResult(poll_srl,data) +function loadRxDefaultPollResult(poll_srl,data) { if(typeof data == 'undefined') { jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){ - loadPollResult(parseInt(data.poll.poll_srl),data); + loadRxDefaultPollResult(parseInt(data.poll.poll_srl),data); }); } else @@ -274,7 +274,7 @@ function loadPollResult(poll_srl,data) jQuery("#stop_date_result_" + poll_srl).html(data.poll.stop_date); jQuery("#poll_count_result_" + poll_srl).html(data.poll.poll_count); - initTemplete('result'); + initRxDefaultTemplete('result',poll_srl); var template = window.template_result; var context = Object; var showMembers = (data.poll.poll_type==1 || data.poll.poll_type==3); @@ -322,7 +322,7 @@ function loadPollResult(poll_srl,data) jQuery(function($){ /* View poll result */ - $('._poll_result').click(function(){ + $('._rx_default_poll_result').click(function(){ var cls = $(this).attr('class'), srl, skin; try{ @@ -332,7 +332,7 @@ jQuery(function($){ if(!srl) return false; jQuery("#poll_" + srl + "_result_button").css({ - display: "table-row" + display: "block" }); jQuery("#poll_" + srl + "_result_nobutton").css({ @@ -340,16 +340,16 @@ jQuery(function($){ }); jQuery("#poll_" + srl + "_result_yesbutton").css({ - display: "table-row" + display: "block" }); - loadPollResult(srl); + loadRxDefaultPollResult(srl); return false; }); /* goto poll result */ - $('._gotoresult_screen').click(function(){ + $('._rx_default_gotoresult_screen').click(function(){ var cls = $(this).attr('class'), srl, skin; try{ @@ -363,20 +363,20 @@ jQuery(function($){ }); jQuery("#poll_" + srl + "_result_nobutton").css({ - display: "table-row" + display: "block" }); jQuery("#poll_" + srl + "_result_yesbutton").css({ display: "none" }); - loadPollResult(srl); + loadRxDefaultPollResult(srl); return false; }); /* View poll screen */ - $('._poll_screen').click(function(){ + $('._rx_default_poll_screen').click(function(){ var cls = $(this).attr('class'), srl, skin; try{ @@ -390,14 +390,14 @@ jQuery(function($){ }); jQuery("#poll_" + srl + "_result_nobutton").css({ - display: "table-row" + display: "block" }); jQuery("#poll_" + srl + "_result_yesbutton").css({ display: "none" }); - loadPoll(srl); + loadRxDefaultPoll(srl); return false; }); diff --git a/widgets/pollWidget/skins/default/pollview.html b/widgets/pollWidget/skins/default/pollview.html index 20909baa3..d7f32c116 100644 --- a/widgets/pollWidget/skins/default/pollview.html +++ b/widgets/pollWidget/skins/default/pollview.html @@ -5,16 +5,16 @@ var poll_member_lang = "{$lang->poll_item_members}"; jQuery(document).ready(function(){ var data = {json_encode($poll_data)}; - if(data.poll.is_polled==0) loadPoll({$poll_srl},data); + if(data.poll.is_polled==0) loadRxDefaultPoll({$poll_srl},data); else { - loadPollResult({$poll_srl},data); + loadRxDefaultPollResult({$poll_srl},data); jQuery("#poll_{$poll_srl}_result_button").css({ display: "none" }); jQuery("#poll_{$poll_srl}_result_nobutton").css({ - display: "table-row" + display: "block" }); jQuery("#poll_{$poll_srl}_result_yesbutton").css({ @@ -23,37 +23,41 @@ } }); -
+
- - - - - - - - - - - - - - - - - - - - - - - - -
lhblankrh
- {$lang->poll_stop_date}: -
blank +
+
+
+ {$lang->poll_stop_date}: +
+
+
+
+
+ + +
+
-
blank
-
- - -
-
lbblankrb
diff --git a/widgets/pollWidget/skins/default/skin.xml b/widgets/pollWidget/skins/default/skin.xml index d57fa5d25..75c5048b1 100644 --- a/widgets/pollWidget/skins/default/skin.xml +++ b/widgets/pollWidget/skins/default/skin.xml @@ -1,41 +1,50 @@ - 설문조사 기본 스킨 - 投票系统默认皮肤 - アンケート調査デフォルトスキン - Default Skin of teh Poll - Skin mặc định của thăm dò - 投票系統預設面板 - Oylamanın Varsayılan Dış Görünümü - 설문조사 기본 스킨 - 投票系统默认皮肤。 - アンケート調査デフォルトスキン - Default Skin of the Poll - Skin mặc định của thăm dò. - 投票系統預設面板。 - Oylamanın Varsayılan Dış Görünümü - 2.0 - 2015-06-09 + 설문조사 기본 스킨 + 投票系统默认皮肤 + アンケート調査デフォルトスキン + Default Skin of teh Poll + Skin mặc định của thăm dò + 投票系統預設面板 + Oylamanın Varsayılan Dış Görünümü + 설문조사 기본 스킨 + 投票系统默认皮肤。 + アンケート調査デフォルトスキン + Default Skin of the Poll + Skin mặc định của thăm dò. + 投票系統預設面板。 + Oylamanın Varsayılan Dış Görünümü + 2.0.1 + 2016-01-24 - - NAVER - NAVER - NAVER - NAVER - NAVER - NAVER - NAVER - + + misol + misol + misol + misol + misol + misol + misol + + + NAVER + NAVER + NAVER + NAVER + NAVER + NAVER + NAVER + - - - 기본 - Mặc định - 默认 - デフォルト - Default - 預設 - Varsayılan - - + + + 기본 + Mặc định + 默认 + デフォルト + Default + 預設 + Varsayılan + + diff --git a/widgets/pollWidget/skins/simple/css/poll.min.css b/widgets/pollWidget/skins/simple/css/poll.min.css deleted file mode 100644 index 557ee0b50..000000000 --- a/widgets/pollWidget/skins/simple/css/poll.min.css +++ /dev/null @@ -1 +0,0 @@ -.simple_poll{table-layout:fixed;padding:0;margin:0;border:0}.simple_poll td{padding:0;margin:0}.simple_poll td.title{text-align:right}.simple_poll td .itemDiv{border-top:1px solid #BBB;margin-top:3px;padding:3px 0}.simple_poll td .title{color:#000;font-weight:700;letter-spacing:-1px}.simple_poll td .checkcount{color:#AAA}.simple_poll td .item{color:#636363;margin:5px 0}.simple_poll td .item input{margin:0;padding:0}.simple_poll td .item label{letter-spacing:-1px}.simple_poll td .resultItem{color:#636363;margin:6px 0 0 10px;letter-spacing:-1px}.simple_poll td .barBox{margin-left:10px}.simple_poll td .barBox .bar{margin:3px 0}.simple_poll td .barBox .status{color:#AAA}.simple_poll td.stopDate{color:#AAA;border-top:1px solid #BBB;padding-top:3px}.simple_poll td.stopDate a{color:#AAA;text-decoration:none}.simple_poll td.poll_button{text-align:left;padding-top:3px}.simple_poll td.poll_button .poll_button{border:1px solid #EEE;background-color:#AAA;color:#FFF;font-weight:700;padding:1px 3px;height:20px}.simple_poll td.b{background-color:#F6F6F5;height:7px}.simple_poll td.b img{width:100%;height:6px;border-bottom:1px solid #E5E5E5}.simple_poll td.bb{height:7px}.simple_poll td.bb img{width:100%;height:6px;border-bottom:1px solid #E5E5E5} \ No newline at end of file From afa1e71d59ac89980a2d06732203a37bcf1cf9a8 Mon Sep 17 00:00:00 2001 From: MinSoo Kim Date: Sun, 24 Jan 2016 04:13:32 +0900 Subject: [PATCH 33/53] =?UTF-8?q?CSS=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 안 쓰게 된 CSS 삭제. (사실 CSS 문서는 새로 짬.) --- widgets/pollWidget/skins/default/css/poll.css | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/widgets/pollWidget/skins/default/css/poll.css b/widgets/pollWidget/skins/default/css/poll.css index ab09f1db5..2cc79457d 100644 --- a/widgets/pollWidget/skins/default/css/poll.css +++ b/widgets/pollWidget/skins/default/css/poll.css @@ -25,33 +25,4 @@ border: none; border-bottom:1px solid #e0e0e0; } -.rx_poll_default .rx_poll_content .poll_vote .poll_item_add input[type="button"]{position:absolute;right:0;top:7px;} - - -.poll_table{table-layout:fixed;width:100%;padding:0;border:none} -.poll_table td{padding:0;margin:0} -.poll_table td.h{background:url(../images/top_bg.png) repeat-x left top} -.poll_table td.title{height:28px;background:url(../images/top_title_bg.png) repeat-x left top;padding:0 20px 0 20px;color:#C3C3C4} -.poll_table td.title strong{color:#FFFFFF;font-weight:bold} -.poll_table td.l{border-left:1px solid #E5E5E5} -.poll_table td.r{border-right:1px solid #E5E5E5} -.poll_table td.poll_content{padding:18px 13px 18px 13px} -.poll_table td.poll_button{border:1px solid #E5E5E5;border-bottom:none;background-color:#F6F6F5} -.poll_table td.poll_button div{padding:5px 0 2px 0;text-align:center} -.poll_table td.b{background-color:#F6F6F5;height:7px} -.poll_table td.b img{width:100%;height:6px;border-bottom:1px solid #E5E5E5} -.poll_table td.bb{height:7px} -.poll_table td.bb img{width:100%;height:6px;border-bottom:1px solid #E5E5E5} -.poll_table td.poll_content div.title{color:#000000;background-color:#F5F5F5;border-top:2px solid #C1C0BD;border-bottom:2px solid #C1C0BD;font-weight:bold;padding:7px 0 7px 10px;margin-bottom:10px} -.poll_table td.poll_content div.item_text{color:#636363;padding:0 10px 0 10px;margin-top:10px} -.poll_table td.poll_content div.item_text strong{font-weight:bold;color:#000000;font-family:돋움;font-size:12px} -.poll_table td.poll_content table.item_bar_table{width:100%;table-layout:fixed;border-bottom:1px solid #EDEDED;margin-top:10px} -.poll_table td.poll_content table.noborder{border-bottom:none;margin-bottom:10px} -.poll_table td.poll_content table.item_bar_table td.bar{padding:0 0 5px 0;background:url(../images/back_bar.png) repeat-x left center} -.poll_table td.poll_content table.item_bar_table td.bar img{width:100%;height:6px} -.poll_table td.poll_content table.item_bar_table td.status{font-size:.9em;padding-bottom:5px;color:#636363;padding-left:15px} -.poll_table td.poll_content table.item_bar_table td.status strong{font-weight:bold;color:#58C011} -.poll_table td.poll_content div.item{color:#636363;border-bottom:1px solid #EDEDED;padding:5px 0 8px 10px;margin-bottom:3px} -.poll_table td.poll_content div.noborder{border-bottom:none;margin-bottom:10px} -.poll_table td.poll_content div.checkcount{border-bottom:1px dashed #EDEDED;padding:0 0 8px 10px;margin-bottom:3px;text-align:right;color:#636363} -.poll_table tr.cap>td{font-size:0;line-height:0;height:7px;overflow:hidden} \ No newline at end of file +.rx_poll_default .rx_poll_content .poll_vote .poll_item_add input[type="button"]{position:absolute;right:0;top:7px;} \ No newline at end of file From d3c0e94b03332f38a286252a93e7f5128f81732a Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 24 Jan 2016 10:20:35 +0900 Subject: [PATCH 34/53] Update minimal server requirements --- README.md | 13 +++++++-- classes/db/DBMysql.class.php | 8 +++--- common/constants.php | 4 +-- modules/install/install.controller.php | 12 ++++---- modules/install/lang/lang.xml | 40 +++++++++++++++----------- 5 files changed, 45 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index c9d137e94..4da57f407 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,16 @@ RhymiX는 개발자와 사용자가 서로의 권리와 책임을 존중하는 ### 설치 환경 -- PHP 5.3 이상 (PHP 5.5 이상 권장, PHP 7 지원) -- MYSQL 4.1 이상 (MySQL 5.0 이상 또는 MariaDB 권장) -- 필수 모듈: curl, gd, iconv _or_ mbstring, json, mcrypt _or_ openssl, xml +- PHP 5.3.3 이상 (PHP 5.5.9 이상 권장, PHP 7 지원) +- MySQL 4.1.13 이상 (MySQL 5.0.7 이상 또는 MariaDB 권장) +- CUBRID 또는 MS SQL을 DB로 사용할 수도 있으나, 권장하지는 않습니다. +- 필수 PHP 모듈 + - curl + - gd + - iconv 또는 mbstring + - json + - mcrypt 또는 openssl + - xml 및 simplexml - php.ini에서 session.auto_start = Off로 설정되어 있어야 합니다. - 설치 폴더 또는 files 폴더에 쓰기 권한이 주어져야 합니다. diff --git a/classes/db/DBMysql.class.php b/classes/db/DBMysql.class.php index 67d31c9bb..9c639e8b9 100644 --- a/classes/db/DBMysql.class.php +++ b/classes/db/DBMysql.class.php @@ -67,7 +67,7 @@ class DBMysql extends DB $result = @mysql_connect($connection["db_hostname"], $connection["db_userid"], $connection["db_password"]); if(!$result) { - exit('XE cannot connect to DB.'); + exit('Unable to connect to DB.'); } if(mysql_error()) @@ -76,10 +76,10 @@ class DBMysql extends DB return; } - // Error appears if the version is lower than 4.1 - if(version_compare(mysql_get_server_info($result), '4.1', '<')) + // Error appears if the version is lower than 4.1.13 + if(version_compare(mysql_get_server_info($result), '4.1.13', '<')) { - $this->setError(-1, 'XE cannot be installed under the version of mysql 4.1. Current mysql version is ' . mysql_get_server_info()); + $this->setError(-1, 'RhymiX requires MySQL 4.1.13 or later. Current MySQL version is ' . mysql_get_server_info()); return; } diff --git a/common/constants.php b/common/constants.php index 1a0e9ae23..683fa9489 100644 --- a/common/constants.php +++ b/common/constants.php @@ -119,8 +119,8 @@ define('__XE_VERSION_ALPHA__', false); define('__XE_VERSION_BETA__', false); define('__XE_VERSION_RC__', false); define('__XE_VERSION_STABLE__', true); -define('__XE_MIN_PHP_VERSION__', '5.3.0'); -define('__XE_RECOMMEND_PHP_VERSION__', '5.5.0'); +define('__XE_MIN_PHP_VERSION__', '5.3.3'); +define('__XE_RECOMMEND_PHP_VERSION__', '5.5.9'); define('__ZBXE__', true); define('__ZBXE_VERSION__', RX_VERSION); define('_XE_PATH_', RX_BASEDIR); diff --git a/modules/install/install.controller.php b/modules/install/install.controller.php index a24fcfaa5..771ce9dab 100644 --- a/modules/install/install.controller.php +++ b/modules/install/install.controller.php @@ -394,18 +394,18 @@ class installController extends install $checklist['json'] = false; } - // Check openssl - if(function_exists('openssl_encrypt')) + // Check mcrypt or openssl + if(function_exists('mcrypt_encrypt') || function_exists('openssl_encrypt')) { - $checklist['openssl'] = true; + $checklist['mcrypt'] = true; } else { - $checklist['openssl'] = false; + $checklist['mcrypt'] = false; } - // Check XML - if(function_exists('xml_parser_create')) + // Check xml & simplexml + if(function_exists('xml_parser_create') && function_exists('simplexml_load_string')) { $checklist['xml'] = true; } diff --git a/modules/install/lang/lang.xml b/modules/install/lang/lang.xml index 6a1e0a1c0..ab1cacc68 100644 --- a/modules/install/lang/lang.xml +++ b/modules/install/lang/lang.xml @@ -137,20 +137,22 @@
- - - - - - - - + + + + + + + + + + @@ -161,6 +163,7 @@ + @@ -171,6 +174,7 @@ + @@ -181,20 +185,22 @@ + - - - - - - - - - + + + + + + + + + + From 49d6736835e904bcae748817e80d7bb8a8e71d0b Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 24 Jan 2016 13:55:13 +0900 Subject: [PATCH 35/53] Fix setting empty value to user_id input in last page of install --- modules/install/tpl/js/install.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/install/tpl/js/install.js b/modules/install/tpl/js/install.js index 15bcc7389..ee565d81f 100644 --- a/modules/install/tpl/js/install.js +++ b/modules/install/tpl/js/install.js @@ -32,7 +32,7 @@ jQuery(function($){ var user_id_input = $("input[name='user_id']"); var email_input = $("input[name='email_address']"); email_input.on("blur", function() { - if (user_id_input.val() == "") { + if (user_id_input.val() == "" && email_input.val() != "") { user_id_input.val(email_input.val().replace(/@.+$/g, "").replace(/[^a-zA-Z0-9_]/g, "")); } }); From 0a89dffa5a55ab99d319d4e185d75a8fe2cf59f3 Mon Sep 17 00:00:00 2001 From: conory Date: Mon, 25 Jan 2016 18:10:15 +0900 Subject: [PATCH 36/53] =?UTF-8?q?XE=ED=91=9C=EA=B8=B0=EB=A5=BC=20Rhymix?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .htaccess | 4 +- addons/blogapi/blogapi.addon.php | 4 +- classes/db/DBCubrid.class.php | 4 +- classes/db/DBMssql.class.php | 4 +- classes/db/DBMysql.class.php | 6 +- common/lang/lang.xml | 59 +++++---- common/tpl/common_layout.html | 6 +- layouts/default/layout.html | 2 +- layouts/xedition/demo/footer.html | 4 +- layouts/xedition/demo/welcome_main.html | 20 +-- layouts/xedition/demo/welcome_sub3.html | 2 +- modules/admin/admin.admin.view.php | 2 +- modules/admin/lang/lang.xml | 118 +++++++++--------- modules/admin/tpl/admin_setup.html | 2 +- modules/autoinstall/lang/lang.xml | 4 +- modules/autoinstall/tpl/install.html | 4 +- modules/board/board.class.php | 2 +- modules/comment/comment.admin.controller.php | 2 +- modules/comment/comment.controller.php | 8 +- .../editor/styles/ckeditor_light/editor.html | 2 +- .../styles/ckeditor_recommend/editor.html | 2 +- modules/editor/styles/default/editor.html | 2 +- modules/editor/styles/dreditor/editor.html | 2 +- modules/editor/styles/xeStyle/editor.html | 2 +- .../editor/styles/xeStyleBlack/editor.html | 2 +- modules/file/lang/lang.xml | 20 +-- .../importer/importer.admin.controller.php | 2 +- modules/importer/lang/lang.xml | 40 +++--- modules/install/script/ko.install.php | 10 +- .../welcome_content/welcome_content_de.html | 6 +- .../welcome_content/welcome_content_en.html | 6 +- .../welcome_content/welcome_content_es.html | 6 +- .../welcome_content/welcome_content_fr.html | 6 +- .../welcome_content/welcome_content_jp.html | 4 +- .../welcome_content/welcome_content_ko.html | 6 +- .../welcome_content/welcome_content_mn.html | 6 +- .../welcome_content/welcome_content_ru.html | 6 +- .../welcome_content/welcome_content_tr.html | 6 +- .../welcome_content/welcome_content_vi.html | 6 +- .../welcome_content_zh-CN.html | 6 +- .../welcome_content_zh-TW.html | 6 +- .../xeicon_content/xeicon_content_ko_2.html | 2 +- modules/layout/lang/lang.xml | 14 +-- modules/layout/tpl/faceOff_sample.tar | Bin 45056 -> 45369 bytes modules/member/lang/lang.xml | 4 +- modules/menu/lang/lang.xml | 8 +- modules/module/lang/lang.xml | 64 +++++----- modules/page/lang/lang.xml | 26 ++-- modules/point/lang/lang.xml | 16 +-- modules/widget/lang/lang.xml | 16 +-- 50 files changed, 283 insertions(+), 278 deletions(-) diff --git a/.htaccess b/.htaccess index 3007a3705..e5ce1bc18 100644 --- a/.htaccess +++ b/.htaccess @@ -1,8 +1,8 @@ RewriteEngine On -# reserve XE Layout Template Source File (*.html) +# reserve Rhymix Layout Template Source File (*.html) RewriteRule ^(layouts|m.layouts)/(.+)\.html$ - [L,F] -# reserve XE Template Source Files (*.html) +# reserve Rhymix Template Source Files (*.html) RewriteCond %{REQUEST_URI} !/modules/editor/ RewriteRule /(skins|m.skins)/(.+)\.html$ - [L,F] diff --git a/addons/blogapi/blogapi.addon.php b/addons/blogapi/blogapi.addon.php index 913f3ae4c..1fde7d9b0 100644 --- a/addons/blogapi/blogapi.addon.php +++ b/addons/blogapi/blogapi.addon.php @@ -527,8 +527,8 @@ if($called_position == 'before_module_proc') - XpressEngine - http://www.xpressengine.com/ + Rhymix + https://www.rhymix.org/ {$homepagelink} diff --git a/classes/db/DBCubrid.class.php b/classes/db/DBCubrid.class.php index ff856ec2b..aaff4c6c3 100644 --- a/classes/db/DBCubrid.class.php +++ b/classes/db/DBCubrid.class.php @@ -14,10 +14,10 @@ class DBCubrid extends DB { /** - * prefix of XE tables(One more XE can be installed on a single DB) + * prefix of Rhymix tables(One more Rhymix can be installed on a single DB) * @var string */ - var $prefix = 'xe_'; + var $prefix = 'rx_'; /** * max size of constant in CUBRID(if string is larger than this, '...'+'...' should be used) diff --git a/classes/db/DBMssql.class.php b/classes/db/DBMssql.class.php index b9e7aa1e7..7dda69d35 100644 --- a/classes/db/DBMssql.class.php +++ b/classes/db/DBMssql.class.php @@ -13,10 +13,10 @@ class DBMssql extends DB { /** - * prefix of XE tables(One more XE can be installed on a single DB) + * prefix of Rhymix tables(One more Rhymix can be installed on a single DB) * @var string */ - var $prefix = 'xe'; + var $prefix = 'rx'; var $param = array(); var $comment_syntax = '/* %s */'; diff --git a/classes/db/DBMysql.class.php b/classes/db/DBMysql.class.php index 9c639e8b9..268ce952d 100644 --- a/classes/db/DBMysql.class.php +++ b/classes/db/DBMysql.class.php @@ -14,10 +14,10 @@ class DBMysql extends DB { /** - * prefix of a tablename (One or more XEs can be installed in a single DB) + * prefix of a tablename (One or more Rhymix can be installed in a single DB) * @var string */ - var $prefix = 'xe_'; // / < + var $prefix = 'rx_'; // / < var $comment_syntax = '/* %s */'; var $charset = 'utf8'; @@ -168,7 +168,7 @@ class DBMysql extends DB { if(!$connection) { - exit('XE cannot handle DB connection.'); + exit('Rhymix cannot handle DB connection.'); } // Run the query statement $result = @mysql_query($query, $connection); diff --git a/common/lang/lang.xml b/common/lang/lang.xml index 75e80b3cd..cbf594fcb 100644 --- a/common/lang/lang.xml +++ b/common/lang/lang.xml @@ -3630,16 +3630,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -3670,25 +3670,30 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - + + + + + + + + + + + diff --git a/common/tpl/common_layout.html b/common/tpl/common_layout.html index b9a5cf604..7995ae298 100644 --- a/common/tpl/common_layout.html +++ b/common/tpl/common_layout.html @@ -2,15 +2,15 @@ $db_info = Context::getDBInfo(); $lang_type = Context::getLangType(); $ssl_actions = Context::getSSLActions(); - $css_files=Context::getCssFile(); - $js_files=Context::getJsFile(); + $css_files = Context::getCssFile(); + $js_files = Context::getJsFile(); } - + diff --git a/layouts/default/layout.html b/layouts/default/layout.html index 4adf5a76c..d2dcba0ef 100644 --- a/layouts/default/layout.html +++ b/layouts/default/layout.html @@ -7,7 +7,7 @@

- XpressEngine + Rhymix {Context::getSiteTitle()} {$layout_info->LOGO_TEXT} {$layout_info->LOGO_TEXT} diff --git a/layouts/xedition/demo/footer.html b/layouts/xedition/demo/footer.html index 0faa80243..b1701abdb 100644 --- a/layouts/xedition/demo/footer.html +++ b/layouts/xedition/demo/footer.html @@ -1,4 +1,4 @@ -

XpressEngine is a free software CMS. You can redistribute or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation.

+

Rhymix is a free software CMS. You can redistribute or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation.

diff --git a/layouts/xedition/demo/welcome_main.html b/layouts/xedition/demo/welcome_main.html index c4156d6cc..965b9f0f6 100644 --- a/layouts/xedition/demo/welcome_main.html +++ b/layouts/xedition/demo/welcome_main.html @@ -25,7 +25,7 @@
  • 레이아웃 디자인 바꾸기

    레이아웃 디자인 바꾸기

    -

    XE는 다양한 레이아웃 디자인을 제공합니다. 레이아웃 디자인은 [관리 > 사이트 제작/편집 > 사이트 디자인 설정]에서 변경할 수 있습니다.

    +

    Rhymix는 다양한 레이아웃 디자인을 제공합니다. 레이아웃 디자인은 [관리 > 사이트 제작/편집 > 사이트 디자인 설정]에서 변경할 수 있습니다.

  • 초기화면 바꾸기 @@ -46,8 +46,8 @@
    FEATURES -

    XE CORE. FEATURES

    -

    XpressEngine은 XE Core 프레임웍을 기반으로 개별 프로그램과 스킨을 실행하여 결과물을 생성합니다.
    다양한 개성을 가진 프로그램과 스킨을 조합하여 다채로운 기능을 가진 멋진 웹사이트를 만들 수 있습니다.

    +

    Rhymix. FEATURES

    +

    Rhymix는 프레임웍을 기반으로 개별 프로그램과 스킨을 실행하여 결과물을 생성합니다.
    다양한 개성을 가진 프로그램과 스킨을 조합하여 다채로운 기능을 가진 멋진 웹사이트를 만들 수 있습니다.

    • @@ -56,7 +56,7 @@

      손쉬운 사이트 구축

      -

      XE는 블로그형, 카페형 등 다양한 모듈을 제공합니다. 만들고자 하는 사이트에 적합한 모듈을 선택하여 쉽고 빠르게 사이트를 구축할 수 있습니다.

      +

      Rhymix는 블로그형, 카페형 등 다양한 모듈을 제공합니다. 만들고자 하는 사이트에 적합한 모듈을 선택하여 쉽고 빠르게 사이트를 구축할 수 있습니다.

      CHECK IT OUT
      @@ -68,7 +68,7 @@

      기능을 더하는 구조

      -

      XE는 확장기능을 내려받아 더 많은 기능을 이용할 수 있습니다. 기본 기능과 확장 기능을 자유롭게 조합하여 다양한 웹 사이트를 제작할 수 있습니다.

      +

      Rhymix는 확장기능을 내려받아 더 많은 기능을 이용할 수 있습니다. 기본 기능과 확장 기능을 자유롭게 조합하여 다양한 웹 사이트를 제작할 수 있습니다.

      CHECK IT OUT
      @@ -80,7 +80,7 @@

      오픈 소스 & 커뮤니티

      -

      XE는 오픈 커뮤니티를 통해 다양한 정보를 제공합니다. 커뮤니티에서 원하는 정보를 찾거거나 공유할 수 있습니다

      +

      Rhymix는 오픈 커뮤니티를 통해 다양한 정보를 제공합니다. 커뮤니티에서 원하는 정보를 찾거거나 공유할 수 있습니다

      CHECK IT OUT
      @@ -92,7 +92,7 @@

      다국어 지원

      -

      XE는 여러 나라의 언어를 지원합니다. 웹 사이트를 언어별로 분리하지 않고도 다국어 웹 사이트를 쉽게 제작할 수 있습니다.

      +

      Rhymix는 여러 나라의 언어를 지원합니다. 웹 사이트를 언어별로 분리하지 않고도 다국어 웹 사이트를 쉽게 제작할 수 있습니다.

      CHECK IT OUT
      @@ -106,7 +106,7 @@
    • COMMUNITY

      COMMUNITY

      -

      XE와 관련한 다양한 커뮤니티를 만나보세요.

      +

      Rhymix와 관련한 다양한 커뮤니티를 만나보세요.

    • Q&A @@ -116,10 +116,10 @@
    • DOWNLOAD

      DOWNLOAD

      -

      XE 자료실을 통해 나만의 홈페이지를 만들어보세요.

      +

      Rhymix 자료실을 통해 나만의 홈페이지를 만들어보세요.

    • - GITHUB + GITHUB

      GITHUB

      오픈소스 프로젝트 개발참여를 위한 GitHub 페이지입니다.

    • diff --git a/layouts/xedition/demo/welcome_sub3.html b/layouts/xedition/demo/welcome_sub3.html index c8b5e3c5a..af022318d 100644 --- a/layouts/xedition/demo/welcome_sub3.html +++ b/layouts/xedition/demo/welcome_sub3.html @@ -23,7 +23,7 @@
    • 레이아웃 디자인 바꾸기

      최적화

      -

      XpressEngine 뿐 아니라, 다양한 프레임워크에서 동일하게 구현됩니다. 다양한 프레임워크에서 자유롭게 이용해 보세요!

      +

      Rhymix 뿐 아니라, 다양한 프레임워크에서 동일하게 구현됩니다. 다양한 프레임워크에서 자유롭게 이용해 보세요!

    • 초기화면 바꾸기
      diff --git a/modules/admin/admin.admin.view.php b/modules/admin/admin.admin.view.php index 03e1d179e..5a3815842 100644 --- a/modules/admin/admin.admin.view.php +++ b/modules/admin/admin.admin.view.php @@ -595,7 +595,7 @@ class adminAdminView extends admin $php_core['memory_limit'] = "{$ini_info['memory_limit']['local_value']}"; $info['PHP_Core'] = $php_core; - $str_info = "[XE Server Environment " . date("Y-m-d") . "]\n\n"; + $str_info = "[Rhymix Server Environment " . date("Y-m-d") . "]\n\n"; $str_info .= "realpath : ".realpath('./')."\n"; foreach( $info as $key=>$value ) { diff --git a/modules/admin/lang/lang.xml b/modules/admin/lang/lang.xml index bdbdd5c5b..51d8b08f5 100644 --- a/modules/admin/lang/lang.xml +++ b/modules/admin/lang/lang.xml @@ -365,10 +365,10 @@ - - - - + + + + @@ -420,15 +420,15 @@ - + - + - - - - + + + + @@ -574,16 +574,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -598,16 +598,16 @@ - - - - - - - - - - + + + + + + + + + + @@ -824,9 +824,9 @@ - - - + + + @@ -1389,16 +1389,16 @@ - safe_mode=On일 경우 XE의 정상적인 동작을 돕습니다.]]> - - - + safe_mode=On일 경우 Rhymix의 정상적인 동작을 돕습니다.]]> + + + - - - - - + + + + + @@ -1479,24 +1479,24 @@ - - - - - - - - + + + + + + + + - - - + + + - - - - + + + + @@ -1507,8 +1507,8 @@ - 매우 심각한 PHP 보안 문제 및 공격에 노출될 수 있습니다.
    • XE 최신 버전을 사용할 수 없습니다.
    • XE 최신 버전 이상에서 지원하는 확장 기능을 사용할 수 없습니다.
    • 일부 확장 기능이 동작하지 않거나, 이로 인해 장애가 발생할 수 있습니다.
    • ]]> - PHP version of this server can be exposed to serious security problems and attacks.
    • Latest version of XE is not available.
    • You can not use extensions that are supported by the latest version of XE.
    • Some extensions may not work properly. It can cause problems.
    • ]]>
      + 매우 심각한 PHP 보안 문제 및 공격에 노출될 수 있습니다.
    • Rhymix 최신 버전을 사용할 수 없습니다.
    • Rhymix 최신 버전 이상에서 지원하는 확장 기능을 사용할 수 없습니다.
    • 일부 확장 기능이 동작하지 않거나, 이로 인해 장애가 발생할 수 있습니다.
    • ]]>
      + PHP version of this server can be exposed to serious security problems and attacks.
    • Latest version of Rhymix is not available.
    • You can not use extensions that are supported by the latest version of Rhymix.
    • Some extensions may not work properly. It can cause problems.
    • ]]>
      diff --git a/modules/admin/tpl/admin_setup.html b/modules/admin/tpl/admin_setup.html index 5137be3e0..9be5faddb 100644 --- a/modules/admin/tpl/admin_setup.html +++ b/modules/admin/tpl/admin_setup.html @@ -26,7 +26,7 @@
      - +
      diff --git a/modules/autoinstall/lang/lang.xml b/modules/autoinstall/lang/lang.xml index 5998c0f52..d6778e9ac 100644 --- a/modules/autoinstall/lang/lang.xml +++ b/modules/autoinstall/lang/lang.xml @@ -334,8 +334,8 @@ - - + + diff --git a/modules/autoinstall/tpl/install.html b/modules/autoinstall/tpl/install.html index 5ecdcb4c5..7c0e505cf 100644 --- a/modules/autoinstall/tpl/install.html +++ b/modules/autoinstall/tpl/install.html @@ -11,8 +11,8 @@
      • 매우 심각한 PHP 보안 문제 및 공격에 노출될 수 있습니다.
      • -
      • XE 최신 버전을 사용할 수 없습니다.
      • -
      • XE 최신 버전 이상을 지원하는 확장 기능을 사용할 수 없습니다.
      • +
      • Rhymix 최신 버전을 사용할 수 없습니다.
      • +
      • Rhymix 최신 버전 이상을 지원하는 확장 기능을 사용할 수 없습니다.
      • 일부 확장 기능이 동작하지 않거나, 이로 인해 장애가 발생할 수 있습니다.
      diff --git a/modules/board/board.class.php b/modules/board/board.class.php index 3ec8166fc..065be0b27 100644 --- a/modules/board/board.class.php +++ b/modules/board/board.class.php @@ -54,7 +54,7 @@ class board extends ModuleObject { $args->mid = 'board'; $args->module = 'board'; - $args->browser_title = 'XpressEngine'; + $args->browser_title = 'Rhymix'; $args->skin = 'default'; $args->site_srl = 0; $output = $oModuleController->insertModule($args); diff --git a/modules/comment/comment.admin.controller.php b/modules/comment/comment.admin.controller.php index 2436fd611..da6d95a78 100644 --- a/modules/comment/comment.admin.controller.php +++ b/modules/comment/comment.admin.controller.php @@ -117,7 +117,7 @@ class commentAdminController extends comment // send email to comment's author, all admins and thread(document) subscribers - START // ------------------------------------------------------- $oMail = new Mail(); - $mail_title = "[XE - " . $module_info->mid . "] comment(s) status changed to " . $new_status . " on document: \"" . $oDocument->getTitleText() . "\""; + $mail_title = "[Rhymix - " . $module_info->mid . "] comment(s) status changed to " . $new_status . " on document: \"" . $oDocument->getTitleText() . "\""; $oMail->setTitle($mail_title); $mail_content = " The comment #" . $comment_srl . " on document \"" . $oDocument->getTitleText() . "\" has been " . $new_status . " by admin of " . strtoupper($module_info->mid) . " module. diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 997f7c091..7d62bce1d 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -410,7 +410,7 @@ class commentController extends comment // determine the order $obj->list_order = getNextSequence() * -1; - // remove XE's own tags from the contents + // remove Rhymix's own tags from the contents $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); // if use editor of nohtml, Remove HTML tags from the contents. @@ -640,7 +640,7 @@ class commentController extends comment { $oMail = new Mail(); $oMail->setSender($obj->email_address, $obj->email_address); - $mail_title = "[XE - " . Context::get('mid') . "] A new comment was posted on document: \"" . $oDocument->getTitleText() . "\""; + $mail_title = "[Rhymix - " . Context::get('mid') . "] A new comment was posted on document: \"" . $oDocument->getTitleText() . "\""; $oMail->setTitle($mail_title); $url_comment = getFullUrl('','document_srl',$obj->document_srl).'#comment_'.$obj->comment_srl; if($using_validation) @@ -726,7 +726,7 @@ class commentController extends comment /* // send email to author - START $oMail = new Mail(); - $mail_title = "[XE - ".Context::get('mid')."] your comment on document: \"".$oDocument->getTitleText()."\" have to be approved"; + $mail_title = "[Rhymix - ".Context::get('mid')."] your comment on document: \"".$oDocument->getTitleText()."\" have to be approved"; $oMail->setTitle($mail_title); //$mail_content = sprintf("From : %s?document_srl=%s&comment_srl=%s#comment_%d
      \r\n%s ", getFullUrl(''),$comment->document_srl,$comment->comment_srl,$comment->comment_srl, getFullUrl(''),$comment->document_srl,$comment->comment_srl,$comment->comment_srl,$comment>content); $mail_content = " @@ -836,7 +836,7 @@ class commentController extends comment $obj->content = $source_obj->get('content'); } - // remove XE's wn tags from contents + // remove Rhymix's wn tags from contents $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); // if use editor of nohtml, Remove HTML tags from the contents. diff --git a/modules/editor/styles/ckeditor_light/editor.html b/modules/editor/styles/ckeditor_light/editor.html index 53452c962..976795b75 100755 --- a/modules/editor/styles/ckeditor_light/editor.html +++ b/modules/editor/styles/ckeditor_light/editor.html @@ -3,7 +3,7 @@ -XpressEngine +Rhymix diff --git a/modules/editor/styles/ckeditor_recommend/editor.html b/modules/editor/styles/ckeditor_recommend/editor.html index 53452c962..976795b75 100755 --- a/modules/editor/styles/ckeditor_recommend/editor.html +++ b/modules/editor/styles/ckeditor_recommend/editor.html @@ -3,7 +3,7 @@ -XpressEngine +Rhymix diff --git a/modules/editor/styles/default/editor.html b/modules/editor/styles/default/editor.html index 53452c962..976795b75 100755 --- a/modules/editor/styles/default/editor.html +++ b/modules/editor/styles/default/editor.html @@ -3,7 +3,7 @@ -XpressEngine +Rhymix diff --git a/modules/editor/styles/dreditor/editor.html b/modules/editor/styles/dreditor/editor.html index 53452c962..976795b75 100644 --- a/modules/editor/styles/dreditor/editor.html +++ b/modules/editor/styles/dreditor/editor.html @@ -3,7 +3,7 @@ -XpressEngine +Rhymix diff --git a/modules/editor/styles/xeStyle/editor.html b/modules/editor/styles/xeStyle/editor.html index 11d2c6a6c..62470095a 100755 --- a/modules/editor/styles/xeStyle/editor.html +++ b/modules/editor/styles/xeStyle/editor.html @@ -4,7 +4,7 @@ -XpressEngine +Rhymix diff --git a/modules/editor/styles/xeStyleBlack/editor.html b/modules/editor/styles/xeStyleBlack/editor.html index 11d2c6a6c..62470095a 100755 --- a/modules/editor/styles/xeStyleBlack/editor.html +++ b/modules/editor/styles/xeStyleBlack/editor.html @@ -4,7 +4,7 @@ -XpressEngine +Rhymix diff --git a/modules/file/lang/lang.xml b/modules/file/lang/lang.xml index 22d31a265..044ecfef3 100644 --- a/modules/file/lang/lang.xml +++ b/modules/file/lang/lang.xml @@ -201,16 +201,16 @@
      - - - - - - - - - - + + + + + + + + + + diff --git a/modules/importer/importer.admin.controller.php b/modules/importer/importer.admin.controller.php index 60c51da6b..0c48b430d 100644 --- a/modules/importer/importer.admin.controller.php +++ b/modules/importer/importer.admin.controller.php @@ -432,7 +432,7 @@ class importerAdminController extends importer $oMail->setTitle("Password update for your " . getFullSiteUrl() . " account"); $webmaster_name = $member_config->webmaster_name?$member_config->webmaster_name:'Webmaster'; $oMail->setContent("Dear $obj->user_name,

      - We recently migrated our phpBB forum to XpressEngine. Since you password was encrypted we could not migrate it too, so please reset it by following this link: + We recently migrated our phpBB forum to Rhymix. Since you password was encrypted we could not migrate it too, so please reset it by following this link: " . getFullSiteUrl() . "?act=dispMemberFindAccount. You need to enter you email address and hit the 'Find account' button. You will then receive an email with a new, generated password that you can change after login.

      Thank you for your understanding,
      diff --git a/modules/importer/lang/lang.xml b/modules/importer/lang/lang.xml index d2c0d0a0d..7996b1c74 100644 --- a/modules/importer/lang/lang.xml +++ b/modules/importer/lang/lang.xml @@ -26,27 +26,27 @@
      - + - + - - + + - - - - - + + + + + @@ -508,25 +508,25 @@ Hãy nhập đường dẫn cho File chứa Data trên Host dưới dạng http: - XML Exporter를 이용하면 XML파일로 변환할 수 있습니다.]]> - XML Exporter를 이용하면 XML파일로 변환할 수 있습니다.]]> + XML Exporter to convert the data you want into XML File.]]> - XML Exporterを利用して変換したい書き込みデータをXMLファイルで作成してアップロードしてください。]]> - XML Exporter生成XML文件后再上传。]]> - XML Exporter 建立 XML 檔案後再上傳。]]> - Exporteur de XML pour convertir les données en fichier de XML, et puis téléchargez-le.]]> - XML Экспортер (XML Exporter), чтобы конвертировать нужные данные в XML Файл и затем загрузить его.]]> - XML Exporter para transformar los datos en archivo XML, y luego subir ese archivo.]]> - XML DışAktarımcı'yı kullanıp istediğiniz veriyi XML türüne çevirmelisiniz.]]> - XML Exporter.]]> + XML Exporter.]]> 'Utility menu', 'list' => array( array( - 'menu_name' => 'XE Official Site', + 'menu_name' => 'Rhymix Official Site', 'is_shortcut' => 'Y', 'open_window' => 'Y', - 'shortcut_target' => 'http://www.xpressengine.com' + 'shortcut_target' => 'https://www.rhymix.org/' ), array( 'menu_name' => 'GitHub', 'is_shortcut' => 'Y', 'open_window' => 'Y', - 'shortcut_target' => 'https://github.com/xpressengine' + 'shortcut_target' => 'https://github.com/rhymix' ), ) ), @@ -269,7 +269,7 @@ $obj->email_address = $logged_info->email_address; $obj->module_srl = $module_srl; Context::set('version', __XE_VERSION__); -$obj->title = 'Welcome XE'; +$obj->title = 'Welcome Rhymix'; $obj->content = $oTemplateHandler->compile(_XE_PATH_ . 'modules/install/script/welcome_content', 'welcome_content_'.$lang); @@ -279,7 +279,7 @@ if(!$output->toBool()) return $output; $document_srl = $output->get('document_srl'); unset($obj->document_srl); -$obj->title = 'Welcome mobile XE'; +$obj->title = 'Welcome mobile Rhymix'; $output = $oDocumentController->insertDocument($obj, true); if(!$output->toBool()) return $output; diff --git a/modules/install/script/welcome_content/welcome_content_de.html b/modules/install/script/welcome_content/welcome_content_de.html index e82bea382..725a5b456 100644 --- a/modules/install/script/welcome_content/welcome_content_de.html +++ b/modules/install/script/welcome_content/welcome_content_de.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      - XE 시작하기 +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      + Rhymix 시작하기
      diff --git a/modules/install/script/welcome_content/welcome_content_en.html b/modules/install/script/welcome_content/welcome_content_en.html index e82bea382..725a5b456 100644 --- a/modules/install/script/welcome_content/welcome_content_en.html +++ b/modules/install/script/welcome_content/welcome_content_en.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      - XE 시작하기 +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      + Rhymix 시작하기
      diff --git a/modules/install/script/welcome_content/welcome_content_es.html b/modules/install/script/welcome_content/welcome_content_es.html index e82bea382..725a5b456 100644 --- a/modules/install/script/welcome_content/welcome_content_es.html +++ b/modules/install/script/welcome_content/welcome_content_es.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      - XE 시작하기 +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      + Rhymix 시작하기
      diff --git a/modules/install/script/welcome_content/welcome_content_fr.html b/modules/install/script/welcome_content/welcome_content_fr.html index e82bea382..725a5b456 100644 --- a/modules/install/script/welcome_content/welcome_content_fr.html +++ b/modules/install/script/welcome_content/welcome_content_fr.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      - XE 시작하기 +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      + Rhymix 시작하기
      diff --git a/modules/install/script/welcome_content/welcome_content_jp.html b/modules/install/script/welcome_content/welcome_content_jp.html index e82bea382..75d64ffc0 100644 --- a/modules/install/script/welcome_content/welcome_content_jp.html +++ b/modules/install/script/welcome_content/welcome_content_jp.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      XE 시작하기
      diff --git a/modules/install/script/welcome_content/welcome_content_ko.html b/modules/install/script/welcome_content/welcome_content_ko.html index e82bea382..725a5b456 100644 --- a/modules/install/script/welcome_content/welcome_content_ko.html +++ b/modules/install/script/welcome_content/welcome_content_ko.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      - XE 시작하기 +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      + Rhymix 시작하기
      diff --git a/modules/install/script/welcome_content/welcome_content_mn.html b/modules/install/script/welcome_content/welcome_content_mn.html index e82bea382..725a5b456 100644 --- a/modules/install/script/welcome_content/welcome_content_mn.html +++ b/modules/install/script/welcome_content/welcome_content_mn.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      - XE 시작하기 +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      + Rhymix 시작하기
      diff --git a/modules/install/script/welcome_content/welcome_content_ru.html b/modules/install/script/welcome_content/welcome_content_ru.html index e82bea382..725a5b456 100644 --- a/modules/install/script/welcome_content/welcome_content_ru.html +++ b/modules/install/script/welcome_content/welcome_content_ru.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      - XE 시작하기 +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      + Rhymix 시작하기
      diff --git a/modules/install/script/welcome_content/welcome_content_tr.html b/modules/install/script/welcome_content/welcome_content_tr.html index e82bea382..725a5b456 100644 --- a/modules/install/script/welcome_content/welcome_content_tr.html +++ b/modules/install/script/welcome_content/welcome_content_tr.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      - XE 시작하기 +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      + Rhymix 시작하기
      diff --git a/modules/install/script/welcome_content/welcome_content_vi.html b/modules/install/script/welcome_content/welcome_content_vi.html index e82bea382..725a5b456 100644 --- a/modules/install/script/welcome_content/welcome_content_vi.html +++ b/modules/install/script/welcome_content/welcome_content_vi.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      - XE 시작하기 +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      + Rhymix 시작하기
      diff --git a/modules/install/script/welcome_content/welcome_content_zh-CN.html b/modules/install/script/welcome_content/welcome_content_zh-CN.html index e82bea382..725a5b456 100644 --- a/modules/install/script/welcome_content/welcome_content_zh-CN.html +++ b/modules/install/script/welcome_content/welcome_content_zh-CN.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      - XE 시작하기 +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      + Rhymix 시작하기
      diff --git a/modules/install/script/welcome_content/welcome_content_zh-TW.html b/modules/install/script/welcome_content/welcome_content_zh-TW.html index e82bea382..725a5b456 100644 --- a/modules/install/script/welcome_content/welcome_content_zh-TW.html +++ b/modules/install/script/welcome_content/welcome_content_zh-TW.html @@ -2,8 +2,8 @@
      WELCOME TO -

      WELCOME TO XPRESSENGINE

      -

      XpressEngine은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      - XE 시작하기 +

      WELCOME TO Rhymix

      +

      Rhymix은 자유로운 웹 콘텐츠 발행을 돕는 CMS입니다.
      간편한 설치와 다양한 추가 프로그램을 활용하여
      자신만의 웹페이지를 쉽고 빠르게 만들 수 있습니다.

      + Rhymix 시작하기
      diff --git a/modules/install/script/xeicon_content/xeicon_content_ko_2.html b/modules/install/script/xeicon_content/xeicon_content_ko_2.html index d77b38188..1960dd38b 100644 --- a/modules/install/script/xeicon_content/xeicon_content_ko_2.html +++ b/modules/install/script/xeicon_content/xeicon_content_ko_2.html @@ -14,7 +14,7 @@
    • 최적화

      -

      XpressEngine 뿐 아니라, 다양한 프레임워크에서 동일하게 구현됩니다. 여러 환경에서 자유롭게 이용해보세요!

      +

      Rhymix 뿐 아니라, 다양한 프레임워크에서 동일하게 구현됩니다. 여러 환경에서 자유롭게 이용해보세요!

    • diff --git a/modules/layout/lang/lang.xml b/modules/layout/lang/lang.xml index cd8aab430..edb3d8000 100644 --- a/modules/layout/lang/lang.xml +++ b/modules/layout/lang/lang.xml @@ -893,13 +893,13 @@ - - - - - - - + + + + + + + 아래 그림을 보고 구성요소와 기능을 이용하여 원하는 레이아웃을 만드세요.]]> diff --git a/modules/layout/tpl/faceOff_sample.tar b/modules/layout/tpl/faceOff_sample.tar index bdea263f415fdb9fc0a97cebdea17da13c23c8aa..b36810cdb2b76a3bc9c25910e6ea69a42d5ebd0b 100755 GIT binary patch delta 2580 zcmZ{mdsNiN6~}+O%i=OHbr%ojITabF|U8^CWVv4k&qU@miDKLM63fwdy2s|=jCur~p082f%zSX0193|>E&LV10^BfT? zDak1+TwXFqm6MQPvMRqqMM-XHQB^TC`MLP8|84N5Xvn8s0*7|LsUi`vk0_Z40W(yy zMTC8%@&*s65}|phGJ>&cHMmUe?@7svMaN4%3F!S{*U-}m=bjzPdc0`UWXg7_<6!ZH zdKySI@4`P?vmf$bHCbSk|70-BzY)CcACA%S0ez5<2bdv81P&vU$AL~_s9ppw1D8&j z0o6xSypSBTO)Uq#LZ)LNIb>1di>E-{3;fB7G z_v;RS4mbskiAQXRSK zUfL9VxXpXY3ro_~aCtY~2Kh$19`Yn(JeX|^bED+yocX28U$h)O@#u?V*R#Gu8dl>h zOvt{>_!u!d7IyQ1;h87#@gTF32Yf#(7yMn83Dp)Sn$r&_rVb3Pyq$la+Cvxb7bDrR zC8d0+2`1jd?WRF6F2~n_gfPl-au#Cfcuo}T9_HNRQ{Bv+3X1ZEai|3I9vNky=4qh$ zIuG4%C;7QNX7O@W|~&xTV}kFl(^Gd)~u8DQueZ}5`oIgdBgXY zmw*#0+Vzx#?Cr~=BqFE)4BxSOn$%l%-n}49nSNrkW1e9}q|vKY)w1D(_+uDW%v40V z8xLJLUoqw&3)L6|?HgJ&zRDk%BO4#|?vySFS-%PzSnj@uhS>+D=M}XtFsubj6tkR==@#gYtr{?akNR@ny*{Z6r;ghPXdCl2s8|-G) zM2{mW&9ckzTvM|a`hVB>Ig{PN1w(0di+}J#OV$>lj|82djBsq7*tXRy6WnF6-dW2F zFj~75A+>ATdB{)Ku0o#8a)-9$h!A~piZt=AKV?bl))E9Lz^?KnF03=a)U_@He))9~ zA~Z$3MT~)-^#;hY1%fiYt;wrZDP=D8<6%0nKFWuZmdA6aEsjohtrT1LH3^G~-jUkA zNf6SHnkXx-_rgjx)*};kr#`@wTsR^-WRYJqW4>TiG<<7^UXaUM72Yt2GRI4?Yf=}c z7@UaS(X}evBzw%19W~>YV7JV%;5!Y0U~B`987pjV{bH4 zrMS@@idRkkmYA14X{g8AxZ%E5g_ny+$B)5l3%09~PkFmB2J~u*0@IrwVL`DQ;vkzh z_(R^m;W6axAMz_{&c->A*KFj6YX8QsdH>s6HYM-^Tx-S~V0YMD&d+hxmMdWV)*E=5 zgb$}A{khjP(q#Q0MbWm85{c2fN9{sMlI*+QqziITgN+#hura2GqDH;Y6%xjTSm8iiooA#KUXz?p?1 z(-`(IP`fPx%-!}4cH_E!tctP)?FLtpmGlq&9>L7}x4gKb#WRET4k}xf&TOomm*8c) zmmAr=;*9Bf_;KS3%|YX54T>vP%7Qvl6=ZhG9|Qf$o=lnXQnF=p3of{(j%dCY!`t~a z@L+qc8}U8e?|1%=kB{xy{r4&q((1L8Wp}DD+R&-d^34%`D#ijVkk{{(0*60HDf~?4 zW9(ArbgbaV&Mt8Kj!|d|cK!!)eiv$Eciwf9&;9$|$H3}tem4wutH7(>ap3r#mEfA5 z6dc@UXSvLVox++itBl&mdbaXg&(!-qc(%6?Ww`idxnILT-%4L?wlP`#yf5(X*3Ue> zW21k2=OJYYdrdI3?ln_V>s`>0vDs&0V}T=OS}RUDvs(G`N3FkxO~}4_@Zi4d$gpnz ze4gRuzV*|8n)q$8-?rrc)3A#E68L`A9}c?PQn3n$R)3|dzQE$p=&eNUDJ!%2I1zoA zN;m4H#3f@(^CbGo!q~PyY(vwjbl2Jp!Zr5lv3+9W&urQOABqMPa0FkIRUY8~J#-x? d24w?y0_+P19*G=~EkD96d(e^J9D`kw{{amB3IqTE delta 2023 zcmZ{kdsI_L0>bknM)w;St>z@5*=Z~2?-^|?m-EV#~ zC%@*cf8~$7kh@O}4PCu@bx2u}#aL2eG%e3F8AGzog&3}gRxElWit%q$W%QzWwn*V5 z;V8ztE3w7Z2VJhGkmaVtCN~ZG+?oWcT4pw{G+Hpx-5cgnN=K?%YR)M~zpE0bMin8* zUCmP6&+%hvRzco!({yFlOryy@UrDpg1*L^{!I-V2OwoUvV~$?+64v4q#IZ{vI4n_4 z^ZY~{9@C@c$yGti3ljz-9ICc|BHnYbPLSc4G7is`1|+LgC{p>k(VyS{$aK%zjmP;unr_{$054Z^hhk15BoI z;^7{+6l(&*SYMzAhl@eQm=Zh@`N3mD>8^)5HE#`bKElg8Gks+vGsP+!ec&`>gcA{Y ztDF+Pl6vTDsYH?zL#o(7a4m8IvI;XHK+^~(GmKO(Q->#cyEEuqf)pf@S~i0 zViRwWtD|H%G$CnNqDZ8K5WJqy%33G-ah>PGI9!;NN>6uQyYg!8vsdF1;TygjHR0z* zP(pa3k-OT+D59{EE3q_!bA)grdlAWTcsZrc zK@z5x0aH`(x2frfit57GQOzz3&N_I`PV2AiI(~m$|LcSEp=hL&HS)BPE<>RdL`s0#&kLG`6 zyw4gIAK+PZhFOCCOar*A57D3H%?AU6S!wWF8p%FbdXIxXCkQKZ2Bef&+XX}#)yOca zSfw$WXWuNhGgzKi#-8L&;}DvkjEeknJj*|U!vza5tZ)z73M24EVV?bT%rxbo#}tR} zO(F0ys}W<4#U^tuzBeyKe9=~1E2=_jv74UPHwY2iWY|R5?8`Ovb^t0?y3lI5!_L{-VEybQ zY1~~u{7|u0pd{BGhW%q})+OTny7_GMdMziVu{NF{Z9^hjH%!9K4UurRdV0_ZWwN|J z!|y%)x6=4b>u(5Yw+^k9L1)cCtJUA_@?oLRCjV?m4Tz!P+jr}UTwbT}#4~HGBh^WV z6R}R=!BbtGVkF;gMR8>Snk#4EtIBaa73@Rsu5v+0)f6q&X^69$bPR3P{}v75sP3I0 z75OSx?hQ6?+1Xdsg6NIvUr5T^I0FYaM&rAUk?`I02=dJ_Fl_ci+2$w6-_j-Ads)`1 zw2F31qY<`sEK;`yp9h4>PXy85HndjUO-x0lOZq$hlO2xHKcfTOw$;?iSoxl*9F8@F z;7&uf!uxc$&!szFUOhkEkGCkKtJWgDQHhF1wZHxMh@A)f8BDcT_E?9yRMd#%zfX1< z*BdA9Y-&bJ(+!xK|BZr{E;e%SaSm5nkHOkD8OPg{__8eqUhVm)ZcnmP=PVa`hPLd@ zyV*DG+c{V|KERERJVbSRVNqu$PIg+I%RO@|=ht|RsmgUk!v0d6*&l)j`+tR52R7j1 zft#$UYc7ZT-Rm{)vTc9s_WyR#*kgilFdWklCd;Wqou4>DpKEid@)YH+9GVY$4bx9j z>TWoRICn6`Rqsn~?K;0pCQ<4JcP5fS4BgG@-gK<*^`ca;v;L++cdrJ6y@iNAl+3mr Vdc;X68A9B#o!EmSthKLM@*il( - + - + diff --git a/modules/menu/lang/lang.xml b/modules/menu/lang/lang.xml index db5952373..2fb81254e 100644 --- a/modules/menu/lang/lang.xml +++ b/modules/menu/lang/lang.xml @@ -987,12 +987,12 @@ Menu không phải là người quản lý, nhiệm vụ của nó chỉ là li - - + + - - + + diff --git a/modules/module/lang/lang.xml b/modules/module/lang/lang.xml index fdf5e9ebb..42d7ef4f9 100644 --- a/modules/module/lang/lang.xml +++ b/modules/module/lang/lang.xml @@ -369,26 +369,26 @@ - - - - - - - - + + + + + + + + - - - - - - - - - - + + + + + + + + + + @@ -930,20 +930,20 @@ - - - - - - + + + + + - - - - + @@ -1004,10 +1004,10 @@ Le module [Administration des Modules] montera tous les modules installés et vo - - - - + + + + diff --git a/modules/page/lang/lang.xml b/modules/page/lang/lang.xml index aa31ff0c8..453b69644 100644 --- a/modules/page/lang/lang.xml +++ b/modules/page/lang/lang.xml @@ -128,10 +128,10 @@ -
    • 위젯형 : 여러가지 위젯들을 생성하여 화면을 구성합니다.
    • 문서형 : 제목, 내용, 태그를 갖는 문서를 제작하여 포스팅 형식의 페이지를 작성합니다.
    • 외부페이지형 : 외부 HTML 또는 PHP 파일을 XE에서 사용할 수 있습니다.
    • ]]>
      -
    • Widget: Create multiple widgets.
    • Article: Create articles with titles, contents and tags for posting page.
    • External Page: Use external HTML or PHP files in XE.
    • ]]>
      -
    • ウィジェット型 : いろんなウィジェットを生成して画面を構成します。
    • ドキュメント型 : タイトル、内容、タグのあるドキュメントを製作して、投稿形式のページを作成します。
    • 外部ページ型 : 外部HTML、またはPHPファイルをXEで使用できます。]]> -
    • Widget 頁面:是以 widgets 為主所建立的頁面。
    • 主題頁面:可建立頁面的主題、內容及標簽。
    • 外連頁面:在 XE 中使用外部 HTML 或 PHP 檔案。
    • ]]>
      +
    • 위젯형 : 여러가지 위젯들을 생성하여 화면을 구성합니다.
    • 문서형 : 제목, 내용, 태그를 갖는 문서를 제작하여 포스팅 형식의 페이지를 작성합니다.
    • 외부페이지형 : 외부 HTML 또는 PHP 파일을 Rhymix에서 사용할 수 있습니다.
    • ]]>
      +
    • Widget: Create multiple widgets.
    • Article: Create articles with titles, contents and tags for posting page.
    • External Page: Use external HTML or PHP files in Rhymix.
    • ]]>
      +
    • ウィジェット型 : いろんなウィジェットを生成して画面を構成します。
    • ドキュメント型 : タイトル、内容、タグのあるドキュメントを製作して、投稿形式のページを作成します。
    • 外部ページ型 : 外部HTML、またはPHPファイルをRhymixで使用できます。]]> +
    • Widget 頁面:是以 widgets 為主所建立的頁面。
    • 主題頁面:可建立頁面的主題、內容及標簽。
    • 外連頁面:在 Rhymix 中使用外部 HTML 或 PHP 檔案。
    • ]]>
      @@ -140,14 +140,14 @@ - - - + + + - - - + + + @@ -156,9 +156,9 @@ - - - + + + diff --git a/modules/point/lang/lang.xml b/modules/point/lang/lang.xml index 5bfe2ec1b..f46f40ac0 100644 --- a/modules/point/lang/lang.xml +++ b/modules/point/lang/lang.xml @@ -60,14 +60,14 @@ - - - - - - - - + + + + + + + + diff --git a/modules/widget/lang/lang.xml b/modules/widget/lang/lang.xml index af32dbce1..45368585f 100644 --- a/modules/widget/lang/lang.xml +++ b/modules/widget/lang/lang.xml @@ -378,25 +378,25 @@ +Rhymix의 페이지나 레이아웃 모듈을 사용하지 않더라도 [코드생성] 기능을 통해 직접 위젯 추가도 할 수 있습니다.]]> - + You can directly add a widget by using the [Generate Code] function without using the Rhymix page module or layout module.]]> + +即使不使用Rhymix的页面模块或布局模块,也可以通过『代码生成』功能直接可以添加相应控件。]]> +即使不使用 Rhymix 的頁面或版面設計模組,也可以通過『建立原始碼』功能直接新增相對應 Widget。]]> +Vous pouvez directement ajouter un gadget en utilisant la fonction [Générer le Code] sans utiliser un module de Page de Rhymix ni un module de Mise en Page.]]> +Sin la necesidad de utilizar los módulos de página o del diseño de Rhymix, Usted puede directamente añadir un widget usando la función de [Generar Códigos].]]> + [Kod Üret] fonksiyonunu kullanarak, Rhymix sayfa modülüne veya yerleşim düzeni modülüne ihtiyaç duymadan widget ekleyebilirsiniz.]]> Nó có thể kết nối với những Module trong Website hay Open API bên ngoài và hiển thị nội dung của Module đó.
      Thông qua sự thiết lập cấu hình, nó có thể là một ứng dụng rộng dãi.
      Bạn có thể thêm một Widget bằng cách bấm nút [Tạo Code] để lấy Code thêm vào một Module hay trang nào đó.]]>
      From 8dc8eeeb76f80b0bec766f7d78d6faec5be42f73 Mon Sep 17 00:00:00 2001 From: conory Date: Mon, 25 Jan 2016 18:23:52 +0900 Subject: [PATCH 37/53] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EC=84=A0=EC=8A=A4=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/admin/lang/lang.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/admin/lang/lang.xml b/modules/admin/lang/lang.xml index 51d8b08f5..ad444f9b2 100644 --- a/modules/admin/lang/lang.xml +++ b/modules/admin/lang/lang.xml @@ -598,16 +598,16 @@ - - - - - - - - - - + + + + + + + + + + From 524cb781156be1f93a217f5e5777093542263736 Mon Sep 17 00:00:00 2001 From: MinSoo Kim Date: Mon, 25 Jan 2016 21:45:02 +0900 Subject: [PATCH 38/53] =?UTF-8?q?default=20=EC=84=A4=EB=AC=B8=EC=A1=B0?= =?UTF-8?q?=EC=82=AC=20=EC=8A=A4=ED=82=A8=EC=9D=98=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=A6=BD=ED=8A=B8=20=EB=8B=A4=EB=93=AC=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/rhymix/rhymix/pull/156 1. 사용하지 않는 스크립트 삭제. 2. onclick event 를 적용할 때 jQuery 를 한번 더 거치는 것은 비효율적이라 생각해서 직접 적용. 3. 스크립트 함수명이 simple 스킨과 겹쳐서 생길 수 있는 문제 회피 4. CSS display 속성을 단일화 해서 제어하도록 함수 내에 내장. ( simple 스킨과 함수명을 공유하지 않기 때문에 가능 ) --- widgets/pollWidget/skins/default/js/poll.js | 129 ++++-------------- .../pollWidget/skins/default/pollview.html | 39 ++---- 2 files changed, 44 insertions(+), 124 deletions(-) diff --git a/widgets/pollWidget/skins/default/js/poll.js b/widgets/pollWidget/skins/default/js/poll.js index c86e92b8f..8416b1c08 100644 --- a/widgets/pollWidget/skins/default/js/poll.js +++ b/widgets/pollWidget/skins/default/js/poll.js @@ -26,7 +26,7 @@ function initRxDefaultTemplete(type, poll_srl) } } /* 설문 참여 함수 */ -function doPoll(fo_obj) { +function doRxDefaultPoll(fo_obj) { var checkcount = new Array(); var item = new Array(); @@ -86,7 +86,7 @@ function doPoll(fo_obj) { } /* 항목 추가 함수 */ -function addItem(poll_srl,poll_srl_indexes) { +function addRxDefaultItem(poll_srl,poll_srl_indexes) { jQuery.exec_json("poll.procPollInsertItem", {"srl":poll_srl,"index_srl":poll_srl_indexes,"title":jQuery("#new_item_" + poll_srl_indexes).val()}, function(data){ if(data.error!=0) alert(data.message); else @@ -110,7 +110,7 @@ function addItem(poll_srl,poll_srl_indexes) { } /* 항목 삭제 함수 */ -function deleteItem(poll_srl,poll_srl_indexes,poll_item_srl) { +function deleteRxDefaultItem(poll_srl,poll_srl_indexes,poll_item_srl) { jQuery.exec_json("poll.procPollDeleteItem", {"srl":poll_srl,"index_srl":poll_srl_indexes,"item_srl":poll_item_srl}, function(data){ if(data.error!=0) alert(data.message); else @@ -245,20 +245,15 @@ function showRxDefaultPollMember(poll_srl,poll_item_srl) jQuery("#poll_content_" + poll_srl + "_result").html(html); - jQuery("#poll_" + poll_srl + "_gotoresult_button").css({ - display: "block" - }); + jQuery("#poll_" + poll_srl + '_result_button').css({ + display: "none" + }); + jQuery("#poll_" + poll_srl + '_gotoresult_button').css({ + display: "block" + }); + }); - jQuery("#poll_" + poll_srl + "_result_nobutton").css({ - display: "none" - }); - - jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ - display: "block" - }); - }); - - return false; + return false; } function loadRxDefaultPollResult(poll_srl,data) @@ -317,88 +312,22 @@ function loadRxDefaultPollResult(poll_srl,data) jQuery("#poll_" + poll_srl + '_result').css({ display: "block" }); + + // do not display back to result button, because, this is that page. + jQuery("#poll_" + poll_srl + '_gotoresult_button').css({ + display: "none" + }); + + // Check if the user have voted or not. If xe (he or she) have done, do not display back to the poll button + if(data.poll.is_polled==0){ + jQuery("#poll_" + poll_srl + '_result_button').css({ + display: "block" + }); + } + else{ + jQuery("#poll_" + poll_srl + '_result_button').css({ + display: "none" + }); + } } -} - -jQuery(function($){ - /* View poll result */ - $('._rx_default_poll_result').click(function(){ - var cls = $(this).attr('class'), srl, skin; - - try{ - srl = cls.match(/\b_srl_(\d+)\b/)[1]; - }catch(e){ }; - - if(!srl) return false; - - jQuery("#poll_" + srl + "_result_button").css({ - display: "block" - }); - - jQuery("#poll_" + srl + "_result_nobutton").css({ - display: "none" - }); - - jQuery("#poll_" + srl + "_result_yesbutton").css({ - display: "block" - }); - - loadRxDefaultPollResult(srl); - - return false; - }); - - /* goto poll result */ - $('._rx_default_gotoresult_screen').click(function(){ - var cls = $(this).attr('class'), srl, skin; - - try{ - srl = cls.match(/\b_srl_(\d+)\b/)[1]; - }catch(e){ }; - - if(!srl) return false; - - jQuery("#poll_" + srl + "_gotoresult_button").css({ - display: "none" - }); - - jQuery("#poll_" + srl + "_result_nobutton").css({ - display: "block" - }); - - jQuery("#poll_" + srl + "_result_yesbutton").css({ - display: "none" - }); - - loadRxDefaultPollResult(srl); - - return false; - }); - - /* View poll screen */ - $('._rx_default_poll_screen').click(function(){ - var cls = $(this).attr('class'), srl, skin; - - try{ - srl = cls.match(/\b_srl_(\d+)\b/)[1]; - }catch(e){ }; - - if(!srl) return false; - - jQuery("#poll_" + srl + "_result_button").css({ - display: "none" - }); - - jQuery("#poll_" + srl + "_result_nobutton").css({ - display: "block" - }); - - jQuery("#poll_" + srl + "_result_yesbutton").css({ - display: "none" - }); - - loadRxDefaultPoll(srl); - - return false; - }); -}); +} \ No newline at end of file diff --git a/widgets/pollWidget/skins/default/pollview.html b/widgets/pollWidget/skins/default/pollview.html index d7f32c116..64fb38358 100644 --- a/widgets/pollWidget/skins/default/pollview.html +++ b/widgets/pollWidget/skins/default/pollview.html @@ -4,23 +4,9 @@ var poll_checkcount_lang = "{$lang->poll_checkcount}"; var poll_member_lang = "{$lang->poll_item_members}"; jQuery(document).ready(function(){ - var data = {json_encode($poll_data)}; - if(data.poll.is_polled==0) loadRxDefaultPoll({$poll_srl},data); - else - { - loadRxDefaultPollResult({$poll_srl},data); - jQuery("#poll_{$poll_srl}_result_button").css({ - display: "none" - }); - - jQuery("#poll_{$poll_srl}_result_nobutton").css({ - display: "block" - }); - - jQuery("#poll_{$poll_srl}_result_yesbutton").css({ - display: "none" - }); - } + var data = {json_encode($poll_data)}; + if(data.poll.is_polled==0) loadRxDefaultPoll({$poll_srl},data); + else loadRxDefaultPollResult({$poll_srl},data); });
      @@ -48,13 +34,13 @@ {{item.title}} {{#if item.my_item}} - + {{/if}}
      {{/each}} {{#if question.additem}}
      - +
      {{/if}} @@ -63,7 +49,7 @@

      {$XE_VALIDATOR_MESSAGE}

      -
      + @@ -80,8 +66,8 @@
      - - + +
    @@ -122,7 +108,7 @@ {{/if}} {{/each}} {{#if isPage}} - + {{/if}}
    @@ -141,7 +127,12 @@
    + From 4de10a74f26b35643f5c148cc38e235022caa6b7 Mon Sep 17 00:00:00 2001 From: conory Date: Mon, 25 Jan 2016 21:46:50 +0900 Subject: [PATCH 39/53] =?UTF-8?q?=ED=83=9C=EA=B7=B8=EC=97=90=EC=84=9C=20ac?= =?UTF-8?q?t=20=EA=B0=80=20=ED=8F=AC=ED=95=A8=EB=90=9C=20url=EC=9D=B4=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=EB=90=98=EC=A7=80=EC=95=8A=EB=8F=84=EB=A1=9D?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/legacy.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/common/legacy.php b/common/legacy.php index 9f95b773b..debae0689 100644 --- a/common/legacy.php +++ b/common/legacy.php @@ -1123,24 +1123,6 @@ function removeSrcHack($match) } } - $filter_arrts = array('style', 'src', 'href'); - - if($tag === 'object') array_push($filter_arrts, 'data'); - if($tag === 'param') array_push($filter_arrts, 'value'); - - foreach($filter_arrts as $attr) - { - if(!isset($attrs[$attr])) continue; - - $attr_value = rawurldecode($attrs[$attr]); - $attr_value = htmlspecialchars_decode($attr_value, ENT_COMPAT); - $attr_value = preg_replace('/\s+|[\t\n\r]+/', '', $attr_value); - if(preg_match('@(\?|&|;)(act=)@i', $attr_value)) - { - unset($attrs[$attr]); - } - } - if(isset($attrs['style']) && preg_match('@(?:/\*|\*/|\n|:\s*expression\s*\()@i', $attrs['style'])) { unset($attrs['style']); From 713c5bc445a0f8f671bdc297dfda9b2cca94bfaf Mon Sep 17 00:00:00 2001 From: MinSoo Kim Date: Mon, 25 Jan 2016 22:13:55 +0900 Subject: [PATCH 40/53] Follow the rule. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 코딩 규칙에 따라 스크립트 수정 --- widgets/pollWidget/skins/default/js/poll.js | 119 +++++++++--------- .../pollWidget/skins/default/pollview.html | 10 +- widgets/pollWidget/skins/simple/pollview.html | 2 +- 3 files changed, 68 insertions(+), 63 deletions(-) diff --git a/widgets/pollWidget/skins/default/js/poll.js b/widgets/pollWidget/skins/default/js/poll.js index 8416b1c08..c8baa9760 100644 --- a/widgets/pollWidget/skins/default/js/poll.js +++ b/widgets/pollWidget/skins/default/js/poll.js @@ -3,21 +3,21 @@ function initRxDefaultTemplete(type, poll_srl) switch(type) { case 'poll': - if(typeof window.template == 'undefined') + if (typeof window.template == 'undefined') { var source = jQuery("#entry-template-" + poll_srl).html(); window.template = Handlebars.compile(source); } break; case 'result': - if(typeof window.template_result == 'undefined') + if (typeof window.template_result == 'undefined') { var source = jQuery("#entry-template-result-" + poll_srl).html(); window.template_result = Handlebars.compile(source); } break; case 'members': - if(typeof window.template_member == 'undefined') + if (typeof window.template_member == 'undefined') { var source = jQuery("#entry-template-members-" + poll_srl).html(); window.template_member = Handlebars.compile(source); @@ -27,32 +27,37 @@ function initRxDefaultTemplete(type, poll_srl) } /* 설문 참여 함수 */ function doRxDefaultPoll(fo_obj) { - var checkcount = new Array(); var item = new Array(); - for(var i=0;i-1) { + if (name.indexOf('checkcount') > -1) { var t = name.split('_'); - var poll_srl_index = parseInt(t[1],10); + var poll_srl_index = parseInt(t[1], 10); checkcount[poll_srl_index] = obj.value; item[poll_srl_index] = new Array(); - } else if(name.indexOf('item_')>-1) { + } else if (name.indexOf('item_') > -1) { var t = name.split('_'); - var poll_srl = parseInt(t[1],10); - var poll_srl_index = parseInt(t[2],10); - if(obj.checked == true) item[poll_srl_index][item[poll_srl_index].length] = obj.value; + var poll_srl = parseInt(t[1], 10); + var poll_srl_index = parseInt(t[2], 10); + if (obj.checked == true) { + item[poll_srl_index][item[poll_srl_index].length] = obj.value; + } } } var poll_srl_indexes = ""; for(var poll_srl_index in checkcount) { - if(!checkcount.hasOwnProperty(poll_srl_index)) continue; + if(!checkcount.hasOwnProperty(poll_srl_index)) { + continue; + } var count = checkcount[poll_srl_index]; var items = item[poll_srl_index]; if(items.length < 1 || count < items.length) { @@ -65,9 +70,10 @@ function doRxDefaultPoll(fo_obj) { fo_obj.poll_srl_indexes.value = poll_srl_indexes; jQuery.exec_json("poll.procPoll", {"poll_srl":poll_srl,"poll_srl_indexes":poll_srl_indexes}, function(data){ - if(data.error!=0) alert(data.message); - else - { + if (data.error != 0) { + alert(data.message); + } + else { loadRxDefaultPollResult(poll_srl); jQuery("#poll_" + poll_srl + "_gotoresult_button").css({ display: "none" @@ -86,11 +92,12 @@ function doRxDefaultPoll(fo_obj) { } /* 항목 추가 함수 */ -function addRxDefaultItem(poll_srl,poll_srl_indexes) { - jQuery.exec_json("poll.procPollInsertItem", {"srl":poll_srl,"index_srl":poll_srl_indexes,"title":jQuery("#new_item_" + poll_srl_indexes).val()}, function(data){ - if(data.error!=0) alert(data.message); - else - { +function addRxDefaultItem(poll_srl, poll_srl_indexes) { + jQuery.exec_json("poll.procPollInsertItem", {"srl":poll_srl, "index_srl":poll_srl_indexes, "title":jQuery("#new_item_" + poll_srl_indexes).val()}, function(data){ + if (data.error!=0) { + alert(data.message); + } + else { jQuery("#poll_" + poll_srl + "_result_button").css({ display: "none" }); @@ -110,11 +117,12 @@ function addRxDefaultItem(poll_srl,poll_srl_indexes) { } /* 항목 삭제 함수 */ -function deleteRxDefaultItem(poll_srl,poll_srl_indexes,poll_item_srl) { - jQuery.exec_json("poll.procPollDeleteItem", {"srl":poll_srl,"index_srl":poll_srl_indexes,"item_srl":poll_item_srl}, function(data){ - if(data.error!=0) alert(data.message); - else - { +function deleteRxDefaultItem(poll_srl, poll_srl_indexes, poll_item_srl) { + jQuery.exec_json("poll.procPollDeleteItem", {"srl":poll_srl, "index_srl":poll_srl_indexes, "item_srl":poll_item_srl}, function(data){ + if (data.error!=0) { + alert(data.message); + } + else { jQuery("#poll_" + poll_srl + "_result_button").css({ display: "none" }); @@ -133,19 +141,17 @@ function deleteRxDefaultItem(poll_srl,poll_srl_indexes,poll_item_srl) { return false; } -function loadRxDefaultPoll(poll_srl,data) +function loadRxDefaultPoll(poll_srl, data) { - if(typeof data == 'undefined') - { + if (typeof data == 'undefined') { jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){ - loadRxDefaultPoll(parseInt(data.poll.poll_srl),data); + loadRxDefaultPoll(parseInt(data.poll.poll_srl), data); }); } - else - { + else { jQuery("#stop_date_"+poll_srl).html(data.poll.stop_date); - initRxDefaultTemplete('poll',poll_srl); + initRxDefaultTemplete('poll', poll_srl); var template = window.template; var context = Object; var additem = data.caniadditem; @@ -158,7 +164,7 @@ function loadRxDefaultPoll(poll_srl,data) context.questions[i].title = poll.title; context.questions[i].items = poll.item; context.questions[i].poll_srl = poll_srl; - context.questions[i].isMultipleChoice = (poll.checkcount>1); + context.questions[i].isMultipleChoice = (poll.checkcount > 1); context.questions[i].additem = additem; } var html = template(context); @@ -174,24 +180,23 @@ function loadRxDefaultPoll(poll_srl,data) } } -function showRxDefaultPollMemberNext(poll_srl,poll_item_srl) +function showRxDefaultPollMemberNext(poll_srl, poll_item_srl) { - if(typeof window.cur_page == 'undefined') - { + if (typeof window.cur_page == 'undefined') { window.cur_page = 1; } window.cur_page++; - jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl,"poll_item":poll_item_srl,"page":window.cur_page}, function(data){ - initRxDefaultTemplete('members',poll_srl); + jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl, "poll_item":poll_item_srl, "page":window.cur_page}, function(data){ + initRxDefaultTemplete('members', poll_srl); var template = window.template_member; var context = Object; context.poll_srl = poll_srl; context.poll_item_srl = poll_item_srl; context.page = window.cur_page; - context.isPage = ((data.page.total_count>5) && (window.cur_page 5) && (window.cur_page < data.page.total_page)); context.members = {}; @@ -213,21 +218,21 @@ function showRxDefaultPollMemberNext(poll_srl,poll_item_srl) return false; } -function showRxDefaultPollMember(poll_srl,poll_item_srl) +function showRxDefaultPollMember(poll_srl, poll_item_srl) { window.cur_page = 1; - jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl,"poll_item":poll_item_srl,"page":window.cur_page}, function(data){ - initRxDefaultTemplete('members',poll_srl); + jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl, "poll_item":poll_item_srl, "page":window.cur_page}, function(data){ + initRxDefaultTemplete('members', poll_srl); var template = window.template_member; var context = Object; var title = poll_member_lang; - title = title.replace("%s",data.item.title); + title = title.replace("%s", data.item.title); var html = '
    ' + title + '
      '; context.poll_srl = poll_srl; context.poll_item_srl = poll_item_srl; context.page = window.cur_page; - context.isPage = ((data.page.total_count>5) && (window.cur_page 5) && (window.cur_page < data.page.total_count)); context.members = {}; @@ -256,20 +261,18 @@ function showRxDefaultPollMember(poll_srl,poll_item_srl) return false; } -function loadRxDefaultPollResult(poll_srl,data) +function loadRxDefaultPollResult(poll_srl, data) { - if(typeof data == 'undefined') - { + if (typeof data == 'undefined') { jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){ - loadRxDefaultPollResult(parseInt(data.poll.poll_srl),data); + loadRxDefaultPollResult(parseInt(data.poll.poll_srl), data); }); } - else - { + else { jQuery("#stop_date_result_" + poll_srl).html(data.poll.stop_date); jQuery("#poll_count_result_" + poll_srl).html(data.poll.poll_count); - initRxDefaultTemplete('result',poll_srl); + initRxDefaultTemplete('result', poll_srl); var template = window.template_result; var context = Object; var showMembers = (data.poll.poll_type==1 || data.poll.poll_type==3); @@ -287,13 +290,11 @@ function loadRxDefaultPollResult(poll_srl,data) for (var j in poll.item) { var item = poll.item[j]; count++; - if(poll.poll_count>0) - { + if (poll.poll_count > 0) { context.questions[i].items[j].per = Math.round((item.poll_count / poll.poll_count)*100); context.questions[i].items[j].isVote = true; } - else - { + else { context.questions[i].items[j].per = 0; context.questions[i].items[j].isVote = false; } @@ -301,7 +302,7 @@ function loadRxDefaultPollResult(poll_srl,data) } context.questions[i].items = poll.item; context.questions[i].poll_srl = poll_srl; - context.questions[i].isMultipleChoice = (poll.checkcount>1); + context.questions[i].isMultipleChoice = (poll.checkcount > 1); } var html = template(context); @@ -319,12 +320,12 @@ function loadRxDefaultPollResult(poll_srl,data) }); // Check if the user have voted or not. If xe (he or she) have done, do not display back to the poll button - if(data.poll.is_polled==0){ + if (data.poll.is_polled == 0) { jQuery("#poll_" + poll_srl + '_result_button').css({ display: "block" }); } - else{ + else { jQuery("#poll_" + poll_srl + '_result_button').css({ display: "none" }); diff --git a/widgets/pollWidget/skins/default/pollview.html b/widgets/pollWidget/skins/default/pollview.html index 64fb38358..56323de13 100644 --- a/widgets/pollWidget/skins/default/pollview.html +++ b/widgets/pollWidget/skins/default/pollview.html @@ -3,10 +3,14 @@ var poll_alert_lang = "{$lang->msg_check_poll_item}"; var poll_checkcount_lang = "{$lang->poll_checkcount}"; var poll_member_lang = "{$lang->poll_item_members}"; - jQuery(document).ready(function(){ + jQuery(document).ready(function() { var data = {json_encode($poll_data)}; - if(data.poll.is_polled==0) loadRxDefaultPoll({$poll_srl},data); - else loadRxDefaultPollResult({$poll_srl},data); + if (data.poll.is_polled == 0) { + loadRxDefaultPoll({$poll_srl},data); + } + else { + loadRxDefaultPollResult({$poll_srl},data); + } });
      diff --git a/widgets/pollWidget/skins/simple/pollview.html b/widgets/pollWidget/skins/simple/pollview.html index 1d5face8d..ce577ce84 100644 --- a/widgets/pollWidget/skins/simple/pollview.html +++ b/widgets/pollWidget/skins/simple/pollview.html @@ -23,7 +23,7 @@ } }); -
      +
      @@ -46,7 +45,7 @@ $(function(){
      diff --git a/widgets/pollWidget/skins/default/css/poll.css b/widgets/pollWidget/skins/default/css/poll.css index 2cc79457d..9c95d8e38 100644 --- a/widgets/pollWidget/skins/default/css/poll.css +++ b/widgets/pollWidget/skins/default/css/poll.css @@ -1,6 +1,6 @@ .rx_poll_default_wrap{max-width:100%;} -.pollWidget{padding:5px;} -.rx_poll_default{border-radius: 10px;border:1px solid #e0e0e0;overflow:auto; background-color:#ffffff; color:#000000; font-size:12px; font-family:"Open Sans","나눔바른고딕",NanumBarunGothic,"맑은 고딕","Malgun Gothic","돋움",Dotum,"애플 SD 산돌고딕 Neo","Apple SD Gothic Neo",AppleGothic,Helvetica,sans-serif;} +.rx_poll_default_wrap .pollWidget{padding:5px;} +.rx_poll_default{border-radius: 10px;border:1px solid #e0e0e0;overflow:auto; background-color:#ffffff; color:#000000; font-size:12px; font-family:"Open Sans","나눔바른고딕",NanumBarunGothic,"맑은 고딕","Malgun Gothic","애플 SD 산돌고딕 Neo","Apple SD Gothic Neo","돋움",Dotum,AppleGothic,Helvetica,sans-serif;} .rx_poll_default .rx_poll_header{padding:13px 15px 10px;overflow:auto;background: #000;background: linear-gradient(-180deg, #212121, #424242);color:#e0e0e0;} .rx_poll_default .rx_poll_h_strong{color:#FFFFFF;font-weight:bold} .rx_poll_default .rx_poll_content{padding: 15px;} diff --git a/widgets/pollWidget/skins/default/images/back_bar.png b/widgets/pollWidget/skins/default/images/back_bar.png deleted file mode 100644 index 8ef71686d41c659c49b23caf72df39d5e7259b03..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^VnEEs!2~2d7=C^SQY`6?zK#qG>ra@ocD)4hB}-f* zN`mv#O3D+9QW+dm@{>{(JaZG%Q-e|yQz{EjrrH1%8G5=nhE&{2+Ee>li#e4+p+O>k zZ;jJJK?cSnM;r_pI25!b7zG?c444!eRwS@EG%zxBo@e!uIPmWjP&0$4tDnm{r-UW| DXWlFq diff --git a/widgets/pollWidget/skins/default/images/blank.gif b/widgets/pollWidget/skins/default/images/blank.gif deleted file mode 100644 index 35d42e808f0a8017b8d52a06be2f8fec0b466a66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43 scmZ?wbhEHbWMp7uXkcLY|NlP&1B2pE7Dgb&paUX6G7L;iE{qJ;0LZEa`2YX_ diff --git a/widgets/pollWidget/skins/default/images/color_bar.png b/widgets/pollWidget/skins/default/images/color_bar.png deleted file mode 100644 index 2afe557c030053078d15412b2562edbd946a0a6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 328 zcmeAS@N?(olHy`uVBq!ia0y~yV7~xlvvDv1Ns(ETCIKmybVpxD28Q(~%vrl$0{N09 zt`Q}{`DrEPiAAXljw$&`sS2LCiRr09sfj6-g(p*OfQoK;x;TbZ+ zE~RfxEX%+$40W6b`eeC5Y@Scs=N&nB$YTdHh<8AN@y5nvMj)%f@!z${HzFlC%R%A{ z5-JT0Z!RbTWjL4(od0hLm*6Pe?Rq2U94I^cKAFtRcHj+T@tE#v^}@O1TaS?83{ F1OQf^Ycc=; diff --git a/widgets/pollWidget/skins/default/images/lb.png b/widgets/pollWidget/skins/default/images/lb.png deleted file mode 100644 index 0cc989c9888cf2619bb50a5bfd136a7e68a0e960..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^>>$j+1|*LJg@&XA{SvVBb*ld7&he_xE{rTA)Dg%5@gWJz{tjMBwFKx%uQ3Er3?(7u6{1- HoD!M>$j+1|*LJgbMeX3$LbFsJYr^GWMFvz?i~YD$IPiyr#?N{%${HN{+{aZM@PMv&9|>J_`{Io zwt%UDA*u57v$IE=+4(;(-*jLU_&L9k(Z|S;fkoi-<>mfYB^!9y+&UCGc*8i3FfbnZ z^x~p&+6FcQaZ#WGZVw(k&XPOz8qzL|K;`ZH@(VW!FbaIOKN7^&z`)G#Qoz*heaK3F QplcaCUHx3vIVCg!09i?3Q~&?~ diff --git a/widgets/pollWidget/skins/default/images/pipe.png b/widgets/pollWidget/skins/default/images/pipe.png deleted file mode 100644 index d560aa240dbbdb4fbcafe41588b3c41e5d9694dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)T!2~32J~8|UQY`6?zK#qG>ra@ocD)4hB}-f* zN`mv#O3D+9QW+dm@{>{(JaZG%Q-e|yQz{EjrrH1%IeWS|hE&{2`oYhfer`_VW=5ut zPDW`44uv<17#Le(MHCt~bThFClm#|09Mah$i%T*!+{}DoE4&ojUll}B>nIL Sp+i997(8A5T-G@yGywpwKQN#G diff --git a/widgets/pollWidget/skins/default/images/rb.png b/widgets/pollWidget/skins/default/images/rb.png deleted file mode 100644 index d74208c12102888250af76d806273c0265a666ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^>>$j+1|*LJg>$j+1|*LJgJ@N{tuskoIC5*YSRUqj=>fdeN_ zD5$G{4|j9>wrs_Uj=Iv)uksBHK>5I*=Np**8CzIb)P)2D2rzOesJSiRGhn&oz|}ER zf=|Zc#Q$e!XLmC&9$^aN7Glq2*KAU1Tkb!96*G$fcLY1L3j^N_2?;sdsv|rC4h5bY zj{g7O+?&Yq$>9)C%OM8ySN3;m+!kE>{@&hzfklF0QlrAxD7#>$j+1|*LJg>$j+1|*LJg!(qtp)Ntp}0hURB`9nC0v;t%u7!-H1^l zL2QC*!rA|cQU8n;X7m);Ce$;r2%N~-VC$nW{m|a8@;cmwd{?0qz6G3=A1qBp6yQ>)gm?jnD>qgu&C*&t;ucLK6U}PhYtJ diff --git a/widgets/pollWidget/skins/default/images/top_title_bg.png b/widgets/pollWidget/skins/default/images/top_title_bg.png deleted file mode 100644 index 900ebbb22c325f36a758b094886359744b94b639..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 523 zcmeAS@N?(olHy`uVBq!ia0vp^oIotY!2~32UNGeYDVB6cUq=Rp^(V|(yIunMk|nMY zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*9U+80UJrIEGZ*O1g64N=k}D!~Y(h zp8t*}%*@IT3>ys^QzZWXPfti;;WluPaQI~p5;JPL(iq~9((vPdz1jvFkVu27V~_*m zgt8S36WBNu#M}h>8yOd|XEC-MW)N^tFkWc%KT$O$>j7%M@Pqb(J0qSHsG3mcUDp2z`>nkD>%rbrskAYgR*86xYJa+_WxsHSIKWAGG zW&<;jJDqr0cfGd1!!K~3nMHt``A8a@TSw)G9ZaVffsUE$agh6yl0nyu1D6;Wk1#!S zR+`EvwLJi6_z|Ww14GBXJp2)A3d{-(33Uw-2RZuY{})gGC(?fOPuU;= y_IXCWEJ|pUXO@geCx@Bd{p| diff --git a/widgets/pollWidget/skins/default/pollview.html b/widgets/pollWidget/skins/default/pollview.html index 56323de13..bfc92ab41 100644 --- a/widgets/pollWidget/skins/default/pollview.html +++ b/widgets/pollWidget/skins/default/pollview.html @@ -50,7 +50,7 @@
      {{/each}} -
      +

      {$XE_VALIDATOR_MESSAGE}

      @@ -60,7 +60,7 @@ - +
      @@ -115,7 +115,7 @@ {{/if}} -
      +

      {$XE_VALIDATOR_MESSAGE}

      diff --git a/widgets/pollWidget/skins/simple/css/poll.css b/widgets/pollWidget/skins/simple/css/poll.css index 6e4241ff1..fd899645a 100644 --- a/widgets/pollWidget/skins/simple/css/poll.css +++ b/widgets/pollWidget/skins/simple/css/poll.css @@ -1,30 +1,30 @@ -.simple_poll { table-layout:fixed; padding:0; margin:0; border:none;} +.rx_poll_smpl_wrap{max-width:100%;} +.rx_poll_smpl_wrap .pollWidget{padding:5px;} +.rx_poll_smpl{box-shadow: 0 0 2px rgba(0, 0, 0, 0.25);overflow:auto; background-color:#ffffff; color:#000000; font-size:12px; font-family:"Open Sans","나눔바른고딕",NanumBarunGothic,"맑은 고딕","Malgun Gothic","애플 SD 산돌고딕 Neo","Apple SD Gothic Neo","돋움",Dotum,AppleGothic,Helvetica,sans-serif;} +.rx_poll_smpl .rx_poll_header{padding:13px 15px 10px;overflow:auto;border-bottom:2px solid #bdbdbd;} +.rx_poll_smpl .rx_poll_h_strong{font-weight:bold} +.rx_poll_smpl .rx_poll_content{padding: 15px;} +.rx_poll_smpl .rx_poll_content .title{border-bottom:2px solid #bdbdbd;font-weight:bold;padding:7px;margin-bottom:10px} +.rx_poll_smpl .rx_poll_content .rx_poll_smpl_item,.rx_poll_smpl .rx_poll_content .poll_vote .checkcount,.rx_poll_smpl .rx_poll_content .poll_vote .poll_item label{padding: 10px 5px;} +.rx_poll_smpl .rx_poll_content .rx_poll_smpl_item .item_text strong{display:inline-block; padding-right:10px; margin-right:10px;border-right:2px solid #e0e0e0;} +.rx_poll_smpl .rx_poll_content .rx_poll_smpl_item>div.item_bar{height:22px;position:relative;margin:6px 0px;background-color:#eeeeee;} +.rx_poll_smpl .rx_poll_content .rx_poll_smpl_item>div.item_bar div.item_bar{position:absolute;top:0px;left:0;background-color:#66bb6a;} +.rx_poll_smpl .rx_poll_content .rx_poll_smpl_item div.item_bar .item_bar_text{position:absolute;top:0px;right:3px;} +.rx_poll_smpl div.poll_button{border-top:1px solid #bdbdbd;padding:10px 15px;width:auto;text-align:center} +.rx_poll_smpl .rx_poll_content .poll_vote{margin:5px 0px 10px;} +.rx_poll_smpl .rx_poll_content .poll_vote .poll_item, .rx_poll_smpl .rx_poll_content .poll_vote .poll_item_add{position:relative;border-bottom:1px solid #e0e0e0;} +.rx_poll_smpl .rx_poll_content .poll_vote .poll_item label{display:block;width:auto;} +.rx_poll_smpl .rx_poll_content .poll_vote .poll_item .poll_item_delete{position:absolute;right:0;top:7px;} -.simple_poll td { padding:0; margin:0; } -.simple_poll td.title { text-align:right; } - -.simple_poll td .itemDiv { border-top:1px solid #BBBBBB; margin-top:3px; padding:3px 0 3px 0; } -.simple_poll td .title { color:#000000; font-weight:bold; letter-spacing:-1px;} -.simple_poll td .checkcount { color:#AAAAAA; } - -.simple_poll td .item { color:#636363; margin:5px 0 5px 0; } -.simple_poll td .item input { margin:0; padding:0; } -.simple_poll td .item label { letter-spacing:-1px; } - -.simple_poll td .resultItem { color:#636363; margin:6px 0 0 10px; letter-spacing:-1px;} - -.simple_poll td .barBox { margin-left:10px; } -.simple_poll td .barBox .bar { margin:3px 0;} -.simple_poll td .barBox .status {color:#AAAAAA; } - -.simple_poll td.stopDate { color:#AAAAAA; border-top:1px solid #BBBBBB; padding-top:3px;} -.simple_poll td.stopDate a { color:#AAAAAA; text-decoration:none; } - -.simple_poll td.poll_button { text-align:left; padding-top:3px;} -.simple_poll td.poll_button .poll_button { border:1px solid #EEEEEE; background-color:#AAAAAA; color:#FFFFFF; font-weight:bold; padding:1px 3px 1px 3px; height:20px; } - - -.simple_poll td.b { background-color:#F6F6F5; height:7px; } -.simple_poll td.b img { width:100%; height:6px; border-bottom:1px solid #E5E5E5; } -.simple_poll td.bb { height:7px; } -.simple_poll td.bb img { width:100%; height:6px; border-bottom:1px solid #E5E5E5; } +.rx_poll_smpl .rx_poll_content .poll_vote .poll_item_add input[type="text"]{ + width:100%; + box-sizing: border-box; + line-height: 25px; + font-size: 14px; + margin: 0; + padding: 8px 50px 8px 5px; + outline: none; + border: none; + border-bottom:1px solid #e0e0e0; +} +.rx_poll_smpl .rx_poll_content .poll_vote .poll_item_add input[type="button"]{position:absolute;right:0;top:7px;} \ No newline at end of file diff --git a/widgets/pollWidget/skins/simple/images/color_bar.png b/widgets/pollWidget/skins/simple/images/color_bar.png deleted file mode 100644 index 2afe557c030053078d15412b2562edbd946a0a6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 328 zcmeAS@N?(olHy`uVBq!ia0y~yV7~xlvvDv1Ns(ETCIKmybVpxD28Q(~%vrl$0{N09 zt`Q}{`DrEPiAAXljw$&`sS2LCiRr09sfj6-g(p*OfQoK;x;TbZ+ zE~RfxEX%+$40W6b`eeC5Y@Scs=N&nB$YTdHh<8AN@y5nvMj)%f@!z${HzFlC%R%A{ z5-JT0Z!RbTWjL4(od0hLm*6Pe?Rq2U94I^cKAFtRcHj+T@tE#v^}@O1TaS?83{ F1OQf^Ycc=; diff --git a/widgets/pollWidget/skins/simple/js/poll.js b/widgets/pollWidget/skins/simple/js/poll.js index 74c5856c9..72dc02977 100644 --- a/widgets/pollWidget/skins/simple/js/poll.js +++ b/widgets/pollWidget/skins/simple/js/poll.js @@ -1,404 +1,334 @@ -function initTemplete(type) +function initRxSmplTemplete(type, poll_srl) { - switch(type) - { - case 'poll': - if(typeof window.template == 'undefined') - { - var source = jQuery("#entry-template").html(); - window.template = Handlebars.compile(source); - } - break; - case 'result': - if(typeof window.template_result == 'undefined') - { - var source = jQuery("#entry-template-result").html(); - window.template_result = Handlebars.compile(source); - } - break; - case 'members': - if(typeof window.template_member == 'undefined') - { - var source = jQuery("#entry-template-members").html(); - window.template_member = Handlebars.compile(source); - } - break; - } + switch(type) + { + case 'poll': + if (typeof window.poll_smpl_template == 'undefined') + { + var source = jQuery("#smpl-template-" + poll_srl).html(); + window.poll_smpl_template = Handlebars.compile(source); + } + break; + case 'result': + if (typeof window.poll_smpl_template_result == 'undefined') + { + var source = jQuery("#smpl-template-result-" + poll_srl).html(); + window.poll_smpl_template_result = Handlebars.compile(source); + } + break; + case 'members': + if (typeof window.poll_smpl_template_member == 'undefined') + { + var source = jQuery("#smpl-template-members-" + poll_srl).html(); + window.poll_smpl_template_member = Handlebars.compile(source); + } + break; + } } /* 설문 참여 함수 */ -function doPoll(fo_obj) { +function doRxSmplPoll(fo_obj) { + var checkcount = new Array(); + var item = new Array(); - var checkcount = new Array(); - var item = new Array(); + for(var i=0; i < fo_obj.length; i++) { + var obj = fo_obj[i]; + if (obj.nodeName != 'INPUT') { + continue; + } - for(var i=0;i -1) { + var t = name.split('_'); + var poll_srl_index = parseInt(t[1], 10); + checkcount[poll_srl_index] = obj.value; + item[poll_srl_index] = new Array(); - var name = obj.name; - if(name.indexOf('checkcount')>-1) { - var t = name.split('_'); - var poll_srl_index = parseInt(t[1],10); - checkcount[poll_srl_index] = obj.value; - item[poll_srl_index] = new Array(); + } else if (name.indexOf('item_') > -1) { + var t = name.split('_'); + var poll_srl = parseInt(t[1], 10); + var poll_srl_index = parseInt(t[2], 10); + if (obj.checked == true) { + item[poll_srl_index][item[poll_srl_index].length] = obj.value; + } + } + } - } else if(name.indexOf('item_')>-1) { - var t = name.split('_'); - var poll_srl = parseInt(t[1],10); - var poll_srl_index = parseInt(t[2],10); - if(obj.checked == true) item[poll_srl_index][item[poll_srl_index].length] = obj.value; - } - } + var poll_srl_indexes = ""; + for(var poll_srl_index in checkcount) { + if(!checkcount.hasOwnProperty(poll_srl_index)) { + continue; + } + var count = checkcount[poll_srl_index]; + var items = item[poll_srl_index]; + if(items.length < 1 || count < items.length) { + alert(poll_alert_lang); + return false; + } - var poll_srl_indexes = ""; - for(var poll_srl_index in checkcount) { - if(!checkcount.hasOwnProperty(poll_srl_index)) continue; - var count = checkcount[poll_srl_index]; - var items = item[poll_srl_index]; - if(items.length < 1 || count < items.length) { - alert(poll_alert_lang); - return false; - } + poll_srl_indexes += items.join(',')+','; + } + fo_obj.poll_srl_indexes.value = poll_srl_indexes; - poll_srl_indexes += items.join(',')+','; - } - fo_obj.poll_srl_indexes.value = poll_srl_indexes; + jQuery.exec_json("poll.procPoll", {"poll_srl":poll_srl,"poll_srl_indexes":poll_srl_indexes}, function(data){ + if (data.error != 0) { + alert(data.message); + } + else { + loadRxSmplPollResult(poll_srl); + jQuery("#poll_" + poll_srl + "_gotoresult_button").css({ + display: "none" + }); - jQuery.exec_json("poll.procPoll", {"poll_srl":poll_srl,"poll_srl_indexes":poll_srl_indexes}, function(data){ - if(data.error!=0) alert(data.message); - else - { - loadPollResult(poll_srl); - jQuery("#poll_" + poll_srl + "_gotoresult_button").css({ - display: "none" - }); + jQuery("#poll_" + poll_srl + "_result_nobutton").css({ + display: "block" + }); - jQuery("#poll_" + poll_srl + "_result_nobutton").css({ - display: "table-row" - }); - - jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ - display: "none" - }); - } - }); - return false; + jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ + display: "none" + }); + } + }); + return false; } /* 항목 추가 함수 */ -function addItem(poll_srl,poll_srl_indexes) { - jQuery.exec_json("poll.procPollInsertItem", {"srl":poll_srl,"index_srl":poll_srl_indexes,"title":jQuery("#new_item_" + poll_srl_indexes).val()}, function(data){ - if(data.error!=0) alert(data.message); - else - { - jQuery("#poll_" + poll_srl + "_result_button").css({ - display: "none" - }); +function addRxSmplItem(poll_srl, poll_srl_indexes) { + jQuery.exec_json("poll.procPollInsertItem", {"srl":poll_srl, "index_srl":poll_srl_indexes, "title":jQuery("#new_item_" + poll_srl_indexes).val()}, function(data){ + if (data.error!=0) { + alert(data.message); + } + else { + jQuery("#poll_" + poll_srl + "_result_button").css({ + display: "none" + }); - jQuery("#poll_" + poll_srl + "_result_nobutton").css({ - display: "table-row" - }); + jQuery("#poll_" + poll_srl + "_result_nobutton").css({ + display: "block" + }); - jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ - display: "none" - }); + jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ + display: "none" + }); - loadPoll(poll_srl); - } - }); - return false; + loadRxSmplPoll(poll_srl); + } + }); + return false; } /* 항목 삭제 함수 */ -function deleteItem(poll_srl,poll_srl_indexes,poll_item_srl) { - jQuery.exec_json("poll.procPollDeleteItem", {"srl":poll_srl,"index_srl":poll_srl_indexes,"item_srl":poll_item_srl}, function(data){ - if(data.error!=0) alert(data.message); - else - { - jQuery("#poll_" + poll_srl + "_result_button").css({ - display: "none" - }); +function deleteRxSmplItem(poll_srl, poll_srl_indexes, poll_item_srl) { + jQuery.exec_json("poll.procPollDeleteItem", {"srl":poll_srl, "index_srl":poll_srl_indexes, "item_srl":poll_item_srl}, function(data){ + if (data.error!=0) { + alert(data.message); + } + else { + jQuery("#poll_" + poll_srl + "_result_button").css({ + display: "none" + }); - jQuery("#poll_" + poll_srl + "_result_nobutton").css({ - display: "table-row" - }); + jQuery("#poll_" + poll_srl + "_result_nobutton").css({ + display: "block" + }); - jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ - display: "none" - }); + jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ + display: "none" + }); - loadPoll(poll_srl); - } - }); - return false; + loadRxSmplPoll(poll_srl); + } + }); + return false; } -function loadPoll(poll_srl,data) +function loadRxSmplPoll(poll_srl, data) { - if(typeof data == 'undefined') - { - jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){ - loadPoll(parseInt(data.poll.poll_srl),data); - }); - } - else - { - jQuery("#stop_date_"+poll_srl).html(data.poll.stop_date); + if (typeof data == 'undefined') { + jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){ + loadRxSmplPoll(parseInt(data.poll.poll_srl), data); + }); + } + else { + jQuery("#stop_date_"+poll_srl).html(data.poll.stop_date); - initTemplete('poll'); - var template = window.template; - var context = Object; - var additem = data.caniadditem; - context.questions = {}; - for (var i in data.poll.poll) { - var poll = data.poll.poll[i]; - context.questions[i] = {}; - context.questions[i].poll_index_srl = poll.poll_index_srl; - context.questions[i].checkcount = poll.checkcount; - context.questions[i].title = poll.title; - context.questions[i].items = poll.item; - context.questions[i].poll_srl = poll_srl; - context.questions[i].isMultipleChoice = (poll.checkcount>1); - context.questions[i].additem = additem; - } - var html = template(context); + initRxSmplTemplete('poll', poll_srl); + var template = window.poll_smpl_template; + var context = Object; + var additem = data.caniadditem; + context.questions = {}; + for (var i in data.poll.poll) { + var poll = data.poll.poll[i]; + context.questions[i] = {}; + context.questions[i].poll_index_srl = poll.poll_index_srl; + context.questions[i].checkcount = poll.checkcount; + context.questions[i].title = poll.title; + context.questions[i].items = poll.item; + context.questions[i].poll_srl = poll_srl; + context.questions[i].isMultipleChoice = (poll.checkcount > 1); + context.questions[i].additem = additem; + } + var html = template(context); - jQuery("#poll_content_" + poll_srl).html(html); + jQuery("#poll_content_" + poll_srl).html(html); - jQuery("#poll_" + poll_srl).css({ - display: "block" - }); - jQuery("#poll_" + poll_srl + '_result').css({ - display: "none" - }); - } + jQuery("#poll_" + poll_srl).css({ + display: "block" + }); + jQuery("#poll_" + poll_srl + '_result').css({ + display: "none" + }); + } } -function showPollMemberNext(poll_srl,poll_item_srl) +function showRxSmplPollMemberNext(poll_srl, poll_item_srl) { - if(typeof window.cur_page == 'undefined') - { - window.cur_page = 1; - } + if (typeof window.cur_page == 'undefined') { + window.cur_page = 1; + } - window.cur_page++; + window.cur_page++; - jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl,"poll_item":poll_item_srl,"page":window.cur_page}, function(data){ - initTemplete('members'); - var template = window.template_member; - var context = Object; + jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl, "poll_item":poll_item_srl, "page":window.cur_page}, function(data){ + initRxSmplTemplete('members', poll_srl); + var template = window.poll_smpl_template_member; + var context = Object; - context.poll_srl = poll_srl; - context.poll_item_srl = poll_item_srl; - context.page = window.cur_page; - context.isPage = ((data.page.total_count>5) && (window.cur_page 5) && (window.cur_page < data.page.total_page)); - context.members = {}; + context.members = {}; - for (var i in data.item.member) { - var member = data.item.member[i]; + for (var i in data.item.member) { + var member = data.item.member[i]; - context.members[i] = {}; - context.members[i].profile_image = member.profile_image; - context.members[i].member_srl = member.member_srl; - context.members[i].nick_name = member.nick_name; - context.members[i].isImage = (member.profile_image != ''); - context.members[i].dummy_profile = data.dummy_profile; - } - var html = template(context); + context.members[i] = {}; + context.members[i].profile_image = member.profile_image; + context.members[i].member_srl = member.member_srl; + context.members[i].nick_name = member.nick_name; + context.members[i].isImage = (member.profile_image != ''); + context.members[i].dummy_profile = data.dummy_profile; + } + var html = template(context); - jQuery("#btn_load_more_" + poll_item_srl).replaceWith(html); - }); - - return false; -} - -function showPollMember(poll_srl,poll_item_srl) -{ - window.cur_page = 1; - - jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl,"poll_item":poll_item_srl,"page":window.cur_page}, function(data){ - initTemplete('members'); - var template = window.template_member; - var context = Object; - var title = poll_member_lang; - title = title.replace("%s",data.item.title); - var html = '
      ' + title + '
        '; - context.poll_srl = poll_srl; - context.poll_item_srl = poll_item_srl; - context.page = window.cur_page; - context.isPage = ((data.page.total_count>5) && (window.cur_page
      '; - - jQuery("#poll_content_" + poll_srl + "_result").html(html); - - jQuery("#poll_" + poll_srl + "_gotoresult_button").css({ - display: "table-row" - }); - - jQuery("#poll_" + poll_srl + "_result_nobutton").css({ - display: "none" - }); - - jQuery("#poll_" + poll_srl + "_result_yesbutton").css({ - display: "table-row" - }); - }); - - return false; -} - -function loadPollResult(poll_srl,data) -{ - if(typeof data == 'undefined') - { - jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){ - loadPollResult(parseInt(data.poll.poll_srl),data); - }); - } - else - { - jQuery("#stop_date_result_" + poll_srl).html(data.poll.stop_date); - jQuery("#poll_count_result_" + poll_srl).html(data.poll.poll_count); - - initTemplete('result'); - var template = window.template_result; - var context = Object; - var showMembers = (data.poll.poll_type==1 || data.poll.poll_type==3); - context.questions = {}; - for (var i in data.poll.poll) { - var poll = data.poll.poll[i]; - context.questions[i] = {}; - context.questions[i].poll_index_srl = poll.poll_index_srl; - context.questions[i].checkcount = poll.checkcount; - context.questions[i].title = poll.title; - context.questions[i].poll_count = poll.poll_count; - context.questions[i].showMembers = showMembers; - context.questions[i].items = poll.item; - var count = 0; - for (var j in poll.item) { - var item = poll.item[j]; - count++; - if(poll.poll_count>0) - { - context.questions[i].items[j].per = Math.round((item.poll_count / poll.poll_count)*100); - context.questions[i].items[j].isVote = true; - } - else - { - context.questions[i].items[j].per = 0; - context.questions[i].items[j].isVote = false; - } - context.questions[i].items[j].number = count; - } - context.questions[i].items = poll.item; - context.questions[i].poll_srl = poll_srl; - context.questions[i].isMultipleChoice = (poll.checkcount>1); - } - var html = template(context); - - jQuery("#poll_content_" + poll_srl + "_result").html(html); - jQuery("#poll_" + poll_srl).css({ - display: "none" - }); - jQuery("#poll_" + poll_srl + '_result').css({ - display: "block" - }); - } -} - -jQuery(function($){ - /* View poll result */ - $('._poll_result').click(function(){ - var cls = $(this).attr('class'), srl, skin; - - try{ - srl = cls.match(/\b_srl_(\d+)\b/)[1]; - }catch(e){ }; - - if(!srl) return false; - - jQuery("#poll_" + srl + "_result_button").css({ - display: "table-row" - }); - - jQuery("#poll_" + srl + "_result_nobutton").css({ - display: "none" - }); - - jQuery("#poll_" + srl + "_result_yesbutton").css({ - display: "table-row" - }); - - loadPollResult(srl); - - return false; + jQuery("#btn_load_more_" + poll_item_srl).replaceWith(html); }); - /* goto poll result */ - $('._gotoresult_screen').click(function(){ - var cls = $(this).attr('class'), srl, skin; + return false; +} - try{ - srl = cls.match(/\b_srl_(\d+)\b/)[1]; - }catch(e){ }; +function showRxSmplPollMember(poll_srl, poll_item_srl) +{ + window.cur_page = 1; - if(!srl) return false; + jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl, "poll_item":poll_item_srl, "page":window.cur_page}, function(data){ + initRxSmplTemplete('members', poll_srl); + var template = window.poll_smpl_template_member; + var context = Object; + var title = poll_member_lang; + title = title.replace("%s", data.item.title); + var html = '
      ' + title + '
        '; + context.poll_srl = poll_srl; + context.poll_item_srl = poll_item_srl; + context.page = window.cur_page; + context.isPage = ((data.page.total_count > 5) && (window.cur_page < data.page.total_count)); - jQuery("#poll_" + srl + "_gotoresult_button").css({ - display: "none" - }); + context.members = {}; - jQuery("#poll_" + srl + "_result_nobutton").css({ - display: "table-row" - }); + for (var i in data.item.member) { + var member = data.item.member[i]; - jQuery("#poll_" + srl + "_result_yesbutton").css({ - display: "none" - }); + context.members[i] = {}; + context.members[i].profile_image = member.profile_image; + context.members[i].member_srl = member.member_srl; + context.members[i].nick_name = member.nick_name; + context.members[i].isImage = (member.profile_image != ''); + context.members[i].dummy_profile = data.dummy_profile; + } + html = html + template(context) + '
      '; - loadPollResult(srl); + jQuery("#poll_content_" + poll_srl + "_result").html(html); - return false; - }); + jQuery("#poll_" + poll_srl + '_result_button').css({ + display: "none" + }); + jQuery("#poll_" + poll_srl + '_gotoresult_button').css({ + display: "block" + }); + }); - /* View poll screen */ - $('._poll_screen').click(function(){ - var cls = $(this).attr('class'), srl, skin; + return false; +} - try{ - srl = cls.match(/\b_srl_(\d+)\b/)[1]; - }catch(e){ }; +function loadRxSmplPollResult(poll_srl, data) +{ + if (typeof data == 'undefined') { + jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){ + loadRxSmplPollResult(parseInt(data.poll.poll_srl), data); + }); + } + else { + jQuery("#stop_date_result_" + poll_srl).html(data.poll.stop_date); + jQuery("#poll_count_result_" + poll_srl).html(data.poll.poll_count); - if(!srl) return false; + initRxSmplTemplete('result', poll_srl); + var template = window.poll_smpl_template_result; + var context = Object; + var showMembers = (data.poll.poll_type==1 || data.poll.poll_type==3); + context.questions = {}; + for (var i in data.poll.poll) { + var poll = data.poll.poll[i]; + context.questions[i] = {}; + context.questions[i].poll_index_srl = poll.poll_index_srl; + context.questions[i].checkcount = poll.checkcount; + context.questions[i].title = poll.title; + context.questions[i].poll_count = poll.poll_count; + context.questions[i].showMembers = showMembers; + context.questions[i].items = poll.item; + var count = 0; + for (var j in poll.item) { + var item = poll.item[j]; + count++; + if (poll.poll_count > 0) { + context.questions[i].items[j].per = Math.round((item.poll_count / poll.poll_count)*100); + context.questions[i].items[j].isVote = true; + } + else { + context.questions[i].items[j].per = 0; + context.questions[i].items[j].isVote = false; + } + context.questions[i].items[j].number = count; + } + context.questions[i].items = poll.item; + context.questions[i].poll_srl = poll_srl; + context.questions[i].isMultipleChoice = (poll.checkcount > 1); + } + var html = template(context); - jQuery("#poll_" + srl + "_result_button").css({ - display: "none" - }); + jQuery("#poll_content_" + poll_srl + "_result").html(html); + jQuery("#poll_" + poll_srl).css({ + display: "none" + }); + jQuery("#poll_" + poll_srl + '_result').css({ + display: "block" + }); - jQuery("#poll_" + srl + "_result_nobutton").css({ - display: "table-row" - }); + // do not display back to result button, because, this is that page. + jQuery("#poll_" + poll_srl + '_gotoresult_button').css({ + display: "none" + }); - jQuery("#poll_" + srl + "_result_yesbutton").css({ - display: "none" - }); - - loadPoll(srl); - - return false; - }); -}); + // Check if the user have voted or not. If xe (he or she) have done, do not display back to the poll button + if (data.poll.is_polled == 0) { + jQuery("#poll_" + poll_srl + '_result_button').css({ + display: "block" + }); + } + else { + jQuery("#poll_" + poll_srl + '_result_button').css({ + display: "none" + }); + } + } +} \ No newline at end of file diff --git a/widgets/pollWidget/skins/simple/pollview.html b/widgets/pollWidget/skins/simple/pollview.html index ce577ce84..c03cdd819 100644 --- a/widgets/pollWidget/skins/simple/pollview.html +++ b/widgets/pollWidget/skins/simple/pollview.html @@ -3,113 +3,107 @@ var poll_alert_lang = "{$lang->msg_check_poll_item}"; var poll_checkcount_lang = "{$lang->poll_checkcount}"; var poll_member_lang = "{$lang->poll_item_members}"; - jQuery(document).ready(function(){ - var data = {json_encode($poll_data)}; - if(data.poll.is_polled==0) loadPoll({$poll_srl},data); - else - { - loadPollResult({$poll_srl},data); - jQuery("#poll_{$poll_srl}_result_button").css({ - display: "none" - }); - - jQuery("#poll_{$poll_srl}_result_nobutton").css({ - display: "table-row" - }); - - jQuery("#poll_{$poll_srl}_result_yesbutton").css({ - display: "none" - }); - } + jQuery(document).ready(function() { + var data = {json_encode($poll_data)}; + if (data.poll.is_polled == 0) { + loadRxSmplPoll({$poll_srl},data); + } + else { + loadRxSmplPollResult({$poll_srl},data); + } }); -
      +