rabin 2 년 전
부모
커밋
4536de1b05
4개의 변경된 파일27개의 추가작업 그리고 8개의 파일을 삭제
  1. 18 3
      src/Database.php
  2. 7 5
      src/Lib/Input.php
  3. 1 0
      template/layadmin/project/database/list.php
  4. 1 0
      template/layadmin/project/database/update.php

+ 18 - 3
src/Database.php

@@ -2297,6 +2297,7 @@ class Database
         if ($exist) {
             foreach ($exist as $k => $v) {
                 if ($v) {
+                    $v = ltrim(rtrim($v));
                     unset($search[$k]);
                     $k = str_replace('search_exist_', '', $k);
                     if ($v == 'yes') {
@@ -2333,6 +2334,7 @@ class Database
             $in_state = false;
             foreach ($in as $k => $v) {
                 if ($v) {
+                    $v = ltrim(rtrim($v));
                     unset($search[$k]);
                     $k = str_replace('search_in_', '', $k);
                     $param['option'][$k] = array('yes', 'in');
@@ -2352,6 +2354,7 @@ class Database
             $fulltext_state = false;
             foreach ($fulltext as $k => $v) {
                 if ($v) {
+                    $v = ltrim(rtrim($v));
                     unset($search[$k]);
                     $k = str_replace('search_fulltext_', '', $k);
                     $param['option_' . $k] = $v;
@@ -2405,6 +2408,7 @@ class Database
         if ($exp) {
             $k = $search['search_exp_col'];
             $v = $search['search_exp_value'];
+            $v = ltrim(rtrim($v));
             $param['option_' . $k] = $v;
             $param['search_type'] = $search['search_exp_type'];
 
@@ -2414,6 +2418,7 @@ class Database
         $order = Dever::preInput('search_order_');
         if ($order) {
             foreach ($order as $k => $v) {
+                $v = ltrim(rtrim($v));
                 $k = str_replace('search_order_', '', $k);
                 $param['order'][0][$k] = $v;
                 unset($search[$k]);
@@ -2421,6 +2426,10 @@ class Database
         }
         foreach ($search as $k => $v) {
             if ($v) {
+                if (is_string($v)) {
+                    $v = ltrim(rtrim($v));
+                }
+                
                 if (strpos($k, '-') !== false) {
                     $k = str_replace('search_option_', '', $k);
                     $temp = explode('-', $k);
@@ -3711,7 +3720,7 @@ class Database
                     if (isset($config['manage']['tab'])) {
                         $param['prefix'] = $prefix;
                         $param['tab_config'] = $config['manage']['tab'];
-                        if (isset($config['manage']['tab'])) {
+                        if (isset($config['manage']['lang'])) {
                             $param['lang'] = $config['manage']['lang'];
                         }
                     }
@@ -3741,11 +3750,14 @@ class Database
                         if ($this->id && $hk === 'id') {
                             $hv['update'] = 'hidden';
                         }
-                        if (isset($hv['update']) && $hv['update']) {
+                        if (isset($hv['update']) && $hv['update'] && !isset($hv['tab'])) {
                             $n = $hv['name'];
                             unset($hv['name']);
                             $s = '';
                             $hv['ext'] = $param['name'] . '_c_-1_i_' . $hk;
+                            if ($hv['update'] == 'linkage') {
+                                $hv['update_width'] = '30%';
+                            }
                             $this->update_html($hv, $hk, $hk, array(), $s, '', 'up');
                             if ($hv['update'] == 'hidden') {
                                 $table_header .= '<td style="display:none;">'.$n.'</td>';
@@ -3773,10 +3785,13 @@ class Database
                                 if ($this->id && $hk === 'id') {
                                     $hv['update'] = 'hidden';
                                 }
-                                if (isset($hv['update']) && $hv['update']) {
+                                if (isset($hv['update']) && $hv['update'] && !isset($hv['tab'])) {
                                     unset($hv['name']);
                                     $s = '';
                                     $hv['ext'] = $param['name'] . '_c_' . $bk . '_i_' . $hk;
+                                    if ($hv['update'] == 'linkage') {
+                                        $hv['update_width'] = '30%';
+                                    }
                                     $this->update_html($hv, $hk, $hk, $bv, $s);
                                     if ($hv['update'] == 'hidden') {
                                         $table_body .= '<td style="display:none;">'.$s.'</td>';

+ 7 - 5
src/Lib/Input.php

@@ -884,11 +884,13 @@ class Input
         }
 
         if (layadmin()) {
-            $w = 'margin-top:0px;width:20%;margin-left:-3px;';
+            $w = 'margin-top:0px;margin-left:-3px;';
             if ($fast == 1) {
-                $w = 'margin-top:0px;width:35%;margin-left:-3px;';
+                $w .= 'width:35%;';
+            } if (isset($param['update_width'])) {
+                $w .= 'width:'.$param['update_width'].';';
             } else {
-                $w = 'margin-top:0px;width:20%;margin-left:-3px;';
+                $w .= 'width:20%;';
             }
         }
 
@@ -977,7 +979,7 @@ class Input
 
         if (strstr($param['name'], 'up_col_')) {
             $xm = false;
-        } elseif (isset($param['option']) && isset($param['update']) && $param['update'] == 'select') {
+        } elseif (!isset($param['select_type']) && isset($param['option']) && isset($param['update']) && $param['update'] == 'select') {
             $total = count($param['option']);
             if ($total <= 30) {
                 $xm = false;
@@ -1044,7 +1046,7 @@ class Input
             } else {
                 $xm_on = 'function(){}';
             }
-            $html .= '<div id="' . $param['name'] . '" '.$change.' class="xm-select-demo" style="min-width:150px"></div>';
+            $html .= '<div id="' . $param['name'] . '" '.$change.' class="xm-select-demo" style="min-width:150px;width:50%"></div>';
             $html .= '<script>
             $(document).ready(function() {
 

+ 1 - 0
template/layadmin/project/database/list.php

@@ -10,6 +10,7 @@ include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'common.php');
 $view   
 ->set('fast', 'Dever::input("fast")')  
 ->fetch('#dever_submit@value',      'manage/database.info#dever_submit')
+->fetch('#fast@value',      '$fast')
 ->fetch('#load_style', 'manage/database.res#css')
 ->fetch('#search_param', 'manage/database.info#search_param')
 ->fetch('#addstyle', 'manage/database.listStyle')    

+ 1 - 0
template/layadmin/project/database/update.php

@@ -17,6 +17,7 @@ $view
 
 # 基本配置
 ->fetch('#dever_submit@value',		'manage/database.info#dever_submit')
+->fetch('#fast@value',      '$fast')
 ->fetch('#project@value',		'manage/database.info#project')
 ->fetch('#table@value',		'manage/database.info#table') 
 ->fetch('#menu_id@value',		'manage/database.info#menu_id')