public function getThemeNameList() { $tpl_view_folder = File::scanDir(WEB_ROOT . 'Application/Home/View'); $tpl_static_folder = File::scanDir(WEB_ROOT . 'Public'); $this->theme_exist = array_intersect($tpl_view_folder, $tpl_static_folder); return $this->theme_exist; }
/** * */ public function backupFile() { $root = File::scanDir(WEB_ROOT, true); $root_info = array(); foreach ($root as $value) { $root_info_temp = array(); $root_info_temp['name'] = $value; $root_info_temp['path'] = WEB_ROOT . $value; $root_info_temp['size'] = File::realSize(WEB_ROOT . $value); array_push($root_info, $root_info_temp); } // dump($root_info); $this->assign('root_info', $root_info); $this->display(); }
/** * */ public function backupFile() { $root = File::scanDir(WEB_ROOT, true); $root_info = array(); $filter_array = array("Data", "Install", "README.md", "UpdateLOG", "composer.json"); foreach ($root as $value) { if (in_array($value, $filter_array)) { continue; } $root_info_temp = array(); $root_info_temp['name'] = $value; $root_info_temp['path'] = WEB_ROOT . $value; $root_info_temp['size'] = File::realSize(WEB_ROOT . $value); array_push($root_info, $root_info_temp); } // dump($root_info); $this->assign('root_info', $root_info); $this->display(); }
/** * */ public function theme() { $tpl_view = File::scanDir(WEB_ROOT . 'Application/Home/View'); $tpl_static = File::scanDir(WEB_ROOT . 'Public'); $tpl = array_intersect($tpl_view, $tpl_static); $theme_list = array(); foreach ($tpl as $value) { $tpl_static_path = WEB_ROOT . 'Public/' . $value . '/'; $theme_temp = array(); if (file_exists($tpl_static_path . 'theme.xml')) { $theme = simplexml_load_file($tpl_static_path . '/theme.xml'); $theme_temp = (array) $theme; if ($theme_temp['name'] == get_kv('home_theme', true)) { $theme_temp['status_name'] = '正在使用'; $theme_temp['status_url'] = '#'; $theme_temp['using_color'] = ' bg-green'; $theme_temp['action_name2'] = '使用中'; $theme_temp['action_url2'] = '#'; } elseif ($this->themeStatus($theme_temp['name']) == 'enabled') { $theme_temp['using_color'] = ' bg-olive'; $theme_temp['status_name'] = '立即使用'; $theme_temp['status_url'] = U('Admin/Custom/themeChangeHandle', array('theme_name' => $theme_temp['name'])); $theme_temp['action_name2'] = '禁用'; $theme_temp['action_url2'] = U('Admin/Custom/themeDisableHandle', array('theme_name' => $theme_temp['name'])); } else { $theme_temp['status_name'] = '禁用中'; $theme_temp['status_url'] = '#'; $theme_temp['action_name2'] = '启用'; $theme_temp['action_url2'] = U('Admin/Custom/themeEnableHandle', array('theme_name' => $theme_temp['name'])); } array_push($theme_list, $theme_temp); } } $this->assign('theme_list', $theme_list); $this->display(); }