display_create_database.lib.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Displays form for creating database (if user has privileges for that)
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. if (! defined('PHPMYADMIN')) {
  9. exit;
  10. }
  11. /**
  12. *
  13. */
  14. require_once './libraries/check_user_privileges.lib.php';
  15. if ($is_create_db_priv) {
  16. // The user is allowed to create a db
  17. ?>
  18. <form method="post" action="db_create.php" id="create_database_form" class="ajax"><strong>
  19. <?php echo '<label for="text_create_db">'
  20. . PMA_Util::getImage('b_newdb.png')
  21. . " " . __('Create database')
  22. . '</label>&nbsp;'
  23. . PMA_Util::showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br />
  24. <?php echo PMA_generate_common_hidden_inputs('', '', 5); ?>
  25. <input type="hidden" name="reload" value="1" />
  26. <input type="text" name="new_db" value="<?php echo htmlspecialchars($db_to_create); ?>" maxlength="64" class="textfield" id="text_create_db"/>
  27. <?php
  28. include_once './libraries/mysql_charsets.lib.php';
  29. echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', null, null, true, 5);
  30. if (! empty($dbstats)) {
  31. echo '<input type="hidden" name="dbstats" value="1" />';
  32. }
  33. ?>
  34. <input type="submit" value="<?php echo __('Create'); ?>" id="buttonGo" />
  35. </form>
  36. <?php
  37. } else {
  38. ?>
  39. <!-- db creation no privileges message -->
  40. <strong><?php echo __('Create database') . ':&nbsp;' . PMA_Util::showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br />
  41. <?php
  42. echo '<span class="noPrivileges">'
  43. . PMA_Util::getImage('s_error2.png', '', array('hspace' => 2, 'border' => 0, 'align' => 'middle'))
  44. . '' . __('No Privileges') .'</span>';
  45. } // end create db form or message
  46. ?>