From: Shane <sh...@lo...> - 2003-12-23 15:23:45
|
Just a suggestion - rather then edit admin.pl, create a plugin for your new functionality. Your plugin can add a menu item to the admin menu, which would call your perl script in your plugin. And when that script runs, it can call the admin menu when it runs, so users won't know the difference that the new functionality isn't in admin.pl. So if the admin plugin's code ever changes, you don't have to worry about it because everything you did is in a plugin. For an example of how this can be done, look at this plugin: http://dev.lottadot.com/cgi-bin/cvsweb.cgi/lastlogins/ Shane On Dec 23, 2003, at 9:02 AM, Blake Carver wrote: > Hi All, > I'm working on making a new op for the admin page to edit stuff for > users and I'm getting stuck early on. > Here's what I have. I'm not sure where I've gone wrong, I'm getting no > errors back, just a blank page. I'm not sure I'm calling > getDescriptions correctly. > I'm calling my op list_users, so "my $ops" I added: > list_users => { > function => \&listPeeps, > seclev => 500, > adminmenu => 'Users', > tab_selected => 'users', > }, > This calls the sub listPeeps, which is also in admin.pl: > my($form, $slashdb, $user, $constants) = @_; > my $nickname; > my $peeps = $slashdb->getDescriptions('peeps', '', 1); > slashDisplay('listPeeps', { > nickname => $nickname > }); > > MySQL.pm is in MySQL.pm, to which I added peeps to %descriptions: > 'peeps' > => sub { $_[0]->sqlSelectMany('seclev, nickname, uid', 'users') }, > > And all of this needs a new template, listPeeps, which is simply: > <FORM ACTION="[% env.script_name %]" METHOD="POST"> > <INPUT TYPE="HIDDEN" NAME="op" VALUE="vars"> > <TABLE> > <TR> > <TD>Name</TD><TD>[% $nickname %] > </TR> > </TABLE> > </FORM> > The HTML does show up on the admin page, just not the list of > nicknames. > > Thanks! > -Blake > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for > IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys > admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > Slashcode-development mailing list > Sla...@li... > https://lists.sourceforge.net/lists/listinfo/slashcode-development > |