merge upstream
This commit is contained in:
commit
f999925313
@ -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
|
||||
|
||||
@ -281,6 +281,6 @@ foreach ($tables as $table) {
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
PMA_printButton();
|
||||
echo PMA_getButton();
|
||||
|
||||
?>
|
||||
|
||||
@ -244,7 +244,7 @@ if ($num_tables == 0) {
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
PMA_printButton();
|
||||
echo PMA_getButton();
|
||||
|
||||
echo "<div id='PMA_disable_floating_menubar'></div>\n";
|
||||
?>
|
||||
|
||||
@ -112,7 +112,7 @@ if (isset($_REQUEST['sort_order'])) {
|
||||
$_url_params['sort_order'] = $_REQUEST['sort_order'];
|
||||
}
|
||||
|
||||
PMA_listNavigator(
|
||||
echo PMA_getListNavigator(
|
||||
$total_num_tables, $pos, $_url_params, 'db_structure.php',
|
||||
'frame_content', $GLOBALS['cfg']['MaxTableList']
|
||||
);
|
||||
@ -727,7 +727,7 @@ if (!$db_is_information_schema && !$cfg['DisableMultiTableMaintenance']) {
|
||||
</form>
|
||||
<?php
|
||||
// display again the table list navigator
|
||||
PMA_listNavigator(
|
||||
echo PMA_getListNavigator(
|
||||
$total_num_tables, $pos, $_url_params, 'db_structure.php',
|
||||
'frame_content', $GLOBALS['cfg']['MaxTableList']
|
||||
);
|
||||
|
||||
@ -29,7 +29,7 @@ function loadResult(result_path, table_name, link, ajaxEnable)
|
||||
$(function() {
|
||||
if(ajaxEnable) {
|
||||
/** Hides the results shown by the delete criteria */
|
||||
var $msg = PMA_ajaxShowMessage();
|
||||
var $msg = PMA_ajaxShowMessage(PMA_messages['strBrowsing'], false);
|
||||
$('#sqlqueryform').hide();
|
||||
$('#togglequerybox').hide();
|
||||
/** Load the browse results to the page */
|
||||
@ -81,11 +81,15 @@ function deleteResult(result_path, msg, ajaxEnable)
|
||||
/** Refresh the search results after the deletion */
|
||||
document.getElementById('buttonGo').click();
|
||||
$('#togglequerybox').html(PMA_messages['strHideQueryBox']);
|
||||
PMA_ajaxRemoveMessage($msg);
|
||||
/** Show the results of the deletion option */
|
||||
$('#browse-results').show();
|
||||
$('#sqlqueryform').show();
|
||||
$('#togglequerybox').show();
|
||||
$('html, body')
|
||||
.animate({
|
||||
scrollTop: $("#browse-results").offset().top
|
||||
}, 1000);
|
||||
PMA_ajaxRemoveMessage($msg);
|
||||
});
|
||||
} else {
|
||||
event.preventDefault();
|
||||
|
||||
@ -2494,49 +2494,6 @@ $(function() {
|
||||
}); //end of Drop Database Ajax action
|
||||
}); // end of $() for Drop Database
|
||||
|
||||
/**
|
||||
* Attach Ajax event handlers for 'Create Database'. Used wherever libraries/
|
||||
* display_create_database.lib.php is used, ie main.php and server_databases.php
|
||||
*
|
||||
* @see $cfg['AjaxEnable']
|
||||
*/
|
||||
$(function() {
|
||||
|
||||
$('#create_database_form.ajax').live('submit', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
$form = $(this);
|
||||
|
||||
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
|
||||
$.post($form.attr('action'), $form.serialize(), function(data) {
|
||||
if (data.success == true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
|
||||
//Append database's row to table
|
||||
$("#tabledatabases")
|
||||
.find('tbody')
|
||||
.append(data.new_db_string)
|
||||
.PMA_sort_table('.name')
|
||||
.find('#db_summary_row')
|
||||
.appendTo('#tabledatabases tbody')
|
||||
.removeClass('odd even');
|
||||
|
||||
var $databases_count_object = $('#databases_count');
|
||||
var databases_count = parseInt($databases_count_object.text()) + 1;
|
||||
$databases_count_object.text(databases_count);
|
||||
//Refresh navigation frame as a new database has been added
|
||||
if (window.parent && window.parent.frame_navigation) {
|
||||
window.parent.frame_navigation.location.reload();
|
||||
}
|
||||
} else {
|
||||
PMA_ajaxShowMessage(data.error, false);
|
||||
}
|
||||
}); // end $.post()
|
||||
}); // end $().live()
|
||||
}); // end $() for Create Database
|
||||
|
||||
/**
|
||||
* Validates the password field in a form
|
||||
*
|
||||
|
||||
@ -31,6 +31,7 @@ $(function() {
|
||||
*/
|
||||
var selected_dbs = [];
|
||||
$form.find('input:checkbox:checked').each(function () {
|
||||
$(this).closest('tr').addClass('removeMe');
|
||||
selected_dbs[selected_dbs.length] = 'DROP DATABASE `' + escapeHtml($(this).val()) + '`;';
|
||||
});
|
||||
if (! selected_dbs.length) {
|
||||
@ -55,14 +56,65 @@ $(function() {
|
||||
$.post(url, function(data) {
|
||||
if(data.success == true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
|
||||
var $rowsToRemove = $form.find('tr.removeMe');
|
||||
var $databasesCount = $('#databases_count');
|
||||
var newCount = parseInt($databasesCount.text()) - $rowsToRemove.length;
|
||||
$databasesCount.text(newCount);
|
||||
|
||||
$rowsToRemove.remove();
|
||||
$form.find('tbody').PMA_sort_table('.name');
|
||||
if (window.parent && window.parent.frame_navigation) {
|
||||
window.parent.frame_navigation.location.reload();
|
||||
}
|
||||
$('#tableslistcontainer').load('server_databases.php form#dbStatsForm');
|
||||
} else {
|
||||
PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest + ": " + data.error, false);
|
||||
$form.find('tr.removeMe').removeClass('removeMe');
|
||||
PMA_ajaxShowMessage(data.error, false);
|
||||
}
|
||||
}); // end $.post()
|
||||
}); // end $.PMA_confirm()
|
||||
}) ; //end of Drop Database action
|
||||
|
||||
/**
|
||||
* Attach Ajax event handlers for 'Create Database'.
|
||||
*
|
||||
* @see $cfg['AjaxEnable']
|
||||
*/
|
||||
$('#create_database_form.ajax').live('submit', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
$form = $(this);
|
||||
|
||||
var newDbNameInput = $form.find('input[name=new_db]');
|
||||
if (newDbNameInput.val() === '') {
|
||||
newDbNameInput.focus();
|
||||
alert(PMA_messages['strFormEmpty']);
|
||||
return;
|
||||
}
|
||||
|
||||
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
|
||||
$.post($form.attr('action'), $form.serialize(), function(data) {
|
||||
if (data.success == true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
|
||||
//Append database's row to table
|
||||
$("#tabledatabases")
|
||||
.find('tbody')
|
||||
.append(data.new_db_string)
|
||||
.PMA_sort_table('.name');
|
||||
|
||||
var $databases_count_object = $('#databases_count');
|
||||
var databases_count = parseInt($databases_count_object.text()) + 1;
|
||||
$databases_count_object.text(databases_count);
|
||||
//Refresh navigation frame as a new database has been added
|
||||
if (window.parent && window.parent.frame_navigation) {
|
||||
window.parent.frame_navigation.location.reload();
|
||||
}
|
||||
} else {
|
||||
PMA_ajaxShowMessage(data.error, false);
|
||||
}
|
||||
}); // end $.post()
|
||||
}); // end $().live()
|
||||
}); // end $()
|
||||
|
||||
5000
libraries/DisplayResults.class.php
Normal file
5000
libraries/DisplayResults.class.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -288,7 +288,8 @@ class PMA_Error_Handler
|
||||
} else {
|
||||
ob_start();
|
||||
var_dump($error);
|
||||
$retval .= ob_end_clean();
|
||||
$retval .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -172,7 +172,8 @@ class PMA_Footer
|
||||
|
||||
ob_start();
|
||||
print_r($_SESSION['debug']);
|
||||
$retval .= ob_end_clean();
|
||||
$retval .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$retval .= '</pre>';
|
||||
$retval .= '</div>';
|
||||
@ -322,7 +323,8 @@ class PMA_Footer
|
||||
if (file_exists(CUSTOM_FOOTER_FILE)) {
|
||||
ob_start();
|
||||
include CUSTOM_FOOTER_FILE;
|
||||
$retval .= ob_end_clean();
|
||||
$retval .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
}
|
||||
} else if (! $this->_isAjax) {
|
||||
$retval .= "</body></html>";
|
||||
|
||||
@ -297,7 +297,8 @@ class PMA_Header
|
||||
if (file_exists(CUSTOM_HEADER_FILE)) {
|
||||
ob_start();
|
||||
include CUSTOM_HEADER_FILE;
|
||||
$retval .= ob_end_clean();
|
||||
$retval .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
}
|
||||
// offer to load user preferences from localStorage
|
||||
if ($this->_userprefsOfferImport) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -360,7 +360,7 @@ if (isset($_GET['sql_query'])) {
|
||||
<?php } ?>
|
||||
|
||||
<div class="exportoptions" id="submit">
|
||||
<?php PMA_externalBug(__('SQL compatibility mode'), 'mysql', '50027', '14515'); ?>
|
||||
<?php echo PMA_getExternalBug(__('SQL compatibility mode'), 'mysql', '50027', '14515'); ?>
|
||||
<input type="submit" value="<?php echo __('Go'); ?>" id="buttonGo" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -214,21 +214,21 @@ if ($GLOBALS['is_upload'] && !empty($cfg['UploadDir'])) { ?>
|
||||
<ul>
|
||||
<li>
|
||||
<input type="radio" name="file_location" id="radio_import_file" />
|
||||
<?php PMA_browseUploadFile($max_upload_size); ?>
|
||||
<?php echo PMA_getBrowseUploadFileBlock($max_upload_size); ?>
|
||||
</li>
|
||||
<li>
|
||||
<input type="radio" name="file_location" id="radio_local_import_file" />
|
||||
<?php PMA_selectUploadFile($import_list, $cfg['UploadDir']); ?>
|
||||
<?php echo PMA_getSelectUploadFileBlock($import_list, $cfg['UploadDir']); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php
|
||||
} elseif ($GLOBALS['is_upload']) {
|
||||
$uid = uniqid('');
|
||||
PMA_browseUploadFile($max_upload_size);
|
||||
echo PMA_getBrowseUploadFileBlock($max_upload_size);
|
||||
} elseif (!$GLOBALS['is_upload']) {
|
||||
PMA_Message::notice(__('File uploads are not allowed on this server.'))->display();
|
||||
} elseif (!empty($cfg['UploadDir'])) {
|
||||
PMA_selectUploadFile($import_list, $cfg['UploadDir']);
|
||||
echo PMA_getSelectUploadFileBlock($import_list, $cfg['UploadDir']);
|
||||
} // end if (web-server upload directory)
|
||||
?>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -59,7 +59,7 @@ class PMA_GIS_Geometrycollection extends PMA_GIS_Geometry
|
||||
|
||||
// Trim to remove leading 'GEOMETRYCOLLECTION(' and trailing ')'
|
||||
$goem_col = substr($spatial, 19, (strlen($spatial) - 20));
|
||||
|
||||
|
||||
// Split the geometry collection object to get its constituents.
|
||||
$sub_parts = $this->_explodeGeomCol($goem_col);
|
||||
|
||||
@ -323,7 +323,6 @@ class PMA_GIS_Geometrycollection extends PMA_GIS_Geometry
|
||||
foreach ($sub_parts as $sub_part) {
|
||||
$type_pos = stripos($sub_part, '(');
|
||||
$type = substr($sub_part, 0, $type_pos);
|
||||
|
||||
$gis_obj = PMA_GIS_Factory::factory($type);
|
||||
if (! $gis_obj) {
|
||||
continue;
|
||||
|
||||
@ -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'])
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -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.
|
||||
*/
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* @package PhpMyAdmin-Transformation
|
||||
*
|
||||
* Has one option: the text to be appended (default '')
|
||||
*/
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
|
||||
@ -176,7 +176,7 @@ if (! $GLOBALS['server']) {
|
||||
}
|
||||
|
||||
$_url_params = array('pos' => $pos);
|
||||
PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
|
||||
echo PMA_getListNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
|
||||
}
|
||||
?>
|
||||
|
||||
@ -256,7 +256,7 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
|
||||
'pos' => $tpos,
|
||||
'db' => $GLOBALS['db']
|
||||
);
|
||||
PMA_listNavigator(
|
||||
echo PMA_getListNavigator(
|
||||
$table_count, $tpos, $_url_params, 'navigation.php',
|
||||
'frame_navigation', $GLOBALS['cfg']['MaxTableList']
|
||||
);
|
||||
@ -266,7 +266,7 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
|
||||
if (count($table_list) <= $GLOBALS['cfg']['MaxTableList']
|
||||
&& $table_count > $GLOBALS['cfg']['MaxTableList']
|
||||
) {
|
||||
PMA_listNavigator(
|
||||
echo PMA_getListNavigator(
|
||||
$table_count, $tpos, $_url_params, 'navigation.php',
|
||||
'frame_navigation', $GLOBALS['cfg']['MaxTableList']
|
||||
);
|
||||
@ -297,7 +297,7 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
|
||||
} else {
|
||||
echo '<div id="databaseList">' . "\n";
|
||||
$_url_params = array('pos' => $pos);
|
||||
PMA_listNavigator(
|
||||
echo PMA_getListNavigator(
|
||||
count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php',
|
||||
'frame_navigation', $GLOBALS['cfg']['MaxDbList']
|
||||
);
|
||||
|
||||
138
pmd_general.php
138
pmd_general.php
@ -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 '>';
|
||||
}
|
||||
if (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) {
|
||||
echo 'v';
|
||||
} else {
|
||||
echo '>';
|
||||
}
|
||||
?></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>
|
||||
|
||||
3455
po/be@latin.po
3455
po/be@latin.po
File diff suppressed because it is too large
Load Diff
3685
po/en_GB.po
3685
po/en_GB.po
File diff suppressed because it is too large
Load Diff
3371
po/phpmyadmin.pot
3371
po/phpmyadmin.pot
File diff suppressed because it is too large
Load Diff
3421
po/pt_BR.po
3421
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
3461
po/sr@latin.po
3461
po/sr@latin.po
File diff suppressed because it is too large
Load Diff
3475
po/uz@latin.po
3475
po/uz@latin.po
File diff suppressed because it is too large
Load Diff
3385
po/zh_CN.po
3385
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
3449
po/zh_TW.po
3449
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
@ -172,7 +172,7 @@ if ($databases_count > 0) {
|
||||
'sort_order' => $sort_order,
|
||||
);
|
||||
|
||||
PMA_listNavigator($databases_count, $pos, $_url_params, 'server_databases.php', 'frame_content', $GLOBALS['cfg']['MaxDbList']);
|
||||
echo PMA_getListNavigator($databases_count, $pos, $_url_params, 'server_databases.php', 'frame_content', $GLOBALS['cfg']['MaxDbList']);
|
||||
|
||||
$_url_params['pos'] = $pos;
|
||||
|
||||
@ -246,7 +246,7 @@ if ($databases_count > 0) {
|
||||
} // end foreach ($databases as $key => $current)
|
||||
unset($current, $odd_row);
|
||||
|
||||
echo '<tr id="db_summary_row">' . "\n";
|
||||
echo '</tbody><tfoot><tr>' . "\n";
|
||||
if ($is_superuser || $cfg['AllowUserDropDatabase']) {
|
||||
echo ' <th></th>' . "\n";
|
||||
}
|
||||
@ -285,7 +285,7 @@ if ($databases_count > 0) {
|
||||
echo ' <th></th>' . "\n";
|
||||
}
|
||||
echo '</tr>' . "\n";
|
||||
echo '</tbody>' . "\n"
|
||||
echo '</tfoot>' . "\n"
|
||||
.'</table>' . "\n";
|
||||
unset($column_order, $stat_name, $stat, $databases, $table_columns);
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
26
sql.php
26
sql.php
@ -106,7 +106,7 @@ if (isset($fields['dbase'])) {
|
||||
/**
|
||||
* During grid edit, if we have a relational field, show the dropdown for it
|
||||
*
|
||||
* Logic taken from libraries/display_tbl_lib.php
|
||||
* Logic taken from libraries/DisplayResults.class.php
|
||||
*
|
||||
* This doesn't seem to be the right place to do this, but I can't think of any
|
||||
* better place either.
|
||||
@ -154,7 +154,7 @@ if (isset($_REQUEST['get_relational_values']) && $_REQUEST['get_relational_value
|
||||
/**
|
||||
* Just like above, find possible values for enum fields during grid edit.
|
||||
*
|
||||
* Logic taken from libraries/display_tbl_lib.php
|
||||
* Logic taken from libraries/DisplayResults.class.php
|
||||
*/
|
||||
if (isset($_REQUEST['get_enum_values']) && $_REQUEST['get_enum_values'] == true) {
|
||||
$field_info_query = PMA_DBI_get_columns_sql($db, $table, $_REQUEST['column']);
|
||||
@ -304,8 +304,16 @@ if (! defined('PMA_CHK_DROP')
|
||||
PMA_mysqlDie(__('"DROP DATABASE" statements are disabled.'), '', '', $err_url);
|
||||
} // end if
|
||||
|
||||
require_once 'libraries/display_tbl.lib.php';
|
||||
PMA_setConfigParamsForDisplayTable();
|
||||
// Include PMA_Index class for use in PMA_DisplayResults class
|
||||
require_once './libraries/Index.class.php';
|
||||
|
||||
require_once 'libraries/DisplayResults.class.php';
|
||||
|
||||
$displayResultsObject = new PMA_DisplayResults(
|
||||
$GLOBALS['db'], $GLOBALS['table'], $GLOBALS['goto'], $GLOBALS['sql_query']
|
||||
);
|
||||
|
||||
$displayResultsObject->setConfigParamsForDisplayTable();
|
||||
|
||||
/**
|
||||
* Need to find the real end of rows?
|
||||
@ -901,7 +909,7 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) {
|
||||
|
||||
if (empty($disp_mode)) {
|
||||
// see the "PMA_setDisplayMode()" function in
|
||||
// libraries/display_tbl.lib.php
|
||||
// libraries/DisplayResults.class.php
|
||||
$disp_mode = 'urdr111101';
|
||||
}
|
||||
|
||||
@ -914,7 +922,7 @@ if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) {
|
||||
$message = PMA_Message::success($message);
|
||||
echo PMA_getMessage($message, $GLOBALS['sql_query'], 'success');
|
||||
}
|
||||
echo PMA_getTable($result, $disp_mode, $analyzed_sql);
|
||||
echo $displayResultsObject->getTable($result, $disp_mode, $analyzed_sql);
|
||||
exit();
|
||||
}
|
||||
|
||||
@ -1048,7 +1056,7 @@ $(makeProfilingChart);
|
||||
// Displays the results in a table
|
||||
if (empty($disp_mode)) {
|
||||
// see the "PMA_setDisplayMode()" function in
|
||||
// libraries/display_tbl.lib.php
|
||||
// libraries/DisplayResults.class.php
|
||||
$disp_mode = 'urdr111101';
|
||||
}
|
||||
|
||||
@ -1063,7 +1071,7 @@ $(makeProfilingChart);
|
||||
$message->display();
|
||||
}
|
||||
|
||||
echo PMA_getTable($result, $disp_mode, $analyzed_sql);
|
||||
echo $displayResultsObject->getTable($result, $disp_mode, $analyzed_sql);
|
||||
PMA_DBI_free_result($result);
|
||||
|
||||
// BEGIN INDEX CHECK See if indexes should be checked.
|
||||
@ -1123,7 +1131,7 @@ $(makeProfilingChart);
|
||||
|
||||
// Do print the page if required
|
||||
if (isset($printview) && $printview == '1') {
|
||||
PMA_printButton();
|
||||
echo PMA_getButton();
|
||||
} // end print case
|
||||
|
||||
if ($GLOBALS['is_ajax_request'] != true) {
|
||||
|
||||
@ -186,8 +186,8 @@ $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;
|
||||
$columns_cnt = count($table_fields);
|
||||
$timestamp_seen = false;
|
||||
$columns_cnt = count($table_fields);
|
||||
|
||||
$tabindex = 0;
|
||||
$tabindex_for_function = +3000;
|
||||
|
||||
@ -469,7 +469,7 @@ foreach ($the_tables as $key => $table) {
|
||||
/**
|
||||
* Displays the footer
|
||||
*/
|
||||
PMA_printButton();
|
||||
echo PMA_getButton();
|
||||
|
||||
echo "<div id='PMA_disable_floating_menubar'></div>\n";
|
||||
?>
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* manipulation of table data like inserting, replacing and updating
|
||||
* Manipulation of table data like inserting, replacing and updating
|
||||
*
|
||||
* usally called as form action from tbl_change.php to insert or update table rows
|
||||
* Usally called as form action from tbl_change.php to insert or update table rows
|
||||
*
|
||||
* @todo 'edit_next' tends to not work as expected if used ...
|
||||
* at least there is no order by it needs the original query
|
||||
* and the row number and than replace the LIMIT clause
|
||||
*
|
||||
* @todo 'edit_next' tends to not work as expected if used ... at least there is no order by
|
||||
* it needs the original query and the row number and than replace the LIMIT clause
|
||||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
@ -214,8 +215,8 @@ foreach ($loop_array as $rownumber => $where_clause) {
|
||||
$query[] = 'UPDATE ' . PMA_backquote($GLOBALS['db']) . '.'
|
||||
. PMA_backquote($GLOBALS['table'])
|
||||
. ' SET ' . implode(', ', $query_values)
|
||||
. ' WHERE ' . $where_clause . ($_REQUEST['clause_is_unique'] ? '' : ' LIMIT 1');
|
||||
|
||||
. ' WHERE ' . $where_clause
|
||||
. ($_REQUEST['clause_is_unique'] ? '' : ' LIMIT 1');
|
||||
}
|
||||
}
|
||||
} // end foreach ($loop_array as $where_clause)
|
||||
@ -224,7 +225,6 @@ unset($multi_edit_columns_name, $multi_edit_columns_prev, $multi_edit_funcs,
|
||||
$multi_edit_auto_increment, $current_value_as_an_array, $key, $current_value,
|
||||
$loop_array, $where_clause, $using_key, $multi_edit_columns_null_prev);
|
||||
|
||||
|
||||
// Builds the sql query
|
||||
if ($is_insert && count($value_sets) > 0) {
|
||||
$query = PMA_buildSqlQuery($is_insertignore, $query_fields, $value_sets);
|
||||
@ -262,7 +262,10 @@ if (! empty($error_messages)) {
|
||||
$message->addMessages($error_messages);
|
||||
$message->isError(true);
|
||||
}
|
||||
unset($error_messages, $warning_messages, $total_affected_rows, $last_messages, $last_message);
|
||||
unset(
|
||||
$error_messages, $warning_messages, $total_affected_rows,
|
||||
$last_messages, $last_message
|
||||
);
|
||||
|
||||
if ($response->isAjax()) {
|
||||
/**
|
||||
@ -270,7 +273,7 @@ if ($response->isAjax()) {
|
||||
* transformed fields, if they were edited. After that, output the correct
|
||||
* link/transformed value and exit
|
||||
*
|
||||
* Logic taken from libraries/display_tbl.lib.php
|
||||
* Logic taken from libraries/DisplayResults.class.php
|
||||
*/
|
||||
|
||||
if (isset($_REQUEST['rel_fields_list']) && $_REQUEST['rel_fields_list'] != '') {
|
||||
@ -294,8 +297,9 @@ if ($response->isAjax()) {
|
||||
}
|
||||
} // end of loop for each relation cell
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['do_transformations']) && $_REQUEST['do_transformations'] == true ) {
|
||||
if (isset($_REQUEST['do_transformations'])
|
||||
&& $_REQUEST['do_transformations'] == true
|
||||
) {
|
||||
include_once 'libraries/transformations.lib.php';
|
||||
//if some posted fields need to be transformed, generate them here.
|
||||
$mime_map = PMA_getMIME($db, $table);
|
||||
@ -303,7 +307,6 @@ if ($response->isAjax()) {
|
||||
if ($mime_map === false) {
|
||||
$mime_map = array();
|
||||
}
|
||||
|
||||
$edited_values = array();
|
||||
parse_str($_REQUEST['transform_fields_list'], $edited_values);
|
||||
|
||||
|
||||
@ -265,7 +265,9 @@ class PMA_GIS_GeometryTest extends PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function providerForTestGetBoundsForOl() {
|
||||
public function providerForTestGetBoundsForOl()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
4326,
|
||||
@ -273,12 +275,12 @@ class PMA_GIS_GeometryTest extends PHPUnit_Framework_TestCase
|
||||
'minX' => '0',
|
||||
'minY' => '0',
|
||||
'maxX' => '1',
|
||||
'maxY' => '1'
|
||||
'maxY' => '1',
|
||||
),
|
||||
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));'
|
||||
),
|
||||
);
|
||||
)
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -290,6 +292,7 @@ class PMA_GIS_GeometryTest extends PHPUnit_Framework_TestCase
|
||||
*@dataProvider providerForTestGetPolygonArrayForOpenLayers
|
||||
*/
|
||||
public function testGetPolygonArrayForOpenLayers($polygons, $srid, $output){
|
||||
|
||||
$this->assertEquals(
|
||||
$this->_callProtectedFunction(
|
||||
'getPolygonArrayForOpenLayers',
|
||||
@ -302,12 +305,14 @@ class PMA_GIS_GeometryTest extends PHPUnit_Framework_TestCase
|
||||
public function providerForTestGetPolygonArrayForOpenLayers(){
|
||||
|
||||
return array(
|
||||
|
||||
array(
|
||||
array('Triangle'),
|
||||
4326,
|
||||
'new Array(new OpenLayers.Geometry.Polygon(new Array(new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(,)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))))'
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
310
test/classes/gis/PMA_GIS_Geometrycollection_test.php
Normal file
310
test/classes/gis/PMA_GIS_Geometrycollection_test.php
Normal file
@ -0,0 +1,310 @@
|
||||
<?php
|
||||
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for PMA_GIS_Geometry
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
require_once 'libraries/gis/pma_gis_geometry.php';
|
||||
require_once 'libraries/gis/pma_gis_geometrycollection.php';
|
||||
require_once 'libraries/gis/pma_gis_factory.php';
|
||||
require_once 'libraries/tcpdf/tcpdf.php';
|
||||
|
||||
/**
|
||||
* Tests for PMA_GIS_Geometrycollection class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class PMA_GIS_Geometrycollection_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @access protected
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* Sets up the fixture, for example, opens a network connection.
|
||||
* This method is called before a test is executed.
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = PMA_GIS_Geometrycollection::singleton();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tears down the fixture, for example, closes a network connection.
|
||||
* This method is called after a test is executed.
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
unset($this->object);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
*
|
||||
* @dataProvider providerForScaleRow
|
||||
*/
|
||||
public function testScaleRow($spatial, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->scaleRow($spatial), $output);
|
||||
}
|
||||
|
||||
public function providerForScaleRow()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
'GEOMETRYCOLLECTION(POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 32,30 20,20 30)))',
|
||||
Array(
|
||||
'maxX' => 45.0,
|
||||
'minX' => 10.0,
|
||||
'maxY' => 45.0,
|
||||
'minY' => 10.0
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $gis_data
|
||||
* @param type $index
|
||||
* @param string $empty
|
||||
* @param type $output
|
||||
*
|
||||
* @dataProvider providerForGenerateWkt
|
||||
*/
|
||||
public function testGenerateWkt($gis_data, $index, $empty, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->generateWkt($gis_data, $index, $empty = ''), $output);
|
||||
}
|
||||
|
||||
public function providerForGenerateWkt()
|
||||
{
|
||||
|
||||
$temp1 = array(
|
||||
0 => array(
|
||||
'gis_type' => 'LINESTRING',
|
||||
'LINESTRING' => array(
|
||||
'no_of_points' => 2,
|
||||
0 => array('x' => 5.02, 'y' => 8.45),
|
||||
1 => array('x' => 6.14, 'y' => 0.15)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
return array(
|
||||
array(
|
||||
$temp1,
|
||||
0,
|
||||
null,
|
||||
'GEOMETRYCOLLECTION(LINESTRING(5.02 8.45,6.14 0.15))'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @param $output
|
||||
*
|
||||
* @dataProvider providerForGenerateParams
|
||||
*/
|
||||
public function testGenerateParams($value, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->generateParams($value), $output);
|
||||
}
|
||||
|
||||
public function providerForGenerateParams()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
'GEOMETRYCOLLECTION(LINESTRING(5.02 8.45,6.14 0.15))',
|
||||
array(
|
||||
'srid' => 0,
|
||||
'GEOMETRYCOLLECTION' => Array('geom_count' => 1),
|
||||
|
||||
'0' => Array(
|
||||
'gis_type' => 'LINESTRING',
|
||||
'LINESTRING' => Array(
|
||||
'no_of_points' => 2,
|
||||
'0' => Array(
|
||||
'x' => 5.02,
|
||||
'y' => 8.45
|
||||
),
|
||||
'1' => Array(
|
||||
'x' => 6.14,
|
||||
'y' => 0.15
|
||||
)
|
||||
)
|
||||
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $image
|
||||
* @param type $output
|
||||
*
|
||||
* @dataProvider providerForPrepareRowAsPng
|
||||
*/
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image);
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsPng()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
'GEOMETRYCOLLECTION(POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 32,30 20,20 30)))',
|
||||
'image',
|
||||
'#B02EE0',
|
||||
array(
|
||||
'x' => 12,
|
||||
'y' => 69,
|
||||
'scale' => 2,
|
||||
'height' => 150
|
||||
),
|
||||
imagecreatetruecolor('120', '150'),
|
||||
''
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $pdf
|
||||
*
|
||||
* @dataProvider providerForPrepareRowAsPdf
|
||||
*/
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf);
|
||||
$this->assertTrue($return instanceof TCPDF);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsPdf()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
'GEOMETRYCOLLECTION(POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 32,30 20,20 30)))',
|
||||
'pdf',
|
||||
'#B02EE0',
|
||||
array(
|
||||
'x' => 12,
|
||||
'y' => 69,
|
||||
'scale' => 2,
|
||||
'height' => 150
|
||||
),
|
||||
new TCPDF(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
* @dataProvider providerForPrepareRowAsSvg
|
||||
*/
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$string = $this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data);
|
||||
$this->assertEquals(1, preg_match($output, $string));
|
||||
// $this->assertEquals($this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsSvg()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
'GEOMETRYCOLLECTION(POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 32,30 20,20 30)))',
|
||||
'svg',
|
||||
'#B02EE0',
|
||||
array(
|
||||
'x' => 12,
|
||||
'y' => 69,
|
||||
'scale' => 2,
|
||||
'height' => 150
|
||||
),
|
||||
'/^(<path d=" M 46, 268 L -4, 248 L 6, 208 L 66, 198 Z M 16, 228 L 46, 224 L 36, 248 Z " name="svg" id="svg)(\d+)(" class="polygon vector" stroke="black" stroke-width="0.5" fill="#B02EE0" fill-rule="evenodd" fill-opacity="0.8"\/>)$/'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $srid
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
* @dataProvider providerForPrepareRowAsOl
|
||||
*/
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->prepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data), $output);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsOl()
|
||||
{
|
||||
|
||||
return array(
|
||||
array(
|
||||
'GEOMETRYCOLLECTION(POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 32,30 20,20 30)))',
|
||||
4326,
|
||||
'Ol',
|
||||
'#B02EE0',
|
||||
array(
|
||||
'minX' => '0',
|
||||
'minY' => '0',
|
||||
'maxX' => '1',
|
||||
'maxY' => '1',
|
||||
),
|
||||
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(new Array(new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(35,10)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(10,20)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(15,40)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(45,45)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(35,10)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))), new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(20,30)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(35,32)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(30,20)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(20,30)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))), null, {"strokeColor":"#000000","strokeWidth":0.5,"fillColor":"#B02EE0","fillOpacity":0.8,"label":"Ol","fontSize":10}));'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@ -9,6 +9,7 @@
|
||||
require_once 'PMA_GIS_Geom_test.php';
|
||||
require_once 'libraries/gis/pma_gis_geometry.php';
|
||||
require_once 'libraries/gis/pma_gis_linestring.php';
|
||||
require_once 'libraries/tcpdf/tcpdf.php';
|
||||
|
||||
/**
|
||||
* Tests for PMA_GIS_Linestring class
|
||||
@ -161,5 +162,150 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $image
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPng
|
||||
*/
|
||||
public function testPrepareRowAsPng($spatial, $label, $line_color, $scale_data, $image, $output)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPng($spatial, $label, $line_color, $scale_data, $image);
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsPng(){
|
||||
|
||||
return array(
|
||||
array(
|
||||
'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
'image',
|
||||
'#B02EE0',
|
||||
array(
|
||||
'x' => 12,
|
||||
'y' => 69,
|
||||
'scale' => 2,
|
||||
'height' => 150
|
||||
),
|
||||
imagecreatetruecolor('120','150'),
|
||||
''
|
||||
)
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $pdf
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsPdf
|
||||
*/
|
||||
public function testPrepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
|
||||
{
|
||||
|
||||
$return = $this->object->prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf);
|
||||
$this->assertTrue($return instanceof TCPDF);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsPdf(){
|
||||
|
||||
return array(
|
||||
array(
|
||||
'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
'pdf',
|
||||
'#B02EE0',
|
||||
array(
|
||||
'x' => 12,
|
||||
'y' => 69,
|
||||
'scale' => 2,
|
||||
'height' => 150
|
||||
),
|
||||
new TCPDF(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsSvg
|
||||
*/
|
||||
public function testPrepareRowAsSvg($spatial, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$string = $this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data);
|
||||
$this->assertEquals(1, preg_match($output, $string));
|
||||
//$this->assertEquals($this->object->prepareRowAsSvg($spatial, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsSvg(){
|
||||
|
||||
return array(
|
||||
array(
|
||||
'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
'svg',
|
||||
'#B02EE0',
|
||||
array(
|
||||
'x' => 12,
|
||||
'y' => 69,
|
||||
'scale' => 2,
|
||||
'height' => 150
|
||||
),
|
||||
'/^(<polyline points="0,218 72,138 114,242 26,198 4,182 46,132 " name="svg" id="svg)(\d+)(" class="linestring vector" fill="none" stroke="#B02EE0" stroke-width="2"\/>)$/'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param type $spatial
|
||||
* @param type $srid
|
||||
* @param type $label
|
||||
* @param type $line_color
|
||||
* @param type $scale_data
|
||||
* @param type $output
|
||||
*
|
||||
*@dataProvider providerForPrepareRowAsOl
|
||||
*/
|
||||
public function testPrepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data, $output)
|
||||
{
|
||||
|
||||
$this->assertEquals($this->object->prepareRowAsOl($spatial, $srid, $label, $line_color, $scale_data) , $output);
|
||||
}
|
||||
|
||||
public function providerForPrepareRowAsOl(){
|
||||
|
||||
return array(
|
||||
array(
|
||||
'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
4326,
|
||||
'Ol',
|
||||
'#B02EE0',
|
||||
array(
|
||||
'minX' => '0',
|
||||
'minY' => '0',
|
||||
'maxX' => '1',
|
||||
'maxY' => '1',
|
||||
),
|
||||
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(new Array((new OpenLayers.Geometry.Point(12,35)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(48,75)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(69,23)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(25,45)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(14,53)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(35,78)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))), null, {"strokeColor":"#B02EE0","strokeWidth":2,"label":"Ol","fontSize":10}));'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user