|
@@ -166,6 +166,10 @@ class Database
|
|
|
} else {
|
|
|
$state = '&search_option_state=' . $state;
|
|
|
}
|
|
|
+ $page_type = Dever::input('page_type');
|
|
|
+ if ($page_type) {
|
|
|
+ $param .= '&page_type=' . $page_type . '';
|
|
|
+ }
|
|
|
$param = 'project=' . $this->project . $param . '&table=' . $table . '&menu=' . $this->menu . '&menu_id=' . $this->menu_id . $state . $suffix;
|
|
|
|
|
|
return $param;
|
|
@@ -576,7 +580,12 @@ class Database
|
|
|
$key = 'page_' . $key;
|
|
|
|
|
|
if (isset($config['manage'][$key])) {
|
|
|
- $result['content'] = Dever::view($config['manage'][$key], 'manage', $this->project);
|
|
|
+ if ($config['manage'][$key] == 'photo' && isset($config['manage']['photo'])) {
|
|
|
+ $result['content'] = Dever::view('list/photo', false, 'manage');
|
|
|
+ } else {
|
|
|
+ $result['content'] = Dever::view($config['manage'][$key], 'manage', $this->project);
|
|
|
+ }
|
|
|
+
|
|
|
//echo $result['content'];die;
|
|
|
if ($result['content']) {
|
|
|
Dever::setInput('page_content', 1);
|
|
@@ -584,7 +593,9 @@ class Database
|
|
|
$result['s2'] = 'display:none';
|
|
|
|
|
|
# 添加底部
|
|
|
- $result['content'] .= Dever::view('foot', 'inc', 'manage');
|
|
|
+ if ($key != 'page_list_table') {
|
|
|
+ $result['content'] .= Dever::view('inc/foot', false, 'manage');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1379,7 +1390,7 @@ class Database
|
|
|
$option = array($col => $v);
|
|
|
$v = Dever::load($config['manage']['search']['api'][$k]['api'], $option);
|
|
|
$result = $config['manage']['search']['api'][$k]['result'];
|
|
|
- if (is_array($v)) {
|
|
|
+ if ($v && is_array($v)) {
|
|
|
if (isset($v[$result])) {
|
|
|
$v = $v[$result];
|
|
|
} else {
|
|
@@ -1395,8 +1406,11 @@ class Database
|
|
|
|
|
|
$param['option'][$k] = array('yes', 'in');
|
|
|
}
|
|
|
+ } else {
|
|
|
+ $v = '-100';
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
$param['option_' . $k] = $v;
|
|
|
}
|
|
|
}
|
|
@@ -1552,7 +1566,49 @@ class Database
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 列表页数据列表
|
|
|
+ * 列表页数据列表:图片形式
|
|
|
+ *
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function list_photo()
|
|
|
+ {
|
|
|
+ $config = $this->config();
|
|
|
+ $result = array();
|
|
|
+ if (isset($config['manage']['photo'])) {
|
|
|
+
|
|
|
+ $high = array();
|
|
|
+
|
|
|
+ $search = Dever::load('manage/auth.oper', 2) ? Dever::preInput('search_') : false;
|
|
|
+
|
|
|
+ $param = array();
|
|
|
+
|
|
|
+ $parent = 0;
|
|
|
+ if ($search) {
|
|
|
+ list($param, $high) = $this->list_tbody_search($config, $param, $high, $search);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (empty($param['page'])) {
|
|
|
+ $num = $this->getNumConfig($config);
|
|
|
+ if ($num) {
|
|
|
+ $param['page'][0] = $num[0];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $method = $this->project . '/' . $this->table . '-list';
|
|
|
+ $result = Dever::load($method, $param);
|
|
|
+ if ($result) {
|
|
|
+ foreach ($result as $k => $v) {
|
|
|
+ $result[$k] = Dever::load($config['manage']['photo'], $v);
|
|
|
+ $result[$k]['button'] = $this->list_tbody_button($config, $v, 'div');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 列表页数据列表:表格形式
|
|
|
*
|
|
|
* @return array
|
|
|
*/
|
|
@@ -1763,58 +1819,7 @@ class Database
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (isset($config['manage']['_list']['value'])) {
|
|
|
- $result[$k] .= '<td>';
|
|
|
- if ($config['state'] == 2) {
|
|
|
- if (isset($config['manage']['_list']['value']['update'])) {
|
|
|
- unset($config['manage']['_list']['value']['update']);
|
|
|
- }
|
|
|
- if (isset($config['manage']['_list']['value']['delete'])) {
|
|
|
- $config['manage']['_list']['value']['delete'] = '恢复';
|
|
|
- }
|
|
|
- }
|
|
|
- foreach ($config['manage']['_list']['value'] as $kj => $vj) {
|
|
|
- $pj = false;
|
|
|
-
|
|
|
- $h = '<span class="am-icon-pencil-square-o"></span>';
|
|
|
- $oper = true;
|
|
|
- if ($kj == 'update') {
|
|
|
- $oper = Dever::load('manage/auth.oper', 3);
|
|
|
- } elseif ($kj == 'delete') {
|
|
|
- $oper = Dever::load('manage/auth.oper', 5);
|
|
|
-
|
|
|
- $h = '<span class="am-icon-trash-o"></span>';
|
|
|
- }
|
|
|
-
|
|
|
- if (is_array($vj) && isset($vj[1])) {
|
|
|
- if (isset($vj[2])) {
|
|
|
- $oper = $this->value($vj[2], $data[$k]);
|
|
|
- }
|
|
|
- if ($oper && strpos($vj[1], 'modal|') === false) {
|
|
|
- $pj = $this->value($vj[1], $data[$k]);
|
|
|
- $vjn = $vj[0];
|
|
|
- }
|
|
|
- } else {
|
|
|
- $vjn = $vj;
|
|
|
- }
|
|
|
-
|
|
|
- if ($oper == true) {
|
|
|
- if (strpos($kj, 'edit') !== false) {
|
|
|
- $result[$k] .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $this->url($kj, $v['id']) . '\', \''.$vj[0].'\', \''.$vj[1].'\')"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5">' . $vj[0] . '</button></a> ';
|
|
|
- } elseif (strpos($kj, 'oper') !== false) {
|
|
|
- $result[$k] .= '<a href="javascript:;" onclick="load(\'' . Dever::url($pj) . '\')"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5">' . $vj[0] . '</button></a> ';
|
|
|
- } elseif (isset($vj[1]) && strpos($vj[1], 'modal|') !== false) {
|
|
|
- $t = explode('|', $vj[1]);
|
|
|
- $result[$k] .= '<a href="#dever_modal" data-toggle="modal" class="btn btn-info btn-rounded waves-effect waves-light m-b-5" onclick=' . $t[1] . ' msg-send="' . $this->value($t[2], $data[$k]) . '">' . $vj[0] . '</a> ';
|
|
|
- } elseif (isset($vj[1])) {
|
|
|
- $result[$k] .= '<a href="' . $this->url($kj, $v['id'], $pj) . '" class="oper_' . $kj . '"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5">' . $h . $vjn . '</button></a> ';
|
|
|
- } else {
|
|
|
- $result[$k] .= '<span style="margin-left:5px;margin-right:10px;">' . $vj[0] . '</span>';
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- $result[$k] .= '</td>';
|
|
|
- }
|
|
|
+ $result[$k] .= $this->list_tbody_button($config, $data[$k]);
|
|
|
|
|
|
$result[$k] .= '</tr>';
|
|
|
}
|
|
@@ -1837,6 +1842,65 @@ class Database
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
+ private function list_tbody_button($config, $data, $type = 'td')
|
|
|
+ {
|
|
|
+ $result = '';
|
|
|
+ if (isset($config['manage']['_list']['value'])) {
|
|
|
+ $result = '<'.$type.'>';
|
|
|
+ if ($config['state'] == 2) {
|
|
|
+ if (isset($config['manage']['_list']['value']['update'])) {
|
|
|
+ unset($config['manage']['_list']['value']['update']);
|
|
|
+ }
|
|
|
+ if (isset($config['manage']['_list']['value']['delete'])) {
|
|
|
+ $config['manage']['_list']['value']['delete'] = '恢复';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ foreach ($config['manage']['_list']['value'] as $kj => $vj) {
|
|
|
+ $pj = false;
|
|
|
+
|
|
|
+ $h = '<span class="am-icon-pencil-square-o"></span>';
|
|
|
+ $oper = true;
|
|
|
+ if ($kj == 'update') {
|
|
|
+ $oper = Dever::load('manage/auth.oper', 3);
|
|
|
+ } elseif ($kj == 'delete') {
|
|
|
+ $oper = Dever::load('manage/auth.oper', 5);
|
|
|
+
|
|
|
+ $h = '<span class="am-icon-trash-o"></span>';
|
|
|
+ }
|
|
|
+
|
|
|
+ if (is_array($vj) && isset($vj[1])) {
|
|
|
+ if (isset($vj[2])) {
|
|
|
+ $oper = $this->value($vj[2], $data);
|
|
|
+ }
|
|
|
+ if ($oper && strpos($vj[1], 'modal|') === false) {
|
|
|
+ $pj = $this->value($vj[1], $data);
|
|
|
+ $vjn = $vj[0];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $vjn = $vj;
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($oper == true) {
|
|
|
+ if (strpos($kj, 'edit') !== false) {
|
|
|
+ $result .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $this->url($kj, $data['id']) . '\', \''.$vj[0].'\', \''.$vj[1].'\')"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5">' . $vj[0] . '</button></a> ';
|
|
|
+ } elseif (strpos($kj, 'oper') !== false) {
|
|
|
+ $result .= '<a href="javascript:;" onclick="load(\'' . Dever::url($pj) . '\')"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5">' . $vj[0] . '</button></a> ';
|
|
|
+ } elseif (isset($vj[1]) && strpos($vj[1], 'modal|') !== false) {
|
|
|
+ $t = explode('|', $vj[1]);
|
|
|
+ $result .= '<a href="#dever_modal" data-toggle="modal" class="btn btn-info btn-rounded waves-effect waves-light m-b-5" onclick=' . $t[1] . ' msg-send="' . $this->value($t[2], $data) . '">' . $vj[0] . '</a> ';
|
|
|
+ } elseif (isset($vj[1])) {
|
|
|
+ $result .= '<a href="' . $this->url($kj, $data['id'], $pj) . '" class="oper_' . $kj . '"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5">' . $h . $vjn . '</button></a> ';
|
|
|
+ } else {
|
|
|
+ $result .= '<span style="margin-left:5px;margin-right:10px;">' . $vj[0] . '</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $result .= '</'.$type.'>';
|
|
|
+ }
|
|
|
+
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 多级分类
|
|
|
*
|
|
@@ -2019,9 +2083,10 @@ class Database
|
|
|
//print_r($config['manage']['update']);die;
|
|
|
$data = $this->getAdminInfo($data);
|
|
|
$col = Dever::input('col');
|
|
|
+
|
|
|
foreach ($config['struct'] as $k => $v) {
|
|
|
if (isset($v['update'])) {
|
|
|
- if ($col && !strstr($col, $k)) {
|
|
|
+ if ($col && !strstr(',' . $col . ',', ',' . $k . ',')) {
|
|
|
continue;
|
|
|
}
|
|
|
//处理权限
|