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,114 @@
<?php
/**
* @class addonAdminController
* @author zero (zero@nzeo.com)
* @brief addon 모듈의 admin controller class
**/
class addonAdminController extends addon {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 애드온의 활성/비활성 체인지
**/
function procAddonAdminToggleActivate() {
$oAddonModel = &getAdminModel('addon');
// addon값을 받아옴
$addon = Context::get('addon');
if($addon) {
// 활성화 되어 있으면 비활성화 시킴
if($oAddonModel->isActivatedAddon($addon)) $this->doDeactivate($addon);
// 비활성화 되어 있으면 활성화 시킴
else $this->doActivate($addon);
}
$this->makeCacheFile();
}
/**
* @brief 애드온 설정 정보 입력
**/
function procAddonAdminSetupAddon() {
$args = Context::getRequestVars();
$addon_name = $args->addon_name;
unset($args->module);
unset($args->act);
unset($args->addon_name);
$this->doSetup($addon_name, $args);
$this->makeCacheFile();
}
/**
* @brief 캐시 파일 생성
**/
function makeCacheFile() {
// 모듈에서 애드온을 사용하기 위한 캐시 파일 생성
$buff = "";
$oAddonModel = &getAdminModel('addon');
$addon_list = $oAddonModel->getInsertedAddons();
foreach($addon_list as $addon=> $val) {
if($val->is_used != 'Y') continue;
if($val->extra_vars) {
unset($extra_vars);
$extra_vars = base64_encode($val->extra_vars);
}
$buff .= sprintf(' if(file_exists("./addons/%s/%s.addon.php")) { unset($addon_info); $addon_info = unserialize(base64_decode("%s")); $addon_path = "./addons/%s/"; @include("./addons/%s/%s.addon.php"); }', $addon, $addon, $extra_vars, $addon, $addon, $addon);
}
$buff = sprintf('<?if(!defined("__ZBXE__"))exit(); %s ?>', $buff);
FileHandler::writeFile($this->cache_file, $buff);
}
/**
* @brief 애드온 추가
* DB에 애드온을 추가함
**/
function doInsert($addon) {
$args->addon = $addon;
$args->is_used = 'N';
return executeQuery('addon.insertAddon', $args);
}
/**
* @brief 애드온 활성화
* addons라는 테이블에 애드온의 활성화 상태를 on 시켜줌
**/
function doActivate($addon) {
$args->addon = $addon;
$args->is_used = 'Y';
return executeQuery('addon.updateAddon', $args);
}
/**
* @brief 애드온 비활성화
*
* addons라는 테이블에 애드온의 이름을 제거하는 것으로 비활성화를 시키게 된다
**/
function doDeactivate($addon) {
$args->addon = $addon;
$args->is_used = 'N';
return executeQuery('addon.updateAddon', $args);
}
/**
* @brief 애드온 설정
**/
function doSetup($addon, $extra_vars) {
$args->addon = $addon;
$args->extra_vars = serialize($extra_vars);
return executeQuery('addon.updateAddon', $args);
}
}
?>

View file

@ -0,0 +1,165 @@
<?php
/**
* @class addonAdminModel
* @author zero (zero@nzeo.com)
* @brief addon 모듈의 admin model class
**/
class addonAdminModel extends addon {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 애드온의 경로를 구함
**/
function getAddonPath($addon_name) {
$class_path = sprintf('./addons/%s/', $addon_name);
if(is_dir($class_path)) return $class_path;
return "";
}
/**
* @brief 애드온의 종류와 정보를 구함
**/
function getAddonList() {
// activated된 애드온 목록을 구함
$inserted_addons = $this->getInsertedAddons();
// 다운받은 애드온과 설치된 애드온의 목록을 구함
$searched_list = FileHandler::readDir('./addons');
$searched_count = count($searched_list);
if(!$searched_count) return;
for($i=0;$i<$searched_count;$i++) {
// 애드온의 이름
$addon_name = $searched_list[$i];
// 애드온의 경로 (files/addons가 우선)
$path = $this->getAddonPath($addon_name);
// 해당 애드온의 정보를 구함
unset($info);
$info = $this->getAddonInfoXml($addon_name);
$info->addon = $addon_name;
$info->path = $path;
$info->activated = false;
// DB에 입력되어 있는지 확인
if(!in_array($addon_name, array_keys($inserted_addons))) {
// DB에 입력되어 있지 않으면 입력 (model에서 이런짓 하는거 싫지만 귀찮아서.. ㅡ.ㅜ)
$oAddonAdminController = &getAdminController('addon');
$oAddonAdminController->doInsert($addon_name);
// 활성화 되어 있는지 확인
} else {
if($inserted_addons[$addon_name]->is_used=='Y') $info->activated = true;
}
$list[] = $info;
}
return $list;
}
/**
* @brief 모듈의 conf/info.xml 읽어서 정보를 구함
**/
function getAddonInfoXml($addon) {
// 요청된 모듈의 경로를 구한다. 없으면 return
$addon_path = $this->getAddonPath($addon);
if(!$addon_path) return;
// 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음
$xml_file = sprintf("%sconf/info.xml", $addon_path);
if(!file_exists($xml_file)) return;
$oXmlParser = new XmlParser();
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
$xml_obj = $tmp_xml_obj->addon;
if(!$xml_obj) return;
$info->title = $xml_obj->title->body;
// 작성자 정보
$addon_info->addon_name = $addon;
$addon_info->title = $xml_obj->title->body;
$addon_info->version = $xml_obj->attrs->version;
$addon_info->author->name = $xml_obj->author->name->body;
$addon_info->author->email_address = $xml_obj->author->attrs->email_address;
$addon_info->author->homepage = $xml_obj->author->attrs->link;
$addon_info->author->date = $xml_obj->author->attrs->date;
$addon_info->author->description = trim($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;
$addon_info->history[] = $obj;
}
// 확장변수
if($xml_obj->extra_vars) {
// DB에 설정된 내역을 가져온다
$db_args->addon = $addon;
$output = executeQuery('addon.getAddonInfo',$db_args);
$extra_vals = unserialize($output->data->extra_vars);
// 확장변수를 정리
if(!is_array($xml_obj->extra_vars->var)) $extra_vars[] = $xml_obj->extra_vars->var;
else $extra_vars = $xml_obj->extra_vars->var;
foreach($extra_vars as $key => $val) {
unset($obj);
$obj->name = $val->attrs->name;
$obj->title = $val->title->body;
$obj->description = $val->description->body;
$obj->value = $extra_vals->{$obj->name};
$addon_info->extra_vars[] = $obj;
}
}
return $addon_info;
}
/**
* @brief 활성화된 애드온 목록을 구해옴
**/
function getInsertedAddons() {
$args->list_order = 'addon';
$output = executeQuery('addon.getAddons', $args);
if(!$output->data) return array();
if(!is_array($output->data)) $output->data = array($output->data);
$activated_count = count($output->data);
for($i=0;$i<$activated_count;$i++) {
$addon = $output->data[$i];
$addon_list[$addon->addon] = $addon;
}
return $addon_list;
}
/**
* @brief 애드온이 활성화 되어 있는지 체크
**/
function isActivatedAddon($addon) {
$args->addon = $addon;
$output = executeQuery('addon.getAddonIsActivated', $args);
if($output->data->count>0) return true;
return false;
}
}
?>

View file

@ -0,0 +1,69 @@
<?php
/**
* @class addonAdminView
* @author zero (zero@nzeo.com)
* @brief addon 모듈의 admin view class
**/
class addonAdminView extends addon {
/**
* @brief 초기화
**/
function init() {
$this->setTemplatePath($this->module_path.'tpl');
}
/**
* @brief 애드온 관리 메인 페이지 (목록 보여줌)
**/
function dispAddonAdminIndex() {
// 애드온 목록을 세팅
$oAddonModel = &getAdminModel('addon');
$addon_list = $oAddonModel->getAddonList();
Context::set('addon_list', $addon_list);
// 템플릿 패스 및 파일을 지정
$this->setTemplateFile('addon_list');
}
/**
* @biref 애드온 세부 설정 팝업 출력
**/
function dispAddonAdminSetup() {
// 요청된 애드온을 구함
$selected_addon = Context::get('selected_addon');
// 요청된 애드온의 정보를 구함
$oAddonModel = &getAdminModel('addon');
$addon_info = $oAddonModel->getAddonInfoXml($selected_addon);
Context::set('addon_info', $addon_info);
// 레이아웃을 팝업으로 지정
$this->setLayoutFile('popup_layout');
// 템플릿 패스 및 파일을 지정
$this->setTemplateFile('setup_addon');
}
/**
* @brief 애드온의 상세 정보(conf/info.xml) 팝업 출력
**/
function dispAddonAdminInfo() {
// 요청된 애드온을 구함
$selected_addon = Context::get('selected_addon');
// 요청된 애드온의 정보를 구함
$oAddonModel = &getAdminModel('addon');
$addon_info = $oAddonModel->getAddonInfoXml($selected_addon);
Context::set('addon_info', $addon_info);
// 레이아웃을 팝업으로 지정
$this->setLayoutFile('popup_layout');
// 템플릿 패스 및 파일을 지정
$this->setTemplateFile('addon_info');
}
}
?>

View file

@ -0,0 +1,54 @@
<?php
/**
* @class addon
* @author zero (zero@nzeo.com)
* @brief addon 모듈의 high class
**/
class addon extends ModuleObject {
var $cache_file = "./files/cache/activated_addons.cache.php";
/**
* @brief 설치시 추가 작업이 필요할시 구현
**/
function moduleInstall() {
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionForward('addon', 'view', 'dispAddonAdminIndex');
// 몇가지 애드온을 등록
$oAddonController = &getAdminController('addon');
$oAddonController->doInsert('blogapi');
$oAddonController->doInsert('counter');
$oAddonController->doInsert('member_extra_info');
$oAddonController->doInsert('naver_search');
$oAddonController->doInsert('openid_delegation_id');
$oAddonController->doInsert('rainbow_link');
$oAddonController->doInsert('spamfilter');
// 몇가지 애드온을 기본 활성화 상태로 변경
$oAddonController->doActivate('member_extra_info');
$oAddonController->doActivate('counter');
$oAddonController->doActivate('blogapi');
$oAddonController->doActivate('spamfilter');
$oAddonController->procAddonAdminToggleActivate();
return new Object();
}
/**
* @brief 설치가 이상이 없는지 체크하는 method
**/
function checkUpdate() {
return false;
}
/**
* @brief 업데이트 실행
**/
function moduleUpdate() {
return new Object();
}
}
?>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<module version="0.1">
<title xml:lang="ko">애드온</title>
<title xml:lang="en">Addon</title>
<title xml:lang="es">Addon</title>
<title xml:lang="zh-CN">插件</title>
<title xml:lang="jp">アドオン</title>
<title xml:lang="fr">Additions</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="en">zero</name>
<name xml:lang="es">zero</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="fr">Zero</name>
<description xml:lang="ko">애드온을 등록하거나 사용/미사용을 설정하는 애드온 관리 모듈입니다.</description>
<description xml:lang="en">This module is for maintaining addons which can toggle use and disuse states.</description>
<description xml:lang="es">La Modula para applicar o desapplicar addionales</description>
<description xml:lang="zh-CN">登录插件或设置启用/禁用插件的管理模块。</description>
<description xml:lang="jp">アドオンの「登録、使用、未使用」などを設定するための管理モジュールです。</description>
<description xml:lang="fr">Ce module est pour les Additions de maintien qui peuvent basculer des états d'utilisation et de désuétude. </description>
</author>
</module>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<module>
<actions>
<action name="dispAddonAdminIndex" type="view" standalone="true" admin_index="true" />
<action name="dispAddonAdminInfo" type="view" standalone="true" />
<action name="dispAddonAdminSetup" type="view" standalone="true" />
<action name="procAddonAdminToggleActivate" type="controller" standalone="true" />
<action name="procAddonAdminSetupAddon" type="controller" standalone="true" />
</actions>
</module>

View file

@ -0,0 +1,15 @@
<?php
/**
* @file en.lang.php
* @author zero (zero@nzeo.com)
* @brief English Language Pack
**/
$lang->addon = "Addon";
$lang->addon_info = 'Summary of this Addon';
$lang->addon_maker = 'Author of this Addon';
$lang->addon_history = 'Addon History';
$lang->about_addon = 'Addon is for controling actions rather than displaying the HTML results.<br />Simply by toggling any addons you want on or off, you can use very useful functions to administer your website';
?>

View file

@ -0,0 +1,15 @@
<?php
/**
* @file es.lang.php
* @author zero (zero@nzeo.com)
* @brief Paquete lenguage de Español
**/
$lang->addon = "Adiciónales";
$lang->addon_info = 'Información de Adiciónales';
$lang->addon_maker = 'Autor';
$lang->addon_history = 'Historia de modificación ';
$lang->about_addon = 'Adiciónales más coltrola acciónes que salida de HTML.<br />Solo encendir o apagar los adiciónales puede utilizar los funciónes útiles de manejar el sitio.';
?>

View file

@ -0,0 +1,15 @@
<?php
/**
* @file fr.lang.php
* @author zero (zero@nzeo.com)
* @brief Paquet Francais de Langue
**/
$lang->addon = "Additions";
$lang->addon_info = 'Un resume de ce additions';
$lang->addon_maker = 'Le createur de ce additions';
$lang->addon_history = 'L\'histoire de ce additions';
$lang->about_addon = 'Les operations de service de additions plutot que le HTML reel results.<br/>Simply basculant n\'importe quel additions te permet en marche et en arret d\'employer les dispositifs utiles.';
?>

View file

@ -0,0 +1,15 @@
<?php
/**
* @file jp.lang.php
* @author zero (zero@nzeo.com) 翻訳RisaPapa
* @brief 日本語言語パッケージ
**/
$lang->addon = "アドオン";
$lang->addon_info = 'アドオン情報';
$lang->addon_maker = 'アドオン作者';
$lang->addon_history = '変更内容';
$lang->about_addon = 'アドオンは、HTMLの出力をコントロールするというより動作を制御する役割をします。お好みのアドオンを「使用/未使用」に設定するだけでサイトの運営に有用な機能が利用できます。';
?>

View file

@ -0,0 +1,15 @@
<?php
/**
* @file ko.lang.php
* @author zero (zero@nzeo.com)
* @brief 한국어 언어팩
**/
$lang->addon = "애드온";
$lang->addon_info = '애드온정보';
$lang->addon_maker = '애드온 제작자';
$lang->addon_history = '변경 사항 ';
$lang->about_addon = '애드온은 html결과물을 출력하기 보다 동작을 제어하는 역할을 합니다.<br />원하시는 애드온을 on/ off하시는 것만으로 사이트 운영에 유용한 기능을 연동할 수 있습니다.';
?>

View file

