當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PMA_Table::setUiProp方法代碼示例

本文整理匯總了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;
}
開發者ID:harryboulderdash,項目名稱:PlayGFC,代碼行數:30,代碼來源:sql.lib.php

示例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);
 }
開發者ID:nervo,項目名稱:phpmyadmin,代碼行數:24,代碼來源:PMA_Table_test.php

示例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']);
    }
}
開發者ID:SashiAsakura,項目名稱:AWS_QuikID_website,代碼行數:28,代碼來源:sql.php

示例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;
}
開發者ID:yszar,項目名稱:linuxwp,代碼行數:19,代碼來源:sql.lib.php


注:本文中的PMA_Table::setUiProp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。