}

    /**
     * Change database charset
     */
    echo '<form method="post" action="./db_operations.php">' . "\n"
       . PMA_generate_common_hidden_inputs($db, $table)
       . '<fieldset>' . "\n"
       . '    <legend>';
    if ($cfg['PropertiesIconic']) {
        echo '<img class="icon" src="' . $pmaThemeImage . 's_asci.png"'
            .' alt="" width="16" height="16" />';
    }
    echo '    <label for="select_db_collation">' . $strCollation . ':</label>' . "\n"
       . '    </legend>' . "\n"
       . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION,
            'db_collation', 'select_db_collation', $db_collation, false, 3)
       . '    <input type="submit" name="submitcollation"'
       . ' value="' . $strGo . '" style="vertical-align: middle" />' . "\n"
       . '</fieldset>' . "\n"
       . '</form>' . "\n";

    if ($num_tables > 0
      && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
        $message = PMA_Message::notice('strRelationNotWorking');
        $message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', false);
        $message->addParam('</a>', false);
        /* Show error if user has configured something, notice elsewhere */
        if (!empty($cfg['Servers'][$server]['pmadb'])) {
            $message->isError(true);
        }
        $message->display();
示例#2
0
    }
    /**
     * Displays the mysql server related links
     */
    if ($server > 0) {
        include_once 'libraries/check_user_privileges.lib.php';
        // Logout for advanced authentication
        if ($cfg['Server']['auth_type'] != 'config') {
            if ($cfg['ShowChgPassword']) {
                $conditional_class = 'ajax';
                PMA_printListItem(PMA\libraries\Util::getImage('s_passwd.png') . "&nbsp;" . __('Change password'), 'li_change_password', 'user_password.php' . $common_url_query, null, null, 'change_password_anchor', "no_bullets", $conditional_class);
            }
        }
        // end if
        echo '    <li id="li_select_mysql_collation" class="no_bullets" >';
        echo '        <form method="post" action="index.php">', "\n" . PMA_URL_getHiddenInputs(null, null, 4, 'collation_connection') . '            <label for="select_collation_connection">' . "\n" . '                ' . PMA\libraries\Util::getImage('s_asci.png') . "&nbsp;" . __('Server connection collation') . "\n" . PMA\libraries\Util::showMySQLDocu('Charset-connection') . ': ' . "\n" . '            </label>' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, true) . '        </form>' . "\n" . '    </li>' . "\n";
    }
    // end of if ($server > 0)
    echo '</ul>';
    echo '</div>';
}
echo '<div class="group">';
echo '<h2>', __('Appearance settings'), '</h2>';
echo '  <ul>';
// Displays language selection combo
if (empty($cfg['Lang']) && count($GLOBALS['available_languages']) > 1) {
    echo '<li id="li_select_lang" class="no_bullets">';
    include_once 'libraries/display_select_lang.lib.php';
    echo PMA\libraries\Util::getImage('s_lang.png'), " ", PMA_getLanguageSelectorHtml();
    echo '</li>';
}
/**
 * Get HTML fieldset for Table option, it contains HTML table for options
 *
 * @param string  $comment            Comment
 * @param array   $tbl_collation      table collation
 * @param string  $tbl_storage_engine table storage engine
 * @param boolean $is_myisam_or_aria  whether MYISAM | ARIA or not
 * @param boolean $is_isam            whether ISAM or not
 * @param string  $pack_keys          pack keys
 * @param string  $delay_key_write    delay key write
 * @param string  $auto_increment     value of auto increment
 * @param string  $transactional      value of transactional
 * @param string  $page_checksum      value of page checksum
 * @param boolean $is_innodb          whether INNODB or not
 * @param boolean $is_pbxt            whether PBXT or not
 * @param boolean $is_aria            whether ARIA or not
 * @param string  $checksum           the checksum
 *
 * @return string $html_output
 */
function PMA_getTableOptionFieldset($comment, $tbl_collation, $tbl_storage_engine, $is_myisam_or_aria, $is_isam, $pack_keys, $delay_key_write, $auto_increment, $transactional, $page_checksum, $is_innodb, $is_pbxt, $is_aria, $checksum)
{
    $html_output = '<fieldset>' . '<legend>' . __('Table options') . '</legend>';
    $html_output .= '<table>';
    $html_output .= PMA_getHtmlForRenameTable();
    $html_output .= PMA_getHtmlForTableComments($comment);
    //Storage engine
    $html_output .= '<tr><td class="vmiddle">' . __('Storage Engine') . '&nbsp;' . PMA\libraries\Util::showMySQLDocu('Storage_engines') . '</td>' . '<td>' . StorageEngine::getHtmlSelect('new_tbl_storage_engine', null, $tbl_storage_engine) . '</td>' . '</tr>';
    //Table character set
    $html_output .= '<tr><td class="vmiddle">' . __('Collation') . '</td>' . '<td>' . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, $tbl_collation, false) . '</td>' . '</tr>';
    // Change all Column collations
    $html_output .= '<tr><td></td><td>' . '<input type="checkbox" name="change_all_collations" value="1" ' . 'id="checkbox_change_all_collations" />' . '<label for="checkbox_change_all_collations">' . __('Change all column collations') . '</label>' . '</td></tr>';
    if ($is_myisam_or_aria || $is_isam) {
        $html_output .= PMA_getHtmlForPackKeys($pack_keys);
    }
    // end if (MYISAM|ISAM)
    if ($is_myisam_or_aria) {
        $html_output .= PMA_getHtmlForTableRow('new_checksum', 'CHECKSUM', $checksum);
        $html_output .= PMA_getHtmlForTableRow('new_delay_key_write', 'DELAY_KEY_WRITE', $delay_key_write);
    }
    // end if (MYISAM)
    if ($is_aria) {
        $html_output .= PMA_getHtmlForTableRow('new_transactional', 'TRANSACTIONAL', $transactional);
        $html_output .= PMA_getHtmlForTableRow('new_page_checksum', 'PAGE_CHECKSUM', $page_checksum);
    }
    // end if (ARIA)
    if (mb_strlen($auto_increment) > 0 && ($is_myisam_or_aria || $is_innodb || $is_pbxt)) {
        $html_output .= '<tr><td class="vmiddle">' . '<label for="auto_increment_opt">AUTO_INCREMENT</label></td>' . '<td><input type="number" name="new_auto_increment" ' . 'id="auto_increment_opt"' . 'value="' . $auto_increment . '" /></td>' . '</tr> ';
    }
    // end if (MYISAM|INNODB)
    $possible_row_formats = PMA_getPossibleRowFormat();
    // for MYISAM there is also COMPRESSED but it can be set only by the
    // myisampack utility, so don't offer here the choice because if we
    // try it inside an ALTER TABLE, MySQL (at least in 5.1.23-maria)
    // does not return a warning
    // (if the table was compressed, it can be seen on the Structure page)
    if (isset($possible_row_formats[$tbl_storage_engine])) {
        $current_row_format = mb_strtoupper($GLOBALS['showtable']['Row_format']);
        $html_output .= '<tr><td class="vmiddle">' . '<label for="new_row_format">ROW_FORMAT</label></td>' . '<td>';
        $html_output .= PMA\libraries\Util::getDropdown('new_row_format', $possible_row_formats[$tbl_storage_engine], $current_row_format, 'new_row_format');
        $html_output .= '</td></tr>';
    }
    $html_output .= '</table>' . '</fieldset>';
    return $html_output;
}
示例#4
0
/**
 * Prints Html For Display Import charset
 *
 * @return string
 */
function PMA_getHtmlForImportCharset()
{
    global $cfg;
    $html = '       <div class="formelementrow" id="charaset_of_file">';
    // charset of file
    if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
        $html .= '<label for="charset_of_file">' . __('Character set of the file:') . '</label>';
        reset($cfg['AvailableCharsets']);
        $html .= '<select id="charset_of_file" name="charset_of_file" size="1">';
        foreach ($cfg['AvailableCharsets'] as $temp_charset) {
            $html .= '<option value="' . htmlentities($temp_charset) . '"';
            if (empty($cfg['Import']['charset']) && $temp_charset == 'utf-8' || $temp_charset == $cfg['Import']['charset']) {
                $html .= ' selected="selected"';
            }
            $html .= '>' . htmlentities($temp_charset) . '</option>';
        }
        $html .= ' </select><br />';
    } else {
        $html .= '<label for="charset_of_file">' . __('Character set of the file:') . '</label>' . "\n";
        $html .= PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', 'charset_of_file', 'utf8', false);
    }
    // end if (recoding)
    $html .= '        </div>';
    return $html;
}
示例#5
0
echo $strGo;
?>
" />
            </td>
        </tr>
    </form>

<?php 
if (PMA_MYSQL_INT_VERSION >= 40101) {
    // MySQL supports setting default charsets / collations for databases since
    // version 4.1.1.
    echo '    <!-- Change database charset -->' . "\n" . '    <tr><td colspan="3"><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td></tr>' . "\n" . '    <tr><td colspan="3" class="tblHeaders">';
    if ($cfg['PropertiesIconic']) {
        echo '<img src="' . $pmaThemeImage . 's_asci.png" border="0" width="16" height="16" hspace="2" align="middle" />';
    }
    echo '      <label for="select_db_collation">' . $strCollation . '</label>:&nbsp;' . "\n" . '    </td></tr>' . "\n" . '        <form method="post" action="./db_operations.php">' . "\n" . '    <tr bgcolor="' . $cfg['BgcolorOne'] . '"><td colspan="2" nowrap="nowrap">' . PMA_generate_common_hidden_inputs($db, $table, 3) . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', 'select_db_collation', $db_collation, FALSE, 3) . '    </td><td align="right">' . '            <input type="submit" name="submitcollation" value="' . $strGo . '" style="vertical-align: middle" />' . "\n" . '    </td></tr>' . "\n" . '        </form>' . "\n" . '         ' . "\n\n";
}
if ($num_tables > 0 && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == FALSE) {
    echo '<tr><td colspan="3"><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td></tr>' . '<tr><th colspan="3" class="tblHeadError"><div class="errorhead">' . $strError . '</div></th></tr>' . '<tr><td colspan="3" class="tblError">' . sprintf(wordwrap($strRelationNotWorking, 65, '<br />'), '<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', '</a>') . '</td></tr>';
}
// end if
?>
</table>

