Alex Trofimov преди 9 години
родител
ревизия
1e7bcb47c4
променени са 54 файла, в които са добавени 3230 реда и са изтрити 914 реда
  1. 42 8
      inc/classes/BxDolStorage.php
  2. 8 2
      inc/classes/BxDolStorageQuery.php
  3. 15 1
      inc/classes/BxDolUploader.php
  4. 998 899
      install/sql/system.sql
  5. 1 1
      modules/base/profile/classes/BxBaseModProfileAlertsResponse.php
  6. 5 3
      modules/base/text/classes/BxBaseModTextFormEntry.php
  7. 21 0
      modules/boonex/files/classes/BxFilesAlertsResponse.php
  8. 24 0
      modules/boonex/files/classes/BxFilesCmtsSearchResult.php
  9. 138 0
      modules/boonex/files/classes/BxFilesConfig.php
  10. 29 0
      modules/boonex/files/classes/BxFilesDb.php
  11. 30 0
      modules/boonex/files/classes/BxFilesFormEntry.php
  12. 82 0
      modules/boonex/files/classes/BxFilesFormUpload.php
  13. 69 0
      modules/boonex/files/classes/BxFilesFormsEntryHelper.php
  14. 21 0
      modules/boonex/files/classes/BxFilesGridAdministration.php
  15. 21 0
      modules/boonex/files/classes/BxFilesGridCommon.php
  16. 24 0
      modules/boonex/files/classes/BxFilesMenu.php
  17. 25 0
      modules/boonex/files/classes/BxFilesMenuManageTools.php
  18. 24 0
      modules/boonex/files/classes/BxFilesMenuView.php
  19. 28 0
      modules/boonex/files/classes/BxFilesModule.php
  20. 24 0
      modules/boonex/files/classes/BxFilesPageAuthor.php
  21. 24 0
      modules/boonex/files/classes/BxFilesPageBrowse.php
  22. 32 0
      modules/boonex/files/classes/BxFilesPageEntry.php
  23. 126 0
      modules/boonex/files/classes/BxFilesSearchResult.php
  24. 27 0
      modules/boonex/files/classes/BxFilesTemplate.php
  25. 33 0
      modules/boonex/files/classes/BxFilesUploaderHTML5.php
  26. 33 0
      modules/boonex/files/classes/BxFilesUploaderSimple.php
  27. 124 0
      modules/boonex/files/install/config.php
  28. 20 0
      modules/boonex/files/install/installer.php
  29. 201 0
      modules/boonex/files/install/langs/en.xml
  30. 45 0
      modules/boonex/files/install/sql/disable.sql
  31. 372 0
      modules/boonex/files/install/sql/enable.sql
  32. 304 0
      modules/boonex/files/install/sql/install.sql
  33. 53 0
      modules/boonex/files/install/sql/uninstall.sql
  34. 51 0
      modules/boonex/files/js/manage_tools.js
  35. 18 0
      modules/boonex/files/request.php
  36. 3 0
      modules/boonex/files/template/attachments.html
  37. 3 0
      modules/boonex/files/template/author.html
  38. 1 0
      modules/boonex/files/template/author_link.html
  39. 3 0
      modules/boonex/files/template/css/forms.css
  40. 6 0
      modules/boonex/files/template/css/main.css
  41. 1 0
      modules/boonex/files/template/css/manage_tools.css
  42. 3 0
      modules/boonex/files/template/entry-all-actions.html
  43. 3 0
      modules/boonex/files/template/entry-location.html
  44. 1 0
      modules/boonex/files/template/entry-share.html
  45. 3 0
      modules/boonex/files/template/entry-text.html
  46. 18 0
      modules/boonex/files/template/form_ghost_template.html
  47. 14 0
      modules/boonex/files/template/form_ghost_template_upload.html
  48. 67 0
      modules/boonex/files/template/images/icons/std-icon.svg
  49. 1 0
      modules/boonex/files/template/title_link.html
  50. 3 0
      modules/boonex/files/template/unit.html
  51. 1 0
      modules/boonex/files/template/unit_full.html
  52. 1 0
      modules/boonex/files/template/unit_gallery.html
  53. 3 0
      modules/boonex/files/template/unit_live_search.html
  54. 3 0
      modules/boonex/files/template/unit_private.html

+ 42 - 8
inc/classes/BxDolStorage.php

@@ -54,6 +54,7 @@ define('BX_DOL_STORAGE_ERR_ENGINE_GET', 5004); ///< some other error during file
 define('BX_DOL_STORAGE_DEFAULT_MIME_TYPE', 'octet/stream'); ///< default mime type if it is not find by extension
 
 define('BX_DOL_STORAGE_DEFAULT_ICON', 'mime-type-any.png'); ///< default icon if no other icon can be determined by file extension
+define('BX_DOL_STORAGE_DEFAULT_ICON_FONT', 'file-o'); ///< default font icon if no other icon can be determined by file extension
 
 define('BX_DOL_STORAGE_QUEUED_DELETIONS_PER_RUN', 200); ///< max number of file deletions per one cron run, @see BxDolStorage::pruneDeletions
 
@@ -813,6 +814,19 @@ abstract class BxDolStorage extends BxDolFactory implements iBxDolFactoryObject
     {
         $sResult = '';
 
+        $aIconsFont = array (
+            'file-pdf-o' => array('pdf'),
+            'file-word-o' => array('doc', 'docx'),
+            'file-excel-o' => array('xls', 'xlt', 'xlsx', 'sxc', 'stc', 'ods', 'ots', 'sdc', 'csv', 'dif', 'slk', 'pxl'),
+            'file-powerpoint-o' => array('ppt', 'pptx', 'sxi', 'sti', 'odp', 'sdp', 'sdd'),
+            'file-code-o' => array('1st', 'aspx', 'asp', 'json', 'js', 'jsp', 'java', 'php', 'xml', 'rdf', 'xsd', 'xsl', 'xslt', 'sax', 'rss', 'cfm', 'js', 'asm', 'pl', 'prl', 'bas', 'b', 'vbs', 'fs', 'src', 'cs', 'ws', 'cgi', 'bat', 'py', 'c', 'cpp', 'cc', 'cp', 'h', 'hh', 'cxx', 'hxx', 'c++', 'm', 'lua', 'swift', 'sh', 'as', 'cob', 'tpl', 'lsp', 'x', 'cmd', 'rb', 'cbl', 'pas', 'pp', 'vb', 'f', 'perl', 'jl', 'lol', 'bal', 'pli', 'css', 'less', 'sass', 'saas', 'bcc', 'coffee', 'jade', 'j', 'tea', 'c#', 'sas', 'diff', 'pro', 'for', 'sh', 'bsh', 'bash', 'twig', 'csh', 'lisp', 'lsp', 'cobol', 'pl', 'd', 'git', 'rb', 'hrl', 'cr', 'inp', 'a', 'go', 'as3', 'm', 'sql'),
+            'file-image-o' => 'image/',
+            'file-video-o' => 'video/',
+            'file-audio-o' => 'audio/',
+            'file-text-o' => 'text/',
+            'file-archive-o' => array('7z', '7zip', 'aar', 'ace', 'alz', 'arj', 'bz2', 'bza', 'bzip2', 'bzp', 'bzp2', 'cab', 'czip', 'gnutar', 'gz', 'gza', 'gzi', 'gzip', 'ha', 'lhz', 'lzma', 'pzip', 'rar', 'roo', 's7z', 'tar', 'tar-gz', 'tar-lzma', 'tar-z', 'taz', 'tbz', 'tbz2', 'tgz', 'tz', 'z', 'zip', 'zipx', 'zix', 'zoo'),
+        );
+        
         $aIcons = array (
             'mime-type-psd.png' => array('psd'),
             'mime-type-png.png' => array('png'),
@@ -845,15 +859,10 @@ abstract class BxDolStorage extends BxDolFactory implements iBxDolFactoryObject
             $aExts = preg_split ("/[\s]+/", $a[1]);
 
             foreach ($aExts as $sExt) {
-                $sIcon = '';
-                foreach ($aIcons as $sIc => $if) {
-                    if (!(is_array($if) && in_array($sExt, $if)) && !(is_string($if) && 0 === strncmp($if, $sMimeType, strlen($if))))
-                        continue;
-                    $sIcon = $sIc;
-                    break;
-                }
+                $sIcon = $this->determineIcon($aIcons, $sExt, $sMimeType);
+                $sIconFont = $this->determineIcon($aIconsFont, $sExt, $sMimeType);
 
-                if (!$this->_oDb->addMimeType($sMimeType, $sExt, $sIcon))
+                if (!$this->_oDb->addMimeType($sMimeType, $sExt, $sIcon, $sIconFont))
                     $sResult .= _t('_Error') . ': ' . $sMimeType . "\t" . $sExt . "\n";
             }
         }
@@ -866,6 +875,16 @@ abstract class BxDolStorage extends BxDolFactory implements iBxDolFactoryObject
         return $sResult;
     }
 
+    protected function determineIcon($aIcons, $sExt, $sMimeType)
+    {
+        foreach ($aIcons as $sIc => $if) {
+            if (!(is_array($if) && in_array($sExt, $if)) && !(is_string($if) && 0 === strncmp($if, $sMimeType, strlen($if))))
+                continue;
+            return $sIc;
+        }
+        return false;
+    }
+
     /**
      * Get file extension by file name.
      * @param $sFileName file name
@@ -916,6 +935,21 @@ abstract class BxDolStorage extends BxDolFactory implements iBxDolFactoryObject
         return $sIcon;
     }
 
+    /**
+     * Get file font icon by file name.
+     * Actually just a class name of icon is returnted.
+     * @param $sFileName file name
+     * @return file icon string
+     */
+    public function getFontIconNameByFileName ($sFileName)
+    {
+        $sExt = $this->getFileExt($sFileName);
+        $sIcon = $this->_oDb->getIconFontByExt($sExt);
+        if (!$sIcon)
+            $sIcon = BX_DOL_STORAGE_DEFAULT_ICON_FONT;
+        return $sIcon;
+    }
+    
     // ------------ internal functions - events
 
     protected function onBeforeFileAdd ($aFileInfo)

+ 8 - 2
inc/classes/BxDolStorageQuery.php

@@ -55,14 +55,20 @@ class BxDolStorageQuery extends BxDolDb
         return $this->getOne($sQuery);
     }
 
+    public function getIconFontByExt($sExt)
+    {
+        $sQuery = $this->prepare("SELECT `icon_font` FROM `sys_storage_mime_types` WHERE `ext` = ?", $sExt);
+        return $this->getOne($sQuery);
+    }
+    
     public function clearAllMimeTypes()
     {
         return $this->query("TRUNCATE TABLE `sys_storage_mime_types`");
     }
 
-    public function addMimeType($sMimeType, $sExt, $sIcon = '')
+    public function addMimeType($sMimeType, $sExt, $sIcon = '', $sIconFont = '')
     {
-        $sQuery = $this->prepare("INSERT IGNORE INTO `sys_storage_mime_types` SET `ext` = ?, `mime_type` = ?, `icon` = ?", $sExt, $sMimeType, $sIcon);
+        $sQuery = $this->prepare("INSERT IGNORE INTO `sys_storage_mime_types` SET `ext` = ?, `mime_type` = ?, `icon` = ?, `icon_font` = ?", $sExt, $sMimeType, $sIcon, $sIconFont);
         return $this->query($sQuery);
     }
 

+ 15 - 1
inc/classes/BxDolUploader.php

@@ -327,7 +327,7 @@ abstract class BxDolUploader extends BxDolFactory
         foreach ($aGhosts as $aFile) {
             $sFileIcon = '';
 
-            if ($oImagesTranscoder && (0 === strncmp($aFile['mime_type'], 'image/', 6) || 0 === strncmp($aFile['mime_type'], 'video/', 6)))
+            if ($this->isUseTranscoderForPreview($oImagesTranscoder, $aFile))
                 $sFileIcon = $oImagesTranscoder->getFileUrl($aFile['id']);
 
             if (!$sFileIcon)
@@ -424,6 +424,20 @@ abstract class BxDolUploader extends BxDolFactory
     {
         return array();
     }
+
+    protected function isUseTranscoderForPreview($oImagesTranscoder, $aFile)
+    {
+        if (!$oImagesTranscoder)
+            return false;
+        
+        if (0 === strncmp($aFile['mime_type'], 'image/', 6) && (is_a($oImagesTranscoder, 'BxDolTranscoderImage') || is_a($oImagesTranscoder, 'BxDolTranscoderProxy')))
+            return true;
+        
+        if (0 === strncmp($aFile['mime_type'], 'video/', 6) && (is_a($oImagesTranscoder, 'BxDolTranscoderVideo') || is_a($oImagesTranscoder, 'BxDolTranscoderProxy')))
+            return true;
+
+        return false;
+    }
 }
 
 /** @} */

+ 998 - 899
install/sql/system.sql

