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,17 @@
<?xml version="1.0" encoding="utf-8"?>
<module version="0.1">
<title xml:lang="ko">모듈</title>
<title xml:lang="zh-CN">模块</title>
<title xml:lang="jp">モジュール</title>
<title xml:lang="en">Module</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="en">zero</name>
<description xml:lang="ko">모듈 생성 및 관리하는 모듈입니다.</description>
<description xml:lang="zh-CN">生成及管理模块的模块。</description>
<description xml:lang="jp">モジュールの生成、管理するモジュールです。</description>
<description xml:lang="en">This module is for creating/managering the other modules.</description>
</author>
</module>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<module>
<actions>
<action name="dispModuleAdminContent" type="view" standalone="true" admin_index="true" />
<action name="dispModuleAdminList" type="view" standalone="true" />
<action name="dispModuleAdminCategory" type="view" standalone="true" />
<action name="dispModuleAdminInfo" type="view" standalone="true" />
<action name="dispModuleSkinInfo" type="view" standalone="true" />
<action name="procModuleAdminInsertCategory" type="controller" standalone="true" />
<action name="procModuleAdminUpdateCategory" type="controller" standalone="true" />
</actions>
</module>

View file

@ -0,0 +1,67 @@
<?php
/**
* @file modules/module/lang/en.lang.php
* @author zero (zero@nzeo.com)
* @brief English language pack
**/
$lang->module_list = "Module List";
$lang->module_index = "Module List";
$lang->module_category = "Module Category";
$lang->module_info = "Info";
$lang->add_shortcut = "Add Shortcuts";
$lang->module_action = "Actions";
$lang->module_maker = "Module Developer";
$lang->module_history = "Update history";
$lang->category_title = "Category Title";
$lang->header_text = 'Header Text';
$lang->footer_text = 'Footer Text';
$lang->use_category = 'Enable Category';
$lang->category_title = 'Category Title';
$lang->checked_count = 'Number of checked article';
$lang->skin_default_info = 'Default Skin Info';
$lang->skin_maker = 'Skin Developer';
$lang->skin_maker_homepage = "Skin Developer's Homepage";
$lang->open_rss = 'Open RSS';
$lang->open_rss_types = array(
'Y' => 'Open all',
'H' => 'Open summary',
'N' => 'Not open',
);
$lang->cmd_add_shortcut = "Add Shortcut";
$lang->cmd_install = "Install";
$lang->cmd_update = "Update";
$lang->cmd_manage_category = 'Manage Categories';
$lang->cmd_manage_grant = 'Manage Permission';
$lang->cmd_manage_skin = 'Manage Skins';
$lang->cmd_manage_document = 'Manage Articles';
$lang->msg_new_module = "Create new module";
$lang->msg_update_module = "Modify module";
$lang->msg_module_name_exists = "The name already exists. Please try other name.";
$lang->msg_category_is_null = 'No registered category exists.';
$lang->msg_grant_is_null = 'No list exists for grant.';
$lang->msg_no_checked_document = 'No checked articles exist.';
$lang->msg_move_failed = 'Failed to move';
$lang->msg_cannot_delete_for_child = 'Cannot delete a category having child categories.';
$lang->about_browser_title = "It will be shown in the browser title. It will be also used in a RSS/Trackback.";
$lang->about_mid = "The module name will be used like http://address/?mid=ModuleName.\n(only english alphabet,numbers, and underscore(_) are allowed)";
$lang->about_default = "If checked, the default will be shown when access to the site without no mid value(mid=NoValue).";
$lang->about_module_category = "It enables you to manage it through module category.\n The URL for the module manager is <a href=\"./?module=admin&amp;act=dispModuleAdminCategory\">Manage module > Module category </a>.";
$lang->about_description= 'It is the description only for a manager.';
$lang->about_default = 'If cheched, the default will be shown when access to the site without no mid value(mid=NoValue).';
$lang->about_header_text = 'The contents will be shown on the top of the module.(html tags available)';
$lang->about_footer_text = 'The contents will be shown on the bottom of the module.(html tags available)';
$lang->about_skin = 'You may choose a module skin.';
$lang->about_use_category = 'If checked, category function will be enabled.';
$lang->about_list_count = 'You can set the number of limit to show article in a page.(default is 1)';
$lang->about_page_count = 'You can set the number of page link to move pages in a bottom of page.(default is 10)';
$lang->about_admin_id = 'You can grant a manager to have all permissions to the module.\n You can enter multiple IDs using <br />,(comma) \n(but the module manager cannot access the site admin page.)';
$lang->about_grant = 'If you disable all objects having specific permissions, all members even not logined may have permission.';
$lang->about_open_rss = 'You can select RSS on the current module to be open to the public.\nNo matter the view permission of article , RSS will be open to the public by its option.';
$lang->about_module = "All of Zeroboard XE except the basic library consist of module.\n [Manage module] module will show all installed modules and help you to manage them.\nThrough [Add shortcut] feature, you can manage frequently used modules easily.";
$lang->about_extra_vars_default_value = 'If multiple default values are needed, you can link them with comma(,).';
?>

View file

@ -0,0 +1,67 @@
<?php
/**
* @file jp.lang.php
* @author zero (zero@nzeo.com) 翻訳RisaPapa
* @brief 日本語言語パッケージ
**/
$lang->module_list = "モジュールリスト";
$lang->module_index = "モジュールインデックス";
$lang->module_category = "モジュールカテゴリ";
$lang->module_info = "モジュール情報";
$lang->add_shortcut = "管理者メニューに追加する";
$lang->module_action = "動作";
$lang->module_maker = "モジュール作者";
$lang->module_history = "変更内容 ";
$lang->category_title = "カテゴリ名";
$lang->header_text = 'ヘッダー内容';
$lang->footer_text = 'フッター内容';
$lang->use_category = 'カテゴリ使用';
$lang->category_title = 'カテゴリ名';
$lang->checked_count = '選択された書き込み数';
$lang->skin_default_info = 'スキン基本情報';
$lang->skin_maker = 'スキン作者';
$lang->skin_maker_homepage = '作者ホームページ';
$lang->open_rss = 'RSS配信';
$lang->open_rss_types = array(
'Y' => '全文配信 ',
'H' => '要約配信',
'N' => '配信しない',
);
$lang->cmd_add_shortcut = "ショットカット追加";
$lang->cmd_install = "インストール";
$lang->cmd_update = "アップデート";
$lang->cmd_manage_category = 'カテゴリ管理';
$lang->cmd_manage_grant = '権限管理';
$lang->cmd_manage_skin = 'スキン管理';
$lang->cmd_manage_document = '書き込み管理';
$lang->msg_new_module = "モジュール作成";
$lang->msg_update_module = "モジュール修正";
$lang->msg_module_name_exists = "既に存在するモジュール名です。他の名前を入力してください。";
$lang->msg_category_is_null = '登録されているカテゴリがありません。';
$lang->msg_grant_is_null = '登録された権限がありません。';
$lang->msg_no_checked_document = '選択された書き込みがありません。';
$lang->msg_move_failed = '移動することができませんでした。';
$lang->msg_cannot_delete_for_child = '下位カテゴリのカテゴリは削除することができません。';
$lang->about_browser_title = "ブラウザのタイトルバーに表示される内容です。RSS/Trackbackでも使用します。";
$lang->about_mid = "モジュール名は、http://アドレス/?mid=モジュール名、のように直接呼び出せる値です英数_のみ可";
$lang->about_default = "チェックすると、サイトに「 mid値」なしで接続した場合、デフォルトで表示します。";
$lang->about_module_category = "カテゴリで管理できるようにします。モジュールのカテゴリの管理は、<a href=\"./?module=admin&amp;act=dispModuleAdminCategory\">モジュール管理 > モジュールカテゴリ </a>で行うことができます。";
$lang->about_description= '管理用に用いられる説明です。';
$lang->about_default = 'チェックすると、サイトに「mid値」なしで接続した場合、デフォルトで表示します。';
$lang->about_header_text = 'モジュールのヘッダーに表示される内容ですHTMLタグが使用できる。';
$lang->about_footer_text = 'モジュールのフッターに表示される内容です。HTMLタグが使用できる。';
$lang->about_skin = 'モジュールのスキンを選択することができます。';
$lang->about_use_category = 'チェックするとカテゴリ機能が使用できます。';
$lang->about_list_count = '1ページ当たりに表示される書き込みの数が指定できます(デフォルト1個)。';
$lang->about_page_count = 'リストの下段に移動できるページのリンク数が指定できます(デフォルト10個)。';
$lang->about_admin_id = '該当するモジュールに対して最高権限を持つ管理者を指定することができます。「,(コンマ)」で区切って多数のIDが指定できます(管理者ページへのアクセスはできません)。';
$lang->about_grant = '特定権限の対象をすべて解除するとログインしていない会員ユーザまで権限が与えられます。';
$lang->about_open_rss = '現在のモジュールに対して「RSS配信」を選択することができます。書き込みの内容が読める権限とは関係なくオプションによってRSSが配信されます。';
$lang->about_module = "ゼロボードXEは、基本ライブラリの他は、すべてモジュールで構成されています。モジュール管理用のモジュールはインストールされたすべてを表示し、管理できるようにします。頻繁に使うモジュールは、【ショットカット追加】で行うと管理しやすなります。";
$lang->about_extra_vars_default_value = '多重・単一選択などのデフォルト値が、複数必要な場合は、「, (コンマ)」でリンクを張ることができます。';
?>

