issue 1314 add function that read communication on mobile.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.2@10993 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
devjin 2012-08-07 12:59:18 +00:00
parent 9ee4d352d9
commit a6e83d087b
12 changed files with 262 additions and 5 deletions

View file

@ -19,11 +19,13 @@
**/
function procCommunicationAdminInsertConfig() {
// get the default information
$args = Context::gets('skin','colorset','editor_skin','editor_colorset');
$args = Context::gets('skin','colorset','editor_skin','editor_colorset', 'mskin');
if(!$args->skin) $args->skin = 'default';
if(!$args->colorset) $args->colorset = 'white';
if(!$args->editor_skin) $args->editor_skin = 'default';
if(!$args->mskin) $args->mskin = 'default';
if(!$args->skin) $args->skin = "default";
if(!$args->colorset) $args->colorset = "white";
if(!$args->editor_skin) $args->editor_skin = "default";
// create the module module Controller object
$oModuleController = &getController('module');
$output = $oModuleController->insertModuleConfig('communication',$args);

View file

@ -28,10 +28,14 @@
Context::set('editor_skin_list', $oEditorModel->getEditorSkinList() );
// get a list of communication skins
Context::set('communication_skin_list', $oModuleModel->getSkins($this->module_path) );
// get a list of communication skins
Context::set('communication_mobile_skin_list', $oModuleModel->getSkins($this->module_path, 'm.skins') );
$security = new Security();
$security->encodeHTML('communication_config..');
$security->encodeHTML('editor_skin_list..');
$security->encodeHTML('communication_skin_list..title');
$security->encodeHTML('communication_skin_list..title');
$security->encodeHTML('communication_mobile_skin_list..title');
// specify a template
$this->setTemplatePath($this->module_path.'tpl');

View file

@ -0,0 +1,68 @@
<?php
require_once(_XE_PATH_.'modules/communication/communication.view.php');
class communicationMobile extends communicationView {
function init() {
$oCommunicationModel = &getModel('communication');
$this->communication_config = $oCommunicationModel->getConfig();
$skin = $this->communication_config->mskin;
Context::set('communication_config', $this->communication_config);
$tpl_path = sprintf('%sm.skins/%s', $this->module_path, $skin);
$this->setTemplatePath($tpl_path);
}
function dispCommunicationMessages()
{
// Error appears if not logged-in
if(!Context::get('is_logged'))
{
return $this->stop('msg_not_logged');
}
$logged_info = Context::get('logged_info');
if(!array_key_exists('dispCommunicationMessages', $logged_info->menu_list))
{
return $this->stop('msg_invalid_request');
}
// Set the variables
$message_srl = Context::get('message_srl');
$message_type = 'R';
Context::set('message_type', $message_type);
$oCommunicationModel = &getModel('communication');
// extract contents if message_srl exists
if($message_srl)
{
$templateFile = 'read_message';
$columnList = array('message_srl', 'sender_srl', 'receiver_srl', 'message_type', 'title', 'content', 'readed', 'regdate');
$message = $oCommunicationModel->getSelectedMessage($message_srl, $columnList);
if($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl) )
{
stripEmbedTagForAdmin($message->content, $message->sender_srl);
Context::set('message', $message);
}
}
else
{
$templateFile = 'messages';
}
// Extract a list
$columnList = array('message_srl', 'readed', 'title', 'member.member_srl', 'member.nick_name', 'message.regdate', 'readed_date');
$output = $oCommunicationModel->getMessages($message_type, $columnList);
// set a template file
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('message_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
$oSecurity = new Security();
$oSecurity->encodeHTML('message_list..nick_name');
$this->setTemplateFile($templateFile);
}
}

View file

@ -25,6 +25,7 @@
if(!$communication_config->skin) $communication_config->skin = 'default';
if(!$communication_config->colorset) $communication_config->colorset = 'white';
if(!$communication_config->editor_skin) $communication_config->editor_skin = 'default';
if(!$communication_config->mskin) $communication_config->mskin = 'default';
return $communication_config;
}

