本文整理汇总了PHP中PMA_Message::addMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Message::addMessage方法的具体用法?PHP PMA_Message::addMessage怎么用?PHP PMA_Message::addMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Message
的用法示例。
在下文中一共展示了PMA_Message::addMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDeletedRows
/**
* Test for getMessageForDeletedRows() method
*
* @param int $rows Number of rows
* @param string $output Expected string
*
* @return void
*
* @dataProvider providerDeletedRows
*/
public function testDeletedRows($rows, $output)
{
$this->object = new PMA_Message();
$msg = $this->object->getMessageForDeletedRows($rows);
echo $this->object->addMessage($msg);
$this->expectOutputString($output);
$this->object->display();
}
示例2: PMA_showHint
/>
<label for="checkbox_dump_onserverover">
<?php
echo $strOverwriteExisting;
?>
</label>
<br />
<?php
}
?>
<label for="filename_template">
<?php
echo $strFileNameTemplate;
$trans = new PMA_Message();
$trans->addMessage('__SERVER__/');
$trans->addString('strFileNameTemplateDescriptionServer');
if ($export_type == 'database' || $export_type == 'table') {
$trans->addMessage('__DB__/');
$trans->addString('strFileNameTemplateDescriptionDatabase');
if ($export_type == 'table') {
$trans->addMessage('__TABLE__/');
$trans->addString('strFileNameTemplateDescriptionTable');
}
}
$message = new PMA_Message('strFileNameTemplateDescription');
$message->addParam('<a href="http://php.net/strftime" target="documentation" title="' . $strDocu . '">', false);
$message->addParam('</a>', false);
$message->addParam($trans);
echo PMA_showHint($message);
?>
示例3: PMA_getHtmlForExportOptionsOutputFormat
/**
* Prints Html For Export Options
*
* @param String $export_type Selected Export Type
*
* @return string
*/
function PMA_getHtmlForExportOptionsOutputFormat($export_type)
{
$html = '<li>';
$html .= '<label for="filename_template" class="desc">';
$html .= __('File name template:');
$trans = new PMA_Message();
$trans->addMessage(__('@SERVER@ will become the server name'));
if ($export_type == 'database' || $export_type == 'table') {
$trans->addMessage(__(', @DATABASE@ will become the database name'));
if ($export_type == 'table') {
$trans->addMessage(__(', @TABLE@ will become the table name'));
}
}
$msg = new PMA_Message(__('This value is interpreted using %1$sstrftime%2$s, ' . 'so you can use time formatting strings. ' . 'Additionally the following transformations will happen: %3$s. ' . 'Other text will be kept as is. See the %4$sFAQ%5$s for details.'));
$msg->addParam('<a href="' . PMA_linkURL(PMA_getPHPDocLink('function.strftime.php')) . '" target="documentation" title="' . __('Documentation') . '">', false);
$msg->addParam('</a>', false);
$msg->addParam($trans);
$doc_url = PMA_Util::getDocuLink('faq', 'faq6-27');
$msg->addParam('<a href="' . $doc_url . '" target="documentation">', false);
$msg->addParam('</a>', false);
$html .= PMA_Util::showHint($msg);
$html .= '</label>';
$html .= '<input type="text" name="filename_template" id="filename_template" ';
$html .= ' value="';
if (isset($_GET['filename_template'])) {
$html .= htmlspecialchars($_GET['filename_template']);
} else {
if ($export_type == 'database') {
$html .= htmlspecialchars($GLOBALS['PMA_Config']->getUserValue('pma_db_filename_template', $GLOBALS['cfg']['Export']['file_template_database']));
} elseif ($export_type == 'table') {
$html .= htmlspecialchars($GLOBALS['PMA_Config']->getUserValue('pma_table_filename_template', $GLOBALS['cfg']['Export']['file_template_table']));
} else {
$html .= htmlspecialchars($GLOBALS['PMA_Config']->getUserValue('pma_server_filename_template', $GLOBALS['cfg']['Export']['file_template_server']));
}
}
$html .= '"';
$html .= '/>';
$html .= '<input type="checkbox" name="remember_template" ';
$html .= 'id="checkbox_remember_template" ';
$html .= PMA_exportCheckboxCheck('remember_file_template');
$html .= '/>';
$html .= '<label for="checkbox_remember_template">';
$html .= __('use this for future exports');
$html .= '</label>';
$html .= '</li>';
return $html;
}
示例4: getMessage
/**
* Prepare the message and the query
* usually the message is the result of the query executed
*
* @param PMA_Message|string $message the message to display
* @param string $sql_query the query to display
* @param string $type the type (level) of the message
*
* @return string
*
* @access public
*/
public static function getMessage($message, $sql_query = null, $type = 'notice')
{
global $cfg;
$retval = '';
if (null === $sql_query) {
if (!empty($GLOBALS['display_query'])) {
$sql_query = $GLOBALS['display_query'];
} elseif (!empty($GLOBALS['unparsed_sql'])) {
$sql_query = $GLOBALS['unparsed_sql'];
} elseif (!empty($GLOBALS['sql_query'])) {
$sql_query = $GLOBALS['sql_query'];
} else {
$sql_query = '';
}
}
if (isset($GLOBALS['using_bookmark_message'])) {
$retval .= $GLOBALS['using_bookmark_message']->getDisplay();
unset($GLOBALS['using_bookmark_message']);
}
// In an Ajax request, $GLOBALS['cell_align_left'] may not be defined. Hence,
// check for it's presence before using it
$retval .= '<div class="result_query"' . (isset($GLOBALS['cell_align_left']) ? ' style="text-align: ' . $GLOBALS['cell_align_left'] . '"' : '') . '>' . "\n";
if ($message instanceof PMA_Message) {
if (isset($GLOBALS['special_message'])) {
$message->addMessage($GLOBALS['special_message']);
unset($GLOBALS['special_message']);
}
$retval .= $message->getDisplay();
} else {
$retval .= '<div class="' . $type . '">';
$retval .= PMA_sanitize($message);
if (isset($GLOBALS['special_message'])) {
$retval .= PMA_sanitize($GLOBALS['special_message']);
unset($GLOBALS['special_message']);
}
$retval .= '</div>';
}
if ($cfg['ShowSQL'] == true && !empty($sql_query) && $sql_query !== ';') {
// Html format the query to be displayed
// If we want to show some sql code it is easiest to create it here
/* SQL-Parser-Analyzer */
if (!empty($GLOBALS['show_as_php'])) {
$new_line = '\\n"<br />' . "\n" . ' . "';
$query_base = htmlspecialchars(addslashes($sql_query));
$query_base = preg_replace('/((\\015\\012)|(\\015)|(\\012))/', $new_line, $query_base);
} else {
$query_base = $sql_query;
}
$query_too_big = false;
$queryLength = mb_strlen($query_base);
if ($queryLength > $cfg['MaxCharactersInDisplayedSQL']) {
// when the query is large (for example an INSERT of binary
// data), the parser chokes; so avoid parsing the query
$query_too_big = true;
$shortened_query_base = nl2br(htmlspecialchars(mb_substr($sql_query, 0, $cfg['MaxCharactersInDisplayedSQL']) . '[...]'));
}
if (!empty($GLOBALS['show_as_php'])) {
$query_base = '$sql = "' . $query_base;
} elseif (isset($query_base)) {
$query_base = self::formatSql($query_base);
}
// Prepares links that may be displayed to edit/explain the query
// (don't go to default pages, we must go to the page
// where the query box is available)
// Basic url query part
$url_params = array();
if (!isset($GLOBALS['db'])) {
$GLOBALS['db'] = '';
}
if (mb_strlen($GLOBALS['db'])) {
$url_params['db'] = $GLOBALS['db'];
if (mb_strlen($GLOBALS['table'])) {
$url_params['table'] = $GLOBALS['table'];
$edit_link = 'tbl_sql.php';
} else {
$edit_link = 'db_sql.php';
}
} else {
$edit_link = 'server_sql.php';
}
// Want to have the query explained
// but only explain a SELECT (that has not been explained)
/* SQL-Parser-Analyzer */
$explain_link = '';
$is_select = preg_match('@^SELECT[[:space:]]+@i', $sql_query);
if (!empty($cfg['SQLQuery']['Explain']) && !$query_too_big) {
$explain_params = $url_params;
if ($is_select) {
//.........这里部分代码省略.........
示例5: __
?>
/>
<label for="checkbox_dump_onserverover"><?php
echo __('Overwrite existing file(s)');
?>
</label>
</li>
<?php
}
?>
<li>
<label for="filename_template" class="desc">
<?php
echo __('File name template:');
$trans = new PMA_Message();
$trans->addMessage(__('@SERVER@ will become the server name'));
if ($export_type == 'database' || $export_type == 'table') {
$trans->addMessage(__(', @DATABASE@ will become the database name'));
if ($export_type == 'table') {
$trans->addMessage(__(', @TABLE@ will become the table name'));
}
}
$message = new PMA_Message(__('This value is interpreted using %1$sstrftime%2$s, so you can use time formatting strings. Additionally the following transformations will happen: %3$s. Other text will be kept as is. See the %4$sFAQ%5$s for details.'));
$message->addParam('<a href="' . PMA_linkURL(PMA_getPHPDocLink('function.strftime.php')) . '" target="documentation" title="' . __('Documentation') . '">', false);
$message->addParam('</a>', false);
$message->addParam($trans);
$message->addParam('<a href="Documentation.html#faq6_27" target="documentation">', false);
$message->addParam('</a>', false);
echo PMA_showHint($message);
?>
</label>