From 8b8ae5f64c6b5941a8f4e261718bb3fc5d9348f8 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Mon, 19 Jun 2023 14:50:00 +0900 Subject: [PATCH] Remove WAP classes and mark getWAP() as deprecated --- common/legacy.php | 3 +- modules/board/board.wap.php | 138 ------------------------------------ modules/page/page.wap.php | 26 ------- 3 files changed, 1 insertion(+), 166 deletions(-) delete mode 100644 modules/board/board.wap.php delete mode 100644 modules/page/page.wap.php diff --git a/common/legacy.php b/common/legacy.php index c7056c52f..dfddb958f 100644 --- a/common/legacy.php +++ b/common/legacy.php @@ -110,8 +110,7 @@ function getMobile($module_name) /** * Create a wap instance of the module * - * @param string $module_name The module name to get a wap instance - * @return mixed Module wap class instance + * @deprecated */ function getWAP($module_name) { diff --git a/modules/board/board.wap.php b/modules/board/board.wap.php deleted file mode 100644 index 139eb65de..000000000 --- a/modules/board/board.wap.php +++ /dev/null @@ -1,138 +0,0 @@ - */ - -/** - * @class boardWAP - * @author NAVER (developers@xpressengine.com) - * @brief board module WAP class - **/ - -class BoardWAP extends Board -{ - /** - * @brief wap procedure method - **/ - function procWAP(&$oMobile) - { - // check grant - if(!$this->grant->list || $this->module_info->consultation == 'Y') - { - return $oMobile->setContent(lang('msg_not_permitted')); - } - - // generate document model object - $oDocumentModel = getModel('document'); - - // if the doument is existed - $document_srl = Context::get('document_srl'); - if($document_srl) - { - $oDocument = $oDocumentModel->getDocument($document_srl); - if($oDocument->isExists()) - { - // check the grant - if(!$this->grant->view) - { - return $oMobile->setContent(lang('msg_not_permitted')); - } - - // setup the browser title - Context::setBrowserTitle($oDocument->getTitleText()); - - // if the act is display comment list - if($this->act=='dispBoardContentCommentList') - { - - $oCommentModel = getModel('comment'); - $output = $oCommentModel->getCommentList($oDocument->document_srl, 0, false, $oDocument->getCommentCount()); - - $content = ''; - if(count($output->data)) - { - foreach($output->data as $key => $val) - { - $oComment = new commentItem(); - $oComment->setAttribute($val); - - if(!$oComment->isAccessible()) continue; - - $content .= "".$oComment->getNickName()." (".$oComment->getRegdate("Y-m-d").")
\r\n".$oComment->getContent(false,false)."
\r\n"; - } - } - - // setup mobile contents - $oMobile->setContent( $content ); - - // setup upper URL - $oMobile->setUpperUrl( getUrl('act',''), lang('cmd_go_upper') ); - - // display the document if the act is not display the comment list - } else { - - // setup contents (strip all html tags) - $content = strip_tags(str_replace('

','
   ',$oDocument->getContent(false,false,false)),'
'); - - - // setup content information(include the comments link) - $content = lang('replies').' : '.$oDocument->getCommentCount().'
'."\r\n".$content; - $content = ''.$oDocument->getNickName().' ('.$oDocument->getRegdate("Y-m-d").")
\r\n".$content; - - // setup mobile contents - $oMobile->setContent( $content ); - - // setup upper URL - $oMobile->setUpperUrl( getUrl('document_srl',''), lang('cmd_list') ); - - } - - return; - } - } - - // board index - $args = new stdClass; - $args->module_srl = $this->module_srl; - $args->page = Context::get('page');; - $args->list_count = 9; - $args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order'; - $args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc'; - $output = $oDocumentModel->getDocumentList($args, $this->except_notice); - $document_list = $output->data; - $page_navigation = $output->page_navigation; - - $childs = array(); - if($document_list && count($document_list)) - { - foreach($document_list as $key => $val) - { - $href = getUrl('mid',$_GET['mid'],'document_srl',$val->document_srl); - $obj = null; - $obj['href'] = $val->getPermanentUrl(); - - $title = htmlspecialchars($val->getTitleText()); - if($val->getCommentCount()) $title .= ' ['.$val->getCommentCount().']'; - $obj['link'] = $obj['text'] = '['.$val->getNickName().'] '.$title; - $childs[] = $obj; - } - $oMobile->setChilds($childs); - } - - $totalPage = $page_navigation->last_page; - $page = (int)Context::get('page'); - if(!$page) $page = 1; - - // next/prevUrl specification - if($page > 1) - { - $oMobile->setPrevUrl(getUrl('mid',$_GET['mid'],'page',$page-1), sprintf('%s (%d/%d)', lang('cmd_prev'), $page-1, $totalPage)); - } - - if($page < $totalPage) - { - $oMobile->setNextUrl(getUrl('mid',$_GET['mid'],'page',$page+1), sprintf('%s (%d/%d)', lang('cmd_next'), $page+1, $totalPage)); - } - - $oMobile->mobilePage = $page; - $oMobile->totalPage = $totalPage; - } -} diff --git a/modules/page/page.wap.php b/modules/page/page.wap.php deleted file mode 100644 index 25d2280a7..000000000 --- a/modules/page/page.wap.php +++ /dev/null @@ -1,26 +0,0 @@ - */ -/** - * @class pageWap - * @author NAVER (developers@xpressengine.com) - * @brief wap class page of the module - */ -class PageWap extends Page -{ - /** - * @brief wap procedure method - * - * Page module does not include the following items on the full content control and output from the mobile class - */ - function procWAP(&$oMobile) - { - // Check permissions - if(!$this->grant->access) return $oMobile->setContent(lang('msg_not_permitted')); - // The contents of the widget chuchulham - $oWidgetController = getController('widget'); - $content = $oWidgetController->transWidgetCode($this->module_info->content); - $oMobile->setContent($content); - } -} -/* End of file page.wap.php */ -/* Location: ./modules/page/page.wap.php */