tbl_common.inc.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Common includes for the table level views
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. use PhpMyAdmin\Url;
  9. if (! defined('PHPMYADMIN')) {
  10. exit;
  11. }
  12. // Check parameters
  13. PhpMyAdmin\Util::checkParameters(array('db', 'table'));
  14. $db_is_system_schema = $GLOBALS['dbi']->isSystemSchema($db);
  15. /**
  16. * Set parameters for links
  17. * @deprecated
  18. */
  19. $url_query = Url::getCommon(array('db' => $db, 'table' => $table));
  20. /**
  21. * Set parameters for links
  22. */
  23. $url_params = array();
  24. $url_params['db'] = $db;
  25. $url_params['table'] = $table;
  26. /**
  27. * Defines the urls to return to in case of error in a sql statement
  28. */
  29. $err_url_0 = PhpMyAdmin\Util::getScriptNameForOption(
  30. $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
  31. )
  32. . Url::getCommon(array('db' => $db));
  33. $err_url = PhpMyAdmin\Util::getScriptNameForOption(
  34. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  35. )
  36. . Url::getCommon($url_params);
  37. /**
  38. * Ensures the database and the table exist (else move to the "parent" script)
  39. * Skip test if we are exporting as we can't tell whether a table name is an alias (which would fail the test).
  40. */
  41. if (basename($_SERVER['PHP_SELF']) != 'tbl_export.php') {
  42. require_once './libraries/db_table_exists.inc.php';
  43. }