* Add priv check for module tree.
This commit is contained in:
@@ -109,6 +109,10 @@ $(function()
|
||||
|
||||
$('#fileTree').on('mousemove', 'a', function()
|
||||
{
|
||||
var libClass = '.libDorpdown';
|
||||
if(!$(this).hasClass('lib')) libClass = '.moduleDorpdown';
|
||||
if($(libClass).find('li').length == 0) return false;
|
||||
|
||||
$(this).find('.icon').removeClass('hidden');
|
||||
}).on('mouseout', 'a', function()
|
||||
{
|
||||
@@ -135,23 +139,13 @@ $(function()
|
||||
|
||||
function renderDropdown(option)
|
||||
{
|
||||
var $liList = (option.id == 'dropDownLibrary') ?
|
||||
('<li data-method="addCatalogue"><a><i class="icon icon-controls"></i>添加目录</a></li>' +
|
||||
'<li data-method="editLib"><a><i class="icon icon-edit"></i>编辑库</a></li>' +
|
||||
'<li data-method="deleteLib"><a><i class="icon icon-trash"></i>删除库</a></li>')
|
||||
:
|
||||
('<li data-method="addCata"><a><i class="icon icon-controls"></i>添加同级目录</a></li>' +
|
||||
'<li data-method="addCataChild"><a><i class="icon icon-edit"></i>添加子目录</a></li>' +
|
||||
'<li data-method="editCata"><a><i class="icon icon-edit"></i>编辑目录</a></li>' +
|
||||
'<li data-method="deleteCata"><a><i class="icon icon-trash"></i>删除目录</a></li>')
|
||||
var libClass = '.libDorpdown';
|
||||
if(option.id != 'dropDownLibrary') libClass = '.moduleDorpdown';
|
||||
if($(libClass).find('li').length == 0) return '';
|
||||
|
||||
var dropdown = '<ul class="dropdown-menu dropdown-in-tree" ' +
|
||||
'id="' + option.id + '"' +
|
||||
'style="display: unset; ' +
|
||||
'left:' + option.left + 'px; ' +
|
||||
'top:' + option.top + 'px;' +
|
||||
'">' + $liList +
|
||||
'</ul>';
|
||||
var dropdown = '<ul class="dropdown-menu dropdown-in-tree" id="' + option.id + '" style="display: unset; left:' + option.left + 'px; top:' + option.top + 'px;">';
|
||||
dropdown += $(libClass).html();
|
||||
dropdown += '</ul>';
|
||||
return dropdown;
|
||||
};
|
||||
|
||||
|
||||
@@ -284,3 +284,11 @@ $lang->doc->placeholder->url = 'Url';
|
||||
$lang->doc->summary = "Total files on this page: <strong>%s</strong> , total size: <strong>%s</strong>, <strong>%s</strong>.";
|
||||
$lang->doc->ge = ':';
|
||||
$lang->doc->point = '.';
|
||||
|
||||
$lang->doc->libDropdown['editLib'] = 'Edit Library';
|
||||
$lang->doc->libDropdown['deleteLib'] = 'Delete Library';
|
||||
$lang->doc->libDropdown['addModule'] = 'Add Directory';
|
||||
$lang->doc->libDropdown['addSameModule'] = 'Add Same Directory';
|
||||
$lang->doc->libDropdown['addSubModule'] = 'Add Sub Directory';
|
||||
$lang->doc->libDropdown['editModule'] = 'Edit Directory';
|
||||
$lang->doc->libDropdown['delModule'] = 'Delete Directory';
|
||||
|
||||
@@ -284,3 +284,11 @@ $lang->doc->placeholder->url = 'URL';
|
||||
$lang->doc->summary = "Total files on this page: <strong>%s</strong> , total size: <strong>%s</strong>, <strong>%s</strong>.";
|
||||
$lang->doc->ge = ':';
|
||||
$lang->doc->point = '.';
|
||||
|
||||
$lang->doc->libDropdown['editLib'] = 'Edit Library';
|
||||
$lang->doc->libDropdown['deleteLib'] = 'Delete Library';
|
||||
$lang->doc->libDropdown['addModule'] = 'Add Directory';
|
||||
$lang->doc->libDropdown['addSameModule'] = 'Add Same Directory';
|
||||
$lang->doc->libDropdown['addSubModule'] = 'Add Sub Directory';
|
||||
$lang->doc->libDropdown['editModule'] = 'Edit Directory';
|
||||
$lang->doc->libDropdown['delModule'] = 'Delete Directory';
|
||||
|
||||
@@ -284,3 +284,11 @@ $lang->doc->placeholder->url = 'URL';
|
||||
$lang->doc->summary = "Total files on this page: <strong>%s</strong> , total size: <strong>%s</strong>, <strong>%s</strong>.";
|
||||
$lang->doc->ge = ':';
|
||||
$lang->doc->point = '.';
|
||||
|
||||
$lang->doc->libDropdown['editLib'] = 'Edit Library';
|
||||
$lang->doc->libDropdown['deleteLib'] = 'Delete Library';
|
||||
$lang->doc->libDropdown['addModule'] = 'Add Directory';
|
||||
$lang->doc->libDropdown['addSameModule'] = 'Add Same Directory';
|
||||
$lang->doc->libDropdown['addSubModule'] = 'Add Sub Directory';
|
||||
$lang->doc->libDropdown['editModule'] = 'Edit Directory';
|
||||
$lang->doc->libDropdown['delModule'] = 'Delete Directory';
|
||||
|
||||
@@ -284,3 +284,11 @@ $lang->doc->placeholder->url = '相应的链接地址';
|
||||
$lang->doc->summary = "本页共 <strong>%s</strong> 个附件,共计 <strong>%s</strong>,其中<strong>%s</strong>。";
|
||||
$lang->doc->ge = '个';
|
||||
$lang->doc->point = '、';
|
||||
|
||||
$lang->doc->libDropdown['editLib'] = '编辑库';
|
||||
$lang->doc->libDropdown['deleteLib'] = '删除库';
|
||||
$lang->doc->libDropdown['addModule'] = '添加目录';
|
||||
$lang->doc->libDropdown['addSameModule'] = '添加同级目录';
|
||||
$lang->doc->libDropdown['addSubModule'] = '添加子目录';
|
||||
$lang->doc->libDropdown['editModule'] = '编辑目录';
|
||||
$lang->doc->libDropdown['delModule'] = '删除目录';
|
||||
|
||||
@@ -94,4 +94,25 @@
|
||||
;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='hidden' id='dropDownData'>
|
||||
<div class='libDorpdown'>
|
||||
<?php if(common::hasPriv('tree', 'browse')):?>
|
||||
<li data-method="addCatalogue"><a><i class="icon icon-controls"></i><?php echo $lang->doc->libDropdown['addModule'];?></a></li>
|
||||
<?php endif;?>
|
||||
<?php if(common::hasPriv('doc', 'editLib')):?>
|
||||
<li data-method="editLib"><a><i class="icon icon-edit"></i><?php echo $lang->doc->libDropdown['editLib'];?></a></li>
|
||||
<?php endif;?>
|
||||
<?php if(common::hasPriv('doc', 'deleteLib')):?>
|
||||
<li data-method="deleteLib"><a><i class="icon icon-trash"></i><?php echo $lang->doc->libDropdown['deleteLib'];?></a></li>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class='moduleDorpdown'>
|
||||
<?php if(common::hasPriv('tree', 'browse')):?>
|
||||
<li data-method="addCata"><a><i class="icon icon-controls"></i><?php echo $lang->doc->libDropdown['addSameModule'];?></a></li>
|
||||
<li data-method="addCataChild"><a><i class="icon icon-edit"></i><?php echo $lang->doc->libDropdown['addSubModule'];?></a></li>
|
||||
<li data-method="editCata"><a><i class="icon icon-edit"></i><?php echo $lang->doc->libDropdown['editModule'];?></a></li>
|
||||
<li data-method="deleteCata"><a><i class="icon icon-trash"></i><?php echo $lang->doc->libDropdown['delModule'];?></a></li>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user