/**
* @class elFinder command "chmod".
* Chmod files.
*
* @type elFinder.command
* @author Naoki Sawada
*/
elFinder.prototype.commands.chmod = function() {
"use strict";
this.updateOnSelect = false;
var fm = this.fm,
level = {
0 : 'owner',
1 : 'group',
2 : 'other'
},
msg = {
read : fm.i18n('read'),
write : fm.i18n('write'),
execute : fm.i18n('execute'),
perm : fm.i18n('perm'),
kind : fm.i18n('kind'),
files : fm.i18n('files')
},
isPerm = function(perm){
return (!isNaN(parseInt(perm, 8)) && parseInt(perm, 8) <= 511) || perm.match(/^([r-][w-][x-]){3}$/i);
};
this.tpl = {
main : '
{title}
'
+'{dataTable}',
itemTitle : '{name}{kind}',
groupTitle : '{items}: {num}',
dataTable : ''
+''+msg.perm+':
',
fieldset : '