Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Custom select field in admin panel

Quote Reply
Custom select field in admin panel
How do I insert a custom select field in the admin section ?

In browser_link_add_form.html, I need to popup a map to define the values of two fields.

As I am building a plugin, I can't modify the scripts, only call for a function.

Is there a simple way to do this?
(I already did it in user section with custom templates)

Mitia
Quote Reply
Re: [mnotaras] Custom select field in admin panel In reply to
The way to do it normally, is Database > Links > Properties > Add Column.

However, if doing it in a plugin, try something like;

Code:
if (exists $DB->table('Links')->cols->{'Has_Priority'}) { $exists = 1; }

if (!$exists) {
my $editor = $DB->editor ('Links');
$editor->add_col ('Has_Priority', {
form_display => 'Priority Listing?',
form_size => '5',
form_type => 'INT',
not_null => '0',
default => '0',
type => 'INT' });
}

This will create a field in MySQL, and also the new one in the admin Wink

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Custom select field in admin panel In reply to
Andy,

I said it wrong.

The new fields display correctly in the admin. What I need is a select field that triggers a javascript when changed. This I can't do from the plugin.

You can see an example of the form I need at
http://www.kalamooka.com/cgi-bin/lsql/add.cgi

Mitia

Last edited by:

mnotaras: Aug 22, 2002, 3:10 AM
Quote Reply
Re: [mnotaras] Custom select field in admin panel In reply to
You can use the hooks "display_link" and "form_link" for this. This works fine when you use the database, i.e. "Datebase -> Links -> xxxx", but it won't work in the browser. Currently there is no easy solution to make it work in the browser section.

I hope that helps.

Ivan
-----
Iyengar Yoga Resources / GT Plugins

Last edited by:

yogi: Aug 22, 2002, 3:52 AM
Quote Reply
Re: [yogi] Custom select field in admin panel In reply to
Thanks Yogi,

I'll check it out.

Mitia