当前位置: 首页>>代码示例>>PHP>>正文


PHP Util::getMessage方法代码示例

本文整理汇总了PHP中PMA\libraries\Util::getMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::getMessage方法的具体用法?PHP Util::getMessage怎么用?PHP Util::getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PMA\libraries\Util的用法示例。


在下文中一共展示了Util::getMessage方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getTable

 /**
  * Prepare a table of results returned by a SQL query.
  *
  * @param integer &$dt_result           the link id associated to the query
  *                                      which results have to be displayed
  * @param array   &$displayParts        the parts to display
  * @param array   $analyzed_sql_results analyzed sql results
  * @param boolean $is_limited_display   With limited operations or not
  *
  * @return  string   $table_html   Generated HTML content for resulted table
  *
  * @access  public
  *
  * @see     sql.php file
  */
 public function getTable(&$dt_result, &$displayParts, $analyzed_sql_results, $is_limited_display = false)
 {
     /**
      * The statement this table is built for.
      * @var \SqlParser\Statements\SelectStatement
      */
     $statement = $analyzed_sql_results['statement'];
     $table_html = '';
     // Following variable are needed for use in isset/empty or
     // use with array indexes/safe use in foreach
     $fields_meta = $this->__get('fields_meta');
     $showtable = $this->__get('showtable');
     $printview = $this->__get('printview');
     // why was this called here? (already called from sql.php)
     //$this->setConfigParamsForDisplayTable();
     /**
      * @todo move this to a central place
      * @todo for other future table types
      */
     $is_innodb = isset($showtable['Type']) && $showtable['Type'] == self::TABLE_TYPE_INNO_DB;
     if ($is_innodb && PMA_isJustBrowsing($analyzed_sql_results, true)) {
         // "j u s t   b r o w s i n g"
         $pre_count = '~';
         $after_count = Util::showHint(PMA_sanitize(__('May be approximate. See [doc@faq3-11]FAQ 3.11[/doc].')));
     } else {
         $pre_count = '';
         $after_count = '';
     }
     // 1. ----- Prepares the work -----
     // 1.1 Gets the information about which functionalities should be
     //     displayed
     list($displayParts, $total) = $this->_setDisplayPartsAndTotal($displayParts);
     // 1.2 Defines offsets for the next and previous pages
     if ($displayParts['nav_bar'] == '1') {
         list($pos_next, $pos_prev) = $this->_getOffsets();
     }
     // end if
     // 1.3 Extract sorting expressions.
     //     we need $sort_expression and $sort_expression_nodirection
     //     even if there are many table references
     $sort_expression = array();
     $sort_expression_nodirection = array();
     $sort_direction = array();
     if (!empty($statement->order)) {
         foreach ($statement->order as $o) {
             $sort_expression[] = $o->expr->expr . ' ' . $o->type;
             $sort_expression_nodirection[] = $o->expr->expr;
             $sort_direction[] = $o->type;
         }
     } else {
         $sort_expression[] = '';
         $sort_expression_nodirection[] = '';
         $sort_direction[] = '';
     }
     $number_of_columns = count($sort_expression_nodirection);
     // 1.4 Prepares display of first and last value of the sorted column
     $sorted_column_message = '';
     for ($i = 0; $i < $number_of_columns; $i++) {
         $sorted_column_message .= $this->_getSortedColumnMessage($dt_result, $sort_expression_nodirection[$i]);
     }
     // 2. ----- Prepare to display the top of the page -----
     // 2.1 Prepares a messages with position information
     if ($displayParts['nav_bar'] == '1' && isset($pos_next)) {
         $message = $this->_setMessageInformation($sorted_column_message, $analyzed_sql_results, $total, $pos_next, $pre_count, $after_count);
         $table_html .= Util::getMessage($message, $this->__get('sql_query'), 'success');
     } elseif (!isset($printview) || $printview != '1') {
         $table_html .= Util::getMessage(__('Your SQL query has been executed successfully.'), $this->__get('sql_query'), 'success');
     }
     // 2.3 Prepare the navigation bars
     if (!mb_strlen($this->__get('table'))) {
         if ($analyzed_sql_results['querytype'] == 'SELECT') {
             // table does not always contain a real table name,
             // for example in MySQL 5.0.x, the query SHOW STATUS
             // returns STATUS as a table name
             $this->__set('table', $fields_meta[0]->table);
         } else {
             $this->__set('table', '');
         }
     }
     // can the result be sorted?
     if ($displayParts['sort_lnk'] == '1') {
         // At this point, $sort_expression is an array but we only verify
         // the first element in case we could find that the table is
         // sorted by one of the choices listed in the
         // "Sort by key" drop-down
//.........这里部分代码省略.........
开发者ID:rugbyprof,项目名称:phpmyadmin,代码行数:101,代码来源:DisplayResults.php

示例2: PMA_RTN_handleRequestCreateOrEdit

/**
 * Handle request to create or edit a routine
 *
 * @param array  $errors Errors
 * @param string $db     DB name
 *
 * @return array
 */
function PMA_RTN_handleRequestCreateOrEdit($errors, $db)
{
    if (empty($_REQUEST['editor_process_add']) && empty($_REQUEST['editor_process_edit'])) {
        return $errors;
    }
    $sql_query = '';
    $routine_query = PMA_RTN_getQueryFromRequest();
    if (!count($errors)) {
        // set by PMA_RTN_getQueryFromRequest()
        // Execute the created query
        if (!empty($_REQUEST['editor_process_edit'])) {
            $isProcOrFunc = in_array($_REQUEST['item_original_type'], array('PROCEDURE', 'FUNCTION'));
            if (!$isProcOrFunc) {
                $errors[] = sprintf(__('Invalid routine type: "%s"'), htmlspecialchars($_REQUEST['item_original_type']));
            } else {
                // Backup the old routine, in case something goes wrong
                $create_routine = $GLOBALS['dbi']->getDefinition($db, $_REQUEST['item_original_type'], $_REQUEST['item_original_name']);
                $privilegesBackup = PMA_RTN_backupPrivileges();
                $drop_routine = "DROP {$_REQUEST['item_original_type']} " . PMA\libraries\Util::backquote($_REQUEST['item_original_name']) . ";\n";
                $result = $GLOBALS['dbi']->tryQuery($drop_routine);
                if (!$result) {
                    $errors[] = sprintf(__('The following query has failed: "%s"'), htmlspecialchars($drop_routine)) . '<br />' . __('MySQL said: ') . $GLOBALS['dbi']->getError(null);
                } else {
                    list($newErrors, $message) = PMA_RTN_createRoutine($routine_query, $create_routine, $privilegesBackup);
                    if (empty($newErrors)) {
                        $sql_query = $drop_routine . $routine_query;
                    } else {
                        $errors = array_merge($errors, $newErrors);
                    }
                    unset($newErrors);
                    if (null === $message) {
                        unset($message);
                    }
                }
            }
        } else {
            // 'Add a new routine' mode
            $result = $GLOBALS['dbi']->tryQuery($routine_query);
            if (!$result) {
                $errors[] = sprintf(__('The following query has failed: "%s"'), htmlspecialchars($routine_query)) . '<br /><br />' . __('MySQL said: ') . $GLOBALS['dbi']->getError(null);
            } else {
                $message = PMA\libraries\Message::success(__('Routine %1$s has been created.'));
                $message->addParam(PMA\libraries\Util::backquote($_REQUEST['item_name']));
                $sql_query = $routine_query;
            }
        }
    }
    if (count($errors)) {
        $message = PMA\libraries\Message::error(__('One or more errors have occurred while' . ' processing your request:'));
        $message->addString('<ul>');
        foreach ($errors as $string) {
            $message->addString('<li>' . $string . '</li>');
        }
        $message->addString('</ul>');
    }
    $output = PMA\libraries\Util::getMessage($message, $sql_query);
    if (!$GLOBALS['is_ajax_request']) {
        return $errors;
    }
    $response = PMA\libraries\Response::getInstance();
    if (!$message->isSuccess()) {
        $response->setRequestStatus(false);
        $response->addJSON('message', $output);
        exit;
    }
    $routines = $GLOBALS['dbi']->getRoutines($db, $_REQUEST['item_type'], $_REQUEST['item_name']);
    $routine = $routines[0];
    $response->addJSON('name', htmlspecialchars(mb_strtoupper($_REQUEST['item_name'])));
    $response->addJSON('new_row', PMA_RTN_getRowForList($routine));
    $response->addJSON('insert', !empty($routine));
    $response->addJSON('message', $output);
    exit;
}
开发者ID:wp-cloud,项目名称:phpmyadmin,代码行数:81,代码来源:rte_routines.lib.php

示例3: PMA_getExtraDataForAjaxBehavior

/**
 * This function return the extra data array for the ajax behavior
 *
 * @param string $password  password
 * @param string $sql_query sql query
 * @param string $hostname  hostname
 * @param string $username  username
 *
 * @return array $extra_data
 */
function PMA_getExtraDataForAjaxBehavior($password, $sql_query, $hostname, $username)
{
    if (isset($GLOBALS['dbname'])) {
        //if (preg_match('/\\\\(?:_|%)/i', $dbname)) {
        if (preg_match('/(?<!\\\\)(?:_|%)/i', $GLOBALS['dbname'])) {
            $dbname_is_wildcard = true;
        } else {
            $dbname_is_wildcard = false;
        }
    }
    $user_group_count = 0;
    if ($GLOBALS['cfgRelation']['menuswork']) {
        $user_group_count = PMA_getUserGroupCount();
    }
    $extra_data = array();
    if (mb_strlen($sql_query)) {
        $extra_data['sql_query'] = Util::getMessage(null, $sql_query);
    }
    if (isset($_REQUEST['change_copy'])) {
        /**
         * generate html on the fly for the new user that was just created.
         */
        $new_user_string = '<tr>' . "\n" . '<td> <input type="checkbox" name="selected_usr[]" ' . 'id="checkbox_sel_users_"' . 'value="' . htmlspecialchars($username) . '&amp;#27;' . htmlspecialchars($hostname) . '" />' . '</td>' . "\n" . '<td><label for="checkbox_sel_users_">' . (empty($_REQUEST['username']) ? '<span style="color: #FF0000">' . __('Any') . '</span>' : htmlspecialchars($username)) . '</label></td>' . "\n" . '<td>' . htmlspecialchars($hostname) . '</td>' . "\n";
        $new_user_string .= '<td>';
        if (!empty($password) || isset($_POST['pma_pw'])) {
            $new_user_string .= __('Yes');
        } else {
            $new_user_string .= '<span style="color: #FF0000">' . __('No') . '</span>';
        }
        $new_user_string .= '</td>' . "\n";
        $new_user_string .= '<td>' . '<code>' . join(', ', PMA_extractPrivInfo(null, true)) . '</code>' . '</td>';
        //Fill in privileges here
        // if $cfg['Servers'][$i]['users'] and $cfg['Servers'][$i]['usergroups'] are
        // enabled
        $cfgRelation = PMA_getRelationsParam();
        if (isset($cfgRelation['users']) && isset($cfgRelation['usergroups'])) {
            $new_user_string .= '<td class="usrGroup"></td>';
        }
        $new_user_string .= '<td>';
        if (isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y') {
            $new_user_string .= __('Yes');
        } else {
            $new_user_string .= __('No');
        }
        $new_user_string .= '</td>';
        if ($GLOBALS['is_grantuser']) {
            $new_user_string .= '<td>' . PMA_getUserLink('edit', $username, $hostname) . '</td>' . "\n";
        }
        if ($cfgRelation['menuswork'] && $user_group_count > 0) {
            $new_user_string .= '<td>' . PMA_getUserGroupEditLink($username) . '</td>' . "\n";
        }
        $new_user_string .= '<td>' . PMA_getUserLink('export', $username, $hostname, '', '', '', isset($_GET['initial']) ? $_GET['initial'] : '') . '</td>' . "\n";
        $new_user_string .= '</tr>';
        $extra_data['new_user_string'] = $new_user_string;
        /**
         * Generate the string for this alphabet's initial, to update the user
         * pagination
         */
        $new_user_initial = mb_strtoupper(mb_substr($username, 0, 1));
        $newUserInitialString = '<a href="server_privileges.php' . PMA_URL_getCommon(array('initial' => $new_user_initial)) . '">' . $new_user_initial . '</a>';
        $extra_data['new_user_initial'] = $new_user_initial;
        $extra_data['new_user_initial_string'] = $newUserInitialString;
    }
    if (isset($_POST['update_privs'])) {
        $extra_data['db_specific_privs'] = false;
        $extra_data['db_wildcard_privs'] = false;
        if (isset($dbname_is_wildcard)) {
            $extra_data['db_specific_privs'] = !$dbname_is_wildcard;
            $extra_data['db_wildcard_privs'] = $dbname_is_wildcard;
        }
        $new_privileges = join(', ', PMA_extractPrivInfo(null, true));
        $extra_data['new_privileges'] = $new_privileges;
    }
    if (isset($_REQUEST['validate_username'])) {
        $sql_query = "SELECT * FROM `mysql`.`user` WHERE `User` = '" . $_REQUEST['username'] . "';";
        $res = $GLOBALS['dbi']->query($sql_query);
        $row = $GLOBALS['dbi']->fetchRow($res);
        if (empty($row)) {
            $extra_data['user_exists'] = false;
        } else {
            $extra_data['user_exists'] = true;
        }
    }
    return $extra_data;
}
开发者ID:itgsod-philip-skalander,项目名称:phpmyadmin,代码行数:95,代码来源:server_privileges.lib.php

示例4: replaceAction

 /**
  * Replace action
  *
  * @return void
  */
 public function replaceAction()
 {
     $this->replace($_POST['columnIndex'], $_POST['findString'], $_POST['replaceWith'], $_POST['useRegex'], $this->_connectionCharSet);
     $this->response->addHTML(Util::getMessage(__('Your SQL query has been executed successfully.'), null, 'success'));
 }
开发者ID:rclakmal,项目名称:phpmyadmin,代码行数:10,代码来源:TableSearchController.php

示例5:

$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('sql.js');
$scripts->addFile('tbl_change.js');
$scripts->addFile('big_ints.js');
$scripts->addFile('jquery/jquery-ui-timepicker-addon.js');
$scripts->addFile('jquery/jquery.validate.js');
$scripts->addFile('jquery/additional-methods.js');
$scripts->addFile('gis_data_editor.js');
/**
 * Displays the query submitted and its result
 *
 * $disp_message come from tbl_replace.php
 */
if (!empty($disp_message)) {
    $response->addHTML(Util::getMessage($disp_message, null));
}
$table_columns = PMA_getTableColumns($db, $table);
// retrieve keys into foreign fields, if any
$foreigners = PMA_getForeigners($db, $table);
// Retrieve form parameters for insert/edit form
$_form_params = PMA_getFormParametersForInsertForm($db, $table, $where_clauses, $where_clause_array, $err_url);
/**
 * Displays the form
 */
// autocomplete feature of IE kills the "onchange" event handler and it
//        must be replaced by the "onpropertychange" one in this case
$chg_evt_handler = 'onchange';
// Had to put the URI because when hosted on an https server,
// some browsers send wrongly this form to the http server.
$html_output = '';
开发者ID:poush,项目名称:phpmyadmin,代码行数:31,代码来源:tbl_change.php

示例6: PMA_getLogInfo

/**
 * Returns the html for binary log information.
 *
 * @param Array $url_params links parameters
 *
 * @return string
 */
function PMA_getLogInfo($url_params)
{
    /**
     * Need to find the real end of rows?
     */
    if (!isset($_REQUEST['pos'])) {
        $pos = 0;
    } else {
        /* We need this to be a integer */
        $pos = (int) $_REQUEST['pos'];
    }
    $sql_query = 'SHOW BINLOG EVENTS';
    if (!empty($_REQUEST['log'])) {
        $sql_query .= ' IN \'' . $_REQUEST['log'] . '\'';
    }
    $sql_query .= ' LIMIT ' . $pos . ', ' . (int) $GLOBALS['cfg']['MaxRows'];
    /**
     * Sends the query
     */
    $result = $GLOBALS['dbi']->query($sql_query);
    /**
     * prepare some vars for displaying the result table
     */
    // Gets the list of fields properties
    if (isset($result) && $result) {
        $num_rows = $GLOBALS['dbi']->numRows($result);
    } else {
        $num_rows = 0;
    }
    if (empty($_REQUEST['dontlimitchars'])) {
        $dontlimitchars = false;
    } else {
        $dontlimitchars = true;
        $url_params['dontlimitchars'] = 1;
    }
    //html output
    $html = Util::getMessage(Message::success(), $sql_query);
    $html .= '<table id="binlogTable">' . '<thead>' . '<tr>' . '<td colspan="6" class="center">';
    $html .= PMA_getNavigationRow($url_params, $pos, $num_rows, $dontlimitchars);
    $html .= '</td>' . '</tr>' . '<tr>' . '<th>' . __('Log name') . '</th>' . '<th>' . __('Position') . '</th>' . '<th>' . __('Event type') . '</th>' . '<th>' . __('Server ID') . '</th>' . '<th>' . __('Original position') . '</th>' . '<th>' . __('Information') . '</th>' . '</tr>' . '</thead>' . '<tbody>';
    $html .= PMA_getAllLogItemInfo($result, $dontlimitchars);
    $html .= '</tbody>' . '</table>';
    return $html;
}
开发者ID:netroby,项目名称:phpmyadmin,代码行数:51,代码来源:server_bin_log.lib.php

示例7: getMessage

 /**
  * Returns the message to be displayed at the top of
  * the page, including the executed SQL query, if any.
  *
  * @return string
  */
 public function getMessage()
 {
     $retval = '';
     $message = '';
     if (!empty($GLOBALS['message'])) {
         $message = $GLOBALS['message'];
         unset($GLOBALS['message']);
     } else {
         if (!empty($_REQUEST['message'])) {
             $message = $_REQUEST['message'];
         }
     }
     if (!empty($message)) {
         if (isset($GLOBALS['buffer_message'])) {
             $buffer_message = $GLOBALS['buffer_message'];
         }
         $retval .= Util::getMessage($message);
         if (isset($buffer_message)) {
             $GLOBALS['buffer_message'] = $buffer_message;
         }
     }
     return $retval;
 }
开发者ID:iShareLife,项目名称:phpmyadmin,代码行数:29,代码来源:Header.php

示例8: updateColumns

 /**
  * Update the table's structure based on $_REQUEST
  *
  * @return boolean $regenerate              true if error occurred
  *
  */
 protected function updateColumns()
 {
     $err_url = 'tbl_structure.php' . PMA_URL_getCommon(array('db' => $this->db, 'table' => $this->table));
     $regenerate = false;
     $field_cnt = count($_REQUEST['field_name']);
     $changes = array();
     $adjust_privileges = array();
     for ($i = 0; $i < $field_cnt; $i++) {
         if (!$this->columnNeedsAlterTable($i)) {
             continue;
         }
         $changes[] = 'CHANGE ' . Table::generateAlter(Util_lib\get($_REQUEST, "field_orig.{$i}", ''), $_REQUEST['field_name'][$i], $_REQUEST['field_type'][$i], $_REQUEST['field_length'][$i], $_REQUEST['field_attribute'][$i], Util_lib\get($_REQUEST, "field_collation.{$i}", ''), Util_lib\get($_REQUEST, "field_null.{$i}", 'NOT NULL'), $_REQUEST['field_default_type'][$i], $_REQUEST['field_default_value'][$i], Util_lib\get($_REQUEST, "field_extra.{$i}", false), Util_lib\get($_REQUEST, "field_comments.{$i}", ''), Util_lib\get($_REQUEST, "field_virtuality.{$i}", ''), Util_lib\get($_REQUEST, "field_expression.{$i}", ''), Util_lib\get($_REQUEST, "field_move_to.{$i}", ''));
         // find the remembered sort expression
         $sorted_col = $this->table_obj->getUiProp(Table::PROP_SORTED_COLUMN);
         // if the old column name is part of the remembered sort expression
         if (mb_strpos($sorted_col, Util::backquote($_REQUEST['field_orig'][$i])) !== false) {
             // delete the whole remembered sort expression
             $this->table_obj->removeUiProp(Table::PROP_SORTED_COLUMN);
         }
         if (isset($_REQUEST['field_adjust_privileges'][$i]) && !empty($_REQUEST['field_adjust_privileges'][$i]) && $_REQUEST['field_orig'][$i] != $_REQUEST['field_name'][$i]) {
             $adjust_privileges[$_REQUEST['field_orig'][$i]] = $_REQUEST['field_name'][$i];
         }
     }
     // end for
     if (count($changes) > 0 || isset($_REQUEST['preview_sql'])) {
         // Builds the primary keys statements and updates the table
         $key_query = '';
         /**
          * this is a little bit more complex
          *
          * @todo if someone selects A_I when altering a column we need to check:
          *  - no other column with A_I
          *  - the column has an index, if not create one
          *
          */
         // To allow replication, we first select the db to use
         // and then run queries on this db.
         if (!$this->dbi->selectDb($this->db)) {
             Util::mysqlDie($this->dbi->getError(), 'USE ' . Util::backquote($this->db) . ';', false, $err_url);
         }
         $sql_query = 'ALTER TABLE ' . Util::backquote($this->table) . ' ';
         $sql_query .= implode(', ', $changes) . $key_query;
         $sql_query .= ';';
         // If there is a request for SQL previewing.
         if (isset($_REQUEST['preview_sql'])) {
             PMA_previewSQL(count($changes) > 0 ? $sql_query : '');
         }
         $columns_with_index = $this->dbi->getTable($this->db, $this->table)->getColumnsWithIndex(PMA_Index::PRIMARY | PMA_Index::UNIQUE | PMA_Index::INDEX | PMA_Index::SPATIAL | PMA_Index::FULLTEXT);
         $changedToBlob = array();
         // While changing the Column Collation
         // First change to BLOB
         for ($i = 0; $i < $field_cnt; $i++) {
             if (isset($_REQUEST['field_collation'][$i]) && isset($_REQUEST['field_collation_orig'][$i]) && $_REQUEST['field_collation'][$i] !== $_REQUEST['field_collation_orig'][$i] && !in_array($_REQUEST['field_orig'][$i], $columns_with_index)) {
                 $secondary_query = 'ALTER TABLE ' . Util::backquote($this->table) . ' CHANGE ' . Util::backquote($_REQUEST['field_orig'][$i]) . ' ' . Util::backquote($_REQUEST['field_orig'][$i]) . ' BLOB;';
                 $this->dbi->query($secondary_query);
                 $changedToBlob[$i] = true;
             } else {
                 $changedToBlob[$i] = false;
             }
         }
         // Then make the requested changes
         $result = $this->dbi->tryQuery($sql_query);
         if ($result !== false) {
             $changed_privileges = $this->adjustColumnPrivileges($adjust_privileges);
             if ($changed_privileges) {
                 $message = Message::success(__('Table %1$s has been altered successfully. Privileges ' . 'have been adjusted.'));
             } else {
                 $message = Message::success(__('Table %1$s has been altered successfully.'));
             }
             $message->addParam($this->table);
             $this->response->addHTML(Util::getMessage($message, $sql_query, 'success'));
         } else {
             // An error happened while inserting/updating a table definition
             // Save the Original Error
             $orig_error = $this->dbi->getError();
             $changes_revert = array();
             // Change back to Original Collation and data type
             for ($i = 0; $i < $field_cnt; $i++) {
                 if ($changedToBlob[$i]) {
                     $changes_revert[] = 'CHANGE ' . Table::generateAlter(Util_lib\get($_REQUEST, "field_orig.{$i}", ''), $_REQUEST['field_name'][$i], $_REQUEST['field_type_orig'][$i], $_REQUEST['field_length_orig'][$i], $_REQUEST['field_attribute_orig'][$i], Util_lib\get($_REQUEST, "field_collation_orig.{$i}", ''), Util_lib\get($_REQUEST, "field_null_orig.{$i}", 'NOT NULL'), $_REQUEST['field_default_type_orig'][$i], $_REQUEST['field_default_value_orig'][$i], Util_lib\get($_REQUEST, "field_extra_orig.{$i}", false), Util_lib\get($_REQUEST, "field_comments_orig.{$i}", ''), Util_lib\get($_REQUEST, "field_virtuality_orig.{$i}", ''), Util_lib\get($_REQUEST, "field_expression_orig.{$i}", ''), Util_lib\get($_REQUEST, "field_move_to_orig.{$i}", ''));
                 }
             }
             $revert_query = 'ALTER TABLE ' . Util::backquote($this->table) . ' ';
             $revert_query .= implode(', ', $changes_revert) . '';
             $revert_query .= ';';
             // Column reverted back to original
             $this->dbi->query($revert_query);
             $this->response->setRequestStatus(false);
             $this->response->addJSON('message', Message::rawError(__('Query error') . ':<br />' . $orig_error));
             $regenerate = true;
         }
     }
     // update field names in relation
     if (isset($_REQUEST['field_orig']) && is_array($_REQUEST['field_orig'])) {
//.........这里部分代码省略.........
开发者ID:Gemorroj,项目名称:phpmyadmin,代码行数:101,代码来源:TableStructureController.php

示例9: createDatabaseAction

 /**
  * Handles creating a new database
  *
  * @return void
  */
 public function createDatabaseAction()
 {
     /**
      * Builds and executes the db creation sql query
      */
     $sql_query = 'CREATE DATABASE ' . Util::backquote($_POST['new_db']);
     if (!empty($_POST['db_collation'])) {
         list($db_charset) = explode('_', $_POST['db_collation']);
         if (in_array($db_charset, $GLOBALS['mysql_charsets']) && in_array($_POST['db_collation'], $GLOBALS['mysql_collations'][$db_charset])) {
             $sql_query .= ' DEFAULT' . PMA_generateCharsetQueryPart($_POST['db_collation']);
         }
     }
     $sql_query .= ';';
     $result = $GLOBALS['dbi']->tryQuery($sql_query);
     if (!$result) {
         // avoid displaying the not-created db name in header or navi panel
         $GLOBALS['db'] = '';
         $message = Message::rawError($GLOBALS['dbi']->getError());
         $this->response->setRequestStatus(false);
         $this->response->addJSON('message', $message);
     } else {
         $GLOBALS['db'] = $_POST['new_db'];
         $message = Message::success(__('Database %1$s has been created.'));
         $message->addParam($_POST['new_db']);
         $this->response->addJSON('message', $message);
         $this->response->addJSON('sql_query', Util::getMessage(null, $sql_query, 'success'));
         $url_query = PMA_URL_getCommon(array('db' => $_POST['new_db']));
         $this->response->addJSON('url_query', Util::getScriptNameForOption($GLOBALS['cfg']['DefaultTabDatabase'], 'database') . $url_query . '&amp;db=' . urlencode($_POST['new_db']));
     }
 }
开发者ID:flash1452,项目名称:phpmyadmin,代码行数:35,代码来源:ServerDatabasesController.php

示例10: updateForInternalRelationAction

 /**
  * Update for internal relation
  *
  * @return void
  */
 public function updateForInternalRelationAction()
 {
     $multi_edit_columns_name = isset($_REQUEST['fields_name']) ? $_REQUEST['fields_name'] : null;
     if ($this->upd_query->updateInternalRelations($multi_edit_columns_name, $_POST['destination_db'], $_POST['destination_table'], $_POST['destination_column'], $this->cfgRelation, isset($this->existrel) ? $this->existrel : null)) {
         $this->response->addHTML(Util::getMessage(__('Internal relations were successfully updated.'), '', 'success'));
     }
 }
开发者ID:itgsod-philip-skalander,项目名称:phpmyadmin,代码行数:12,代码来源:TableRelationController.php

示例11: doSaveDataAction

 /**
  * Process the data from the edit/create index form,
  * run the query to build the new index
  * and moves back to "tbl_sql.php"
  *
  * @return void
  */
 public function doSaveDataAction()
 {
     $error = false;
     $sql_query = $this->dbi->getTable($this->db, $this->table)->getSqlQueryForIndexCreateOrEdit($this->index, $error);
     // If there is a request for SQL previewing.
     if (isset($_REQUEST['preview_sql'])) {
         $this->response->addJSON('sql_data', Template::get('preview_sql')->render(array('query_data' => $sql_query)));
     } elseif (!$error) {
         $this->dbi->query($sql_query);
         if ($GLOBALS['is_ajax_request'] == true) {
             $message = Message::success(__('Table %1$s has been altered successfully.'));
             $message->addParam($this->table);
             $this->response->addJSON('message', Util::getMessage($message, $sql_query, 'success'));
             $this->response->addJSON('index_table', Index::getHtmlForIndexes($this->table, $this->db));
         } else {
             include 'tbl_structure.php';
         }
     } else {
         $this->response->setRequestStatus(false);
         $this->response->addJSON('message', $error);
     }
 }
开发者ID:itgsod-philip-skalander,项目名称:phpmyadmin,代码行数:29,代码来源:TableIndexesController.php


注:本文中的PMA\libraries\Util::getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。