@ -0,0 +1,15 @@
<?php
/**
* @file zh-CN.lang.php
* @author zero (zero@nzeo.com)
* @brief 简体中文语言包
**/
$lang->addon = "插件";
$lang->addon_info = '插件信息';
$lang->addon_maker = '插件作者';
$lang->addon_history = '更新纪录 ';
$lang->about_addon = '插件是加载扩展功能的动作,而不是输出结果组件。<br />启用/禁用插件,为网站提供强大的功能。';
?>

View file

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

View file

@ -0,0 +1,9 @@
<query id="getAddonInfo" action="select">
<tables>
<table name="addons" />
</tables>
<columns />
<conditions>
<condition operation="equal" column="addon" var="addon" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,12 @@
<query id="getAddonIsActivated" action="select">
<tables>
<table name="addons" />
</tables>
<columns>
<column name="count(*)" alias="count" />
</columns>
<conditions>
<condition operation="equal" column="addon" var="addon" notnull="notnull" />
<condition operation="equal" column="is_used" default="Y" notnull="notnull" pipe="and" />
</conditions>
</query>

View file

@ -0,0 +1,8 @@
<query id="getAddons" action="select">
<tables>
<table name="addons" />
</tables>
<navigation>
<index var="list_order" default="addon" order="asc" />
</navigation>
</query>

View file

@ -0,0 +1,10 @@
<query id="insertAddon" action="insert">
<tables>
<table name="addons" />
</tables>
<columns>
<column name="addon" var="addon" notnull="notnull" />
<column name="is_used" var="is_used" default="N" notnull="notnull" />
<column name="regdate" var="regdate" default="curdate()" />
</columns>
</query>

View file

@ -0,0 +1,12 @@
<query id="updateAddon" action="update">
<tables>
<table name="addons" />
</tables>
<columns>
<column name="is_used" var="is_used" default="Y" />
<column name="extra_vars" var="extra_vars" />
</columns>
<conditions>
<condition operation="equal" column="addon" var="addon" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,6 @@
<table name="addons">
<column name="addon" type="varchar" size="250" notnull="notnull" primary_key="primary_key" />
<column name="is_used" type="char" size="1" default="Y" notnull="notnull" />
<column name="extra_vars" type="text"/>
<column name="regdate" type="date" index="idx_regdate" />
</table>

View file

