本文整理汇总了PHP中AJXP_Utils::mimeData方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Utils::mimeData方法的具体用法?PHP AJXP_Utils::mimeData怎么用?PHP AJXP_Utils::mimeData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AJXP_Utils
的用法示例。
在下文中一共展示了AJXP_Utils::mimeData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadNodeInfo
/**
* @param AJXP_Node $ajxpNode
* @param bool $parentNode
* @param bool $details
* @return void
*/
public function loadNodeInfo(&$ajxpNode, $parentNode = false, $details = false)
{
$nodeName = basename($ajxpNode->getPath());
$metaData = $ajxpNode->metadata;
if (!isset($metaData["is_file"])) {
$isLeaf = is_file($ajxpNode->getUrl()) || AJXP_Utils::isBrowsableArchive($nodeName);
$metaData["is_file"] = $isLeaf ? "1" : "0";
} else {
$isLeaf = $metaData["is_file"] == "1" ? true : false;
}
$metaData["filename"] = $ajxpNode->getPath();
if (RecycleBinManager::recycleEnabled() && $ajxpNode->getPath() == RecycleBinManager::getRelativeRecycle()) {
$mess = ConfService::getMessages();
$recycleIcon = $this->countFiles($ajxpNode->getUrl(), false, true) > 0 ? "trashcan_full.png" : "trashcan.png";
$metaData["icon"] = $recycleIcon;
$metaData["mimestring"] = $mess[122];
$ajxpNode->setLabel($mess[122]);
$metaData["ajxp_mime"] = "ajxp_recycle";
} else {
$mimeData = AJXP_Utils::mimeData($ajxpNode->getUrl(), !$isLeaf);
$metaData["mimestring_id"] = $mimeData[0];
//AJXP_Utils::mimetype($ajxpNode->getUrl(), "type", !$isLeaf);
$metaData["icon"] = $mimeData[1];
//AJXP_Utils::mimetype($nodeName, "image", !$isLeaf);
if ($metaData["icon"] == "folder.png") {
$metaData["openicon"] = "folder_open.png";
}
if (!$isLeaf) {
$metaData["ajxp_mime"] = "ajxp_folder";
}
}
//if ($lsOptions["l"]) {
$metaData["file_group"] = @filegroup($ajxpNode->getUrl()) || "unknown";
$metaData["file_owner"] = @fileowner($ajxpNode->getUrl()) || "unknown";
$crtPath = $ajxpNode->getPath();
$vRoots = $this->repository->listVirtualRoots();
if (!empty($crtPath)) {
if (!@$this->isWriteable($ajxpNode->getUrl())) {
$metaData["ajxp_readonly"] = "true";
}
if (isset($vRoots[ltrim($crtPath, "/")])) {
$metaData["ajxp_readonly"] = $vRoots[ltrim($crtPath, "/")]["right"] == "r" ? "true" : "false";
}
} else {
if (count($vRoots)) {
$metaData["ajxp_readonly"] = "true";
}
}
$fPerms = @fileperms($ajxpNode->getUrl());
if ($fPerms !== false) {
$fPerms = substr(decoct($fPerms), $isLeaf ? 2 : 1);
} else {
$fPerms = '0000';
}
$metaData["file_perms"] = $fPerms;
$datemodif = $this->date_modif($ajxpNode->getUrl());
$metaData["ajxp_modiftime"] = $datemodif ? $datemodif : "0";
$metaData["bytesize"] = 0;
if ($isLeaf) {
$metaData["bytesize"] = $this->filesystemFileSize($ajxpNode->getUrl());
}
$metaData["filesize"] = AJXP_Utils::roundSize($metaData["bytesize"]);
if (AJXP_Utils::isBrowsableArchive($nodeName)) {
$metaData["ajxp_mime"] = "ajxp_browsable_archive";
}
if ($details == "minimal") {
$miniMeta = array("is_file" => $metaData["is_file"], "filename" => $metaData["filename"], "bytesize" => $metaData["bytesize"], "ajxp_modiftime" => $metaData["ajxp_modiftime"]);
$ajxpNode->mergeMetadata($miniMeta);
} else {
$ajxpNode->mergeMetadata($metaData);
}
}