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

Hiding form fields from editors

Quote Reply
Hiding form fields from editors
I know I have posted this in another form somewhere else, but I have a part solution here.

I don't want my editors to be able to see or modify certain fileds in my Category and Links tables. For example, priority, sponsoroship, or advertising fields which I have added. I also want to block things like the description field (SUB1) because I use the yahoo subcats plugin.

One method is to change the properties of the columns you want to hide so that form type = "hidden". The problem with this, is its a pain for you to search and modify these fields yourself!!

The browser display needs to have some kind of checking built into it where it recognises 'admin' logged in, and this displays the fields. Or conversely, anyone other than admin, the fields are not shown.

Anyone have any thoughts or solutions to this? Is this something which might be in the next Links update??


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Hiding form fields from editors In reply to
How about editing the template files for the editors? I believe they are in the /templates/admin folder.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Hiding form fields from editors In reply to
Hi Andy.

I thought the same thing. However when you look inside the template files, you are ultimately presented with <%form%>.... so not much to change there unless you rewrite the for tag , which is basically the whole table editor. This is how is seems to be to me, i'd love to know if I am wrong on this or there is an easier way.Unsure


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Hiding form fields from editors In reply to
If you could hook the editors using the handle_editor hook (I mentioned the problems using it, in my other post), then you could make a condition in your plugin, then you could something similar:
<%if editor_logged_in%><%form%><%endif%>

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Hiding form fields from editors In reply to
I see your point.

The problem is that you still want parts of <%form%> to be displayed.... just not the parts you want hidden.

And my understanding of the <%form%> tag is that it is generated by browser.pm.

I would have to make another form completely just for the editors perhaps... hmmm.


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Hiding form fields from editors In reply to
If the handle_editor hook works, then you can copy the original functions,
then use the GT::Plugins->action ( STOP ); to replace the original code.

So you just duplicate the original code, then you do the changes you want... Wink

After I examined the plugin system functioning, I suppose, there will be no possible to use 2 plugins, which both replaces the same original code!

So be careful, use this replace feature very carefully! Only use, when it is very necessary and it is likely that nobody else will want write a plugin, which replaces the same original code. You have to know, that only one of both plugin will work, so the user have to choose, which one to install & use.
BTW: this is my personal opinion, after I tested the functioning of the plugin system. But Alex knows better than me, so maybe he will be able to tell you more about this.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Hiding form fields from editors In reply to
Thanks webmaster.

This seems to be very limiting indeed for the plugin systemFrown. If you can only have one plug-in replacing code, then this is a big turn off to developing something which may conflict with something else. Not something I want to do, especially at my level of knowledge.

I hope this is something which is being looked into. Maybe someone could enlighten us on this a little more?


http://www.iuni.com/...tware/web/index.html
Links Plugins