mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-30 15:52:17 +09:00
삭제
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2327 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
commit
8326004cb2
2773 changed files with 91485 additions and 0 deletions
17
modules/layout/conf/info.xml
Normal file
17
modules/layout/conf/info.xml
Normal 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">Layout</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/managing.</description>
|
||||
</author>
|
||||
</module>
|
||||
18
modules/layout/conf/module.xml
Normal file
18
modules/layout/conf/module.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module>
|
||||
<actions>
|
||||
<action name="dispLayoutAdminContent" type="view" admin_index="true" standalone="true" />
|
||||
<action name="dispLayoutAdminInsert" type="view" standalone="true" />
|
||||
<action name="dispLayoutAdminModify" type="view" standalone="true" />
|
||||
<action name="dispLayoutAdminEdit" type="view" standalone="true" />
|
||||
<action name="dispLayoutAdminDownloadedList" type="view" standalone="true" />
|
||||
<action name="dispLayoutAdminPreview" type="view" standalone="true" />
|
||||
<action name="dispLayoutAdminInfo" type="view" standalone="true" />
|
||||
|
||||
<action name="procLayoutAdminInsert" type="controller" standalone="true" />
|
||||
<action name="procLayoutAdminUpdate" type="controller" standalone="true" />
|
||||
<action name="procLayoutAdminDelete" type="controller" standalone="true" />
|
||||
<action name="procLayoutAdminCodeUpdate" type="controller" standalone="true" />
|
||||
<action name="procLayoutAdminCodeReset" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
32
modules/layout/lang/en.lang.php
Normal file
32
modules/layout/lang/en.lang.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/layout/lang/en.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief Layout module's basic language pack
|
||||
**/
|
||||
|
||||
$lang->cmd_layout_management = 'Layout Setting';
|
||||
$lang->cmd_layout_edit = 'Edit Layout';
|
||||
|
||||
$lang->layout_name = 'Layout Name';
|
||||
$lang->layout_maker = "Layout Developer";
|
||||
$lang->layout_history = "Updates";
|
||||
$lang->layout_info = "Layout Info";
|
||||
$lang->layout_list = 'Layout List';
|
||||
$lang->menu_count = 'Menus';
|
||||
$lang->downloaded_list = 'Download List';
|
||||
$lang->layout_preview_content = 'The content gets displayed here';
|
||||
$lang->not_apply_menu = 'Apply Layouts';
|
||||
|
||||
$lang->cmd_move_to_installed_list = "View created list";
|
||||
|
||||
$lang->about_downloaded_layouts = "List of downloaded layouts";
|
||||
$lang->about_title = 'Please input the title that is easy to verify when connecting to module';
|
||||
$lang->about_not_apply_menu = 'All connected module\'s layout will be changed by checking this option.';
|
||||
|
||||
$lang->about_layout = "Layout module helps you to create the site's layout easily.<br />By using layout setting and menu connection, website's completed shape will display with various modules.<br />* Those layouts which are unabled to delete or modify are the blog or other module's layout. ";
|
||||
$lang->about_layout_code =
|
||||
"It will be applied to the service when you save the layout code after editing it.
|
||||
You must previous the result before saving it.
|
||||
Refer to <a href=\"#\" onclick=\"winopen('http://trac.zeroboard.com/trac/wiki/TemplateHandler');return false;\">ZeroboardXE Pamphlet</a> for ZeroboardXE's grammer of pamphlet.";
|
||||
?>
|
||||
32
modules/layout/lang/jp.lang.php
Normal file
32
modules/layout/lang/jp.lang.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/layout/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com> 翻訳:RisaPapa
|
||||
* @brief レイアウト(layout)モジュールの基本言語パッケージ
|
||||
**/
|
||||
|
||||
$lang->cmd_layout_management = 'レイアウト設定';
|
||||
$lang->cmd_layout_edit = 'レイアウト編集';
|
||||
|
||||
$lang->layout_name = 'レイアウト名';
|
||||
$lang->layout_maker = "レイアウト作者";
|
||||
$lang->layout_history = "変更内容 ";
|
||||
$lang->layout_info = "レイアウト情報";
|
||||
$lang->layout_list = 'レイアウトリスト';
|
||||
$lang->menu_count = 'メニュー数';
|
||||
$lang->downloaded_list = 'ダウンロードリスト';
|
||||
$lang->layout_preview_content = '内容が出力される部分です。';
|
||||
$lang->not_apply_menu = 'レイアウトの一括適用';
|
||||
|
||||
$lang->cmd_move_to_installed_list = "作成されたリスト表示";
|
||||
|
||||
$lang->about_downloaded_layouts = "ダウンロードのレイアウトリスト";
|
||||
$lang->about_title = 'モジュールとの連動をわかりやすく区分するためのタイトルを入力してください。';
|
||||
$lang->about_not_apply_menu = 'チェックを入れると連動するすべてのメニューのモジュールのレイアウトを一括変更します。';
|
||||
|
||||
$lang->about_layout = "レイアウトのモジュールはサイトのレイアウトを分かりやすく作成できるようにします。レイアウトの設定とメニューのリンクで様々なモジュールで完成されたサイトデザインができます。<br />★削除・修正ができないレイアウトはブログまたは他のモジュールのレイアウトであるため、該当するモジュールで設定を行ってください。";
|
||||
$lang->about_layout_code =
|
||||
"下のレイアウトコードを修正して保存するとサービスに反映されます。
|
||||
必ずプレビューで確認した上で保存してください。
|
||||
ゼロボードXEのテンプレート文法は<a href=\"#\" onclick=\"winopen('http://trac.zeroboard.com/trac/wiki/TemplateHandler');return false;\">ゼロボードXEテンプレート</a>を参考してください。";
|
||||
?>
|
||||
32
modules/layout/lang/ko.lang.php
Normal file
32
modules/layout/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/layout/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 레이아웃(layout) 모듈의 기본 언어팩
|
||||
**/
|
||||
|
||||
$lang->cmd_layout_management = '레이아웃 설정';
|
||||
$lang->cmd_layout_edit = '레이아웃 편집';
|
||||
|
||||
$lang->layout_name = '레이아웃 이름';
|
||||
$lang->layout_maker = "레이아웃 제작자";
|
||||
$lang->layout_history = "변경 사항 ";
|
||||
$lang->layout_info = "레이아웃 정보";
|
||||
$lang->layout_list = '레이아웃 목록';
|
||||
$lang->menu_count = '메뉴수';
|
||||
$lang->downloaded_list = '다운로드 목록';
|
||||
$lang->layout_preview_content = '내용이 출력되는 부분입니다';
|
||||
$lang->not_apply_menu = '레이아웃 일괄 적용';
|
||||
|
||||
$lang->cmd_move_to_installed_list = "생성된 목록 보기";
|
||||
|
||||
$lang->about_downloaded_layouts = "다운로드 되어 있는 레이아웃 목록";
|
||||
$lang->about_title = '모듈에 연결시 쉽게 구분할 수 있는 제목을 입력해주세요';
|
||||
$lang->about_not_apply_menu = '체크를 하시면 연결된 모든 메뉴의 모듈 레이아웃을 일괄 변경합니다.';
|
||||
|
||||
$lang->about_layout = "레이아웃 모듈은 사이트의 레이아웃을 쉽게 만들 수 있도록 도와줍니다.<br />레이아웃 설정과 메뉴의 연결을 통해서 다양한 모듈이 완성된 사이트의 모습으로 보여줄 수 있도록 합니다.<br />* 삭제나 수정이 불가능한 레이아웃은 블로그나 기타 모듈의 자체 레이아웃이므로 해당 모듈로 가서 설정하셔야 합니다.";
|
||||
$lang->about_layout_code =
|
||||
"아래 레이아웃의 코드를 직접 수정후 저장하시면 서비스에 반영이 됩니다.
|
||||
꼭 미리보기를 하신 후에 저장을 하세요.
|
||||
제로보드XE의 템플릿 문법은 <a href=\"#\" onclick=\"winopen('http://trac.zeroboard.com/trac/wiki/TemplateHandler');return false;\">제로보드XE 템플릿</a> 을 참고하시면 됩니다.";
|
||||
?>
|
||||
34
modules/layout/lang/zh-CN.lang.php
Normal file
34
modules/layout/lang/zh-CN.lang.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/layout/lang/zh-CN.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 布局(layout) 模块语言包
|
||||
**/
|
||||
|
||||
$lang->cmd_layout_management = '布局设置';
|
||||
$lang->cmd_layout_edit = '布局编辑';
|
||||
$lang->cmd_preview = '预览';
|
||||
$lang->cmd_reset = '初始化';
|
||||
|
||||
$lang->layout_name = '布局名';
|
||||
$lang->layout_maker = "布局作者";
|
||||
$lang->layout_history = "更新记录 ";
|
||||
$lang->layout_info = "布局信息";
|
||||
$lang->layout_list = '布局目录';
|
||||
$lang->menu_count = '菜单数';
|
||||
$lang->downloaded_list = '下载目录';
|
||||
$lang->layout_preview_content = '显示内容的部分。';
|
||||
$lang->not_apply_menu = '布局共享';
|
||||
|
||||
$lang->cmd_move_to_installed_list = "查看生成目录";
|
||||
|
||||
$lang->about_downloaded_layouts = "已下载的布局目录";
|
||||
$lang->about_title = '请输入连接模块时容易区分的标题。';
|
||||
$lang->about_not_apply_menu = '更新所有被连接到菜单的模块布局。';
|
||||
|
||||
$lang->about_layout = "布局模块是使制作网站变得更简单。<br />通过布局设定和菜单的链接可以展示多种模块组成的网站。<br />* 不能删除和修改的布局是博客或其他模块自带的布局,要设定到相关模块设置。";
|
||||
$lang->about_layout_code =
|
||||
"修改下面的布局代码,保存后即可生效。
|
||||
保存之前请必须先预览后再保存。
|
||||
Zeroboard XE 模板语法请参考 <a href=\"#\" onclick=\"winopen('http://trac.zeroboard.com/trac/wiki/TemplateHandler');return false;\">zeroboard XE 模板</a>。";
|
||||
?>
|
||||
194
modules/layout/layout.admin.controller.php
Normal file
194
modules/layout/layout.admin.controller.php
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
<?php
|
||||
/**
|
||||
* @class layoutAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief layout 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class layoutAdminController extends layout {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 신규 생성
|
||||
* 레이아웃의 신규 생성은 제목만 받아서 layouts테이블에 입력함
|
||||
**/
|
||||
function procLayoutAdminInsert() {
|
||||
$args->layout_srl = getNextSequence();
|
||||
$args->layout = Context::get('layout');
|
||||
$args->title = Context::get('title');
|
||||
|
||||
$output = $this->insertLayout($args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('layout_srl', $args->layout_srl);
|
||||
}
|
||||
|
||||
function insertLayout($args) {
|
||||
$output = executeQuery("layout.insertLayout", $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 정보 변경
|
||||
* 생성된 레이아웃의 제목과 확장변수(extra_vars)를 적용한다
|
||||
**/
|
||||
function procLayoutAdminUpdate() {
|
||||
// module, act, layout_srl, layout, title을 제외하면 확장변수로 판단.. 좀 구리다..
|
||||
$extra_vars = Context::getRequestVars();
|
||||
unset($extra_vars->module);
|
||||
unset($extra_vars->act);
|
||||
unset($extra_vars->layout_srl);
|
||||
unset($extra_vars->layout);
|
||||
unset($extra_vars->title);
|
||||
unset($extra_vars->apply_layout);
|
||||
|
||||
$args = Context::gets('layout_srl','title');
|
||||
|
||||
// 레이아웃의 정보를 가져옴
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($args->layout_srl);
|
||||
$menus = get_object_vars($layout_info->menu);
|
||||
if(count($menus)) {
|
||||
foreach($menus as $menu_id => $val) {
|
||||
$menu_srl = Context::get($menu_id);
|
||||
if(!$menu_srl) continue;
|
||||
$menu_srl_list[] = $menu_srl;
|
||||
}
|
||||
|
||||
// 정해진 메뉴가 있으면 모듈 및 메뉴에 대한 레이아웃 연동
|
||||
if(count($menu_srl_list) && Context::get('apply_layout')=='Y') {
|
||||
// 해당 메뉴와 레이아웃 값을 매핑
|
||||
$oMenuAdminController = &getAdminController('menu');
|
||||
$oMenuAdminController->updateMenuLayout($args->layout_srl, $menu_srl_list);
|
||||
|
||||
// 해당 메뉴에 속한 mid의 layout값을 모두 변경
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->updateModuleLayout($args->layout_srl, $menu_srl_list);
|
||||
}
|
||||
}
|
||||
|
||||
// extra_vars의 type이 image일 경우 별도 처리를 해줌
|
||||
if($layout_info->extra_var) {
|
||||
foreach($layout_info->extra_var as $name => $vars) {
|
||||
if($vars->type!='image') continue;
|
||||
|
||||
$image_obj = $extra_vars->{$name};
|
||||
$extra_vars->{$name} = $layout_info->extra_var->{$name}->value;
|
||||
|
||||
// 삭제 요청에 대한 변수를 구함
|
||||
$del_var = $extra_vars->{"del_".$name};
|
||||
unset($extra_vars->{"del_".$name});
|
||||
if($del_var == 'Y') {
|
||||
$extra_vars->{$name} = '';
|
||||
@unlink($extra_vars->{$name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 정상적으로 업로드된 파일이 아니면 무시
|
||||
if(!$image_obj['tmp_name'] || !is_uploaded_file($image_obj['tmp_name'])) continue;
|
||||
|
||||
// 이미지 파일이 아니어도 무시 (swf는 패스~)
|
||||
if(!eregi("\.(jpg|jpeg|gif|png|swf)$", $image_obj['name'])) continue;
|
||||
|
||||
// 경로를 정해서 업로드
|
||||
$path = sprintf("./files/attach/images/%s/", $args->layout_srl);
|
||||
|
||||
// 디렉토리 생성
|
||||
if(!FileHandler::makeDir($path)) continue;
|
||||
|
||||
$filename = $path.$image_obj['name'];
|
||||
|
||||
// 파일 이동
|
||||
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) continue;
|
||||
|
||||
$extra_vars->{$name} = $filename;
|
||||
}
|
||||
}
|
||||
|
||||
// DB에 입력하기 위한 변수 설정
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
|
||||
$output = $this->updateLayout($args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('default_layout.html');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile("top_refresh.html");
|
||||
}
|
||||
|
||||
function updateLayout($args) {
|
||||
$output = executeQuery('layout.updateLayout', $args);
|
||||
if($output->toBool()) {
|
||||
$cache_file = sprintf('./files/cache/layout/%s.%s.cache.php', $args->layout_srl, Context::getLangType());
|
||||
@unlink($cache_file);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 삭제
|
||||
* 삭제시 메뉴 xml 캐시 파일도 삭제
|
||||
**/
|
||||
function procLayoutAdminDelete() {
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
|
||||
// 캐시 파일 삭제
|
||||
$cache_list = FileHandler::readDir("./files/cache/layout","",false,true);
|
||||
if(count($cache_list)) {
|
||||
foreach($cache_list as $cache_file) {
|
||||
$pos = strpos($cache_file, $layout_srl.'_');
|
||||
if($pos>0) unlink($cache_file);
|
||||
}
|
||||
}
|
||||
|
||||
$layout_file = sprintf('./files/cache/layout/%d.html', $layout_srl);
|
||||
if(file_exists($layout_file)) @unlink($layout_file);
|
||||
|
||||
// 레이아웃 삭제
|
||||
$args->layout_srl = $layout_srl;
|
||||
|
||||
$output = $this->deleteLayout($args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
function deleteLayout($args) {
|
||||
$output = executeQuery("layout.deleteLayout", $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 코드 추가
|
||||
**/
|
||||
function procLayoutAdminCodeUpdate() {
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
$code = Context::get('code');
|
||||
if(!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$layout_file = sprintf('./files/cache/layout/%d.html', $layout_srl);
|
||||
FileHandler::writeFile($layout_file, $code);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 코드 초기화
|
||||
**/
|
||||
function procLayoutAdminCodeReset() {
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
if(!$layout_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$layout_file = sprintf('./files/cache/layout/%d.html', $layout_srl);
|
||||
@unlink($layout_file);
|
||||
|
||||
$this->setMessage('success_reset');
|
||||
}
|
||||
}
|
||||
?>
|
||||
179
modules/layout/layout.admin.view.php
Normal file
179
modules/layout/layout.admin.view.php
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
<?php
|
||||
/**
|
||||
* @class layoutAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief layout 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class layoutAdminView extends layout {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 관리의 첫 페이지
|
||||
**/
|
||||
function dispLayoutAdminContent() {
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_list = $oLayoutModel->getLayoutList();
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 등록 페이지
|
||||
* 1차적으로 레이아웃만 선택한 후 DB 에 빈 값을 넣고 그 후 상세 값 설정하는 단계를 거침
|
||||
**/
|
||||
function dispLayoutAdminInsert() {
|
||||
// 레이아웃 목록을 세팅
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_list = $oLayoutModel->getDownloadedLayoutList();
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
$this->setTemplateFile('insert_layout');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 세부 정보 입력
|
||||
**/
|
||||
function dispLayoutAdminModify() {
|
||||
// 선택된 레이아웃의 정보르 구해서 세팅
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
|
||||
// 레이아웃의 정보를 가져옴
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($layout_srl);
|
||||
|
||||
// 등록된 레이아웃이 없으면 오류 표시
|
||||
if(!$layout_info) return $this->dispLayoutAdminContent();
|
||||
|
||||
Context::set('selected_layout', $layout_info);
|
||||
|
||||
// 메뉴 목록을 가져옴
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$menu_list = $oMenuAdminModel->getMenus();
|
||||
Context::set('menu_list', $menu_list);
|
||||
|
||||
$this->setTemplateFile('layout_modify');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 코드 편집
|
||||
**/
|
||||
function dispLayoutAdminEdit() {
|
||||
// 선택된 레이아웃의 정보르 구해서 세팅
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
|
||||
// 레이아웃의 정보를 가져옴
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($layout_srl);
|
||||
|
||||
// 등록된 레이아웃이 없으면 오류 표시
|
||||
if(!$layout_info) return $this->dispLayoutAdminContent();
|
||||
Context::set('selected_layout', $layout_info);
|
||||
|
||||
// 레이아웃 코드 가져오기
|
||||
$layout_file = sprintf('./files/cache/layout/%d.html', $layout_info->layout_srl);
|
||||
if(!file_exists($layout_file)) $layout_file = sprintf('%s%s', $layout_info->path, 'layout.html');
|
||||
|
||||
$layout_code = FileHandler::readFile($layout_file);
|
||||
Context::set('layout_code', $layout_code);
|
||||
|
||||
// 위젯 목록을 세팅
|
||||
$oWidgetModel = &getModel('widget');
|
||||
$widget_list = $oWidgetModel->getDownloadedWidgetList();
|
||||
Context::set('widget_list', $widget_list);
|
||||
|
||||
$this->setTemplateFile('layout_edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 목록을 보여줌
|
||||
**/
|
||||
function dispLayoutAdminDownloadedList() {
|
||||
// 레이아웃 목록을 세팅
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_list = $oLayoutModel->getDownloadedLayoutList();
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
$this->setTemplateFile('downloaded_layout_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃 미리 보기
|
||||
**/
|
||||
function dispLayoutAdminPreview() {
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
$code = Context::get('code');
|
||||
|
||||
if(!$layout_srl || !$code) return new Object(-1, 'msg_invalid_request');
|
||||
//$code = str_replace(array('<','>','"'), array('<','>','"'), $code);
|
||||
|
||||
// 레이아웃 정보 가져오기
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($layout_srl);
|
||||
if(!$layout_info) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
// 레이아웃 정보중 extra_vars의 이름과 값을 $layout_info에 입력
|
||||
if($layout_info->extra_var_count) {
|
||||
foreach($layout_info->extra_var as $var_id => $val) {
|
||||
$layout_info->{$var_id} = $val->value;
|
||||
}
|
||||
}
|
||||
|
||||
// 레이아웃 정보중 menu를 Context::set
|
||||
if($layout_info->menu_count) {
|
||||
foreach($layout_info->menu as $menu_id => $menu) {
|
||||
if(file_exists($menu->php_file)) @include($menu->php_file);
|
||||
Context::set($menu_id, $menu);
|
||||
}
|
||||
}
|
||||
|
||||
Context::set('layout_info', $layout_info);
|
||||
Context::set('content', Context::getLang('layout_preview_content'));
|
||||
|
||||
// 코드를 임시로 저장
|
||||
$edited_layout_file = sprintf('./files/cache/layout/tmp.tpl');
|
||||
FileHandler::writeFile($edited_layout_file, $code);
|
||||
|
||||
// 컴파일
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
|
||||
$layout_path = $layout_info->path;
|
||||
$layout_file = 'layout';
|
||||
|
||||
$layout_tpl = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file);
|
||||
|
||||
// 위젯등을 변환
|
||||
$oContext = &Context::getInstance();
|
||||
$layout_tpl = $oContext->transContent($layout_tpl);
|
||||
Context::set('layout_tpl', $layout_tpl);
|
||||
|
||||
// 임시 파일 삭제
|
||||
@unlink($edited_layout_file);
|
||||
|
||||
$this->setTemplateFile('layout_preview');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃의 상세 정보(conf/info.xml)를 팝업 출력
|
||||
**/
|
||||
function dispLayoutAdminInfo() {
|
||||
// 선택된 레이아웃 정보를 구함
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayoutInfo(Context::get('selected_layout'));
|
||||
Context::set('layout_info', $layout_info);
|
||||
|
||||
// 레이아웃을 팝업으로 지정
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('layout_detail_info');
|
||||
}
|
||||
}
|
||||
?>
|
||||
43
modules/layout/layout.class.php
Normal file
43
modules/layout/layout.class.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* @class layout
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief layout 모듈의 high class
|
||||
**/
|
||||
|
||||
class layout extends ModuleObject {
|
||||
|
||||
/**
|
||||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// action forward에 등록 (관리자 모드에서 사용하기 위함)
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminContent');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInsert');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminModify');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminEdit');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminDownloadedList');
|
||||
$oModuleController->insertActionForward('layout', 'view', 'dispLayoutAdminInfo');
|
||||
|
||||
// 레이아웃에서 사용할 디렉토리 생성
|
||||
FileHandler::makeDir('./files/cache/layout');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
**/
|
||||
function checkUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 업데이트 실행
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
206
modules/layout/layout.model.php
Normal file
206
modules/layout/layout.model.php
Normal file
|
|
@ -0,0 +1,206 @@
|
|||
<?php
|
||||
/**
|
||||
* @class layoutModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @version 0.1
|
||||
* @brief layout 모듈의 Model class
|
||||
**/
|
||||
|
||||
class layoutModel extends layout {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DB 에 생성된 레이아웃의 목록을 구함
|
||||
* 생성되었다는 것은 DB에 등록이 되었다는 것을 의미
|
||||
**/
|
||||
function getLayoutList() {
|
||||
$output = executeQuery('layout.getLayoutList');
|
||||
if(!$output->data) return;
|
||||
|
||||
if(is_array($output->data)) return $output->data;
|
||||
return array($output->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DB 에 생성된 한개의 레이아웃 정보를 구함
|
||||
* 생성된 레이아웃의 DB정보+XML정보를 return
|
||||
**/
|
||||
function getLayout($layout_srl) {
|
||||
// 일단 DB에서 정보를 가져옴
|
||||
$args->layout_srl = $layout_srl;
|
||||
$output = executeQuery('layout.getLayout', $args);
|
||||
if(!$output->data) return;
|
||||
|
||||
// layout, extra_vars를 정리한 후 xml 파일 정보를 정리해서 return
|
||||
$layout_info = $this->getLayoutInfo($layout, $output->data);
|
||||
return $layout_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃의 경로를 구함
|
||||
**/
|
||||
function getLayoutPath($layout_name) {
|
||||
$class_path = sprintf('./layouts/%s/', $layout_name);
|
||||
if(is_dir($class_path)) return $class_path;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레이아웃의 종류와 정보를 구함
|
||||
* 다운로드되어 있는 레이아웃의 종류 (생성과 다른 의미)
|
||||
**/
|
||||
function getDownloadedLayoutList() {
|
||||
// 다운받은 레이아웃과 설치된 레이아웃의 목록을 구함
|
||||
$searched_list = FileHandler::readDir('./layouts');
|
||||
$searched_count = count($searched_list);
|
||||
if(!$searched_count) return;
|
||||
|
||||
// 찾아진 레이아웃 목록을 loop돌면서 필요한 정보를 간추려 return
|
||||
for($i=0;$i<$searched_count;$i++) {
|
||||
// 레이아웃의 이름
|
||||
$layout = $searched_list[$i];
|
||||
|
||||
// 해당 레이아웃의 정보를 구함
|
||||
$layout_info = $this->getLayoutInfo($layout);
|
||||
|
||||
$list[] = $layout_info;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함
|
||||
* 이것 역시 캐싱을 통해서 xml parsing 시간을 줄인다..
|
||||
**/
|
||||
function getLayoutInfo($layout, $info = null) {
|
||||
if($info) {
|
||||
$layout_title = $info->title;
|
||||
$layout = $info->layout;
|
||||
$layout_srl = $info->layout_srl;
|
||||
$vars = unserialize($info->extra_vars);
|
||||
|
||||
if($info->module_srl) {
|
||||
$layout_path = preg_replace('/([a-zA-Z0-9\_\.]+)(\.html)$/','',$info->layout_path);
|
||||
$xml_file = sprintf('%sskin.xml', $layout_path);
|
||||
}
|
||||
}
|
||||
|
||||
// 요청된 모듈의 경로를 구한다. 없으면 return
|
||||
if(!$layout_path) $layout_path = $this->getLayoutPath($layout);
|
||||
if(!is_dir($layout_path)) return;
|
||||
|
||||
// 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음
|
||||
if(!$xml_file) $xml_file = sprintf("%sconf/info.xml", $layout_path);
|
||||
if(!file_exists($xml_file)) {
|
||||
$layout_info->layout = $layout;
|
||||
$layout_info->path = $layout_path;
|
||||
$layout_info->layout_title = $layout_title;
|
||||
return $layout_info;
|
||||
}
|
||||
|
||||
// cache 파일을 비교하여 문제 없으면 include하고 $layout_info 변수를 return
|
||||
if(!$layout_srl) $cache_file = sprintf('./files/cache/layout/%s.%s.cache.php', $layout, Context::getLangType());
|
||||
else $cache_file = sprintf('./files/cache/layout/%s.%s.cache.php', $layout_srl, Context::getLangType());
|
||||
|
||||
if(file_exists($cache_file)&&filectime($cache_file)>filectime($xml_file)) {
|
||||
@include($cache_file);
|
||||
|
||||
if($layout_info->extra_var && $vars) {
|
||||
foreach($vars as $key => $value) {
|
||||
if(!$layout_info->extra_var->{$key} && !$layout_info->{$key}) {
|
||||
$layout_info->{$key} = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $layout_info;
|
||||
}
|
||||
|
||||
// cache 파일이 없으면 xml parsing하고 변수화 한 후에 캐시 파일에 쓰고 변수 바로 return
|
||||
$oXmlParser = new XmlParser();
|
||||
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
|
||||
if($tmp_xml_obj->layout) $xml_obj = $tmp_xml_obj->layout;
|
||||
elseif($tmp_xml_obj->skin) $xml_obj = $tmp_xml_obj->skin;
|
||||
|
||||
if(!$xml_obj) return;
|
||||
|
||||
$buff = '';
|
||||
|
||||
// 레이아웃의 제목, 버전
|
||||
$buff .= sprintf('$layout_info->layout = "%s";', $layout);
|
||||
$buff .= sprintf('$layout_info->path = "%s";', $layout_path);
|
||||
$buff .= sprintf('$layout_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff .= sprintf('$layout_info->version = "%s";', $xml_obj->attrs->version);
|
||||
$buff .= sprintf('$layout_info->layout_srl = $layout_srl;');
|
||||
$buff .= sprintf('$layout_info->layout_title = $layout_title;');
|
||||
|
||||
// 작성자 정보
|
||||
$buff .= sprintf('$layout_info->author->name = "%s";', $xml_obj->author->name->body);
|
||||
$buff .= sprintf('$layout_info->author->email_address = "%s";', $xml_obj->author->attrs->email_address);
|
||||
$buff .= sprintf('$layout_info->author->homepage = "%s";', $xml_obj->author->attrs->link);
|
||||
$buff .= sprintf('$layout_info->author->date = "%s";', $xml_obj->author->attrs->date);
|
||||
$buff .= sprintf('$layout_info->author->description = "%s";', $xml_obj->author->description->body);
|
||||
|
||||
// 추가 변수 (템플릿에서 사용할 제작자 정의 변수)
|
||||
$extra_vars = $xml_obj->extra_vars->var;
|
||||
if($extra_vars) {
|
||||
if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
|
||||
|
||||
$extra_var_count = count($extra_vars);
|
||||
|
||||
$buff .= sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++) {
|
||||
unset($var);
|
||||
unset($options);
|
||||
$var = $extra_vars[$i];
|
||||
$name = $var->attrs->name;
|
||||
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name);
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
|
||||
|
||||
$options = $var->options;
|
||||
if(!$options) continue;
|
||||
|
||||
if(!is_array($options)) $options = array($options);
|
||||
$options_count = count($options);
|
||||
for($j=0;$j<$options_count;$j++) {
|
||||
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"] = "%s";', $var->attrs->name, $options[$j]->value->body, $options[$j]->title->body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 메뉴
|
||||
if($xml_obj->menus->menu) {
|
||||
$menus = $xml_obj->menus->menu;
|
||||
if(!is_array($menus)) $menus = array($menus);
|
||||
|
||||
$menu_count = count($menus);
|
||||
$buff .= sprintf('$layout_info->menu_count = "%s";', $menu_count);
|
||||
for($i=0;$i<$menu_count;$i++) {
|
||||
$name = $menus[$i]->attrs->name;
|
||||
if($menus[$i]->attrs->default == "true") $buff .= sprintf('$layout_info->default_menu = "%s";', $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
|
||||
$buff .= sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->maxdepth->body);
|
||||
|
||||
$buff .= sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name);
|
||||
$buff .= sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
|
||||
}
|
||||
}
|
||||
|
||||
$buff = '<?php if(!defined("__ZBXE__")) exit(); '.$buff.' ?>';
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
if(file_exists($cache_file)) @include($cache_file);
|
||||
return $layout_info;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
8
modules/layout/queries/deleteLayout.xml
Normal file
8
modules/layout/queries/deleteLayout.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteLayout" action="delete">
|
||||
<tables>
|
||||
<table name="layouts" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
modules/layout/queries/getLayout.xml
Normal file
11
modules/layout/queries/getLayout.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getLayout" action="select">
|
||||
<tables>
|
||||
<table name="layouts" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
modules/layout/queries/getLayoutList.xml
Normal file
11
modules/layout/queries/getLayoutList.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="getLayoutList" action="select">
|
||||
<tables>
|
||||
<table name="layouts" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<navigation>
|
||||
<index var="sort_index" default="layout_srl" order="desc" />
|
||||
</navigation>
|
||||
</query>
|
||||
13
modules/layout/queries/insertLayout.xml
Normal file
13
modules/layout/queries/insertLayout.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<query id="insertLayout" action="insert">
|
||||
<tables>
|
||||
<table name="layouts" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||
<column name="layout" var="layout" notnull="notnull" />
|
||||
<column name="title" var="title" notnull="notnull" />
|
||||
<column name="module_srl" var="module_srl" />
|
||||
<column name="layout_path" var="layout_path" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
</columns>
|
||||
</query>
|
||||
13
modules/layout/queries/updateLayout.xml
Normal file
13
modules/layout/queries/updateLayout.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<query id="updateLayout" action="update">
|
||||
<tables>
|
||||
<table name="layouts" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="title" var="title" />
|
||||
<column name="extra_vars" var="extra_vars" />
|
||||
<column name="layout_path" var="layout_path" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="layout_srl" var="layout_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
9
modules/layout/schemas/layouts.xml
Normal file
9
modules/layout/schemas/layouts.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<table name="layouts">
|
||||
<column name="layout_srl" type="number" size="12" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="layout" type="varchar" size="250" />
|
||||
<column name="title" type="varchar" size="250" />
|
||||
<column name="extra_vars" type="text" />
|
||||
<column name="layout_path" type="varchar" size="250" />
|
||||
<column name="module_srl" type="number" size="12" default="0" index="idx_module_srl" />
|
||||
<column name="regdate" type="date" index="idx_regdate" />
|
||||
</table>
|
||||
48
modules/layout/tpl/downloaded_layout_list.html
Normal file
48
modules/layout/tpl/downloaded_layout_list.html
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<!--#include("header.html")-->
|
||||
|
||||
<!-- 레이아웃의 목록 -->
|
||||
<table cellspacing="0" class="tableType1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->layout_name}</th>
|
||||
<th scope="col">{$lang->version}</th>
|
||||
<th scope="col">{$lang->author}</th>
|
||||
<th scope="col">{$lang->menu_count}</th>
|
||||
<th scope="col">{$lang->date}</th>
|
||||
<th scope="col">{$lang->path}</th>
|
||||
<th scope="col">{$lang->cmd_make}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--@foreach($layout_list as $key => $val)-->
|
||||
|
||||
<!-- 레이아웃 정보 파일(conf/info.xml)가 있는 경우-->
|
||||
<!--@if($val->title)-->
|
||||
<tr>
|
||||
<td rowspan="2">
|
||||
<a href="{getUrl('','module','layout','act','dispLayoutAdminInfo','selected_layout',$val->layout)}" onclick="popopen(this.href,'layout_info');return false" class="blue">{$val->title}</a> <br />
|
||||
({$val->layout})
|
||||
</td>
|
||||
<td class="tahoma">{$val->version}</td>
|
||||
<td><a href="{$val->author->homepage}" onclick="window.open(this.href);return false;" class="blue">{$val->author->name}</a></td>
|
||||
<td class="tahoma">{$val->menu_count}</td>
|
||||
<td class="tahoma">{$val->author->date}</td>
|
||||
<td class="tahoma">{$val->path}</td>
|
||||
<td><a href="{getUrl('act','dispLayoutAdminInsert','layout',$val->layout)}" class="button"><span>{$lang->cmd_make}</span></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6" class="left">
|
||||
{nl2br($val->author->description)}
|
||||
</td>
|
||||
</tr>
|
||||
<!-- 레이아웃 정보 파일(conf/info.xml)이 없는 경우 -->
|
||||
<!--@else-->
|
||||
<tr>
|
||||
<td colspan="6">{$val->layout}</td>
|
||||
<td class="tahoma">{$val->path}</td>
|
||||
<td class="tahoma blue"><a href="{getUrl('act','dispLayoutAdminInsert','layout',$val->layout)}">{$lang->cmd_make}</a></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
9
modules/layout/tpl/filter/delete_layout.xml
Normal file
9
modules/layout/tpl/filter/delete_layout.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<filter name="delete_layout" module="layout" act="procLayoutAdminDelete" confirm_msg_code="confirm_delete">
|
||||
<form>
|
||||
<node target="layout_srl" required="true" />
|
||||
</form>
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
14
modules/layout/tpl/filter/insert_layout.xml
Normal file
14
modules/layout/tpl/filter/insert_layout.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<filter name="insert_layout" module="layout" act="procLayoutAdminInsert" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="title" required="true" />
|
||||
</form>
|
||||
<parameter>
|
||||
<param name="layout" target="layout" />
|
||||
<param name="title" target="title" />
|
||||
</parameter>
|
||||
<response callback_func="completeInsertLayout">
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
<tag name="layout_srl" />
|
||||
</response>
|
||||
</filter>
|
||||
10
modules/layout/tpl/filter/reset_layout_code.xml
Normal file
10
modules/layout/tpl/filter/reset_layout_code.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<filter name="reset_layout_code" module="layout" act="procLayoutAdminCodeReset" confirm_msg_code="confirm_reset">
|
||||
<form>
|
||||
<node target="layout_srl" required="true" />
|
||||
<node target="code" required="true" />
|
||||
</form>
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
10
modules/layout/tpl/filter/update_layout_code.xml
Normal file
10
modules/layout/tpl/filter/update_layout_code.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<filter name="update_layout_code" module="layout" act="procLayoutAdminCodeUpdate" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="layout_srl" required="true" />
|
||||
<node target="code" required="true" />
|
||||
</form>
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
9
modules/layout/tpl/filter/update_layout_info.xml
Normal file
9
modules/layout/tpl/filter/update_layout_info.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<filter name="update_layout_info" module="layout" act="procLayoutAdminUpdate" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="title" required="true" />
|
||||
</form>
|
||||
<response>
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
15
modules/layout/tpl/header.html
Normal file
15
modules/layout/tpl/header.html
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<!--%import("js/layout_admin.js")-->
|
||||
|
||||
<h3>{$lang->layout} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
|
||||
<div class="infoText">{nl2br($lang->about_layout)}</div>
|
||||
|
||||
<!-- 관리자 페이지용 메뉴 -->
|
||||
<!--@if($module == 'admin')-->
|
||||
<div class="header4">
|
||||
<ul class="localNavigation">
|
||||
<li <!--@if($act=='dispLayoutAdminContent')-->class="on"<!--@end-->><a href="{getUrl('act','dispLayoutAdminContent')}">{$lang->layout_list}</a></li>
|
||||
<li <!--@if($act=='dispLayoutAdminDownloadedList')-->class="on"<!--@end-->><a href="{getUrl('act','dispLayoutAdminDownloadedList')}">{$lang->downloaded_list}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--@end-->
|
||||
60
modules/layout/tpl/index.html
Normal file
60
modules/layout/tpl/index.html
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<!--%import("filter/delete_layout.xml")-->
|
||||
|
||||
<!--#include("header.html")-->
|
||||
|
||||
<!-- 삭제를 위한 임시 form -->
|
||||
<form id="fo_layout" action="./" method="get" onsubmit="return procFilter(this, delete_layout)">
|
||||
<input type="hidden" name="layout_srl" value="" />
|
||||
</form>
|
||||
|
||||
<!-- 목록 -->
|
||||
<table cellspacing="0" class="tableType1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->no}</th>
|
||||
<th scope="col">{$lang->layout}</th>
|
||||
<th scope="col">{$lang->title}</th>
|
||||
<th scope="col">{$lang->regdate}</th>
|
||||
<th scope="col">{$lang->cmd_layout_management}</th>
|
||||
<th scope="col">{$lang->cmd_layout_edit}</th>
|
||||
<th scope="col">{$lang->cmd_delete}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--@foreach($layout_list as $no => $val)-->
|
||||
<tr>
|
||||
<td class="tahoma">{$no+1}</td>
|
||||
<td>
|
||||
{$val->layout}
|
||||
<!--@if($val->module_srl)-->
|
||||
(module)
|
||||
<!--@end-->
|
||||
</td>
|
||||
<td>{htmlspecialchars($val->title)}</td>
|
||||
<td class="tahoma">{zdate($val->regdate,"Y-m-d")}</td>
|
||||
<td>
|
||||
<!--@if(!$val->module_srl)-->
|
||||
<a href="{getUrl('act','dispLayoutAdminModify','layout_srl',$val->layout_srl)}" class="blue">{$lang->cmd_layout_management}</a>
|
||||
<!--@else-->
|
||||
|
||||
<!--@end-->
|
||||
</td>
|
||||
<td>
|
||||
<a href="{getUrl('act','dispLayoutAdminEdit','layout_srl',$val->layout_srl)}" class="blue">{$lang->cmd_layout_edit}</a>
|
||||
</td>
|
||||
<td>
|
||||
<!--@if(!$val->module_srl)-->
|
||||
<a href="#" onclick="doDeleteLayout('{$val->layout_srl}');return false;" class="red">{$lang->cmd_delete}</a>
|
||||
<!--@else-->
|
||||
|
||||
<!--@end-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 버튼 -->
|
||||
<div class="tRight gap1">
|
||||
<a href="{getUrl('act','dispLayoutAdminInsert','layout_srl','')}" class="button"><span>{$lang->cmd_make}</span></a>
|
||||
</div>
|
||||
33
modules/layout/tpl/insert_layout.html
Normal file
33
modules/layout/tpl/insert_layout.html
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<!--%import("filter/insert_layout.xml")-->
|
||||
|
||||
<!--#include("header.html")-->
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_layout)">
|
||||
|
||||
<table cellspacing="0" class="tableType2 gap1">
|
||||
<col width="150" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="row">{$lang->layout_name}</th>
|
||||
<td>
|
||||
<select name="layout">
|
||||
<!--@foreach($layout_list as $key => $val)-->
|
||||
<option value="{$val->layout}" <!--@if($layout == $val->layout)-->selected="selected"<!--@end-->> <!--@if($val->title)-->{$val->title} ({$val->layout})<!--@else-->{$val->layout}<!--@end--></option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{$lang->title}</th>
|
||||
<td>
|
||||
<input type="text" name="title" value="{$info->title}" class="inputTypeText w100" />
|
||||
<p>{$lang->about_title}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="tRight gap1">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_next}" accesskey="s" /></span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
44
modules/layout/tpl/js/layout_admin.js
Normal file
44
modules/layout/tpl/js/layout_admin.js
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/* 레이아웃 신규 생성시 완료 후 요청하는 함수 */
|
||||
function completeInsertLayout(ret_obj) {
|
||||
var layout_srl = ret_obj['layout_srl'];
|
||||
var url = current_url.setQuery('act','dispLayoutAdminModify').setQuery('layout_srl',layout_srl);
|
||||
location.href = url;
|
||||
}
|
||||
|
||||
/* 레이아웃 삭제 */
|
||||
function doDeleteLayout(layout_srl) {
|
||||
var fo_obj = xGetElementById("fo_layout");
|
||||
if(!fo_obj) return;
|
||||
fo_obj.layout_srl.value = layout_srl;
|
||||
|
||||
procFilter(fo_obj, delete_layout);
|
||||
}
|
||||
|
||||
/* 수정된 레이아웃을 원본으로 돌림 */
|
||||
function doResetLayoutCode(layout_srl) {
|
||||
var fo_obj = xGetElementById('fo_layout');
|
||||
procFilter(fo_obj, reset_layout_code);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 수정중인 레이아웃 미리보기 */
|
||||
function doPreviewLayoutCode() {
|
||||
var fo_obj = xGetElementById('fo_layout');
|
||||
fo_obj.target = "_LayoutPreview";
|
||||
fo_obj.act.value = "dispLayoutAdminPreview";
|
||||
fo_obj.submit();
|
||||
fo_obj.act.value = "";
|
||||
fo_obj.target = "";
|
||||
}
|
||||
|
||||
|
||||
/* 메뉴 관리로 이동 */
|
||||
function doMenuManagement(menu_id) {
|
||||
var fo_obj = xGetElementById("fo_layout");
|
||||
var sel_obj = fo_obj[menu_id];
|
||||
if(sel_obj.selectedIndex == 0) return;
|
||||
var menu_srl = sel_obj.options[sel_obj.selectedIndex].value;
|
||||
|
||||
var url = current_url.setQuery('act','dispMenuAdminManagement').setQuery('menu_srl',menu_srl);
|
||||
winopen(url,'MenuManage','width=850,height=800,resizable=yes,scrollbars=yes,toolbars=no');
|
||||
}
|
||||
36
modules/layout/tpl/layout_detail_info.html
Normal file
36
modules/layout/tpl/layout_detail_info.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<div id="popHeadder">
|
||||
<h1>{$lang->layout_maker}</h1>
|
||||
</div>
|
||||
|
||||
<div id="popBody">
|
||||
<table cellspacing="0" class="tableType5">
|
||||
<col width="100" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="row">{$lang->title}</th>
|
||||
<td>{$layout_info->title} ver {$layout_info->version}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{$lang->author}</th>
|
||||
<td><a href="mailto:{$layout_info->author->email_address}">{$layout_info->author->name}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{$lang->homepage}</th>
|
||||
<td><a href="{$layout_info->author->homepage}" onclick="window.open(this.href);return false;">{$layout_info->author->homepage}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{$lang->regdate}</th>
|
||||
<td>{$layout_info->author->date}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{$lang->description}</th>
|
||||
<td>{nl2br($layout_info->author->description)}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="popFooter">
|
||||
<div class="tCenter gap1">
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
50
modules/layout/tpl/layout_edit.html
Normal file
50
modules/layout/tpl/layout_edit.html
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<!--%import("filter/update_layout_code.xml")-->
|
||||
<!--%import("filter/reset_layout_code.xml")-->
|
||||
|
||||
<!--#include("header.html")-->
|
||||
|
||||
<table cellspacing="0" class="tableType3 gap1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$selected_layout->title} ver {$selected_layout->version} ({$selected_layout->layout})</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="left blue">{nl2br($lang->about_layout_code)}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table cellspacing="0" class="widgetBox gap1">
|
||||
<col width="80" />
|
||||
<col />
|
||||
<tr>
|
||||
<th>{$lang->widget}</th>
|
||||
<td>
|
||||
<!--@foreach($widget_list as $widget)-->
|
||||
<div class="fl gap1">
|
||||
<a href="{getUrl('','module','widget','act','dispWidgetGenerateCode','selected_widget',$widget->widget,'module_srl',$module_srl)}" onclick="popopen(this.href,'GenerateCodeInPage');return false;" class="button"><span>{$widget->title}</span></a>
|
||||
</div>
|
||||
<!--@end-->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="gap1">
|
||||
<form id="fo_layout" action="./" method="post" onsubmit="return procFilter(this, update_layout_code);">
|
||||
<input type="hidden" name="layout_srl" value="{$layout_srl}" />
|
||||
<input type="hidden" name="module" value="layout" />
|
||||
<input type="hidden" name="act" value="" />
|
||||
|
||||
<div class="layout_editor_box">
|
||||
<textarea name="code" class="layout_editor">{htmlspecialchars($layout_code)}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="tRight gap1">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
<a href="#" onclick="doPreviewLayoutCode();return false" class="button"><span>{$lang->cmd_preview}</span></a>
|
||||
<a href="#" onclick="doResetLayoutCode('{$layout_srl}');return false" class="button"><span>{$lang->cmd_reset}</span></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
114
modules/layout/tpl/layout_modify.html
Normal file
114
modules/layout/tpl/layout_modify.html
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<!--%import("filter/update_layout_info.xml")-->
|
||||
|
||||
<!--#include("header.html")-->
|
||||
|
||||
<table cellspacing="0" class="tableType2 gap1">
|
||||
<col width="150" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="row">{$lang->layout}</th>
|
||||
<td>{$selected_layout->title} ver {$selected_layout->version} ({$selected_layout->layout})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{$lang->path}</th>
|
||||
<td>{$selected_layout->path}</td>
|
||||
</tr>
|
||||
<!--@if($selected_layout->author->homepage)-->
|
||||
<tr>
|
||||
<th scope="row">{$lang->author}</th>
|
||||
<td><a href="{$selected_layout->author->homepage}" onclick="window.open(this.href);return false;" class="blue">{$selected_layout->author->name}</a></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
<!--@if($selected_layout->author->description)-->
|
||||
<tr>
|
||||
<th scope="row">{$lang->description}</th>
|
||||
<td>{nl2br($selected_layout->author->description)}</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</table>
|
||||
|
||||
<!--<form id="fo_layout" action="./" method="post" onsubmit="return procFilter(this, update_layout_info)" enctype="multipart/form-data" target="hidden_iframe">-->
|
||||
<form id="fo_layout" action="./" method="post" enctype="multipart/form-data" target="hidden_iframe">
|
||||
<input type="hidden" name="module" value="layout" />
|
||||
<input type="hidden" name="act" value="procLayoutAdminUpdate" />
|
||||
<input type="hidden" name="layout_srl" value="{$layout_srl}" />
|
||||
<input type="hidden" name="layout" value="{$selected_layout->layout}" />
|
||||
|
||||
<table cellspacing="0" class="tableType3 gap1">
|
||||
<col width="150" />
|
||||
<col width="*" />
|
||||
<tr>
|
||||
<th scope="row">{$lang->title}</th>
|
||||
<td class="left">
|
||||
<input type="text" name="title" value="{htmlspecialchars($selected_layout->layout_title)}" class="inputTypeText w100" />
|
||||
<p>{$lang->about_title}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<!--@foreach($selected_layout->extra_var as $name => $var)-->
|
||||
<tr>
|
||||
<th scope="row">{$var->title}</th>
|
||||
|
||||
<td class="left">
|
||||
<!--@if($var->type == "text")-->
|
||||
<input type="text" name="{$name}" value="{htmlspecialchars($var->value)}" class="inputTypeText w100"/>
|
||||
|
||||
<!--@elseif($var->type == "textarea")-->
|
||||
<textarea name="{$name}" class="inputTypeTextArea w100">{htmlspecialchars($var->value)}</textarea>
|
||||
|
||||
<!--@elseif($var->type=="image")-->
|
||||
|
||||
<!--@if($var->value)-->
|
||||
<div>
|
||||
<img src="{$var->value}" alt="image" /><br />
|
||||
<input type="checkbox" name="del_{$name}" value="Y" id="del_{$name}" class="checkbox" />
|
||||
<label for="del_{$name}">{$lang->cmd_delete}</label>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<input type="file" name="{$name}" value="" />
|
||||
|
||||
<!--@elseif($var->type == "select")-->
|
||||
<select name="{$name}">
|
||||
<!--@foreach($var->options as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($key==$var->value)-->selected="selected"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<!--@end-->
|
||||
<p>{$var->description}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
<!--@foreach($selected_layout->menu as $menu_name => $menu_info)-->
|
||||
<tr>
|
||||
<th scope="row">{$menu_info->title}<br />({$menu_name})</th>
|
||||
<td class="left tahoma">
|
||||
<select name="{$menu_name}">
|
||||
<option value="0">------------------------</option>
|
||||
<!--@foreach($menu_list as $key => $val)-->
|
||||
<option value="{$val->menu_srl}" <!--@if($val->menu_srl == $menu_info->menu_srl)-->selected="selected"<!--@end-->>{$val->title}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<a href="#" onclick="doMenuManagement('{$menu_name}');return false;" class="button"><span>{$lang->cmd_management}</span></a>
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
<tr>
|
||||
<th scope="row">{$lang->not_apply_menu}</th>
|
||||
<td class="left">
|
||||
<input type="checkbox" name="apply_layout" value="Y" />
|
||||
{$lang->about_not_apply_menu}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="tRight gap1">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
<!--@if($module=="admin")-->
|
||||
<a href="{getUrl('act','dispLayoutAdminContent')}" class="button"><span>{$lang->cmd_list}</span></a>
|
||||
<!--@else-->
|
||||
<a href="{getUrl('act','')}" class="button"><span>{$lang->cmd_back}</span></a>
|
||||
<!--@end-->
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<iframe name="hidden_iframe" frameborder="0" style="display:none"></iframe>
|
||||
1
modules/layout/tpl/layout_preview.html
Normal file
1
modules/layout/tpl/layout_preview.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{$layout_tpl}
|
||||
4
modules/layout/tpl/top_refresh.html
Normal file
4
modules/layout/tpl/top_refresh.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<script type="text/javascript">
|
||||
alert("{$lang->success_updated}");
|
||||
top.location.href = top.location.href;
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue