/**
  * Gets file info for ExtJs tree node
  *
  * @param  $file
  * @return array
  */
 protected function getFileInfo($file)
 {
     $unknownType = $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:ext_details_file_unknownType');
     $imageType = $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:ext_details_file_imageType');
     $textType = $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:ext_details_file_textType');
     $extType = $GLOBALS['LANG']->sL('LLL:EXT:em/language/locallang.xml:ext_details_file_extType');
     $editTypes = explode(',', $GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext']);
     $imageTypes = array('gif', 'jpg', 'png');
     $fileExt = '';
     $type = '';
     $cls = t3lib_iconWorks::mapFileExtensionToSpriteIconClass('');
     if (strrpos($file, '.') !== FALSE) {
         $fileExt = strtolower(substr($file, strrpos($file, '.') + 1));
     }
     if ($fileExt && in_array($fileExt, $imageTypes) || in_array($fileExt, $editTypes)) {
         $cls = t3lib_iconWorks::mapFileExtensionToSpriteIconClass($fileExt);
         $type = in_array($fileExt, $imageTypes) ? 'image' : 'text';
     }
     if (t3lib_div::strtolower($file) === 'changelog') {
         $cls = t3lib_iconWorks::mapFileExtensionToSpriteIconClass('txt');
         $type = 'text';
     }
     switch ($type) {
         case 'image':
             $label = $imageType;
             break;
         case 'text':
             $label = $textType;
             break;
         default:
             $label = $fileExt ? sprintf($extType, $fileExt) : $unknownType;
     }
     return array(htmlspecialchars($file), $label, htmlspecialchars($fileExt), $type, $cls);
 }