mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 09:14:48 +09:00
#314 board 모듈을 코어에 포함
This commit is contained in:
parent
46900dfc8b
commit
9c76b509d9
103 changed files with 8382 additions and 0 deletions
93
modules/board/board.model.php
Normal file
93
modules/board/board.model.php
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
<?php
|
||||
/* Copyright (C) NAVER <http://www.navercorp.com> */
|
||||
|
||||
/**
|
||||
* @class boardModel
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* @brief board module Model class
|
||||
**/
|
||||
class boardModel extends module
|
||||
{
|
||||
/**
|
||||
* @brief initialization
|
||||
**/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get the list configuration
|
||||
**/
|
||||
function getListConfig($module_srl)
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$oDocumentModel = getModel('document');
|
||||
|
||||
// get the list config value, if it is not exitsted then setup the default value
|
||||
$list_config = $oModuleModel->getModulePartConfig('board', $module_srl);
|
||||
if(!$list_config || !count($list_config))
|
||||
{
|
||||
$list_config = array( 'no', 'title', 'nick_name','regdate','readed_count');
|
||||
}
|
||||
|
||||
// get the extra variables
|
||||
$inserted_extra_vars = $oDocumentModel->getExtraKeys($module_srl);
|
||||
|
||||
foreach($list_config as $key)
|
||||
{
|
||||
if(preg_match('/^([0-9]+)$/',$key))
|
||||
{
|
||||
if($inserted_extra_vars[$key])
|
||||
{
|
||||
$output['extra_vars'.$key] = $inserted_extra_vars[$key];
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$output[$key] = new ExtraItem($module_srl, -1, Context::getLang($key), $key, 'N', 'N', 'N', null);
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief return the default list configration value
|
||||
**/
|
||||
function getDefaultListConfig($module_srl)
|
||||
{
|
||||
// add virtual srl, title, registered date, update date, nickname, ID, name, readed count, voted count etc.
|
||||
$virtual_vars = array( 'no', 'title', 'regdate', 'last_update', 'last_post', 'nick_name',
|
||||
'user_id', 'user_name', 'readed_count', 'voted_count', 'blamed_count', 'thumbnail', 'summary', 'comment_status');
|
||||
foreach($virtual_vars as $key)
|
||||
{
|
||||
$extra_vars[$key] = new ExtraItem($module_srl, -1, Context::getLang($key), $key, 'N', 'N', 'N', null);
|
||||
}
|
||||
|
||||
// get the extra variables from the document model
|
||||
$oDocumentModel = getModel('document');
|
||||
$inserted_extra_vars = $oDocumentModel->getExtraKeys($module_srl);
|
||||
|
||||
if(count($inserted_extra_vars))
|
||||
{
|
||||
foreach($inserted_extra_vars as $obj)
|
||||
{
|
||||
$extra_vars['extra_vars'.$obj->idx] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
return $extra_vars;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief return module name in sitemap
|
||||
**/
|
||||
function triggerModuleListInSitemap(&$obj)
|
||||
{
|
||||
array_push($obj, 'board');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue