typing error in embedding example
deepak.sathya - November 6, 2006 - 10:40
| Project: | Filebrowser Extensions |
| Version: | HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
While using filebrowser_embed() to embed the filebrowser in a node, the expander doesnt work. One of the reasons might be the link being passed to the ajax interface. Here is a comparison:
when a new filebrowser instance is created through the settings panel, the link for folders is :
<a href='/dfiles/product3?mode=raw'>
when filebrowser_embed() is used:
<a href='//product3/specs?mode=raw'>
Not sure, but I think the extra '/' is making all the difference.

#1
Interesting.
In practice I've usually seen badly formed URLs like that just resolve OK, but it's obviously a bit wrong.
... I checked and the doc was a bit out of synch with the way profiles are really managed. A 'path' or callback context should have been defined into the profile that you need to use.
I've updated CVS (so it really works as it used to) and embedding should go like this:
<?php
$subfolder = '';
$context = "demo3";
// each unique embed profile needs its own 'path' or context
// in order to serve up the same configurations on the later
// ajax calls.
$profile = array(
// very simple list
'cols' => 'expander;file',
'render' => 'list',
'path' = $context,
);
// scan & render
print filebrowser_embed($folder,$profile);
?>
Check out the latest and see if it helps.
Works for me now, but not tested in all circumstances
#2
Thanks for your quick response. Now it works exactly as it should. And also understood the use of 'context' clearly now.
#3
Just an update on this one. With the new cvs version, when I go to settings>>filebrowser extensions
I get :
Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/myusername/public_html/includes/bootstrap.inc on line 609
but the page opens up below.
#4
I see.
That was due to my creating the column definition on-the-fly. It got saved as an array, but the settings screen expected it to be a list. I've patched the settings form to deal with either now.
should be ok now in CVS
#5
see last line: '=>' instead of '='
$profile = array(
// very simple list
'cols' => 'expander;file',
'render' => 'list',
'path' => $context,
);
#6
was mostly docs.
Well fixed
#7