|
@@ -556,7 +556,6 @@ class Database
|
|
|
|
|
|
$config['level'] = 1;
|
|
|
|
|
|
- $option = array('select', 'group', 'linkage');
|
|
|
foreach ($config['struct'] as $k => $v) {
|
|
|
if (isset($v['level'])) {
|
|
|
$config['level'] = 3;
|
|
@@ -570,32 +569,39 @@ class Database
|
|
|
if (!isset($config['search'])) {
|
|
|
if (isset($v['search']) && is_string($v['search'])) {
|
|
|
|
|
|
- $config['manage']['search'][$v['search']][$k]['lang'] = $v['name'];
|
|
|
+ $search = array();
|
|
|
+
|
|
|
+ if (strpos($v['name'], '-') !== false) {
|
|
|
+ $t = explode('-', $v['name']);
|
|
|
+ $v['name'] = $t[0];
|
|
|
+ }
|
|
|
+ $search['lang'] = $v['name'];
|
|
|
if ($v['search'] == 'fulltext' && isset($v['match'])) {
|
|
|
$config['request']['list']['option'][$k] = array('option', 'like_score');
|
|
|
}
|
|
|
|
|
|
- if (isset($v['option'])) {
|
|
|
- $config['manage']['search'][$v['search']][$k]['option'] = $v['option'];
|
|
|
- }
|
|
|
- if (isset($v['exist'])) {
|
|
|
- $config['manage']['search'][$v['search']][$k]['option'] = $v['exist'];
|
|
|
- }
|
|
|
if (isset($v['search_option'])) {
|
|
|
- $config['manage']['search'][$v['search']][$k]['option'] = $v['search_option'];
|
|
|
+ $search['option'] = $v['search_option'];
|
|
|
+ } elseif (isset($v['exist'])) {
|
|
|
+ $search['option'] = $v['exist'];
|
|
|
+ } elseif (isset($v['option'])) {
|
|
|
+ $search['option'] = $v['option'];
|
|
|
}
|
|
|
+
|
|
|
if (isset($v['default'])) {
|
|
|
- $config['manage']['search'][$v['search']][$k]['default'] = $v['default'];
|
|
|
+ $search['default'] = $v['default'];
|
|
|
}
|
|
|
if (isset($v['search_after'])) {
|
|
|
- $config['manage']['search'][$v['search']][$k]['after'] = $v['search_after'];
|
|
|
+ $search['after'] = $v['search_after'];
|
|
|
}
|
|
|
if (isset($v['search_name'])) {
|
|
|
- $config['manage']['search'][$v['search']][$k]['lang'] = $v['search_name'];
|
|
|
+ $search['lang'] = $v['search_name'];
|
|
|
}
|
|
|
if (isset($v['search_order'])) {
|
|
|
- $config['manage']['search'][$v['search']][$k]['order'] = $v['search_order'];
|
|
|
+ $search['order'] = $v['search_order'];
|
|
|
}
|
|
|
+
|
|
|
+ $config['manage']['search'][$v['search']][$k] = $search;
|
|
|
} elseif (isset($v['search']) && is_array($v['search'])) {
|
|
|
if (isset($v['search']['api'])) {
|
|
|
$config['manage']['search']['api'][$k] = $v['search'];
|
|
@@ -613,6 +619,7 @@ class Database
|
|
|
$config['end']['insert'] = $v['value'];
|
|
|
}
|
|
|
*/
|
|
|
+
|
|
|
|
|
|
|
|
|
if (isset($v['update'])) {
|
|
@@ -1201,6 +1208,9 @@ class Database
|
|
|
if (isset($config['manage']['search']['select'])) {
|
|
|
$this->list_search_br($result);
|
|
|
foreach ($config['manage']['search']['select'] as $k => $v) {
|
|
|
+ if (!isset($v['option'])) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
$bind = array();
|
|
|
$parent = '';
|
|
|
$option = $this->option($v['option']);
|
|
@@ -1217,9 +1227,8 @@ class Database
|
|
|
}
|
|
|
$this->list_search_select($result, $search, $prefix . 'option_' . $k, $v['lang'], $option, $v['default'], $bind, $parent);
|
|
|
|
|
|
- print_r($v);die;
|
|
|
- if (isset($v['search_after']) && $v['search_after']) {
|
|
|
- echo 11;die;
|
|
|
+ if (isset($v['after']) && $v['after']) {
|
|
|
+ $result .= $v['after'];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1227,14 +1236,26 @@ class Database
|
|
|
if (isset($config['manage']['search']['exist'])) {
|
|
|
$this->list_search_br($result);
|
|
|
foreach ($config['manage']['search']['exist'] as $k => $v) {
|
|
|
+ if (!isset($v['option'])) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
$this->list_search_select($result, $search, $prefix . 'exist_' . $k, $v['lang'], $this->option($v['option']), '');
|
|
|
+ if (isset($v['after']) && $v['after']) {
|
|
|
+ $result .= $v['after'];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (isset($config['manage']['search']['group'])) {
|
|
|
$this->list_search_br($result);
|
|
|
foreach ($config['manage']['search']['group'] as $k => $v) {
|
|
|
+ if (!isset($v['option'])) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
$this->list_search_group($result, $search, $prefix . 'option_' . $k, $v['lang'], $this->option($v['option']), $v['default']);
|
|
|
+ if (isset($v['after']) && $v['after']) {
|
|
|
+ $result .= $v['after'];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1247,10 +1268,6 @@ class Database
|
|
|
if (isset($search[$value['name']])) {
|
|
|
$value['value'] = $search[$value['name']];
|
|
|
}
|
|
|
- if (strpos($v['lang'], '-') !== false) {
|
|
|
- $t = explode('-', $v['lang']);
|
|
|
- $v['lang'] = $t[0];
|
|
|
- }
|
|
|
$value['placeholder'] = $v['lang'];
|
|
|
|
|
|
if (isset($v['option']) && $v['option']) {
|
|
@@ -1259,6 +1276,10 @@ class Database
|
|
|
} else {
|
|
|
$result .= Html::text($value, false);
|
|
|
}
|
|
|
+
|
|
|
+ if (isset($v['after']) && $v['after']) {
|
|
|
+ $result .= $v['after'];
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -1272,12 +1293,11 @@ class Database
|
|
|
if (isset($search[$value['name']])) {
|
|
|
$value['value'] = $search[$value['name']];
|
|
|
}
|
|
|
- if (strpos($v, '-') !== false) {
|
|
|
- $t = explode('-', $v);
|
|
|
- $v = $t[0];
|
|
|
- }
|
|
|
- $value['placeholder'] = $v;
|
|
|
+ $value['placeholder'] = $v['lang'];
|
|
|
$result .= Html::text($value, false);
|
|
|
+ if (isset($v['after']) && $v['after']) {
|
|
|
+ $result .= $v['after'];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1290,13 +1310,12 @@ class Database
|
|
|
if (isset($search[$value['name']])) {
|
|
|
$value['value'] = $search[$value['name']];
|
|
|
}
|
|
|
- if (strpos($v, '-') !== false) {
|
|
|
- $t = explode('-', $v);
|
|
|
- $v = $t[0];
|
|
|
- }
|
|
|
- $value['placeholder'] = $v;
|
|
|
+ $value['placeholder'] = $v['lang'];
|
|
|
$value['type'] = 'hidden';
|
|
|
$result .= Html::hidden($value, false);
|
|
|
+ if (isset($v['after']) && $v['after']) {
|
|
|
+ $result .= $v['after'];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1309,12 +1328,11 @@ class Database
|
|
|
if (isset($search[$value['name']])) {
|
|
|
$value['value'] = $search[$value['name']];
|
|
|
}
|
|
|
- if (strpos($v, '-') !== false) {
|
|
|
- $t = explode('-', $v);
|
|
|
- $v = $t[0];
|
|
|
- }
|
|
|
- $value['placeholder'] = $v;
|
|
|
+ $value['placeholder'] = $v['lang'];
|
|
|
$result .= Html::text($value, false);
|
|
|
+ if (isset($v['after']) && $v['after']) {
|
|
|
+ $result .= $v['after'];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1327,12 +1345,12 @@ class Database
|
|
|
if (isset($search[$value['name']])) {
|
|
|
$value['value'] = $search[$value['name']];
|
|
|
}
|
|
|
- if (strpos($v, '-') !== false) {
|
|
|
- $t = explode('-', $v);
|
|
|
- $v = $t[0];
|
|
|
- }
|
|
|
- $value['placeholder'] = $v;
|
|
|
+
|
|
|
+ $value['placeholder'] = $v['lang'];
|
|
|
$result .= Html::text($value, false);
|
|
|
+ if (isset($v['after']) && $v['after']) {
|
|
|
+ $result .= $v['after'];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1361,32 +1379,32 @@ class Database
|
|
|
|
|
|
if (isset($config['manage']['search']['day'])) {
|
|
|
foreach ($config['manage']['search']['day'] as $k => $v) {
|
|
|
- $this->list_search_time($result, $search, $prefix, $k, $v, 'day');
|
|
|
+ $this->list_search_time($result, $search, $prefix, $k, $v['lang'], 'day');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (isset($config['manage']['search']['date'])) {
|
|
|
foreach ($config['manage']['search']['date'] as $k => $v) {
|
|
|
- $this->list_search_time($result, $search, $prefix, $k, $v, 'date');
|
|
|
+ $this->list_search_time($result, $search, $prefix, $k, $v['lang'], 'date');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (isset($config['manage']['search']['year'])) {
|
|
|
foreach ($config['manage']['search']['year'] as $k => $v) {
|
|
|
- $this->list_search_time($result, $search, $prefix, $k, $v, 'year');
|
|
|
+ $this->list_search_time($result, $search, $prefix, $k, $v['lang'], 'year');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (isset($config['manage']['search']['month'])) {
|
|
|
foreach ($config['manage']['search']['month'] as $k => $v) {
|
|
|
- $this->list_search_time($result, $search, $prefix, $k, $v, 'month');
|
|
|
+ $this->list_search_time($result, $search, $prefix, $k, $v['lang'], 'month');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (isset($config['manage']['search']['sday'])) {
|
|
|
$result .= '<br />';
|
|
|
foreach ($config['manage']['search']['sday'] as $k => $v) {
|
|
|
- $this->list_search_time($result, $search, $prefix, $k, $v, 'sday');
|
|
|
+ $this->list_search_time($result, $search, $prefix, $k, $v['lang'], 'sday');
|
|
|
}
|
|
|
$sday = Dever::input('search_option_sday');
|
|
|
|
|
@@ -1408,7 +1426,7 @@ class Database
|
|
|
} elseif (isset($config['manage']['search']['sdate'])) {
|
|
|
$result .= '<br />';
|
|
|
foreach ($config['manage']['search']['sdate'] as $k => $v) {
|
|
|
- $this->list_search_time($result, $search, $prefix, $k, $v, 'sdate');
|
|
|
+ $this->list_search_time($result, $search, $prefix, $k, $v['lang'], 'sdate');
|
|
|
}
|
|
|
$sdate = Dever::input('search_option_sdate');
|
|
|
|