Merge #15917 - Fix #15810 - Unexpected Modal Heading

Pull-request: #15917
Fixes: #15810

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2020-02-22 20:15:47 +01:00
commit e296b590f2
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
11 changed files with 19 additions and 5 deletions

View File

@ -339,7 +339,9 @@ RTE.COMMON = {
minWidth: 500,
maxHeight: $(window).height(),
buttons: that.buttonOptions,
title: data.title,
// Issue #15810 - use button titles for modals (eg: new procedure)
// Respect the order: title on href tag, href content, title sent in response
title: $this.attr('title') || $this.text() || $(data.title).text(),
modal: true,
open: function () {
if ($('#rteDialog').parents('.ui-dialog').height() > $(window).height()) {

View File

@ -1193,7 +1193,7 @@ class NavigationTree
$args[] = urlencode($parent->realName);
}
$link = vsprintf($node->links['text'], $args);
$title = isset($node->links['title']) ? $node->links['title'] : '';
$title = isset($node->links['title']) ? $node->links['title'] : $node->title ?? '';
if ($node->type == Node::CONTAINER) {
$retval .= "&nbsp;<a class='hover_show_full' href='$link'>";
$retval .= htmlspecialchars($node->name);

View File

@ -41,6 +41,7 @@ class NodeColumnContainer extends Node
);
$new->isNew = true;
$new->icon = Util::getImage('b_column_add', $newLabel);
$new->title = $newLabel;
$new->links = [
'text' => 'tbl_addfield.php?server=' . $GLOBALS['server']
. '&amp;db=%3$s&amp;table=%2$s'

View File

@ -35,12 +35,14 @@ class NodeDatabaseContainer extends Node
if ($GLOBALS['is_create_db_priv']
&& $GLOBALS['cfg']['ShowCreateDb'] !== false
) {
$newLabel = _pgettext('Create new database', 'New');
$new = NodeFactory::getInstance(
'Node',
_pgettext('Create new database', 'New')
$newLabel
);
$new->isNew = true;
$new->icon = Util::getImage('b_newdb', '');
$new->title = $newLabel;
$new->links = [
'text' => 'server_databases.php?server=' . $GLOBALS['server'],
'icon' => 'server_databases.php?server=' . $GLOBALS['server'],

View File

@ -34,12 +34,14 @@ class NodeEventContainer extends NodeDatabaseChildContainer
];
$this->realName = 'events';
$newLabel = _pgettext('Create new event', 'New');
$new = NodeFactory::getInstance(
'Node',
_pgettext('Create new event', 'New')
$newLabel
);
$new->isNew = true;
$new->icon = Util::getImage('b_event_add', '');
$new->title = $newLabel;
$new->links = [
'text' => 'db_events.php?server=' . $GLOBALS['server']
. '&amp;db=%2$s&add_item=1',

View File

@ -41,6 +41,7 @@ class NodeFunctionContainer extends NodeDatabaseChildContainer
);
$new->isNew = true;
$new->icon = Util::getImage('b_routine_add', $newLabel);
$new->title = $newLabel;
$new->links = [
'text' => 'db_routines.php?server=' . $GLOBALS['server']
. '&amp;db=%2$s&add_item=1&amp;item_type=FUNCTION',

View File

@ -41,6 +41,7 @@ class NodeIndexContainer extends Node
);
$new->isNew = true;
$new->icon = Util::getImage('b_index_add', $newLabel);
$new->title = $newLabel;
$new->links = [
'text' => 'tbl_indexes.php?server=' . $GLOBALS['server']
. '&amp;create_index=1&amp;added_fields=2'

View File

@ -41,6 +41,7 @@ class NodeProcedureContainer extends NodeDatabaseChildContainer
);
$new->isNew = true;
$new->icon = Util::getImage('b_routine_add', $newLabel);
$new->title = $newLabel;
$new->links = [
'text' => 'db_routines.php?server=' . $GLOBALS['server']
. '&amp;db=%2$s&add_item=1',

View File

@ -42,6 +42,7 @@ class NodeTableContainer extends NodeDatabaseChildContainer
);
$new->isNew = true;
$new->icon = Util::getImage('b_table_add', $newLabel);
$new->title = $newLabel;
$new->links = [
'text' => 'tbl_create.php?server=' . $GLOBALS['server']
. '&amp;db=%2$s',

View File

@ -34,12 +34,14 @@ class NodeTriggerContainer extends Node
];
$this->realName = 'triggers';
$newLabel = _pgettext('Create new trigger', 'New');
$new = NodeFactory::getInstance(
'Node',
_pgettext('Create new trigger', 'New')
$newLabel
);
$new->isNew = true;
$new->icon = Util::getImage('b_trigger_add', '');
$new->title = $newLabel;
$new->links = [
'text' => 'db_triggers.php?server=' . $GLOBALS['server']
. '&amp;db=%3$s&amp;add_item=1',

View File

@ -42,6 +42,7 @@ class NodeViewContainer extends NodeDatabaseChildContainer
);
$new->isNew = true;
$new->icon = Util::getImage('b_view_add', $newLabel);
$new->title = $newLabel;
$new->links = [
'text' => 'view_create.php?server=' . $GLOBALS['server']
. '&amp;db=%2$s',