View file

@ -0,0 +1,67 @@
<?php
/**
* @file ko.lang.php
* @author zero (zero@nzeo.com)
* @brief 한국어 언어팩
**/
$lang->module_list = "모듈 목록";
$lang->module_index = "모듈 목록";
$lang->module_category = "모듈 분류";
$lang->module_info = "모듈 정보";
$lang->add_shortcut = "관리자 메뉴에 추가";
$lang->module_action = "동작";
$lang->module_maker = "모듈 제작자";
$lang->module_history = "변경 사항 ";
$lang->category_title = "분류 이름";
$lang->header_text = '상단 내용';
$lang->footer_text = '하단 내용';
$lang->use_category = '분류 사용';
$lang->category_title = '분류명';
$lang->checked_count = '선택된 글 수';
$lang->skin_default_info = '스킨 기본정보';
$lang->skin_maker = '스킨제작자';
$lang->skin_maker_homepage = '제작자 홈페이지';
$lang->open_rss = 'RSS 공개';
$lang->open_rss_types = array(
'Y' => '전문 공개 ',
'H' => '요약 공개',
'N' => '공개하지 않음',
);
$lang->cmd_add_shortcut = "바로가기 추가";
$lang->cmd_install = "설치";
$lang->cmd_update = "업데이트";
$lang->cmd_manage_category = '분류관리';
$lang->cmd_manage_grant = '권한관리';
$lang->cmd_manage_skin = '스킨관리';
$lang->cmd_manage_document = '게시글 관리';
$lang->msg_new_module = "모듈 생성";
$lang->msg_update_module = "모듈 수정";
$lang->msg_module_name_exists = "이미 존재하는 모듈이름입니다. 다른 이름을 입력해주세요.";
$lang->msg_category_is_null = '등록된 분류가 없습니다';
$lang->msg_grant_is_null = '등록된 권한 대상이 없습니다';
$lang->msg_no_checked_document = '선택된 게시물이 없습니다';
$lang->msg_move_failed = '이동 실패하였습니다';
$lang->msg_cannot_delete_for_child = '하부 분류가 있는 분류는 삭제하실 수 없습니다';
$lang->about_browser_title = "브라우저의 제목에 나타나는 값입니다. RSS/Trackback에서도 사용됩니다.";
$lang->about_mid = "모듈이름은 http://주소/?mid=모듈이름 처럼 직접 호출할 수 있는 값입니다. (영문+숫자+_ 만 가능)";
$lang->about_default = "선택하시면 사이트에 mid값 없이 접속하였을 경우 기본으로 보여줍니다";
$lang->about_module_category = "분류를 통한 관리를 할 수 있도록 합니다. 모듈 분류의 관리는 <a href=\"./?module=admin&amp;act=dispModuleAdminCategory\">모듈관리 > 모듈분류 </a>에서 하실 수 있습니다.";
$lang->about_description= '관리용으로 사용되는 설명입니다';
$lang->about_default = '선택하시면 사이트에 mid값 없이 접속하였을 경우 기본으로 보여줍니다';
$lang->about_header_text = '모듈의 상단에 표시되는 내용입니다 (html 태그 사용 가능)';
$lang->about_footer_text = '모듈의 하단에 표시되는 내용입니다 (html 태그 사용 가능)';
$lang->about_skin = '모듈의 스킨을 선택하실 수 있습니다';
$lang->about_use_category = '선택하시면 분류기능을 사용할 수 있습니다';
$lang->about_list_count = '한페이지에 표시될 글의 수를 지정하실 수 있습니다. (기본 1개)';
$lang->about_page_count = '목록 하단 페이지 이동 하는 링크의 수를 지정하실 수 있습니다. (기본 10개)';
$lang->about_admin_id = '해당 모듈에 대해 최고 권한을 가지는 관리자를 지정할 수 있습니다.<br />,(콤마)로 다수 아이디 지정이 가능합니다. (관리자페이지 접근은 불가능)';
$lang->about_grant = '특정 권한의 대상을 모두 해제하시면 로그인하지 않은 회원까지 권한을 가질 수 있습니다';
$lang->about_open_rss = '현재 모듈에 대한 RSS 공개를 선택하실 수 있습니다. 글 보는 권한과 상관없이 옵션에 따라 RSS가 공개됩니다';
$lang->about_module = "제로보드XE는 기본 라이브러리를 제외한 나머지는 모두 모듈로 구성되어 있습니다.\n모듈관리 모듈은 설치된 모든 모듈을 보여주고 관리를 도와줍니다.\n자주 쓰는 모듈은 [바로가기 추가]를 통해서 편하게 관리하실 수 있습니다.";
$lang->about_extra_vars_default_value = '다중/단일 선택등 기본값이 여러개가 필요한 경우 , (콤마)로 연결하시면 됩니다';
?>

View file

@ -0,0 +1,67 @@
<?php
/**
* @file zh-CN.lang.php
* @author zero (zero@nzeo.com)
* @brief 简体中文语言包
**/
$lang->module_list = "模块目录";
$lang->module_index = "模块目录";
$lang->module_category = "模块分类";
$lang->module_info = "模块信息";
$lang->add_shortcut = "添加到快捷菜单";
$lang->module_action = "动作";
$lang->module_maker = "模块作者";
$lang->module_history = "更新事项 ";
$lang->category_title = "分类名称";
$lang->header_text = '上端内容';
$lang->footer_text = '下端内容';
$lang->use_category = '使用分类';
$lang->category_title = '分类名';
$lang->checked_count = '被选择的主题数';
$lang->skin_default_info = '皮肤默认信息';
$lang->skin_maker = '皮肤作者';
$lang->skin_maker_homepage = '作者主页';
$lang->open_rss = '公开RSS';
$lang->open_rss_types = array(
'Y' => '公开全文',
'H' => '公开摘要',
'N' => '不公开',
);
$lang->cmd_add_shortcut = "添加到快捷菜单";
$lang->cmd_install = "安装";
$lang->cmd_update = "升级";
$lang->cmd_manage_category = '分类管理';
$lang->cmd_manage_grant = '权限管理';
$lang->cmd_manage_skin = '皮肤管理';
$lang->cmd_manage_document = '主题管理';
$lang->msg_new_module = "模块生成";
$lang->msg_update_module = "模块修改";
$lang->msg_module_name_exists = "已存在的模块名称。请输入其他名称。";
$lang->msg_category_is_null = '没有登录的分类';
$lang->msg_grant_is_null = '没有登录的权限对象';
$lang->msg_no_checked_document = '没有被选择的主题';
$lang->msg_move_failed = '移动失败!';
$lang->msg_cannot_delete_for_child = '不能删除有下级分类的分类!';
$lang->about_browser_title = "显示在浏览器窗口的标题值。 在RSS/Trackback也可以使用。";
$lang->about_mid = "模块名称只允许使用英文,数字和下划线。";
$lang->about_default = "用没有mid值的网址访问网站时将会显示默认。";
$lang->about_module_category = "可以分类管理模块。 模块分类可以在 <a href=\"./?module=admin&amp;act=dispModuleAdminCategory\">模块管理 > 模块分类 </a>中进行管理。";
$lang->about_description= '管理用使用说明。';
$lang->about_default = '用没有mid值的网址访问网站时将会显示默认。';
$lang->about_header_text = '显示在模块顶部的内容。(可以使用HTML)';
$lang->about_footer_text = '显示在模块底部的内容。(可以使用HTML)';
$lang->about_skin = '可以选择模块皮肤。';
$lang->about_use_category = '选择此项可以使用分类功能。';
$lang->about_list_count = '可以指定每页显示的主题数。(默认为1个)';
$lang->about_page_count = '可以指定显示在目录下方的页面数。 (默认为10个)';
$lang->about_admin_id = '可以对该模块指定最高管理权限。<br />有多名管理员时,可以用,(逗号)来分隔。 (不能访问管理页面)';
$lang->about_grant = '全部解除特定权限的对象时,没有登录的会员也将具有相关权限。';
$lang->about_open_rss = '可以选择对该模块的RSS公开程度。RSS公开将不受查看内容权限的限制随公开RSS的选项公开RSS。';
$lang->about_module = "除基本library以外Zeroboard XE全部由模块组成。\n模块管理中列出所有已安装的模块,因此易于管理。\n常用模块可以通过『添加到快捷菜单』来方便管理。";
$lang->about_extra_vars_default_value = '复选/单选缺省值需要多个时,用,(逗号)来分隔。';
?>

