mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-19 03:09:55 +09:00
merge from 1.7.3.5(r13153:r13167)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc47d2b247
commit
2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions
|
|
@ -12,7 +12,7 @@
|
|||
<description xml:lang="ko">
|
||||
글작성/삭제/댓글작성/삭제시에 포인트를 부여할 수 있습니다.
|
||||
포인트마다 레벨을 지정하여 사용자 이름 앞에 아이콘을 표시할 수도 있습니다.
|
||||
단 포인트 관련 애드온을 활성화 시키셔야 됩니다.
|
||||
단 포인트 관련 애드온을 활성화 시켜야 됩니다.
|
||||
</description>
|
||||
<description xml:lang="zh-CN">
|
||||
可以在发表/删除新帖,发表/删除评论时,付与相应积分。
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<value xml:lang="vi"><![CDATA[Cấp bậc]]></value>
|
||||
</item>
|
||||
<item name="about_point_module">
|
||||
<value xml:lang="ko"><![CDATA[포인트 모듈은 글 작성/댓글작성/업로드/다운로드 등의 행동을 할 때 포인트를 부여할 수 있게 합니다.]]></value>
|
||||
<value xml:lang="ko"><![CDATA[글 작성/댓글작성/업로드/다운로드 등의 행동을 할 때 포인트를 부여할 수 있게 합니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[You can grant points for writing/adding comments/uploading/downloading.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[ポイントモジュールでは、書き込み作成/コメント作成/アップロード/ダウンロードなどのユーザーの活動に対してポイントの計算を行います。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[积分系统可以在发表新帖及评论,上传/下载文件等动作时,付与其相应的积分的模块。]]></value>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<value xml:lang="vi"><![CDATA[Bạn có thể đặt mức điểm khi thành viên gửi, thêm bài viết, bình luận, Download, Upload.<br />Nhưng điểm chỉ có thể cho và tích lũy khi Addon điểm được kích hoạt.]]></value>
|
||||
</item>
|
||||
<item name="about_act_config">
|
||||
<value xml:lang="ko"><![CDATA[게시판, 블로그 등 각 모듈마다 글 작성/삭제/댓글작성/삭제 등의 action이 있습니다. 게시판/블로그 외에 다른 모듈에 포인트 기능 연동을 하고 싶을 때는 각 기능에 맞는 act값을 추가 하시면 됩니다.<br />연결은 ,(콤마)로 하시면 됩니다.]]></value>
|
||||
<value xml:lang="ko"><![CDATA[게시판, 블로그 등 각 페이지마다 글 작성/삭제/댓글작성/삭제 등의 action이 있습니다. 게시판/블로그 외에 다른 페이지에 포인트 기능 연동을 하고 싶을 때는 각 기능에 맞는 act값을 추가 하면 됩니다.<br />연결은 ,(콤마)로 하면 됩니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[Each module like board/blog has its own actions such as "writing/deleting/adding comments/deleting comments". You can just add act values to link modules with point system except board/blog.<br />Comma (,) will distinguish multiple values.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[掲示板、ブログなどのモジュールごとに「書き込み作成・削除/コメント作成・削除」などのアクションがあります。掲示板/ブログ以外のモジュールにポイントシステムを連動させたい場合は、各機能のアクションの「act値」を追加します。連動は半角「,(コンマ)」で区切って追加します。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[版面,博客等模块都有发表/删除新帖,发表/删除评论等动作。 <br />要想与版面/博客之外的模块关联积分功能时,添加与其各模块功能相适合的act值即可。]]></value>
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
<value xml:lang="vi"><![CDATA[Cấp bậc lớn nhất]]></value>
|
||||
</item>
|
||||
<item name="about_max_level">
|
||||
<value xml:lang="ko"><![CDATA[최고레벨을 지정할 수 있습니다. 레벨 아이콘을 염두에 두셔야 하고 최고 레벨은 1000이 한계입니다.]]></value>
|
||||
<value xml:lang="ko"><![CDATA[최고레벨을 지정할 수 있습니다. 레벨 아이콘을 염두에 두어야 하고 최고 레벨은 1000이 한계입니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[You may set the max level. Level icons should be considered and the level of 1000 is the maximum value you can set]]></value>
|
||||
<value xml:lang="jp"><![CDATA[最高レベルを指定することができます。最高レベルは「1000」が最大値であるため、レベルアイコンに注意が必要です。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[可以指定最高级别。级别共设1000级,因此制作级别图标时要好好考虑一下。]]></value>
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
<value xml:lang="vi"><![CDATA[Thư mục chứa Icon của cấp bậc có dạng "./module/point/icons/[level].gif" và cấp độ lớn nhất có thể khác với bộ Icon hiện tại. Vì vậy xin hãy cẩn thận.]]></value>
|
||||
</item>
|
||||
<item name="point_name">
|
||||
<value xml:lang="ko"><![CDATA[포인트 명칭]]></value>
|
||||
<value xml:lang="ko"><![CDATA[포인트 이름]]></value>
|
||||
<value xml:lang="en"><![CDATA[Point Name]]></value>
|
||||
<value xml:lang="jp"><![CDATA[ポイント名]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[积分名]]></value>
|
||||
|
|
@ -487,7 +487,7 @@
|
|||
<value xml:lang="vi"><![CDATA[Danh sách điểm thành viên]]></value>
|
||||
</item>
|
||||
<item name="msg_cannot_download">
|
||||
<value xml:lang="ko"><![CDATA[포인트가 부족하여 다운로드를 하실 수 없습니다.]]></value>
|
||||
<value xml:lang="ko"><![CDATA[포인트가 부족하여 다운로드할 수 없습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[You don't have enough points to download]]></value>
|
||||
<value xml:lang="jp"><![CDATA[ポイントが不足しているため、ダウンロードできません。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[积分不足无法下载!]]></value>
|
||||
|
|
@ -499,7 +499,7 @@
|
|||
<value xml:lang="vi"><![CDATA[Bạn không đủ điểm để Download.]]></value>
|
||||
</item>
|
||||
<item name="msg_disallow_by_point">
|
||||
<value xml:lang="ko"><![CDATA[포인트가 부족하여 글을 읽으실 수 없습니다. (필요한 포인트 : %d, 현재 포인트 : %d)]]></value>
|
||||
<value xml:lang="ko"><![CDATA[포인트가 부족하여 글을 읽을 수 없습니다. (필요한 포인트 : %d, 현재 포인트 : %d)]]></value>
|
||||
<value xml:lang="en"><![CDATA[You need more points to read the article (You need %d, but you have %d).]]></value>
|
||||
<value xml:lang="jp"><![CDATA[ポイントが不足しているため、閲覧ができません。(必要なポイント : %d、 現在のポイント : %d)]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[积分不够,无法查看主题。(所需积分 : %d, 当前积分 : %d)]]></value>
|
||||
|
|
@ -640,8 +640,8 @@
|
|||
<value xml:lang="vi"><![CDATA[Đăng nhập ít nhất]]></value>
|
||||
</item>
|
||||
<item name="extra_vars">
|
||||
<value xml:lang="ko"><![CDATA[확장변수]]></value>
|
||||
<value xml:lang="en"><![CDATA[Extra Vars]]></value>
|
||||
<value xml:lang="ko"><![CDATA[사용자 정의]]></value>
|
||||
<value xml:lang="en"><![CDATA[User Defined]]></value>
|
||||
<value xml:lang="jp"><![CDATA[拡張変数]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[扩展信息]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[延伸變數]]></value>
|
||||
|
|
|
|||
|
|
@ -1,346 +1,374 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pointAdminController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The admin controller class of the point module
|
||||
**/
|
||||
/**
|
||||
* @class pointAdminController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The admin controller class of the point module
|
||||
*/
|
||||
class pointAdminController extends point
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
class pointAdminController extends point {
|
||||
/**
|
||||
* @brief Save the default configurations
|
||||
*/
|
||||
function procPointAdminInsertConfig()
|
||||
{
|
||||
// Get the configuration information
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
// Arrange variables
|
||||
$args = Context::getRequestVars();
|
||||
// Check the point name
|
||||
$config->point_name = $args->point_name;
|
||||
if(!$config->point_name) $config->point_name = 'point';
|
||||
// Specify the default points
|
||||
$config->signup_point = (int)$args->signup_point;
|
||||
$config->login_point = (int)$args->login_point;
|
||||
$config->insert_document = (int)$args->insert_document;
|
||||
$config->read_document = (int)$args->read_document;
|
||||
$config->insert_comment = (int)$args->insert_comment;
|
||||
$config->upload_file = (int)$args->upload_file;
|
||||
$config->download_file = (int)$args->download_file;
|
||||
$config->voted = (int)$args->voted;
|
||||
$config->blamed = (int)$args->blamed;
|
||||
// The highest level
|
||||
$config->max_level = $args->max_level;
|
||||
if($config->max_level>1000) $config->max_level = 1000;
|
||||
if($config->max_level<1) $config->max_level = 1;
|
||||
// Set the level icon
|
||||
$config->level_icon = $args->level_icon;
|
||||
// Check if downloads are not allowed
|
||||
if($args->disable_download == 'Y') $config->disable_download = 'Y';
|
||||
else $config->disable_download = 'N';
|
||||
// Check if reading a document is not allowed
|
||||
if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y';
|
||||
else $config->disable_read_document = 'N';
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
|
||||
/**
|
||||
* @brief Save the default configurations
|
||||
**/
|
||||
function procPointAdminInsertConfig() {
|
||||
// Get the configuration information
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
// Arrange variables
|
||||
$args = Context::getRequestVars();
|
||||
// Check the point name
|
||||
$config->point_name = $args->point_name;
|
||||
if(!$config->point_name) $config->point_name = 'point';
|
||||
// Specify the default points
|
||||
$config->signup_point = (int)$args->signup_point;
|
||||
$config->login_point = (int)$args->login_point;
|
||||
$config->insert_document = (int)$args->insert_document;
|
||||
$config->read_document = (int)$args->read_document;
|
||||
$config->insert_comment = (int)$args->insert_comment;
|
||||
$config->upload_file = (int)$args->upload_file;
|
||||
$config->download_file = (int)$args->download_file;
|
||||
$config->voted = (int)$args->voted;
|
||||
$config->blamed = (int)$args->blamed;
|
||||
// The highest level
|
||||
$config->max_level = $args->max_level;
|
||||
if($config->max_level>1000) $config->max_level = 1000;
|
||||
if($config->max_level<1) $config->max_level = 1;
|
||||
// Set the level icon
|
||||
$config->level_icon = $args->level_icon;
|
||||
// Check if downloads are not allowed
|
||||
if($args->disable_download == 'Y') $config->disable_download = 'Y';
|
||||
else $config->disable_download = 'N';
|
||||
// Check if reading a document is not allowed
|
||||
if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y';
|
||||
else $config->disable_read_document = 'N';
|
||||
// Per-level group configurations
|
||||
foreach($group_list as $group)
|
||||
{
|
||||
// Admin group should not be connected to point.
|
||||
if($group->is_admin == 'Y' || $group->is_default == 'Y') continue;
|
||||
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
|
||||
// Per-level group configurations
|
||||
foreach($group_list as $group)
|
||||
$group_srl = $group->group_srl;
|
||||
if($args->{'point_group_'.$group_srl})
|
||||
{
|
||||
// Admin group should not be connected to point.
|
||||
if($group->is_admin == 'Y' || $group->is_default == 'Y') continue;
|
||||
|
||||
$group_srl = $group->group_srl;
|
||||
if($args->{'point_group_'.$group_srl})
|
||||
{
|
||||
$config->point_group[$group_srl] = $args->{'point_group_'.$group_srl};
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($config->point_group[$group_srl]);
|
||||
}
|
||||
$config->point_group[$group_srl] = $args->{'point_group_'.$group_srl};
|
||||
}
|
||||
|
||||
$config->group_reset = $args->group_reset;
|
||||
// Per-level point configurations
|
||||
unset($config->level_step);
|
||||
for($i=1;$i<=$config->max_level;$i++) {
|
||||
$key = "level_step_".$i;
|
||||
$config->level_step[$i] = (int)$args->{$key};
|
||||
}
|
||||
// A function to calculate per-level points
|
||||
$config->expression = $args->expression;
|
||||
// Save
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModuleConfig('point', $config);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPointAdminConfig');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Save per-module configurations
|
||||
**/
|
||||
function procPointAdminInsertModuleConfig() {
|
||||
$args = Context::getRequestVars();
|
||||
|
||||
foreach($args as $key => $val) {
|
||||
preg_match("/^(insert_document|insert_comment|upload_file|download_file|read_document|voted|blamed)_([0-9]+)$/", $key, $matches);
|
||||
if(!$matches[1]) continue;
|
||||
$name = $matches[1];
|
||||
$module_srl = $matches[2];
|
||||
if(strlen($val)>0) $module_config[$module_srl][$name] = (int)$val;
|
||||
}
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
if(count($module_config)) {
|
||||
foreach($module_config as $module_srl => $config) {
|
||||
$oModuleController->insertModulePartConfig('point',$module_srl,$config);
|
||||
}
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPointAdminModuleConfig');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Save individual points per module
|
||||
**/
|
||||
function procPointAdminInsertPointModuleConfig() {
|
||||
$module_srl = Context::get('target_module_srl');
|
||||
if(!$module_srl) return new Object(-1, 'msg_invalid_request');
|
||||
// In case of batch configuration of several modules
|
||||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||
else $module_srl = array($module_srl);
|
||||
// Save configurations
|
||||
$oModuleController = &getController('module');
|
||||
for($i=0;$i<count($module_srl);$i++) {
|
||||
$srl = trim($module_srl[$i]);
|
||||
if(!$srl) continue;
|
||||
unset($config);
|
||||
$config['insert_document'] = (int)Context::get('insert_document');
|
||||
$config['insert_comment'] = (int)Context::get('insert_comment');
|
||||
$config['upload_file'] = (int)Context::get('upload_file');
|
||||
$config['download_file'] = (int)Context::get('download_file');
|
||||
$config['read_document'] = (int)Context::get('read_document');
|
||||
$config['voted'] = (int)Context::get('voted');
|
||||
$config['blamed'] = (int)Context::get('blamed');
|
||||
$oModuleController->insertModulePartConfig('point', $srl, $config);
|
||||
}
|
||||
|
||||
$this->setError(-1);
|
||||
$this->setMessage('success_updated', 'info');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminContent');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Change members points
|
||||
**/
|
||||
function procPointAdminUpdatePoint() {
|
||||
$member_srl = Context::get('member_srl');
|
||||
$point = Context::get('point');
|
||||
|
||||
preg_match('/^(\+|-)?([1-9][0-9]*)$/', $point, $m);
|
||||
|
||||
$action = '';
|
||||
switch($m[1])
|
||||
else
|
||||
{
|
||||
case '+':
|
||||
$action = 'add';
|
||||
break;
|
||||
|
||||
case '-':
|
||||
$action = 'minus';
|
||||
break;
|
||||
|
||||
default:
|
||||
$action = 'update';
|
||||
break;
|
||||
unset($config->point_group[$group_srl]);
|
||||
}
|
||||
$point = $m[2];
|
||||
}
|
||||
|
||||
$oPointController = &getController('point');
|
||||
$output = $oPointController->setPoint($member_srl, (int)$point, $action);
|
||||
$config->group_reset = $args->group_reset;
|
||||
// Per-level point configurations
|
||||
unset($config->level_step);
|
||||
for($i=1;$i<=$config->max_level;$i++)
|
||||
{
|
||||
$key = "level_step_".$i;
|
||||
$config->level_step[$i] = (int)$args->{$key};
|
||||
}
|
||||
// A function to calculate per-level points
|
||||
$config->expression = $args->expression;
|
||||
// Save
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModuleConfig('point', $config);
|
||||
|
||||
$this->setError(-1);
|
||||
$this->setMessage('success_updated', 'info');
|
||||
$this->setMessage('success_updated');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPointAdminPointList');
|
||||
return $this->setRedirectUrl($returnUrl, $output);
|
||||
}
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPointAdminConfig');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Recalculate points based on the list/comment/attachment and registration information. Granted only once a first-time login score.
|
||||
**/
|
||||
function procPointAdminReCal() {
|
||||
set_time_limit(0);
|
||||
// Get per-module points information
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
/**
|
||||
* @brief Save per-module configurations
|
||||
*/
|
||||
function procPointAdminInsertModuleConfig()
|
||||
{
|
||||
$args = Context::getRequestVars();
|
||||
|
||||
$module_config = $oModuleModel->getModulePartConfigs('point');
|
||||
// A variable to store member's points
|
||||
$member = array();
|
||||
|
||||
// Get member infomation
|
||||
$output = executeQueryArray('point.getMemberCount');
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
if(!$val->member_srl) continue;
|
||||
$member[$val->member_srl] = 0;
|
||||
$configTypeList = array('insert_document', 'insert_comment', 'upload_file', 'download_file', 'read_document', 'voted', 'blamed');
|
||||
foreach($configTypeList AS $config)
|
||||
{
|
||||
if(is_array($args->{$config}))
|
||||
{
|
||||
foreach($args->{$config} AS $key=>$value)
|
||||
{
|
||||
$module_config[$key][$config] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get post information
|
||||
$output = executeQueryArray('point.getDocumentPoint');
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document'];
|
||||
else $insert_point = $config->insert_document;
|
||||
|
||||
if(!$val->member_srl) continue;
|
||||
$point = $insert_point * $val->count;
|
||||
$member[$val->member_srl] += $point;
|
||||
}
|
||||
$oModuleController = &getController('module');
|
||||
if(count($module_config))
|
||||
{
|
||||
foreach($module_config as $module_srl => $config)
|
||||
{
|
||||
$oModuleController->insertModulePartConfig('point',$module_srl,$config);
|
||||
}
|
||||
}
|
||||
|
||||
$output = null;
|
||||
// Get comments information
|
||||
$output = executeQueryArray('point.getCommentPoint');
|
||||
if(!$output->toBool()) return $output;
|
||||
$this->setMessage('success_updated');
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))
|
||||
{
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPointAdminModuleConfig');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment'];
|
||||
else $insert_point = $config->insert_comment;
|
||||
/**
|
||||
* @brief Save individual points per module
|
||||
*/
|
||||
function procPointAdminInsertPointModuleConfig()
|
||||
{
|
||||
$module_srl = Context::get('target_module_srl');
|
||||
if(!$module_srl) return new Object(-1, 'msg_invalid_request');
|
||||
// In case of batch configuration of several modules
|
||||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||
else $module_srl = array($module_srl);
|
||||
// Save configurations
|
||||
$oModuleController = &getController('module');
|
||||
for($i=0;$i<count($module_srl);$i++)
|
||||
{
|
||||
$srl = trim($module_srl[$i]);
|
||||
if(!$srl) continue;
|
||||
unset($config);
|
||||
$config['insert_document'] = (int)Context::get('insert_document');
|
||||
$config['insert_comment'] = (int)Context::get('insert_comment');
|
||||
$config['upload_file'] = (int)Context::get('upload_file');
|
||||
$config['download_file'] = (int)Context::get('download_file');
|
||||
$config['read_document'] = (int)Context::get('read_document');
|
||||
$config['voted'] = (int)Context::get('voted');
|
||||
$config['blamed'] = (int)Context::get('blamed');
|
||||
$oModuleController->insertModulePartConfig('point', $srl, $config);
|
||||
}
|
||||
|
||||
if(!$val->member_srl) continue;
|
||||
$point = $insert_point * $val->count;
|
||||
$member[$val->member_srl] += $point;
|
||||
}
|
||||
}
|
||||
$output = null;
|
||||
// Get the attached files' information
|
||||
$output = executeQueryArray('point.getFilePoint');
|
||||
if(!$output->toBool()) return $output;
|
||||
$this->setError(-1);
|
||||
$this->setMessage('success_updated', 'info');
|
||||
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file'];
|
||||
else $insert_point = $config->upload_file;
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispBoardAdminContent');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
if(!$val->member_srl) continue;
|
||||
$point = $insert_point * $val->count;
|
||||
$member[$val->member_srl] += $point;
|
||||
}
|
||||
}
|
||||
$output = null;
|
||||
// Set all members' points to 0
|
||||
$output = executeQuery("point.initMemberPoint");
|
||||
if(!$output->toBool()) return $output;
|
||||
// Save the file temporarily
|
||||
$f = fopen("./files/cache/pointRecal.txt","w");
|
||||
foreach($member as $key => $val) {
|
||||
$val += (int)$config->signup_point;
|
||||
fwrite($f, $key.','.$val."\r\n");
|
||||
}
|
||||
fclose($f);
|
||||
/**
|
||||
* @brief Change members points
|
||||
*/
|
||||
function procPointAdminUpdatePoint()
|
||||
{
|
||||
$member_srl = Context::get('member_srl');
|
||||
$point = Context::get('point');
|
||||
|
||||
$this->add('total', count($member));
|
||||
$this->add('position', 0);
|
||||
$this->setMessage( sprintf(Context::getLang('point_recal_message'), 0, $this->get('total')) );
|
||||
}
|
||||
preg_match('/^(\+|-)?([1-9][0-9]*)$/', $point, $m);
|
||||
|
||||
/**
|
||||
* @brief Apply member points saved by file to units of 5,000 people
|
||||
**/
|
||||
function procPointAdminApplyPoint() {
|
||||
$position = (int)Context::get('position');
|
||||
$total = (int)Context::get('total');
|
||||
$action = '';
|
||||
switch($m[1])
|
||||
{
|
||||
case '+':
|
||||
$action = 'add';
|
||||
break;
|
||||
case '-':
|
||||
$action = 'minus';
|
||||
break;
|
||||
default:
|
||||
$action = 'update';
|
||||
break;
|
||||
}
|
||||
$point = $m[2];
|
||||
|
||||
if(!file_exists('./files/cache/pointRecal.txt')) return new Object(-1, 'msg_invalid_request');
|
||||
$oPointController = &getController('point');
|
||||
$output = $oPointController->setPoint($member_srl, (int)$point, $action);
|
||||
|
||||
$idx = 0;
|
||||
$f = fopen("./files/cache/pointRecal.txt","r");
|
||||
while(!feof($f)) {
|
||||
$str = trim(fgets($f, 1024));
|
||||
$idx ++;
|
||||
if($idx > $position) {
|
||||
list($member_srl, $point) = explode(',',$str);
|
||||
$this->setError(-1);
|
||||
$this->setMessage('success_updated', 'info');
|
||||
|
||||
$args = null;
|
||||
$args->member_srl = $member_srl;
|
||||
$args->point = $point;
|
||||
$output = executeQuery('point.insertPoint',$args);
|
||||
if($idx%5000==0) break;
|
||||
}
|
||||
}
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPointAdminPointList');
|
||||
return $this->setRedirectUrl($returnUrl, $output);
|
||||
}
|
||||
|
||||
if(feof($f)) {
|
||||
FileHandler::removeFile('./files/cache/pointRecal.txt');
|
||||
$idx = $total;
|
||||
/**
|
||||
* @brief Recalculate points based on the list/comment/attachment and registration information. Granted only once a first-time login score.
|
||||
*/
|
||||
function procPointAdminReCal()
|
||||
{
|
||||
@set_time_limit(0);
|
||||
// Get per-module points information
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
FileHandler::rename('./files/member_extra_info/point','./files/member_extra_info/point.old');
|
||||
$module_config = $oModuleModel->getModulePartConfigs('point');
|
||||
// A variable to store member's points
|
||||
$member = array();
|
||||
|
||||
FileHandler::removeDir('./files/member_extra_info/point.old');
|
||||
}
|
||||
fclose($f);
|
||||
// Get member infomation
|
||||
$output = executeQueryArray('point.getMemberCount');
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('total', $total);
|
||||
$this->add('position', $idx);
|
||||
$this->setMessage(sprintf(Context::getLang('point_recal_message'), $idx, $total));
|
||||
if($output->data)
|
||||
{
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
if(!$val->member_srl) continue;
|
||||
$member[$val->member_srl] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// Get post information
|
||||
$output = executeQueryArray('point.getDocumentPoint');
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
/**
|
||||
* @brief Reset points for each module
|
||||
**/
|
||||
function procPointAdminReset() {
|
||||
$module_srl = Context::get('module_srls');
|
||||
if(!$module_srl) return new Object(-1, 'msg_invalid_request');
|
||||
// In case of batch configuration of several modules
|
||||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||
else $module_srl = array($module_srl);
|
||||
// Save configurations
|
||||
$oModuleController = &getController('module');
|
||||
for($i=0;$i<count($module_srl);$i++) {
|
||||
$srl = trim($module_srl[$i]);
|
||||
if(!$srl) continue;
|
||||
unset($args);
|
||||
$args->module = 'point';
|
||||
$args->module_srl = $srl;
|
||||
executeQuery('module.deleteModulePartConfig', $args);
|
||||
}
|
||||
if($output->data)
|
||||
{
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document'];
|
||||
else $insert_point = $config->insert_document;
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
if(!$val->member_srl) continue;
|
||||
$point = $insert_point * $val->count;
|
||||
$member[$val->member_srl] += $point;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Save the cache files
|
||||
* @deprecated
|
||||
**/
|
||||
function cacheActList() {
|
||||
return;
|
||||
}
|
||||
$output = null;
|
||||
// Get comments information
|
||||
$output = executeQueryArray('point.getCommentPoint');
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
}
|
||||
?>
|
||||
if($output->data)
|
||||
{
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment'];
|
||||
else $insert_point = $config->insert_comment;
|
||||
|
||||
if(!$val->member_srl) continue;
|
||||
$point = $insert_point * $val->count;
|
||||
$member[$val->member_srl] += $point;
|
||||
}
|
||||
}
|
||||
$output = null;
|
||||
// Get the attached files' information
|
||||
$output = executeQueryArray('point.getFilePoint');
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
if($output->data)
|
||||
{
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file'];
|
||||
else $insert_point = $config->upload_file;
|
||||
|
||||
if(!$val->member_srl) continue;
|
||||
$point = $insert_point * $val->count;
|
||||
$member[$val->member_srl] += $point;
|
||||
}
|
||||
}
|
||||
$output = null;
|
||||
// Set all members' points to 0
|
||||
$output = executeQuery("point.initMemberPoint");
|
||||
if(!$output->toBool()) return $output;
|
||||
// Save the file temporarily
|
||||
$f = fopen("./files/cache/pointRecal.txt","w");
|
||||
foreach($member as $key => $val)
|
||||
{
|
||||
$val += (int)$config->signup_point;
|
||||
fwrite($f, $key.','.$val."\r\n");
|
||||
}
|
||||
fclose($f);
|
||||
|
||||
$this->add('total', count($member));
|
||||
$this->add('position', 0);
|
||||
$this->setMessage( sprintf(Context::getLang('point_recal_message'), 0, $this->get('total')) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Apply member points saved by file to units of 5,000 people
|
||||
*/
|
||||
function procPointAdminApplyPoint()
|
||||
{
|
||||
$position = (int)Context::get('position');
|
||||
$total = (int)Context::get('total');
|
||||
|
||||
if(!file_exists('./files/cache/pointRecal.txt')) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$idx = 0;
|
||||
$f = fopen("./files/cache/pointRecal.txt","r");
|
||||
while(!feof($f))
|
||||
{
|
||||
$str = trim(fgets($f, 1024));
|
||||
$idx ++;
|
||||
if($idx > $position)
|
||||
{
|
||||
list($member_srl, $point) = explode(',',$str);
|
||||
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $member_srl;
|
||||
$args->point = $point;
|
||||
$output = executeQuery('point.insertPoint',$args);
|
||||
if($idx%5000==0) break;
|
||||
}
|
||||
}
|
||||
|
||||
if(feof($f))
|
||||
{
|
||||
FileHandler::removeFile('./files/cache/pointRecal.txt');
|
||||
$idx = $total;
|
||||
|
||||
FileHandler::rename('./files/member_extra_info/point','./files/member_extra_info/point.old');
|
||||
|
||||
FileHandler::removeDir('./files/member_extra_info/point.old');
|
||||
}
|
||||
fclose($f);
|
||||
|
||||
$this->add('total', $total);
|
||||
$this->add('position', $idx);
|
||||
$this->setMessage(sprintf(Context::getLang('point_recal_message'), $idx, $total));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reset points for each module
|
||||
*/
|
||||
function procPointAdminReset()
|
||||
{
|
||||
$module_srl = Context::get('module_srls');
|
||||
if(!$module_srl) return new Object(-1, 'msg_invalid_request');
|
||||
// In case of batch configuration of several modules
|
||||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||
else $module_srl = array($module_srl);
|
||||
// Save configurations
|
||||
$oModuleController = &getController('module');
|
||||
for($i=0;$i<count($module_srl);$i++)
|
||||
{
|
||||
$srl = trim($module_srl[$i]);
|
||||
if(!$srl) continue;
|
||||
$args = new stdClass();
|
||||
$args->module = 'point';
|
||||
$args->module_srl = $srl;
|
||||
executeQuery('module.deleteModulePartConfig', $args);
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Save the cache files
|
||||
* @deprecated
|
||||
*/
|
||||
function cacheActList()
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* End of file point.admin.controller.php */
|
||||
/* Location: ./modules/point/point.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -1,117 +1,125 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pointAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The admin view class of the point module
|
||||
**/
|
||||
/**
|
||||
* @class pointAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The admin view class of the point module
|
||||
*/
|
||||
class pointAdminView extends point
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
// Get teh configuration information
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
// Set the configuration variable
|
||||
Context::set('config', $config);
|
||||
|
||||
class pointAdminView extends point {
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('config.point_name','config.level_icon');
|
||||
$security->encodeHTML('module_info..');
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
// Get teh configuration information
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
// Set the configuration variable
|
||||
Context::set('config', $config);
|
||||
// Set the template path
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('config.point_name','config.level_icon');
|
||||
$security->encodeHTML('module_info..');
|
||||
/**
|
||||
* @brief Default configurations
|
||||
*/
|
||||
function dispPointAdminConfig()
|
||||
{
|
||||
// Get the list of level icons
|
||||
$level_icon_list = FileHandler::readDir("./modules/point/icons");
|
||||
Context::set('level_icon_list', $level_icon_list);
|
||||
// Get the list of groups
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
$selected_group_list = array();
|
||||
if(count($group_list))
|
||||
{
|
||||
foreach($group_list as $key => $val)
|
||||
{
|
||||
$selected_group_list[$key] = $val;
|
||||
}
|
||||
}
|
||||
Context::set('group_list', $selected_group_list);
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('group_list..title','group_list..description');
|
||||
|
||||
// Set the template path
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
// Set the template
|
||||
$this->setTemplateFile('config');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Default configurations
|
||||
**/
|
||||
function dispPointAdminConfig() {
|
||||
// Get the list of level icons
|
||||
$level_icon_list = FileHandler::readDir("./modules/point/icons");
|
||||
Context::set('level_icon_list', $level_icon_list);
|
||||
// Get the list of groups
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
$selected_group_list = array();
|
||||
if(count($group_list)) {
|
||||
foreach($group_list as $key => $val) {
|
||||
$selected_group_list[$key] = $val;
|
||||
}
|
||||
}
|
||||
Context::set('group_list', $selected_group_list);
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('group_list..title','group_list..description');
|
||||
/**
|
||||
* @brief Set per-module scores
|
||||
*/
|
||||
function dispPointAdminModuleConfig()
|
||||
{
|
||||
// Get a list of mid
|
||||
$oModuleModel = &getModel('module');
|
||||
$columnList = array('module_srl', 'mid', 'browser_title');
|
||||
$mid_list = $oModuleModel->getMidList(null, $columnList);
|
||||
Context::set('mid_list', $mid_list);
|
||||
|
||||
// Set the template
|
||||
$this->setTemplateFile('config');
|
||||
}
|
||||
Context::set('module_config', $oModuleModel->getModulePartConfigs('point'));
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('mid_list..browser_title','mid_list..mid');
|
||||
|
||||
/**
|
||||
* @brief Set per-module scores
|
||||
**/
|
||||
function dispPointAdminModuleConfig() {
|
||||
// Get a list of mid
|
||||
$oModuleModel = &getModel('module');
|
||||
$columnList = array('module_srl', 'mid', 'browser_title');
|
||||
$mid_list = $oModuleModel->getMidList(null, $columnList);
|
||||
Context::set('mid_list', $mid_list);
|
||||
// Set the template
|
||||
$this->setTemplateFile('module_config');
|
||||
}
|
||||
|
||||
Context::set('module_config', $oModuleModel->getModulePartConfigs('point'));
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('mid_list..browser_title','mid_list..mid');
|
||||
/**
|
||||
* @brief Configure the functional act
|
||||
*/
|
||||
function dispPointAdminActConfig()
|
||||
{
|
||||
// Set the template
|
||||
$this->setTemplateFile('action_config');
|
||||
}
|
||||
|
||||
// Set the template
|
||||
$this->setTemplateFile('module_config');
|
||||
}
|
||||
/**
|
||||
* @brief Get a list of member points
|
||||
*/
|
||||
function dispPointAdminPointList()
|
||||
{
|
||||
$oPointModel = &getModel('point');
|
||||
|
||||
/**
|
||||
* @brief Configure the functional act
|
||||
**/
|
||||
function dispPointAdminActConfig() {
|
||||
// Set the template
|
||||
$this->setTemplateFile('action_config');
|
||||
}
|
||||
$args = new stdClass();
|
||||
$args->list_count = 20;
|
||||
$args->page = Context::get('page');
|
||||
|
||||
/**
|
||||
* @brief Get a list of member points
|
||||
**/
|
||||
function dispPointAdminPointList() {
|
||||
$oPointModel = &getModel('point');
|
||||
$oMemberModel = &getModel('member');
|
||||
$memberConfig = $oMemberModel->getMemberConfig();
|
||||
|
||||
$args->list_count = 20;
|
||||
$args->page = Context::get('page');
|
||||
Context::set('identifier', $memberConfig->identifier);
|
||||
|
||||
$oMemberModel = &getModel('member');
|
||||
$memberConfig = $oMemberModel->getMemberConfig();
|
||||
$columnList = array('member.member_srl', 'member.user_id', 'member.email_address', 'member.nick_name', 'point.point');
|
||||
$output = $oPointModel->getMemberList($args, $columnList);
|
||||
// context::set for writing into a template
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('member_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
// Create a member model object
|
||||
$oMemberModel = &getModel('member');
|
||||
// Get a list of groups
|
||||
$this->group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $this->group_list);
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('group_list..title','group_list..description');
|
||||
$security->encodeHTML('member_list..');
|
||||
|
||||
Context::set('identifier', $memberConfig->identifier);
|
||||
|
||||
$columnList = array('member.member_srl', 'member.user_id', 'member.email_address', 'member.nick_name', 'point.point');
|
||||
$output = $oPointModel->getMemberList($args, $columnList);
|
||||
// context::set for writing into a template
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('member_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
// Create a member model object
|
||||
$oMemberModel = &getModel('member');
|
||||
// Get a list of groups
|
||||
$this->group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $this->group_list);
|
||||
//Security
|
||||
$security = new Security();
|
||||
$security->encodeHTML('group_list..title','group_list..description');
|
||||
$security->encodeHTML('member_list..');
|
||||
|
||||
// Set the template
|
||||
$this->setTemplateFile('member_list');
|
||||
}
|
||||
}
|
||||
?>
|
||||
// Set the template
|
||||
$this->setTemplateFile('member_list');
|
||||
}
|
||||
}
|
||||
/* End of file point.admin.view.php */
|
||||
/* Location: ./modules/point/point.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -1,180 +1,184 @@
|
|||
<?php
|
||||
/**
|
||||
* @class point
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The parent class of the point module
|
||||
**/
|
||||
/**
|
||||
* @class point
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The parent class of the point module
|
||||
*/
|
||||
class point extends ModuleObject
|
||||
{
|
||||
/**
|
||||
* @brief Additional tasks required to accomplish during the installation
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
// Registration in action forward (for using in the administrator mode)
|
||||
$oModuleController = &getController('module');
|
||||
// Create a directory to store points information
|
||||
FileHandler::makeDir('./files/member_extra_info/point');
|
||||
|
||||
class point extends ModuleObject {
|
||||
$oModuleController = &getController('module');
|
||||
// The highest level
|
||||
$config->max_level = 30;
|
||||
// Per-level score
|
||||
for($i=1;$i<=30;$i++)
|
||||
{
|
||||
$config->level_step[$i] = pow($i,2)*90;
|
||||
}
|
||||
// Points for registration
|
||||
$config->signup_point = 10;
|
||||
// Login points
|
||||
$config->login_point = 5;
|
||||
// Point's name
|
||||
$config->point_name = 'point';
|
||||
// Level icon directory
|
||||
$config->level_icon = "default";
|
||||
// Prevent downloads if there are no scores
|
||||
$config->disable_download = false;
|
||||
|
||||
/**
|
||||
* @brief Additional tasks required to accomplish during the installation
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// Registration in action forward (for using in the administrator mode)
|
||||
$oModuleController = &getController('module');
|
||||
// Create a directory to store points information
|
||||
FileHandler::makeDir('./files/member_extra_info/point');
|
||||
/**
|
||||
* Define the default points per module as well as all actions (as we do not know if it is forum or blogs, specify "act")
|
||||
*/
|
||||
// Insert document
|
||||
$config->insert_document = 10;
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
// The highest level
|
||||
$config->max_level = 30;
|
||||
// Per-level score
|
||||
for($i=1;$i<=30;$i++) {
|
||||
$config->level_step[$i] = pow($i,2)*90;
|
||||
}
|
||||
// Points for registration
|
||||
$config->signup_point = 10;
|
||||
// Login points
|
||||
$config->login_point = 5;
|
||||
// Point's name
|
||||
$config->point_name = 'point';
|
||||
// Level icon directory
|
||||
$config->level_icon = "default";
|
||||
// Prevent downloads if there are no scores
|
||||
$config->disable_download = false;
|
||||
$config->insert_document_act = 'procBoardInsertDocument';
|
||||
$config->delete_document_act = 'procBoardDeleteDocument';
|
||||
// Insert comment
|
||||
$config->insert_comment = 5;
|
||||
|
||||
/**
|
||||
* Define the default points per module as well as all actions (as we do not know if it is forum or blogs, specify "act")
|
||||
**/
|
||||
// Insert document
|
||||
$config->insert_document = 10;
|
||||
$config->insert_comment_act = 'procBoardInsertComment,procBlogInsertComment';
|
||||
$config->delete_comment_act = 'procBoardDeleteComment,procBlogDeleteComment';
|
||||
// Upload
|
||||
$config->upload_file = 5;
|
||||
|
||||
$config->insert_document_act = 'procBoardInsertDocument';
|
||||
$config->delete_document_act = 'procBoardDeleteDocument';
|
||||
// Insert comment
|
||||
$config->insert_comment = 5;
|
||||
$config->upload_file_act = 'procFileUpload';
|
||||
$config->delete_file_act = 'procFileDelete';
|
||||
// Download
|
||||
$config->download_file = -5;
|
||||
$config->download_file_act = 'procFileDownload';
|
||||
// View
|
||||
$config->read_document = 0;
|
||||
// Vote up / Vote down
|
||||
$config->voted = 0;
|
||||
$config->blamed = 0;
|
||||
// Save configurations
|
||||
$oModuleController->insertModuleConfig('point', $config);
|
||||
// Cash act list for faster execution
|
||||
$oPointController = &getAdminController('point');
|
||||
$oPointController->cacheActList();
|
||||
// Add a trigger for registration/insert document/insert comment/upload a file/download
|
||||
$oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after');
|
||||
$oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after');
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before');
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after');
|
||||
$oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after');
|
||||
$oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after');
|
||||
$oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after');
|
||||
$oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after');
|
||||
$oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before');
|
||||
$oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after');
|
||||
$oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after');
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after');
|
||||
$oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after');
|
||||
// Add a trigger for voting up and down 2008.05.13 haneul
|
||||
$oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after');
|
||||
// Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero
|
||||
$oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before');
|
||||
|
||||
$config->insert_comment_act = 'procBoardInsertComment,procBlogInsertComment';
|
||||
$config->delete_comment_act = 'procBoardDeleteComment,procBlogDeleteComment';
|
||||
// Upload
|
||||
$config->upload_file = 5;
|
||||
return new Object();
|
||||
}
|
||||
|
||||
$config->upload_file_act = 'procFileUpload';
|
||||
$config->delete_file_act = 'procFileDelete';
|
||||
// Download
|
||||
$config->download_file = -5;
|
||||
$config->download_file_act = 'procFileDownload';
|
||||
// View
|
||||
$config->read_document = 0;
|
||||
// Vote up / Vote down
|
||||
$config->voted = 0;
|
||||
$config->blamed = 0;
|
||||
// Save configurations
|
||||
$oModuleController->insertModuleConfig('point', $config);
|
||||
// Cash act list for faster execution
|
||||
$oPointController = &getAdminController('point');
|
||||
$oPointController->cacheActList();
|
||||
// Add a trigger for registration/insert document/insert comment/upload a file/download
|
||||
$oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after');
|
||||
$oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after');
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before');
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after');
|
||||
$oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after');
|
||||
$oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after');
|
||||
$oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after');
|
||||
$oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after');
|
||||
$oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before');
|
||||
$oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after');
|
||||
$oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after');
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after');
|
||||
$oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after');
|
||||
// Add a trigger for voting up and down 2008.05.13 haneul
|
||||
$oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after');
|
||||
// Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero
|
||||
$oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before');
|
||||
/**
|
||||
* @brief A method to check if the installation has been successful
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
// Get the information of the point module
|
||||
$oModuleModel = &getModel('module');
|
||||
// Add a trigger for registration/insert document/insert comment/upload a file/download
|
||||
if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) return true;
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) return true;
|
||||
if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) return true;
|
||||
// Add a trigger for voting up and down 2008.05.13 haneul
|
||||
if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true;
|
||||
// Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero
|
||||
if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) return true;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
|
||||
/**
|
||||
* @brief A method to check if the installation has been successful
|
||||
**/
|
||||
function checkUpdate() {
|
||||
// Get the information of the point module
|
||||
$oModuleModel = &getModel('module');
|
||||
// Add a trigger for registration/insert document/insert comment/upload a file/download
|
||||
if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) return true;
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) return true;
|
||||
if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) return true;
|
||||
if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) return true;
|
||||
// Add a trigger for voting up and down 2008.05.13 haneul
|
||||
if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true;
|
||||
// Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero
|
||||
if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
/**
|
||||
* @brief Execute update
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
// Get the information of the point module
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
// Add a trigger for registration/insert document/insert comment/upload a file/download
|
||||
if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'))
|
||||
$oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after');
|
||||
if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'))
|
||||
$oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after');
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'))
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before');
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'))
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after');
|
||||
if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'))
|
||||
$oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after');
|
||||
if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'))
|
||||
$oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after');
|
||||
if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'))
|
||||
$oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after');
|
||||
if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'))
|
||||
$oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after');
|
||||
if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'))
|
||||
$oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before');
|
||||
if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'))
|
||||
$oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after');
|
||||
if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'))
|
||||
$oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after');
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'))
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after');
|
||||
if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'))
|
||||
$oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after');
|
||||
// Add a trigger for voting up and down 2008.05.13 haneul
|
||||
if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'))
|
||||
$oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after');
|
||||
// Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero
|
||||
if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'))
|
||||
$oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before');
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Execute update
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
// Get the information of the point module
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
// Add a trigger for registration/insert document/insert comment/upload a file/download
|
||||
if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'))
|
||||
$oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after');
|
||||
if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'))
|
||||
$oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after');
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'))
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before');
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'))
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after');
|
||||
if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'))
|
||||
$oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after');
|
||||
if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'))
|
||||
$oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after');
|
||||
if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'))
|
||||
$oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after');
|
||||
if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'))
|
||||
$oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after');
|
||||
if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'))
|
||||
$oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before');
|
||||
if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'))
|
||||
$oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after');
|
||||
if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'))
|
||||
$oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after');
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'))
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after');
|
||||
if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'))
|
||||
$oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after');
|
||||
// Add a trigger for voting up and down 2008.05.13 haneul
|
||||
if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'))
|
||||
$oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after');
|
||||
// Add a trigger for using points for permanent saving of a temporarily saved document 2009.05.19 zero
|
||||
if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'))
|
||||
$oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before');
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'point', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Re-create the cache file
|
||||
**/
|
||||
function recompileCache() {
|
||||
// redefine point action file
|
||||
$oPointAdminController = &getAdminController('point');
|
||||
$oPointAdminController->cacheActList();
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
/**
|
||||
* @brief Re-create the cache file
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
// redefine point action file
|
||||
$oPointAdminController = &getAdminController('point');
|
||||
$oPointAdminController->cacheActList();
|
||||
}
|
||||
}
|
||||
/* End of file point.class.php */
|
||||
/* Location: ./modules/point/point.class.php */
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,174 +1,195 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pointModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The model class fo the point module
|
||||
**/
|
||||
/**
|
||||
* @class pointModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The model class fo the point module
|
||||
*/
|
||||
class pointModel extends point
|
||||
{
|
||||
var $pointList = array();
|
||||
|
||||
class pointModel extends point {
|
||||
var $pointList = array();
|
||||
/**
|
||||
* @brief Initialization
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
/**
|
||||
* @brief Check if there is points information
|
||||
*/
|
||||
function isExistsPoint($member_srl)
|
||||
{
|
||||
$member_srl = abs($member_srl);
|
||||
|
||||
/**
|
||||
* @brief Check if there is points information
|
||||
**/
|
||||
function isExistsPoint($member_srl) {
|
||||
$member_srl = abs($member_srl);
|
||||
// Get from instance memory
|
||||
if($this->pointList[$member_srl]) return true;
|
||||
|
||||
// Get from instance memory
|
||||
if($this->pointList[$member_srl]) return true;
|
||||
|
||||
// Get from file cache
|
||||
$path = sprintf('./files/member_extra_info/point/%s',getNumberingPath($member_srl));
|
||||
$cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl);
|
||||
if(file_exists($cache_filename))
|
||||
{
|
||||
if(!$this->pointList[$member_srl])
|
||||
$this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename));
|
||||
return true;
|
||||
}
|
||||
|
||||
$args->member_srl = $member_srl;
|
||||
$output = executeQuery('point.getPoint', $args);
|
||||
if($output->data->member_srl == $member_srl)
|
||||
{
|
||||
if(!$this->pointList[$member_srl])
|
||||
$this->pointList[$member_srl] = (int)$output->data->point;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the points
|
||||
**/
|
||||
function getPoint($member_srl, $from_db = false) {
|
||||
$member_srl = abs($member_srl);
|
||||
|
||||
// Get from instance memory
|
||||
if(!$from_db && $this->pointList[$member_srl]) return $this->pointList[$member_srl];
|
||||
|
||||
// Get from file cache
|
||||
$path = sprintf('./files/member_extra_info/point/%s',getNumberingPath($member_srl));
|
||||
$cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl);
|
||||
|
||||
if(!$from_db && file_exists($cache_filename))
|
||||
return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename));
|
||||
|
||||
// Get from the DB
|
||||
$args->member_srl = $member_srl;
|
||||
$output = executeQuery('point.getPoint', $args);
|
||||
|
||||
if(isset($output->data->member_srl))
|
||||
{
|
||||
$point = (int)$output->data->point;
|
||||
$this->pointList[$member_srl] = $point;
|
||||
if(!is_dir($path)) FileHandler::makeDir($path);
|
||||
FileHandler::writeFile($cache_filename, $point);
|
||||
return $point;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the level
|
||||
**/
|
||||
function getLevel($point, $level_step) {
|
||||
$level_count = count($level_step);
|
||||
for($level=0;$level<=$level_count;$level++) if($point < $level_step[$level]) break;
|
||||
$level --;
|
||||
return $level;
|
||||
}
|
||||
|
||||
function getMembersPointInfo()
|
||||
// Get from file cache
|
||||
$path = sprintf('./files/member_extra_info/point/%s',getNumberingPath($member_srl));
|
||||
$cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl);
|
||||
if(file_exists($cache_filename))
|
||||
{
|
||||
$member_srls = Context::get('member_srls');
|
||||
$member_srls = explode(',',$member_srls);
|
||||
if(count($member_srls)==0) return;
|
||||
array_unique($member_srls);
|
||||
if(!$this->pointList[$member_srl])
|
||||
$this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename));
|
||||
return true;
|
||||
}
|
||||
|
||||
$args =new stdClass();
|
||||
$args->member_srl = $member_srl;
|
||||
$output = executeQuery('point.getPoint', $args);
|
||||
if($output->data->member_srl == $member_srl)
|
||||
{
|
||||
if(!$this->pointList[$member_srl])
|
||||
$this->pointList[$member_srl] = (int)$output->data->point;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the points
|
||||
*/
|
||||
function getPoint($member_srl, $from_db = false)
|
||||
{
|
||||
$member_srl = abs($member_srl);
|
||||
|
||||
// Get from instance memory
|
||||
if(!$from_db && $this->pointList[$member_srl]) return $this->pointList[$member_srl];
|
||||
|
||||
// Get from file cache
|
||||
$path = sprintf('./files/member_extra_info/point/%s',getNumberingPath($member_srl));
|
||||
$cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl);
|
||||
|
||||
if(!$from_db && file_exists($cache_filename))
|
||||
return $this->pointList[$member_srl] = trim(FileHandler::readFile($cache_filename));
|
||||
|
||||
// Get from the DB
|
||||
$args =new stdClass();
|
||||
$args->member_srl = $member_srl;
|
||||
$output = executeQuery('point.getPoint', $args);
|
||||
|
||||
if(isset($output->data->member_srl))
|
||||
{
|
||||
$point = (int)$output->data->point;
|
||||
$this->pointList[$member_srl] = $point;
|
||||
if(!is_dir($path)) FileHandler::makeDir($path);
|
||||
FileHandler::writeFile($cache_filename, $point);
|
||||
return $point;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the level
|
||||
*/
|
||||
function getLevel($point, $level_step)
|
||||
{
|
||||
$level_count = count($level_step);
|
||||
for($level=0;$level<=$level_count;$level++) if($point < $level_step[$level]) break;
|
||||
$level --;
|
||||
return $level;
|
||||
}
|
||||
|
||||
function getMembersPointInfo()
|
||||
{
|
||||
$member_srls = Context::get('member_srls');
|
||||
$member_srls = explode(',',$member_srls);
|
||||
if(count($member_srls)==0) return;
|
||||
array_unique($member_srls);
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
$info = array();
|
||||
foreach($member_srls as $v)
|
||||
{
|
||||
$obj = new stdClass;
|
||||
$obj->point = $this->getPoint($v);
|
||||
$obj->level = $this->getLevel($obj->point, $config->level_step);
|
||||
$obj->member_srl = $v;
|
||||
$info[] = $obj;
|
||||
}
|
||||
|
||||
$this->add('point_info',$info);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get a list of points members list
|
||||
*/
|
||||
function getMemberList($args = null, $columnList = array())
|
||||
{
|
||||
// Arrange the search options
|
||||
$args->is_admin = Context::get('is_admin')=='Y'?'Y':'';
|
||||
$args->is_denied = Context::get('is_denied')=='Y'?'Y':'';
|
||||
$args->selected_group_srl = Context::get('selected_group_srl');
|
||||
|
||||
$search_target = trim(Context::get('search_target'));
|
||||
$search_keyword = trim(Context::get('search_keyword'));
|
||||
|
||||
// if search keyword is emtpy, show all list
|
||||
if(!$search_keyword)
|
||||
{
|
||||
unset($args->is_admin, $args->is_denied, $args->selected_group_srl, $search_target);
|
||||
}
|
||||
|
||||
if($search_target && $search_keyword)
|
||||
{
|
||||
switch($search_target)
|
||||
{
|
||||
case 'user_id' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_user_id = $search_keyword;
|
||||
break;
|
||||
case 'user_name' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_user_name = $search_keyword;
|
||||
break;
|
||||
case 'nick_name' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_nick_name = $search_keyword;
|
||||
break;
|
||||
case 'email_address' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_email_address = $search_keyword;
|
||||
break;
|
||||
case 'regdate' :
|
||||
$args->s_regdate = $search_keyword;
|
||||
break;
|
||||
case 'last_login' :
|
||||
$args->s_last_login = $search_keyword;
|
||||
break;
|
||||
case 'extra_vars' :
|
||||
$args->s_extra_vars = $search_keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If there is a selected_group_srl, change the "query id" (for table join)
|
||||
if($args->selected_group_srl)
|
||||
{
|
||||
$query_id = 'point.getMemberListWithinGroup';
|
||||
}
|
||||
else
|
||||
{
|
||||
$query_id = 'point.getMemberList';
|
||||
}
|
||||
|
||||
$output = executeQuery($query_id, $args, $columnList);
|
||||
|
||||
if($output->total_count)
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
$info = array();
|
||||
foreach($member_srls as $v)
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
$obj = new stdClass;
|
||||
$obj->point = $this->getPoint($v);
|
||||
$obj->level = $this->getLevel($obj->point, $config->level_step);
|
||||
$obj->member_srl = $v;
|
||||
$info[] = $obj;
|
||||
$output->data[$key]->level = $this->getLevel($val->point, $config->level_step);
|
||||
}
|
||||
|
||||
$this->add('point_info',$info);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get a list of points members list
|
||||
**/
|
||||
function getMemberList($args = null, $columnList = array()) {
|
||||
// Arrange the search options
|
||||
$args->is_admin = Context::get('is_admin')=='Y'?'Y':'';
|
||||
$args->is_denied = Context::get('is_denied')=='Y'?'Y':'';
|
||||
$args->selected_group_srl = Context::get('selected_group_srl');
|
||||
|
||||
$search_target = trim(Context::get('search_target'));
|
||||
$search_keyword = trim(Context::get('search_keyword'));
|
||||
|
||||
if($search_target && $search_keyword) {
|
||||
switch($search_target) {
|
||||
case 'user_id' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_user_id = $search_keyword;
|
||||
break;
|
||||
case 'user_name' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_user_name = $search_keyword;
|
||||
break;
|
||||
case 'nick_name' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_nick_name = $search_keyword;
|
||||
break;
|
||||
case 'email_address' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_email_address = $search_keyword;
|
||||
break;
|
||||
case 'regdate' :
|
||||
$args->s_regdate = $search_keyword;
|
||||
break;
|
||||
case 'last_login' :
|
||||
$args->s_last_login = $search_keyword;
|
||||
break;
|
||||
case 'extra_vars' :
|
||||
$args->s_extra_vars = $search_keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// If there is a selected_group_srl, change the "query id" (for table join)
|
||||
if($args->selected_group_srl) {
|
||||
$query_id = 'point.getMemberListWithinGroup';
|
||||
} else {
|
||||
$query_id = 'point.getMemberList';
|
||||
}
|
||||
|
||||
$output = executeQuery($query_id, $args, $columnList);
|
||||
|
||||
if($output->total_count) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
foreach($output->data as $key => $val) {
|
||||
$output->data[$key]->level = $this->getLevel($val->point, $config->level_step);
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
/* End of file point.model.php */
|
||||
/* Location: ./modules/point/point.model.php */
|
||||
|
|
|
|||
|
|
@ -1,60 +1,65 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pointView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The view class of the point module
|
||||
*
|
||||
* POINT 2.0 format document output
|
||||
*
|
||||
**/
|
||||
/**
|
||||
* @class pointView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief The view class of the point module
|
||||
*
|
||||
* POINT 2.0 format document output
|
||||
*
|
||||
*/
|
||||
class pointView extends point
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
class pointView extends point {
|
||||
/**
|
||||
* @brief Additional configurations for a service module
|
||||
* Receive the form for the form used by point
|
||||
*/
|
||||
function triggerDispPointAdditionSetup(&$obj)
|
||||
{
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
if(!$current_module_srl && !$current_module_srls)
|
||||
{
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new Object();
|
||||
}
|
||||
// Get the configuration information
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
/**
|
||||
* @brief Additional configurations for a service module
|
||||
* Receive the form for the form used by point
|
||||
**/
|
||||
function triggerDispPointAdditionSetup(&$obj) {
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
if($current_module_srl)
|
||||
{
|
||||
$module_config = $oModuleModel->getModulePartConfig('point', $current_module_srl);
|
||||
if(!$module_config)
|
||||
{
|
||||
$module_config['insert_document'] = $config->insert_document;
|
||||
$module_config['insert_comment'] = $config->insert_comment;
|
||||
$module_config['upload_file'] = $config->upload_file;
|
||||
$module_config['download_file'] = $config->download_file;
|
||||
$module_config['read_document'] = $config->read_document;
|
||||
$module_config['voted'] = $config->voted;
|
||||
$module_config['blamed'] = $config->blamed;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$current_module_srl && !$current_module_srls) {
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new Object();
|
||||
}
|
||||
// Get the configuration information
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_config['module_srl'] = $current_module_srl;
|
||||
$module_config['point_name'] = $config->point_name;
|
||||
Context::set('module_config', $module_config);
|
||||
// Set the template file
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'point_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
if($current_module_srl) {
|
||||
$module_config = $oModuleModel->getModulePartConfig('point', $current_module_srl);
|
||||
if(!$module_config) {
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
$module_config['insert_document'] = $config->insert_document;
|
||||
$module_config['insert_comment'] = $config->insert_comment;
|
||||
$module_config['upload_file'] = $config->upload_file;
|
||||
$module_config['download_file'] = $config->download_file;
|
||||
$module_config['read_document'] = $config->read_document;
|
||||
$module_config['voted'] = $config->voted;
|
||||
$module_config['blamed'] = $config->blamed;
|
||||
}
|
||||
}
|
||||
|
||||
$module_config['module_srl'] = $current_module_srl;
|
||||
$module_config['point_name'] = $config->point_name;
|
||||
Context::set('module_config', $module_config);
|
||||
// Set the template file
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'point_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
/* End of file point.view.php */
|
||||
/* Location: ./modules/point/point.view.php */
|
||||
|
|
|
|||
|
|
@ -1,183 +1,168 @@
|
|||
<!--#include("./header.html")-->
|
||||
<p>{$lang->about_point_module}</p>
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/point/tpl/config/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<form ruleset="insertConfig" action="./" method="post" class="form">
|
||||
<form ruleset="insertConfig" action="./" method="post" class="x_form-horizontal">
|
||||
<input type="hidden" name="module" value="point" />
|
||||
<input type="hidden" name="act" value="procPointAdminInsertConfig" />
|
||||
<fieldset>
|
||||
<h2 class="h2">{$lang->is_default}</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<p class="q"><label for="max_level">{$lang->max_level}</label></p>
|
||||
<p class="a">
|
||||
<input type="text" value="{$config->max_level}" name="max_level" id="max_level" style="width:30px" />
|
||||
<span class="desc">{$lang->about_max_level}</span>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q"><label for="point_name">{$lang->point_name}</label></p>
|
||||
<p class="a">
|
||||
<input type="text" value="{$config->point_name}" name="point_name" id="point_name" style="width:30px" />
|
||||
<span class="desc">{$lang->about_point_name}</span>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q"><label>{$lang->give_point}</label></p>
|
||||
<p class="a">
|
||||
<input type="text" value="{$config->signup_point}" name="signup_point" id="signup_point" style="width:30px" /> :
|
||||
<label for="signup_point">{$lang->point_signup}</label>
|
||||
<br />
|
||||
<input type="text" value="{$config->login_point}" name="login_point" id="login_point" style="width:30px" /> :
|
||||
<label for="login_point">{$lang->cmd_login}</label>
|
||||
<br />
|
||||
<input type="text" name="insert_document" value="{$config->insert_document}" id="insert_document" style="width:30px" /> :
|
||||
<label for="insert_document">{$lang->point_insert_document}</label>
|
||||
<br />
|
||||
<input type="text" name="insert_comment" value="{$config->insert_comment}" id="insert_comment" style="width:30px" /> :
|
||||
<label for="insert_comment">{$lang->point_insert_comment}</label>
|
||||
<br />
|
||||
<input type="text" name="upload_file" value="{$config->upload_file}" id="upload_file" style="width:30px" /> :
|
||||
<label for="upload_file">{$lang->point_upload_file}</label>
|
||||
<br />
|
||||
<input type="text" name="download_file" value="{$config->download_file}" id="download_file" style="width:30px" /> :
|
||||
<label for="download_file">{$lang->point_download_file}</label>
|
||||
<br />
|
||||
<input type="text" name="read_document" value="{$config->read_document}" id="read_document" style="width:30px" /> :
|
||||
<label for="read_document">{$lang->point_read_document}</label>
|
||||
<br />
|
||||
<input type="text" name="voted" value="{$config->voted}" style="width:30px" id="voted" /> :
|
||||
<label for="voted">{$lang->point_voted}</label>
|
||||
<br />
|
||||
<input type="text" name="blamed" value="{$config->blamed}" id="blamed" style="width:30px" /> :
|
||||
<label for="blamed">{$lang->point_blamed}</label>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q"><label for="level_icon">{$lang->level_icon}</label></p>
|
||||
<p class="a">
|
||||
<select name="level_icon" id="level_icon">
|
||||
<!--@foreach($level_icon_list as $key => $val)-->
|
||||
<option value="{$val}" selected="selected"|cond="$config->level_icon == $val">{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<span class="desc">{$lang->about_level_icon}</span>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q"><label for="disable_download">{$lang->disable_download}</label></p>
|
||||
<p class="a">
|
||||
<input type="checkbox" name="disable_download" id="disable_download" value="Y" checked="checked"|cond="$config->disable_download=='Y'" />
|
||||
<span class="desc">{$lang->about_disable_download}</span>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q"><label for="disable_read_document">{$lang->disable_read_document}</label></p>
|
||||
<p class="a">
|
||||
<input type="checkbox" name="disable_read_document" id="disable_read_document" value="Y" checked="checked"|cond="$config->disable_read_document=='Y'" />
|
||||
<span class="desc">{$lang->about_disable_read_document}</span>
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="btnArea">
|
||||
<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
<input type="hidden" name="xe_validator_id" value="modules/point/tpl/config/1" />
|
||||
<section class="section">
|
||||
<h1>{$lang->is_default}</h1>
|
||||
<div class="x_control-group">
|
||||
<label for="max_level" class="x_control-label">{$lang->max_level}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="0" max="1000" value="{$config->max_level}" name="max_level" id="max_level" />
|
||||
{$lang->about_max_level}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<h2 class="h2">{$lang->point_link_group}</h2>
|
||||
<div class="table even">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<caption>
|
||||
{$lang->about_point_link_group}
|
||||
<span class="side">
|
||||
<input type="radio" name="group_reset" id="group_reset_y" value="Y" checked="checked"|cond="$config->group_reset != 'N'" />
|
||||
<label for="group_reset_y">{$lang->point_group_reset_and_add}</label>
|
||||
<input type="radio" name="group_reset" id="group_reset_n" value="N" checked="checked"|cond="$config->group_reset == 'N'" />
|
||||
<label for="group_reset_n">{$lang->point_group_add_only}</label>
|
||||
</span>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{$lang->member_group}</th>
|
||||
<th>{$lang->level}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$group_list => $key,$val">
|
||||
<td><label for="point_group_{$key}">{$val->title}</label></td>
|
||||
<td cond="$val->is_default != 'Y'"><input type="text" value="{$config->point_group[$key]}" name="point_group_{$key}" id="point_group_{$key}" style="width:30px" /></td>
|
||||
<td cond="$val->is_default == 'Y'"><span>{$lang->default_group}</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="x_control-group">
|
||||
<label for="point_name" class="x_control-label">{$lang->point_name}</label>
|
||||
<div class="x_controls">
|
||||
<input type="text" value="{$config->point_name}" name="point_name" id="point_name" style="width:50px" />
|
||||
{$lang->about_point_name}
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->give_point}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" value="{$config->signup_point}" name="signup_point" id="signup_point" style="text-align:right" /> :
|
||||
<label for="signup_point" class="x_inline">{$lang->point_signup}</label>
|
||||
<br />
|
||||
<input type="number" value="{$config->login_point}" name="login_point" id="login_point" style="text-align:right" /> :
|
||||
<label for="login_point" class="x_inline">{$lang->cmd_login}</label>
|
||||
<br />
|
||||
<input type="number" name="insert_document" value="{$config->insert_document}" id="insert_document" style="text-align:right" /> :
|
||||
<label for="insert_document" class="x_inline">{$lang->point_insert_document}</label>
|
||||
<br />
|
||||
<input type="number" name="insert_comment" value="{$config->insert_comment}" id="insert_comment" style="text-align:right" /> :
|
||||
<label for="insert_comment" class="x_inline">{$lang->point_insert_comment}</label>
|
||||
<br />
|
||||
<input type="number" name="upload_file" value="{$config->upload_file}" id="upload_file" style="text-align:right" /> :
|
||||
<label for="upload_file" class="x_inline">{$lang->point_upload_file}</label>
|
||||
<br />
|
||||
<input type="number" name="download_file" value="{$config->download_file}" id="download_file" style="text-align:right" /> :
|
||||
<label for="download_file" class="x_inline">{$lang->point_download_file}</label>
|
||||
<br />
|
||||
<input type="number" name="read_document" value="{$config->read_document}" id="read_document" style="text-align:right" /> :
|
||||
<label for="read_document" class="x_inline">{$lang->point_read_document}</label>
|
||||
<br />
|
||||
<input type="number" name="voted" value="{$config->voted}" style="text-align:right" id="voted" /> :
|
||||
<label for="voted" class="x_inline">{$lang->point_voted}</label>
|
||||
<br />
|
||||
<input type="number" name="blamed" value="{$config->blamed}" id="blamed" style="text-align:right" /> :
|
||||
<label for="blamed" class="x_inline">{$lang->point_blamed}</label>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<div class="x_control-group">
|
||||
<label for="level_icon" class="x_control-label">{$lang->level_icon}</label>
|
||||
<div class="x_controls">
|
||||
<select name="level_icon" id="level_icon">
|
||||
<!--@foreach($level_icon_list as $key => $val)-->
|
||||
<option value="{$val}" selected="selected"|cond="$config->level_icon == $val">{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<span class="x_help-inline">{$lang->about_level_icon}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="disable_download" class="x_control-label">{$lang->disable_download}</label>
|
||||
<div class="x_controls" style="padding-top:3px">
|
||||
<input type="checkbox" name="disable_download" id="disable_download" value="Y" checked="checked"|cond="$config->disable_download=='Y'" />
|
||||
{$lang->about_disable_download}
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="disable_read_document" class="x_control-label">{$lang->disable_read_document}</label>
|
||||
<div class="x_controls" style="padding-top:3px">
|
||||
<input type="checkbox" name="disable_read_document" id="disable_read_document" value="Y" checked="checked"|cond="$config->disable_read_document=='Y'" />
|
||||
{$lang->about_disable_read_document}
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_clearfix btnArea">
|
||||
<span class="x_pull-right"><input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_save}" /></span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<h1>{$lang->point_link_group}</h1>
|
||||
<div class="x_clearfix" style="margin-bottom:-10px">
|
||||
<p class="x_pull-left">{$lang->about_point_link_group}</p>
|
||||
<div class="x_pull-right">
|
||||
<label for="group_reset_y" class="x_inline"><input type="radio" name="group_reset" id="group_reset_y" value="Y" checked="checked"|cond="$config->group_reset != 'N'" /> {$lang->point_group_reset_and_add}</label>
|
||||
<label for="group_reset_n" class="x_inline"><input type="radio" name="group_reset" id="group_reset_n" value="N" checked="checked"|cond="$config->group_reset == 'N'" /> {$lang->point_group_add_only}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group" loop="$group_list => $key,$val">
|
||||
<label class="x_control-label" for="point_group_{$key}">{$val->title}</label>
|
||||
<div class="x_controls">
|
||||
<input cond="$val->is_default != 'Y'" type="number" min="0" max="1000" value="{$config->point_group[$key]}" name="point_group_{$key}" id="point_group_{$key}" style="width:50px" />
|
||||
<span cond="$val->is_default == 'Y'" style="display:inline-block;padding-top:3px">{$lang->default_group}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_clearfix btnArea">
|
||||
<span class="x_pull-right"><input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_save}" /></span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
{@$point_group = @array_flip($config->point_group)}
|
||||
<h2 class="h2">{$lang->level_point}</h2>
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<caption>
|
||||
<span class="side">
|
||||
<label for="">{$lang->expression}</label>
|
||||
<input value="{$config->expression}" size="30" class="level_expression" />
|
||||
<button type="button" class="calc_point">{$lang->level_point_calc}</button>
|
||||
<button type="button" class="calc_point _reset">{$lang->cmd_exp_reset}</button>
|
||||
</span>
|
||||
</caption>
|
||||
<tr>
|
||||
<th scope="col">{$lang->level}</th>
|
||||
<th scope="col">{$lang->level_icon}</th>
|
||||
<th scope="col">{$lang->point}</th>
|
||||
<th scope="col">{$lang->member_group}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td><img src="{getUrl()}/modules/point/icons/{$config->level_icon}/1.gif" alt="" /></td>
|
||||
<td><input type="text" name="level_step_1" value="{$config->level_step[1]}" style="width:40px;text-align:right" /> {$config->point_name}</td>
|
||||
<h1>{$lang->level_point}</h1>
|
||||
<div class="x_clearfix">
|
||||
<p class="x_pull-left">{$lang->expression}</p>
|
||||
<span class="x_pull-right x_input-append">
|
||||
<input type="text" value="{$config->expression}" placeholder="Math.pow(i,2) * 90" size="30" class="level_expression" />
|
||||
<button type="button" class="x_btn calc_point">{$lang->level_point_calc}</button>
|
||||
<button type="button" class="x_btn calc_point _reset">{$lang->cmd_exp_reset}</button>
|
||||
</span>
|
||||
</div>
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
<tr>
|
||||
<th scope="col">{$lang->level}</th>
|
||||
<th scope="col">{$lang->level_icon}</th>
|
||||
<th scope="col">{$lang->point}</th>
|
||||
<th scope="col">{$lang->member_group}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td><img src="{getUrl()}/modules/point/icons/{$config->level_icon}/1.gif" alt="1" /></td>
|
||||
<td><label for="level_step_1" style="margin:0"><input type="number" id="level_step_1" name="level_step_1" value="{$config->level_step[1]}" style="width:60px;text-align:right" /> {$config->point_name}</label></td>
|
||||
{@$point_group_item = $point_group[1]}
|
||||
{@$title=array()}
|
||||
<!--@if($point_group_item)-->
|
||||
<!--@if($config->group_reset != 'N')-->
|
||||
{@$title[0] = $group_list[$point_group_item.'']->title}
|
||||
<!--@else-->
|
||||
{@$title[] = $group_list[$point_group_item.'']->title}
|
||||
<!--@end-->
|
||||
<!--@if($config->group_reset != 'N')-->
|
||||
{@$title[0] = $group_list[$point_group_item.'']->title}
|
||||
<!--@else-->
|
||||
{@$title[] = $group_list[$point_group_item.'']->title}
|
||||
<!--@end-->
|
||||
<td>{implode(', ', $title)}</td>
|
||||
</tr>
|
||||
<!--@for($i=2;$i<=$config->max_level;$i++)-->
|
||||
<!--@end-->
|
||||
<td>{implode(', ', $title)}</td>
|
||||
</tr>
|
||||
<!--@for($i=2;$i<=$config->max_level;$i++)-->
|
||||
{@$point_group_item = $point_group[$i]}
|
||||
<!--@if($point_group_item)-->
|
||||
<!--@if($config->group_reset != 'N')-->
|
||||
{@$title[0] = $group_list[$point_group_item.'']->title}
|
||||
<!--@else-->
|
||||
{@$title[] = $group_list[$point_group_item.'']->title}
|
||||
<!--@end-->
|
||||
<!--@if($config->group_reset != 'N')-->
|
||||
{@$title[0] = $group_list[$point_group_item.'']->title}
|
||||
<!--@else-->
|
||||
{@$title[] = $group_list[$point_group_item.'']->title}
|
||||
<!--@end-->
|
||||
<tr class="row{(($i-1)%2+1)}">
|
||||
<td>{$i}</td>
|
||||
<td><img src="{getUrl()}/modules/point/icons/{$config->level_icon}/{$i}.gif" alt="" /></td>
|
||||
<td><input type="text" id="level_step_{$i}" name="level_step_{$i}" value="{$config->level_step[$i]}" style="width:40px;text-align:right" /> {$config->point_name}</td>
|
||||
<td>{implode(', ', $title)}</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</table>
|
||||
<!--@end-->
|
||||
<tr class="row{(($i-1)%2+1)}">
|
||||
<td>{$i}</td>
|
||||
<td><img src="{getUrl()}/modules/point/icons/{$config->level_icon}/{$i}.gif" alt="{$i}" /></td>
|
||||
<td><label for="level_step_{$i}" style="margin:0"><input type="number" id="level_step_{$i}" name="level_step_{$i}" value="{$config->level_step[$i]}" style="width:60px;text-align:right" /> {$config->point_name}</label></td>
|
||||
<td>{implode(', ', $title)}</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</table>
|
||||
<div class="x_clearfix">
|
||||
<span class="x_pull-right"><input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_save}" /></span>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<h2 class="h2">{$lang->cmd_point_recal}</h2>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<h1>{$lang->cmd_point_recal}</h1>
|
||||
<p><input class="x_btn x_btn-warning" type="button" value="{$lang->cmd_point_recal}" onclick="doPointRecal()" /></p>
|
||||
<p>{$lang->about_cmd_point_recal}</p>
|
||||
<p id="pointReCal"></p>
|
||||
<div class="btnArea">
|
||||
<span class="btn medium"><input type="button" value="{$lang->cmd_point_recal}" onclick="doPointRecal(); return false;"/></span>
|
||||
</div>
|
||||
</fieldset>
|
||||
</section>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
<load target="js/point_admin.js" usecdn="true" />
|
||||
<h1 class="h1">{$lang->point} {$lang->cmd_management}</h1>
|
||||
<!--@if($module=='admin')-->
|
||||
<div class="cnb">
|
||||
<ul>
|
||||
<li <!--@if($act=='dispPointAdminConfig')-->class="active"<!--@end-->><a href="{getUrl('act','dispPointAdminConfig')}">{$lang->cmd_point_config}</a></li>
|
||||
<li <!--@if($act=='dispPointAdminModuleConfig')-->class="active"<!--@end-->><a href="{getUrl('act','dispPointAdminModuleConfig')}">{$lang->cmd_point_module_config}</a></li>
|
||||
<li <!--@if($act=='dispPointAdminPointList')-->class="active"<!--@end-->><a href="{getUrl('act','dispPointAdminPointList')}">{$lang->cmd_point_member_list}</a></li>
|
||||
</ul>
|
||||
<div class="x_page-header">
|
||||
<h1>{$lang->point} {$lang->cmd_management} <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_member_point" target="_blank">{$lang->help}</a></h1>
|
||||
</div>
|
||||
<!--@end-->
|
||||
<ul class="x_nav x_nav-tabs" cond="$module=='admin'">
|
||||
<li class="x_active"|cond="$act=='dispPointAdminConfig'"><a href="{getUrl('act','dispPointAdminConfig')}">{$lang->cmd_point_config}</a></li>
|
||||
<li class="x_active"|cond="$act=='dispPointAdminModuleConfig'"><a href="{getUrl('act','dispPointAdminModuleConfig')}">{$lang->cmd_point_module_config}</a></li>
|
||||
<li class="x_active"|cond="$act=='dispPointAdminPointList'"><a href="{getUrl('act','dispPointAdminPointList')}">{$lang->cmd_point_member_list}</a></li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ function doPointReset(module_srls) {
|
|||
'point',
|
||||
'procPointAdminReset',
|
||||
{module_srls : module_srls},
|
||||
function(ret_obj){alert(ret_obj['message']);},
|
||||
function(ret_obj){document.location.reload();},
|
||||
['error','message']
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,127 +1,146 @@
|
|||
<!--#include("header.html")-->
|
||||
<include target="header.html" />
|
||||
<load target="js/point_admin.js" usecdn="true" />
|
||||
<p>{$lang->about_point_module} {$lang->point_update_desc}</p>
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/point/tpl/member_list/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<!-- 검색 -->
|
||||
<form action="./" method="get" class="adminSearch" no-error-return-url="true">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<p>{$lang->about_point_module} {$lang->point_update_desc}</p>
|
||||
<!-- SEARCH -->
|
||||
|
||||
<fieldset>
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
<caption>
|
||||
<strong>Total: {number_format($total_count)}, Page: {number_format($page)}/{number_format($total_page)}</strong>
|
||||
<form action="./" method="get" no-error-return-url="true" class="x_pull-right"style="margin:0;height:26px">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<fieldset>
|
||||
<select name="is_admin" style="width:auto;margin:0">
|
||||
<option value="" selected="selected"|cond="$is_admin!='Y'">{$lang->total}</option>
|
||||
<option value="Y" selected="selected"|cond="$is_admin=='Y'">{$lang->is_admin}</option>
|
||||
</select>
|
||||
<select name="selected_group_srl" style="width:auto;margin:0" title="{$lang->member_group}">
|
||||
<option value="0">{$lang->member_group}</option>
|
||||
<option loop="$group_list => $key,$val" value="{$val->group_srl}" selected="selected"|cond="$selected_group_srl==$val->group_srl">{$val->title}</option>
|
||||
</select>
|
||||
<select name="search_target" style="width:auto;margin:0" title="{$lang->search_target}">
|
||||
<option value="{$identifier}" selected="selected"|cond="$search_target == $identifier">{Context::getLang($identifier)}</option>
|
||||
<option loop="$lang->search_target_list => $key,$val" value="{$key}" selected="selected"|cond="$search_target==$key">{$val}</option>
|
||||
</select>
|
||||
<span class="x_input-append">
|
||||
<input type="search" required name="search_keyword" required value="{htmlspecialchars($search_keyword)}" title="{$lang->cmd_search}" style="width:100px" />
|
||||
<button type="submit" class="x_btn x_btn-inverse">{$lang->cmd_search}</button>
|
||||
<a href="{getUrl('','module',$module,'act',$act)}" class="x_btn">{$lang->cmd_cancel}</a>
|
||||
</span>
|
||||
</fieldset>
|
||||
</form>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->no}</th>
|
||||
<th scope="col">{Context::getLang($identifier)}</th>
|
||||
<th scope="col">{$lang->nick_name}</th>
|
||||
<th scope="col">{$lang->point}</th>
|
||||
<th scope="col">{$lang->level}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$member_list => $no,$val">
|
||||
<td>{$no}</td>
|
||||
<td cond="$identifier == 'user_id'">{$val->user_id}</td>
|
||||
<td cond="$identifier != 'user_id'">{$val->email_address}</td>
|
||||
<td><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a></td>
|
||||
<td>
|
||||
<form action="./" method="get" style="margin:0">
|
||||
<input type="hidden" name="module" value="point" />
|
||||
<input type="hidden" name="member_srl" value="{$val->member_srl}" />
|
||||
<input type="hidden" name="xe_validator_id" value="modules/point/tpl/member_list/1" />
|
||||
<input type="text" name="orgpoint" value="{$val->point}" disabled="disabled" style="width:40px;text-align:right" />
|
||||
->
|
||||
<span class="x_input-append">
|
||||
<input type="number" id="point_{$val->member_srl}" value="{$val->point}" name="point" required style="width:60px;text-align:right" />
|
||||
<input type="button" value="{$lang->cmd_update}" onclick="updatePoint({$val->member_srl})" class="x_btn" />
|
||||
</span>
|
||||
</form>
|
||||
</td>
|
||||
<td>{$val->level}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<select name="is_admin">
|
||||
<option value="" <!--@if($is_admin!='Y')-->selected="selected"<!--@end-->>{$lang->total}</option>
|
||||
<option value="Y" <!--@if($is_admin=='Y')-->selected="selected"<!--@end-->>{$lang->is_admin}</option>
|
||||
</select>
|
||||
<select name="is_denied">
|
||||
<option value="" <!--@if($is_denied!='Y')-->selected="selected"<!--@end-->>{$lang->total}</option>
|
||||
<option value="Y" <!--@if($is_denied=='Y')-->selected="selected"<!--@end-->>{$lang->denied}</option>
|
||||
</select>
|
||||
<select name="selected_group_srl">
|
||||
<option value="0">{$lang->member_group}</option>
|
||||
<!--@foreach($group_list as $key => $val)-->
|
||||
<option value="{$val->group_srl}" <!--@if($selected_group_srl==$val->group_srl)-->selected="selected"<!--@end-->>{$val->title}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<select name="search_target">
|
||||
<option value="">{$lang->search_target}</option>
|
||||
<option value="{$identifier}" selected="selected"|cond="$search_target == $identifier">{Context::getLang($identifier)}</option>
|
||||
<!--@foreach($lang->search_target_list as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
|
||||
<span class="btn"><input type="submit" value="{$lang->cmd_search}" /></span>
|
||||
<span class="btn"><button type="button" onclick="location.href='{getUrl('','module',$module,'act',$act)}';return false;">{$lang->cmd_cancel}</button></span>
|
||||
</fieldset>
|
||||
</form>
|
||||
<div class="table form">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<caption>Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->no}</th>
|
||||
<th scope="col">{Context::getLang($identifier)}</th>
|
||||
<th scope="col">{$lang->nick_name}</th>
|
||||
<th scope="col">{$lang->point}</th>
|
||||
<th scope="col">{$lang->level}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--@foreach($member_list as $no => $val)-->
|
||||
<tr>
|
||||
<td>{$no}</td>
|
||||
<td cond="$identifier == 'user_id'">{$val->user_id}</td>
|
||||
<td cond="$identifier != 'user_id'">{$val->email_address}</td>
|
||||
<td><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a></td>
|
||||
<td>
|
||||
<form action="./" method="get">
|
||||
<input type="hidden" name="module" value="point" />
|
||||
<input type="hidden" name="member_srl" value="{$val->member_srl}" />
|
||||
<input type="text" name="orgpoint" value="{$val->point}" disabled="disabled" style="width:40px;text-align:right" />
|
||||
<input type="text" id="point_{$val->member_srl}" name="point" style="width:40px;text-align:right" />
|
||||
<input type="button" value="{$lang->cmd_update}" onclick="updatePoint({$val->member_srl})" class="text" />
|
||||
</form>
|
||||
</td>
|
||||
<td>{$val->level}</td>
|
||||
</tr>
|
||||
<div class="x_clearfix">
|
||||
<!-- PAGINATION -->
|
||||
<form cond="$page_navigation" action="./" class="x_pagination x_pull-left" no-error-return-url="true" style="margin:0">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input cond="$is_admin" type="hidden" name="is_admin" value="{$is_admin}" />
|
||||
<input cond="$is_denied" type="hidden" name="is_denied" value="{$is_denied}" />
|
||||
<input cond="$selected_group_srl" type="hidden" name="selected_group_srl" value="{$selected_group_srl}" />
|
||||
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
|
||||
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
|
||||
<ul>
|
||||
<li class="x_disabled"|cond="!$page || $page == 1"><a href="{getUrl('page', '')}">« {$lang->first_page}</a></li>
|
||||
|
||||
<block cond="$page_navigation->first_page != 1 && $page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page - 1 && $page_navigation->page_count != $page_navigation->total_page">
|
||||
{@$isGoTo = true}
|
||||
<li>
|
||||
<a href="#goTo" data-toggle title="{$lang->cmd_go_to_page}">…</a>
|
||||
<span cond="$isGoTo" id="goTo" class="x_input-append">
|
||||
<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
|
||||
<button type="submit" class="x_add-on">Go</button>
|
||||
</span>
|
||||
</li>
|
||||
</block>
|
||||
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
{@$last_page = $page_no}
|
||||
<li class="x_active"|cond="$page_no == $page"><a href="{getUrl('page', $page_no)}">{$page_no}</a></li>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<block cond="$last_page != $page_navigation->last_page && $last_page + 1 != $page_navigation->last_page">
|
||||
{@$isGoTo = true}
|
||||
<li>
|
||||
<a href="#goTo" data-toggle title="{$lang->cmd_go_to_page}">…</a>
|
||||
<span cond="$isGoTo" id="goTo" class="x_input-append">
|
||||
<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
|
||||
<button type="submit" class="x_add-on">Go</button>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
</block>
|
||||
|
||||
<li class="x_disabled"|cond="$page == $page_navigation->last_page"><a href="{getUrl('page', $page_navigation->last_page)}" title="{$page_navigation->last_page}">{$lang->last_page} »</a></li>
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
<!-- SEARCH -->
|
||||
<form action="./" method="get" no-error-return-url="true" class="x_clearfix x_pull-right" style="margin:0">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<fieldset>
|
||||
<select name="is_admin" style="width:auto;margin:0">
|
||||
<option value="" selected="selected"|cond="$is_admin!='Y'">{$lang->total}</option>
|
||||
<option value="Y" selected="selected"|cond="$is_admin=='Y'">{$lang->is_admin}</option>
|
||||
</select>
|
||||
<select name="selected_group_srl" style="width:auto;margin:0" title="{$lang->member_group}">
|
||||
<option loop="$group_list => $key,$val" value="{$val->group_srl}" selected="selected"|cond="$selected_group_srl==$val->group_srl">{$val->title}</option>
|
||||
</select>
|
||||
<select name="search_target" style="width:auto;margin:0" title="{$lang->search_target}">
|
||||
<option value="{$identifier}" selected="selected"|cond="$search_target == $identifier">{Context::getLang($identifier)}</option>
|
||||
<option loop="$lang->search_target_list => $key,$val" value="{$key}" selected="selected"|cond="$search_target==$key">{$val}</option>
|
||||
</select>
|
||||
<span class="x_input-append">
|
||||
<input type="search" name="search_keyword" required value="{htmlspecialchars($search_keyword)}" title="{$lang->cmd_search}" style="width:100px" />
|
||||
<button type="submit" class="x_btn x_btn-inverse">{$lang->cmd_search}</button>
|
||||
<a href="{getUrl('','module',$module,'act',$act)}" class="x_btn">{$lang->cmd_cancel}</a>
|
||||
</span>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<form ruleset="updatePoint" id="updateForm" action="./" method="POST">
|
||||
<form ruleset="updatePoint" id="updateForm" action="./" method="POST" style="margin:0">
|
||||
<input type="hidden" name="module" value="point" />
|
||||
<input type="hidden" name="act" value="procPointAdminUpdatePoint" />
|
||||
<input type="hidden" id="update_member_srl" name="member_srl" value="" />
|
||||
<input type="hidden" id="update_point" name="point" />
|
||||
<input type="hidden" name="xe_validator_id" value="modules/point/tpl/member_list/1" />
|
||||
</form>
|
||||
|
||||
|
||||
<!-- 페이지 네비게이션 -->
|
||||
<div class="pagination">
|
||||
<a href="{getUrl('page','','module_srl','')}" class="direction">‹ {$lang->first_page}</a>
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
<!--@if($page == $page_no)-->
|
||||
<strong>{$page_no}</strong>
|
||||
<!--@else-->
|
||||
<a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
<a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="direction">{$lang->last_page} ›</a>
|
||||
</div>
|
||||
|
||||
<!-- 검색 -->
|
||||
<form action="./" method="get" class="adminSearch" no-error-return-url="true">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
|
||||
<fieldset>
|
||||
|
||||
<select name="is_admin">
|
||||
<option value="" <!--@if($is_admin!='Y')-->selected="selected"<!--@end-->>{$lang->total}</option>
|
||||
<option value="Y" <!--@if($is_admin=='Y')-->selected="selected"<!--@end-->>{$lang->is_admin}</option>
|
||||
</select>
|
||||
<select name="is_denied">
|
||||
<option value="" <!--@if($is_denied!='Y')-->selected="selected"<!--@end-->>{$lang->total}</option>
|
||||
<option value="Y" <!--@if($is_denied=='Y')-->selected="selected"<!--@end-->>{$lang->denied}</option>
|
||||
</select>
|
||||
<select name="selected_group_srl">
|
||||
<option value="0">{$lang->member_group}</option>
|
||||
<!--@foreach($group_list as $key => $val)-->
|
||||
<option value="{$val->group_srl}" <!--@if($selected_group_srl==$val->group_srl)-->selected="selected"<!--@end-->>{$val->title}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<select name="search_target">
|
||||
<option value="">{$lang->search_target}</option>
|
||||
<!--@foreach($lang->search_target_list as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
|
||||
<span class="btn"><input type="submit" value="{$lang->cmd_search}" /></span>
|
||||
<span class="btn"><button type="button" onclick="location.href='{getUrl('','module',$module,'act',$act)}';return false;">{$lang->cmd_cancel}</button></span>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,40 +1,39 @@
|
|||
<!--#include("./header.html")-->
|
||||
<p>{$lang->about_module_point}</p>
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/point/tpl/module_cofig/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<form action="./" method="post" id="fo_point" class="form">
|
||||
<p>{$lang->about_module_point}</p>
|
||||
<form action="./" method="post" id="fo_point">
|
||||
<input type="hidden" name="module" value="point" />
|
||||
<input type="hidden" name="act" value="procPointAdminInsertModuleConfig" />
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->module}</th>
|
||||
<th scope="col">{$lang->point_insert_document}</th>
|
||||
<th scope="col">{$lang->point_insert_comment}</th>
|
||||
<th scope="col">{$lang->point_upload_file}</th>
|
||||
<th scope="col">{$lang->point_download_file}</th>
|
||||
<th scope="col">{$lang->point_read_document}</th>
|
||||
<th scope="col">{$lang->point_voted}</th>
|
||||
<th scope="col">{$lang->point_blamed}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$mid_list => $key,$val">
|
||||
<th scope="row">{$val->browser_title}({$val->mid})</th>
|
||||
<td><input type="text" style="width:30px;text-align:right" name="insert_document_{$val->module_srl}" value="{$module_config[$val->module_srl]['insert_document']}" /> {$config->point_name}</td>
|
||||
<td><input type="text" style="width:30px;text-align:right" name="insert_comment_{$val->module_srl}" value="{$module_config[$val->module_srl]['insert_comment']}" /> {$config->point_name}</td>
|
||||
<td><input type="text" style="width:30px;text-align:right" name="upload_file_{$val->module_srl}" value="{$module_config[$val->module_srl]['upload_file']}" /> {$config->point_name}</td>
|
||||
<td><input type="text" style="width:30px;text-align:right" name="download_file_{$val->module_srl}" value="{$module_config[$val->module_srl]['download_file']}" /> {$config->point_name}</td>
|
||||
<td><input type="text" style="width:30px;text-align:right" name="read_document_{$val->module_srl}" value="{$module_config[$val->module_srl]['read_document']}" /> {$config->point_name}</td>
|
||||
<td><input type="text" style="width:30px;text-align:right" name="voted_{$val->module_srl}" value="{$module_config[$val->module_srl]['voted']}" /> {$config->point_name}</td>
|
||||
<td><input type="text" style="width:30px;text-align:right" name="blamed_{$val->module_srl}" value="{$module_config[$val->module_srl]['blamed']}" /> {$config->point_name}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<span class="btn medium"><input type="submit" value="{$lang->cmd_registration}" /></span>
|
||||
<input type="hidden" name="xe_validator_id" value="modules/point/tpl/module_cofig/1" />
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->module}</th>
|
||||
<th scope="col">{$lang->point_insert_document}</th>
|
||||
<th scope="col">{$lang->point_insert_comment}</th>
|
||||
<th scope="col">{$lang->point_upload_file}</th>
|
||||
<th scope="col">{$lang->point_download_file}</th>
|
||||
<th scope="col">{$lang->point_read_document}</th>
|
||||
<th scope="col">{$lang->point_voted}</th>
|
||||
<th scope="col">{$lang->point_blamed}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$mid_list => $key,$val">
|
||||
<th scope="row">{$val->browser_title}({$val->mid})</th>
|
||||
<td class="nowr"><input type="number" style="width:40px;text-align:right" name="insert_document[{$val->module_srl}]" value="{$module_config[$val->module_srl]['insert_document']}" title="{$config->point_name}" /> {$config->point_name}</td>
|
||||
<td class="nowr"><input type="number" style="width:40px;text-align:right" name="insert_comment[{$val->module_srl}]" value="{$module_config[$val->module_srl]['insert_comment']}" title="{$config->point_name}" /> {$config->point_name}</td>
|
||||
<td class="nowr"><input type="number" style="width:40px;text-align:right" name="upload_file[{$val->module_srl}]" value="{$module_config[$val->module_srl]['upload_file']}" title="{$config->point_name}" /> {$config->point_name}</td>
|
||||
<td class="nowr"><input type="number" style="width:40px;text-align:right" name="download_file[{$val->module_srl}]" value="{$module_config[$val->module_srl]['download_file']}" title="{$config->point_name}" /> {$config->point_name}</td>
|
||||
<td class="nowr"><input type="number" style="width:40px;text-align:right" name="read_document[{$val->module_srl}]" value="{$module_config[$val->module_srl]['read_document']}" title="{$config->point_name}" /> {$config->point_name}</td>
|
||||
<td class="nowr"><input type="number" style="width:40px;text-align:right" name="voted[{$val->module_srl}]" value="{$module_config[$val->module_srl]['voted']}" title="{$config->point_name}" /> {$config->point_name}</td>
|
||||
<td class="nowr"><input type="number" style="width:40px;text-align:right" name="blamed[{$val->module_srl}]" value="{$module_config[$val->module_srl]['blamed']}" title="{$config->point_name}" /> {$config->point_name}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="x_clearfix">
|
||||
<span class="x_pull-right"><input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_registration}" /></span>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,49 +1,60 @@
|
|||
<!--%import("filter/insert_point_module_config.xml")-->
|
||||
<load target="js/point_admin.js" usecdn="true" />
|
||||
<form action="./" method="post" id="fo_point" class="form">
|
||||
<input type="hidden" name="module" value="point" />
|
||||
<input type="hidden" name="act" value="procPointAdminInsertPointModuleConfig" />
|
||||
<input type="hidden" name="target_module_srl" value="{$module_config['module_srl']?$module_config['module_srl']:$module_srls}" />
|
||||
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
|
||||
|
||||
<h3 class="h3">{$lang->point}</h3>
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<tr>
|
||||
<th scope="row"><label for="insert_document">{$lang->point_insert_document}</label></th>
|
||||
<td class="text"><input type="text" name="insert_document" id="insert_document" value="{$module_config['insert_document']}" style="width:30px" /> {$module_config['point_name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="insert_comment">{$lang->point_insert_comment}</label></th>
|
||||
<td class="text"><input type="text" name="insert_comment" id="insert_comment" value="{$module_config['insert_comment']}" style="width:30px" /> {$module_config['point_name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="upload_file">{$lang->point_upload_file}</label></th>
|
||||
<td class="text"><input type="text" name="upload_file" id="upload_file" value="{$module_config['upload_file']}" style="width:30px" /> {$module_config['point_name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="download_file">{$lang->point_download_file}</label></th>
|
||||
<td class="text"><input type="text" name="download_file" id="download_file" value="{$module_config['download_file']}" style="width:30px" /> {$module_config['point_name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="read_document">{$lang->point_read_document}</label></th>
|
||||
<td class="text"><input type="text" name="read_document" id="read_document" value="{$module_config['read_document']}" style="width:30px" /> {$module_config['point_name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="voted">{$lang->point_voted}</label></th>
|
||||
<td class="text"><input type="text" name="voted" id="voted" value="{$module_config['voted']}" style="width:30px" /> {$module_config['point_name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="blamed">{$lang->point_blamed}</label></th>
|
||||
<td class="text"><input type="text" name="blamed" id="blamed" value="{$module_config['blamed']}" style="width:30px" /> {$module_config['point_name']}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<span class="btn"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
<span class="btn"><button type="button" onclick="doPointReset('{$module_config['module_srl']?$module_config['module_srl']:$module_srls}')">{$lang->cmd_reset}</button></span>
|
||||
</div>
|
||||
|
||||
<!-- 버튼 -->
|
||||
|
||||
</form>
|
||||
<section class="section">
|
||||
<h1>{$lang->point}</h1>
|
||||
|
||||
<form action="./" method="post" id="fo_point" class="x_form-horizontal">
|
||||
<input type="hidden" name="module" value="point" />
|
||||
<input type="hidden" name="act" value="procPointAdminInsertPointModuleConfig" />
|
||||
<input type="hidden" name="target_module_srl" value="{$module_config['module_srl']?$module_config['module_srl']:$module_srls}" />
|
||||
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
|
||||
|
||||
<div class="x_control-group">
|
||||
<label for="insert_document" class="x_control-label">{$lang->point_insert_document}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" name="insert_document" id="insert_document" value="{$module_config['insert_document']}" /> {$module_config['point_name']}
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="insert_comment" class="x_control-label">{$lang->point_insert_comment}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" name="insert_comment" id="insert_comment" value="{$module_config['insert_comment']}" /> {$module_config['point_name']}
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="upload_file" class="x_control-label">{$lang->point_upload_file}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" name="upload_file" id="upload_file" value="{$module_config['upload_file']}" /> {$module_config['point_name']}
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="download_file" class="x_control-label">{$lang->point_download_file}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" name="download_file" id="download_file" value="{$module_config['download_file']}" /> {$module_config['point_name']}
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="read_document" class="x_control-label">{$lang->point_read_document}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" name="read_document" id="read_document" value="{$module_config['read_document']}" /> {$module_config['point_name']}
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="voted" class="x_control-label">{$lang->point_voted}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" name="voted" id="voted" value="{$module_config['voted']}" /> {$module_config['point_name']}
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="blamed" class="x_control-label">{$lang->point_blamed}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" name="blamed" id="blamed" value="{$module_config['blamed']}" /> {$module_config['point_name']}
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_clearfix btnArea">
|
||||
<button class="x_btn x_btn-warning x_pull-left" type="button" onclick="doPointReset('{$module_config['module_srl']?$module_config['module_srl']:$module_srls}')">{$lang->cmd_reset}</button>
|
||||
<span class="x_pull-right">
|
||||
<input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_save}">
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue