本文整理汇总了PHP中format::filename方法的典型用法代码示例。如果您正苦于以下问题:PHP format::filename方法的具体用法?PHP format::filename怎么用?PHP format::filename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类format
的用法示例。
在下文中一共展示了format::filename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: files_and_folders
//.........这里部分代码省略.........
}
} else {
if ($file->have_access($current_user)) {
$include = true;
$have_access = true;
} else {
$have_access = false;
$restricted = true;
}
}
if (!$hide_locked) {
$include = true;
}
if ($include) {
if ($kind == "img" && !$file->needs_thumbnail()) {
// don't show listing for image smaller than thumbnail;
continue;
}
$kind_display = isset($file_kind['display']) ? $file_kind['display'] : '';
$icon_file = "";
$new = false;
$updated = false;
if (false && $file->stats['ctime'] > $new_updated_start) {
$new = true;
} else {
if ($file->stats['mtime'] > $new_updated_start) {
$updated = true;
}
}
$icon_file = Subfolio::$filekind->get_icon_by_file($file_kind);
$listing_mode = Subfolio::$filebrowser->get_folder_property('listing_mode', $listing_mode);
if ($icon_file == "gen" && $file->type == "folder") {
$icon_file = "dir";
}
// to be confirmed
if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod')) {
$listing_mode = 'grid';
}
$icon_set = view::get_option('icon_set_list', "list");
$icon_set_grid = view::get_option('icon_set_grid', "grid");
$icon = view::get_view_url() . "/images/icons/" . $icon_set . "/" . $icon_file . ".png";
$icon_grid = view::get_view_url() . "/images/icons/" . $icon_set_grid . "/" . $icon_file . ".png";
$target = "";
$url = "";
$display = "";
switch ($kind) {
case "slide":
$slide_files = Subfolio::$filebrowser->get_file_list(null, $file->name . "/");
$slide_files = Subfolio::$filebrowser->sort($slide_files);
if (sizeof($slide_files) == 0) {
$url = Subfolio::$filebrowser->get_link($file->name);
} else {
$url = Subfolio::$filebrowser->get_link($slide_files[0]->name);
}
$display = format::filename($file->get_display_name($replace_dash_space, $replace_underscore_space, $display_file_extensions), false);
break;
case "pop":
$width = Subfolio::$filebrowser->get_item_property($file->name, 'width') ? Subfolio::$filebrowser->get_item_property($file->name, 'width') : 800;
$height = Subfolio::$filebrowser->get_item_property($file->name, 'height') ? Subfolio::$filebrowser->get_item_property($file->name, 'height') : 600;
$url = Subfolio::$filebrowser->get_item_property($file->name, 'url') ? Subfolio::$filebrowser->get_item_property($file->name, 'url') : 'http://www.subfolio.com';
$name = Subfolio::$filebrowser->get_item_property($file->name, 'name') ? Subfolio::$filebrowser->get_item_property($file->name, 'name') : 'POPUP';
$style = Subfolio::$filebrowser->get_item_property($file->name, 'style') ? Subfolio::$filebrowser->get_item_property($file->name, 'style') : 'POPSCROLL';
$url = "javascript:pop('{$url}','{$name}',{$width},{$height},'{$style}');";
$display = format::filename($file->get_display_name($replace_dash_space, $replace_underscore_space, TRUE), false);
break;
case "link":
$url = Subfolio::$filebrowser->get_item_property($file->name, 'url') ? Subfolio::$filebrowser->get_item_property($file->name, 'url') : '';
$target = Subfolio::$filebrowser->get_item_property($file->name, 'target') ? Subfolio::$filebrowser->get_item_property($file->name, 'target') : '_blank';
$display = format::filename($file->get_display_name($replace_dash_space, $replace_underscore_space, TRUE), false);
if ($url == '') {
$url = "http://" . substr($file->name, 0, strrpos($file->name, "."));
}
break;
default:
$url = Subfolio::$filebrowser->get_link($file->name);
$display = $file->get_display_name($replace_dash_space, $replace_underscore_space, $display_file_extensions);
break;
}
$item = array();
$item['empty'] = $empty;
$item['target'] = $target;
$item['url'] = $url;
$item['icon'] = $icon;
$item['icon_grid'] = $icon_grid;
$item['filename'] = $display;
$item['size'] = format::filesize($file->stats['size']);
$item['date'] = format::filedate($file->stats['mtime']);
$item['kind'] = $kind_display;
$item['comment'] = format::get_rendered_text(Subfolio::$filebrowser->get_item_property($file->name, 'comment'));
$item['restricted'] = $restricted;
$item['have_access'] = $have_access;
$item['new'] = $new;
$item['updated'] = $updated;
$list[] = $item;
}
}
}
}
return $list;
}