@ -0,0 +1,34 @@
<div id="popHeadder">
<h1>{$lang->addon_maker}</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>{$addon_info->title} ver. {$addon_info->version}</td>
</tr>
<tr>
<th scope="row"><label for="textfield2">{$lang->author}</label></th>
<td class="blue"><a href="mailto:{$addon_info->author->email_address}">{$addon_info->author->name}</a></td>
</tr>
<tr>
<th scope="row"><label for="textfield2">{$lang->homepage}</label></th>
<td class="blue"><a href="{$addon_info->author->homepage}" onclick="window.open(this.href);return false;">{$addon_info->author->homepage}</a></td>
</tr>
<tr>
<th scope="row"><label for="textfield2">{$lang->regdate}</label></th>
<td>{$addon_info->author->date}<td>
</tr>
<tr>
<th scope="row" class="borderBottomNone">{$lang->description}</th>
<td class="borderBottomNone">{nl2br($addon_info->author->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>

View file

@ -0,0 +1,60 @@
<!--%import("filter/toggle_activate_addon.xml")-->
<!--%import("js/addon.js")-->
<h3>{$lang->addon} <span class="gray">{$lang->cmd_management}</span></h3>
<div class="infoText">{nl2br($lang->about_addon)}</div>
<!-- xml js filter를 이용하기 위한 데이터 전달용 form -->
<form id="fo_addon" action="./" method="get">
<input type="hidden" name="addon" value="" />
</form>
<!-- 애드온의 목록 -->
<table cellspacing="0" class="tableType3">
<thead>
<tr>
<th scope="col">{$lang->addon_name}</th>
<th scope="col">{$lang->version}</th>
<th scope="col">{$lang->author}</th>
<th scope="col">{$lang->date}</th>
<th scope="col">{$lang->installed_path}</th>
<th scope="col">{$lang->cmd_setup}</th>
<th scope="col">{$lang->use}</th>
</tr>
</thead>
<tbody>
<!--@foreach($addon_list as $key => $val)-->
<tr>
<th scope="row" rowspan="2">
<a href="{getUrl('','module','addon','act','dispAddonAdminInfo','selected_addon',$val->addon)}" onclick="popopen(this.href,'addon_info');return false" class="blue">{$val->title}</a> <br />
({$val->addon})
</th>
<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">{$val->path}</td>
<td>
<!--@if($val->extra_vars)-->
<a href="{getUrl('','module','addon','act','dispAddonAdminSetup','selected_addon',$val->addon)}" onclick="popopen(this.href,'addon_info');return false" class="blue">{$lang->cmd_setup}</a>
<!--@else-->
&nbsp;
<!--@end-->
</td>
<td>
<!--@if($val->activated)-->
<a href="#" onclick="doToggleAddon('{$val->addon}');return false;" class="blue">{$lang->use}</a>
<!--@else-->
<a href="#" onclick="doToggleAddon('{$val->addon}');return false;" class="red">{$lang->notuse}</a>
<!--@end-->
</td>
</tr>
<tr>
<td colspan="7" class="colSpan">
{nl2br($val->author->description)}
</td>
</tr>
<!--@end-->
</tbody>
</table>

View file

@ -0,0 +1,8 @@
<filter name="setup_addon" module="addon" act="procAddonAdminSetupAddon" confirm_msg_code="confirm_submit">
<form />
<parameter />
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -0,0 +1,9 @@
<filter name="toggle_activate_addon" module="addon" act="procAddonAdminToggleActivate">
<form>
<node target="addon" required="true" />
</form>
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -0,0 +1,9 @@
/**
* @brief 애드온의 활성/비활성 토글용 함수
* fo_addon이라는 id를 가지는 form에 인자로 주어진 addon값을 세팅후 실행
**/
function doToggleAddon(addon) {
var fo_obj = xGetElementById('fo_addon');
fo_obj.addon.value = addon;
procFilter(fo_obj, toggle_activate_addon);
}

View file

@ -0,0 +1,46 @@
<!--%import("filter/setup_addon.xml")-->
<div id="popHeadder">
<h1>{$lang->cmd_setup}</h1>
</div>
<form action="./" method="get" onsubmit="return procFilter(this, setup_addon);">
<input type="hidden" name="addon_name" value="{$addon_info->addon_name}" />
<div id="popBody">
<table cellspacing="0" class="tableType5">
<col width="100" />
<col />
<tr>
<th scope="row"><label for="textfield1">{$lang->title}</label></th>
<td>{$addon_info->title} ver. {$addon_info->version}</td>
</tr>
<tr>
<th scope="row"><label for="textfield2">{$lang->author}</label></th>
<td><a href="mailto:{$addon_info->author->email_address}">{$addon_info->author->name}</a></td>
</tr>
<tr>
<th scope="row"><label for="textfield2">{$lang->homepage}</label></th>
<td><a href="{$addon_info->author->homepage}" onclick="window.open(this.href);return false;">{$addon_info->author->homepage}</a></td>
</tr>
<!--@foreach($addon_info->extra_vars as $key => $val)-->
<tr>
<th scope="row">{$val->title}</th>
<td>
<input type="text" name="{$val->name}" value="{$val->value}" class="inputTypeText w100" />
<p>{$val->description}</p>
</td>
</tr>
<!--@end-->
</table>
</div>
<div id="popFooter">
<div class="tCenter gap1">
<span class="button"><input type="submit" value="{$lang->cmd_apply}" class="editor_button" /></span>
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
</div>
</div>
</form>

View file

@ -0,0 +1,59 @@
<?php
/**
* @class adminAdminController
* @author zero (zero@nzeo.com)
* @brief admin 모듈의 admin controller class
**/
class adminAdminController extends admin {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 숏컷 추가
**/
function procAdminInsertShortCut() {
$module = Context::get('selected_module');
$output = $this->insertShortCut($module);
if(!$output->toBool()) return $output;
$this->setMessage('success_registed');
}
/**
* @brief 숏컷의 삭제
**/
function procAdminDeleteShortCut() {
$args->module = Context::get('selected_module');
// 삭제 불가능 바로가기의 처리
if(in_array($args->module, array('module','addon','widget','layout'))) return new Object(-1, 'msg_manage_module_cannot_delete');
$output = executeQuery('admin.deleteShortCut', $args);
if(!$output->toBool()) return $output;
$this->setMessage('success_deleted');
}
/**
* @brief 관리자 페이지의 단축 메뉴 추가
**/
function insertShortCut($module) {
// 선택된 모듈의 정보중에서 admin_index act를 구함
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoXml($module);
$args->module = $module;
$args->title = $module_info->title;
$args->default_act = $module_info->admin_index_act;
if(!$args->default_act) return new Object(-1, 'msg_default_act_is_null');
$output = executeQuery('admin.insertShortCut', $args);
return $output;
}
}
?>

View file

@ -0,0 +1,42 @@
<?php
/**
* @class adminAdminModel
* @author zero (zero@nzeo.com)
* @brief admin 모듈의 admin model class
**/
class adminAdminModel extends admin {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief admin shortcut 등록된 목록을 return;
**/
function getShortCuts() {
$output = executeQuery('admin.getShortCutList');
if(!$output->toBool()) return $output;
if(!is_array($output->data)) $list = array($output->data);
else $list = $output->data;
foreach($list as $val) {
$shortcut_list[$val->module] = $val;
}
// 모듈 목록을 구해와서 숏컷에 해당하는 타이틀을 추출
$oModuleModel = &getModel('module');
$module_list = $oModuleModel->getModulesXmlInfo();
foreach($module_list as $key => $val) {
$module_name = $val->module;
if($shortcut_list[$module_name]) $shortcut_list[$module_name]->title = $val->title;
}
return $shortcut_list;
}
}
?>

View file

@ -0,0 +1,85 @@
<?php
/**
* @class adminAdminView
* @author zero (zero@nzeo.com)
* @brief admin 모듈의 admin view class
**/
class adminAdminView extends admin {
/**
* @brief 초기화
**/
function init() {
if(!$this->grant->is_admin) return;
// template path 지정
$this->setTemplatePath($this->module_path.'tpl');
// 접속 사용자에 대한 체크
$oMemberModel = &getModel('member');
$logged_info = $oMemberModel->getLoggedInfo();
// 관리자용 레이아웃으로 변경
$this->setLayoutPath($this->getTemplatePath());
$this->setLayoutFile('layout.html');
// shortcut 가져오기
$oAdminModel = &getAdminModel('admin');
$shortcut_list = $oAdminModel->getShortCuts();
Context::set('shortcut_list', $shortcut_list);
// 현재 실행중인 모듈을 구해 놓음
$running_module = strtolower(preg_replace('/([a-z]+)([A-Z]+)([a-z]+)(.*)/', '\\2\\3', $this->act));
Context::set('running_module', $running_module);
$db_info = Context::getDBInfo();
Context::set('time_zone_list', $GLOBALS['time_zone']);
Context::set('time_zone', $GLOBALS['_time_zone']);
Context::set('use_rewrite', $db_info->use_rewrite=='Y'?'Y':'N');
Context::setBrowserTitle("ZeroboardXE Admin Page");
}
/**
* @brief 관리자 메인 페이지 출력
**/
function dispAdminIndex() {
// 공식사이트에서 최신 뉴스를 가져옴
$newest_news_url = sprintf("http://news.zeroboard.com/%s/news.php", Context::getLangType());
$cache_file = sprintf("./files/cache/newest_news.%s.cache.php", Context::getLangType());
// 1시간 단위로 캐싱 체크
if(!file_exists($cache_file) || filectime($cache_file)+ 60*60 < time()) {
FileHandler::getRemoteFile($newest_news_url, $cache_file);
}
if(file_exists($cache_file)) {
$oXml = new XmlParser();
$buff = $oXml->parse(FileHandler::readFile($cache_file));
$item = $buff->zbxe_news->item;
if($item) {
if(!is_array($item)) $item = array($item);
foreach($item as $key => $val) {
$obj = null;
$obj->title = $val->body;
$obj->date = $val->attrs->date;
$obj->url = $val->attrs->url;
$news[] = $obj;
}
Context::set('news', $news);
}
}
$this->setTemplateFile('index');
}
/**
* @brief 관리자 메뉴 숏컷 출력
**/
function dispAdminShortCut() {
$this->setTemplateFile('shortcut_list');
}
}
?>

View file

@ -0,0 +1,45 @@
<?php
/**
* @class admin
* @author zero (zero@nzeo.com)
* @brief admin 모듈의 high class
**/
class admin extends ModuleObject {
/**
* @brief 설치시 추가 작업이 필요할시 구현
**/
function moduleInstall() {
// 게시판, 회원관리, 레이아웃관리등 자주 사용될 module을 admin_shortcut에 등록
$oAdminController = &getAdminController('admin');
$oAdminController->insertShortCut('blog');
$oAdminController->insertShortCut('board');
$oAdminController->insertShortCut('page');
$oAdminController->insertShortCut('menu');
$oAdminController->insertShortCut('layout');
$oAdminController->insertShortCut('addon');
$oAdminController->insertShortCut('widget');
$oAdminController->insertShortCut('member');
$oAdminController->insertShortCut('module');
return new Object();
}
/**
* @brief 설치가 이상이 없는지 체크하는 method
**/
function checkUpdate() {
return false;
}
/**
* @brief 업데이트 실행
**/
function moduleUpdate() {
return new Object();
}
}
?>

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<module version="0.1">
<title xml:lang="ko">관리자 모듈</title>
<title xml:lang="en">Administrator Module</title>
<title xml:lang="es">Modules de administración</title>
<title xml:lang="zh-CN">管理员模块</title>
<title xml:lang="jp">管理者用モジュール</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="en">zero</name>
<name xml:lang="es">zero</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="jp">Zero</name>
<description xml:lang="ko">각 모듈들의 기능을 나열하고 관리자용 레이아웃을 적용하여 관리 기능을 사용할 수 있도록 하는 모듈입니다.</description>
<description xml:lang="en">This module shows a list of features of each module, and enables you to use a quite few of managers by applying layout for administrator.</description>
<description xml:lang="es">Lista las los funciónes de modules y aplica diseño de administración para manejar sitio.</description>
<description xml:lang="zh-CN">列出各模块的功能并使用管理员布局,可以让其使用管理功能的模块。</description>
<description xml:lang="jp">各モジュールの機能を羅列し、管理者用のレイアウトを適用させ、管理機能が使用できるようにするモジュールです。</description>
</author>
</module>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<module>
<actions>
<action name="dispAdminIndex" type="view" standalone="true" index="true"/>
<action name="dispAdminShortCut" type="view" standalone="true" />
<action name="procAdminInsertShortCut" type="controller" standalone="true" />
<action name="procAdminDeleteShortCut" type="controller" standalone="true" />
</actions>
</module>

View file

@ -0,0 +1,70 @@
<?php
/**
* @file en.lang.php
* @author zero (zero@nzeo.com)
* @brief English Language Pack (Only basic words are included here)
**/
$lang->newest_news = "Latest News";
$lang->env_setup = "Setting";
$lang->item_module = "Module List";
$lang->item_addon = "Addon List";
$lang->item_widget = "Widget List";
$lang->item_layout = "Layout List";
$lang->module_name = "Module Name";
$lang->addon_name = "Addon Name";
$lang->version = "Version";
$lang->author = "Developer";
$lang->table_count = "Number of Table";
$lang->installed_path = "Installed Path";
$lang->cmd_shortcut_management = "Edit Menues";
$lang->msg_is_not_administrator = 'Administrator only';
$lang->msg_manage_module_cannot_delete = 'Shortcuts of module, addon, layout, widget cannot be removed';
$lang->msg_default_act_is_null = 'Shortcut could not be registered because default admin Action is not set';
$lang->welcome_to_zeroboard_xe = 'Welcome to the admin page of Zeroboard XE';
$lang->about_admin_page = "Admin page is still being developing,\nWe will add essential contents by accepting many good suggestions during Closebeta.";
$lang->zeroboard_xe_user_links = 'Links for Users';
$lang->zeroboard_xe_developer_links = 'Links for Developers';
$lang->xe_user_links = array(
'Official Website' => 'http://www.zeroboard.com',
//'Close Beta website' => 'http://spring.zeroboard.com',
//'Module morgue' => 'http://www.zeroboard.com',
//'Addon morgue' => 'http://www.zeroboard.com',
//'Widget morgue' => 'http://www.zeroboard.com',
//'Module Skin morgue' => 'http://www.zeroboard.com',
//'Widget Skin morgue' => 'http://www.zeroboard.com',
//'Layout Skin morgue' => 'http://www.zeroboard.com',
);
$lang->xe_developer_links = array(
//'Manual' => 'http://www.zeroboard.com/wiki/manual',
"Developer's forum" => 'http://spring.zeroboard.com',
'Issue Tracking' => 'http://trac.zeroboard.com',
'SVN Repository' => 'http://svn.zeroboard.com',
'doxygen document' => 'http://doc.zeroboard.com',
'PDF Documentation' => 'http://doc.zeroboard.com/zeroboard_xe.pdf',
);
$lang->zeroboard_xe_usefulness_module = 'Useful Modules';
$lang->xe_usefulness_modules = array(
'dispEditorAdminIndex' => 'Editor Manager',
'dispDocumentAdminList' => 'Article Manager',
'dispCommentAdminList' => 'Comment Manager',
'dispFileAdminList' => 'Attachment Manager',
'dispPollAdminList' => 'Poll Manager',
'dispSpamfilterAdminConfig' => 'Spam Filter Manager',
'dispCounterAdminIndex' => 'Counter Log',
);
$lang->xe_license = 'Zeroboard XE complies with the GPL';
$lang->about_shortcut = 'You may remove shortcuts of modules which are registered on frequently using module list';
?>

View file

@ -0,0 +1,66 @@
<?php
/**
* @file es.lang.php
* @author zero (zero@nzeo.com)
* @brief Paquete lenguaje Español (solo los basicos)
**/
$lang->item_module = "Lista de Módulos";
$lang->item_addon = "Lista de Adiciónales";
$lang->item_widget = "Lista de Widget";
$lang->item_layout = "Liasta de Diseño";
$lang->module_name = "Nombre de Módulo";
$lang->addon_name = "Nombre de Adición";
$lang->version = "Versión";
$lang->author = "Autor";
$lang->table_count = "Numero de Tablos";
$lang->installed_path = "Paso de instalación";
$lang->cmd_shortcut_management = "Modificar Menú";
$lang->msg_is_not_administrator = 'Solo administrador puede entrar.';
$lang->msg_manage_module_cannot_delete = 'No puede eliminar acceso directo de Módulos, Adiciónales, Diseño y Widget.';
$lang->msg_default_act_is_null = 'No puede registrar acceso directo por acción de administrador determinado no esta registrado.';
$lang->welcome_to_zeroboard_xe = 'Esto es Pagina de Administrador de ZeroBoard XE';
$lang->about_admin_page = "El pagina de Administración no esta listo.";
$lang->zeroboard_xe_user_links = 'Enlace para usuarios ';
$lang->zeroboard_xe_developer_links = 'Enlace para desarrolladores';
$lang->xe_user_links = array(
'Pagina de web oficial' => 'http://www.zeroboard.com',
//'Sitio para beta cerrado' => 'http://spring.zeroboard.com',
//'Depósitorio de Módulos´ => 'http://www.zeroboard.com',
//'Depósitorio de Adiciónales' => 'http://www.zeroboard.com',
//'Depósitorio de Widgets' => 'http://www.zeroboard.com',
//'Depósitorio de carátulas de módulos' => 'http://www.zeroboard.com',
//'Depósitorio de carátulas de widget' => 'http://www.zeroboard.com',
//'Depósitorio de carátulas de diseño' => 'http://www.zeroboard.com',
);
$lang->xe_developer_links = array(
//'Manuales' => 'http://www.zeroboard.com/wiki/manual',
'Foro Abierto de desarrolladores' => 'http://spring.zeroboard.com',
'Huellas de distribuciónes' => 'http://trac.zeroboard.com',
'Repositor de SVN' => 'http://svn.zeroboard.com',
'doxygen document' => 'http://doc.zeroboard.com',
'Documentación en PDF' => 'http://doc.zeroboard.com/zeroboard_xe.pdf',
);
$lang->zeroboard_xe_usefulness_module = 'Módulos útiles';
$lang->xe_usefulness_modules = array(
'dispEditorAdminIndex' => 'Manejar Editor',
'dispDocumentAdminList' => 'Manejar Documentos',
'dispCommentAdminList' => 'Manejar Commentarios',
'dispFileAdminList' => 'Manejar archivos',
'dispPollAdminList' => 'Manejar votaciónes',
'dispSpamfilterAdminConfig' => 'Manejar SpamFilter',
'dispCounterAdminIndex' => 'Manejar archivo de registro de taquilla',
);
$lang->xe_license = 'ZeroBoard XE esta en bajo de Licencia GPL';
$lang->about_shortcut = 'Puede Eliminar acceso directo de módulos';
?>

View file

@ -0,0 +1,70 @@
<?php
/**
* @file jp.lang.php
* @author zero (zero@nzeo.com) 翻訳RisaPapa
* @brief 日本語言語パッケージ(基本的な内容のみ)
**/
$lang->newest_news = "最新ニュース";
$lang->env_setup = "環境設定";
$lang->item_module = "モジュールリスト";
$lang->item_addon = "アドオンリスト";
$lang->item_widget = "ウィジェットリスト";
$lang->item_layout = "レイアウトリスト";
$lang->module_name = "モジュール名";
$lang->addon_name = "アドオン名";
$lang->version = "バージョン";
$lang->author = "作者";
$lang->table_count = "テーブル数";
$lang->installed_path = "インストールパス";
$lang->cmd_shortcut_management = "メニュー編集";
$lang->msg_is_not_administrator = '管理者のみ接続できます';
$lang->msg_manage_module_cannot_delete = 'モジュール、アドオン、ウィジェットのショットカットは削除できません。';
$lang->msg_default_act_is_null = 'デフォルトの管理者のアクションが指定されていないため、ショットカットを登録することができません。';
$lang->welcome_to_zeroboard_xe = 'ゼロボードXEの管理者ページです。';
$lang->about_admin_page = "管理者ページはまだ未完成です。クローズベタバージョンの期間に、多くの方々からご意見をいただきながら、必ず必要なコンテンツを埋めていきたいと思います。";
$lang->zeroboard_xe_user_links = 'ユーザのためのリンク';
$lang->zeroboard_xe_developer_links = 'デベロッパーのためのリンク';
$lang->xe_user_links = array(
'公式ホームページ' => 'http://www.zeroboard.com',
//'クローズベタサイト' => 'http://spring.zeroboard.com',
//'モジュルダ情報' => 'http://www.zeroboard.com',
//'アドオン情報' => 'http://www.zeroboard.com',
//'ウィジェット情報' => 'http://www.zeroboard.com',
//'モジュール・スキン情報' => 'http://www.zeroboard.com',
//'ウィジェットスキン情報' => 'http://www.zeroboard.com',
//'レイアウトスキン情報' => 'http://www.zeroboard.com',
);
$lang->xe_developer_links = array(
'デベロッパーフォーラム' => 'http://spring.zeroboard.com',
//'マニュアル' => 'http://www.zeroboard.com/wiki/manual',
'イッシュートラッキング' => 'http://trac.zeroboard.com',
'SVN Repository' => 'http://svn.zeroboard.com',
'Doxygen Document' => 'http://doc.zeroboard.com',
'PDFドキュメント' => 'http://doc.zeroboard.com/zeroboard_xe.pdf',
);
$lang->zeroboard_xe_usefulness_module = '有用なモジュール';
$lang->xe_usefulness_modules = array(
'dispEditorAdminIndex' => 'エディター管理',
'dispDocumentAdminList' => 'ドキュメント管理',
'dispCommentAdminList' => 'コメント管理',
'dispFileAdminList' => '添付ファイル管理',
'dispPollAdminList' => 'アンケート管理',
'dispSpamfilterAdminConfig' => 'スパムフィルター管理',
'dispCounterAdminIndex' => 'カウンターログ',
);
$lang->xe_license = 'ゼロボードXEのライセンスはGPLです。';
$lang->about_shortcut = 'よく使用するモジュールに登録されたショットカットは削除できます。';
?>

View file

@ -0,0 +1,70 @@
<?php
/**
* @file ko.lang.php
* @author zero (zero@nzeo.com)
* @brief 한국어 언어팩 (기본적인 내용만 수록)
**/
$lang->newest_news = "최신 소식";
$lang->env_setup = "환경 설정";
$lang->item_module = "모듈 목록";
$lang->item_addon = "애드온 목록";
$lang->item_widget = "위젯 목록";
$lang->item_layout = "레이아웃 목록";
$lang->module_name = "모듈 이름";
$lang->addon_name = "애드온 이름";
$lang->version = "버전";
$lang->author = "제작자";
$lang->table_count = "테이블수";
$lang->installed_path = "설치경로";
$lang->cmd_shortcut_management = "메뉴 편집하기";
$lang->msg_is_not_administrator = '관리자만 접속이 가능합니다';
$lang->msg_manage_module_cannot_delete = '모듈, 애드온, 레이아웃, 위젯 모듈의 바로가기는 삭제 불가능합니다';
$lang->msg_default_act_is_null = '기본 관리자 Action이 지정되어 있지 않아 바로가기 등록을 할 수가 없습니다';
$lang->welcome_to_zeroboard_xe = '제로보드XE 관리자 페이지입니다';
$lang->about_admin_page = "관리자 페이지는 아직 미완성입니다.\n클로즈 베타동안 좋은 의견 받아서 꼭 필요한 컨텐츠를 채우도록 하겠습니다.";
$lang->zeroboard_xe_user_links = '사용자를 위한 링크';
$lang->zeroboard_xe_developer_links = '개발자를 위한 링크';
$lang->xe_user_links = array(
'공식홈페이지' => 'http://www.zeroboard.com',
//'클로즈베타 사이트' => 'http://spring.zeroboard.com',
//'모듈 자료실' => 'http://www.zeroboard.com',
//'애드온 자료실' => 'http://www.zeroboard.com',
//'위젯 자료실' => 'http://www.zeroboard.com',
//'모듈 스킨 자료실' => 'http://www.zeroboard.com',
//'위젯 스킨 자료실' => 'http://www.zeroboard.com',
//'레이아웃 스킨 자료실' => 'http://www.zeroboard.com',
);
$lang->xe_developer_links = array(
//'매뉴얼' => 'http://www.zeroboard.com/wiki/manual',
'개발자 포럼' => 'http://spring.zeroboard.com',
'이슈트래킹' => 'http://trac.zeroboard.com',
'SVN Repository' => 'http://svn.zeroboard.com',
'doxygen document' => 'http://doc.zeroboard.com',
'pdf 문서' => 'http://doc.zeroboard.com/zeroboard_xe.pdf',
);
$lang->zeroboard_xe_usefulness_module = '유용한 모듈들';
$lang->xe_usefulness_modules = array(
'dispEditorAdminIndex' => '에디터 관리',
'dispDocumentAdminList' => '문서 관리',
'dispCommentAdminList' => '댓글 관리',
'dispFileAdminList' => '첨부파일 관리',
'dispPollAdminList' => '설문조사 관리',
'dispSpamfilterAdminConfig' => '스팸필터 관리',
'dispCounterAdminIndex' => '카운터 로그',
);
$lang->xe_license = '제로보드XE는 GPL을 따릅니다';
$lang->about_shortcut = '자주 사용하는 모듈에 등록된 모듈의 바로가기를 삭제할 수 있습니다';
?>

View file

@ -0,0 +1,71 @@
<?php
/**
* @file zh-CN.lang.php
* @author zero (zero@nzeo.com)
* @brief 简体中文语言包 (只收录基本内容)
**/
$lang->newest_news = "最新消息";
$lang->env_setup = "环境设置";
$lang->item_module = "模块目录";
$lang->item_addon = "插件目录";
$lang->item_widget = "控件目录";
$lang->item_layout = "布局目录";
$lang->module_name = "模块名称";
$lang->addon_name = "插件名称";
$lang->version = "版本";
$lang->author = "作者";
$lang->table_count = "表格数";
$lang->installed_path = "安装路径";
$lang->cmd_shortcut_management = "编辑菜单";
$lang->msg_is_not_administrator = '只有管理员可以查看';
$lang->msg_manage_module_cannot_delete = '模块,插件,布局,控件模块的快捷菜单是不能删除的。';
$lang->msg_default_act_is_null = '没有指定默认管理员的动作,是不能添加到快捷菜单的。';
$lang->welcome_to_zeroboard_xe = 'zeroboard XE 管理页面';
$lang->about_admin_page = "后台管理页面未完成";
$lang->zeroboard_xe_user_links = '为用户提供的链接';
$lang->zeroboard_xe_developer_links = '为开发人员提供的链接';
$lang->xe_user_links = array(
'韩国官方主页' => 'http://www.zeroboard.com',
//'closebeta主页' => 'http://spring.zeroboard.com',
//'模块下载地址' => 'http://www.zeroboard.com',
//'插件下载地址' => 'http://www.zeroboard.com',
//'控件下载地址' => 'http://www.zeroboard.com',
//'模块皮肤下载地址' => 'http://www.zeroboard.com',
//'控件皮肤下载地址' => 'http://www.zeroboard.com',
//'布局皮肤下载地址' => 'http://www.zeroboard.com',
);
$lang->xe_developer_links = array(
//'使用手册' => 'http://www.zeroboard.com/wiki/manual',
'Developer 论坛' => 'http://spring.zeroboard.com',
'问题跟踪' => 'http://trac.zeroboard.com',
'SVN Repository' => 'http://svn.zeroboard.com',
'doxygen document' => 'http://doc.zeroboard.com',
'pdf 文件' => 'http://doc.zeroboard.com/zeroboard_xe.pdf',
);
$lang->zeroboard_xe_usefulness_module = '常用模块';
$lang->xe_usefulness_modules = array(
'dispEditorAdminIndex' => '编辑器管理',
'dispDocumentAdminList' => '主题管理',
'dispCommentAdminList' => '评论管理',
'dispFileAdminList' => '附件管理',
'dispPollAdminList' => '投票管理',
'dispSpamfilterAdminConfig' => '垃圾过滤管理',
'dispCounterAdminIndex' => '统计日志',
);
$lang->xe_license = 'Zeroboard XE遵循 GPL协议';
$lang->about_shortcut = '可以删除添加到常用模块中的快捷菜单。';
?>

View file

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

View file

@ -0,0 +1,8 @@
<query id="getShortCutList" action="select">
<tables>
<table name="admin_shortcut" />
</tables>
<navigation>
<index var="sort_index" default="list_order" order="asc" />
</navigation>
</query>

View file

@ -0,0 +1,13 @@
<query id="insertShortCut" action="insert">
<tables>
<table name="admin_shortcut" />
</tables>
<columns>
<column name="shortcut_srl" var="shortcut_srl" default="sequence()" filter="number" notnull="notnull" />
<column name="title" var="title" notnull="notnull" minlength="2" maxlength="250" />
<column name="module" var="module" notnull="notnull" minlength="2" maxlength="250" />
<column name="default_act" var="default_act" notnull="notnull" minlength="2" maxlength="250" />
<column name="regdate" var="regdate" default="curdate()" />
<column name="list_order" var="list_order" default="sequence()" />
</columns>
</query>

View file

@ -0,0 +1,8 @@
<table name="admin_shortcut">
<column name="shortcut_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="module" type="varchar" size="250" notnull="notnull" unique="uni_module" />
<column name="title" type="varchar" size="250" notnull="notnull" />
<column name="default_act" type="varchar" size="250" notnull="notnull" />
<column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" />
<column name="regdate" type="date" />
</table>

View file

@ -0,0 +1,211 @@
@charset "utf-8";
/*
NHN UIT Lab. WebStandardization Team (http://html.nhndesign.com/)
Jeong, Chan Myeong 070601~070630
*/
/*
Used Hack
IE6 & Below
{ property:value; _property:value;}
IE7 Only
*:first-child+html #selector
*/
body { margin:0; }
li { list-style:none; }
a { text-decoration:none;}
a:hover { text-decoration:underline;}
address { font-style:normal;}
/* Special Class Selector */
.fr { float:right;}
.fl { float:left;}
.fwB { font-weight:bold;}
.gl3 { padding-left:2em; }
/* ----- cBody | Start ----- */
h3 { padding:22px 0 7px 0; border-bottom:2px solid #f2250d; background:url(../images/h3.gif) no-repeat 1px 24px; font-size:1.4em; margin-bottom:10px; text-indent:24px; z-index:99;}
h3 .gray { color:#9d9d9d;}
.pass { background:url(../images/h4.gif) no-repeat .5em center; padding-left:1em; color:#606060; font-size:1em;}
.header4 { overflow:hidden;}
h4 { font-size:1em; color:#f2250d; float:left; padding:.5em 0 1.2em 2em;}
h4 .bracket { font-weight:normal; color:#9d9d9d;}
h4 .vr { font-weight:normal; color:#d1d1d1;}
h4 .view { color:#158692; padding-right:.6em; font:bold .9em Tahoma; background:url(../images/iconView.gif) no-repeat right center;}
.header4 div.summary { font:.9em Tahoma; color:#636363; float:left; padding:.5em 0 1.2em 2em;}
.header4 div.summary .vr { font-weight:normal; color:#d1d1d1; margin:0 .5em;}
.header4 div.summary em { color:#ff1d00; font-style:normal;}
.header4 table.summary { border-right:1px solid #f2f2f2; width:100%; height:35px; margin-bottom:15px;}
.header4 table.summary th { background:#969693; color:#ffffff;}
.header4 table.summary th img { vertical-align:middle;}
.header4 table.summary th .vr { color:#a3a39f; margin:0 4px; font-weight:normal;}
.header4 table.summary td { border-top:1px solid #f2f2f2; border-bottom:1px solid #f2f2f2; font:.9em Tahoma; padding-left:17px;}
select.time_zone { width:70%; position:relative; top:4px; }
/* ----- cBody | End ----- */
/* ----- Content | Start ----- */
/* localNavigation */
.localNavigation { float:right;margin-bottom:10px;}
.localNavigation li { float:left; margin-right:.3em;}
.localNavigation li.on { margin-right:.3em;}
.localNavigation li a { padding:.4em 1em .2em 1em; display:block; float:left; font-size:.9em; color:#606060; border:2px solid #e0dfde;}
.localNavigation li a:hover { border:2px solid #ff1a00; color:#f2250d; text-decoration:none;}
.localNavigation li.on a { color:#f2250d; border:2px solid #ff1a00; text-decoration:none;}
/* pageNavigation */
.pageNavigation { display:block; padding:1.5em 0 2em 0; text-align:center; font:bold .8em Tahoma; }
.pageNavigation a { margin-left:-4px; font:bold 1em Tahoma; color:#666666; display:inline-block; padding:1px 7px 2px 6px; border-left:1px solid #dedfde; border-right:1px solid #CCCCCC; text-decoration:none; line-height:1em; }
.pageNavigation a:hover { background:#F7F7F7; text-decoration:none; }
.pageNavigation a:visited { color:#999999;}
.pageNavigation a.goToFirst,
.pageNavigation a.goToLast { border:none; border-right:1px solid #ffffff; border-left:1px solid #ffffff; z-index:99; vertical-align:top; padding:0px 7px 4px 6px;}
.pageNavigation a.goToFirst img,
.pageNavigation a.goToLast img { display:inline-block; padding:2px 0; top:2px; _top:1px;}
.pageNavigation .current { margin-left:-4px; font:bold 1em Tahoma; color:#ff6600; display:inline-block; padding:1px 7px 1px 6px; border-left:1px solid #dedfde; border-right:1px solid #CCCCCC; text-decoration:none; line-height:1em; }
/* tableStyle */
.infoText { clear:both; border:1px solid #f2f2f0; margin-bottom:12px; background:#f9f9f6; padding:1.2em; color:#7b7972; font-size:.9em; line-height:1.4em;}
.gap1 { margin-top:.8em; }
.tableSummaryType1 { font:bold .8em Tahoma; color:#a0a0a0; margin-bottom:10px;}
.tableSummaryType1 strong { font:bold 1em Tahoma; color:#ff1a00;}
.tableType1 { width:100%; border-bottom:2px solid #c1c0bd;}
.tableType1 caption { padding:2em 0 .5em 1.5em; font-weight:bold; text-align:left; background:url(../images/iconH3.gif) no-repeat .5em 2em;}
.tableType1 th { font-weight:normal; color:#ffffff; background:url(../images/tableType1Header.gif) repeat-x; height:28px;}
.tableType1 th select { vertical-align:middle; }
.tableType1 td { text-align:center; color:#636363; height:30px; border-top:1px solid #ededed;}
.tableType1 td.left { text-align:left }
.tableType1 td a { color:#1d1d1d;}
.tableType1 .tahoma { font-size:.9em; font-family:Tahoma;}
.tableType1 .tahoma a { font-size:1em;}
.tableType1 td.blue a { color:#158692;}
.tableType1 td.red a { color:#c95b53;}
.tableType1 td.red { color:#c95b53;}
.tableType1 td .blue { color:#158692;}
.tableType1 td .red { color:#c95b53;}
.tableType2 { border:2px solid #c1c0bd; border-left:none; border-right:none; width:100%;}
.tableType2 caption { padding:2em 0 .5em 1.5em; font-weight:bold; text-align:left; background:url(../images/iconH3.gif) no-repeat .5em 2em;}
.tableType2 th { border-top:1px solid #fbfbfb; border-bottom:1px solid #e4e4e4; background:#f5f5f5; padding:10px 10px 10px 2em; font-weight:normal; text-align:left; color:#606060;}
.tableType2 td { border-bottom:1px solid #ededed; padding:10px 10px 7px 10px; font-size:.9em; color:#7b7972;}
.tableType2 td input,
.tableType2 td textarea,
.tableType2 td select { margin-bottom:.5em; vertical-align:middle; font-size:1em; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6;}
.tableType2 td .w100 { width:100%; display:block;}
.tableType2 td .checkbox { margin:-3px;}
.tableType2 td p { line-height:1.4em;}
.tableType2 td a { color:#1d1d1d;}
.tableType2 td a.blue { color:#158692;}
.tableType2 td a.red { color:#c95b53;}
.tableType3 { width:100%; border-bottom:2px solid #c1c0bd;}
.tableType3 caption { padding:2em 0 .5em 1.5em; font-weight:bold; text-align:left; background:url(../images/iconH3.gif) no-repeat .5em 2em;}
.tableType3 th.bold { font-weight:bold; }
.tableType3 th,
.tableType3 td { border-top:1px solid #bfbfbf;}
.tableType3 thead th { font-weight:normal; color:#ffffff; background:url(../images/tableType1Header.gif) repeat-x; height:28px;}
.tableType3 tbody th { font-weight:normal; color:#606060; text-align:left; background:#f5f5f5; padding:10px 10px 10px 2em;}
.tableType3 tbody th img { vertical-align:middle; margin-top:-2px;}
.tableType3 td { text-align:center; color:#636363; border-left:1px solid #ededed; padding:10px 10px 7px 10px;}
.tableType3 td.colSpan { text-align:left; border-top:1px solid #ededed;}
.tableType3 td a { color:#1d1d1d;}
.tableType3 th a.blue { color:#158692;}
.tableType3 th a.red { color:#c95b53;}
.tableType3 .tahoma { font-size:.9em; font-family:Tahoma;}
.tableType3 .tahoma a { font-size:1em;}
.tableType3 td.left { text-align:left; }
.tableType3 td label { margin-right:1em; }
.tableType3 td.blue a { color:#158692;}
.tableType3 td.red a { color:#c95b53;}
.tableType3 td a.blue { color:#158692;}
.tableType3 td a.red { color:#c95b53;}
/*.tableType3 td input,*/
.tableType3 td textarea,
.tableType3 td select { margin-bottom:.5em; vertical-align:middle; font-size:1em; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6;}
.tableType3 td .w100 { width:100%; display:block;}
.tableType4 { border:2px solid #c1c0bd; border-left:none; border-right:none; width:100%;}
.tableType4 th { border-top:1px solid #fbfbfb; border-bottom:1px solid #e4e4e4; background:#f5f5f5; padding:10px 10px 10px 2em; font-weight:normal; text-align:left; color:#606060;}
.tableType4 caption { padding:2em 0 .5em 1.5em; font-weight:bold; text-align:left; background:url(../images/iconH3.gif) no-repeat .5em 2em;}
.tableType4.counter th { font-size:.9em; text-align:center; padding:0;}
.tableType4.counter th em { font:normal 1em Tahoma;}
.tableType4 td { border-bottom:1px solid #ededed; padding:10px 10px 7px 10px; color:#7b7972;}
.tableType4 td a { color:#1d1d1d;}
.tableType4 .tahoma { font-size:.9em; font-family:Tahoma;}
.tableType4 .tahoma a { font-size:1em;}
.tableType4 td.blue a { color:#158692;}
.tableType4 td.red a { color:#c95b53;}
/*.tableType4 td input,*/
.tableType4 td textarea,
.tableType4 td select { margin-bottom:.5em; vertical-align:middle;font-size:1em; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6;}
.tableType4 td label { margin-right:1em; }
.tableType4 td .w100 { width:100%; display:block;}
.tableType4 td .checkbox { margin:-3px;}
.tableType4 td p { line-height:1.4em;}
.tableType4 td .graph { width:90%; position:relative;}
.tableType4 td .graph .bar { width:100%; position:absolute; margin-top:4px;}
.tableType4 td .graph .num { position:relative; background:#ffffff; color:#636363; font:.9em Tahoma; padding-left:10px;}
.widgetBox { border:1px solid #c1c0bd; width:100%;}
.widgetBox th { text-align:center; font-weight:normal; background-color:#EFEFEF; }
.widgetBox td { text-align:left; padding:.5em; }
/* ----- Content | End ----- */
/* ----- Popup | Start ----- */
/* popup */
#popHeadder { width:620px; height:40px; background:url(../images/popupTopBg.png) repeat-x left top; }
#popHeadder h1 { padding:13px 0 0 19px; height:27px; background:url(../images/popupTopBgEnd.png) no-repeat right top; font-size:1.2em; color:#d8d8d8;}
#popBody { width:600px; padding:10px; background:#ffffff;}
#popFooter { width:620px; background:#f7f7f6; border-top:1px solid #e8e8e7; padding:.5em 0 .5em 0; overflow:hidden; }
#popFooter .close { position:relative; left:50%; margin-left:-1em; float:left;}
#popBody .tableType5 { border:1px solid #c1c0bd; border-left:none; border-right:none; width:100%;}
#popBody .tableType5 th { border-top:1px solid #fbfbfb; border-bottom:1px solid #e4e4e4; background:#f5f5f5; padding:8px 10px 7px 2em; font-weight:normal; text-align:left; color:#606060;}
#popBody .tableType5 td { border-bottom:1px solid #ededed; padding:8px 10px 7px 10px; color:#7b7972;}
/*#popBody .tableType5 td input,*/
#popBody .tableType5 td textarea,
#popBody .tableType5 td select { margin-bottom:.5em; vertical-align:middle;}
#popBody .tableType5 td .w100 { width:100%; display:block;}
#popBody .tableType5 td .checkbox { margin:-3px; margin-bottom:1em; }
#popBody .tableType5 td p { line-height:1.4em;}
#popBody .tableType5 td.blue a { color:#158692;}
#popBody .tableType5 .borderBottomNone { border-bottom:none;}
/* ----- Popup | End ----- */
.widget_item { margin-bottom:.5em; }
.layout_editor { width:100%; height:500px; border:0px; font-size:1em; }
.layout_editor_box { padding:10px; border:1px solid #DDDDDD; }
/* adminSearch */
.adminSearch { text-align:right; clear:both; width:100%;}
.adminSearch fieldset { border:none; display:inline; overflow:visible; }
.adminSearch * { vertical-align:middle;}
.title { font-size:1.5em; font-weight:bold; margin-top:2em; margin-bottom:.5em; color:#666666; }
.desc { font-size:1em; margin-bottom:.5em; color:#ADADAD;}
.w700 { width:700px; }
.w5 { width:5em; }
.nowrap { white-space:nowrap; }
.mid_list { width:7em; }
ul.extra_vars li { margin-bottom:.5em;}
li.type_key { float:left; width:10em; }
li.type_value { clear:right; }
.admin_news { width:49%; float:left; margin-right:10px; }
.admin_link { width:49%; float:right; }

View file

@ -0,0 +1,65 @@
@charset "utf-8";
/*
NHN UIT Lab. WebStandardization Team (http://html.nhndesign.com/)
Jeong, Chan Myeong 070601~070630
*/
/*
Used Hack
IE6 & Below
{ property:value; _property:value;}
IE7 Only
*:first-child+html #selector
*/
/* default.css - Type Selector Definition */
li { list-style:none;}
a { text-decoration:none;}
a:hover { text-decoration:underline;}
address { font-style:normal;}
/* Special Class Selector */
.fr { float:right;}
.fl { float:left;}
.fwB { font-weight:bold;}
/* ----- Header | Start ----- */
#header { position:relative; height:71px; background:url(../images/headerBg.gif) repeat-x; overflow:hidden; clear:both; z-index:99;}
#header h1 { float:left; width:180px; height:71px; position:relative; background:url(../images/h1_bg.gif) no-repeat;}
#header h1 img { position:absolute; top:29px; left:29px;}
#header #logout { width:470px; height:71px; float:right; background:url(../images/headerBgEnd.png) no-repeat right top;}
#header #logout a { float:right; position:relative; top:29px; right:24px;}
/* ----- Header | End ----- */
#cBody { clear:both; padding:0px 18px 0px 198px; margin:-71px 0 -38px 0; overflow:hidden; background:#ffffff url(../images/menuBg.gif) repeat-y;}
#gNavigation { float:left; width:180px; padding:71px 0 200px 0; margin-right:18px; margin-left:-198px; _margin-left:-99px; background:#ffffff url(../images/menuBg.gif) repeat-y;}
#gNavigation h2 { }
#gNavigation ul { width:180px;}
#gNavigation ul li { width:180px; height:30px; background:url(../images/menuBg.png) no-repeat left top; } /* behavior:url(./common/js/iePngFix.htc);}*/
#gNavigation ul li.on { background-position:left -30px; margin-top:-2px; _background:url(../images/menuBgIeFix.png) no-repeat left top;}
#gNavigation ul li.on a { color:#ffffff; font-weight:bold;}
#gNavigation ul li a { display:block; padding:9px 0 0 28px; height:21px; color:#606060;}
#gNavigation ul li a:hover { background:url(../images/menuBgIeFix.png) no-repeat; margin-top:-2px; font-weight:bold; color:#ffffff; text-decoration:none;}
#gNavigation ul li.on a:hover { background:url(../images/menuBgIeFix.png) no-repeat; margin-top:0; font-weight:bold; color:#ffffff; text-decoration:none;}
#gNavigation .menuEdit { width:180px; height:30px; text-align:center; margin-top:1em;}
#content { float:left; width:100%; padding:71px 0 100px 0;}
/* ----- Footer | Start ----- */
#footer { width:100%; clear:both; height:38px; margin-bottom:-38px; overflow:hidden; background:url(../images/footerBg.gif) repeat-x left 3px;}
#footer .footerLine { height:3px; width:100%; float:left; clear:both;}
#footer .footerLeft { float:left;}
#footer address { float:right; width:350px; height:35px; background:url(../images/addressBg.gif) no-repeat right top;}
#footer address img { margin:15px 10px 0 0}
#footer address .version { font:.8em Tahoma; color:#ffffff;}
#footer address .version strong { font:bold 1em Tahoma; color:#ff0000; }
/* ----- Footer | End ----- */

View file

@ -0,0 +1,9 @@
<filter name="delete_shortcut" module="admin" act="procAdminDeleteShortCut" confirm_msg_code="confirm_delete">
<form>
<node target="selected_module" required="true" />
</form>
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -0,0 +1,9 @@
<filter name="update_env_config" module="install" act="procInstallAdminSaveTimeZone" >
<form>
<node target="time_zone" required="true" />
</form>
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

View file

@ -0,0 +1,96 @@
<!--%import("./filter/update_env_config.xml")-->
<!--%import("../../install/lang")-->
<h3>{$lang->welcome_to_zeroboard_xe}</h3>
<form action="./" method="get" onsubmit="return procFilter(this, update_env_config);">
<table cellspacing="0" class="tableType4">
<col width="250" />
<col />
<caption>{$lang->env_setup}</caption>
<tr>
<th scope="row">Lang</th>
<td>
<select name="lang_type" onchange="doChangeLangType(this)">
<option value="{$lang_type}">{$lang_type}</option>
<!--@foreach($lang_supported as $val)-->
<!--@if($val != $lang_type)-->
<option value="{$val}">{$val}</option>
<!--@end-->
<!--@end-->
</select>
</td>
</tr>
<tr>
<th scope="row">{$lang->use_rewrite}</th>
<td>
<input type="checkbox" name="use_rewrite" value="Y" <!--@if(function_exists('apache_get_modules')&&in_array('mod_rewrite',apache_get_modules())&&$use_rewrite=='Y')-->checked="checked"<!--@end--> />
<p>{$lang->about_rewrite}</p>
</td>
</tr>
<tr>
<th scope="row">{$lang->time_zone}</th>
<td>
<select name="time_zone" class="time_zone">
<!--@foreach($time_zone_list as $key => $val)-->
<option value="{$key}" <!--@if($time_zone==$key)-->selected="selected"<!--@end-->>{$val}</option>
<!--@end-->
</select>
<p>{$lang->about_time_zone}</p>
</td>
</tr>
</table>
<div class="tRight gap1">
<span class="button"><input type="submit" value="{$lang->cmd_save}" /></span>
</div>
</form>
<div class="admin_news">
<!--@if($news)-->
<table cellspacing="0" class="tableType1">
<caption>{$lang->newest_news}</caption>
<thead>
<tr>
<th scope="col">{$lang->title}</th>
<th scope="col">{$lang->regdate}</th>
</tr>
</thead>
<tbody>
<!--@foreach($news as $key => $val)-->
<tr>
<td class="left">&nbsp;<a href="{$val->url}" onclick="window.open(this.href);return false;">{$val->title}</a></td>
<td class="tahoma">{zdate($val->date,"Y-m-d H:i")}</td>
</tr>
<!--@end-->
</tbody>
</table>
<!--@end-->
</div>
<div class="admin_link">
<!-- 사용자 링크 -->
<table cellspacing="0" class="tableType3">
<col width="250" />
<col />
<caption>{$lang->zeroboard_xe_user_links}</caption>
<!--@foreach($lang->xe_user_links as $key => $val)-->
<tr>
<th scope="col">{$key}</th>
<td class="left blue"><a href="{$val}" onclick="winopen(this.href); return false;">{$val}</a></td>
</tr>
<!--@end-->
</table>
<!-- 개발자 링크 -->
<table cellspacing="0" class="tableType3">
<col width="250" />
<col />
<caption>{$lang->zeroboard_xe_developer_links}</caption>
<!--@foreach($lang->xe_developer_links as $key => $val)-->
<tr>
<th scope="col">{$key}</th>
<td class="left blue"><a href="{$val}" onclick="winopen(this.href); return false;">{$val}</a></td>
</tr>
<!--@end-->
</table>
</div>

View file

@ -0,0 +1,31 @@
/**
* @file admin.js
* @author zero (zero@nzeo.com)
* @brief admin 모듈의 javascript
**/
// 숏컷 삭제
function doDeleteShortCut(selected_module) {
var fo_obj = xGetElementById('fo_shortcut_info');
fo_obj.selected_module.value = selected_module;
procFilter(fo_obj, delete_shortcut);
}
// footer를 화면 크기에 맞춰 설정 (폐기)
//xAddEventListener(window, 'load', fixAdminLayoutFooter);
//xAddEventListener(window, 'resize', fixAdminLayoutFooter);
function fixAdminLayoutFooter(height) {
return;
}
if(xIE6) {
xAddEventListener(window,'load',fixAdminNaviHeight);
}
function fixAdminNaviHeight() {
var naviHeight = xHeight('gNavigation');
var bodyHeight = xHeight('content');
if(naviHeight<bodyHeight) xHeight('gNavigation',bodyHeight);
else xHeight('content',naviHeight);
setTimeout(fixAdminNaviHeight, 500);
}

View file

@ -0,0 +1,34 @@
<!--%import("css/admin_layout.css")-->
<!--%import("js/admin.js")-->
<div id="header">
<h1><a href="{getUrl('','module','admin')}"><img src="./images/h1.png" alt="Zeroboard XE" width="128" height="20" class="iePngFix" /></a></h1>
<div id="logout" class="iePngFix">
<a href="{getUrl('','module','admin','act','dispMemberLogout')}"><img src="./images/buttonLogout.png" alt="{$lang->cmd_logout}" width="53" height="10" class="iePngFix" /></a>
</div>
</div>
<div id="cBody">
<div id="gNavigation">
<h2><img src="./images/h2.gif" alt="Administration" width="180" height="45" /></h2>
<ul>
<!--@foreach($shortcut_list as $key => $val)-->
<li <!--@if($running_module==$val->module)-->class="on"<!--@end-->><a href="{getUrl('','module','admin','act',$val->default_act)}">{cut_str($val->title,14,'..')}</a></li>
<!--@end-->
</ul>
<div class="menuEdit">
<a href="{getUrl('','module','admin','act','dispAdminShortCut')}" class="button"><span>{$lang->cmd_shortcut_management}</span></a>
</div>
</div>
<div id="content">{$content}</div>
</div>
<div id="footer">
<img src="./images/footerLine.gif" alt="" class="footerLine" /><img src="./images/footerLeft.gif" alt="" width="350" height="35" class="footerLeft" />
<address>
<a href="http://www.zeroboard.com"><img src="./images/address.gif" alt="Copyright 2000, Zeroboard All Rights Reserved. Version" width="255" height="7" /><span class="version"><strong>XE</strong> Beta</span></a>
</address>
</div>

View file

@ -0,0 +1,32 @@
<!--%import("filter/delete_shortcut.xml")-->
<!--%import("js/admin.js")-->
<h3>{$lang->cmd_shortcut_management}</h3>
<div class="infoText">{$lang->about_shortcut}</div>
<!-- 숏컷의 위/아래, 삭제와 관련된 form -->
<form id="fo_shortcut_info" action="./" method="get">
<input type="hidden" name="selected_module" value="" />
</form>
<table cellspacing="0" class="tableType3">
<thead>
<tr>
<th scope="col">{$lang->title}</th>
<th scope="col">{$lang->module}</th>
<th scope="col">{$lang->regdate}</th>
<th scope="col">{$lang->cmd_delete}</th>
</tr>
</thead>
<tbody>
<!--@foreach($shortcut_list as $shortcut_info)-->
<tr>
<th scope="row">{$shortcut_info->title}</th>
<td class="tahoma">{$shortcut_info->module}</td>
<td class="tahoma">{zdate($shortcut_info->regdate,"Y-m-d H:i:s")}</td>
<td><a href="#" onclick="doDeleteShortCut('{$shortcut_info->module}');return false;" class="red">{$lang->cmd_delete}</a></td>
</tr>
<!--@end-->
</tbody>
</table>

View file

@ -0,0 +1,566 @@
<?php
/**
* @class blogAdminController
* @author zero (zero@nzeo.com)
* @brief blog 모듈의 admin controller class
**/
class blogAdminController extends blog {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 권한 추가
**/
function procBlogAdminInsertGrant() {
$module_srl = Context::get('module_srl');
// 현 모듈의 권한 목록을 가져옴
$grant_list = $this->xml_info->grant;
if(count($grant_list)) {
foreach($grant_list as $key => $val) {
$group_srls = Context::get($key);
if($group_srls) $arr_grant[$key] = explode('|@|',$group_srls);
}
$grants = serialize($arr_grant);
}
$oModuleController = &getController('module');
$oModuleController->updateModuleGrant($module_srl, $grants);
$this->add('module_srl',Context::get('module_srl'));
$this->setMessage('success_registed');
}
/**
* @brief 스킨 정보 업데이트
**/
function procBlogAdminUpdateSkinInfo() {
// module_srl에 해당하는 정보들을 가져오기
$module_srl = Context::get('module_srl');
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
$skin = $module_info->skin;
// 스킨의 정보르 구해옴 (extra_vars를 체크하기 위해서)
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
// 입력받은 변수들을 체크 (mo, act, module_srl, page등 기본적인 변수들 없앰)
$obj = Context::getRequestVars();
unset($obj->act);
unset($obj->module_srl);
unset($obj->page);
// 원 skin_info에서 extra_vars의 type이 image일 경우 별도 처리를 해줌
if($skin_info->extra_vars) {
foreach($skin_info->extra_vars as $vars) {
if($vars->type!='image') continue;
$image_obj = $obj->{$vars->name};
// 삭제 요청에 대한 변수를 구함
$del_var = $obj->{"del_".$vars->name};
unset($obj->{"del_".$vars->name});
if($del_var == 'Y') {
@unlink($module_info->{$vars->name});
continue;
}
// 업로드 되지 않았다면 이전 데이터를 그대로 사용
if(!$image_obj['tmp_name']) {
$obj->{$vars->name} = $module_info->{$vars->name};
continue;
}
// 정상적으로 업로드된 파일이 아니면 무시
if(!is_uploaded_file($image_obj['tmp_name'])) {
unset($obj->{$vars->name});
continue;
}
// 이미지 파일이 아니어도 무시
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) {
unset($obj->{$vars->name});
continue;
}
// 경로를 정해서 업로드
$path = sprintf("./files/attach/images/%s/", $module_srl);
// 디렉토리 생성
if(!FileHandler::makeDir($path)) return false;
$filename = $path.$image_obj['name'];
// 파일 이동
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) {
unset($obj->{$vars->name});
continue;
}
// 변수를 바꿈
unset($obj->{$vars->name});
$obj->{$vars->name} = $filename;
}
}
// 메뉴 관리
$menus = get_object_vars($skin_info->menu);
if(count($menus)) {
foreach($menus as $menu_id => $val) {
$menu_srl = Context::get($menu_id);
if($menu_srl) {
$obj->menu->{$menu_id} = $menu_srl;
$obj->{$menu_id} = $menu_srl;
$menu_srl_list[] = $menu_srl;
}
}
// 정해진 메뉴가 있으면 모듈 및 메뉴에 대한 레이아웃 연동
if(count($menu_srl_list)) {
// 해당 메뉴와 레이아웃 값을 매핑
$oMenuAdminController = &getAdminController('menu');
$oMenuAdminController->updateMenuLayout($module_srl, $menu_srl_list);
// 해당 메뉴에 속한 mid의 layout값을 모두 변경
$oModuleController->updateModuleLayout($module_srl, $menu_srl_list);
}
}
// serialize하여 저장
$obj->category_xml_file = sprintf("./files/cache/blog_category/%s.xml.php", $module_srl);
$obj->mid = $module_info->mid;
$skin_vars = serialize($obj);
$oModuleController->updateModuleSkinVars($module_srl, $skin_vars);
// 레이아웃 확장변수 수정
$layout_args->extra_vars = $skin_vars;
$layout_args->layout_srl = $module_srl;
$oLayoutAdminController = &getAdminController('layout');
$output = $oLayoutAdminController->updateLayout($layout_args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
$this->setLayoutPath('./common/tpl');
$this->setLayoutFile('default_layout.html');
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile("top_refresh.html");
}
/**
* @brief 블로그 추가
**/
function procBlogAdminInsertBlog() {
// 일단 입력된 값들을 모두 받아서 db 입력항목과 그외 것으로 분리
$args = Context::gets('module_srl','module_category_srl','blog_name','skin','browser_title','description','is_default','header_text','footer_text','admin_id','open_rss');
$args->module = 'blog';
$args->mid = $args->blog_name;
unset($args->blog_name);
if($args->is_default!='Y') $args->is_default = 'N';
// 기본 값외의 것들을 정리
$extra_var = delObjectVars(Context::getRequestVars(), $args);
unset($extra_var->act);
unset($extra_var->page);
unset($extra_var->blog_name);
$oDB = &DB::getInstance();
$oDB->begin();
// module_srl이 넘어오면 원 모듈이 있는지 확인
if($args->module_srl) {
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
// 만약 원래 모듈이 없으면 새로 입력하기 위한 처리
if($module_info->module_srl != $args->module_srl) unset($args->module_srl);
}
// $extra_var를 serialize
$args->extra_vars = serialize($extra_var);
// module 모듈의 controller 객체 생성
$oModuleController = &getController('module');
// is_default=='Y' 이면
if($args->is_default=='Y') $oModuleController->clearDefaultModule();
// module_srl의 값에 따라 insert/update
if(!$args->module_srl) {
// 블로그 등록
$output = $oModuleController->insertModule($args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// 글작성, 파일첨부, 댓글 파일첨부, 관리에 대한 권한 지정
if($output->toBool()) {
$oMemberModel = &getModel('member');
$admin_group = $oMemberModel->getAdminGroup();
$admin_group_srl = $admin_group->group_srl;
$module_srl = $output->get('module_srl');
$grants = serialize(array('write_document'=>array($admin_group_srl), 'fileupload'=>array($admin_group_srl), 'comment_fileupload'=>array($admin_group_srl), 'manager'=>array($admin_group_srl)));
$output = $oModuleController->updateModuleGrant($module_srl, $grants);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
}
// 레이아웃 등록
$layout_args->layout_srl = $layout_args->module_srl = $module_srl;
$layout_args->layout = 'blog';
$layout_args->title = sprintf('%s - %s',$args->browser_title, $args->mid);
$layout_args->layout_path = sprintf('./modules/blog/skins/%s/layout.html', $args->skin);
$oLayoutController = &getAdminController('layout');
$output = $oLayoutController->insertLayout($layout_args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// 기본 카테고리 등록
$category_args->module_srl = $module_srl;
$category_args->category_srl = getNextSequence();
$category_args->name = 'Story';
$category_args->expand = 'N';
$this->procBlogAdminInsertCategory($category_args);
$msg_code = 'success_registed';
} else {
// 블로그 데이터 수정
$output = $oModuleController->updateModule($args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// 레이아웃 수정
$layout_args->layout_srl = $layout_args->module_srl = $module_srl = $output->get('module_srl');
$layout_args->title = $args->browser_title;
$layout_args->layout_path = sprintf('./modules/blog/skins/%s/layout.html', $args->skin);
$oLayoutAdminController = &getAdminController('layout');
$output = $oLayoutAdminController->updateLayout($layout_args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
$msg_code = 'success_updated';
}
$oDB->commit();
$this->add('page',Context::get('page'));
$this->add('module_srl',$output->get('module_srl'));
$this->setMessage($msg_code);
}
/**
* @brief 블로그 삭제
**/
function procBlogAdminDeleteBlog() {
$module_srl = Context::get('module_srl');
$oDB = &DB::getInstance();
$oDB->begin();
// 블로그 모듈 삭제
$oModuleController = &getController('module');
$output = $oModuleController->deleteModule($module_srl);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// 레이아웃 삭제
$layout_args->layout_srl = $layout_args->module_srl = $module_srl;
$oLayoutAdminController = &getAdminController('layout');
$output = $oLayoutAdminController->deleteLayout($layout_args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// 블로그 카테고리 삭제
$category_args->module_srl = $module_srl;
$output = executeQuery('blog.deleteCategories', $category_args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
@unlink( sprintf('./files/cache/blog_category/%d.xml.php', $module_srl) );
$oDB->commit();
$this->add('module','blog');
$this->add('page',Context::get('page'));
$this->setMessage('success_deleted');
}
/**
* @brief 카테고리 추가
**/
function procBlogAdminInsertCategory($args = null) {
// 입력할 변수 정리
if(!$args) $args = Context::gets('module_srl','category_srl','parent_srl','name','expand','group_srls');
if($args->expand !="Y") $args->expand = "N";
$args->group_srls = str_replace('|@|',',',$args->group_srls);
$args->parent_srl = (int)$args->parent_srl;
$oDB = &DB::getInstance();
$oDB->begin();
// 이미 존재하는지를 확인
$oBlogModel = &getModel('blog');
$category_info = $oBlogModel->getCategoryInfo($args->category_srl);
// 존재하게 되면 update를 해준다
if($category_info->category_srl == $args->category_srl) {
$output = executeQuery('blog.updateCategory', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
$oDocumentController = &getAdminController('document');
$document_args->category_srl = $args->category_srl;
$document_args->title = $args->name ;
$output = $oDocumentController->updateCategory($document_args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// 존재하지 않으면 insert를 해준다
} else {
$args->listorder = -1*$args->category_srl;
$output = executeQuery('blog.insertCategory', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
$oDocumentController = &getAdminController('document');
$output = $oDocumentController->insertCategory($args->module_srl, $args->name, $args->category_srl);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
}
// XML 파일을 갱신하고 위치을 넘겨 받음
$xml_file = $this->makeXmlFile($args->module_srl);
$oDB->commit();
$this->add('xml_file', $xml_file);
$this->add('module_srl', $args->module_srl);
$this->add('category_srl', $args->category_srl);
$this->add('parent_srl', $args->parent_srl);
}
/**
* @brief 카테고리 삭제
**/
function procBlogAdminDeleteCategory() {
// 변수 정리
$args = Context::gets('module_srl','category_srl');
$oDB = &DB::getInstance();
$oDB->begin();
$oBlogModel = &getModel('blog');
// 원정보를 가져옴
$category_info = $oBlogModel->getCategoryInfo($args->category_srl);
if($category_info->parent_srl) $parent_srl = $category_info->parent_srl;
// 자식 노드가 있는지 체크하여 있으면 삭제 못한다는 에러 출력
$output = executeQuery('blog.getChildCategoryCount', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
if($output->data->count>0) {
$oDB->rollback();
return new Object(-1, 'msg_cannot_delete_for_child');
}
// DB에서 삭제
$output = executeQuery("blog.deleteCategory", $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
$oDocumentController = &getAdminController('document');
$output = $oDocumentController->deleteCategory($args->category_srl);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// XML 파일을 갱신하고 위치을 넘겨 받음
$xml_file = $this->makeXmlFile($args->module_srl);
$oDB->commit();
$this->add('xml_file', $xml_file);
$this->add('category_srl', $parent_srl);
$this->setMessage('success_deleted');
}
/**
* @brief 카테고리 이동
**/
function procBlogAdminMoveCategory() {
$source_category_srl = Context::get('source_category_srl');
$target_category_srl = Context::get('target_category_srl');
$oBlogModel = &getModel('blog');
$target_category = $oBlogModel->getCategoryInfo($target_category_srl);
$source_category = $oBlogModel->getCategoryInfo($source_category_srl);
// source_category에 target_category_srl의 parent_srl, listorder 값을 입력
$source_args->category_srl = $source_category_srl;
$source_args->parent_srl = $target_category->parent_srl;
$source_args->listorder = $target_category->listorder;
$output = executeQuery('blog.updateCategoryParent', $source_args);
if(!$output->toBool()) return $output;
// target_category의 listorder값을 +1해 준다
$target_args->category_srl = $target_category_srl;
$target_args->parent_srl = $target_category->parent_srl;
$target_args->listorder = $target_category->listorder -1;
$output = executeQuery('blog.updateCategoryParent', $target_args);
if(!$output->toBool()) return $output;
// xml파일 재생성
$xml_file = $this->makeXmlFile($target_category->module_srl);
// return 변수 설정
$this->add('xml_file', $xml_file);
$this->add('source_category_srl', $source_category_srl);
}
/**
* @brief xml 파일을 갱신
* 관리자페이지에서 메뉴 구성 간혹 xml파일이 재생성 안되는 경우가 있는데\n
* 이럴 경우 관리자의 수동 갱신 기능을 구현해줌\n
* 개발 중간의 문제인 같고 현재는 문제가 생기지 않으나 굳이 없앨 필요 없는 기능
**/
function procBlogAdminMakeXmlFile() {
// 입력값을 체크
$module_srl = Context::get('module_srl');
// xml파일 재생성
$xml_file = $this->makeXmlFile($module_srl);
// return 값 설정
$this->add('xml_file',$xml_file);
}
/**
* @brief 블로그 카테고리를 xml파일로 저장
**/
function makeXmlFile($module_srl) {
// xml파일 생성시 필요한 정보가 없으면 그냥 return
if(!$module_srl) return;
// 캐시 파일의 이름을 지정
$xml_file = sprintf("./files/cache/blog_category/%s.xml.php", $module_srl);
// 모듈정보를 구해옴
$oModuleModel = &getModel('module');
$this->module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
// DB에서 module_srl 에 해당하는 메뉴 아이템 목록을 listorder순으로 구해옴
$oBlogModel = &getModel('blog');
$list = $oBlogModel->getCategoryList($module_srl);
// 구해온 데이터가 없다면 노드데이터가 없는 xml 파일만 생성
if(!$list) {
$xml_buff = "<root />";
FileHandler::writeFile($xml_file, $xml_buff);
return $xml_file;
}
// 구해온 데이터가 하나라면 array로 바꾸어줌
if(!is_array($list)) $list = array($list);
// 루프를 돌면서 tree 구성
$list_count = count($list);
for($i=0;$i<$list_count;$i++) {
$node = $list[$i];
$category_srl = $node->category_srl;
$parent_srl = $node->parent_srl;
$tree[$parent_srl][$category_srl] = $node;
}
// xml 캐시 파일 생성
$xml_buff = sprintf('<?php header("Content-Type: text/xml; charset=UTF-8"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); @session_start(); ?><root>%s</root>', $this->getXmlTree($tree[0], $tree));
// 파일 저장
FileHandler::writeFile($xml_file, $xml_buff);
return $xml_file;
}
/**
* @brief array로 정렬된 노드들을 parent_srl을 참조하면서 recursive하게 돌면서 xml 데이터 생성
* 메뉴 xml파일은 node라는 tag가 중첩으로 사용되며 xml doc으로 관리자 페이지에서 메뉴를 구성해줌\n
* (tree_menu.js 에서 xml파일을 바로 읽고 tree menu를 구현)
**/
function getXmlTree($source_node, $tree) {
if(!$source_node) return;
foreach($source_node as $category_srl => $node) {
$child_buff = "";
// 자식 노드의 데이터 가져옴
if($category_srl && $tree[$category_srl]) $child_buff = $this->getXmlTree($tree[$category_srl], $tree);
// 변수 정리
$name = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->name);
$expand = $node->expand;
$group_srls = $node->group_srls;
// node->group_srls값이 있으면
if($group_srls) $group_check_code = sprintf('($_SESSION["is_admin"]==true||(is_array($_SESSION["group_srls"])&&count(array_intersect($_SESSION["group_srls"], array(%s)))))',$group_srls);
else $group_check_code = "true";
$attribute = sprintf(
'node_srl="%s" text="<?=(%s?"%s":"")?>" url="%s" expand="%s" ',
$category_srl,
$group_check_code,
$name,
getUrl('','mid',$this->module_info->mid,'category',$category_srl),
$expand
);
if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
else $buff .= sprintf('<node %s />', $attribute);
}
return $buff;
}
}
?>

View file

@ -0,0 +1,65 @@
<?php
/**
* @class blogAdminModel
* @author zero (zero@nzeo.com)
* @version 0.1
* @brief blog 모듈의 admin model class
**/
class blogAdminModel extends blog {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 특정 카테고리의 정보를 이용하여 템플릿을 구한후 return
* 관리자 페이지에서 특정 메뉴의 정보를 추가하기 위해 서버에서 tpl을 컴파일 한후 컴파일 html을 직접 return
**/
function getBlogAdminCategoryTplInfo() {
// 해당 메뉴의 정보를 가져오기 위한 변수 설정
$category_srl = Context::get('category_srl');
$parent_srl = Context::get('parent_srl');
// 회원 그룹의 목록을 가져옴
$oMemberModel = &getModel('member');
$group_list = $oMemberModel->getGroups();
Context::set('group_list', $group_list);
$oBlogModel = &getModel('blog');
// parent_srl이 있고 category_srl 이 없으면 하부 메뉴 추가임
if(!$category_srl && $parent_srl) {
// 상위 메뉴의 정보를 가져옴
$parent_info = $oBlogModel->getCategoryInfo($parent_srl);
// 추가하려는 메뉴의 기본 변수 설정
$category_info->category_srl = getNextSequence();
$category_info->parent_srl = $parent_srl;
$category_info->parent_category_name = $parent_info->name;
// root에 메뉴 추가하거나 기존 메뉴의 수정일 경우
} else {
// category_srl 이 있으면 해당 메뉴의 정보를 가져온다
if($category_srl) $category_info = $oBlogModel->getCategoryInfo($category_srl);
// 찾아진 값이 없다면 신규 메뉴 추가로 보고 category_srl값만 구해줌
if(!$category_info->category_srl) {
$category_info->category_srl = getNextSequence();
}
}
Context::set('category_info', $category_info);
// template 파일을 직접 컴파일한후 tpl변수에 담아서 return한다.
$oTemplate = &TemplateHandler::getInstance();
$tpl = $oTemplate->compile($this->module_path.'tpl', 'category_info');
// return 할 변수 설정
$this->add('tpl', $tpl);
}
}
?>

View file

@ -0,0 +1,209 @@
<?php
/**
* @class blogAdminView
* @author zero (zero@nzeo.com)
* @brief blog 모듈의 admin view class
**/
class blogAdminView extends blog {
/**
* @brief 초기화
*
* blog 모듈은 일반 사용과 관리자용으로 나누어진다.\n
**/
function init() {
// module_srl이 있으면 미리 체크하여 존재하는 모듈이면 module_info 세팅
$module_srl = Context::get('module_srl');
if(!$module_srl && $this->module_srl) {
$module_srl = $this->module_srl;
Context::set('module_srl', $module_srl);
}
// module model 객체 생성
$oModuleModel = &getModel('module');
// module_srl이 넘어오면 해당 모듈의 정보를 미리 구해 놓음
if($module_srl) {
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
if($module_info->module_srl == $module_srl) {
$this->module_info = $module_info;
Context::set('module_info',$module_info);
}
}
// 모듈 카테고리 목록을 구함
$module_category = $oModuleModel->getModuleCategories();
Context::set('module_category', $module_category);
// 만약 블로그 서비스 페이지에서 관리자 기능 호출시 요청된 블로그의 정보와 레이아웃 가져옴
if($this->mid) {
$oView = &getView('blog');
$oView->setModuleInfo($this->module_info, $this->xml_info);
$oView->init();
}
// 템플릿 경로 지정 (blog의 경우 tpl에 관리자용 템플릿 모아놓음)
$this->setTemplatePath($this->module_path."tpl");
}
/**
* @brief 블로그 관리 목록 보여줌
**/
function dispBlogAdminContent() {
// 등록된 blog 모듈을 불러와 세팅
$args->sort_index = "module_srl";
$args->page = Context::get('page');
$args->list_count = 40;
$args->page_count = 10;
$args->s_module_category_srl = Context::get('module_category_srl');
$output = executeQuery('blog.getBlogList', $args);
// 템플릿에 쓰기 위해서 context::set
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('blog_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
// 템플릿 파일 지정
$this->setTemplateFile('index');
}
/**
* @brief 선택된 블로그의 정보 출력
**/
function dispBlogAdminBlogInfo() {
// module_srl 값이 없다면 그냥 index 페이지를 보여줌
if(!Context::get('module_srl')) return $this->dispBlogAdminContent();
// 레이아웃이 정해져 있다면 레이아웃 정보를 추가해줌(layout_title, layout)
if($this->module_info->layout_srl) {
$oLayoutModel = &getModel('layout');
$layout_info = $oLayoutModel->getLayout($this->module_info->layout_srl);
$this->module_info->layout = $layout_info->layout;
$this->module_info->layout_title = $layout_info->layout_title;
}
// 정해진 스킨이 있으면 해당 스킨의 정보를 구함
if($this->module_info->skin) {
$oModuleModel = &getModel('module');
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $this->module_info->skin);
$this->module_info->skin_title = $skin_info->title;
}
// 템플릿 파일 지정
$this->setTemplateFile('blog_info');
}
/**
* @brief 블로그 추가 출력
**/
function dispBlogAdminInsertBlog() {
// 스킨 목록을 구해옴
$oModuleModel = &getModel('module');
$skin_list = $oModuleModel->getSkins($this->module_path);
Context::set('skin_list',$skin_list);
// 템플릿 파일 지정
$this->setTemplateFile('blog_insert');
}
/**
* @brief 블로그 삭제 화면 출력
**/
function dispBlogAdminDeleteBlog() {
if(!Context::get('module_srl')) return $this->dispBlogAdminContent();
$module_info = Context::get('module_info');
$oDocumentModel = &getModel('document');
$document_count = $oDocumentModel->getDocumentCount($module_info->module_srl);
$module_info->document_count = $document_count;
Context::set('module_info',$module_info);
// 템플릿 파일 지정
$this->setTemplateFile('blog_delete');
}
/**
* @brief 스킨 정보 보여줌
**/
function dispBlogAdminSkinInfo() {
// 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음
$module_info = Context::get('module_info');
$skin = $module_info->skin;
$oModuleModel = &getModel('module');
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
// skin_info에 extra_vars 값을 지정
if(count($skin_info->extra_vars)) {
foreach($skin_info->extra_vars as $key => $val) {
$name = $val->name;
$type = $val->type;
$value = $module_info->{$name};
if($type=="checkbox"&&!$value) $value = array();
$skin_info->extra_vars[$key]->value= $value;
}
}
// skin_info에 menu값을 지정
if(count($skin_info->menu)) {
foreach($skin_info->menu as $key => $val) {
if($module_info->{$key}) $skin_info->menu->{$key}->menu_srl = $module_info->{$key};
}
}
// 메뉴를 가져옴
$oMenuAdminModel = &getAdminModel('menu');
$menu_list = $oMenuAdminModel->getMenus();
Context::set('menu_list', $menu_list);
Context::set('skin_info', $skin_info);
$this->setTemplateFile('skin_info');
}
/**
* @brief 카테고리의 정보 출력
**/
function dispBlogAdminCategoryInfo() {
// module_srl을 구함
$module_srl = $this->module_info->module_srl;
// 카테고리 정보를 가져옴
$oBlogModel = &getModel('blog');
$category_info = $oBlogModel->getCategory($module_srl);
Context::set('category_info', $category_info);
Context::addJsFile('./common/js/tree_menu.js');
Context::set('layout','none');
$this->setTemplateFile('category_list');
}
/**
* @brief 권한 목록 출력
**/
function dispBlogAdminGrantInfo() {
// module_srl을 구함
$module_srl = Context::get('module_srl');
// module.xml에서 권한 관련 목록을 구해옴
$grant_list = $this->xml_info->grant;
Context::set('grant_list', $grant_list);
// 권한 그룹의 목록을 가져온다
$oMemberModel = &getModel('member');
$group_list = $oMemberModel->getGroups();
Context::set('group_list', $group_list);
$this->setTemplateFile('grant_list');
}
}
?>

View file

@ -0,0 +1,53 @@
<?php
/**
* @class blog
* @author zero (zero@nzeo.com)
* @brief blog 모듈의 high class
**/
class blog extends ModuleObject {
var $skin = "default"; ///< 스킨 이름
var $list_count = 1; ///< 한 페이지에 나타날 글의 수
var $page_count = 10; ///< 페이지의 수
var $editor = 'default'; ///< 에디터 종류
/**
* @brief 설치시 추가 작업이 필요할시 구현
**/
function moduleInstall() {
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionForward('blog', 'view', 'dispBlogAdminContent');
$oModuleController->insertActionForward('blog', 'view', 'dispBlogAdminBlogInfo');
$oModuleController->insertActionForward('blog', 'view', 'dispBlogAdminInsertBlog');
$oModuleController->insertActionForward('blog', 'view', 'dispBlogAdminDeleteBlog');
$oModuleController->insertActionForward('blog', 'view', 'dispBlogAdminSkinInfo');
$oModuleController->insertActionForward('blog', 'view', 'dispBlogAdminCategoryInfo');
$oModuleController->insertActionForward('blog', 'view', 'dispBlogAdminMenuInfo');
$oModuleController->insertActionForward('blog', 'view', 'dispBlogAdminGrantInfo');
$oModuleController->insertActionForward('blog', 'controller', 'procBlogAdminUpdateSkinInfo');
// 캐쉬로 사용할 디렉토리 생성
FileHandler::makeDir('./files/cache/blog_category');
return new Object();
}
/**
* @brief 설치가 이상이 없는지 체크하는 method
**/
function checkUpdate() {
return false;
}
/**
* @brief 업데이트 실행
**/
function moduleUpdate() {
return new Object();
}
}
?>

View file

@ -0,0 +1,226 @@
<?php
/**
* @class blogController
* @author zero (zero@nzeo.com)
* @brief blog 모듈의 Controller class
**/
class blogController extends blog {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief 문서 입력
**/
function procBlogInsertDocument() {
// 권한 체크
if(!$this->grant->write_document) return new Object(-1, 'msg_not_permitted');
// 글작성시 필요한 변수를 세팅
$obj = Context::getRequestVars();
$obj->module_srl = $this->module_srl;
if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N';
// document module의 model 객체 생성
$oDocumentModel = &getModel('document');
// document module의 controller 객체 생성
$oDocumentController = &getController('document');
// 이미 존재하는 글인지 체크
$oDocument = $oDocumentModel->getDocument($obj->document_srl, $this->grant->manager);
// 이미 존재하는 경우 수정
if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) {
$output = $oDocumentController->updateDocument($oDocument, $obj);
$msg_code = 'success_updated';
// 그렇지 않으면 신규 등록
} else {
$output = $oDocumentController->insertDocument($obj);
$msg_code = 'success_registed';
$obj->document_srl = $output->get('document_srl');
}
// 오류 발생시 멈춤
if(!$output->toBool()) return $output;
// 트랙백이 있으면 트랙백 발송
$trackback_url = Context::get('trackback_url');
$trackback_charset = Context::get('trackback_charset');
if($trackback_url) {
$oTrackbackController = &getController('trackback');
$oTrackbackController->sendTrackback($obj, $trackback_url, $trackback_charset);
}
// 결과를 리턴
$this->add('mid', Context::get('mid'));
$this->add('document_srl', $output->get('document_srl'));
// 성공 메세지 등록
$this->setMessage($msg_code);
}
/**
* @brief 문서 삭제
**/
function procBlogDeleteDocument() {
// 문서 번호 확인
$document_srl = Context::get('document_srl');
// 문서 번호가 없다면 오류 발생
if(!$document_srl) return $this->doError('msg_invalid_document');
// document module model 객체 생성
$oDocumentController = &getController('document');
// 삭제 시도
$output = $oDocumentController->deleteDocument($document_srl, $this->grant->manager);
if(!$output->toBool()) return $output;
// 성공 메세지 등록
$this->add('mid', Context::get('mid'));
$this->add('page', $output->get('page'));
$this->setMessage('success_deleted');
}
/**
* @brief 코멘트 추가
**/
function procBlogInsertComment() {
// 권한 체크
if(!$this->grant->write_comment) return new Object(-1, 'msg_not_permitted');
// 댓글 입력에 필요한 데이터 추출
$obj = Context::gets('document_srl','comment_srl','parent_srl','content','password','nick_name','nick_name','member_srl','email_address','homepage');
$obj->module_srl = $this->module_srl;
// comment 모듈의 model 객체 생성
$oCommentModel = &getModel('comment');
// comment 모듈의 controller 객체 생성
$oCommentController = &getController('comment');
// 줄바꾸임나 태그제거등의 작업
$obj->content = nl2br(strip_tags($obj->content));
/**
* 존재하는 댓글인지를 확인하여 존재 하지 않는 댓글이라면 신규로 등록하기 위해서 comment_srl의 sequence값을 받는다
**/
if(!$obj->comment_srl) {
$obj->comment_srl = getNextSequence();
} else {
$comment = $oCommentModel->getComment($obj->comment_srl, $this->grant->manager);
}
// comment_srl이 없을 경우 신규 입력
if($comment->comment_srl != $obj->comment_srl) {
// parent_srl이 있으면 답변으로
if($obj->parent_srl) {
$parent_comment = $oCommentModel->getComment($obj->parent_srl);
if(!$parent_comment->comment_srl) return new Object(-1, 'msg_invalid_request');
$output = $oCommentController->insertComment($obj);
// 없으면 신규
} else {
$output = $oCommentController->insertComment($obj);
}
// comment_srl이 있으면 수정으로
} else {
$obj->parent_srl = $comment->parent_srl;
$output = $oCommentController->updateComment($obj, $this->grant->manager);
$comment_srl = $obj->comment_srl;
}
if(!$output->toBool()) return $output;
$this->add('mid', Context::get('mid'));
$this->add('document_srl', $obj->document_srl);
$this->add('comment_srl', $obj->comment_srl);
$this->setMessage('success_registed');
}
/**
* @brief 코멘트 삭제
**/
function procBlogDeleteComment() {
// 댓글 번호 확인
$comment_srl = Context::get('comment_srl');
if(!$comment_srl) return $this->doError('msg_invalid_request');
// comment 모듈의 controller 객체 생성
$oCommentController = &getController('comment');
$output = $oCommentController->deleteComment($comment_srl, $this->grant->manager);
if(!$output->toBool()) return $output;
$this->add('mid', Context::get('mid'));
$this->add('page', Context::get('page'));
$this->add('document_srl', $output->get('document_srl'));
$this->setMessage('success_deleted');
}
/**
* @brief 엮인글 삭제
**/
function procBlogDeleteTrackback() {
$trackback_srl = Context::get('trackback_srl');
// trackback module의 controller 객체 생성
$oTrackbackController = &getController('trackback');
$output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager);
if(!$output->toBool()) return $output;
$this->add('mid', Context::get('mid'));
$this->add('page', Context::get('page'));
$this->add('document_srl', $output->get('document_srl'));
$this->setMessage('success_deleted');
}
/**
* @brief 문서와 댓글의 비밀번호를 확인
**/
function procBlogVerificationPassword() {
// 비밀번호와 문서 번호를 받음
$password = md5(Context::get('password'));
$document_srl = Context::get('document_srl');
$comment_srl = Context::get('comment_srl');
// comment_srl이 있을 경우 댓글이 대상
if($comment_srl) {
// 문서번호에 해당하는 글이 있는지 확인
$oCommentModel = &getModel('comment');
$data = $oCommentModel->getComment($comment_srl);
// comment_srl이 없으면 문서가 대상
} else {
// 문서번호에 해당하는 글이 있는지 확인
$oDocumentModel = &getModel('document');
$data = $oDocumentModel->getDocument($document_srl);
}
// 글이 없을 경우 에러
if(!$data) return new Object(-1, 'msg_invalid_request');
// 문서의 비밀번호와 입력한 비밀번호의 비교
if($data->password != $password) return new Object(-1, 'msg_invalid_password');
// 해당 글에 대한 권한 부여
if($comment_srl) {
$oCommentController = &getController('comment');
$oCommentController->addGrant($comment_srl);
} else {
$oDocumentController = &getController('document');
$oDocumentController->addGrant($document_srl);
}
}
}
?>

View file

@ -0,0 +1,53 @@
<?php
/**
* @class blogModel
* @author zero (zero@nzeo.com)
* @version 0.1
* @brief blog 모듈의 Model class
**/
class blogModel extends blog {
/**
* @brief 초기화
**/
function init() {
}
/**
* @brief DB 생성된 카테고리 정보를 구함
* 생성된 메뉴의 DB정보+XML정보를 return
**/
function getCategory($module_srl) {
$category_info->xml_file = sprintf('./files/cache/blog_category/%s.xml.php',$module_srl);
return $category_info;
}
/**
* @brief 특정 모듈의 전체 카테고리를 구함
**/
function getCategoryList($module_srl) {
$args->module_srl = $module_srl;
$args->sort_index = 'listorder';
$output = executeQuery('blog.getBlogCategories', $args);
if(!$output->toBool()) return;
return $output->data;
}
/**
* @brief 특정 카테고리의 정보를 return
* 정보중에 group_srls의 경우는 , 연결되어 들어가며 사용시에는 explode를 통해 array로 변환 시킴
**/
function getCategoryInfo($category_srl) {
if(!$category_srl) return;
// category_srl이 있으면 해당 메뉴의 정보를 가져온다
$args->category_srl= $category_srl;
$output = executeQuery('blog.getCategoryInfo', $args);
$node = $output->data;
if($node->group_srls) $node->group_srls = explode(',',$node->group_srls);
else $node->group_srls = array();
return $node;
}
}
?>

382
modules/blog/blog.view.php Normal file
View file

@ -0,0 +1,382 @@
<?php
/**
* @class blogView
* @author zero (zero@nzeo.com)
* @brief blog 모듈의 View class
**/
class blogView extends blog {
/**
* @brief 초기화
*
* blog 모듈은 일반 사용과 관리자용으로 나누어진다.\n
**/
function init() {
// 템플릿에서 사용할 변수를 Context::set()
if($this->module_srl) Context::set('module_srl',$this->module_srl);
// 기본 모듈 정보들 설정
$this->list_count = $this->module_info->list_count?$this->module_info->list_count:1;
$this->page_count = $this->module_info->page_count?$this->module_info->page_count:10;
// 카테고리 목록을 가져오고 선택된 카테고리의 값을 설정
$oDocumentModel = &getModel('document');
$this->category_list = $oDocumentModel->getCategoryList($this->module_srl);
Context::set('category_list', $this->category_list);
// 스킨 경로 구함
$template_path = sprintf("%sskins/%s/",$this->module_path, $this->module_info->skin);
$this->setTemplatePath($template_path);
// rss url
if($this->module_info->open_rss != 'N') Context::set('rss_url', getUrl('','mid',$this->mid,'act','rss'));
// 레이아웃의 정보를 속이기 위해서 layout_srl을 현 블로그의 module_srl로 입력
$this->module_info->layout_srl = $this->module_info->module_srl;
/**
* 블로그는 자체 레이아웃을 관리하기에 이와 관련된 세팅을 해줌
**/
// 레이아웃 경로와 파일 지정 (블로그는 자체 레이아웃을 가지고 있음)
$this->setLayoutPath($template_path);
$this->setLayoutFile("layout");
// 수정된 레이아웃 파일이 있으면 지정
$edited_layout = sprintf('./files/cache/layout/%d.html', $this->module_info->module_srl);
if(file_exists($edited_layout)) $this->setEditedLayoutFile($edited_layout);
// 카테고리 xml 파일 위치 지정
$this->module_info->category_xml_file = sprintf('%s/files/cache/blog_category/%d.xml.php', getUrl(), $this->module_info->module_srl);
// 메뉴 등록시 메뉴 정보를 구해옴
if($this->module_info->menu) {
foreach($this->module_info->menu as $menu_id => $menu_srl) {
$menu_php_file = sprintf("./files/cache/menu/%s.php", $menu_srl);
if(file_exists($menu_php_file)) @include($menu_php_file);
Context::set($menu_id, $menu);
}
}
// layout_info 변수 설정
Context::set('layout_info',$this->module_info);
// 모듈정보 세팅
Context::set('module_info',$this->module_info);
}
/**
* @brief 목록 선택된 출력
**/
function dispBlogContent() {
// 권한 체크
if(!$this->grant->list) return $this->dispBlogMessage('msg_not_permitted');
// 목록 구현에 필요한 변수들을 가져온다
$document_srl = Context::get('document_srl');
$page = Context::get('page');
// document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-;
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument(0, $this->grant->manager);
// document_srl이 있다면 해당 글을 구해오자
if($this->grant->list && $document_srl) {
// 글을 구함
$oDocument->setDocument($document_srl);
// 찾아지지 않았다면 초기화
if(!$oDocument->isExists()) {
unset($document_srl);
Context::set('document_srl','',true);
} else {
// 브라우저 타이틀 설정
Context::setBrowserTitle($oDocument->getTitleText());
// 댓글에디터 설정
//if($this->grant->write_comment && $oDocument->allowComment() && !$oDocument->isLocked()) $this->setCommentEditor(0, 100);
// 조회수 증가
$oDocument->updateReadedCount();
}
}
Context::set('oDocument', $oDocument);
// 댓글
//$this->setCommentEditor(0, 100);
// 만약 document_srl은 있는데 page가 없다면 글만 호출된 경우 page를 구해서 세팅해주자..
if($document_srl && !$page) {
$page = $oDocumentModel->getDocumentPage($document_srl, $this->module_srl, $this->list_count);
Context::set('page', $page);
}
// 목록을 구하기 위한 옵션
$args->module_srl = $this->module_srl; ///< 현재 모듈의 module_srl
$args->page = $page; ///< 페이지
$args->list_count = $this->list_count; ///< 한페이지에 보여줄 글 수
$args->page_count = $this->page_count; ///< 페이지 네비게이션에 나타날 페이지의 수
// 검색 옵션
$args->search_target = trim(Context::get('search_target')); ///< 검색대상
$args->search_keyword = trim(Context::get('search_keyword')); ///< 검색어
// 키워드 검색이 아닌 검색일 경우 목록의 수를 40개로 고정
if($args->search_target && $args->search_keyword) $args->list_count = 40;
// 키워드 검색의 경우 제목,내용으로 검색 대상 고정
if($args->search_keyword && !$args->search_target) $args->search_target = "title_content";
// 블로그 카테고리
$args->category_srl = (int)Context::get('category');
$args->sort_index = 'list_order'; ///< 소팅 값
// 목록 구함, document->getDocumentList 에서 걍 알아서 다 해버리는 구조
$output = $oDocumentModel->getDocumentList($args, true);
// 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('document_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
// 템플릿에서 사용할 검색옵션 세팅
$count_search_option = count($this->search_option);
for($i=0;$i<$count_search_option;$i++) {
$search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]);
}
Context::set('search_option', $search_option);
// 블로그의 코멘트는 ajax로 호출되기에 미리 css, js파일을 import
Context::addJsFile('./modules/editor/tpl/js/editor.js');
Context::addCSSFile('./modules/editor/tpl/css/editor.css');
$this->setTemplateFile('list');
}
/**
* @brief 작성 화면 출력
**/
function dispBlogWrite() {
// 권한 체크
if(!$this->grant->write_document) return $this->dispBlogMessage('msg_not_permitted');
// GET parameter에서 document_srl을 가져옴
$document_srl = Context::get('document_srl');
// document 모듈 객체 생성
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager);
// 지정된 글이 없다면 (신규) 새로운 번호를 만든다
if(!$oDocument->isExists()) {
unset($document_srl);
Context::set('document_srl','');
}
if(!$document_srl) $document_srl = getNextSequence();
// 글을 수정하려고 할 경우 권한이 없는 경우 비밀번호 입력화면으로
if($oDocument->isExists()&&!$oDocument->isGranted()) return $this->setTemplateFile('input_password_form');
Context::set('document_srl',$document_srl);
Context::set('oDocument', $oDocument);
// 에디터 모듈의 getEditor를 호출하여 세팅
$oEditorModel = &getModel('editor');
$option->allow_fileupload = $this->grant->fileupload;
$option->enable_autosave = true;
$option->enable_default_component = true;
$option->enable_component = true;
$option->resizable = true;
$option->height = 600;
$editor = $oEditorModel->getEditor($document_srl, $option);
Context::set('editor', $editor);
$this->setTemplateFile('write_form');
}
/**
* @brief 문서 삭제 화면 출력
**/
function dispBlogDelete() {
// 권한 체크
if(!$this->grant->write_document) return $this->dispBlogMessage('msg_not_permitted');
// 삭제할 문서번호를 가져온다
$document_srl = Context::get('document_srl');
// 지정된 글이 있는지 확인
if($document_srl) {
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
}
// 삭제하려는 글이 없으면 에러
if(!$oDocument->isExists()) return $this->dispBlogContent();
// 권한이 없는 경우 비밀번호 입력화면으로
if(!$oDocument->isGranted()) return $this->setTemplateFile('input_password_form');
Context::set('oDocument',$oDocument);
$this->setTemplateFile('delete_form');
}
/**
* @brief 댓글의 답글 화면 출력
**/
function dispBlogReplyComment() {
// 권한 체크
if(!$this->grant->write_comment) return $this->dispBlogMessage('msg_not_permitted');
// 목록 구현에 필요한 변수들을 가져온다
$document_srl = Context::get('document_srl');
$parent_srl = Context::get('comment_srl');
// 지정된 원 댓글이 없다면 오류
if(!$parent_srl) return new Object(-1, 'msg_invalid_request');
// 해당 댓글를 찾아본다
$oCommentModel = &getModel('comment');
$source_comment = $oCommentModel->getComment($parent_srl, $this->grant->manager);
// 댓글이 없다면 오류
if(!$source_comment) return $this->dispBlogMessage('msg_invalid_request');
// 필요한 정보들 세팅
Context::set('document_srl',$source_comment->document_srl);
Context::set('parent_srl',$parent_srl);
Context::set('comment_srl',NULL);
Context::set('source_comment',$source_comment);
// 댓글 에디터 세팅
//$this->setCommentEditor(0,400);
$this->setTemplateFile('comment_form');
}
/**
* @brief 댓글 수정 출력
**/
function dispBlogModifyComment() {
// 권한 체크
if(!$this->grant->write_comment) return $this->dispBlogMessage('msg_not_permitted');
// 목록 구현에 필요한 변수들을 가져온다
$document_srl = Context::get('document_srl');
$comment_srl = Context::get('comment_srl');
// 지정된 댓글이 없다면 오류
if(!$comment_srl) return new Object(-1, 'msg_invalid_request');
// 해당 댓글를 찾아본다
$oCommentModel = &getModel('comment');
$comment = $oCommentModel->getComment($comment_srl, $this->grant->manager);
// 댓글이 없다면 오류
if(!$comment) return $this->dispBlogMessage('msg_invalid_request');
Context::set('document_srl',$comment->document_srl);
// 글을 수정하려고 할 경우 권한이 없는 경우 비밀번호 입력화면으로
if($comment_srl&&$comment&&!$comment->is_granted) return $this->setTemplateFile('input_password_form');
// 필요한 정보들 세팅
Context::set('comment_srl',$comment_srl);
Context::set('comment', $comment);
// 댓글 에디터 세팅
//$this->setCommentEditor($comment_srl,400);
$this->setTemplateFile('comment_form');
}
/**
* @brief 댓글 삭제 화면 출력
**/
function dispBlogDeleteComment() {
// 권한 체크
if(!$this->grant->write_comment) return $this->dispBlogMessage('msg_not_permitted');
// 삭제할 댓글번호를 가져온다
$comment_srl = Context::get('comment_srl');
// 삭제하려는 댓글가 있는지 확인
if($comment_srl) {
$oCommentModel = &getModel('comment');
$comment = $oCommentModel->getComment($comment_srl, $this->grant->manager);
}
// 삭제하려는 글이 없으면 에러
if(!$comment) return $this->dispBlogContent();
Context::set('document_srl',$comment->document_srl);
// 권한이 없는 경우 비밀번호 입력화면으로
if($comment_srl&&$comment&&!$comment->is_granted) return $this->setTemplateFile('input_password_form');
Context::set('comment',$comment);
$this->setTemplateFile('delete_comment_form');
}
/**
* @brief 엮인글 삭제 화면 출력
**/
function dispBlogDeleteTrackback() {
// 삭제할 댓글번호를 가져온다
$trackback_srl = Context::get('trackback_srl');
// 삭제하려는 댓글가 있는지 확인
$oTrackbackModel = &getModel('trackback');
$output = $oTrackbackModel->getTrackback($trackback_srl);
$trackback = $output->data;
// 삭제하려는 글이 없으면 에러
if(!$trackback) return $this->dispBlogContent();
Context::set('trackback',$trackback);
$this->setTemplateFile('delete_trackback_form');
}
/**
* @brief 메세지 출력
**/
function dispBlogMessage($msg_code) {
$msg = Context::getLang($msg_code);
if(!$msg) $msg = $msg_code;
Context::set('message', $msg);
$this->setTemplateFile('message');
}
/**
* @brief 댓글의 editor 세팅
* 댓글의 경우 수정하는 경우가 아니라면 고유값이 없음.\n
* 따라서 고유값이 없을 경우 고유값을 가져와서 지정해 주어야
**/
function setCommentEditor($comment_srl=0, $height = 100) {
return;
if(!$comment_srl) {
$comment_srl = getNextSequence();
Context::set('comment_srl', $comment_srl);
}
$oEditorModel = &getModel('editor');
$option->allow_fileupload = $this->grant->comment_fileupload;
$option->enable_autosave = false;
$option->enable_default_component = true;
$option->enable_component = true;
$option->resizable = true;
$option->height = $height;
$comment_editor = $oEditorModel->getEditor($comment_srl, $option);
Context::set('comment_editor', $comment_editor);
}
}
?>

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<module version="0.1">
<title xml:lang="ko">블로그</title>
<title xml:lang="jp">ブログ</title>
<title xml:lang="en">Blog</title>
<title xml:lang="es">Blog</title>
<title xml:lang="zh-CN">博客</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="en">zero</name>
<name xml:lang="es">zero</name>
<name xml:lang="zh-CN">zero</name>
<description xml:lang="ko">
블로그의 기능을 담당하는 모듈.
게시판과 비슷하지만 보여지는 view가 다르고 블로그에 적합한 method가 추가되었음.
레이아웃과 기본 메뉴를 직접 담당
</description>
<description xml:lang="jp">
ブログの機能を担当するモジュール
掲示板と似ているが、内容の表示が異なり、ブログに適切なメソッドが追加されている。
レイアウトと基本メニューを直接担当します。
</description>
<description xml:lang="en">
This module contains the blog functions.
It's similar to the bbs module, but it has diffent views and more suitable methods for blog has been included.
This module manages layout and basic menu itself.
</description>
<description xml:lang="es">
Es el módulo para funcióne a blog.
Casi mismo del boletín, pero la vista es diferente, y incluye metodo para blog. Maneja directo al diseño y menú principal.
</description>
<description xml:lang="zh-CN">
是负责博客功能的模块。
虽然类似版面但其显示模式不同且还添加了适合博客的method。
内置布局和基本的菜单。
</description>
</author>
</module>

Some files were not shown because too many files have changed in this diff Show more