<form method="post" action="pdf_schema.php">
<?php 
// is this OK to check for 'class' support?
if ($num_tables > 0) {
    $takeaway = $url_query . '&amp;table=' . urlencode($table);
}
if ($cfgRelation['pdfwork'] && $num_tables > 0 || $num_tables > 0 && $cfgRelation['relwork'] && $cfgRelation['commwork'] && isset($cfg['docSQLDir']) && !empty($cfg['docSQLDir'])) {
 /**
  * Test for PMA_getHtmlForSqlQueryFormUpload
  *
  * @return void
  */
 public function testPMAGetHtmlForSqlQueryFormUpload()
 {
     //Call the test function
     $html = PMA_getHtmlForSqlQueryFormUpload();
     //validate 1: Browse your computer
     $this->assertContains(__('Browse your computer:'), $html);
     //validate 2: $GLOBALS['max_upload_size']
     $this->assertContains(PMA_Util::getFormattedMaximumUploadSize($GLOBALS['max_upload_size']), $html);
     $this->assertContains(PMA_Util::generateHiddenMaxFileSize($GLOBALS['max_upload_size']), $html);
     //validate 3: Dropdown Box
     $this->assertContains(PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', null, 'utf8', false), $html);
 }
/**
 * return HTML for Sql Query Form Upload
 *
 * @return string
 *
 * @usedby  PMA_getHtmlForSqlQueryForm()
 */
function PMA_getHtmlForSqlQueryFormUpload()
{
    global $timeout_passed, $local_import_file;
    $errors = array();
    // we allow only SQL here
    $matcher = '@\\.sql(\\.(' . PMA_supportedDecompressions() . '))?$@';
    if (!empty($GLOBALS['cfg']['UploadDir'])) {
        $files = PMA_getFileSelectOptions(PMA_Util::userDir($GLOBALS['cfg']['UploadDir']), $matcher, isset($timeout_passed) && $timeout_passed && isset($local_import_file) ? $local_import_file : '');
    } else {
        $files = '';
    }
    // start output
    $html = '<fieldset id="">';
    $html .= '<legend>';
    $html .= __('Browse your computer:') . '</legend>';
    $html .= '<div class="formelement">';
    $html .= '<input type="file" name="sql_file" class="textfield" /> ';
    $html .= PMA_Util::getFormattedMaximumUploadSize($GLOBALS['max_upload_size']);
    // some browsers should respect this :)
    $html .= PMA_Util::generateHiddenMaxFileSize($GLOBALS['max_upload_size']) . "\n";
    $html .= '</div>';
    if ($files === false) {
        $errors[] = PMA_Message::error(__('The directory you set for upload work cannot be reached.'));
    } elseif (!empty($files)) {
        $html .= '<div class="formelement">';
        $html .= '<strong>' . __('web server upload directory:') . '</strong>';
        $html .= '<select size="1" name="sql_localfile">' . "\n";
        $html .= '<option value="" selected="selected"></option>' . "\n";
        $html .= $files;
        $html .= '</select>' . "\n";
        $html .= '</div>';
    }
    $html .= '<div class="clearfloat"></div>' . "\n";
    $html .= '</fieldset>';
    $html .= '<fieldset id="" class="tblFooters">';
    $html .= __('Character set of the file:') . "\n";
    $html .= PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', null, 'utf8', false);
    $html .= '<input type="submit" name="SQL" value="' . __('Go') . '" />' . "\n";
    $html .= '<div class="clearfloat"></div>' . "\n";
    $html .= '</fieldset>';
    foreach ($errors as $error) {
        $html .= $error->getDisplay();
    }
    return $html;
}
示例#8
0
            echo ' selected="selected"';
        }
        echo '>' . $temp_charset . '</option>' . "\n";
        while ($temp_charset = next($cfg['AvailableCharsets'])) {
            echo '            <option value="' . $temp_charset . '"';
            if ($temp_charset == $charset) {
                echo ' selected="selected"';
            }
            echo '>' . $temp_charset . '</option>' . "\n";
        }
        echo '        </select>' . "\n" . '    ';
        echo '    </td>' . "\n";
        echo '    </tr>' . "\n";
    } else {
        if (PMA_MYSQL_INT_VERSION >= 40100) {
            echo '    <tr bgcolor="' . $cfg['BgcolorTwo'] . '"><td' . $queryframe_thcolspan . '>' . "\n" . $strCharsetOfFile . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', NULL, 'utf8', FALSE) . '    </td>' . "\n" . '    </tr>' . "\n";
        }
    }
    echo '    <tr bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n" . '        <td align="right"' . $queryframe_thcolspan . '><input type="submit" name="SQL" value="' . $strGo . '" /></td>' . "\n" . '    </tr>' . "\n\n";
}
// Bookmark Support
$bookmark_go = FALSE;
if (!isset($is_inside_querywindow) || isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && ($querydisplay_tab == 'history' || $querydisplay_tab == 'full')) {
    if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) {
        if (($bookmark_list = PMA_listBookmarks($db, $cfg['Bookmark'])) && count($bookmark_list) > 0) {
            $form_items++;
            echo '    <tr><td' . $queryframe_thcolspan . '><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td></tr>' . "\n";
            echo '    <tr><td' . $queryframe_thcolspan . ' class="tblHeaders">' . "\n";
            echo "            " . (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE && isset($querydisplay_tab) && $querydisplay_tab == 'full' || !isset($is_inside_querywindow) ? "<i>{$strOr}</i>" : '') . " {$strBookmarkQuery}:&nbsp;\n";
            echo '    </td></tr>' . "\n";
            if (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) {
    <tr><td><input type="text" name="comment" size="40" maxlength="80"
                value="<?php 
    echo isset($comment) ? $comment : '';
    ?>
"
                class="textfield" />
        </td>
        <td width="25">&nbsp;</td>
        <td>
<?php 
    echo PMA_generateEnginesDropdown('tbl_type', null, FALSE, isset($GLOBALS['tbl_type']) ? $GLOBALS['tbl_type'] : null, 3);
    ?>
        </td>
        <?php 
    if (PMA_MYSQL_INT_VERSION >= 40100) {
        echo '        <td width="25">&nbsp;</td>' . "\n" . '        <td>' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, isset($tbl_collation) ? $tbl_collation : null, FALSE, 3) . '        </td>' . "\n";
    }
    ?>
    </tr>
    </table>
    <br />
    <?php 
}
// end if ($action == 'tbl_create.php')
?>

<fieldset class="tblFooters">
    <input type="submit" name="do_save_data" value="<?php 
echo $strSave;
?>
" />
/**
 * Displays a form used to add/edit a routine
 *
 * @param string $mode      If the editor will be used edit a routine
 *                          or add a new one: 'edit' or 'add'.
 * @param string $operation If the editor was previously invoked with
 *                          JS turned off, this will hold the name of
 *                          the current operation
 * @param array  $routine   Data for the routine returned by
 *                          PMA_RTN_getDataFromRequest() or
 *                          PMA_RTN_getDataFromName()
 *
 * @return string   HTML code for the editor.
 */
function PMA_RTN_getEditorForm($mode, $operation, $routine)
{
    global $db, $errors, $param_sqldataaccess, $param_opts_num;
    // Escape special characters
    $need_escape = array('item_original_name', 'item_name', 'item_returnlength', 'item_definition', 'item_definer', 'item_comment');
    foreach ($need_escape as $key => $index) {
        $routine[$index] = htmlentities($routine[$index], ENT_QUOTES);
    }
    for ($i = 0; $i < $routine['item_num_params']; $i++) {
        $routine['item_param_name'][$i] = htmlentities($routine['item_param_name'][$i], ENT_QUOTES);
        $routine['item_param_length'][$i] = htmlentities($routine['item_param_length'][$i], ENT_QUOTES);
    }
    // Handle some logic first
    if ($operation == 'change') {
        if ($routine['item_type'] == 'PROCEDURE') {
            $routine['item_type'] = 'FUNCTION';
            $routine['item_type_toggle'] = 'PROCEDURE';
        } else {
            $routine['item_type'] = 'PROCEDURE';
            $routine['item_type_toggle'] = 'FUNCTION';
        }
    } else {
        if ($operation == 'add' || $routine['item_num_params'] == 0 && $mode == 'add' && !$errors) {
            $routine['item_param_dir'][] = '';
            $routine['item_param_name'][] = '';
            $routine['item_param_type'][] = '';
            $routine['item_param_length'][] = '';
            $routine['item_param_opts_num'][] = '';
            $routine['item_param_opts_text'][] = '';
            $routine['item_num_params']++;
        } else {
            if ($operation == 'remove') {
                unset($routine['item_param_dir'][$routine['item_num_params'] - 1]);
                unset($routine['item_param_name'][$routine['item_num_params'] - 1]);
                unset($routine['item_param_type'][$routine['item_num_params'] - 1]);
                unset($routine['item_param_length'][$routine['item_num_params'] - 1]);
                unset($routine['item_param_opts_num'][$routine['item_num_params'] - 1]);
                unset($routine['item_param_opts_text'][$routine['item_num_params'] - 1]);
                $routine['item_num_params']--;
            }
        }
    }
    $disable_remove_parameter = '';
    if (!$routine['item_num_params']) {
        $disable_remove_parameter = " color: gray;' disabled='disabled";
    }
    $original_routine = '';
    if ($mode == 'edit') {
        $original_routine = "<input name='item_original_name' " . "type='hidden' " . "value='{$routine['item_original_name']}'/>\n" . "<input name='item_original_type' " . "type='hidden' " . "value='{$routine['item_original_type']}'/>\n";
    }
    $isfunction_class = '';
    $isprocedure_class = '';
    $isfunction_select = '';
    $isprocedure_select = '';
    if ($routine['item_type'] == 'PROCEDURE') {
        $isfunction_class = ' hide';
        $isprocedure_select = " selected='selected'";
    } else {
        $isprocedure_class = ' hide';
        $isfunction_select = " selected='selected'";
    }
    // Create the output
    $retval = "";
    $retval .= "<!-- START " . strtoupper($mode) . " ROUTINE FORM -->\n\n";
    $retval .= "<form class='rte_form' action='db_routines.php' method='post'>\n";
    $retval .= "<input name='{$mode}_item' type='hidden' value='1' />\n";
    $retval .= $original_routine;
    $retval .= PMA_generate_common_hidden_inputs($db) . "\n";
    $retval .= "<fieldset>\n";
    $retval .= "<legend>" . __('Details') . "</legend>\n";
    $retval .= "<table class='rte_table' style='width: 100%'>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td style='width: 20%;'>" . __('Routine name') . "</td>\n";
    $retval .= "    <td><input type='text' name='item_name' maxlength='64'\n";
    $retval .= "               value='{$routine['item_name']}' /></td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td>" . __('Type') . "</td>\n";
    $retval .= "    <td>\n";
    if ($GLOBALS['is_ajax_request']) {
        $retval .= "        <select name='item_type'>\n";
        $retval .= "            <option value='PROCEDURE'{$isprocedure_select}>PROCEDURE</option>\n";
        $retval .= "            <option value='FUNCTION'{$isfunction_select}>FUNCTION</option>\n";
        $retval .= "        </select>\n";
    } else {
        $retval .= "        <input name='item_type' type='hidden' value='{$routine['item_type']}' />\n";
        $retval .= "        <div style='width: 49%; float: left; text-align: center; font-weight: bold;'>\n";
        $retval .= "            {$routine['item_type']}\n";
        $retval .= "        </div>\n";
        $retval .= "        <input style='width: 49%;' type='submit' name='routine_changetype'\n";
        $retval .= "               value='" . sprintf(__('Change to %s'), $routine['item_type_toggle']) . "' />\n";
    }
    $retval .= "    </td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td>" . __('Parameters') . "</td>\n";
    $retval .= "    <td>\n";
    // parameter handling start
    $retval .= "        <table class='routine_params_table'>\n";
    $retval .= "        <tr>\n";
    $retval .= "            <th class='routine_direction_cell{$isprocedure_class}'>" . __('Direction') . "</th>\n";
    $retval .= "            <th>" . __('Name') . "</th>\n";
    $retval .= "            <th>" . __('Type') . "</th>\n";
    $retval .= "            <th>" . __('Length/Values') . "</th>\n";
    $retval .= "            <th colspan='2'>" . __('Options') . "</th>\n";
    $retval .= "            <th class='routine_param_remove hide'>&nbsp;</th>\n";
    $retval .= "        </tr>";
    for ($i = 0; $i < $routine['item_num_params']; $i++) {
        // each parameter
        $retval .= PMA_RTN_getParameterRow($routine, $i, $isprocedure_class);
    }
    $retval .= "        </table>\n";
    $retval .= "    </td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td>&nbsp;</td>\n";
    $retval .= "    <td>\n";
    $retval .= "        <input style='width: 49%;' type='submit' \n";
    $retval .= "               name='routine_addparameter'\n";
    $retval .= "               value='" . __('Add parameter') . "' />\n";
    $retval .= "        <input style='width: 49%;{$disable_remove_parameter}'\n";
    $retval .= "               type='submit' \n";
    $retval .= "               name='routine_removeparameter'\n";
    $retval .= "               value='" . __('Remove last parameter') . "' />\n";
    $retval .= "    </td>\n";
    $retval .= "</tr>\n";
    // parameter handling end
    $retval .= "<tr class='routine_return_row{$isfunction_class}'>\n";
    $retval .= "    <td>" . __('Return type') . "</td>\n";
    $retval .= "    <td><select name='item_returntype'>\n";
    $retval .= PMA_CommonFunctions::getInstance()->getSupportedDatatypes(true, $routine['item_returntype']) . "\n";
    $retval .= "    </select></td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr class='routine_return_row{$isfunction_class}'>\n";
    $retval .= "    <td>" . __('Return length/values') . "</td>\n";
    $retval .= "    <td><input type='text' name='item_returnlength'\n";
    $retval .= "               value='{$routine['item_returnlength']}' /></td>\n";
    $retval .= "    <td class='hide no_len'>---</td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr class='routine_return_row{$isfunction_class}'>\n";
    $retval .= "    <td>" . __('Return options') . "</td>\n";
    $retval .= "    <td><div>\n";
    $retval .= PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, "item_returnopts_text", null, $routine['item_returnopts_text']);
    $retval .= "\n    </div>\n";
    $retval .= "    <div><select name='item_returnopts_num'>\n";
    $retval .= "        <option value=''></option>";
    foreach ($param_opts_num as $key => $value) {
        $selected = "";
        if (!empty($routine['item_returnopts_num']) && $routine['item_returnopts_num'] == $value) {
            $selected = " selected='selected'";
        }
        $retval .= "<option{$selected}>{$value}</option>";
    }
    $retval .= "\n    </select></div>\n";
    $retval .= "    <div class='hide no_opts'>---</div>\n";
    $retval .= "</td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td>" . __('Definition') . "</td>\n";
    $retval .= "    <td><textarea name='item_definition' rows='15' cols='40'>";
    $retval .= $routine['item_definition'];
    $retval .= "</textarea></td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td>" . __('Is deterministic') . "</td>\n";
    $retval .= "    <td><input type='checkbox' name='item_isdeterministic'{$routine['item_isdeterministic']} /></td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td>" . __('Definer') . "</td>\n";
    $retval .= "    <td><input type='text' name='item_definer'\n";
    $retval .= "               value='{$routine['item_definer']}' /></td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td>" . __('Security type') . "</td>\n";
    $retval .= "    <td><select name='item_securitytype'>\n";
    $retval .= "        <option value='DEFINER'{$routine['item_securitytype_definer']}>DEFINER</option>\n";
    $retval .= "        <option value='INVOKER'{$routine['item_securitytype_invoker']}>INVOKER</option>\n";
    $retval .= "    </select></td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td>" . __('SQL data access') . "</td>\n";
    $retval .= "    <td><select name='item_sqldataaccess'>\n";
    foreach ($param_sqldataaccess as $key => $value) {
        $selected = "";
        if ($routine['item_sqldataaccess'] == $value) {
            $selected = " selected='selected'";
        }
        $retval .= "        <option{$selected}>{$value}</option>\n";
    }
    $retval .= "    </select></td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td>" . __('Comment') . "</td>\n";
    $retval .= "    <td><input type='text' name='item_comment' maxlength='64'\n";
    $retval .= "               value='{$routine['item_comment']}' /></td>\n";
    $retval .= "</tr>\n";
    $retval .= "</table>\n";
    $retval .= "</fieldset>\n";
    if ($GLOBALS['is_ajax_request']) {
        $retval .= "<input type='hidden' name='editor_process_{$mode}'\n";
        $retval .= "       value='true' />\n";
        $retval .= "<input type='hidden' name='ajax_request' value='true' />\n";
    } else {
        $retval .= "<fieldset class='tblFooters'>\n";
        $retval .= "    <input type='submit' name='editor_process_{$mode}'\n";
        $retval .= "           value='" . __('Go') . "' />\n";
        $retval .= "</fieldset>\n";
    }
    $retval .= "</form>\n\n";
    $retval .= "<!-- END " . strtoupper($mode) . " ROUTINE FORM -->\n\n";
    return $retval;
}
/**
 * Get HTML fieldset for Table option, it contains HTML table for options
 *
 * @param string  $comment            Comment
 * @param array   $tbl_collation      table collation
 * @param string  $tbl_storage_engine table storage engine
 * @param boolean $is_myisam_or_aria  whether MYISAM | ARIA or not
 * @param boolean $is_isam            whether ISAM or not
 * @param array   $pack_keys          pack keys
 * @param string  $delay_key_write    delay key write
 * @param string  $auto_increment     value of auto increment
 * @param string  $transactional      value of transactional
 * @param string  $page_checksum      value of page checksum
 * @param boolean $is_innodb          whether INNODB or not
 * @param boolean $is_pbxt            whether PBXT or not
 * @param boolean $is_aria            whether ARIA or not
 * @param string  $checksum           the checksum
 *
 * @return string $html_output
 */
