These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for trouble with custom plugin on the new forum.
I am trying to make my first plugin. I have added it to plugins and features and account plan... But haven't been able to make it show up in the virtualmin menu. It shows up in webmin modules but not in menu. Ant help will be appreciated.
Howdy,
Is there any chance you could post the contents of your plugin?
Thanks!
-Eric
Seemed like it shouldn't be too hard... Just have to launch the php script to connect to the simplescript interface. But I have never tried, and it is probably over my head.
Module.info
desc=A Plugin to enable SimpleScripts category=system version=1.0
virtualmin-simplescripts-lib.pl
use WebminCore; &init_config(); &foreign_require("virtual-server", "virtual-server-lib.pl"); 1;
virtual-feature.pl
do 'virtualmin-simplescripts-lib.pl';
sub feature_name { return "A Plug-In to enable SimpleScripts with Virtualmin."; }
sub feature_label { return "Enable the Simple Scripts plugin"; }
sub feature_setup { my ($d) = @_; &$virtual_server::first_print("Setting up My plugin.."); my $ex = system("/usr/bin/php launch-simplescripts --add $d->{'dom'} >/dev/null 2>&1"); if ($ex) { &$virtual_server::second_print(".. failed!"); return 1; } else { &$virtual_server::second_print(".. done"); return 1; } }
sub feature_links { local ($d) = @_; return ( { 'mod' => $virtualmin-simplescripts, 'desc' => "Manage My plugin", 'page' => 'launch-simplescripts.php?dom='.$d->{'dom'}, 'cat' => 'services', } ); }
launch-simplescripts.php