|
|
|
@ -565,71 +565,97 @@ class AdminController extends Controller {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function addShortcutIcon() {
|
|
|
|
|
|
|
|
|
|
$Kuaijieicon = M('Kuaijieicon');
|
|
|
|
|
|
|
|
|
|
$result = $Kuaijieicon->where(['url'=>$_REQUEST['url']])->find();
|
|
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
|
|
|
|
|
|
if ($result['status'] == 0) {
|
|
|
|
|
|
|
|
|
|
$data = array('status'=>1,'id'=>$result['id']);
|
|
|
|
|
|
|
|
|
|
$id = $Kuaijieicon->save($data);
|
|
|
|
|
|
|
|
|
|
if($id){
|
|
|
|
|
//记录行为
|
|
|
|
|
action_log('Kuaijie/edit', 'Kuaijieicon', $result['id'], UID);
|
|
|
|
|
$this->success('添加成功');
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('添加失败');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$this->error('已添加过常用设置');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
public function addShortcutIcon() {
|
|
|
|
|
|
|
|
|
|
$Kuaijieicon = M('Kuaijieicon');
|
|
|
|
|
|
|
|
|
|
$result = $Kuaijieicon->where(['url'=>$_REQUEST['url']])->find();
|
|
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
|
|
|
|
|
|
if ($result['status'] == 0) {
|
|
|
|
|
|
|
|
|
|
$data = array('status'=>1,'id'=>$result['id']);
|
|
|
|
|
|
|
|
|
|
$id = $Kuaijieicon->save($data);
|
|
|
|
|
|
|
|
|
|
if($id){
|
|
|
|
|
//记录行为
|
|
|
|
|
action_log('Kuaijie/edit', 'Kuaijieicon', $result['id'], UID);
|
|
|
|
|
$this->success('添加成功');
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('添加失败');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$this->error('已添加过常用设置');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$data = array('title'=>$_REQUEST['title'],'status'=>1,'url'=>$_REQUEST['url'],'value'=>0);
|
|
|
|
|
|
|
|
|
|
$id = $Kuaijieicon->add($data);
|
|
|
|
|
|
|
|
|
|
if($id){
|
|
|
|
|
//记录行为
|
|
|
|
|
action_log('Kuaijie/add', 'Kuaijieicon', $id, UID);
|
|
|
|
|
$this->success('添加成功');
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('添加失败');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public function delShortcutIcon($id=0) {
|
|
|
|
|
|
|
|
|
|
if (!is_numeric($id) || $id<1) {$this->error('参数错误');}
|
|
|
|
|
|
|
|
|
|
$Kuaijieicon = M('Kuaijieicon');
|
|
|
|
|
|
|
|
|
|
$data = array('title'=>$_REQUEST['title'],'status'=>1,'url'=>$_REQUEST['url'],'value'=>0);
|
|
|
|
|
|
|
|
|
|
$id = $Kuaijieicon->add($data);
|
|
|
|
|
|
|
|
|
|
if($id){
|
|
|
|
|
//记录行为
|
|
|
|
|
action_log('Kuaijie/add', 'Kuaijieicon', $id, UID);
|
|
|
|
|
$this->success('添加成功');
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('添加失败');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function delShortcutIcon($id=0) {
|
|
|
|
|
|
|
|
|
|
if (!is_numeric($id) || $id<1) {$this->error('参数错误');}
|
|
|
|
|
|
|
|
|
|
$Kuaijieicon = M('Kuaijieicon');
|
|
|
|
|
|
|
|
|
|
$data = array('status'=>0,'id'=>$id);
|
|
|
|
|
|
|
|
|
|
$res = $Kuaijieicon->save($data);
|
|
|
|
|
|
|
|
|
|
if($res){
|
|
|
|
|
//记录行为
|
|
|
|
|
action_log('Kuaijie/del', 'Kuaijieicon', $id, UID);
|
|
|
|
|
$this->success('删除成功');
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('删除失败');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
$data = array('status'=>0,'id'=>$id);
|
|
|
|
|
|
|
|
|
|
$res = $Kuaijieicon->save($data);
|
|
|
|
|
|
|
|
|
|
if($res){
|
|
|
|
|
//记录行为
|
|
|
|
|
action_log('Kuaijie/del', 'Kuaijieicon', $id, UID);
|
|
|
|
|
$this->success('删除成功');
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('删除失败');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 验证列表的展示或者统计权限
|
|
|
|
|
* @param [type] $type 0:"_list_check",1:"_count_check"
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function checkListOrCountAuth($type,$checkarr = false)
|
|
|
|
|
{
|
|
|
|
|
$flag = false;
|
|
|
|
|
if(IS_ROOT){ $flag=true; }
|
|
|
|
|
$suffix = $type=="list" ? "_list_check" :"_count_check";
|
|
|
|
|
$rule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME.$suffix);
|
|
|
|
|
if($this->checkRule($rule,array('in','1,2'))){
|
|
|
|
|
$flag = true;
|
|
|
|
|
}
|
|
|
|
|
if(!$flag && $checkarr){
|
|
|
|
|
foreach ($checkarr as $v) {
|
|
|
|
|
if(isset($_REQUEST[$v])){
|
|
|
|
|
$flag = true;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if($type == "count"){
|
|
|
|
|
$this->assign("rule_count_check",$flag);
|
|
|
|
|
}else{
|
|
|
|
|
return $flag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|