本文整理汇总了PHP中PMA_deleteColumnsFromList函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_deleteColumnsFromList函数的具体用法?PHP PMA_deleteColumnsFromList怎么用?PHP PMA_deleteColumnsFromList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_deleteColumnsFromList函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPMADeleteColumnsFromList
/**
* Test for PMA_deleteColumnsFromList
*
* @return void
*/
public function testPMADeleteColumnsFromList()
{
$_REQUEST['db'] = 'PMA_db';
$_REQUEST['table'] = 'PMA_table';
// when column exists in the central column list
$GLOBALS['dbi']->expects($this->at(2))->method('fetchResult')->with("SELECT col_name FROM `pma_central_columns` " . "WHERE db_name = 'PMA_db' AND col_name IN ('col1');", null, null, $GLOBALS['controllink'])->will($this->returnValue(array('col1')));
$GLOBALS['dbi']->expects($this->at(4))->method('tryQuery')->with("DELETE FROM `pma_central_columns` " . "WHERE db_name = 'PMA_db' AND col_name IN ('col1');", $GLOBALS['controllink'])->will($this->returnValue(array('col1')));
$this->assertTrue(PMA_deleteColumnsFromList(array("col1"), false));
// when column does not exist in the central column list
$this->assertInstanceOf('PMA_Message', PMA_deleteColumnsFromList(array('column1'), false));
$this->assertInstanceOf('PMA_Message', PMA_deleteColumnsFromList(array('PMA_table')));
}
示例2: PMA_getHtmlShowCreate
include 'db_export.php';
exit;
break;
case 'show_create':
$show_create = PMA_getHtmlShowCreate($GLOBALS['db'], $selected);
// Send response to client.
$response = PMA_Response::getInstance();
$response->addJSON('message', $show_create);
exit;
case 'sync_unique_columns_central_list':
include_once 'libraries/central_columns.lib.php';
$centralColsError = PMA_syncUniqueColumns($selected);
break;
case 'delete_unique_columns_central_list':
include_once 'libraries/central_columns.lib.php';
$centralColsError = PMA_deleteColumnsFromList($selected);
break;
case 'make_consistent_with_central_list':
include_once 'libraries/central_columns.lib.php';
$centralColsError = PMA_makeConsistentWithList($GLOBALS['db'], $selected);
break;
}
// end switch
} elseif (isset($selected_fld) && !empty($selected_fld)) {
// coming from table structure view - do something with
// selected columns
$selected = $selected_fld;
list($what_ret, $query_type_ret, $is_unset_submit_mult, $mult_btn_ret, $centralColsError) = PMA_getDataForSubmitMult($submit_mult, $GLOBALS['db'], $table, $selected, $action);
//update the existing variables
if (isset($what_ret)) {
$what = $what_ret;
示例3: PMA_getHTMLforEditingPage
$selected_db = $_REQUEST['db'];
$edit_central_column_page = PMA_getHTMLforEditingPage($selected_fld, $selected_db);
$response->addHTML($edit_central_column_page);
exit;
}
if (isset($_POST['multi_edit_central_column_save'])) {
$message = PMA_updateMultipleColumn();
if (!is_bool($message)) {
$response->isSuccess(false);
$response->addJSON('message', $message);
}
}
if (isset($_POST['delete_save'])) {
$col_name = array();
parse_str($_POST['col_name'], $col_name);
$tmp_msg = PMA_deleteColumnsFromList($col_name['selected_fld'], false);
}
if (isset($_REQUEST['total_rows']) && $_REQUEST['total_rows']) {
$total_rows = $_REQUEST['total_rows'];
} else {
$total_rows = PMA_getCentralColumnsCount($db);
}
if (isset($_REQUEST['pos'])) {
$pos = $_REQUEST['pos'];
} else {
$pos = 0;
}
$addNewColumn = PMA_getHTMLforAddNewColumn($db);
$response->addHTML($addNewColumn);
if ($total_rows <= 0) {
$response->addHTML('<fieldset>' . __('The central list of columns for the current database is empty.') . '</fieldset>');
示例4: getDataForSubmitMult
/**
* Get List of information for Submit Mult
*
* @param string $submit_mult mult_submit type
* @param array $selected the selected columns
* @param string $action action type
*
* @return array
*/
protected function getDataForSubmitMult($submit_mult, $selected, $action)
{
$what = null;
$query_type = null;
$is_unset_submit_mult = false;
$mult_btn = null;
$centralColsError = null;
switch ($submit_mult) {
case 'drop':
$what = 'drop_fld';
break;
case 'primary':
// Gets table primary key
$primary = $this->getKeyForTablePrimary();
if (empty($primary)) {
// no primary key, so we can safely create new
$is_unset_submit_mult = true;
$query_type = 'primary_fld';
$mult_btn = __('Yes');
} else {
// primary key exists, so lets as user
$what = 'primary_fld';
}
break;
case 'index':
$is_unset_submit_mult = true;
$query_type = 'index_fld';
$mult_btn = __('Yes');
break;
case 'unique':
$is_unset_submit_mult = true;
$query_type = 'unique_fld';
$mult_btn = __('Yes');
break;
case 'spatial':
$is_unset_submit_mult = true;
$query_type = 'spatial_fld';
$mult_btn = __('Yes');
break;
case 'ftext':
$is_unset_submit_mult = true;
$query_type = 'fulltext_fld';
$mult_btn = __('Yes');
break;
case 'add_to_central_columns':
include_once 'libraries/central_columns.lib.php';
$centralColsError = PMA_syncUniqueColumns($selected, false);
break;
case 'remove_from_central_columns':
include_once 'libraries/central_columns.lib.php';
$centralColsError = PMA_deleteColumnsFromList($selected, false);
break;
case 'change':
$this->displayHtmlForColumnChange($selected, $action);
// execution stops here but PMA_Response correctly finishes
// the rendering
exit;
case 'browse':
// this should already be handled by tbl_structure.php
}
return array($what, $query_type, $is_unset_submit_mult, $mult_btn, $centralColsError);
}
示例5: PMA_syncUniqueColumns
$tmp_msg = PMA_syncUniqueColumns($selected_col, false, $selected_tbl);
}
$response = PMA_Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('jquery/jquery.uitablefilter.js');
$scripts->addFile('jquery/jquery.tablesorter.js');
$scripts->addFile('db_central_columns.js');
$cfgCentralColumns = PMA_centralColumnsGetParams();
$pmadb = $cfgCentralColumns['db'];
$pmatable = $cfgCentralColumns['table'];
$max_rows = $GLOBALS['cfg']['MaxRows'];
if (isset($_POST['delete_save'])) {
$col_name = array();
$col_name[] = $_REQUEST['col_name'];
$tmp_msg = PMA_deleteColumnsFromList($col_name, false);
}
if (isset($_REQUEST['total_rows']) && $_REQUEST['total_rows']) {
$total_rows = $_REQUEST['total_rows'];
} else {
$total_rows = PMA_getCentralColumnsCount($db);
}
if (PMA_isValid($_REQUEST['pos'], 'integer')) {
$pos = $_REQUEST['pos'];
} else {
$pos = 0;
}
$addNewColumn = PMA_getHTMLforAddNewColumn($db);
$response->addHTML($addNewColumn);
if ($total_rows <= 0) {
$response->addHTML('<fieldset>' . __('The central list of columns for the current database is empty.') . '</fieldset>');
示例6: testPMADeleteColumnsFromList
/**
* Test for PMA_deleteColumnsFromList
*
* @return void
*/
public function testPMADeleteColumnsFromList()
{
$field_select = array("col1");
$_POST['db'] = 'PMA_db';
$_POST['table'] = 'PMA_table';
$this->assertTrue(PMA_deleteColumnsFromList($field_select, false));
$this->assertInstanceOf('PMA_Message', PMA_deleteColumnsFromList(array('column1'), false));
$this->assertInstanceOf('PMA_Message', PMA_deleteColumnsFromList(array('PMA_table')));
}