Beispiel #1
0
 public function actionIndex($parentid = 0)
 {
     $folder = zotop::model('system.folder');
     if (form::isPostBack()) {
         $post = form::post();
         foreach ((array) $post['id'] as $i => $id) {
             $folder->update(array('order' => $i + 1), $id);
         }
         if (!$folder->error()) {
             msg::success('保存成功', zotop::url('system/folder/index'));
         }
         msg::error($folder->msg());
     }
     $folders = $folder->getAll();
     $tree = new tree($folders, 0);
     $rows = $tree->getChild($parentid);
     $position = $tree->getPosition($parentid);
     foreach ($position as $p) {
         $pos[zotop::url('system/folder/index/' . $p['id'])] = $p['title'];
     }
     $page = new page();
     $page->set('title', zotop::t('文件管理'));
     $page->set('navbar', $this->navbar($parentid));
     $page->set('position', array(zotop::url('system/file') => zotop::t('文件管理'), zotop::url('system/folder') => zotop::t('分类管理')) + (array) $pos + array('列表'));
     $page->set('folders', $folders);
     $page->set('rows', $rows);
     $page->set('hash', $hash);
     $page->display();
 }
Beispiel #2
0
 public function actionIndex($parentid = 0)
 {
     $category = zotop::model('content.category');
     if (form::isPostBack()) {
         $ids = zotop::post('id');
         $category->order($ids);
         if (!$category->error()) {
             msg::success('保存成功');
         }
         msg::error($category->msg());
     }
     $categorys = $category->db()->where('parentid', '=', $parentid)->orderby('order', 'asc')->getAll();
     $types = $category->types();
     $model = zotop::model('content.model');
     $models = $model->cache();
     $position = $category->getPosition($parentid);
     foreach ($position as $p) {
         $pos[zotop::url('content/category/index/' . $p['id'])] = $p['title'];
     }
     $page = new page();
     $page->set('title', zotop::t('栏目管理'));
     $page->set('position', array(zotop::url('content') => zotop::t('内容管理'), zotop::url('content/category') => zotop::t('栏目管理')) + (array) $pos + array('栏目列表'));
     $page->set('navbar', $this->navbar($parentid));
     $page->set('categorys', $categorys);
     $page->set('models', $models);
     $page->set('types', $types);
     $page->display();
 }
Beispiel #3
0
 public function actionIndex()
 {
     $page = new page();
     $page->title = zotop::t('系统管理');
     $page->navbar = $this->navbar();
     $page->display();
 }
Beispiel #4
0
 public function actionIndex($type = '')
 {
     $file = zotop::model('zotop.file');
     if (!empty($type)) {
         $where = array('type', '=', $type);
     }
     $files = $file->db()->where($where)->orderby('createtime', 'desc')->getPage();
     $pagination = new pagination();
     $pagination->page = $files['page'];
     $pagination->pagesize = $files['pagesize'];
     $pagination->total = $files['total'];
     $p = $pagination->render();
     $totalsize = $file->totalsize();
     $totalcount = $file->count();
     $page = new page();
     $page->set('title', zotop::t('文件管理'));
     $page->set('navbar', $this->navbar());
     $page->set('page', $files['page']);
     $page->set('pagesize', $files['pagesize']);
     $page->set('total', $files['total']);
     $page->set('files', $files['data']);
     $page->set('totalsize', $totalsize);
     $page->set('totalcount', $totalcount);
     $page->set('pagination', $p);
     $page->display();
 }
Beispiel #5
0
 public function actionIndex()
 {
     $page = new page();
     $page->title = zotop::t('模板管理');
     $page->set('navbar', $this->navbar());
     $page->display();
 }
Beispiel #6
0
 public function actionIndex()
 {
     $page = new page();
     $page->title = '系统管理中心';
     $page->body = array('class' => 'frame');
     $page->set('user', $this->user);
     $page->display();
 }
Beispiel #7
0
 public function actionDetail($id)
 {
     $content = zotop::model('content.content');
     $content->read($id);
     $page = new page();
     $page->set('content', $content);
     $page->set('body', array('class' => 'detail'));
     $page->display($content->template);
 }
Beispiel #8
0
 public function actionLocation($globalid)
 {
     $file = zotop::model('system.file');
     $images = $file->db()->where('type', '=', 'image')->where('globalid', '=', $globalid)->orderby('createtime', 'desc')->getAll();
     $page = new page();
     $page->set('title', '已上传图片');
     $page->set('globalid', $globalid);
     $page->set('images', $images);
     $page->display();
 }