View file

@ -0,0 +1,66 @@
<?php
/**
* @class moduleAdminController
* @author zero (zero@nzeo.com)
* @brief module 모듈의 admin controller class
**/
class moduleAdminController extends module {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 모듈 카테고리 추가
**/
function procModuleAdminInsertCategory() {
$args->title = Context::get('title');
$output = executeQuery('module.insertModuleCategory', $args);
if(!$output->toBool()) return $output;
$this->setMessage("success_registed");
}
/**
* @brief 카테고리의 내용 수정
**/
function procModuleAdminUpdateCategory() {
$mode = Context::get('mode');
switch($mode) {
case 'delete' :
$output = $this->doDeleteModuleCategory();
$msg_code = 'success_deleted';
break;
case 'update' :
$output = $this->doUpdateModuleCategory();
$msg_code = 'success_updated';
break;
}
if(!$output->toBool()) return $output;
$this->setMessage($msg_code);
}
/**
* @brief 모듈 카테고리의 제목 변경
**/
function doUpdateModuleCategory() {
$args->title = Context::get('title');
$args->module_category_srl = Context::get('module_category_srl');
return executeQuery('module.updateModuleCategory', $args);
}
/**
* @brief 모듈 카테고리 삭제
**/
function doDeleteModuleCategory() {
$args->module_category_srl = Context::get('module_category_srl');
return executeQuery('module.deleteModuleCategory', $args);
}
}
?>

View file

@ -0,0 +1,82 @@
<?php
/**
* @class moduleAdminView
* @author zero (zero@nzeo.com)
* @brief module 모듈의 admin view class
**/
class moduleAdminView extends module {
/**
* @brief 초기화
**/
function init() {
// template path 지정
$this->setTemplatePath($this->module_path.'tpl');
}
/**
* @brief 모듈 관리자 페이지
**/
function dispModuleAdminContent() {
$this->dispModuleAdminList();
}
/**
* @brief 모듈 목록 출력
**/
function dispModuleAdminList() {
// 모듈 목록을 구해서
$oModuleModel = &getModel('module');
$module_list = $oModuleModel->getModuleList();
Context::set('module_list', $module_list);
// 템플릿 파일 지정
$this->setTemplateFile('module_list');
}
/**
* @brief 모듈의 상세 정보(conf/info.xml) 팝업 출력
**/
function dispModuleAdminInfo() {
// 모듈 목록을 구해서
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoXml(Context::get('selected_module'));
Context::set('module_info', $module_info);
// 레이아웃을 팝업으로 지정
$this->setLayoutFile('popup_layout');
// 템플릿 파일 지정
$this->setTemplateFile('module_info');
}
/**
* @brief 모듈 카테고리 목록
**/
function dispModuleAdminCategory() {
$module_category_srl = Context::get('module_category_srl');
// 모듈 목록을 구해서
$oModuleModel = &getModel('module');
// 선택된 카테고리가 있으면 해당 카테고리의 정보 수정 페이지로
if($module_category_srl) {
$selected_category = $oModuleModel->getModuleCategory($module_category_srl);
Context::set('selected_category', $selected_category);
// 템플릿 파일 지정
$this->setTemplateFile('category_update_form');
// 아니면 전체 목록
} else {
$category_list = $oModuleModel->getModuleCategories();
Context::set('category_list', $category_list);
// 템플릿 파일 지정
$this->setTemplateFile('category_list');
}
}
}
?>

View file

@ -0,0 +1,42 @@
<?php
/**
* @class module
* @author zero (zero@nzeo.com)
* @brief module 모듈의 high class
**/
class module extends ModuleObject {
/**
* @brief 설치시 추가 작업이 필요할시 구현
**/
function moduleInstall() {
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionForward('module', 'view', 'dispModuleAdminContent');
$oModuleController->insertActionForward('module', 'view', 'dispModuleAdminList');
$oModuleController->insertActionForward('module', 'view', 'dispModuleAdminCategory');
$oModuleController->insertActionForward('module', 'view', 'dispModuleAdminInfo');
// module 모듈에서 사용할 디렉토리 생성
FileHandler::makeDir('./files/cache/module_info');
return new Object();
}
/**
* @brief 설치가 이상이 없는지 체크하는 method
**/
function checkUpdate() {
return false;
}
/**
* @brief 업데이트 실행
**/
function moduleUpdate() {
return new Object();
}
}
?>

View file