function PMA_getTableOptionFieldset($comment, $tbl_collation, $tbl_storage_engine, $is_myisam_or_aria, $is_isam, $pack_keys, $delay_key_write, $auto_increment, $transactional, $page_checksum, $is_innodb, $is_pbxt, $is_aria, $checksum)
{
    $html_output = '<fieldset>' . '<legend>' . __('Table options') . '</legend>';
    $html_output .= '<table>';
    //Change table name
    $html_output .= '<tr><td>' . __('Rename table to') . '</td>' . '<td>' . '<input type="text" size="20" name="new_name" onfocus="this.select()"' . 'value="' . htmlspecialchars($GLOBALS['table']) . '" required="required" />' . '</td>' . '</tr>';
    //Table comments
    $html_output .= '<tr><td>' . __('Table comments') . '</td>' . '<td><input type="text" name="comment" maxlength="60" size="30"' . 'value="' . htmlspecialchars($comment) . '" onfocus="this.select()" />' . '<input type="hidden" name="prev_comment" value="' . htmlspecialchars($comment) . '" />' . '</td>' . '</tr>';
    //Storage engine
    $html_output .= '<tr><td>' . __('Storage Engine') . PMA_Util::showMySQLDocu('Storage_engines') . '</td>' . '<td>' . PMA_StorageEngine::getHtmlSelect('new_tbl_storage_engine', null, $tbl_storage_engine) . '</td>' . '</tr>';
    //Table character set
    $html_output .= '<tr><td>' . __('Collation') . '</td>' . '<td>' . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, $tbl_collation, false, 3) . '</td>' . '</tr>';
    if ($is_myisam_or_aria || $is_isam) {
        $html_output .= '<tr>' . '<td><label for="new_pack_keys">PACK_KEYS</label></td>' . '<td><select name="new_pack_keys" id="new_pack_keys">';
        $html_output .= '<option value="DEFAULT"';
        if ($pack_keys == 'DEFAULT') {
            $html_output .= 'selected="selected"';
        }
        $html_output .= '>DEFAULT</option>
                <option value="0"';
        if ($pack_keys == '0') {
            $html_output .= 'selected="selected"';
        }
        $html_output .= '>0</option>
                <option value="1" ';
        if ($pack_keys == '1') {
            $html_output .= 'selected="selected"';
        }
        $html_output .= '>1</option>' . '</select>' . '</td>' . '</tr>';
    }
    // end if (MYISAM|ISAM)
    if ($is_myisam_or_aria) {
        $html_output .= PMA_getHtmlForTableRow('new_checksum', 'CHECKSUM', $checksum);
        $html_output .= PMA_getHtmlForTableRow('new_delay_key_write', 'DELAY_KEY_WRITE', $delay_key_write);
    }
    // end if (MYISAM)
    if ($is_aria) {
        $html_output .= PMA_getHtmlForTableRow('new_transactional', 'TRANSACTIONAL', $transactional);
        $html_output .= PMA_getHtmlForTableRow('new_page_checksum', 'PAGE_CHECKSUM', $page_checksum);
    }
    // end if (ARIA)
    /** @var PMA_String $pmaString */
    $pmaString = $GLOBALS['PMA_String'];
    if ($pmaString->strlen($auto_increment) > 0 && ($is_myisam_or_aria || $is_innodb || $is_pbxt)) {
        $html_output .= '<tr><td>' . '<label for="auto_increment_opt">AUTO_INCREMENT</label></td>' . '<td><input type="number" name="new_auto_increment" ' . 'id="auto_increment_opt"' . 'value="' . $auto_increment . '" /></td>' . '</tr> ';
    }
    // end if (MYISAM|INNODB)
    $possible_row_formats = PMA_getPossibleRowFormat();
    // for MYISAM there is also COMPRESSED but it can be set only by the
    // myisampack utility, so don't offer here the choice because if we
    // try it inside an ALTER TABLE, MySQL (at least in 5.1.23-maria)
    // does not return a warning
    // (if the table was compressed, it can be seen on the Structure page)
    if (isset($possible_row_formats[$tbl_storage_engine])) {
        $current_row_format = $pmaString->strtoupper($GLOBALS['showtable']['Row_format']);
        $html_output .= '<tr><td>' . '<label for="new_row_format">ROW_FORMAT</label></td>' . '<td>';
        $html_output .= PMA_Util::getDropdown('new_row_format', $possible_row_formats[$tbl_storage_engine], $current_row_format, 'new_row_format');
        $html_output .= '</td></tr>';
    }
    $html_output .= '</table>' . '</fieldset>';
    return $html_output;
}
 *
 * @package PhpMyAdmin
 */
