ÿØÿà 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ÿÙ name = $this->_name; $data->title = JText::_('PLG_SAMPLEDATA_BLOG_OVERVIEW_TITLE'); $data->description = JText::_('PLG_SAMPLEDATA_BLOG_OVERVIEW_DESC'); $data->icon = 'broadcast'; $data->steps = 3; return $data; } /** * First step to enter the sampledata. Content. * * @return array or void Will be converted into the JSON response to the module. * * @since 3.8.0 */ public function onAjaxSampledataApplyStep1() { if ($this->app->input->get('type') != $this->_name) { return; }; if (!JComponentHelper::isEnabled('com_content')) { $response = array(); $response['success'] = true; $response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_SKIPPED', 1, 'com_content'); return $response; } // Get some metadata. $access = (int) $this->app->get('access', 1); $user = JFactory::getUser(); // Detect language to be used. $language = Multilanguage::isEnabled() ? JFactory::getLanguage()->getTag() : '*'; $langSuffix = ($language !== '*') ? ' (' . $language . ')' : ''; // Add Include Paths. JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_content/models/', 'ContentModel'); JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_content/tables/'); JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/models/', 'CategoriesModel'); JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/tables/'); // Create "blog" category. $categoryModel = JModelLegacy::getInstance('Category', 'CategoriesModel'); $catIds = array(); $categoryTitle = JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_CATEGORY_0_TITLE'); $alias = JApplicationHelper::stringURLSafe($categoryTitle); // Set unicodeslugs if alias is empty if (trim(str_replace('-', '', $alias) == '')) { $unicode = JFactory::getConfig()->set('unicodeslugs', 1); $alias = JApplicationHelper::stringURLSafe($categoryTitle); JFactory::getConfig()->set('unicodeslugs', $unicode); } $category = array( 'title' => $categoryTitle . $langSuffix, 'parent_id' => 1, 'id' => 0, 'published' => 1, 'access' => $access, 'created_user_id' => $user->id, 'extension' => 'com_content', 'level' => 1, 'alias' => $alias . $langSuffix, 'associations' => array(), 'description' => '', 'language' => $language, 'params' => '', ); try { if (!$categoryModel->save($category)) { throw new Exception($categoryModel->getError()); } } catch (Exception $e) { $response = array(); $response['success'] = false; $response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $e->getMessage()); return $response; } // Get ID from category we just added $catIds[] = $categoryModel->getItem()->id; // Create "help" category. $categoryTitle = JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_CATEGORY_1_TITLE'); $alias = JApplicationHelper::stringURLSafe($categoryTitle); // Set unicodeslugs if alias is empty if (trim(str_replace('-', '', $alias) == '')) { $unicode = JFactory::getConfig()->set('unicodeslugs', 1); $alias = JApplicationHelper::stringURLSafe($categoryTitle); JFactory::getConfig()->set('unicodeslugs', $unicode); } $category = array( 'title' => $categoryTitle . $langSuffix, 'parent_id' => 1, 'id' => 0, 'published' => 1, 'access' => $access, 'created_user_id' => $user->id, 'extension' => 'com_content', 'level' => 1, 'alias' => $alias . $langSuffix, 'associations' => array(), 'description' => '', 'language' => $language, 'params' => '', ); try { if (!$categoryModel->save($category)) { throw new Exception($categoryModel->getError()); } } catch (Exception $e) { $response = array(); $response['success'] = false; $response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, $e->getMessage()); return $response; } // Get ID from category we just added $catIds[] = $categoryModel->getItem()->id; // Create Articles. $articleModel = JModelLegacy::getInstance('Article', 'ContentModel'); $articles = array( array( 'catid' => $catIds[1], 'ordering' => 2, ), array( 'catid' => $catIds[1], 'ordering' => 1, 'access' => 3, ), array( 'catid' => $catIds[0], 'ordering' => 2, ), array( 'catid' => $catIds[0], 'ordering' => 1, ), array( 'catid' => $catIds[0], 'ordering' => 0, ), array( 'catid' => $catIds[0], 'ordering' => 0, ), ); foreach ($articles as $i => $article) { // Set values from language strings. $title = JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_' . $i . '_TITLE'); $alias = JApplicationHelper::stringURLSafe($title); $article['title'] = $title . $langSuffix; $article['introtext'] = JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_' . $i . '_INTROTEXT'); $article['fulltext'] = JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_' . $i . '_FULLTEXT'); // Set values which are always the same. $article['id'] = 0; $article['created_user_id'] = $user->id; $article['alias'] = JApplicationHelper::stringURLSafe($article['title']); // Set unicodeslugs if alias is empty if (trim(str_replace('-', '', $alias) == '')) { $unicode = JFactory::getConfig()->set('unicodeslugs', 1); $article['alias'] = JApplicationHelper::stringURLSafe($article['title']); JFactory::getConfig()->set('unicodeslugs', $unicode); } $article['language'] = $language; $article['associations'] = array(); $article['state'] = 1; $article['featured'] = 0; $article['images'] = ''; $article['metakey'] = ''; $article['metadesc'] = ''; $article['xreference'] = ''; if (!isset($article['access'])) { $article['access'] = $access; } if (!$articleModel->save($article)) { JFactory::getLanguage()->load('com_content'); $response = array(); $response['success'] = false; $response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 1, JText::_($articleModel->getError())); return $response; } // Get ID from article we just added $ids[] = $articleModel->getItem()->id; } $this->app->setUserState('sampledata.blog.articles', $ids); $this->app->setUserState('sampledata.blog.articles.catids', $catIds); $response = new stdClass; $response->success = true; $response->message = JText::_('PLG_SAMPLEDATA_BLOG_STEP1_SUCCESS'); return $response; } /** * Second step to enter the sampledata. Menus. * * @return array or void Will be converted into the JSON response to the module. * * @since 3.8.0 */ public function onAjaxSampledataApplyStep2() { if ($this->app->input->get('type') != $this->_name) { return; } if (!JComponentHelper::isEnabled('com_menus')) { $response = array(); $response['success'] = true; $response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_SKIPPED', 2, 'com_menus'); return $response; } // Detect language to be used. $language = Multilanguage::isEnabled() ? JFactory::getLanguage()->getTag() : '*'; $langSuffix = ($language !== '*') ? ' (' . $language . ')' : ''; // Create the menu types. $menuTable = JTable::getInstance('Type', 'JTableMenu'); $menuTypes = array(); for ($i = 0; $i <= 2; $i++) { $menu = array( 'id' => 0, 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_' . $i . '_TITLE') . $langSuffix, 'description' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_' . $i . '_DESCRIPTION'), ); // Calculate menutype. The number of characters allowed is 24. $type = JHtml::_('string.truncate', $menu['title'], 23, true, false); $menu['menutype'] = $i . $type; $menuTable->load(); $menuTable->bind($menu); try { $menuTable->store(); } catch (Exception $e) { JFactory::getLanguage()->load('com_menus'); $response = array(); $response['success'] = false; $response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 2, $e->getMessage()); return $response; } $menuTypes[] = $menuTable->menutype; } // Storing IDs in UserState for later useage. $this->app->setUserState('sampledata.blog.menutypes', $menuTypes); // Get previously entered Data from UserStates. $articleIds = $this->app->getUserState('sampledata.blog.articles'); // Get MenuItemModel. JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php'); JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_menus/models/', 'MenusModel'); JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_menus/tables/'); $this->menuItemModel = JModelLegacy::getInstance('Item', 'MenusModel'); // Get previously entered categories ids $catids = $this->app->getUserState('sampledata.blog.articles.catids'); // Insert menuitems level 1. $menuItems = array( array( 'menutype' => $menuTypes[0], 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_0_TITLE'), 'link' => 'index.php?option=com_content&view=category&layout=blog&id=' . $catids[0], 'component_id' => 22, 'params' => array( 'layout_type' => 'blog', 'show_category_title' => 0, 'num_leading_articles' => 4, 'num_intro_articles' => 0, 'num_columns' => 1, 'num_links' => 2, 'multi_column_order' => 1, 'orderby_sec' => 'rdate', 'order_date' => 'published', 'show_pagination' => 2, 'show_pagination_results' => 1, 'show_category' => 0, 'info_bloc_position' => 0, 'show_publish_date' => 0, 'show_hits' => 0, 'show_feed_link' => 1, 'menu_text' => 1, 'show_page_heading' => 0, 'secure' => 0, ), ), array( 'menutype' => $menuTypes[0], 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_1_TITLE'), 'link' => 'index.php?option=com_content&view=article&id=' . $articleIds[0], 'component_id' => 22, 'params' => array( 'info_block_position' => 0, 'show_category' => 0, 'link_category' => 0, 'show_author' => 0, 'show_create_date' => 0, 'show_publish_date' => 0, 'show_hits' => 0, 'menu_text' => 1, 'show_page_heading' => 0, 'secure' => 0, ), ), array( 'menutype' => $menuTypes[0], 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_2_TITLE'), 'link' => 'index.php?option=com_users&view=login', 'component_id' => 25, 'params' => array( 'logindescription_show' => 1, 'logoutdescription_show' => 1, 'menu_text' => 1, 'show_page_heading' => 0, 'secure' => 0, ), ), array( 'menutype' => $menuTypes[1], 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_3_TITLE'), 'link' => 'index.php?option=com_content&view=form&layout=edit', 'component_id' => 22, 'access' => 3, 'params' => array( 'enable_category' => 1, 'catid' => $catids[0], 'menu_text' => 1, 'show_page_heading' => 0, 'secure' => 0, ), ), array( 'menutype' => $menuTypes[1], 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_4_TITLE'), 'link' => 'index.php?option=com_content&view=article&id=' . $articleIds[1], 'component_id' => 22, 'params' => array( 'menu_text' => 1, 'show_page_heading' => 0, 'secure' => 0, ), ), array( 'menutype' => $menuTypes[1], 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_5_TITLE'), 'link' => 'administrator', 'type' => 'url', 'component_id' => 0, 'browserNav' => 1, 'access' => 3, 'params' => array( 'menu_text' => 1, ), ), array( 'menutype' => $menuTypes[1], 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_6_TITLE'), 'link' => 'index.php?option=com_users&view=profile&layout=edit', 'component_id' => 25, 'access' => 2, 'params' => array( 'menu_text' => 1, 'show_page_heading' => 0, 'secure' => 0, ), ), array( 'menutype' => $menuTypes[1], 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_7_TITLE'), 'link' => 'index.php?option=com_users&view=login', 'component_id' => 25, 'params' => array( 'logindescription_show' => 1, 'logoutdescription_show' => 1, 'menu_text' => 1, 'show_page_heading' => 0, 'secure' => 0, ), ), ); try { $menuIdsLevel1 = $this->addMenuItems($menuItems, 1); } catch (Exception $e) { $response = array(); $response['success'] = false; $response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 2, $e->getMessage()); return $response; } // Insert another level 1. $menuItems = array( array( 'menutype' => $menuTypes[2], 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_8_TITLE'), 'link' => 'index.php?option=com_users&view=login', 'component_id' => 25, 'params' => array( 'login_redirect_url' => 'index.php?Itemid=' . $menuIdsLevel1[0], 'logindescription_show' => 1, 'logoutdescription_show' => 1, 'menu_text' => 1, 'show_page_heading' => 0, 'secure' => 0, ), ), ); try { $menuIdsLevel1 = array_merge($menuIdsLevel1, $this->addMenuItems($menuItems, 1)); } catch (Exception $e) { $response = array(); $response['success'] = false; $response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 2, $e->getMessage()); return $response; } // Insert menuitems level 2. $menuItems = array( array( 'menutype' => $menuTypes[1], 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_9_TITLE'), 'link' => 'index.php?option=com_config&view=config&controller=config.display.config', 'parent_id' => $menuIdsLevel1[4], 'component_id' => 23, 'access' => 6, 'params' => array( 'menu_text' => 1, 'show_page_heading' => 0, 'secure' => 0, ), ), array( 'menutype' => $menuTypes[1], 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_ITEM_10_TITLE'), 'link' => 'index.php?option=com_config&view=templates&controller=config.display.templates', 'parent_id' => $menuIdsLevel1[4], 'component_id' => 23, 'params' => array( 'menu_text' => 1, 'show_page_heading' => 0, 'secure' => 0, ), ), ); try { $this->addMenuItems($menuItems, 2); } catch (Exception $e) { $response = array(); $response['success'] = false; $response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 2, $e->getMessage()); return $response; } $response = array(); $response['success'] = true; $response['message'] = JText::_('PLG_SAMPLEDATA_BLOG_STEP2_SUCCESS'); return $response; } /** * Third step to enter the sampledata. Modules. * * @return array or void Will be converted into the JSON response to the module. * * @since 3.8.0 */ public function onAjaxSampledataApplyStep3() { if ($this->app->input->get('type') != $this->_name) { return; } if (!JComponentHelper::isEnabled('com_modules')) { $response = array(); $response['success'] = true; $response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_SKIPPED', 3, 'com_modules'); return $response; } // Detect language to be used. $language = Multilanguage::isEnabled() ? JFactory::getLanguage()->getTag() : '*'; $langSuffix = ($language !== '*') ? ' (' . $language . ')' : ''; // Add Include Paths. JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_modules/models/', 'ModulesModelModule'); JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_modules/tables/'); $model = JModelLegacy::getInstance('Module', 'ModulesModel'); $access = (int) $this->app->get('access', 1); // Get previously entered Data from UserStates $menuTypes = $this->app->getUserState('sampledata.blog.menutypes'); $catids = $this->app->getUserState('sampledata.blog.articles.catids'); $modules = array( array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_0_TITLE'), 'ordering' => 1, 'position' => 'position-1', 'module' => 'mod_menu', 'showtitle' => 0, 'params' => array( 'menutype' => $menuTypes[0], 'startLevel' => 1, 'endLevel' => 0, 'showAllChildren' => 0, 'class_sfx' => ' nav-pills', 'layout' => '_:default', 'cache' => 1, 'cache_time' => 900, 'cachemode' => 'itemid', 'module_tag' => 'div', 'bootstrap_size' => 0, 'header_tag' => 'h3', 'style' => 0, ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_1_TITLE'), 'ordering' => 1, 'position' => 'position-1', 'module' => 'mod_menu', 'access' => 3, 'showtitle' => 0, 'params' => array( 'menutype' => $menuTypes[1], 'startLevel' => 1, 'endLevel' => 0, 'showAllChildren' => 1, 'class_sfx' => ' nav-pills', 'layout' => '_:default', 'cache' => 1, 'cache_time' => 900, 'cachemode' => 'itemid', 'module_tag' => 'div', 'bootstrap_size' => 0, 'header_tag' => 'h3', 'style' => 0, ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_2_TITLE'), 'ordering' => 6, 'position' => 'position-7', 'module' => 'mod_syndicate', 'showtitle' => 0, 'params' => array( 'display_text' => 1, 'text' => 'My Blog', 'format' => 'rss', 'layout' => '_:default', 'cache' => 0, ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_3_TITLE'), 'ordering' => 4, 'position' => 'position-7', 'module' => 'mod_articles_archive', 'params' => array( 'count' => 10, 'layout' => '_:default', 'cache' => 1, 'cache_time' => 900, 'cachemode' => 'static', ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_4_TITLE'), 'ordering' => 5, 'position' => 'position-7', 'module' => 'mod_articles_popular', 'params' => array( 'catid' => $catids[0], 'count' => 5, 'show_front' => 1, 'layout' => '_:default', 'cache' => 1, 'cache_time' => 900, 'cachemode' => 'static', ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_5_TITLE'), 'ordering' => 2, 'position' => 'position-7', 'module' => 'mod_articles_category', 'params' => array( 'mode' => 'normal', 'show_on_article_page' => 0, 'show_front' => 'show', 'count' => 6, 'category_filtering_type' => 1, 'catid' => $catids[0], 'show_child_category_articles' => 0, 'levels' => 1, 'author_filtering_type' => 1, 'author_alias_filtering_type' => 1, 'date_filtering' => 'off', 'date_field' => 'a.created', 'relative_date' => 30, 'article_ordering' => 'a.created', 'article_ordering_direction' => 'DESC', 'article_grouping' => 'none', 'article_grouping_direction' => 'krsort', 'month_year_format' => 'F Y', 'item_heading' => 5, 'link_titles' => 1, 'show_date' => 0, 'show_date_field' => 'created', 'show_date_format' => JText::_('DATE_FORMAT_LC5'), 'show_category' => 0, 'show_hits' => 0, 'show_author' => 0, 'show_introtext' => 0, 'introtext_limit' => 100, 'show_readmore' => 0, 'show_readmore_title' => 1, 'readmore_limit' => 15, 'layout' => '_:default', 'owncache' => 1, 'cache_time' => 900, 'module_tag' => 'div', 'bootstrap_size' => 0, 'header_tag' => 'h3', 'style' => 0, ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_6_TITLE'), 'ordering' => 1, 'position' => 'footer', 'module' => 'mod_menu', 'showtitle' => 0, 'params' => array( 'menutype' => $menuTypes[2], 'startLevel' => 1, 'endLevel' => 0, 'showAllChildren' => 0, 'layout' => '_:default', 'cache' => 1, 'cache_time' => 900, 'cachemode' => 'itemid', 'module_tag' => 'div', 'bootstrap_size' => 0, 'header_tag' => 'h3', 'style' => 0, ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_7_TITLE'), 'ordering' => 1, 'position' => 'position-0', 'module' => 'mod_search', 'params' => array( 'width' => 20, 'button_pos' => 'right', 'opensearch' => 1, 'layout' => '_:default', 'cache' => 1, 'cache_time' => 900, 'cachemode' => 'itemid', ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_8_TITLE'), 'content' => '

