*** EditTablePlugin.pm-orig	Tue Mar  2 13:41:12 2004
--- EditTablePlugin.pm	Tue Apr 27 12:33:46 2004
***************
*** 39,50 ****
  package TWiki::Plugins::EditTablePlugin;
  
  # =========================
  use vars qw(
          $web $topic $user $installWeb $VERSION $debug
          $query $renderingWeb
          $preSp %params @format @formatExpanded
          $prefsInitialized $prefCHANGEROWS $prefEDITBUTTON
!         $prefJSCALENDARDATEFORMAT $prefJSCALENDARLANGUAGE $prefJSCALENDAROPTIONS
          $nrCols $encodeStart $encodeEnd $table
      );
  
--- 39,51 ----
  package TWiki::Plugins::EditTablePlugin;
  
  # =========================
+ # David Smith - added prefJSCALENDARTHEME for theme selection
  use vars qw(
          $web $topic $user $installWeb $VERSION $debug
          $query $renderingWeb
          $preSp %params @format @formatExpanded
          $prefsInitialized $prefCHANGEROWS $prefEDITBUTTON
!         $prefJSCALENDARDATEFORMAT $prefJSCALENDARLANGUAGE $prefJSCALENDAROPTIONS $prefJSCALENDARTHEME
          $nrCols $encodeStart $encodeEnd $table
      );
  
***************
*** 155,160 ****
--- 156,164 ----
                      &TWiki::Func::getPreferencesValue("EDITTABLEPLUGIN_JSCALENDARDATEFORMAT") || "%Y/%m/%d";
          $prefJSCALENDARLANGUAGE   = &TWiki::Func::getPreferencesValue("JSCALENDARLANGUAGE") ||
                      &TWiki::Func::getPreferencesValue("EDITTABLEPLUGIN_JSCALENDARLANGUAGE") || "en";
+ # david smith - added support for theme selection
+         $prefJSCALENDARTHEME   = &TWiki::Func::getPreferencesValue("JSCALENDARTHEME") ||
+                     &TWiki::Func::getPreferencesValue("EDITTABLEPLUGIN_JSCALENDARTHEME") || "system";
          $prefJSCALENDAROPTIONS    = &TWiki::Func::getPreferencesValue("JSCALENDAROPTIONS") ||
                      &TWiki::Func::getPreferencesValue("EDITTABLEPLUGIN_JSCALENDAROPTIONS") || "";
          $prefsInitialized = 1;
***************
*** 400,407 ****
      my $text = "";
      if( $doEdit ) {
          my $dir = "%PUBURL%/$installWeb/EditTablePlugin";
          $text .= "$preSp<script type=\"text/javascript\" src=\"$dir/calendar.js\"></script>\n";
!         $text .= "$preSp<script type=\"text/javascript\" src=\"$dir/calendar-"
                 . "$prefJSCALENDARLANGUAGE.js\"></script>\n";
          $text .= "$preSp<script type=\"text/javascript\" src=\"$dir/calendar-setup.js\"></script>\n";
      }
--- 404,416 ----
      my $text = "";
      if( $doEdit ) {
          my $dir = "%PUBURL%/$installWeb/EditTablePlugin";
+ # david smith - added support for theme and forcing CSS file, 
+ # css files didn't get populated on my systems, causing the calendar 
+ # to have a clear backround.
+         $text .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"$dir/calendar-$prefJSCALENDARTHEME.css\" title=\"win2k-cold-1\" />";
          $text .= "$preSp<script type=\"text/javascript\" src=\"$dir/calendar.js\"></script>\n";
! # david smith added support for jscalendar-0.9.6 (lang files moved)
!         $text .= "$preSp<script type=\"text/javascript\" src=\"$dir/lang/calendar-"
                 . "$prefJSCALENDARLANGUAGE.js\"></script>\n";
          $text .= "$preSp<script type=\"text/javascript\" src=\"$dir/calendar-setup.js\"></script>\n";
      }
***************
*** 542,548 ****
      my $style = "";
      $style = " style='background:#e8e8e8'" if ($theRowNr % 2);
      if( $type eq "select" ) {
!         my $expandedValue = &TWiki::Func::expandCommonVariables( $theValue, $theTopic, $theWeb );
          $size = 1 if $size < 1;
          $text = "<select$style name=\"$theName\" size=\"$size\">";
          $i = 2;
--- 551,564 ----
      my $style = "";
      $style = " style='background:#e8e8e8'" if ($theRowNr % 2);
      if( $type eq "select" ) {
! # david smith - ok, don't know what this does but 
! # it is the reason that tables with more that a few rows, 
! # and with select fields crash.
! # This ends up calling commonTagsHandler for every select
! #commonTagsHandler creates a header, after some number of headers
! # (200 on netscape server) the server shuts it down.
! 		#my $expandedValue = &TWiki::Func::expandCommonVariables( $theValue, $theTopic, $theWeb );
!         my $expandedValue = $theValue;
          $size = 1 if $size < 1;
          $text = "<select$style name=\"$theName\" size=\"$size\">";
          $i = 2;
