: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @class elFinder command "mkdir"
* @author Dmitry (dio) Levashov
elFinder.prototype.commands.mkdir = function() {
this.disableOnSearch = true;
this.updateOnSelect = false;
this.syncTitleOnChange = true;
this.prefix = 'untitled folder';
this.exec = function(select, cOpts) {
if (select && select.length && cOpts && cOpts._currentType && cOpts._currentType === 'navbar') {
this.origin = cOpts._currentType;
onCwd = fm.cwd().hash === select[0];
this.origin = curOrg && !onCwd? curOrg : 'cwd';
if (! select && ! this.options.intoNewFolderToolbtn) {
fm.getUI('cwd').trigger('unselectall');
//this.move = (!onCwd && curOrg !== 'navbar' && fm.selected().length)? true : false;
this.move = this.value === fm.i18n('cmdmkdirin');
return jQuery.proxy(fm.res('mixin', 'make'), self)();
if (this.options.intoNewFolderToolbtn) {
this.syncTitleOnChange = true;
fm.bind('select contextmenucreate closecontextmenu', function(e) {
var sel = (e.data? (e.data.selected || e.data.targets) : null) || fm.selected();
self.className = 'mkdir';
curOrg = e.data && sel.length? (e.data.origin || e.data.type || '') : '';
if (!self.options.intoNewFolderToolbtn && curOrg === '') {
if (sel.length && curOrg !== 'navbar' && curOrg !== 'cwd' && fm.cwd().hash !== sel[0]) {
self.title = fm.i18n('cmdmkdirin');
self.className += ' elfinder-button-icon-mkdirin';
self.title = fm.i18n('cmdmkdir');
if (e.type !== 'closecontextmenu') {
self.update(void(0), self.title);
requestAnimationFrame(function() {
self.update(void(0), self.title);
this.getstate = function(select) {
sel = (curOrg === 'navbar' || (select && select[0] !== cwd.hash))? this.files(select || fm.selected()) : [],
filter = function(files) {
return jQuery.grep(files, function(f) {
fres = fres && f.read && ! f.locked? true : false;
if (curOrg === 'navbar') {
return cnt && sel[0].write && sel[0].read? 0 : -1;
return cwd.write && (!cnt || filter(sel).length == cnt)? 0 : -1;