-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgletyle.smartphone.php
42 lines (38 loc) · 2.03 KB
/
upgletyle.smartphone.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* @class upgletyleSmartphone
* @author UPGLE ([email protected])
* @brief upgletyle module SmartPhone IPhone class
**/
class upgletyleSPhone extends upgletyle {
function procSmartPhone(&$oSmartPhone) {
$oDocumentModel = &getModel('document');
$oDocument = Context::get('oDocument');
if($oDocument->isExists()) {
if(Context::get('comment') == 'true' && $oDocument->getCommentCount()) {
Context::set('comment_list', $oDocument->getComments());
$comment_page_navigation = $oDocument->comment_page_navigation;
if($comment_page_navigation) {
if($comment_page_navigation->cur_page > $comment_page_navigation->first_page) $oSmartPhone->setPrevUrl(getUrl('cpage',$comment_page_navigation->cur_page-1));
if($comment_page_navigation->cur_page < $comment_page_navigation->last_page) $oSmartPhone->setNextUrl(getUrl('cpage',$comment_page_navigation->cur_page+1));
}
$oSmartPhone->setParentUrl(getUrl('comment',''));
$tpl_file = 'comment_list';
} else {
$oSmartPhone->setParentUrl(getUrl('document_srl',''));
$tpl_file = 'view_document';
}
} else {
$page_navigation = Context::get('page_navigation');
if($page_navigation) {
if($page_navigation->cur_page > $page_navigation->first_page) $oSmartPhone->setPrevUrl(getUrl('page',$page_navigation->cur_page-1));
if($page_navigation->cur_page < $page_navigation->last_page) $oSmartPhone->setNextUrl(getUrl('page',$page_navigation->cur_page+1));
}
$tpl_file = 'list';
}
$oTemplate = new TemplateHandler();
$content = $oTemplate->compile($this->module_path.'tpl/smartphone', $tpl_file);
$oSmartPhone->setContent($content);
}
}
?>