More work on overlay themes
authorJamie Cameron <jcameron@webmin.com>
Thu, 18 Dec 2008 01:01:47 +0000 (01:01 +0000)
committerJamie Cameron <jcameron@webmin.com>
Thu, 18 Dec 2008 01:01:47 +0000 (01:01 +0000)
acl/CHANGELOG
acl/edit_user.cgi
acl/lang/en
acl/save_user.cgi
change-user/CHANGELOG
webmin/CHANGELOG

index 1f1cf40..bb5c930 100644 (file)
@@ -53,3 +53,4 @@ Added an API function to allow easier anonymous module access setup.
 Removed the Hide Unused button and associated functionality, as un-available modules are already automatically hidden in the Un-used Modules category.
 Moved the 'global ACL' fields to the Edit User and Edit Group pages, so that restrictions applying to all modules can be more easily found and edited.
 Added a per-user option to not grant that user new module permissions when Webmin is upgraded.
+If any theme overlays are installed, users' overlays can be selected on the Edit User page.
index 3c75564..434ed1e 100755 (executable)
@@ -183,10 +183,14 @@ if ($access{'cats'}) {
        }
 
 if ($access{'theme'}) {
+       @all = &webmin::list_themes();
+       @themes = grep { !$_->{'overlay'} } @all;
+       @overlays = grep { $_->{'overlay'} } @all;
+
        # Current theme
        @topts = ( );
        push(@topts, [ "", $text{'edit_themedef'} ]);
-       foreach $t (&webmin::list_themes()) {
+       foreach $t (@themes) {
                push(@topts, [ $t->{'dir'}, $t->{'desc'} ]);
                }
        print &ui_table_row($text{'edit_theme'},
@@ -195,6 +199,16 @@ if ($access{'theme'}) {
                    [ 0, &ui_select("theme", $user{'theme'}, \@topts) ] ]));
        }
 
+if ($access{'theme'} && @overlays) {
+       # Overlay theme, if any
+       print &ui_table_row($text{'edit_overlay'},
+               &ui_radio("overlay_def", defined($user{'overlay'}) ? 0 : 1,
+                 [ [ 1, $text{'edit_overlayglobal'} ],
+                   [ 0, &ui_select("overlay", $user{'overlay'},
+                          [ map { [ $_->{'dir'}, $_->{'desc'} ] } @overlays ]
+                                   ) ] ]));
+       }
+
 if ($showui) {
        print &ui_hidden_table_end("ui");
        }
index 493bed3..bb9ffb9 100644 (file)
@@ -68,9 +68,11 @@ edit_risk_low=Normal user
 edit_groupmods=(In addition to modules from group)
 edit_euser=You are not allowed to edit this user
 edit_ecreate=You are not allowed to create users
-edit_theme=Personal theme
+edit_theme=Personal UI theme
 edit_themeglobal=From Webmin Configuration
 edit_themedef=Old Webmin theme
+edit_overlay=Personal theme overlay
+edit_overlayglobal=None - use theme defaults
 edit_log=View Logs
 edit_selall=Select all
 edit_invert=Invert selection
@@ -99,6 +101,7 @@ save_err=Failed to save user
 save_ename='$1' is not a valid username
 save_enamewebmin=The username 'webmin' is reserved for internal use
 save_edup=The username '$1' is already in use
+save_eoverlay=A theme overlay cannot be selected unless a theme is
 save_edeny=you cannot deny yourself access to the Webmin Users module
 save_eos=The Same as Unix password option is not supported on your operating system.
 save_emd5=The Same as Unix password option cannot be used on systems with MD5 encryption
index 09d0054..03b4d66 100755 (executable)
@@ -179,8 +179,17 @@ $salt = chr(int(rand(26))+65).chr(int(rand(26))+65);
 $user{'name'} = $in{'name'};
 $user{'lang'} = !$access{'lang'} ? $old->{'lang'} :
                $in{'lang_def'} ? undef : $in{'lang'};
-$user{'theme'} = !$access{'theme'} ? $old->{'theme'} :
-                $in{'theme_def'} ? undef : $in{'theme'};
+if (!$access{'theme'}) {
+       $user{'theme'} = $old->{'theme'};
+       $user{'overlay'} = $old->{'overlay'};
+       }
+else {
+       $user{'theme'} = $in{'theme_def'} ? undef : $in{'theme'};
+       $user{'overlay'} = $in{'overlay_def'} ? undef : $in{'overlay'};
+       if ($user{'overlay'} && !$user{'theme'}) {
+               &error($text{'save_eoverlay'});
+               }
+       }
 $user{'cert'} = !$access{'chcert'} ? $old->{'cert'} :
                $in{'cert_def'} ? undef : $in{'cert'};
 $user{'notabs'} = !$access{'cats'} ? $old->{'notabs'} : $in{'notabs'};
index 7102595..14bf161 100644 (file)
@@ -1,2 +1,4 @@
 ---- Changes since 1.430 ----
 Converted the UI to use the new Webmin user interface functions, for a more consistent look.
+---- Changes since 1.440 ----
+If any theme overlays are installed, one can be selected in this module to modify the appearance of the underlying theme.
index c940ea6..a627e5e 100644 (file)
@@ -82,3 +82,5 @@ On Linux systems, the IO scheduling class and priority for Webmin Cron jobs can
 Added a field to the SSL Encryption page for setting allowed ciphers.
 ---- Changes since 1.440 ----
 Added an advanced option to have Webmin turn off the immutable bit on files before writing to them, and turn it back on when done.
+Re-designed the Webmin Themes page to use tabs.
+Added support for overlay themes, which can be selected in addition to a regular theme. An overlay typically just modifies the CSS or images in the real theme, making simple design changes easier.