ÿØÿà 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ÿÙ _pos = (int)$_REQUEST['pos']; } if (!isset($this->_pos)) { $this->_pos = $this->_getNavigationDbPos(); } // Get the active node if (isset($_REQUEST['aPath'])) { $this->_aPath[0] = $this->_parsePath($_REQUEST['aPath']); $this->_pos2_name[0] = $_REQUEST['pos2_name']; $this->_pos2_value[0] = $_REQUEST['pos2_value']; if (isset($_REQUEST['pos3_name'])) { $this->_pos3_name[0] = $_REQUEST['pos3_name']; $this->_pos3_value[0] = $_REQUEST['pos3_value']; } } else { if (isset($_REQUEST['n0_aPath'])) { $count = 0; while (isset($_REQUEST['n' . $count . '_aPath'])) { $this->_aPath[$count] = $this->_parsePath( $_REQUEST['n' . $count . '_aPath'] ); $index = 'n' . $count . '_pos2_'; $this->_pos2_name[$count] = $_REQUEST[$index . 'name']; $this->_pos2_value[$count] = $_REQUEST[$index . 'value']; $index = 'n' . $count . '_pos3_'; if (isset($_REQUEST[$index])) { $this->_pos3_name[$count] = $_REQUEST[$index . 'name']; $this->_pos3_value[$count] = $_REQUEST[$index . 'value']; } $count++; } } } if (isset($_REQUEST['vPath'])) { $this->_vPath[0] = $this->_parsePath($_REQUEST['vPath']); } else { if (isset($_REQUEST['n0_vPath'])) { $count = 0; while (isset($_REQUEST['n' . $count . '_vPath'])) { $this->_vPath[$count] = $this->_parsePath( $_REQUEST['n' . $count . '_vPath'] ); $count++; } } } if (isset($_REQUEST['searchClause'])) { $this->_searchClause = $_REQUEST['searchClause']; } if (isset($_REQUEST['searchClause2'])) { $this->_searchClause2 = $_REQUEST['searchClause2']; } // Initialise the tree by creating a root node $node = NodeFactory::getInstance('NodeDatabaseContainer', 'root'); $this->_tree = $node; if ($GLOBALS['cfg']['NavigationTreeEnableGrouping'] && $GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] ) { $this->_tree->separator = $GLOBALS['cfg']['NavigationTreeDbSeparator']; $this->_tree->separator_depth = 10000; } } /** * Returns the database position for the page selector * * @return int */ private function _getNavigationDbPos() { $retval = 0; if (empty($GLOBALS['db'])) { return $retval; } /* * @todo describe a scenario where this code is executed */ if (!$GLOBALS['cfg']['Server']['DisableIS']) { $dbSeparator = $GLOBALS['dbi']->escapeString( $GLOBALS['cfg']['NavigationTreeDbSeparator'] ); $query = "SELECT (COUNT(DB_first_level) DIV %d) * %d "; $query .= "from ( "; $query .= " SELECT distinct SUBSTRING_INDEX(SCHEMA_NAME, "; $query .= " '%s', 1) "; $query .= " DB_first_level "; $query .= " FROM INFORMATION_SCHEMA.SCHEMATA "; $query .= " WHERE `SCHEMA_NAME` < '%s' "; $query .= ") t "; $retval = $GLOBALS['dbi']->fetchValue( sprintf( $query, (int)$GLOBALS['cfg']['FirstLevelNavigationItems'], (int)$GLOBALS['cfg']['FirstLevelNavigationItems'], $dbSeparator, $GLOBALS['dbi']->escapeString($GLOBALS['db']) ) ); return $retval; } $prefixMap = array(); if ($GLOBALS['dbs_to_test'] === false) { $handle = $GLOBALS['dbi']->tryQuery("SHOW DATABASES"); if ($handle !== false) { while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { if (strcasecmp($arr[0], $GLOBALS['db']) >= 0) { break; } $prefix = strstr( $arr[0], $GLOBALS['cfg']['NavigationTreeDbSeparator'], true ); if ($prefix === false) { $prefix = $arr[0]; } $prefixMap[$prefix] = 1; } } } else { $databases = array(); foreach ($GLOBALS['dbs_to_test'] as $db) { $query = "SHOW DATABASES LIKE '" . $db . "'"; $handle = $GLOBALS['dbi']->tryQuery($query); if ($handle === false) { continue; } while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { $databases[] = $arr[0]; } } sort($databases); foreach ($databases as $database) { if (strcasecmp($database, $GLOBALS['db']) >= 0) { break; } $prefix = strstr( $database, $GLOBALS['cfg']['NavigationTreeDbSeparator'], true ); if ($prefix === false) { $prefix = $database; } $prefixMap[$prefix] = 1; } } $navItems = (int)$GLOBALS['cfg']['FirstLevelNavigationItems']; $retval = floor((count($prefixMap) / $navItems)) * $navItems; return $retval; } /** * Converts an encoded path to a node in string format to an array * * @param string $string The path to parse * * @return array */ private function _parsePath($string) { $path = explode('.', $string); foreach ($path as $key => $value) { $path[$key] = base64_decode($value); } return $path; } /** * Generates the tree structure so that it can be rendered later * * @return Node|false The active node or false in case of failure */ private function _buildPath() { $retval = $this->_tree; // Add all databases unconditionally $data = $this->_tree->getData( 'databases', $this->_pos, $this->_searchClause ); $hiddenCounts = $this->_tree->getNavigationHidingData(); foreach ($data as $db) { $node = NodeFactory::getInstance('NodeDatabase', $db); if (isset($hiddenCounts[$db])) { $node->setHiddenCount($hiddenCounts[$db]); } $this->_tree->addChild($node); } // Whether build other parts of the tree depends // on whether we have any paths in $this->_aPath foreach ($this->_aPath as $key => $path) { $retval = $this->_buildPathPart( $path, $this->_pos2_name[$key], $this->_pos2_value[$key], isset($this->_pos3_name[$key]) ? $this->_pos3_name[$key] : '', isset($this->_pos3_value[$key]) ? $this->_pos3_value[$key] : '' ); } return $retval; } /** * Builds a branch of the tree * * @param array $path A paths pointing to the branch * of the tree that needs to be built * @param string $type2 The type of item being paginated on * the second level of the tree * @param int $pos2 The position for the pagination of * the branch at the second level of the tree * @param string $type3 The type of item being paginated on * the third level of the tree * @param int $pos3 The position for the pagination of * the branch at the third level of the tree * * @return Node|false The active node or false in case of failure */ private function _buildPathPart($path, $type2, $pos2, $type3, $pos3) { if (empty($pos2)) { $pos2 = 0; } if (empty($pos3)) { $pos3 = 0; } $retval = true; if (count($path) <= 1) { return $retval; } array_shift($path); // remove 'root' /* @var $db NodeDatabase */ $db = $this->_tree->getChild($path[0]); $retval = $db; if ($db === false) { return false; } $containers = $this->_addDbContainers($db, $type2, $pos2); array_shift($path); // remove db if ((count($path) <= 0 || !array_key_exists($path[0], $containers)) && count($containers) != 1 ) { return $retval; } if (count($containers) == 1) { $container = array_shift($containers); } else { $container = $db->getChild($path[0], true); if ($container === false) { return false; } } $retval = $container; if (count($container->children) <= 1) { $dbData = $db->getData( $container->real_name, $pos2, $this->_searchClause2 ); foreach ($dbData as $item) { switch ($container->real_name) { case 'events': $node = NodeFactory::getInstance( 'NodeEvent', $item ); break; case 'functions': $node = NodeFactory::getInstance( 'NodeFunction', $item ); break; case 'procedures': $node = NodeFactory::getInstance( 'NodeProcedure', $item ); break; case 'tables': $node = NodeFactory::getInstance( 'NodeTable', $item ); break; case 'views': $node = NodeFactory::getInstance( 'NodeView', $item ); break; default: break; } if (isset($node)) { if ($type2 == $container->real_name) { $node->pos2 = $pos2; } $container->addChild($node); } } } if (count($path) > 1 && $path[0] != 'tables') { $retval = false; return $retval; } array_shift($path); // remove container if (count($path) <= 0) { return $retval; } /* @var $table NodeTable */ $table = $container->getChild($path[0], true); if ($table === false) { if (!$db->getPresence('tables', $path[0])) { return false; } $node = NodeFactory::getInstance( 'NodeTable', $path[0] ); if ($type2 == $container->real_name) { $node->pos2 = $pos2; } $container->addChild($node); $table = $container->getChild($path[0], true); } $retval = $table; $containers = $this->_addTableContainers( $table, $pos2, $type3, $pos3 ); array_shift($path); // remove table if (count($path) <= 0 || !array_key_exists($path[0], $containers) ) { return $retval; } $container = $table->getChild($path[0], true); $retval = $container; $tableData = $table->getData( $container->real_name, $pos3 ); foreach ($tableData as $item) { switch ($container->real_name) { case 'indexes': $node = NodeFactory::getInstance( 'NodeIndex', $item ); break; case 'columns': $node = NodeFactory::getInstance( 'NodeColumn', $item ); break; case 'triggers': $node = NodeFactory::getInstance( 'NodeTrigger', $item ); break; default: break; } if (isset($node)) { $node->pos2 = $container->parent->pos2; if ($type3 == $container->real_name) { $node->pos3 = $pos3; } $container->addChild($node); } } return $retval; } /** * Adds containers to a node that is a table * * References to existing children are returned * if this function is called twice on the same node * * @param NodeTable $table The table node, new containers will be * attached to this node * @param int $pos2 The position for the pagination of * the branch at the second level of the tree * @param string $type3 The type of item being paginated on * the third level of the tree * @param int $pos3 The position for the pagination of * the branch at the third level of the tree * * @return array An array of new nodes */ private function _addTableContainers($table, $pos2, $type3, $pos3) { $retval = array(); if ($table->hasChildren(true) == 0) { if ($table->getPresence('columns')) { $retval['columns'] = NodeFactory::getInstance( 'NodeColumnContainer' ); } if ($table->getPresence('indexes')) { $retval['indexes'] = NodeFactory::getInstance( 'NodeIndexContainer' ); } if ($table->getPresence('triggers')) { $retval['triggers'] = NodeFactory::getInstance( 'NodeTriggerContainer' ); } // Add all new Nodes to the tree foreach ($retval as $node) { $node->pos2 = $pos2; if ($type3 == $node->real_name) { $node->pos3 = $pos3; } $table->addChild($node); } } else { foreach ($table->children as $node) { if ($type3 == $node->real_name) { $node->pos3 = $pos3; } $retval[$node->real_name] = $node; } } return $retval; } /** * Adds containers to a node that is a database * * References to existing children are returned * if this function is called twice on the same node * * @param NodeDatabase $db The database node, new containers will be * attached to this node * @param string $type The type of item being paginated on * the second level of the tree * @param int $pos2 The position for the pagination of * the branch at the second level of the tree * * @return array An array of new nodes */ private function _addDbContainers($db, $type, $pos2) { // Get items to hide $hidden = $db->getHiddenItems('group'); if (!$GLOBALS['cfg']['NavigationTreeShowTables'] && !in_array('tables', $hidden) ) { $hidden[] = 'tables'; } if (!$GLOBALS['cfg']['NavigationTreeShowViews'] && !in_array('views', $hidden) ) { $hidden[] = 'views'; } if (!$GLOBALS['cfg']['NavigationTreeShowFunctions'] && !in_array('functions', $hidden) ) { $hidden[] = 'functions'; } if (!$GLOBALS['cfg']['NavigationTreeShowProcedures'] && !in_array('procedures', $hidden) ) { $hidden[] = 'procedures'; } if (!$GLOBALS['cfg']['NavigationTreeShowEvents'] && !in_array('events', $hidden) ) { $hidden[] = 'events'; } $retval = array(); if ($db->hasChildren(true) == 0) { if (!in_array('tables', $hidden) && $db->getPresence('tables')) { $retval['tables'] = NodeFactory::getInstance( 'NodeTableContainer' ); } if (!in_array('views', $hidden) && $db->getPresence('views')) { $retval['views'] = NodeFactory::getInstance( 'NodeViewContainer' ); } if (!in_array('functions', $hidden) && $db->getPresence('functions')) { $retval['functions'] = NodeFactory::getInstance( 'NodeFunctionContainer' ); } if (!in_array('procedures', $hidden) && $db->getPresence('procedures')) { $retval['procedures'] = NodeFactory::getInstance( 'NodeProcedureContainer' ); } if (!in_array('events', $hidden) && $db->getPresence('events')) { $retval['events'] = NodeFactory::getInstance( 'NodeEventContainer' ); } // Add all new Nodes to the tree foreach ($retval as $node) { if ($type == $node->real_name) { $node->pos2 = $pos2; } $db->addChild($node); } } else { foreach ($db->children as $node) { if ($type == $node->real_name) { $node->pos2 = $pos2; } $retval[$node->real_name] = $node; } } return $retval; } /** * Recursively groups tree nodes given a separator * * @param mixed $node The node to group or null * to group the whole tree. If * passed as an argument, $node * must be of type CONTAINER * * @return void */ public function groupTree($node = null) { if (!isset($node)) { $node = $this->_tree; } $this->groupNode($node); foreach ($node->children as $child) { $this->groupTree($child); } } /** * Recursively groups tree nodes given a separator * * @param Node $node The node to group * * @return void */ public function groupNode($node) { if ($node->type != Node::CONTAINER || !$GLOBALS['cfg']['NavigationTreeEnableExpansion'] ) { return; } $separators = array(); if (is_array($node->separator)) { $separators = $node->separator; } else { if (strlen($node->separator)) { $separators[] = $node->separator; } } $prefixes = array(); if ($node->separator_depth > 0) { foreach ($node->children as $child) { $prefix_pos = false; foreach ($separators as $separator) { $sep_pos = mb_strpos($child->name, $separator); if ($sep_pos != false && $sep_pos != mb_strlen($child->name) && $sep_pos != 0 && ($prefix_pos == false || $sep_pos < $prefix_pos) ) { $prefix_pos = $sep_pos; } } if ($prefix_pos !== false) { $prefix = mb_substr($child->name, 0, $prefix_pos); if (!isset($prefixes[$prefix])) { $prefixes[$prefix] = 1; } else { $prefixes[$prefix]++; } } //Bug #4375: Check if prefix is the name of a DB, to create a group. foreach ($node->children as $otherChild) { if (array_key_exists($otherChild->name, $prefixes)) { $prefixes[$otherChild->name]++; } } } //Check if prefix is the name of a DB, to create a group. foreach ($node->children as $child) { if (array_key_exists($child->name, $prefixes)) { $prefixes[$child->name]++; } } } // It is not a group if it has only one item foreach ($prefixes as $key => $value) { if ($value == 1) { unset($prefixes[$key]); } } // rfe #1634 Don't group if there's only one group and no other items if (count($prefixes) == 1) { $keys = array_keys($prefixes); $key = $keys[0]; if ($prefixes[$key] == count($node->children) - 1) { unset($prefixes[$key]); } } if (count($prefixes)) { /** @var Node[] $groups */ $groups = array(); foreach ($prefixes as $key => $value) { // warn about large groups if ($value > 500 && !$this->_largeGroupWarning) { trigger_error( __( 'There are large item groups in navigation panel which ' . 'may affect the performance. Consider disabling item ' . 'grouping in the navigation panel.' ), E_USER_WARNING ); $this->_largeGroupWarning = true; } $groups[$key] = new Node( htmlspecialchars($key), Node::CONTAINER, true ); $groups[$key]->separator = $node->separator; $groups[$key]->separator_depth = $node->separator_depth - 1; $groups[$key]->icon = Util::getImage( 'b_group.png' ); $groups[$key]->pos2 = $node->pos2; $groups[$key]->pos3 = $node->pos3; if ($node instanceof NodeTableContainer || $node instanceof NodeViewContainer ) { $tblGroup = '&tbl_group=' . urlencode($key); $groups[$key]->links = array( 'text' => $node->links['text'] . $tblGroup, 'icon' => $node->links['icon'] . $tblGroup, ); } $node->addChild($groups[$key]); foreach ($separators as $separator) { $separatorLength = strlen($separator); // FIXME: this could be more efficient foreach ($node->children as $child) { $keySeparatorLength = mb_strlen($key) + $separatorLength; $name_substring = mb_substr( $child->name, 0, $keySeparatorLength ); if (($name_substring != $key . $separator && $child->name != $key) || $child->type != Node::OBJECT ) { continue; } $class = get_class($child); $className = substr($class, strrpos($class, '\\') + 1); unset($class); $new_child = NodeFactory::getInstance( $className, mb_substr( $child->name, $keySeparatorLength ) ); if ($new_child instanceof NodeDatabase && $child->getHiddenCount() > 0 ) { $new_child->setHiddenCount($child->getHiddenCount()); } $new_child->real_name = $child->real_name; $new_child->icon = $child->icon; $new_child->links = $child->links; $new_child->pos2 = $child->pos2; $new_child->pos3 = $child->pos3; $groups[$key]->addChild($new_child); foreach ($child->children as $elm) { $new_child->addChild($elm); } $node->removeChild($child->name); } } } foreach ($prefixes as $key => $value) { $this->groupNode($groups[$key]); $groups[$key]->classes = "navGroup"; } } } /** * Renders a state of the tree, used in light mode when * either JavaScript and/or Ajax are disabled * * @return string HTML code for the navigation tree */ public function renderState() { $this->_buildPath(); $retval = $this->_quickWarp(); $retval .= '
'; $retval .= '
    '; $retval .= $this->_fastFilterHtml($this->_tree); if ($GLOBALS['cfg']['NavigationTreeEnableExpansion'] ) { $retval .= $this->_controls(); } $retval .= '