Beispiel #9
0
 public function actionUninstalled()
 {
     $module = zotop::model('system.module');
     $modules = $module->getUnInstalled();
     $page = new page();
     $page->set('title', '模块安装 ');
     $page->set('position', $position);
     $page->set('navbar', $this->navbar());
     $page->set('modules', $modules);
     $page->display();
 }
Beispiel #10
0
 public function actionIndex()
 {
     $module = zotop::module('content');
     $menus = array(array('id' => 'category', 'icon' => '', 'title' => '内容管理', 'url' => zotop::url('content/content'), 'description' => '内容管理,添加,编辑以及删除等操作'), array('id' => 'category', 'icon' => '', 'title' => '栏目管理', 'url' => zotop::url('content/category'), 'description' => '栏目分类管理,新建栏目及调整栏目顺序'), array('id' => 'category', 'icon' => '', 'title' => '模型管理', 'url' => zotop::url('content/model'), 'description' => '内容模型管理,可以自定义内容模型'), array('id' => 'category', 'icon' => '', 'title' => '模块设置', 'url' => zotop::url('content/setting'), 'description' => '内容模块的相关设置'));
     $page = new page();
     $page->set('title', $module['title']);
     //$page->set('description', $module['description']);
     $page->set('navbar', $this->navbar());
     $page->set('module', $module);
     $page->set('menus', $menus);
     $page->display();
 }
Beispiel #11
0
 public function uninstalledAction($id = '')
 {
     $module = zotop::model('zotop.module');
     $modules = $module->getUnInstalled();
     if (!empty($id) && isset($modules[$id])) {
         zotop::redirect('zotop/module/license', array('id' => $id));
         exit;
     }
     $page = new page();
     $page->set('title', '系统模块管理 ');
     $page->set('position', $position);
     $page->set('navbar', $this->navbar());
     $page->set('modules', $modules);
     $page->display();
 }
Beispiel #12
0
 public function actionUninstalled($path = '')
 {
     $module = zotop::model('zotop.module');
     $modules = $module->getUnInstalled();
     if (!empty($path)) {
         zotop::redirect('zotop/module/license', array('path' => url::encode($path)));
         exit;
     }
     $page = new page();
     $page->set('title', '系统模块管理 ');
     $page->set('position', $position);
     $page->set('navbar', $this->navbar());
     $page->set('modules', $modules);
     $page->display();
 }
Beispiel #13
0
 public function indexAction()
 {
     $apps = array();
     $modules = (array) zotop::module();
     foreach ($modules as $module) {
         if ($module['type'] == 'plugin') {
             $apps[] = $module;
         }
     }
     $page = new page();
     $page->set('apps', $apps);
     $page->addScript('$common/js/side.js');
     $page->body = array('class' => 'side');
     $page->display();
 }
Beispiel #14
0
 public function indexAction()
 {
     $db = zotop::db();
     $database = $db->config();
     $database['version'] = $db->version();
     $database['size'] = $db->size();
     $tables = zotop::db()->tables(true);
     $page = new page();
     $page->title = '数据库管理';
     $page->set('position', $database['database'] . ' @ ' . $database['hostname']);
     $page->set('navbar', $this->navbar());
     $page->set('database', $database);
     $page->set('tables', $tables);
     $page->display();
 }
Beispiel #15
0
 public function actionBakup()
 {
     $db = zotop::model('database.database');
     if (form::isPostBack()) {
         msg::error('功能开发中……');
     }
     $database = $db->db()->config();
     $tables = $db->tables();
     $page = new page();
     $page->title = '数据库备份';
     $page->set('position', $database['database'] . ' @ ' . $database['hostname']);
     $page->set('navbar', $this->navbar());
     $page->set('database', $database);
     $page->set('tables', $tables);
     $page->display();
 }
