本文整理汇总了PHP中shortenFileName函数的典型用法代码示例。如果您正苦于以下问题:PHP shortenFileName函数的具体用法?PHP shortenFileName怎么用?PHP shortenFileName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了shortenFileName函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: manager
$manager = new manager($upload->getFilePath(), false);
$fileType = $manager->getFileType($upload->getFileName());
foreach($fileType as $k=>$v)
{
$tem[$k] = $v;
}
$tem['path'] = backslashToSlash($path);
$tem['type'] = "file";
$tem['size'] = transformFileSize($tem['size']);
$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
$tem['short_name'] = shortenFileName($tem['name']);
$tem['flag'] = 'noFlag';
$obj->close();
foreach($tem as $k=>$v)
{
$info .= sprintf(", %s:'%s'", $k, $v);
}
$info .= sprintf(", url:'%s'", getFileUrl($path));
$info .= sprintf(", tipedit:'%s'", TIP_DOC_RENAME);
}else
{
$error = ERR_FILE_NOT_AVAILABLE;
}
示例2: file
} else {
include_once CLASS_FILE;
$file = new file();
if ($file->mkdir(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], 0775)) {
include_once CLASS_MANAGER;
$manager = new manager(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], false);
$pathInfo = $manager->getFolderInfo(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']);
foreach ($pathInfo as $k => $v) {
switch ($k) {
case "ctime":
case "mtime":
case "atime":
$v = date(DATE_TIME_FORMAT, $v);
break;
case 'name':
$info .= sprintf(", %s:'%s'", 'short_name', shortenFileName($v));
break;
case 'cssClass':
$v = 'folderEmpty';
break;
}
$info .= sprintf(", %s:'%s'", $k, $v);
}
} else {
$error = ERR_FOLDER_CREATION_FAILED;
}
//$error = "For security reason, folder creation function has been disabled.";
}
}
echo "error:'" . $error . "'";
echo $info;
示例3: dirname
<?php
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php";
if (!defined('_PS_ADMIN_DIR_')) {
define('_PS_ADMIN_DIR_', getcwd() . '/../');
}
require_once _PS_ADMIN_DIR_ . '/../config/config.inc.php';
require_once _PS_ADMIN_DIR_ . '/init.php';
?>
<select class="input inputSearch" name="search_folder" id="search_folder">
<?php
foreach (getFolderListing(CONFIG_SYS_ROOT_PATH) as $k => $v) {
?>
<option value="<?php
echo $v;
?>
" ><?php
echo shortenFileName($k, 30);
?>
</option>
<?php
}
?>
</select>
示例4: echo
ajaxStart('#searchFolderContainer');
$('#searchFolderContainer').load('<?php echo CONFIG_URL_LOAD_FOLDERS; ?>');
}
);
</script>
<?php
}else
{
?>
<select class="input inputSearch" name="search_folder" id="search_folder">
<?php
foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
{
?>
<option value="<?php echo $v; ?>" <?php echo (removeTrailingSlash(backslashToSlash(($folderInfo['path']))) == removeTrailingSlash(backslashToSlash(($v)))?' selected="selected"':''); ?>><?php echo shortenFileName($k, 30); ?></option>
<?php
}
?>
</select>
<?php
}
?></span>
</td>
</tr>
<tr>
<td>
<b><?php echo LBL_SEARCH_MTIME; ?></b><br />
<input type="text" class="input inputMtime" name="search_mtime_from" id="search_mtime_from" value="<?php echo (!empty($_GET['search_mtime_from'])?$_GET['search_mtime_from']:''); ?>" />
<span class="leftToRightArrow"> </span>
示例5: foreach
<select class="input inputSearchSelect" name="search_folder" id="search_folder">
<!-- Chamilo integrating, modify name class for disable by css -->
<?php
foreach (getFolderListing(CONFIG_SYS_ROOT_PATH) as $k => $v) {
if (hideFolderName($k)) {
//show only those permitted by Chamilo
?>
<option value="<?php
echo $v;
?>
" <?php
echo removeTrailingSlash(backslashToSlash($folderInfo['path'])) == removeTrailingSlash(backslashToSlash($v)) ? ' selected="selected"' : '';
?>
><?php
echo hideFolderName(shortenFileName($k, 30));
?>
</option>
<?php
}
}
?>
</select>
<?php
}
?>
</span>
<b><?php
//echo LBL_SEARCH_MTIME;
?>
</b><br/>
示例6: shortenFileName
?>
" type="checkbox" name="check[]" <?php
echo $file['is_writable'] ? '' : 'disabled';
?>
class="radio" value="<?php
echo $file['path'];
?>
" />
<a <?php
echo $file['cssClass'] == 'filePicture' ? 'rel="orgImg"' : '';
?>
href="<?php
echo $file['path'];
?>
" title="<?php
echo $file['name'];
?>
" id="a<?php
echo $count;
?>
"><?php
echo shortenFileName($file['name']);
?>
</a></dd>
</dl>
<?php
$count++;
}
?>
</div>
示例7: shortenFileName
<?php
if(!defined('AJAX_INIT_DONE'))
{
die('Permission denied');
}
?><?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
?>
<select class="input inputSearch" name="search_folder" id="search_folder">
<?php
foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
{
?>
<option value="<?php echo $v; ?>" ><?php echo shortenFileName($k, 30); ?></option>
<?php
}
?>
</select>
示例8: echo
{
?>
<dl class="thumbnailListing" id="dl<?php echo $count; ?>">
<dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' && empty($file['file']) && empty($file['subdir'])?'folderEmpty':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>">
<?php
switch($file['cssClass'])
{
case 'filePicture':
echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">';
echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n";
break;
case 'fileFlash':
case 'fileVideo':
case 'fileMusic':
break;
default:
echo ' ';
}
?>
</dt>
<dd id="dd<?php echo $count; ?>" class="thumbnailListing_info"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable']?'':'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" />
<a <?php echo ($file['cssClass']== 'filePicture'?'rel="orgImg"':''); ?> href="<?php echo $file['path']; ?>" title="<?php echo $file['name']; ?>" id="a<?php echo $count; ?>"><?php echo shortenFileName($file['name']); ?></a></dd>
</dl>
<?php
$count++;
}
?>
</div>
示例9: shortenFileName
<div id="content">
<ul id="textListing">
<?php
$count = 1;
foreach($fileList as $file)
{
?>
<li id="li<?php echo $count; ?>"><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" class="input" />
<a href="<?php echo $file['path']; ?>" title="<?php echo $file['name']; ?>" id="a<?php echo $count; ?>"><?php echo shortenFileName($file['name']); ?></a></li>
<?php
$count++;
}
?>
</ul>
</div>