Admin Books

DOWNLOAD Free e-Books for Linux Admin Servers :

Add Custom Link To Virtualmin/Webmin Menu

I want to have links on the left side of webmin/virtualmin default theme.
The links I want are link to File Manager and to PHPMyadmin.
File Manager was located in the original webmin menu.
PHPMyadmin , I installed it in the http://vps.mydomain.com/phpmyadmin/.
Also available in secured pages  https://vps.mydomain.com/phpmyadmin/
So I hack the template in /usr/libexec/webmin/virtual-server-theme/left.cgi.

Here is dirtty hack of  How to Add Custom Link To Virtualmin/Webmin Menu :

Edit /usr/libexec/webmin/virtual-server-theme/left.cgi.
Find code block like this :

     # Show list of all systems
    print "<div class='linkwithicon'><img src='images/vm2-small.png' alt=''><b><div class='aftericon'><a href='server-manager/index.cgi' target=right>$text{'left_vm2'}</a></b></div></div>\n";
    }




Right below that block, add several lines of code like this :

#START OF MY CUSTOM LINKS
#added by roy :


print "<div class='linkwithicon'><img src='images/vm2-small.png' alt=''>\n";
print "<div class='aftericon'><a target=right href='/file/'>File Manager</a></div></div>\n";

print "<div class='linkwithicon'><img src='images/vm2-small.png' alt=''>\n";
print "<div class='aftericon'><a target=_blank href='http://";
print "$ENV{'SERVER_NAME'}";
print "/phpmyadmin/'>PHPMyadmin</a> ";

print "<a target=_blank href='https://";
print "$ENV{'SERVER_NAME'}";
print "/
phpmyadmin/'>(https)</a>";

print "</div></div>\n";

#END OF MY CUSTOM LINKS


Then save the left.cgi and refresh webmin/virtualmin page. Customize your code if you want to add other links. Make sure you edit the right theme. Mine , I use default installation  theme called virtual-server-theme.