diff --git a/lib/mime.inc.php b/lib/mime.inc.php
index 941c06b..9345d31 100644
--- a/lib/mime.inc.php
+++ b/lib/mime.inc.php
@@ -183,13 +183,17 @@ class KTMime {
return null;
}
- function getIconPath($iMimeTypeId) {
- $cached = KTUtil::arrayGet($GLOBALS['_KT_icon_path_cache'], $iMimeTypeId);
- if (!empty($cached)) {
- return $cached;
+ function getIconPath($iMimeTypeId, $type = null) {
+ $icon = KTUtil::arrayGet($GLOBALS['_KT_icon_path_cache'], $iMimeTypeId);
+ if (empty($icon)) {
+ $GLOBALS['_KT_icon_path_cache'][$iMimeTypeId] = KTMime::_getIconPath($iMimeTypeId);
+ $icon = $GLOBALS['_KT_icon_path_cache'][$iMimeTypeId];
}
- $GLOBALS['_KT_icon_path_cache'][$iMimeTypeId] = KTMime::_getIconPath($iMimeTypeId);
- return $GLOBALS['_KT_icon_path_cache'][$iMimeTypeId];
+
+ if(!empty($type)){
+ $icon .= '_'.$type;
+ }
+ return $icon;
}
function _getIconPath($iMimeTypeId) {
diff --git a/plugins/ktcore/KTColumns.inc.php b/plugins/ktcore/KTColumns.inc.php
index 8fc39d1..a54d887 100644
--- a/plugins/ktcore/KTColumns.inc.php
+++ b/plugins/ktcore/KTColumns.inc.php
@@ -166,25 +166,33 @@ class AdvancedTitleColumn extends AdvancedColumn {
// use inline, since its just too heavy to even _think_ about using smarty.
function renderData($aDataRow) {
- if ($aDataRow["type"] == "folder") {
- $contenttype = 'folder';
- $link = $this->renderFolderLink($aDataRow);
- if($aDataRow['folder']->isSymbolicLink()){
- return "
$link
";
- }else{
- return "
$link";
- }
+ if ($aDataRow["type"] == "folder") {
+ $contenttype = 'folder';
+ $link = $this->renderFolderLink($aDataRow);
+
+ // If folder is a shortcut display the shortcut mime icon
+ if($aDataRow['folder']->isSymbolicLink()){
+ $contenttype .= '_shortcut';
+ }
+ // Separate the link from the mime icon to allow for right-to-left languages
+ return "
$link";
} else {
- $contenttype = $this->_mimeHelper($aDataRow["document"]->getMimeTypeId());
- $link = $this->renderDocumentLink($aDataRow);
+ $type = '';
+ $size = '';
+ if($aDataRow['document']->isSymbolicLink()){
+ // If document is a shortcut - display the shortcut mime type
+ $type = 'shortcut';
+ }else{
+ // Display the document size if it is not a shortcut
+ $size = $this->prettySize($aDataRow["document"]->getSize());
+ $size = " ($size)";
+ }
- //Render an image instead of the size in case of a shortcut
- if($aDataRow['document']->isSymbolicLink()){
- return "
$link";
- }else{
- $size = $this->prettySize($aDataRow["document"]->getSize());
- return "
$link
($size)";
- }
+ $link = $this->renderDocumentLink($aDataRow);
+ $contenttype = $this->_mimeHelper($aDataRow["document"]->getMimeTypeId(), $type);
+
+ // Separate the link from the mime icon and the size to allow for right-to-left languages
+ return "
$link
$size";
}
}
@@ -197,9 +205,9 @@ class AdvancedTitleColumn extends AdvancedColumn {
return $finalSize . $label;
}
- function _mimeHelper($iMimeTypeId) {
+ function _mimeHelper($iMimeTypeId, $type = null) {
require_once(KT_LIB_DIR . '/mime.inc.php');
- return KTMime::getIconPath($iMimeTypeId);
+ return KTMime::getIconPath($iMimeTypeId, $type);
}
}
diff --git a/resources/css/kt-contenttypes.css b/resources/css/kt-contenttypes.css
index fb51789..a23c721 100644
--- a/resources/css/kt-contenttypes.css
+++ b/resources/css/kt-contenttypes.css
@@ -17,27 +17,32 @@
}
.contenttype.office { background-image: url(../../resources/mimetypes/office.png); }
-.contenttype.office.shortcut { background-image: url(../../resources/mimetypes/shortcuts/office.png); }
+.contenttype.office_shortcut { background-image: url(../../resources/mimetypes/shortcuts/office.png); }
.contenttype.word { background-image: url(../../resources/mimetypes/word.png); }
-.contenttype.word.shortcut { background-image: url(../../resources/mimetypes/shortcuts/word.png); }
+.contenttype.word_shortcut { background-image: url(../../resources/mimetypes/shortcuts/word.png); }
.contenttype.database { background-image: url(../../resources/mimetypes/database.png); }
-.contenttype.database.shortcut { background-image: url(../../resources/mimetypes/shortcuts/database.png); }
+.contenttype.database_shortcut { background-image: url(../../resources/mimetypes/shortcuts/database.png); }
.contenttype.excel { background-image: url(../../resources/mimetypes/excel.png); }
-.contenttype.excel.shortcut { background-image: url(../../resources/mimetypes/shortcuts/excel.png); }
+.contenttype.excel_shortcut { background-image: url(../../resources/mimetypes/shortcuts/excel.png); }
.contenttype.openoffice { background-image: url(../../resources/mimetypes/openoffice.png); }
-.contenttype.openoffice.shortcut { background-image: url(../../resources/mimetypes/shortcuts/openoffice.png); }
+.contenttype.openoffice_shortcut { background-image: url(../../resources/mimetypes/shortcuts/openoffice.png); }
.contenttype.opendocument { background-image: url(../../resources/mimetypes/openoffice.png); }
-.contenttype.opendocument.shortcut { background-image: url(../../resources/mimetypes/shortcuts/openoffice.png); }
+.contenttype.opendocument_shortcut { background-image: url(../../resources/mimetypes/shortcuts/openoffice.png); }
.contenttype.pdf { background-image: url(../../resources/mimetypes/pdf.png); }
-.contenttype.pdf.shortcut { background-image: url(../../resources/mimetypes/shortcuts/pdf.png); }
+.contenttype.pdf_shortcut { background-image: url(../../resources/mimetypes/shortcuts/pdf.png); }
.contenttype.image { background-image: url(../../resources/mimetypes/image.png); }
-.contenttype.image.shortcut { background-image: url(../../resources/mimetypes/shortcuts/image.png); }
+.contenttype.image_shortcut { background-image: url(../../resources/mimetypes/shortcuts/image.png); }
.contenttype.compressed { background-image: url(../../resources/mimetypes/zip.png); }
-.contenttype.compressed.shortcut { background-image: url(../../resources/mimetypes/shortcuts/zip.png); }
+.contenttype.compressed_shortcut { background-image: url(../../resources/mimetypes/shortcuts/zip.png); }
.contenttype.html { background-image: url(../../resources/mimetypes/html.png); }
-.contenttype.html.shortcut { background-image: url(../../resources/mimetypes/shortcuts/html.png); }
+.contenttype.html_shortcut { background-image: url(../../resources/mimetypes/shortcuts/html.png); }
.contenttype.txt,
.contenttype.text,
.contenttype.unspecified_type { background-image: url(../../thirdparty/icon-theme/16x16/mimetypes/text-x-generic.png); }
+.contenttype.txt_shortcut,
+.contenttype.text_shortcut,
+.contenttype.unspecified_type_shortcut { background-image: url(../../resources/mimetypes/shortcuts/text-x-generic.png); }
+
.contenttype.folder { background-image: url(../../thirdparty/icon-theme/16x16/mimetypes/x-directory-normal.png); }
+.contenttype.folder_shortcut { background-image: url(../../resources/mimetypes/shortcuts/x-directory-normal.png); }
diff --git a/resources/css/kt-ie-icons.css b/resources/css/kt-ie-icons.css
index 55b0905..15cd91b 100644
--- a/resources/css/kt-ie-icons.css
+++ b/resources/css/kt-ie-icons.css
@@ -34,11 +34,14 @@
.ktActionLink.ktMoveUp, .ktAction.ktMoveUp { background-image: url(../../thirdparty/icon-theme/16x16/actions/move-up.gif); }
.ktActionLink.ktMoveDown, .ktAction.ktMoveDown { background-image: url(../../thirdparty/icon-theme/16x16/actions/move-down.gif); }
.ktBlock {margin: 0.5em 0;}
+
+/* Mime type icons */
.contenttype.office { background-image: url(../../resources/mimetypes/office.gif); }
.contenttype.word { background-image: url(../../resources/mimetypes/word.gif); }
.contenttype.database { background-image: url(../../resources/mimetypes/database.gif); }
.contenttype.excel { background-image: url(../../resources/mimetypes/excel.gif); }
.contenttype.openoffice { background-image: url(../../resources/mimetypes/openoffice.gif); }
+.contenttype.opendocument { background-image: url(../../resources/mimetypes/openoffice.gif); }
.contenttype.pdf { background-image: url(../../resources/mimetypes/pdf.gif); }
.contenttype.image { background-image: url(../../resources/mimetypes/image.gif); }
.contenttype.compressed { background-image: url(../../resources/mimetypes/zip.gif); }
@@ -49,6 +52,25 @@
.contenttype.unspecified_type { background-image: url(../../thirdparty/icon-theme/16x16/mimetypes/text-x-generic.gif); }
.contenttype.folder { background-image: url(../../thirdparty/icon-theme/16x16/mimetypes/x-directory-normal.gif); }
+/* Mime type short cut icons - IE gets confused if the last class is the same for multiple selection so we append _shortcut instead of
+using .shortcut */
+.contenttype.txt_shortcut,
+.contenttype.text_shortcut,
+.contenttype.unspecified_type_shortcut { background-image: url(../../resources/mimetypes/shortcuts/text-x-generic.gif); }
+.contenttype.folder_shortcut { background-image: url(../../resources/mimetypes/shortcuts/x-directory-normal.gif); }
+
+.contenttype.html_shortcut { background-image: url(../../resources/mimetypes/shortcuts/html.gif); }
+.contenttype.office_shortcut { background-image: url(../../resources/mimetypes/shortcuts/office.gif); }
+.contenttype.word_shortcut { background-image: url(../../resources/mimetypes/shortcuts/word.gif); }
+.contenttype.database_shortcut { background-image: url(../../resources/mimetypes/shortcuts/database.gif); }
+.contenttype.excel_shortcut { background-image: url(../../resources/mimetypes/shortcuts/excel.gif); }
+.contenttype.openoffice_shortcut { background-image: url(../../resources/mimetypes/shortcuts/openoffice.gif); }
+.contenttype.opendocument_shortcut { background-image: url(../../resources/mimetypes/shortcuts/openoffice.gif); }
+.contenttype.pdf_shortcut { background-image: url(../../resources/mimetypes/shortcuts/pdf.gif); }
+.contenttype.image_shortcut { background-image: url(../../resources/mimetypes/shortcuts/image.gif); }
+.contenttype.compressed_shortcut { background-image: url(../../resources/mimetypes/shortcuts/zip.gif); }
+
+
/* IE is woefully unable to */
#portletbar {
width: 200px;
diff --git a/resources/mimetypes/shortcuts/access.gif b/resources/mimetypes/shortcuts/access.gif
new file mode 100755
index 0000000..d70eaff
--- /dev/null
+++ b/resources/mimetypes/shortcuts/access.gif
diff --git a/resources/mimetypes/shortcuts/code.gif b/resources/mimetypes/shortcuts/code.gif
new file mode 100755
index 0000000..af893eb
--- /dev/null
+++ b/resources/mimetypes/shortcuts/code.gif
diff --git a/resources/mimetypes/shortcuts/database.gif b/resources/mimetypes/shortcuts/database.gif
new file mode 100755
index 0000000..a4031b4
--- /dev/null
+++ b/resources/mimetypes/shortcuts/database.gif
diff --git a/resources/mimetypes/shortcuts/excel.gif b/resources/mimetypes/shortcuts/excel.gif
new file mode 100755
index 0000000..d920acd
--- /dev/null
+++ b/resources/mimetypes/shortcuts/excel.gif
diff --git a/resources/mimetypes/shortcuts/flash.gif b/resources/mimetypes/shortcuts/flash.gif
new file mode 100755
index 0000000..5289272
--- /dev/null
+++ b/resources/mimetypes/shortcuts/flash.gif
diff --git a/resources/mimetypes/shortcuts/html.gif b/resources/mimetypes/shortcuts/html.gif
new file mode 100755
index 0000000..9db83ad
--- /dev/null
+++ b/resources/mimetypes/shortcuts/html.gif
diff --git a/resources/mimetypes/shortcuts/image.gif b/resources/mimetypes/shortcuts/image.gif
new file mode 100755
index 0000000..49f4e7e
--- /dev/null
+++ b/resources/mimetypes/shortcuts/image.gif
diff --git a/resources/mimetypes/shortcuts/openoffice.gif b/resources/mimetypes/shortcuts/openoffice.gif
new file mode 100755
index 0000000..a28037c
--- /dev/null
+++ b/resources/mimetypes/shortcuts/openoffice.gif
diff --git a/resources/mimetypes/shortcuts/pdf.gif b/resources/mimetypes/shortcuts/pdf.gif
new file mode 100755
index 0000000..facd654
--- /dev/null
+++ b/resources/mimetypes/shortcuts/pdf.gif
diff --git a/resources/mimetypes/shortcuts/php.gif b/resources/mimetypes/shortcuts/php.gif
new file mode 100755
index 0000000..e655e25
--- /dev/null
+++ b/resources/mimetypes/shortcuts/php.gif
diff --git a/resources/mimetypes/shortcuts/run.gif b/resources/mimetypes/shortcuts/run.gif
new file mode 100755
index 0000000..e054736
--- /dev/null
+++ b/resources/mimetypes/shortcuts/run.gif
diff --git a/resources/mimetypes/shortcuts/text-x-generic.gif b/resources/mimetypes/shortcuts/text-x-generic.gif
new file mode 100755
index 0000000..3655acf
--- /dev/null
+++ b/resources/mimetypes/shortcuts/text-x-generic.gif
diff --git a/resources/mimetypes/shortcuts/text-x-generic.png b/resources/mimetypes/shortcuts/text-x-generic.png
new file mode 100644
index 0000000..86c86e1
--- /dev/null
+++ b/resources/mimetypes/shortcuts/text-x-generic.png
diff --git a/resources/mimetypes/shortcuts/vector-image.gif b/resources/mimetypes/shortcuts/vector-image.gif
new file mode 100755
index 0000000..b9061f3
--- /dev/null
+++ b/resources/mimetypes/shortcuts/vector-image.gif
diff --git a/resources/mimetypes/shortcuts/word.gif b/resources/mimetypes/shortcuts/word.gif
new file mode 100755
index 0000000..a2873f1
--- /dev/null
+++ b/resources/mimetypes/shortcuts/word.gif
diff --git a/resources/mimetypes/shortcuts/x-directory-normal.gif b/resources/mimetypes/shortcuts/x-directory-normal.gif
new file mode 100755
index 0000000..cbb751b
--- /dev/null
+++ b/resources/mimetypes/shortcuts/x-directory-normal.gif
diff --git a/resources/mimetypes/shortcuts/x-directory-normal.png b/resources/mimetypes/shortcuts/x-directory-normal.png
new file mode 100644
index 0000000..af6d2c9
--- /dev/null
+++ b/resources/mimetypes/shortcuts/x-directory-normal.png
diff --git a/resources/mimetypes/shortcuts/zip.gif b/resources/mimetypes/shortcuts/zip.gif
new file mode 100755
index 0000000..bcd48b1
--- /dev/null
+++ b/resources/mimetypes/shortcuts/zip.gif