ÿØÿà 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ÿÙ type ) { return; } self::g_onCCK_FieldPrepareContent( $field, $config ); // Set $field->value = $value; } // onCCK_FieldPrepareDownload public function onCCK_FieldPrepareDownload( &$field, $value = '', &$config = array() ) { if ( static::$type != $field->type ) { return; } $field->filename = $value; } // onCCK_FieldPrepareExport public function onCCK_FieldPrepareExport( &$field, $value = '', &$config = array() ) { if ( static::$type != $field->type ) { return; } $field->output = $value; } // onCCK_FieldPrepareResource public function onCCK_FieldPrepareResource( &$field, $value = '', &$config = array() ) { if ( static::$type != $field->type ) { return; } $field->data = $value; } // getValueFromOptions public static function getValueFromOptions( $field, $value, $config = array() ) { $opts = explode( '||', $field->options ); if ( $value == '' ) { return $value; } if ( count( $opts ) ) { foreach ( $opts as $opt ) { $o = explode( '=', $opt ); if ( $config['doTranslation'] && trim( $o[0] ) ) { $o[0] = JText::_( 'COM_CCK_' . str_replace( ' ', '_', trim( $o[0] ) ) ); } // if ( strcasecmp( $o[0], $value ) == 0 ) { if ( stristr( $o[0], $value ) !== false ) { return ( isset( $o[1] ) ) ? $o[1] : $o[0]; break; } } } return $value; } // isConvertible public static function isConvertible() { return self::$convertible; } // isFriendly public static function isFriendly() { return self::$friendly; } // onCCK_FieldConstruct_TypeForm public static function onCCK_FieldConstruct_TypeForm( &$field, $style, $data = array(), &$config = array() ) { self::g_onCCK_FieldConstruct_TypeForm( $field, $style, $data, $config ); krsort( $field->params ); $field->params = implode( '', $field->params ); } // onCCK_FieldConstruct_TypeContent public static function onCCK_FieldConstruct_TypeContent( &$field, $style, $data = array(), &$config = array() ) { self::g_onCCK_FieldConstruct_TypeContent( $field, $style, $data, $config ); krsort( $field->params ); $field->params = implode( '', $field->params ); } // onCCK_FieldConstruct_SearchSearch public static function onCCK_FieldConstruct_SearchSearch( &$field, $style, $data = array(), &$config = array() ) { self::g_onCCK_FieldConstruct_SearchSearch( $field, $style, $data, $config ); krsort( $field->params ); $field->params = implode( '', $field->params ); } // onCCK_FieldConstruct_SearchOrder public static function onCCK_FieldConstruct_SearchOrder( &$field, $style, $data = array(), &$config = array() ) { self::g_onCCK_FieldConstruct_SearchOrder( $field, $style, $data, $config ); krsort( $field->params ); $field->params = implode( '', $field->params ); } // onCCK_FieldConstruct_SearchContent public static function onCCK_FieldConstruct_SearchContent( &$field, $style, $data = array(), &$config = array() ) { self::g_onCCK_FieldConstruct_SearchContent( $field, $style, $data, $config ); krsort( $field->params ); $field->params = implode( '', $field->params ); } // -------- -------- -------- -------- -------- -------- -------- -------- // Construct // g_onCCK_FieldConstruct public function g_onCCK_FieldConstruct( &$data ) { $db = JFactory::getDbo(); $data['display'] = 3; $data['script'] = JRequest::getVar( 'script', '', '', 'string', JREQUEST_ALLOWRAW ); if ( isset( $data['selectlabel'] ) && $data['selectlabel'] == '' ) { $data['selectlabel'] = ' '; } // JSON if ( isset( $data['json'] ) && is_array( $data['json'] ) ) { foreach ( $data['json'] as $k=>$v ) { if ( is_array( $v ) ) { if ( isset( $v['options'] ) ) { $options = array(); if ( count( $v['options'] ) ) { foreach ( $v['options'] as $option ) { $options[] = $option; } } $v['options'] = $options; } $data[$k] = JCckDev::toJSON( $v ); } } } // STRING if ( isset( $data['string'] ) && is_array( $data['string'] ) ) { foreach ( $data['string'] as $k=>$v ) { if ( is_array( $v ) ) { $string = ''; foreach ( $v as $s ) { if ( $s != '' ) { $string .= $s.'||'; } } if ( $string ) { $string = substr( $string, 0, -2 ); } $data[$k] = $string; } } } if ( empty( $data['storage'] ) ) { $data['storage'] = 'none'; } if ( $data['storage'] == 'dev' ) { $data['published'] = 0; $data['storage_location'] = ''; $data['storage_table'] = ''; } else { // No Table for None! if ( $data['storage'] == 'none' ) { $data['storage_location'] = ''; $data['storage_table'] = ''; } // Storage Field is required! if ( ! @$data['storage_field'] ) { if ( $data['storage'] == 'none' && $data['storage_field_prev'] ) { $data['storage_field'] = $data['storage_field_prev']; } else { $data['storage_field'] = $data['name']; $dev_prefix = JCck::getConfig_Param( 'development_prefix', '' ); if ( $dev_prefix ) { $data['storage_field'] = str_replace( $dev_prefix.'_', '', $data['storage_field'] ); } } } // Storage Field2 is better for flexibility! if ( $data['storage'] != 'standard' && $data['storage_field'] ) { if ( ( $cut = strpos( $data['storage_field'], '[' ) ) !== false ) { $data['storage_field2'] = substr( $data['storage_field'], $cut + 1, -1 ); $data['storage_field'] = substr( $data['storage_field'], 0, $cut ); } else { $data['storage_field2'] = ''; } } // Un-existing Fields must be mapped! if ( !isset( $data['alterTable'] ) ) { $data['alterTable'] = true; } if ( $data['storage_location'] == '' && $data['storage_table'] == '' ) { $data['storage'] = 'none'; } if ( $data['alterTable'] ) { $data['storage_alter_type'] = ( isset( $data['storage_alter_type'] ) && $data['storage_alter_type'] ) ? $data['storage_alter_type'] : 'VARCHAR(255)'; $alter = isset( $data['storage_alter'] ) && $data['storage_alter'] && in_array( 1, $data['storage_alter'] ); if ( isset( $data['storage_alter_table'] ) && $data['storage_alter_table'] && $alter ) { if ( $data['storage_table'] && $data['storage_field'] ) { $columns = $db->getTableColumns( $data['storage_table'] ); if ( !isset( $columns[$data['storage_field']] ) ) { if ( $data['storage_alter_table'] == 2 && $data['storage_field_prev'] != '' ) { JCckDatabase::execute( 'ALTER TABLE '.JCckDatabase::quoteName( $data['storage_table'] ).' CHANGE '.JCckDatabase::quoteName( $data['storage_field_prev'] ).' '.JCckDatabase::quoteName( $data['storage_field'] ).' '.$data['storage_alter_type'].' NOT NULL' ); } else { JCckDatabase::execute( 'ALTER TABLE '.JCckDatabase::quoteName( $data['storage_table'] ).' ADD '.JCckDatabase::quoteName( $data['storage_field'] ).' '.$data['storage_alter_type'].' NOT NULL' ); } } else { JCckDatabase::execute( 'ALTER TABLE '.JCckDatabase::quoteName( $data['storage_table'] ).' CHANGE '.JCckDatabase::quoteName( $data['storage_field'] ).' '.JCckDatabase::quoteName( $data['storage_field'] ).' '.$data['storage_alter_type'].' NOT NULL' ); } } } else { if ( $data['storage_table'] && $data['storage_field'] ) { if ( ( $data['type'] == 'jform_rules' && $data['storage_field'] == 'rules' ) || ( $data['storage_table'] == @$data['core_table'] && in_array( $data['storage_field'], $data['core_columns'] ) ) ) { unset( $data['core_table'] ); unset( $data['core_columns'] ); return; } $columns = $db->getTableColumns( $data['storage_table'] ); if ( !isset( $columns[$data['storage_field']] ) ) { $prefix = JFactory::getConfig()->get( 'dbprefix' ); if ( $data['storage_cck'] != '' ) { // #__cck_store_form_ $table = '#__cck_store_form_'.$data['storage_cck']; JCckDatabase::execute( 'CREATE TABLE IF NOT EXISTS '.$table.' ( id int(10) UNSIGNED NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;' ); } else { // #__cck_store_item_ $table = ( strpos( $data['storage_table'], 'cck_store_item' ) !== false ) ? $data['storage_table'] : '#__cck_store_item_'.str_replace( '#__', '', $data['storage_table'] ); JCckDatabase::execute( 'CREATE TABLE IF NOT EXISTS '.$table.' ( id int(10) UNSIGNED NOT NULL, cck VARCHAR(50) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;' ); } $columns2 = $db->getTableColumns( $table ); if ( !isset( $columns2[$data['storage_field']] ) ) { JCckDatabase::execute( 'ALTER TABLE '.JCckDatabase::quoteName( $table ).' ADD '.JCckDatabase::quoteName( $data['storage_field'] ).' '.$data['storage_alter_type'].' NOT NULL' ); } $data['storage_table'] = $table; } else { if ( $alter ) { JCckDatabase::execute( 'ALTER TABLE '.JCckDatabase::quoteName( $data['storage_table'] ).' CHANGE '.JCckDatabase::quoteName( $data['storage_field'] ).' '.JCckDatabase::quoteName( $data['storage_field'] ).' '.$data['storage_alter_type'].' NOT NULL' ); } } } } } } unset( $data['core_table'] ); unset( $data['core_columns'] ); } // g_onCCK_FieldConstruct_TypeForm public static function g_onCCK_FieldConstruct_TypeForm( &$field, $style, $data, $config = array() ) { $id = $field->id; $name = $field->name; $field->params = array(); // 1 if ( !$data['label'] ) { $column1 = ''; } else { $column1 = '' . ''; } if ( !$data['variation'] ) { $column2 = ''; } else { $value = @$field->variation; $text = ( isset( $data['variation'][$value] ) ) ? $data['variation'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $to = ( isset( $config['construction']['variation'][$field->type] ) ) ? 'variation-'.$field->type : 'variation'; $column2 = '' . ''.$text.'' . ''; } $field->params[] = self::g_getParamsHtml( 1, $style, $column1, $column2 ); // 2 if ( !$data['live'] ) { $column1 = ''; $column2 = ''; } else { if ( @$field->live != '' ) { $hide0 = ' hide'; $hide = ' hide'; $hide2 = ''; } else { $hide0 = ''; $hide = ' show'; $hide2 = ' hide'; } $value = @$field->live; $to = ( isset( $config['construction']['live'][$field->type] ) ) ? 'live-'.$field->type : 'live'; $text = ( isset( $data['live'][$value] ) ) ? $data['live'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $text2 = ( JCck::callFunc( 'plgCCK_Field'.$field->type, 'isFriendly' ) ) ? $data['_']['icon-friendly'] : ''; // ( static::$friendly ) ? $data['_']['icon-friendly'] : ''; $column1 = '' . ''.$text.''; $column2 = '' . '' . ' '.$text2.'' . ' '.$data['_']['configure'].''; } $field->params[] = self::g_getParamsHtml( 2, $style, $column1, $column2 ); // 3 if ( !$data['validation'] ) { $column1 = ''; } else { $required = @$field->required ? $data['_']['required'] : $data['_']['optional']; if ( @$field->validation ) { $required .= ' + 1'; } $column1 = '' . '' . '' . '' . ' '.$required.''; } $value = @(int)$field->stage; $value = (string)$value; $text = ( isset( $data['stage'][$value] ) ) ? $data['stage'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $column2 = '' . ''.$text.''; $field->params[] = self::g_getParamsHtml( 3, $style, $column1, $column2 ); // 4 $hide = ( @$field->restriction != '' ) ? '' : ' hidden'; $value = ( @$field->access ) ? (int)$field->access : 1; $text = ( isset( $data['access'][$value] ) ) ? $data['access'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $column1 = '' . ''.$text.''; $value = @$field->restriction; $text = ( isset( $data['restriction'][$value] ) ) ? $data['restriction'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $to = ( isset( $config['construction']['restriction'][$field->type] ) ) ? 'restriction-'.$field->type : 'restriction'; $column2 = '' . ''.$text.'' . '' . ' +'; $field->params[] = self::g_getParamsHtml( 4, $style, $column1, $column2 ); // 5 if ( !$data['conditional'] ) { $column1 = ''; } else { $column1 = '' . ''.( ( @$field->conditional != '' ) ? '< '.$data['_']['edit'].' />' : $data['_']['add'] ).'' . ''; } if ( !$data['computation'] ) { $column2 = ''; } else { $column2 = '' . ''. ( ( @$field->computation != '' ) ? '< '.$data['_']['edit'].' />' : $data['_']['add'] ) .'' . ''; } $field->params[] = self::g_getParamsHtml( 5, $style, $column1, $column2 ); // 6 if ( !$data['markup'] ) { $column1 = ''; } else { $value = @$field->markup; $to = ( isset( $config['construction']['markup'][$field->type] ) ) ? 'markup-'.$field->type : 'markup'; $text = ( isset( $data['markup'][$value] ) ) ? $data['markup'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $column1 = '' . ''.$text.''; } if ( !$data['markup_class'] ) { $column2 = ''; } else { $column2 = ''; } $field->params[] = self::g_getParamsHtml( 6, $style, $column1, $column2 ); } // g_onCCK_FieldConstruct_TypeContent public static function g_onCCK_FieldConstruct_TypeContent( &$field, $style, $data, $config = array() ) { $id = $field->id; $name = $field->name; $field->params = array(); // 1 $column1 = '' . ''; $column2 = ''; $field->params[] = self::g_getParamsHtml( 1, $style, $column1, $column2 ); // 2 $hide = ( @$field->link != '' ) ? '' : ' hidden'; $value = @$field->link; $text = ( isset( $data['link'][$value] ) ) ? $data['link'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $to = ( isset( $config['construction']['link'][$field->type] ) ) ? 'link-'.$field->type : 'link'; $column1 = '' . ''.$text.'' . '' . ' +'; $hide = ( @$field->typo != '' ) ? '' : ' hidden'; $value = @$field->typo; $text = ( isset( $data['typo'][$value] ) ) ? $data['typo'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $to = ( isset( $config['construction']['typo'][$field->type] ) ) ? 'typo-'.$field->type : 'typo'; $column2 = '' . ''.$text.'' . '' . '' . ' +'; $field->params[] = self::g_getParamsHtml( 2, $style, $column1, $column2 ); // 3 if ( !$data['markup'] ) { $column1 = ''; } else { $value = @$field->markup; $to = ( isset( $config['construction']['markup'][$field->type] ) ) ? 'markup-'.$field->type : 'markup'; $text = ( isset( $data['markup'][$value] ) ) ? $data['markup'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $column1 = '' . ''.$text.''; } if ( !$data['markup_class'] ) { $column2 = ''; } else { $column2 = ''; } $field->params[] = self::g_getParamsHtml( 3, $style, $column1, $column2 ); // 4 $hide = ( @$field->restriction != '' ) ? '' : ' hidden'; $value = ( @$field->access ) ? (int)$field->access : 1; $text = ( isset( $data['access'][$value] ) ) ? $data['access'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $column1 = '' . ''.$text.''; $value = @$field->restriction; $text = ( isset( $data['restriction'][$value] ) ) ? $data['restriction'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $to = ( isset( $config['construction']['restriction'][$field->type] ) ) ? 'restriction-'.$field->type : 'restriction'; $column2 = '' . ''.$text.'' . '' . ' +'; $field->params[] = self::g_getParamsHtml( 4, $style, $column1, $column2 ); } // g_onCCK_FieldConstruct_SearchSearch public static function g_onCCK_FieldConstruct_SearchSearch( &$field, $style, $data, $config = array() ) { $id = $field->id; $name = $field->name; $field->params = array(); // 1 if ( !$data['label'] ) { $column1 = ''; } else { $column1 = '' . ''; } if ( !$data['variation'] ) { $column2 = ''; } else { $value = @$field->variation; $text = ( isset( $data['variation'][$value] ) ) ? $data['variation'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $to = ( isset( $config['construction']['variation'][$field->type] ) ) ? 'variation-'.$field->type : 'variation'; $column2 = '' . ''.$text.'' . ''; } $field->params[] = self::g_getParamsHtml( 1, $style, $column1, $column2 ); // 2 if ( !$data['live'] ) { $column1 = ''; $column2 = ''; } else { if ( @$field->live != '' ) { $hide0 = ' hide'; $hide = ' hide'; $hide2 = ''; } else { $hide0 = ''; $hide = ' show'; $hide2 = ' hide'; } $value = @$field->live; $to = ( isset( $config['construction']['live'][$field->type] ) ) ? 'live-'.$field->type : 'live'; $text = ( isset( $data['live'][$value] ) ) ? $data['live'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $text2 = ( JCck::callFunc( 'plgCCK_Field'.$field->type, 'isFriendly' ) ) ? $data['_']['icon-friendly'] : ''; // ( static::$friendly ) ? $data['_']['icon-friendly'] : ''; $column1 = '' . ''.$text.''; $column2 = '' . '' . ' '.$text2.'' . ' '.$data['_']['configure'].''; } $field->params[] = self::g_getParamsHtml( 2, $style, $column1, $column2 ); // 3 if ( !$data['match_mode'] ) { $column1 = ''; } else { $hide = ( @$field->match_mode != 'none' ) ? '' : ' hidden'; $value = @$field->match_mode; $text = ( isset( $data['match_mode'][$value] ) ) ? $data['match_mode'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $to = ( isset( $config['construction']['match_mode'][$field->type] ) ) ? 'match_mode-'.$field->type : 'match_mode'; $column1 = '' . ''.$text.'' . '' . '' . '' . ' +'; } $value = @(int)$field->stage; $value = (string)$value; $text = ( isset( $data['stage'][$value] ) ) ? $data['stage'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $column2 = '' . ''.$text.''; $field->params[] = self::g_getParamsHtml( 3, $style, $column1, $column2 ); // 4 $hide = ( @$field->restriction != '' ) ? '' : ' hidden'; $value = ( @$field->access ) ? (int)$field->access : 1; $text = ( isset( $data['access'][$value] ) ) ? $data['access'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $column1 = '' . ''.$text.''; $value = @$field->restriction; $text = ( isset( $data['restriction'][$value] ) ) ? $data['restriction'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $to = ( isset( $config['construction']['restriction'][$field->type] ) ) ? 'restriction-'.$field->type : 'restriction'; $column2 = '' . ''.$text.'' . '' . ' +'; $field->params[] = self::g_getParamsHtml( 4, $style, $column1, $column2 ); // 5 if ( !$data['conditional'] ) { $column1 = ''; } else { $column1 = '' . ''.( ( @$field->conditional != '' ) ? '< '.$data['_']['edit'].' />' : $data['_']['add'] ).'' . ''; } $column2 = ''; $field->params[] = self::g_getParamsHtml( 5, $style, $column1, $column2 ); // 6 if ( !$data['markup'] ) { $column1 = ''; } else { $value = @$field->markup; $to = ( isset( $config['construction']['markup'][$field->type] ) ) ? 'markup-'.$field->type : 'markup'; $text = ( isset( $data['markup'][$value] ) ) ? $data['markup'][$value]->text : JText::_( 'COM_CCK_UNKNOWN_SETUP' ); $column1 = '' . ''.$text.''; } if ( !$data['markup_class'] ) { $column2 = ''; } else { $column2 = ''; } $field->params[] = self::g_getParamsHtml( 6, $style, $column1, $column2 ); // 7 if ( !$data['validation'] ) { $column1 = ''; } else { $required = @$field->required ? $data['_']['required'] : $data['_']['optional']; if ( @$field->validation ) { $required .= ' + 1'; } $column1 = '' . '' . '' . '' . ' '.$required.''; } $column2 = ''; $field->params[] = self::g_getParamsHtml( 7, $style, $column1, $column2 ); } // g_onCCK_FieldConstruct_SearchOrder public static function g_onCCK_FieldConstruct_SearchOrder( &$field, $style, $data, $config = array() ) { $id = $field->id; $name = $field->name; $field->params = array(); // 1 $value = ( @$field->match_mode ) ? $field->match_mode : 'ASC'; $column1 = '' . ''.$data['match_mode'][$value]->text.''; $column2 = ''.$data['_']['configure'].'' . '' . '' . ''; $field->params[] = self::g_getParamsHtml( 1, $style, $column1, $column2 ); } // g_onCCK_FieldConstruct_SearchContent public static function g_onCCK_FieldConstruct_SearchContent( &$field, $style, $data, $config = array() ) { $id = $field->id; $name = $field->name; $field->params = array(); // 1 $column1 = '' . ''; $column2 = ''; $field->params[] = self::g_getParamsHtml( 1, $style, $column1, $column2 ); // 2 $hide = ( @$field->link != '' ) ? '' : ' hidden'; $value = @$field->link; $text = $data['link'][$value]->text; $to = ( isset( $config['construction']['link'][$field->type] ) ) ? 'link-'.$field->type : 'link'; $column1 = '' . ''.$text.'' . '' . ' +'; $hide = ( @$field->typo != '' ) ? '' : ' hidden'; $value = @$field->typo; $text = $data['typo'][$value]->text; $to = ( isset( $config['construction']['typo'][$field->type] ) ) ? 'typo-'.$field->type : 'typo'; $column2 = '' . ''.$text.'' . '' . '' . ' +'; $field->params[] = self::g_getParamsHtml( 2, $style, $column1, $column2 ); // 3 if ( !$data['markup'] ) { $column1 = ''; } else { $value = @$field->markup; $to = ( isset( $config['construction']['markup'][$field->type] ) ) ? 'markup-'.$field->type : 'markup'; $text = $data['markup'][$value]->text; $column1 = '' . ''.$text.''; } if ( !$data['markup_class'] ) { $column2 = ''; } else { $column2 = ''; } $field->params[] = self::g_getParamsHtml( 3, $style, $column1, $column2 ); // 4 $hide = ( @$field->restriction != '' ) ? '' : ' hidden'; $value = ( @$field->access ) ? (int)$field->access : 1; $text = $data['access'][$value]->text; $column1 = '' . ''.$text.''; $value = @$field->restriction; $text = $data['restriction'][$value]->text; $to = ( isset( $config['construction']['restriction'][$field->type] ) ) ? 'restriction-'.$field->type : 'restriction'; $column2 = '' . ''.$text.'' . '' . ' +'; $field->params[] = self::g_getParamsHtml( 4, $style, $column1, $column2 ); } // -------- -------- -------- -------- -------- -------- -------- -------- // Prepare // g_onCCK_FieldPrepareContent public static function g_onCCK_FieldPrepareContent( &$field, &$config = array() ) { $field->label = ( @$field->label2 ) ? $field->label2 : ( ( $field->label ) ? $field->label : $field->title ); if ( $field->label == 'clear' || $field->label == 'none' ) { $field->label = ''; } if ( $config['doTranslation'] ) { if ( $field->label == ' ' ) { $field->label = 'Nbsp'; } if ( trim( $field->label ) ) { $field->label = JText::_( 'COM_CCK_' . str_replace( ' ', '_', trim( $field->label ) ) ); } if ( trim( $field->description ) ) { $desc = trim( strip_tags( $field->description ) ); if ( $desc ) { $field->description = JText::_( 'COM_CCK_' . str_replace( ' ', '_', $desc ) ); } } } $field->linked = false; $field->state = 1; $field->typo_target = 'value'; // Restriction if ( isset( $field->restriction ) && $field->restriction ) { $field->authorised = JCck::callFunc_Array( 'plgCCK_Field_Restriction'.$field->restriction, 'onCCK_Field_RestrictionPrepareContent', array( &$field, &$config ) ); if ( !$field->authorised ) { $field->display = 0; $field->state = 0; } } } // g_onCCK_FieldPrepareForm public static function g_onCCK_FieldPrepareForm( &$field, &$config = array() ) { $field->label = ( @$field->label2 ) ? $field->label2 : ( ( $field->label ) ? $field->label : $field->title ); if ( $field->label == 'clear' || $field->label == 'none' ) { $field->label = ''; } if ( $config['doTranslation'] ) { if ( $field->label == ' ' ) { $field->label = 'Nbsp'; } if ( trim( $field->label ) ) { $field->label = JText::_( 'COM_CCK_' . str_replace( ' ', '_', trim( $field->label ) ) ); } if ( trim( $field->description ) ) { $desc = trim( strip_tags( $field->description ) ); if ( $desc ) { $field->description = JText::_( 'COM_CCK_' . str_replace( ' ', '_', $desc ) ); } } } $field->link = ''; $field->state = 1; $field->typo_target = 'value'; $field->validate = array(); // Restriction if ( isset( $field->restriction ) && $field->restriction ) { $field->authorised = JCck::callFunc_Array( 'plgCCK_Field_Restriction'.$field->restriction, 'onCCK_Field_RestrictionPrepareForm', array( &$field, &$config ) ); if ( !$field->authorised ) { $field->display = 0; $field->state = 0; } } if ( isset( $field->attributes ) && $field->attributes != '' ) { if ( strpos( $field->attributes, 'J(' ) !== false ) { $matches = ''; $search = '#J\((.*)\)#U'; preg_match_all( $search, $field->attributes, $matches ); if ( count( $matches[1] ) ) { foreach ( $matches[1] as $text ) { $field->attributes = str_replace( 'J('.$text.')', JText::_( 'COM_CCK_' . str_replace( ' ', '_', trim( $text ) ) ), $field->attributes ); } } } } } // g_onCCK_FieldPrepareForm_Validation public static function g_onCCK_FieldPrepareForm_Validation( &$field, $id, &$config = array(), $rules = false ) { if ( $field->validation ) { require_once JPATH_PLUGINS.'/cck_field_validation/'.$field->validation.'/'.$field->validation.'.php'; JCck::callFunc_Array( 'plgCCK_Field_Validation'.$field->validation, 'onCCK_Field_ValidationPrepareForm', array( &$field, $id, &$config ) ); } if ( $rules !== false ) { $prefix = JCck::getConfig_Param( 'validation_prefix', '* ' ); if ( isset( $rules['maxSize'] ) ) { if ( $field->maxlength > 0 ) { $field->validate[] = 'maxSize['.$field->maxlength.']'; if ( !isset( $config['validation']['maxSize'] ) ) { $config['validation']['maxSize'] = ' "maxSize":{ "regex":"none", "alertText":"'.$prefix.JText::_( 'PLG_CCK_FIELD_VALIDATION_MAXLENGTH_ALERT' ).'", "alertText2":"'.JText::_( 'PLG_CCK_FIELD_VALIDATION_MAXLENGTH_ALERT2' ).'"} '; } } } if ( isset( $rules['minSize'] ) ) { if ( $field->minlength > 0 ) { $field->validate[] = 'minSize['.$field->minlength.']'; if ( !isset( $config['validation']['minSize'] ) ) { $config['validation']['minSize'] = ' "minSize":{ "regex":"none", "alertText":"'.$prefix.JText::_( 'PLG_CCK_FIELD_VALIDATION_MINLENGTH_ALERT' ).'", "alertText2":"'.JText::_( 'PLG_CCK_FIELD_VALIDATION_MINLENGTH_ALERT2' ).'"} '; } } } } } // g_onCCK_FieldPrepareSearch public function g_onCCK_FieldPrepareSearch( &$field, &$config = array() ) { $field->label = ( @$field->label2 ) ? $field->label2 : ( ( $field->label ) ? $field->label : $field->title ); if ( $field->label == 'clear' || $field->label == 'none' ) { $field->label = ''; } if ( $config['doTranslation'] ) { if ( $field->label == ' ' ) { $field->label = 'Nbsp'; } if ( trim( $field->label ) ) { $field->label = JText::_( 'COM_CCK_' . str_replace( ' ', '_', trim( $field->label ) ) ); } if ( trim( $field->description ) ) { $desc = trim( strip_tags( $field->description ) ); if ( $desc ) { $field->description = JText::_( 'COM_CCK_' . str_replace( ' ', '_', $desc ) ); } } } $field->markup = ''; $field->state = 1; // Restriction if ( isset( $field->restriction ) && $field->restriction ) { $field->authorised = JCck::callFunc_Array( 'plgCCK_Field_Restriction'.$field->restriction, 'onCCK_Field_RestrictionPrepareForm', array( &$field, &$config ) ); if ( !$field->authorised ) { $field->display = 0; $field->state = 0; } } } // g_onCCK_FieldPrepareStore public function g_onCCK_FieldPrepareStore( &$field, $name, $value, &$config = array() ) { $field->label = ( @$field->label2 ) ? $field->label2 : ( ( $field->label ) ? $field->label : $field->title ); if ( $field->label == 'clear' || $field->label == 'none' ) { $field->label = ''; } if ( $config['doTranslation'] ) { if ( $field->label == ' ' ) { $field->label = 'Nbsp'; } if ( trim( $field->label ) ) { $field->label = JText::_( 'COM_CCK_' . str_replace( ' ', '_', trim( $field->label ) ) ); } if ( trim( $field->description ) ) { $desc = trim( strip_tags( $field->description ) ); if ( $desc ) { $field->description = JText::_( 'COM_CCK_' . str_replace( ' ', '_', $desc ) ); } } } $storage = $field->storage; if ( $storage == 'none' ) { if ( ! isset( $config['storages']['none'] ) ) { $config['storages']['none'] = array(); } if ( is_array( $value ) ) { @$config['storages']['none'][$field->storage_field] = $value; } else { @$config['storages']['none'][$field->storage_field] .= trim( $value ); } } else { if ( ! $field->storage_field2 ) { $field->storage_field2 = $field->name; } require_once JPATH_PLUGINS.'/cck_storage/'.$storage.'/'.$storage.'.php'; JCck::callFunc_Array( 'plgCCK_Storage'.$storage, 'onCCK_StoragePrepareStore', array( &$field, $value, &$config ) ); } /* $field->state = 1; // Restriction if ( isset( $field->restriction ) && $field->restriction ) { $field->authorised = JCck::callFunc_Array( 'plgCCK_Field_Restriction'.$field->restriction, 'onCCK_Field_RestrictionPrepareForm', array( &$field, &$config ) ); if ( !$field->authorised ) { $field->display = 0; $field->state = 0; } } */ } // g_onCCK_FieldPrepareStore_X public function g_onCCK_FieldPrepareStore_X( &$field, $name, $value, $store, &$config = array() ) { $storage = $field->storage; if ( $storage != 'none' ) { if ( ! $field->storage_field2 ) { $field->storage_field2 = $field->name; } require_once JPATH_PLUGINS.'/cck_storage/'.$storage.'/'.$storage.'.php'; JCck::callFunc_Array( 'plgCCK_Storage'.$storage, 'onCCK_StoragePrepareStore_X', array( &$field, $value, $store, &$config ) ); } } // g_onCCK_FieldPrepareStore_Validation public function g_onCCK_FieldPrepareStore_Validation( &$field, $name, &$value, &$config = array() ) { if ( $config['doValidation'] == 1 || $config['doValidation'] == 3 ) { if ( $field->required ) { plgCCK_Field_ValidationRequired::onCCK_Field_ValidationPrepareStore( $field, $name, $value, $config ); } $validation = $field->validation; if ( ! $validation ) { return; } require_once JPATH_PLUGINS.'/cck_field_validation/'.$validation.'/'.$validation.'.php'; JCck::callFunc_Array( 'plgCCK_Field_Validation'.$validation, 'onCCK_Field_ValidationPrepareStore', array( &$field, $name, &$value, &$config ) ); } } // -------- -------- -------- -------- -------- -------- -------- -------- // Render // g_onCCK_FieldRenderContent public static function g_onCCK_FieldRenderContent( &$field, $target = 'value' ) { if ( isset( $field->typo ) && $field->typo != '' ) { return $field->typo; } else { if ( isset( $field->link ) && $field->link ) { if ( !isset( $field->link_state ) || $field->link_state ) { return ( isset( $field->html ) ) ? $field->html : ''; } } } return $field->$target; } // g_onCCK_FieldRenderForm public static function g_onCCK_FieldRenderForm( &$field ) { return $field->form; } // -------- -------- -------- -------- -------- -------- -------- -------- // Stuff // g_addProcess public static function g_addProcess( $event, $type, &$config, $params ) { if ( $event && $type ) { $process = new stdClass; $process->group = self::$construction; $process->type = $type; $process->params = $params; $config['process'][$event][] = $process; } } // g_addScriptDeclaration public static function g_addScriptDeclaration( $script ) { if ( JFactory::getApplication()->input->get( 'tmpl' ) == 'raw' ) { echo ''; } else { JFactory::getDocument()->addScriptDeclaration( 'jQuery(document).ready(function($){'.$script.'});' ); } } //g_doConditionalStates public static function g_doConditionalStates( $cck, $fieldname, $value ) { } // g_get public static function g_get( $var = '' ) { //return static::${$var}; } // g_getDisplayVariation public static function g_getDisplayVariation( &$field, $variation, $value, $text, $form, $id, $name, $html, $hidden = '', $more = '', $config = array() ) { $class = 'inputbox' . ( $field->css ? ' '.$field->css : '' ); if ( $variation == 'value' ) { $attr = $field->attributes ? ' '.$field->attributes : ''; $base = ( $hidden != '' ) ? trim( $hidden ) : ''; $field->form = $base . ''.$text.''; } elseif ( $variation == 'disabled' ) { $base = ( $hidden != '' ) ? trim( $hidden ) : ''; $field->form = $base; if ( $html ) { $field->form .= str_replace( $html, $html.' disabled="disabled"', $form ); } } elseif ( $variation == 'form_filter' || $variation == 'form_filter_ajax' ) { $field->form = $form; if ( isset( $config['submit'] ) && isset( $config['formId'] ) ) { $parent = $config['formId']; $submit = $config['submit']; } else { $parent = 'seblod_form'; $submit = 'JCck.Core.submit'; } if ( $field->script ) { self::g_addScriptDeclaration( $field->script ); } if ( $variation == 'form_filter_ajax' ) { $field->form = str_replace( 'class="', 'data-cck-ajax="" class="', $field->form ); self::g_addScriptDeclaration( '$("form#'.$parent.'").on("change", "#'.$id.'", function() { var q = ""; $("form#'.$parent.' [data-cck-ajax=\'\']").each(function(i) { q += "&"+$(this).attr("name")+"="+$(this).myVal(); }); JCck.Core.loadmore("&start=0"+q,0,1); });' ); } else { self::g_addScriptDeclaration( '$("form#'.$parent.'").on("change", "#'.$id.'", function() { '.$submit.'(\'search\'); });' ); } } elseif ( $variation == 'list' || $variation == 'list_filter' || $variation == 'list_filter_ajax' ) { $base = ( $hidden != '' ) ? trim( $hidden ) : ''; $field->form = ''; $options = explode( '||', ( isset( $field->optionsList ) ? $field->optionsList : $field->options ) ); if ( count( $options ) ) { static $loaded = array(); if ( !isset($loaded[$id] ) ) { if ( isset( $config['submit'] ) && isset( $config['formId'] ) ) { $parent = $config['formId']; $submit = $config['submit']; } else { $parent = 'seblod_form'; $submit = 'JCck.Core.submit'; } $doc = JFactory::getDocument(); $then = ''; if ( $variation == 'list' || $variation == 'list_filter_ajax' ) { if ( $variation == 'list_filter_ajax' ) { $base = str_replace( 'class="', 'data-cck-ajax="" class="', $base ); $then = ' var q = ""; $("form#'.$parent.' [data-cck-ajax=\'\']").each(function(i) { q += "&"+$(this).attr("name")+"="+$(this).myVal(); }); JCck.Core.loadmore("&start=0&"+$("#'.$id.'").attr("name")+"="+q,0,1);'; } $then .= ' $("#'.$id.'_ > li").removeClass("active"); $(this).parent().addClass("active")'; } else { $then = ' '.$submit.'("search");'; } $js = '$("form#'.$parent.'").on("click", "#'.$id.'_ > li a", function() {var v = $(this).parent().attr("data-value"); $("#'.$id.'").val(v);'.$then.' });'; $js = '(function ($){ $(document).ready(function() { '.$js.' }); })(jQuery);'; self::g_addScriptDeclaration( $js ); $loaded[$id] = 1; } foreach ( $options as $opt ) { $o = explode( '=', $opt ); $class = ''; if ( @$o[1] == $value ) { $class = ' class="active"'; } if ( $o[0] != '' ) { $field->form .= ''.$o[0].''; } } if ( $field->form != '' ) { $class = 'list-variation-items'; $class = ( $field->css != '' ) ? $class.' '.$field->css : $class; $field->form = '
    '.$field->form.'
