/** * Prints Html For Export Options * * @param String $export_type Selected Export Type * @param String $db Selected DB * @param String $table Selected Table * @param String $multi_values Export selection * @param String $num_tables number of tables * @param ExportPlugin[] $export_list Export List * @param String $unlim_num_rows Number of Rows * * @return string */ function PMA_getHtmlForExportOptions($export_type, $db, $table, $multi_values, $num_tables, $export_list, $unlim_num_rows) { global $cfg; $html = PMA_getHtmlForExportOptionsMethod(); $html .= PMA_getHtmlForExportOptionsFormatDropdown($export_list); $html .= PMA_getHtmlForExportOptionsSelection($export_type, $multi_values); $tableLength = mb_strlen($table); if ($tableLength && empty($num_tables) && !PMA_Table::isMerge($db, $table)) { $html .= PMA_getHtmlForExportOptionsRows($db, $table, $unlim_num_rows); } if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { $html .= PMA_getHtmlForExportOptionsQuickExport(); } $html .= PMA_getHtmlForAliasModalDialog($db, $table); $html .= PMA_getHtmlForExportOptionsOutput($export_type); $html .= PMA_getHtmlForExportOptionsFormat($export_list); return $html; }
/** * Test for PMA_getHtmlForAliasModalDialog * * @return void */ public function testPMAGetHtmlForAliasModalDialog() { $columns_info = array('test\'_db' => array('test_<b>table' => array('co"l1' => array('COLUMN_NAME' => 'co"l1'), 'col<2' => array('COLUMN_NAME' => 'col<2')))); $dbi = $this->getMockBuilder('PMA_DatabaseInterface')->disableOriginalConstructor()->getMock(); $dbi->expects($this->any())->method('getColumnsFull')->will($this->returnValue($columns_info)); $GLOBALS['dbi'] = $dbi; $html = PMA_getHtmlForAliasModalDialog(); $this->assertContains('<div id="alias_modal" class="hide" title="' . 'Rename exported databases/tables/columns">', $html); $this->assertContains('test\'_db', $html); $this->assertContains('test_<b>table', $html); $this->assertContains('col<2', $html); $this->assertContains('co"l1', $html); $this->assertContains('<hr/>', $html); $name_attr = 'aliases[test\'_db][tables][test_<b>table][alias]'; $id_attr = $GLOBALS['PMA_String']->substr(md5($name_attr), 0, 12); $this->assertContains('<input type="text" value="" name="' . $name_attr . '" ' . 'id="' . $id_attr . '" placeholder="' . 'test_<b>table alias" class=""/>', $html); }