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


PHP PMA_message::notice方法代码示例

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


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

示例1: PMA_getMessageIfMissingColumnIndex

/**
 * To get the message if a column index is missing. If not will return null
 *
 * @param string  $table    current table
 * @param string  $db       current database
 * @param boolean $editable whether the results table can be editable or not
 *
 * @return PMA_message $message
 */
function PMA_getMessageIfMissingColumnIndex($table, $db, $editable)
{
    if (!empty($table) && ($GLOBALS['dbi']->isSystemSchema($db) || !$editable)) {
        $missing_unique_column_msg = PMA_message::notice(__('Current selection does not contain a unique column.' . ' Grid edit, checkbox, Edit, Copy and Delete features' . ' are not available.'));
    } else {
        $missing_unique_column_msg = null;
    }
    return $missing_unique_column_msg;
}
开发者ID:harryboulderdash,项目名称:PlayGFC,代码行数:18,代码来源:sql.lib.php

示例2: PMA_RTN_handleExecute


//.........这里部分代码省略.........
                        while ($row = PMA_DBI_fetch_assoc($result)) {
                            $output .= "<tr>";
                            foreach ($row as $key => $value) {
                                if ($value === null) {
                                    $value = '<i>NULL</i>';
                                } else {
                                    $value = htmlspecialchars($value);
                                }
                                $output .= "<td class='" . $color_class . "'>" . $value . "</td>";
                            }
                            $output .= "</tr>";
                            $color_class = $color_class == 'odd' ? 'even' : 'odd';
                        }
                        $output .= "</table>";
                        $num_of_rusults_set_to_display++;
                        $affected = $num_rows;
                    }
                    if (!PMA_DBI_more_results()) {
                        break;
                    }
                    $output .= "<br/>";
                    PMA_DBI_free_result($result);
                } while (PMA_DBI_next_result());
                $output .= "</fieldset>";
                $message = __('Your SQL query has been executed successfully');
                if ($routine['item_type'] == 'PROCEDURE') {
                    $message .= '<br />';
                    // TODO : message need to be modified according to the
                    // output from the routine
                    $message .= sprintf(_ngettext('%d row affected by the last statement inside the procedure', '%d rows affected by the last statement inside the procedure', $affected), $affected);
                }
                $message = PMA_message::success($message);
                if ($num_of_rusults_set_to_display == 0) {
                    $notice = __('MySQL returned an empty result set (i.e. zero rows).');
                    $output .= PMA_message::notice($notice)->getDisplay();
                }
            } else {
                $output = '';
                $message = PMA_message::error(sprintf(__('The following query has failed: "%s"'), htmlspecialchars($query)) . '<br /><br />' . __('MySQL said: ') . PMA_DBI_getError(null));
            }
            // Print/send output
            if ($GLOBALS['is_ajax_request']) {
                $response = PMA_Response::getInstance();
                $response->isSuccess($message->isSuccess());
                $response->addJSON('message', $message->getDisplay() . $output);
                $response->addJSON('dialog', false);
                exit;
            } else {
                echo $message->getDisplay() . $output;
                if ($message->isError()) {
                    // At least one query has failed, so shouldn't
                    // execute any more queries, so we quit.
                    exit;
                }
                unset($_POST);
                // Now deliberately fall through to displaying the routines list
            }
        } else {
            $message = __('Error in processing request') . ' : ';
            $message .= sprintf(PMA_RTE_getWord('not_found'), htmlspecialchars(PMA_Util::backquote($_REQUEST['item_name'])), htmlspecialchars(PMA_Util::backquote($db)));
            $message = PMA_message::error($message);
            if ($GLOBALS['is_ajax_request']) {
                $response = PMA_Response::getInstance();
                $response->isSuccess(false);
                $response->addJSON('message', $message);
                exit;
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:67,代码来源:rte_routines.lib.php

示例3: indexAction

 /**
  * Index action
  *
  * @return void
  */
 public function indexAction()
 {
     // Add/Remove favorite tables using Ajax request.
     if ($GLOBALS['is_ajax_request'] && !empty($_REQUEST['favorite_table'])) {
         $this->addRemoveFavoriteTablesAction();
         return;
     }
     $this->response->getHeader()->getScripts()->addFiles(array('db_structure.js', 'tbl_change.js', 'jquery/jquery-ui-timepicker-addon.js'));
     // Drops/deletes/etc. multiple tables if required
     if (!empty($_POST['submit_mult']) && isset($_POST['selected_tbl']) || isset($_POST['mult_btn'])) {
         $action = 'db_structure.php';
         $err_url = 'db_structure.php' . PMA_URL_getCommon(array('db' => $this->db));
         // see bug #2794840; in this case, code path is:
         // db_structure.php -> libraries/mult_submits.inc.php -> sql.php
         // -> db_structure.php and if we got an error on the multi submit,
         // we must display it here and not call again mult_submits.inc.php
         if (!isset($_POST['error']) || false === $_POST['error']) {
             include 'libraries/mult_submits.inc.php';
         }
         if (empty($_POST['message'])) {
             $_POST['message'] = PMA_Message::success();
         }
     }
     $this->_url_query .= '&amp;goto=db_structure.php';
     // Gets the database structure
     $sub_part = '_structure';
     list($tables, $num_tables, $total_num_tables, $sub_part, $is_show_stats, $db_is_system_schema, $tooltip_truename, $tooltip_aliasname, $pos) = PMA_Util::getDbInfo($GLOBALS['db'], isset($sub_part) ? $sub_part : '');
     $this->_tables = $tables;
     // updating $tables seems enough for #11376, but updating other
     // variables too in case they may cause some other problem.
     $this->_num_tables = $num_tables;
     $this->_pos = $pos;
     $this->_db_is_system_schema = $db_is_system_schema;
     $this->_total_num_tables = $total_num_tables;
     $this->_is_show_stats = $is_show_stats;
     // If there is an Ajax request for real row count of a table.
     if ($GLOBALS['is_ajax_request'] && isset($_REQUEST['real_row_count']) && $_REQUEST['real_row_count'] == true) {
         $this->handleRealRowCountRequestAction();
         return;
     }
     if (!PMA_DRIZZLE) {
         include_once 'libraries/replication.inc.php';
     } else {
         $GLOBALS['replication_info']['slave']['status'] = false;
     }
     PMA_PageSettings::showGroup('DbStructure');
     $db_collation = PMA_getDbCollation($this->db);
     $titles = PMA_Util::buildActionTitles();
     // 1. No tables
     if ($this->_num_tables == 0) {
         $this->response->addHTML(PMA_message::notice(__('No tables found in database.')));
         if (empty($db_is_system_schema)) {
             $this->response->addHTML(PMA_getHtmlForCreateTable($this->db));
         }
         return;
     }
     // else
     // 2. Shows table information
     /**
      * Displays the tables list
      */
     $this->response->addHTML('<div id="tableslistcontainer">');
     $_url_params = array('pos' => $this->_pos, 'db' => $this->db);
     // Add the sort options if they exists
     if (isset($_REQUEST['sort'])) {
         $_url_params['sort'] = $_REQUEST['sort'];
     }
     if (isset($_REQUEST['sort_order'])) {
         $_url_params['sort_order'] = $_REQUEST['sort_order'];
     }
     $this->response->addHTML(PMA_Util::getListNavigator($this->_total_num_tables, $this->_pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']));
     // table form
     $this->response->addHTML(Template::get('database/structure/table_header')->render(array('db' => $this->db, 'db_is_system_schema' => $this->_db_is_system_schema, 'replication' => $GLOBALS['replication_info']['slave']['status'])));
     $i = $sum_entries = 0;
     $overhead_check = '';
     $create_time_all = '';
     $update_time_all = '';
     $check_time_all = '';
     $num_columns = $GLOBALS['cfg']['PropertiesNumColumns'] > 1 ? ceil($this->_num_tables / $GLOBALS['cfg']['PropertiesNumColumns']) + 1 : 0;
     $row_count = 0;
     $sum_size = (double) 0;
     $overhead_size = (double) 0;
     $hidden_fields = array();
     $odd_row = true;
     $overall_approx_rows = false;
     // Instance of PMA_RecentFavoriteTable class.
     $fav_instance = PMA_RecentFavoriteTable::getInstance('favorite');
     foreach ($this->_tables as $keyname => $current_table) {
         // Get valid statistics whatever is the table type
         $drop_query = '';
         $drop_message = '';
         $already_favorite = false;
         $overhead = '';
         $table_is_view = false;
         $table_encoded = urlencode($current_table['TABLE_NAME']);
//.........这里部分代码省略.........
开发者ID:TheBlackBloodyUnicorn,项目名称:pico_wanderblog,代码行数:101,代码来源:DatabaseStructureController.class.php

示例4: PMA_getReservedWordColumnNameMessages

/**
 * Check column names for MySQL reserved words
 *
 * @param string $db    database name
 * @param string $table tablename
 *
 * @return array $messages      array of PMA_Messages
 */
function PMA_getReservedWordColumnNameMessages($db, $table)
{
    $messages = array();
    if ($GLOBALS['cfg']['ReservedWordDisableWarning'] === false) {
        $pma_table = new PMA_Table($table, $db);
        $columns = $pma_table->getReservedColumnNames();
        if (!empty($columns)) {
            foreach ($columns as $column) {
                $msg = PMA_message::notice(__('The column name \'%s\' is a MySQL reserved keyword.'));
                $msg->addParam($column);
                $messages[] = $msg;
            }
        }
    }
    return $messages;
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:24,代码来源:structure.lib.php

示例5: PMA_getMessageIfMissingColumnIndex

/**
 * To get the message if a column index is missing. If not will return null
 *
 * @param string  $table      current table
 * @param string  $db         current database
 * @param boolean $editable   whether the results table can be editable or not
 * @param boolean $has_unique whether there is a unique key
 *
 * @return PMA_message $message
 */
function PMA_getMessageIfMissingColumnIndex($table, $db, $editable, $has_unique)
{
    if (!empty($table) && ($GLOBALS['dbi']->isSystemSchema($db) || !$editable)) {
        $missing_unique_column_msg = PMA_message::notice(sprintf(__('Current selection does not contain a unique column.' . ' Grid edit, checkbox, Edit, Copy and Delete features' . ' are not available. %s'), PMA_Util::showDocu('config', 'cfg_RowActionLinksWithoutUnique')));
    } elseif (!empty($table) && !$has_unique) {
        $missing_unique_column_msg = PMA_message::notice(sprintf(__('Current selection does not contain a unique column.' . ' Grid edit, Edit, Copy and Delete features may result in' . ' undesired behavior. %s'), PMA_Util::showDocu('config', 'cfg_RowActionLinksWithoutUnique')));
    } else {
        $missing_unique_column_msg = null;
    }
    return $missing_unique_column_msg;
}
开发者ID:mi-squared,项目名称:openemr,代码行数:21,代码来源:sql.lib.php

示例6: PMA_resultSetContainsUniqueKey

 // Displays the results in a table
 if (empty($disp_mode)) {
     // see the "PMA_setDisplayMode()" function in
     // libraries/DisplayResults.class.php
     $disp_mode = 'urdr111101';
 }
 $resultSetContainsUniqueKey = PMA_resultSetContainsUniqueKey($db, $table, $fields_meta);
 // hide edit and delete links:
 // - for information_schema
 // - if the result set does not contain all the columns of a unique key
 //   and we are not just browing all the columns of an updatable view
 $updatableView = $justBrowsing && trim($analyzed_sql[0]['select_expr_clause']) == '*' && PMA_Table::isUpdatableView($db, $table);
 $editable = $resultSetContainsUniqueKey || $updatableView;
 if (PMA_is_system_schema($db) || !$editable) {
     $disp_mode = 'nnnn110111';
     $msg = PMA_message::notice(__('This table does not contain a unique column.' . ' Grid edit, checkbox, Edit, Copy and Delete features' . ' are not available.'));
     $msg->display();
 }
 if (isset($label)) {
     $msg = PMA_message::success(__('Bookmark %s created'));
     $msg->addParam($label);
     $msg->display();
 }
 // Should be initialized these parameters before parsing
 $showtable = isset($showtable) ? $showtable : null;
 $printview = isset($printview) ? $printview : null;
 $url_query = isset($url_query) ? $url_query : null;
 if (!empty($sql_data) && $sql_data['valid_queries'] > 1 || $is_procedure) {
     $_SESSION['is_multi_query'] = true;
     echo getTableHtmlForMultipleQueries($displayResultsObject, $db, $sql_data, $goto, $pmaThemeImage, $text_dir, $printview, $url_query, $disp_mode, $sql_limit_to_append, $editable);
 } else {
开发者ID:SashiAsakura,项目名称:AWS_QuikID_website,代码行数:31,代码来源:sql.php

示例7: PMA_getRelationsParam

 */
$cfgRelation = PMA_getRelationsParam();
/**
 * Runs common work
 */
require_once 'libraries/tbl_common.inc.php';
$url_query .= '&amp;goto=tbl_structure.php&amp;back=tbl_structure.php';
$url_params['goto'] = 'tbl_structure.php';
$url_params['back'] = 'tbl_structure.php';
// Check column names for MySQL reserved words
if ($cfg['ReservedWordDisableWarning'] === false) {
    $pma_table = new PMA_Table($table, $db);
    $columns = $pma_table->getReservedColumnNames();
    if (!empty($columns)) {
        foreach ($columns as $column) {
            $msg = PMA_message::notice(__('The column name \'%s\' is a MySQL reserved keyword.'));
            $msg->addParam($column);
            $response->addHTML($msg);
        }
    }
}
/**
 * Prepares the table structure display
 */
/**
 * Gets tables informations
 */
require_once 'libraries/tbl_info.inc.php';
require_once 'libraries/Index.class.php';
// 2. Gets table keys and retains them
// @todo should be: $server->db($db)->table($table)->primary()
开发者ID:fanscky,项目名称:HTPMS,代码行数:31,代码来源:tbl_structure.php

示例8: PMA_handleRealRowCountRequest

if ($GLOBALS['is_ajax_request'] && isset($_REQUEST['real_row_count']) && $_REQUEST['real_row_count'] == true) {
    PMA_handleRealRowCountRequest();
    exit;
}
if (!PMA_DRIZZLE) {
    include_once 'libraries/replication.inc.php';
} else {
    $GLOBALS['replication_info']['slave']['status'] = false;
}
require_once 'libraries/bookmark.lib.php';
require_once 'libraries/mysql_charsets.inc.php';
$db_collation = PMA_getDbCollation($db);
$titles = PMA_Util::buildActionTitles();
// 1. No tables
if ($num_tables == 0) {
    $response->addHTML(PMA_message::notice(__('No tables found in database.')));
    PMA_possiblyShowCreateTableDialog($db, $db_is_system_schema, $response);
    exit;
}
// else
// 2. Shows table informations
/**
 * Displays the tables list
 */
$response->addHTML('<div id="tableslistcontainer">');
$_url_params = array('pos' => $pos, 'db' => $db);
// Add the sort options if they exists
if (isset($_REQUEST['sort'])) {
    $_url_params['sort'] = $_REQUEST['sort'];
}
if (isset($_REQUEST['sort_order'])) {
开发者ID:graurus,项目名称:testgit_t37,代码行数:31,代码来源:db_structure.php

示例9: indexAction

 /**
  * Index action
  *
  * @return void
  */
 public function indexAction()
 {
     // Database structure
     if ($this->_type == 'db') {
         // Add/Remove favorite tables using Ajax request.
         if ($GLOBALS['is_ajax_request'] && !empty($_REQUEST['favorite_table'])) {
             $this->addRemoveFavoriteTables();
             return;
         }
         $this->response->getHeader()->getScripts()->addFiles(array('db_structure.js', 'tbl_change.js', 'jquery/jquery-ui-timepicker-addon.js'));
         // Drops/deletes/etc. multiple tables if required
         if (!empty($_POST['submit_mult']) && isset($_POST['selected_tbl']) || isset($_POST['mult_btn'])) {
             $action = 'db_structure.php';
             $err_url = 'db_structure.php' . PMA_URL_getCommon(array('db' => $this->_db));
             // see bug #2794840; in this case, code path is:
             // db_structure.php -> libraries/mult_submits.inc.php -> sql.php
             // -> db_structure.php and if we got an error on the multi submit,
             // we must display it here and not call again mult_submits.inc.php
             if (!isset($_POST['error']) || false === $_POST['error']) {
                 include 'libraries/mult_submits.inc.php';
             }
             if (empty($_POST['message'])) {
                 $_POST['message'] = PMA_Message::success();
             }
         }
         $this->_url_query .= '&amp;goto=db_structure.php';
         // Gets the database structure
         $sub_part = '_structure';
         // If there is an Ajax request for real row count of a table.
         if ($GLOBALS['is_ajax_request'] && isset($_REQUEST['real_row_count']) && $_REQUEST['real_row_count'] == true) {
             $this->handleRealRowCountRequestAction();
             return;
         }
         if (!PMA_DRIZZLE) {
             include_once 'libraries/replication.inc.php';
         } else {
             $GLOBALS['replication_info']['slave']['status'] = false;
         }
         PMA_PageSettings::showGroup('DbStructure');
         $db_collation = PMA_getDbCollation($this->_db);
         $titles = PMA_Util::buildActionTitles();
         // 1. No tables
         if ($this->_num_tables == 0) {
             $this->response->addHTML(PMA_message::notice(__('No tables found in database.')));
             if (empty($db_is_system_schema)) {
                 $this->response->addHTML(PMA_getHtmlForCreateTable($this->_db));
             }
             return;
         }
         // else
         // 2. Shows table information
         /**
          * Displays the tables list
          */
         $this->response->addHTML('<div id="tableslistcontainer">');
         $_url_params = array('pos' => $this->_pos, 'db' => $this->_db);
         // Add the sort options if they exists
         if (isset($_REQUEST['sort'])) {
             $_url_params['sort'] = $_REQUEST['sort'];
         }
         if (isset($_REQUEST['sort_order'])) {
             $_url_params['sort_order'] = $_REQUEST['sort_order'];
         }
         $this->response->addHTML(PMA_Util::getListNavigator($this->_total_num_tables, $this->_pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']));
         // table form
         $this->response->addHTML(Template::get('structure/table_header')->render(array('db' => $this->_db, 'db_is_system_schema' => $this->_db_is_system_schema, 'replication' => $GLOBALS['replication_info']['slave']['status'])));
         $i = $sum_entries = 0;
         $overhead_check = '';
         $create_time_all = '';
         $update_time_all = '';
         $check_time_all = '';
         $num_columns = $GLOBALS['cfg']['PropertiesNumColumns'] > 1 ? ceil($this->_num_tables / $GLOBALS['cfg']['PropertiesNumColumns']) + 1 : 0;
         $row_count = 0;
         $sum_size = (double) 0;
         $overhead_size = (double) 0;
         $hidden_fields = array();
         $odd_row = true;
         $overall_approx_rows = false;
         // Instance of PMA_RecentFavoriteTable class.
         $fav_instance = PMA_RecentFavoriteTable::getInstance('favorite');
         foreach ($this->_tables as $keyname => $current_table) {
             // Get valid statistics whatever is the table type
             $drop_query = '';
             $drop_message = '';
             $already_favorite = false;
             $overhead = '';
             $table_is_view = false;
             $table_encoded = urlencode($current_table['TABLE_NAME']);
             // Sets parameters for links
             $tbl_url_query = $this->_url_query . '&amp;table=' . $table_encoded;
             // do not list the previous table's size info for a view
             list($current_table, $formatted_size, $unit, $formatted_overhead, $overhead_unit, $overhead_size, $table_is_view, $sum_size) = $this->getStuffForEngineTypeTable($current_table, $this->_db_is_system_schema, $this->_is_show_stats, $sum_size, $overhead_size);
             if (!$this->dbi->getTable($this->_db, $current_table['TABLE_NAME'])->isMerge()) {
                 $sum_entries += $current_table['TABLE_ROWS'];
             }
//.........这里部分代码省略.........
开发者ID:nobodypb,项目名称:phpmyadmin,代码行数:101,代码来源:StructureController.class.php


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