if (!defined('PHPMYADMIN')) {
    exit;
}
/**
 *
 */
require_once './libraries/check_user_privileges.lib.php';
if ($is_create_db_priv) {
    // The user is allowed to create a db
    $html .= '<form method="post" action="db_create.php"' . ' id="create_database_form" class="ajax"><strong>';
    $html .= '<label for="text_create_db">' . PMA_Util::getImage('b_newdb.png') . " " . __('Create database') . '</label>&nbsp;' . PMA_Util::showMySQLDocu('CREATE_DATABASE');
    $html .= '</strong><br />';
    $html .= PMA_URL_getHiddenInputs('', '', 5);
    $html .= '<input type="hidden" name="reload" value="1" />';
    $html .= '<input type="text" name="new_db" value="' . $db_to_create . '" maxlength="64" class="textfield" id="text_create_db" ' . 'required placeholder="' . __('Database name') . '"/>';
    include_once './libraries/mysql_charsets.inc.php';
    $html .= PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', null, null, true);
    if (!empty($dbstats)) {
        $html .= '<input type="hidden" name="dbstats" value="1" />';
    }
    $html .= '<input type="submit" value="' . __('Create') . '" id="buttonGo" />';
    $html .= '</form>';
} else {
    $html .= '<!-- db creation no privileges message -->';
    $html .= '<strong>' . __('Create database:') . '&nbsp;' . PMA_Util::showMySQLDocu('CREATE_DATABASE') . '</strong><br />';
    $html .= '<span class="noPrivileges">' . PMA_Util::getImage('s_error2.png', '', array('hspace' => 2, 'border' => 0, 'align' => 'middle')) . '' . __('No Privileges') . '</span>';
}
// end create db form or message
   var new_fields = document.getElementById('added_fields').value;
   var new_field_container = document.getElementById('table_columns');
   var new_field = '<?php echo preg_replace('|\s+|', ' ', preg_replace('|\'|', '\\\'', $new_field)); ?>';
   var i = 0;
   for (i = 0; i < new_fields; i++) {
       if (odd_row) {
           new_field_container.innerHTML += '<tr class="odd">' + new_field + '</tr>';
       } else {
           new_field_container.innerHTML += '<tr class="even">' + new_field + '</tr>';
       }
       odd_row = ! odd_row;
   }

   return true;
}
// ]]>
</script>
   <?php
}
*/
if ($action == 'tbl_create.php') {
    $html .= '<table>' . '<tr class="vtop">' . '<th>' . __('Table comments') . ':&nbsp;</th>' . '<td width="25">&nbsp;</td>' . '<th>' . __('Storage Engine') . ':' . PMA_Util::showMySQLDocu('Storage_engines', 'Storage_engines') . '</th>' . '<td width="25">&nbsp;</td>' . '<th>' . __('Collation') . ':&nbsp;</th>' . '</tr>' . '<tr><td><input type="text" name="comment" size="40" maxlength="80"' . 'value="' . (isset($_REQUEST['comment']) ? htmlspecialchars($_REQUEST['comment']) : '') . '" class="textfield" />' . '</td>' . '<td width="25">&nbsp;</td>' . '<td>' . PMA_StorageEngine::getHtmlSelect('tbl_storage_engine', null, isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null) . '</td>' . '<td width="25">&nbsp;</td>' . '<td>' . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null, false, 3) . '</td>' . '</tr>';
    if (PMA_Partition::havePartitioning()) {
        $html .= '<tr class="vtop">' . '<th>' . __('PARTITION definition') . ':&nbsp;' . PMA_Util::showMySQLDocu('Partitioning', 'Partitioning') . '</th>' . '</tr>' . '<tr>' . '<td>' . '<textarea name="partition_definition" id="partitiondefinition"' . ' cols="' . $GLOBALS['cfg']['TextareaCols'] . '"' . ' rows="' . $GLOBALS['cfg']['TextareaRows'] . '"' . ' dir="' . $GLOBALS['text_dir'] . '">' . (isset($_REQUEST['partition_definition']) ? htmlspecialchars($_REQUEST['partition_definition']) : '') . '</textarea>' . '</td>' . '</tr>';
    }
    $html .= '</table>' . '<br />';
}
// end if ($action == 'tbl_create.php')
$html .= '<fieldset class="tblFooters">' . '<input type="submit" name="do_save_data" value="' . __('Save') . '" />' . '</fieldset>' . '<div id="properties_message"></div>' . '</form>';
$html .= '<div id="popup_background"></div>';
PMA_Response::getInstance()->addHTML($html);
 /**
  * Test for PMA_generateCharsetDropdownBox
  *
  * @return void
  * @test
  */
 public function testGenerateCharsetDropdownBox()
 {
     $GLOBALS['mysql_charsets'] = array('latin1', 'latin2', 'latin3');
     $GLOBALS['mysql_charsets_available'] = array('latin1' => true, 'latin2' => false, 'latin3' => true);
     $GLOBALS['mysql_charsets_descriptions'] = array('latin1' => 'abc', 'latin2' => 'def');
     $GLOBALS['mysql_collations'] = array('latin1' => array('latin1_german1_ci', 'latin1_swedish1_ci'), 'latin2' => array('latin1_general_ci'), 'latin3' => array());
     $GLOBALS['mysql_collations_available'] = array('latin1_german1_ci' => true, 'latin1_swedish1_ci' => false, 'latin2_general_ci' => true);
     $result = PMA_generateCharsetDropdownBox();
     $this->assertContains('name="collation"', $result);
     $this->assertNotContains('id="', $result);
     $this->assertNotContains('class="autosubmit"', $result);
     $this->assertContains('<option value="">Collation', $result);
     $this->assertContains('<option value=""></option>', $result);
     $this->assertContains('<optgroup label="latin1', $result);
     $this->assertNotContains('<optgroup label="latin2', $result);
     $this->assertContains('title="latin3', $result);
     $this->assertContains('title="abc', $result);
     $this->assertNotContains('value="latin1_swedish1_ci"', $result);
     $this->assertContains('value="latin1_german1_ci"', $result);
     $this->assertNotContains('value="latin2_general1_ci"', $result);
     $this->assertContains('title="German', $result);
     $result = PMA_generateCharsetDropdownBox(2, null, "test_id", "latin1", false, true);
     $this->assertContains('name="character_set"', $result);
     $this->assertNotContains('Charset</option>', $result);
     $this->assertContains('class="autosubmit"', $result);
     $this->assertContains('id="test_id"', $result);
     $this->assertContains('selected="selected">latin1', $result);
 }