Beispiel #16
0
 public function indexAction()
 {
     $user = zotop::model('zotop.user');
     if (form::isPostBack()) {
         $post = array();
         $post['username'] = request::post('username');
         $post['password'] = request::post('password');
         $post['logintime'] = time();
         zotop::cookie('admin.username', $post['username'], 3600);
         if (empty($post['username'])) {
             msg::error(zotop::t('登陆失败,请输入登陆账户名称'));
         }
         if (empty($post['password'])) {
             msg::error(zotop::t('登陆失败,请输入登陆账户密码'));
         }
         if (!$user->isValidUserName($post['username'])) {
             msg::error(zotop::t('登陆失败,请输入有效的账户名称'));
         }
         if (!$user->isValidPassword($post['password'])) {
             msg::error(zotop::t('登陆失败,请输入有效的账户密码'));
         }
         //读取用户
         $data = $user->read(array('username', '=', $post['username']));
         //验证
         if ($data == false) {
             msg::error(zotop::t('账户名称`{$username}`不存在,请检查是否输入有误!', array('username' => $post['username'])));
         }
         if ($user->password($post['password']) != $data['password']) {
             msg::error(zotop::t('账户密码`{$password}`错误,请检查是否输入有误!', array('password' => $post['password'])));
         }
         //用户登入
         $user->login();
         //跳转
         msg::success('登陆成功,系统正在加载中', url::current(), 2);
     }
     if (!empty($this->user)) {
         $this->redirect('zotop/index');
     }
     $data = $user->read(array('username', '=', 'admin'));
     $page = new page();
     $page->title = '系统登陆';
     $page->body = array('class' => 'login');
     $page->addScript('$this/js/login.js');
     $page->display();
 }
Beispiel #17
0
 public function actionShow($id)
 {
     $blog = zotop::model('blog.blog');
     $blog->category = zotop::model('blog.category');
     $blog->read($id);
     $blog->category->read($blog->categoryid);
     $categorys = $blog->category->getAll();
     //渲染页面
     $page = new page();
     $page->set('title', $blog->title . ' ' . $blog->category->title);
     $page->set('keywords', $blog->keywords . ' ' . $blog->category->keywords);
     $page->set('description', $blog->description . ' ' . $blog->category->description);
     $page->set('body', array('class' => 'detail'));
     $page->set('id', $id);
     $page->set('blog', $blog);
     $page->set('categorys', $categorys);
     $page->display('blog.show');
 }
Beispiel #18
0
 public function actionUpload()
 {
     $config = zotop::model('zotop.config');
     if (form::isPostBack()) {
         $post = form::post();
         $save = $config->save($post);
         if ($save) {
             msg::success('保存成功,重新加载中,请稍后……');
         }
         msg::error($save);
     }
     $fields = $config->fields('upload');
     $page = new page();
     $page->set('title', '上传设置');
     $page->set('navbar', $this->navbar());
     $page->set('fields', $fields);
     $page->display();
 }
Beispiel #19
0
 public function actionTheme()
 {
     $config = zotop::model('system.config');
     if (form::isPostBack()) {
         $post = form::post();
         $config->save($post);
         if ($config->error()) {
             msg::error($config->msg());
         }
         msg::success('保存成功');
     }
     $theme = $config->fields('system.theme');
     $page = new page();
     $page->set('title', zotop::t('系统设置'));
     $page->set('navbar', $this->navbar());
     $page->set('theme', $theme);
     $page->display();
 }
Beispiel #20
0
 public function changeInfoAction()
 {
     $user = zotop::model('zotop.user');
     $user->id = (int) zotop::user('id');
     if (form::isPostBack()) {
         $post = form::post();
         $update = $user->update($post, $user->id);
         if ($update) {
             msg::success('资料设置成功,正在刷新页面,请稍后……', url::current());
         }
         msg::error();
     }
     $data = $user->read();
     $page = new page();
     $page->title = '修改我的基本信息';
     $page->set('navbar', $this->navbar());
     $page->set('data', $data);
     $page->display();
 }
Beispiel #21
0
 public function actionInfo()
 {
     $user = zotop::model('system.user');
     $user->id = (int) zotop::user('id');
     if (form::isPostBack()) {
         $post = form::post();
         $update = $user->update($post, $user->id);
         if ($update) {
             msg::success('资料设置成功,正在刷新页面,请稍后……', url::location());
         }
         msg::error();
     }
     $data = $user->read();
     $page = new page();
     $page->title = zotop::t('个人中心');
     $page->set('navbar', $this->navbar());
     $page->set('globalid', $user->globalid());
     $page->set('data', $data);
     $page->display();
 }
