Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit de96331
Showing
544 changed files
with
99,131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Thunbs.db | ||
.idea | ||
*.log | ||
node_modules/ | ||
/Runtime/ | ||
/Theme/ | ||
/Uploads/ | ||
!*.md | ||
!/vendor | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L] | ||
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# 插件目录 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
// +---------------------------------------------------------------------- | ||
// | 零云 [ 简单 高效 卓越 ] | ||
// +---------------------------------------------------------------------- | ||
// | Copyright (c) 2016 http://www.lingyun.net All rights reserved. | ||
// +---------------------------------------------------------------------- | ||
// | Author: jry <598821125@qq.com> | ||
// +---------------------------------------------------------------------- | ||
namespace Addons\RocketToTop; | ||
use Common\Controller\Addon; | ||
/** | ||
* 小火箭返回顶部 | ||
* @jry <598821125@qq.com> | ||
*/ | ||
class RocketToTopAddon extends Addon{ | ||
/** | ||
* 插件信息 | ||
* @author jry <598821125@qq.com> | ||
*/ | ||
public $info = array( | ||
'name' => 'RocketToTop', | ||
'title' => '小火箭返回顶部', | ||
'description' => '小火箭返回顶部', | ||
'status' => '1', | ||
'author' => 'OpenCMF', | ||
'version' => '1.3.0', | ||
); | ||
|
||
/** | ||
* 插件安装方法 | ||
* @author jry <598821125@qq.com> | ||
*/ | ||
public function install(){ | ||
return true; | ||
} | ||
|
||
/** | ||
* 插件卸载方法 | ||
* @author jry <598821125@qq.com> | ||
*/ | ||
public function uninstall(){ | ||
return true; | ||
} | ||
|
||
/** | ||
* 实现的PageFooter钩子方法 | ||
* @author jry <598821125@qq.com> | ||
*/ | ||
public function PageFooter($param){ | ||
$addons_config = $this->getConfig(); | ||
if($addons_config['status']){ | ||
$this->display('rocket'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
// +---------------------------------------------------------------------- | ||
// | 零云 [ 简单 高效 卓越 ] | ||
// +---------------------------------------------------------------------- | ||
// | Copyright (c) 2016 http://www.lingyun.net All rights reserved. | ||
// +---------------------------------------------------------------------- | ||
// | Author: jry <598821125@qq.com> | ||
// +---------------------------------------------------------------------- | ||
return array( | ||
'status'=>array( | ||
'title'=>'是否开启:', | ||
'type'=>'radio', | ||
'options'=>array( | ||
'1'=>'开启', | ||
'0'=>'关闭', | ||
), | ||
'value'=>'1', | ||
), | ||
); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<style> | ||
#rocket-to-top div { | ||
left:0; | ||
margin:0; | ||
overflow:hidden; | ||
padding:0; | ||
position:absolute; | ||
top:0; | ||
width:88px; | ||
background: red; | ||
} | ||
#rocket-to-top .level-2 { | ||
background:url("__ADDONROOT__/images/rocket_button_up.png") no-repeat scroll -88px 0 transparent; | ||
display:none; | ||
height:200px; | ||
opacity:0; | ||
z-index:1; | ||
} | ||
#rocket-to-top .level-3 { | ||
background:none repeat scroll 0 0 transparent; | ||
cursor:pointer; | ||
display:block; | ||
height:150px; | ||
z-index:2; | ||
} | ||
#rocket-to-top { | ||
background:url("__ADDONROOT__/images/rocket_button_up.png") no-repeat scroll 0 0 transparent; | ||
cursor:default; | ||
display:block; | ||
height:200px; | ||
margin:-25px 0 0; | ||
overflow:hidden; | ||
padding:0; | ||
position:fixed; | ||
right:0; | ||
top:70%; | ||
width:88px; | ||
z-index:11; | ||
} | ||
@media (max-width: 768px) { | ||
.returntop { | ||
display: none; | ||
} | ||
} | ||
</style> | ||
<div class="returntop"> | ||
<div style="display:none;" id="rocket-to-top"> | ||
<div style="opacity:0;display:block;" class="level-2"></div> | ||
<div class="level-3"></div> | ||
</div> | ||
<script> | ||
$(function() { | ||
var e = $("#rocket-to-top"), | ||
t = $(document).scrollTop(), | ||
n, | ||
r, | ||
i = !0; | ||
$(window).scroll(function() { | ||
var t = $(document).scrollTop(); | ||
t == 0 ? e.css("background-position") == "0px 0px" ? e.fadeOut("slow") : i && (i = !1, $(".level-2").css("opacity", 1), e.delay(100).animate({ | ||
marginTop: "-1000px" | ||
}, | ||
"normal", | ||
function() { | ||
e.css({ | ||
"margin-top": "-25px", | ||
display: "none" | ||
}), | ||
i = !0 | ||
})) : e.fadeIn("slow") | ||
}), | ||
e.hover(function() { | ||
$(".level-2").stop(!0).animate({ | ||
opacity: 1 | ||
}) | ||
}, | ||
function() { | ||
$(".level-2").stop(!0).animate({ | ||
opacity: 0 | ||
}) | ||
}), | ||
$(".level-3").click(function() { | ||
function t() { | ||
var t = e.css("background-position"); | ||
if (e.css("display") == "none" || i == 0) { | ||
clearInterval(n), | ||
e.css("background-position", "0px 0px"); | ||
e.css("height", "200px;"); | ||
return | ||
} | ||
switch (t){ | ||
case "0px 0px": | ||
e.css("background-position", "-176px 0px"); | ||
break; | ||
case "-176px 0px": | ||
e.css("background-position", "-264px 0px"); | ||
break; | ||
case "-264px 0px": | ||
e.css("background-position", "-352px 0px"); | ||
break; | ||
case "-352px 0px": | ||
e.css("background-position", "-440px 0px"); | ||
break; | ||
case "-440px 0px": | ||
e.css("background-position", "-176px 0px"); | ||
} | ||
} | ||
if (!i) return; | ||
n = setInterval(t, 50), | ||
$("html,body").animate({scrollTop: 0},"slow"); | ||
}); | ||
}); | ||
</script> | ||
</div> |
132 changes: 132 additions & 0 deletions
132
Application/Admin/Controller/AccessController.class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
<?php | ||
// +---------------------------------------------------------------------- | ||
// | 零云 [ 简单 高效 卓越 ] | ||
// +---------------------------------------------------------------------- | ||
// | Copyright (c) 2016 http://www.lingyun.net All rights reserved. | ||
// +---------------------------------------------------------------------- | ||
// | Author: jry <598821125@qq.com> | ||
// +---------------------------------------------------------------------- | ||
namespace Admin\Controller; | ||
use Common\Util\Think\Page; | ||
/** | ||
* 管理员控制器 | ||
* @author jry <598821125@qq.com> | ||
*/ | ||
class AccessController extends AdminController { | ||
/** | ||
* 管理员列表 | ||
* @param $tab 配置分组ID | ||
* @author jry <598821125@qq.com> | ||
*/ | ||
public function index() { | ||
// 搜索 | ||
$keyword = I('keyword', '', 'string'); | ||
$condition = array('like','%'.$keyword.'%'); | ||
$map['id|uid'] = array( | ||
$condition, | ||
$condition, | ||
'_multi'=>true | ||
); | ||
|
||
// 获取所有配置 | ||
$map['status'] = array('egt', '0'); // 禁用和正常状态 | ||
$p = !empty($_GET["p"]) ? $_GET['p'] : 1; | ||
$access_object = D('Access'); | ||
$data_list = $access_object | ||
->page($p, C('ADMIN_PAGE_ROWS')) | ||
->where($map) | ||
->order('sort asc,id asc') | ||
->select(); | ||
$page = new Page( | ||
$access_object->where($map)->count(), | ||
C('ADMIN_PAGE_ROWS') | ||
); | ||
|
||
// 设置Tab导航数据列表 | ||
$group_object = D('Group'); | ||
$user_object = D('User'); | ||
foreach ($data_list as $key => &$val) { | ||
$val['username'] = $user_object->getFieldById($val['uid'], 'username'); | ||
$val['group_title'] = $group_object->getFieldById($val['group'], 'title'); | ||
} | ||
|
||
// 使用Builder快速建立列表页面。 | ||
$builder = new \Common\Builder\ListBuilder(); | ||
$builder->setMetaTitle('管理员列表') // 设置页面标题 | ||
->addTopButton('addnew') // 添加新增按钮 | ||
->addTopButton('resume') // 添加启用按钮 | ||
->addTopButton('forbid') // 添加禁用按钮 | ||
->addTopButton('delete') // 添加删除按钮 | ||
->setSearch('请输入ID/UID', U('index')) | ||
->addTableColumn('id', 'ID') | ||
->addTableColumn('uid', 'UID') | ||
->addTableColumn('username', '用户名') | ||
->addTableColumn('group_title', '用户组') | ||
->addTableColumn('status', '状态', 'status') | ||
->addTableColumn('right_button', '操作', 'btn') | ||
->setTableDataList($data_list) // 数据列表 | ||
->setTableDataPage($page->show()) // 数据列表分页 | ||
->addRightButton('edit') // 添加编辑按钮 | ||
->addRightButton('forbid') // 添加禁用/启用按钮 | ||
->addRightButton('delete') // 添加删除按钮 | ||
->display(); | ||
} | ||
|
||
/** | ||
* 新增 | ||
* @author jry <598821125@qq.com> | ||
*/ | ||
public function add(){ | ||
if (IS_POST) { | ||
$access_object = D('Access'); | ||
$data = $access_object->create(); | ||
if ($data) { | ||
if ($access_object->add($data)) { | ||
$this->success('新增成功', U('index')); | ||
} else { | ||
$this->error('新增失败'); | ||
} | ||
} else { | ||
$this->error($access_object->getError()); | ||
} | ||
} else { | ||
//使用FormBuilder快速建立表单页面。 | ||
$builder = new \Common\Builder\FormBuilder(); | ||
$builder->setMetaTitle('新增配置') //设置页面标题 | ||
->setPostUrl(U('add')) //设置表单提交地址 | ||
->addFormItem('uid', 'uid', 'UID', '用户ID') | ||
->addFormItem('group', 'select', '用户组', '不同用户组对应相应的权限', select_list_as_tree('Group')) | ||
->display(); | ||
} | ||
} | ||
|
||
/** | ||
* 编辑 | ||
* @author jry <598821125@qq.com> | ||
*/ | ||
public function edit($id){ | ||
if (IS_POST) { | ||
$access_object = D('Access'); | ||
$data = $access_object->create(); | ||
if ($data) { | ||
if ($access_object->save($data)) { | ||
$this->success('更新成功', U('index')); | ||
} else { | ||
$this->error('更新失败'); | ||
} | ||
} else { | ||
$this->error($access_object->getError()); | ||
} | ||
} else { | ||
// 使用FormBuilder快速建立表单页面。 | ||
$builder = new \Common\Builder\FormBuilder(); | ||
$builder->setMetaTitle('编辑配置') // 设置页面标题 | ||
->setPostUrl(U('edit')) // 设置表单提交地址 | ||
->addFormItem('id', 'hidden', 'ID', 'ID') | ||
->addFormItem('uid', 'uid', 'UID', '用户ID') | ||
->addFormItem('group', 'select', '用户组', '不同用户组对应相应的权限', select_list_as_tree('Group')) | ||
->setFormData(D('Access')->find($id)) | ||
->display(); | ||
} | ||
} | ||
} |
Oops, something went wrong.