]> git.mjollnir.org Git - moodle.git/commitdiff
Now SQL sentences are all together and with proper terminators.
authorstronk7 <stronk7>
Mon, 9 Jul 2007 18:03:47 +0000 (18:03 +0000)
committerstronk7 <stronk7>
Mon, 9 Jul 2007 18:03:47 +0000 (18:03 +0000)
Tested against MySQL, PostgreSQL and MSSQL. MDL-7357

admin/xmldb/actions/check_indexes/check_indexes.class.php

index 8ad40b12fd961d1a6866bd28c2e3c6e8971029b1..db2fcf0185a0081c1c9eab10fd2de2e95b00f07c 100644 (file)
@@ -222,6 +222,7 @@ class check_indexes extends XMLDBAction {
             }
 
         /// We have finished, let's show the results of the search
+            $s = '';
             $r = '<table class="generalbox boxaligncenter boxwidthwide" border="0" cellpadding="5" cellspacing="0" id="results">';
             $r.= '  <tr><td class="generalboxcontent">';
             $r.= '    <h2 class="main">' . $this->str['searchresults'] . '</h2>';
@@ -236,18 +237,21 @@ class check_indexes extends XMLDBAction {
                 foreach ($missing_indexes as $obj) {
                     $xmldb_table = $obj->table;
                     $xmldb_index = $obj->index;
-                    $sqlarr = $xmldb_table->getAddIndexSQL($CFG->dbtype, $CFG->prefix, $xmldb_index, false);
+                    $sqlarr = $xmldb_table->getAddIndexSQL($CFG->dbtype, $CFG->prefix, $xmldb_index, true);
                     $r.= '            <li>' . $this->str['table'] . ': ' . $xmldb_table->getName() . '. ' .
-                                              $this->str['index'] . ': ' . $xmldb_index->readableInfo() . '<br />' .
-                                              '<p><code>' . implode('<br />', $sqlarr) . '</code></p></li>';
+                                              $this->str['index'] . ': ' . $xmldb_index->readableInfo() . '</li>';
+                    $s.= '<code>' . str_replace("\n", '<br />', implode('<br />', $sqlarr)) . '</code><br />';
                     
                 }
                 $r.= '        </ul>';
+            /// Add the SQL statements (all together)
+                $r.= '<hr />' . $s;
             } else {
                 $r.= '    <p class="centerpara">' . $this->str['nomissingindexesfound'] . '</p>';
             }
             $r.= '  </td></tr>';
             $r.= '  <tr><td class="generalboxcontent">';
+        /// Add the complete log message
             $r.= '    <p class="centerpara">' . $this->str['completelogbelow'] . '</p>';
             $r.= '  </td></tr>';
             $r.= '</table>';