Beispiel #22
0
 public function phpinfoAction()
 {
     ob_start();
     phpinfo();
     $phpinfo = ob_get_contents();
     ob_clean();
     if (preg_match('/<body><div class="center">([\\s\\S]*?)<\\/div><\\/body>/', $phpinfo, $match)) {
         $phpinfo = $match[1];
     }
     $phpinfo = str_replace('class="e"', 'style="color:#ff6600;"', $phpinfo);
     $phpinfo = str_replace('class="v"', '', $phpinfo);
     $phpinfo = str_replace('<table', '<table class="table list" style="table-layout:fixed;"', $phpinfo);
     $phpinfo = str_replace('<tr class="h">', '<tr class="title">', $phpinfo);
     $phpinfo = preg_replace('/<a href="http:\\/\\/www.php.net\\/"><img(.*)alt="PHP Logo" \\/><\\/a><h1 class="p">(.*)<\\/h1>/', "<h1>\\2</h1>", $phpinfo);
     $page = new page();
     $page->title = 'PHP探针';
     $page->set('navbar', $this->navbar());
     $page->set('phpinfo', $phpinfo);
     $page->display();
 }
Beispiel #23
0
 public function actionEdit($id)
 {
     $model = zotop::model('content.model');
     if (form::isPostBack()) {
         $post = form::post();
         $model->edit($post, $id);
         if (!$model->error()) {
             msg::success('保存成功', zotop::url('content/model/index/'));
         }
         msg::error($model->msg());
     }
     $data = $model->read($id);
     $data['settings'] = $model->settings();
     $page = new page();
     $page->set('title', zotop::t('模型管理'));
     $page->set('position', array(zotop::url('content') => zotop::t('内容管理'), zotop::url('content/model') => zotop::t('模型管理'), zotop::t('编辑模型')));
     $page->set('navbar', $this->navbar());
     $page->set('data', $data);
     $page->display();
 }
Beispiel #24
0
 public function actionIndex()
 {
     $user = zotop::model('system.user');
     if (form::isPostBack()) {
         $post = form::post();
         $user->login($post);
         if (!$user->error()) {
             msg::success(zotop::t('登陆成功,系统正在加载中'), zotop::url(), 2);
         }
         msg::error($user->msg());
     }
     if (!empty($this->user)) {
         header("Location: " . zotop::url());
         exit;
     }
     $page = new page();
     $page->set('title', zotop::t('系统管理登陆'));
     $page->set('body', array('class' => 'login'));
     $page->display();
 }
Beispiel #25
0
 public function actionIndex($parentid = 'root')
 {
     $config = zotop::model('system.config');
     if (form::isPostBack()) {
         $post = form::post();
         //保存并排序
         $save = $config->save($post, true);
         if ($save) {
             msg::success(zotop::t('保存成功'));
         }
         msg::error($save);
     }
     $configs = $config->db()->where('parentid', '=', $parentid)->orderby('order', 'asc')->getAll();
     $position = $config->position($parentid, ' <cite>></cite> <a href=\\"' . zotop::url('system/config/index') . '/$id\\">$title</a>');
     $position = '<a href="' . zotop::url('system/config/index') . '">' . zotop::t('首页') . '</a>' . $position;
     $page = new page();
     $page->set('title', zotop::t('注册表管理 '));
     $page->set('position', $position);
     $page->set('navbar', $this->navbar($parentid));
     $page->set('configs', $configs);
     $page->display();
 }
Beispiel #26
0
 public function actionIndex($type = 'all', $folderid = 0)
 {
     $file = zotop::model('system.file');
     $folder = zotop::model('system.folder');
     if (!empty($type) && $type != 'all') {
         $where = array('file.type', '=', $type);
     }
     $files = $file->db()->select('file.*', 'user.name as user_name', 'user.username as user_username')->join('user', 'user.id', 'file.userid')->where($where)->orderby('file.createtime', 'desc')->getPage();
     //zotop::dump($file->db()->Sql());
     $types = $file->types();
     $pagination = new pagination();
     $pagination->page = $files['page'];
     $pagination->pagesize = $files['pagesize'];
     $pagination->total = $files['total'];
     $p = $pagination->render();
     $totalsize = $file->totalsize($where);
     $totalcount = $file->count();
     $folders = $folder->getAll();
     $tree = new tree($folders, 0);
     $position = $tree->getPosition($folderid);
     foreach ($position as $p) {
         $pos[zotop::url('system/file/index/' . $type . '/' . $p['id'])] = $p['title'];
     }
     $page = new page();
     $page->set('title', zotop::t('文件管理'));
     $page->set('position', array(zotop::url('system/file') => zotop::t('文件管理'), zotop::url('system/file/' . $type . '/0') => zotop::t('全部文件')) + (array) $pos + array('列表'));
     $page->set('navbar', $this->navbar());
     $page->set('page', $files['page']);
     $page->set('pagesize', $files['pagesize']);
     $page->set('total', $files['total']);
     $page->set('files', $files['data']);
     $page->set('totalsize', $totalsize);
     $page->set('totalcount', $totalcount);
     $page->set('pagination', $p);
     $page->set('types', $types);
     $page->set('type', $type);
     $page->set('folderid', $folderid);
     $page->display();
 }
