ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ." ¤‡ú*õ'VŽ|¼´Úgllº¼klz[Æüï÷Aób‡Eÿ dÑ»Xx9ÃÜ£ÁT/`¼¸vI±Ýµ·Ë‚“G³þ*Ÿû´r|*}<¨îºœ @¦mÄ’M¹”.œ«Y–|6ÏU¤jç¥ÕÞqO ˜kDÆÁ¨5ÿ š;ÐЦ¦€GÙk \ –Þ=â¼=SͧµªS°ÚÍpÜãQűÀõ¬?ÃÁ1Ñ•õZà?hóœ€ L¦l{Y*K˜Ù›zc˜–ˆâ ø+¾ ­-Ök¥%ùEÜA'}ˆ><ÊIè“bpÍ/qÞâvoX€w,\úªò6Z[XdÒæ­@Ö—€$òJí#é>'°Ú ôª˜<)4ryÙ£|óAÅn5žêŸyÒäMÝ2{"}‰–¤l÷ûWX\l¾Á¸góÉOÔ /óñB¤f¸çñ[.P˜ZsÊË*ßT܈§QN¢’¡¨§V¼(Üù*eÕ“”5T¨‹Âê¥FŒã½Dü[8'Ò¥a…Ú¶k7a *•›¼'Ò·\8¨ª\@\õ¢¦íq+DÙrmÎ…_ªæ»ŠÓœ¡¯’Ré9MÅ×D™lælffc+ŒÑ,ý™ÿ ¯þǤ=Å’Á7µ÷ÚÛ/“Ü€ñýã¼àí¾ÕÑ+ƒ,uµMâÀÄbm:ÒÎPæ{˜Gz[ƒ¯«® KHà`ߨŠéí¯P8Aq.C‰ à€kòpj´kN¶qô€…Õ,ÜNŠª-­{Zö’æû44‰sŽè‰îVíRœÕm" 6?³D9¡ÇTíÅꋇ`4«¸ÝÁô ï’ýorqКÇZ«x4Žâéþuïf¹µö[P ,Q£éaX±`PÉÍZ ¸äYúg üAx ’6Lê‚xÝÓ*äQ  Ï’¨hÍ =²,6ï#rÃ<¯–£»ƒ‹,–ê•€ aÛsñ'%Æ"®ÛüìBᝠHÚ3ß°©$“XnœÖ’î2ËTeûìxîß ¦å¿çÉ ðK§þ{‘t‚Ϋ¬jéîZ[ ”š7L¥4VÚCE×]m¤Øy”ä4-dz£œ§¸x.*ãÊÊ b÷•h:©‡¦s`BTÁRû¾g⻩‹jø sF¢àJøFl‘È•Xᓁà~*j¯ +(ÚÕ6-£¯÷GŠØy‚<Ç’.F‹Hœw(+)ÜÜâÈzÄäT§FߘãÏ;DmVœ3Àu@mÚüXÝü•3B¨òÌÁÛ<·ÃÜ z,Ì@õÅ·d2]ü8s÷IôÞ¯^Ç9¢u„~ëAŸï4«M? K]­ÅàPl@s_ p:°¬ZR”´›JC[CS.h‹ƒïËœ«Æ]–÷ó‚wR×k7X‰k›‘´ù¦=¡«‰¨¨Â')—71ó’c‡Ðúµ `é.{§p¹ój\Ž{1h{o±Ý=áUÊïGÖŒõ–-BÄm+AZX¶¡ ïHðæ¥JmÙ;…䡟ˆ¦ ° äšiÉg«$üMk5¤L“’çÊvïâï ,=f“"íἊ5ô¬x6{ɏžID0e¸vçmi'︧ºð9$ò¹÷*£’9ÿ ²TÔ…×>JV¥}Œ}$p[bÔ®*[jzS*8 ”·T›Í–ñUîƒwo$áè=LT™ç—~ô·¤ÈÚ$榍q‰„+´kFm)ž‹©i–ËqÞŠ‰à¶ü( ‚•§ •°ò·‡#5ª•µÊ﯅¡X¨šÁ*F#TXJÊ ušJVÍ&=iÄs1‚3•'fý§5Ñ<=[íÞ­ PÚ;ѱÌ_~Ä££8rÞ ²w;’hDT°>ÈG¬8Á²ÚzŽ®ò®qZcqJêäÞ-ö[ܘbň±çb“ж31²n×iƒðÕ;1¶þÉ ªX‰,ßqÏ$>•î íZ¥Z 1{ç൵+ƒÕµ¥°T$§K]á»Ûï*·¤tMI’ÂZbŽÕiÒ˜}bÓ0£ª5›¨ [5Ž^ÝœWøÂÝh° ¢OWun£¤5 a2Z.G2³YL]jåtì”ä ÁÓ‘%"©<Ôúʰsº UZvä‡ÄiÆÒM .÷V·™ø#kèýiíÌ–ª)µT[)BˆõÑ xB¾B€ÖT¨.¥~ð@VĶr#¸ü*åZNDŽH;âi ],©£öØpù(šºãö¼T.uCê•4@ÿ GÕÛ)Cx›®0ø#:ÏðFÒbR\(€€Ä®fã4Þ‰Fä¯HXƒÅ,†öEÑÔÜ]Öv²?tLÃvBY£ú6Êu5ÅAQ³1‘’¬x–HŒÐ‡ ^ ¸KwJôÖŽ5×CÚ¨vÜ«/B0$×k°=ðbÇ(Ï)w±A†Á† 11Í=èQšµ626ŒÜ/`G«µ<}—-Ö7KEHÈÉðóȤmݱû±·ø«Snmá=“䫚mݱŸ¡¶~ó·“äUóJæúòB|E LêŽy´jDÔ$G¢þÐñ7óR8ýÒ…Ç› WVe#·Ÿ p·Fx~•ݤF÷0Èÿ K¯æS<6’¡WШ; ´ÿ ¥Êø\Òuî†åÝ–VNœkÒ7oòX¨Á­Ø÷FÎÑä±g÷ÿ M~Çî=p,X´ ÝÌÚÅ‹’ÃjÖ.ØöÏñ qïQ¤ÓZE†° =6·]܈ s¸>v•Ž^Ý\wq9r‰Î\¸¡kURÒ$­*‹Nq?Þª*!sŠÆ:TU_u±T+øX¡ ®¹¡,ÄâÃBTsÜ$Ø›4m椴zÜK]’’›Pƒ @€#â˜`é¹=I‡fiV•Ôî“nRm+µFPOhÍ0B£ €+¬5c v•:P'ÒyÎ ‰V~‚Ó†ÖuókDoh$å\*ö%Ю=£«…aȼ½÷Û.-½VŒŠ¼'lyî±1¬3ó#ÞE¿ÔS¤gV£m›=§\û"—WU¤ÚǼÿ ÂnÁGŒÃ ‚õN D³õNÚíŒÕ;HôyÄÈ©P¹Ä{:?R‘Ô¨âF÷ø£bÅó® JS|‚R÷ivýáâ€Æé¡è³´IئÑT!§˜•ت‚¬â@q€wnïCWÄ@JU€ê¯m6]Ï:£âx'+ÒðXvÓ¦Úm=–´7œ $ì“B£~p%ÕŸUþ« N@¼üï~w˜ñø5®—'Ôe»¤5ã//€ž~‰Tþ›Å7•#¤× Íö pÄ$ùeåì*«ÓŠEØWEÈsßg ¦ûvžSsLpºÊW–âµEWöˬH; ™!CYõZ ÃÄf æ#1W. \uWâ\,\Çf j’<qTbên›Î[vxx£ë 'ö¨1›˜ÀM¼Pÿ H)ƒêêŒA7s,|F“ 꺸k³9Ìö*ç®;Ö!Ö$Eiž•¹ÒÚ†ýóéÝû¾ÕS®ó$’NÝäŸz¤5r¦ãÄÃD÷Üø!°ø‡Ô&@m™Ì^Ãä­d q5Lnÿ N;.6½·N|#ä"1Nƒx“ã<3('&ñßt  ~ªu”1Tb㫨9ê–›–bìd$ߣ=#ÕãÒmU¯eí$EFù5ýYô櫨æì™Ç—±ssM]·á¿0ÕåJRÓªîiƒ+O58ÖñªŠÒx" \µâá¨i’¤i —Ö ” M+M¤ë9‚‰A¦°Qõ¾ßøK~¼Ã‘g…Ö´~÷Ï[3GUœÒ½#…kàÔ®Ò”‰³·dWV‰IP‰Ú8u¹”E ÖqLj¾êÕCBš{A^Âß;–¨`¯¬ìö ˼ ×tìø.tƐm*n¨y4o&Àx¥n¦×î‡aupáÛj8¿m›è¶ã!o½;ß0y^ý×^EÑ¿ÒjzŒ­)vÚÑnÄL …^ªô× ‡—‚3k Îý­hï]içå–îÏ*÷ñþ»Ô CÒjøjÍznˆ´ ¹#b'Fô‹ ‰v¥'’à'T´ƒHýÍ%M‰ ƒ&ÆÇŒï1 ‘ –Þ ‰i¬s žR-Ÿ kЬá¬7:þ 0ŒÅÒÕ/aÙ¬ÃÝ#Úøœ ©aiVc‰. ¹¦ãµ” ›Yg¦›ÆÎýº°f³7ƒhá·¸­}&D9¡ÂsÉÙÞèŠõØàC™¨ñbFC|´Ü(ŸƒÚÒ-%»'a Ì¿)ËÇn¿úÿ ÞŽX…4ÊÅH^ôΑí@ù¹Eh¶“L8Çjù ¼ÎåVªóR©Ï5uà V4lZß®=€xÖŸ–ÑÈ ÷”¨°¾__yM1tÉ?uÆþIkÄgæ@þ[¢†°XÃJ£j·:nkÅ¢u ‘}âGzö­/IµèЬ¼48q¦F°ŽR¼=ûì{´¯RýicS ÕÛ íNtÍÙï£,w4rêì®»~x(©Uñ§#Ñ&œÕ¤>ÎåÍÓ9’Ö{9eV­[Öjâ²ãu]˜å2›qÑšÕJç0€sÄ|Êëè0튔bÁ>“{×_F`Ø©ºê:µä,v¤ðfc1±"«ÔÍän1#=· Âøv~H½ÐßA¾¿Ü€Óš]Õ; I¾÷ç‚Qi†î¹9ywÔKG˜áñ zQY—§ÃÕZ07§X‚ Áh;ÁM)iÌCH-¯T‘ë|A0{Ò½LÚ–TâÖkÜ’dÀ“rmm»”جPF³ÖcbE§T€ÒxKºû’Ó®7±²(\4ŽÃ¸Uu@j™yĵ;³µ!Á¢b.W¤=mõ´êµK k ¸K^ÜÛ#p*Ü14qkZç5ïë †°5Ï%ÍÛ<Õ¤×Ô¥ê†C Õ´¼ú$ƒÖ“”]Ù¬qÞÚ[4©ý!ûÏ—Áb쳐XµA¬â~`›Çr¸8ìùÝ䫦<>ä÷«?xs´ÇÑ /á;¹øüÊÈÙà{"@Žïzâ¬[âß‚ U_<ÇŸ½4èN˜ú61®qŠu ¦þF£»äJ_ˆÙÎ~ ÞAã–݄ϗrŠD;xTž‘ô`É«…suãO`?³à™ô Lý#Íc5öoæØ‚y´´÷«ZR§<&JÇ+éâô´€i!Àˆ0æAoàðLèÖ-2ŸõW.’t^–(KÁmHµV@xÜÇy®Ñø­â^:Ú3w· 7½¹°ñ¸â¹®:',«Mœ—n­Á+Ãbš LÈ‘ÄnRÓÅœ%¦²‰¨ùQ:¤f‚ "PÕtô¸…cæl…&˜Ú˜Ôkv‹ž+vŠ,=¢v­6—Xy*¥t£«<™:“aîϲ=¦6rO]XI¿Œ÷¤zÚ­›¶ 6÷”w\d ü~v®ˆÌk«^m<ÿ ¢‰Õ\)ùºŽ;… lîÙÅEŠ®cѾ@vnMÏ,¼“ñ•ŽBxðÃzãÇç%3ˆ"}Ù•Åî> BÉú;Ò]V+P˜F_´ßé> Øše|ï‡ÄOmFæÇ ãqÞ$/xÐx­z`ï9"œÜij‚!7.\Td…9M‡•iŽ‹¾‘50ÞŽn¥ß4ÉôO ¹*í^QêËÜÇÌ8=ާs‰'ÂëÙ«á%Pú[O †ÅP¯Vsް.‰,kc¶ ¬A9n˜XÎ-ÞšN["¹QÕ‰ƒMýÁߺXJæÍaLj¾×Ãmã¾ãÚ uñÒþåQô¦¥ /ÄUx:‚ÍÜ’ Đ©ØÝ3V¨‰ÕnÐ6ó*óúK­«…c ¯U òhsý­jóÔj#,ímŒRµ«lbïUTŒÑ8†Ä0œÏr`ð¡¬É Ї ë"À² ™ 6¥ f¶ ¢ÚoܱԷ-<Àî)†a¶ž'Ú»¨TXqØæ¶÷YÄHy˜9ÈIW­YÀuMFë ºÏ’AqÌ4·/Ú †ô'i$øä­=Ä Ý|öK×40è|È6p‘0§)o¥ctî§H+CA-“ xØ|ÐXАç l8íºð3Ø:³¤¬KX¯UÿÙ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * Functions used in the export tab * */ /** * Disables the "Dump some row(s)" sub-options */ function disable_dump_some_rows_sub_options() { $("label[for='limit_to']").fadeTo('fast', 0.4); $("label[for='limit_from']").fadeTo('fast', 0.4); $("input[type='text'][name='limit_to']").prop('disabled', 'disabled'); $("input[type='text'][name='limit_from']").prop('disabled', 'disabled'); } /** * Enables the "Dump some row(s)" sub-options */ function enable_dump_some_rows_sub_options() { $("label[for='limit_to']").fadeTo('fast', 1); $("label[for='limit_from']").fadeTo('fast', 1); $("input[type='text'][name='limit_to']").prop('disabled', ''); $("input[type='text'][name='limit_from']").prop('disabled', ''); } /** * Return template data as a json object * * @returns template data */ function getTemplateData() { var $form = $('form[name="dump"]'); var blacklist = ['token', 'server', 'db', 'table', 'single_table', 'export_type', 'export_method', 'sql_query', 'template_id']; var obj = {}; var arr = $form.serializeArray(); $.each(arr, function () { if ($.inArray(this.name, blacklist) < 0) { if (obj[this.name] !== undefined) { if (! obj[this.name].push) { obj[this.name] = [obj[this.name]]; } obj[this.name].push(this.value || ''); } else { obj[this.name] = this.value || ''; } } }); // include unchecked checboxes (which are ignored by serializeArray()) with null // to uncheck them when loading the template $form.find('input[type="checkbox"]:not(:checked)').each(function () { if (obj[this.name] === undefined) { obj[this.name] = null; } }); // include empty multiselects $form.find('select').each(function () { if ($(this).find('option:selected').length == 0) { obj[this.name] = []; } }); return obj; } /** * Create a template with selected options * * @param name name of the template */ function createTemplate(name) { var templateData = getTemplateData(); var params = { ajax_request : true, token : PMA_commonParams.get('token'), server : PMA_commonParams.get('server'), db : PMA_commonParams.get('db'), table : PMA_commonParams.get('table'), exportType : $('input[name="export_type"]').val(), templateAction : 'create', templateName : name, templateData : JSON.stringify(templateData) }; PMA_ajaxShowMessage(); $.post('tbl_export.php', params, function (response) { if (response.success === true) { $('#templateName').val(''); $('#template').html(response.data); $("#template").find("option").each(function() { if ($(this).text() == name) { $(this).prop('selected', true); } }); PMA_ajaxShowMessage(PMA_messages.strTemplateCreated); } else { PMA_ajaxShowMessage(response.error, false); } }); } /** * Loads a template * * @param id ID of the template to load */ function loadTemplate(id) { var params = { ajax_request : true, token : PMA_commonParams.get('token'), server : PMA_commonParams.get('server'), db : PMA_commonParams.get('db'), table : PMA_commonParams.get('table'), exportType : $('input[name="export_type"]').val(), templateAction : 'load', templateId : id, }; PMA_ajaxShowMessage(); $.post('tbl_export.php', params, function (response) { if (response.success === true) { var $form = $('form[name="dump"]'); var options = $.parseJSON(response.data); $.each(options, function (key, value) { var $element = $form.find('[name="' + key + '"]'); if ($element.length) { if (($element.is('input') && $element.attr('type') == 'checkbox') && value === null) { $element.prop('checked', false); } else { if (($element.is('input') && $element.attr('type') == 'checkbox') || ($element.is('input') && $element.attr('type') == 'radio') || ($element.is('select') && $element.attr('multiple') == 'multiple')) { if (! value.push) { value = [value]; } } $element.val(value); } $element.trigger('change'); } }); $('input[name="template_id"]').val(id); PMA_ajaxShowMessage(PMA_messages.strTemplateLoaded); } else { PMA_ajaxShowMessage(response.error, false); } }); } /** * Updates an existing template with current options * * @param id ID of the template to update */ function updateTemplate(id) { var templateData = getTemplateData(); var params = { ajax_request : true, token : PMA_commonParams.get('token'), server : PMA_commonParams.get('server'), db : PMA_commonParams.get('db'), table : PMA_commonParams.get('table'), exportType : $('input[name="export_type"]').val(), templateAction : 'update', templateId : id, templateData : JSON.stringify(templateData) }; PMA_ajaxShowMessage(); $.post('tbl_export.php', params, function (response) { if (response.success === true) { PMA_ajaxShowMessage(PMA_messages.strTemplateUpdated); } else { PMA_ajaxShowMessage(response.error, false); } }); } /** * Delete a template * * @param id ID of the template to delete */ function deleteTemplate(id) { var params = { ajax_request : true, token : PMA_commonParams.get('token'), server : PMA_commonParams.get('server'), db : PMA_commonParams.get('db'), table : PMA_commonParams.get('table'), exportType : $('input[name="export_type"]').val(), templateAction : 'delete', templateId : id, }; PMA_ajaxShowMessage(); $.post('tbl_export.php', params, function (response) { if (response.success === true) { $('#template').find('option[value="' + id + '"]').remove(); PMA_ajaxShowMessage(PMA_messages.strTemplateDeleted); } else { PMA_ajaxShowMessage(response.error, false); } }); } /** * Unbind all event handlers before tearing down a page */ AJAX.registerTeardown('export.js', function () { $("#plugins").unbind('change'); $("input[type='radio'][name='sql_structure_or_data']").unbind('change'); $("input[type='radio'][name$='_structure_or_data']").off('change'); $("input[type='radio'][name='output_format']").unbind('change'); $("#checkbox_sql_include_comments").unbind('change'); $("input[type='radio'][name='quick_or_custom']").unbind('change'); $("input[type='radio'][name='allrows']").unbind('change'); $('#btn_alias_config').off('click'); $('#db_alias_select').off('change'); $('.table_alias_select').off('change'); $('input[name="table_select[]"]').off('change'); $('input[name="table_structure[]"]').off('change'); $('input[name="table_data[]"]').off('change'); $('#table_structure_all').off('change'); $('#table_data_all').off('change'); $('input[name="createTemplate"]').off('click'); $('select[name="template"]').off('change'); $('input[name="updateTemplate"]').off('click'); $('input[name="deleteTemplate"]').off('click'); }); AJAX.registerOnload('export.js', function () { /** * Export template handling code */ // create a new template $('input[name="createTemplate"]').on('click', function (e) { e.preventDefault(); var name = $('input[name="templateName"]').val(); if (name.length) { createTemplate(name); } }); // load an existing template $('select[name="template"]').on('change', function (e) { e.preventDefault(); var id = $(this).val(); if (id.length) { loadTemplate(id); } }); // udpate an existing template with new criteria $('input[name="updateTemplate"]').on('click', function (e) { e.preventDefault(); var id = $('select[name="template"]').val(); if (id.length) { updateTemplate(id); } }); // delete an existing template $('input[name="deleteTemplate"]').on('click', function (e) { e.preventDefault(); var id = $('select[name="template"]').val(); if (id.length) { deleteTemplate(id); } }); /** * Toggles the hiding and showing of each plugin's options * according to the currently selected plugin from the dropdown list */ $("#plugins").change(function () { $("#format_specific_opts").find("div.format_specific_options").hide(); var selected_plugin_name = $("#plugins").find("option:selected").val(); $("#" + selected_plugin_name + "_options").show(); }); /** * Toggles the enabling and disabling of the SQL plugin's comment options that apply only when exporting structure */ $("input[type='radio'][name='sql_structure_or_data']").change(function () { var comments_are_present = $("#checkbox_sql_include_comments").prop("checked"); var show = $("input[type='radio'][name='sql_structure_or_data']:checked").val(); if (show == 'data') { // disable the SQL comment options if (comments_are_present) { $("#checkbox_sql_dates").prop('disabled', true).parent().fadeTo('fast', 0.4); } $("#checkbox_sql_relation").prop('disabled', true).parent().fadeTo('fast', 0.4); $("#checkbox_sql_mime").prop('disabled', true).parent().fadeTo('fast', 0.4); } else { // enable the SQL comment options if (comments_are_present) { $("#checkbox_sql_dates").prop('disabled', false).parent().fadeTo('fast', 1); } $("#checkbox_sql_relation").prop('disabled', false).parent().fadeTo('fast', 1); $("#checkbox_sql_mime").prop('disabled', false).parent().fadeTo('fast', 1); } if (show == 'structure') { $('#checkbox_sql_auto_increment').prop('disabled', true).parent().fadeTo('fast', 0.4); } else { $("#checkbox_sql_auto_increment").prop('disabled', false).parent().fadeTo('fast', 1); } }); // For separate-file exports only ZIP compression is allowed $('input[type="checkbox"][name="as_separate_files"]').change(function(){ if ($(this).is(':checked')) { $('#compression').val('zip'); } }); $('#compression').change(function(){ if ($('option:selected').val() !== 'zip') { $('input[type="checkbox"][name="as_separate_files"]').prop('checked', false); } }); }); function setup_table_structure_or_data() { if ($("input[name='export_type']").val() != 'database') { return; } var pluginName = $("#plugins").find("option:selected").val(); var formElemName = pluginName + "_structure_or_data"; var force_structure_or_data = !($("input[name='" + formElemName + "_default']").length); if (force_structure_or_data === true) { $('input[name="structure_or_data_forced"]').val(1); $('.export_structure input[type="checkbox"], .export_data input[type="checkbox"]') .prop('disabled', true); $('.export_structure, .export_data').fadeTo('fast', 0.4); } else { $('input[name="structure_or_data_forced"]').val(0); $('.export_structure input[type="checkbox"], .export_data input[type="checkbox"]') .prop('disabled', false); $('.export_structure, .export_data').fadeTo('fast', 1); var structure_or_data = $('input[name="' + formElemName + '_default"]').val(); if (structure_or_data == 'structure') { $('.export_data input[type="checkbox"]') .prop('checked', false); } else if (structure_or_data == 'data') { $('.export_structure input[type="checkbox"]') .prop('checked', false); } if (structure_or_data == 'structure' || structure_or_data == 'structure_and_data') { if (!$('.export_structure input[type="checkbox"]:checked').length) { $('input[name="table_select[]"]:checked') .closest('tr') .find('.export_structure input[type="checkbox"]') .prop('checked', true); } } if (structure_or_data == 'data' || structure_or_data == 'structure_and_data') { if (!$('.export_data input[type="checkbox"]:checked').length) { $('input[name="table_select[]"]:checked') .closest('tr') .find('.export_data input[type="checkbox"]') .prop('checked', true); } } check_selected_tables(); check_table_select_all(); } } /** * Toggles the hiding and showing of plugin structure-specific and data-specific * options */ function toggle_structure_data_opts() { var pluginName = $("select#plugins").val(); var radioFormName = pluginName + "_structure_or_data"; var dataDiv = "#" + pluginName + "_data"; var structureDiv = "#" + pluginName + "_structure"; var show = $("input[type='radio'][name='" + radioFormName + "']:checked").val(); if (show == 'data') { $(dataDiv).slideDown('slow'); $(structureDiv).slideUp('slow'); } else { $(structureDiv).slideDown('slow'); if (show == 'structure') { $(dataDiv).slideUp('slow'); } else { $(dataDiv).slideDown('slow'); } } } /** * Toggles the disabling of the "save to file" options */ function toggle_save_to_file() { var $ulSaveAsfile = $("#ul_save_asfile"); if (!$("#radio_dump_asfile").prop("checked")) { $ulSaveAsfile.find("> li").fadeTo('fast', 0.4); $ulSaveAsfile.find("> li > input").prop('disabled', true); $ulSaveAsfile.find("> li > select").prop('disabled', true); } else { $ulSaveAsfile.find("> li").fadeTo('fast', 1); $ulSaveAsfile.find("> li > input").prop('disabled', false); $ulSaveAsfile.find("> li > select").prop('disabled', false); } } AJAX.registerOnload('export.js', function () { toggle_save_to_file(); $("input[type='radio'][name='output_format']").change(toggle_save_to_file); }); /** * For SQL plugin, toggles the disabling of the "display comments" options */ function toggle_sql_include_comments() { $("#checkbox_sql_include_comments").change(function () { var $ulIncludeComments = $("#ul_include_comments"); if (!$("#checkbox_sql_include_comments").prop("checked")) { $ulIncludeComments.find("> li").fadeTo('fast', 0.4); $ulIncludeComments.find("> li > input").prop('disabled', true); } else { // If structure is not being exported, the comment options for structure should not be enabled if ($("#radio_sql_structure_or_data_data").prop("checked")) { $("#text_sql_header_comment").prop('disabled', false).parent("li").fadeTo('fast', 1); } else { $ulIncludeComments.find("> li").fadeTo('fast', 1); $ulIncludeComments.find("> li > input").prop('disabled', false); } } }); } function check_table_select_all() { var total = $('input[name="table_select[]"]').length; var str_checked = $('input[name="table_structure[]"]:checked').length; var data_checked = $('input[name="table_data[]"]:checked').length; var str_all = $('#table_structure_all'); var data_all = $('#table_data_all'); if (str_checked == total) { str_all .prop("indeterminate", false) .prop('checked', true); } else if (str_checked === 0) { str_all .prop("indeterminate", false) .prop('checked', false); } else { str_all .prop("indeterminate", true) .prop('checked', false); } if (data_checked == total) { data_all .prop("indeterminate", false) .prop('checked', true); } else if (data_checked === 0) { data_all .prop("indeterminate", false) .prop('checked', false); } else { data_all .prop("indeterminate", true) .prop('checked', false); } } function toggle_table_select_all_str() { var str_all = $('#table_structure_all').is(':checked'); if (str_all) { $('input[name="table_structure[]"]').prop('checked', true); } else { $('input[name="table_structure[]"]').prop('checked', false); } } function toggle_table_select_all_data() { var data_all = $('#table_data_all').is(':checked'); if (data_all) { $('input[name="table_data[]"]').prop('checked', true); } else { $('input[name="table_data[]"]').prop('checked', false); } } function check_selected_tables(argument) { $('.export_table_select tbody tr').each(function() { check_table_selected(this); }); } function check_table_selected(row) { var $row = $(row); var table_select = $row.find('input[name="table_select[]"]'); var str_check = $row.find('input[name="table_structure[]"]'); var data_check = $row.find('input[name="table_data[]"]'); var data = data_check.is(':checked:not(:disabled)'); var structure = str_check.is(':checked:not(:disabled)'); if (data && structure) { table_select.prop({checked: true, indeterminate: false}); } else if (data || structure) { table_select.prop({checked: true, indeterminate: true}); } else { table_select.prop({checked: false, indeterminate: false}); } } function toggle_table_select(row) { var $row = $(row); var table_selected = $row.find('input[name="table_select[]"]').is(':checked'); if (table_selected) { $row.find('input[type="checkbox"]:not(:disabled)').prop('checked', true); } else { $row.find('input[type="checkbox"]:not(:disabled)').prop('checked', false); } } function handleAddProcCheckbox() { if ($('#table_structure_all').is(':checked') === true && $('#table_data_all').is(':checked') === true ) { $('#checkbox_sql_procedure_function').prop('checked', true); } else { $('#checkbox_sql_procedure_function').prop('checked', false); } } AJAX.registerOnload('export.js', function () { /** * For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options */ var $create = $("#checkbox_sql_create_table_statements"); var $create_options = $("#ul_create_table_statements").find("input"); $create.change(function () { $create_options.prop('checked', $(this).prop("checked")); }); $create_options.change(function () { if ($create_options.is(":checked")) { $create.prop('checked', true); } }); /** * Disables the view output as text option if the output must be saved as a file */ $("#plugins").change(function () { var active_plugin = $("#plugins").find("option:selected").val(); var force_file = $("#force_file_" + active_plugin).val(); if (force_file == "true") { if ($("#radio_dump_asfile").prop('checked') !== true) { $("#radio_dump_asfile").prop('checked', true); toggle_save_to_file(); } $("#radio_view_as_text").prop('disabled', true).parent().fadeTo('fast', 0.4); } else { $("#radio_view_as_text").prop('disabled', false).parent().fadeTo('fast', 1); } }); $("input[type='radio'][name$='_structure_or_data']").on('change', function () { toggle_structure_data_opts(); }); $('input[name="table_select[]"]').on('change', function() { toggle_table_select($(this).closest('tr')); check_table_select_all(); handleAddProcCheckbox(); }); $('input[name="table_structure[]"]').on('change', function() { check_table_selected($(this).closest('tr')); check_table_select_all(); handleAddProcCheckbox(); }); $('input[name="table_data[]"]').on('change', function() { check_table_selected($(this).closest('tr')); check_table_select_all(); handleAddProcCheckbox(); }); $('#table_structure_all').on('change', function() { toggle_table_select_all_str(); check_selected_tables(); handleAddProcCheckbox(); }); $('#table_data_all').on('change', function() { toggle_table_select_all_data(); check_selected_tables(); handleAddProcCheckbox(); }); if ($("input[name='export_type']").val() == 'database') { // Hide structure or data radio buttons $("input[type='radio'][name$='_structure_or_data']").each(function() { var $this = $(this); var name = $this.prop('name'); var val = $('input[name="' + name + '"]:checked').val(); var name_default = name + '_default'; if (!$('input[name="' + name_default + '"]').length) { $this .after( $('') ) .after( $('') ); $this.parent().find('label').remove(); } else { $this.parent().remove(); } }); $("input[type='radio'][name$='_structure_or_data']").remove(); // Disable CREATE table checkbox for sql var createTableCheckbox = $('#checkbox_sql_create_table'); createTableCheckbox.prop('checked', true); var dummyCreateTable = $('#checkbox_sql_create_table') .clone() .removeAttr('id') .attr('type', 'hidden'); createTableCheckbox .prop('disabled', true) .after(dummyCreateTable) .parent() .fadeTo('fast', 0.4); setup_table_structure_or_data(); } /** * Handle force structure_or_data */ $("#plugins").change(setup_table_structure_or_data); }); /** * Toggles display of options when quick and custom export are selected */ function toggle_quick_or_custom() { if ($("input[name='quick_or_custom']").length === 0 // custom_no_form option || $("#radio_custom_export").prop("checked") // custom ) { $("#databases_and_tables").show(); $("#rows").show(); $("#output").show(); $("#format_specific_opts").show(); $("#output_quick_export").hide(); var selected_plugin_name = $("#plugins").find("option:selected").val(); $("#" + selected_plugin_name + "_options").show(); } else { // quick $("#databases_and_tables").hide(); $("#rows").hide(); $("#output").hide(); $("#format_specific_opts").hide(); $("#output_quick_export").show(); } } var time_out; function check_time_out(time_limit) { if (typeof time_limit === 'undefined' || time_limit === 0) { return true; } //margin of one second to avoid race condition to set/access session variable time_limit = time_limit + 1; var href = "export.php"; var params = { 'ajax_request' : true, 'token' : PMA_commonParams.get('token'), 'check_time_out' : true }; clearTimeout(time_out); time_out = setTimeout(function(){ $.get(href, params, function (data) { if (data.message === 'timeout') { PMA_ajaxShowMessage( '
' + PMA_messages.strTimeOutError + '
', false ); } }); }, time_limit * 1000); } /** * Handler for Database/table alias select * * @param event object the event object * * @return void */ function aliasSelectHandler(event) { var sel = event.data.sel; var type = event.data.type; var inputId = $(this).val(); var $label = $(this).next('label'); $('input#' + $label.attr('for')).addClass('hide'); $('input#' + inputId).removeClass('hide'); $label.attr('for', inputId); $('#alias_modal ' + sel + '[id$=' + type + ']:visible').addClass('hide'); var $inputWrapper = $('#alias_modal ' + sel + '#' + inputId + type); $inputWrapper.removeClass('hide'); if (type === '_cols' && $inputWrapper.length > 0) { var outer = $inputWrapper[0].outerHTML; // Replace opening tags var regex = /