Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Atul Pratap Singh 2012-06-21 20:53:08 +05:30
commit 682d7d4d4b
9 changed files with 462 additions and 325 deletions

View File

@ -56,6 +56,7 @@ VerboseMultiSubmit, ReplaceHelpImg
- bug #3531586 [unterface] Add user form prints JSON when user presses enter
- bug #3534121 [config] duplicate line in config.sample.inc.php
- bug #3534311 [interface] Grid editing incorrectly parses ENUM/SET values
- bug #3510196 [core] More clever URL rewriting with ForceSSL
3.5.1.0 (2012-05-03)
- bug #3510784 [edit] Limit clause ignored when sort order is remembered

View File

@ -4576,7 +4576,7 @@ class PMA_DisplayResults
* @param string $default_function default function
* @param string $nowrap 'nowrap' if the content should not be
* wrapped
* @param string $where_comparison data for the where cluase
* @param string $where_comparison data for the where clause
* @param array $transform_options array of options for transformation
* @param bool $is_field_truncated whether the field is truncated
*
@ -4747,8 +4747,8 @@ class PMA_DisplayResults
* @param array $is_display array with explicit indexes for all
* the display elements
* @param string $row_no the row number
* @param string $where_clause_html url encoded where cluase
* @param array $condition_array array of conditions in the where cluase
* @param string $where_clause_html url encoded where clause
* @param array $condition_array array of conditions in the where clause
* @param string $del_query delete query
* @param string $id_suffix suffix for the id
* @param string $class css classes for the td element
@ -4799,8 +4799,8 @@ class PMA_DisplayResults
* @param string $edit_url edit url
* @param string $class css classes for td element
* @param string $edit_str text for the edit link
* @param string $where_clause where cluase
* @param string $where_clause_html url encoded where cluase
* @param string $where_clause where clause
* @param string $where_clause_html url encoded where clause
*
* @return string the generated HTML
*
@ -4839,7 +4839,7 @@ class PMA_DisplayResults
* @param string $copy_url copy url
* @param string $copy_str text for the copy link
* @param string $where_clause where clause
* @param string $where_clause_html url encoded where cluase
* @param string $where_clause_html url encoded where clause
* @param string $class css classes for the td element
*
* @return string the generated HTML
@ -4924,8 +4924,8 @@ class PMA_DisplayResults
* display elements
* @param string $row_no row number
* @param string $where_clause where clause
* @param string $where_clause_html url encoded where cluase
* @param array $condition_array array of conditions in the where cluase
* @param string $where_clause_html url encoded where clause
* @param array $condition_array array of conditions in the where clause
* @param string $del_query delete query
* @param string $id_suffix suffix for the id
* @param string $edit_url edit url

View File

