Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
authorDan
Sun, 25 Nov 2007 19:03:50 -0500
changeset 293 3f98d4ba1e33
parent 292 b3cfaf0a505c
child 294 4ab30e8dd168
Added OpenDocument MIME types and extensions; make sql_report page show total time taken for SQL queries
includes/constants.php
includes/dbal.php
--- a/includes/constants.php	Sun Nov 25 17:53:03 2007 -0500
+++ b/includes/constants.php	Sun Nov 25 19:03:50 2007 -0500
@@ -293,6 +293,22 @@
   'xwd'     => 'image/x-xwindowdump',
   'xyz'     => 'chemical/x-xyz',
   'zip'     => 'application/zip',
+  'odt' => 'application/vnd.oasis.opendocument.text',
+  'ott' => 'application/vnd.oasis.opendocument.text-template',
+  'odg' => 'application/vnd.oasis.opendocument.graphics',
+  'otg' => 'application/vnd.oasis.opendocument.graphics-template',
+  'odp' => 'application/vnd.oasis.opendocument.presentation',
+  'otp' => 'application/vnd.oasis.opendocument.presentation-template',
+  'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+  'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
+  'odc' => 'application/vnd.oasis.opendocument.chart',
+  'otc' => 'application/vnd.oasis.opendocument.chart-template',
+  'odi' => 'application/vnd.oasis.opendocument.image',
+  'oti' => 'application/vnd.oasis.opendocument.image-template',
+  'odf' => 'application/vnd.oasis.opendocument.formula',
+  'otf' => 'application/vnd.oasis.opendocument.formula-template',
+  'odm' => 'application/vnd.oasis.opendocument.text-master',
+  'oth' => 'application/vnd.oasis.opendocument.text-web'
 );
 
 $mimetype_extlist = Array(
@@ -415,6 +431,22 @@
   'x-conference/x-cooltalk'=>'ice',
   // Added for Enano
   'image/xcf' => 'xcf xcfbz2 xcf.bz2',
+  'application/vnd.oasis.opendocument.text' => 'odt',
+  'application/vnd.oasis.opendocument.text-template' => 'ott',
+  'application/vnd.oasis.opendocument.graphics' => 'odg',
+  'application/vnd.oasis.opendocument.graphics-template' => 'otg',
+  'application/vnd.oasis.opendocument.presentation' => 'odp',
+  'application/vnd.oasis.opendocument.presentation-template' => 'otp',
+  'application/vnd.oasis.opendocument.spreadsheet' => 'ods',
+  'application/vnd.oasis.opendocument.spreadsheet-template' => 'ots',
+  'application/vnd.oasis.opendocument.chart' => 'odc',
+  'application/vnd.oasis.opendocument.chart-template' => 'otc',
+  'application/vnd.oasis.opendocument.image' => 'odi',
+  'application/vnd.oasis.opendocument.image-template' => 'oti',
+  'application/vnd.oasis.opendocument.formula' => 'odf',
+  'application/vnd.oasis.opendocument.formula-template' => 'otf',
+  'application/vnd.oasis.opendocument.text-master' => 'odm',
+  'application/vnd.oasis.opendocument.text-web' => 'oth'
 );
 
 $k = array_keys($mime_types);
--- a/includes/dbal.php	Sun Nov 25 17:53:03 2007 -0500
+++ b/includes/dbal.php	Sun Nov 25 19:03:50 2007 -0500
@@ -773,6 +773,15 @@
               </tr>';
       }
     }
+    if ( function_exists('array_sum') )
+    {
+      $query_time_total = array_sum($this->query_times);
+      echo '<tr>
+              <th class="subhead" colspan="2">
+                Total time taken for SQL queries: ' . round( $query_time_total, 6 ) . ' seconds
+              </th>
+            </tr>';
+    }
     echo '  </table>
           </div>';
     $template->footer();