Is it possible to embed elFinder into a node?

CommentFileSizeAuthor
#2 elfinder.txt27.46 KBjhelou

Comments

Snicers’s picture

Assigned: Snicers » Unassigned
jhelou’s picture

StatusFileSize
new27.46 KB

yeah, you will need to show the module as a block and display the block on specific nodes. to display elfinder in the blocks section modify elfinder.module:

add: ________________________________________________

function elfinder_block_info() {
  // Makes it show up on /admin/build/block page.
  $blocks[0]['info'] = t('File Manager');
  return $blocks;
}

function elfinder_block_view() {

  // Show the block.
  $block['subject'] = t('File Manager');
  $block['content'] = b_elfinder_file_browser();
  return $block;
}

function elfinder_block_configure(){
return elfinder_admin_form($junk);
}

_________________________________________

then duplicate the function elfinder_file_browser() to b_elfinder_file_browser() and change the line that says:

print theme('elfinder_page'); (this line is towards the end of the function)

to

return "<div id='finder'></div>";

when you save the file you will see "File Manager" appear in your blocks page.
i have attached the modified module file to this post as a guide.

Cheers

P.S. BIG THANKS to those who contributed to the development and drupal integration of elfinder. good job!

matulis’s picture

this works for 6.x-1.x-dev, maybe for 7.x too

<iframe id="elfinder" src="/elfinder"></iframe>

add to theme's style.css

iframe#elfinder {
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 99%;
  height: 600px;
}
ph0enix’s picture

/**
  * Implementation of hook_block_info().
  */ 
function elfinder_block_block_info() {
 $blocks['elfinder-block'] = array( 
  'info' => t('elFinder'), 
 );
 return $blocks; 
}


/**
  * Implementation of hook_block_view().
  */ 
function elfinder_block_block_view($delta='') {
 $block = array();
 switch ($delta) {
  case 'elfinder-block':
    $block['subject'] = t('elFinder');
    $block['content'] = elfinder_file_browser('backend');
    break;
  } 
  
  return $block; 
}
ph0enix’s picture

Status: Active » Fixed

Latest dev version creating block which can be included into node

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Guit4eva’s picture

Status: Closed (fixed) » Needs review

Hi there,

I tried the lastest dev (6x.1x) but could not find the option to embed elfinder as a block. Where would I put that code snippet (above) to add it myself?

Guit4eva’s picture

Oops, saw now that this issue is for 7.x-1.x, but hopefully I can apply it to the D6 version?

ph0enix’s picture

It should be automatically add block 'File Manager' to Blocks admin page. If you don't see block in the list, try to disable/enable elFinder module.

mdallmeyer’s picture

I've added the "File Manager" block, but it just loads a blank frame with the title File Manager, never showing elFinder. This is probably related to another issue, where elFinder is not being displayed at admin/content/files.

ph0enix’s picture

Is there any javascript errors?

mdallmeyer’s picture

Sorry, sort of duplicate posts here, but again, no errors.

ph0enix’s picture

Is there errors in server error log?

mdallmeyer’s picture

No errors in the server log, and in the other thread you asked if it shows up at /elfinder, which it does. I would like to have the users on a page which still allows navigation through the rest of the site, hence why I'd like to use admin/content/files instead of /elfinder.
Or I would even be okay with creating a new page for it, but I don't believe it would show up since it also didn't display when I added it to a block on the dashboard.

(This is on 6.x-2.x-dev, it works fine for 6.x-1.x-dev or 6.x-0.7, but I'd like individual user access control)

ph0enix’s picture

Just tested latest build on clean D6.

Try to do following:

0. Backup database and files
1. Disable elfinder module
2. Uninstall module data (you will lose elfinder settings).
3. Update elFinder to latest 6.x-2.x module and library to elFinder 2.0rc1 (https://github.com/downloads/Studio-42/elFinder/elfinder-2.0-rc1.tar.gz).
4. Enable module and check if there are any changes

If this will still not work:

1. Please test it in Garland theme
2. Try to disable CSS and JS optimization it it is already set.
3. Try to disable jquery_update and jquery_ui modules if they already presenteed
4. Provide html code between tags for admin/content/files page (you can replace real domain names to example.com)

mdallmeyer’s picture

Hm, elFinder only displayed (at admin/content/files) once the JQuery_UI module was disabled...I'm using Open Atrium though which has a dependency on this module. Re-enabling it did indeed 'break' the page again.

ph0enix’s picture

What versions of jquery_ui module and jquery ui library you are using?

mdallmeyer’s picture

6.x-1.5 module, and for the library, I have a file named jquery-1.3.2.js but the version.txt file says 1.7.3.

EDIT:
Hm, well I used the block on a custom content page and it displayed fine, strange that it wouldn't at admin/content/files...

EDIT 2:
I found something that might be useful to figuring out the issue here. The block displays fine in the Content region when the layout is Default, but when I switch the layout for this node to Wide, the block does NOT display fine in the Content region. So I'm assuming there's something going on with the way the block works in different regions/with different layouts. Any ideas?

nwom’s picture

Issue summary: View changes
Status: Needs review » Fixed

The 7.x branch includes a block that can be embedded. The issue was re-opened with "Needs Review" even though no patch was attached (after the initial commit).

nwom’s picture

Status: Fixed » Closed (works as designed)