getHeader(); $scripts = $header->getScripts(); $scripts->addFile('vendor/jquery/jquery.uitablefilter.js'); $scripts->addFile('vendor/jquery/jquery.tablesorter.js'); $scripts->addFile('db_central_columns.js'); $cfgCentralColumns = CentralColumns::getParams($GLOBALS['cfg']['Server']['user']); $pmadb = $cfgCentralColumns['db']; $pmatable = $cfgCentralColumns['table']; $max_rows = intval($GLOBALS['cfg']['MaxRows']); if (isset($_REQUEST['edit_central_columns_page'])) { $selected_fld = $_REQUEST['selected_fld']; $selected_db = $_REQUEST['db']; $edit_central_column_page = CentralColumns::getHtmlForEditingPage( $GLOBALS['dbi'], $GLOBALS['cfg']['Server']['user'], $GLOBALS['cfg']['MaxRows'], $GLOBALS['cfg']['CharEditing'], $GLOBALS['cfg']['Server']['DisableIS'], $selected_fld, $selected_db ); $response->addHTML($edit_central_column_page); exit; } if (isset($_POST['multi_edit_central_column_save'])) { $message = CentralColumns::updateMultipleColumn( $GLOBALS['dbi'], $GLOBALS['cfg']['Server']['user'] ); if (!is_bool($message)) { $response->setRequestStatus(false); $response->addJSON('message', $message); } } if (isset($_POST['delete_save'])) { $col_name = array(); parse_str($_POST['col_name'], $col_name); $tmp_msg = CentralColumns::deleteColumnsFromList( $GLOBALS['dbi'], $GLOBALS['cfg']['Server']['user'], $col_name['selected_fld'], false ); } if (isset($_REQUEST['total_rows']) && $_REQUEST['total_rows']) { $total_rows = $_REQUEST['total_rows']; } else { $total_rows = CentralColumns::getCount( $GLOBALS['dbi'], $GLOBALS['cfg']['Server']['user'], $db ); } if (Core::isValid($_REQUEST['pos'], 'integer')) { $pos = intval($_REQUEST['pos']); } else { $pos = 0; } $addNewColumn = CentralColumns::getHtmlForAddNewColumn( $GLOBALS['dbi'], $GLOBALS['cfg']['MaxRows'], $GLOBALS['cfg']['CharEditing'], $GLOBALS['cfg']['Server']['DisableIS'], $db, $total_rows ); $response->addHTML($addNewColumn); if ($total_rows <= 0) { $response->addHTML( '
' . __( 'The central list of columns for the current database is empty.' ) . '
' ); $columnAdd = CentralColumns::getHtmlForAddCentralColumn($GLOBALS['dbi'], $total_rows, $pos, $db); $response->addHTML($columnAdd); exit; } $table_navigation_html = CentralColumns::getHtmlForTableNavigation( $GLOBALS['cfg']['MaxRows'], $total_rows, $pos, $db ); $response->addHTML($table_navigation_html); $columnAdd = CentralColumns::getHtmlForAddCentralColumn($GLOBALS['dbi'], $total_rows, $pos, $db); $response->addHTML($columnAdd); $deleteRowForm = '
' . Url::getHiddenInputs( $db ) . '' . '' . '
'; $response->addHTML($deleteRowForm); $table_struct = '
' . '
' . ''; $response->addHTML($table_struct); $tableheader = CentralColumns::getTableHeader( 'column_heading', __('Click to sort.'), 2 ); $response->addHTML($tableheader); $result = CentralColumns::getColumnsList( $GLOBALS['dbi'], $GLOBALS['cfg']['Server']['user'], $db, $pos, $max_rows ); $row_num = 0; foreach ($result as $row) { $tableHtmlRow = CentralColumns::getHtmlForCentralColumnsTableRow( $GLOBALS['dbi'], $GLOBALS['cfg']['MaxRows'], $GLOBALS['cfg']['CharEditing'], $GLOBALS['cfg']['Server']['DisableIS'], $row, $row_num, $db ); $response->addHTML($tableHtmlRow); $row_num++; } $response->addHTML('
'); $tablefooter = CentralColumns::getTableFooter($pmaThemeImage, $text_dir); $response->addHTML($tablefooter); $response->addHTML('
'); $message = PhpMyAdmin\Message::success( sprintf(__('Showing rows %1$s - %2$s.'), ($pos + 1), ($pos + count($result))) ); if (isset($tmp_msg) && $tmp_msg !== true) { $message = $tmp_msg; }