Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Font-based mimes
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Jul 11, 2016
1 parent 60dcdcd commit cf0ba6f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions core/src/core/src/pydio/Core/Utils/Vars/StatHelper.php
Expand Up @@ -66,7 +66,7 @@ public static function getMimeInfo($ajxpNode, $isDir = null)
if (!isSet($mime)) {
$mime = $registeredExtensions["ajxp_empty"];
}
return array($mime[2], $mime[1]);
return array($mime[3], $mime[1], $mime[2]);

}

Expand Down Expand Up @@ -95,7 +95,12 @@ private static function getRegisteredExtensions(ContextInterface $ctx)
$res = array();
/** @var \DOMElement $node */
foreach ($nodes as $node) {
$res[$node->getAttribute("mime")] = array($node->getAttribute("mime"), $node->getAttribute("icon"), $node->getAttribute("messageId"));
$res[$node->getAttribute("mime")] = array(
$node->getAttribute("mime"),
$node->getAttribute("icon"),
$node->getAttribute("font"),
$node->getAttribute("messageId")
);
}
if (count($res)) {
$EXTENSIONS = array_merge($EXTENSIONS, $res);
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/access.ajxp_conf/ConfAccessDriver.php
Expand Up @@ -3198,4 +3198,4 @@ public static function availableDriversToXML($filterByTagName = "", $filterByDri
*/
protected function initRepository(ContextInterface $ctx){
}
}
}
4 changes: 4 additions & 0 deletions core/src/plugins/access.fs/FsAccessDriver.php
Expand Up @@ -1586,13 +1586,17 @@ public function loadNodeInfo(&$ajxpNode, $parentNode = false, $details = false)
if (RecycleBinManager::recycleEnabled() && $ajxpNode->getPath() == RecycleBinManager::getRelativeRecycle()) {
$recycleIcon = ($this->countChildren($ajxpNode, false, true)>0?"trashcan_full.png":"trashcan.png");
$metaData["icon"] = $recycleIcon;
$metaData["fonticon"] = "delete";
$metaData["mimestring_id"] = 122;
//$ajxpNode->setLabel($mess[122]);
$metaData["ajxp_mime"] = "ajxp_recycle";
} else {
$mimeData = StatHelper::getMimeInfo($ajxpNode, !$isLeaf);
$metaData["mimestring_id"] = $mimeData[0];
$metaData["icon"] = $mimeData[1];
if(!empty($mimeData[2])){
$metaData["fonticon"] = $mimeData[2];
}
if ($metaData["icon"] == "folder.png") {
$metaData["openicon"] = "folder_open.png";
}
Expand Down

0 comments on commit cf0ba6f

Please sign in to comment.