/**
 * build html for adding a new user defined column to central list
 *
 * @param string $db current database
 *
 * @return string html of the form to let user add a new user defined column to the
 *                list
 */
function PMA_getHTMLforAddNewColumn($db)
{
    $addNewColumn = '<div id="add_col_div"><a href="#">' . '<span>+</span> ' . __('Add new column') . '</a>' . '<form id="add_new" style="min-width:100%;display:none" ' . 'method="post" action="db_central_columns.php">' . PMA_URL_getHiddenInputs($db) . '<input type="hidden" name="add_new_column" value="add_new_column">' . '<table>';
    $addNewColumn .= PMA_getCentralColumnsTableHeader();
    $addNewColumn .= '<tr>' . '<td></td>' . '<td name="col_name" class="nowrap">' . PMA\libraries\Template::get('columns_definitions/column_name')->render(array('columnNumber' => 0, 'ci' => 0, 'ci_offset' => 0, 'columnMeta' => array(), 'cfgRelation' => array('centralcolumnswork' => false))) . '</td>' . '<td name = "col_type" class="nowrap">' . PMA\libraries\Template::get('columns_definitions/column_type')->render(array('columnNumber' => 0, 'ci' => 1, 'ci_offset' => 0, 'type_upper' => '', 'columnMeta' => array())) . '</td>' . '<td class="nowrap" name="col_length">' . PMA\libraries\Template::get('columns_definitions/column_length')->render(array('columnNumber' => 0, 'ci' => 2, 'ci_offset' => 0, 'length_values_input_size' => 8, 'length_to_display' => '')) . '</td>' . '<td class="nowrap" name="col_default">' . PMA\libraries\Template::get('columns_definitions/column_default')->render(array('columnNumber' => 0, 'ci' => 3, 'ci_offset' => 0, 'type_upper' => '', 'columnMeta' => array())) . '</td>' . '<td name="collation" class="nowrap">' . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'field_collation[0]', 'field_0_4', null, false) . '</td>' . '<td class="nowrap" name="col_attribute">' . PMA\libraries\Template::get('columns_definitions/column_attribute')->render(array('columnNumber' => 0, 'ci' => 5, 'ci_offset' => 0, 'extracted_columnspec' => array(), 'columnMeta' => array(), 'submit_attribute' => false)) . '</td>' . '<td class="nowrap" name="col_isNull">' . PMA\libraries\Template::get('columns_definitions/column_null')->render(array('columnNumber' => 0, 'ci' => 6, 'ci_offset' => 0, 'columnMeta' => array())) . '</td>' . '<td class="nowrap" name="col_extra">' . PMA\libraries\Template::get('columns_definitions/column_extra')->render(array('columnNumber' => 0, 'ci' => 7, 'ci_offset' => 0, 'columnMeta' => array())) . '</td>' . ' <td>' . '<input id="add_column_save" type="submit" ' . ' value="Save"/></td>' . '</tr>';
    $addNewColumn .= '</table></form></div>';
    return $addNewColumn;
}
示例#16
0
        echo '&nbsp;' . $strCharsetOfFile . "\n" . '    <select name="charset_of_file" size="1">' . "\n" . '            <option value="' . $temp_charset . '"';
        if ($temp_charset == $charset) {
            echo ' selected="selected"';
        }
        echo '>' . $temp_charset . '</option>' . "\n";
        while ($temp_charset = next($cfg['AvailableCharsets'])) {
            echo '            <option value="' . $temp_charset . '"';
            if ($temp_charset == $charset) {
                echo ' selected="selected"';
            }
            echo '>' . $temp_charset . '</option>' . "\n";
        }
        echo '        </select><br />' . "\n" . '    ';
    } elseif (PMA_MYSQL_INT_VERSION >= 40100) {
        echo $strCharsetOfFile . "\n";
        echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', NULL, 'utf8', FALSE);
    }
    // end if (recoding)
    echo '    </td>' . "\n";
    echo '    <td align="right"><input type="submit" name="SQL" value="' . $strGo . '" /></td>' . "\n";
    echo '    </tr>' . "\n";
}
// Bookmark Support
if ($cfg['Bookmark']['db'] && $cfg['Bookmark']['table']) {
    if (($bookmark_list = PMA_listBookmarks($db, $cfg['Bookmark'])) && count($bookmark_list) > 0) {
        echo '    <tr><td colspan="2"><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td></tr>' . "\n";
        echo '    <tr><td colspan="2" class="tblHeaders">&nbsp;<i>' . $strOr . '</i></td></tr>' . "\n";
        echo '    <tr bgcolor="' . $cfg['BgcolorOne'] . '"><td colspan="2">' . "\n";
        echo '        <b>' . $strBookmarkQuery . ':</b>&nbsp;' . "\n";
        echo '        <select name="id_bookmark">' . "\n";
        echo '            <option value=""></option>' . "\n";
示例#17
0
           . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection')
           . '            <label for="select_collation_connection">' . "\n"
           . '                ' . __('Server connection collation') . "\n"
           // put the doc link in the form so that it appears on the same line
           . $common_functions->showMySQLDocu(
               'MySQL_Database_Administration',
               'Charset-connection'
           )
           . ': ' .  "\n"
           . '            </label>' . "\n"

           . PMA_generateCharsetDropdownBox(
               PMA_CSDROPDOWN_COLLATION,
               'collation_connection',
               'select_collation_connection',
               $collation_connection,
               true,
               4,
               true
           )
           . '        </form>' . "\n"
           . '    </li>' . "\n";
    } // end of if ($server > 0 && !PMA_DRIZZLE)
    echo '</ul>';
    echo '</div>';
}

echo '<div class="group">';
echo '<h2>' . __('Appearance Settings') . '</h2>';
echo '  <ul>';
示例#18
0
    </fieldset>
    </form>
    </div>
    <?php 
    /**
     * Change database charset
     */
    echo '<div class="operations_half_width"><form id="change_db_charset_form" ';
    if ($GLOBALS['cfg']['AjaxEnable']) {
        echo ' class="ajax" ';
    }
    echo 'method="post" action="db_operations.php">' . PMA_generate_common_hidden_inputs($db, $table) . '<fieldset>' . "\n" . '    <legend>';
    if ($cfg['PropertiesIconic']) {
        echo PMA_getImage('s_asci.png');
    }
    echo '    <label for="select_db_collation">' . __('Collation') . ':</label>' . "\n" . '    </legend>' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', 'select_db_collation', $db_collation, false, 3) . '</fieldset>' . '<fieldset class="tblFooters">' . '    <input type="submit" name="submitcollation"' . ' value="' . __('Go') . '" />' . "\n" . '</fieldset>' . "\n" . '</form></div>' . "\n";
    if ($num_tables > 0 && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
        $message = PMA_Message::notice(__('The phpMyAdmin configuration storage has been deactivated. To find out why click %shere%s.'));
        $message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', false);
        $message->addParam('</a>', false);
        /* Show error if user has configured something, notice elsewhere */
        if (!empty($cfg['Servers'][$server]['pmadb'])) {
            $message->isError(true);
        }
        echo '<div class="operations_full_width">';
        $message->display();
        echo '</div>';
    }
    // end if
}
// end if (!$is_information_schema)
示例#19
0
/**
 * prints bookmark fieldset
 *
 * @usedby  PMA_sqlQueryForm()
 * @uses    $GLOBALS['cfg']['GZipDump']
 * @uses    $GLOBALS['cfg']['BZipDump']
 * @uses    $GLOBALS['cfg']['UploadDir']
 * @uses    $GLOBALS['cfg']['AvailableCharsets']
 * @uses    $GLOBALS['cfg']['AllowAnywhereRecoding']
 * @uses    $GLOBALS['strAutodetect']
 * @uses    $GLOBALS['strBzip']
 * @uses    $GLOBALS['strCharsetOfFile']
 * @uses    $GLOBALS['strCompression']
 * @uses    $GLOBALS['strError']
 * @uses    $GLOBALS['strGo']
 * @uses    $GLOBALS['strGzip']
 * @uses    $GLOBALS['strLocationTextfile']
 * @uses    $GLOBALS['strWebServerUploadDirectory']
 * @uses    $GLOBALS['strWebServerUploadDirectoryError']
 * @uses    $GLOBALS['allow_recoding']
 * @uses    $GLOBALS['charset']
 * @uses    $GLOBALS['max_upload_size']
 * @uses    PMA_supportedDecompressions()
 * @uses    PMA_getFileSelectOptions()
 * @uses    PMA_displayMaximumUploadSize()
 * @uses    PMA_generateCharsetDropdownBox()
 * @uses    PMA_generateHiddenMaxFileSize()
 * @uses    PMA_MYSQL_INT_VERSION
 * @uses    PMA_CSDROPDOWN_CHARSET
 * @uses    empty()
 */