Beispiel #27
0
 public function indexAction($parentid = 'root')
 {
     $config = zotop::model('zotop.config');
     if (form::isPostBack()) {
         $post = form::post();
         $save = $config->save($post);
         if ($save) {
             msg::success('保存成功,重新加载中,请稍后……', zotop::url('zotop/config/index', array('parentid' => $parentid)));
         }
         msg::error(zotop::dump($post, true));
     }
     $configs = $config->getAll(array('where' => array('parentid', '=', $parentid), 'orderby' => array('order' => 'asc')));
     //zotop::dump($configs);
     $position = $config->position($parentid, ' > <a href=\\"' . zotop::url('zotop/config/index') . '/$id\\">$title</a>');
     $position = '<a href="' . zotop::url('zotop/config/index') . '">注册表首页</a>' . $position;
     $page = new page();
     $page->set('title', '注册表管理 ');
     $page->set('position', $position);
     $page->set('navbar', $this->navbar($parentid));
     $page->set('configs', $configs);
     $page->display();
 }
Beispiel #28
0
 public function actionIndex($categoryid = 0, $page = 1)
 {
     $blog = zotop::model('blog.blog');
     $blog->category = zotop::model('blog.category');
     $blogs = $blog->getPage($categoryid, 100, $page, 15);
     if (!empty($categoryid)) {
         $blog->category->read($categoryid);
     }
     $categorys = $blog->category->getAll();
     $pagination = pagination::output($blogs['total'], $blogs['page'], $blogs['pagesize'], zotop::url("blog/list/{$categoryid}/{#page}"));
     //渲染页面
     $page = new page();
     $page->set('title', $blog->category->title);
     $page->set('keywords', $blog->category->keywords);
     $page->set('description', $blog->category->description);
     $page->set('body', array('class' => 'list'));
     $page->set('categoryid', $categoryid);
     $page->set('blog', $blog);
     $page->set('blogs', $blogs);
     $page->set('categorys', $categorys);
     $page->set('pagination', $pagination);
     $page->display('blog.list');
 }
Beispiel #29
0
 public function actionIndex($dir = '')
 {
     $dir = url::clean($dir);
     $path = ZOTOP_PATH_ROOT . DS . trim($dir, DS);
     $path = path::clean($path);
     //获取当前目录的子目录及子文件
     $folders = (array) dir::folders($path);
     $files = (array) dir::files($path);
     $position = '<a href="' . zotop::url('webftp/index/index') . '">wwwroot</a>';
     $dirs = arr::dirpath($dir, '/');
     foreach ($dirs as $d) {
         $position .= ' / <a href="' . zotop::url('webftp/index/index', array('dir' => rawurlencode($d[1]))) . '">' . $d[0] . '</a>';
     }
     $page = new page();
     $page->title = '文件管理器';
     $page->set('position', $position);
     $page->set('navbar', $this->navbar($dir));
     $page->set('folders', $folders);
     $page->set('files', $files);
     $page->set('path', $path);
     $page->set('dir', $dir);
     $page->display();
 }
Beispiel #30
0
 public function actionIndex($tablename)
 {
     $db = zotop::db();
     $database = $db->config();
     $database['version'] = $db->version();
     $database['size'] = $db->size();
     $tables = $db->tables(true);
     $table = $tables[$tablename];
     $fields = array();
     if (isset($table)) {
         $fields = $db->table($tablename)->fields(true);
     }
     $indexes = $db->table($tablename)->index();
     $page = new page();
     $page->title = '数据库管理';
     $page->set('position', '<a href="' . zotop::url('database/table') . '">' . $database['database'] . ' @ ' . $database['hostname'] . '</a><i>></i> 数据表 : <b>' . $tablename . '</b>');
     $page->set('navbar', $this->navbar($tablename));
     $page->set('database', $database);
     $page->set('tablename', $tablename);
     $page->set('table', $table);
     $page->set('fields', $fields);
     $page->set('indexes', $indexes);
     $page->display();
 }