Skip to content

Instantly share code, notes, and snippets.

@flyskyko
Last active August 29, 2015 14:01
Show Gist options
  • Save flyskyko/bf01869b2ca20eeb2059 to your computer and use it in GitHub Desktop.
Save flyskyko/bf01869b2ca20eeb2059 to your computer and use it in GitHub Desktop.
<?php
class myBoardAdminView extends myBoard
{
public function init()
{
$moduleSrl = Context::get('module_srl');
// 모듈 정보
if ($moduleSrl)
{
$oModuleModel = getModel('module');
$moduleInfo = $oModuleModel->getModuleInfoByModuleSrl($moduleSrl);
if ($moduleInfo->module != 'myboard')
{
return new Object(-1, 'invalid_request');
}
$this->module_info = $moduleInfo;
}
// 템플릿 경로를 스킨 경로로 세팅
$templatePath = sprintf('%stpl/', $this->module_path);
$this->setTemplatePath($templatePath);
// 템플릿 파일명을 세팅
$templateFile = str_replace('dispMyboardAdmin', '', $this->act);
$this->setTemplateFile($templateFile);
}
public function dispMyboardAdminList()
{
// 쿼리 파라미터
$args = new stdClass();
$args->page = Context::get('page');
// 쿼리 실행
$output = executeQueryArray('myboard.getMyboardList', $args);
// 팀플릿 변수 세팅
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('list', $output->data);
Context::set('page_navigation', $output->page_navigation);
}
public function dispMyboardAdminInsert()
{
// 스킨 목록
$oModuleModel = getModel('module');
$skinList = $oModuleModel->getSkins($this->module_path);
Context::set('skin_list', $skinList);
// 레이아웃 목록
$oLayoutModel = getModel('layout');
$layoutList = $oLayoutModel->getLayoutList();
Context::set('layout_list', $layoutList);
}
public function dispMyboardAdminInfo()
{
$this->setTemplateFile('Insert');
return $this->dispMyboardAdminInsert();
}
}
/* End of file: myboard.admin.view.php */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment