diff --git a/e107_admin/db.php b/e107_admin/db.php index 0be646ccc..494d70680 100644 --- a/e107_admin/db.php +++ b/e107_admin/db.php @@ -203,13 +203,15 @@ class system_tools $this->del_pref_val($_POST['pref_type']); } - if(isset($_POST['verify_sql']) || varset($_GET['mode'])=='verify_sql') + if(isset($_POST['verify_sql']) || !empty($_POST['verify_table']) || varset($_GET['mode']) =='verify_sql') { e107::getCache()->clear('Dbverify',true); require_once(e_HANDLER."db_verify_class.php"); $dbv = new db_verify; $dbv->backUrl = e_SELF."?mode=verify_sql"; $dbv->verify(); + + //echo e107::getMessage()->render(); return; } diff --git a/e107_handlers/core_functions.php b/e107_handlers/core_functions.php index e9193a74b..06f9520bd 100644 --- a/e107_handlers/core_functions.php +++ b/e107_handlers/core_functions.php @@ -372,7 +372,7 @@ if (!function_exists('multiarray_sort')) * @param $order * @param $natsort * @param $case - * @return sorted array. + * @return array sorted array. */ function multiarray_sort(&$array, $key, $order = 'asc', $natsort = true, $case = true) { @@ -397,15 +397,21 @@ if (!function_exists('multiarray_sort')) if(!isset($sort_values)) { - return; + return $array; } reset ($sort_values); - +/* while (list ($arr_key, $arr_val) = each ($sort_values)) { $key = is_numeric($arr_key) ? "" : $arr_key; // retain assoc-array keys. $sorted_arr[$key] = $array[$arr_key]; + }*/ + + foreach($sort_values as $arr_key=>$arr_val) + { + $key = is_numeric($arr_key) ? "" : $arr_key; // retain assoc-array keys. + $sorted_arr[$key] = $array[$arr_key]; } return $sorted_arr; } diff --git a/e107_handlers/db_verify_class.php b/e107_handlers/db_verify_class.php index 1d98ca501..97e0402e2 100755 --- a/e107_handlers/db_verify_class.php +++ b/e107_handlers/db_verify_class.php @@ -162,21 +162,18 @@ class db_verify */ function verify() { - + if(!empty($_POST['runfix'])) + { + $this->runFix($_POST['fix']); + } + if(!empty($_POST['verify_table'])) { $this->runComparison($_POST['verify_table']); - } else { - if(isset($_POST['runfix'])) - { - $this->runFix($_POST['fix']); - - } - - $this->renderTableSelect(); + $this->renderTableSelect(); } } @@ -199,7 +196,7 @@ class db_verify { $message = str_replace("[x]",$cnt,DBVLAN_26); // Found [x] issues. $mes->add($message, E_MESSAGE_WARNING); - $this->renderResults(); + $this->renderResults($fileArray); } else { @@ -456,8 +453,8 @@ class db_verify } - - function renderResults() + + function renderResults($fileArray=array()) { $frm = e107::getForm(); @@ -466,8 +463,8 @@ class db_verify $text = "
-
- ".DBVLAN_16." +
+ ".DBVLAN_16." @@ -479,7 +476,7 @@ class db_verify - + @@ -577,7 +574,14 @@ class db_verify
".$frm->admin_button('runfix', DBVLAN_21, 'execute', '', array('id'=>false))." ".$frm->admin_button('check_all', 'jstarget:fix', 'action', LAN_CHECKALL, array('id'=>false))." - ".$frm->admin_button('uncheck_all', 'jstarget:fix', 'action', LAN_UNCHECKALL, array('id'=>false))." + ".$frm->admin_button('uncheck_all', 'jstarget:fix', 'action', LAN_UNCHECKALL, array('id'=>false)); + + foreach($fileArray as $tab) + { + $text .= $frm->hidden('verify_table[]',$tab); + } + + $text .= "
".DBVLAN_4.": {$k}".DBVLAN_4." ".DBVLAN_5." ".DBVLAN_6." ".DBVLAN_7."