本文整理汇总了PHP中PMA_getHtmlForColumnsList函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getHtmlForColumnsList函数的具体用法?PHP PMA_getHtmlForColumnsList怎么用?PHP PMA_getHtmlForColumnsList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getHtmlForColumnsList函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPMAGetHtmlContentsFor1NFStep3
/**
* Test for PMA_getHtmlContentsFor1NFStep3
*
* @return void
*/
public function testPMAGetHtmlContentsFor1NFStep3()
{
$db = "PMA_db";
$table = "PMA_table";
$result = PMA_getHtmlContentsFor1NFStep3($db, $table);
$this->assertInternalType('array', $result);
$this->assertArrayHasKey('legendText', $result);
$this->assertArrayHasKey('headText', $result);
$this->assertArrayHasKey('subText', $result);
$this->assertArrayHasKey('extra', $result);
$this->assertArrayHasKey('primary_key', $result);
$this->assertContains(__('Step 1.') . 3, $result['legendText']);
$this->assertContains(PMA_getHtmlForColumnsList($db, $table, 'all', "checkbox"), $result['extra']);
$this->assertContains('<input type="submit" id="moveRepeatingGroup"', $result['extra']);
$this->assertEquals(json_encode(array('id')), $result['primary_key']);
}
示例2: __
/**
* Normalization process (temporarily specific to 1NF)
*
* @package PhpMyAdmin
*/
/**
*
*/
require_once 'libraries/common.inc.php';
require_once 'libraries/transformations.lib.php';
require_once 'libraries/normalization.lib.php';
require_once 'libraries/Index.class.php';
if (isset($_REQUEST['getColumns'])) {
$html = '<option selected disabled>' . __('Select one…') . '</option>' . '<option value="no_such_col">' . __('No such column') . '</option>';
//get column whose datatype falls under string category
$html .= PMA_getHtmlForColumnsList($db, $table, _pgettext('string types', 'String'));
echo $html;
exit;
}
if (isset($_REQUEST['splitColumn'])) {
$num_fields = $_REQUEST['numFields'];
$html = PMA_getHtmlForCreateNewColumn($num_fields, $db, $table);
$html .= PMA_URL_getHiddenInputs($db, $table);
echo $html;
exit;
}
if (isset($_REQUEST['addNewPrimary'])) {
$num_fields = 1;
$columnMeta = array('Field' => $table . "_id", 'Extra' => 'auto_increment');
$html = PMA_getHtmlForCreateNewColumn($num_fields, $db, $table, $columnMeta);
$html .= PMA_URL_getHiddenInputs($db, $table);
示例3: PMA_getHtmlContentsFor1NFStep3
/**
* build the html contents of various html elements in step 1.3
*
* @param string $db current database
* @param string $table current table
*
* @return string HTML contents for step 1.3
*/
function PMA_getHtmlContentsFor1NFStep3($db, $table)
{
$step = 3;
$stepTxt = __('Move repeating groups');
$legendText = __('Step 1.') . $step . " " . $stepTxt;
$headText = __("Do you have a group of two or more columns that are closely " . "related and are all repeating the same attribute? For example, " . "a table that holds data on books might have columns such as book_id, " . "author1, author2, author3 and so on which form a " . "repeating group. In this case a new table (book_id, author) should " . "be created.");
$subText = __("Check the columns which form a repeating group. " . "If no such group, click on 'No repeating group'");
$extra = PMA_getHtmlForColumnsList($db, $table, 'all', "checkbox") . "</br>" . '<input type="submit" id="moveRepeatingGroup" value="' . __('Done') . '"/>' . '<input type="submit" value="' . __('No repeating group') . '" onclick="goToStep4();"' . '/>';
$primary = PMA\libraries\Index::getPrimary($table, $db);
$primarycols = $primary->getColumns();
$pk = array();
foreach ($primarycols as $col) {
$pk[] = $col->getName();
}
$res = array('legendText' => $legendText, 'headText' => $headText, 'subText' => $subText, 'extra' => $extra, 'primary_key' => json_encode($pk));
return $res;
}