List:Commits« Previous MessageNext Message »
From:mcbrown Date:July 15 2008 2:22pm
Subject:svn commit - mysqldoc@docsrva: r11254 - trunk/tools/MySQL/DynXML
View as plain text  
Author: mcbrown
Date: 2008-07-15 16:22:35 +0200 (Tue, 15 Jul 2008)
New Revision: 11254

Log:
Fixing the way we create tables so that we don't get missing columns and headers



Modified:
   trunk/tools/MySQL/DynXML/Optvar.pm


Modified: trunk/tools/MySQL/DynXML/Optvar.pm
===================================================================
--- trunk/tools/MySQL/DynXML/Optvar.pm	2008-07-15 14:20:27 UTC (rev 11253)
+++ trunk/tools/MySQL/DynXML/Optvar.pm	2008-07-15 14:22:35 UTC (rev 11254)
Changed blocks: 4, Lines Added: 34, Lines Deleted: 40; 3899 bytes

@@ -1299,22 +1299,38 @@
 
     my $iodest = IO::String->new();
 
-    my ($title_name,$title_cmd_line,$title_option_file,$title_system_var,$title_status_var,$title_var_scope,$title_dynamic) 
-        = ($self->translate_phrase('name',$options->{lang}),
-           $self->translate_phrase('cmd-line',$options->{lang}),
-           $self->translate_phrase('option_file',$options->{lang}),
-           $self->translate_phrase('system_var',$options->{lang}),
-           $self->translate_phrase('status_var',$options->{lang}),
-           $self->translate_phrase('var_scope',$options->{lang}),
-           $self->translate_phrase('dynamic',$options->{lang}));
+    my $columns = {
+        'name' => 1,
+        'cmd-line' => 2,
+        'option_file' => 3,
+        'system_var' => 4,
+        'status_var' => 5,
+        'var_scope' => 6,
+        'dynamic' => 7,
+    };
 
+    my $col_titles = {};
+
+    foreach my $key (keys %{$columns})
+    {
+        $col_titles->{$key} = $self->translate_phrase($key,$options->{lang});
+    }
+
     my $colcount = 7;
 
-    $colcount = 6 if ((exists($options->{selectsystemvar}) &&
-                       $options->{selectsystemvar} eq 'yes'));
-    
-    $colcount = 5 if ((exists($options->{selectsessionvar}) &&
-                       $options->{selectsessionvar} eq 'yes'));
+    if ((exists($options->{selectsystemvar}) &&
+         $options->{selectsystemvar} eq 'yes'))
+    {
+        $colcount = 6;
+        delete($columns->{status_var});
+    }
+    if ((exists($options->{selectsessionvar}) &&
+         $options->{selectsessionvar} eq 'yes'))
+    {
+        $colcount = 5;
+        delete($columns->{status_var});
+        delete($columns->{var_scope});
+    }
 
     print $iodest <<EOF;
         <!--

@@ -1336,38 +1352,20 @@
 
 for(my $i=1;$i<$colcount;$i++)
 {
-    print $iodest '<colspec colwidth="10*" align="center"/>';
+    printf$iodest ('<colspec colwidth="%d*" align="center"/>',int(60/$colcount));
 }
 
 print $iodest <<EOF;
 <thead>
 <row>
-<entry><emphasis role="bold">$title_name</emphasis></entry>
-<entry><emphasis role="bold">$title_cmd_line</emphasis></entry>
-<entry><emphasis role="bold">$title_option_file</emphasis></entry>
-<entry><emphasis role="bold">$title_system_var</emphasis></entry>
 EOF
 
-if ((exists($options->{selectsystemvar}) &&
-     $options->{selectsystemvar} eq 'no') &&
-    (exists($options->{selectsessionvar}) &&
-     $options->{selectsessionvar} eq 'no'))
+    foreach my $key (sort { $columns->{$a} <=> $columns->{$b} } keys %{$columns})
 {
-    print $iodest <<EOF;
-<entry><emphasis role="bold">$title_status_var</emphasis></entry>
-EOF
+    printf $iodest ('<entry><emphasis role="bold">%s</emphasis></entry>',$col_titles->{$key});
 }
 
-if ((exists($options->{selectsessionvar}) &&
-     $options->{selectsessionvar} eq 'no'))
-{
-    print $iodest <<EOF;
-<entry><emphasis role="bold">$title_var_scope</emphasis></entry>
-EOF
-}
-
 print $iodest <<EOF;
-<entry><emphasis role="bold">$title_dynamic</emphasis></entry>
 </row>
 </thead>
 <tbody>

@@ -1385,10 +1383,7 @@
 
         my @corefields = qw/cmdline mycnf system status/;
 
-        if ((exists($options->{selectsystemvar}) &&
-             $options->{selectsystemvar} eq 'yes') ||
-            (exists($options->{selectsessionvar}) &&
-             $options->{selectsessionvar} eq 'yes'))
+        if (!exists($columns->{status_var}))
         {
             @corefields = qw/cmdline mycnf system/;
         }

@@ -1405,8 +1400,7 @@
             }
         }
         
-        if (exists($options->{selectsessionvar}) &&
-            $options->{selectsessionvar} eq 'no')
+        if (exists($columns->{var_scope}))
         {
             if (exists($td->{$id}->{scope}))
             {


Thread
svn commit - mysqldoc@docsrva: r11254 - trunk/tools/MySQL/DynXMLmcbrown15 Jul