Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Browser Folder Color Suggestion

Quote Reply
Browser Folder Color Suggestion
Another suggestion coming up! Wink

Re

Why not make this little folder change color if it is currently has editors assigned to it? Wow, an easy way to see which categories are edited while browsing!! Why a nice green or orange would stand out don't you think?

Last edited by:

Alex: May 6, 2002, 2:52 PM
Quote Reply
Re: [sooke] Browser Folder Color Suggestion In reply to
When editors are assigned

Normal - no editors have been assigned, or 'admin' assigned

Is this an easy change?

Last edited by:

sooke: May 6, 2002, 2:51 PM
Quote Reply
Re: [sooke] Browser Folder Color Suggestion In reply to
I am thinking no changes need to be made to any .pm file in order to do this (I think), rather modify the javascript functions in browser.html (template) only.
Quote Reply
Re: [sooke] Browser Folder Color Suggestion In reply to
I feel like I am writing to myselfBlush.

The only reference I can find to the folder images in browser.html is:

Code:


var NODE_EXPAND_BUTTON_FAKE = "<%Links::Browser::JFunction::node_expand_button_fake()%>";
var NODE_EXPAND_BUTTON_PLUS = "<%Links::Browser::JFunction::node_expand_button_plus()%>";
var NODE_EXPAND_BUTTON_LESS = "<%Links::Browser::JFunction::node_expand_button_less()%>";
var NODE_UNSELECTED_BUTTON = "<%Links::Browser::JFunction::node_unselected_button()%>";
So what are these? And how can I change them depending whether an editor is assigned to one of them or not?Crazy
Quote Reply
Re: [sooke] Browser Folder Color Suggestion In reply to
Those just translate to:

sub node_expand_button_fake { return $CFG->{build_images_url} . "/browser/expandfake.gif"; }
sub node_expand_button_plus { return $CFG->{build_images_url} . "/browser/expandplus.gif"; }
sub node_expand_button_less { return $CFG->{build_images_url} . "/browser/expandless.gif"; }
sub node_unselected_button { return $CFG->{build_images_url} . "/browser/unselected.gif"; }

So basically the image url and the image name. This is in admin/Links/Brower/JFunction.pm (probably could get moved into the template safely, we didn't have as powerful a template parser when this was originally done).

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Browser Folder Color Suggestion In reply to
Hi Alex,

I haven't given up on this one yet!

Let's say I have my own tag which returns true if there is an editor in the category which is being displayed: <%haseditor%>.

I then want to alter the function to display a different color folder if this is true:

Code:


/**
* Returns HTML code that represents the
* folder which is being clicked to be selected.
*/
function UnloadedNode_folderHtml()
{
var node_id = this.getId();
return '<a name="' + node_id + '" href="#" onClick="return parent.clickEvent(' +
"'" + 'UnloadedNode' + "', " +
"'" + 'select' + "', " +
node_id +
')"><img src="' +
<%if haseditor($node_id)%>NODE_EDITOR_BUTTON<%else%>NODE_UNSELECTED_BUTTON
<%endif%> +
'" border=0></a>';
}


The problem is passing the category/node_id to the perl funciton, I am not sure how to do this. I guess then I just need to define NODE_EDITOR_BUTTON as my new folder image.

Any plans to move the image references out of the .pm into the template? Or perhaps even better/easier, to modify the JFunction.pm to check to do the editor check and return a different color folder itself.

Thanks,

Ian


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

Last edited by:

Ian: Jul 16, 2002, 12:38 AM
Quote Reply
Re: [Alex] Browser Folder Color Suggestion In reply to
Code:
sub node_unselected_button {
my $id = shift;
if (haseditor($id)) {
return $CFG->{build_images_url} . "/browser/editorfolder.gif";
}
else {
return $CFG->{build_images_url} . "/browser/unselected.gif";
}
}


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