function _copyThemesFiles($theme, $alias) { $themePath = R_P . 'mode/area/themes/' . $theme; $channelPath = $this->getChannelPath($alias); L::loadClass('fileoperate', 'utility', false); PW_FileOperate::copyFiles($themePath, $channelPath); }
function deleteDir($dir) { $dir = S::escapePath($dir); while (!rmdir($dir)) { if (is_dir($dir)) { if ($dp = opendir($dir)) { while (($file = readdir($dp)) != false) { if (is_dir($dir . '/' . $file) && $file != '.' && $file != '..') { PW_FileOperate::deleteDir($dir . '/' . $file); } else { if ($file != '.' && $file != '..') { P_unlink($dir . '/' . $file); } } } closedir($dp); } else { return false; } } } }
} ajax_footer(); exit; } elseif ($action == 'del') { //* include_once pwCache::getPath(D_P.'data/bbscache/area_config.php'); pwCache::getData(D_P . 'data/bbscache/area_config.php'); S::gp(array('id')); $channel_info = $channelService->getChannelByChannelid($id); if (!$channel_info) { Showmsg("频道不存在"); } $del_flag = $channelService->delChannel($id); $dir = AREA_PATH . $channel_info['alias']; if (is_dir($dir) && $channel_info['alias'] != "") { L::loadClass('fileoperate', 'utility', false); PW_FileOperate::deleteDir(S::escapePath($dir)); } if ($area_default_alias == $channel_info['alias']) { $channelService->updateDefaultAlias(''); } $navConfigService = L::loadClass('navconfig', 'site'); /* @var $navConfigService PW_NavConfig */ $navConfigService->deleteByKey('area_' . $channel_info['alias']); Showmsg("删除成功!"); } elseif ($action == 'edit') { S::gp(array('edit_step', 'id', 'channel_name', 'channel_theme', 'channel_domain')); $actionUrl = EncodeUrl($actionUrl); if (empty($edit_step)) { $channel_info = $channelService->getChannelByChannelid($id); include PrintMode('channel_manage'); ajax_footer();