本文整理汇总了PHP中PMA_Table::setUiProp方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Table::setUiProp方法的具体用法?PHP PMA_Table::setUiProp怎么用?PHP PMA_Table::setUiProp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Table
的用法示例。
在下文中一共展示了PMA_Table::setUiProp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_setColumnProperty
/**
* Function to set a column property
*
* @param PMA_Table $pmatable PMA_Table instance
* @param string $request_index col_order|col_visib
*
* @return boolean $retval
*/
function PMA_setColumnProperty($pmatable, $request_index)
{
$property_value = explode(',', $_REQUEST[$request_index]);
switch ($request_index) {
case 'col_order':
$property_to_set = PMA_Table::PROP_COLUMN_ORDER;
break;
case 'col_visib':
$property_to_set = PMA_Table::PROP_COLUMN_VISIB;
break;
default:
$property_to_set = '';
}
$retval = $pmatable->setUiProp($property_to_set, $property_value, $_REQUEST['table_create_time']);
if (gettype($retval) != 'boolean') {
$response = PMA_Response::getInstance();
$response->isSuccess(false);
$response->addJSON('message', $retval->getString());
exit;
}
return $retval;
}
示例2: testSetUiProp
/**
* Test for setUiProp
*
* @return void
*/
public function testSetUiProp()
{
$table_name = 'PMA_BookMark';
$db = 'PMA';
$table = new PMA_Table($table_name, $db);
$property = PMA_Table::PROP_COLUMN_ORDER;
$value = "UiProp_value";
$table_create_time = null;
$table->setUiProp($property, $value, $table_create_time);
//set UI prop successfully
$this->assertEquals($value, $table->uiprefs[$property]);
//removeUiProp
$table->removeUiProp($property);
$is_define_property = isset($table->uiprefs[$property]) ? true : false;
$this->assertEquals(false, $is_define_property);
//getUiProp after removeUiProp
$is_define_property = $table->getUiProp($property);
$this->assertEquals(false, $is_define_property);
}
示例3: PMA_handleSortOrder
/**
* Handle remembered sorting order, only for single table query
*
* @param string $db database name
* @param string $table table name
* @param array &$analyzed_sql the analyzed query
* @param string &$full_sql_query SQL query
*
* @return void
*/
function PMA_handleSortOrder($db, $table, &$analyzed_sql, &$full_sql_query)
{
$pmatable = new PMA_Table($table, $db);
if (empty($analyzed_sql[0]['order_by_clause'])) {
$sorted_col = $pmatable->getUiProp(PMA_Table::PROP_SORTED_COLUMN);
if ($sorted_col) {
// retrieve the remembered sorting order for current table
$sql_order_to_append = ' ORDER BY ' . $sorted_col . ' ';
$full_sql_query = $analyzed_sql[0]['section_before_limit'] . $sql_order_to_append . $analyzed_sql[0]['limit_clause'] . ' ' . $analyzed_sql[0]['section_after_limit'];
// update the $analyzed_sql
$analyzed_sql[0]['section_before_limit'] .= $sql_order_to_append;
$analyzed_sql[0]['order_by_clause'] = $sorted_col;
}
} else {
// store the remembered table into session
$pmatable->setUiProp(PMA_Table::PROP_SORTED_COLUMN, $analyzed_sql[0]['order_by_clause']);
}
}
示例4: PMA_setColumnVisibility
/**
* Function to set the column visibility
*
* @param PMA_Table $pmatable PMA_Table instance
*
* @return boolean $retval
*/
function PMA_setColumnVisibility($pmatable)
{
$col_visib = explode(',', $_REQUEST['col_visib']);
$retval = $pmatable->setUiProp(PMA_Table::PROP_COLUMN_VISIB, $col_visib, $_REQUEST['table_create_time']);
if (gettype($retval) != 'boolean') {
$response = PMA_Response::getInstance();
$response->isSuccess(false);
$response->addJSON('message', $retval->getString());
exit;
}
return $retval;
}