: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Display current folder path in statusbar.
* Click on folder name in path - open folder
* @author Dmitry (dio) Levashov
jQuery.fn.elfinderpath = function(fm, options) {
return this.each(function() {
clHover= fm.res('class', 'hover'),
prefix = 'path' + (elFinder.prototype.uniqueid? elFinder.prototype.uniqueid : '') + '-',
wzbase = jQuery('<div class="ui-widget-header ui-helper-clearfix elfinder-workzone-path"></div>'),
path = jQuery(this).addClass('elfinder-path').html(' ')
.on('mousedown', 'span.elfinder-path-dir', function(e) {
var hash = jQuery(this).attr('id').substr(prefix.length);
if (hash != fm.cwd().hash) {
jQuery(this).addClass(clHover);
fm.exec('search', query, { target: hash, mime: mimes.join(' ') });
fm.trigger('select', {selected : [hash]}).exec('open', hash);
.prependTo(fm.getUI('statusbar').show()),
roots = jQuery('<div class="elfinder-path-roots"></div>').on('click', function(e) {
var roots = jQuery.map(fm.roots, function(h) { return fm.file(h); }),
jQuery.each(roots, function(i, f) {
if (! f.phash && fm.root(fm.cwd().hash, true) !== f.hash) {
label : fm.escape(f.i18 || f.name),
callback : function() { fm.exec('open', f.hash); },
iconClass : f.csscls || '',
fm.trigger('contextmenu', {
}).append('<span class="elfinder-button-icon elfinder-button-icon-menu" ></span>').appendTo(wzbase),
jQuery.each(fm.parents(cwd), function(i, hash) {
var c = (cwd === hash)? 'elfinder-path-dir elfinder-path-cwd' : 'elfinder-path-dir',
name = fm.escape(f.i18 || f.name);
dirs.push('<span id="'+prefix+hash+'" class="'+c+'" title="'+names.join(fm.option('separator'))+'">'+name+'</span>');
return dirs.join('<span class="elfinder-path-other">'+fm.option('separator')+'</span>');
toWorkzone = function() {
path.children('span.elfinder-path-dir').attr('style', '');
prev = fm.direction === 'ltr'? jQuery('#'+prefix + fm.cwd().hash).prevAll('span.elfinder-path-dir:first') : jQuery();
path.scrollLeft(prev.length? prev.position().left : 0);
var dirs = path.children('span.elfinder-path-dir'),
if (place === 'workzone' || cnt < 2) {
path.width(path.css('max-width'));
dirs.css({maxWidth: (100/cnt)+'%', display: 'inline-block'});
path.children('span.elfinder-path-other').each(function() {
m -= jQuery(this).width();
if (w < this.scrollWidth) {
jQuery.each(ids, function(i, k) {
d.css('max-width', d.width() + m);
dirs.last().attr('style', '');
fm.one('init', function() {
hasUiTree = fm.getUI('tree').length;
hasUiStat = fm.getUI('stat').length;
if (! hasUiTree && options.toWorkzoneWithoutNavbar) {
wzbase.append(path).insertBefore(fm.getUI('workzone'));
fm.bind('open', toWorkzone)
.one('opendone', function() {
fm.getUI().trigger('resize');
.bind('open searchend parents', function() {
path.html(render(fm.cwd().hash));
if (Object.keys(fm.roots).length > 1) {
.bind('searchstart', function(e) {
query = e.data.query || '';
target = e.data.target || '';
mimes = e.data.mimes || [];
.bind('search', function(e) {
html = fm.i18n('btnAll');
path.html('<span class="elfinder-path-other">'+fm.i18n('searcresult') + ': </span>' + html);
// on swipe to navbar show/hide
.bind('navbarshow navbarhide', function() {
var wz = fm.getUI('workzone');
if (this.type === 'navbarshow') {
fm.unbind('open', toWorkzone);
path.prependTo(fm.getUI('statusbar'));
wzbase.append(path).insertBefore(wz);
fm.bind('open', toWorkzone);
.bind('resize uistatchange', fit);