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


PHP PMA_getHtmlForColumns函數代碼示例

本文整理匯總了PHP中PMA_getHtmlForColumns函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_getHtmlForColumns函數的具體用法?PHP PMA_getHtmlForColumns怎麽用?PHP PMA_getHtmlForColumns使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了PMA_getHtmlForColumns函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testPMAGetHtmlForColumns

 /**
  * Tests for PMA_getHtmlForColumns() method.
  *
  * @return void
  * @test
  */
 public function testPMAGetHtmlForColumns()
 {
     $columns = array(array('Field' => 'Field1', 'Type' => 'Type1', 'Collation' => 'Collation1', "Null" => 'YES', 'Extra' => 'Extra1', 'Key' => 'PRI', 'Comment' => 'Comment1'), array('Field' => 'Field2', 'Type' => 'Type2', 'Collation' => 'Collation2', "Null" => 'No', 'Extra' => 'Extra2', 'Key' => 'Key2', 'Comment' => 'Comment2'));
     $html = PMA_getHtmlForColumns($columns);
     $this->assertContains(__('Column'), $html);
     $this->assertContains(__('Type'), $html);
     $this->assertContains(__('Collation'), $html);
     $this->assertContains(__('Default'), $html);
     $this->assertContains(__('Comment'), $html);
     //column1
     $item1 = $columns[0];
     $this->assertContains(htmlspecialchars($item1['Field']), $html);
     $this->assertContains(htmlspecialchars($item1['Type']), $html);
     $this->assertContains(htmlspecialchars($item1['Collation']), $html);
     $this->assertContains('<i>NULL</i>', $html);
     $this->assertContains(htmlspecialchars($item1['Comment']), $html);
     //column2
     $item1 = $columns[1];
     $this->assertContains(htmlspecialchars($item1['Field']), $html);
     $this->assertContains(htmlspecialchars($item1['Type']), $html);
     $this->assertContains(htmlspecialchars($item1['Collation']), $html);
     $this->assertContains(_pgettext('None for default', 'None'), $html);
     $this->assertContains(htmlspecialchars($item1['Comment']), $html);
 }
開發者ID:xtreme-jamil-shamy,項目名稱:phpmyadmin-cf,代碼行數:30,代碼來源:PMA_tbl_tracking_test.php

示例2: PMA_getHtmlForSchemaSnapshot

/**
 * Function to get html for schema snapshot
 *
 * @param string $url_query url query
 *
 * @return string
 */
function PMA_getHtmlForSchemaSnapshot($url_query)
{
    $html = '<h3>' . __('Structure snapshot') . '  [<a href="tbl_tracking.php' . $url_query . '">' . __('Close') . '</a>]</h3>';
    $data = PMA_Tracker::getTrackedData($_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version']);
    // Get first DROP TABLE/VIEW and CREATE TABLE/VIEW statements
    $drop_create_statements = $data['ddlog'][0]['statement'];
    if (mb_strstr($data['ddlog'][0]['statement'], 'DROP TABLE') || mb_strstr($data['ddlog'][0]['statement'], 'DROP VIEW')) {
        $drop_create_statements .= $data['ddlog'][1]['statement'];
    }
    // Print SQL code
    $html .= PMA_Util::getMessage(sprintf(__('Version %s snapshot (SQL code)'), htmlspecialchars($_REQUEST['version'])), $drop_create_statements);
    // Unserialize snapshot
    $temp = unserialize($data['schema_snapshot']);
    $columns = $temp['COLUMNS'];
    $indexes = $temp['INDEXES'];
    $html .= PMA_getHtmlForColumns($columns);
    if (count($indexes) > 0) {
        $html .= PMA_getHtmlForIndexes($indexes);
    }
    // endif
    $html .= '<br /><hr /><br />';
    return $html;
}
開發者ID:saisai,項目名稱:phpmyadmin,代碼行數:30,代碼來源:tracking.lib.php


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