function PMA_sqlQueryFormUpload()
{
    $errors = array();
    $matcher = '@\\.sql(\\.(' . PMA_supportedDecompressions() . '))?$@';
    // we allow only SQL here
    if (!empty($GLOBALS['cfg']['UploadDir'])) {
        $files = PMA_getFileSelectOptions(PMA_userDir($GLOBALS['cfg']['UploadDir']), $matcher, isset($timeout_passed) && $timeout_passed && isset($local_import_file) ? $local_import_file : '');
    } else {
        $files = '';
    }
    // start output
    echo '<fieldset id="">';
    echo '<legend>';
    echo $GLOBALS['strLocationTextfile'] . '</legend>';
    echo '<div class="formelement">';
    echo '<input type="file" name="sql_file" class="textfield" /> ';
    echo PMA_displayMaximumUploadSize($GLOBALS['max_upload_size']);
    // some browsers should respect this :)
    echo PMA_generateHiddenMaxFileSize($GLOBALS['max_upload_size']) . "\n";
    echo '</div>';
    if ($files === FALSE) {
        $errors[$GLOBALS['strError']] = $GLOBALS['strWebServerUploadDirectoryError'];
    } elseif (!empty($files)) {
        echo '<div class="formelement">';
        echo '<strong>' . $GLOBALS['strWebServerUploadDirectory'] . ':</strong>' . "\n";
        echo '<select size="1" name="sql_localfile">' . "\n";
        echo '<option value="" selected="selected"></option>' . "\n";
        echo $files;
        echo '</select>' . "\n";
        echo '</div>';
    }
    echo '<div class="clearfloat"></div>' . "\n";
    echo '</fieldset>';
    echo '<fieldset id="" class="tblFooters">';
    if (PMA_MYSQL_INT_VERSION < 40100 && $GLOBALS['cfg']['AllowAnywhereRecoding'] && $GLOBALS['allow_recoding']) {
        echo $GLOBALS['strCharsetOfFile'] . "\n" . '<select name="charset_of_file" size="1">' . "\n";
        foreach ($GLOBALS['cfg']['AvailableCharsets'] as $temp_charset) {
            echo '<option value="' . $temp_charset . '"';
            if ($temp_charset == $GLOBALS['charset']) {
                echo ' selected="selected"';
            }
            echo '>' . $temp_charset . '</option>' . "\n";
        }
        echo '</select>' . "\n";
    } elseif (PMA_MYSQL_INT_VERSION >= 40100) {
        echo $GLOBALS['strCharsetOfFile'] . "\n";
        echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', null, 'utf8', FALSE);
    }
    // end if (recoding)
    echo '<input type="submit" name="SQL" value="' . $GLOBALS['strGo'] . '" />' . "\n";
    echo '<div class="clearfloat"></div>' . "\n";
    echo '</fieldset>';
    foreach ($errors as $error => $message) {
        echo '<div>' . $error . '</div>';
        echo '<div>' . $message . '</div>';
    }
}
/**
 * Function to get html for column collation
 *
 * @param int   $columnNumber column number
 * @param int   $ci           cell index
 * @param int   $ci_offset    cell index offset
 * @param array $columnMeta   column meta
 *
 * @return string
 */
function PMA_getHtmlForColumnCollation($columnNumber, $ci, $ci_offset, $columnMeta)
{
    $tmp_collation = empty($columnMeta['Collation']) ? null : $columnMeta['Collation'];
    $html = PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'field_collation[' . $columnNumber . ']', 'field_' . $columnNumber . '_' . ($ci - $ci_offset), $tmp_collation, false);
    return $html;
}
示例#21
0
                ?>
                    </form>
                <?php 
            }
            // end  if ($PMA_Config->get('BLOBSTREAMING_PLUGINS_EXIST'))
        }
        // end if ($PMA_Config->get('PBXT_NAME') !== strtolower($db))
    }
    /**
     * Change database charset
     */
    echo '<form method="post" action="./db_operations.php">' . "\n" . PMA_generate_common_hidden_inputs($db, $table) . '<fieldset>' . "\n" . '    <legend>';
    if ($cfg['PropertiesIconic']) {
        echo '<img class="icon" src="' . $pmaThemeImage . 's_asci.png"' . ' alt="" width="16" height="16" />';
    }
    echo '    <label for="select_db_collation">' . $strCollation . ':</label>' . "\n" . '    </legend>' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', 'select_db_collation', $db_collation, false, 3) . '    <input type="submit" name="submitcollation"' . ' value="' . $strGo . '" style="vertical-align: middle" />' . "\n" . '</fieldset>' . "\n" . '</form>' . "\n";
    if ($num_tables > 0 && !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
        $message = PMA_Message::notice('strRelationNotWorking');
        $message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', false);
        $message->addParam('</a>', false);
        /* Show error if user has configured something, notice elsewhere */
        if (!empty($cfg['Servers'][$server]['pmadb'])) {
            $message->isError(true);
        }
        $message->display();
    }
    // end if
}
// end if (!$is_information_schema)
// not sure about displaying the PDF dialog in case db is information_schema
if ($cfgRelation['pdfwork'] && $num_tables > 0) {
            <?php 
    echo '<label for="text_create_db">' . $strCreateNewDatabase . '</label>&nbsp;' . PMA_showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE');
    ?>
</b><br />
            <?php 
    echo PMA_generate_common_hidden_inputs('', '', 5);
    ?>
            <input type="hidden" name="reload" value="1" />
            <input type="text" name="new_db" value="<?php 
    echo $db_to_create;
    ?>
" maxlength="64" class="textfield" id="text_create_db"/>
            <?php 
    if (PMA_MYSQL_INT_VERSION >= 40101) {
        require_once './libraries/mysql_charsets.lib.php';
        echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', null, null, TRUE, 5);
    }
    ?>
            <input type="submit" value="<?php 
    echo $strCreate;
    ?>
" id="buttonGo" />
        </form>
    <?php 
} else {
    ?>
    <!-- db creation no privileges message -->
        <b><?php 
    echo $strCreateNewDatabase . ':&nbsp;' . PMA_showMySQLDocu('SQL-Syntax', 'CREATE_DATABASE');
    ?>
</b><br />
                value="<?php 
    echo isset($_REQUEST['comment']) ? htmlspecialchars($_REQUEST['comment']) : '';
    ?>
"
                class="textfield" />
        </td>
        <td width="25">&nbsp;</td>
        <td>
    <?php 
    echo PMA_StorageEngine::getHtmlSelect('tbl_type', null, isset($_REQUEST['tbl_type']) ? $_REQUEST['tbl_type'] : null);
    ?>
        </td>
        <td width="25">&nbsp;</td>
        <td>
    <?php 
    echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null, false, 3);
    ?>
        </td>
    </tr>
    <?php 
    if (PMA_Partition::havePartitioning()) {
        ?>
    <tr valign="top">
        <th><?php 
        echo __('PARTITION definition');
        ?>
:&nbsp;<?php 
        echo PMA_showMySQLDocu('Partitioning', 'Partitioning');
        ?>
        </th>
    </tr>
// charset of file
if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
    echo '<label for="charset_of_file">' . __('Character set of the file:') . '</label>';
    reset($cfg['AvailableCharsets']);
    echo '<select id="charset_of_file" name="charset_of_file" size="1">';
    foreach ($cfg['AvailableCharsets'] as $temp_charset) {
        echo '<option value="' . htmlentities($temp_charset) . '"';
        if (empty($cfg['Import']['charset']) && $temp_charset == 'utf-8' || $temp_charset == $cfg['Import']['charset']) {
            echo ' selected="selected"';
        }
        echo '>' . htmlentities($temp_charset) . '</option>';
    }
    echo ' </select><br />';
} else {
    echo '<label for="charset_of_file">' . __('Character set of the file:') . '</label>' . "\n";
    echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', 'charset_of_file', 'utf8', false);
}
// end if (recoding)
?>
        </div>
    </div>
    <div class="importoptions">
        <h3><?php 
echo __('Partial Import:');
?>
</h3>

        <?php 
if (isset($timeout_passed) && $timeout_passed) {
    echo '<div class="formelementrow">' . "\n";
    echo '<input type="hidden" name="skip" value="' . $offset . '" />';
示例#25
0
        <td><?php 
echo PMA_StorageEngine::getHtmlSelect('new_tbl_type', null, $tbl_type);
?>
        </td>
    </tr>

<?php 
if (PMA_MYSQL_INT_VERSION >= 40100) {
    ?>
    <!-- Table character set -->
    <tr><td><?php 
    echo $strCollation;
    ?>
</td>
        <td><?php 
    echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', null, $tbl_collation, false, 3);
    ?>
        </td>
    </tr>
    <?php 
}
if ($tbl_type == 'MYISAM' || $tbl_type == 'ISAM') {
    ?>
    <tr>
        <td><label for="new_pack_keys">pack_keys</label></td>
        <td><select name="new_pack_keys" id="new_pack_keys">
                <option value="DEFAULT"
                    <?php 
    if ($pack_keys == 'DEFAULT') {
        echo 'selected="selected"';
    }
示例#26
0
    }
    /**
     * Displays the mysql server related links
     */
    if ($server > 0 && !PMA_DRIZZLE) {
        include_once 'libraries/check_user_privileges.lib.php';
        // Logout for advanced authentication
        if ($cfg['Server']['auth_type'] != 'config') {
            if ($cfg['ShowChgPassword']) {
                $conditional_class = 'ajax';
                PMA_printListItem(PMA_Util::getImage('s_passwd.png') . " " . __('Change password'), 'li_change_password', 'user_password.php?' . $common_url_query, null, null, 'change_password_anchor', "no_bullets", $conditional_class);
            }
        }
        // end if
        echo '    <li id="li_select_mysql_collation" class="no_bullets" >';
        echo '        <form method="post" action="index.php">' . "\n" . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection') . '            <label for="select_collation_connection">' . "\n" . '                ' . PMA_Util::getImage('s_asci.png') . " " . __('Server connection collation') . "\n" . PMA_Util::showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . ': ' . "\n" . '            </label>' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true) . '        </form>' . "\n" . '    </li>' . "\n";
    }
    // end of if ($server > 0 && !PMA_DRIZZLE)
    echo '</ul>';
    echo '</div>';
}
echo '<div class="group">';
echo '<h2>' . __('Appearance Settings') . '</h2>';
echo '  <ul>';
// Displays language selection combo
if (empty($cfg['Lang']) && count($GLOBALS['available_languages']) > 1) {
    echo '<li id="li_select_lang" class="no_bullets">';
    include_once 'libraries/display_select_lang.lib.php';
    echo PMA_Util::getImage('s_lang.png') . " " . PMA_getLanguageSelectorHtml();
    echo '</li>';
}
            </td>
            <td bgcolor="<?php 
