Permalink
Browse files

Resolving conflicts in tbl_select.php

  • Loading branch information...
2 parents 56e44b6 + 084c56e commit df0c40f862c25517b1b9d9c74c1fd342fb1eab1c @zixtor zixtor committed May 23, 2012
Showing with 3,417 additions and 2,235 deletions.
  1. +1 −1 db_create.php
  2. +3 −3 db_operations.php
  3. +1 −1 db_search.php
  4. +1 −1 db_tracking.php
  5. +1 −1 js/db_operations.js
  6. +1 −1 js/server_privileges.js
  7. +1 −1 js/tbl_change.js
  8. +1 −1 libraries/Menu.class.php
  9. +51 −49 libraries/common.lib.php
  10. +3,137 −1,971 libraries/display_tbl.lib.php
  11. +1 −1 libraries/rte/rte_events.lib.php
  12. +1 −1 libraries/rte/rte_routines.lib.php
  13. +1 −1 libraries/rte/rte_triggers.lib.php
  14. +1 −1 libraries/schema/User_Schema.class.php
  15. +1 −1 main.php
  16. +1 −1 pmd_pdf.php
  17. +1 −1 po/cs.po
  18. +4 −5 po/fi.po
  19. +5 −5 po/ja.po
  20. +16 −22 po/pt_BR.po
  21. +5 −7 po/zh_TW.po
  22. +1 −1 server_binlog.php
  23. +1 −1 server_databases.php
  24. +7 −7 server_privileges.php
  25. +7 −7 sql.php
  26. +1 −1 tbl_addfield.php
  27. +1 −1 tbl_alter.php
  28. +2 −2 tbl_change.php
  29. +1 −1 tbl_export.php
  30. +1 −1 tbl_indexes.php
  31. +1 −1 tbl_move_copy.php
  32. +5 −5 tbl_operations.php
  33. +3 −3 tbl_relation.php
  34. +1 −1 tbl_replace.php
  35. +30 −30 tbl_structure.php
  36. +1 −1 tbl_tracking.php
  37. +0 −52 test/libraries/common/PMA_generate_slider_effect_test.php
  38. +3 −3 test/libraries/common/PMA_getCheckbox_test.php
  39. +59 −0 test/libraries/common/PMA_getDivForSliderEffect_test.php
  40. +8 −8 test/libraries/common/{PMA_generate_html_dropdown_test.php → PMA_getDropdown_test.php}
  41. +42 −26 test/libraries/common/{PMA_display_html_radio_test.php → PMA_getRadioFields_test.php}
  42. +3 −3 test/libraries/common/PMA_showMessage_test_disabled.php
  43. +2 −2 user_password.php
  44. +1 −1 view_create.php
  45. +1 −1 view_operations.php