@@ -1353,908 +1353,1007 @@ CREATE TABLE IF NOT EXISTS `sys_storage_mime_types` (
   `ext` varchar(32) NOT NULL,
   `mime_type` varchar(128) NOT NULL,
   `icon` varchar(255) NOT NULL,
+  `icon_font` varchar(255) NOT NULL,
   PRIMARY KEY (`ext`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
-
-INSERT INTO `sys_storage_mime_types` (`ext`, `mime_type`, `icon`) VALUES
-('ez', 'application/andrew-inset', ''),
-('aw', 'application/applixware', ''),
-('atom', 'application/atom+xml', ''),
-('atomcat', 'application/atomcat+xml', ''),
-('atomsvc', 'application/atomsvc+xml', ''),
-('ccxml', 'application/ccxml+xml', ''),
-('cdmia', 'application/cdmi-capability', ''),
-('cdmic', 'application/cdmi-container', ''),
-('cdmid', 'application/cdmi-domain', ''),
-('cdmio', 'application/cdmi-object', ''),
-('cdmiq', 'application/cdmi-queue', ''),
-('cu', 'application/cu-seeme', ''),
-('davmount', 'application/davmount+xml', ''),
-('dssc', 'application/dssc+der', ''),
-('xdssc', 'application/dssc+xml', ''),
-('ecma', 'application/ecmascript', ''),
-('emma', 'application/emma+xml', ''),
-('epub', 'application/epub+zip', ''),
-('exi', 'application/exi', ''),
-('pfr', 'application/font-tdpfr', ''),
-('stk', 'application/hyperstudio', ''),
-('ipfix', 'application/ipfix', ''),
-('jar', 'application/java-archive', ''),
-('ser', 'application/java-serialized-object', ''),
-('class', 'application/java-vm', ''),
-('js', 'application/javascript', ''),
-('json', 'application/json', ''),
-('lostxml', 'application/lost+xml', ''),
-('hqx', 'application/mac-binhex40', ''),
-('cpt', 'application/mac-compactpro', ''),
-('mads', 'application/mads+xml', ''),
-('mrc', 'application/marc', ''),
-('mrcx', 'application/marcxml+xml', ''),
-('ma', 'application/mathematica', ''),
-('nb', 'application/mathematica', ''),
-('mb', 'application/mathematica', ''),
-('mathml', 'application/mathml+xml', ''),
-('mbox', 'application/mbox', ''),
-('mscml', 'application/mediaservercontrol+xml', ''),
-('meta4', 'application/metalink4+xml', ''),
-('mets', 'application/mets+xml', ''),
-('mods', 'application/mods+xml', ''),
-('m21', 'application/mp21', ''),
-('mp21', 'application/mp21', ''),
-('mp4s', 'application/mp4', ''),
-('doc', 'application/msword', 'mime-type-document.png'),
-('dot', 'application/msword', ''),
-('mxf', 'application/mxf', ''),
-('bin', 'application/octet-stream', ''),
-('dms', 'application/octet-stream', ''),
-('lha', 'application/octet-stream', ''),
-('lrf', 'application/octet-stream', ''),
-('lzh', 'application/octet-stream', ''),
-('so', 'application/octet-stream', ''),
-('iso', 'application/octet-stream', ''),
-('dmg', 'application/octet-stream', ''),
-('dist', 'application/octet-stream', ''),
-('distz', 'application/octet-stream', ''),
-('pkg', 'application/octet-stream', ''),
-('bpk', 'application/octet-stream', ''),
-('dump', 'application/octet-stream', ''),
-('elc', 'application/octet-stream', ''),
-('deploy', 'application/octet-stream', ''),
-('mobipocket-ebook', 'application/octet-stream', ''),
-('oda', 'application/oda', ''),
-('opf', 'application/oebps-package+xml', ''),
-('ogx', 'application/ogg', ''),
-('onetoc', 'application/onenote', ''),
-('onetoc2', 'application/onenote', ''),
-('onetmp', 'application/onenote', ''),
-('onepkg', 'application/onenote', ''),
-('xer', 'application/patch-ops-error+xml', ''),
-('pdf', 'application/pdf', 'mime-type-document.png'),
-('pgp', 'application/pgp-encrypted', ''),
-('asc', 'application/pgp-signature', ''),
-('sig', 'application/pgp-signature', ''),
-('prf', 'application/pics-rules', ''),
-('p10', 'application/pkcs10', 'mime-type-vector.png'),
-('p7m', 'application/pkcs7-mime', ''),
-('p7c', 'application/pkcs7-mime', ''),
-('p7s', 'application/pkcs7-signature', ''),
-('p8', 'application/pkcs8', ''),
-('ac', 'application/pkix-attr-cert', ''),
-('cer', 'application/pkix-cert', ''),
-('crl', 'application/pkix-crl', ''),
-('pkipath', 'application/pkix-pkipath', ''),
-('pki', 'application/pkixcmp', ''),
-('pls', 'application/pls+xml', ''),
-('ai', 'application/postscript', 'mime-type-vector.png'),
-('eps', 'application/postscript', ''),
-('ps', 'application/postscript', 'mime-type-vector.png'),
-('cww', 'application/prs.cww', ''),
-('pskcxml', 'application/pskc+xml', ''),
-('rdf', 'application/rdf+xml', ''),
-('rif', 'application/reginfo+xml', ''),
-('rnc', 'application/relax-ng-compact-syntax', ''),
-('rl', 'application/resource-lists+xml', ''),
-('rld', 'application/resource-lists-diff+xml', ''),
-('rs', 'application/rls-services+xml', ''),
-('rsd', 'application/rsd+xml', ''),
-('rss', 'application/rss+xml', ''),
-('rtf', 'application/rtf', 'mime-type-document.png'),
-('sbml', 'application/sbml+xml', ''),
-('scq', 'application/scvp-cv-request', ''),
-('scs', 'application/scvp-cv-response', ''),
-('spq', 'application/scvp-vp-request', ''),
-('spp', 'application/scvp-vp-response', ''),
-('sdp', 'application/sdp', 'mime-type-presentation.png'),
-('setpay', 'application/set-payment-initiation', ''),
-('setreg', 'application/set-registration-initiation', ''),
-('shf', 'application/shf+xml', ''),
-('smi', 'application/smil+xml', ''),
-('smil', 'application/smil+xml', ''),
-('rq', 'application/sparql-query', ''),
-('srx', 'application/sparql-results+xml', ''),
-('gram', 'application/srgs', ''),
-('grxml', 'application/srgs+xml', ''),
-('sru', 'application/sru+xml', ''),
-('ssml', 'application/ssml+xml', ''),
-('tei', 'application/tei+xml', ''),
-('teicorpus', 'application/tei+xml', ''),
-('tfi', 'application/thraud+xml', ''),
-('tsd', 'application/timestamped-data', ''),
-('plb', 'application/vnd.3gpp.pic-bw-large', ''),
-('psb', 'application/vnd.3gpp.pic-bw-small', ''),
-('pvb', 'application/vnd.3gpp.pic-bw-var', ''),
-('tcap', 'application/vnd.3gpp2.tcap', ''),
-('pwn', 'application/vnd.3m.post-it-notes', ''),
-('aso', 'application/vnd.accpac.simply.aso', ''),
-('imp', 'application/vnd.accpac.simply.imp', ''),
-('acu', 'application/vnd.acucobol', ''),
-('atc', 'application/vnd.acucorp', ''),
-('acutc', 'application/vnd.acucorp', ''),
-('air', 'application/vnd.adobe.air-application-installer-package+zip', ''),
-('fxp', 'application/vnd.adobe.fxp', ''),
-('fxpl', 'application/vnd.adobe.fxp', ''),
-('xdp', 'application/vnd.adobe.xdp+xml', ''),
-('xfdf', 'application/vnd.adobe.xfdf', ''),
-('ahead', 'application/vnd.ahead.space', ''),
-('azf', 'application/vnd.airzip.filesecure.azf', ''),
-('azs', 'application/vnd.airzip.filesecure.azs', ''),
-('azw', 'application/vnd.amazon.ebook', ''),
-('acc', 'application/vnd.americandynamics.acc', ''),
-('ami', 'application/vnd.amiga.ami', ''),
-('apk', 'application/vnd.android.package-archive', ''),
-('cii', 'application/vnd.anser-web-certificate-issue-initiation', ''),
-('fti', 'application/vnd.anser-web-funds-transfer-initiation', ''),
-('atx', 'application/vnd.antix.game-component', ''),
-('mpkg', 'application/vnd.apple.installer+xml', ''),
-('m3u8', 'application/vnd.apple.mpegurl', ''),
-('swi', 'application/vnd.aristanetworks.swi', ''),
-('aep', 'application/vnd.audiograph', ''),
-('mpm', 'application/vnd.blueice.multipass', ''),
-('bmi', 'application/vnd.bmi', ''),
-('rep', 'application/vnd.businessobjects', ''),
-('cdxml', 'application/vnd.chemdraw+xml', ''),
-('mmd', 'application/vnd.chipnuts.karaoke-mmd', ''),
-('cdy', 'application/vnd.cinderella', ''),
-('cla', 'application/vnd.claymore', ''),
-('rp9', 'application/vnd.cloanto.rp9', ''),
-('c4g', 'application/vnd.clonk.c4group', ''),
-('c4d', 'application/vnd.clonk.c4group', ''),
-('c4f', 'application/vnd.clonk.c4group', ''),
-('c4p', 'application/vnd.clonk.c4group', ''),
-('c4u', 'application/vnd.clonk.c4group', ''),
-('c11amc', 'application/vnd.cluetrust.cartomobile-config', ''),
-('c11amz', 'application/vnd.cluetrust.cartomobile-config-pkg', ''),
-('csp', 'application/vnd.commonspace', ''),
-('cdbcmsg', 'application/vnd.contact.cmsg', ''),
-('cmc', 'application/vnd.cosmocaller', ''),
-('clkx', 'application/vnd.crick.clicker', ''),
-('clkk', 'application/vnd.crick.clicker.keyboard', ''),
-('clkp', 'application/vnd.crick.clicker.palette', ''),
-('clkt', 'application/vnd.crick.clicker.template', ''),
-('clkw', 'application/vnd.crick.clicker.wordbank', ''),
-('wbs', 'application/vnd.criticaltools.wbs+xml', ''),
-('pml', 'application/vnd.ctc-posml', ''),
-('ppd', 'application/vnd.cups-ppd', ''),
-('car', 'application/vnd.curl.car', ''),
-('pcurl', 'application/vnd.curl.pcurl', ''),
-('rdz', 'application/vnd.data-vision.rdz', ''),
-('uvf', 'application/vnd.dece.data', ''),
-('uvvf', 'application/vnd.dece.data', ''),
-('uvd', 'application/vnd.dece.data', ''),
-('uvvd', 'application/vnd.dece.data', ''),
-('uvt', 'application/vnd.dece.ttml+xml', ''),
-('uvvt', 'application/vnd.dece.ttml+xml', ''),
-('uvx', 'application/vnd.dece.unspecified', ''),
-('uvvx', 'application/vnd.dece.unspecified', ''),
-('fe_launch', 'application/vnd.denovo.fcselayout-link', ''),
-('dna', 'application/vnd.dna', ''),
-('mlp', 'application/vnd.dolby.mlp', ''),
-('dpg', 'application/vnd.dpgraph', ''),
-('dfac', 'application/vnd.dreamfactory', ''),
-('ait', 'application/vnd.dvb.ait', 'mime-type-vector.png'),
-('svc', 'application/vnd.dvb.service', ''),
-('geo', 'application/vnd.dynageo', ''),
-('mag', 'application/vnd.ecowin.chart', ''),
-('nml', 'application/vnd.enliven', ''),
-('esf', 'application/vnd.epson.esf', ''),
-('msf', 'application/vnd.epson.msf', ''),
-('qam', 'application/vnd.epson.quickanime', ''),
-('slt', 'application/vnd.epson.salt', ''),
-('ssf', 'application/vnd.epson.ssf', ''),
-('es3', 'application/vnd.eszigno3+xml', ''),
-('et3', 'application/vnd.eszigno3+xml', ''),
-('ez2', 'application/vnd.ezpix-album', ''),
-('ez3', 'application/vnd.ezpix-package', ''),
-('fdf', 'application/vnd.fdf', ''),
-('mseed', 'application/vnd.fdsn.mseed', ''),
-('seed', 'application/vnd.fdsn.seed', ''),
-('dataless', 'application/vnd.fdsn.seed', ''),
-('gph', 'application/vnd.flographit', ''),
-('ftc', 'application/vnd.fluxtime.clip', ''),
-('fm', 'application/vnd.framemaker', ''),
-('frame', 'application/vnd.framemaker', ''),
-('maker', 'application/vnd.framemaker', ''),
-('book', 'application/vnd.framemaker', ''),
-('fnc', 'application/vnd.frogans.fnc', ''),
-('ltf', 'application/vnd.frogans.ltf', ''),
-('fsc', 'application/vnd.fsc.weblaunch', ''),
-('oas', 'application/vnd.fujitsu.oasys', ''),
-('oa2', 'application/vnd.fujitsu.oasys2', ''),
-('oa3', 'application/vnd.fujitsu.oasys3', ''),
-('fg5', 'application/vnd.fujitsu.oasysgp', ''),
-('bh2', 'application/vnd.fujitsu.oasysprs', ''),
-('ddd', 'application/vnd.fujixerox.ddd', ''),
-('xdw', 'application/vnd.fujixerox.docuworks', ''),
-('xbd', 'application/vnd.fujixerox.docuworks.binder', ''),
-('fzs', 'application/vnd.fuzzysheet', ''),
-('txd', 'application/vnd.genomatix.tuxedo', ''),
-('ggb', 'application/vnd.geogebra.file', ''),
-('ggt', 'application/vnd.geogebra.tool', ''),
-('gex', 'application/vnd.geometry-explorer', ''),
-('gre', 'application/vnd.geometry-explorer', ''),
-('gxt', 'application/vnd.geonext', ''),
-('g2w', 'application/vnd.geoplan', ''),
-('g3w', 'application/vnd.geospace', ''),
-('gmx', 'application/vnd.gmx', ''),
-('kml', 'application/vnd.google-earth.kml+xml', ''),
-('kmz', 'application/vnd.google-earth.kmz', ''),
-('gqf', 'application/vnd.grafeq', ''),
-('gqs', 'application/vnd.grafeq', ''),
-('gac', 'application/vnd.groove-account', ''),
-('ghf', 'application/vnd.groove-help', ''),
-('gim', 'application/vnd.groove-identity-message', ''),
-('grv', 'application/vnd.groove-injector', ''),
-('gtm', 'application/vnd.groove-tool-message', ''),
-('tpl', 'application/vnd.groove-tool-template', ''),
-('vcg', 'application/vnd.groove-vcard', ''),
-('hal', 'application/vnd.hal+xml', ''),
-('zmm', 'application/vnd.handheld-entertainment+xml', ''),
-('hbci', 'application/vnd.hbci', ''),
-('les', 'application/vnd.hhe.lesson-player', ''),
-('hpgl', 'application/vnd.hp-hpgl', 'mime-type-vector.png'),
-('hpid', 'application/vnd.hp-hpid', ''),
-('hps', 'application/vnd.hp-hps', ''),
-('jlt', 'application/vnd.hp-jlyt', ''),
-('pcl', 'application/vnd.hp-pcl', ''),
-('pclxl', 'application/vnd.hp-pclxl', ''),
-('sfd-hdstx', 'application/vnd.hydrostatix.sof-data', ''),
-('x3d', 'application/vnd.hzn-3d-crossword', ''),
-('mpy', 'application/vnd.ibm.minipay', ''),
-('afp', 'application/vnd.ibm.modcap', ''),
-('listafp', 'application/vnd.ibm.modcap', ''),
-('list3820', 'application/vnd.ibm.modcap', ''),
-('irm', 'application/vnd.ibm.rights-management', ''),
-('sc', 'application/vnd.ibm.secure-container', ''),
-('icc', 'application/vnd.iccprofile', ''),
-('icm', 'application/vnd.iccprofile', ''),
-('igl', 'application/vnd.igloader', ''),
-('ivp', 'application/vnd.immervision-ivp', ''),
-('ivu', 'application/vnd.immervision-ivu', ''),
-('igm', 'application/vnd.insors.igm', ''),
-('xpw', 'application/vnd.intercon.formnet', ''),
-('xpx', 'application/vnd.intercon.formnet', ''),
-('i2g', 'application/vnd.intergeo', ''),
-('qbo', 'application/vnd.intu.qbo', ''),
-('qfx', 'application/vnd.intu.qfx', ''),
-('rcprofile', 'application/vnd.ipunplugged.rcprofile', ''),
-('irp', 'application/vnd.irepository.package+xml', ''),
-('xpr', 'application/vnd.is-xpr', ''),
-('fcs', 'application/vnd.isac.fcs', ''),
-('jam', 'application/vnd.jam', ''),
-('rms', 'application/vnd.jcp.javame.midlet-rms', ''),
-('jisp', 'application/vnd.jisp', ''),
-('joda', 'application/vnd.joost.joda-archive', ''),
-('ktz', 'application/vnd.kahootz', ''),
-('ktr', 'application/vnd.kahootz', ''),
-('karbon', 'application/vnd.kde.karbon', ''),
-('chrt', 'application/vnd.kde.kchart', ''),
-('kfo', 'application/vnd.kde.kformula', ''),
-('flw', 'application/vnd.kde.kivio', ''),
-('kon', 'application/vnd.kde.kontour', ''),
-('kpr', 'application/vnd.kde.kpresenter', ''),
-('kpt', 'application/vnd.kde.kpresenter', ''),
-('ksp', 'application/vnd.kde.kspread', ''),
-('kwd', 'application/vnd.kde.kword', ''),
-('kwt', 'application/vnd.kde.kword', ''),
-('htke', 'application/vnd.kenameaapp', ''),
-('kia', 'application/vnd.kidspiration', ''),
-('kne', 'application/vnd.kinar', ''),
-('knp', 'application/vnd.kinar', ''),
-('skp', 'application/vnd.koan', ''),
-('skd', 'application/vnd.koan', ''),
-('skt', 'application/vnd.koan', ''),
-('skm', 'application/vnd.koan', ''),
-('sse', 'application/vnd.kodak-descriptor', ''),
-('lasxml', 'application/vnd.las.las+xml', ''),
-('lbd', 'application/vnd.llamagraphics.life-balance.desktop', ''),
-('lbe', 'application/vnd.llamagraphics.life-balance.exchange+xml', ''),
-('123', 'application/vnd.lotus-1-2-3', ''),
-('apr', 'application/vnd.lotus-approach', ''),
-('pre', 'application/vnd.lotus-freelance', ''),
-('nsf', 'application/vnd.lotus-notes', ''),
-('org', 'application/vnd.lotus-organizer', ''),
-('scm', 'application/vnd.lotus-screencam', ''),
-('lwp', 'application/vnd.lotus-wordpro', ''),
-('portpkg', 'application/vnd.macports.portpkg', ''),
-('mcd', 'application/vnd.mcd', ''),
-('mc1', 'application/vnd.medcalcdata', ''),
-('cdkey', 'application/vnd.mediastation.cdkey', ''),
-('mwf', 'application/vnd.mfer', ''),
-('mfm', 'application/vnd.mfmp', ''),
-('flo', 'application/vnd.micrografx.flo', ''),
-('igx', 'application/vnd.micrografx.igx', ''),
-('mif', 'application/vnd.mif', ''),
-('daf', 'application/vnd.mobius.daf', ''),
-('dis', 'application/vnd.mobius.dis', ''),
-('mbk', 'application/vnd.mobius.mbk', ''),
-('mqy', 'application/vnd.mobius.mqy', ''),
-('msl', 'application/vnd.mobius.msl', ''),
-('plc', 'application/vnd.mobius.plc', ''),
-('txf', 'application/vnd.mobius.txf', ''),
-('mpn', 'application/vnd.mophun.application', ''),
-('mpc', 'application/vnd.mophun.certificate', ''),
-('xul', 'application/vnd.mozilla.xul+xml', ''),
-('cil', 'application/vnd.ms-artgalry', 'mime-type-vector.png'),
-('cab', 'application/vnd.ms-cab-compressed', 'mime-type-archive.png'),
-('xls', 'application/vnd.ms-excel', 'mime-type-spreadsheet.png'),
-('xlm', 'application/vnd.ms-excel', ''),
-('xla', 'application/vnd.ms-excel', ''),
-('xlc', 'application/vnd.ms-excel', ''),
-('xlt', 'application/vnd.ms-excel', 'mime-type-spreadsheet.png'),
-('xlw', 'application/vnd.ms-excel', ''),
-('xlam', 'application/vnd.ms-excel.addin.macroenabled.12', ''),
-('xlsb', 'application/vnd.ms-excel.sheet.binary.macroenabled.12', ''),
-('xlsm', 'application/vnd.ms-excel.sheet.macroenabled.12', ''),
-('xltm', 'application/vnd.ms-excel.template.macroenabled.12', ''),
-('eot', 'application/vnd.ms-fontobject', ''),
-('chm', 'application/vnd.ms-htmlhelp', ''),
-('ims', 'application/vnd.ms-ims', ''),
-('lrm', 'application/vnd.ms-lrm', ''),
-('thmx', 'application/vnd.ms-officetheme', ''),
-('cat', 'application/vnd.ms-pki.seccat', ''),
-('stl', 'application/vnd.ms-pki.stl', ''),
-('ppt', 'application/vnd.ms-powerpoint', 'mime-type-presentation.png'),
-('pps', 'application/vnd.ms-powerpoint', ''),
-('pot', 'application/vnd.ms-powerpoint', ''),
-('ppam', 'application/vnd.ms-powerpoint.addin.macroenabled.12', ''),
-('pptm', 'application/vnd.ms-powerpoint.presentation.macroenabled.12', ''),
-('sldm', 'application/vnd.ms-powerpoint.slide.macroenabled.12', ''),
-('ppsm', 'application/vnd.ms-powerpoint.slideshow.macroenabled.12', ''),
-('potm', 'application/vnd.ms-powerpoint.template.macroenabled.12', ''),
-('mpp', 'application/vnd.ms-project', ''),
-('mpt', 'application/vnd.ms-project', ''),
-('docm', 'application/vnd.ms-word.document.macroenabled.12', ''),
-('dotm', 'application/vnd.ms-word.template.macroenabled.12', ''),
-('wps', 'application/vnd.ms-works', ''),
-('wks', 'application/vnd.ms-works', ''),
-('wcm', 'application/vnd.ms-works', ''),
-('wdb', 'application/vnd.ms-works', ''),
-('wpl', 'application/vnd.ms-wpl', ''),
-('xps', 'application/vnd.ms-xpsdocument', ''),
-('mseq', 'application/vnd.mseq', ''),
-('mus', 'application/vnd.musician', ''),
-('msty', 'application/vnd.muvee.style', ''),
-('nlu', 'application/vnd.neurolanguage.nlu', ''),
-('nnd', 'application/vnd.noblenet-directory', ''),
-('nns', 'application/vnd.noblenet-sealer', ''),
-('nnw', 'application/vnd.noblenet-web', ''),
-('ngdat', 'application/vnd.nokia.n-gage.data', ''),
-('n-gage', 'application/vnd.nokia.n-gage.symbian.install', ''),
-('rpst', 'application/vnd.nokia.radio-preset', ''),
-('rpss', 'application/vnd.nokia.radio-presets', ''),
-('edm', 'application/vnd.novadigm.edm', ''),
-('edx', 'application/vnd.novadigm.edx', ''),
-('ext', 'application/vnd.novadigm.ext', ''),
-('odc', 'application/vnd.oasis.opendocument.chart', ''),
-('otc', 'application/vnd.oasis.opendocument.chart-template', ''),
-('odb', 'application/vnd.oasis.opendocument.database', ''),
-('odf', 'application/vnd.oasis.opendocument.formula', ''),
-('odft', 'application/vnd.oasis.opendocument.formula-template', ''),
-('odg', 'application/vnd.oasis.opendocument.graphics', 'mime-type-vector.png'),
-('otg', 'application/vnd.oasis.opendocument.graphics-template', ''),
-('odi', 'application/vnd.oasis.opendocument.image', ''),
-('oti', 'application/vnd.oasis.opendocument.image-template', ''),
-('odp', 'application/vnd.oasis.opendocument.presentation', 'mime-type-presentation.png'),
-('otp', 'application/vnd.oasis.opendocument.presentation-template', ''),
-('ods', 'application/vnd.oasis.opendocument.spreadsheet', 'mime-type-spreadsheet.png'),
-('ots', 'application/vnd.oasis.opendocument.spreadsheet-template', 'mime-type-spreadsheet.png'),
-('odt', 'application/vnd.oasis.opendocument.text', 'mime-type-document.png'),
-('odm', 'application/vnd.oasis.opendocument.text-master', ''),
-('ott', 'application/vnd.oasis.opendocument.text-template', 'mime-type-document.png'),
-('oth', 'application/vnd.oasis.opendocument.text-web', ''),
-('xo', 'application/vnd.olpc-sugar', ''),
-('dd2', 'application/vnd.oma.dd2+xml', ''),
-('oxt', 'application/vnd.openofficeorg.extension', ''),
-('pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'mime-type-presentation.png'),
-('sldx', 'application/vnd.openxmlformats-officedocument.presentationml.slide', ''),
-('ppsx', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', ''),
-('potx', 'application/vnd.openxmlformats-officedocument.presentationml.template', ''),
-('xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'mime-type-spreadsheet.png'),
-('xltx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', ''),
-('docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'mime-type-document.png'),
-('dotx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', ''),
-('mgp', 'application/vnd.osgeo.mapguide.package', ''),
-('dp', 'application/vnd.osgi.dp', ''),
-('pdb', 'application/vnd.palm', 'mime-type-document.png'),
-('pqa', 'application/vnd.palm', ''),
-('oprc', 'application/vnd.palm', ''),
-('paw', 'application/vnd.pawaafile', ''),
-('str', 'application/vnd.pg.format', ''),
-('ei6', 'application/vnd.pg.osasli', ''),
-('efif', 'application/vnd.picsel', ''),
-('wg', 'application/vnd.pmi.widget', ''),
-('plf', 'application/vnd.pocketlearn', ''),
-('pbd', 'application/vnd.powerbuilder6', ''),
-('box', 'application/vnd.previewsystems.box', ''),
-('mgz', 'application/vnd.proteus.magazine', ''),
-('qps', 'application/vnd.publishare-delta-tree', ''),
-('ptid', 'application/vnd.pvi.ptid1', ''),
-('qxd', 'application/vnd.quark.quarkxpress', ''),
-('qxt', 'application/vnd.quark.quarkxpress', ''),
-('qwd', 'application/vnd.quark.quarkxpress', ''),
-('qwt', 'application/vnd.quark.quarkxpress', ''),
-('qxl', 'application/vnd.quark.quarkxpress', ''),
-('qxb', 'application/vnd.quark.quarkxpress', ''),
-('bed', 'application/vnd.realvnc.bed', ''),
-('mxl', 'application/vnd.recordare.musicxml', ''),
-('musicxml', 'application/vnd.recordare.musicxml+xml', ''),
-('cryptonote', 'application/vnd.rig.cryptonote', ''),
-('cod', 'application/vnd.rim.cod', ''),
-('rm', 'application/vnd.rn-realmedia', ''),
-('link66', 'application/vnd.route66.link66+xml', ''),
-('st', 'application/vnd.sailingtracker.track', ''),
-('see', 'application/vnd.seemail', ''),
-('sema', 'application/vnd.sema', ''),
-('semd', 'application/vnd.semd', ''),
-('semf', 'application/vnd.semf', ''),
-('ifm', 'application/vnd.shana.informed.formdata', ''),
-('itp', 'application/vnd.shana.informed.formtemplate', ''),
-('iif', 'application/vnd.shana.informed.interchange', ''),
-('ipk', 'application/vnd.shana.informed.package', ''),
-('twd', 'application/vnd.simtech-mindmapper', ''),
-('twds', 'application/vnd.simtech-mindmapper', ''),
-('mmf', 'application/vnd.smaf', ''),
-('teacher', 'application/vnd.smart.teacher', ''),
-('sdkm', 'application/vnd.solent.sdkm+xml', ''),
-('sdkd', 'application/vnd.solent.sdkm+xml', ''),
-('dxp', 'application/vnd.spotfire.dxp', ''),
-('sfs', 'application/vnd.spotfire.sfs', ''),
-('sdc', 'application/vnd.stardivision.calc', 'mime-type-spreadsheet.png'),
-('sda', 'application/vnd.stardivision.draw', ''),
-('sdd', 'application/vnd.stardivision.impress', 'mime-type-presentation.png'),
-('smf', 'application/vnd.stardivision.math', ''),
-('sdw', 'application/vnd.stardivision.writer', 'mime-type-document.png'),
-('vor', 'application/vnd.stardivision.writer', ''),
-('sgl', 'application/vnd.stardivision.writer-global', ''),
-('sm', 'application/vnd.stepmania.stepchart', ''),
-('sxc', 'application/vnd.sun.xml.calc', 'mime-type-spreadsheet.png'),
-('stc', 'application/vnd.sun.xml.calc.template', 'mime-type-spreadsheet.png'),
-('sxd', 'application/vnd.sun.xml.draw', 'mime-type-vector.png'),
-('std', 'application/vnd.sun.xml.draw.template', ''),
-('sxi', 'application/vnd.sun.xml.impress', 'mime-type-presentation.png'),
-('sti', 'application/vnd.sun.xml.impress.template', 'mime-type-presentation.png'),
-('sxm', 'application/vnd.sun.xml.math', ''),
-('sxw', 'application/vnd.sun.xml.writer', 'mime-type-document.png'),
-('sxg', 'application/vnd.sun.xml.writer.global', ''),
-('stw', 'application/vnd.sun.xml.writer.template', 'mime-type-document.png'),
-('sus', 'application/vnd.sus-calendar', ''),
-('susp', 'application/vnd.sus-calendar', ''),
-('svd', 'application/vnd.svd', ''),
-('sis', 'application/vnd.symbian.install', ''),
-('sisx', 'application/vnd.symbian.install', ''),
-('xsm', 'application/vnd.syncml+xml', ''),
-('bdm', 'application/vnd.syncml.dm+wbxml', ''),
-('xdm', 'application/vnd.syncml.dm+xml', ''),
-('tao', 'application/vnd.tao.intent-module-archive', ''),
-('tmo', 'application/vnd.tmobile-livetv', ''),
-('tpt', 'application/vnd.trid.tpt', ''),
-('mxs', 'application/vnd.triscape.mxs', ''),
-('tra', 'application/vnd.trueapp', ''),
-('ufd', 'application/vnd.ufdl', ''),
-('ufdl', 'application/vnd.ufdl', ''),
-('utz', 'application/vnd.uiq.theme', ''),
-('umj', 'application/vnd.umajin', ''),
-('unityweb', 'application/vnd.unity', ''),
-('uoml', 'application/vnd.uoml+xml', ''),
-('vcx', 'application/vnd.vcx', ''),
-('vsd', 'application/vnd.visio', ''),
-('vst', 'application/vnd.visio', ''),
-('vss', 'application/vnd.visio', 'mime-type-vector.png'),
-('vsw', 'application/vnd.visio', ''),
-('vis', 'application/vnd.visionary', ''),
-('vsf', 'application/vnd.vsf', ''),
-('wbxml', 'application/vnd.wap.wbxml', ''),
-('wmlc', 'application/vnd.wap.wmlc', ''),
-('wmlsc', 'application/vnd.wap.wmlscriptc', ''),
-('wtb', 'application/vnd.webturbo', ''),
-('nbp', 'application/vnd.wolfram.player', ''),
-('wpd', 'application/vnd.wordperfect', ''),
-('wqd', 'application/vnd.wqd', ''),
-('stf', 'application/vnd.wt.stf', ''),
-('xar', 'application/vnd.xara', ''),
-('xfdl', 'application/vnd.xfdl', ''),
-('hvd', 'application/vnd.yamaha.hv-dic', ''),
-('hvs', 'application/vnd.yamaha.hv-script', ''),
-('hvp', 'application/vnd.yamaha.hv-voice', ''),
-('osf', 'application/vnd.yamaha.openscoreformat', ''),
-('osfpvg', 'application/vnd.yamaha.openscoreformat.osfpvg+xml', ''),
-('saf', 'application/vnd.yamaha.smaf-audio', ''),
-('spf', 'application/vnd.yamaha.smaf-phrase', ''),
-('cmp', 'application/vnd.yellowriver-custom-menu', ''),
-('zir', 'application/vnd.zul', ''),
-('zirz', 'application/vnd.zul', ''),
-('zaz', 'application/vnd.zzazz.deck+xml', ''),
-('vxml', 'application/voicexml+xml', ''),
-('wgt', 'application/widget', ''),
-('hlp', 'application/winhlp', ''),
-('wsdl', 'application/wsdl+xml', ''),
-('wspolicy', 'application/wspolicy+xml', ''),
-('7z', 'application/x-7z-compressed', 'mime-type-archive.png'),
-('abw', 'application/x-abiword', ''),
-('ace', 'application/x-ace-compressed', 'mime-type-archive.png'),
-('aab', 'application/x-authorware-bin', ''),
-('x32', 'application/x-authorware-bin', ''),
-('u32', 'application/x-authorware-bin', ''),
-('vox', 'application/x-authorware-bin', ''),
-('aam', 'application/x-authorware-map', ''),
-('aas', 'application/x-authorware-seg', ''),
-('bcpio', 'application/x-bcpio', ''),
-('torrent', 'application/x-bittorrent', ''),
-('bz', 'application/x-bzip', ''),
-('bz2', 'application/x-bzip2', 'mime-type-archive.png'),
-('boz', 'application/x-bzip2', ''),
-('vcd', 'application/x-cdlink', ''),
-('chat', 'application/x-chat', ''),
-('pgn', 'application/x-chess-pgn', ''),
-('cpio', 'application/x-cpio', ''),
-('csh', 'application/x-csh', ''),
-('deb', 'application/x-debian-package', ''),
-('udeb', 'application/x-debian-package', ''),
-('dir', 'application/x-director', ''),
-('dcr', 'application/x-director', ''),
-('dxr', 'application/x-director', ''),
-('cst', 'application/x-director', ''),
-('cct', 'application/x-director', ''),
-('cxt', 'application/x-director', ''),
-('w3d', 'application/x-director', ''),
-('fgd', 'application/x-director', ''),
-('swa', 'application/x-director', ''),
-('wad', 'application/x-doom', ''),
-('ncx', 'application/x-dtbncx+xml', ''),
-('dtb', 'application/x-dtbook+xml', ''),
-('res', 'application/x-dtbresource+xml', ''),
-('dvi', 'application/x-dvi', ''),
-('bdf', 'application/x-font-bdf', ''),
-('gsf', 'application/x-font-ghostscript', ''),
-('psf', 'application/x-font-linux-psf', ''),
-('otf', 'application/x-font-otf', ''),
-('pcf', 'application/x-font-pcf', ''),
-('snf', 'application/x-font-snf', ''),
-('ttf', 'application/x-font-ttf', ''),
-('ttc', 'application/x-font-ttf', ''),
-('pfa', 'application/x-font-type1', ''),
-('pfb', 'application/x-font-type1', ''),
-('pfm', 'application/x-font-type1', ''),
-('afm', 'application/x-font-type1', ''),
-('woff', 'application/x-font-woff', ''),
-('spl', 'application/x-futuresplash', ''),
-('gnumeric', 'application/x-gnumeric', ''),
-('gtar', 'application/x-gtar', ''),
-('hdf', 'application/x-hdf', ''),
-('jnlp', 'application/x-java-jnlp-file', ''),
-('latex', 'application/x-latex', ''),
-('prc', 'application/x-mobipocket-ebook', ''),
-('mobi', 'application/x-mobipocket-ebook', ''),
-('application', 'application/x-ms-application', ''),
-('wmd', 'application/x-ms-wmd', ''),
-('wmz', 'application/x-ms-wmz', ''),
-('xbap', 'application/x-ms-xbap', ''),
-('mdb', 'application/x-msaccess', ''),
-('obd', 'application/x-msbinder', ''),
-('crd', 'application/x-mscardfile', ''),
-('clp', 'application/x-msclip', ''),
-('exe', 'application/x-msdownload', ''),
-('dll', 'application/x-msdownload', ''),
-('com', 'application/x-msdownload', ''),
-('bat', 'application/x-msdownload', ''),
-('msi', 'application/x-msdownload', ''),
-('mvb', 'application/x-msmediaview', ''),
-('m13', 'application/x-msmediaview', ''),
-('m14', 'application/x-msmediaview', ''),
-('wmf', 'application/x-msmetafile', ''),
-('mny', 'application/x-msmoney', ''),
-('pub', 'application/x-mspublisher', ''),
-('scd', 'application/x-msschedule', ''),
-('trm', 'application/x-msterminal', ''),
-('wri', 'application/x-mswrite', ''),
-('nc', 'application/x-netcdf', ''),
-('cdf', 'application/x-netcdf', ''),
-('p12', 'application/x-pkcs12', ''),
-('pfx', 'application/x-pkcs12', ''),
-('p7b', 'application/x-pkcs7-certificates', ''),
-('spc', 'application/x-pkcs7-certificates', ''),
-('p7r', 'application/x-pkcs7-certreqresp', ''),
-('rar', 'application/x-rar-compressed', 'mime-type-archive.png'),
-('sh', 'application/x-sh', ''),
-('shar', 'application/x-shar', ''),
-('swf', 'application/x-shockwave-flash', ''),
-('xap', 'application/x-silverlight-app', ''),
-('sit', 'application/x-stuffit', ''),
-('sitx', 'application/x-stuffitx', ''),
-('sv4cpio', 'application/x-sv4cpio', ''),
-('sv4crc', 'application/x-sv4crc', ''),
-('tar', 'application/x-tar', 'mime-type-archive.png'),
-('tcl', 'application/x-tcl', ''),
-('tex', 'application/x-tex', ''),
-('tfm', 'application/x-tex-tfm', ''),
-('texinfo', 'application/x-texinfo', ''),
-('texi', 'application/x-texinfo', ''),
-('ustar', 'application/x-ustar', ''),
-('src', 'application/x-wais-source', ''),
-('der', 'application/x-x509-ca-cert', ''),
-('crt', 'application/x-x509-ca-cert', ''),
-('fig', 'application/x-xfig', ''),
-('xpi', 'application/x-xpinstall', ''),
-('xdf', 'application/xcap-diff+xml', ''),
-('xenc', 'application/xenc+xml', ''),
-('xhtml', 'application/xhtml+xml', ''),
-('xht', 'application/xhtml+xml', ''),
-('xml', 'application/xml', ''),
-('xsl', 'application/xml', ''),
-('dtd', 'application/xml-dtd', ''),
-('xop', 'application/xop+xml', ''),
-('xslt', 'application/xslt+xml', ''),
-('xspf', 'application/xspf+xml', ''),
-('mxml', 'application/xv+xml', ''),
-('xhvml', 'application/xv+xml', ''),
-('xvml', 'application/xv+xml', ''),
-('xvm', 'application/xv+xml', ''),
-('yang', 'application/yang', ''),
-('yin', 'application/yin+xml', ''),
-('zip', 'application/zip', 'mime-type-archive.png'),
-('adp', 'audio/adpcm', 'mime-type-audio.png'),
-('au', 'audio/basic', 'mime-type-audio.png'),
-('snd', 'audio/basic', 'mime-type-audio.png'),
-('mid', 'audio/midi', 'mime-type-audio.png'),
-('midi', 'audio/midi', 'mime-type-audio.png'),
-('kar', 'audio/midi', 'mime-type-audio.png'),
-('rmi', 'audio/midi', 'mime-type-audio.png'),
-('mp4a', 'audio/mp4', 'mime-type-audio.png'),
-('m4a', 'audio/mp4a-latm', 'mime-type-audio.png'),
-('m4p', 'audio/mp4a-latm', 'mime-type-audio.png'),
-('mpga', 'audio/mpeg', 'mime-type-audio.png'),
-('mp2', 'audio/mpeg', 'mime-type-audio.png'),
-('mp2a', 'audio/mpeg', 'mime-type-audio.png'),
-('mp3', 'audio/mpeg', 'mime-type-audio.png'),
-('m2a', 'audio/mpeg', 'mime-type-audio.png'),
-('m3a', 'audio/mpeg', 'mime-type-audio.png'),
-('oga', 'audio/ogg', 'mime-type-audio.png'),
-('ogg', 'audio/ogg', 'mime-type-audio.png'),
-('spx', 'audio/ogg', 'mime-type-audio.png'),
-('uva', 'audio/vnd.dece.audio', 'mime-type-audio.png'),
-('uvva', 'audio/vnd.dece.audio', 'mime-type-audio.png'),
-('eol', 'audio/vnd.digital-winds', 'mime-type-audio.png'),
-('dra', 'audio/vnd.dra', 'mime-type-audio.png'),
-('dts', 'audio/vnd.dts', 'mime-type-audio.png'),
-('dtshd', 'audio/vnd.dts.hd', 'mime-type-audio.png'),
-('lvp', 'audio/vnd.lucent.voice', 'mime-type-audio.png'),
-('pya', 'audio/vnd.ms-playready.media.pya', 'mime-type-audio.png'),
-('ecelp4800', 'audio/vnd.nuera.ecelp4800', 'mime-type-audio.png'),
-('ecelp7470', 'audio/vnd.nuera.ecelp7470', 'mime-type-audio.png'),
-('ecelp9600', 'audio/vnd.nuera.ecelp9600', 'mime-type-audio.png'),
-('rip', 'audio/vnd.rip', 'mime-type-audio.png'),
-('weba', 'audio/webm', 'mime-type-audio.png'),
-('aac', 'audio/x-aac', 'mime-type-audio.png'),
-('aif', 'audio/x-aiff', 'mime-type-audio.png'),
-('aiff', 'audio/x-aiff', 'mime-type-audio.png'),
-('aifc', 'audio/x-aiff', 'mime-type-audio.png'),
-('m3u', 'audio/x-mpegurl', 'mime-type-audio.png'),
-('wax', 'audio/x-ms-wax', 'mime-type-audio.png'),
-('wma', 'audio/x-ms-wma', 'mime-type-audio.png'),
-('ram', 'audio/x-pn-realaudio', 'mime-type-audio.png'),
-('ra', 'audio/x-pn-realaudio', 'mime-type-audio.png'),
-('rmp', 'audio/x-pn-realaudio-plugin', 'mime-type-audio.png'),
-('wav', 'audio/x-wav', 'mime-type-audio.png'),
-('cdx', 'chemical/x-cdx', 'mime-type-vector.png'),
-('cif', 'chemical/x-cif', ''),
-('cmdf', 'chemical/x-cmdf', ''),
-('cml', 'chemical/x-cml', ''),
-('csml', 'chemical/x-csml', ''),
-('xyz', 'chemical/x-xyz', ''),
-('bmp', 'image/bmp', 'mime-type-image.png'),
-('cgm', 'image/cgm', 'mime-type-image.png'),
-('g3', 'image/g3fax', 'mime-type-image.png'),
-('gif', 'image/gif', 'mime-type-image.png'),
-('ief', 'image/ief', 'mime-type-image.png'),
-('jp2', 'image/jp2', 'mime-type-image.png'),
-('jpeg', 'image/jpeg', 'mime-type-image.png'),
-('jpg', 'image/jpeg', 'mime-type-image.png'),
-('jpe', 'image/jpeg', 'mime-type-image.png'),
-('ktx', 'image/ktx', 'mime-type-image.png'),
-('pict', 'image/pict', 'mime-type-image.png'),
-('pic', 'image/pict', 'mime-type-image.png'),
-('pct', 'image/pict', 'mime-type-image.png'),
-('png', 'image/png', 'mime-type-png.png'),
-('btif', 'image/prs.btif', 'mime-type-image.png'),
-('svg', 'image/svg+xml', 'mime-type-image.png'),
-('svgz', 'image/svg+xml', 'mime-type-image.png'),
-('tiff', 'image/tiff', 'mime-type-image.png'),
-('tif', 'image/tiff', 'mime-type-image.png'),
-('psd', 'image/vnd.adobe.photoshop', 'mime-type-psd.png'),
-('uvi', 'image/vnd.dece.graphic', 'mime-type-image.png'),
-('uvvi', 'image/vnd.dece.graphic', 'mime-type-image.png'),
-('uvg', 'image/vnd.dece.graphic', 'mime-type-image.png'),
-('uvvg', 'image/vnd.dece.graphic', 'mime-type-image.png'),
-('sub', 'image/vnd.dvb.subtitle', 'mime-type-image.png'),
-('djvu', 'image/vnd.djvu', 'mime-type-image.png'),
-('djv', 'image/vnd.djvu', 'mime-type-image.png'),
-('dwg', 'image/vnd.dwg', 'mime-type-image.png'),
-('dxf', 'image/vnd.dxf', 'mime-type-image.png'),
-('fbs', 'image/vnd.fastbidsheet', 'mime-type-image.png'),
-('fpx', 'image/vnd.fpx', 'mime-type-image.png'),
-('fst', 'image/vnd.fst', 'mime-type-image.png'),
-('mmr', 'image/vnd.fujixerox.edmics-mmr', 'mime-type-image.png'),
-('rlc', 'image/vnd.fujixerox.edmics-rlc', 'mime-type-image.png'),
-('mdi', 'image/vnd.ms-modi', 'mime-type-image.png'),
-('npx', 'image/vnd.net-fpx', 'mime-type-image.png'),
-('wbmp', 'image/vnd.wap.wbmp', 'mime-type-image.png'),
-('xif', 'image/vnd.xiff', 'mime-type-image.png'),
-('webp', 'image/webp', 'mime-type-image.png'),
-('ras', 'image/x-cmu-raster', 'mime-type-image.png'),
-('cmx', 'image/x-cmx', 'mime-type-image.png'),
-('fh', 'image/x-freehand', 'mime-type-image.png'),
-('fhc', 'image/x-freehand', 'mime-type-image.png'),
-('fh4', 'image/x-freehand', 'mime-type-image.png'),
-('fh5', 'image/x-freehand', 'mime-type-image.png'),
-('fh7', 'image/x-freehand', 'mime-type-image.png'),
-('ico', 'image/x-icon', 'mime-type-image.png'),
-('pntg', 'image/x-macpaint', 'mime-type-image.png'),
-('pnt', 'image/x-macpaint', 'mime-type-image.png'),
-('mac', 'image/x-macpaint', 'mime-type-image.png'),
-('pcx', 'image/x-pcx', 'mime-type-image.png'),
-('pnm', 'image/x-portable-anymap', 'mime-type-image.png'),
-('pbm', 'image/x-portable-bitmap', 'mime-type-image.png'),
-('pgm', 'image/x-portable-graymap', 'mime-type-image.png'),
-('ppm', 'image/x-portable-pixmap', 'mime-type-image.png'),
-('qtif', 'image/x-quicktime', 'mime-type-image.png'),
-('qti', 'image/x-quicktime', 'mime-type-image.png'),
-('rgb', 'image/x-rgb', 'mime-type-image.png'),
-('xbm', 'image/x-xbitmap', 'mime-type-image.png'),
-('xpm', 'image/x-xpixmap', 'mime-type-image.png'),
-('xwd', 'image/x-xwindowdump', 'mime-type-image.png'),
-('eml', 'message/rfc822', ''),
-('mime', 'message/rfc822', ''),
-('igs', 'model/iges', ''),
-('iges', 'model/iges', ''),
-('msh', 'model/mesh', ''),
-('mesh', 'model/mesh', ''),
-('silo', 'model/mesh', ''),
-('dae', 'model/vnd.collada+xml', ''),
-('dwf', 'model/vnd.dwf', ''),
-('gdl', 'model/vnd.gdl', ''),
-('gtw', 'model/vnd.gtw', ''),
-('mts', 'model/vnd.mts', ''),
-('vtu', 'model/vnd.vtu', ''),
-('wrl', 'model/vrml', ''),
-('vrml', 'model/vrml', ''),
-('manifest', 'text/cache-manifest', ''),
-('ics', 'text/calendar', ''),
-('ifb', 'text/calendar', ''),
-('css', 'text/css', ''),
-('csv', 'text/csv', 'mime-type-spreadsheet.png'),
-('html', 'text/html', ''),
-('htm', 'text/html', ''),
-('n3', 'text/n3', ''),
-('txt', 'text/plain', 'mime-type-document.png'),
-('text', 'text/plain', ''),
-('conf', 'text/plain', ''),
-('def', 'text/plain', ''),
-('list', 'text/plain', ''),
-('log', 'text/plain', ''),
-('in', 'text/plain', ''),
-('dsc', 'text/prs.lines.tag', ''),
-('rtx', 'text/richtext', ''),
-('sgml', 'text/sgml', ''),
-('sgm', 'text/sgml', ''),
-('tsv', 'text/tab-separated-values', ''),
-('t', 'text/troff', ''),
-('tr', 'text/troff', ''),
-('roff', 'text/troff', ''),
-('man', 'text/troff', ''),
-('me', 'text/troff', ''),
-('ms', 'text/troff', ''),
-('ttl', 'text/turtle', ''),
-('uri', 'text/uri-list', ''),
-('uris', 'text/uri-list', ''),
-('urls', 'text/uri-list', ''),
-('curl', 'text/vnd.curl', ''),
-('dcurl', 'text/vnd.curl.dcurl', ''),
-('scurl', 'text/vnd.curl.scurl', ''),
-('mcurl', 'text/vnd.curl.mcurl', ''),
-('fly', 'text/vnd.fly', ''),
-('flx', 'text/vnd.fmi.flexstor', ''),
-('gv', 'text/vnd.graphviz', ''),
-('3dml', 'text/vnd.in3d.3dml', ''),
-('spot', 'text/vnd.in3d.spot', ''),
-('jad', 'text/vnd.sun.j2me.app-descriptor', ''),
-('wml', 'text/vnd.wap.wml', ''),
-('wmls', 'text/vnd.wap.wmlscript', ''),
-('s', 'text/x-asm', ''),
-('asm', 'text/x-asm', ''),
-('c', 'text/x-c', ''),
-('cc', 'text/x-c', ''),
-('cxx', 'text/x-c', ''),
-('cpp', 'text/x-c', ''),
-('h', 'text/x-c', ''),
-('hh', 'text/x-c', ''),
-('dic', 'text/x-c', ''),
-('f', 'text/x-fortran', ''),
-('for', 'text/x-fortran', ''),
-('f77', 'text/x-fortran', ''),
-('f90', 'text/x-fortran', ''),
-('p', 'text/x-pascal', ''),
-('pas', 'text/x-pascal', ''),
-('java', 'text/x-java-source', ''),
-('etx', 'text/x-setext', ''),
-('uu', 'text/x-uuencode', ''),
-('vcs', 'text/x-vcalendar', ''),
-('vcf', 'text/x-vcard', ''),
-('3gp', 'video/3gpp', 'mime-type-video.png'),
-('3g2', 'video/3gpp2', 'mime-type-video.png'),
-('h261', 'video/h261', 'mime-type-video.png'),
-('h263', 'video/h263', 'mime-type-video.png'),
-('h264', 'video/h264', 'mime-type-video.png'),
-('jpgv', 'video/jpeg', 'mime-type-video.png'),
-('jpm', 'video/jpm', 'mime-type-video.png'),
-('jpgm', 'video/jpm', 'mime-type-video.png'),
-('mj2', 'video/mj2', 'mime-type-video.png'),
-('mjp2', 'video/mj2', 'mime-type-video.png'),
-('ts', 'video/mp2t', 'mime-type-video.png'),
-('mp4', 'video/mp4', 'mime-type-video.png'),
-('mp4v', 'video/mp4', 'mime-type-video.png'),
-('mpg4', 'video/mp4', 'mime-type-video.png'),
-('m4v', 'video/mp4', 'mime-type-video.png'),
-('mpeg', 'video/mpeg', 'mime-type-video.png'),
-('mpg', 'video/mpeg', 'mime-type-video.png'),
-('mpe', 'video/mpeg', 'mime-type-video.png'),
-('m1v', 'video/mpeg', 'mime-type-video.png'),
-('m2v', 'video/mpeg', 'mime-type-video.png'),
-('ogv', 'video/ogg', 'mime-type-video.png'),
-('qt', 'video/quicktime', 'mime-type-video.png'),
-('mov', 'video/quicktime', 'mime-type-video.png'),
-('uvh', 'video/vnd.dece.hd', 'mime-type-video.png'),
-('uvvh', 'video/vnd.dece.hd', 'mime-type-video.png'),
-('uvm', 'video/vnd.dece.mobile', 'mime-type-video.png'),
-('uvvm', 'video/vnd.dece.mobile', 'mime-type-video.png'),
-('uvp', 'video/vnd.dece.pd', 'mime-type-video.png'),
-('uvvp', 'video/vnd.dece.pd', 'mime-type-video.png'),
-('uvs', 'video/vnd.dece.sd', 'mime-type-video.png'),
-('uvvs', 'video/vnd.dece.sd', 'mime-type-video.png'),
-('uvv', 'video/vnd.dece.video', 'mime-type-video.png'),
-('uvvv', 'video/vnd.dece.video', 'mime-type-video.png'),
-('fvt', 'video/vnd.fvt', 'mime-type-video.png'),
-('mxu', 'video/vnd.mpegurl', 'mime-type-video.png'),
-('m4u', 'video/vnd.mpegurl', 'mime-type-video.png'),
-('pyv', 'video/vnd.ms-playready.media.pyv', 'mime-type-video.png'),
-('uvu', 'video/vnd.uvvu.mp4', 'mime-type-video.png'),
-('uvvu', 'video/vnd.uvvu.mp4', 'mime-type-video.png'),
-('viv', 'video/vnd.vivo', 'mime-type-video.png'),
-('dv', 'video/x-dv', 'mime-type-video.png'),
-('dif', 'video/x-dv', 'mime-type-video.png'),
-('webm', 'video/webm', 'mime-type-video.png'),
-('f4v', 'video/x-f4v', 'mime-type-video.png'),
-('fli', 'video/x-fli', 'mime-type-video.png'),
-('flv', 'video/x-flv', 'mime-type-video.png'),
-('asf', 'video/x-ms-asf', 'mime-type-video.png'),
-('asx', 'video/x-ms-asf', 'mime-type-video.png'),
-('wm', 'video/x-ms-wm', 'mime-type-video.png'),
-('wmv', 'video/x-ms-wmv', 'mime-type-video.png'),
-('wmx', 'video/x-ms-wmx', 'mime-type-video.png'),
-('wvx', 'video/x-ms-wvx', 'mime-type-video.png'),
-('avi', 'video/x-msvideo', 'mime-type-video.png'),
-('movie', 'video/x-sgi-movie', 'mime-type-video.png'),
-('ice', 'x-conference/x-cooltalk', '');
+INSERT INTO `sys_storage_mime_types` (`ext`, `mime_type`, `icon`, `icon_font`) VALUES
+('ez', 'application/andrew-inset', '', ''),
+('aw', 'application/applixware', '', ''),
+('atom', 'application/atom+xml', '', ''),
+('atomcat', 'application/atomcat+xml', '', ''),
+('atomsvc', 'application/atomsvc+xml', '', ''),
+('ccxml', 'application/ccxml+xml', '', ''),
+('cdmia', 'application/cdmi-capability', '', ''),
+('cdmic', 'application/cdmi-container', '', ''),
+('cdmid', 'application/cdmi-domain', '', ''),
+('cdmio', 'application/cdmi-object', '', ''),
+('cdmiq', 'application/cdmi-queue', '', ''),
+('cu', 'application/cu-seeme', '', ''),
+('davmount', 'application/davmount+xml', '', ''),
+('dbk', 'application/docbook+xml', '', ''),
+('dssc', 'application/dssc+der', '', ''),
+('xdssc', 'application/dssc+xml', '', ''),
+('ecma', 'application/ecmascript', '', ''),
+('emma', 'application/emma+xml', '', ''),
+('epub', 'application/epub+zip', '', ''),
+('exi', 'application/exi', '', ''),
+('pfr', 'application/font-tdpfr', '', ''),
+('gml', 'application/gml+xml', '', ''),
+('gpx', 'application/gpx+xml', '', ''),
+('gxf', 'application/gxf', '', ''),
+('stk', 'application/hyperstudio', '', ''),
+('ink', 'application/inkml+xml', '', ''),
+('inkml', 'application/inkml+xml', '', ''),
+('ipfix', 'application/ipfix', '', ''),
+('jar', 'application/java-archive', '', ''),
+('ser', 'application/java-serialized-object', '', ''),
+('class', 'application/java-vm', '', ''),
+('js', 'application/javascript', '', 'file-code-o'),
+('json', 'application/json', '', 'file-code-o'),
+('jsonml', 'application/jsonml+json', '', ''),
+('lostxml', 'application/lost+xml', '', ''),
+('hqx', 'application/mac-binhex40', '', ''),
+('cpt', 'application/mac-compactpro', '', ''),
+('mads', 'application/mads+xml', '', ''),
+('mrc', 'application/marc', '', ''),
+('mrcx', 'application/marcxml+xml', '', ''),
+('ma', 'application/mathematica', '', ''),
+('nb', 'application/mathematica', '', ''),
+('mb', 'application/mathematica', '', ''),
+('mathml', 'application/mathml+xml', '', ''),
+('mbox', 'application/mbox', '', ''),
+('mscml', 'application/mediaservercontrol+xml', '', ''),
+('metalink', 'application/metalink+xml', '', ''),
+('meta4', 'application/metalink4+xml', '', ''),
+('mets', 'application/mets+xml', '', ''),
+('mods', 'application/mods+xml', '', ''),
+('m21', 'application/mp21', '', ''),
+('mp21', 'application/mp21', '', ''),
+('mp4s', 'application/mp4', '', ''),
+('doc', 'application/msword', 'mime-type-document.png', 'file-word-o'),
+('dot', 'application/msword', '', ''),
+('mxf', 'application/mxf', '', ''),
+('bin', 'application/octet-stream', '', ''),
+('dms', 'application/octet-stream', '', ''),
+('lrf', 'application/octet-stream', '', ''),
+('mar', 'application/octet-stream', '', ''),
+('so', 'application/octet-stream', '', ''),
+('dist', 'application/octet-stream', '', ''),
+('distz', 'application/octet-stream', '', ''),
+('pkg', 'application/octet-stream', '', ''),
+('bpk', 'application/octet-stream', '', ''),
+('dump', 'application/octet-stream', '', ''),
+('elc', 'application/octet-stream', '', ''),
+('deploy', 'application/octet-stream', '', ''),
+('mobipocket-ebook', 'application/octet-stream', '', ''),
+('oda', 'application/oda', '', ''),
+('opf', 'application/oebps-package+xml', '', ''),
+('ogx', 'application/ogg', '', ''),
+('omdoc', 'application/omdoc+xml', '', ''),
+('onetoc', 'application/onenote', '', ''),
+('onetoc2', 'application/onenote', '', ''),
+('onetmp', 'application/onenote', '', ''),
+('onepkg', 'application/onenote', '', ''),
+('oxps', 'application/oxps', '', ''),
+('xer', 'application/patch-ops-error+xml', '', ''),
+('pdf', 'application/pdf', 'mime-type-document.png', 'file-pdf-o'),
+('pgp', 'application/pgp-encrypted', '', ''),
+('asc', 'application/pgp-signature', '', ''),
+('sig', 'application/pgp-signature', '', ''),
+('prf', 'application/pics-rules', '', ''),
+('p10', 'application/pkcs10', 'mime-type-vector.png', ''),
+('p7m', 'application/pkcs7-mime', '', ''),
+('p7c', 'application/pkcs7-mime', '', ''),
+('p7s', 'application/pkcs7-signature', '', ''),
+('p8', 'application/pkcs8', '', ''),
+('ac', 'application/pkix-attr-cert', '', ''),
+('cer', 'application/pkix-cert', '', ''),
+('crl', 'application/pkix-crl', '', ''),
+('pkipath', 'application/pkix-pkipath', '', ''),
+('pki', 'application/pkixcmp', '', ''),
+('pls', 'application/pls+xml', '', ''),
+('ai', 'application/postscript', 'mime-type-vector.png', ''),
+('eps', 'application/postscript', '', ''),
+('ps', 'application/postscript', 'mime-type-vector.png', ''),
+('cww', 'application/prs.cww', '', ''),
+('pskcxml', 'application/pskc+xml', '', ''),
+('rdf', 'application/rdf+xml', '', 'file-code-o'),
+('rif', 'application/reginfo+xml', '', ''),
+('rnc', 'application/relax-ng-compact-syntax', '', ''),
+('rl', 'application/resource-lists+xml', '', ''),
+('rld', 'application/resource-lists-diff+xml', '', ''),
+('rs', 'application/rls-services+xml', '', ''),
+('gbr', 'application/rpki-ghostbusters', '', ''),
+('mft', 'application/rpki-manifest', '', ''),
+('roa', 'application/rpki-roa', '', ''),
+('rsd', 'application/rsd+xml', '', ''),
+('rss', 'application/rss+xml', '', 'file-code-o'),
+('rtf', 'application/rtf', 'mime-type-document.png', ''),
+('sbml', 'application/sbml+xml', '', ''),
+('scq', 'application/scvp-cv-request', '', ''),
+('scs', 'application/scvp-cv-response', '', ''),
+('spq', 'application/scvp-vp-request', '', ''),
+('spp', 'application/scvp-vp-response', '', ''),
+('sdp', 'application/sdp', 'mime-type-presentation.png', 'file-powerpoint-o'),
+('setpay', 'application/set-payment-initiation', '', ''),
+('setreg', 'application/set-registration-initiation', '', ''),
+('shf', 'application/shf+xml', '', ''),
+('smi', 'application/smil+xml', '', ''),
+('smil', 'application/smil+xml', '', ''),
+('rq', 'application/sparql-query', '', ''),
+('srx', 'application/sparql-results+xml', '', ''),
+('gram', 'application/srgs', '', ''),
+('grxml', 'application/srgs+xml', '', ''),
+('sru', 'application/sru+xml', '', ''),
+('ssdl', 'application/ssdl+xml', '', ''),
+('ssml', 'application/ssml+xml', '', ''),
+('tei', 'application/tei+xml', '', ''),
+('teicorpus', 'application/tei+xml', '', ''),
+('tfi', 'application/thraud+xml', '', ''),
+('tsd', 'application/timestamped-data', '', ''),
+('plb', 'application/vnd.3gpp.pic-bw-large', '', ''),
+('psb', 'application/vnd.3gpp.pic-bw-small', '', ''),
+('pvb', 'application/vnd.3gpp.pic-bw-var', '', ''),
+('tcap', 'application/vnd.3gpp2.tcap', '', ''),
+('pwn', 'application/vnd.3m.post-it-notes', '', ''),
+('aso', 'application/vnd.accpac.simply.aso', '', ''),
+('imp', 'application/vnd.accpac.simply.imp', '', ''),
+('acu', 'application/vnd.acucobol', '', ''),
+('atc', 'application/vnd.acucorp', '', ''),
+('acutc', 'application/vnd.acucorp', '', ''),
+('air', 'application/vnd.adobe.air-application-installer-package+zip', '', ''),
+('fcdt', 'application/vnd.adobe.formscentral.fcdt', '', ''),
+('fxp', 'application/vnd.adobe.fxp', '', ''),
+('fxpl', 'application/vnd.adobe.fxp', '', ''),
+('xdp', 'application/vnd.adobe.xdp+xml', '', ''),
+('xfdf', 'application/vnd.adobe.xfdf', '', ''),
+('ahead', 'application/vnd.ahead.space', '', ''),
+('azf', 'application/vnd.airzip.filesecure.azf', '', ''),
+('azs', 'application/vnd.airzip.filesecure.azs', '', ''),
+('azw', 'application/vnd.amazon.ebook', '', ''),
+('acc', 'application/vnd.americandynamics.acc', '', ''),
+('ami', 'application/vnd.amiga.ami', '', ''),
+('apk', 'application/vnd.android.package-archive', '', ''),
+('cii', 'application/vnd.anser-web-certificate-issue-initiation', '', ''),
+('fti', 'application/vnd.anser-web-funds-transfer-initiation', '', ''),
+('atx', 'application/vnd.antix.game-component', '', ''),
+('mpkg', 'application/vnd.apple.installer+xml', '', ''),
+('m3u8', 'application/vnd.apple.mpegurl', '', ''),
+('swi', 'application/vnd.aristanetworks.swi', '', ''),
+('iota', 'application/vnd.astraea-software.iota', '', ''),
+('aep', 'application/vnd.audiograph', '', ''),
+('mpm', 'application/vnd.blueice.multipass', '', ''),
+('bmi', 'application/vnd.bmi', '', ''),
+('rep', 'application/vnd.businessobjects', '', ''),
+('cdxml', 'application/vnd.chemdraw+xml', '', ''),
+('mmd', 'application/vnd.chipnuts.karaoke-mmd', '', ''),
+('cdy', 'application/vnd.cinderella', '', ''),
+('cla', 'application/vnd.claymore', '', ''),
+('rp9', 'application/vnd.cloanto.rp9', '', ''),
+('c4g', 'application/vnd.clonk.c4group', '', ''),
+('c4d', 'application/vnd.clonk.c4group', '', ''),
+('c4f', 'application/vnd.clonk.c4group', '', ''),
+('c4p', 'application/vnd.clonk.c4group', '', ''),
+('c4u', 'application/vnd.clonk.c4group', '', ''),
+('c11amc', 'application/vnd.cluetrust.cartomobile-config', '', ''),
+('c11amz', 'application/vnd.cluetrust.cartomobile-config-pkg', '', ''),
+('csp', 'application/vnd.commonspace', '', ''),
+('cdbcmsg', 'application/vnd.contact.cmsg', '', ''),
+('cmc', 'application/vnd.cosmocaller', '', ''),
+('clkx', 'application/vnd.crick.clicker', '', ''),
+('clkk', 'application/vnd.crick.clicker.keyboard', '', ''),
+('clkp', 'application/vnd.crick.clicker.palette', '', ''),
+('clkt', 'application/vnd.crick.clicker.template', '', ''),
+('clkw', 'application/vnd.crick.clicker.wordbank', '', ''),
+('wbs', 'application/vnd.criticaltools.wbs+xml', '', ''),
+('pml', 'application/vnd.ctc-posml', '', ''),
+('ppd', 'application/vnd.cups-ppd', '', ''),
+('car', 'application/vnd.curl.car', '', ''),
+('pcurl', 'application/vnd.curl.pcurl', '', ''),
+('dart', 'application/vnd.dart', '', ''),
+('rdz', 'application/vnd.data-vision.rdz', '', ''),
+('uvf', 'application/vnd.dece.data', '', ''),
+('uvvf', 'application/vnd.dece.data', '', ''),
+('uvd', 'application/vnd.dece.data', '', ''),
+('uvvd', 'application/vnd.dece.data', '', ''),
+('uvt', 'application/vnd.dece.ttml+xml', '', ''),
+('uvvt', 'application/vnd.dece.ttml+xml', '', ''),
+('uvx', 'application/vnd.dece.unspecified', '', ''),
+('uvvx', 'application/vnd.dece.unspecified', '', ''),
+('uvz', 'application/vnd.dece.zip', '', ''),
+('uvvz', 'application/vnd.dece.zip', '', ''),
+('fe_launch', 'application/vnd.denovo.fcselayout-link', '', ''),
+('dna', 'application/vnd.dna', '', ''),
+('mlp', 'application/vnd.dolby.mlp', '', ''),
+('dpg', 'application/vnd.dpgraph', '', ''),
+('dfac', 'application/vnd.dreamfactory', '', ''),
+('kpxx', 'application/vnd.ds-keypoint', '', ''),
+('ait', 'application/vnd.dvb.ait', 'mime-type-vector.png', ''),
+('svc', 'application/vnd.dvb.service', '', ''),
+('geo', 'application/vnd.dynageo', '', ''),
+('mag', 'application/vnd.ecowin.chart', '', ''),
+('nml', 'application/vnd.enliven', '', ''),
+('esf', 'application/vnd.epson.esf', '', ''),
+('msf', 'application/vnd.epson.msf', '', ''),
+('qam', 'application/vnd.epson.quickanime', '', ''),
+('slt', 'application/vnd.epson.salt', '', ''),
+('ssf', 'application/vnd.epson.ssf', '', ''),
+('es3', 'application/vnd.eszigno3+xml', '', ''),
+('et3', 'application/vnd.eszigno3+xml', '', ''),
+('ez2', 'application/vnd.ezpix-album', '', ''),
+('ez3', 'application/vnd.ezpix-package', '', ''),
+('fdf', 'application/vnd.fdf', '', ''),
+('mseed', 'application/vnd.fdsn.mseed', '', ''),
+('seed', 'application/vnd.fdsn.seed', '', ''),
+('dataless', 'application/vnd.fdsn.seed', '', ''),
+('gph', 'application/vnd.flographit', '', ''),
+('ftc', 'application/vnd.fluxtime.clip', '', ''),
+('fm', 'application/vnd.framemaker', '', ''),
+('frame', 'application/vnd.framemaker', '', ''),
+('maker', 'application/vnd.framemaker', '', ''),
+('book', 'application/vnd.framemaker', '', ''),
+('fnc', 'application/vnd.frogans.fnc', '', ''),
+('ltf', 'application/vnd.frogans.ltf', '', ''),
+('fsc', 'application/vnd.fsc.weblaunch', '', ''),
+('oas', 'application/vnd.fujitsu.oasys', '', ''),
+('oa2', 'application/vnd.fujitsu.oasys2', '', ''),
+('oa3', 'application/vnd.fujitsu.oasys3', '', ''),
+('fg5', 'application/vnd.fujitsu.oasysgp', '', ''),
+('bh2', 'application/vnd.fujitsu.oasysprs', '', ''),
+('ddd', 'application/vnd.fujixerox.ddd', '', ''),
+('xdw', 'application/vnd.fujixerox.docuworks', '', ''),
+('xbd', 'application/vnd.fujixerox.docuworks.binder', '', ''),
+('fzs', 'application/vnd.fuzzysheet', '', ''),
+('txd', 'application/vnd.genomatix.tuxedo', '', ''),
+('ggb', 'application/vnd.geogebra.file', '', ''),
+('ggt', 'application/vnd.geogebra.tool', '', ''),
+('gex', 'application/vnd.geometry-explorer', '', ''),
+('gre', 'application/vnd.geometry-explorer', '', ''),
+('gxt', 'application/vnd.geonext', '', ''),
+('g2w', 'application/vnd.geoplan', '', ''),
+('g3w', 'application/vnd.geospace', '', ''),
+('gmx', 'application/vnd.gmx', '', ''),
+('kml', 'application/vnd.google-earth.kml+xml', '', ''),
+('kmz', 'application/vnd.google-earth.kmz', '', ''),
+('gqf', 'application/vnd.grafeq', '', ''),
+('gqs', 'application/vnd.grafeq', '', ''),
+('gac', 'application/vnd.groove-account', '', ''),
+('ghf', 'application/vnd.groove-help', '', ''),
+('gim', 'application/vnd.groove-identity-message', '', ''),
+('grv', 'application/vnd.groove-injector', '', ''),
+('gtm', 'application/vnd.groove-tool-message', '', ''),
+('tpl', 'application/vnd.groove-tool-template', '', 'file-code-o'),
+('vcg', 'application/vnd.groove-vcard', '', ''),
+('hal', 'application/vnd.hal+xml', '', ''),
+('zmm', 'application/vnd.handheld-entertainment+xml', '', ''),
+('hbci', 'application/vnd.hbci', '', ''),
+('les', 'application/vnd.hhe.lesson-player', '', ''),
+('hpgl', 'application/vnd.hp-hpgl', 'mime-type-vector.png', ''),
+('hpid', 'application/vnd.hp-hpid', '', ''),
+('hps', 'application/vnd.hp-hps', '', ''),
+('jlt', 'application/vnd.hp-jlyt', '', ''),
+('pcl', 'application/vnd.hp-pcl', '', ''),
+('pclxl', 'application/vnd.hp-pclxl', '', ''),
+('sfd-hdstx', 'application/vnd.hydrostatix.sof-data', '', ''),
+('mpy', 'application/vnd.ibm.minipay', '', ''),
+('afp', 'application/vnd.ibm.modcap', '', ''),
+('listafp', 'application/vnd.ibm.modcap', '', ''),
+('list3820', 'application/vnd.ibm.modcap', '', ''),
+('irm', 'application/vnd.ibm.rights-management', '', ''),
+('sc', 'application/vnd.ibm.secure-container', '', ''),
+('icc', 'application/vnd.iccprofile', '', ''),
+('icm', 'application/vnd.iccprofile', '', ''),
+('igl', 'application/vnd.igloader', '', ''),
+('ivp', 'application/vnd.immervision-ivp', '', ''),
+('ivu', 'application/vnd.immervision-ivu', '', ''),
+('igm', 'application/vnd.insors.igm', '', ''),
+('xpw', 'application/vnd.intercon.formnet', '', ''),
+('xpx', 'application/vnd.intercon.formnet', '', ''),
+('i2g', 'application/vnd.intergeo', '', ''),
+('qbo', 'application/vnd.intu.qbo', '', ''),
+('qfx', 'application/vnd.intu.qfx', '', ''),
+('rcprofile', 'application/vnd.ipunplugged.rcprofile', '', ''),
+('irp', 'application/vnd.irepository.package+xml', '', ''),
+('xpr', 'application/vnd.is-xpr', '', ''),
+('fcs', 'application/vnd.isac.fcs', '', ''),
+('jam', 'application/vnd.jam', '', ''),
+('rms', 'application/vnd.jcp.javame.midlet-rms', '', ''),
+('jisp', 'application/vnd.jisp', '', ''),
+('joda', 'application/vnd.joost.joda-archive', '', ''),
+('ktz', 'application/vnd.kahootz', '', ''),
+('ktr', 'application/vnd.kahootz', '', ''),
+('karbon', 'application/vnd.kde.karbon', '', ''),
+('chrt', 'application/vnd.kde.kchart', '', ''),
+('kfo', 'application/vnd.kde.kformula', '', ''),
+('flw', 'application/vnd.kde.kivio', '', ''),
+('kon', 'application/vnd.kde.kontour', '', ''),
+('kpr', 'application/vnd.kde.kpresenter', '', ''),
+('kpt', 'application/vnd.kde.kpresenter', '', ''),
+('ksp', 'application/vnd.kde.kspread', '', ''),
+('kwd', 'application/vnd.kde.kword', '', ''),
+('kwt', 'application/vnd.kde.kword', '', ''),
+('htke', 'application/vnd.kenameaapp', '', ''),
+('kia', 'application/vnd.kidspiration', '', ''),
+('kne', 'application/vnd.kinar', '', ''),
+('knp', 'application/vnd.kinar', '', ''),
+('skp', 'application/vnd.koan', '', ''),
+('skd', 'application/vnd.koan', '', ''),
+('skt', 'application/vnd.koan', '', ''),
+('skm', 'application/vnd.koan', '', ''),
+('sse', 'application/vnd.kodak-descriptor', '', ''),
+('lasxml', 'application/vnd.las.las+xml', '', ''),
+('lbd', 'application/vnd.llamagraphics.life-balance.desktop', '', ''),
+('lbe', 'application/vnd.llamagraphics.life-balance.exchange+xml', '', ''),
+('123', 'application/vnd.lotus-1-2-3', '', ''),
+('apr', 'application/vnd.lotus-approach', '', ''),
+('pre', 'application/vnd.lotus-freelance', '', ''),
+('nsf', 'application/vnd.lotus-notes', '', ''),
+('org', 'application/vnd.lotus-organizer', '', ''),
+('scm', 'application/vnd.lotus-screencam', '', ''),
+('lwp', 'application/vnd.lotus-wordpro', '', ''),
+('portpkg', 'application/vnd.macports.portpkg', '', ''),
+('mcd', 'application/vnd.mcd', '', ''),
+('mc1', 'application/vnd.medcalcdata', '', ''),
+('cdkey', 'application/vnd.mediastation.cdkey', '', ''),
+('mwf', 'application/vnd.mfer', '', ''),
+('mfm', 'application/vnd.mfmp', '', ''),
+('flo', 'application/vnd.micrografx.flo', '', ''),
+('igx', 'application/vnd.micrografx.igx', '', ''),
+('mif', 'application/vnd.mif', '', ''),
+('daf', 'application/vnd.mobius.daf', '', ''),
+('dis', 'application/vnd.mobius.dis', '', ''),
+('mbk', 'application/vnd.mobius.mbk', '', ''),
+('mqy', 'application/vnd.mobius.mqy', '', ''),
+('msl', 'application/vnd.mobius.msl', '', ''),
+('plc', 'application/vnd.mobius.plc', '', ''),
+('txf', 'application/vnd.mobius.txf', '', ''),
+('mpn', 'application/vnd.mophun.application', '', ''),
+('mpc', 'application/vnd.mophun.certificate', '', ''),
+('xul', 'application/vnd.mozilla.xul+xml', '', ''),
+('cil', 'application/vnd.ms-artgalry', 'mime-type-vector.png', ''),
+('cab', 'application/vnd.ms-cab-compressed', 'mime-type-archive.png', 'file-archive-o'),
+('xls', 'application/vnd.ms-excel', 'mime-type-spreadsheet.png', 'file-excel-o'),
+('xlm', 'application/vnd.ms-excel', '', ''),
+('xla', 'application/vnd.ms-excel', '', ''),
+('xlc', 'application/vnd.ms-excel', '', ''),
+('xlt', 'application/vnd.ms-excel', 'mime-type-spreadsheet.png', 'file-excel-o'),
+('xlw', 'application/vnd.ms-excel', '', ''),
+('xlam', 'application/vnd.ms-excel.addin.macroenabled.12', '', ''),
+('xlsb', 'application/vnd.ms-excel.sheet.binary.macroenabled.12', '', ''),
+('xlsm', 'application/vnd.ms-excel.sheet.macroenabled.12', '', ''),
+('xltm', 'application/vnd.ms-excel.template.macroenabled.12', '', ''),
+('eot', 'application/vnd.ms-fontobject', '', ''),
+('chm', 'application/vnd.ms-htmlhelp', '', ''),
+('ims', 'application/vnd.ms-ims', '', ''),
+('lrm', 'application/vnd.ms-lrm', '', ''),
+('thmx', 'application/vnd.ms-officetheme', '', ''),
+('cat', 'application/vnd.ms-pki.seccat', '', ''),
+('stl', 'application/vnd.ms-pki.stl', '', ''),
+('ppt', 'application/vnd.ms-powerpoint', 'mime-type-presentation.png', 'file-powerpoint-o'),
+('pps', 'application/vnd.ms-powerpoint', '', ''),
+('pot', 'application/vnd.ms-powerpoint', '', ''),
+('ppam', 'application/vnd.ms-powerpoint.addin.macroenabled.12', '', ''),
+('pptm', 'application/vnd.ms-powerpoint.presentation.macroenabled.12', '', ''),
+('sldm', 'application/vnd.ms-powerpoint.slide.macroenabled.12', '', ''),
+('ppsm', 'application/vnd.ms-powerpoint.slideshow.macroenabled.12', '', ''),
+('potm', 'application/vnd.ms-powerpoint.template.macroenabled.12', '', ''),
+('mpp', 'application/vnd.ms-project', '', ''),
+('mpt', 'application/vnd.ms-project', '', ''),
+('docm', 'application/vnd.ms-word.document.macroenabled.12', '', ''),
+('dotm', 'application/vnd.ms-word.template.macroenabled.12', '', ''),
+('wps', 'application/vnd.ms-works', '', ''),
+('wks', 'application/vnd.ms-works', '', ''),
+('wcm', 'application/vnd.ms-works', '', ''),
+('wdb', 'application/vnd.ms-works', '', ''),
+('wpl', 'application/vnd.ms-wpl', '', ''),
+('xps', 'application/vnd.ms-xpsdocument', '', ''),
+('mseq', 'application/vnd.mseq', '', ''),
+('mus', 'application/vnd.musician', '', ''),
+('msty', 'application/vnd.muvee.style', '', ''),
+('taglet', 'application/vnd.mynfc', '', ''),
+('nlu', 'application/vnd.neurolanguage.nlu', '', ''),
+('ntf', 'application/vnd.nitf', '', ''),
+('nitf', 'application/vnd.nitf', '', ''),
+('nnd', 'application/vnd.noblenet-directory', '', ''),
+('nns', 'application/vnd.noblenet-sealer', '', ''),
+('nnw', 'application/vnd.noblenet-web', '', ''),
+('ngdat', 'application/vnd.nokia.n-gage.data', '', ''),
+('n-gage', 'application/vnd.nokia.n-gage.symbian.install', '', ''),
+('rpst', 'application/vnd.nokia.radio-preset', '', ''),
+('rpss', 'application/vnd.nokia.radio-presets', '', ''),
+('edm', 'application/vnd.novadigm.edm', '', ''),
+('edx', 'application/vnd.novadigm.edx', '', ''),
+('ext', 'application/vnd.novadigm.ext', '', ''),
+('odc', 'application/vnd.oasis.opendocument.chart', '', ''),
+('otc', 'application/vnd.oasis.opendocument.chart-template', '', ''),
+('odb', 'application/vnd.oasis.opendocument.database', '', ''),
+('odf', 'application/vnd.oasis.opendocument.formula', '', ''),
+('odft', 'application/vnd.oasis.opendocument.formula-template', '', ''),
+('odg', 'application/vnd.oasis.opendocument.graphics', 'mime-type-vector.png', ''),
+('otg', 'application/vnd.oasis.opendocument.graphics-template', '', ''),
+('odi', 'application/vnd.oasis.opendocument.image', '', ''),
+('oti', 'application/vnd.oasis.opendocument.image-template', '', ''),
+('odp', 'application/vnd.oasis.opendocument.presentation', 'mime-type-presentation.png', 'file-powerpoint-o'),
+('otp', 'application/vnd.oasis.opendocument.presentation-template', '', ''),
+('ods', 'application/vnd.oasis.opendocument.spreadsheet', 'mime-type-spreadsheet.png', 'file-excel-o'),
+('ots', 'application/vnd.oasis.opendocument.spreadsheet-template', 'mime-type-spreadsheet.png', 'file-excel-o'),
+('odt', 'application/vnd.oasis.opendocument.text', 'mime-type-document.png', ''),
+('odm', 'application/vnd.oasis.opendocument.text-master', '', ''),
+('ott', 'application/vnd.oasis.opendocument.text-template', 'mime-type-document.png', ''),
+('oth', 'application/vnd.oasis.opendocument.text-web', '', ''),
+('xo', 'application/vnd.olpc-sugar', '', ''),
+('dd2', 'application/vnd.oma.dd2+xml', '', ''),
+('oxt', 'application/vnd.openofficeorg.extension', '', ''),
+('pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'mime-type-presentation.png', 'file-powerpoint-o'),
+('sldx', 'application/vnd.openxmlformats-officedocument.presentationml.slide', '', ''),
+('ppsx', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', '', ''),
+('potx', 'application/vnd.openxmlformats-officedocument.presentationml.template', '', ''),
+('xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'mime-type-spreadsheet.png', 'file-excel-o'),
+('xltx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', '', ''),
+('docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'mime-type-document.png', 'file-word-o'),
+('dotx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', '', ''),
+('mgp', 'application/vnd.osgeo.mapguide.package', '', ''),
+('dp', 'application/vnd.osgi.dp', '', ''),
+('esa', 'application/vnd.osgi.subsystem', '', ''),
+('pdb', 'application/vnd.palm', 'mime-type-document.png', ''),
+('pqa', 'application/vnd.palm', '', ''),
+('oprc', 'application/vnd.palm', '', ''),
+('paw', 'application/vnd.pawaafile', '', ''),
+('str', 'application/vnd.pg.format', '', ''),
+('ei6', 'application/vnd.pg.osasli', '', ''),
+('efif', 'application/vnd.picsel', '', ''),
+('wg', 'application/vnd.pmi.widget', '', ''),
+('plf', 'application/vnd.pocketlearn', '', ''),
+('pbd', 'application/vnd.powerbuilder6', '', ''),
+('box', 'application/vnd.previewsystems.box', '', ''),
+('mgz', 'application/vnd.proteus.magazine', '', ''),
+('qps', 'application/vnd.publishare-delta-tree', '', ''),
+('ptid', 'application/vnd.pvi.ptid1', '', ''),
+('qxd', 'application/vnd.quark.quarkxpress', '', ''),
+('qxt', 'application/vnd.quark.quarkxpress', '', ''),
+('qwd', 'application/vnd.quark.quarkxpress', '', ''),
+('qwt', 'application/vnd.quark.quarkxpress', '', ''),
+('qxl', 'application/vnd.quark.quarkxpress', '', ''),
+('qxb', 'application/vnd.quark.quarkxpress', '', ''),
+('bed', 'application/vnd.realvnc.bed', '', ''),
+('mxl', 'application/vnd.recordare.musicxml', '', ''),
+('musicxml', 'application/vnd.recordare.musicxml+xml', '', ''),
+('cryptonote', 'application/vnd.rig.cryptonote', '', ''),
+('cod', 'application/vnd.rim.cod', '', ''),
+('rm', 'application/vnd.rn-realmedia', '', ''),
+('rmvb', 'application/vnd.rn-realmedia-vbr', '', ''),
+('link66', 'application/vnd.route66.link66+xml', '', ''),
+('st', 'application/vnd.sailingtracker.track', '', ''),
+('see', 'application/vnd.seemail', '', ''),
+('sema', 'application/vnd.sema', '', ''),
+('semd', 'application/vnd.semd', '', ''),
+('semf', 'application/vnd.semf', '', ''),
+('ifm', 'application/vnd.shana.informed.formdata', '', ''),
+('itp', 'application/vnd.shana.informed.formtemplate', '', ''),
+('iif', 'application/vnd.shana.informed.interchange', '', ''),
+('ipk', 'application/vnd.shana.informed.package', '', ''),
+('twd', 'application/vnd.simtech-mindmapper', '', ''),
+('twds', 'application/vnd.simtech-mindmapper', '', ''),
+('mmf', 'application/vnd.smaf', '', ''),
+('teacher', 'application/vnd.smart.teacher', '', ''),
+('sdkm', 'application/vnd.solent.sdkm+xml', '', ''),
+('sdkd', 'application/vnd.solent.sdkm+xml', '', ''),
+('dxp', 'application/vnd.spotfire.dxp', '', ''),
+('sfs', 'application/vnd.spotfire.sfs', '', ''),
+('sdc', 'application/vnd.stardivision.calc', 'mime-type-spreadsheet.png', 'file-excel-o'),
+('sda', 'application/vnd.stardivision.draw', '', ''),
+('sdd', 'application/vnd.stardivision.impress', 'mime-type-presentation.png', 'file-powerpoint-o'),
+('smf', 'application/vnd.stardivision.math', '', ''),
+('sdw', 'application/vnd.stardivision.writer', 'mime-type-document.png', ''),
+('vor', 'application/vnd.stardivision.writer', '', ''),
+('sgl', 'application/vnd.stardivision.writer-global', '', ''),
+('smzip', 'application/vnd.stepmania.package', '', ''),
+('sm', 'application/vnd.stepmania.stepchart', '', ''),
+('sxc', 'application/vnd.sun.xml.calc', 'mime-type-spreadsheet.png', 'file-excel-o'),
+('stc', 'application/vnd.sun.xml.calc.template', 'mime-type-spreadsheet.png', 'file-excel-o'),
+('sxd', 'application/vnd.sun.xml.draw', 'mime-type-vector.png', ''),
+('std', 'application/vnd.sun.xml.draw.template', '', ''),
+('sxi', 'application/vnd.sun.xml.impress', 'mime-type-presentation.png', 'file-powerpoint-o'),
+('sti', 'application/vnd.sun.xml.impress.template', 'mime-type-presentation.png', 'file-powerpoint-o'),
+('sxm', 'application/vnd.sun.xml.math', '', ''),
+('sxw', 'application/vnd.sun.xml.writer', 'mime-type-document.png', ''),
+('sxg', 'application/vnd.sun.xml.writer.global', '', ''),
+('stw', 'application/vnd.sun.xml.writer.template', 'mime-type-document.png', ''),
+('sus', 'application/vnd.sus-calendar', '', ''),
+('susp', 'application/vnd.sus-calendar', '', ''),
+('svd', 'application/vnd.svd', '', ''),
+('sis', 'application/vnd.symbian.install', '', ''),
+('sisx', 'application/vnd.symbian.install', '', ''),
+('xsm', 'application/vnd.syncml+xml', '', ''),
+('bdm', 'application/vnd.syncml.dm+wbxml', '', ''),
+('xdm', 'application/vnd.syncml.dm+xml', '', ''),
+('tao', 'application/vnd.tao.intent-module-archive', '', ''),
+('pcap', 'application/vnd.tcpdump.pcap', '', ''),
+('cap', 'application/vnd.tcpdump.pcap', '', ''),
+('dmp', 'application/vnd.tcpdump.pcap', '', ''),
+('tmo', 'application/vnd.tmobile-livetv', '', ''),
+('tpt', 'application/vnd.trid.tpt', '', ''),
+('mxs', 'application/vnd.triscape.mxs', '', ''),
+('tra', 'application/vnd.trueapp', '', ''),
+('ufd', 'application/vnd.ufdl', '', ''),
+('ufdl', 'application/vnd.ufdl', '', ''),
+('utz', 'application/vnd.uiq.theme', '', ''),
+('umj', 'application/vnd.umajin', '', ''),
+('unityweb', 'application/vnd.unity', '', ''),
+('uoml', 'application/vnd.uoml+xml', '', ''),
+('vcx', 'application/vnd.vcx', '', ''),
+('vsd', 'application/vnd.visio', '', ''),
+('vst', 'application/vnd.visio', '', ''),
+('vss', 'application/vnd.visio', 'mime-type-vector.png', ''),
+('vsw', 'application/vnd.visio', '', ''),
+('vis', 'application/vnd.visionary', '', ''),
+('vsf', 'application/vnd.vsf', '', ''),
+('wbxml', 'application/vnd.wap.wbxml', '', ''),
+('wmlc', 'application/vnd.wap.wmlc', '', ''),
+('wmlsc', 'application/vnd.wap.wmlscriptc', '', ''),
+('wtb', 'application/vnd.webturbo', '', ''),
+('nbp', 'application/vnd.wolfram.player', '', ''),
+('wpd', 'application/vnd.wordperfect', '', ''),
+('wqd', 'application/vnd.wqd', '', ''),
+('stf', 'application/vnd.wt.stf', '', ''),
+('xar', 'application/vnd.xara', '', ''),
+('xfdl', 'application/vnd.xfdl', '', ''),
+('hvd', 'application/vnd.yamaha.hv-dic', '', ''),
+('hvs', 'application/vnd.yamaha.hv-script', '', ''),
+('hvp', 'application/vnd.yamaha.hv-voice', '', ''),
+('osf', 'application/vnd.yamaha.openscoreformat', '', ''),
+('osfpvg', 'application/vnd.yamaha.openscoreformat.osfpvg+xml', '', ''),
+('saf', 'application/vnd.yamaha.smaf-audio', '', ''),
+('spf', 'application/vnd.yamaha.smaf-phrase', '', ''),
+('cmp', 'application/vnd.yellowriver-custom-menu', '', ''),
+('zir', 'application/vnd.zul', '', ''),
+('zirz', 'application/vnd.zul', '', ''),
+('zaz', 'application/vnd.zzazz.deck+xml', '', ''),
+('vxml', 'application/voicexml+xml', '', ''),
+('wgt', 'application/widget', '', ''),
+('hlp', 'application/winhlp', '', ''),
+('wsdl', 'application/wsdl+xml', '', ''),
+('wspolicy', 'application/wspolicy+xml', '', ''),
+('7z', 'application/x-7z-compressed', 'mime-type-archive.png', 'file-archive-o'),
+('abw', 'application/x-abiword', '', ''),
+('ace', 'application/x-ace-compressed', 'mime-type-archive.png', 'file-archive-o'),
+('dmg', 'application/x-apple-diskimage', '', ''),
+('aab', 'application/x-authorware-bin', '', ''),
+('x32', 'application/x-authorware-bin', '', ''),
+('u32', 'application/x-authorware-bin', '', ''),
+('vox', 'application/x-authorware-bin', '', ''),
+('aam', 'application/x-authorware-map', '', ''),
+('aas', 'application/x-authorware-seg', '', ''),
+('bcpio', 'application/x-bcpio', '', ''),
+('torrent', 'application/x-bittorrent', '', ''),
+('blb', 'application/x-blorb', '', ''),
+('blorb', 'application/x-blorb', '', ''),
+('bz', 'application/x-bzip', '', ''),
+('bz2', 'application/x-bzip2', 'mime-type-archive.png', 'file-archive-o'),
+('boz', 'application/x-bzip2', '', ''),
+('cbr', 'application/x-cbr', '', ''),
+('cba', 'application/x-cbr', '', ''),
+('cbt', 'application/x-cbr', '', ''),
+('cbz', 'application/x-cbr', '', ''),
+('cb7', 'application/x-cbr', '', ''),
+('vcd', 'application/x-cdlink', '', ''),
+('cfs', 'application/x-cfs-compressed', '', ''),
+('chat', 'application/x-chat', '', ''),
+('pgn', 'application/x-chess-pgn', '', ''),
+('nsc', 'application/x-conference', '', ''),
+('cpio', 'application/x-cpio', '', ''),
+('csh', 'application/x-csh', '', 'file-code-o'),
+('deb', 'application/x-debian-package', '', ''),
+('udeb', 'application/x-debian-package', '', ''),
+('dgc', 'application/x-dgc-compressed', '', ''),
+('dir', 'application/x-director', '', ''),
+('dcr', 'application/x-director', '', ''),
+('dxr', 'application/x-director', '', ''),
+('cst', 'application/x-director', '', ''),
+('cct', 'application/x-director', '', ''),
+('cxt', 'application/x-director', '', ''),
+('w3d', 'application/x-director', '', ''),
+('fgd', 'application/x-director', '', ''),
+('swa', 'application/x-director', '', ''),
+('wad', 'application/x-doom', '', ''),
+('ncx', 'application/x-dtbncx+xml', '', ''),
+('dtb', 'application/x-dtbook+xml', '', ''),
+('res', 'application/x-dtbresource+xml', '', ''),
+('dvi', 'application/x-dvi', '', ''),
+('evy', 'application/x-envoy', '', ''),
+('eva', 'application/x-eva', '', ''),
+('bdf', 'application/x-font-bdf', '', ''),
+('gsf', 'application/x-font-ghostscript', '', ''),
+('psf', 'application/x-font-linux-psf', '', ''),
+('otf', 'application/x-font-otf', '', ''),
+('pcf', 'application/x-font-pcf', '', ''),
+('snf', 'application/x-font-snf', '', ''),
+('ttf', 'application/x-font-ttf', '', ''),
+('ttc', 'application/x-font-ttf', '', ''),
+('pfa', 'application/x-font-type1', '', ''),
+('pfb', 'application/x-font-type1', '', ''),
+('pfm', 'application/x-font-type1', '', ''),
+('afm', 'application/x-font-type1', '', ''),
+('woff', 'application/x-font-woff', '', ''),
+('arc', 'application/x-freearc', '', ''),
+('spl', 'application/x-futuresplash', '', ''),
+('gca', 'application/x-gca-compressed', '', ''),
+('ulx', 'application/x-glulx', '', ''),
+('gnumeric', 'application/x-gnumeric', '', ''),
+('gramps', 'application/x-gramps-xml', '', ''),
+('gtar', 'application/x-gtar', '', ''),
+('hdf', 'application/x-hdf', '', ''),
+('install', 'application/x-install-instructions', '', ''),
+('iso', 'application/x-iso9660-image', '', ''),
+('jnlp', 'application/x-java-jnlp-file', '', ''),
+('latex', 'application/x-latex', '', ''),
+('lzh', 'application/x-lzh-compressed', '', ''),
+('lha', 'application/x-lzh-compressed', '', ''),
+('mie', 'application/x-mie', '', ''),
+('prc', 'application/x-mobipocket-ebook', '', ''),
+('mobi', 'application/x-mobipocket-ebook', '', ''),
+('application', 'application/x-ms-application', '', ''),
+('lnk', 'application/x-ms-shortcut', '', ''),
+('wmd', 'application/x-ms-wmd', '', ''),
+('wmz', 'application/x-ms-wmz', '', ''),
+('xbap', 'application/x-ms-xbap', '', ''),
+('mdb', 'application/x-msaccess', '', ''),
+('obd', 'application/x-msbinder', '', ''),
+('crd', 'application/x-mscardfile', '', ''),
+('clp', 'application/x-msclip', '', ''),
+('exe', 'application/x-msdownload', '', ''),
+('dll', 'application/x-msdownload', '', ''),
+('com', 'application/x-msdownload', '', ''),
+('bat', 'application/x-msdownload', '', 'file-code-o'),
+('msi', 'application/x-msdownload', '', ''),
+('mvb', 'application/x-msmediaview', '', ''),
+('m13', 'application/x-msmediaview', '', ''),
+('m14', 'application/x-msmediaview', '', ''),
+('wmf', 'application/x-msmetafile', '', ''),
+('emf', 'application/x-msmetafile', '', ''),
+('emz', 'application/x-msmetafile', '', ''),
+('mny', 'application/x-msmoney', '', ''),
+('pub', 'application/x-mspublisher', '', ''),
+('scd', 'application/x-msschedule', '', ''),
+('trm', 'application/x-msterminal', '', ''),
+('wri', 'application/x-mswrite', '', ''),
+('nc', 'application/x-netcdf', '', ''),
+('cdf', 'application/x-netcdf', '', ''),
+('nzb', 'application/x-nzb', '', ''),
+('p12', 'application/x-pkcs12', '', ''),
+('pfx', 'application/x-pkcs12', '', ''),
+('p7b', 'application/x-pkcs7-certificates', '', ''),
+('spc', 'application/x-pkcs7-certificates', '', ''),
+('p7r', 'application/x-pkcs7-certreqresp', '', ''),
+('rar', 'application/x-rar-compressed', 'mime-type-archive.png', 'file-archive-o'),
+('ris', 'application/x-research-info-systems', '', ''),
+('sh', 'application/x-sh', '', 'file-code-o'),
+('shar', 'application/x-shar', '', ''),
+('swf', 'application/x-shockwave-flash', '', ''),
+('xap', 'application/x-silverlight-app', '', ''),
+('sql', 'application/x-sql', '', 'file-code-o'),
+('sit', 'application/x-stuffit', '', ''),
+('sitx', 'application/x-stuffitx', '', ''),
+('srt', 'application/x-subrip', '', ''),
+('sv4cpio', 'application/x-sv4cpio', '', ''),
+('sv4crc', 'application/x-sv4crc', '', ''),
+('t3', 'application/x-t3vm-image', '', ''),
+('gam', 'application/x-tads', '', ''),
+('tar', 'application/x-tar', 'mime-type-archive.png', 'file-archive-o'),
+('tcl', 'application/x-tcl', '', ''),
+('tex', 'application/x-tex', '', ''),
+('tfm', 'application/x-tex-tfm', '', ''),
+('texinfo', 'application/x-texinfo', '', ''),
+('texi', 'application/x-texinfo', '', ''),
+('obj', 'application/x-tgif', '', ''),
+('ustar', 'application/x-ustar', '', ''),
+('src', 'application/x-wais-source', '', 'file-code-o'),
+('der', 'application/x-x509-ca-cert', '', ''),
+('crt', 'application/x-x509-ca-cert', '', ''),
+('fig', 'application/x-xfig', '', ''),
+('xlf', 'application/x-xliff+xml', '', ''),
+('xpi', 'application/x-xpinstall', '', ''),
+('xz', 'application/x-xz', '', ''),
+('z1', 'application/x-zmachine', '', ''),
+('z2', 'application/x-zmachine', '', ''),
+('z3', 'application/x-zmachine', '', ''),
+('z4', 'application/x-zmachine', '', ''),
+('z5', 'application/x-zmachine', '', ''),
+('z6', 'application/x-zmachine', '', ''),
+('z7', 'application/x-zmachine', '', ''),
+('z8', 'application/x-zmachine', '', ''),
+('xaml', 'application/xaml+xml', '', ''),
+('xdf', 'application/xcap-diff+xml', '', ''),
+('xenc', 'application/xenc+xml', '', ''),
+('xhtml', 'application/xhtml+xml', '', ''),
+('xht', 'application/xhtml+xml', '', ''),
+('xml', 'application/xml', '', 'file-code-o'),
+('xsl', 'application/xml', '', 'file-code-o'),
+('dtd', 'application/xml-dtd', '', ''),
+('xop', 'application/xop+xml', '', ''),
+('xpl', 'application/xproc+xml', '', ''),
+('xslt', 'application/xslt+xml', '', 'file-code-o'),
+('xspf', 'application/xspf+xml', '', ''),
+('mxml', 'application/xv+xml', '', ''),
+('xhvml', 'application/xv+xml', '', ''),
+('xvml', 'application/xv+xml', '', ''),
+('xvm', 'application/xv+xml', '', ''),
+('yang', 'application/yang', '', ''),
+('yin', 'application/yin+xml', '', ''),
+('zip', 'application/zip', 'mime-type-archive.png', 'file-archive-o'),
+('adp', 'audio/adpcm', 'mime-type-audio.png', 'file-audio-o'),
+('au', 'audio/basic', 'mime-type-audio.png', 'file-audio-o'),
+('snd', 'audio/basic', 'mime-type-audio.png', 'file-audio-o'),
+('mid', 'audio/midi', 'mime-type-audio.png', 'file-audio-o'),
+('midi', 'audio/midi', 'mime-type-audio.png', 'file-audio-o'),
+('kar', 'audio/midi', 'mime-type-audio.png', 'file-audio-o'),
+('rmi', 'audio/midi', 'mime-type-audio.png', 'file-audio-o'),
+('m4a', 'audio/mp4', 'mime-type-audio.png', 'file-audio-o'),
+('mp4a', 'audio/mp4', 'mime-type-audio.png', 'file-audio-o'),
+('m4p', 'audio/mp4a-latm', 'mime-type-audio.png', 'file-audio-o'),
+('mpga', 'audio/mpeg', 'mime-type-audio.png', 'file-audio-o'),
+('mp2', 'audio/mpeg', 'mime-type-audio.png', 'file-audio-o'),
+('mp2a', 'audio/mpeg', 'mime-type-audio.png', 'file-audio-o'),
+('mp3', 'audio/mpeg', 'mime-type-audio.png', 'file-audio-o'),
+('m2a', 'audio/mpeg', 'mime-type-audio.png', 'file-audio-o'),
+('m3a', 'audio/mpeg', 'mime-type-audio.png', 'file-audio-o'),
+('oga', 'audio/ogg', 'mime-type-audio.png', 'file-audio-o'),
+('ogg', 'audio/ogg', 'mime-type-audio.png', 'file-audio-o'),
+('spx', 'audio/ogg', 'mime-type-audio.png', 'file-audio-o'),
+('s3m', 'audio/s3m', 'mime-type-audio.png', 'file-audio-o'),
+('sil', 'audio/silk', 'mime-type-audio.png', 'file-audio-o'),
+('uva', 'audio/vnd.dece.audio', 'mime-type-audio.png', 'file-audio-o'),
+('uvva', 'audio/vnd.dece.audio', 'mime-type-audio.png', 'file-audio-o'),
+('eol', 'audio/vnd.digital-winds', 'mime-type-audio.png', 'file-audio-o'),
+('dra', 'audio/vnd.dra', 'mime-type-audio.png', 'file-audio-o'),
+('dts', 'audio/vnd.dts', 'mime-type-audio.png', 'file-audio-o'),
+('dtshd', 'audio/vnd.dts.hd', 'mime-type-audio.png', 'file-audio-o'),
+('lvp', 'audio/vnd.lucent.voice', 'mime-type-audio.png', 'file-audio-o'),
+('pya', 'audio/vnd.ms-playready.media.pya', 'mime-type-audio.png', 'file-audio-o'),
+('ecelp4800', 'audio/vnd.nuera.ecelp4800', 'mime-type-audio.png', 'file-audio-o'),
+('ecelp7470', 'audio/vnd.nuera.ecelp7470', 'mime-type-audio.png', 'file-audio-o'),
+('ecelp9600', 'audio/vnd.nuera.ecelp9600', 'mime-type-audio.png', 'file-audio-o'),
+('rip', 'audio/vnd.rip', 'mime-type-audio.png', 'file-audio-o'),
+('weba', 'audio/webm', 'mime-type-audio.png', 'file-audio-o'),
+('aac', 'audio/x-aac', 'mime-type-audio.png', 'file-audio-o'),
+('aif', 'audio/x-aiff', 'mime-type-audio.png', 'file-audio-o'),
+('aiff', 'audio/x-aiff', 'mime-type-audio.png', 'file-audio-o'),
+('aifc', 'audio/x-aiff', 'mime-type-audio.png', 'file-audio-o'),
+('caf', 'audio/x-caf', 'mime-type-audio.png', 'file-audio-o'),
+('flac', 'audio/x-flac', 'mime-type-audio.png', 'file-audio-o'),
+('mka', 'audio/x-matroska', 'mime-type-audio.png', 'file-audio-o'),
+('m3u', 'audio/x-mpegurl', 'mime-type-audio.png', 'file-audio-o'),
+('wax', 'audio/x-ms-wax', 'mime-type-audio.png', 'file-audio-o'),
+('wma', 'audio/x-ms-wma', 'mime-type-audio.png', 'file-audio-o'),
+('ram', 'audio/x-pn-realaudio', 'mime-type-audio.png', 'file-audio-o'),
+('ra', 'audio/x-pn-realaudio', 'mime-type-audio.png', 'file-audio-o'),
+('rmp', 'audio/x-pn-realaudio-plugin', 'mime-type-audio.png', 'file-audio-o'),
+('wav', 'audio/x-wav', 'mime-type-audio.png', 'file-audio-o'),
+('xm', 'audio/xm', 'mime-type-audio.png', 'file-audio-o'),
+('cdx', 'chemical/x-cdx', 'mime-type-vector.png', ''),
+('cif', 'chemical/x-cif', '', ''),
+('cmdf', 'chemical/x-cmdf', '', ''),
+('cml', 'chemical/x-cml', '', ''),
+('csml', 'chemical/x-csml', '', ''),
+('xyz', 'chemical/x-xyz', '', ''),
+('bmp', 'image/bmp', 'mime-type-image.png', 'file-image-o'),
+('cgm', 'image/cgm', 'mime-type-image.png', 'file-image-o'),
+('g3', 'image/g3fax', 'mime-type-image.png', 'file-image-o'),
+('gif', 'image/gif', 'mime-type-image.png', 'file-image-o'),
+('ief', 'image/ief', 'mime-type-image.png', 'file-image-o'),
+('jp2', 'image/jp2', 'mime-type-image.png', 'file-image-o'),
+('jpeg', 'image/jpeg', 'mime-type-image.png', 'file-image-o'),
+('jpg', 'image/jpeg', 'mime-type-image.png', 'file-image-o'),
+('jpe', 'image/jpeg', 'mime-type-image.png', 'file-image-o'),
+('ktx', 'image/ktx', 'mime-type-image.png', 'file-image-o'),
+('pict', 'image/pict', 'mime-type-image.png', 'file-image-o'),
+('pic', 'image/pict', 'mime-type-image.png', 'file-image-o'),
+('pct', 'image/pict', 'mime-type-image.png', 'file-image-o'),
+('png', 'image/png', 'mime-type-png.png', 'file-image-o'),
+('btif', 'image/prs.btif', 'mime-type-image.png', 'file-image-o'),
+('sgi', 'image/sgi', 'mime-type-image.png', 'file-image-o'),
+('svg', 'image/svg+xml', 'mime-type-image.png', 'file-image-o'),
+('svgz', 'image/svg+xml', 'mime-type-image.png', 'file-image-o'),
+('tiff', 'image/tiff', 'mime-type-image.png', 'file-image-o'),
+('tif', 'image/tiff', 'mime-type-image.png', 'file-image-o'),
+('psd', 'image/vnd.adobe.photoshop', 'mime-type-psd.png', 'file-image-o'),
+('uvi', 'image/vnd.dece.graphic', 'mime-type-image.png', 'file-image-o'),
+('uvvi', 'image/vnd.dece.graphic', 'mime-type-image.png', 'file-image-o'),
+('uvg', 'image/vnd.dece.graphic', 'mime-type-image.png', 'file-image-o'),
+('uvvg', 'image/vnd.dece.graphic', 'mime-type-image.png', 'file-image-o'),
+('sub', 'image/vnd.dvb.subtitle', 'mime-type-image.png', 'file-image-o'),
+('djvu', 'image/vnd.djvu', 'mime-type-image.png', 'file-image-o'),
+('djv', 'image/vnd.djvu', 'mime-type-image.png', 'file-image-o'),
+('dwg', 'image/vnd.dwg', 'mime-type-image.png', 'file-image-o'),
+('dxf', 'image/vnd.dxf', 'mime-type-image.png', 'file-image-o'),
+('fbs', 'image/vnd.fastbidsheet', 'mime-type-image.png', 'file-image-o'),
+('fpx', 'image/vnd.fpx', 'mime-type-image.png', 'file-image-o'),
+('fst', 'image/vnd.fst', 'mime-type-image.png', 'file-image-o'),
+('mmr', 'image/vnd.fujixerox.edmics-mmr', 'mime-type-image.png', 'file-image-o'),
+('rlc', 'image/vnd.fujixerox.edmics-rlc', 'mime-type-image.png', 'file-image-o'),
+('mdi', 'image/vnd.ms-modi', 'mime-type-image.png', 'file-image-o'),
+('wdp', 'image/vnd.ms-photo', 'mime-type-image.png', 'file-image-o'),
+('npx', 'image/vnd.net-fpx', 'mime-type-image.png', 'file-image-o'),
+('wbmp', 'image/vnd.wap.wbmp', 'mime-type-image.png', 'file-image-o'),
+('xif', 'image/vnd.xiff', 'mime-type-image.png', 'file-image-o'),
+('webp', 'image/webp', 'mime-type-image.png', 'file-image-o'),
+('3ds', 'image/x-3ds', 'mime-type-image.png', 'file-image-o'),
+('ras', 'image/x-cmu-raster', 'mime-type-image.png', 'file-image-o'),
+('cmx', 'image/x-cmx', 'mime-type-image.png', 'file-image-o'),
+('fh', 'image/x-freehand', 'mime-type-image.png', 'file-image-o'),
+('fhc', 'image/x-freehand', 'mime-type-image.png', 'file-image-o'),
+('fh4', 'image/x-freehand', 'mime-type-image.png', 'file-image-o'),
+('fh5', 'image/x-freehand', 'mime-type-image.png', 'file-image-o'),
+('fh7', 'image/x-freehand', 'mime-type-image.png', 'file-image-o'),
+('ico', 'image/x-icon', 'mime-type-image.png', 'file-image-o'),
+('pntg', 'image/x-macpaint', 'mime-type-image.png', 'file-image-o'),
+('pnt', 'image/x-macpaint', 'mime-type-image.png', 'file-image-o'),
+('mac', 'image/x-macpaint', 'mime-type-image.png', 'file-image-o'),
+('sid', 'image/x-mrsid-image', 'mime-type-image.png', 'file-image-o'),
+('pcx', 'image/x-pcx', 'mime-type-image.png', 'file-image-o'),
+('pnm', 'image/x-portable-anymap', 'mime-type-image.png', 'file-image-o'),
+('pbm', 'image/x-portable-bitmap', 'mime-type-image.png', 'file-image-o'),
+('pgm', 'image/x-portable-graymap', 'mime-type-image.png', 'file-image-o'),
+('ppm', 'image/x-portable-pixmap', 'mime-type-image.png', 'file-image-o'),
+('qtif', 'image/x-quicktime', 'mime-type-image.png', 'file-image-o'),
+('qti', 'image/x-quicktime', 'mime-type-image.png', 'file-image-o'),
+('rgb', 'image/x-rgb', 'mime-type-image.png', 'file-image-o'),
+('tga', 'image/x-tga', 'mime-type-image.png', 'file-image-o'),
+('xbm', 'image/x-xbitmap', 'mime-type-image.png', 'file-image-o'),
+('xpm', 'image/x-xpixmap', 'mime-type-image.png', 'file-image-o'),
+('xwd', 'image/x-xwindowdump', 'mime-type-image.png', 'file-image-o'),
+('eml', 'message/rfc822', '', ''),
+('mime', 'message/rfc822', '', ''),
+('igs', 'model/iges', '', ''),
+('iges', 'model/iges', '', ''),
+('msh', 'model/mesh', '', ''),
+('mesh', 'model/mesh', '', ''),
+('silo', 'model/mesh', '', ''),
+('dae', 'model/vnd.collada+xml', '', ''),
+('dwf', 'model/vnd.dwf', '', ''),
+('gdl', 'model/vnd.gdl', '', ''),
+('gtw', 'model/vnd.gtw', '', ''),
+('mts', 'model/vnd.mts', '', ''),
+('vtu', 'model/vnd.vtu', '', ''),
+('wrl', 'model/vrml', '', ''),
+('vrml', 'model/vrml', '', ''),
+('x3db', 'model/x3d+binary', '', ''),
+('x3dbz', 'model/x3d+binary', '', ''),
+('x3dv', 'model/x3d+vrml', '', ''),
+('x3dvz', 'model/x3d+vrml', '', ''),
+('x3d', 'model/x3d+xml', '', ''),
+('x3dz', 'model/x3d+xml', '', ''),
+('manifest', 'text/cache-manifest', '', 'file-text-o'),
+('appcache', 'text/cache-manifest', '', 'file-text-o'),
+('ics', 'text/calendar', '', 'file-text-o'),
+('ifb', 'text/calendar', '', 'file-text-o'),
+('css', 'text/css', '', 'file-code-o'),
+('csv', 'text/csv', 'mime-type-spreadsheet.png', 'file-excel-o'),
+('html', 'text/html', '', 'file-text-o'),
+('htm', 'text/html', '', 'file-text-o'),
+('n3', 'text/n3', '', 'file-text-o'),
+('txt', 'text/plain', 'mime-type-document.png', 'file-text-o'),
+('text', 'text/plain', '', 'file-text-o'),
+('conf', 'text/plain', '', 'file-text-o'),
+('def', 'text/plain', '', 'file-text-o'),
+('list', 'text/plain', '', 'file-text-o'),
+('log', 'text/plain', '', 'file-text-o'),
+('in', 'text/plain', '', 'file-text-o'),
+('dsc', 'text/prs.lines.tag', '', 'file-text-o'),
+('rtx', 'text/richtext', '', 'file-text-o'),
+('sgml', 'text/sgml', '', 'file-text-o'),
+('sgm', 'text/sgml', '', 'file-text-o'),
+('tsv', 'text/tab-separated-values', '', 'file-text-o'),
+('t', 'text/troff', '', 'file-text-o'),
+('tr', 'text/troff', '', 'file-text-o'),
+('roff', 'text/troff', '', 'file-text-o'),
+('man', 'text/troff', '', 'file-text-o'),
+('me', 'text/troff', '', 'file-text-o'),
+('ms', 'text/troff', '', 'file-text-o'),
+('ttl', 'text/turtle', '', 'file-text-o'),
+('uri', 'text/uri-list', '', 'file-text-o'),
+('uris', 'text/uri-list', '', 'file-text-o'),
+('urls', 'text/uri-list', '', 'file-text-o'),
+('vcard', 'text/vcard', '', 'file-text-o'),
+('curl', 'text/vnd.curl', '', 'file-text-o'),
+('dcurl', 'text/vnd.curl.dcurl', '', 'file-text-o'),
+('scurl', 'text/vnd.curl.scurl', '', 'file-text-o'),
+('mcurl', 'text/vnd.curl.mcurl', '', 'file-text-o'),
+('fly', 'text/vnd.fly', '', 'file-text-o'),
+('flx', 'text/vnd.fmi.flexstor', '', 'file-text-o'),
+('gv', 'text/vnd.graphviz', '', 'file-text-o'),
+('3dml', 'text/vnd.in3d.3dml', '', 'file-text-o'),
+('spot', 'text/vnd.in3d.spot', '', 'file-text-o'),
+('jad', 'text/vnd.sun.j2me.app-descriptor', '', 'file-text-o'),
+('wml', 'text/vnd.wap.wml', '', 'file-text-o'),
+('wmls', 'text/vnd.wap.wmlscript', '', 'file-text-o'),
+('s', 'text/x-asm', '', 'file-text-o'),
+('asm', 'text/x-asm', '', 'file-code-o'),
+('c', 'text/x-c', '', 'file-code-o'),
+('cc', 'text/x-c', '', 'file-code-o'),
+('cxx', 'text/x-c', '', 'file-code-o'),
+('cpp', 'text/x-c', '', 'file-code-o'),
+('h', 'text/x-c', '', 'file-code-o'),
+('hh', 'text/x-c', '', 'file-code-o'),
+('dic', 'text/x-c', '', 'file-text-o'),
+('f', 'text/x-fortran', '', 'file-code-o'),
+('for', 'text/x-fortran', '', 'file-code-o'),
+('f77', 'text/x-fortran', '', 'file-text-o'),
+('f90', 'text/x-fortran', '', 'file-text-o'),
+('java', 'text/x-java-source', '', 'file-code-o'),
+('opml', 'text/x-opml', '', 'file-text-o'),
+('p', 'text/x-pascal', '', 'file-text-o'),
+('pas', 'text/x-pascal', '', 'file-code-o'),
+('nfo', 'text/x-nfo', '', 'file-text-o'),
+('etx', 'text/x-setext', '', 'file-text-o'),
+('sfv', 'text/x-sfv', '', 'file-text-o'),
+('uu', 'text/x-uuencode', '', 'file-text-o'),
+('vcs', 'text/x-vcalendar', '', 'file-text-o'),
+('vcf', 'text/x-vcard', '', 'file-text-o'),
+('3gp', 'video/3gpp', 'mime-type-video.png', 'file-video-o'),
+('3g2', 'video/3gpp2', 'mime-type-video.png', 'file-video-o'),
+('h261', 'video/h261', 'mime-type-video.png', 'file-video-o'),
+('h263', 'video/h263', 'mime-type-video.png', 'file-video-o'),
+('h264', 'video/h264', 'mime-type-video.png', 'file-video-o'),
+('jpgv', 'video/jpeg', 'mime-type-video.png', 'file-video-o'),
+('jpm', 'video/jpm', 'mime-type-video.png', 'file-video-o'),
+('jpgm', 'video/jpm', 'mime-type-video.png', 'file-video-o'),
+('mj2', 'video/mj2', 'mime-type-video.png', 'file-video-o'),
+('mjp2', 'video/mj2', 'mime-type-video.png', 'file-video-o'),
+('ts', 'video/mp2t', 'mime-type-video.png', 'file-video-o'),
+('mp4', 'video/mp4', 'mime-type-video.png', 'file-video-o'),
+('mp4v', 'video/mp4', 'mime-type-video.png', 'file-video-o'),
+('mpg4', 'video/mp4', 'mime-type-video.png', 'file-video-o'),
+('m4v', 'video/mp4', 'mime-type-video.png', 'file-video-o'),
+('mpeg', 'video/mpeg', 'mime-type-video.png', 'file-video-o'),
+('mpg', 'video/mpeg', 'mime-type-video.png', 'file-video-o'),
+('mpe', 'video/mpeg', 'mime-type-video.png', 'file-video-o'),
+('m1v', 'video/mpeg', 'mime-type-video.png', 'file-video-o'),
+('m2v', 'video/mpeg', 'mime-type-video.png', 'file-video-o'),
+('ogv', 'video/ogg', 'mime-type-video.png', 'file-video-o'),
+('qt', 'video/quicktime', 'mime-type-video.png', 'file-video-o'),
+('mov', 'video/quicktime', 'mime-type-video.png', 'file-video-o'),
+('uvh', 'video/vnd.dece.hd', 'mime-type-video.png', 'file-video-o'),
+('uvvh', 'video/vnd.dece.hd', 'mime-type-video.png', 'file-video-o'),
+('uvm', 'video/vnd.dece.mobile', 'mime-type-video.png', 'file-video-o'),
+('uvvm', 'video/vnd.dece.mobile', 'mime-type-video.png', 'file-video-o'),
+('uvp', 'video/vnd.dece.pd', 'mime-type-video.png', 'file-video-o'),
+('uvvp', 'video/vnd.dece.pd', 'mime-type-video.png', 'file-video-o'),
+('uvs', 'video/vnd.dece.sd', 'mime-type-video.png', 'file-video-o'),
+('uvvs', 'video/vnd.dece.sd', 'mime-type-video.png', 'file-video-o'),
+('uvv', 'video/vnd.dece.video', 'mime-type-video.png', 'file-video-o'),
+('uvvv', 'video/vnd.dece.video', 'mime-type-video.png', 'file-video-o'),
+('dvb', 'video/vnd.dvb.file', 'mime-type-video.png', 'file-video-o'),
+('fvt', 'video/vnd.fvt', 'mime-type-video.png', 'file-video-o'),
+('mxu', 'video/vnd.mpegurl', 'mime-type-video.png', 'file-video-o'),
+('m4u', 'video/vnd.mpegurl', 'mime-type-video.png', 'file-video-o'),
+('pyv', 'video/vnd.ms-playready.media.pyv', 'mime-type-video.png', 'file-video-o'),
+('uvu', 'video/vnd.uvvu.mp4', 'mime-type-video.png', 'file-video-o'),
+('uvvu', 'video/vnd.uvvu.mp4', 'mime-type-video.png', 'file-video-o'),
+('viv', 'video/vnd.vivo', 'mime-type-video.png', 'file-video-o'),
+('dv', 'video/x-dv', 'mime-type-video.png', 'file-video-o'),
+('dif', 'video/x-dv', 'mime-type-video.png', 'file-excel-o'),
+('webm', 'video/webm', 'mime-type-video.png', 'file-video-o'),
+('f4v', 'video/x-f4v', 'mime-type-video.png', 'file-video-o'),
+('fli', 'video/x-fli', 'mime-type-video.png', 'file-video-o'),
+('flv', 'video/x-flv', 'mime-type-video.png', 'file-video-o'),
+('mkv', 'video/x-matroska', 'mime-type-video.png', 'file-video-o'),
+('mk3d', 'video/x-matroska', 'mime-type-video.png', 'file-video-o'),
+('mks', 'video/x-matroska', 'mime-type-video.png', 'file-video-o'),
+('mng', 'video/x-mng', 'mime-type-video.png', 'file-video-o'),
+('asf', 'video/x-ms-asf', 'mime-type-video.png', 'file-video-o'),
+('asx', 'video/x-ms-asf', 'mime-type-video.png', 'file-video-o');
+INSERT INTO `sys_storage_mime_types` (`ext`, `mime_type`, `icon`, `icon_font`) VALUES
+('vob', 'video/x-ms-vob', 'mime-type-video.png', 'file-video-o'),
+('wm', 'video/x-ms-wm', 'mime-type-video.png', 'file-video-o'),
+('wmv', 'video/x-ms-wmv', 'mime-type-video.png', 'file-video-o'),
+('wmx', 'video/x-ms-wmx', 'mime-type-video.png', 'file-video-o'),
+('wvx', 'video/x-ms-wvx', 'mime-type-video.png', 'file-video-o'),
+('avi', 'video/x-msvideo', 'mime-type-video.png', 'file-video-o'),
+('movie', 'video/x-sgi-movie', 'mime-type-video.png', 'file-video-o'),
+('smv', 'video/x-smv', 'mime-type-video.png', 'file-video-o'),
+('ice', 'x-conference/x-cooltalk', '', '');
 
 
 -- --------------------------------------------------------

+ 1 - 1
modules/base/profile/classes/BxBaseModProfileAlertsResponse.php

@@ -79,7 +79,7 @@ class BxBaseModProfileAlertsResponse extends BxBaseModGeneralAlertsResponse
             $oAlert->aExtras['override_content'] = MsgBox(_t('_sys_access_denied_to_private_content'));
         }
 
-        if ($bDisableOwnerActions) {
+        if ($bDisableOwnerActions && isset($oAlert->aExtras['menu'])) {
             foreach ($oAlert->aExtras['menu'] as $i => $r) {
                 if ('timeline-view-owner' == $r['id'] || 'timeline-view-other'  == $r['id'])
                     unset($oAlert->aExtras['menu'][$i]);

+ 5 - 3
modules/base/text/classes/BxBaseModTextFormEntry.php

@@ -14,6 +14,8 @@
  */
 class BxBaseModTextFormEntry extends BxBaseModGeneralFormEntry
 {
+    protected $_sGhostTemplate = 'form_ghost_template.html';
+
     public function __construct($aInfo, $oTemplate = false)
     {
         parent::__construct($aInfo, $oTemplate);
@@ -56,7 +58,7 @@ class BxBaseModTextFormEntry extends BxBaseModGeneralFormEntry
                 $this->aInputs[$CNF['FIELD_PHOTO']]['content_id'] = $aValues['id'];
             }
 
-            $this->aInputs[$CNF['FIELD_PHOTO']]['ghost_template'] = $this->_oModule->_oTemplate->parseHtmlByName('form_ghost_template.html', $this->_getPhotoGhostTmplVars($aContentInfo));
+            $this->aInputs[$CNF['FIELD_PHOTO']]['ghost_template'] = $this->_oModule->_oTemplate->parseHtmlByName($this->_sGhostTemplate, $this->_getPhotoGhostTmplVars($aContentInfo));
         }
 
         return parent::initChecker($aValues, $aSpecificValues);
@@ -130,11 +132,11 @@ class BxBaseModTextFormEntry extends BxBaseModGeneralFormEntry
 			'name' => $this->aInputs[$CNF['FIELD_PHOTO']]['name'],
 			'content_id' => $this->aInputs[$CNF['FIELD_PHOTO']]['content_id'],
 			'editor_id' => $CNF['FIELD_TEXT_ID'],
-			'thumb_id' => isset($aContentInfo[$CNF['FIELD_THUMB']]) ? $aContentInfo[$CNF['FIELD_THUMB']] : 0,
+			'thumb_id' => isset($CNF['FIELD_THUMB']) && isset($aContentInfo[$CNF['FIELD_THUMB']]) ? $aContentInfo[$CNF['FIELD_THUMB']] : 0,
 			'bx_if:set_thumb' => array (
 				'condition' => CHECK_ACTION_RESULT_ALLOWED === $this->_oModule->checkAllowedSetThumb(),
 				'content' => array (
-					'name_thumb' => $CNF['FIELD_THUMB'],
+					'name_thumb' => isset($CNF['FIELD_THUMB']) ? $CNF['FIELD_THUMB'] : '',
     				'txt_pict_use_as_thumb' => _t(!empty($CNF['T']['txt_pict_use_as_thumb']) ? $CNF['T']['txt_pict_use_as_thumb'] : '_sys_txt_form_entry_input_picture_use_as_thumb')
 				),
 			),

+ 21 - 0
modules/boonex/files/classes/BxFilesAlertsResponse.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxFilesAlertsResponse extends BxBaseModTextAlertsResponse
+{
+    public function __construct()
+    {
+        $this->MODULE = 'bx_files';
+        parent::__construct();
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/files/classes/BxFilesCmtsSearchResult.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxFilesCmtsSearchResult extends BxBaseModGeneralCmtsSearchResult
+{
+    function __construct($sMode = '', $aParams = array())
+    {
+    	$this->sModule = 'bx_files';
+
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent['title'] = _t('_bx_files_page_block_title_browse_cmts');
+    }
+}
+
+/** @} */

+ 138 - 0
modules/boonex/files/classes/BxFilesConfig.php

@@ -0,0 +1,138 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxFilesConfig extends BxBaseModTextConfig
+{
+    function __construct($aModule)
+    {
+        parent::__construct($aModule);
+
+        $aMenuItems2Methods = array (
+            'edit-file' => 'checkAllowedEdit',
+            'delete-file' => 'checkAllowedDelete',
+        );
+
+        $this->CNF = array (
+
+            // module icon
+            'ICON' => 'file-o col-red3',
+
+            // database tables
+            'TABLE_ENTRIES' => $aModule['db_prefix'] . 'main',
+            'TABLE_ENTRIES_FULLTEXT' => 'search_fields',
+            'TABLE_FILES' => $aModule['db_prefix'] . 'files',
+
+            // database fields
+            'FIELD_ID' => 'id',
+            'FIELD_AUTHOR' => 'author',
+            'FIELD_ADDED' => 'added',
+            'FIELD_CHANGED' => 'changed',
+            'FIELD_TITLE' => 'title',
+            'FIELD_CATEGORY' => 'cat',
+            'FIELD_TEXT' => 'desc',
+            'FIELD_TEXT_ID' => 'file-desc',
+            'FIELD_ALLOW_VIEW_TO' => 'allow_view_to',
+            'FIELD_PHOTO' => 'attachments',
+            'FIELD_COMMENTS' => 'comments',
+	        'FIELD_STATUS' => 'status',
+        	'FIELD_STATUS_ADMIN' => 'status_admin',
+            'FIELD_LOCATION_PREFIX' => 'location',
+            'FIELDS_WITH_KEYWORDS' => 'auto', // can be 'auto', array of fields or comma separated string of field names, works only when OBJECT_METATAGS is specified
+
+            // page URIs
+            'URI_VIEW_ENTRY' => 'view-file',
+            'URI_AUTHOR_ENTRIES' => 'files-author',
+            'URI_ADD_ENTRY' => 'create-file',
+        	'URI_EDIT_ENTRY' => 'edit-file',
+        	'URI_MANAGE_COMMON' => 'files-manage',
+
+            'URL_HOME' => 'page.php?i=files-home',
+            'URL_POPULAR' => 'page.php?i=files-popular',
+            'URL_UPDATED' => 'page.php?i=files-updated',
+        	'URL_MANAGE_COMMON' => 'page.php?i=files-manage',
+        	'URL_MANAGE_ADMINISTRATION' => 'page.php?i=files-administration',
+
+            // some params
+            'PARAM_CHARS_SUMMARY' => 'bx_files_summary_chars',
+            'PARAM_CHARS_SUMMARY_PLAIN' => 'bx_files_plain_summary_chars',
+            'PARAM_NUM_RSS' => 'bx_files_rss_num',
+        	'PARAM_SEARCHABLE_FIELDS' => 'bx_files_searchable_fields',
+
+            // objects
+            'OBJECT_STORAGE' => 'bx_files_files',
+            'OBJECT_IMAGES_TRANSCODER_PREVIEW' => 'bx_files_preview',
+            'OBJECT_IMAGES_TRANSCODER_GALLERY' => 'bx_files_gallery',
+            'OBJECT_VIDEOS_TRANSCODERS' => array(),
+        	'OBJECT_REPORTS' => 'bx_files',
+            'OBJECT_VIEWS' => 'bx_files',
+            'OBJECT_VOTES' => 'bx_files',
+        	'OBJECT_FAVORITES' => 'bx_files',
+            'OBJECT_METATAGS' => 'bx_files',
+            'OBJECT_COMMENTS' => 'bx_files',
+            'OBJECT_PRIVACY_VIEW' => 'bx_files_allow_view_to',
+            'OBJECT_FORM_ENTRY' => 'bx_files',
+            'OBJECT_FORM_ENTRY_DISPLAY_VIEW' => 'bx_files_entry_view',
+            'OBJECT_FORM_ENTRY_DISPLAY_ADD' => 'bx_files_entry_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_EDIT' => 'bx_files_entry_edit',
+            'OBJECT_FORM_ENTRY_DISPLAY_DELETE' => 'bx_files_entry_delete',
+            'OBJECT_MENU_ACTIONS_VIEW_ENTRY' => 'bx_files_view', // actions menu on view entry page
+            'OBJECT_MENU_ACTIONS_MY_ENTRIES' => 'bx_files_my', // actions menu on my entries page
+            'OBJECT_MENU_SUBMENU' => 'bx_files_submenu', // main module submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY' => 'bx_files_view_submenu', // view entry submenu
+            'OBJECT_MENU_SUBMENU_VIEW_ENTRY_MAIN_SELECTION' => 'files-home', // first item in view entry submenu from main module submenu
+            'OBJECT_MENU_MANAGE_TOOLS' => 'bx_files_menu_manage_tools', //manage menu in content administration tools
+            'OBJECT_GRID_ADMINISTRATION' => 'bx_files_administration',
+        	'OBJECT_GRID_COMMON' => 'bx_files_common',
+            'OBJECT_UPLOADERS' => array('sys_simple', 'sys_html5'),
+
+            // menu items which visibility depends on custom visibility checking
+            'MENU_ITEM_TO_METHOD' => array (
+                'bx_files_my' => array (
+                    'create-file' => 'checkAllowedAdd',
+                ),
+                'bx_files_view' => $aMenuItems2Methods,
+            ),
+
+            // some language keys
+            'T' => array (
+                'txt_sample_single' => '_bx_files_txt_sample_single',
+            	'txt_sample_single_with_article' => '_bx_files_txt_sample_single_with_article',
+            	'txt_sample_comment_single' => '_bx_files_txt_sample_comment_single',
+            	'txt_sample_vote_single' => '_bx_files_txt_sample_vote_single',
+            	'grid_action_err_delete' => '_bx_files_grid_action_err_delete',
+            	'grid_txt_account_manager' => '_bx_files_grid_txt_account_manager',
+				'filter_item_active' => '_bx_files_grid_filter_item_title_adm_active',
+            	'filter_item_hidden' => '_bx_files_grid_filter_item_title_adm_hidden',
+            	'filter_item_select_one_filter1' => '_bx_files_grid_filter_item_title_adm_select_one_filter1',
+            	'menu_item_manage_my' => '_bx_files_menu_item_title_manage_my',
+            	'menu_item_manage_all' => '_bx_files_menu_item_title_manage_all',
+                'txt_all_entries_by' => '_bx_files_txt_all_entries_by',
+                'txt_all_entries_by_author' => '_bx_files_page_title_browse_by_author',
+            ),
+        );
+
+        $this->_aJsClasses = array(
+        	'manage_tools' => 'BxFilesManageTools'
+        );
+
+        $this->_aJsObjects = array(
+        	'manage_tools' => 'oBxFilesManageTools'
+        );
+
+        $this->_aGridObjects = array(
+        	'common' => $this->CNF['OBJECT_GRID_COMMON'],
+        	'administration' => $this->CNF['OBJECT_GRID_ADMINISTRATION'],
+        	
+        );
+    }
+}
+
+/** @} */

+ 29 - 0
modules/boonex/files/classes/BxFilesDb.php

@@ -0,0 +1,29 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module database queries
+ */
+class BxFilesDb extends BxBaseModTextDb
+{
+    function __construct(&$oConfig)
+    {
+        parent::__construct($oConfig);
+    }
+
+    public function getFileTitle($iFileId)
+    {
+        $sQuery = $this->prepare ("SELECT `c`.`title` FROM `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` AS `c` INNER JOIN `sys_storage_ghosts` AS `g` ON(`g`.`object` = ? AND `g`.`content_id` = `c`.`id`) WHERE `g`.`id` = ?", $this->_oConfig->CNF['TABLE_FILES'], $iFileId);
+        return $this->getOne($sQuery);
+    }
+}
+
+/** @} */

+ 30 - 0
modules/boonex/files/classes/BxFilesFormEntry.php

@@ -0,0 +1,30 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Create/Edit entry form
+ */
+class BxFilesFormEntry extends BxBaseModTextFormEntry
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_files';
+        parent::__construct($aInfo, $oTemplate);
+
+        $CNF = &$this->_oModule->_oConfig->CNF;
+        
+        if (isset($this->aInputs[$CNF['FIELD_PHOTO']])) {
+            $this->aInputs[$CNF['FIELD_PHOTO']]['multiple'] = false;
+        }
+    }
+}
+
+/** @} */

+ 82 - 0
modules/boonex/files/classes/BxFilesFormUpload.php

@@ -0,0 +1,82 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Files upload form
+ */
+class BxFilesFormUpload extends BxBaseModTextFormEntry
+{
+    public function __construct($aInfo, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_files';
+        parent::__construct($aInfo, $oTemplate);
+
+        $this->_sGhostTemplate = 'form_ghost_template_upload.html';
+    }
+
+    public function insert ($aValsToAdd = array(), $isIgnore = false)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        return $this->processFiles ($CNF['FIELD_PHOTO'], 0, true);
+    }
+
+    public function processFiles ($sFieldFile, $iContentId = 0, $isAssociateWithContent = false)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        if (!isset($this->aInputs[$sFieldFile]))
+            return true;
+
+        $mixedFileIds = $this->getCleanValue($sFieldFile);
+        if(!$mixedFileIds)
+            return true;
+
+        $oStorage = BxDolStorage::getObjectInstance($this->aInputs[$sFieldFile]['storage_object']);
+        if (!$oStorage)
+            return false;
+
+        $iProfileId = $this->getContentOwnerProfileId($iContentId);
+
+        $aGhostFiles = $oStorage->getGhosts ($iProfileId, $isAssociateWithContent ? 0 : $iContentId, true);
+        if (!$aGhostFiles)
+            return true;
+
+        // get values form main form to pass it to each file later
+        $aFormValues = array();
+        foreach ($this->aInputs as $aInput) {
+            if ($aInput['name'] && isset($aInput['value']) && $aInput['value'] && !is_array($aInput['value']) && $aInput['name'] != 'do_submit' && $aInput['name'] != $CNF['FIELD_PHOTO'])
+                $aFormValues[$aInput['name']] = $aInput['value'];//$this->getCleanValue($aInput['name']);
+        }
+
+        $aContentIds = array();
+        foreach ($aGhostFiles as $aFile) {
+            if (is_array($mixedFileIds) && !in_array($aFile['id'], $mixedFileIds))
+                continue;
+
+            $iContentId = 0;
+            if ($isAssociateWithContent)
+                $iContentId = BxBaseModGeneralFormEntry::insert (array_merge(array($CNF['FIELD_TITLE'] => $this->getCleanValue('title-' . $aFile['id'])), $aFormValues));
+            if (!$iContentId)
+                continue;
+            $aContentIds[] = $iContentId;
+
+            if ($aFile['private'])
+                $oStorage->setFilePrivate ($aFile['id'], 0);
+            if ($iContentId)
+                $this->_associalFileWithContent($oStorage, $aFile['id'], $iProfileId, $iContentId, $sFieldFile);
+        }
+
+        return $aContentIds;
+    }
+}
+
+/** @} */

+ 69 - 0
modules/boonex/files/classes/BxFilesFormsEntryHelper.php

@@ -0,0 +1,69 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Entry forms helper functions
+ */
+class BxFilesFormsEntryHelper extends BxBaseModTextFormsEntryHelper
+{
+    public function __construct($oModule)
+    {
+        parent::__construct($oModule);
+    }
+
+    public function getObjectFormAdd ()
+    {
+        return BxDolForm::getObjectInstance('bx_files_upload', 'bx_files_entry_upload', $this->_oModule->_oTemplate);
+    }
+    
+    public function addDataForm ()
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        // check access
+        if (CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $this->_oModule->checkAllowedAdd()))
+            return MsgBox($sMsg);
+
+        // check and display form
+        $oForm = $this->getObjectFormAdd();
+        if (!$oForm)
+            return MsgBox(_t('_sys_txt_error_occured'));
+
+        $oForm->initChecker();
+
+        if (!$oForm->isSubmittedAndValid())
+            return $oForm->getCode();
+
+        // insert data into database
+        $aValsToAdd = array ();
+        $aContentIds = $oForm->insert ($aValsToAdd);
+        if (false === $aContentIds || !is_array($aContentIds)) {
+            if (!$oForm->isValid() || !is_array($aContentIds))
+                return $oForm->getCode();
+            else
+                return MsgBox(_t('_sys_txt_error_entry_creation'));
+        }
+
+        foreach ($aContentIds as $iContentId) {
+            $sResult = $this->onDataAddAfter (getLoggedId(), $iContentId);
+            if ($sResult)
+                return $sResult;
+
+            // perform action
+            $this->_oModule->checkAllowedAdd(true);
+        }
+
+        // redirect
+        $this->_redirectAndExit('page.php?i=' . $CNF['URI_AUTHOR_ENTRIES'] . '&profile_id=' . bx_get_logged_profile_id());
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/files/classes/BxFilesGridAdministration.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxFilesGridAdministration extends BxBaseModTextGridAdministration
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_files';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 21 - 0
modules/boonex/files/classes/BxFilesGridCommon.php

@@ -0,0 +1,21 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ * 
+ * @{
+ */
+
+class BxFilesGridCommon extends BxBaseModTextGridCommon
+{
+    public function __construct ($aOptions, $oTemplate = false)
+    {
+    	$this->MODULE = 'bx_files';
+        parent::__construct ($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/files/classes/BxFilesMenu.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * General class for module menu.
+ */
+class BxFilesMenu extends BxBaseModTextMenu
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_files';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 25 - 0
modules/boonex/files/classes/BxFilesMenuManageTools.php

@@ -0,0 +1,25 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * 'Files manage tools' menu.
+ */
+class BxFilesMenuManageTools extends BxBaseModTextMenuManageTools
+{
+
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_files';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/files/classes/BxFilesMenuView.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * View entry menu
+ */
+class BxFilesMenuView extends BxBaseModTextMenuView
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_files';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 28 - 0
modules/boonex/files/classes/BxFilesModule.php

@@ -0,0 +1,28 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Files module
+ */
+class BxFilesModule extends BxBaseModTextModule
+{
+    function __construct(&$aModule)
+    {
+        parent::__construct($aModule);
+    }
+
+    public function checkAllowedSetThumb ()
+    {
+        return _t('_sys_txt_access_denied');
+    }
+}
+
+/** @} */

+ 24 - 0
modules/boonex/files/classes/BxFilesPageAuthor.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Profile's entries page.
+ */
+class BxFilesPageAuthor extends BxBaseModTextPageAuthor
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        parent::__construct($aObject, $oTemplate);
+    }
+
+}
+
+/** @} */

+ 24 - 0
modules/boonex/files/classes/BxFilesPageBrowse.php

@@ -0,0 +1,24 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Browse entries pages.
+ */
+class BxFilesPageBrowse extends BxBaseModTextPageBrowse
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_files';
+        parent::__construct($aObject, $oTemplate);
+    }
+}
+
+/** @} */

+ 32 - 0
modules/boonex/files/classes/BxFilesPageEntry.php

@@ -0,0 +1,32 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/**
+ * Entry create/edit pages
+ */
+class BxFilesPageEntry extends BxBaseModTextPageEntry
+{
+    public function __construct($aObject, $oTemplate = false)
+    {
+        $this->MODULE = 'bx_files';
+        parent::__construct($aObject, $oTemplate);
+    }
+
+    protected function _setSubmenu($aParams)
+    {
+    	parent::_setSubmenu(array_merge($aParams, array(
+    		'title' => '',
+    		'icon' => ''
+    	)));
+    }
+}
+
+/** @} */

+ 126 - 0
modules/boonex/files/classes/BxFilesSearchResult.php

@@ -0,0 +1,126 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxFilesSearchResult extends BxBaseModTextSearchResult
+{
+    function __construct($sMode = '', $aParams = array())
+    {
+        parent::__construct($sMode, $aParams);
+
+        $this->aCurrent = array(
+            'name' => 'bx_files',
+            'module_name' => 'bx_files',
+            'object_metatags' => 'bx_files',
+            'title' => _t('_bx_files_page_title_browse'),
+            'table' => 'bx_files_main',
+            'ownFields' => array('id', 'title', 'desc', 'author', 'added'),
+            'searchFields' => array(),
+            'restriction' => array(
+                'author' => array('value' => '', 'field' => 'author', 'operator' => '='),
+        		'status' => array('value' => 'active', 'field' => 'status', 'operator' => '='),
+            ),
+            'paginate' => array('perPage' => getParam('bx_files_per_page_browse'), 'start' => 0),
+            'sorting' => 'last',
+            'rss' => array(
+                'title' => '',
+                'link' => '',
+                'image' => '',
+                'profile' => 0,
+                'fields' => array (
+                    'Guid' => 'link',
+                    'Link' => 'link',
+                    'Title' => 'title',
+                    'DateTimeUTS' => 'added',
+                    'Desc' => 'desc',
+                ),
+            ),
+            'ident' => 'id',
+        );
+
+        $this->sFilterName = 'bx_files_filter';
+        $this->oModule = $this->getMain();
+        $this->aCurrent['searchFields'] = explode(',', getParam($this->oModule->_oConfig->CNF['PARAM_SEARCHABLE_FIELDS']));
+
+        $oProfileAuthor = null;
+
+        $CNF = &$this->oModule->_oConfig->CNF;
+
+        switch ($sMode) {
+            case 'author':
+                if(!$this->_updateCurrentForAuthor($sMode, $aParams, $oProfileAuthor)) {
+                    $this->isError = true;
+                    break;
+                }
+                break;
+
+            case 'favorite':
+                if(!$this->_updateCurrentForFavorite($sMode, $aParams, $oProfileAuthor)) {
+                    $this->isError = true;
+                    break;
+                }
+                break;
+
+            case 'public':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_HOME']);
+                $this->aCurrent['title'] = _t('_bx_files_page_title_browse_recent');
+                $this->aCurrent['rss']['link'] = 'modules/?r=files/rss/' . $sMode;
+                break;
+
+            case 'popular':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_POPULAR']);
+                $this->aCurrent['title'] = _t('_bx_files_page_title_browse_popular');
+                $this->aCurrent['rss']['link'] = 'modules/?r=files/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'popular';
+                break;
+
+            case 'updated':
+                $this->sBrowseUrl = BxDolPermalinks::getInstance()->permalink($CNF['URL_UPDATED']);
+                $this->aCurrent['title'] = _t('_bx_files_page_title_browse_updated');
+                $this->aCurrent['rss']['link'] = 'modules/?r=files/rss/' . $sMode;
+                $this->aCurrent['sorting'] = 'updated';
+                break;
+
+            case '': // search results
+                $this->sBrowseUrl = BX_DOL_SEARCH_KEYWORD_PAGE;
+                $this->aCurrent['title'] = _t('_bx_files');
+                $this->aCurrent['paginate']['perPage'] = 3;
+                unset($this->aCurrent['rss']);
+                break;
+
+            default:
+                $sMode = '';
+                $this->isError = true;
+        }
+
+        $this->processReplaceableMarkers($oProfileAuthor);
+
+        $this->addConditionsForPrivateContent($CNF, $oProfileAuthor);
+    }
+
+    function getAlterOrder()
+    {
+        $aSql = array();
+        switch ($this->aCurrent['sorting']) {
+            case 'last':
+                $aSql['order'] = ' ORDER BY `bx_files_main`.`added` DESC';
+                break;
+            case 'updated':
+                $aSql['order'] = ' ORDER BY `bx_files_main`.`changed` DESC';
+                break;
+            case 'popular':
+                $aSql['order'] = ' ORDER BY `bx_files_main`.`views` DESC';
+                break;
+        }
+        return $aSql;
+    }
+}
+
+/** @} */

+ 27 - 0
modules/boonex/files/classes/BxFilesTemplate.php

@@ -0,0 +1,27 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+/*
+ * Module representation.
+ */
+class BxFilesTemplate extends BxBaseModTextTemplate
+{
+    /**
+     * Constructor
+     */
+    function __construct(&$oConfig, &$oDb)
+    {
+        $this->MODULE = 'bx_files';
+        parent::__construct($oConfig, $oDb);
+    }
+}
+
+/** @} */

+ 33 - 0
modules/boonex/files/classes/BxFilesUploaderHTML5.php

@@ -0,0 +1,33 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxFilesUploaderHTML5 extends BxTemplUploaderHTML5
+{
+    protected $_oModule;
+
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+        $this->_oModule = BxDolModule::getInstance('bx_files');
+    }
+
+    protected function getGhostTemplateVars($aFile, $iProfileId, $iContentId, $oStorage, $oImagesTranscoder)
+    {
+        $sTitle = $this->_oModule->_oDb->getFileTitle($aFile['id']);
+        $a = array(
+            'file_title' => $sTitle ? $sTitle : $aFile['file_name']
+        );
+        $a['file_title_attr'] = bx_html_attribute($a['file_title']);
+        return $a;
+    }
+}
+
+/** @} */

+ 33 - 0
modules/boonex/files/classes/BxFilesUploaderSimple.php

@@ -0,0 +1,33 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxFilesUploaderSimple extends BxTemplUploaderSimple
+{
+    protected $_oModule;
+
+    public function __construct ($aObject, $sStorageObject, $sUniqId, $oTemplate)
+    {
+        parent::__construct($aObject, $sStorageObject, $sUniqId, $oTemplate);
+        $this->_oModule = BxDolModule::getInstance('bx_files');
+    }
+
+    protected function getGhostTemplateVars($aFile, $iProfileId, $iContentId, $oStorage, $oImagesTranscoder)
+    {
+        $sTitle = $this->_oModule->_oDb->getFileTitle($aFile['id']);
+        $a = array(
+            'file_title' => $sTitle ? $sTitle : $aFile['file_name']
+        );
+        $a['file_title_attr'] = bx_html_attribute($a['file_title']);
+        return $a;
+    }
+}
+
+/** @} */

+ 124 - 0
modules/boonex/files/install/config.php

@@ -0,0 +1,124 @@
+<?php
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+$aConfig = array(
+
+    /**
+     * Main Section.
+     */
+    'type' => BX_DOL_MODULE_TYPE_MODULE,
+    'name' => 'bx_files',
+    'title' => 'Files',
+    'note' => 'Basic blogging module.',
+    'version' => '9.0.0.DEV',
+    'vendor' => 'BoonEx',
+	'help_url' => 'http://feed.boonex.com/?section={module_name}',
+
+    'compatible_with' => array(
+        '9.0.x'
+    ),
+
+    /**
+     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
+     */
+    'home_dir' => 'boonex/files/',
+    'home_uri' => 'files',
+
+    'db_prefix' => 'bx_files_',
+    'class_prefix' => 'BxFiles',
+
+    /**
+     * Category for language keys.
+     */
+    'language_category' => 'Files',
+
+    /**
+     * List of page triggers.
+     */
+    'page_triggers' => array (
+    	'trigger_page_profile_view_entry',
+    ),
+    
+    /**
+     * Menu triggers.
+     */
+    'menu_triggers' => array(
+    	'trigger_profile_view_submenu'
+    ),
+
+    /**
+     * Storages.
+     */
+    'storages' => array(
+    	'bx_files_files'
+    ),
+
+    /**
+     * Transcoders.
+     */
+    'transcoders' => array(
+		'bx_files_preview',
+        'bx_files_gallery',
+    ),
+
+    /**
+     * Installation/Uninstallation Section.
+     */
+    'install' => array(
+        'execute_sql' => 1,
+        'update_languages' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'uninstall' => array (
+    	'process_storages' => 1,
+        'execute_sql' => 1,
+        'update_languages' => 1,
+    	'update_relations' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable' => array(
+        'execute_sql' => 1,
+    	'update_relations' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'enable_success' => array(
+        'process_menu_triggers' => 1,
+        'process_page_triggers' => 1,
+    	'register_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable' => array (
+        'execute_sql' => 1,
+    	'update_relations' => 1,
+    	'unregister_transcoders' => 1,
+        'clear_db_cache' => 1,
+    ),
+    'disable_failed' => array (
+    	'register_transcoders' => 1,
+    	'clear_db_cache' => 1,
+    ),
+
+    /**
+     * Dependencies Section
+     */
+    'dependencies' => array(),
+
+    /**
+     * Relations Section
+     */
+    'relations' => array(
+    	'bx_timeline',
+    	'bx_notifications'
+    ),
+
+);
+
+/** @} */

+ 20 - 0
modules/boonex/files/install/installer.php

@@ -0,0 +1,20 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxFilesInstaller extends BxBaseModTextInstaller
+{
+    function __construct($aConfig)
+    {
+        parent::__construct($aConfig);
+    }
+}
+
+/** @} */

+ 201 - 0
modules/boonex/files/install/langs/en.xml

@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources name="en" flag="gb" title="English">
+
+	<string name="_bx_files"><![CDATA[Files]]></string>
+	<string name="_bx_files_cmts"><![CDATA[Files' Comments]]></string>
+
+	<string name="_bx_files_option_summary_chars"><![CDATA[Number of characters in auto-cropped file summary]]></string>
+	<string name="_bx_files_option_plain_summary_chars"><![CDATA[Number of characters in plain file description when file hasn't thumb]]></string>
+	<string name="_bx_files_option_per_page_browse"><![CDATA[Number of items per page]]></string>
+	<string name="_bx_files_option_rss_num"><![CDATA[Number of items in RSS feed]]></string>
+	<string name="_bx_files_option_searchable_fields"><![CDATA[Searchable fields]]></string>
+
+	<string name="_bx_files_form_entry"><![CDATA[Files]]></string>
+	<string name="_bx_files_form_entry_display_add"><![CDATA[Add File]]></string>
+	<string name="_bx_files_form_entry_display_edit"><![CDATA[Edit File]]></string>
+	<string name="_bx_files_form_entry_display_delete"><![CDATA[Delete File]]></string>
+	<string name="_bx_files_form_entry_display_view"><![CDATA[View File]]></string>
+	<string name="_bx_files_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_files_form_entry_input_do_submit"><![CDATA[Submit]]></string>
+	<string name="_bx_files_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string>
+	<string name="_bx_files_form_entry_input_do_publish"><![CDATA[Publish]]></string>
+	<string name="_bx_files_form_entry_input_sys_title"><![CDATA[Title]]></string>
+	<string name="_bx_files_form_entry_input_title"><![CDATA[Title]]></string>
+	<string name="_bx_files_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string>
+	<string name="_bx_files_form_entry_input_sys_cat"><![CDATA[Category]]></string>
+	<string name="_bx_files_form_entry_input_cat"><![CDATA[Category]]></string>
+    <string name="_bx_files_form_entry_input_cat_err"><![CDATA[Please select category]]></string>
+	<string name="_bx_files_form_entry_input_sys_desc"><![CDATA[Description]]></string>
+	<string name="_bx_files_form_entry_input_desc"><![CDATA[Description]]></string>
+	<string name="_bx_files_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string>
+	<string name="_bx_files_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this file]]></string>
+	<string name="_bx_files_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string>
+	<string name="_bx_files_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the file]]></string>
+	<string name="_bx_files_form_entry_input_sys_attachments"><![CDATA[Files]]></string>
+	<string name="_bx_files_form_entry_input_attachments"><![CDATA[Files]]></string>
+    <string name="_bx_files_form_entry_input_sys_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_files_form_entry_input_allow_view_to"><![CDATA[Visibility]]></string>
+    <string name="_bx_files_form_entry_input_picture_use_as_thumb"><![CDATA[Cover Image]]></string>
+    <string name="_bx_files_form_entry_input_sys_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_files_form_entry_input_date_added"><![CDATA[Created]]></string>
+    <string name="_bx_files_form_entry_input_sys_date_changed"><![CDATA[Updated]]></string>
+    <string name="_bx_files_form_entry_input_date_changed"><![CDATA[Updated]]></string>
+
+	<string name="_bx_files_acl_action_create_entry"><![CDATA[Create File]]></string>
+	<string name="_bx_files_acl_action_delete_entry"><![CDATA[Delete File]]></string>
+	<string name="_bx_files_acl_action_view_entry"><![CDATA[View File]]></string>
+	<string name="_bx_files_acl_action_set_thumb"><![CDATA[Set File Thumbnail]]></string>
+	<string name="_bx_files_acl_action_edit_any_entry"><![CDATA[Edit Any File]]></string>
+
+	<string name="_bx_files_page_title_sys_create_entry"><![CDATA[Upload Files]]></string>
+	<string name="_bx_files_page_title_create_entry"><![CDATA[Upload Files]]></string>
+	<string name="_bx_files_page_block_title_create_entry"><![CDATA[Upload Files]]></string>
+	<string name="_bx_files_page_title_sys_edit_entry"><![CDATA[Edit]]></string>
+	<string name="_bx_files_page_title_edit_entry"><![CDATA[Edit]]></string>
+	<string name="_bx_files_page_block_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_files_page_title_sys_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_files_page_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_files_page_block_title_delete_entry"><![CDATA[Delete]]></string>
+	<string name="_bx_files_page_title_sys_view_entry"><![CDATA[View File]]></string>
+	<string name="_bx_files_page_title_view_entry"><![CDATA[{title}]]></string>
+	<string name="_bx_files_page_block_title_entry_text"><![CDATA[File Description]]></string>
+	<string name="_bx_files_page_title_browse"><![CDATA[Files]]></string>
+	<string name="_bx_files_page_title_search_results"><![CDATA[Files matching "{0}"]]></string>
+	<string name="_bx_files_page_title_browse_by_author"><![CDATA[Files of {display_name}]]></string>
+    <string name="_bx_files_page_title_browse_recent"><![CDATA[Latest]]></string>
+    <string name="_bx_files_page_title_browse_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_files_page_title_browse_updated"><![CDATA[Updated Files]]></string>
+    <string name="_bx_files_page_title_sys_home"><![CDATA[Files Home]]></string>
+    <string name="_bx_files_page_title_home"><![CDATA[Files]]></string>
+    <string name="_bx_files_page_block_title_recent_entries"><![CDATA[Latest (Gallery View)]]></string>
+    <string name="_bx_files_page_block_title_recent_entries_view_extended"><![CDATA[Latest]]></string>
+    <string name="_bx_files_page_block_title_recent_entries_view_full"><![CDATA[Latest (Full View)]]></string>
+    <string name="_bx_files_page_block_title_entry_social_sharing"><![CDATA[Share]]></string>
+    <string name="_bx_files_page_block_title_entry_author"><![CDATA[Author]]></string>
+    <string name="_bx_files_page_block_title_entry_actions"><![CDATA[Actions]]></string>
+    <string name="_bx_files_page_block_title_entry_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_files_page_block_title_entry_comments_link"><![CDATA[Comments to <a href="{entry_link}">{title}</a>]]></string>
+    <string name="_bx_files_page_block_title_entry_location"><![CDATA[Location]]></string>
+    <string name="_bx_files_page_block_title_entry_attachments"><![CDATA[Attachments]]></string>
+    <string name="_bx_files_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string>
+    <string name="_bx_files_page_title_sys_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_files_page_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_files_page_title_sys_entries_updated"><![CDATA[Updated Files]]></string>
+    <string name="_bx_files_page_title_entries_updated"><![CDATA[Updated Files]]></string>
+    <string name="_bx_files_page_block_title_popular_entries"><![CDATA[Popular]]></string>
+    <string name="_bx_files_page_block_title_popular_entries_view_extended"><![CDATA[Popular (Extended View)]]></string>
+    <string name="_bx_files_page_block_title_popular_entries_view_full"><![CDATA[Popular (Full View)]]></string>
+    <string name="_bx_files_page_block_title_updated_entries"><![CDATA[Updated Files]]></string>
+    <string name="_bx_files_page_title_sys_view_entry_comments"><![CDATA[File Comments]]></string>
+    <string name="_bx_files_page_title_view_entry_comments"><![CDATA[Comments to {title}]]></string>
+    <string name="_bx_files_page_title_sys_entries_of_author"><![CDATA[Files of author]]></string>
+    <string name="_bx_files_page_title_entries_of_author"><![CDATA[Files by {display_name}]]></string>
+    <string name="_bx_files_page_block_title_favorites_of_author"><![CDATA[Favorites by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_files_page_block_title_sys_favorites_of_author"><![CDATA[Favorites of author]]></string>
+    <string name="_bx_files_page_block_title_entries_of_author"><![CDATA[Files by <a href="{profile_link}">{display_name}</a>]]></string>
+    <string name="_bx_files_page_block_title_sys_entries_of_author"><![CDATA[Files of author]]></string>   
+    <string name="_bx_files_page_block_title_entries_actions"><![CDATA[Files actions]]></string>
+    <string name="_bx_files_page_block_title_browse_cmts"><![CDATA[Files' Comments]]></string>
+	<string name="_bx_files_page_title_sys_manage"><![CDATA[Manage Own]]></string>
+	<string name="_bx_files_page_title_sys_manage_administration"><![CDATA[Manage All]]></string>
+	<string name="_bx_files_page_title_manage"><![CDATA[Manage]]></string>
+	<string name="_bx_files_page_block_title_system_manage"><![CDATA[Manage Own]]></string>
+	<string name="_bx_files_page_block_title_system_manage_administration"><![CDATA[Manage All]]></string>
+	<string name="_bx_files_page_block_title_manage"><![CDATA[Manage]]></string>    
+	<string name="_bx_files_page_block_title_popular_keywords"><![CDATA[Popular Hashtags]]></string>
+	<string name="_bx_files_page_block_title_cats"><![CDATA[Files Categories]]></string>
+	<string name="_bx_files_page_block_title_entry_info"><![CDATA[Info]]></string>
+	<string name="_bx_files_page_block_title_my_entries"><![CDATA[My Files]]></string>
+
+    <string name="_bx_files_menu_set_title_view_entry"><![CDATA[File Actions]]></string>
+    <string name="_bx_files_menu_title_view_entry"><![CDATA[File Actions]]></string>
+    <string name="_bx_files_menu_title_submenu"><![CDATA[Files Submenu]]></string>
+    <string name="_bx_files_menu_set_title_submenu"><![CDATA[Files Submenu]]></string>
+    <string name="_bx_files_menu_item_title_system_create_entry"><![CDATA[Upload Files]]></string>
+    <string name="_bx_files_menu_item_title_create_entry"><![CDATA[Upload Files]]></string>
+    <string name="_bx_files_menu_item_title_system_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_files_menu_item_title_edit_entry"><![CDATA[Edit]]></string>
+    <string name="_bx_files_menu_item_title_system_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_files_menu_item_title_delete_entry"><![CDATA[Delete]]></string>
+    <string name="_bx_files_menu_item_title_system_view_entry"><![CDATA[View File]]></string>
+    <string name="_bx_files_menu_item_title_system_entries_home"><![CDATA[Files]]></string>
+    <string name="_bx_files_menu_item_title_entries_home"><![CDATA[Files]]></string>
+    <string name="_bx_files_menu_item_title_system_entries_public"><![CDATA[Latest]]></string>
+    <string name="_bx_files_menu_item_title_entries_public"><![CDATA[Latest]]></string>
+    <string name="_bx_files_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_files_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
+    <string name="_bx_files_menu_item_title_system_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_files_menu_item_title_entries_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_files_menu_title_view_entry_submenu"><![CDATA[View File Submenu]]></string>
+    <string name="_bx_files_menu_set_title_view_entry_submenu"><![CDATA[View File Submenu]]></string>
+    <string name="_bx_files_menu_item_title_view_entry_submenu_entry"><![CDATA[File]]></string>
+    <string name="_bx_files_menu_item_title_view_entry_submenu_comments"><![CDATA[Comments]]></string>
+    <string name="_bx_files_menu_item_title_system_view_entry_comments"><![CDATA[File Comments]]></string>
+    <string name="_bx_files_menu_item_title_system_view_entries_author"><![CDATA[Files]]></string>
+    <string name="_bx_files_menu_item_title_view_entries_author"><![CDATA[Files]]></string>
+    <string name="_bx_files_menu_title_entries_my"><![CDATA[My Files Action Menu]]></string>
+    <string name="_bx_files_menu_set_title_entries_my"><![CDATA[My Files Menu]]></string>
+	<string name="_bx_files_menu_item_title_system_manage_my_files"><![CDATA[My files]]></string>
+    <string name="_bx_files_menu_item_title_manage_my_files"><![CDATA[{addon} files]]></string>
+    <string name="_bx_files_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_files_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string>
+    <string name="_bx_files_menu_item_title_system_manage_account"><![CDATA[Manage account]]></string>
+    <string name="_bx_files_menu_item_title_manage_account"><![CDATA[Manage account]]></string>
+	<string name="_bx_files_menu_item_title_system_admt_files"><![CDATA[Files]]></string>
+	<string name="_bx_files_menu_item_title_admt_files"><![CDATA[Files - {addon} hidden]]></string>
+	<string name="_bx_files_menu_item_title_manage_my"><![CDATA[My Files]]></string>
+	<string name="_bx_files_menu_item_title_manage_all"><![CDATA[All Files]]></string>
+
+	<string name="_bx_files_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string>
+	<string name="_bx_files_grid_filter_item_title_adm_active"><![CDATA[Active]]></string>
+	<string name="_bx_files_grid_filter_item_title_adm_hidden"><![CDATA[Hidden]]></string>
+	<string name="_bx_files_grid_column_title_adm_active"><![CDATA[Active]]></string>
+    <string name="_bx_files_grid_column_title_adm_title"><![CDATA[Title]]></string>
+    <string name="_bx_files_grid_column_title_adm_added"><![CDATA[Added]]></string>
+    <string name="_bx_files_grid_column_title_adm_author"><![CDATA[Author]]></string>
+    <string name="_bx_files_grid_action_title_adm_edit"><![CDATA[Edit]]></string>
+    <string name="_bx_files_grid_action_title_adm_delete"><![CDATA[Delete]]></string>
+    <string name="_bx_files_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string>
+    <string name="_bx_files_grid_action_err_delete"><![CDATA[Cannot delete the selected file(s).]]></string>
+    <string name="_bx_files_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string>
+
+    <string name="_bx_files_pre_lists_cats"><![CDATA[File categories]]></string>
+    <string name="_bx_files_cat_Animals_Pets"><![CDATA[Animals & Pets]]></string>
+    <string name="_bx_files_cat_Architecture"><![CDATA[Architecture]]></string>
+    <string name="_bx_files_cat_Art"><![CDATA[Art]]></string>
+    <string name="_bx_files_cat_Cars_Motorcycles"><![CDATA[Cars & Motorcycles]]></string>
+    <string name="_bx_files_cat_Celebrities"><![CDATA[Celebrities]]></string>
+    <string name="_bx_files_cat_Design"><![CDATA[Design]]></string>
+    <string name="_bx_files_cat_DIY_Crafts"><![CDATA[DIY & Crafts]]></string>
+    <string name="_bx_files_cat_Education"><![CDATA[Education]]></string>
+    <string name="_bx_files_cat_Film_Music_Books"><![CDATA[Film, Music & Books]]></string>
+    <string name="_bx_files_cat_Food_Drink"><![CDATA[Food & Drink]]></string>
+    <string name="_bx_files_cat_Gardening"><![CDATA[Gardening]]></string>
+    <string name="_bx_files_cat_Geek"><![CDATA[Geek]]></string>
+    <string name="_bx_files_cat_Hair_Beauty"><![CDATA[Hair & Beauty]]></string>
+    <string name="_bx_files_cat_Health_Fitness"><![CDATA[Health & Fitness]]></string>
+    <string name="_bx_files_cat_History"><![CDATA[History]]></string>
+    <string name="_bx_files_cat_Holidays_Events"><![CDATA[Holidays & Events]]></string>
+    <string name="_bx_files_cat_Home_Decor"><![CDATA[Home Decor]]></string>
+    <string name="_bx_files_cat_Humor"><![CDATA[Humor]]></string>
+    <string name="_bx_files_cat_Illustrations_Fileers"><![CDATA[Illustrations & Fileers]]></string>
+    <string name="_bx_files_cat_Kids_Parenting"><![CDATA[Kids & Parenting]]></string>
+    <string name="_bx_files_cat_Mens_Fashion"><![CDATA[Men's Fashion]]></string>
+    <string name="_bx_files_cat_Outdoors"><![CDATA[Outdoors]]></string>
+    <string name="_bx_files_cat_Photography"><![CDATA[Photography]]></string>
+    <string name="_bx_files_cat_Products"><![CDATA[Products]]></string>
+    <string name="_bx_files_cat_Quotes"><![CDATA[Quotes]]></string>
+    <string name="_bx_files_cat_Science_Nature"><![CDATA[Science & Nature]]></string>
+    <string name="_bx_files_cat_Sports"><![CDATA[Sports]]></string>
+    <string name="_bx_files_cat_Tattoos"><![CDATA[Tattoos]]></string>
+    <string name="_bx_files_cat_Technology"><![CDATA[Technology]]></string>
+    <string name="_bx_files_cat_Travel"><![CDATA[Travel]]></string>
+    <string name="_bx_files_cat_Weddings"><![CDATA[Weddings]]></string>
+    <string name="_bx_files_cat_Womens_Fashion"><![CDATA[Women's Fashion]]></string>
+
+    <string name="_bx_files_txt_all_entries_by"><![CDATA[<a href="{0}">All Files by {1} ({2})</a>]]></string>
+    <string name="_bx_files_txt_sample_single"><![CDATA[file]]></string>
+    <string name="_bx_files_txt_sample_single_with_article"><![CDATA[a file]]></string>
+    <string name="_bx_files_txt_sample_comment_single"><![CDATA[file's comment]]></string>
+    <string name="_bx_files_txt_sample_vote_single"><![CDATA[file's vote]]></string>
+</resources>

+ 45 - 0
modules/boonex/files/install/sql/disable.sql

@@ -0,0 +1,45 @@
+
+-- SETTINGS
+SET @iTypeId = (SELECT `ID` FROM `sys_options_types` WHERE `name` = 'bx_files' LIMIT 1);
+SET @iCategId = (SELECT `ID` FROM `sys_options_categories` WHERE `type_id` = @iTypeId LIMIT 1);
+DELETE FROM `sys_options` WHERE `category_id` = @iCategId;
+DELETE FROM `sys_options_categories` WHERE `type_id` = @iTypeId;
+DELETE FROM `sys_options_types` WHERE `id` = @iTypeId;
+
+-- PAGES
+DELETE FROM `sys_objects_page` WHERE `module` = 'bx_files';
+DELETE FROM `sys_pages_blocks` WHERE `module` = 'bx_files' OR `object` IN('bx_files_create_entry', 'bx_files_edit_entry', 'bx_files_delete_entry', 'bx_files_view_entry', 'bx_files_view_entry_comments', 'bx_files_home', 'bx_files_popular', 'bx_files_updated', 'bx_files_author');
+
+-- MENU
+DELETE FROM `sys_objects_menu` WHERE `module` = 'bx_files';
+DELETE FROM `sys_menu_sets` WHERE `module` = 'bx_files';
+DELETE FROM `sys_menu_items` WHERE `module` = 'bx_files' OR `set_name` IN('bx_files_view', 'bx_files_submenu', 'bx_files_view_submenu', 'bx_files_my');
+
+-- PRIVACY 
+DELETE FROM `sys_objects_privacy` WHERE `object` = 'bx_files_allow_view_to';
+
+-- ACL
+DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Module` = 'bx_files';
+DELETE FROM `sys_acl_actions` WHERE `Module` = 'bx_files';
+
+-- SEARCH
+DELETE FROM `sys_objects_search` WHERE `ObjectName` IN ('bx_files', 'bx_files_cmts');
+
+-- METATAGS
+DELETE FROM `sys_objects_metatags` WHERE `object` = 'bx_files';
+
+-- CATEGORY
+DELETE FROM `sys_objects_category` WHERE `object` = 'bx_files_cats';
+
+-- GRIDS
+DELETE FROM `sys_objects_grid` WHERE `object` IN ('bx_files_administration', 'bx_files_common');
+DELETE FROM `sys_grid_fields` WHERE `object` IN ('bx_files_administration', 'bx_files_common');
+DELETE FROM `sys_grid_actions` WHERE `object` IN ('bx_files_administration', 'bx_files_common');
+
+-- UPLOADERS
+DELETE FROM `sys_objects_uploader` WHERE `object` IN('bx_files_simple', 'bx_files_html5');
+
+-- ALERTS
+SET @iHandler := (SELECT `id` FROM `sys_alerts_handlers` WHERE `name` = 'bx_files' LIMIT 1);
+DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler;
+DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler;

+ 372 - 0
modules/boonex/files/install/sql/enable.sql

@@ -0,0 +1,372 @@
+
+-- SETTINGS
+
+SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
+INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES 
+('modules', 'bx_files', '_bx_files', 'bx_files@modules/boonex/files/|std-icon.svg', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
+SET @iTypeId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
+VALUES (@iTypeId, 'bx_files', '_bx_files', 1);
+SET @iCategId = LAST_INSERT_ID();
+
+INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
+('bx_files_summary_chars', '700', @iCategId, '_bx_files_option_summary_chars', 'digit', '', '', '', 1),
+('bx_files_plain_summary_chars', '240', @iCategId, '_bx_files_option_plain_summary_chars', 'digit', '', '', '', 2),
+('bx_files_per_page_browse', '12', @iCategId, '_bx_files_option_per_page_browse', 'digit', '', '', '', 10),
+('bx_files_rss_num', '10', @iCategId, '_bx_files_option_rss_num', 'digit', '', '', '', 20),
+('bx_files_searchable_fields', 'title,desc', @iCategId, '_bx_files_option_searchable_fields', 'list', '', '', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:21:"get_searchable_fields";}', 30);
+
+-- PAGE: create entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_create_entry', '_bx_files_page_title_sys_create_entry', '_bx_files_page_title_create_entry', 'bx_files', 5, 2147483647, 1, 'create-file', 'page.php?i=create-file', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_files_create_entry', 1, 'bx_files', '_bx_files_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:13:"entity_create";}', 0, 1, 1);
+
+
+-- PAGE: edit entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_edit_entry', '_bx_files_page_title_sys_edit_entry', '_bx_files_page_title_edit_entry', 'bx_files', 5, 2147483647, 1, 'edit-file', '', '', '', '', 0, 1, 0, 'BxFilesPageEntry', 'modules/boonex/files/classes/BxFilesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_files_edit_entry', 1, 'bx_files', '_bx_files_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:11:"entity_edit";}', 0, 0, 0);
+
+
+-- PAGE: delete entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_delete_entry', '_bx_files_page_title_sys_delete_entry', '_bx_files_page_title_delete_entry', 'bx_files', 5, 2147483647, 1, 'delete-file', '', '', '', '', 0, 1, 0, 'BxFilesPageEntry', 'modules/boonex/files/classes/BxFilesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('bx_files_delete_entry', 1, 'bx_files', '_bx_files_page_block_title_delete_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:13:"entity_delete";}', 0, 0, 0);
+
+
+-- PAGE: view entry
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_view_entry', '_bx_files_page_title_sys_view_entry', '_bx_files_page_title_view_entry', 'bx_files', 10, 2147483647, 1, 'view-file', '', '', '', '', 0, 1, 0, 'BxFilesPageEntry', 'modules/boonex/files/classes/BxFilesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_files_view_entry', 1, 'bx_files', '', '_bx_files_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 0),
+('bx_files_view_entry', 2, 'bx_files', '', '_bx_files_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 1, 0),
+('bx_files_view_entry', 3, 'bx_files', '', '_bx_files_page_block_title_entry_info', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:11:\"entity_info\";}', 0, 0, 1, 1),
+('bx_files_view_entry', 3, 'bx_files', '', '_bx_files_page_block_title_entry_location', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:15:\"entity_location\";}', 0, 0, 0, 2),
+('bx_files_view_entry', 4, 'bx_files', '', '_bx_files_page_block_title_entry_all_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:18:\"entity_all_actions\";}', 0, 0, 1, 0),
+('bx_files_view_entry', 4, 'bx_files', '', '_bx_files_page_block_title_entry_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:14:\"entity_actions\";}', 0, 0, 0, 1),
+('bx_files_view_entry', 4, 'bx_files', '', '_bx_files_page_block_title_entry_social_sharing', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:21:\"entity_social_sharing\";}', 0, 0, 0, 2),
+('bx_files_view_entry', 4, 'bx_files', '', '_bx_files_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:18:\"entity_attachments\";}', 0, 0, 0, 3),
+('bx_files_view_entry', 4, 'bx_files', '', '_bx_files_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1, 4),
+('bx_files_view_entry', 4, 'bx_files', '', '_bx_files_page_block_title_entry_location', 3, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"locations_map\";s:6:\"params\";a:2:{i:0;s:8:\"bx_files\";i:1;s:4:\"{id}\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 0, 1, 5);
+
+
+-- PAGE: view entry comments
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_view_entry_comments', '_bx_files_page_title_sys_view_entry_comments', '_bx_files_page_title_view_entry_comments', 'bx_files', 5, 2147483647, 1, 'view-file-comments', '', '', '', '', 0, 1, 0, 'BxFilesPageEntry', 'modules/boonex/files/classes/BxFilesPageEntry.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_files_view_entry_comments', 1, 'bx_files', '_bx_files_page_block_title_entry_comments', '_bx_files_page_block_title_entry_comments_link', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1);
+
+
+-- PAGE: popular entries
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_popular', '_bx_files_page_title_sys_entries_popular', '_bx_files_page_title_entries_popular', 'bx_files', 5, 2147483647, 1, 'files-popular', 'page.php?i=files-popular', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_files_popular', 1, 'bx_files', '_bx_files_page_block_title_popular_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:14:"browse_popular";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
+
+
+-- PAGE: recently updated entries
+
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_updated', '_bx_files_page_title_sys_entries_updated', '_bx_files_page_title_entries_updated', 'bx_files', 5, 2147483647, 1, 'files-updated', 'page.php?i=files-updated', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_files_updated', 1, 'bx_files', '_bx_files_page_block_title_updated_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:14:"browse_updated";s:6:"params";a:3:{s:9:"unit_view";s:7:"gallery";s:13:"empty_message";b:1;s:13:"ajax_paginate";b:0;}}', 0, 1, 1);
+
+
+-- PAGE: entries of author
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_author', 'files-author', '_bx_files_page_title_sys_entries_of_author', '_bx_files_page_title_entries_of_author', 'bx_files', 5, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxFilesPageAuthor', 'modules/boonex/files/classes/BxFilesPageAuthor.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_files_author', 1, 'bx_files', '', '_bx_files_page_block_title_entries_actions', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:18:\"my_entries_actions\";}', 0, 0, 1, 1),
+('bx_files_author', 1, 'bx_files', '_bx_files_page_block_title_sys_favorites_of_author', '_bx_files_page_block_title_favorites_of_author', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:15:\"browse_favorite\";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 1, 1, 2),
+('bx_files_author', 1, 'bx_files', '_bx_files_page_block_title_sys_entries_of_author', '_bx_files_page_block_title_entries_of_author', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:13:\"browse_author\";}', 0, 0, 1, 3);
+
+-- PAGE: module home
+
+INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_home', 'files-home', '_bx_files_page_title_sys_home', '_bx_files_page_title_home', 'bx_files', 2, 2147483647, 1, 'page.php?i=files-home', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('bx_files_home', 1, 'bx_files', '', '_bx_files_page_block_title_recent_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, 1, 0),
+('bx_files_home', 2, 'bx_files', '', '_bx_files_page_block_title_popular_keywords', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:14:\"keywords_cloud\";s:6:\"params\";a:2:{i:0;s:8:\"bx_files\";i:1;s:8:\"bx_files\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', 0, 1, 1, 0),
+('bx_files_home', 2, 'bx_files', '', '_bx_files_page_block_title_cats', 11, 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:15:\"categories_list\";s:6:\"params\";a:2:{i:0;s:13:\"bx_files_cats\";i:1;a:1:{s:10:\"show_empty\";b:1;}}s:5:\"class\";s:20:\"TemplServiceCategory\";}', 0, 1, 1, 1);
+
+-- PAGE: module manage own
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_manage', '_bx_files_page_title_sys_manage', '_bx_files_page_title_manage', 'bx_files', 5, 2147483647, 1, 'files-manage', 'page.php?i=files-manage', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_files_manage', 1, 'bx_files', '_bx_files_page_block_title_system_manage', '_bx_files_page_block_title_manage', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:12:\"manage_tools\";}}', 0, 1, 0);
+
+-- PAGE: module manage all
+INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_administration', '_bx_files_page_title_sys_manage_administration', '_bx_files_page_title_manage', 'bx_files', 5, 192, 1, 'files-administration', 'page.php?i=files-administration', '', '', '', 0, 1, 0, 'BxFilesPageBrowse', 'modules/boonex/files/classes/BxFilesPageBrowse.php');
+
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('bx_files_administration', 1, 'bx_files', '_bx_files_page_block_title_system_manage_administration', '_bx_files_page_block_title_manage', 11, 192, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:12:\"manage_tools\";s:6:\"params\";a:1:{i:0;s:14:\"administration\";}}', 0, 1, 0);
+
+-- PAGE: add block to homepage
+
+SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = 'sys_home' AND `cell_id` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES 
+('sys_home', 1, 'bx_files', '_bx_files_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:13:\"browse_public\";}', 1, 0, 0, IFNULL(@iBlockOrder, 0) + 1);
+
+-- PAGES: add page block to profiles modules (trigger* page objects are processed separately upon modules enable/disable)
+SET @iPBCellProfile = 3;
+INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
+('trigger_page_profile_view_entry', @iPBCellProfile, 'bx_files', '_bx_files_page_block_title_my_entries', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:13:"browse_author";s:6:"params";a:1:{i:0;s:12:"{profile_id}";}}', 0, 0, 0);
+
+-- PAGE: service blocks
+
+SET @iBlockOrder = (SELECT `order` FROM `sys_pages_blocks` WHERE `object` = '' AND `cell_id` = 0 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES 
+('', 0, 'bx_files', '_bx_files_page_block_title_recent_entries', 11, 2147483647, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_files\";s:6:\"method\";s:13:\"browse_public\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:7:\"gallery\";s:13:\"empty_message\";b:1;s:13:\"ajax_paginate\";b:0;}}', 0, 1, IFNULL(@iBlockOrder, 0) + 1),
+
+('', 0, 'bx_files', '_bx_files_page_block_title_recent_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:13:"browse_public";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 2),
+('', 0, 'bx_files', '_bx_files_page_block_title_popular_entries_view_extended', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:8:"extended";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 3),
+('', 0, 'bx_files', '_bx_files_page_block_title_popular_entries_view_full', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:8:"bx_files";s:6:"method";s:14:"browse_popular";s:6:"params";a:1:{i:0;s:4:"full";}}', 0, 1, IFNULL(@iBlockOrder, 0) + 4);
+
+-- MENU: add to site menu
+
+SET @iSiteMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_site' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_site', 'bx_files', 'files-home', '_bx_files_menu_item_title_system_entries_home', '_bx_files_menu_item_title_entries_home', 'page.php?i=files-home', '', '', 'file-o col-red3', 'bx_files_submenu', 2147483647, 1, 1, IFNULL(@iSiteMenuOrder, 0) + 1);
+
+-- MENU: add to homepage menu
+
+SET @iHomepageMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_homepage' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_homepage', 'bx_files', 'files-home', '_bx_files_menu_item_title_system_entries_home', '_bx_files_menu_item_title_entries_home', 'page.php?i=files-home', '', '', 'file-o col-red3', 'bx_files_submenu', 2147483647, 1, 1, IFNULL(@iHomepageMenuOrder, 0) + 1);
+
+-- MENU: add to "add content" menu
+
+SET @iAddMenuOrder = (SELECT `order` FROM `sys_menu_items` WHERE `set_name` = 'sys_add_content_links' AND `active` = 1 ORDER BY `order` DESC LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_add_content_links', 'bx_files', 'create-file', '_bx_files_menu_item_title_system_create_entry', '_bx_files_menu_item_title_create_entry', 'page.php?i=create-file', '', '', 'file-o col-red3', '', 2147483647, 1, 1, IFNULL(@iAddMenuOrder, 0) + 1);
+
+
+-- MENU: actions menu for view entry 
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_view', '_bx_files_menu_title_view_entry', 'bx_files_view', 'bx_files', 9, 0, 1, 'BxFilesMenuView', 'modules/boonex/files/classes/BxFilesMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_files_view', 'bx_files', '_bx_files_menu_set_title_view_entry', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_files_view', 'bx_files', 'edit-file', '_bx_files_menu_item_title_system_edit_entry', '_bx_files_menu_item_title_edit_entry', 'page.php?i=edit-file&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 1),
+('bx_files_view', 'bx_files', 'delete-file', '_bx_files_menu_item_title_system_delete_entry', '_bx_files_menu_item_title_delete_entry', 'page.php?i=delete-file&id={content_id}', '', '', 'remove', '', 2147483647, 1, 0, 2);
+
+
+-- MENU: actions menu for my entries
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_my', '_bx_files_menu_title_entries_my', 'bx_files_my', 'bx_files', 9, 0, 1, 'BxFilesMenu', 'modules/boonex/files/classes/BxFilesMenu.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_files_my', 'bx_files', '_bx_files_menu_set_title_entries_my', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_files_my', 'bx_files', 'create-file', '_bx_files_menu_item_title_system_create_entry', '_bx_files_menu_item_title_create_entry', 'page.php?i=create-file', '', '', 'plus', '', 2147483647, 1, 0, 0);
+
+
+-- MENU: module sub-menu
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_submenu', '_bx_files_menu_title_submenu', 'bx_files_submenu', 'bx_files', 8, 0, 1, '', '');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_files_submenu', 'bx_files', '_bx_files_menu_set_title_submenu', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_files_submenu', 'bx_files', 'files-home', '_bx_files_menu_item_title_system_entries_public', '_bx_files_menu_item_title_entries_public', 'page.php?i=files-home', '', '', '', '', 2147483647, 1, 1, 1),
+('bx_files_submenu', 'bx_files', 'files-popular', '_bx_files_menu_item_title_system_entries_popular', '_bx_files_menu_item_title_entries_popular', 'page.php?i=files-popular', '', '', '', '', 2147483647, 1, 1, 2),
+('bx_files_submenu', 'bx_files', 'files-manage', '_bx_files_menu_item_title_system_entries_manage', '_bx_files_menu_item_title_entries_manage', 'page.php?i=files-manage', '', '', '', '', 2147483646, 1, 1, 3);
+
+-- MENU: sub-menu for view entry
+
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_view_submenu', '_bx_files_menu_title_view_entry_submenu', 'bx_files_view_submenu', 'bx_files', 8, 0, 1, 'BxFilesMenuView', 'modules/boonex/files/classes/BxFilesMenuView.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_files_view_submenu', 'bx_files', '_bx_files_menu_set_title_view_entry_submenu', 0);
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('bx_files_view_submenu', 'bx_files', 'view-file', '_bx_files_menu_item_title_system_view_entry', '_bx_files_menu_item_title_view_entry_submenu_entry', 'page.php?i=view-file&id={content_id}', '', '', '', '', 2147483647, 0, 0, 1),
+('bx_files_view_submenu', 'bx_files', 'view-file-comments', '_bx_files_menu_item_title_system_view_entry_comments', '_bx_files_menu_item_title_view_entry_submenu_comments', 'page.php?i=view-file-comments&id={content_id}', '', '', '', '', 2147483647, 0, 0, 2);
+
+-- MENU: profile stats
+SET @iNotifMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_profile_stats' AND `active` = 1 LIMIT 1);
+INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
+('sys_profile_stats', 'bx_files', 'profile-stats-manage-files', '_bx_files_menu_item_title_system_manage_my_files', '_bx_files_menu_item_title_manage_my_files', 'page.php?i=files-manage', '', '_self', 'file-o col-red3', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:41:"get_menu_addon_manage_tools_profile_stats";}', '', 2147483646, 1, 0, @iNotifMenuOrder + 1);
+
+-- MENU: manage tools submenu
+INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files_menu_manage_tools', '_bx_files_menu_title_manage_tools', 'bx_files_menu_manage_tools', 'bx_files', 6, 0, 1, 'BxFilesMenuManageTools', 'modules/boonex/files/classes/BxFilesMenuManageTools.php');
+
+INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES 
+('bx_files_menu_manage_tools', 'bx_files', '_bx_files_menu_set_title_manage_tools', 0);
+
+--INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+--('bx_files_menu_manage_tools', 'bx_files', 'delete-with-content', '_bx_files_menu_item_title_system_delete_with_content', '_bx_files_menu_item_title_delete_with_content', 'javascript:void(0)', 'javascript:{js_object}.onClickDeleteWithContent({content_id});', '_self', 'trash-o', '', 128, 1, 0, 0);
+
+-- MENU: dashboard manage tools
+SET @iManageMenuOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='sys_account_dashboard_manage_tools' LIMIT 1);
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('sys_account_dashboard_manage_tools', 'bx_files', 'files-administration', '_bx_files_menu_item_title_system_admt_files', '_bx_files_menu_item_title_admt_files', 'page.php?i=files-administration', '', '_self', '', 'a:2:{s:6:"module";s:8:"bx_files";s:6:"method";s:27:"get_menu_addon_manage_tools";}', '', 192, 1, 0, @iManageMenuOrder + 1);
+
+-- MENU: add menu item to profiles modules (trigger* menu sets are processed separately upon modules enable/disable)
+
+INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
+('trigger_profile_view_submenu', 'bx_files', 'files-author', '_bx_files_menu_item_title_system_view_entries_author', '_bx_files_menu_item_title_view_entries_author', 'page.php?i=files-author&profile_id={profile_id}', '', '', 'file-o col-red3', '', 2147483647, 1, 0, 0);
+
+
+-- PRIVACY 
+
+INSERT INTO `sys_objects_privacy` (`object`, `module`, `action`, `title`, `default_group`, `table`, `table_field_id`, `table_field_author`, `override_class_name`, `override_class_file`) VALUES
+('bx_files_allow_view_to', 'bx_files', 'view', '_bx_files_form_entry_input_allow_view_to', '3', 'bx_files_main', 'id', 'author', '', '');
+
+
+-- ACL
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_files', 'create entry', NULL, '_bx_files_acl_action_create_entry', '', 1, 3);
+SET @iIdActionEntryCreate = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_files', 'delete entry', NULL, '_bx_files_acl_action_delete_entry', '', 1, 3);
+SET @iIdActionEntryDelete = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_files', 'view entry', NULL, '_bx_files_acl_action_view_entry', '', 1, 0);
+SET @iIdActionEntryView = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_files', 'set thumb', NULL, '_bx_files_acl_action_set_thumb', '', 1, 3);
+SET @iIdActionSetThumb = LAST_INSERT_ID();
+
+INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
+('bx_files', 'edit any entry', NULL, '_bx_files_acl_action_edit_any_entry', '', 1, 3);
+SET @iIdActionEntryEditAny = LAST_INSERT_ID();
+
+SET @iUnauthenticated = 1;
+SET @iAccount = 2;
+SET @iStandard = 3;
+SET @iUnconfirmed = 4;
+SET @iPending = 5;
+SET @iSuspended = 6;
+SET @iModerator = 7;
+SET @iAdministrator = 8;
+SET @iPremium = 9;
+
+INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
+
+-- entry create
+(@iStandard, @iIdActionEntryCreate),
+(@iModerator, @iIdActionEntryCreate),
+(@iAdministrator, @iIdActionEntryCreate),
+(@iPremium, @iIdActionEntryCreate),
+
+-- entry delete
+(@iStandard, @iIdActionEntryDelete),
+(@iModerator, @iIdActionEntryDelete),
+(@iAdministrator, @iIdActionEntryDelete),
+(@iPremium, @iIdActionEntryDelete),
+
+-- entry view
+(@iUnauthenticated, @iIdActionEntryView),
+(@iAccount, @iIdActionEntryView),
+(@iStandard, @iIdActionEntryView),
+(@iUnconfirmed, @iIdActionEntryView),
+(@iPending, @iIdActionEntryView),
+(@iModerator, @iIdActionEntryView),
+(@iAdministrator, @iIdActionEntryView),
+(@iPremium, @iIdActionEntryView),
+
+-- set entry thumb
+(@iStandard, @iIdActionSetThumb),
+(@iModerator, @iIdActionSetThumb),
+(@iAdministrator, @iIdActionSetThumb),
+(@iPremium, @iIdActionSetThumb),
+
+-- edit any entry
+(@iModerator, @iIdActionEntryEditAny),
+(@iAdministrator, @iIdActionEntryEditAny);
+
+
+-- SEARCH
+SET @iSearchOrder = (SELECT IFNULL(MAX(`Order`), 0) FROM `sys_objects_search`);
+INSERT INTO `sys_objects_search` (`ObjectName`, `Title`, `Order`, `ClassName`, `ClassPath`) VALUES
+('bx_files', '_bx_files', @iSearchOrder + 1, 'BxFilesSearchResult', 'modules/boonex/files/classes/BxFilesSearchResult.php'),
+('bx_files_cmts', '_bx_files_cmts', @iSearchOrder + 2, 'BxFilesCmtsSearchResult', 'modules/boonex/files/classes/BxFilesCmtsSearchResult.php');
+
+-- METATAGS
+INSERT INTO `sys_objects_metatags` (`object`, `table_keywords`, `table_locations`, `table_mentions`, `override_class_name`, `override_class_file`) VALUES
+('bx_files', 'bx_files_meta_keywords', '', '', '', '');
+
+-- CATEGORY
+INSERT INTO `sys_objects_category` (`object`, `search_object`, `form_object`, `list_name`, `table`, `field`, `join`, `where`, `override_class_name`, `override_class_file`) VALUES
+('bx_files_cats', 'bx_files', 'bx_files', 'bx_files_cats', 'bx_files_main', 'cat', 'INNER JOIN `sys_profiles` ON (`sys_profiles`.`id` = `bx_files_main`.`author`)', 'AND `sys_profiles`.`status` = ''active''', '', '');
+
+-- GRIDS: moderation tools
+INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `field_active`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_fields_translatable`, `filter_mode`, `sorting_fields`, `sorting_fields_translatable`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
+('bx_files_administration', 'Sql', 'SELECT * FROM `bx_files_main` WHERE 1 ', 'bx_files_main', 'id', 'added', 'status_admin', '', 20, NULL, 'start', '', 'title,desc', '', 'like', '', '', 192, 'BxFilesGridAdministration', 'modules/boonex/files/classes/BxFilesGridAdministration.php'),
+('bx_files_common', 'Sql', 'SELECT * FROM `bx_files_main` WHERE 1 ', 'bx_files_main', 'id', 'added', 'status', '', 20, NULL, 'start', '', 'title,desc', '', 'like', '', '', 2147483647, 'BxFilesGridCommon', 'modules/boonex/files/classes/BxFilesGridCommon.php');
+
+
+INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
+('bx_files_administration', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_files_administration', 'switcher', '_bx_files_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_files_administration', 'title', '_bx_files_grid_column_title_adm_title', '25%', 0, '', '', 3),
+('bx_files_administration', 'added', '_bx_files_grid_column_title_adm_added', '20%', 1, '25', '', 4),
+('bx_files_administration', 'author', '_bx_files_grid_column_title_adm_author', '25%', 0, '25', '', 5),
+('bx_files_administration', 'actions', '', '20%', 0, '', '', 6),
+('bx_files_common', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
+('bx_files_common', 'switcher', '_bx_files_grid_column_title_adm_active', '8%', 0, '', '', 2),
+('bx_files_common', 'title', '_bx_files_grid_column_title_adm_title', '40%', 0, '', '', 3),
+('bx_files_common', 'added', '_bx_files_grid_column_title_adm_added', '30%', 1, '25', '', 4),
+('bx_files_common', 'actions', '', '20%', 0, '', '', 5);
+
+INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `icon_only`, `confirm`, `order`) VALUES
+('bx_files_administration', 'bulk', 'delete', '_bx_files_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_files_administration', 'single', 'edit', '_bx_files_grid_action_title_adm_edit', 'pencil', 1, 0, 1),
+('bx_files_administration', 'single', 'delete', '_bx_files_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_files_administration', 'single', 'settings', '_bx_files_grid_action_title_adm_more_actions', 'cog', 1, 0, 3),
+('bx_files_common', 'bulk', 'delete', '_bx_files_grid_action_title_adm_delete', '', 0, 1, 1),
+('bx_files_common', 'single', 'edit', '_bx_files_grid_action_title_adm_edit', 'pencil', 1, 0, 1),
+('bx_files_common', 'single', 'delete', '_bx_files_grid_action_title_adm_delete', 'remove', 1, 1, 2),
+('bx_files_common', 'single', 'settings', '_bx_files_grid_action_title_adm_more_actions', 'cog', 1, 0, 3);
+
+-- UPLOADERS
+INSERT INTO `sys_objects_uploader` (`object`, `active`, `override_class_name`, `override_class_file`) VALUES
+('bx_files_simple', 1, 'BxFilesUploaderSimple', 'modules/boonex/files/classes/BxFilesUploaderSimple.php'),
+('bx_files_html5', 1, 'BxFilesUploaderHTML5', 'modules/boonex/files/classes/BxFilesUploaderHTML5.php');
+
+-- ALERTS
+
+INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES 
+('bx_files', 'BxFilesAlertsResponse', 'modules/boonex/files/classes/BxFilesAlertsResponse.php', '');
+SET @iHandler := LAST_INSERT_ID();
+
+INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
+('system', 'save_setting', @iHandler),
+('profile', 'delete', @iHandler);
+

+ 304 - 0
modules/boonex/files/install/sql/install.sql

@@ -0,0 +1,304 @@
+
+SET @sStorageEngine = (SELECT `value` FROM `sys_options` WHERE `name` = 'sys_storage_default');
+
+-- TABLE: entries
+
+CREATE TABLE IF NOT EXISTS `bx_files_main` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `author` int(10) unsigned NOT NULL,
+  `added` int(11) NOT NULL,
+  `changed` int(11) NOT NULL,
+  `title` varchar(255) NOT NULL,
+  `cat` int(11) NOT NULL,
+  `desc` text NOT NULL,
+  `views` int(11) NOT NULL default '0',
+  `rate` float NOT NULL default '0',
+  `votes` int(11) NOT NULL default '0',
+  `favorites` int(11) NOT NULL default '0',
+  `comments` int(11) NOT NULL default '0',
+  `reports` int(11) NOT NULL default '0',
+  `allow_view_to` int(11) NOT NULL DEFAULT '3',
+  `status` enum('active','hidden') NOT NULL DEFAULT 'active',
+  `status_admin` enum('active','hidden') NOT NULL DEFAULT 'active',
+  PRIMARY KEY (`id`),
+  FULLTEXT KEY `search_fields` (`title`,`desc`)
+);
+
+-- TABLE: storages & transcoders
+
+CREATE TABLE IF NOT EXISTS `bx_files_files` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(255) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+CREATE TABLE IF NOT EXISTS `bx_files_photos_resized` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `profile_id` int(10) unsigned NOT NULL,
+  `remote_id` varchar(255) NOT NULL,
+  `path` varchar(255) NOT NULL,
+  `file_name` varchar(255) NOT NULL,
+  `mime_type` varchar(128) NOT NULL,
+  `ext` varchar(32) NOT NULL,
+  `size` int(11) NOT NULL,
+  `added` int(11) NOT NULL,
+  `modified` int(11) NOT NULL,
+  `private` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `remote_id` (`remote_id`)
+);
+
+-- TABLE: comments
+
+CREATE TABLE IF NOT EXISTS `bx_files_cmts` (
+  `cmt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `cmt_parent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_vparent_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_object_id` int(11) NOT NULL DEFAULT '0',
+  `cmt_author_id` int(10) unsigned NOT NULL DEFAULT '0',
+  `cmt_level` int(11) NOT NULL DEFAULT '0',
+  `cmt_text` text NOT NULL,
+  `cmt_mood` tinyint(4) NOT NULL DEFAULT '0',
+  `cmt_rate` int(11) NOT NULL DEFAULT '0',
+  `cmt_rate_count` int(11) NOT NULL DEFAULT '0',
+  `cmt_time` int(11) unsigned NOT NULL DEFAULT '0',
+  `cmt_replies` int(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`cmt_id`),
+  KEY `cmt_object_id` (`cmt_object_id`,`cmt_parent_id`),
+  FULLTEXT KEY `search_fields` (`cmt_text`)
+);
+
+-- TABLE: votes
+
+CREATE TABLE IF NOT EXISTS `bx_files_votes` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  `sum` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_files_votes_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `value` tinyint(4) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `vote` (`object_id`, `author_nip`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: views
+
+CREATE TABLE `bx_files_views_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `viewer_id` int(11) NOT NULL default '0',
+  `viewer_nip` int(11) unsigned NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: metas
+
+CREATE TABLE `bx_files_meta_keywords` (
+  `object_id` int(10) unsigned NOT NULL,
+  `keyword` varchar(255) NOT NULL,
+  KEY `object_id` (`object_id`),
+  KEY `keyword` (`keyword`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: reports
+
+CREATE TABLE IF NOT EXISTS `bx_files_reports` (
+  `object_id` int(11) NOT NULL default '0',
+  `count` int(11) NOT NULL default '0',
+  UNIQUE KEY `object_id` (`object_id`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `bx_files_reports_track` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `author_nip` int(11) unsigned NOT NULL default '0',
+  `type` varchar(32) NOT NULL default '',
+  `text` text NOT NULL default '',
+  `date` int(11) NOT NULL default '0',
+  PRIMARY KEY (`id`),
+  KEY `report` (`object_id`, `author_nip`)
+) ENGINE=MYISAM DEFAULT CHARSET=utf8;
+
+-- TABLE: favorites
+
+CREATE TABLE `bx_files_favorites_track` (
+  `object_id` int(11) NOT NULL default '0',
+  `author_id` int(11) NOT NULL default '0',
+  `date` int(11) NOT NULL default '0',
+  KEY `id` (`object_id`,`author_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+-- STORAGES & TRANSCODERS
+
+INSERT INTO `sys_objects_storage` (`object`, `engine`, `params`, `token_life`, `cache_control`, `levels`, `table_files`, `ext_mode`, `ext_allow`, `ext_deny`, `quota_size`, `current_size`, `quota_number`, `current_number`, `max_file_size`, `ts`) VALUES
+('bx_files_files', @sStorageEngine, '', 360, 2592000, 3, 'bx_files_files', 'deny-allow', '', 'action,apk,app,bat,bin,cmd,com,command,cpl,csh,exe,gadget,inf,ins,inx,ipa,isu,job,jse,ksh,lnk,msc,msi,msp,mst,osx,out,paf,pif,prg,ps1,reg,rgs,run,sct,shb,shs,u3p,vb,vbe,vbs,vbscript,workflow,ws,wsf', 0, 0, 0, 0, 0, 0),
+('bx_files_photos_resized', @sStorageEngine, '', 360, 2592000, 3, 'bx_files_photos_resized', 'allow-deny', 'jpg,jpeg,jpe,gif,png', '', 0, 0, 0, 0, 0, 0);
+
+INSERT INTO `sys_objects_transcoder` (`object`, `storage_object`, `source_type`, `source_params`, `private`, `atime_tracking`, `atime_pruning`, `ts`) VALUES 
+('bx_files_preview', 'bx_files_photos_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_files_files";}', 'no', '1', '2592000', '0'),
+('bx_files_gallery', 'bx_files_photos_resized', 'Storage', 'a:1:{s:6:"object";s:14:"bx_files_files";}', 'no', '1', '2592000', '0');
+
+INSERT INTO `sys_transcoder_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
+('bx_files_preview', 'Resize', 'a:3:{s:1:"w";s:3:"300";s:1:"h";s:3:"200";s:11:"crop_resize";s:1:"1";}', '0'),
+('bx_files_gallery', 'Resize', 'a:1:{s:1:"w";s:3:"500";}', '0');
+
+-- FORMS
+
+INSERT INTO `sys_objects_form`(`object`, `module`, `title`, `action`, `form_attrs`, `table`, `key`, `uri`, `uri_title`, `submit_name`, `params`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
+('bx_files', 'bx_files', '_bx_files_form_entry', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_files_main', 'id', '', '', 'do_submit', '', 0, 1, 'BxFilesFormEntry', 'modules/boonex/files/classes/BxFilesFormEntry.php'),
+('bx_files_upload', 'bx_files', '_bx_files_form_upload', '', 'a:1:{s:7:\"enctype\";s:19:\"multipart/form-data\";}', 'bx_files_main', 'id', '', '', 'do_submit', '', 0, 1, 'BxFilesFormUpload', 'modules/boonex/files/classes/BxFilesFormUpload.php');
+
+INSERT INTO `sys_form_displays`(`object`, `display_name`, `module`, `view_mode`, `title`) VALUES 
+('bx_files', 'bx_files_entry_delete', 'bx_files', 0, '_bx_files_form_entry_display_delete'),
+('bx_files', 'bx_files_entry_edit', 'bx_files', 0, '_bx_files_form_entry_display_edit'),
+('bx_files', 'bx_files_entry_view', 'bx_files', 1, '_bx_files_form_entry_display_view'),
+('bx_files_upload', 'bx_files_entry_upload', 'bx_files', 0, '_bx_files_form_entry_display_add');
+
+INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `checked`, `type`, `caption_system`, `caption`, `info`, `required`, `collapsed`, `html`, `attrs`, `attrs_tr`, `attrs_wrapper`, `checker_func`, `checker_params`, `checker_error`, `db_pass`, `db_params`, `editable`, `deletable`) VALUES 
+('bx_files', 'bx_files', 'allow_view_to', '', '', 0, 'custom', '_bx_files_form_entry_input_sys_allow_view_to', '_bx_files_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_files', 'bx_files', 'delete_confirm', 1, '', 0, 'checkbox', '_bx_files_form_entry_input_sys_delete_confirm', '_bx_files_form_entry_input_delete_confirm', '_bx_files_form_entry_input_delete_confirm_info', 1, 0, 0, '', '', '', 'Avail', '', '_bx_files_form_entry_input_delete_confirm_error', '', '', 1, 0),
+('bx_files', 'bx_files', 'do_publish', '_bx_files_form_entry_input_do_publish', '', 0, 'submit', '_bx_files_form_entry_input_sys_do_publish', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files', 'bx_files', 'do_submit', '_bx_files_form_entry_input_do_submit', '', 0, 'submit', '_bx_files_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files', 'bx_files', 'attachments', 'a:1:{i:0;s:14:"bx_files_html5";}', 'a:2:{s:15:"bx_files_simple";s:26:"_sys_uploader_simple_title";s:14:"bx_files_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_files_form_entry_input_sys_attachments', '_bx_files_form_entry_input_attachments', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files', 'bx_files', 'desc', '', '', 0, 'textarea', '_bx_files_form_entry_input_sys_desc', '_bx_files_form_entry_input_desc', '', 0, 0, 2, '', '', '', '', '', '', 'XssHtml', '', 1, 0),
+('bx_files', 'bx_files', 'title', '', '', 0, 'text', '_bx_files_form_entry_input_sys_title', '_bx_files_form_entry_input_title', '', 1, 0, 0, '', '', '', 'Avail', '', '_bx_files_form_entry_input_title_err', 'Xss', '', 1, 0),
+('bx_files', 'bx_files', 'cat', '', '#!bx_files_cats', 0, 'select', '_bx_files_form_entry_input_sys_cat', '_bx_files_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_files_form_entry_input_cat_err', 'Xss', '', 1, 0),
+('bx_files', 'bx_files', 'added', '', '', 0, 'datetime', '_bx_files_form_entry_input_sys_date_added', '_bx_files_form_entry_input_date_added', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files', 'bx_files', 'changed', '', '', 0, 'datetime', '_bx_files_form_entry_input_sys_date_changed', '_bx_files_form_entry_input_date_changed', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+
+('bx_files_upload', 'bx_files', 'attachments', 'a:1:{i:0;s:14:"bx_files_html5";}', 'a:2:{s:15:"bx_files_simple";s:26:"_sys_uploader_simple_title";s:14:"bx_files_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_files_form_entry_input_sys_attachments', '_bx_files_form_entry_input_attachments', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files_upload', 'bx_files', 'cat', '', '#!bx_files_cats', 0, 'select', '_bx_files_form_entry_input_sys_cat', '_bx_files_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_files_form_entry_input_cat_err', 'Xss', '', 1, 0),
+('bx_files_upload', 'bx_files', 'allow_view_to', '', '', 0, 'custom', '_bx_files_form_entry_input_sys_allow_view_to', '_bx_files_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 0, 0),
+('bx_files_upload', 'bx_files', 'do_submit', '_bx_files_form_entry_input_do_submit', '', 0, 'submit', '_bx_files_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
+
+
+INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
+('bx_files_entry_delete', 'cat', 2147483647, 0, 0),
+('bx_files_entry_delete', 'attachments', 2147483647, 0, 0),
+('bx_files_entry_delete', 'desc', 2147483647, 0, 0),
+('bx_files_entry_delete', 'do_publish', 2147483647, 0, 0),
+('bx_files_entry_delete', 'title', 2147483647, 0, 0),
+('bx_files_entry_delete', 'allow_view_to', 2147483647, 0, 0),
+('bx_files_entry_delete', 'delete_confirm', 2147483647, 1, 1),
+('bx_files_entry_delete', 'do_submit', 2147483647, 1, 2),
+('bx_files_entry_edit', 'do_publish', 2147483647, 0, 1),
+('bx_files_entry_edit', 'delete_confirm', 2147483647, 0, 2),
+('bx_files_entry_edit', 'title', 2147483647, 1, 3),
+('bx_files_entry_edit', 'cat', 2147483647, 1, 4),
+('bx_files_entry_edit', 'desc', 2147483647, 1, 5),
+('bx_files_entry_edit', 'attachments', 2147483647, 1, 6),
+('bx_files_entry_edit', 'allow_view_to', 2147483647, 1, 7),
+('bx_files_entry_edit', 'do_submit', 2147483647, 1, 8),
+('bx_files_entry_view', 'attachments', 2147483647, 0, 0),
+('bx_files_entry_view', 'delete_confirm', 2147483647, 0, 0),
+('bx_files_entry_view', 'desc', 2147483647, 0, 0),
+('bx_files_entry_view', 'do_publish', 2147483647, 0, 0),
+('bx_files_entry_view', 'title', 2147483647, 0, 0),
+('bx_files_entry_view', 'do_submit', 2147483647, 0, 0),
+('bx_files_entry_view', 'allow_view_to', 2147483647, 0, 0),
+('bx_files_entry_view', 'cat', 2147483647, 1, 1),
+('bx_files_entry_view', 'added', 2147483647, 1, 2),
+('bx_files_entry_view', 'changed', 2147483647, 1, 3),
+
+('bx_files_entry_upload', 'attachments', 2147483647, 1, 1),
+('bx_files_entry_upload', 'cat', 2147483647, 1, 2),
+('bx_files_entry_upload', 'allow_view_to', 2147483647, 1, 3),
+('bx_files_entry_upload', 'do_submit', 2147483647, 1, 4);
+
+-- PRE-VALUES
+
+INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES
+('bx_files_cats', '_bx_files_pre_lists_cats', 'bx_files', '0');
+
+INSERT INTO `sys_form_pre_values`(`Key`, `Value`, `Order`, `LKey`, `LKey2`) VALUES
+('bx_files_cats', '', 0, '_sys_please_select', ''),
+('bx_files_cats', '1', 1, '_bx_files_cat_Animals_Pets', ''),
+('bx_files_cats', '2', 2, '_bx_files_cat_Architecture', ''),
+('bx_files_cats', '3', 3, '_bx_files_cat_Art', ''),
+('bx_files_cats', '4', 4, '_bx_files_cat_Cars_Motorcycles', ''),
+('bx_files_cats', '5', 5, '_bx_files_cat_Celebrities', ''),
+('bx_files_cats', '6', 6, '_bx_files_cat_Design', ''),
+('bx_files_cats', '7', 7, '_bx_files_cat_DIY_Crafts', ''),
+('bx_files_cats', '8', 8, '_bx_files_cat_Education', ''),
+('bx_files_cats', '9', 9, '_bx_files_cat_Film_Music_Books', ''),
+('bx_files_cats', '10', 10, '_bx_files_cat_Food_Drink', ''),
+('bx_files_cats', '11', 11, '_bx_files_cat_Gardening', ''),
+('bx_files_cats', '12', 12, '_bx_files_cat_Geek', ''),
+('bx_files_cats', '13', 13, '_bx_files_cat_Hair_Beauty', ''),
+('bx_files_cats', '14', 14, '_bx_files_cat_Health_Fitness', ''),
+('bx_files_cats', '15', 15, '_bx_files_cat_History', ''),
+('bx_files_cats', '16', 16, '_bx_files_cat_Holidays_Events', ''),
+('bx_files_cats', '17', 17, '_bx_files_cat_Home_Decor', ''),
+('bx_files_cats', '18', 18, '_bx_files_cat_Humor', ''),
+('bx_files_cats', '19', 19, '_bx_files_cat_Illustrations_Posters', ''),
+('bx_files_cats', '20', 20, '_bx_files_cat_Kids_Parenting', ''),
+('bx_files_cats', '21', 21, '_bx_files_cat_Mens_Fashion', ''),
+('bx_files_cats', '22', 22, '_bx_files_cat_Outdoors', ''),
+('bx_files_cats', '23', 23, '_bx_files_cat_Photography', ''),
+('bx_files_cats', '24', 24, '_bx_files_cat_Products', ''),
+('bx_files_cats', '25', 25, '_bx_files_cat_Quotes', ''),
+('bx_files_cats', '26', 26, '_bx_files_cat_Science_Nature', ''),
+('bx_files_cats', '27', 27, '_bx_files_cat_Sports', ''),
+('bx_files_cats', '28', 28, '_bx_files_cat_Tattoos', ''),
+('bx_files_cats', '29', 29, '_bx_files_cat_Technology', ''),
+('bx_files_cats', '30', 30, '_bx_files_cat_Travel', ''),
+('bx_files_cats', '31', 31, '_bx_files_cat_Weddings', ''),
+('bx_files_cats', '32', 32, '_bx_files_cat_Womens_Fashion', '');
+
+-- COMMENTS
+
+INSERT INTO `sys_objects_cmts` (`Name`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
+('bx_files', 'bx_files_cmts', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-file&id={object_id}', '', 'bx_files_main', 'id', 'author', 'title', 'comments', '', '');
+
+-- VOTES
+
+INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`, `MinValue`, `MaxValue`, `IsUndo`, `IsOn`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldRate`, `TriggerFieldRateCount`, `ClassName`, `ClassFile`) VALUES 
+('bx_files', 'bx_files_votes', 'bx_files_votes_track', '604800', '1', '1', '0', '1', 'bx_files_main', 'id', 'author', 'rate', 'votes', '', '');
+
+-- REPORTS
+
+INSERT INTO `sys_objects_report` (`name`, `table_main`, `table_track`, `is_on`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_files', 'bx_files_reports', 'bx_files_reports_track', '1', 'page.php?i=view-file&id={object_id}', 'bx_files_main', 'id', 'author', 'reports', '', '');
+
+-- VIEWS
+
+INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_files', 'bx_files_views_track', '86400', '1', 'bx_files_main', 'id', 'author', 'views', '', '');
+
+-- FAFORITES
+
+INSERT INTO `sys_objects_favorite` (`name`, `table_track`, `is_on`, `is_undo`, `is_public`, `base_url`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
+('bx_files', 'bx_files_favorites_track', '1', '1', '1', 'page.php?i=view-file&id={object_id}', 'bx_files_main', 'id', 'author', 'favorites', '', '');
+
+-- STUDIO: page & widget
+
+INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
+(3, 'bx_files', '_bx_files', '_bx_files', 'bx_files@modules/boonex/files/|std-icon.svg');
+SET @iPageId = LAST_INSERT_ID();
+
+SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name` = 'home');
+SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id` = @iParentPageId);
+INSERT INTO `sys_std_widgets` (`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
+(@iPageId, 'bx_files', '{url_studio}module.php?name=bx_files', '', 'bx_files@modules/boonex/files/|std-icon.svg', '_bx_files', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioModules";}');
+INSERT INTO `sys_std_pages_widgets` (`page_id`, `widget_id`, `order`) VALUES
+(@iParentPageId, LAST_INSERT_ID(), IF(ISNULL(@iParentPageOrder), 1, @iParentPageOrder + 1));
+

+ 53 - 0
modules/boonex/files/install/sql/uninstall.sql

@@ -0,0 +1,53 @@
+
+-- TABLES
+
+DROP TABLE IF EXISTS `bx_files_main`, `bx_files_files`, `bx_files_photos_resized`, `bx_files_cmts`, `bx_files_votes`, `bx_files_votes_track`, `bx_files_views_track`, `bx_files_meta_keywords`, `bx_files_reports`, `bx_files_reports_track`, `bx_files_favorites_track`;
+
+-- STORAGES & TRANSCODERS
+
+DELETE FROM `sys_objects_storage` WHERE `object` = 'bx_files_files' OR `object` = 'bx_files_photos_resized';
+DELETE FROM `sys_storage_tokens` WHERE `object` = 'bx_files_files' OR `object` = 'bx_files_photos_resized';
+
+DELETE FROM `sys_objects_transcoder` WHERE `object` IN('bx_files_preview', 'bx_files_gallery');
+DELETE FROM `sys_transcoder_filters` WHERE `transcoder_object` IN('bx_files_preview', 'bx_files_gallery');
+DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` IN('bx_files_preview', 'bx_files_gallery');
+
+-- FORMS
+
+DELETE FROM `sys_objects_form` WHERE `module` = 'bx_files';
+DELETE FROM `sys_form_displays` WHERE `module` = 'bx_files';
+DELETE FROM `sys_form_inputs` WHERE `module` = 'bx_files';
+DELETE FROM `sys_form_display_inputs` WHERE `display_name` IN ('bx_files_entry_upload', 'bx_files_entry_edit', 'bx_files_entry_view', 'bx_files_entry_delete');
+
+-- PRE-VALUES
+
+DELETE FROM `sys_form_pre_lists` WHERE `module` = 'bx_files';
+
+DELETE FROM `sys_form_pre_values` WHERE `Key` IN('bx_files_cats');
+
+-- COMMENTS
+
+DELETE FROM `sys_objects_cmts` WHERE `Name` = 'bx_files';
+
+-- VOTES
+
+DELETE FROM `sys_objects_vote` WHERE `Name` = 'bx_files';
+
+-- REPORTS
+
+DELETE FROM `sys_objects_report` WHERE `name` = 'bx_files';
+
+-- VIEWS
+
+DELETE FROM `sys_objects_view` WHERE `name` = 'bx_files';
+
+-- FAFORITES
+
+DELETE FROM `sys_objects_favorite` WHERE `name` = 'bx_files';
+
+-- STUDIO: page & widget
+
+DELETE FROM `tp`, `tw`, `tpw`
+USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
+WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_files';
+

+ 51 - 0
modules/boonex/files/js/manage_tools.js

@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+function BxFilesManageTools(oOptions) {
+	this._sActionsUrl = oOptions.sActionUrl;
+	this._sObjNameGrid = oOptions.sObjNameGrid;
+    this._sObjName = oOptions.sObjName == undefined ? 'oBxFilesManageTools' : oOptions.sObjName;
+
+    this._sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
+    this._iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
+    this._sParamsDivider = oOptions.sParamsDivider == undefined ? '#-#' : oOptions.sParamsDivider;
+
+    this._aHtmlIds = oOptions.aHtmlIds == undefined ? {} : oOptions.aHtmlIds;
+    this._oRequestParams = oOptions.oRequestParams == undefined ? {} : oOptions.oRequestParams;
+}
+
+BxFilesManageTools.prototype.onChangeFilter = function(oFilter) {
+	var oFilter1 = $('#bx-grid-filter1-' + this._sObjNameGrid);
+	var sValueFilter1 = oFilter1.length > 0 ? oFilter1.val() : '';
+
+	var oSearch = $('#bx-grid-search-' + this._sObjNameGrid);
+	var sValueSearch = oSearch.length > 0 ? oSearch.val() : '';
+	if(sValueSearch == _t('_sys_grid_search'))
+		sValueSearch = '';
+
+	glGrids[this._sObjNameGrid].setFilter(sValueFilter1 + this._sParamsDivider + sValueSearch, true);
+};
+
+BxFilesManageTools.prototype.onClickSettings = function(sMenuObject, oButton) {
+	if($(oButton).hasClass('bx-btn-disabled'))
+		return false;
+
+	bx_menu_popup(sMenuObject, oButton, {}, {
+		content_id: $(oButton).attr('bx_grid_action_data')
+	});
+};
+
+BxFilesManageTools.prototype.onClickDelete = function(iContentId) {
+	$('.bx-popup-applied:visible').dolPopupHide();
+
+	glGrids[this._sObjNameGrid].actionWithId(iContentId, 'delete', {}, '', false, 1);
+};
+
+/** @} */

+ 18 - 0
modules/boonex/files/request.php

@@ -0,0 +1,18 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Files Files
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+check_logged();
+
+BxBaseModTextRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
+
+/** @} */

+ 3 - 0
modules/boonex/files/template/attachments.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/attachments.html />
+

+ 3 - 0
modules/boonex/files/template/author.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/author.html />
+

+ 1 - 0
modules/boonex/files/template/author_link.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/author_link.html />

+ 3 - 0
modules/boonex/files/template/css/forms.css

@@ -0,0 +1,3 @@
+
+@import url(../../../../base/text/template/css/forms.css);
+

+ 6 - 0
modules/boonex/files/template/css/main.css

@@ -0,0 +1,6 @@
+
+@import url(../../../../base/text/template/css/main.css);
+
+.bx_files_cover .bx-cover-title {
+    margin-top:9rem;
+}

+ 1 - 0
modules/boonex/files/template/css/manage_tools.css

@@ -0,0 +1 @@
+@import url(../../../../base/general/template/css/manage_tools.css);

+ 3 - 0
modules/boonex/files/template/entry-all-actions.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/entry-all-actions.html />
+

+ 3 - 0
modules/boonex/files/template/entry-location.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/general/template/entry-location.html />
+

+ 1 - 0
modules/boonex/files/template/entry-share.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/entry-share.html />

+ 3 - 0
modules/boonex/files/template/entry-text.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/entry-text.html />
+

+ 18 - 0
modules/boonex/files/template/form_ghost_template.html

@@ -0,0 +1,18 @@
+<div id="bx-uploader-file-{storage_object}-{file_id}" class="bx-uploader-ghost bx-def-margin-sec-top bx-clearfix">
+    <input type="hidden" name="__name__[]" value="{file_id}" />
+    <div class="bx-base-general-icon-wrapper bx-def-margin-sec-right">
+        <img src="{file_icon}" class="bx-def-round-corners bx-base-general-icon bx-base-general-icon-{file_id}" />
+    </div>
+    <span class="bx-base-general-uploader-ghost">
+        <b>{file_name}</b>
+    </span>
+</div>
+<script>
+    if ('object' == typeof(tinymce))
+        $('#bx-base-general-intert-to-post-link-{file_id}').show();
+
+    // disable images drag&drop, because resized images address can be reset after some time
+    $(".bx-base-general-icon-{file_id}").bind('dragstart', function(){
+        return false; 
+    });
+</script>

+ 14 - 0
modules/boonex/files/template/form_ghost_template_upload.html

@@ -0,0 +1,14 @@
+<div id="bx-uploader-file-{storage_object}-{file_id}" class="bx-uploader-ghost bx-def-margin-sec-top bx-clearfix">
+    <input type="hidden" name="__name__[]" value="{file_id}" />
+    <div class="bx-base-general-icon-wrapper bx-def-margin-sec-right">
+        <img src="{file_icon}" class="bx-def-round-corners bx-base-general-icon bx-base-general-icon-{file_id}" />
+    </div>
+    <span class="bx-base-general-uploader-ghost">
+        <b><bx_text:_bx_files_form_entry_input_title /></b>
+        <br />
+        <input class="bx-def-font-inputs bx-form-input-text bx-def-margin-sec-bottom" type="text" value="{file_title_attr}" name="title-{file_id}" /> <br />
+
+        <a class="bx-btn bx-btn-small bx-def-margin-sec-right" href="javascript:void(0);" onclick="bx_base_general_delete_ghost('{file_id}', '{file_url}', '{file_icon}', ['__editor_id__'], {js_instance_name});"><bx_text:_sys_txt_form_entry_input_picture_delete /></a>
+
+    </span>
+</div>

+ 67 - 0
modules/boonex/files/template/images/icons/std-icon.svg

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="600px" height="600px" viewBox="0 0 600 600" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 40.3 (33839) - http://www.bohemiancoding.com/sketch -->
+    <title>Group 2 Copy 25</title>
+    <desc>Created with Sketch.</desc>
+    <defs>
+        <linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
+            <stop stop-color="#FFFFFF" stop-opacity="0.2" offset="0%"></stop>
+            <stop stop-color="#000000" stop-opacity="0.138870018" offset="100%"></stop>
+        </linearGradient>
+        <linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-2">
+            <stop stop-color="#FFFFFF" offset="0%"></stop>
+            <stop stop-color="#F6F6F6" offset="35.2427758%"></stop>
+            <stop stop-color="#E5E5E5" offset="100%"></stop>
+        </linearGradient>
+        <path d="M286.8,104.5 C286.1,101.6 284.8,99.5 283.3,97.7 L199.6,6 C197.7,3.9 195.5,2.9 193,1.6 C190.1,0.1 186.9,0 183.6,0 L23.7,0 C11.3,0 -2.84217094e-14,9.6 -2.84217094e-14,22.9 L-2.84217094e-14,358.1 C-2.84217094e-14,371.5 11.3,384 23.7,384 L266.8,384 C279.2,384 288,371.5 288,358.1 L288,114 C288,110.4 287.6,107.8 286.8,104.5 L286.8,104.5 Z M193,46.6 L251,110.1 L193,110.1 L193,46.6 L193,46.6 Z M32,352.1 L32,32.1 L161,32.1 L161,113.8 C161,128.6 174.4,142.1 189.1,142.1 L256,142.1 L256,352.1 L32,352.1 L32,352.1 Z" id="path-3"></path>
+        <filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-4">
+            <feMorphology radius="1" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
+            <feOffset dx="0" dy="2" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
+            <feColorMatrix values="0 0 0 0 0   0 0 0 0 0   0 0 0 0 0  0 0 0 0.08 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
+        </filter>
+        <filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-6">
+            <feMorphology radius="1" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
+            <feOffset dx="0" dy="2" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
+            <feColorMatrix values="0 0 0 0 0   0 0 0 0 0   0 0 0 0 0  0 0 0 0.08 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
+        </filter>
+        <filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-8">
+            <feMorphology radius="1" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
+            <feOffset dx="0" dy="2" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
+            <feColorMatrix values="0 0 0 0 0   0 0 0 0 0   0 0 0 0 0  0 0 0 0.08 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
+        </filter>
+        <filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-10">
+            <feMorphology radius="1" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
+            <feOffset dx="0" dy="2" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
+            <feColorMatrix values="0 0 0 0 0   0 0 0 0 0   0 0 0 0 0  0 0 0 0.08 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
+        </filter>
+        <filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-12">
+            <feMorphology radius="1" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
+            <feOffset dx="0" dy="2" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
+            <feColorMatrix values="0 0 0 0 0   0 0 0 0 0   0 0 0 0 0  0 0 0 0.08 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
+        </filter>
+        <filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-14">
+            <feMorphology radius="1" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
+            <feOffset dx="0" dy="2" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
+            <feColorMatrix values="0 0 0 0 0   0 0 0 0 0   0 0 0 0 0  0 0 0 0.08 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
+        </filter>
+        <filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-16">
+            <feMorphology radius="1" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
+            <feOffset dx="0" dy="2" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
+            <feColorMatrix values="0 0 0 0 0   0 0 0 0 0   0 0 0 0 0  0 0 0 0.08 0" type="matrix" in="shadowOffsetOuter1"></feColorMatrix>
+        </filter>
+    </defs>
+    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="Group-2-Copy-25">
+            <path d="M552.268958,552.268958 C600,504.537813 600,431.458333 600,300 C600,168.541667 600,95.4621875 552.268958,47.7310417 C504.537813,0 431.458333,0 300,0 C168.541667,0 95.4621875,0 47.7310417,47.7310417 C0,95.4621875 0,168.541667 0,300 C0,431.458333 0,504.537813 47.7310417,552.268958 C95.4621875,600 168.541667,600 300,600 C431.458333,600 504.537813,600 552.268958,552.268958 L552.268958,552.268958 Z" id="path" fill="#2BAF92"></path>
+            <path d="M552.268958,552.268958 C600,504.537813 600,431.458333 600,300 C600,168.541667 600,95.4621875 552.268958,47.7310417 C504.537813,0 431.458333,0 300,0 C168.541667,0 95.4621875,0 47.7310417,47.7310417 C0,95.4621875 0,168.541667 0,300 C0,431.458333 0,504.537813 47.7310417,552.268958 C95.4621875,600 168.541667,600 300,600 C431.458333,600 504.537813,600 552.268958,552.268958 L552.268958,552.268958 Z" id="path-copy" fill="url(#linearGradient-1)"></path>
+            <g id="document" transform="translate(156.000000, 105.000000)">
+                <g id="Layer_1">
+                    <g id="Shape">
+                        <use fill="black" fill-opacity="1" filter="url(#filter-4)" xlink:href="#path-3"></use>
+                        <use fill="url(#linearGradient-2)" fill-rule="evenodd" xlink:href="#path-3"></use>
+                    </g>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 1 - 0
modules/boonex/files/template/title_link.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/title_link.html />

+ 3 - 0
modules/boonex/files/template/unit.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit.html />
+

+ 1 - 0
modules/boonex/files/template/unit_full.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/unit_full.html />

+ 1 - 0
modules/boonex/files/template/unit_gallery.html

@@ -0,0 +1 @@
+<bx_include_base:../modules/base/text/template/unit_gallery.html />

+ 3 - 0
modules/boonex/files/template/unit_live_search.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit_live_search.html />
+

+ 3 - 0
modules/boonex/files/template/unit_private.html

@@ -0,0 +1,3 @@
+
+<bx_include_base:../modules/base/text/template/unit_private.html />
+