2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * display selection for relational field values
9 use PhpMyAdmin\BrowseForeigners
;
10 use PhpMyAdmin\Relation
;
11 use PhpMyAdmin\Response
;
14 require_once 'libraries/common.inc.php';
17 * Sets globals from $_POST
19 $request_params = array(
24 foreach ($request_params as $one_request_param) {
25 if (isset($_POST[$one_request_param])) {
26 $GLOBALS[$one_request_param] = $_POST[$one_request_param];
30 Util
::checkParameters(array('db', 'table', 'field'));
32 $response = Response
::getInstance();
33 $response->getFooter()->setMinimal();
34 $header = $response->getHeader();
35 $header->disableMenuAndConsole();
36 $header->setBodyId('body_browse_foreigners');
38 $relation = new Relation();
43 $foreigners = $relation->getForeigners($db, $table);
44 $browseForeigners = new BrowseForeigners(
45 $GLOBALS['cfg']['LimitChars'],
46 $GLOBALS['cfg']['MaxRows'],
47 $GLOBALS['cfg']['RepeatCells'],
48 $GLOBALS['cfg']['ShowAll'],
49 $GLOBALS['pmaThemeImage']
51 $foreign_limit = $browseForeigners->getForeignLimit(
52 isset($_POST['foreign_showAll']) ?
$_POST['foreign_showAll'] : null
55 $foreignData = $relation->getForeignData(
56 $foreigners, $_POST['field'], true,
57 isset($_POST['foreign_filter'])
58 ?
$_POST['foreign_filter']
60 isset($foreign_limit) ?
$foreign_limit : null,
61 true // for getting value in $foreignData['the_total']
65 $html = $browseForeigners->getHtmlForRelationalFieldSelection(
70 isset($fieldkey) ?
$fieldkey : null,
71 isset($data) ?
$data : null
74 $response->addHtml($html);