@ -73,7 +73,7 @@ function PMA_GIS_modifyQuery($sql_query, $visualizationSettings)
}
}
}
// If select cluase is *
// If select clause is *
} else {
// If label column is chosen add it to the query
if (isset($visualizationSettings['labelColumn'])

View File

@ -73,6 +73,9 @@ function PMA_getValuesForEditMode($where_clause, $table, $db)
}
/**
* Creates array of where clauses
*
* @param array $where_clause where clause
*
* @return whereClauseArray array of where clauses
*/
@ -88,12 +91,12 @@ function PMA_getWhereClauseArray($where_clause)
}
/**
* Analysing where cluases array
* Analysing where clauses array
*
* @param array $where_clause_array array of where clauses
* @param string $table name of the table
* @param string $db name of the database
* @param boolean $found_unique_key boolean variable for unique key
* @param array $where_clause_array array of where clauses
* @param string $table name of the table
* @param string $db name of the database
* @param boolean $found_unique_key boolean variable for unique key
*
* @return array $where_clauses, $result, $rows
*/
@ -122,12 +125,12 @@ function PMA_analyzeWhereClauses(
/**
* Show message for empty reult or set the unique_condition
*
* @param array $rows
* @param string $key_id
* @param array $where_clause_array
* @param string $local_query
* @param array $result
* @param boolean $found_unique_key
* @param array $rows MySQL returned rows
* @param string $key_id ID in current key
* @param array $where_clause_array array of where clauses
* @param string $local_query query performed
* @param array $result MySQL result handle
* @param boolean $found_unique_key boolean variable for unique key
*
* @return boolean $found_unique_key
*/
@ -158,15 +161,16 @@ function PMA_showEmptyResultMessageOrSetUniqueCondition($rows, $key_id,
/**
* No primary key given, just load first row
*
* @param string $table name of the table
* @param string $db name of the database
* @param string $table name of the table
* @param string $db name of the database
*
* @return array containing $result and $rows arrays
*/
function PMA_loadFirstRowInEditMode($table, $db)
{
$result = PMA_DBI_query(
'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table) . ' LIMIT 1;',
'SELECT * FROM '
. PMA_backquote($db) . '.' . PMA_backquote($table) . ' LIMIT 1;',
null,
PMA_DBI_QUERY_STORE
);
@ -177,10 +181,9 @@ function PMA_loadFirstRowInEditMode($table, $db)
/**
* Add some url parameters
*
* @param array $url_params containing $db and $table as url parameters
* @param array $url_params containing $db and $table as url parameters
*
* @return array Add some url parameters to $url_params array
* and return it
* @return array Add some url parameters to $url_params array and return it
*/
function PMA_urlParamsInEditMode($url_params)
{
@ -196,9 +199,10 @@ function PMA_urlParamsInEditMode($url_params)
/**
* Show function fields in data edit view in pma
*
* @param array $url_params containing url parameters
* @param array $url_params containing url parameters
* @param boolean $showFuncFields whether to show function field
*
* @return string an html snippet
* @return string an html snippet
*/
function PMA_showFunctionFieldsInEditMode($url_params, $showFuncFields)
{
@ -228,11 +232,12 @@ function PMA_showFunctionFieldsInEditMode($url_params, $showFuncFields)
/**
* Show field types in data edit view in pma
*
* @param array $url_params containing url parameters
* @param array $url_params containing url parameters
* @param boolean $showColumnType whether to show column type
*
* @return stirng an html snippet
* @return string an html snippet
*/
function PMA_showColumnTypesInDataEditView($url_params, $showColumnType )
function PMA_showColumnTypesInDataEditView($url_params, $showColumnType)
{
$params = array();
if (! $showColumnType) {
@ -257,7 +262,9 @@ function PMA_showColumnTypesInDataEditView($url_params, $showColumnType )
/**
* Retrieve the default for datetime data type
*
* @param array $column containing column type, Default and null
* @param array $column containing column type, Default and null
*
* @return nothing
*/
function PMA_getDefaultForDatetime($column)
{
@ -290,9 +297,9 @@ function PMA_getDefaultForDatetime($column)
/**
* Analyze the table column array
*
* @param array $column description of column in given table
* @param array $comments_map comments for every column that has a comment
* @param integer $timestamp_seen 0 interger
* @param array $column description of column in given table
* @param array $comments_map comments for every column that has a comment
* @param boolean $timestamp_seen whether a timestamp has been seen
*
* @return array description of column in given table
*/
@ -308,8 +315,8 @@ function PMA_analyzeTableColumnsArray($column, $comments_map, $timestamp_seen)
$column['is_binary'] = PMA_isColumnBinary($column);
$column['is_blob'] = PMA_isColumnBlob($column);
$column['is_char'] = PMA_isColumnChar($column);
list($column['pma_type'], $column['wrap'], $column['first_timestamp']) =
PMA_getEnumSetAndTimestampColumns($column, $timestamp_seen);
list($column['pma_type'], $column['wrap'], $column['first_timestamp'])
= PMA_getEnumSetAndTimestampColumns($column, $timestamp_seen);
return $column;
}
@ -317,8 +324,8 @@ function PMA_analyzeTableColumnsArray($column, $comments_map, $timestamp_seen)
/**
* Retrieve the column title
*
* @param array $column description of column in given table
* @param array $comments_map comments for every column that has a comment
* @param array $column description of column in given table
* @param array $comments_map comments for every column that has a comment
*
* @return string column title
*/
@ -397,12 +404,12 @@ function PMA_isColumnChar($column)
}
}
/**
* Retieve set, enum, timestamp table columns
* Retrieve set, enum, timestamp table columns
*
* @param array $column description of column in given table
* @param integer $timestamp_seen 0 interger
* @param boolean $timestamp_seen whether a timestamp has been seen
*
* return array $column['pma_type'], $column['wrap'], $column['first_timestamp']
* @return array $column['pma_type'], $column['wrap'], $column['first_timestamp']
*/
function PMA_getEnumSetAndTimestampColumns($column, $timestamp_seen)
{
@ -417,8 +424,8 @@ function PMA_getEnumSetAndTimestampColumns($column, $timestamp_seen)
$column['wrap'] = '';
break;
case 'timestamp':
if (!$timestamp_seen) { // can only occur once per table
$timestamp_seen = 1;
if (! $timestamp_seen) { // can only occur once per table
$timestamp_seen = true;
$column['first_timestamp'] = true;
}
$column['pma_type'] = $column['Type'];
@ -457,9 +464,9 @@ function PMA_getFunctionColumn($column, $is_upload, $column_name_appendix,
$tabindex, $idindex, $insert_mode
) {
$html_output = '';
if (($GLOBALS['cfg']['ProtectBinary'] && $column['is_blob'] && !$is_upload)
|| ($GLOBALS['cfg']['ProtectBinary'] == 'all' && $column['is_binary'])
|| ($GLOBALS['cfg']['ProtectBinary'] == 'noblob' && !$column['is_blob'])
if (($GLOBALS['cfg']['ProtectBinary'] && $column['is_blob'] && ! $is_upload)
|| ($GLOBALS['cfg']['ProtectBinary'] === 'all' && $column['is_binary'])
|| ($GLOBALS['cfg']['ProtectBinary'] === 'noblob' && ! $column['is_blob'])
) {
$html_output .= '<td class="center">' . __('Binary') . '</td>' . "\n";
} elseif (strstr($column['True_Type'], 'enum')
@ -503,21 +510,25 @@ function PMA_getNullColumn($column, $column_name_appendix, $real_null_value,
}
$html_output = '';
$html_output .= '<td>' . "\n";
$html_output .= '<input type="hidden" name="fields_null_prev' . $column_name_appendix . '"';
$html_output .= '<input type="hidden" name="fields_null_prev'
. $column_name_appendix . '"';
if ($real_null_value && !$column['first_timestamp']) {
$html_output .= ' value="on"';
}
$html_output .= ' />' . "\n";
$html_output .= '<input type="checkbox" class="checkbox_null" tabindex="' . ($tabindex + $tabindex_for_null) . '"'
. ' name="fields_null' . $column_name_appendix . '"';
$html_output .= '<input type="checkbox" class="checkbox_null" tabindex="'
. ($tabindex + $tabindex_for_null) . '"'
. ' name="fields_null' . $column_name_appendix . '"';
if ($real_null_value && !$column['first_timestamp']) {
$html_output .= ' checked="checked"';
}
$html_output .= ' id="field_' . ($idindex) . '_2" />';
// nullify_code is needed by the js nullify() function
$nullify_code = PMA_getNullifyCodeForNullColumn($column, $foreigners, $foreignData);
$nullify_code = PMA_getNullifyCodeForNullColumn(
$column, $foreigners, $foreignData
);
// to be able to generate calls to nullify() in jQuery
$html_output .= '<input type="hidden" class="nullify_code" name="nullify_code'
. $column_name_appendix . '" value="' . $nullify_code . '" />';
@ -574,20 +585,26 @@ function PMA_getNullifyCodeForNullColumn($column, $foreigners, $foreignData)
* @param array $data description of the column field
* @param array $special_chars special characters
* @param array $foreignData data about the foreign keys
* @param boolean $odd_row whether row is odd
* @param array $paramTableDbArray array containing $db and $table
* @param array $rownumber_param &amp;rownumber=row_id
* @param array $titles An HTML IMG tag for a particular icon from
* a theme, which may be an actual file or
* an icon from a sprite
* @param array $text_dir
* @param array $text_dir text direction
* @param string $special_chars_encoded replaced char if the string starts
* with a \r\n pair (0x0d0a) add an extra \n
* @param string $vkey [multi_edit]['row_id']
* @param boolean $is_upload is upload or not
* @param integer $biggest_max_file_size 0 intger
* @param string $default_char_editing default char editing mode which is stroe
* in the config.inc.php script
* @param array $no_support_types list of datatypes that are not (yet)
* handled by PMA
* @param array $gis_data_types list of GIS data types
* @param array $extracted_columnspec associative array containing type,
* spec_in_brackets and possibly
* enum_set_values (another array)
*
* @return string an html snippet
*/
@ -605,7 +622,7 @@ function PMA_getValueColumn($column, $backup_field, $column_name_appendix,
$column, $backup_field, $column_name_appendix,
$unnullify_trigger, $tabindex, $tabindex_for_value, $idindex, $data,
$paramTableDbArray, $rownumber_param, $titles
);
);
} elseif (is_array($foreignData['disp_row'])) {
$html_output .= PMA_dispRowForeignData(
@ -620,7 +637,7 @@ function PMA_getValueColumn($column, $backup_field, $column_name_appendix,
$html_output .= '<tr class="' . ($odd_row ? 'odd' : 'even') . '">'
. '<td colspan="5" class="right">';
$html_output .= PMA_getTextarea(
$column,$backup_field, $column_name_appendix, $unnullify_trigger,
$column, $backup_field, $column_name_appendix, $unnullify_trigger,
$tabindex, $tabindex_for_value, $idindex, $text_dir,
$special_chars_encoded
);
@ -639,28 +656,28 @@ function PMA_getValueColumn($column, $backup_field, $column_name_appendix,
} elseif ($column['pma_type'] == 'enum') {
$html_output .= PMA_getPmaTypeEnum(
$paramsArrayForColumns, $column,$extracted_columnspec
$paramsArrayForColumns, $column, $extracted_columnspec
);
} elseif ($column['pma_type'] == 'set') {
$html_output .= PMA_getPmaTypeSet(
$column,$extracted_columnspec, $backup_field,
$column, $extracted_columnspec, $backup_field,
$column_name_appendix, $unnullify_trigger, $tabindex,
$tabindex_for_value, $idindex
);
} elseif ($column['is_binary'] || $column['is_blob']) {
$html_output .= PMA_getBinaryAndBlobColumn(
$column, $data, $special_chars,$biggest_max_file_size,
$backup_field,$column_name_appendix, $unnullify_trigger, $tabindex,
$column, $data, $special_chars, $biggest_max_file_size,
$backup_field, $column_name_appendix, $unnullify_trigger, $tabindex,
$tabindex_for_value, $idindex, $text_dir, $special_chars_encoded,
$vkey, $is_upload
);
} elseif (! in_array($column['pma_type'], $no_support_types)) {
$html_output .= PMA_getNoSupportTypes(
$column, $default_char_editing,$backup_field,
$column_name_appendix, $unnullify_trigger,$tabindex,$special_chars,
$column, $default_char_editing, $backup_field,
$column_name_appendix, $unnullify_trigger, $tabindex, $special_chars,
$tabindex_for_value, $idindex, $text_dir, $special_chars_encoded,
$data, $extracted_columnspec
);
@ -683,7 +700,7 @@ function PMA_getValueColumn($column, $backup_field, $column_name_appendix,
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param array $data
* @param array $data data to edit
* @param array $paramTableDbArray array containing $db and $table
* @param array $rownumber_param &amp;rownumber=row_id
* @param array $titles An HTML IMG tag for a particular icon from
@ -722,7 +739,7 @@ function PMA_getForeignLink($column, $backup_field, $column_name_appendix,
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param array $data
* @param array $data data to edit
* @param array $foreignData data about the foreign keys
*
* @return string an html snippet
@ -733,13 +750,17 @@ function PMA_dispRowForeignData($backup_field, $column_name_appendix,
) {
$html_output = '';
$html_output .= $backup_field . "\n";
$html_output .= '<input type="hidden" name="fields_type' . $column_name_appendix . '" value="foreign" />'
$html_output .= '<input type="hidden" name="fields_type'
. $column_name_appendix . '" value="foreign" />'
. '<select name="fields' . $column_name_appendix . '"'
. $unnullify_trigger
. 'class="textfield"' . ($tabindex + $tabindex_for_value). '"'
. 'id="field_' . $idindex . '_3"'
. PMA_foreignDropdown($foreignData['disp_row'], $foreignData['foreign_field'],
$foreignData['foreign_display'], $data, $GLOBALS['cfg']['ForeignKeyMaxLimit'])
. PMA_foreignDropdown(
$foreignData['disp_row'], $foreignData['foreign_field'],
$foreignData['foreign_display'], $data,
$GLOBALS['cfg']['ForeignKeyMaxLimit']
)
. '</select>';
return $html_output;
@ -748,13 +769,14 @@ function PMA_dispRowForeignData($backup_field, $column_name_appendix,
/**
* Get HTML textarea for insert form
*
* @param array $column column information
* @param string $backup_field hidden input field
* @param string $column_name_appendix the name atttibute
* @param string $unnullify_trigger validation string
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param array $text_dir
* @param array $text_dir text direction
* @param array $special_chars_encoded replaced char if the string starts
* with a \r\n pair (0x0d0a) add an extra \n
*
@ -808,19 +830,26 @@ function PMA_getPmaTypeEnum(
) {
$html_output = '';
if (! isset($column['values'])) {
$column['values'] = PMA_getColumnEnumValues($column, $extracted_columnspec);
$column['values'] = PMA_getColumnEnumValues(
$column, $extracted_columnspec
);
}
$column_enum_values = $column['values'];
$html_output .= '<input type="hidden" name="fields_type' . $column_name_appendix. '" value="enum" />';
$html_output .= '<input type="hidden" name="fields' . $column_name_appendix . '" value="" />';
$html_output .= '<input type="hidden" name="fields_type'
. $column_name_appendix. '" value="enum" />';
$html_output .= '<input type="hidden" name="fields'
. $column_name_appendix . '" value="" />';
$html_output .= "\n" . ' ' . $backup_field . "\n";
if (strlen($column['Type']) > 20) {
$html_output .= PMA_getDropDownDependingOnLength($column, $column_name_appendix, $unnullify_trigger,
$html_output .= PMA_getDropDownDependingOnLength(
$column, $column_name_appendix, $unnullify_trigger,
$tabindex, $tabindex_for_value, $idindex, $data, $column_enum_values
);
} else {
$html_output .= PMA_getRadioButtonDependingOnLength($column_name_appendix, $unnullify_trigger,
$tabindex, $column, $tabindex_for_value, $idindex, $data, $column_enum_values
$html_output .= PMA_getRadioButtonDependingOnLength(
$column_name_appendix, $unnullify_trigger,
$tabindex, $column, $tabindex_for_value,
$idindex, $data, $column_enum_values
);
}
return $html_output;
@ -859,7 +888,7 @@ function PMA_getColumnEnumValues($column, $extracted_columnspec)
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param array $data
* @param array $data data to edit
* @param array $column_enum_values $column['values']
*
* @return string an html snippet
@ -901,7 +930,7 @@ function PMA_getDropDownDependingOnLength(
* @param array $column description of column in given table
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param array $data
* @param array $data data to edit
* @param array $column_enum_values $column['values']
*
* @return string an html snippet
@ -938,12 +967,13 @@ function PMA_getRadioButtonDependingOnLength(
/**
* Get the HTML for 'set' pma type
*
* @param array $column description of column in given table
* @param array $extracted_columnspec associative array containing type, spec_in_brackets
* and possibly enum_set_values (another array)
* @param string $backup_field hidden input field
* @param string $column_name_appendix the name atttibute
* @param string $unnullify_trigger validation string
* @param array $column description of column in given table
* @param array $extracted_columnspec associative array containing type,
* spec_in_brackets and possibly
* enum_set_values (another array)
* @param string $backup_field hidden input field
* @param string $column_name_appendix the name atttibute
* @param string $unnullify_trigger validation string
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
@ -960,7 +990,8 @@ function PMA_getPmaTypeSet(
);
$vset = array_flip(explode(',', $data));
$html_output = $backup_field . "\n";
$html_output .= '<input type="hidden" name="fields_type' . $column_name_appendix . '" value="set" />';
$html_output .= '<input type="hidden" name="fields_type'
. $column_name_appendix . '" value="set" />';
$html_output .= '<select name="fields' . $column_name_appendix . '[]' . '"'
. 'class="textfield"'
. 'size="' . $select_size . '"'
@ -1008,7 +1039,7 @@ function PMA_getColumnSetValueAndSelectSize($column, $extracted_columnspec)
* Get HTML for binary and blob column
*
* @param array $column description of column in given table
* @param array $data
* @param array $data data to edit
* @param array $special_chars special characters
* @param integer $biggest_max_file_size biggest max file size for uploading
* @param string $backup_field hidden input field
@ -1017,16 +1048,16 @@ function PMA_getColumnSetValueAndSelectSize($column, $extracted_columnspec)
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param string $text_dir
* @param string $text_dir text direction
* @param string $special_chars_encoded replaced char if the string starts
* with a \r\n pair (0x0d0a) add an extra \n
* @param string $vkey [multi_edit]['row_id']
* @param boolean $is_upload is upload or not
* @param string $vkey [multi_edit]['row_id']
* @param boolean $is_upload is upload or not
*
* @return string an html snippet
*/
function PMA_getBinaryAndBlobColumn(
$column, $data, $special_chars,$biggest_max_file_size,
$column, $data, $special_chars, $biggest_max_file_size,
$backup_field, $column_name_appendix, $unnullify_trigger, $tabindex,
$tabindex_for_value, $idindex, $text_dir, $special_chars_encoded,
$vkey, $is_upload
@ -1043,8 +1074,10 @@ function PMA_getBinaryAndBlobColumn(
unset($data_size);
}
$html_output .= '<input type="hidden" name="fields_type' . $column_name_appendix . '" value="protected" />'
. '<input type="hidden" name="fields' . $column_name_appendix . '" value="" />';
$html_output .= '<input type="hidden" name="fields_type'
. $column_name_appendix . '" value="protected" />'
. '<input type="hidden" name="fields'
. $column_name_appendix . '" value="" />';
} elseif ($column['is_blob']) {
$html_output .= "\n" . PMA_getTextarea(
$column, $backup_field, $column_name_appendix, $unnullify_trigger,
@ -1062,8 +1095,10 @@ function PMA_getBinaryAndBlobColumn(
if ($is_upload && $column['is_blob']) {
$html_output .= '<br />'
. '<input type="file" name="fields_upload' . $vkey . '[' . $column['Field_md5']
. ']" class="textfield" id="field_' . $idindex . '_3" size="10" ' . $unnullify_trigger . '/>&nbsp;';
. '<input type="file" name="fields_upload'
. $vkey . '[' . $column['Field_md5']
. ']" class="textfield" id="field_' . $idindex . '_3" size="10" '
. $unnullify_trigger . '/>&nbsp;';
list($html_out, $biggest_max_file_size) = PMA_getMaxUploadSize(
$column, $biggest_max_file_size
);
@ -1121,23 +1156,25 @@ function PMA_getSelectOptionForUpload($vkey, $column)
{
$files = PMA_getFileSelectOptions(PMA_userDir($GLOBALS['cfg']['UploadDir']));
if ($files === false) {
return ' <font color="red">' . __('Error') . '</font><br />' . "\n"
. ' ' . __('The directory you set for upload work cannot be reached') . "\n";
return '<font color="red">' . __('Error') . '</font><br />' . "\n"
. __('The directory you set for upload work cannot be reached') . "\n";
} elseif (!empty($files)) {
return "<br />\n"
. ' <i>' . __('Or') . '</i>' . ' ' . __('web server upload directory') . ':<br />' . "\n"
. ' <select size="1" name="fields_uploadlocal' . $vkey . '[' . $column['Field_md5'] . ']">' . "\n"
. ' <option value="" selected="selected"></option>' . "\n"
. '<i>' . __('Or') . '</i>' . ' '
. __('web server upload directory') . ':<br />' . "\n"
. '<select size="1" name="fields_uploadlocal'
. $vkey . '[' . $column['Field_md5'] . ']">' . "\n"
. '<option value="" selected="selected"></option>' . "\n"
. $files
. ' </select>' . "\n";
. '</select>' . "\n";
}
}
/**
* Retrieve the maximum upload file size
*
* @param array $column description of column in given table
* @param integer $biggest_max_file_size biggest max file size for uploading
* @param array $column description of column in given table
* @param integer $biggest_max_file_size biggest max file size for uploading
*
* @return array an html snippet and $biggest_max_file_size
*/
@ -1181,9 +1218,13 @@ function PMA_getMaxUploadSize($column, $biggest_max_file_size)
* @param array $special_chars apecial characters
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $idindex id index
* @param string $text_dir
* @param string $text_dir text direction
* @param array $special_chars_encoded replaced char if the string starts
* with a \r\n pair (0x0d0a) add an extra \n
* @param strign $data data to edit
* @param array $extracted_columnspec associative array containing type,
* spec_in_brackets and possibly
* enum_set_values (another array)
*
* @return string an html snippet
*/
@ -1202,7 +1243,8 @@ function PMA_getNoSupportTypes($column, $default_char_editing, $backup_field,
$GLOBALS['cfg']['CharEditing'] = $default_char_editing;
$html_output .= PMA_getTextarea(
$column, $backup_field, $column_name_appendix, $unnullify_trigger,
$tabindex, $tabindex_for_value, $idindex, $text_dir, $special_chars_encoded
$tabindex, $tabindex_for_value, $idindex, $text_dir,
$special_chars_encoded
);
} else {
$html_output .= PMA_getHTMLinput(
@ -1211,20 +1253,20 @@ function PMA_getNoSupportTypes($column, $default_char_editing, $backup_field,
);
if ($column['Extra'] == 'auto_increment') {
$html_output .= '<input type="hidden" name="auto_increment' . $column_name_appendix . '" value="1" />';
$html_output .= '<input type="hidden" name="auto_increment'
. $column_name_appendix . '" value="1" />';
}
if (substr($column['pma_type'], 0, 9) == 'timestamp') {
$html_output .= '<input type="hidden" name="fields_type' . $column_name_appendix . '" value="timestamp" />';
$html_output .= '<input type="hidden" name="fields_type'
. $column_name_appendix . '" value="timestamp" />';
}
if (substr($column['pma_type'], 0, 8) == 'datetime') {
$html_output .= '<input type="hidden" name="fields_type' . $column_name_appendix . '" value="datetime" />';
$html_output .= '<input type="hidden" name="fields_type'
. $column_name_appendix . '" value="datetime" />';
}
if ($column['True_Type'] == 'bit') {
$html_output .= '<input type="hidden" name="fields_type' . $column_name_appendix . '" value="bit" />';
$html_output .= '<input type="hidden" name="fields_type'
. $column_name_appendix . '" value="bit" />';
}
if ($column['pma_type'] == 'date'
|| $column['pma_type'] == 'datetime'
@ -1241,7 +1283,10 @@ function PMA_getNoSupportTypes($column, $default_char_editing, $backup_field,
/**
* Get the field size
*
* @param array $column description of column in given table
* @param array $column description of column in given table
* @param array $extracted_columnspec associative array containing type,
* spec_in_brackets and possibly enum_set_values
* (another array)
*
* @return integer field size
*/
@ -1264,26 +1309,31 @@ function PMA_getColumnSize($column, $extracted_columnspec)
*/
$fieldsize = $column['len'];
}
return min(max($fieldsize, $GLOBALS['cfg']['MinSizeForInputField']), $GLOBALS['cfg']['MaxSizeForInputField']);
return min(
max($fieldsize, $GLOBALS['cfg']['MinSizeForInputField']),
$GLOBALS['cfg']['MaxSizeForInputField']
);
}
/**
* Get HTML for gis data types
*
* @param string $current_row row description
* @param array $column description of column in given table
* @param string $current_row row description
* @param array $column description of column in given table
*
* @return string an html snippet
*/
function PMA_getHTMLforGisDataTypes($current_row, $column)
{
$data_val = isset($current_row[$column['Field']]) ? $current_row[$column['Field']] : '';
$data_val = isset($current_row[$column['Field']])
? $current_row[$column['Field']] : '';
$_url_params = array(
'field' => $column['Field_title'],
'value' => $data_val,
);
if ($column['pma_type'] != 'geometry') {
$_url_params = $_url_params + array('gis_data[gis_type]' => strtoupper($column['pma_type']));
$_url_params = $_url_params
+ array('gis_data[gis_type]' => strtoupper($column['pma_type']));
}
$edit_str = PMA_getIcon('b_edit.png', __('Edit/Insert'));
return '<span class="open_gis_editor">'
@ -1311,7 +1361,9 @@ function PMA_getContinueInsertionForm($table, $db, $where_clause_array, $err_url
if (isset($_REQUEST['where_clause'])) {
foreach ($where_clause_array as $key_id => $where_clause) {
$html_output .= '<input type="hidden" name="where_clause[' . $key_id . ']" value="' . htmlspecialchars(trim($where_clause)) . '" />'. "\n";
$html_output .= '<input type="hidden" name="where_clause['
. $key_id . ']" value="'
. htmlspecialchars(trim($where_clause)) . '" />'. "\n";
}
}
$tmp = '<select name="insert_rows" id="insert_rows">' . "\n";
@ -1335,6 +1387,8 @@ function PMA_getContinueInsertionForm($table, $db, $where_clause_array, $err_url
/**
* Get action panel
*
* @param array $where_clause where clause
* @param string $after_insert insert mode, e.g. new_insert, same_insert
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param boolean $found_unique_key boolean variable for unique key
@ -1353,10 +1407,13 @@ function PMA_getActionsPanel($where_clause, $after_insert, $tabindex,
$html_output .= '</td>'
. '<td class="vmiddle">'
. '&nbsp;&nbsp;&nbsp;<strong>' . __('and then') . '</strong>&nbsp;&nbsp;&nbsp;'
. '&nbsp;&nbsp;&nbsp;<strong>'
. __('and then') . '</strong>&nbsp;&nbsp;&nbsp;'
. '</td>'
. '<td class="nowrap vmiddle">'
. PMA_getAfterInsertDropDown($where_clause, $after_insert, $found_unique_key)
. PMA_getAfterInsertDropDown(
$where_clause, $after_insert, $found_unique_key
)
. '</td>'
. '</tr>';
$html_output .='<tr>'
@ -1382,9 +1439,15 @@ function PMA_getSubmitTypeDropDown($where_clause, $tabindex, $tabindex_for_value
if (isset($where_clause)) {
$html_output .= '<option value="save">' . __('Save') . '</option>';
}
$html_output .= '<option value="insert">' . __('Insert as new row') . '</option>'
. '<option value="insertignore">' . __('Insert as new row and ignore errors') . '</option>'
. '<option value="showinsert">' . __('Show insert query') . '</option>'
$html_output .= '<option value="insert">'
. __('Insert as new row')
. '</option>'
. '<option value="insertignore">'
. __('Insert as new row and ignore errors')
. '</option>'
. '<option value="showinsert">'
. __('Show insert query')
. '</option>'
. '</select>';
return $html_output;
}
@ -1394,7 +1457,6 @@ function PMA_getSubmitTypeDropDown($where_clause, $tabindex, $tabindex_for_value
*
* @param array $where_clause where clause
* @param string $after_insert insert mode, e.g. new_insert, same_insert
* @param string $after_insert a request parameter it can be 'edit_text', 'back'
* @param boolean $found_unique_key boolean variable for unique key
*
* @return string an html snippet
@ -1417,7 +1479,10 @@ function PMA_getAfterInsertDropDown($where_clause, $after_insert, $found_unique_
// in 2.9.0, we are looking for `table_name`.`field_name` = numeric_value
$is_numeric = false;
for ($i = 0; $i < count($where_clause); $i++) {
$is_numeric = preg_match('@^[\s]*`[^`]*`[\.]`[^`]*` = [0-9]+@', $where_clause[$i]);
$is_numeric = preg_match(
'@^[\s]*`[^`]*`[\.]`[^`]*` = [0-9]+@',
$where_clause[$i]
);
if ($is_numeric == true) {
break;
}
@ -1436,10 +1501,10 @@ function PMA_getAfterInsertDropDown($where_clause, $after_insert, $found_unique_
/**
* get Submit button and Reset button for action panel
*
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
* @param integer $tabindex tab index
* @param integer $tabindex_for_value offset for the values tabindex
*
* @return string an html snippet
* @return string an html snippet
*/
function PMA_getSumbitAndResetButtonForActionsPanel($tabindex, $tabindex_for_value)
{
@ -1494,13 +1559,18 @@ function PMA_getHeadAndFootOfInsertRowTable($url_params)
*
* @param array $current_row a row of the table
* @param array $column description of column in given table
* @param array $extracted_columnspec associative array containing type, spec_in_brackets
* and possibly enum_set_values (another array)
* @param array $extracted_columnspec associative array containing type,
* spec_in_brackets and possibly
* enum_set_values (another array)
* @param boolean $real_null_value whether column value null or not null
* @param array $gis_data_types list of GIS data types
* @param string $column_name_appendix string to append to column name in input
*
* @return array $real_null_value, $data, $special_chars, $backup_field, $special_chars_encoded
* @return array $real_null_value, $data, $special_chars, $backup_field,
* $special_chars_encoded
*/
function PMA_getSpecialCharsAndBackupFieldForExistingRow($current_row, $column, $extracted_columnspec,
function PMA_getSpecialCharsAndBackupFieldForExistingRow(
$current_row, $column, $extracted_columnspec,
$real_null_value, $gis_data_types, $column_name_appendix
) {
$special_chars_encoded = '';
@ -1562,8 +1632,9 @@ function PMA_getSpecialCharsAndBackupFieldForExistingRow($current_row, $column,
*
* @return array $real_null_value, $data, $special_chars, $backup_field, $special_chars_encoded
*/
function PMA_getSpecialCharsAndBackupFieldForInsertingMode($column, $real_null_value)
{
function PMA_getSpecialCharsAndBackupFieldForInsertingMode(
$column, $real_null_value
) {
if (! isset($column['Default'])) {
$column['Default'] = '';
$real_null_value = true;
@ -1587,7 +1658,10 @@ function PMA_getSpecialCharsAndBackupFieldForInsertingMode($column, $real_null_v
) {
$column['display_binary_as_hex'] = true;
}
return array($real_null_value, $data, $special_chars, $backup_field, $special_chars_encoded);
return array(
$real_null_value, $data, $special_chars,
$backup_field, $special_chars_encoded
);
}
/**
@ -1619,7 +1693,8 @@ function PMA_getParamsForUpdateOrInsert()
}
/**
* check wether insert row mode and if so include tbl_changen script and set global variables.
* Check wether insert row mode and if so include tbl_changen script and set
* global variables.
*
* @return void
*/
@ -1648,7 +1723,8 @@ function PMA_isInsertRow()
*/
function PMA_setSessionForEditNext($one_where_clause)
{
$local_query = 'SELECT * FROM ' . PMA_backquote($GLOBALS['db']) . '.' . PMA_backquote($GLOBALS['table'])
$local_query = 'SELECT * FROM '
. PMA_backquote($GLOBALS['db']) . '.' . PMA_backquote($GLOBALS['table'])
. ' WHERE ' . str_replace('` =', '` >', $one_where_clause)
. ' LIMIT 1;';
$res = PMA_DBI_query($local_query);
@ -1669,7 +1745,8 @@ function PMA_setSessionForEditNext($one_where_clause)
* if $GLOBALS['goto'] empty, if $goto_include previously not defined
* and new_insert, same_insert, same_insert
*
* @param string $goto_include store some script for include, otherwise it is boolean false
* @param string $goto_include store some script for include, otherwise it is
* boolean false
*
* @return string $goto_include
*/
@ -1720,11 +1797,11 @@ function PMA_getErrorUrl($url_params)
/**
* Builds the sql query
*
* @param boolean $is_insertignore $_REQUEST['submit_type'] == 'insertignore'
* @param array $query_fields column names array
* @param array $value_sets array of query values
* @param boolean $is_insertignore $_REQUEST['submit_type'] == 'insertignore'
* @param array $query_fields column names array
* @param array $value_sets array of query values
*
* @return string a query
* @return string a query
*/
function PMA_buildSqlQuery($is_insertignore, $query_fields, $value_sets)
{
@ -1750,6 +1827,7 @@ function PMA_buildSqlQuery($is_insertignore, $query_fields, $value_sets)
*/
function PMA_executeSqlQuery($url_params, $query)
{
$return_to_sql_query = '';
if (! empty($GLOBALS['sql_query'])) {
$url_params['sql_query'] = $GLOBALS['sql_query'];
$return_to_sql_query = $GLOBALS['sql_query'];

View File

@ -11,6 +11,8 @@ if (! defined('PHPMYADMIN')) {
/**
* Sets required globals
*
* @return nothing
*/
function PMA_RTN_setGlobals()
{
@ -30,6 +32,8 @@ function PMA_RTN_setGlobals()
/**
* Main function for the routines functionality
*
* @return nothing
*/
function PMA_RTN_main()
{
@ -78,7 +82,7 @@ function PMA_RTN_main()
* as returned by PMA_RTN_parseAllParameters() and returns an array containing
* the information about this parameter.
*
* @param string $value A string containing one parameter of a routine
* @param string $value A string containing one parameter of a routine
*
* @return array Parsed information about the input parameter
*/
@ -111,17 +115,27 @@ function PMA_RTN_parseOneParameter($value)
|| $parsed_param[$i]['type'] == 'alpha_functionName') && $depth == 0 // "CHAR" seems to be mistaken for a function by the parser
) {
$retval[2] = strtoupper($parsed_param[$i]['data']);
} else if ($parsed_param[$i]['type'] == 'punct_bracket_open_round' && $depth == 0) {
} else if ($parsed_param[$i]['type'] == 'punct_bracket_open_round'
&& $depth == 0
) {
$depth = 1;
} else if ($parsed_param[$i]['type'] == 'punct_bracket_close_round' && $depth == 1) {
} else if ($parsed_param[$i]['type'] == 'punct_bracket_close_round'
&& $depth == 1
) {
$depth = 0;
} else if ($depth == 1) {
$param_length .= $parsed_param[$i]['data'];
} else if ($parsed_param[$i]['type'] == 'alpha_reservedWord' && strtoupper($parsed_param[$i]['data']) == 'CHARSET' && $depth == 0) {
if ($parsed_param[$i+1]['type'] == 'alpha_charset' || $parsed_param[$i+1]['type'] == 'alpha_identifier') {
} else if ($parsed_param[$i]['type'] == 'alpha_reservedWord'
&& strtoupper($parsed_param[$i]['data']) == 'CHARSET' && $depth == 0
) {
if ($parsed_param[$i+1]['type'] == 'alpha_charset'
|| $parsed_param[$i+1]['type'] == 'alpha_identifier'
) {
$param_opts[] = strtolower($parsed_param[$i+1]['data']);
}
} else if ($parsed_param[$i]['type'] == 'alpha_columnAttrib' && $depth == 0) {
} else if ($parsed_param[$i]['type'] == 'alpha_columnAttrib'
&& $depth == 0
) {
$param_opts[] = strtoupper($parsed_param[$i]['data']);
}
}
@ -137,8 +151,8 @@ function PMA_RTN_parseOneParameter($value)
* SHOW CREATE [PROCEDURE | FUNCTION] query and extracts
* information about the routine's parameters.
*
* @param array $parsed_query Parsed query, returned by by PMA_SQP_parse()
* @param string $routine_type Routine type: 'PROCEDURE' or 'FUNCTION'
* @param array $parsed_query Parsed query, returned by by PMA_SQP_parse()
* @param string $routine_type Routine type: 'PROCEDURE' or 'FUNCTION'
*
* @return array Information about the parameteres of a routine.
*/
@ -153,14 +167,20 @@ function PMA_RTN_parseAllParameters($parsed_query, $routine_type)
$fetching = false;
$depth = 0;
for ($i=0; $i<$parsed_query['len']; $i++) {
if ($parsed_query[$i]['type'] == 'alpha_reservedWord' && $parsed_query[$i]['data'] == $routine_type) {
if ($parsed_query[$i]['type'] == 'alpha_reservedWord'
&& $parsed_query[$i]['data'] == $routine_type
) {
$fetching = true;
} else if ($fetching == true && $parsed_query[$i]['type'] == 'punct_bracket_open_round') {
} else if ($fetching == true
&& $parsed_query[$i]['type'] == 'punct_bracket_open_round'
) {
$depth++;
if ($depth > 1) {
$buffer .= $parsed_query[$i]['data'] . ' ';
}
} else if ($fetching == true && $parsed_query[$i]['type'] == 'punct_bracket_close_round') {
} else if ($fetching == true
&& $parsed_query[$i]['type'] == 'punct_bracket_close_round'
) {
$depth--;
if ($depth > 0) {
$buffer .= $parsed_query[$i]['data'] . ' ';
@ -203,7 +223,7 @@ function PMA_RTN_parseAllParameters($parsed_query, $routine_type)
* SHOW CREATE [PROCEDURE | FUNCTION] query and extracts
* information about the routine's definer.
*
* @param array $parsed_query Parsed query, returned by PMA_SQP_parse()
* @param array $parsed_query Parsed query, returned by PMA_SQP_parse()
*
* @return string The definer of a routine.
*/
@ -212,11 +232,18 @@ function PMA_RTN_parseRoutineDefiner($parsed_query)
$retval = '';
$fetching = false;
for ($i=0; $i<$parsed_query['len']; $i++) {
if ($parsed_query[$i]['type'] == 'alpha_reservedWord' && $parsed_query[$i]['data'] == 'DEFINER') {
if ($parsed_query[$i]['type'] == 'alpha_reservedWord'
&& $parsed_query[$i]['data'] == 'DEFINER'
) {
$fetching = true;
} else if ($fetching == true && ($parsed_query[$i]['type'] != 'quote_backtick' && substr($parsed_query[$i]['type'], 0, 5) != 'punct')) {
} else if ($fetching == true
&& $parsed_query[$i]['type'] != 'quote_backtick'
&& substr($parsed_query[$i]['type'], 0, 5) != 'punct'
) {
break;
} else if ($fetching == true && $parsed_query[$i]['type'] == 'quote_backtick') {
} else if ($fetching == true
&& $parsed_query[$i]['type'] == 'quote_backtick'
) {
$retval .= PMA_unQuote($parsed_query[$i]['data']);
} else if ($fetching == true && $parsed_query[$i]['type'] == 'punct_user') {
$retval .= $parsed_query[$i]['data'];
@ -227,6 +254,8 @@ function PMA_RTN_parseRoutineDefiner($parsed_query)
/**
* Handles editor requests for adding or editing an item
*
* @return Does not return
*/
function PMA_RTN_handleEditor()
{
@ -280,10 +309,15 @@ function PMA_RTN_handleEditor()
// 'Add a new routine' mode
$result = PMA_DBI_try_query($routine_query);
if (! $result) {
$errors[] = sprintf(__('The following query has failed: "%s"'), $routine_query) . '<br /><br />'
. __('MySQL said: ') . PMA_DBI_getError(null);
$errors[] = sprintf(
__('The following query has failed: "%s"'),
$routine_query
) . '<br /><br />'
. __('MySQL said: ') . PMA_DBI_getError(null);
} else {
$message = PMA_Message::success(__('Routine %1$s has been created.'));
$message = PMA_Message::success(
__('Routine %1$s has been created.')
);
$message->addParam(PMA_backquote($_REQUEST['item_name']));
$sql_query = $routine_query;
}
@ -291,7 +325,9 @@ function PMA_RTN_handleEditor()
}
if (count($errors)) {
$message = PMA_Message::error(__('<b>One or more errors have occured while processing your request:</b>'));
$message = PMA_Message::error(
__('<b>One or more errors have occured while processing your request:</b>')
);
$message->addString('<ul>');
foreach ($errors as $string) {
$message->addString('<li>' . $string . '</li>');
@ -505,10 +541,10 @@ function PMA_RTN_getDataFromRequest()
* This function will generate the values that are required to complete
* the "Edit routine" form given the name of a routine.
*
* @param string $name The name of the routine.
* @param string $type Type of routine (ROUTINE|PROCEDURE)
* @param bool $all Whether to return all data or just
* the info about parameters.
* @param string $name The name of the routine.
* @param string $type Type of routine (ROUTINE|PROCEDURE)
* @param bool $all Whether to return all data or just
* the info about parameters.
*
* @return array Data necessary to create the routine editor.
*/
@ -577,7 +613,9 @@ function PMA_RTN_getDataFromName($name, $type, $all = true)
&& strtoupper($parsed_query[$i]['data']) == 'RETURNS'
) {
$fetching = true;
} else if ($fetching == true && $parsed_query[$i]['type'] == 'alpha_reservedWord') {
} else if ($fetching == true
&& $parsed_query[$i]['type'] == 'alpha_reservedWord'
) {
// We will not be looking for options such as UNSIGNED
// or ZEROFILL because there is no way that a numeric
// field's DTD_IDENTIFIER can be longer than 64
@ -604,8 +642,8 @@ function PMA_RTN_getDataFromName($name, $type, $all = true)
$retval['item_returnopts_num'] = $returnparam[4];
$retval['item_returnopts_text'] = $returnparam[4];
}
$retval['item_definer'] = PMA_RTN_parseRoutineDefiner($parsed_query);
$retval['item_definition'] = $routine['ROUTINE_DEFINITION'];
$retval['item_definer'] = PMA_RTN_parseRoutineDefiner($parsed_query);
$retval['item_definition'] = $routine['ROUTINE_DEFINITION'];
$retval['item_isdeterministic'] = '';
if ($routine['IS_DETERMINISTIC'] == 'YES') {
$retval['item_isdeterministic'] = " checked='checked'";
@ -627,13 +665,13 @@ function PMA_RTN_getDataFromName($name, $type, $all = true)
/**
* Creates one row for the parameter table used in the routine editor.
*
* @param array $routine Data for the routine returned by
* PMA_RTN_getDataFromRequest() or
* PMA_RTN_getDataFromName()
* @param mixed $index Either a numeric index of the row being processed
* or NULL to create a template row for AJAX request
* @param string $class Class used to hide the direction column, if the
* row is for a stored function.
* @param array $routine Data for the routine returned by
* PMA_RTN_getDataFromRequest() or
* PMA_RTN_getDataFromName()
* @param mixed $index Either a numeric index of the row being processed
* or NULL to create a template row for AJAX request
* @param string $class Class used to hide the direction column, if the
* row is for a stored function.
*
* @return string HTML code of one row of parameter table for the editor.
*/
@ -732,14 +770,14 @@ function PMA_RTN_getParameterRow($routine = array(), $index = null, $class = '')
/**
* 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()
* @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.
*/
@ -779,7 +817,9 @@ function PMA_RTN_getEditorForm($mode, $operation, $routine)
$routine['item_type'] = 'PROCEDURE';
$routine['item_type_toggle'] = 'FUNCTION';
}
} else if ($operation == 'add' || ($routine['item_num_params'] == 0 && $mode == 'add' && ! $errors)) {
} else if ($operation == 'add'
|| ($routine['item_num_params'] == 0 && $mode == 'add' && ! $errors)
) {
$routine['item_param_dir'][] = '';
$routine['item_param_name'][] = '';
$routine['item_param_type'][] = '';
@ -989,7 +1029,8 @@ function PMA_RTN_getQueryFromRequest()
{
global $_REQUEST, $errors, $param_sqldataaccess, $param_directions;
$_REQUEST['item_type'] = isset($_REQUEST['item_type']) ? $_REQUEST['item_type'] : '';
$_REQUEST['item_type'] = isset($_REQUEST['item_type'])
? $_REQUEST['item_type'] : '';
$query = 'CREATE ';
if (! empty($_REQUEST['item_definer'])) {
@ -1006,7 +1047,10 @@ function PMA_RTN_getQueryFromRequest()
) {
$query .= $_REQUEST['item_type'] . ' ';
} else {
$errors[] = sprintf(__('Invalid routine type: "%s"'), htmlspecialchars($_REQUEST['item_type']));
$errors[] = sprintf(
__('Invalid routine type: "%s"'),
htmlspecialchars($_REQUEST['item_type'])
);
}
if (! empty($_REQUEST['item_name'])) {
$query .= PMA_backquote($_REQUEST['item_name']);
@ -1133,6 +1177,8 @@ function PMA_RTN_getQueryFromRequest()
/**
* Handles requests for executing a routine
*
* @return Does not return
*/
function PMA_RTN_handleExecute()
{
@ -1344,8 +1390,8 @@ function PMA_RTN_handleExecute()
/**
* Creates the HTML code that shows the routine execution dialog.
*
* @param array $routine Data for the routine returned by
* PMA_RTN_getDataFromName()
* @param array $routine Data for the routine returned by
* PMA_RTN_getDataFromName()
*
* @return string HTML code for the routine execution dialog.
*/

View File

@ -228,23 +228,24 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
<thead>
<tr>
<?php
if (isset($_REQUEST['query'])) {
echo '<td class="select_all">';
echo '<input type="checkbox" value="select_all_'.htmlspecialchars($t_n_url).'" style="margin: 0px;" ';
echo 'id="select_all_'.htmlspecialchars($t_n_url).'" title="select all" ';
echo 'onclick="Select_all(\''. htmlspecialchars($t_n_url) .'\',\''.htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]).'\')"></td>';
}?>
if (isset($_REQUEST['query'])) {
echo '<td class="select_all">';
echo '<input type="checkbox" value="select_all_'.htmlspecialchars($t_n_url).'" style="margin: 0px;" ';
echo 'id="select_all_'.htmlspecialchars($t_n_url).'" title="select all" ';
echo 'onclick="Select_all(\''. htmlspecialchars($t_n_url) .'\',\''.htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]).'\')"></td>';
}
?>
<td class="small_tab" onmouseover="this.className='small_tab2';"
onmouseout="this.className='small_tab';"
id="id_hide_tbody_<?php echo $t_n_url ?>"
onclick="Small_tab('<?php echo $t_n_url ?>', 1)"><?php
// no space alloawd here, between tags and content !!!
// JavaScript function does require this
if (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) {
echo 'v';
} else {
echo '&gt;';
}
if (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) {
echo 'v';
} else {
echo '&gt;';
}
?></td>
<td class="small_tab_pref" onmouseover="this.className='small_tab_pref2';"
onmouseout="this.className='small_tab_pref';"
@ -261,21 +262,22 @@ if (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) {
echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
?></td>
<?php
if (isset($_REQUEST['query'])) {
echo '<td class="tab_zag" onmouseover="Table_onover(\''.htmlspecialchars($t_n_url).'\',0,1)" id="id_zag_'.htmlspecialchars($t_n_url).'_2"';
echo 'onmousedown="cur_click=document.getElementById(\''.htmlspecialchars($t_n_url).'\');"';
echo 'onmouseout="Table_onover(\''.htmlspecialchars($t_n_url).'\',1,1)">';
}?>
if (isset($_REQUEST['query'])) {
echo '<td class="tab_zag" onmouseover="Table_onover(\''.htmlspecialchars($t_n_url).'\',0,1)" id="id_zag_'.htmlspecialchars($t_n_url).'_2"';
echo 'onmousedown="cur_click=document.getElementById(\''.htmlspecialchars($t_n_url).'\');"';
echo 'onmouseout="Table_onover(\''.htmlspecialchars($t_n_url).'\',1,1)">';
}
?>
</tr>
</thead>
<tbody id="id_tbody_<?php echo $t_n_url ?>"
<?php
if (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) {
echo 'style="display: none;"';
} ?>>
<?php
$display_field = PMA_getDisplayField($db, $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]);
for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++) {
if (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) {
echo 'style="display: none;"';
}
echo '>';
$display_field = PMA_getDisplayField($db, $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]);
for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++) {
?>
<tr id="id_tr_<?php
echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '.'
@ -311,56 +313,52 @@ for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++
id="<?php echo $t_n_url.".".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>">
<div class="nowrap">
<?php
if (isset($tables_pk_or_unique_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]])) {
?>
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/FieldKey_small.png"
alt="*" />
<?php
} else {
?>
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Field_small<?php
if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'text')
) {
echo '_char';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'float')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'double')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')
) {
echo '_int';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'time')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'year')
) {
echo '_date';
if (isset($tables_pk_or_unique_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]])) {
?>
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/FieldKey_small.png"
alt="*" />
<?php
} else {
?>
<img src="<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>pmd/Field_small<?php
if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'text')
) {
echo '_char';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'float')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'double')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')
) {
echo '_int';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'time')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'year')
) {
echo '_date';
}
?>.png" alt="*" />
<?php
}
?>.png" alt="*" />
<?php
echo htmlspecialchars(
$tab_column[$t_n]["COLUMN_NAME"][$j] . " : " . $tab_column[$t_n]["TYPE"][$j],
ENT_QUOTES
);
echo "</div>\n</td>\n";
if (isset($_REQUEST['query'])) {
//$temp = $GLOBALS['PMD_OUT']["OWNER"][$i].'.'.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
echo '<td class="small_tab_pref" onmouseover="this.className=\'small_tab_pref2\';"';
echo 'onmouseout="this.className=\'small_tab_pref\';"';
echo 'onclick="Click_option(\'pmd_optionse\',\''
. urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) . '\',\''
. $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i].'\')" >';
echo '<img src="'
. $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png')
. '" title="options" alt="" /></td> ';
}
echo "</tr>\n";
}
echo htmlspecialchars(
$tab_column[$t_n]["COLUMN_NAME"][$j] . " : " . $tab_column[$t_n]["TYPE"][$j],
ENT_QUOTES
);
?>
</div>
</td>
<?php
if (isset($_REQUEST['query'])) {
//$temp = $GLOBALS['PMD_OUT']["OWNER"][$i].'.'.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
echo '<td class="small_tab_pref" onmouseover="this.className=\'small_tab_pref2\';"';
echo 'onmouseout="this.className=\'small_tab_pref\';"';
echo 'onclick="Click_option(\'pmd_optionse\',\''.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'\',\''.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i].'\')" >';
echo '<img src="' . $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png') . '" title="options" alt="" /></td> ';
}
?>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
echo "</tbody>\n</table>\n";
}
?>
</form>

View File

@ -4,7 +4,7 @@ msgstr ""
"Project-Id-Version: phpMyAdmin-docs 4.0.0-dev\n"
"Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2012-06-18 10:54+0200\n"
"PO-Revision-Date: 2012-05-25 18:45+0200\n"
"PO-Revision-Date: 2012-06-20 18:40+0200\n"
"Last-Translator: Marc Delisle <marc@infomarc.info>\n"
"Language-Team: none\n"
"Language: fr\n"
@ -1582,7 +1582,7 @@ msgstr "Tableau"
#: js/messages.php:191
msgid "Edit chart"
msgstr "Éditer le graphique"
msgstr "Modifier le graphique"
#: js/messages.php:192
msgid "Series"
@ -1897,10 +1897,9 @@ msgstr "Survoler un point montrera sa description."
#: js/messages.php:304
msgid "To zoom in, select a section of the plot with the mouse."
msgstr "Pour faire un zoom avant, sélectionnez une section avec la souris."
msgstr "Pour zoomer, sélectionnez une section avec la souris."
#: js/messages.php:306
#, fuzzy
#| msgid "Click reset zoom link to come back to original state."
msgid "Click reset zoom button to come back to original state."
msgstr "Cliquez le lien «Réinitialiser zoom» pour revenir à l'état original."
@ -2467,10 +2466,10 @@ msgid "vertical"
msgstr "vertical"
#: libraries/DisplayResults.class.php:702
#, fuzzy, php-format
#, php-format
#| msgid "Headers every"
msgid "Headers every %s rows"
msgstr "En-têtes à chaque"
msgstr "En-têtes à chaque %s ligne"
#: libraries/DisplayResults.class.php:1180
msgid "Sort by key"
@ -3462,7 +3461,7 @@ msgstr "Impossible d'utiliser Blowfish depuis mcrypt !"
#: libraries/auth/cookie.auth.lib.php:139
msgid "Your session has expired. Please login again."
msgstr ""
msgstr "Votre session a expiré. Veuillez vous connecter à nouveau."
#: libraries/auth/cookie.auth.lib.php:227
msgid "Log in"

View File

@ -854,15 +854,14 @@ echo __('Runtime Information');
<div class="formelement">
<select id="filterCategory" name="filterCategory">
<option value=''><?php echo __('Filter by category...'); ?></option>
<?php
foreach ($sections as $section_id => $section_name) {
if (isset($categoryUsed[$section_id])) {
?>
<option value='<?php echo $section_id; ?>'><?php echo $section_name; ?></option>
<?php
}
}
?>
<?php
foreach ($sections as $section_id => $section_name) {
if (isset($categoryUsed[$section_id])) {
echo '<option value="' . $section_id. '">'
. $section_name. '</option>'. "\n";
}
}
?>
</select>
</div>
<div class="formelement">
@ -872,25 +871,25 @@ echo __('Runtime Information');
</fieldset>
<div id="linkSuggestions" class="defaultLinks" style="display:none">
<p class="notice"><?php echo __('Related links:'); ?>
<?php
foreach ($links as $section_name => $section_links) {
echo '<span class="status_' . $section_name . '"> ';
$i=0;
foreach ($section_links as $link_name => $link_url) {
if ($i > 0) {
echo ', ';
}
if ('doc' == $link_name) {
echo PMA_showMySQLDocu($link_url, $link_url);
} else {
echo '<a href="' . $link_url . '">' . $link_name . '</a>';
}
$i++;
}
echo '</span>';
}
unset($link_url, $link_name, $i);
?>
<?php
foreach ($links as $section_name => $section_links) {
echo '<span class="status_' . $section_name . '"> ';
$i=0;
foreach ($section_links as $link_name => $link_url) {
if ($i > 0) {
echo ', ';
}
if ('doc' == $link_name) {
echo PMA_showMySQLDocu($link_url, $link_url);
} else {
echo '<a href="' . $link_url . '">' . $link_name . '</a>';
}
$i++;
}
echo '</span>';
}
unset($link_url, $link_name, $i);
?>
</p>
</div>
<div class="tabInnerContent">
@ -910,17 +909,17 @@ echo __('Runtime Information');
<div class="tabInnerContent clearfloat">
</div>
<div id="advisorInstructionsDialog" style="display:none;">
<?php
echo '<p>';
echo __('The Advisor system can provide recommendations on server variables by analyzing the server status variables.');
echo '</p> <p>';
echo __('Do note however that this system provides recommendations based on simple calculations and by rule of thumb which may not necessarily apply to your system.');
echo '</p> <p>';
echo __('Prior to changing any of the configuration, be sure to know what you are changing (by reading the documentation) and how to undo the change. Wrong tuning can have a very negative effect on performance.');
echo '</p> <p>';
echo __('The best way to tune your system would be to change only one setting at a time, observe or benchmark your database, and undo the change if there was no clearly measurable improvement.');
echo '</p>';
?>
<?php
echo '<p>';
echo __('The Advisor system can provide recommendations on server variables by analyzing the server status variables.');
echo '</p> <p>';
echo __('Do note however that this system provides recommendations based on simple calculations and by rule of thumb which may not necessarily apply to your system.');
echo '</p> <p>';
echo __('Prior to changing any of the configuration, be sure to know what you are changing (by reading the documentation) and how to undo the change. Wrong tuning can have a very negative effect on performance.');
echo '</p> <p>';
echo __('The best way to tune your system would be to change only one setting at a time, observe or benchmark your database, and undo the change if there was no clearly measurable improvement.');
echo '</p>';
?>
</div>
</div>
</div>
@ -1024,11 +1023,11 @@ function printQueryStatistics()
<div id="serverstatusquerieschart">
<span style="display:none;">
<?php
if ($other_sum > 0) {
$chart_json[__('Other')] = $other_sum;
}
if ($other_sum > 0) {
$chart_json[__('Other')] = $other_sum;
}
echo json_encode($chart_json);
echo json_encode($chart_json);
?>
</span>
</div>
@ -1266,7 +1265,9 @@ function printServerTraffic()
<img src="<?php echo $GLOBALS['pmaThemeImage'] . 's_' . ($show_full_sql ? 'partial' : 'full'); ?>text.png"
alt="<?php echo $show_full_sql ? __('Truncate Shown Queries') : __('Show Full Queries'); ?>" />
</a>
<?php } ?>
<?php
}
?>
</th>
</tr>
</thead>
@ -1466,20 +1467,24 @@ function printVariablesTable()
'Table_locks_waited' => 0,
'Qcache_lowmem_prunes' => 0,
'Qcache_free_blocks' => isset($server_status['Qcache_total_blocks']) ? $server_status['Qcache_total_blocks'] / 5 : 0,
'Qcache_free_blocks' => isset($server_status['Qcache_total_blocks'])
? $server_status['Qcache_total_blocks'] / 5 : 0,
'Slow_launch_threads' => 0,
// depends on Key_read_requests
// normaly lower then 1:0.01
'Key_reads' => isset($server_status['Key_read_requests']) ? (0.01 * $server_status['Key_read_requests']) : 0,
'Key_reads' => isset($server_status['Key_read_requests'])
? (0.01 * $server_status['Key_read_requests']) : 0,
// depends on Key_write_requests
// normaly nearly 1:1
'Key_writes' => isset($server_status['Key_write_requests']) ? (0.9 * $server_status['Key_write_requests']) : 0,
'Key_writes' => isset($server_status['Key_write_requests'])
? (0.9 * $server_status['Key_write_requests']) : 0,
'Key_buffer_fraction' => 0.5,
// alert if more than 95% of thread cache is in use
'Threads_cached' => isset($server_variables['thread_cache_size']) ? 0.95 * $server_variables['thread_cache_size'] : 0
'Threads_cached' => isset($server_variables['thread_cache_size'])
? 0.95 * $server_variables['thread_cache_size'] : 0
// higher is better
// variable => min value
@ -1581,12 +1586,16 @@ function printMonitor()
<?php echo PMA_getImage('s_cog.png'); ?>
<?php echo __('Settings'); ?>
</a>
<?php if (! PMA_DRIZZLE) { ?>
<?php
if (! PMA_DRIZZLE) {
?>
<a href="#monitorInstructionsDialog">
<?php echo PMA_getImage('b_help.png'); ?>
<?php echo __('Instructions/Setup'); ?>
</a>
<?php } ?>
<?php
}
?>
<a href="#endChartEditMode" style="display:none;">
<?php echo PMA_getImage('s_okay.png'); ?>
<?php echo __('Done rearranging/editing charts'); ?>
@ -1664,7 +1673,9 @@ function printMonitor()
?>
</p>
</div>
<?php } ?>
<?php
}
?>
</div>
<div id="addChartDialog" title="<?php echo __('Add chart'); ?>" style="display:none;">
@ -1731,7 +1742,9 @@ function printMonitor()
<div id="emptyDialog" title="Dialog" style="display:none;">
</div>
<?php if (! PMA_DRIZZLE) { ?>
<?php
if (! PMA_DRIZZLE) {
?>
<div id="logAnalyseDialog" title="<?php echo __('Log statistics'); ?>" style="display:none;">
<p> <?php echo __('Selected time range:'); ?>
<input type="text" name="dateStart" class="datetimefield" value="" /> -
@ -1760,7 +1773,9 @@ function printMonitor()
<p></p>
<div class="placeHolder"></div>
</div>
<?php } ?>
<?php
}
?>
<table class="clearfloat" id="chartGrid">
@ -1771,16 +1786,16 @@ function printMonitor()
<script type="text/javascript">
variableNames = [ <?php
$i=0;
foreach ($server_status as $name=>$value) {
if (is_numeric($value)) {
if ($i++ > 0) {
echo ", ";
}
echo "'" . $name . "'";
}
$i=0;
foreach ($server_status as $name=>$value) {
if (is_numeric($value)) {
if ($i++ > 0) {
echo ", ";
}
?> ];
echo "'" . $name . "'";
}
}
?> ];
</script>
<?php
}

View File

@ -186,7 +186,7 @@ $html_output .= '<script src="js/keyhandler.js" type="text/javascript"></script>
. 'document.onkeydown = onKeyDownArrowsHandler;'
. '</script>';
// Set if we passed the first timestamp field
$timestamp_seen = 0;
$timestamp_seen = false;
$columns_cnt = count($table_fields);
$tabindex = 0;