From ad2754314cbf47b5f3c6ce84eee5a2c63bc95025 Mon Sep 17 00:00:00 2001 From: zero Date: Mon, 23 Apr 2007 05:38:32 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@1279 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- addons/counter/counter.addon.php | 5 ++- common/js/common.js | 10 ++++- common/tpl/calendar.php | 24 +++++------ modules/counter/counter.view.php | 19 +++++++++ modules/counter/lang/ko.lang.php | 12 ++++++ modules/counter/tpl/index.html | 57 ++++++++++++------------- modules/counter/tpl/js/counter.js | 14 ++++++ modules/counter/tpl/js/counter_admin.js | 6 +++ 8 files changed, 101 insertions(+), 46 deletions(-) create mode 100644 modules/counter/tpl/js/counter.js create mode 100644 modules/counter/tpl/js/counter_admin.js diff --git a/addons/counter/counter.addon.php b/addons/counter/counter.addon.php index 73d2b8bce..fc2bed4ae 100644 --- a/addons/counter/counter.addon.php +++ b/addons/counter/counter.addon.php @@ -13,7 +13,8 @@ **/ // called_position가 before_module_init 이고 module이 admin이 아닐 경우 - if($called_position == 'before_module_init' && $this->module != 'admin') { - Context::addJsFile('./modules/counter/tpl/js/counter.js'); + if($called_position == 'before_module_init' && !$GLOBALS['__counter_addon_called__']) { + if($this->module != 'admin') Context::addJsFile('./modules/counter/tpl/js/counter.js'); + $GLOBALS['__counter_addon_called__'] = true; } ?> diff --git a/common/js/common.js b/common/js/common.js index 665d5d040..5c45e85ab 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -26,6 +26,7 @@ String.prototype.getQuery = function(key) { String.prototype.setQuery = function(key, val) { var idx = this.indexOf('?'); var uri = this; + uri = uri.replace(/#$/,''); if(idx != -1) { uri = this.substr(0, idx); var query_string = this.substr(idx+1, this.length); @@ -499,8 +500,13 @@ function setMemberMenuObjCursor() { } // 날자 선택 (달력 열기) -function open_calendar(fo_id, day_str) { +function open_calendar(fo_id, day_str, callback_func) { if(typeof(day_str)=="undefined") day_str = ""; - var url = "./common/tpl/calendar.php?fo_id="+fo_id+"&day_str="+day_str; + + var url = "./common/tpl/calendar.php?"; + if(fo_id) url+="fo_id="+fo_id; + if(day_str) url+="&day_str="+day_str; + if(callback_func) url+="&callback_func="+callback_func; + popopen(url, 'Calendar'); } diff --git a/common/tpl/calendar.php b/common/tpl/calendar.php index f03a3f562..b56bb6edb 100644 --- a/common/tpl/calendar.php +++ b/common/tpl/calendar.php @@ -4,6 +4,7 @@ $method = $_REQUEST['method']; $fo_id = $_REQUEST['fo_id']; + $callback_func = $_REQUEST['callback_func']; $day_str = $_REQUEST['day_str']; if($day_str && strlen($day_str)) { @@ -59,7 +60,7 @@