function com_install2()
{
    global $database, $mosConfig_absolute_path, $mosConfig_live_site, $booklibrary_configuration;
    //*******************************   begin check version PHP   **********************************
    $is_warning = false;
    if (phpversion() < 5) {
        ?>
        <center>
            <table width="100%" border="0">
                <tr>
                    <td>
                        <code>Installation status: <font color="red">fault</font></code>
                    </td>
                </tr>
                <tr>
                    <td>
                        <code><font color="red">This component works correctly under PHP version 5.0 and higher.</font></code>
                    </td>
                </tr>
            </table>
        </center>

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

    <?php 
    if ($is_warning) {
        return '<h2><font color="red">The BookLibrary Component installed with a warning about a missing PHP extension! Please read carefully and uninstall BookLibrary. Next fix your PHP installation and then install BookLibrary again.</font></h2>';
    }
}
 function entire_import($file)
 {
     global $mosConfig_absolute_path;
     $ret = mosBooklibraryImportExport::remove_info();
     if ($ret != "") {
         return;
     }
     $fp = fopen($file, "r");
     $whole = fread($fp, filesize($file));
     $pc = array();
     $pc = explode('###', $whole);
     $urr = mosBooklibraryImportExport::import_cat(trim($pc[1]), trim($pc[3]));
     if (!is_array($urr)) {
         return;
     }
     $ret = mosBooklibraryImportExport::import_book(trim($pc[0]), trim($pc[2]), $urr);
     //$pc[4]=review,$pc[5]=isbn
     $ret = mosBooklibraryImportExport::import_review(trim($pc[4]), trim($pc[5]));
     if ($ret == "") {
         echo "<h2 style='color:#0f0;'>OK</h2>";
     }
 }
Esempio n. 3
0
function export($option)
{
    global $database, $my, $mainframe, $booklibrary_configuration;
    $catid = mosGetParam($_POST, 'export_catid', 0);
    //$lend = mosGetParam($_POST, 'export_lend', null);
    //$pub = mosGetParam($_POST, 'export_pub', null);
    $type = mosGetParam($_POST, 'export_type', 0);
    $where = array();
    $wherecatid = '';
    if ($catid > 0) {
        array_push($where, "ac.catid='{$catid}'");
        $wherecatid = " AND c.id ='{$catid}'";
    }
    $selectstring = "SELECT a.id FROM #__booklibrary AS a\n                        \nLEFT JOIN #__booklibrary_categories AS ac ON a.id = ac.bookid" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . "\nGROUP BY ac.bookid" . "\nORDER BY a.ordering";
    $database->setQuery($selectstring);
    $booksids = $database->loadResultArray();
    if (version_compare(JVERSION, '3.0', 'lt')) {
        $booksids = $database->loadResultArray();
    } else {
        $booksids = $database->loadColumn();
    }
    echo $database->getErrorMsg();
    if ($database->getErrorNum()) {
        echo $database->stderr();
        return;
    }
    /*************************************************************************************************/
    $cats = '';
    if ($type == '4') {
        $selectstring = "SELECT c.* FROM #__booklibrary_main_categories AS c" . "\nWHERE c.section='com_booklibrary' " . $wherecatid . "\nORDER BY c.parent_id";
        $database->setQuery($selectstring);
        $cats = $database->loadAssocList();
    }
    $order = array("\r\n", "\n", "\r");
    $strXmlDoc = "";
    $strXmlDoc .= "<?xml version='1.0' encoding='utf-8' ?>\n";
    $strXmlDoc .= "<data>\n";
    $strXmlDoc .= "<version>" . $booklibrary_configuration['release']['version'] . "</version>\n";
    $strXmlDoc .= "<books>\n";
    foreach ($booksids as $bid) {
        $tmp = new mosBooklibrary($database);
        if ($catid > 0) {
            $tmp->categs = array($catid);
        }
        if ($tmp->load(intval($bid))) {
            $tmp->title = str_replace('|', '-', $tmp->title);
            $tmp->title = str_replace('\\n', ' ', $tmp->title);
            $tmp->title = str_replace('\\r', ' ', $tmp->title);
            $tmp->comment = str_replace('|', '-', $tmp->comment);
            $tmp->comment = str_replace('\\n', ' ', $tmp->comment);
            $tmp->comment = str_replace('\\r', ' ', $tmp->comment);
            $tmp->featured_clicks = str_replace('|', '-', $tmp->featured_clicks);
            $tmp->featured_clicks = str_replace($order, ' ', $tmp->featured_clicks);
            $tmp->featured_shows = str_replace('|', '-', $tmp->featured_shows);
            $tmp->featured_shows = str_replace($order, ' ', $tmp->featured_shows);
            //$books[]=$tmp;
            $strXmlDoc .= $tmp->toXML2();
        }
    }
    $strXmlDoc .= "</books>\n";
    $strXmlDoc2 = "";
    $strXmlDoc2 .= "<categories>\n";
    if ($type == '4') {
        foreach ($cats as $cat) {
            $strXmlDoc2 .= "<category>\n";
            foreach ($cat as $field => $value) {
                $strXmlDoc2 .= '<' . $field . '><![CDATA[' . $value . ']]></' . $field . ">\n";
            }
            $strXmlDoc2 .= "</category>\n";
        }
    }
    $strXmlDoc2 .= "</categories>\n";
    if ($type == '4') {
        $strXmlDoc .= $strXmlDoc2;
    }
    $strXmlDoc .= "</data>\n";
    /*    print_r(":11111111111111:");
        print_r("<pre>");
        print_r($cats);
        print_r("</pre>");
        exit;  */
    /*************************************************************************************************/
    /*
    
        $books = array();
        $order = array("\r\n", "\n", "\r");
    
        foreach($booksids as $bid){
            $tmp = new mosBooklibrary($database); // __constructor JTable
            if($tmp->load(intval($bid))){
                $books[]=$tmp;
            }
        }
    
    //parsing in title and commenr symbol '|'
    
        foreach ($books as $key => $book) {
            $books[$key]->title = str_replace('|', '-', $book->title);
            $books[$key]->title = str_replace('\n', ' ', $book->title);
            $books[$key]->title = str_replace('\r', ' ', $book->title);
            $books[$key]->comment = str_replace('|', '-', $book->comment);
            $books[$key]->comment = str_replace('\n', ' ', $book->comment);
            $books[$key]->comment = str_replace('\r', ' ', $book->comment);
            $books[$key]->featured_clicks = str_replace('|', '-', $books[$key]->featured_clicks);
            $books[$key]->featured_clicks = str_replace($order, ' ', $books[$key]->featured_clicks);
            $books[$key]->featured_shows = str_replace('|', '-', $books[$key]->featured_shows);
            $books[$key]->featured_shows = str_replace($order, ' ', $books[$key]->featured_shows);
            if ($catid > 0){
                $books[$key]->categs = array($catid);
            }
        }
    
        $cats = '';
    
        if ($type == '4') {
            $selectstring = "SELECT c.* FROM #__booklibrary_main_categories AS c" .
                    "\nWHERE c.section='com_booklibrary' " . $wherecatid .
                    "\nORDER BY c.parent_id";
            $database->setQuery($selectstring);
            $cats = $database->loadAssocList();
        }
    */
    //$retVal = mosBooklibraryImportExport :: exportBooksXML($books, $cats);
    $retVal = $strXmlDoc;
    $type2 = 'xml';
    switch ($type) {
        case '1':
            $type2 = 'csv';
            break;
        case '2':
            $type2 = 'xml';
            break;
    }
    $InformationArray = mosBooklibraryImportExport::storeExportFile($retVal, $type2);
    HTML_booklibrary::showExportResult($InformationArray, $option);
}