View file

@ -0,0 +1,127 @@
@charset "utf-8";
/* Mobile XE (/modules/board/m.skins/default) */
body{margin:0;background:#fff;color:#000;word-wrap:break-word}
body,input,textarea,select,button,table{font-family:Tahoma,Geneva,sans-serif}
img{border:0}
em{font-style:normal}
form{margin:0;padding:0}
fieldset{margin:0;padding:0;border:0}
textarea{resize:vertical}
input[type=checkbox],
input[type=radio]{width:13px;height:13px;margin:0;padding:0}
/* Common */
.fl{float:left}
.fr{float:right}
/* Background */
.rp li li,
.rp .answer,
.rp .btn,
/* Body */
.bd{background:#f8f8f8;padding:1px 0}
.co{margin:10px;line-height:1.4;font-size:14px;color:#333}
.co:after{content:"";display:block;clear:both;zoom:1}
/* Hx */
.hx{position:relative;border-bottom:1px solid #ccc8be;padding:8px 10px;margin:0}
.hx:after{content:"";margin:0 -10px;position:relative;top:10px;display:block;clear:both;height:1px;background:#fff}
.hx.h2{background:#e5e5e5;text-shadow:1px 1px 0 #fff;padding-right:40px}
.hx.h2 em{font-size:12px;color:#6352d2}
.hx.h3{background:#868686;color:#fff}
.hx.h3 em{font-size:12px}
.hx h2, .hx h3{margin:0 10px 0 0;display:inline}
.hx h2{font-size:16px;line-height:1.4}
.hx h3{font-size:14px}
.hx a{color:#000}
.hx .ex{font-size:12px}
.hx .tg{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;padding:0;overflow:visible;border:0;cursor:pointer;opacity:0;background:none}
.hx .ca{font-size:12px;text-decoration:underline;color:#333}
.hx .ca:after{content:"";display:inline-block;position:relative;left:4px;width:0;height:0;border:4px solid;border-color:transparent;border-left-color:#8d7de1;margin:0 -8px 0 0}
.hx .write{position:absolute;top:8px;right:10px;background-position:0 0;display:inline-block;width:28px;height:27px;font-size:0;overflow:hidden;text-indent:-28px}
/* Global Navigation */
.gn{margin:0;padding:0;list-style:none;background:#d3d1cc;text-shadow:1px 1px 0 #fff}
.gn li{background:#c3c3c3;border:1px solid #a3a09a;border-left:0;border-right:0;margin:0 0 -1px 0}
.gn li li{background:#f8f8f8;border:1px solid #c9c9c9;border-left:0;border-right:0}
.gn li li li{background:#e8e8e8}
.gn ul{margin:0 0 -1px 0;padding:0;list-style:none}
.gn a{position:relative;text-decoration:none;display:block;padding:10px;font-size:16px}
.gn li a{color:#333}
.gn li a:after{position:absolute;top:7px;right:10px;content:"";color:#888;font-size:18px;font-weight:bold;font-family:Verdana, Geneva, sans-serif}
.gn li li a:before{content:"";display:inline-block;width:6px;height:6px;border:1px dotted #666;border-top:0;border-right:0;margin:0 4px 0 0;vertical-align:top}
.gn li li a{padding-left:15px}
.gn li li li a{padding-left:30px}
.gn li li li li a{padding-left:45px}
.gn li li li li li a{padding-left:60px}
.gn em{color:#6352d2;font-size:12px}
/* List */
.lt{margin:0;padding:0;list-style:none;background:#f8f8f8;font-size:14px}
.lt li{border-bottom:1px solid #ccc8be;overflow:hidden}
.lt .read{background:url(../img/read.png) no-repeat 10px center;padding:5px 5px 5px 52px}
.lt .unread{background:url(../img/unread.png) no-repeat 10px center;padding:5px 5px 5px 52px}
.lt a{float:left;display:inline-block;text-decoration:none;color:#000;padding:5px}
.lt .memberInfo{float:right;padding:5px 5px 5px 34px;background:url(../img/member.png) no-repeat 10px center;}
.lt .notice{display:inline-block;background:#a06acd;font-weight:bold;color:#fff;font-size:12px;padding:1px;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px}
.lt .title{display:block;margin:0 0 5px 0}
.lt .title strong{font-size:14px;font-weight:bold}
.lt .title em{font-size:12px;color:#333;color:#6352d2}
.lt .auth{display:block;font-size:12px}
.lt .auth .time{padding:0 5px;border-left:1px solid #bfbfbf}
/* Toggle Open */
.tgo{display:none;background:#f8f8f8;color:#333;margin:0;padding:0;list-style:none;font-size:14px;color:#333}
.tgo.open{display:block}
.file{margin:0;padding:0;list-style:none}
.file li{border-top:1px solid #c9c9c9;border-bottom:1px solid #c9c9c9;margin:0 0 -1px 0}
.file a{text-decoration:none;display:block;padding:10px 0 10px 10px;color:#333}
.file .size{font-size:12px;border-left:1px solid #bfbfbf;margin:0 5px;padding:0 10px;color:#666}
.rp ul{margin:10px 0 -11px -10px;padding:0;list-style:none}
.rp li{border-top:1px solid #c9c9c9;border-bottom:1px solid #c9c9c9;padding:10px 0 10px 10px;margin:0 0 -1px 0}
.rp .xe_content, .rp p{margin:0 0 5px 0}
.rp ul ul{margin-left:-25px}
.rp ul ul ul{margin-left:-40px}
.rp ul ul ul ul{margin-left:-55px}
.rp ul ul ul ul ul{margin-left:-70px}
.rp ul ul ul ul ul ul{margin-left:-85px}
.rp li li,
.rp .answer{padding-left:25px;background-position:10px -145px}
.rp li li li{padding-left:40px;background-position:25px -145px}
.rp li li li li{padding-left:55px;background-position:40px -145px}
.rp li li li li li{padding-left:70px;background-position:55px -145px}
.rp li li li li li li{padding-left:85px;background-position:70px -145px}
.rp .btn{display:inline-block;width:15px;height:15px;overflow:hidden;vertical-align:middle;text-indent:15px}
.rp .btn.ed{background-position:0 -32px}
.rp .btn.de{background-position:-15px -32px}
.rp .btn.re{background-position:-30px -32px}
.rp .auth{font-size:12px}
.rp .auth .time{padding:0 5px;border-left:1px solid #bfbfbf}
/* Form Field */
.origin{padding:10px 0;margin:0 10px;font-size:14px}
.ff{margin:0;padding:10px 0}
.ff ul{margin:0 10px 10px 10px;padding:10px 0 0 0;list-style:none}
.ff li{margin:0 0 5px 0;padding:0}
.ff label{margin-right:10px}
.ff label+input[type=text],
.ff label+input[type=password],
.ff label+textarea,
.ff label+select{display:block;width:96%;font-size:14px;margin:0 0 5px 0}
.ff label+input[type=text],
.ff label+input[type=password],
.ff label+textarea{padding:5px}
/* Button Area */
.bna{text-align:center;padding:0 10px;margin:10px 0;zoom:1}
.bna:after{content:"";display:block;clear:both}
.bn{display:inline-block;line-height:26px !important;padding:0 10px;font-size:12px;font-weight:bold;border:1px solid;text-decoration:none;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;cursor:pointer;vertical-align:middle}
.bn[type=submit],
.bn[type=button]{height:28px}
.bn[href]{height:26px}
.bn.dark{border-color:#666;background:#777 -webkit-gradient(linear,0% 0%,0% 100%,from(#7e7c78),to(#5c5b58));background:#777 -moz-linear-gradient(top,#7e7c78,#5c5b58);background-color:#777;color:#fff;box-shadow:0 0 1px #fff inset;-moz-box-shadow:0 0 1px #fff inset;-webkit-box-shadow:0 0 1px #fff inset}
.bn.white{border-color:#b5b5b5;background:#1b1b1b -webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#f6f6f6),color-stop(0.5,#f0f0f0),color-stop(0.5,#e4e4e4));background:#1b1b1b -moz-linear-gradient(top,#fff,#e4e4e4);background-color:#fff;color:#000}
/* Pagination */
.pn{font-size:12px;text-align:center;background:#f2f0ec;padding:15px 0;border-top:1px solid #fff}
.pn a{color:#333;text-decoration:none}
.pn strong{margin:0 10px}
.pn .prev:before{content:"";display:inline-block;width:0;height:0;margin:0 4px 0 0;border:4px solid;border-color:transparent;border-right-color:#999}
.pn .next:after{content:"";display:inline-block;width:0;height:0;margin:0 0 0 4px;border:4px solid;border-color:transparent;border-left-color:#999}
/* Search */
.sh{border:1px solid #bfbfbf;border-left:0;border-right:0;background:#e8e8e8;padding:10px;text-align:center}
.sh *{vertical-align:top}
.sh select{width:80px;font-size:14px;margin:0 0 5px 0}
.sh input[type=text]{width:160px;margin:0;font-size:14px;padding:5px}
.sh .shbn{width:28px;height:28px;border:1px solid #666;background:#777 url(../img/mx.png) no-repeat 5px -60px;box-shadow:0 0 1px #fff inset;-moz-box-shadow:0 0 1px #fff inset;-webkit-box-shadow:0 0 1px #fff inset;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;cursor:pointer}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1,17 @@
<load target="css/mcommunication.css" />
<div class="bd">
<div class="hx h2">
<h2>{$lang->message_box['R']}</h2>
</div>
<ul class="lt">
<li loop="$message_list => $no,$val" class="read"|cond="$val->readed == 'Y'" class="unread"|cond="$val->readed != 'Y'">
<a href="{getUrl('message_srl', $val->message_srl)}">{$val->title}</a>
<span class="memberInfo">{$val->nick_name} ({zdate($val->regdate,"Y-m-d")})</span>
</li>
</ul>
<div class="pn">
<a cond="$page != 1" href="{getUrl('page',$page-1,'document_srl','')}" class="prev">{$lang->cmd_prev}</a>
<strong>{$page} / {$page_navigation->last_page}</strong>
<a cond="$page != $page_navigation->last_page" href="{getUrl('page',$page+1,'document_srl','')}" class="next">{$lang->cmd_next}</a>
</div>
</div>

View file

@ -0,0 +1,12 @@
<load target="css/mcommunication.css" />
<div class="hx h2">
<h2>{$message->title}</h2><span class="ex">{$message->nick_name} | {zdate($message->regdate, "Y.m.d H:i")}</span>
</div>
<div class="co">
<div class="xe_content">{$message->content}</div>
</div>
<div class="bna">
<span class="fl"><a href="{getUrl('message_srl', '')}" class="bn white">{$lang->cmd_list}</a></span>
</div>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<skin version="0.2">
<title xml:lang="ko">XE 커뮤니케이션 모바일 기본 스킨</title>
<description xml:lang="ko">
XE 커뮤니케이션 모바일 기본 스킨입니다.
NHN (developers@xpressengine.com)
</description>
<version>0.1</version>
<date>2012-08-07</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NHN</name>
<name xml:lang="en">NHN</name>
<name xml:lang="zh-TW">NHN</name>
<name xml:lang="tr">NHN</name>
</author>
<extra_vars />
</skin>

View file

@ -39,6 +39,14 @@
<th scope="row">{$lang->colorset}</th>
<td><div id="communication_colorset"></div></td>
</tr>
<tr>
<th scope="row">{$lang->mobile_skin}</th>
<td>
<select name="mskin">
<option loop="$communication_mobile_skin_list => $key,$val" value="{$key}" selected="selected"|cond="$key==$communication_config->mskin" >{$val->title}</option>
</select>
</td>
</tr>
</table>
</div>
<div class="btnArea">