mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
Add settings for combined board
This commit is contained in:
parent
a9334cec95
commit
264c6f0e74
6 changed files with 82 additions and 2 deletions
|
|
@ -12,13 +12,16 @@ class boardAdminController extends board {
|
|||
/**
|
||||
* @brief initialization
|
||||
**/
|
||||
function init() {
|
||||
function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief insert borad module
|
||||
**/
|
||||
function procBoardAdminInsertBoard($args = null) {
|
||||
function procBoardAdminInsertBoard($args = null)
|
||||
{
|
||||
// generate module model/controller object
|
||||
$oModuleController = getController('module');
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -163,6 +166,42 @@ class boardAdminController extends board {
|
|||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings for combined board.
|
||||
*/
|
||||
public function procBoardAdminInsertCombinedConfig()
|
||||
{
|
||||
$vars = Context::getRequestVars();
|
||||
$module_srl = intval($vars->target_module_srl);
|
||||
$include_modules = array_map('intval', $vars->include_modules ?: []);
|
||||
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($module_srl);
|
||||
if (!$module_info)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\TargetNotFound;
|
||||
}
|
||||
|
||||
$module_info->include_modules = implode(',', array_filter($include_modules, function($item) {
|
||||
return $item > 0;
|
||||
}));
|
||||
|
||||
$output = getController('module')->updateModule($module_info);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
if (Context::get('success_return_url'))
|
||||
{
|
||||
$this->setRedirectUrl(Context::get('success_return_url'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminBoardAdditionSetup', 'module_srl', $module_srl));
|
||||
}
|
||||
}
|
||||
|
||||
function procBoardAdminSaveCategorySettings()
|
||||
{
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
|
|
|||
|
|
@ -205,6 +205,12 @@ class boardAdminView extends board {
|
|||
ModuleHandler::triggerCall('module.dispAdditionSetup', 'after', $content);
|
||||
Context::set('setup_content', $content);
|
||||
|
||||
// Get the list of boards to combine.
|
||||
$args = new stdClass;
|
||||
$args->list_count = 1000;
|
||||
$output = executeQueryArray('board.getBoardList', $args, ['module_srl', 'mid', 'browser_title']);
|
||||
Context::set('board_list', $output->data);
|
||||
|
||||
// setup the template file
|
||||
$this->setTemplateFile('addition_setup');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@
|
|||
<action name="procBoardAdminInsertBoard" type="controller" permission="manager" check_var="module_srl" ruleset="insertBoard" />
|
||||
<action name="procBoardAdminDeleteBoard" type="controller" permission="manager" check_var="module_srl" />
|
||||
<action name="procBoardAdminUpdateBoardFroBasic" type="controller" ruleset="insertBoardForBasic" />
|
||||
<action name="procBoardAdminInsertCombinedConfig" type="controller" />
|
||||
<action name="procBoardAdminSaveCategorySettings" type="controller" permission="manager" check_var="module_srl" ruleset="saveCategorySettings" />
|
||||
</actions>
|
||||
<menus>
|
||||
|
|
|
|||
|
|
@ -92,3 +92,6 @@ $lang->cmd_all_comment_message = 'Always';
|
|||
$lang->cmd_do_not_message = 'Never';
|
||||
$lang->delete_placeholder = 'Delete Placeholder';
|
||||
$lang->msg_document_notify_mail = '[%s] The new post : %s';
|
||||
$lang->cmd_board_combined_board = 'Combined Board';
|
||||
$lang->about_board_combined_board = 'You can use this board to view documents from other boards. Press the Ctrl key and click to select multiple boards.';
|
||||
$lang->cmd_board_include_modules = 'Include Boards';
|
||||
|
|
@ -104,3 +104,6 @@ $lang->msg_document_notify_mail = '[%s] 새로운 게시글이 등록되었습
|
|||
$lang->cmd_document_vote_user = '이 글의 추천인 목록';
|
||||
$lang->cmd_comment_vote_user = '이 댓글의 추천인 목록';
|
||||
$lang->msg_not_target = '문서 또는 댓글의 추천인목록만 조회가능합니다.';
|
||||
$lang->cmd_board_combined_board = '통합 게시판';
|
||||
$lang->about_board_combined_board = '다른 게시판의 글을 모아서 볼 수 있습니다. 여러 게시판을 선택하려면 Ctrl 키를 누르고 클릭하세요.';
|
||||
$lang->cmd_board_include_modules = '포함할 게시판 선택';
|
||||
|
|
@ -3,4 +3,32 @@
|
|||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
|
||||
<!--@if($logged_info->is_admin === 'Y')-->
|
||||
<section class="section">
|
||||
<h1>{$lang->cmd_board_combined_board}</h1>
|
||||
<form action="./" method="post" class="x_form-horizontal">
|
||||
<input type="hidden" name="module" value="document" />
|
||||
<input type="hidden" name="act" value="procBoardAdminInsertCombinedConfig" />
|
||||
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
|
||||
<input type="hidden" name="target_module_srl" value="{$module_info->module_srl}" />
|
||||
{@ $include_modules = explode(',', $module_info->include_modules ?? '')}
|
||||
<div class="x_control-group">
|
||||
<label for="use_history" class="x_control-label">{$lang->cmd_board_include_modules}</label>
|
||||
<div class="x_controls">
|
||||
<select name="include_modules[]" size="8" multiple="multiple">
|
||||
<!--@foreach($board_list as $board_info)-->
|
||||
<option value="{$board_info->module_srl}" selected="selected"|cond="in_array($board_info->module_srl, $include_modules)">{$board_info->browser_title}</option>
|
||||
<!--@endforeach-->
|
||||
</select>
|
||||
<p class="x_help-block">{$lang->about_board_combined_board}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<!--@endif-->
|
||||
|
||||
{$setup_content}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue