2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * display selection for relational field values
9 require_once 'libraries/common.inc.php';
10 require_once 'libraries/transformations.lib.php';
11 require_once 'libraries/browse_foreigners.lib.php';
14 * Sets globals from $_REQUEST
16 $request_params = array(
21 foreach ($request_params as $one_request_param) {
22 if (isset($_REQUEST[$one_request_param])) {
23 $GLOBALS[$one_request_param] = $_REQUEST[$one_request_param];
27 PMA_Util
::checkParameters(array('db', 'table', 'field'));
29 $response = PMA_Response
::getInstance();
30 $response->getFooter()->setMinimal();
31 $header = $response->getHeader();
32 $header->disableMenu();
33 $header->setBodyId('body_browse_foreigners');
39 $cfgRelation = PMA_getRelationsParam();
40 $foreigners = ($cfgRelation['relwork'] ?
PMA_getForeigners($db, $table) : false);
41 $foreign_limit = PMA_getForeignLimit(
42 isset($foreign_navig) ?
$foreign_navig : null
45 $foreignData = PMA_getForeignData(
46 $foreigners, $_REQUEST['field'], true,
47 isset($_REQUEST['foreign_filter'])
48 ?
$_REQUEST['foreign_filter']
50 isset($foreign_limit) ?
$foreign_limit : null
54 $code = PMA_getJsScriptToHandleSelectRelationalFields();
56 $header->getScripts()->addCode($code);
59 $html = PMA_getHtmlForRelationalFieldSelection(
60 $db, $table, $_REQUEST['field'], $foreignData,
61 isset($fieldkey) ?
$fieldkey : null,
62 isset($data) ?
$data : null
65 $response->addHtml($html);