Begin some re-orginization of UI controls. Remove support for $theme_css, since...
[squirrelmail.git] / config / conf.pl
index 95bbd8f1c16af1cbe9a8fad29a0b2145f3d368a6..d87b702e8e334753792111253d52f3a017a59d80 100755 (executable)
@@ -196,6 +196,18 @@ while ( $line = <FILE> ) {
                 $options[1] =~ s/^\.\.\/config/\.\.\/templates/;
             }
             $templateset_id[$sub] = $options[1];
+##### FIXME: This section BELOW here so old prefs files don't blow up when running conf.pl
+#####        Remove after a month or two 
+} elsif ( $options[0] =~ /^aTemplateSet\[[0-9]+\]\[['"]PATH['"]\]/ ) {
+    $sub = $options[0];
+    $sub =~ s/\]\[['"]PATH['"]\]//;
+    $sub =~ s/.*\[//;
+    if ( -e "../templates" ) {
+        $options[1] =~ s/^\.\.\/config/\.\.\/templates/;
+    }
+    $templateset_id[$sub] = $options[1];
+##### FIXME: This section ABOVE here so old prefs files don't blow up when running conf.pl
+#####        Remove after a month or two 
         } elsif ( $options[0] =~ /^aTemplateSet\[[0-9]+\]\[['"]NAME['"]\]/ ) {
             $sub = $options[0];
             $sub =~ s/\]\[['"]NAME['"]\]//;
@@ -345,8 +357,6 @@ $noselect_fix_enable = 'false'          if ( !$noselect_fix_enable );
 $frame_top = "_top"                     if ( !$frame_top );
 $provider_uri = ''                      if ( !$provider_uri );
 $provider_name = ''                     if ( !$provider_name );
-$edit_identity = 'true'                 if ( !$edit_identity );
-$edit_name = 'true'                     if ( !$edit_name );
 $no_list_for_subscribe = 'false'        if ( !$no_list_for_subscribe );
 $allow_charset_search = 'true'          if ( !$allow_charset_search );
 $allow_advanced_search = 0              if ( !$allow_advanced_search) ;
@@ -359,6 +369,9 @@ $default_use_javascript_addr_book = 'false' if (! $default_use_javascript_addr_b
 
 # since 1.2.0
 $hide_sm_attributions = 'false'         if ( !$hide_sm_attributions );
+# since 1.2.5
+$edit_identity = 'true'                 if ( !$edit_identity );
+$edit_name = 'true'                     if ( !$edit_name );
 
 # since 1.4.0
 $use_smtp_tls= 'false'                  if ( !$use_smtp_tls);
@@ -471,7 +484,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) {
         print "2.  Server Settings\n";
         print "3.  Folder Defaults\n";
         print "4.  General Options\n";
-        print "5.  Templates\n";
+        print "5.  User Interface\n";
         print "6.  Address Books\n";
         print "7.  Message of the Day (MOTD)\n";
         print "8.  Plugins\n";
@@ -606,18 +619,13 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) {
         print "\n";
         print "R   Return to Main Menu\n";
     } elsif ( $menu == 5 ) {
-        print $WHT. "Themes\n" . $NRM;
-        print "1.  Change Template set\n";
-#        for ( $count = 0 ; $count <= $#theme_name/2 ; $count++ ) {
-#            $temp_name = $theme_name[$count*2];
-#            printf "     %s%*s    %s\n", $temp_name,
-#                   40 - length($temp_name), " ",
-#                   $theme_name[($count*2)+1];
-#        }
-        print "2.  CSS File : $WHT$theme_css$NRM\n";
-        print "3.  Default font size: $WHT$default_fontsize$NRM\n";
-        print "4.  Change available font sets\n";
-        print "5.  Change Themes\n";
+        print $WHT. "User Interface\n" . $NRM;
+        print "1.  Modify Template sets\n";
+        print "2.  Use Icons                    : $WHT$use_icons$NRM\n";
+        print "3.  Default Icon Set             : $WHT$icon_theme_def$NRM\n";
+        print "4.  Default font size            : $WHT$default_fontsize$NRM\n";
+        print "5.  Modify available font sets\n";
+#        print "4.  Change Themes\n";
 
         print "\n";
         print "R   Return to Main Menu\n";
@@ -706,8 +714,6 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) {
     } elsif ( $menu == 11 ) {
     print $WHT. "Interface tweaks\n" . $NRM;
     print "1.  Display html mails in iframe : $WHT$use_iframe$NRM\n";
-    print "2.  Use Icons                    : $WHT$use_icons$NRM\n";
-    print "3.  Default Icon Set             : $WHT$icon_theme_def$NRM\n";
     print "\n";
     print $WHT. "PHP tweaks\n" . $NRM;
     print "4.  Use php recode functions     : $WHT$use_php_recode$NRM\n";
@@ -842,10 +848,10 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) {
             elsif ( $command == 16 ) { $config_location_base     = command_config_location_base(); }
         } elsif ( $menu == 5 ) {
             if ( $command == 1 ) { $templateset_default = command_templates(); }
-            elsif ( $command == 2 ) { $theme_css = command42(); }
-            elsif ( $command == 3 ) { $default_fontsize = command_default_fontsize(); }
-            elsif ( $command == 4 ) { command_fontsets(); }
-            elsif ( $command == 5 ) { command41(); }
+            elsif ( $command == 2 ) { $use_icons      = commandB3(); }
+            elsif ( $command == 3 ) { $icon_theme_def = commandB7(); }
+            elsif ( $command == 4 ) { $default_fontsize = command_default_fontsize(); }
+            elsif ( $command == 5 ) { command_fontsets(); }
         } elsif ( $menu == 6 ) {
             if    ( $command == 1 ) { command61(); }
             elsif ( $command == 2 ) { command62(); }
@@ -877,8 +883,6 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) {
             elsif ( $command == 5 ) { $lossy_encoding                = commandA5(); }
         } elsif ( $menu == 11 ) {
             if    ( $command == 1 ) { $use_iframe     = commandB2(); }
-            elsif ( $command == 2 ) { $use_icons      = commandB3(); }
-            elsif ( $command == 3 ) { $icon_theme_def = commandB7(); }
             elsif ( $command == 4 ) { $use_php_recode = commandB4(); }
             elsif ( $command == 5 ) { $use_php_iconv  = commandB5(); }
             elsif ( $command == 6 ) { $allow_remote_configtest = commandB6(); }
@@ -2762,8 +2766,6 @@ sub command_templates {
         # list template sets
         #
         if ( $input =~ /^\s*l\s*/i ) {
-# LEFT OFF HERE!  default is lost after detection.... hmmmm
-print "DEFAULT INDEX IS " . $templateset_default . "\n";
             $count = 0;
             while ( $count <= $#templateset_name ) {
                 if ( $count == $templateset_default ) {
@@ -2919,34 +2921,6 @@ print "DEFAULT INDEX IS " . $templateset_default . "\n";
 }
 
 
-# Theme - CSS file
-sub command42 {
-    print "You may specify a cascading style-sheet (CSS) file to be included\n";
-    print "on each html page generated by SquirrelMail. The CSS file is useful\n";
-    print "for specifying a site-wide font. If you're not familiar with CSS\n";
-    print "files, leave this blank.\n";
-    print "\n";
-    print "To clear out an existing value, just type a space for the input.\n";
-    print "\n";
-    print "Please be aware of the following: \n";
-    print "  - Relative URLs are relative to the config dir\n";
-    print "    to use the themes directory, use ../themes/css/newdefault.css\n";
-    print "  - To specify a css file defined outside the SquirrelMail source tree\n";
-    print "    use the absolute URL the webserver would use to include the file\n";
-    print "    e.g. http://some.host.com/css/mystyle.css or /css/mystyle.css\n";
-    print "\n";
-    print "[$WHT$theme_css$NRM]: $WHT";
-    $new_theme_css = <STDIN>;
-
-    if ( $new_theme_css eq "\n" ) {
-        $new_theme_css = $theme_css;
-    } else {
-        $new_theme_css =~ s/[\r\n]//g;
-    }
-    $new_theme_css =~ s/^\s*//;
-    return $new_theme_css;
-}
-
 # sets default font size option
 sub command_default_fontsize {
     print "Enter default font size [$WHT$$default_fontsize$NRM]: $WHT";
@@ -4144,6 +4118,13 @@ sub save_data {
 
         if ( $templateset_default eq '' ) { $templateset_default = '0'; }
         print CF "\$templateset_default = $templateset_default;\n";
+# FIXME: need to make this a setting the user can change herein
+#        This REALLY needs to be done, since the index of the "default"
+#        set cannot always be predicted!
+#        Heck, why are default and fallback indexes?  If we make them
+#        into the ID strings, then it would not cause such issues
+$templateset_fallback = 0;
+        print CF "\$templateset_fallback = $templateset_fallback;\n";
 
         for ( $count = 0 ; $count <= $#templateset_name ; $count++ ) {
             print CF "\$aTemplateSet[$count]['ID'] = '" . $templateset_id[$count] . "';\n";