mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
issue 70 super admin dashboard and site admin dashboard developement
yet site admin not completed git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8813 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
84888b172b
commit
59cab1cc60
13 changed files with 212 additions and 23 deletions
|
|
@ -46,7 +46,6 @@
|
|||
if($db_info->https_port) Context::set('https_port', $db_info->https_port);
|
||||
|
||||
$this->showSendEnv();
|
||||
|
||||
}
|
||||
|
||||
function makeGnbUrl($module = 'admin')
|
||||
|
|
@ -163,7 +162,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Display main administration page
|
||||
* @brief Display Super Admin Dashboard
|
||||
* @return none
|
||||
**/
|
||||
function dispAdminIndex() {
|
||||
|
|
@ -328,6 +327,7 @@
|
|||
$this->setTemplateFile('menu_setup');
|
||||
}
|
||||
|
||||
|
||||
function showSendEnv() {
|
||||
if(Context::getResponseMethod() != 'HTML') return;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
<!--#include("./_spHeader.html")-->
|
||||
<div class="content dashboard" id="content">
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<!--@if(!$isEnviromentGatheringAgreement)-->
|
||||
<form action="./" method="post" class="message info">
|
||||
<input type="hidden" name="act" value="procAdminEnviromentGatheringAgreement" />
|
||||
|
|
@ -42,11 +45,16 @@
|
|||
<!--@foreach($latestDocumentList AS $key=>$value)-->
|
||||
{@$document = $value->variables}
|
||||
<li>
|
||||
<a href="#" target="_blank">{$document['title']}</a> <span class="side">{$document['nick_name']}</span>
|
||||
<a href="{getUrl('', 'document_srl', $document['document_srl'])}" target="_blank">{$document['title']}</a> <span class="side">{$document['nick_name']}</span>
|
||||
<span class="action">
|
||||
<a href="#" target="_blank">Edit</a>
|
||||
<a href="#">Spam</a>
|
||||
<a href="#">Trash</a>
|
||||
<form>
|
||||
<input type="hidden" name="module" value="admin" />
|
||||
<input type="hidden" name="act" value="procDocumentManageCheckedDocument" />
|
||||
<input type="hidden" name="cart[]" value="{$document['document_srl']}" />
|
||||
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', 'admin')}" />
|
||||
<button type="submit" name="type" value="trash" class="text">{$lang->cmd_trash}</button>
|
||||
<button type="submit" name="type" value="delete" class="text">{$lang->cmd_delete}</button>
|
||||
</form>
|
||||
</span>
|
||||
</li>
|
||||
<!--@end-->
|
||||
|
|
@ -59,9 +67,14 @@
|
|||
<li>
|
||||
<a href="#" target="_blank">{$value->content}</a> <span class="side">{$value->nick_name}</span>
|
||||
<span class="action">
|
||||
<a href="#" target="_blank">Edit</a>
|
||||
<a href="#">Spam</a>
|
||||
<a href="#">Trash</a>
|
||||
<form>
|
||||
<input type="hidden" name="module" value="admin" />
|
||||
<input type="hidden" name="act" value="procCommentAdminDeleteChecked" />
|
||||
<input type="hidden" name="cart[]" value="{$value->comment_srl}" />
|
||||
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', 'admin')}" />
|
||||
<button type="submit" name="is_trash" value="true" class="text">{$lang->cmd_trash}</button>
|
||||
<button type="submit" name="is_trash" value="false" class="text">{$lang->cmd_delete}</button>
|
||||
</form>
|
||||
</span>
|
||||
</li>
|
||||
<!--@end-->
|
||||
|
|
@ -74,9 +87,13 @@
|
|||
<li>
|
||||
<a href="#" target="_blank">{$value->title}</a> <span class="side">{$value->blog_name}</span>
|
||||
<span class="action">
|
||||
<a href="#" target="_blank">Edit</a>
|
||||
<a href="#">Spam</a>
|
||||
<a href="#">Trash</a>
|
||||
<form>
|
||||
<input type="hidden" name="module" value="admin" />
|
||||
<input type="hidden" name="act" value="procTrackbackAdminDeleteChecked" />
|
||||
<input type="hidden" name="cart[]" value="{$value->trackback_srl}" />
|
||||
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', 'admin')}" />
|
||||
<button type="submit" class="text">{$lang->cmd_delete}</button>
|
||||
</form>
|
||||
</span>
|
||||
</li>
|
||||
<!--@end-->
|
||||
|
|
@ -93,9 +110,9 @@
|
|||
<div class="portlet">
|
||||
<h2 class="h2">Your Favorite</h2>
|
||||
<ul class="lined">
|
||||
<li><a href="#">Extensions</a> > <a href="#">Installed Module</a> > <a href="#">Board</a></li>
|
||||
<li><a href="#">Extensions</a> > <a href="#">Installed Module</a> > <a href="#">Wiki</a></li>
|
||||
</ul>
|
||||
<LI><A HREF="#">EXTENSIONS</A> > <A HREF="#">INSTALLED MODULE</A> > <A HREF="#">BOARD</A></LI>
|
||||
<LI><A HREF="#">EXTENSIONS</A> > <A HREF="#">INSTALLED MODULE</A> > <A HREF="#">WIKI</A></LI>
|
||||
</UL>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -152,8 +152,9 @@
|
|||
/**
|
||||
* @brief get the total number of comments in corresponding with document_srl.
|
||||
**/
|
||||
function getCommentCountByDate($date = '') {
|
||||
function getCommentCountByDate($date = '', $moduleSrlList = array()) {
|
||||
if($date) $args->regDate = date('Ymd', strtotime($date));
|
||||
if(count($moduleSrlList)>0) $args->module_srl = $moduleSrlList;
|
||||
|
||||
$output = executeQuery('comment.getCommentCount', $args);
|
||||
if(!$output->toBool()) return 0;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" />
|
||||
<condition operation="equal" column="module_srl" var="module_srl" filter="number" pipe="and" />
|
||||
<condition operation="in" column="module_srl" var="module_srl" filter="number" pipe="and" />
|
||||
<condition operation="like_prefix" column="regdate" var="regDate" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -80,8 +80,9 @@
|
|||
/**
|
||||
* @brief Return document count with date
|
||||
**/
|
||||
function getDocumentCountByDate($date = '') {
|
||||
function getDocumentCountByDate($date = '', $moduleSrlList = array()) {
|
||||
if($date) $args->regDate = date('Ymd', strtotime($date));
|
||||
if(count($moduleSrlList)>0) $args->moduleSrlList = $moduleSrlList;
|
||||
|
||||
$output = executeQuery('document.getDocumentCountByDate', $args);
|
||||
if(!$output->toBool()) return 0;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="like_prefix" column="regdate" var="regDate" />
|
||||
<condition operation="in" column="module_srl" var="moduleSrlList" />
|
||||
<condition operation="like_prefix" column="regdate" var="regDate" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -147,5 +147,17 @@
|
|||
|
||||
return $output->data->count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return site join member count with date
|
||||
**/
|
||||
function getMemberGroupMemberCountByDate($date = '') {
|
||||
if($date) $args->regDate = date('Ymd', strtotime($date));
|
||||
|
||||
$output = executeQuery('member.getMemberGroupMemberCountByDate', $args);
|
||||
if(!$output->toBool()) return 0;
|
||||
|
||||
return count($output->data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
14
modules/member/queries/getMemberGroupMemberCountByDate.xml
Normal file
14
modules/member/queries/getMemberGroupMemberCountByDate.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<query id="getMemberGroupMemberCountByDate" action="select">
|
||||
<tables>
|
||||
<table name="member_group_member" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="like_prefix" column="regdate" var="regDate" />
|
||||
</conditions>
|
||||
<groups>
|
||||
<group column="member_srl" />
|
||||
</groups>
|
||||
</query>
|
||||
|
|
@ -3,6 +3,8 @@
|
|||
<grants />
|
||||
<permissions />
|
||||
<actions>
|
||||
<action name="dispSiteAdminIndex" type="view" standalone="true" />
|
||||
|
||||
<action name="getSiteAllList" type="model" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -28,8 +28,84 @@
|
|||
if(!$this->site_srl) return $this->stop('msg_invalid_request');
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
|
||||
|
||||
}
|
||||
|
||||
function dispSiteAdminIndex()
|
||||
{
|
||||
// Get Module List in Virtual Site
|
||||
$site_module_info = Context::get('current_module_info');
|
||||
$args->site_srl = $site_module_info->site_srl;
|
||||
$columnList = array('module_srl');
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$output = $oModuleModel->getModuleSrlList($args, $columnList);
|
||||
$moduleSrlList = array();
|
||||
if(is_array($output))
|
||||
{
|
||||
foreach($output AS $key=>$value)
|
||||
array_push($moduleSrlList, $value->module_srl);
|
||||
}
|
||||
|
||||
// Get statistics
|
||||
$args->date = date("Ymd000000", time()-60*60*24);
|
||||
$today = date("Ymd");
|
||||
|
||||
// Member Status
|
||||
// TODO add site srl
|
||||
$oMemberAdminModel = &getAdminModel('member');
|
||||
$status->member->todayCount = $oMemberAdminModel->getMemberGroupMemberCountByDate($today);
|
||||
$status->member->totalCount = $oMemberAdminModel->getMemberGroupMemberCountByDate();
|
||||
|
||||
// Document Status
|
||||
$oDocumentAdminModel = &getAdminModel('document');
|
||||
$status->document->todayCount = $oDocumentAdminModel->getDocumentCountByDate($today, $moduleSrlList);
|
||||
$status->document->totalCount = $oDocumentAdminModel->getDocumentCountByDate('', $moduleSrlList);
|
||||
|
||||
// Comment Status
|
||||
$oCommentModel = &getModel('comment');
|
||||
$status->comment->todayCount = $oCommentModel->getCommentCountByDate($today, $moduleSrlList);
|
||||
$status->comment->totalCount = $oCommentModel->getCommentCountByDate('', $moduleSrlList);
|
||||
|
||||
// Trackback Status
|
||||
$oTrackbackAdminModel = &getAdminModel('trackback');
|
||||
$status->trackback->todayCount = $oTrackbackAdminModel->getTrackbackCountByDate($today, $moduleSrlList);
|
||||
$status->trackback->totalCount = $oTrackbackAdminModel->getTrackbackCountByDate('', $moduleSrlList);
|
||||
|
||||
Context::set('status', $status);
|
||||
|
||||
// Latest Document
|
||||
$oDocumentModel = &getModel('document');
|
||||
$columnList = array('document_srl', 'module_srl', 'category_srl', 'title', 'nick_name', 'member_srl');
|
||||
$args->module_srl = $moduleSrlList;
|
||||
$args->list_count = 5;;
|
||||
$output = $oDocumentModel->getDocumentList($args, false, false, $columnList);
|
||||
Context::set('latestDocumentList', $output->data);
|
||||
unset($args, $output, $columnList);
|
||||
|
||||
// Latest Comment
|
||||
$oCommentModel = &getModel('comment');
|
||||
$columnList = array('comment_srl', 'module_srl', 'document_srl', 'content', 'nick_name', 'member_srl');
|
||||
$args->module_srl = $moduleSrlList;
|
||||
$args->list_count = 5;
|
||||
$output = $oCommentModel->getNewestCommentList($args, $columnList);
|
||||
if(is_array($output))
|
||||
{
|
||||
foreach($output AS $key=>$value)
|
||||
$value->content = strip_tags($value->content);
|
||||
}
|
||||
Context::set('latestCommentList', $output);
|
||||
unset($args, $output, $columnList);
|
||||
|
||||
//Latest Trackback
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
$columnList = array();
|
||||
$args->module_srl = $moduleSrlList;
|
||||
$args->list_count = 5;
|
||||
$output =$oTrackbackModel->getNewestTrackbackList($args);
|
||||
Context::set('latestTrackbackList', $output->data);
|
||||
unset($args, $output, $columnList);
|
||||
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
64
modules/site/tpl/index.html
Normal file
64
modules/site/tpl/index.html
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<div class="content dashboard" id="content">
|
||||
<div class="portlet">
|
||||
<h2 class="h2">Current State</h2>
|
||||
<ul class="lined">
|
||||
<li><a href="#">User</a> <span class="side">{number_format($status->member->totalCount)}(<!--@if($status->member->todayCount>0)-->+<!--@end-->{$status->member->todayCount})</span></li>
|
||||
<li><a href="#">Document</a> <span class="side">{number_format($status->document->totalCount)}(<!--@if($status->document->todayCount>0)-->+<!--@end-->{$status->document->todayCount})</span></li>
|
||||
<li><a href="#">Reply</a> <span class="side">{number_format($status->comment->totalCount)}(<!--@if($status->comment->todayCount>0)-->+<!--@end-->{$status->comment->todayCount})</span></li>
|
||||
<li><a href="#">Trackback</a> <span class="side">{number_format($status->trackback->totalCount)}(<!--@if($status->comment->todayCount>0)-->+<!--@end-->{$status->comment->todayCount})</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="portlet">
|
||||
<h2 class="h2">Latest Document</h2>
|
||||
<ul class="lined">
|
||||
<!--@foreach($latestDocumentList AS $key=>$value)-->
|
||||
{@$document = $value->variables}
|
||||
<li>
|
||||
<a href="#">{$document['title']}</a> <span class="side">{$document['nick_name']}</span>
|
||||
<span class="action">
|
||||
<a href="#" target="_blank">Edit</a>
|
||||
<a href="#">Spam</a>
|
||||
<a href="#">Trash</a>
|
||||
</span>
|
||||
</li>
|
||||
<!--@end-->
|
||||
</ul>
|
||||
</div>
|
||||
<div class="portlet">
|
||||
<h2 class="h2">Latest Comment</h2>
|
||||
<ul class="lined">
|
||||
<!--@foreach($latestCommentList AS $key=>$value)-->
|
||||
<li>
|
||||
<a href="#">{$value->content}</a> <span class="side">{$value->nick_name}</span>
|
||||
<span class="action">
|
||||
<a href="#" target="_blank">Edit</a>
|
||||
<a href="#">Spam</a>
|
||||
<a href="#">Trash</a>
|
||||
</span>
|
||||
</li>
|
||||
<!--@end-->
|
||||
</ul>
|
||||
</div>
|
||||
<div class="portlet">
|
||||
<h2 class="h2">Latest Trackback</h2>
|
||||
<ul class="lined">
|
||||
<!--@foreach($latestTrackbackList AS $key=>$value)-->
|
||||
<li>
|
||||
<a href="#">{$value->title}</a> <span class="side">{$value->blog_name}</span>
|
||||
<span class="action">
|
||||
<a href="#" target="_blank">Edit</a>
|
||||
<a href="#">Spam</a>
|
||||
<a href="#">Trash</a>
|
||||
</span>
|
||||
</li>
|
||||
<!--@end-->
|
||||
</ul>
|
||||
</div>
|
||||
<div class="portlet">
|
||||
<h2 class="h2">Your Favorite</h2>
|
||||
<ul class="lined">
|
||||
<li><a href="#" target="_blank"><a href="#">Extensions</a> > <a href="#">Installed Module</a> > <a href="#">Board</a></a></li>
|
||||
<li><a href="#" target="_blank"><a href="#">Extensions</a> > <a href="#">Installed Module</a> > <a href="#">Wiki</a></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" />
|
||||
<condition operation="equal" column="module_srl" var="module_srl" filter="number" pipe="and" />
|
||||
<condition operation="in" column="module_srl" var="module_srl" filter="number" pipe="and" />
|
||||
<condition operation="like_prefix" column="regdate" var="regDate" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -63,9 +63,10 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
function getTrackbackCountByDate($date = '')
|
||||
function getTrackbackCountByDate($date = '', $moduleSrlList = array())
|
||||
{
|
||||
if($date) $args->regDate = date('Ymd', strtotime($date));
|
||||
if(count($moduleSrlList)>0) $args->module_srl = $moduleSrlList;
|
||||
|
||||
$output = executeQuery('trackback.getTrackbackCount', $args);
|
||||
if(!$output->toBool()) return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue