git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2327 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-08-12 03:59:52 +00:00
commit 8326004cb2
2773 changed files with 91485 additions and 0 deletions

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<module version="0.1">
<title xml:lang="ko">한국 우편번호</title>
<title xml:lang="en">Korean Zip Code</title>
<title xml:lang="zh-CN">韩国邮编 </title>
<title xml:lang="jp">韓国郵便番号</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="en">Zero</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="jp">Zero</name>
<description xml:lang="ko">
제로보드에서 운영하는 우편번호서버를 이용하여 우편번호 검색을 합니다.
우편번호 검색 서버는 설정을 통해 변경하실 수 있습니다.
</description>
<description xml:lang="en">
Searching the zip code via zip code server operated by zeroboard.
You can change the zip code server by setting.
</description>
<description xml:lang="zh-CN">
利用zeroboard运营的邮编服务器搜索邮编。
通过设置可以修改邮编搜索服务器。
</description>
<description xml:lang="jp">
ゼロボードで運用している郵便番号サーバを利用して韓国の郵便番号を検索します。
郵便番号検索サーバは設定によって変更することができます。
</description>
</author>
</module>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<module>
<grants />
<actions>
<action name="dispKrzipAdminConfig" type="view" admin_index="true" standalone="true" />
<action name="procKrzipAdminInsertConfig" type="controller" standalone="true" />
<action name="getKrzipCodeList" type="model" index="true" standalone="true" />
</actions>
</module>

View file

@ -0,0 +1,33 @@
<?php
/**
* @class krzipAdminController
* @author zero (zero@nzeo.com)
* @brief krzip 모듈의 admin controller class
**/
class krzipAdminController extends krzip {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 설정
**/
function procKrzipAdminInsertConfig() {
// 기본 정보를 받음
$args = Context::gets('krzip_server_hostname','krzip_server_port','krzip_server_query');
if(!$args->krzip_server_hostname) $args->krzip_server_hostname = $this->hostname;
if(!$args->krzip_server_port) $args->krzip_server_port = $this->port;
if(!$args->krzip_server_query) $args->krzip_server_query = $this->query;
// module Controller 객체 생성하여 입력
$oModuleController = &getController('module');
$output = $oModuleController->insertModuleConfig('krzip',$args);
return $output;
}
}
?>

View file

@ -0,0 +1,32 @@
<?php
/**
* @class krzipAdminView
* @author zero (zero@nzeo.com)
* @brief krzip 모듈의 admin view class
**/
class krzipAdminView extends krzip {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 설정
**/
function dispKrzipAdminConfig() {
// 설정 정보를 받아옴 (module model 객체를 이용)
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('krzip');
Context::set('config',$config);
// 템플릿 파일 지정
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('index');
}
}
?>

View file

@ -0,0 +1,40 @@
<?php
/**
* @class krzip
* @author zero (zero@nzeo.com)
* @brief 우편번호 검색 모듈인 krzip의 상위 클래스
**/
class krzip extends ModuleObject {
var $hostname = 'kr.zip.zeroboard.com';
var $port = 80;
var $query = '/server.php?addr3=';
/**
* @brief 설치시 추가 작업이 필요할시 구현
**/
function moduleInstall() {
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionForward('krzip', 'view', 'dispKrzipAdminConfig');
return new Object();
}
/**
* @brief 설치가 이상이 없는지 체크하는 method
**/
function checkUpdate() {
return false;
}
/**
* @brief 업데이트 실행
**/
function moduleUpdate() {
return new Object();
}
}
?>

View file

@ -0,0 +1,56 @@
<?php
/**
* @class krzipModel
* @author zero (zero@nzeo.com)
* @brief krzip 모듈의 model 클래스
**/
class krzipModel extends krzip {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 우편 번호 검색
* 동이름을 입력받아서 지정된 서버에 우편번호 목록을 요청한다
**/
function getKrzipCodeList() {
// 설정 정보를 받아옴 (module model 객체를 이용)
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('krzip');
if($args->krzip_server_hostname) $this->hostname = $args->krzip_server_hostname;
if($args->krzip_server_port) $this->port = $args->krzip_server_port;
if($args->krzip_server_query) $this->query = $args->krzip_server_query;
// 동네 이름을 받음
$addr = trim(Context::get('addr'));
if(!$addr) return new Object(-1,'msg_not_exists_addr');
// 지정된 서버에 요청을 시도한다
$query_string = $this->query.urlencode($addr);
$fp = fsockopen($this->hostname, $this->port, $errno, $errstr);
if(!$fp) return new Object(-1, 'msg_fail_to_socket_open');
fputs($fp, "GET {$query_string} HTTP/1.0\r\n");
fputs($fp, "Host: {$this->hostname}\r\n\r\n");
$buff = '';
while(!feof($fp)) {
$str = fgets($fp, 1024);
if(trim($str)=='') $start = true;
if($start) $buff .= $str;
}
fclose($fp);
$address_list = unserialize(base64_decode($buff));
if(!$address_list) return new Object(-1, 'msg_no_result');
$this->add('address_list', implode("\n",$address_list));
}
}
?>

View file