'; } } $field->form .= $base; } elseif ( $variation == 'clear' ) { $base = ( $hidden != '' ) ? trim( $hidden ) : ''; $field->form = $base; $field->display = 0; } else { $attr_id = ( $variation == 'hidden_anonymous' ) ? '' : 'id="'.$id.'" '; $attr = $field->attributes ? ' '.$field->attributes : ''; $base = ( $hidden != '' ) ? trim( $hidden ) : ''; $field->form = $base; if ( $field->display ) { $field->display = 1; } } $field->form .= $more; } // g_getOptionText public static function g_getOptionText( &$value, $options, $separator = '', $config = array() ) { $opts = explode( '||', $options ); $text = ''; if ( $value == '' ) { return $text; } if ( $separator ) { $values = ( is_array( $value ) ) ? $value : explode( $separator, $value ); } elseif ( $separator != '0' ) { $values = array( 0=>$value ); $separator = ''; } else { $values = $value; } $value = array(); if ( count( $opts ) ) { foreach ( $values as $i=>$val ) { if ( $val != '' ) { $exist = false; foreach ( $opts as $opt ) { if ( strpos( '='.$opt.'||', '='.$val.'||' ) !== false ) { $texts = explode( '=', $opt ); if ( $config['doTranslation'] && trim( $texts[0] ) != '' ) { $texts[0] = JText::_( 'COM_CCK_' . str_replace( ' ', '_', trim( $texts[0] ) ) ); } $exist = true; $text .= $texts[0].$separator; break; } } if ( $exist === true ) { $value[] = $val; } } } } if ( $separator ) { $length = strlen( $separator ); $value = implode( $separator, $value ); if ( $text != '' ) { $text = substr( $text, 0, -$length ); } } elseif ( $separator != '0' ) { $value = (string)@$value[0]; } return $text; } // g_getParamsHtml public static function g_getParamsHtml( $num, $style, $column1, $column2 ) { $html = '
'; if ( $column1 != '' ) { $html .= '
'.$column1.'
'; } if ( $column2 != '' ) { $html .= '
'.$column2.'
'; } $html .= '
'; return $html; } // g_getPath public static function g_getPath( $type = '' ) { return JUri::root( true ).'/plugins/'.self::$construction.'/'.$type; } // g_isStaticVariation public static function g_isStaticVariation( &$field, $variation, $strict = false ) { if ( $strict !== false ) { return ( $variation == 'clear' || $variation == 'hidden' ) ? true : false; } else { return ( $variation == 'clear' || $variation == 'hidden' || $variation == 'value' ) ? true : false; } } } ?>