本文整理汇总了PHP中transformFilePath函数的典型用法代码示例。如果您正苦于以下问题:PHP transformFilePath函数的具体用法?PHP transformFilePath怎么用?PHP transformFilePath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了transformFilePath函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* constructor
*
* @param string $rootFolder
*/
function __construct($rootFolder)
{
$this->rootFolder = $rootFolder;
$this->sessionAction = new SessionAction();
$objRootFolder = new file($this->rootFolder);
$tem = $objRootFolder->getFileInfo();
$obj = new manager($this->rootFolder, false);
$obj->setSessionAction($this->sessionAction);
$selectedDocuments = $this->sessionAction->get();
$fileType = $obj->getFolderInfo($this->rootFolder);
foreach($fileType as $k=>$v)
{
$tem[$k] = $v;
}
$tem['path'] = backslashToSlash($this->rootFolder);
$tem['type'] = (is_dir($this->rootFolder)?'folder':'file');
$tem['size'] = (is_dir($this->rootFolder)?'':transformFileSize(@filesize($this->rootFolder)));
//$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
//$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
$tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag');
$tem['url'] = getFileUrl($this->rootFolder);
$tem['friendly_path'] = transformFilePath($this->rootFolder);
$tem['file'] = 0;
$tem['subdir'] = 0;
$manager = null;
$this->rootFolderInfo = $tem;
$tem = null;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:35,代码来源:class.search.php
示例2: __construct
/**
* constructor
* @path the path to a folder
* @calculateSubdir force to get the subdirectories information
*/
function __construct($path = null, $calculateSubdir = true)
{
$this->calculateSubdir = $calculateSubdir;
if (defined('CONFIG_SYS_FOLDER_SHOWN_ON_TOP')) {
$this->forceFolderOnTop = CONFIG_SYS_FOLDER_SHOWN_ON_TOP;
}
if (!is_null($path)) {
$this->currentFolderPath = $path;
} elseif (isset($_GET[$this->folderPathIndex]) && file_exists(base64_decode($_GET[$this->folderPathIndex])) && !is_file(base64_decode($_GET[$this->folderPathIndex]))) {
$this->currentFolderPath = api_htmlentities(Security::remove_XSS($_GET[$this->folderPathIndex]));
} elseif (isset($_SESSION[$this->lastVisitedFolderPathIndex]) && file_exists($_SESSION[$this->lastVisitedFolderPathIndex]) && !is_file($_SESSION[$this->lastVisitedFolderPathIndex])) {
$this->currentFolderPath = $_SESSION[$this->lastVisitedFolderPathIndex];
} else {
$this->currentFolderPath = CONFIG_SYS_DEFAULT_PATH;
}
$this->currentFolderPath = isUnderRoot($this->getCurrentFolderPath()) ? backslashToSlash(addTrailingSlash($this->getCurrentFolderPath())) : $this->currentFolderPath;
$this->currentFolderPath = base64_encode($this->currentFolderPath);
if ($this->calculateSubdir) {
// keep track of this folder path in session
$_SESSION[$this->lastVisitedFolderPathIndex] = $this->currentFolderPath;
}
if (is_dir($this->getCurrentFolderPath())) {
$file = new file($this->getCurrentFolderPath());
$folderInfo = $file->getFileInfo();
if (sizeof($folderInfo)) {
//for Chamilo in a name folder, replace num user by user names
if (preg_match('/sf_user_/', basename($this->getCurrentFolderPath()))) {
$userinfo = api_get_user_info(substr(basename($this->getCurrentFolderPath()), 8));
$this->currentFolderInfo['name'] = $userinfo['complete_name'];
} else {
$this->currentFolderInfo['name'] = str_replace('_', ' ', basename($this->getCurrentFolderPath()));
//for Chamilo. Prevent long directory name
}
if (preg_match('/shared_folder/', basename($this->getCurrentFolderPath()))) {
$this->currentFolderInfo['name'] = get_lang('UserFolders');
}
if (preg_match('/shared_folder_session_/', basename($this->getCurrentFolderPath()))) {
$session = explode('_', basename($this->getCurrentFolderPath()));
$session = strtolower($session[sizeof($session) - 1]);
$this->currentFolderInfo['name'] = get_lang('UserFolders') . ' (' . api_get_session_name($session) . ')*';
}
//end Chamilo
$this->currentFolderInfo['subdir'] = 0;
$this->currentFolderInfo['file'] = 0;
$this->currentFolderInfo['ctime'] = $folderInfo['ctime'];
$this->currentFolderInfo['mtime'] = $folderInfo['mtime'];
$this->currentFolderInfo['is_readable'] = $folderInfo['is_readable'];
$this->currentFolderInfo['is_writable'] = $folderInfo['is_writable'];
$this->currentFolderInfo['path'] = $this->getCurrentFolderPath();
$this->currentFolderInfo['path_base64'] = base64_encode($this->getCurrentFolderPath());
$this->currentFolderInfo['friendly_path'] = transformFilePath($this->getCurrentFolderPath());
$this->currentFolderInfo['type'] = 'folder';
$this->currentFolderInfo['cssClass'] = 'folder';
//$this->currentFolderInfo['flag'] = $folderInfo['flag'];
}
}
if ($calculateSubdir && !file_exists($this->getCurrentFolderPath())) {
die(ERR_FOLDER_NOT_FOUND . $this->getCurrentFolderPath());
}
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:65,代码来源:class.manager.php
示例3: __construct
/**
* constructor
* @path the path to a folder
* @calculateSubdir force to get the subdirectories information
*/
function __construct($path = null, $calculateSubdir = true)
{
$this->calculateSubdir = $calculateSubdir;
if (defined('CONFIG_SYS_FOLDER_SHOWN_ON_TOP')) {
$this->forceFolderOnTop = CONFIG_SYS_FOLDER_SHOWN_ON_TOP;
}
if (!is_null($path)) {
$this->currentFolderPath = $path;
} elseif (isset($_GET[$this->folderPathIndex]) && file_exists($_GET[$this->folderPathIndex]) && !is_file($_GET[$this->folderPathIndex])) {
$this->currentFolderPath = $_GET[$this->folderPathIndex];
} elseif (isset($_SESSION[$this->lastVisitedFolderPathIndex]) && file_exists($_SESSION[$this->lastVisitedFolderPathIndex]) && !is_file($_SESSION[$this->lastVisitedFolderPathIndex])) {
$this->currentFolderPath = $_SESSION[$this->lastVisitedFolderPathIndex];
} else {
$this->currentFolderPath = CONFIG_SYS_DEFAULT_PATH;
}
$this->currentFolderPath = isUnderRoot($this->currentFolderPath) ? backslashToSlash(addTrailingSlash($this->currentFolderPath)) : CONFIG_SYS_DEFAULT_PATH;
if ($this->calculateSubdir) {
// keep track of this folder path in session
$_SESSION[$this->lastVisitedFolderPathIndex] = $this->currentFolderPath;
}
if (is_dir($this->currentFolderPath)) {
$file = new file($this->currentFolderPath);
$folderInfo = $file->getFileInfo();
if (sizeof($folderInfo)) {
$this->currentFolderInfo['name'] = basename($this->currentFolderPath);
$this->currentFolderInfo['subdir'] = 0;
$this->currentFolderInfo['file'] = 0;
$this->currentFolderInfo['ctime'] = $folderInfo['ctime'];
$this->currentFolderInfo['mtime'] = $folderInfo['mtime'];
$this->currentFolderInfo['is_readable'] = $folderInfo['is_readable'];
$this->currentFolderInfo['is_writable'] = $folderInfo['is_writable'];
$this->currentFolderInfo['path'] = $this->currentFolderPath;
$this->currentFolderInfo['friendly_path'] = transformFilePath($this->currentFolderPath);
$this->currentFolderInfo['type'] = "folder";
$this->currentFolderInfo['cssClass'] = 'folder';
//$this->currentFolderInfo['flag'] = $folderInfo['flag'];
}
}
if ($calculateSubdir && !file_exists($this->currentFolderPath)) {
die(ERR_FOLDER_NOT_FOUND . $this->currentFolderPath);
}
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:47,代码来源:class.manager.php
示例4: transformFilePath
</p>
<div class="clear"></div>
</fieldset>
<?php
}
?>
<fieldset id="folderFieldSet" >
<legend><?php echo LBL_FOLDER_INFO; ?></legend>
<table cellpadding="0" cellspacing="0" class="tableSummary" id="folderInfo">
<tbody>
<tr>
<th><?php echo LBL_FOLDER_PATH; ?></th>
<td colspan="3" id="folderPath"><?php echo transformFilePath($folderInfo['path']); ?></td>
</tr>
<tr>
<th><?php echo LBL_FOLDER_CREATED; ?></th>
<td colspan="3" id="folderCtime"><?php echo (!empty($folderInfo['ctime'])?date(DATE_TIME_FORMAT,$folderInfo['ctime']):' ') ; ?></td>
</tr>
<tr>
<th><?php echo LBL_FOLDER_MODIFIED; ?></th>
<td colspan="3" id="folderMtime"><?php echo (!empty($folderInfo['mtime'])?date(DATE_TIME_FORMAT,$folderInfo['mtime']):' '); ?></td>
</tr>
<tr>
<th><?php echo LBL_FOLDER_SUDDIR; ?></th>
<td colspan="3" id="folderSubdir"><?php echo (isset($folderInfo['subdir'])?$folderInfo['subdir']:" "); ?></td>
</tr>
开发者ID:hungnv0789,项目名称:vhtm,代码行数:30,代码来源:ajaxfilemanager.php
示例5: transformFilePath
<div id="leftCol">
<fieldset id="folderFieldSet">
<legend><?php
echo LBL_FOLDER_INFO;
?>
</legend>
<table cellpadding="0" cellspacing="0" class="tableSummary" id="folderInfo">
<tbody>
<tr>
<th><?php
echo LBL_FOLDER_PATH;
?>
</th>
<td colspan="3" id="folderPath"><?php
echo transformFilePath($folderInfo['path']);
?>
</td>
</tr>
<tr>
<th><?php
echo LBL_FOLDER_CREATED;
?>
</th>
<td colspan="3" id="folderCtime">
<?php
echo !empty($folderInfo['ctime']) ? date(DATE_TIME_FORMAT, $folderInfo['ctime']) : ' ';
?>
</td>
</tr>
<tr>
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:ajaxfilemanager.php
注:本文中的transformFilePath函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论