*/ /** * @class pageView * @author NAVER (developers@xpressengine.com) * @brief page view class of the module */ class pageView extends page { var $module_srl = 0; var $list_count = 20; var $page_count = 10; var $cache_file; var $interval; var $path; /** * @brief Initialization */ function init() { // Get a template path (page in the administrative template tpl putting together) $this->setTemplatePath($this->module_path.'tpl'); switch($this->module_info->page_type) { case 'WIDGET' : { $this->cache_file = sprintf("%sfiles/cache/page/%d.%s.%s.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType(), Context::getSslStatus()); $this->interval = (int)($this->module_info->page_caching_interval); break; } case 'OUTSIDE' : { $this->cache_file = sprintf("%sfiles/cache/opage/%d.%s.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getSslStatus()); $this->interval = (int)($this->module_info->page_caching_interval); $this->path = $this->module_info->path; break; } } } /** * @brief General request output */ function dispPageIndex() { // Variables used in the template Context:: set() if($this->module_srl) Context::set('module_srl',$this->module_srl); $page_type_name = strtolower($this->module_info->page_type); $method = '_get' . ucfirst($page_type_name) . 'Content'; if(method_exists($this, $method)) $page_content = $this->{$method}(); else return new Object(-1, sprintf('%s method is not exists', $method)); Context::set('module_info', $this->module_info); Context::set('page_content', $page_content); $this->setTemplateFile('content'); } function _getWidgetContent() { if($this->interval>0) { if(!file_exists($this->cache_file)) $mtime = 0; else $mtime = filemtime($this->cache_file); if($mtime + $this->interval*60 > $_SERVER['REQUEST_TIME']) { $page_content = FileHandler::readFile($this->cache_file); $page_content = str_replace('