@ -0,0 +1,22 @@
<?php
/**
* @file modules/krzip/lang/en.lang.php
* @author zero <zero@nzeo.com>
* @brief English language pack (Only basic contents are listed)
**/
// normal words
$lang->krzip = "Korean Zip code";
$lang->krzip_server_hostname = "Server name for zip code checking";
$lang->krzip_server_port = "Server port for zip code checking";
$lang->krzip_server_query = "Server path for zip code checking";
// descriptions
$lang->about_krzip_server_hostname = "Input the server's domain for checking zip codes and receiving the result list";
$lang->about_krzip_server_port = "Input the server's port number for checking the zip code";
$lang->about_krzip_server_query = "Input the query url that will be requested for checking the zip code";
// error messages
$lang->msg_not_exists_addr = "Target for searching doesn't exist";
$lang->msg_fail_to_socket_open = "Unabled to connect to zip code checking server";
?>

View file

@ -0,0 +1,22 @@
<?php
/**
* @file modules/krzip/lang/jp.lang.php
* @author zero <zero@nzeo.com> 翻訳RisaPapa
* @brief 日本語言語パッケージ(基本的な内容のみ)
**/
// 一般用語
$lang->krzip = "韓国郵便番号";
$lang->krzip_server_hostname = "郵便番号検索サーバ名";
$lang->krzip_server_port = "郵便番号検索サーバのポート";
$lang->krzip_server_query = "郵便番号検索サーバのクエリ";
// 설명문
$lang->about_krzip_server_hostname = "郵便番号を検索して結果を取り寄せるサーバのドメインを入力してください。";
$lang->about_krzip_server_port = "郵便番号検索サーバのポート番号を入力してください。";
$lang->about_krzip_server_query = "郵便番号検索サーバに問い合わせるクエリのURLを入力してください。";
// 에러 메세지들
$lang->msg_not_exists_addr = "入力された文字列では郵便番号が見つかりませんでした";
$lang->msg_fail_to_socket_open = "郵便番号サーバとの接続に失敗しました";
?>

View file

@ -0,0 +1,22 @@
<?php
/**
* @file modules/krzip/lang/ko.lang.php
* @author zero <zero@nzeo.com>
* @brief 한국어 언어팩 (기본적인 내용만 수록)
**/
// 일반 단어들
$lang->krzip = "한국 우편번호";
$lang->krzip_server_hostname = "우편번호 검사 서버의 이름";
$lang->krzip_server_port = "우편번호 검사 서버 포트";
$lang->krzip_server_query = "우편번호 검사 서버 경로";
// 설명문
$lang->about_krzip_server_hostname = "우편번호를 검사하여 결과 목록을 가져올 서버의 도메인을 입력해주세요";
$lang->about_krzip_server_port = "우편번호를 검사서버의 포트 번호를 입력해주세요";
$lang->about_krzip_server_query = "우편번호를 검사서버에 요청할 query url을 입력해 주세요";
// 에러 메세지들
$lang->msg_not_exists_addr = "검색하려는 대상이 없습니다";
$lang->msg_fail_to_socket_open = "우편번호 검색 대상 서버 접속이 실패하였습니다";
?>

View file

@ -0,0 +1,22 @@
<?php
/**
* @file modules/krzip/lang/zh-CN.lang.php
* @author zero <zero@nzeo.com>
* @brief 简体中文语言包(收录了基本内容)
**/
// 一般单词
$lang->krzip = "韩国邮编";
$lang->krzip_server_hostname = "邮编检测服务器名";
$lang->krzip_server_port = "邮编检测服务器端口";
$lang->krzip_server_query = "邮编检测服务器路径";
// 说明文
$lang->about_krzip_server_hostname = "请输入要导入的检测结果目录服务器域名。";
$lang->about_krzip_server_port = "请输入邮编检测服务器端口。";
$lang->about_krzip_server_query = "请输入向邮编检测服务器发出请求的 query url。";
// 错误提示
$lang->msg_not_exists_addr = "没有要搜索的对象!";
$lang->msg_fail_to_socket_open = "连接邮编搜索对象服务器失败!";
?>

View file

@ -0,0 +1,11 @@
<filter name="insert_config" module="krzip" act="procKrzipAdminInsertConfig" confirm_msg_code="confirm_submit">
<form>
<node target="krzip_server_hostname" required="true" />
<node target="krzip_server_port" required="true" />
<node target="krzip_server_query" required="true" />
</form>
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -0,0 +1,37 @@
<!--%import("filter/insert_config.xml")-->
<h3>{$lang->krzip} <span class="gray">{$lang->cmd_management}</span></h3>
<form action="./" method="get" onsubmit="return procFilter(this, insert_config)">
<table cellspacing="0" class="tableType4">
<col width="200" />
<col />
<thead>
<tr>
<th scope="col">{$lang->krzip_server_hostname}</th>
<td>
<input type="text" name="krzip_server_hostname" value="{htmlspecialchars($config->krzip_server_hostname?$config->krzip_server_hostname:'kr.zip.zeroboard.com')}" class="inputTypeText w100" />
<p>{$lang->about_krzip_server_hostname}</p>
</td>
</tr>
<tr>
<th scope="col">{$lang->krzip_server_port}</th>
<td>
<input type="text" name="krzip_server_port" value="{htmlspecialchars($config->krzip_server_port?$config->krzip_server_port:'80')}" class="inputTypeText w100"/>
<p>{$lang->about_krzip_server_port}</p>
</td>
</tr>
<tr>
<th scope="col">{$lang->krzip_server_query}</th>
<td>
<input type="text" name="krzip_server_query" value="{htmlspecialchars($config->krzip_server_query?$config->krzip_server_query:'/server.php?addr3=')}" class="inputTypeText w100"/>
<p>{$lang->about_krzip_server_query}</p>
</td>
</tr>
</table>
<!-- 버튼 -->
<div class="tRight gap1">
<span class="button"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
</div>
</form>