View
@@ -85,7 +85,7 @@
* @global array $GLOBALS['extra_data']
* @name $extra_data
*/
- $extra_data['sql_query'] = PMA_showMessage(null, $sql_query, 'success');
+ $extra_data['sql_query'] = PMA_getMessage(null, $sql_query, 'success');
//Construct the html for the new database, so that it can be appended to
// the list of databases on server_databases.php
View
@@ -341,7 +341,7 @@
*/
if ( $GLOBALS['is_ajax_request'] == true) {
$extra_data['newname'] = $newname;
- $extra_data['sql_query'] = PMA_showMessage(null, $sql_query);
+ $extra_data['sql_query'] = PMA_getMessage(null, $sql_query);
PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
};
}
@@ -375,7 +375,7 @@
echo "\n";
if (isset($message)) {
- PMA_showMessage($message, $sql_query);
+ echo PMA_getMessage($message, $sql_query);
unset($message);
}
}
@@ -523,7 +523,7 @@
'structure' => __('Structure only'),
'data' => __('Structure and data'),
'dataonly' => __('Data only'));
- PMA_displayHtmlRadio('what', $choices, 'data', true);
+ echo PMA_getRadioFields('what', $choices, 'data', true);
unset($choices);
?>
<input type="checkbox" name="create_database_before_copying" value="1"
View
@@ -306,7 +306,7 @@ function PMA_getSearchSqls($table, $field, $search_str, $search_option)
// 4th parameter set to true to add line breaks
// 5th parameter set to false to avoid htmlspecialchars() escaping in the label
// since we have some HTML in some labels
-PMA_displayHtmlRadio('search_option', $choices, $search_option, true, false);
+echo PMA_getRadioFields('search_option', $choices, $search_option, true, false);
unset($choices);
?>
</td>
View
@@ -225,7 +225,7 @@
foreach ($data['ddlog'] as $entry) {
$log .= '# ' . $entry['date'] . ' ' . $entry['username'] . "\n" . $entry['statement'] . "\n";
}
- PMA_showMessage(__('Database Log'), $log);
+ echo PMA_getMessage(__('Database Log'), $log);
}
/**
View
@@ -60,7 +60,7 @@ $(function() {
.end()
.after(data.sql_query);
- //Remove the empty notice div generated due to a NULL query passed to PMA_showMessage()
+ //Remove the empty notice div generated due to a NULL query passed to PMA_getMessage()
var $notice_class = $("#floating_menubar").next("div").find('.notice');
if ($notice_class.text() == '') {
$notice_class.remove();
View
@@ -188,7 +188,7 @@ $(function() {
.end()
.after(data.sql_query);
- //Remove the empty notice div generated due to a NULL query passed to PMA_showMessage()
+ //Remove the empty notice div generated due to a NULL query passed to PMA_getMessage()
var $notice_class = $("#floating_menubar").next("div").find('.notice');
if ($notice_class.text() == '') {
$notice_class.remove();
View
@@ -345,7 +345,7 @@ $(function() {
.end()
.after(data.sql_query);
- //Remove the empty notice div generated due to a NULL query passed to PMA_showMessage()
+ //Remove the empty notice div generated due to a NULL query passed to PMA_getMessage()
var $notice_class = $("#floating_menubar").next("div").find('.notice');
if ($notice_class.text() == '') {
$notice_class.remove();
View
@@ -89,7 +89,7 @@ public function display()
echo $this->_getBreadcrumbs();
echo $this->_getMenu();
if (! empty($GLOBALS['message'])) {
- PMA_showMessage($GLOBALS['message']);
+ echo PMA_getMessage($GLOBALS['message']);
unset($GLOBALS['message']);
}
}
View
@@ -972,7 +972,7 @@ function PMA_reloadNavigation($jsonly = false)
}
/**
- * displays the message and the query
+ * Prepare the message and the query
* usually the message is the result of the query executed
*
* @param string $message the message to display
@@ -984,7 +984,7 @@ function PMA_reloadNavigation($jsonly = false)
*
* @access public
*/
-function PMA_showMessage(
+function PMA_getMessage(
$message,
$sql_query = null,
$type = 'notice',
@@ -1331,17 +1331,9 @@ function PMA_showMessage(
$retval .= '<br class="clearfloat" />';
}
- // If we are in an Ajax request, we have most probably been called in
- // PMA_ajaxResponse(). Hence, collect the buffer contents and return it
- // to PMA_ajaxResponse(), which will encode it for JSON.
- if ($GLOBALS['is_ajax_request'] == true
- && ! isset($GLOBALS['buffer_message'])
- ) {
- return $retval;
- } else {
- echo $retval;
- }
-} // end of the 'PMA_showMessage()' function
+ return $retval;
+
+} // end of the 'PMA_getMessage()' function
/**
* Verifies if current MySQL server supports profiling
@@ -1382,12 +1374,14 @@ function PMA_getProfilingForm($sql_query)
{
$retval = '';
if (PMA_profilingSupported()) {
+
$retval .= '<form action="sql.php" method="post">' . "\n";
$retval .= PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']);
$retval .= '<input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />' . "\n";
$retval .= '<input type="hidden" name="profiling_form" value="1" />' . "\n";
$retval .= PMA_getCheckbox('profiling', __('Profiling'), isset($_SESSION['profiling']), true);
$retval .= ' </form>' . "\n";
+
}
return $retval;
}
@@ -2262,33 +2256,32 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row,
* @param string $image image to display
* @param string $value value
*
- * @return void
+ * @return string html content
*
* @access public
*/
-function PMA_buttonOrImage($button_name, $button_class, $image_name, $text,
+function PMA_getButtonOrImage($button_name, $button_class, $image_name, $text,
$image, $value = ''
) {
if ($value == '') {
$value = $text;
}
if (false === $GLOBALS['cfg']['PropertiesIconic']) {
- echo ' <input type="submit" name="' . $button_name . '"'
- .' value="' . htmlspecialchars($value) . '"'
- .' title="' . htmlspecialchars($text) . '" />' . "\n";
- return;
+ return ' <input type="submit" name="' . $button_name . '"'
+ .' value="' . htmlspecialchars($value) . '"'
+ .' title="' . htmlspecialchars($text) . '" />' . "\n";
}
/* Opera has trouble with <input type="image"> */
/* IE has trouble with <button> */
if (PMA_USR_BROWSER_AGENT != 'IE') {
- echo '<button class="' . $button_class . '" type="submit"'
+ return '<button class="' . $button_class . '" type="submit"'
.' name="' . $button_name . '" value="' . htmlspecialchars($value) . '"'
.' title="' . htmlspecialchars($text) . '">' . "\n"
. PMA_getIcon($image, $text)
.'</button>' . "\n";
} else {
- echo '<input type="image" name="' . $image_name
+ return '<input type="image" name="' . $image_name
. '" value="' . htmlspecialchars($value)
. '" title="' . htmlspecialchars($text)
. '" src="' . $GLOBALS['pmaThemeImage']. $image . '" />'
@@ -2599,14 +2592,14 @@ function PMA_externalBug($functionality, $component, $minimum_version, $bugref)
}
/**
- * Returns an HTML checkbox
+ * Returns a HTML checkbox
*
* @param string $html_field_name the checkbox HTML field
* @param string $label label for checkbox
* @param boolean $checked is it initially checked?
* @param boolean $onclick should it submit the form on click?
*
- * @return string HTML for the checkbox
+ * @return string HTML for the checkbox
*/
function PMA_getCheckbox($html_field_name, $label, $checked, $onclick)
{
@@ -2615,10 +2608,11 @@ function PMA_getCheckbox($html_field_name, $label, $checked, $onclick)
. $html_field_name . '"' . ($checked ? ' checked="checked"' : '')
. ($onclick ? ' class="autosubmit"' : '') . ' /><label for="'
. $html_field_name . '">' . $label . '</label>';
+
}
/**
- * Generates and echoes a set of radio HTML fields
+ * Generates a set of radio HTML fields
*
* @param string $html_field_name the radio HTML field
* @param array $choices the choices values and labels
@@ -2627,33 +2621,39 @@ function PMA_getCheckbox($html_field_name, $label, $checked, $onclick)
* @param boolean $escape_label whether to use htmlspecialchars() on label
* @param string $class enclose each choice with a div of this class
*
- * @return void
+ * @return string set of html radio fiels
*/
-function PMA_displayHtmlRadio($html_field_name, $choices, $checked_choice = '',
+function PMA_getRadioFields($html_field_name, $choices, $checked_choice = '',
$line_break = true, $escape_label = true, $class=''
) {
+
+ $radio_html = '';
+
foreach ($choices as $choice_value => $choice_label) {
if (! empty($class)) {
- echo '<div class="' . $class . '">';
+ $radio_html .= '<div class="' . $class . '">';
}
$html_field_id = $html_field_name . '_' . $choice_value;
- echo '<input type="radio" name="' . $html_field_name . '" id="'
- . $html_field_id . '" value="' . htmlspecialchars($choice_value) . '"';
+ $radio_html .= '<input type="radio" name="' . $html_field_name . '" id="'
+ . $html_field_id . '" value="' . htmlspecialchars($choice_value) . '"';
if ($choice_value == $checked_choice) {
- echo ' checked="checked"';
+ $radio_html .= ' checked="checked"';
}
- echo ' />' . "\n";
- echo '<label for="' . $html_field_id . '">'
- . ($escape_label ? htmlspecialchars($choice_label) : $choice_label)
- . '</label>';
+ $radio_html .= ' />' . "\n"
+ . '<label for="' . $html_field_id . '">'
+ . ($escape_label ? htmlspecialchars($choice_label) : $choice_label)
+ . '</label>';
if ($line_break) {
- echo '<br />';
+ $radio_html .= '<br />';
}
if (! empty($class)) {
- echo '</div>';
+ $radio_html .= '</div>';
}
- echo "\n";
+ $radio_html .= "\n";
}
+
+ return $radio_html;
+
}
/**
@@ -2666,11 +2666,11 @@ function PMA_displayHtmlRadio($html_field_name, $choices, $checked_choice = '',
* case the dropdown is present more than once
* on the page
*
- * @return string
+ * @return string html content
*
* @todo support titles
*/
-function PMA_generateHtmlDropdown($select_name, $choices, $active_choice, $id)
+function PMA_getDropdown($select_name, $choices, $active_choice, $id)
{
$result = '<select name="' . htmlspecialchars($select_name) . '" id="'
. htmlspecialchars($id) . '">';
@@ -2693,14 +2693,14 @@ function PMA_generateHtmlDropdown($select_name, $choices, $active_choice, $id)
*
* @param string $id the id of the <div> on which to apply the effect
* @param string $message the message to show as a link
- *
- * @return void
+ *
+ * @return string html div element
+ *
*/
-function PMA_generateSliderEffect($id, $message)
+function PMA_getDivForSliderEffect($id, $message)
{
if ($GLOBALS['cfg']['InitialSlidersState'] == 'disabled') {
- echo '<div id="' . $id . '">';
- return;
+ return '<div id="' . $id . '">';
}
/**
* Bad hack on the next line. document.write() conflicts with jQuery,
@@ -2710,11 +2710,13 @@ function PMA_generateSliderEffect($id, $message)
* method maybe by using an additional param, the id of the div to
* append to
*/
- echo '<div id="' . $id . '"';
- echo $GLOBALS['cfg']['InitialSlidersState'] == 'closed'
- ? ' style="display: none; overflow:auto;"'
- : '';
- echo ' class="pma_auto_slider" title="' . htmlspecialchars($message) . '">';
+
+ return '<div id="' . $id . '"'
+ . (($GLOBALS['cfg']['InitialSlidersState'] == 'closed')
+ ? ' style="display: none; overflow:auto;"'
+ : '')
+ . ' class="pma_auto_slider" title="' . htmlspecialchars($message) . '">';
+
}
/**
Oops, something went wrong.

0 comments on commit df0c40f

Please sign in to comment.