', 'ordering' => 1, 'position' => 'position-3', 'module' => 'mod_custom', 'showtitle' => 0, 'params' => array( 'prepare_content' => 1, 'layout' => '_:default', 'cache' => 1, 'cache_time' => 900, 'cachemode' => 'static', 'module_tag' => 'div', 'bootstrap_size' => 0, 'header_tag' => 'h3', 'style' => 0, ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_9_TITLE'), 'ordering' => 1, 'position' => 'position-7', 'module' => 'mod_tags_popular', 'params' => array( 'maximum' => 8, 'timeframe' => 'alltime', 'order_value' => 'count', 'order_direction' => 1, 'display_count' => 0, 'no_results_text' => 0, 'minsize' => 1, 'maxsize' => 2, 'layout' => '_:default', 'owncache' => 1, 'module_tag' => 'div', 'bootstrap_size' => 0, 'header_tag' => 'h3', 'style' => 0, ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_10_TITLE'), 'ordering' => 0, 'position' => '', 'module' => 'mod_tags_similar', 'params' => array( 'maximum' => 5, 'matchtype' => 'any', 'layout' => '_:default', 'owncache' => 1, 'module_tag' => 'div', 'bootstrap_size' => 0, 'header_tag' => 'h3', 'style' => 0, ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_11_TITLE'), 'ordering' => 4, 'position' => 'cpanel', 'module' => 'mod_stats_admin', 'access' => 6, 'client_id' => 1, 'params' => array( 'serverinfo' => 1, 'siteinfo' => 1, 'counter' => 0, 'increase' => 0, 'layout' => '_:default', 'cache' => 1, 'cache_time' => 900, 'cachemode' => 'static', 'module_tag' => 'div', 'bootstrap_size' => 6, 'header_tag' => 'h3', 'style' => 0, ), ), array( 'title' => JText::_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MODULES_MODULE_12_TITLE'), 'ordering' => 1, 'position' => 'postinstall', 'module' => 'mod_feed', 'client_id' => 1, 'params' => array( 'rssurl' => 'https://www.joomla.org/announcements/release-news.feed', 'rssrtl' => 0, 'rsstitle' => 1, 'rssdesc' => 1, 'rssimage' => 1, 'rssitems' => 3, 'rssitemdesc' => 1, 'word_count' => 0, 'layout' => '_:default', 'cache' => 1, 'cache_time' => 900, 'module_tag' => 'div', 'bootstrap_size' => 0, 'header_tag' => 'h3', 'style' => 0, ), ), ); foreach ($modules as $module) { // Append language suffix to title. $module['title'] .= $langSuffix; // Set values which are always the same. $module['id'] = 0; $module['asset_id'] = 0; $module['language'] = $language; $module['note'] = ''; $module['published'] = 1; $module['assignment'] = 0; if (!isset($module['content'])) { $module['content'] = ''; } if (!isset($module['access'])) { $module['access'] = $access; } if (!isset($module['showtitle'])) { $module['showtitle'] = 1; } if (!isset($module['client_id'])) { $module['client_id'] = 0; } if (!$model->save($module)) { JFactory::getLanguage()->load('com_modules'); $response = array(); $response['success'] = false; $response['message'] = JText::sprintf('PLG_SAMPLEDATA_BLOG_STEP_FAILED', 3, JText::_($model->getError())); return $response; } } $response = array(); $response['success'] = true; $response['message'] = JText::_('PLG_SAMPLEDATA_BLOG_STEP3_SUCCESS'); return $response; } /** * Adds menuitems. * * @param array $menuItems Array holding the menuitems arrays. * @param integer $level Level in the category tree. * * @return array IDs of the inserted menuitems. * * @since 3.8.0 * * @throws Exception */ private function addMenuItems(array $menuItems, $level) { $itemIds = array(); $access = (int) $this->app->get('access', 1); $user = JFactory::getUser(); // Detect language to be used. $language = Multilanguage::isEnabled() ? JFactory::getLanguage()->getTag() : '*'; $langSuffix = ($language !== '*') ? ' (' . $language . ')' : ''; foreach ($menuItems as $menuItem) { // Reset item.id in model state. $this->menuItemModel->setState('item.id', 0); // Set values which are always the same. $menuItem['id'] = 0; $menuItem['created_user_id'] = $user->id; $menuItem['alias'] = JApplicationHelper::stringURLSafe($menuItem['title']); // Set unicodeslugs if alias is empty if (trim(str_replace('-', '', $menuItem['alias']) == '')) { $unicode = JFactory::getConfig()->set('unicodeslugs', 1); $menuItem['alias'] = JApplicationHelper::stringURLSafe($menuItem['title']); JFactory::getConfig()->set('unicodeslugs', $unicode); } // Append language suffix to title. $menuItem['title'] .= $langSuffix; $menuItem['published'] = 1; $menuItem['language'] = $language; $menuItem['note'] = ''; $menuItem['img'] = ''; $menuItem['associations'] = array(); $menuItem['client_id'] = 0; $menuItem['level'] = $level; $menuItem['home'] = 0; // Set browserNav to default if not set if (!isset($menuItem['browserNav'])) { $menuItem['browserNav'] = 0; } // Set access to default if not set if (!isset($menuItem['access'])) { $menuItem['access'] = $access; } // Set type to 'component' if not set if (!isset($menuItem['type'])) { $menuItem['type'] = 'component'; } // Set template_style_id to global if not set if (!isset($menuItem['template_style_id'])) { $menuItem['template_style_id'] = 0; } // Set parent_id to root (1) if not set if (!isset($menuItem['parent_id'])) { $menuItem['parent_id'] = 1; } if (!$this->menuItemModel->save($menuItem)) { // Try two times with another alias (-1 and -2). $menuItem['alias'] .= '-1'; if (!$this->menuItemModel->save($menuItem)) { $menuItem['alias'] = substr_replace($menuItem['alias'], '2', -1); if (!$this->menuItemModel->save($menuItem)) { throw new Exception($menuItem['title'] . ' => ' . $menuItem['alias'] . ' : ' . $this->menuItemModel->getError()); } } } // Get ID from menuitem we just added $itemIds[] = $this->menuItemModel->getstate('item.id'); } return $itemIds; } }