我正在使用PHP扩展程序浏览服务器上的文件。
现在我只想将视图锁定到一个文件夹。
子文件夹可以,但是单击点以查看父文件夹不是可以的。
我该如何解决?
我尝试禁用此行:
//
// Display breadcrumbs (relative path of the location).
// Default: $_CONFIG['show_path'] = true;
//
$_CONFIG['show_path'] = false;
编码资源管理器演示:
http://encode-explorer.siineiolekala.net/explorer/index.php
Github脚本:
https://github.com/marekrei/encode-explorer/blob/master/index.php
答案 0 :(得分:1)
只需删除3114到3119行,就会从所有目录中删除“ ..” ...
<tr class="row two">
<td class="icon"><img alt="dir" src="?img=directory" /></td>
<td colspan="<?php print (($this->mobile == true?1:(GateKeeper::isDeleteAllowed()?4:3))); ?>" class="long">
<a class="item" href="<?php print $this->makeLink(false, false, null, null, null, $this->location->getDir(false, true, false, 1)); ?>">..</a>
</td>
</tr>
但是,如果您有一些子文件夹可以进出,最好在一些IF语句下...(我更喜欢这种解决方案)
例如,仅当您位于root目录中时,才显示“ ..”,而在其他目录中显示:
<?php if ( !empty($_REQUEST['dir']) ): ?>
<tr class="row two">
<td class="icon"><img alt="dir" src="?img=directory" /></td>
<td colspan="<?php print (($this->mobile == true?1:(GateKeeper::isDeleteAllowed()?4:3))); ?>" class="long">
<a class="item" href="<?php print $this->makeLink(false, false, null, null, null, $this->location->getDir(false, true, false, 1)); ?>">..</a>
</td>
</tr>
<?php endif; ?>