本文整理汇总了PHP中Network::islocal方法的典型用法代码示例。如果您正苦于以下问题:PHP Network::islocal方法的具体用法?PHP Network::islocal怎么用?PHP Network::islocal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network::islocal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displaydir
public function displaydir($file_list, $srvid, $filename = false, $tpl_browse = false)
{
if (GPXDEBUG) {
echo "DEBUG: Server ID: {$srvid}, Filename: {$filename}, Browsing Templates: {$tpl_browse}<br>";
}
// Use correct img path
if (isset($_SESSION['gpx_admin'])) {
$bk_path = '../';
} else {
$bk_path = '';
}
// Setup language
require DOCROOT . '/lang.php';
#$back_link = '<span class="links" onClick="javascript:load_dir('.$srvid.',\'\',1);" title="Go Back">< Go Back</span><br /><br />';
$back_link = '<div class="links" style="margin-top:10px;margin-bottom:5px;" onClick="javascript:load_dir(' . $srvid . ',\'\',1,' . $tpl_browse . ');"><img src="' . $bk_path . 'images/icons/small/back.png" width="28" height="28" border="0" style="margin-top:5px;" /> ' . $lang['go_back'] . '</div>';
// Unable to read due to permissions etc
if ($file_list == 'err_opendir') {
die($back_link . '<br />Sorry, unable to read this directory.');
}
####################################################
// Not a directory; show file contents
if (!is_array($file_list)) {
if ($tpl_browse) {
return 'Sorry, cannot edit files in template browse mode.';
}
# require(DOCROOT.'/lang.php');
echo '<div class="infobox" style="display:none;"></div> ' . $back_link . '<textarea id="filecontent_cur" class="txteditor" style="white-space:pre;">' . $file_list . '</textarea><br />
<div class="button" onClick="javascript:file_savecontent(' . $srvid . ',\'' . $filename . '\');">' . $lang['save'] . '</div>';
exit;
}
####################################################
// Setup file/dir sorting
$arr_files = array();
$arr_dirs = array();
#echo '<pre>';
#var_dump($file_list);
#echo '</pre>';
#exit;
foreach ($file_list as $filename => $file_arr) {
$file_type = $file_arr['type'];
#$filename = strval($filename);
if (is_numeric($filename)) {
$filename .= ' ';
}
#echo "Name: $filename<br>";
if ($file_type == '1') {
$arr_files[$filename][] = $file_arr;
} else {
$arr_dirs[$filename][] = $file_arr;
}
}
// Sort arrays by filename
ksort($arr_files);
ksort($arr_dirs);
# Combine, dirs first
$file_list = array_merge($arr_dirs, $arr_files);
// OLD/unorganized - Make new array to sort directories together
#$array = array($file_list,array_keys($file_list));
#array_multisort($array[0], SORT_DESC, $array[1], SORT_DESC);
#$file_list = array_combine($array[1], $array[0]);
#unset($array);
####################################################
// Check if server is local
$Network = new Network();
$is_local = $Network->islocal($srvid);
// Setup language
#require(DOCROOT.'/lang.php');
####################################################
// File Uploads - Allow if local
if ($is_local) {
echo '<div align="center">
<div id="file_up"></div>
</div>
<script type="text/javascript">
$(document).ready(function(){
createUploader();
});
</script>';
}
####################################################
// Allow back button
if (!empty($_SESSION['curdir'])) {
// If tpl browsing, add "use this directory" option
if ($tpl_browse) {
$cur_dir = $_SESSION['curdir'];
echo '<div align="center"><span class="links" onClick="javascript:template_browse_select(\'' . $cur_dir . '\');">Click to use this folder for this template</span></div>';
}
#$backdir = $_SESSION['curdir']; //dirname($_SESSION['curdir']);
echo $back_link;
}
// Show current directory
if ($_SESSION['curdir']) {
echo '<div style="width:100%;height:20px;line-height:20px;font-family:Arial;font-size:11pt;color:#777;"><b>' . $lang['working_dir'] . ':</b> ' . htmlspecialchars(stripslashes($_SESSION['curdir'])) . '</div>';
}
echo '<div class="infobox" style="display:none;"></div>';
echo '<div class="box">
<div class="box_title" id="box_servers_title">' . $lang['files'] . '</div>
<div class="box_content" id="box_servers_content">
//.........这里部分代码省略.........