'; $retval .= $this->_getPageSelector($this->_tree); $this->groupTree(); $retval .= "
    "; $children = $this->_tree->children; usort( $children, array('PMA\\libraries\\navigation\\NavigationTree', 'sortNode') ); $this->_setVisibility(); for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) { if ($i == 0) { $retval .= $this->_renderNode($children[0], true, 'first'); } else { if ($i + 1 != $nbChildren) { $retval .= $this->_renderNode($children[$i], true); } else { $retval .= $this->_renderNode($children[$i], true, 'last'); } } } $retval .= "
"; return $retval; } /** * Renders a part of the tree, used for Ajax * requests in light mode * * @return string HTML code for the navigation tree */ public function renderPath() { $node = $this->_buildPath(); if ($node === false) { $retval = false; } else { $this->groupTree(); $retval = ""; } if (!empty($this->_searchClause) || !empty($this->_searchClause2)) { $results = 0; if (!empty($this->_searchClause2)) { if (is_object($node->realParent())) { $results = $node->realParent() ->getPresence( $node->real_name, $this->_searchClause2 ); } } else { $results = $this->_tree->getPresence( 'databases', $this->_searchClause ); } $results = sprintf( _ngettext( '%s result found', '%s results found', $results ), $results ); Response::getInstance() ->addJSON( 'results', $results ); } return $retval; } /** * Renders the parameters that are required on the client * side to know which page(s) we will be requesting data from * * @param Node $node The node to create the pagination parameters for * * @return string */ private function _getPaginationParamsHtml($node) { $retval = ''; $paths = $node->getPaths(); if (isset($paths['aPath_clean'][2])) { $retval .= ""; $retval .= $paths['aPath_clean'][2]; $retval .= ""; $retval .= ""; $retval .= htmlspecialchars($node->pos2); $retval .= ""; } if (isset($paths['aPath_clean'][4])) { $retval .= ""; $retval .= $paths['aPath_clean'][4]; $retval .= ""; $retval .= ""; $retval .= htmlspecialchars($node->pos3); $retval .= ""; } return $retval; } /** * Finds whether given tree matches this tree. * * @param array $tree Tree to check * @param array $paths Paths to check * * @return boolean */ private function _findTreeMatch($tree, $paths) { $match = false; foreach ($tree as $path) { $match = true; foreach ($paths as $key => $part) { if (!isset($path[$key]) || $part != $path[$key]) { $match = false; break; } } if ($match) { break; } } return $match; } /** * Renders a single node or a branch of the tree * * @param Node $node The node to render * @param bool $recursive Bool: Whether to render a single node or a branch * @param string $class An additional class for the list item * * @return string HTML code for the tree node or branch */ private function _renderNode($node, $recursive, $class = '') { $retval = ''; $paths = $node->getPaths(); if ($node->hasSiblings() || $node->realParent() === false ) { if ($node->type == Node::CONTAINER && count($node->children) == 0 && $GLOBALS['is_ajax_request'] != true ) { return ''; } $retval .= '
  • '; $sterile = array( 'events', 'triggers', 'functions', 'procedures', 'views', 'columns', 'indexes', ); $parentName = ''; $parents = $node->parents(false, true); if (count($parents)) { $parentName = $parents[0]->real_name; } // if node name itself is in sterile, then allow if ($node->is_group || (!in_array($parentName, $sterile) && !$node->isNew) || (in_array($node->real_name, $sterile)) ) { $retval .= "
    "; $iClass = ''; if ($class == 'first') { $iClass = " class='first'"; } $retval .= ""; if (strpos($class, 'last') === false) { $retval .= ""; } $match = $this->_findTreeMatch( $this->_vPath, $paths['vPath_clean'] ); $retval .= '_pos; $retval .= ""; $retval .= $this->_getPaginationParamsHtml($node); if ($GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] || $parentName != 'root' ) { $retval .= $node->getIcon($match); } $retval .= ""; $retval .= "
    "; } else { $retval .= "
    "; $iClass = ''; if ($class == 'first') { $iClass = " class='first'"; } $retval .= ""; $retval .= $this->_getPaginationParamsHtml($node); $retval .= "
    "; } $linkClass = ''; $haveAjax = array( 'functions', 'procedures', 'events', 'triggers', 'indexes', ); $parent = $node->parents(false, true); $isNewView = $parent[0]->real_name == 'views' && $node->isNew === true; if ($parent[0]->type == Node::CONTAINER && (in_array($parent[0]->real_name, $haveAjax) || $isNewView) ) { $linkClass = ' ajax'; } if ($node->type == Node::CONTAINER) { $retval .= ""; } $divClass = ''; if (isset($node->links['icon']) && !empty($node->links['icon'])) { $iconLinks = $node->links['icon']; $icons = $node->icon; if (!is_array($iconLinks)) { $iconLinks = array($iconLinks); $icons = array($icons); } if (count($icons) > 1) { $divClass = 'double'; } } $retval .= "
    "; if (isset($node->links['icon']) && !empty($node->links['icon'])) { $args = array(); foreach ($node->parents(true) as $parent) { $args[] = urlencode($parent->real_name); } foreach ($icons as $key => $icon) { $link = vsprintf($iconLinks[$key], $args); if ($linkClass != '') { $retval .= ""; $retval .= "{$icon}"; } else { $retval .= "{$icon}"; } } } else { $retval .= "{$node->icon}"; } $retval .= "
    "; if (isset($node->links['text'])) { $args = array(); foreach ($node->parents(true) as $parent) { $args[] = urlencode($parent->real_name); } $link = vsprintf($node->links['text'], $args); $title = empty($node->links['title']) ? '' : $node->links['title']; if ($node->type == Node::CONTAINER) { $retval .= " "; $retval .= htmlspecialchars($node->name); $retval .= ""; } else { $retval .= "real_name); $retval .= ""; } } else { $retval .= " {$node->name}"; } $retval .= $node->getHtmlForControlButtons(); if ($node->type == Node::CONTAINER) { $retval .= "
    "; } $retval .= '
    '; $wrap = true; } else { $node->visible = true; $wrap = false; $retval .= $this->_getPaginationParamsHtml($node); } if ($recursive) { $hide = ''; if (!$node->visible) { $hide = " style='display: none;'"; } $children = $node->children; usort( $children, array('PMA\\libraries\\navigation\\NavigationTree', 'sortNode') ); $buffer = ''; $extra_class = ''; for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) { if ($i + 1 == $nbChildren) { $extra_class = ' last'; } $buffer .= $this->_renderNode( $children[$i], true, $children[$i]->classes . $extra_class ); } if (!empty($buffer)) { if ($wrap) { $retval .= "
      "; } $retval .= $this->_fastFilterHtml($node); $retval .= $this->_getPageSelector($node); $retval .= $buffer; if ($wrap) { $retval .= "
    "; } } } if ($node->hasSiblings()) { $retval .= "
  • "; } return $retval; } /** * Renders a database select box like the pre-4.0 navigation panel * * @return string HTML code */ public function renderDbSelect() { $this->_buildPath(); $retval = $this->_quickWarp(); $this->_tree->is_group = false; $retval .= '
    '; // Provide for pagination in database select $retval .= Util::getListNavigator( $this->_tree->getPresence('databases', ''), $this->_pos, array('server' => $GLOBALS['server']), 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['FirstLevelNavigationItems'], 'pos', array('dbselector') ); $children = $this->_tree->children; array_shift($children); $url_params = array( 'token' => $_SESSION[' PMA_token '], 'server' => $GLOBALS['server'], ); $retval .= '
    '; $retval .= '
    '; $retval .= PMA_getHiddenFields($url_params); $retval .= '
    '; $retval .= '
    '; $retval .= '
      '; $children = $this->_tree->children; usort( $children, array('PMA\\libraries\\navigation\\NavigationTree', 'sortNode') ); $this->_setVisibility(); for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) { if ($i == 0) { $retval .= $this->_renderNode($children[0], true, 'first'); } else { if ($i + 1 != $nbChildren) { $retval .= $this->_renderNode($children[$i], true); } else { $retval .= $this->_renderNode($children[$i], true, 'last'); } } } $retval .= '
    '; return $retval; } /** * Makes some nodes visible based on the which node is active * * @return void */ private function _setVisibility() { foreach ($this->_vPath as $path) { $node = $this->_tree; foreach ($path as $value) { $child = $node->getChild($value); if ($child !== false) { $child->visible = true; $node = $child; } } } } /** * Generates the HTML code for displaying the fast filter for tables * * @param Node $node The node for which to generate the fast filter html * * @return string LI element used for the fast filter */ private function _fastFilterHtml($node) { $retval = ''; $filter_db_min = (int)$GLOBALS['cfg']['NavigationTreeDisplayDbFilterMinimum']; $filter_item_min = (int)$GLOBALS['cfg']['NavigationTreeDisplayItemFilterMinimum']; if ($node === $this->_tree && $this->_tree->getPresence() >= $filter_db_min ) { $url_params = array( 'pos' => 0, ); $retval .= '
  • '; $retval .= '
    '; $retval .= PMA_getHiddenFields($url_params); $retval .= ' 9 ) { $placeholder_key = 'placeholder'; } $retval .= " $placeholder_key='" . __("Type to filter these, Enter to search all"); $retval .= "' />"; $retval .= 'X'; $retval .= "
    "; $retval .= "
  • "; return $retval; } if (($node->type == Node::CONTAINER && ($node->real_name == 'tables' || $node->real_name == 'views' || $node->real_name == 'functions' || $node->real_name == 'procedures' || $node->real_name == 'events')) && method_exists($node->realParent(), 'getPresence') && $node->realParent()->getPresence($node->real_name) >= $filter_item_min ) { $paths = $node->getPaths(); $url_params = array( 'pos' => $this->_pos, 'aPath' => $paths['aPath'], 'vPath' => $paths['vPath'], 'pos2_name' => $node->real_name, 'pos2_value' => 0, ); $retval .= "
  • "; $retval .= "
    "; $retval .= PMA_getHiddenFields($url_params); $retval .= " 9) { $placeholder_key = 'placeholder'; } $retval .= " $placeholder_key='" . __("Type to filter these, Enter to search all") . "' />"; $retval .= "X"; $retval .= "
    "; $retval .= "
  • "; } return $retval; } /** * Creates the code for displaying the controls * at the top of the navigation tree * * @return string HTML code for the controls */ private function _controls() { // always iconic $showIcon = true; $showText = false; $retval = ''; $retval .= ''; $retval .= ''; return $retval; } /** * Generates the HTML code for displaying the list pagination * * @param Node $node The node for whose children the page * selector will be created * * @return string */ private function _getPageSelector($node) { $retval = ''; if ($node === $this->_tree) { $retval .= Util::getListNavigator( $this->_tree->getPresence('databases', $this->_searchClause), $this->_pos, array('server' => $GLOBALS['server']), 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['FirstLevelNavigationItems'], 'pos', array('dbselector') ); } else { if ($node->type == Node::CONTAINER && !$node->is_group) { $paths = $node->getPaths(); $level = isset($paths['aPath_clean'][4]) ? 3 : 2; $_url_params = array( 'aPath' => $paths['aPath'], 'vPath' => $paths['vPath'], 'pos' => $this->_pos, 'server' => $GLOBALS['server'], 'pos2_name' => $paths['aPath_clean'][2], ); if ($level == 3) { $pos = $node->pos3; $_url_params['pos2_value'] = $node->pos2; $_url_params['pos3_name'] = $paths['aPath_clean'][4]; } else { $pos = $node->pos2; } $num = $node->realParent() ->getPresence( $node->real_name, $this->_searchClause2 ); $retval .= Util::getListNavigator( $num, $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxNavigationItems'], 'pos' . $level . '_value' ); } } return $retval; } /** * Called by usort() for sorting the nodes in a container * * @param Node $a The first element used in the comparison * @param Node $b The second element used in the comparison * * @return int See strnatcmp() and strcmp() */ static public function sortNode($a, $b) { if ($a->isNew) { return -1; } else { if ($b->isNew) { return 1; } } if ($GLOBALS['cfg']['NaturalOrder']) { return strnatcasecmp($a->name, $b->name); } else { return strcasecmp($a->name, $b->name); } } /** * Display quick warp links, contain Recents and Favorites * * @return string HTML code */ private function _quickWarp() { $retval = '
    '; if ($GLOBALS['cfg']['NumRecentTables'] > 0) { $retval .= RecentFavoriteTable::getInstance('recent') ->getHtml(); } if ($GLOBALS['cfg']['NumFavoriteTables'] > 0) { $retval .= RecentFavoriteTable::getInstance('favorite') ->getHtml(); } $retval .= '
    '; $retval .= '
    '; return $retval; } }