MDL-86800 tool_xmldb: Fix incorrect table borders

This commit is contained in:
Mihail Geshoski
2025-10-01 11:08:30 +08:00
parent a623714cdf
commit e5fc010f84
18 changed files with 25 additions and 25 deletions
@@ -93,7 +93,7 @@ abstract class XMLDBCheckAction extends XMLDBAction {
$o = '<table class="table generaltable" border="0" cellpadding="5" cellspacing="0" id="notice">';
$o.= ' <tr><td class="generalboxcontent">';
$o.= ' <p class="centerpara">' . $this->str[$this->introstr] . '</p>';
$o.= ' <table class="boxaligncenter" cellpadding="20"><tr><td>';
$o .= ' <table class="table-reboot w-100" cellpadding="20"><tr><td class="text-end">';
$o.= ' <div class="singlebutton">';
$o.= ' <form action="index.php?action=' . $this->title . '&amp;confirmed=yes&amp;sesskey=' . sesskey() . '" method="post"><fieldset class="invisiblefieldset">';
$o.= ' <input type="submit" value="'. $this->str['yes'] .'" /></fieldset></form></div>';
@@ -76,7 +76,7 @@ class delete_field extends XMLDBAction {
$o = '<table width="60" class="table generaltable" border="0" cellpadding="5" cellspacing="0" id="notice">';
$o.= ' <tr><td class="generalboxcontent">';
$o.= ' <p class="centerpara">' . $this->str['confirmdeletefield'] . '<br /><br />' . $fieldparam . '</p>';
$o.= ' <table class="boxaligncenter" cellpadding="20"><tr><td>';
$o .= ' <table class="table-reboot w-100" cellpadding="20"><tr><td class="text-end">';
$o.= ' <div class="singlebutton">';
$o.= ' <form action="index.php?action=delete_field&amp;sesskey=' . sesskey() . '&amp;confirmed=yes&amp;postaction=edit_table&amp;field=' . $fieldparam . '&amp;table=' . $tableparam . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '" method="post"><fieldset class="invisiblefieldset">';
$o.= ' <input type="submit" value="'. $this->str['yes'] .'" /></fieldset></form></div>';
@@ -76,7 +76,7 @@ class delete_index extends XMLDBAction {
$o = '<table width="60" class="table generaltable" border="0" cellpadding="5" cellspacing="0" id="notice">';
$o.= ' <tr><td class="generalboxcontent">';
$o.= ' <p class="centerpara">' . $this->str['confirmdeleteindex'] . '<br /><br />' . $indexparam . '</p>';
$o.= ' <table class="boxaligncenter" cellpadding="20"><tr><td>';
$o .= ' <table class="table-reboot w-100" cellpadding="20"><tr><td class="text-end">';
$o.= ' <div class="singlebutton">';
$o.= ' <form action="index.php?action=delete_index&amp;sesskey=' . sesskey() . '&amp;confirmed=yes&amp;postaction=edit_table&amp;index=' . $indexparam . '&amp;table=' . $tableparam . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '" method="post"><fieldset class="invisiblefieldset">';
$o.= ' <input type="submit" value="'. $this->str['yes'] .'" /></fieldset></form></div>';
@@ -76,7 +76,7 @@ class delete_key extends XMLDBAction {
$o = '<table width="60" class="table generaltable" border="0" cellpadding="5" cellspacing="0" id="notice">';
$o.= ' <tr><td class="generalboxcontent">';
$o.= ' <p class="centerpara">' . $this->str['confirmdeletekey'] . '<br /><br />' . $keyparam . '</p>';
$o.= ' <table class="boxaligncenter" cellpadding="20"><tr><td>';
$o .= ' <table class="table-reboot w-100" cellpadding="20"><tr><td class="text-end">';
$o.= ' <div class="singlebutton">';
$o.= ' <form action="index.php?action=delete_key&amp;sesskey=' . sesskey() . '&amp;confirmed=yes&amp;postaction=edit_table&amp;key=' . $keyparam . '&amp;table=' . $tableparam . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '" method="post"><fieldset class="invisiblefieldset">';
$o.= ' <input type="submit" value="'. $this->str['yes'] .'" /></fieldset></form></div>';
@@ -75,7 +75,7 @@ class delete_table extends XMLDBAction {
$o = '<table width="60" class="table generaltable" border="0" cellpadding="5" cellspacing="0" id="notice">';
$o.= ' <tr><td class="generalboxcontent">';
$o.= ' <p class="centerpara">' . $this->str['confirmdeletetable'] . '<br /><br />' . $tableparam . '</p>';
$o.= ' <table class="boxaligncenter" cellpadding="20"><tr><td>';
$o .= ' <table class="table-reboot w-100" cellpadding="20"><tr><td class="text-end">';
$o.= ' <div class="singlebutton">';
$o.= ' <form action="index.php?action=delete_table&amp;sesskey=' . sesskey() . '&amp;confirmed=yes&amp;postaction=edit_xml_file&amp;table=' . $tableparam . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '" method="post"><fieldset class="invisiblefieldset">';
$o.= ' <input type="submit" value="'. $this->str['yes'] .'" /></fieldset></form></div>';
@@ -74,7 +74,7 @@ class delete_xml_file extends XMLDBAction {
$o = '<table width="60" class="table generaltable" border="0" cellpadding="5" cellspacing="0" id="notice">';
$o.= ' <tr><td class="generalboxcontent">';
$o.= ' <p class="centerpara">' . $this->str['confirmdeletexmlfile'] . '<br /><br />' . $dirpath . '/install.php</p>';
$o.= ' <table class="boxaligncenter" cellpadding="20"><tr><td>';
$o .= ' <table class="table-reboot w-100" cellpadding="20"><tr><td class="text-end">';
$o.= ' <div class="singlebutton">';
$o.= ' <form action="index.php?action=delete_xml_file&amp;sesskey=' . sesskey() . '&amp;confirmed=yes&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '&amp;postaction=main_view#lastused" method="post"><fieldset class="invisiblefieldset">';
$o.= ' <input type="submit" value="'. $this->str['yes'] .'" /></fieldset></form></div>';
@@ -114,7 +114,7 @@ class edit_field extends XMLDBAction {
$o.= ' <input type="hidden" name ="sesskey" value="' . sesskey() .'" />';
$o.= ' <input type="hidden" name ="action" value="edit_field_save" />';
$o.= ' <input type="hidden" name ="postaction" value="edit_table" />';
$o.= ' <table id="formelements" class="boxaligncenter">';
$o .= ' <table id="formelements" class="table-reboot">';
// XMLDB field name
// If the field has dependencies, we cannot change its name
$disabled = '';
@@ -106,7 +106,7 @@ class edit_index extends XMLDBAction {
$o.= ' <input type="hidden" name ="sesskey" value="' . sesskey() .'" />';
$o.= ' <input type="hidden" name ="action" value="edit_index_save" />';
$o.= ' <input type="hidden" name ="postaction" value="edit_table" />';
$o.= ' <table id="formelements" class="boxaligncenter">';
$o .= ' <table id="formelements" class="table-reboot">';
// XMLDB index name
// If the index has dependencies, we cannot change its name
$disabled = '';
@@ -106,7 +106,7 @@ class edit_key extends XMLDBAction {
$o.= ' <input type="hidden" name ="sesskey" value="' . sesskey() .'" />';
$o.= ' <input type="hidden" name ="action" value="edit_key_save" />';
$o.= ' <input type="hidden" name ="postaction" value="edit_table" />';
$o.= ' <table id="formelements" class="boxaligncenter">';
$o .= ' <table id="formelements" class="table-reboot">';
// XMLDB key name
// If the key has dependencies, we cannot change its name
$disabled = '';
@@ -126,7 +126,7 @@ class edit_table extends XMLDBAction {
$o.= ' <input type="hidden" name ="action" value="edit_table_save" />';
$o.= ' <input type="hidden" name ="sesskey" value="' . sesskey() .'" />';
$o.= ' <input type="hidden" name ="postaction" value="edit_table" />';
$o .= ' <table id="formelements">';
$o .= ' <table id="formelements" class="table-reboot">';
// If the table is being used, we cannot rename it
if ($structure->getTableUses($table->getName())) {
$o.= ' <tr valign="top"><td>Name:</td><td><input type="hidden" name ="name" value="' . s($table->getName()) . '" />' . s($table->getName()) .'</td></tr>';
@@ -208,7 +208,7 @@ class edit_table extends XMLDBAction {
$fields = $table->getFields();
if (!empty($fields)) {
$o .= '<h3 class="main">' . $this->str['fields'] . '</h3>';
$o .= '<table id="listfields" border="0" cellpadding="5" cellspacing="1" class="boxaligncenter flexible">';
$o .= '<table id="listfields" border="0" cellpadding="5" cellspacing="1" class="table-reboot flexible">';
$row = 0;
foreach ($fields as $field) {
// Drag element up/down.
@@ -259,7 +259,7 @@ class edit_table extends XMLDBAction {
$keys = $table->getKeys();
if (!empty($keys)) {
$o .= '<h3 class="main">' . $this->str['keys'] . '</h3>';
$o .= '<table id="listkeys" border="0" cellpadding="5" cellspacing="1" class="boxaligncenter flexible">';
$o .= '<table id="listkeys" border="0" cellpadding="5" cellspacing="1" class="table-reboot flexible">';
$row = 0;
foreach ($keys as $key) {
// Drag element up/down.
@@ -305,7 +305,7 @@ class edit_table extends XMLDBAction {
$indexes = $table->getIndexes();
if (!empty($indexes)) {
$o .= '<h3 class="main">' . $this->str['indexes'] . '</h3>';
$o .= '<table id="listindexes" border="0" cellpadding="5" cellspacing="1" class="boxaligncenter flexible">';
$o .= '<table id="listindexes" border="0" cellpadding="5" cellspacing="1" class="table-reboot flexible">';
$row = 0;
foreach ($indexes as $index) {
// Drag element up/down.
@@ -116,7 +116,7 @@ class edit_xml_file extends XMLDBAction {
$o.= ' <input type="hidden" name ="path" value="' . s($structure->getPath()) .'" />';
$o.= ' <input type="hidden" name ="version" value="' . s($structure->getVersion()) .'" />';
$o.= ' <input type="hidden" name ="sesskey" value="' . sesskey() .'" />';
$o .= ' <table id="formelements">';
$o .= ' <table id="formelements" class="table-reboot">';
$o.= ' <tr valign="top"><td>Path:</td><td>' . s($structure->getPath()) . '</td></tr>';
$o.= ' <tr valign="top"><td>Version:</td><td>' . s($structure->getVersion()) . '</td></tr>';
$o .= ' <tr valign="top"><td><label for="comment" accesskey="c">Comment:</label></td><td>
@@ -179,7 +179,7 @@ class edit_xml_file extends XMLDBAction {
$tables = $structure->getTables();
if ($tables) {
$o .= '<h3 class="main">' . $this->str['tables'] . '</h3>';
$o .= '<table id="listtables" border="0" cellpadding="5" cellspacing="1" class="boxaligncenter flexible">';
$o .= '<table id="listtables" border="0" cellpadding="5" cellspacing="1" class="table-reboot flexible">';
$row = 0;
foreach ($tables as $table) {
// Drag element for sortorder.
@@ -115,7 +115,7 @@ class new_table_from_mysql extends XMLDBAction {
$o.= ' <input type="hidden" name ="action" value="new_table_from_mysql" />';
$o.= ' <input type="hidden" name ="postaction" value="edit_table" />';
$o.= ' <input type="hidden" name ="sesskey" value="' . sesskey() . '" />';
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
$o .= ' <table id="formelements" class="table-reboot" cellpadding="5">';
$o.= ' <tr><td><label for="menutable" accesskey="t">' . $this->str['createtable'] .' </label>' . html_writer::select($selecttables, 'table') . '<label for="menuafter" accesskey="a">' . $this->str['aftertable'] . ' </label>' .html_writer::select($aftertables, 'after') . '</td></tr>';
$o.= ' <tr><td colspan="2" align="center"><input type="submit" value="' .$this->str['create'] . '" /></td></tr>';
$o.= ' <tr><td colspan="2" align="center"><a href="index.php?action=edit_xml_file&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['back'] . ']</a></td></tr>';
@@ -74,7 +74,7 @@ class revert_changes extends XMLDBAction {
$o = '<table width="60" class="table generaltable" border="0" cellpadding="5" cellspacing="0" id="notice">';
$o.= ' <tr><td class="generalboxcontent">';
$o.= ' <p class="centerpara">' . $this->str['confirmrevertchanges'] . '<br /><br />' . $dirpath . '</p>';
$o.= ' <table class="boxaligncenter" cellpadding="20"><tr><td>';
$o .= ' <table class="table-reboot w-100" cellpadding="20"><tr><td class="text-end">';
$o.= ' <div class="singlebutton">';
$o.= ' <form action="index.php?action=revert_changes&amp;sesskey=' . sesskey() . '&amp;confirmed=yes&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '&amp;postaction=main_view#lastused" method="post"><fieldset class="invisiblefieldset">';
$o.= ' <input type="submit" value="'. $this->str['yes'] .'" /></fieldset></form></div>';
@@ -103,7 +103,7 @@ class view_reserved_words extends XMLDBAction {
// The list of currently wrong field names
if ($wronguses) {
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
$o .= ' <table id="formelements" class="boxaligncenter table-reboot" cellpadding="5">';
$o.= ' <tr><td align="center"><font color="red">' . $this->str['wrongreservedwords'] . '</font></td></tr>';
$o.= ' <tr><td>';
$o.= ' <ul><li>' . implode('</li><li>', $wronguses) . '</li></ul>';
@@ -112,7 +112,7 @@ class view_reserved_words extends XMLDBAction {
}
// The textarea showing all the reserved words
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
$o .= ' <table id="formelements" class="boxaligncenter table-reboot" cellpadding="5">';
$o.= ' <tr><td align="center">' . $this->str['listreservedwords'].'</td></tr>';
$o .= ' <tr><td><textarea cols="80" rows="32" class="form-control">';
$o.= s(implode(', ', array_keys($reserved_words)));
@@ -113,12 +113,12 @@ class view_structure_php extends XMLDBAction {
$o.='<div>';
$o.= ' <input type="hidden" name ="dir" value="' . str_replace($CFG->dirroot, '', $dirpath) . '" />';
$o.= ' <input type="hidden" name ="action" value="view_structure_php" />';
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
$o .= ' <table id="formelements" class="table-reboot" cellpadding="5">';
$o.= ' <tr><td><label for="menucommand" accesskey="c">' . $this->str['selectaction'] .' </label>' . html_writer::select($popcommands, 'command', $commandparam, false) . '&nbsp;<label for="menutable" accesskey="t">' . $this->str['selecttable'] . ' </label>' .html_writer::select($poptables, 'table', $tableparam, false) . '</td></tr>';
$o.= ' <tr><td colspan="2" align="center"><input type="submit" value="' .$this->str['view'] . '" /></td></tr>';
$o.= ' </table>';
$o.= '</div></form>';
$o.= ' <table id="phpcode" class="boxaligncenter" cellpadding="5">';
$o .= ' <table id="phpcode" class="table-reboot" cellpadding="5">';
$o .= ' <tr><td><textarea cols="80" rows="32" class="form-control">';
// Based on current params, call the needed function
switch ($commandparam) {
@@ -85,7 +85,7 @@ class view_structure_sql extends XMLDBAction {
$b .= '</p>';
$o = $b;
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
$o .= ' <table id="formelements" class="table-reboot" cellpadding="5">';
$o .= ' <tr><td><textarea cols="80" rows="32" class="form-control">';
// Get an array of statements
if ($starr = $DB->get_manager()->generator->getCreateStructureSQL($structure)) {
@@ -162,13 +162,13 @@ class view_table_php extends XMLDBAction {
$o.= ' <input type="hidden" name ="dir" value="' . str_replace($CFG->dirroot, '', $dirpath) . '" />';
$o.= ' <input type="hidden" name ="table" value="' . s($tableparam) . '" />';
$o.= ' <input type="hidden" name ="action" value="view_table_php" />';
$o .= ' <table id="formelements" cellpadding="5">';
$o .= ' <table id="formelements" class="table-reboot" cellpadding="5">';
$o.= ' <tr><td><label for="menucommand" accesskey="c">' . $this->str['selectaction'] .' </label>' . html_writer::select($popcommands, 'command', $commandparam, false) . '&nbsp;<label for="menufieldkeyindex" accesskey="f">' . $this->str['selectfieldkeyindex'] . ' </label>' .html_writer::select($popfields, 'fieldkeyindex', $origfieldkeyindexparam, false) . '</td></tr>';
$o.= ' <tr><td colspan="2" align="center"><input type="submit" value="' .$this->str['view'] . '" /></td></tr>';
$o.= ' </table>';
$o.= '</div></form>';
$o.= ' <table id="phpcode" class="boxaligncenter" cellpadding="5">';
$o .= ' <table id="phpcode" class="table-reboot" cellpadding="5">';
$o .= ' <tr><td><textarea cols="80" rows="32" class="form-control">';
// Check we have selected some field/key/index from the popup
if ($fieldkeyindexparam == 'fieldshead' || $fieldkeyindexparam == 'keyshead' || $fieldkeyindexparam == 'indexeshead') {
@@ -92,7 +92,7 @@ class view_table_sql extends XMLDBAction {
$b .= '</p>';
$o = $b;
$o.= ' <table id="formelements" class="boxaligncenter" cellpadding="5">';
$o .= ' <table id="formelements" class="table-reboot" cellpadding="5">';
$o .= ' <tr><td><textarea cols="80" rows="32" class="form-control">';
// Get an array of statements