Merge remote-tracking branch 'origin/master'
[phpmyadmin/madhuracj.git] / libraries / display_create_database.lib.php
blob1ec7931fd76513af1f4186c07c5ad9fdc6710d27
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)
6 * @package phpMyAdmin
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 /**
15 require_once './libraries/check_user_privileges.lib.php';
17 if ($is_create_db_priv) {
18 // The user is allowed to create a db
20 <form method="post" action="db_create.php" id="create_database_form" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'class="ajax" ' : ''); ?>><strong>
21 <?php echo '<label for="text_create_db">' . __('Create database') . '</label>&nbsp;' . PMA_showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br />
22 <?php echo PMA_generate_common_hidden_inputs('', '', 5); ?>
23 <input type="hidden" name="reload" value="1" />
24 <input type="text" name="new_db" value="<?php echo $db_to_create; ?>" maxlength="64" class="textfield" id="text_create_db"/>
25 <?php
26 require_once './libraries/mysql_charsets.lib.php';
27 echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', null, null, true, 5);
29 if (! empty($dbstats)) {
30 echo '<input type="hidden" name="dbstats" value="1" />';
33 <input type="submit" value="<?php echo __('Create'); ?>" id="buttonGo" />
34 </form>
35 <?php
36 } else {
38 <!-- db creation no privileges message -->
39 <strong><?php echo __('Create database') . ':&nbsp;' . PMA_showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE'); ?></strong><br />
40 <?php
41 echo '<span class="noPrivileges">'
42 . ($cfg['ErrorIconic'] ? '<img class="icon ic_s_error2" src="themes/dot.gif" alt="" hspace="2" border="0" align="middle" />' : '')
43 . '' . __('No Privileges') .'</span>';
44 } // end create db form or message