Use new module
authorJamie Cameron <jcameron@webmin.com>
Sun, 1 Mar 2009 22:51:55 +0000 (22:51 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sun, 1 Mar 2009 22:51:55 +0000 (22:51 +0000)
blue-theme/index.cgi
blue-theme/left.cgi
blue-theme/old-index.cgi [deleted file]
blue-theme/right.cgi

index e5538c3..1cb4b6f 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
-do './web-lib.pl';
+BEGIN { push(@INC, ".."); };
+use WebminCore;
 &ReadParse();
 &init_config();
 %text = &load_language($current_theme);
index 429187b..8481c74 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/perl
 # Show the left-side menu of Virtualmin domains, plus modules
 
-do './web-lib.pl';
-do './ui-lib.pl';
+BEGIN { push(@INC, ".."); };
+use WebminCore;
 &init_config();
 &ReadParse();
 %text = &load_language($current_theme);
diff --git a/blue-theme/old-index.cgi b/blue-theme/old-index.cgi
deleted file mode 100755 (executable)
index d7e39f2..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/local/bin/perl
-# Display all Webmin modules visible to the current user
-
-$theme_index_page = 1;
-require './web-lib.pl';
-&ReadParse();
-&init_config();
-$hostname = &get_display_hostname();
-$ver = &get_webmin_version();
-&get_miniserv_config(\%miniserv);
-if ($gconfig{'real_os_type'}) {
-       if ($gconfig{'os_version'} eq "*") {
-               $ostr = $gconfig{'real_os_type'};
-               }
-       else {
-               $ostr = "$gconfig{'real_os_type'} $gconfig{'real_os_version'}";
-               }
-       }
-else {
-       $ostr = "$gconfig{'os_type'} $gconfig{'os_version'}";
-       }
-%access = &get_module_acl();
-
-# Build a list of all modules
-@modules = &get_visible_module_infos();
-
-if (!defined($in{'cat'})) {
-       # Maybe redirect to some module after login
-       local $goto = &get_goto_module(\@modules);
-       if ($goto) {
-               &redirect($goto->{'dir'}.'/');
-               exit;
-               }
-       }
-
-@args = ( $gconfig{'nohostname'} ? $text{'main_title2'} :
-           &text('main_title', $ver, $hostname, $ostr), "");
-&header(@args, undef, undef, 1, 1);
-
-print $text{'main_header'};
-
-if (!@modules) {
-       # use has no modules!
-       print "<p><b>$text{'main_none'}</b><p>\n";
-       }
-elsif ($gconfig{"notabs_${base_remote_user}"} == 2 ||
-    $gconfig{"notabs_${base_remote_user}"} == 0 && $gconfig{'notabs'}) {
-       # Generate main menu with all modules on one page
-       print "<center><table cellpadding=5>\n";
-       $pos = 0;
-       $cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
-       $per = 100.0 / $cols;
-       foreach $m (@modules) {
-               local $idx = $m->{'index_link'};
-               push(@links, "$gconfig{'webprefix'}/$m->{'dir'}/$idx");
-               push(@titles, $m->{'desc'});
-               push(@icons, "$m->{'dir'}/images/icon.gif");
-               }
-       &icons_table(\@links, \@titles, \@icons);
-       }
-else {
-       # Display modules under current tab
-       &ReadParse();
-       %cats = &list_categories(\@modules);
-       @cats = sort { $b cmp $a } keys %cats;
-       $cats = @cats;
-       $per = $cats ? 100.0 / $cats : 100;
-       if (!defined($in{'cat'})) {
-               # Use default category
-               if (defined($gconfig{'deftab'}) &&
-                   &indexof($gconfig{'deftab'}, @cats) >= 0) {
-                       $in{'cat'} = $gconfig{'deftab'};
-                       }
-               else {
-                       $in{'cat'} = $cats[0];
-                       }
-               }
-       elsif (!$cats{$in{'cat'}}) {
-               $in{'cat'} = "";
-               }
-
-       # Display the modules in this category
-       $pos = 0;
-       $cols = $gconfig{'nocols'} ? $gconfig{'nocols'} : 4;
-       $per = 100.0 / $cols;
-       foreach $m (@modules) {
-               next if ($m->{'category'} ne $in{'cat'});
-               local $idx = $m->{'index_link'};
-               push(@links, "$gconfig{'webprefix'}/$m->{'dir'}/$idx");
-               push(@titles, $m->{'desc'});
-               push(@icons, "$m->{'dir'}/images/icon.gif");
-               }
-       &icons_table(\@links, \@titles, \@icons);
-       }
-
-print $text{'main_footer'};
-&footer();
-
index 0580303..a3b3f6a 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/local/bin/perl
 # Show server or domain information
 
-do './web-lib.pl';
+BEGIN { push(@INC, ".."); };
+use WebminCore;
 &init_config();
-do './ui-lib.pl';
 &ReadParse();
 &load_theme_library();
 if (&get_product_name() eq "usermin") {
@@ -19,7 +19,7 @@ foreach $o (split(/\0/, $in{'open'})) {
        $open{$o} = 1;
        }
 
-&popup_header(undef, &capture_function_output(\&theme_prehead));
+&popup_header(undef, &capture_function_output(\&WebminCore::theme_prehead));
 print "<center>\n";
 
 # Webmin logo