echo $cfg['BgcolorOne'];
?>
" align="right">
                <input type="submit" name="submittype" value="<?php 
echo $strGo;
?>
" />
            </td>
        </tr>
    </form>
        <tr><td colspan="2" height="5"></td></tr>
    <?php 
if (PMA_MYSQL_INT_VERSION >= 40100) {
    echo "\n" . '<!-- Table character set -->' . "\n" . '    <form method="post" action="tbl_properties_operations.php">' . "\n" . '        <tr>' . "\n" . '            <th colspan="2" class="tblHeaders" align="left">' . "\n" . PMA_generate_common_hidden_inputs($db, $table, 3) . '            ' . $strCollation . ':&nbsp;' . "\n" . '            </th>' . "\n" . '        </tr>' . "\n" . '        <tr>' . "\n" . '            <td bgcolor="' . $cfg['BgcolorOne'] . '">' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'tbl_collation', NULL, $tbl_collation, FALSE, 3) . '            </td>' . "\n" . '            <td bgcolor="' . $cfg['BgcolorOne'] . '" align="right">' . "\n" . '                <input type="submit" name="submitcollation" value="' . $strGo . '" style="vertical-align: middle" />' . "\n" . '        </td>' . "\n" . '        </tr>' . "\n" . '    </form>' . "\n" . '        <tr><td colspan="2" height="5"></td></tr>' . "\n";
}
// PACK_KEYS: MyISAM or ISAM
// DELAY_KEY_WRITE, CHECKSUM, AUTO_INCREMENT: MyISAM only
if ($tbl_type == 'MYISAM' || $tbl_type == 'ISAM') {
    ?>
    <!-- Table options -->
    <form method="post" action="tbl_properties_operations.php">
        <tr>
            <th colspan="2" class="tblHeaders" align="left">
                <?php 
    echo $strTableOptions;
    ?>
:&nbsp;
                <?php 
    echo PMA_generate_common_hidden_inputs($db, $table);
示例#28
0
        require_once './libraries/check_user_privileges.lib.php';
        if (!PMA_DRIZZLE) {
            // Logout for advanced authentication
            if ($cfg['Server']['auth_type'] != 'config') {
                if ($cfg['ShowChgPassword']) {
                    if ($GLOBALS['cfg']['AjaxEnable']) {
                        $conditional_class = 'ajax';
                    } else {
                        $conditional_class = null;
                    }
                    PMA_printListItem(__('Change password'), 'li_change_password', './user_password.php?' . $common_url_query, null, null, 'change_password_anchor', null, $conditional_class);
                }
            }
            // end if
            echo '    <li id="li_select_mysql_collation">';
            echo '        <form method="post" action="index.php" target="_parent">' . "\n" . PMA_generate_common_hidden_inputs(null, null, 4, 'collation_connection') . '            <label for="select_collation_connection">' . "\n" . '                ' . __('MySQL connection collation') . "\n" . PMA_showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . ': ' . "\n" . '            </label>' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true) . '            <noscript><input type="submit" value="' . __('Go') . '" /></noscript>' . "\n" . '        </form>' . "\n" . '    </li>' . "\n";
        }
        // not Drizzle
    }
    // end of if ($server > 0)
    echo '</ul>';
    echo '</div>';
}
echo '<div class="group">';
echo '<h2>' . __('Appearance Settings') . '</h2>';
echo '  <ul>';
// Displays language selection combo
if (empty($cfg['Lang'])) {
    echo '<li id="li_select_lang">';
    require_once './libraries/display_select_lang.lib.php';
    PMA_select_language();
示例#29
0
/**
 * Displays a form used to add/edit a routine
 *
 * @param string $mode      If the editor will be used to edit a routine
 *                          or add a new one: 'edit' or 'add'.
 * @param string $operation If the editor was previously invoked with
 *                          JS turned off, this will hold the name of
 *                          the current operation
 * @param array  $routine   Data for the routine returned by
 *                          PMA_RTN_getDataFromRequest() or
 *                          PMA_RTN_getDataFromName()
 *
 * @return string   HTML code for the editor.
 */
function PMA_RTN_getEditorForm($mode, $operation, $routine)
{
    global $db, $errors, $param_sqldataaccess, $param_opts_num;
    // Escape special characters
    $need_escape = array('item_original_name', 'item_name', 'item_returnlength', 'item_definition', 'item_definer', 'item_comment');
    foreach ($need_escape as $key => $index) {
        $routine[$index] = htmlentities($routine[$index], ENT_QUOTES, 'UTF-8');
    }
    for ($i = 0; $i < $routine['item_num_params']; $i++) {
        $routine['item_param_name'][$i] = htmlentities($routine['item_param_name'][$i], ENT_QUOTES);
        $routine['item_param_length'][$i] = htmlentities($routine['item_param_length'][$i], ENT_QUOTES);
    }
    // Handle some logic first
    if ($operation == 'change') {
        if ($routine['item_type'] == 'PROCEDURE') {
            $routine['item_type'] = 'FUNCTION';
            $routine['item_type_toggle'] = 'PROCEDURE';
        } else {
            $routine['item_type'] = 'PROCEDURE';
            $routine['item_type_toggle'] = 'FUNCTION';
        }
    } else {
        if ($operation == 'add' || $routine['item_num_params'] == 0 && $mode == 'add' && !$errors) {
            $routine['item_param_dir'][] = '';
            $routine['item_param_name'][] = '';
            $routine['item_param_type'][] = '';
            $routine['item_param_length'][] = '';
            $routine['item_param_opts_num'][] = '';
            $routine['item_param_opts_text'][] = '';
            $routine['item_num_params']++;
        } else {
            if ($operation == 'remove') {
                unset($routine['item_param_dir'][$routine['item_num_params'] - 1]);
                unset($routine['item_param_name'][$routine['item_num_params'] - 1]);
                unset($routine['item_param_type'][$routine['item_num_params'] - 1]);
                unset($routine['item_param_length'][$routine['item_num_params'] - 1]);
                unset($routine['item_param_opts_num'][$routine['item_num_params'] - 1]);
                unset($routine['item_param_opts_text'][$routine['item_num_params'] - 1]);
                $routine['item_num_params']--;
            }
        }
    }
    $disableRemoveParam = '';
    if (!$routine['item_num_params']) {
        $disableRemoveParam = " color: gray;' disabled='disabled";
    }
    $original_routine = '';
    if ($mode == 'edit') {
        $original_routine = "<input name='item_original_name' " . "type='hidden' " . "value='{$routine['item_original_name']}'/>\n" . "<input name='item_original_type' " . "type='hidden' " . "value='{$routine['item_original_type']}'/>\n";
    }
    $isfunction_class = '';
    $isprocedure_class = '';
    $isfunction_select = '';
    $isprocedure_select = '';
    if ($routine['item_type'] == 'PROCEDURE') {
        $isfunction_class = ' hide';
        $isprocedure_select = " selected='selected'";
    } else {
        $isprocedure_class = ' hide';
        $isfunction_select = " selected='selected'";
    }
    // Create the output
    $retval = "";
    $retval .= "<!-- START " . mb_strtoupper($mode) . " ROUTINE FORM -->\n\n";
    $retval .= "<form class='rte_form' action='db_routines.php' method='post'>\n";
    $retval .= "<input name='{$mode}_item' type='hidden' value='1' />\n";
    $retval .= $original_routine;
    $retval .= PMA_URL_getHiddenInputs($db) . "\n";
    $retval .= "<fieldset>\n";
    $retval .= "<legend>" . __('Details') . "</legend>\n";
    $retval .= "<table class='rte_table' style='width: 100%'>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td style='width: 20%;'>" . __('Routine name') . "</td>\n";
    $retval .= "    <td><input type='text' name='item_name' maxlength='64'\n";
    $retval .= "               value='{$routine['item_name']}' /></td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td>" . __('Type') . "</td>\n";
    $retval .= "    <td>\n";
    if ($GLOBALS['is_ajax_request']) {
        $retval .= "        <select name='item_type'>\n" . "<option value='PROCEDURE'{$isprocedure_select}>PROCEDURE</option>\n" . "<option value='FUNCTION'{$isfunction_select}>FUNCTION</option>\n" . "</select>\n";
    } else {
        $retval .= "<input name='item_type' type='hidden'" . " value='{$routine['item_type']}' />\n" . "<div class='floatleft' style='width: 49%; text-align: center;" . " font-weight: bold;'>\n" . $routine['item_type'] . "\n" . "</div>\n" . "<input style='width: 49%;' type='submit' name='routine_changetype'\n" . " value='" . sprintf(__('Change to %s'), $routine['item_type_toggle']) . "' />\n";
    }
    $retval .= "    </td>\n";
    $retval .= "</tr>\n";
    $retval .= "<tr>\n";
    $retval .= "    <td>" . __('Parameters') . "</td>\n";
    $retval .= "    <td>\n";
    // parameter handling start
    $retval .= "        <table class='routine_params_table'>\n";
    $retval .= "        <thead>\n";
    $retval .= "        <tr>\n";
    $retval .= "            <td></td>\n";
    $retval .= "            <th class='routine_direction_cell{$isprocedure_class}'>" . __('Direction') . "</th>\n";
    $retval .= "            <th>" . __('Name') . "</th>\n";
    $retval .= "            <th>" . __('Type') . "</th>\n";
    $retval .= "            <th>" . __('Length/Values') . "</th>\n";
    $retval .= "            <th colspan='2'>" . __('Options') . "</th>\n";
    $retval .= "            <th class='routine_param_remove hide'>&nbsp;</th>\n";
    $retval .= "        </tr>";
    $retval .= "        </thead>\n";
    $retval .= "        <tbody>\n";
    for ($i = 0; $i < $routine['item_num_params']; $i++) {
        // each parameter
        $retval .= PMA_RTN_getParameterRow($routine, $i, $isprocedure_class);
    }
    $retval .= "        </tbody>\n";
    $retval .= "        </table>";
    $retval .= "    </td>";
    $retval .= "</tr>";
    $retval .= "<tr>";
    $retval .= "    <td>&nbsp;</td>";
    $retval .= "    <td>";
    $retval .= "        <input style='width: 49%;' type='button'";
    $retval .= "               name='routine_addparameter'";
    $retval .= "               value='" . __('Add parameter') . "' />";
    $retval .= "        <input style='width: 49%;" . $disableRemoveParam . "'";
    $retval .= "               type='submit' ";
    $retval .= "               name='routine_removeparameter'";
    $retval .= "               value='" . __('Remove last parameter') . "' />";
    $retval .= "    </td>";
    $retval .= "</tr>";
    // parameter handling end
    $retval .= "<tr class='routine_return_row" . $isfunction_class . "'>";
    $retval .= "    <td>" . __('Return type') . "</td>";
    $retval .= "    <td><select name='item_returntype'>";
    $retval .= PMA\libraries\Util::getSupportedDatatypes(true, $routine['item_returntype']);
    $retval .= "    </select></td>";
    $retval .= "</tr>";
    $retval .= "<tr class='routine_return_row" . $isfunction_class . "'>";
    $retval .= "    <td>" . __('Return length/values') . "</td>";
    $retval .= "    <td><input type='text' name='item_returnlength'";
    $retval .= "        value='" . $routine['item_returnlength'] . "' /></td>";
    $retval .= "    <td class='hide no_len'>---</td>";
    $retval .= "</tr>";
    $retval .= "<tr class='routine_return_row" . $isfunction_class . "'>";
    $retval .= "    <td>" . __('Return options') . "</td>";
    $retval .= "    <td><div>";
    $retval .= PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, "item_returnopts_text", null, $routine['item_returnopts_text']);
    $retval .= "    </div>";
    $retval .= "    <div><select name='item_returnopts_num'>";
    $retval .= "        <option value=''></option>";
    foreach ($param_opts_num as $key => $value) {
        $selected = "";
        if (!empty($routine['item_returnopts_num']) && $routine['item_returnopts_num'] == $value) {
            $selected = " selected='selected'";
        }
        $retval .= "<option" . $selected . ">" . $value . "</option>";
    }
    $retval .= "    </select></div>";
    $retval .= "    <div class='hide no_opts'>---</div>";
    $retval .= "</td>";
    $retval .= "</tr>";
    $retval .= "<tr>";
    $retval .= "    <td>" . __('Definition') . "</td>";
    $retval .= "    <td><textarea name='item_definition' rows='15' cols='40'>";
    $retval .= $routine['item_definition'];
    $retval .= "</textarea></td>";
    $retval .= "</tr>";
    $retval .= "<tr>";
    $retval .= "    <td>" . __('Is deterministic') . "</td>";
    $retval .= "    <td><input type='checkbox' name='item_isdeterministic'" . $routine['item_isdeterministic'] . " /></td>";
    $retval .= "</tr>";
    if (isset($_REQUEST['edit_item']) && !empty($_REQUEST['edit_item'])) {
        $retval .= "<tr>";
        $retval .= "    <td>" . __('Adjust privileges');
        $retval .= PMA\libraries\Util::showDocu('faq', 'faq6-39');
        $retval .= "</td>";
        if ($GLOBALS['proc_priv'] && $GLOBALS['is_reload_priv']) {
            $retval .= "    <td><input type='checkbox' " . "name='item_adjust_privileges' value='1' checked /></td>";
        } else {
            $retval .= "    <td><input type='checkbox' " . "name='item_adjust_privileges' value='1' title='" . __("You do not have sufficient privileges to perform this " . "operation; Please refer to the documentation for more " . "details") . "' disabled/></td>";
        }
        $retval .= "</tr>";
    }
    $retval .= "<tr>";
    $retval .= "    <td>" . __('Definer') . "</td>";
    $retval .= "    <td><input type='text' name='item_definer'";
    $retval .= "               value='" . $routine['item_definer'] . "' /></td>";
    $retval .= "</tr>";
    $retval .= "<tr>";
    $retval .= "    <td>" . __('Security type') . "</td>";
    $retval .= "    <td><select name='item_securitytype'>";
    $retval .= "        <option value='DEFINER'" . $routine['item_securitytype_definer'] . ">DEFINER</option>";
    $retval .= "        <option value='INVOKER'" . $routine['item_securitytype_invoker'] . ">INVOKER</option>";
    $retval .= "    </select></td>";
    $retval .= "</tr>";
    $retval .= "<tr>";
    $retval .= "    <td>" . __('SQL data access') . "</td>";
    $retval .= "    <td><select name='item_sqldataaccess'>";
    foreach ($param_sqldataaccess as $key => $value) {
        $selected = "";
        if ($routine['item_sqldataaccess'] == $value) {
            $selected = " selected='selected'";
        }
        $retval .= "        <option" . $selected . ">" . $value . "</option>";
    }
    $retval .= "    </select></td>";
    $retval .= "</tr>";
    $retval .= "<tr>";
    $retval .= "    <td>" . __('Comment') . "</td>";
    $retval .= "    <td><input type='text' name='item_comment' maxlength='64'";
    $retval .= "    value='" . $routine['item_comment'] . "' /></td>";
    $retval .= "</tr>";
    $retval .= "</table>";
    $retval .= "</fieldset>";
    if ($GLOBALS['is_ajax_request']) {
        $retval .= "<input type='hidden' name='editor_process_" . $mode . "'";
        $retval .= "       value='true' />";
        $retval .= "<input type='hidden' name='ajax_request' value='true' />";
    } else {
        $retval .= "<fieldset class='tblFooters'>";
        $retval .= "    <input type='submit' name='editor_process_" . $mode . "'";
        $retval .= "           value='" . __('Go') . "' />";
        $retval .= "</fieldset>";
    }
    $retval .= "</form>";
    $retval .= "<!-- END " . mb_strtoupper($mode) . " ROUTINE FORM -->";
    return $retval;
}
示例#30
0
        if ($convcharset == $tmpcharset) {
            $selected = ' selected="selected"';
        } else {
            $selected = '';
        }
        echo '                        ' . '<option value="' . $tmpcharset . '"' . $selected . '>' . $tmpcharset . '</option>' . "\n";
    }
    ?>
                </select>
                <noscript><input type="submit" value="Go" style="vertical-align: middle" /></noscript>
            </form>
        </td>
    </tr>
    <?php 
} elseif ($server != 0 && PMA_MYSQL_INT_VERSION >= 40100) {
    echo '    <!-- Charset Info -->' . "\n" . '    <tr>' . "\n" . '        ' . ($str_iconic_list != '' ? sprintf($str_iconic_list, '', 's_asci.png', $strMySQLCharset, '') : $str_normal_list) . "\n" . '        <td>' . "\n" . '            ' . $strMySQLCharset . ': ' . '            <b>' . '               ' . $mysql_charsets_descriptions[$mysql_charset_map[strtolower($charset)]] . "\n" . '               (' . $mysql_charset_map[strtolower($charset)] . ')' . "\n" . '            </b>' . "\n" . '        </td>' . "\n" . '    </tr>' . "\n" . '    <!-- MySQL Connection Collation -->' . "\n" . '    <tr>' . "\n" . '        ' . ($str_iconic_list != '' ? sprintf($str_iconic_list, '', 's_asci.png', $strMySQLCharset, '') : $str_normal_list) . "\n" . '        <td>' . "\n" . '            <form method="post" action="index.php" target="_parent">' . "\n" . PMA_generate_common_hidden_inputs(NULL, NULL, 4, 'collation_connection') . '                <label for="select_collation_connection">' . "\n" . '                    ' . $strMySQLConnectionCollation . ': ' . "\n" . '                </label>' . "\n" . PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, TRUE, 4, TRUE) . '                <noscript><input type="submit" value="' . $strGo . '" style="vertical-align: middle" /></noscript>' . "\n" . PMA_showMySQLDocu('MySQL_Database_Administration', 'Charset-connection') . "\n" . '            </form>' . "\n" . '        </td>' . "\n" . '    </tr>' . "\n";
}
echo "\n";
// added by Michael Keck <mail_at_michaelkeck_dot_de>
// ThemeManager if available
if (isset($available_themes_choices) && $available_themes_choices > 1) {
    $theme_selected = FALSE;
    $theme_preview_path = './themes.php';
    $theme_preview_href = '<a href="' . $theme_preview_path . '" target="themes" onclick="' . "window.open('" . $theme_preview_path . "','themes','left=10,top=20,width=510,height=350,scrollbars=yes,status=yes,resizable=yes');" . '">';
    ?>
    <!-- Theme Manager -->
    <tr>
<?php 
    echo '        ' . ($str_iconic_list != '' ? sprintf($str_iconic_list, $theme_preview_href, 's_theme.png', isset($strTheme) ? $strTheme : 'Theme (Style)', '</a>') : $str_normal_list) . "\n";
    ?>
        <td>