本文整理汇总了PHP中file::getFullPathTo方法的典型用法代码示例。如果您正苦于以下问题:PHP file::getFullPathTo方法的具体用法?PHP file::getFullPathTo怎么用?PHP file::getFullPathTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类file
的用法示例。
在下文中一共展示了file::getFullPathTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFullPathTo
public static function getFullPathTo($parent)
{
$path = "";
if ($parent > 0) {
$folder = new file();
$folder->load($parent);
$path = file::getFullPathTo($folder->parent);
$path .= '/' . $folder->name;
}
return $path;
}
示例2: generate
public function generate()
{
global $layout;
global $website;
$html = array();
$access = array(0 => '', 1 => '<img src="img/icons/silk/lock.png" align="absmiddle" title="' . t(361, 'Web users only') . '" />', 2 => '<img src="img/icons/silk/user_gray.png" align="absmiddle" title="' . t(363, 'Users who have not yet signed up or signed in') . '" />', 3 => '<img src="img/icons/silk/group_key.png" align="absmiddle" title="' . t(512, "Selected web user groups") . '" />');
$permissions = array(0 => '', 1 => '<img src="img/icons/silk/world_dawn.png" align="absmiddle" title="' . t(70, 'Private') . '" />', 2 => '<img src="img/icons/silk/world_night.png" align="absmiddle" title="' . t(81, 'Hidden') . '" />');
$html[] = '<div class="navigate-content-safe ui-corner-all" id="navigate-content-safe">';
$html[] = '<div class="navibrowse" id="' . $this->id . '">';
$html[] = '<div class="navibrowse-path ui-corner-all">';
$html[] = ' <a href="?fid=' . $_REQUEST['fid'] . '"><img src="img/icons/silk/folder_home.png" width="16px" height="16px" align="absbottom" /> ' . t(18, 'Home') . '</a>';
if ($this->parent > 0) {
$html[] = ' <a href="?fid=' . $_REQUEST['fid'] . '&parent=' . $this->previous . '"><img src="img/icons/silk/folder_up.png" width="16px" height="16px" align="absbottom" /> ' . t(139, 'Back') . '</a>';
}
// recent folders
$function_id = $_REQUEST['fid'];
if (!is_numeric($function_id)) {
$f = core_load_function($_REQUEST['fid']);
$function_id = $f->id;
}
$actions = users_log::recent_actions($function_id, 'list', 8);
if (!empty($actions)) {
$html[] = ' <a href="#" id="navigate-navibrowse-recent-items-link"><img src="img/icons/silk/folder_bell.png" width="16px" height="16px" align="absbottom" /> ' . t(275, 'Recent elements') . ' <span style=" float: right; " class="ui-icon ui-icon-triangle-1-s"></span></i></a>';
$layout->add_content('<ul id="navigate-navibrowse-recent-items" class="hidden">' . implode("\n", array_map(function ($action) {
return '<li>' . '<a href="?fid=' . $_REQUEST['fid'] . '&parent=' . $action->item . '">' . '<img src="img/icons/silk/folder.png" style="vertical-align: text-bottom;" /> ' . file::getFullPathTo($action->item) . '</a>' . '</li>';
}, $actions)) . '</ul>');
$layout->add_script('
$("#navigate-navibrowse-recent-items-link").on("click", function(e)
{
e.preventDefault();
e.stopPropagation();
$("#navigate-navibrowse-recent-items").css({
position: "absolute",
top: $("#navigate-navibrowse-recent-items-link").offset().top + 26,
left: $("#navigate-navibrowse-recent-items-link").offset().left,
zIndex: 10,
"min-width": $("#navigate-navibrowse-recent-items-link").width() + "px"
});
$("#navigate-navibrowse-recent-items").addClass("navi-ui-widget-shadow");
$("#navigate-navibrowse-recent-items").removeClass("hidden");
$("#navigate-navibrowse-recent-items").menu().show();
return false;
});
');
}
// folders hierarchy
$html[] = ' <a href="#" onclick="navibrowse_folder_tree_dialog(' . $this->parent . ');"><img src="img/icons/silk/application_side_tree.png" width="16px" height="16px" align="absbottom" /> ' . t(75, 'Path') . ': ' . $this->path . '</a>';
$html[] = '
<div style="float: right;">
<i class="fa fa-filter"></i>
<select id="navibrowse-filter-type" name="navibrowse-filter-type">
<option value="" selected="selected">(' . t(443, "All") . ')</option>
<option value="folder">' . t(141, "Folder") . '</option>
<option value="image">' . t(157, 'Image') . '</option>
<option value="audio">' . t(31, 'Audio') . '</option>
<option value="document">' . t(539, 'Document') . '</option>
<option value="video">' . t(30, 'Video') . '</option>
</select>
</div>
';
$layout->add_script('
$("#navibrowse-filter-type")
.select2(
{
placeholder: "' . t(160, "Type") . '",
allowClear: true,
minimumResultsForSearch: Infinity,
width: 150,
templateResult: navibrowse_filter_type_render,
templateSelection: navibrowse_filter_type_render
})
.on("select2:unselecting", function(e)
{
$(this).select2("val", "");
$(this).val("");
e.preventDefault();
$(this).trigger("change");
});
function navibrowse_filter_type_render(opt)
{
if(!opt.id) { return opt.text; }
var icon = "fa-file";
switch(opt.element.value)
{
case "folder": icon = "fa-folder-o"; break;
case "image": icon = "fa-image"; break;
case "audio": icon = "fa-music"; break;
case "document": icon = "fa-file-text-o"; break;
case "video": icon = "fa-video-camera"; break;
}
var html = $(\'<span><i class="fa fa-fw \'+icon+\'"></i> \' + opt.text + \'</span>\');
return html;
}
$("#navibrowse-filter-type").on("change", function () {
//.........这里部分代码省略.........
示例3: files_media_browser
//.........这里部分代码省略.........
$order = ' date_added ASC';
break;
case 'date_added_DESC':
default:
$order = ' date_added DESC';
}
if ($media == 'folder') {
$parent = 0;
$files = file::filesOnPath($_REQUEST['parent'], $wid, $order);
if ($_REQUEST['parent'] > 0) {
$previous = $DB->query_single('parent', 'nv_files', ' id = ' . $_REQUEST['parent'] . ' AND website = ' . $wid);
array_unshift($files, json_decode('{"id":"' . $previous . '","type":"folder","name":"' . t(139, 'Back') . '","mime":"folder\\/back","navipath":"/foo"}'));
}
$total = count($files);
$files_shown = array();
for ($i = $offset; $i + $offset < $limit; $i++) {
if (empty($files[$i])) {
break;
}
// search by text in a folder
if (!empty($text)) {
if (stripos($files[$i]->name, $text) === false) {
continue;
}
}
$files_shown[] = $files[$i];
}
} else {
if ($media == 'youtube') {
//list($files_shown, $total) = files_youtube_search($offset, $limit, $text, $order);
} else {
list($files_shown, $total) = file::filesByMedia($media, $offset, $limit, $wid, $text, $order);
}
}
foreach ($files_shown as $f) {
$website_root = $ws->absolute_path(true) . '/object';
if (empty($website_root)) {
$website_root = NVWEB_OBJECT;
}
$download_link = $website_root . '?id=' . $f->id . '&disposition=attachment';
if ($f->type == 'image') {
$f->title = json_decode($f->title, true);
$f->description = json_decode($f->description, true);
$icon = NAVIGATE_DOWNLOAD . '?wid=' . $wid . '&id=' . $f->id . '&disposition=inline&width=75&height=75';
$out[] = '<div class="ui-corner-all draggable-' . $f->type . '"
mediatype="' . $f->type . '"
mimetype="' . $f->mime . '"
image-width="' . $f->width . '"
image-height="' . $f->height . '"
image-title="' . base64_encode(json_encode($f->title, JSON_HEX_QUOT | JSON_HEX_APOS)) . '"
image-description="' . base64_encode(json_encode($f->description, JSON_HEX_QUOT | JSON_HEX_APOS)) . '"
download-link="' . $download_link . '"
data-file-id="' . $f->id . '"
id="file-' . $f->id . '">
<div class="file-access-icons">' . $access[$f->access] . $permissions[$f->permission] . '</div>
<div class="file-image-wrapper"><img src="' . $icon . '" title="' . $f->name . '" /></div>
</div>';
} else {
if ($f->type == 'youtube') {
$out[] = '<div class="ui-corner-all draggable-' . $f->type . '"
mediatype="' . $f->type . '"
mimetype="' . $f->mime . '"
image-width="' . $f->width . '"
image-height="' . $f->height . '"
image-title="' . base64_encode(json_encode($f->title, JSON_HEX_QUOT | JSON_HEX_APOS)) . '"
image-description="' . base64_encode(json_encode($f->description, JSON_HEX_QUOT | JSON_HEX_APOS)) . '"
download-link="' . $download_link . '"
data-file-id="' . $f->id . '"
id="file-youtube#' . $f->id . '">
<img src="' . $f->thumbnail->url . '" title="' . $f->title . '" width="75" height="53" />
<span>' . $f->title . '</span>
</div>';
} else {
$icon = navibrowse::mimeIcon($f->mime, $f->type);
$navipath = file::getFullPathTo($f->id);
$out[] = '<div class="ui-corner-all draggable-' . $f->type . '"
mediatype="' . $f->type . '"
mimetype="' . $f->mime . '"
navipath="' . $navipath . '"
download-link="' . $download_link . '"
data-file-id="' . $f->id . '"
id="file-' . $f->id . '">
<div class="file-access-icons">' . $access[$f->access] . $permissions[$f->permission] . '</div>
<div class="file-icon-wrapper"><img src="' . $icon . '" width="50" height="50" title="' . $f->name . '" /></div>
<span style="clear: both; display: block; height: 0px;"></span>' . $f->name . '
</div>';
}
}
}
if ($total > $limit + $offset) {
$out[] = '<div class="ui-corner-all" id="file-more">
<img src="' . NAVIGATE_URL . '/img/icons/ricebowl/actions/forward.png" width="32" height="32" style="margin-top: 14px;" />' . t(234, 'More elements') . '
</div>';
}
echo implode("\n", $out);
}
session_write_close();
$DB->disconnect();
exit;
}