@ -0,0 +1,251 @@
<?php
/**
* @class moduleController
* @author zero (zero@nzeo.com)
* @brief module 모듈의 controller class
**/
class moduleController extends module {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 모듈의 기본 정보 입력
* 모듈의 정보를 입력받은 데이터를 serialize하여 등록한다.
**/
function insertModuleConfig($module, $config) {
// 변수 정리
$args->module = $module;
$args->config = serialize($config);
// 일단 삭제 (캐쉬 파일도 지운다)
$output = executeQuery('module.deleteModuleConfig', $args);
if(!$output->toBool()) return $output;
@unlink( sprintf('./files/cache/module_info/%s.config.php',$module) );
// 변수 정리후 query 실행
$output = executeQuery('module.insertModuleConfig', $args);
return $output;
}
/**
* @brief 모듈 입력
**/
function insertModule($args) {
// begin transaction
$oDB = &DB::getInstance();
$oDB->begin();
// 이미 존재하는 모듈 이름인지 체크
$output = executeQuery('module.isExistsModuleName', $args);
if(!$output->toBool() || $output->data->count) {
$oDB->rollback();
return new Object(-1, 'msg_module_name_exists');
}
// module model 객체 생성
$oModuleModel = &getModel('module');
// 선택된 스킨정보에서 colorset을 구함
$module_path = ModuleHandler::getModulePath($args->module);
$skin_info = $oModuleModel->loadSkinInfo($module_path, $args->skin);
$skin_vars->colorset = $skin_info->colorset[0]->name;
// 변수 정리후 query 실행
if(!$args->module_srl) $args->module_srl = getNextSequence();
$args->skin_vars = serialize($skin_vars);
$output = executeQuery('module.insertModule', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// commit
$oDB->commit();
$output->add('module_srl',$args->module_srl);
return $output;
}
/**
* @brief 모듈의 정보를 수정
**/
function updateModule($args) {
// begin transaction
$oDB = &DB::getInstance();
$oDB->begin();
// 이미 존재하는 모듈 이름인지 체크
$output = executeQuery('module.isExistsModuleName', $args);
if(!$output->toBool() || $output->data->count) {
$oDB->rollback();
return new Object(-1, 'msg_module_name_exists');
}
$output = executeQuery('module.updateModule', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
$output->add('module_srl',$args->module_srl);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
$oDB->commit();
return $output;
}
/**
* @brief action forward 추가
* action foward는 등록된 action이 요청된 모듈에 없을 경우 찾아서 포워딩을 하는 구조이다
* 모듈의 설치시에 사용된다.
**/
function insertActionForward($module, $type, $act) {
$args->module = $module;
$args->type = $type;
$args->act = $act;
$output = executeQuery('module.insertActionFoward', $args);
return $output;
}
/**
* @brief 모듈의 기타 정보를 변경
**/
function updateModuleSkinVars($module_srl, $skin_vars) {
// skin_vars 정보 세팅
$args->module_srl = $module_srl;
$args->skin_vars = $skin_vars;
$output = executeQuery('module.updateModuleSkinVars', $args);
if(!$output->toBool()) return $output;
return $output;
}
/**
* @brief 모듈의 권한 정보 변경
**/
function updateModuleGrant($module_srl, $grants) {
$args->module_srl = $module_srl;
$args->grants = $grants;
$output = executeQuery('module.updateModuleGrant', $args);
if(!$output->toBool()) return $output;
return $output;
}
/**
* @brief 모듈을 삭제
*
* 모듈 삭제시는 관련 정보들을 모두 삭제 시도한다.
**/
function deleteModule($module_srl) {
// begin transaction
$oDB = &DB::getInstance();
$oDB->begin();
$args->module_srl = $module_srl;
// addon 삭제
// widget 삭제
// document 삭제
$oDocumentController = &getAdminController('document');
$output = $oDocumentController->deleteModuleDocument($module_srl);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// category 삭제
$output = $oDocumentController->deleteModuleCategory($module_srl);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// trackbacks 삭제
$oTrackbackController = &getAdminController('trackback');
$output = $oTrackbackController->deleteModuleTrackbacks($module_srl);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// comments 삭제
$oCommentController = &getAdminController('comment');
$output = $oCommentController->deleteModuleComments($module_srl);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// tags 삭제
$oTagController = &getAdminController('tag');
$output = $oTagController->deleteModuleTags($module_srl);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// 첨부 파일 삭제
$oFileController = &getAdminController('file');
$output = $oFileController->deleteModuleFiles($module_srl);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// module 정보를 DB에서 삭제
$output = executeQuery('module.deleteModule', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// commit
$oDB->commit();
return $output;
}
/**
* @brief 모든 모듈의 is_default값을 N 으로 세팅 (기본 모듈 해제)
**/
function clearDefaultModule() {
$output = executeQuery('module.clearDefaultModule');
if(!$output->toBool()) return $output;
return $output;
}
/**
* @brief 지정된 menu_srl에 속한 mid menu_srl 변경
**/
function updateModuleMenu($args) {
return executeQuery('module.updateModuleMenu', $args);
}
/**
* @brief 지정된 menu_srl에 속한 mid layout_srl을 변경
**/
function updateModuleLayout($layout_srl, $menu_srl_list) {
if(!count($menu_srl_list)) return;
$args->layout_srl = $layout_srl;
$args->menu_srls = implode(',',$menu_srl_list);
return executeQuery('module.updateModuleLayout', $args);
}
}
?>

View file

@ -0,0 +1,563 @@
<?php
/**
* @class moduleModel
* @author zero (zero@nzeo.com)
* @brief module 모듈의 Model class
**/
class moduleModel extends module {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief document_srl로 모듈의 정보르 구함
*
* 경우는 캐시파일을 이용할 수가 없음
**/
function getModuleInfoByDocumentSrl($document_srl) {
// 데이터를 DB에서 가져옴
$args->document_srl = $document_srl;
$output = executeQuery('module.getModuleInfoByDocument', $args);
return $this->arrangeModuleInfo($output->data);
}
/**
* @brief mid로 모듈의 정보를 구함
**/
function getModuleInfoByMid($mid='') {
// $mid값이 인자로 주어질 경우 $mid로 모듈의 정보를 구함
if($mid) {
$args->mid = $mid;
$output = executeQuery('module.getMidInfo', $args);
}
// 모듈의 정보가 없다면($mid가 잘못이거나 없었을 경우) 기본 모듈을 가져옴
if(!$output->data) {
$output = executeQuery('module.getDefaultMidInfo');
}
$module_info = $this->arrangeModuleInfo($output->data);
return $module_info;
}
/**
* @brief module_srl에 해당하는 모듈의 정보를 구함
**/
function getModuleInfoByModuleSrl($module_srl) {
// 데이터를 가져옴
$args->module_srl = $module_srl;
$output = executeQuery('module.getMidInfo', $args);
if(!$output->data) return;
$module_info = $this->arrangeModuleInfo($output->data);
return $module_info;
}
/**
* @brief DB에서 가져온 모듈 정보에서 grant, extraVar등의 정리
**/
function arrangeModuleInfo($source_module_info) {
if(!$source_module_info || !is_object($source_module_info) ) return;
// serialize되어 있는 변수들 추출
$extra_vars = $source_module_info->extra_vars;
$skin_vars = $source_module_info->skin_vars;
$grants = $source_module_info->grants;
$admin_id = $source_module_info->admin_id;
unset($source_module_info->extra_vars);
unset($source_module_info->skin_vars);
unset($source_module_info->grants);
unset($source_module_info->admin_id);
$module_info = clone($source_module_info);
// extra_vars의 정리
if($extra_vars) {
$extra_vars = unserialize($extra_vars);
foreach($extra_vars as $key => $val) if(!$module_info->{$key}) $module_info->{$key} = $val;
}
// skin_vars의 정리
if($skin_vars) {
$skin_vars = unserialize($skin_vars);
foreach($skin_vars as $key => $val) if(!$module_info->{$key}) $module_info->{$key} = $val;
}
// 권한의 정리
if($grants) $module_info->grants = unserialize($grants);
// 관리자 아이디의 정리
if($admin_id) $module_info->admin_id = explode(',',$admin_id);
else $module_info->admin_id = array();
return $module_info;
}
/**
* @brief act 값에 의한 forward 값을 구함
**/
function getActionForward($act) {
$args->act = $act;
$output = executeQuery('module.getActionForward',$args);
return $output->data;
}
/**
* @brief DB에 생성된 mid목록을 구해옴
**/
function getMidList($args = null) {
$output = executeQuery('module.getMidList', $args);
if(!$output->toBool()) return $output;
$list = $output->data;
if(!$list) return;
if(!is_array($list)) $list = array($list);
foreach($list as $val) {
$mid_list[$val->mid] = $val;
}
return $mid_list;
}
/**
* @brief mid 목록에 대응하는 module_srl을 배열로 return
**/
function getModuleSrlByMid($mid) {
if(is_array($mid)) $mid = "'".implode("','",$mid)."'";
$args->mid = $mid;
$output = executeQuery('module.getModuleSrlByMid', $args);
if(!$output->toBool()) return $output;
$list = $output->data;
if(!$list) return;
if(!is_array($list)) $list = array($list);
foreach($list as $key => $val) $module_srl_list[] = $val->module_srl;
return $module_srl_list;
}
/**
* @brief 주어진 곳의 스킨 목록을 구함
* 스킨과 skin.xml 파일을 분석 정리한 결과를 return
**/
function getSkins($path) {
$skin_path = sprintf("%s/skins/", $path);
$list = FileHandler::readDir($skin_path);
if(!count($list)) return;
foreach($list as $skin_name) {
unset($skin_info);
$skin_info = $this->loadSkinInfo($path, $skin_name);
if(!$skin_info) $skin_info->title = $skin_name;
$skin_list[$skin_name] = $skin_info;
}
return $skin_list;
}
/**
* @brief 특정 위치의 특정 스킨의 정보를 구해옴
**/
function loadSkinInfo($path, $skin) {
// 모듈의 스킨의 정보 xml 파일을 읽음
$skin_xml_file = sprintf("%sskins/%s/skin.xml", $path, $skin);
if(!file_exists($skin_xml_file)) return;
// XmlParser 객체 생성
$oXmlParser = new XmlParser();
$_xml_obj = $oXmlParser->loadXmlFile($skin_xml_file);
// 스킨 정보가 없으면 return
if(!$_xml_obj->skin) return;
$xml_obj = $_xml_obj->skin;
// 스킨이름
$skin_info->title = $xml_obj->title->body;
// 작성자 정보
$skin_info->maker->name = $xml_obj->maker->name->body;
$skin_info->maker->email_address = $xml_obj->maker->attrs->email_address;
$skin_info->maker->homepage = $xml_obj->maker->attrs->link;
$skin_info->maker->date = $xml_obj->maker->attrs->date;
$skin_info->maker->description = $xml_obj->maker->description->body;
// colorset
$colorset = $xml_obj->colorset->color;
if($colorset) {
if(!is_array($colorset)) $colorset = array($colorset);
foreach($colorset as $color) {
$name = $color->attrs->name;
$title = $color->title->body;
$screenshot = $color->attrs->src;
if($screenshot) {
$screenshot = sprintf("%sskins/%s/%s", $path, $skin, $screenshot);
if(!file_exists($screenshot)) $screenshot = "";
} else $screenshot = "";
unset($obj);
$obj->name = $name;
$obj->title = $title;
$obj->screenshot = $screenshot;
$skin_info->colorset[] = $obj;
}
}
// 스킨에서 사용되는 변수들
$extra_vars = $xml_obj->extra_vars->var;
if($extra_vars) {
if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
foreach($extra_vars as $var) {
$name = $var->attrs->name;
$type = $var->attrs->type;
$title = $var->title->body;
$description = $var->description->body;
if($var->default) {
unset($default);
if(is_array($var->default)) {
for($i=0;$i<count($var->default);$i++) $default[] = $var->default[$i]->body;
} else {
$default = $var->default->body;
}
}
$width = $var->attrs->width;
$height = $var->attrs->height;
unset($obj);
$obj->title = $title;
$obj->description = $description;
$obj->name = $name;
$obj->type = $type;
$obj->default = $default;
$obj->width = $width;
$obj->height = $height;
$skin_info->extra_vars[] = $obj;
}
}
// 메뉴 종류 (레이아웃을 위한 설정)
if($xml_obj->menus->menu) {
$menus = $xml_obj->menus->menu;
if(!is_array($menus)) $menus = array($menus);
$menu_count = count($menus);
$skin_info->menu_count = $menu_count;
for($i=0;$i<$menu_count;$i++) {
unset($obj);
$obj->name = $menus[$i]->attrs->name;
if($menus[$i]->attrs->default == "true") $obj->default = true;
$obj->title = $menus[$i]->title->body;
$obj->maxdepth = $menus[$i]->maxdepth->body;
$skin_info->menu->{$obj->name} = $obj;
}
}
return $skin_info;
}
/**
* @brief module의 conf/module.xml 통해 grant(권한) action 데이터를 return
*
* module.xml 파일의 경우 파싱하는데 시간이 걸리기에 캐싱을 한다...
* 캐싱을 할때 바로 include 있도록 역시 코드까지 추가하여 캐싱을 한다.
* 이게 퍼포먼스 상으로는 좋은데 어떤 부정적인 결과를 유도할지는 모르겠...
**/
function getModuleActionXml($module) {
// 요청된 모듈의 경로를 구한다. 없으면 return
$class_path = ModuleHandler::getModulePath($module);
if(!$class_path) return;
// 해당 경로에 module.xml 파일이 있는지 체크한다. 없으면 return
$xml_file = sprintf("%sconf/module.xml", $class_path);
if(!file_exists($xml_file)) return;
// 캐시된 파일이 있는지 확인
$cache_file = sprintf("./files/cache/module_info/%s.%s.php", $module, Context::getLangType());
// 캐시 파일이 없거나 캐시 파일이 xml 파일보다 오래되었으면 내용 다시 갱신
if(!file_exists($cache_file) || filectime($cache_file)<filectime($xml_file)) {
$buff = ""; ///< 캐시 파일에 쓸 buff 변수 설정
$xml_obj = XmlParser::loadXmlFile($xml_file); ///< xml 파일을 읽어서 xml object로 변환
if(!count($xml_obj->module)) return; ///< xml 내용중에 module 태그가 없다면 오류;;
$grants = $xml_obj->module->grants->grant; ///< 권한 정보 (없는 경우도 있음)
$actions = $xml_obj->module->actions->action; ///< action list (필수)
$default_index = $admin_index = '';
// 권한 정보의 정리
if($grants) {
if(is_array($grants)) $grant_list = $grants;
else $grant_list[] = $grants;
foreach($grant_list as $grant) {
$name = $grant->attrs->name;
$default = $grant->attrs->default?$grant->attrs->default:'guest';
$title = $grant->title->body;
$info->grant->{$name}->title = $title;
$info->grant->{$name}->default = $default;
$buff .= sprintf('$info->grant->%s->title=\'%s\';', $name, $title);
$buff .= sprintf('$info->grant->%s->default=\'%s\';', $name, $default);
}
}
// actions 정리
if($actions) {
if(is_array($actions)) $action_list = $actions;
else $action_list[] = $actions;
foreach($action_list as $action) {
$name = $action->attrs->name;
$type = $action->attrs->type;
$grant = $action->attrs->grant?$action->attrs->grant:'guest';
$standalone = $action->attrs->standalone=='true'?'true':'false';
$index = $action->attrs->index;
$admin_index = $action->attrs->admin_index;
$output->action->{$name}->type = $type;
$output->action->{$name}->grant = $grant;
$output->action->{$name}->standalone= $standalone;
$info->action->{$name}->type = $type;
$info->action->{$name}->grant = $grant;
$info->action->{$name}->standalone = $standalone=='true'?true:false;
$buff .= sprintf('$info->action->%s->type=\'%s\';', $name, $type);
$buff .= sprintf('$info->action->%s->grant=\'%s\';', $name, $grant);
$buff .= sprintf('$info->action->%s->standalone=%s;', $name, $standalone);
if($index=='true') {
$default_index_act = $name;
$info->default_index_act = $name;
}
if($admin_index=='true') {
$admin_index_act = $name;
$info->admin_index_act = $name;
}
}
}
$buff = sprintf('<?php if(!defined("__ZBXE__")) exit();$info->default_index_act = \'%s\';$info->admin_index_act = \'%s\';%s?>', $default_index_act, $admin_index_act, $buff);
FileHandler::writeFile($cache_file, $buff);
return $info;
}
@include($cache_file);
return $info;
}
/**
* @brief 특정 모듈의 설정 정보 return
* 캐시된 설정 정보가 없으면 만들 캐시하고 return
**/
function getModuleConfig($module) {
if(!$GLOBALS['__ModuleConfig__'][$module]) {
$cache_file = sprintf('./files/cache/module_info/%s.config.php',$module);
if(!file_exists($cache_file)) {
$args->module = $module;
$output = executeQuery('module.getModuleConfig', $args);
$config = base64_encode($output->data->config);
$buff = sprintf('<?php if(!defined("__ZBXE__")) exit(); $config = "%s"; ?>', $config);
FileHandler::writeFile($cache_file, $buff);
}
if(!$config && file_exists($cache_file)) @include($cache_file);
$GLOBALS['__ModuleConfig__'][$module] = unserialize(base64_decode($config));
}
return $GLOBALS['__ModuleConfig__'][$module];
}
/**
* @brief 모듈의 conf/info.xml 읽어서 정보를 구함
**/
function getModuleInfoXml($module) {
// 요청된 모듈의 경로를 구한다. 없으면 return
$module_path = ModuleHandler::getModulePath($module);
if(!$module_path) return;
// 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음
$xml_file = sprintf("%s/conf/info.xml", $module_path);
if(!file_exists($xml_file)) return;
$oXmlParser = new XmlParser();
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
$xml_obj = $tmp_xml_obj->module;
if(!$xml_obj) return;
$info->title = $xml_obj->title->body;
// 작성자 정보
$module_info->title = $xml_obj->title->body;
$module_info->version = $xml_obj->attrs->version;
$module_info->author->name = $xml_obj->author->name->body;
$module_info->author->email_address = $xml_obj->author->attrs->email_address;
$module_info->author->homepage = $xml_obj->author->attrs->link;
$module_info->author->date = $xml_obj->author->attrs->date;
$module_info->author->description = $xml_obj->author->description->body;
// history
if(!is_array($xml_obj->history->author)) $history[] = $xml_obj->history->author;
else $history = $xml_obj->history->author;
foreach($history as $item) {
unset($obj);
$obj->name = $item->name->body;
$obj->email_address = $item->attrs->email_address;
$obj->homepage = $item->attrs->link;
$obj->date = $item->attrs->date;
$obj->description = $item->description->body;
$module_info->history[] = $obj;
}
// action 정보를 얻어서 admin_index를 추가
$action_info = $this->getModuleActionXml($module);
$module_info->admin_index_act = $action_info->admin_index_act;
return $module_info;
}
/**
* @brief 모듈 카테고리의 목록을 구함
**/
function getModuleCategories() {
// 데이터를 DB에서 가져옴
$output = executeQuery('module.getModuleCategories');
if(!$output->toBool()) return $output;
$list = $output->data;
if(!$list) return;
if(!is_array($list)) $list = array($list);
foreach($list as $val) {
$category_list[$val->module_category_srl] = $val;
}
return $category_list;
}
/**
* @brief 특정 모듈 카테고리의 내용을 구함
**/
function getModuleCategory($module_category_srl) {
// 데이터를 DB에서 가져옴
$args->module_category_srl = $module_category_srl;
$output = executeQuery('module.getModuleCategory', $args);
if(!$output->toBool()) return $output;
return $output->data;
}
/**
* @brief 모듈의 xml 정보만 구함
**/
function getModulesXmlInfo() {
// 다운받은 모듈과 설치된 모듈의 목록을 구함
$searched_list = FileHandler::readDir('./modules');
$searched_count = count($searched_list);
if(!$searched_count) return;
for($i=0;$i<$searched_count;$i++) {
// 모듈의 이름
$module_name = $searched_list[$i];
$path = ModuleHandler::getModulePath($module_name);
// 해당 모듈의 정보를 구함
$info = $this->getModuleInfoXml($module_name);
unset($obj);
$info->module = $module_name;
$info->created_table_count = $created_table_count;
$info->table_count = $table_count;
$info->path = $path;
$info->admin_index_act = $info->admin_index_act;
$list[] = $info;
}
return $list;
}
/**
* @brief 모듈의 종류와 정보를 구함
**/
function getModuleList() {
// DB 객체 생성
$oDB = &DB::getInstance();
// 다운받은 모듈과 설치된 모듈의 목록을 구함
$searched_list = FileHandler::readDir('./modules');
$searched_count = count($searched_list);
if(!$searched_count) return;
for($i=0;$i<$searched_count;$i++) {
// 모듈의 이름
$module_name = $searched_list[$i];
$path = ModuleHandler::getModulePath($module_name);
// schemas내의 테이블 생성 xml파일수를 구함
$tmp_files = FileHandler::readDir($path."schemas");
$table_count = count($tmp_files);
// 테이블이 설치되어 있는지 체크
$created_table_count = 0;
for($j=0;$j<count($tmp_files);$j++) {
list($table_name) = explode(".",$tmp_files[$j]);
if($oDB->isTableExists($table_name)) $created_table_count ++;
}
// 해당 모듈의 정보를 구함
$info = $this->getModuleInfoXml($module_name);
unset($obj);
$info->module = $module_name;
$info->created_table_count = $created_table_count;
$info->table_count = $table_count;
$info->path = $path;
$info->admin_index_act = $info->admin_index_act;
// 설치 유무 체크 (설치는 DB의 설치만 관리)
if($table_count > $created_table_count) $info->need_install = treu;
else $info->need_install = false;
// 각 모듈의 module.class.php로 upgrade 유무 체크
$oDummy = null;
$oDummy = &getModule($module_name, 'class');
if($oDummy) $info->need_update = $oDummy->checkUpdate();
$list[] = $info;
}
return $list;
}
}
?>

View file

@ -0,0 +1,41 @@
<?php
/**
* @class moduleView
* @author zero (zero@nzeo.com)
* @brief module 모듈의 view class
**/
class moduleView extends module {
/**
* @brief 초기화
**/
function init() {
// template path 지정
$this->setTemplatePath($this->module_path.'tpl');
}
/**
* @brief 스킨 정보 출력
**/
function dispModuleSkinInfo() {
$selected_module = Context::get('selected_module');
$skin = Context::get('skin');
// 모듈/스킨 정보를 구함
$module_path = sprintf("./modules/%s/", $selected_module);
if(!is_dir($module_path)) $this->stop("msg_invalid_request");
$skin_info_xml = sprintf("%sskins/%s/skin.xml", $module_path, $skin);
if(!file_exists($skin_info_xml)) $this->stop("msg_invalid_request");
$oModuleModel = &getModel('module');
$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
Context::set('skin_info',$skin_info);
$this->setLayoutFile("popup_layout");
$this->setTemplateFile("skin_info");
}
}
?>

View file

@ -0,0 +1,8 @@
<query id="clearDefaultModule" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="is_default" var="is_default" default="N" />
</columns>
</query>

View file

@ -0,0 +1,8 @@
<query id="deleteModule" action="delete">
<tables>
<table name="modules" />
</tables>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,8 @@
<query id="deleteModuleCategory" action="delete">
<tables>
<table name="module_categories" />
</tables>
<conditions>
<condition operation="equal" column="module_category_srl" var="module_category_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -0,0 +1,8 @@
<query id="deleteModuleConfig" action="delete">
<tables>
<table name="module_config" />
</tables>
<conditions>
<condition operation="equal" column="module" var="module" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="getActionForward" action="select">
<tables>
<table name="action_forward" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="act" var="act" />
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="getDefaultMidInfo" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="is_default" default="Y" />
</conditions>
</query>

View file

@ -0,0 +1,12 @@
<query id="getMidInfo" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="mid" var="mid" />
<condition operation="equal" column="module_srl" var="module_srl" pipe="and" />
</conditions>
</query>

View file

@ -0,0 +1,16 @@
<query id="getMidList" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="module_category_srl" var="module_category_srl" />
<condition operation="equal" column="module" var="module" pipe="and" />
<condition operation="in" column="open_rss" var="open_rss" pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="mid" order="asc" />
</navigation>
</query>

View file

@ -0,0 +1,6 @@
<query id="getModuleCategories" action="select">
<tables>
<table name="module_categories" />
</tables>
<columns />
</query>

View file

@ -0,0 +1,9 @@
<query id="selectModuleCategory" action="select">
<tables>
<table name="module_categories" />
</tables>
<columns />
<conditions>
<condition operation="equal" column="module_category_srl" var="module_category_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="getModuleConfig" action="select">
<tables>
<table name="module_config" />
</tables>
<columns>
<column name="config" />
</columns>
<conditions>
<condition operation="equal" column="module" var="module" />
</conditions>
</query>

View file

@ -0,0 +1,13 @@
<query id="getModuleInfoByDocument" action="select">
<tables>
<table name="modules" />
<table name="documents" />
</tables>
<columns>
<column name="modules.*" />
</columns>
<conditions>
<condition operation="equal" column="documents.document_srl" var="document_srl" notnull="notnull" />
<condition operation="equal" column="modules.module_srl" var="documents.module_srl" pipe="and" />
</conditions>
</query>

View file

@ -0,0 +1,8 @@
<query id="getModuleInfoByModuleSrl" action="select">
<tables>
<table name="modules" />
</tables>
<conditions>
<condition operation="in" column="module_srl" var="module_srls" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="getModuleSrlByMid" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="module_srl" />
</columns>
<conditions>
<condition operation="in" column="mid" var="mid" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,10 @@
<query id="insertActionFoward" action="insert">
<tables>
<table name="action_forward" />
</tables>
<columns>
<column name="act" var="act" notnull="notnull" />
<column name="module" var="module" notnull="notnull" />
<column name="type" var="type" notnull="notnull" />
</columns>
</query>

View file

@ -0,0 +1,25 @@
<query id="insertModule" action="insert">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="module_srl" var="module_srl" notnull="notnull" />
<column name="module_category_srl" var="module_category_srl" default="0" />
<column name="mid" var="mid" notnull="notnull" minlength="1" maxlength="40" />
<column name="skin" var="skin" minlength="1" maxlength="250" />
<column name="browser_title" var="browser_title" notnull="notnull" minlength="1" maxlength="250" />
<column name="layout_srl" var="layout_srl" />
<column name="description" var="description" />
<column name="content" var="content" />
<column name="module" var="module" notnull="notnull" maxlength="80"/>
<column name="is_default" var="is_default" default="N" notnull="notnull" />
<column name="menu_srl" var="menu_srl" filter="number" />
<column name="extra_vars" var="extra_vars" />
<column name="skin_vars" var="skin_vars" />
<column name="admin_id" var="admin_id" maxlength="80" />
<column name="open_rss" var="open_rss" default="Y" notnull="notnull" />
<column name="header_text" var="header_text" />
<column name="footer_text" var="footer_text" />
<column name="regdate" default="curdate()" />
</columns>
</query>

View file

@ -0,0 +1,10 @@
<query id="insertModuleCategory" action="insert">
<tables>
<table name="module_categories" />
</tables>
<columns>
<column name="module_category_srl" default="sequence()" />
<column name="title" var="title" notnull="notnull"/>
<column name="regdate" default="curdate()" />
</columns>
</query>

View file

@ -0,0 +1,10 @@
<query id="insertModuleConfig" action="insert">
<tables>
<table name="module_config" />
</tables>
<columns>
<column name="module" var="module" notnull="notnull" />
<column name="config" var="config" />
<column name="regdate" default="curdate()" />
</columns>
</query>

View file

@ -0,0 +1,12 @@
<query id="isExistsModuleName" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="count(*)" alias="count" />
</columns>
<conditions>
<condition operation="equal" column="mid" var="mid" notnull="notnull" />
<condition operation="notequal" column="module_srl" var="module_srl" default="0" notnull="notnull" pipe="and" />
</conditions>
</query>

View file

@ -0,0 +1,25 @@
<query id="updateModule" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="mid" var="mid" notnull="notnull" minlength="1" maxlength="40"/>
<column name="module_category_srl" var="module_category_srl" />
<column name="skin" var="skin" minlength="1" maxlength="250" />
<column name="browser_title" var="browser_title" notnull="notnull" minlength="1" maxlength="250" />
<column name="layout_srl" var="layout_srl" />
<column name="description" var="description" />
<column name="content" var="content" />
<column name="module" var="module" notnull="notnull" maxlength="80"/>
<column name="is_default" var="is_default" default="N" notnull="notnull" />
<column name="menu_srl" var="menu_srl" filter="number" />
<column name="extra_vars" var="extra_vars" />
<column name="admin_id" var="admin_id" maxlength="80" />
<column name="open_rss" var="open_rss" default="Y" notnull="notnull" />
<column name="header_text" var="header_text" />
<column name="footer_text" var="footer_text" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="updateModuleCategory" action="update">
<tables>
<table name="module_categories" />
</tables>
<columns>
<column name="title" var="title" notnull="notnull"/>
</columns>
<conditions>
<condition operation="equal" column="module_category_srl" var="module_category_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="updateModuleGrant" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="grants" var="grants" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="updateModuleLayout" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="layout_srl" var="layout_srl" />
</columns>
<conditions>
<condition operation="in" column="menu_srl" var="menu_srls" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -0,0 +1,12 @@
<query id="updateModuleMenu" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="menu_srl" var="menu_srl" />
<column name="layout_srl" var="layout_srl" />
</columns>
<conditions>
<condition operation="equal" column="mid" var="mid" notnull="notnull"/>
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="updateModuleSkinVars" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="skin_vars" var="skin_vars" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -0,0 +1,5 @@
<table name="action_forward">
<column name="act" type="varchar" size="80" notnull="notnull" unique="idx_foward"/>
<column name="module" type="varchar" size="60" notnull="notnull" />
<column name="type" type="varchar" size="15" notnull="notnull" />
</table>

View file

@ -0,0 +1,5 @@
<table name="module_categories">
<column name="module_category_srl" type="number" size="11" default="0" notnull="notnull" primary_key="primary_key" />
<column name="title" type="varchar" size="250" />
<column name="regdate" type="date" index="idx_regdate" />
</table>

View file

@ -0,0 +1,5 @@
<table name="module_config">
<column name="module" type="varchar" size="250" notnull="notnull" primary_key="primary_key" />
<column name="config" type="text" />
<column name="regdate" type="date" />
</table>

View file

@ -0,0 +1,21 @@
<table name="modules">
<column name="module_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="module" type="varchar" size="80" notnull="notnull" index="idx_module" />
<column name="module_category_srl" type="number" size="11" default="0" index="idx_module_category" />
<column name="layout_srl" type="number" size="11" default="0" />
<column name="menu_srl" type="number" size="11" default="0"/>
<column name="mid" type="varchar" size="40" notnull="notnull" unique="unique_mid"/>
<column name="skin" type="varchar" size="250" />
<column name="browser_title" type="varchar" size="250" notnull="notnull"/>
<column name="description" type="text" />
<column name="is_default" type="char" size="1" notnull="notnull" default="N" />
<column name="extra_vars" type="text" />
<column name="skin_vars" type="text" />
<column name="content" type="bigtext"/>
<column name="grants" type="text" />
<column name="admin_id" type="text" />
<column name="open_rss" type="char" size="1" notnull="notnull" default="Y" />
<column name="header_text" type="text" />
<column name="footer_text" type="text" />
<column name="regdate" type="date" />
</table>

View file

@ -0,0 +1,59 @@
<!--%import("filter/insert_category.xml")-->
<!--%import("filter/update_category.xml")-->
<!--#include("./header.html")-->
<!-- 카테고리의 위/아래, 삭제와 관련된 form -->
<form id="fo_category_info" action="./" method="get">
<input type="hidden" name="module_category_srl" value="" />
<input type="hidden" name="mode" value="" />
</form>
<table cellspacing="0" class="tableType1 gap1">
<thead>
<tr>
<th scope="col">{$lang->category_title}</th>
<th scope="col">{$lang->regdate}</th>
<th scope="col">{$lang->cmd_modify}</th>
<th scope="col">{$lang->cmd_delete}</th>
</tr>
</thead>
<tbody>
<!--@if(!count($category_list))-->
<tr>
<td colspan="4">{$lang->msg_category_is_null}</td>
</tr>
<!--@end-->
<!--@foreach($category_list as $key => $val)-->
<tr>
<td>{$val->title}</td>
<td class="tahoma">{zdate($val->regdate,"Y-m-d H:i:s")}</td>
<td class="blue"><a href="{getUrl('module_category_srl',$val->module_category_srl)}">{$lang->cmd_modify}</a></td>
<td><a href="#" onclick="doUpdateCategory('{$val->module_category_srl}','delete','{$lang->confirm_delete}');return false;" class="button"><span>{$lang->cmd_delete}</span></a></td>
</tr>
<!--@end-->
</tbody>
</table>
<!-- 카테고리 추가 -->
<form action="./" method="post" onsubmit="return procFilter(this, insert_category)">
<input type="hidden" name="page" value="{$page}" />
<input type="hidden" name="module_srl" value="{$module_srl}" />
<input type="hidden" name="module_category_srl" value="" />
<table cellspacing="0" class="tableType3 gap1">
<col width="150" />
<col />
<tr>
<th scope="row">{$lang->category_title}</th>
<td>
<input type="text" name="title" class="inputTypeText w100" />
</td>
</tr>
</table>
<div class="tRight gap1">
<span class="button"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
</div>
</form>

View file

@ -0,0 +1,27 @@
<!--%import("filter/update_category.xml")-->
<!--#include("./header.html")-->
<!-- 카테고리 수정 -->
<!--@if($selected_category)-->
<form action="./" method="post" onsubmit="return procFilter(this, update_category)" enctype="multipart/form-data">
<input type="hidden" name="module_category_srl" value="{$selected_category->module_category_srl}" />
<input type="hidden" name="mode" value="update" />
<table cellspacing="0" class="tableType3 gap1">
<col width="150" />
<col />
<tr>
<th scope="row">{$lang->category_title}</th>
<td>
<input type="text" name="title" value="{$selected_category->title}" class="inputTypeText w100" />
</td>
</tr>
</table>
<div class="tRight gap1">
<span class="button"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
</div>
</form>
<!--@end-->

View file

@ -0,0 +1,19 @@
<!--#include("header.html")-->
<form action="./" method="get" onsubmit="return procFilter(this, insert_config)">
<table border="1">
<tr>
<th rowspan="2">{$lang->test}</th>
<td><input type="text" name="test" value="{$config->test}" /></td>
</tr>
<tr>
<td>{$lang->about_test}</td>
</tr>
<tr>
<td colspan="2">
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('act','')}'" />
<input type="submit" value="{$lang->cmd_registration}" accesskey="s" />
</td>
</tr>
</table>
</form>

View file

@ -0,0 +1,10 @@
<filter name="insert_category" module="module" act="procModuleAdminInsertCategory" confirm_msg_code="confirm_submit">
<form>
<node target="title" required="true" />
</form>
<response callback_func="completeUpdateCategory">
<tag name="error" />
<tag name="message" />
<tag name="page" />
</response>
</filter>

View file

@ -0,0 +1,9 @@
<filter name="insert_shortcut" module="admin" act="procAdminInsertShortCut" confirm_msg_code="confirm_submit">
<form>
<node target="module" required="true" />
</form>
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -0,0 +1,10 @@
<filter name="update_category" module="module" act="procModuleAdminUpdateCategory">
<form>
<node target="module_category_srl" required="true" />
<node target="mode" required="true" />
</form>
<response callback_func="completeUpdateCategory">
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -0,0 +1,15 @@
<!--%import("js/module_admin.js")-->
<h3>{$lang->module} <span class="gray">{$lang->cmd_management}</span></h3>
<!--@if($act == 'dispModuleAdminContent')-->
<div class="infoText">{nl2br($lang->about_module)}</div>
<!--@end-->
<div class="header4">
<div class="summary">&nbsp;</div>
<ul class="localNavigation">
<li <!--@if($act=='dispModuleAdminContent')-->class="on"<!--@end-->><a href="{getUrl('act','dispModuleAdminContent')}">{$lang->module_index}</a></li>
<li <!--@if($act=='dispModuleAdminCategory')-->class="on"<!--@end-->><a href="{getUrl('act','dispModuleAdminCategory')}">{$lang->module_category}</a></li>
</ul>
</div>

View file

@ -0,0 +1 @@
<!--#include("header.html")-->

View file

@ -0,0 +1,52 @@
/**
* @file modules/module/js/module_admin.js
* @author zero (zero@nzeo.com)
* @brief module 모듈의 관리자용 javascript
**/
/* 카테고리 관련 작업들 */
function doUpdateCategory(module_category_srl, mode, message) {
if(typeof(message)!='undefined'&&!confirm(message)) return;
var fo_obj = xGetElementById('fo_category_info');
fo_obj.module_category_srl.value = module_category_srl;
fo_obj.mode.value = mode;
procFilter(fo_obj, update_category);
}
/* 카테고리 정보 수정 후 */
function completeUpdateCategory(ret_obj) {
var error = ret_obj['error'];
var message = ret_obj['message'];
alert(message);
location.href = current_url.setQuery('module_category_srl','');
}
/* 선택된 모듈을 관리자 메뉴의 바로가기에 등록 */
function doAddShortCut(module) {
var fo_obj = xGetElementById("fo_shortcut");
fo_obj.selected_module.value = module;
procFilter(fo_obj, insert_shortcut);
}
/* 모듈 설치 */
function doInstallModule(module) {
var params = new Array();
params['module_name'] = module;
exec_xml('install','procInstallAdminInstall',params, completeInstallModule);
}
function completeInstallModule(ret_obj) {
alert(ret_obj['message']);
location.reload();
}
/* 모듈 업그레이드 */
function doUpdateModule(module) {
var params = new Array();
params['module_name'] = module;
exec_xml('install','procInstallAdminUpdate',params, completeInstallModule);
}

View file

@ -0,0 +1,36 @@
<div id="popHeadder">
<h1>{$lang->module_maker}</h1>
</div>
<div id="popBody">
<table cellspacing="0" class="tableType5">
<col width="100" />
<col />
<tr>
<th scope="row">{$lang->title}</th>
<td>{$module_info->title} ver {$module_info->version}</td>
</tr>
<tr>
<th scope="row">{$lang->author}</th>
<td><a href="mailto:{$module_info->author->email_address}">{$module_info->author->name}</a></td>
</tr>
<tr>
<th scope="row">{$lang->homepage}</th>
<td><a href="{$module_info->author->homepage}" onclick="window.open(this.href);return false;">{$module_info->author->homepage}</a></td>
</tr>
<tr>
<th scope="row">{$lang->regdate}</th>
<td>{$module_info->author->date}</td>
</tr>
<tr>
<th scope="row">{$lang->description}</th>
<td>{nl2br($module_info->author->description)}</td>
</tr>
</table>
</div>
<div id="popFooter" class="tCenter gap1">
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
</div>

View file

@ -0,0 +1,61 @@
<!--%import("filter/insert_shortcut.xml")-->
<!--#include("header.html")-->
<!-- 관리자 메뉴 바로가기 추가를 위한 임시 form -->
<form id="fo_shortcut" action="./" method="get">
<input type="hidden" name="selected_module" value="" />
</form>
<table cellspacing="0" class="tableType1">
<thead>
<tr>
<th scope="col">{$lang->module_name}</th>
<th scope="col">{$lang->version}</th>
<th scope="col">{$lang->author}</th>
<th scope="col">{$lang->date}</th>
<th scope="col">{$lang->table_count}</th>
<th scope="col">{$lang->installed_path}</th>
<th scope="col">{$lang->module_info}</th>
<th scope="col">{$lang->module_action}</th>
<th scope="col">{$lang->add_shortcut}</th>
</tr>
</thead>
<tbody>
<!--@foreach($module_list as $key => $val)-->
<tr>
<td class="left gl3 blue">
<!--@if($val->admin_index_act)-->
<a href="{getUrl('act',$val->admin_index_act)}">{$val->title}</a> ({$val->module})
<!--@else-->
{$val->title} ({$val->module})
<!--@end-->
</td>
<td class="tahoma">{$val->version}</td>
<td><a href="{$val->author->homepage}" onclick="window.open(this.href);return false;">{$val->author->name}</a></td>
<td class="tahoma">{$val->author->date}</td>
<td class="tahoma <!--@if($val->created_table_count != $val->table_count)-->red<!--@end-->">
{$val->created_table_count}/{$val->table_count}
</td>
<td class="tahoma left">{$val->path}</td>
<td class="blue"><a href="{getUrl('','module','module','act','dispModuleAdminInfo','selected_module',$val->module)}" onclick="popopen(this.href,'module_info');return false">{$lang->cmd_view}</a></td>
<td class="red">
<!--@if($val->need_install)-->
<a href="#" onclick="doInstallModule('{$val->module}');return false;">{$lang->cmd_install}</a>
<!--@end-->
<!--@if($val->need_update)-->
<a href="#" onclick="doUpdateModule('{$val->module}'); return false;">{$lang->cmd_update}</a>
<!--@else-->
&nbsp;
<!--@end-->
</td>
<td>
<!--@if(!$shortcut_list[$val->module] && $val->admin_index_act )-->
<a href="#" onclick="doAddShortCut('{$val->module}');return false;" class="button"><span>{$lang->cmd_add_shortcut}</span></a>
<!--@else-->
&nbsp;
<!--@end-->
</td>
</tr>
<!--@end-->
</tbody>
</table>

View file

@ -0,0 +1,35 @@
<!--%import("../../admin/tpl/css/admin.css")-->
<div id="popHeadder">
<h1>{$skin_info->title}</h1>
</div>
<div id="popBody">
<table cellspacing="0" class="tableType5">
<col width="100" />
<col />
<tr>
<th scope="row"><label for="textfield1">{$lang->title}</label></th>
<td>{$skin_info->title}</td>
</tr>
<tr>
<th scope="row"><label for="textfield2">{$lang->author}</label></th>
<td class="blue"><a href="mailto:{$skin_info->maker->email_address}">{$skin_info->maker->name}</a></td>
</tr>
<tr>
<th scope="row"><label for="textfield2">{$lang->homepage}</label></th>
<td class="blue"><a href="{$skin_info->maker->homepage}" onclick="window.open(this.href);return false;">{$skin_info->maker->homepage}</a></td>
</tr>
<tr>
<th scope="row"><label for="textfield2">{$lang->regdate}</label></th>
<td>{$skin_info->maker->date}<td>
</tr>
<tr>
<th scope="row" class="borderBottomNone">{$lang->description}</th>
<td class="borderBottomNone">{nl2br($skin_info->maker->description)}</td>
</tr>
</table>
</div>
<div id="popFooter" class="tCenter">
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
</div>