mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
#12 현재 기본 패키지에 포함된 블로그/게시판/페이지/외부페이지의 모듈 복사 기능 추가. 추가되는 모듈들도 복사할 수 있도록 module의 기본 기능으로 추가하였음
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2619 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
8577a213d4
commit
1d45f520e1
22 changed files with 204 additions and 4 deletions
|
|
@ -8,7 +8,9 @@
|
|||
|
||||
<action name="dispModuleSkinInfo" type="view" standalone="true" />
|
||||
|
||||
<action name="dispModuleAdminCopyModule" type="view" standalone="true" />
|
||||
<action name="procModuleAdminInsertCategory" type="controller" standalone="true" />
|
||||
<action name="procModuleAdminUpdateCategory" type="controller" standalone="true" />
|
||||
<action name="procModuleAdminCopyModule" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
'H' => 'Open summary',
|
||||
'N' => 'Not open',
|
||||
);
|
||||
$lang->module_copy = "Copy module";
|
||||
|
||||
$lang->cmd_add_shortcut = "Add Shortcut";
|
||||
$lang->cmd_install = "Install";
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
'H' => 'Abrir el sumario',
|
||||
'N' => 'No abrir',
|
||||
);
|
||||
$lang->module_copy = "Copy Module";
|
||||
|
||||
$lang->cmd_add_shortcut = "añadir acceso directo";
|
||||
$lang->cmd_install = "Instalar";
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
'H' => '要約配信',
|
||||
'N' => '配信しない',
|
||||
);
|
||||
$lang->module_copy = "Copy module";
|
||||
|
||||
$lang->cmd_add_shortcut = "ショットカット追加";
|
||||
$lang->cmd_install = "インストール";
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
'H' => '요약 공개',
|
||||
'N' => '공개하지 않음',
|
||||
);
|
||||
$lang->module_copy = "모듈 복사";
|
||||
|
||||
$lang->cmd_add_shortcut = "바로가기 추가";
|
||||
$lang->cmd_install = "설치";
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
'H' => '公开摘要',
|
||||
'N' => '不公开',
|
||||
);
|
||||
$lang->module_copy = "Copy Module";
|
||||
|
||||
$lang->cmd_add_shortcut = "添加到快捷菜单";
|
||||
$lang->cmd_install = "安装";
|
||||
|
|
|
|||
|
|
@ -62,5 +62,50 @@
|
|||
return executeQuery('module.deleteModuleCategory', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈 복사
|
||||
**/
|
||||
function procModuleAdminCopyModule() {
|
||||
// 복사하려는 대상 모듈의 정보를 구함
|
||||
$module_srl = Context::get('module_srl');
|
||||
if(!$module_srl) return;
|
||||
|
||||
// 새로 생성하려는 모듈들의 이름/브라우저 제목을 구함
|
||||
$clones = array();
|
||||
$args = Context::getAll();
|
||||
for($i=1;$i<=10;$i++) {
|
||||
$mid = $args->{"mid_".$i};
|
||||
$browser_title = $args->{"browser_title_".$i};
|
||||
if(!$mid) continue;
|
||||
if($mid && !$browser_title) $browser_title = $mid;
|
||||
$clones[$mid] = $browser_title;
|
||||
}
|
||||
if(!count($clones)) return;
|
||||
|
||||
// 원 모듈의 정보를 직접 구해옴
|
||||
$obj->module_srl = $module_srl;
|
||||
$output = executeQuery("module.getMidInfo", $obj);
|
||||
$module_info = $output->data;
|
||||
unset($module_info->module_srl);
|
||||
unset($module_info->regdate);
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// 모듈 복사
|
||||
foreach($clones as $mid => $browser_title) {
|
||||
$clone_args = null;
|
||||
$clone_args = clone($module_info);
|
||||
$clone_args->module_srl = getNextSequence();
|
||||
$clone_args->mid = $mid;
|
||||
$clone_args->browser_title = $browser_title;
|
||||
$clone_args->is_default = 'N';
|
||||
$output = executeQuery('module.insertModule', $clone_args);
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -78,5 +78,24 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈 복사 기능
|
||||
**/
|
||||
function dispModuleAdminCopyModule() {
|
||||
// 복사하려는 대상 모듈을 구함
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// 해당 모듈의 정보를 구함
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
Context::set('module_info', $module_info);
|
||||
|
||||
// 레이아웃을 팝업으로 지정
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('copy_module');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
<column name="layout_srl" var="layout_srl" />
|
||||
<column name="description" var="description" />
|
||||
<column name="content" var="content" />
|
||||
<column name="grants" var="grants" />
|
||||
<column name="module" var="module" notnull="notnull" maxlength="80"/>
|
||||
<column name="is_default" var="is_default" default="N" notnull="notnull" />
|
||||
<column name="menu_srl" var="menu_srl" filter="number" />
|
||||
|
|
|
|||
87
modules/module/tpl/copy_module.html
Normal file
87
modules/module/tpl/copy_module.html
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
<!--%import("js/module_admin.js")-->
|
||||
<!--%import("filter/copy_module.xml")-->
|
||||
|
||||
<div id="popHeadder">
|
||||
<h1>{$lang->module_copy}</h1>
|
||||
</div>
|
||||
|
||||
<form action="./" method="post" onsubmit="return procFilter(this, copy_module)" >
|
||||
<input type="hidden" name="module_srl" value="{$module_info->module_srl}" />
|
||||
|
||||
<div id="popBody">
|
||||
|
||||
<table cellspacing="0" class="tableType5">
|
||||
<col width="140" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="row">{$lang->module}</th>
|
||||
<td>{$module_info->module}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{$lang->mid}</th>
|
||||
<td>{$module_info->mid}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{$lang->browser_title}</th>
|
||||
<td>{$module_info->browser_title}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table cellspacing="0" class="tableType3 gap1">
|
||||
<col width="50%" />
|
||||
<col width="50%" />
|
||||
<tr>
|
||||
<th scope="col">{$lang->mid}</th>
|
||||
<th scope="col">{$lang->browser_title}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="mid_1" class="inputTypeText w200" /></td>
|
||||
<td><input type="text" name="browser_title_1" class="inputTypeText w200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="mid_2" class="inputTypeText w200" /></td>
|
||||
<td><input type="text" name="browser_title_2" class="inputTypeText w200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="mid_3" class="inputTypeText w200" /></td>
|
||||
<td><input type="text" name="browser_title_3" class="inputTypeText w200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="mid_4" class="inputTypeText w200" /></td>
|
||||
<td><input type="text" name="browser_title_4" class="inputTypeText w200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="mid_5" class="inputTypeText w200" /></td>
|
||||
<td><input type="text" name="browser_title_5" class="inputTypeText w200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="mid_6" class="inputTypeText w200" /></td>
|
||||
<td><input type="text" name="browser_title_6" class="inputTypeText w200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="mid_7" class="inputTypeText w200" /></td>
|
||||
<td><input type="text" name="browser_title_7" class="inputTypeText w200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="mid_8" class="inputTypeText w200" /></td>
|
||||
<td><input type="text" name="browser_title_8" class="inputTypeText w200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="mid_9" class="inputTypeText w200" /></td>
|
||||
<td><input type="text" name="browser_title_9" class="inputTypeText w200" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="mid_10" class="inputTypeText w200" /></td>
|
||||
<td><input type="text" name="browser_title_10" class="inputTypeText w200" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="popFooter" class="tCenter gap1">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
<span class="button"><input type="button" value="{$lang->cmd_close}" onclick="window.close(); return false;"/></span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
9
modules/module/tpl/filter/copy_module.xml
Normal file
9
modules/module/tpl/filter/copy_module.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<filter name="copy_module" module="module" act="procModuleAdminCopyModule">
|
||||
<form>
|
||||
<node target="module_srl" required="true" />
|
||||
</form>
|
||||
<response callback_func="completeCopyModule">
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
</response>
|
||||
</filter>
|
||||
|
|
@ -50,3 +50,9 @@ function doUpdateModule(module) {
|
|||
params['module_name'] = module;
|
||||
exec_xml('install','procInstallAdminUpdate',params, completeInstallModule);
|
||||
}
|
||||
|
||||
/* 모듈 복사후 */
|
||||
function completeCopyModule() {
|
||||
if(typeof(opener)!='undefined') opener.location.href = opener.location.href;
|
||||
window.close();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue