....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 195.3.193.30  /  Your IP : 216.73.216.125
Web Server : Apache
System : Linux server3 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User : web032 ( 1035)
PHP Version : 7.3.33
Disable Function : show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, disk_total_space, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/web032/htdocs/cms/components/com_rialto/views/entry/tmpl/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/web032/htdocs/cms/components/com_rialto/views/entry/tmpl/default.php
<?php
/**
 *
 * Rialto - Classified Ads for Joomla!
 *
 * @Version       $Id: default.php 2306 2016-06-13 13:24:56Z geoffc $
 * @Package       Rialto
 * @Subpackage    com_rialto
 * @Release       1.3.0
 * @Copyright     Copyright (C) 2015-2016 Macrotone Consulting Ltd. All rights reserved.
 * @License       GNU General Public License version 3 or later; see LICENSE.txt
 * @Contact       support@macrotoneconsulting.co.uk
 * @Lastrevision  $Date: 2016-06-13 14:24:56 +0100 (Mon, 13 Jun 2016) $
 *
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

JHTML::stylesheet('com_rialto/rialto.css', array(), true);
JHTML::_('behavior.formvalidation');

require_once(JPATH_COMPONENT.DS.'classes/user.php');
$app = JFactory::getApplication();
$data = $this->data;

?>

<div class="macrotone">

<?php
echo "<script type='text/javascript'>";
   echo "function confirmdelete() { ";
      echo "return confirm('" . JText::_( 'COM_RIALTO_CONFIRM_DELETE' ) . "');";
   echo "}";
   echo "function myValidate(f) {";
        echo "if (document.formvalidator.isValid(f)) {";
                echo "f.task.value='Apply';";
               echo "f.submit(); ";
        echo "}";
        echo "else {";
                echo "alert('" . JText::_( 'COM_RIALTO_ENTRY_FORM_ERROR' ) . "');";
            echo "return false;";
         echo "}";
        echo "return false;";
   echo "}";
echo "</script>";

$user = JFactory::getUser();
$logUser = new RialtoUser( $user->id);

// set page title and description
$document = JFactory::getDocument();
$title = $document->getTitle();
$siteName = $app->get('sitename');

switch ( $this->task) {
   case "new":
   case "create":
   case "create1":
   case "create2":
   case "create3": {
      $title = JText::_( 'COM_RIALTO_NEW_ENTRY' );
      break;
   }
   default: {
      $title = $data->title . " - " . $data->cat_name;
      break;
   }
}

$document->setTitle( $title);
if ( !empty($data)) {
   $document->setDescription( $data->title . ". " . $data->description );
}
$cHelper = new RialtoFrontendHelper();

// get parameters
$params = JComponentHelper::getParams('com_rialto');
$_commercialEntries = $params->get('commercialEntries', '0'); // 0 no, 1 yes
$showbreadcrumbs  = $params->get('showBreadcrumbs', 0);

$input   = JFactory::getApplication()->input;
$catid   = $input->getInt( 'categoryselectbox', 0);
$language = $input->get( 'languageselectbox');

if ( $catid == 0) {
   if ( !empty($data)) {
      $catid = $data->category_id;
   } else {
      $catid = 1;
   }
}

if ( empty($language) ) $language = '*';

// get user fields

$_use_firstname = $cHelper->getCategoryUseFirstnameById( $catid);
if ( $_use_firstname == 2) { // global
   $_use_firstname = $params->get('useFirstname', '1'); // 0 no, 1 yes
}

$_use_lastname = $cHelper->getCategoryUseLastnameById( $catid);
if ( $_use_lastname == 2) { // global
   $_use_lastname = $params->get('useLastname', '1'); // 0 no, 1 yes
}

$_use_company = $cHelper->getCategoryUseCompanyById( $catid);
if ( $_use_company == 2) { // global
   $_use_company = $params->get('useCompany', '1'); // 0 no, 1 yes
}

$_use_street = $cHelper->getCategoryUseStreetById( $catid);
if ( $_use_street == 2) { // global
   $_use_street = $params->get('useStreet', '1'); // 0 no, 1 yes
}

$_use_zip = $cHelper->getCategoryUseZipById( $catid);
if ( $_use_zip == 2) { // global
   $_use_zip = $params->get('useZip', '1'); // 0 no, 1 yes
}

$_use_city = $cHelper->getCategoryUseCityById( $catid);
if ( $_use_city == 2) { // global
   $_use_city = $params->get('useCity', '1'); // 0 no, 1 yes
}

$_use_state = $cHelper->getCategoryUseStateById( $catid);
if ( $_use_state == 2) { // global
   $_use_state = $params->get('useState', '1'); // 0 no, 1 yes
}

$_use_country = $cHelper->getCategoryUseCountryById( $catid);
if ( $_use_country == 2) { // global
   $_use_country = $params->get('useCountry', '1'); // 0 no, 1 yes
}

$_use_phone = $cHelper->getCategoryUsePhoneById( $catid);
if ( $_use_phone == 2) { // global
   $_use_phone = $params->get('usePhone', '1'); // 0 no, 1 yes
}

$_use_mobile = $cHelper->getCategoryUseMobileById( $catid);
if ( $_use_mobile == 2) { // global
   $_use_mobile = $params->get('useMobile', '1'); // 0 no, 1 yes
}

$_use_email = $cHelper->getCategoryUseEmailById( $catid);
if ( $_use_email == 2) { // global
   $_use_email = $params->get('useEmail', '1'); // 0 no, 1 yes
}

$_use_web = $cHelper->getCategoryUseWebById( $catid);
if ( $_use_web == 2) { // global
   $_use_web = $params->get('useWeb', '1'); // 0 no, 1 yes
}

$_use_condition = $cHelper->getCategoryUseConditionById( $catid);
if ( $_use_condition == 2) { // global
   $_use_condition = $params->get('useCondition', '1'); // 0 no, 1 yes
}

$_use_price = $cHelper->getCategoryUsePriceById( $catid);
if ( $_use_price == 2) { // global
   $_use_price = $params->get('usePrice', '1'); // 0 no, 1 yes
}

$images = $params->get('images', '3'); // 3 default
$videos = $params->get('videos', '0'); // 0 default
// $rel    = $params->get('rel', '0');


$_imagesDisplayMode           = $params->get('imagesDisplayMode', '0'); // 0 Browser, 1 Slimbox, 2 RokBox
$_includeMootoolsJS           = $params->get('includeMootoolsJS', '0'); // 0 no, 1 yes
$_includeJQueryJS             = $params->get('includeJQueryJS', '0'); // 0 no, 1 yes
$_includeSlimboxJS            = $params->get('includeSlimboxJS', '0');  // 0 no, 1 yes
$_showContactDetailsToPublic  = $params->get('showContactDetailsToPublic', '0');  // 0 no, 1 yes

if ( $_imagesDisplayMode == 1) { // Slimbox
   $assets = JURI::root() . "media/com_rialto";
   if ($_includeMootoolsJS) {
      $document->addStyleSheet($assets . '/css/slimbox.css');
   } else {
      $document->addStyleSheet($assets . '/css/slimbox2.css');
   }
}

// website root directory
$_root = JURI::root();?>

<?php
   if ( $this->task == "") { // don't include when creating a new entry
?>

<?php
   if ( $_includeMootoolsJS == 1) { // include Mootools JS
      echo "<script type=\"text/javascript\" src=\"" . $assets . "/js/mootools.js\"></script>";
      if ( $_includeSlimboxJS == 1) { // include Slimbox JS
         echo "<script type=\"text/javascript\" src=\"" . $assets . "/js/slimbox.js\"></script>";
      }
   }
   if ( $_includeJQueryJS == 1) { // include JQuery JS
      if(JFactory::getApplication()->get('jquery') !== true) {
         $jquery_cdn = $this->params->get( 'jquery_cdn_link', 'http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js');
         $document->addScript($jquery_cdn);
         // $document->addScriptDeclaration('jQuery.noConflict()');
         JFactory::getApplication()->set('jquery', true);
      }
      if ( $_includeSlimboxJS == 1) { // include Slimbox JS
         echo "<script type=\"text/javascript\" src=\"" . $assets . "/js/slimbox2.js\"></script>";
         // $document->addScript($jquery_cdn);
      }
   }
?>

   <!-- Javascript functions -->
   <script type="text/javascript">
       function callURL(obj) {
         var $catid  = obj.options[obj.selectedIndex].value;
         // var length  = slugsarray.length;
         for(var k=0; k < slugsarray.length; k++) {
            // if selected index found jump to category
            if ( slugsarray[k][0] == $catid) {
                  location.href = slugsarray[k][1];
            }
         }
       }
   </script>
   <!-- Javascript functions -->
<?php } ?>

<?php if ( $this->params->def( 'show_page_title', 1 ) ) : ?>
   <div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
      <?php echo $this->escape($this->params->get('page_title')); ?>
   </div>
<?php endif; ?>

<?php if ( $this->task == "") { // don't display header stuff when creating a new entry
   ?>

   <!-- HTML Box Top -->
   <?php
   $htmlBoxEntryTop = $params->get('htmlBoxEntryTop', '');

   if ( $htmlBoxEntryTop != "") {
      echo "<div class='rialtoHtmlBoxEntryTop'>";
         echo $htmlBoxEntryTop;
      echo "</div>";
   }
   ?>
   <!-- HTML Box Top -->

   <?php include( JPATH_COMPONENT.DS.'includes/topmenu.php'); ?>

   <!-- Category icon, name and description -->
   <table width="100%" class="noborder" style="margin-bottom:10px;">
      <tr>
         <!-- category image -->
         <td width="50" class="noborder">
            <?php
            if ( $data->cat_image == "") {  // show default category image
               echo "<img src='". $_root ."media/com_rialto/images/folder.png' style='border:0px;margin:5px;' />";
            } else {
               echo "<img src='" . $_root.$data->cat_image."' style='border:0px;margin:5px;' />";
            }
             ?>
         </td>
         <!-- category image -->

         <!-- category name and description -->
         <td align="left" class="noborder">
            <?php
            echo "<h2 style='padding: 0; margin: 0 0 5px 0;'>";
            echo $data->cat_name;
            echo "</h2>";
            echo $data->cat_description;
            if ($params->get('show_tags', 1) && !empty($this->categorytags)) :
               echo "<br style='clear:left;'>";
               $this->categorytags->tagLayout = new JLayoutFile('joomla.content.tags');
               echo $this->categorytags->tagLayout->render($this->categorytags->itemTags);
            endif;
            ?>
         </td>
         <!-- category name and description -->

         <!-- category quick select box -->
         <td align="right" class="noborder">
            <?php echo $cHelper->getQuickJumpSelectBox( $data->cat_id); ?>
         </td>
         <!-- category quick select box -->
      </tr>
   </table>
   <!-- Category icon, name and description -->

   <!-- Breadcrumb -->
   <?php echo $this->loadTemplate('breadcrumb');

}

$input = JFactory::getApplication()->input;
$_task = $this->task;

if ( $_commercialEntries == 0) { // only private entries
    $iSteps=3;
} else { // commercial entries allowed
    $iSteps=4;
}

if ( $_commercialEntries == 0 && $_task == "create") { // only private entries
    $_task = "create1"; // skip private/commercial choice
}

switch ( $_task) {
   // wizard step 0, choose either private or commercial
   case "create": {
      if ( $_commercialEntries == 0) { // only private entries
         $iStep=0;
      } else { // commercial entries allowed
         $iStep=1;
         echo JText::_( 'COM_RIALTO_RIALTO_RULES' );
      }

      echo "<br /><br /><h2>";
        echo JText::_( 'COM_RIALTO_STEP' )  . " " . $iStep . " / " . $iSteps ;
      echo "</h2>";

      echo "<div class='rialtoEntryForm'>";
         echo "<form action='' method='post' name='entryform' id='entryform' >";
            echo "<table cellspacing='1' cellpadding='0' width='100%' class='noborder'>";
               // private / commercial checkbox
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;'>";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_PRIVATE_COMMERCIAL' ) . ":</div> ";
                        echo "<div class='rialtoCategory'>";
                           echo "<input type='radio' name='flag_commercial' value='0' checked> " . JText::_( 'COM_RIALTO_PRIVATE');
                           echo "&nbsp;&nbsp;&nbsp;";
                           echo "<input type='radio' name='flag_commercial' value='1'> " . JText::_( 'COM_RIALTO_COMMERCIAL');
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_PRIVATE_COMMERCIAL_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               // button
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;'>";
                     echo "<div class='rialtoButton'>";
                        echo "<input type='hidden' name='task' value='create1'>";
                        echo "<input class='rialtoButton' type='submit' name='submit' value='" . JText::_( 'COM_RIALTO_CONTINUE' ) . "'>";
                        echo " " . JText::_( 'COM_RIALTO_OR' ) . " ";
                        $menuLinkHome      = JRoute::_( 'index.php?option=com_rialto');
                        echo "<a href='$menuLinkHome'>" . JText::_( 'JCANCEL' ) . "</a>";
                     echo "</div> ";
                  echo "</td>";
               echo "</tr>";
            echo "</table>";
         echo "</form>";
      echo "</div>";
      break;
   }
   // wizard step 0, choose either private or commercial

   // wizard step 1
   case "create1": {
      if ( $_commercialEntries == 0) { // only private entries
         $iStep=1;
         echo JText::_( 'COM_RIALTO_RIALTO_RULES' );
      } else { // commercial entries allowed
        $iStep=2;
      }

      echo "<br />";
      echo "<br />";
      echo "<h2>";
        echo JText::_( 'COM_RIALTO_STEP' )  . " " . $iStep . " / " . $iSteps ;
      echo "</h2>";

      $flag_commercial = $input->getInt( 'flag_commercial', 0);

      echo "<div class='rialtoEntryForm'>";
         echo "<form action='' method='post' name='entryform' id='entryform' >";
            echo "<table cellspacing='1' cellpadding='0' width='100%' class='noborder'>";
               // Category select box
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_CATEGORY' ) . ":</div> ";
                        echo "<div class='rialtoCategory'>";
                        echo $cHelper->getCategorySelectBox(0); // 0 nothing selected
                     echo "</div>";
                     echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_CATEGORY_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               if ( JLanguageMultilang::isEnabled() && $input->get( 'show_lang', 0) ) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_LANGUAGE' ) . ":</div> ";
                           echo "<div class='rialtoCategory'>";
                           echo $cHelper->getLanguageSelectBox(0); // 0 nothing selected
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_LANGUAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // button
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoButton'>";
                        echo "<input type='hidden' name='flag_commercial' value='" . $flag_commercial . "'>";
                        echo "<input type='hidden' name='task' value='create2'>";
                        echo "<input class='rialtoButton' type='submit' name='submit' value='" . JText::_( 'COM_RIALTO_CONTINUE' ) . "'>";

                        echo " " . JText::_( 'COM_RIALTO_OR' ) . " ";
                        $menuLinkHome      = JRoute::_( 'index.php?option=com_rialto');
                        echo "<a href='$menuLinkHome'>" . JText::_( 'JCANCEL' ) . "</a>";

                     echo "</div> ";
                  echo "</td>";
               echo "</tr>";
            echo "</table>";
         echo "</form>";
      echo "</div>";
      break;
   }
   // wizard step 1

   // wizard step 2
   case "create2": {
      if ( $_commercialEntries == 0) { // only private entries
         $iStep=2;
      } else { // commercial entries allowed
         $iStep=3;
      }

      echo "<br />";
      echo "<br />";
      echo "<h2>";
        echo JText::_( 'COM_RIALTO_STEP' )  . " " . $iStep . " / " . $iSteps ;
      echo "</h2>";

      $flag_commercial  = $input->getInt( 'flag_commercial', 0);
      $category_id      = $input->getInt( 'categoryselectbox', 0);
      // $language         = $input->get( 'languageselectbox');
      $language         = $input->get( 'filter_language');

      // Modify category selected if language changed.
      if ( JLanguageMultilang::isEnabled() ) {
         if ( JFactory::getLanguage()->getTag() != $language ) {
            $category_id = $cHelper->updateCategoryID($category_id, $language);
         }
      }

      echo "<div class='rialtoEntryForm'>";
         echo "<form action='' method='post' name='entryform' id='entryform' >";
            echo "<table cellspacing='1' cellpadding='0' width='100%' class='noborder'>";

               // contact data
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 10px 5px 0 5px;' >";
                     echo "<h3>" . JText::_( 'COM_RIALTO_CONTACT_DATA' ) . "</h3>";
                  echo "</td>";
               echo "</tr>";

               // firstname
               if ( $_use_firstname == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_FIRST_NAME' ) . ":</div> ";
                           echo "<div class='rialtoFirstname'>";
                              echo "<input type='text' name='firstname' id='firstname' size='50' maxlength='250' value='" . $logUser->getFirstname() . "' >";
                           echo "</div>";

                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_FIRST_NAME_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // lastname
               if ( $_use_lastname == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_LAST_NAME' ) . ":</div> ";
                           echo "<div class='rialtoLastname'>";
                              echo "<input type='text' name='lastname' id='lastname' size='50' maxlength='250' value='" . $logUser->getLastname() . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_LAST_NAME_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // company
               if ( $_use_company == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_COMPANY' ) . ":</div> ";
                           echo "<div class='rialtoLastname'>";
                              echo "<input type='text' name='company' id='company' size='50' maxlength='250' value='" . $logUser->getCompany() . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_COMPANY_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // street
               if ( $_use_street == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_STREET' ) . ":</div> ";
                           echo "<div class='rialtoStreet'>";
                              echo "<input type='text' name='street' id='street' size='50' maxlength='250' value='" . $logUser->getStreet() . "'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_STREET_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // zip
               if ( $_use_zip == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_ZIP' ) . ":</div> ";
                           echo "<div class='rialtoZip'>";
                              echo "<input type='text' name='zip' id='zip' size='50' maxlength='250' value='" . $logUser->getZip() . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_ZIP_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // city
               if ( $_use_city == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_CITY' ) . ":</div> ";
                           echo "<div class='rialtoCity'>";
                              echo "<input type='text' name='city' id='city' size='50' maxlength='250' value='" . $logUser->getCity() . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_CITY_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // state
               if ( $_use_state == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_STATE' ) . ":</div> ";
                           echo "<div class='rialtoState'>";
                              echo "<input type='text' name='state' id='state' size='50' maxlength='250' value='" . $logUser->getStateName() . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_STATE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // country
               if ( $_use_country == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_COUNTRY' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='country' id='country' size='50' maxlength='250' value='" . $logUser->getCountry() . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_COUNTRY_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // phone
               if ( $_use_phone == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_PHONE' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='phone' id='phone' size='50' maxlength='250' value='" . $logUser->getPhone() . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_PHONE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // mobile
               if ( $_use_mobile == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_MOBILE' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='mobile' id='mobile' size='50' maxlength='250' value='" . $logUser->getMobile() . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_MOBILE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // email
               if ( $_use_email == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'JGLOBAL_EMAIL' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='email' id='email' size='50' maxlength='250' class='validate-email' value='" . $logUser->getEmail() . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_EMAIL_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // web
               if ( $_use_web == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_WEB' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='web' id='web' size='50' maxlength='250' value='" . $logUser->getWebsite() . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_WEB_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // button
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoButton'>";
                        echo "<input type='hidden' name='flag_commercial' value='" . $flag_commercial . "'>";
                        echo "<input type='hidden' name='categoryselectbox' value='" . $category_id . "'>";
                        echo "<input type='hidden' name='languageselectbox' value='" . $language . "'>";
                        echo "<input type='hidden' name='task' value='create3'>";
                        echo "<input class='rialtoButton' type='submit' name='submit' value='" . JText::_( 'COM_RIALTO_CONTINUE' ) . "'>";
                        echo " " . JText::_( 'COM_RIALTO_OR' ) . " ";
                        $menuLinkHome      = JRoute::_( 'index.php?option=com_rialto');
                        echo "<a href='$menuLinkHome'>" . JText::_( 'JCANCEL' ) . "</a>";
                     echo "</div> ";
                  echo "</td>";
               echo "</tr>";
            echo "</table>";
          echo "</form>";

      echo "</div>";
      break;
   }
   // wizard step 2

   // wizard step 3
   case "create3": {
      if ( $_commercialEntries == 0) { // only private entries
         $iStep=3;
      } else { // commercial entries allowed
         $iStep=4;
      }

      echo "<br />";
      echo "<br />";
      echo "<h2>".JText::_( 'COM_RIALTO_STEP' )  . " " . $iStep . " / " . $iSteps."</h2>";

      $flag_commercial = $input->getInt( 'flag_commercial', 0);
      // get category from step 1
      $category_id   = $input->getInt( 'categoryselectbox', 0);
      $language      = $input->get( 'languageselectbox');

      // get contact data from step 2
      $firstname  = $input->getString( 'firstname', '', 'POST');
      $lastname   = $input->getString( 'lastname', '', 'POST');
      $company    = $input->getString( 'company', '', 'POST');
      $street     = $input->getString( 'street', '', 'POST');
      $zip        = $input->getString( 'zip', '', 'POST');
      $city       = $input->getString( 'city', '', 'POST');
      $state      = $input->getString( 'state', '', 'POST');
      $country    = $input->getString( 'country', '', 'POST');
      $phone      = $input->getString( 'phone', '', 'POST');
      $mobile     = $input->getString( 'mobile', '', 'POST');
      $email      = $input->getString( 'email', '', 'POST');
      $web        = $input->getString( 'web', '', 'POST');

      echo "<div class='rialtoEntryForm'>";
         echo "<form action='' method='post' name='entryform' id='entryform' enctype='multipart/form-data' class='form-validate' onSubmit='return myValidate(this);'>";
            echo "<table cellspacing='1' cellpadding='0' width='100%' class='noborder'>";
               // entry data
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 10px 5px 0 5px;' >";
                     echo "<h3>" . JText::_( 'COM_RIALTO_ENTRY_DATA' ) . "</h3>";
                  echo "</td>";
               echo "</tr>";

               // label  TODO Change for language selected.
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_LABEL' ) . ":</div> ";
                        echo "<div class='rialtoType'>";
                           echo $cHelper->getLabelSelectBox(0, $language); // 0 nothing selected
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_LABEL_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               // title
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_HEADLINE' ) . ":</div> ";
                        echo "<div class='rialtoHeadline'>";
                           echo "<input type='text' name='entryHeadline' id='entryHeadline' size='50' maxlength='250' class='required'>";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_HEADLINE_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               // text
               echo "<tr>";
                  echo "<td class='noborder' align='left' valign='top' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_TEXT' ) . ":</div> ";
                     echo "<div class='rialtoText'>";
                        echo "<textarea name='entryText' cols='80' rows='10' wrap='VIRTUAL' id='entryText' class='required'>";
                        echo "</textarea>";
                     echo "</div>";
                     echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_TEXT_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               // condition
               if ( $_use_condition == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_CONDITION' ) . ":</div> ";
                           echo "<div class='rialtoCondition'>";
                              echo "<input type='text' name='condition' id='condition' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_CONDITION_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // price
               if ( $_use_price == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_PRICE' ) . ":</div> ";
                           echo "<div class='rialtoPrice'>";
                              echo "<input type='text' name='price' id='price' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_PRICE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // Tags  This is a temporary kludge until we change over completely to JForm.
               if ($this->params->get('show_tags', 1) ) :
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<br style='clear:left;'>";
                        require_once( JPATH_COMPONENT.DIRECTORY_SEPARATOR.'models'.DS.'entryform.php');
                        $efmodel = new RialtoModelEntryform();
                        $this->eform = $efmodel->getForm();
                        echo '<div class="control-group">';
                           echo '<div class="control-label">';
                              echo $this->eform->getLabel('tags');
                           echo '</div>';
                           echo '<div class="controls" style="width:700px; float:left;">';
                              echo $this->eform->getInput('tags');
                           echo '</div>';
                        echo '</div>';
                        echo '<div class="clearfix"> </div>';
                        echo '<br />';
                     echo "</td>";
                  echo "</tr>";
               endif;

               if ( $images > 0) {
                  // image1
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 1:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image1' id='image1' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 1) {
                  // image2
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 2:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image2' id='image2' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 2) {
                  // image3
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 3:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image3' id='image3' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 3) {
                  // image4
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 4:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image4' id='image4' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 4) {
                  // image5
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 5:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image5' id='image5' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 5) {
                  // image6
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 6:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image6' id='image6' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 6) {
                  // image7
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 7:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image7' id='image7' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 7) {
                  // image8
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 8:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image8' id='image8' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 8) {
                  // image9
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 9:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image9' id='image9' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 9) {
                  // image10
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 10:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image10' id='image10' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $videos > 0 ) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_VIDEO' ) . " 1:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='text' name='video1' id='video1' value='' size='12' maxlength='12' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_VIDEO_INFO' ) . "</div> ";
                           echo JText::_( 'COM_RIALTO_FIELD_VIDEO_TYPE_LABEL' ) . " 1: ";
                           echo  "<select id='vtype1' name='vtype1' required='true' >";
                              echo "<option value='1' selected='selected' >".JText::_('COM_RIALTO_VTYPE_UTUBE')."</option>";
                              echo "<option value='2' >".JText::_('COM_RIALTO_VTYPE_VIMEO')."</option>";
                          echo "</select>";
                     echo "</td>";
                  echo "</tr>";
//                  echo $this->loadTemplate('video');
               }

               if ( $videos > 1 ) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_VIDEO' ) . " 2:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='text' name='video2' id='video2' value='' size='12' maxlength='12' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_VIDEO_INFO' ) . "</div> ";
                           echo JText::_( 'COM_RIALTO_FIELD_VIDEO_TYPE_LABEL' ) . " 2: ";
                           echo  "<select id='vtype2' name='vtype2' >";
                              echo "<option value='1' selected='selected' >".JText::_('COM_RIALTO_VTYPE_UTUBE')."</option>";
                              echo "<option value='2' >".JText::_('COM_RIALTO_VTYPE_VIMEO')."</option>";
                           echo "</select>";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $videos > 2 ) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_VIDEO' ) . " 3:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='text' name='video3' id='video3' value='' size='12' maxlength='12' />";
                              // echo $cHelper->getVideotype('vtype3'); // 0 nothing selected
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_VIDEO_INFO' ) . "</div> ";
                           echo JText::_( 'COM_RIALTO_FIELD_VIDEO_TYPE_LABEL' ) . " 3: ";
                           echo  "<select id='vtype3' name='vtype3' >";
                              echo "<option value='1' selected='selected' >".JText::_('COM_RIALTO_VTYPE_UTUBE')."</option>";
                              echo "<option value='2' >".JText::_('COM_RIALTO_VTYPE_VIMEO')."</option>";
                           echo "</select>";
                     echo "</td>";
                  echo "</tr>";
               }

               // button
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoButton'>";
                        switch ( $this->task) {
                           case "edit": {
                              echo "<input type='hidden' name='dbmode' value='update'>";
                              break;
                           }
                           default: {
                              echo "<input type='hidden' name='dbmode' value='insert'>";
                              break;
                           }
                        }

                        echo "<input type='hidden' name='flag_commercial' value='" . $flag_commercial . "'>";
                        echo "<input type='hidden' name='categoryselectbox' value='" . $category_id . "'>";
                        echo "<input type='hidden' name='languageselectbox' value='" . $language . "'>";
                        echo "<input type='hidden' name='firstname' value='" . $firstname . "'>";
                        echo "<input type='hidden' name='lastname' value='" . $lastname . "'>";
                        echo "<input type='hidden' name='company' value='" . $company . "'>";
                        echo "<input type='hidden' name='street' value='" . $street . "'>";
                        echo "<input type='hidden' name='zip' value='" . $zip . "'>";
                        echo "<input type='hidden' name='city' value='" . $city . "'>";
                        echo "<input type='hidden' name='state' value='" . $state . "'>";
                        echo "<input type='hidden' name='country' value='" . $country . "'>";
                        echo "<input type='hidden' name='phone' value='" . $phone . "'>";
                        echo "<input type='hidden' name='mobile' value='" . $mobile . "'>";
                        echo "<input type='hidden' name='email' value='" . $email . "'>";
                        echo "<input type='hidden' name='web' value='" . $web . "'>";
                        echo "<input type='hidden' name='task' value='save'>";
                        echo "<input class='rialtoButton' type='submit' name='submit' value='" . JText::_( 'JSAVE' ) . "'>";

                        echo " " . JText::_( 'COM_RIALTO_OR' ) . " ";
                        $menuLinkHome      = JRoute::_( 'index.php?option=com_rialto');
                        echo "<a href='$menuLinkHome'>" . JText::_( 'JCANCEL' ) . "</a>";
                     echo "</div> ";
                  echo "</td>";
               echo "</tr>";
            echo "</table>";
          echo "</form>";
      echo "</div>";
      break;
   }
   // wizard step 3

   case "edit": {
      if ( $logUser->isModerator()) {
         // cool, do nothing for now
      } else {
         // check if this is the owner of this entry
         if ( $data->user_id != $user->id) {
            // redirect link
            $redirectLink = JRoute::_( "index.php?option=com_rialto&view=index");
            // if user is not the owner, kick him back to index page
            $app->redirect( $redirectLink, JText::_( 'COM_RIALTO_HACKING_ATTEMPT_OWNER' ), "message");
         }
      }

      echo "<div class='rialtoEntryForm'>";
         echo "<form action='' method='post' name='entryform' id='entryform' enctype='multipart/form-data' class='form-validate' onSubmit='return myValidate(this);' >";
            echo "<table cellspacing='1' cellpadding='0' width='100%' class='noborder'>";
               // contact data
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 50px 5px 0 5px;' >";
                     echo "<h3>" . JText::_( 'COM_RIALTO_CONTACT_DATA' ) . "</h3>";
                  echo "</td>";
               echo "</tr>";

               // firstname
               if ( $_use_firstname == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_FIRST_NAME' ) . ":</div> ";
                           echo "<div class='rialtoFirstname'>";
                              echo "<input type='text' name='firstname' id='firstname' size='50' maxlength='250' value='" . $data->firstname . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_FIRST_NAME_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // lastname
               if ( $_use_lastname == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_LAST_NAME' ) . ":</div> ";
                           echo "<div class='rialtoLastname'>";
                              echo "<input type='text' name='lastname' id='lastname' size='50' maxlength='250' value='" . $data->lastname . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_LAST_NAME_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // company
               if ( $_use_company == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_COMPANY' ) . ":</div> ";
                           echo "<div class='rialtoLastname'>";
                              echo "<input type='text' name='company' id='company' size='50' maxlength='250' value='" . $data->company . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_COMPANY_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // street
               if ( $_use_street == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_STREET' ) . ":</div> ";
                           echo "<div class='rialtoStreet'>";
                              echo "<input type='text' name='street' id='street' size='50' maxlength='250' value='" . $data->street . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_STREET_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // zip
               if ( $_use_zip == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_ZIP' ) . ":</div> ";
                           echo "<div class='rialtoZip'>";
                              echo "<input type='text' name='zip' id='zip' size='50' maxlength='250' value='" . $data->zip . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_ZIP_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // city
               if ( $_use_city == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_CITY' ) . ":</div> ";
                           echo "<div class='rialtoCity'>";
                              echo "<input type='text' name='city' id='city' size='50' maxlength='250' value='" . $data->city . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_CITY_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // state
               if ( $_use_state == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_STATE' ) . ":</div> ";
                           echo "<div class='rialtoState'>";
                              echo "<input type='text' name='state' id='state' size='50' maxlength='250' value='" . $data->statename . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_STATE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // country
               if ( $_use_country == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_COUNTRY' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='country' id='country' size='50' maxlength='250' value='" . $data->country . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_COUNTRY_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // phone
               if ( $_use_phone == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_PHONE' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='phone' id='phone' size='50' maxlength='250' value='" . $data->phone . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_PHONE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // mobile
               if ( $_use_mobile == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_MOBILE' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='mobile' id='mobile' size='50' maxlength='250' value='" . $data->mobile . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_MOBILE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // email
               if ( $_use_email == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'JGLOBAL_EMAIL' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='email' id='email' size='50' maxlength='250' value='" . $data->email . "' class='validate-email' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_EMAIL_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // web
               if ( $_use_web == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_WEB' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='web' id='web' size='50' maxlength='250' value='" . $data->web . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_WEB_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // entry data
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 50px 5px 0 5px;' >";
                     echo "<h3>" . JText::_( 'COM_RIALTO_ENTRY_DATA' ) . "</h3>";
                  echo "</td>";
               echo "</tr>";

               // Category select box
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_CATEGORY' ) . ":</div> ";
                        echo "<div class='rialtoCategory'>";
                           echo $cHelper->getCategorySelectBox( $data->category_id);
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_CATEGORY_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";
/*
               if ( JLanguageMultilang::isEnabled() ) {
                  // Language select box
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_LANGUAGE' ) . ":</div> ";
                           echo "<div class='rialtoCategory'>";
                              echo $cHelper->getLanguageSelectBox( $data->language);
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_LANGUAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }
*/
               // label
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_LABEL' ) . ":</div> ";
                        echo "<div class='rialtoType'>";
                           echo $cHelper->getLabelSelectBox( $data->label_id);
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_LABEL_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               // title
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_HEADLINE' ) . ":</div> ";
                        echo "<div class='rialtoHeadline'>";
                           echo "<input type='text' name='entryHeadline' id='entryHeadline' size='50' maxlength='250' value='" . $data->title . "' class='required' >";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_HEADLINE_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               // text
               echo "<tr>";
                  echo "<td class='noborder' align='left' valign='top' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_TEXT' ) . ":</div> ";
                        echo "<div class='rialtoText'>";
                           echo "<textarea name='entryText' cols='80' rows='10' wrap='VIRTUAL' id='entryText' class='required'>";
                           if ( $this->task == "edit") {
                                 echo $data->description;
                           }
                        echo "</textarea>";
                     echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_TEXT_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               // condition
               if ( $_use_condition == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_CONDITION' ) . ":</div> ";
                           echo "<div class='rialtoCondition'>";
                              echo "<input type='text' name='condition' id='condition' size='50' maxlength='250' value='" . $data->condition . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_CONDITION_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // price
               if ( $_use_price == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_PRICE' ) . ":</div> ";
                           echo "<div class='rialtoPrice'>";
                              echo "<input type='text' name='price' id='price' size='50' maxlength='250' value='" . $data->price . "' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_PRICE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 0) {
                  // image1
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 1:</div> ";
                        if ( $data->image1 != "") {
                           echo "<div>";
                              echo "<img src='" . $_root . "/images/rialto/entries/" . $data->id . "/small/" . $data->image1 . "' alt='$data->title' align='top' class='rialtoEntryContentImage' style='margin-left: 0px;' />";
                              echo "<input type='checkbox' name='cb_image1' value='delete'> " . JText::_( 'JACTION_DELETE' );
                           echo "</div>";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='file' name='image1' id='image1' value='' size='50' maxlength='250' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 1) {
                  // image2
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 2:</div> ";
                        if ( $data->image2 != "") {
                           echo "<div>";
                              echo "<img src='" . $_root . "/images/rialto/entries/" . $data->id . "/small/" . $data->image2 . "' alt='$data->title' align='top' class='rialtoEntryContentImage' style='margin-left: 0px;' />";
                              echo "<input type='checkbox' name='cb_image2' value='delete'> " . JText::_( 'JACTION_DELETE' );
                           echo "</div>";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='file' name='image2' id='image2' value='' size='50' maxlength='250' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 2) {
                  // image3
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 3:</div> ";
                        if ( $data->image3 != "") {
                           echo "<div>";
                              echo "<img src='" . $_root . "/images/rialto/entries/" . $data->id . "/small/" . $data->image3 . "' alt='$data->title' align='top' class='rialtoEntryContentImage' style='margin-left: 0px;' />";
                              echo "<input type='checkbox' name='cb_image3' value='delete'> " . JText::_( 'JACTION_DELETE' );
                           echo "</div>";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='file' name='image3' id='image3' value='' size='50' maxlength='250' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 3) {
                  // image4
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 4:</div> ";
                        if ( $data->image4 != "") {
                           echo "<div>";
                              echo "<img src='" . $_root . "/images/rialto/entries/" . $data->id . "/small/" . $data->image4 . "' alt='$data->title' align='top' class='rialtoEntryContentImage' style='margin-left: 0px;' />";
                              echo "<input type='checkbox' name='cb_image4' value='delete'> " . JText::_( 'JACTION_DELETE' );
                           echo "</div>";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='file' name='image4' id='image4' value='' size='50' maxlength='250' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 4) {
                  // image5
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 5:</div> ";
                        if ( $data->image5 != "") {
                           echo "<div>";
                              echo "<img src='" . $_root . "/images/rialto/entries/" . $data->id . "/small/" . $data->image5 . "' alt='$data->title' align='top' class='rialtoEntryContentImage' style='margin-left: 0px;' />";
                              echo "<input type='checkbox' name='cb_image5' value='delete'> " . JText::_( 'JACTION_DELETE' );
                           echo "</div>";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='file' name='image5' id='image5' value='' size='50' maxlength='250' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 5) {
                  // image6
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 6:</div> ";
                        if ( $data->image6 != "") {
                           echo "<div>";
                              echo "<img src='" . $_root . "/images/rialto/entries/" . $data->id . "/small/" . $data->image6 . "' alt='$data->title' align='top' class='rialtoEntryContentImage' style='margin-left: 0px;' />";
                              echo "<input type='checkbox' name='cb_image6' value='delete'> " . JText::_( 'JACTION_DELETE' );
                           echo "</div>";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='file' name='image6' id='image6' value='' size='50' maxlength='250' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 6) {
                  // image7
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 7:</div> ";
                        if ( $data->image7 != "") {
                           echo "<div>";
                              echo "<img src='" . $_root . "/images/rialto/entries/" . $data->id . "/small/" . $data->image7 . "' alt='$data->title' align='top' class='rialtoEntryContentImage' style='margin-left: 0px;' />";
                              echo "<input type='checkbox' name='cb_image7' value='delete'> " . JText::_( 'JACTION_DELETE' );
                           echo "</div>";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='file' name='image7' id='image7' value='' size='50' maxlength='250' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 7) {
                  // image8
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 8:</div> ";
                        if ( $data->image8 != "") {
                           echo "<div>";
                              echo "<img src='" . $_root . "/images/rialto/entries/" . $data->id . "/small/" . $data->image8 . "' alt='$data->title' align='top' class='rialtoEntryContentImage' style='margin-left: 0px;' />";
                              echo "<input type='checkbox' name='cb_image8' value='delete'> " . JText::_( 'JACTION_DELETE' );
                           echo "</div>";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='file' name='image8' id='image8' value='' size='50' maxlength='250' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 8) {
                  // image9
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 9:</div> ";
                        if ( $data->image9 != "") {
                           echo "<div>";
                              echo "<img src='" . $_root . "/images/rialto/entries/" . $data->id . "/small/" . $data->image9 . "' alt='$data->title' align='top' class='rialtoEntryContentImage' style='margin-left: 0px;' />";
                              echo "<input type='checkbox' name='cb_image9' value='delete'> " . JText::_( 'JACTION_DELETE' );
                           echo "</div>";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='file' name='image9' id='image9' value='' size='50' maxlength='250' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 9) {
                  // image10
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 10:</div> ";
                        if ( $data->image10 != "") {
                           echo "<div>";
                              echo "<img src='" . $_root . "/images/rialto/entries/" . $data->id . "/small/" . $data->image10 . "' alt='$data->title' align='top' class='rialtoEntryContentImage' style='margin-left: 0px;' />";
                              echo "<input type='checkbox' name='cb_image10' value='delete'> " . JText::_( 'JACTION_DELETE' );
                           echo "</div>";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='file' name='image10' id='image10' value='' size='50' maxlength='250' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $videos > 0 ) {
                  // image1
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_VIDEO' ) . " 1:</div> ";
                        if ( $data->video1 != "") {
                           echo '<br /><div class="embed-container">';
                           echo '<iframe src="http://www.youtube.com/embed/'.$data->video1.'" frameborder="0"  allowfullscreen> </iframe>';
                           echo "</div><br />";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='text' name='video1' id='video1' value='".$data->video1."' size='12' maxlength='12' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_VIDEO_INFO' ) . "</div> ";

                        echo JText::_( 'COM_RIALTO_FIELD_VIDEO_TYPE_LABEL' ) . " 1: ";
                        echo  "<select id='vtype1' name='vtype1'"; if ( $data->vtype1 =='1') { echo "selected='selected'"; } echo ">";
                           echo "<option value='1'"; if ( $data->vtype1 =='1') { echo "selected='selected'"; } echo ">".JText::_('COM_RIALTO_VTYPE_UTUBE')."</option>";
                           echo "<option value='2'"; if ( $data->vtype1 =='2') { echo "selected='selected'"; } echo ">".JText::_('COM_RIALTO_VTYPE_VIMEO')."</option>";
                        echo "</select>";
                     echo "</td>";
                  echo "</tr>";
//                  echo $this->loadTemplate('video');
               }

               if ( $videos > 1 ) {
                  // video2
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_VIDEO' ) . " 2:</div> ";
                        if ( $data->video2 != "") {
                           echo '<br /><div class="embed-container">';
                           echo '<iframe src="http://www.youtube.com/embed/'.$data->video2.'" frameborder="0"  allowfullscreen> </iframe>';
                           echo "</div><br />";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='text' name='video2' id='video2' value='".$data->video2."' size='12' maxlength='12' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_VIDEO_INFO' ) . "</div> ";
                        echo JText::_( 'COM_RIALTO_FIELD_VIDEO_TYPE_LABEL' ) . " 2: ";
                        echo  "<select id='vtype2' name='vtype2'"; if ( $data->vtype2 =='1') { echo "selected='selected'"; } echo ">";
                          echo "<option value='1'"; if ( $data->vtype2 =='1') { echo "selected='selected'"; } echo ">".JText::_('COM_RIALTO_VTYPE_UTUBE')."</option>";
                          echo "<option value='2'"; if ( $data->vtype2 =='2') { echo "selected='selected'"; } echo ">".JText::_('COM_RIALTO_VTYPE_VIMEO')."</option>";
                        echo "</select>";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $videos > 2 ) {
                  // video3
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_VIDEO' ) . " 3:</div> ";
                        if ( $data->video3 != "") {
                           echo '<br /><div class="embed-container">';
                           echo '<iframe src="http://www.youtube.com/embed/'.$data->video3.'" frameborder="0"  allowfullscreen> </iframe>';
                           echo "</div><br />";
                        }
                        echo "<div class='rialtoImage'>";
                           echo "<input type='text' name='video3' id='video3' value='".$data->video3."' size='12' maxlength='12' />";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_VIDEO_INFO' ) . "</div> ";
                        echo JText::_( 'COM_RIALTO_FIELD_VIDEO_TYPE_LABEL' ) . " 3: ";
                        echo  "<select id='vtype3' name='vtype3'"; if ( $data->vtype3 =='1') { echo "selected='selected'"; } echo ">";
                          echo "<option value='1'"; if ( $data->vtype3 =='1') { echo "selected='selected'"; } echo ">".JText::_('COM_RIALTO_VTYPE_UTUBE')."</option>";
                          echo "<option value='2'"; if ( $data->vtype3 =='2') { echo "selected='selected'"; } echo ">".JText::_('COM_RIALTO_VTYPE_VIMEO')."</option>";
                       echo "</select>";
                     echo "</td>";
                  echo "</tr>";
               }

               // button
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoButton'>";
                        switch ( $this->task) {
                           case "edit": {
                              echo "<input type='hidden' name='dbmode' value='update'>";
                              break;
                           }
                           default: {
                              echo "<input type='hidden' name='dbmode' value='insert'>";
                              break;
                           }
                        }
                        echo "<input type='hidden' name='task' value='save'>";
                        echo "<input type='hidden' name='entry' value='" . $data->id . "'>";
                        echo "<input class='rialtoButton' type='submit' name='submit' value='" . JText::_( 'COM_RIALTO_UPDATE' ) . "'>";
                     echo "</div> ";
                  echo "</td>";
               echo "</tr>";
            echo "</table>";
          echo "</form>";
      echo "</div>";
      break;
   }

   case "new": {
      echo JText::_( 'COM_RIALTO_RIALTO_RULES' );
      echo "<div class='rialtoEntryForm'>";
         echo "<form action='' method='post' name='entryform' id='entryform' enctype='multipart/form-data' class='form-validate' onSubmit='return myValidate(this);'>";
            echo "<table class='noborder' cellspacing='1' cellpadding='0' width='100%'>";
               // contact data
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 50px 5px 0 5px;' >";
                     echo "<h3>" . JText::_( 'COM_RIALTO_CONTACT_DATA' ) . "</h3>";
                  echo "</td>";
               echo "</tr>";

               // firstname
               if ( $_use_firstname == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_FIRST_NAME' ) . ":</div> ";
                           echo "<div class='rialtoFirstname'>";
                              echo "<input type='text' name='firstname' id='firstname' size='50' maxlength='250' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_FIRST_NAME_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // lastname
               if ( $_use_lastname == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_LAST_NAME' ) . ":</div> ";
                           echo "<div class='rialtoLastname'>";
                              echo "<input type='text' name='lastname' id='lastname' size='50' maxlength='250' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_LAST_NAME_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // company
               if ( $_use_company == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_COMPANY' ) . ":</div> ";
                           echo "<div class='rialtoLastname'>";
                              echo "<input type='text' name='company' id='company' size='50' maxlength='250' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_COMPANY_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // street
               if ( $_use_street == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_STREET' ) . ":</div> ";
                           echo "<div class='rialtoStreet'>";
                              echo "<input type='text' name='street' id='street' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_STREET_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // zip
               if ( $_use_zip == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_ZIP' ) . ":</div> ";
                           echo "<div class='rialtoZip'>";
                              echo "<input type='text' name='zip' id='zip' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_ZIP_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // city
               if ( $_use_city == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_CITY' ) . ":</div> ";
                           echo "<div class='rialtoCity'>";
                              echo "<input type='text' name='city' id='city' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_CITY_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // state
               if ( $_use_state == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_STATE' ) . ":</div> ";
                           echo "<div class='rialtoState'>";
                              echo "<input type='text' name='state' id='state' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_STATE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // country
               if ( $_use_country == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_COUNTRY' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='country' id='country' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_COUNTRY_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // phone
               if ( $_use_phone == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_PHONE' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='phone' id='phone' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_PHONE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // mobile
               if ( $_use_mobile == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_MOBILE' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='mobile' id='mobile' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_MOBILE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // email
               if ( $_use_email == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'JGLOBAL_EMAIL' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='email' id='email' size='50' maxlength='250' class='validate-email' >";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_EMAIL_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // web
               if ( $_use_web == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_WEB' ) . ":</div> ";
                           echo "<div class='rialtoCountry'>";
                              echo "<input type='text' name='web' id='web' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_WEB_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // entry data
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 50px 5px 0 5px;' >";
                     echo "<h3>" . JText::_( 'COM_RIALTO_ENTRY_DATA' ) . "</h3>";
                  echo "</td>";
               echo "</tr>";

               // Category select box
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_CATEGORY' ) . ":</div> ";
                        echo "<div class='rialtoCategory'>";
                           echo $cHelper->getCategorySelectBox( 0); // 0 nothing selected
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_CATEGORY_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               // label
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_LABEL' ) . ":</div> ";
                        echo "<div class='rialtoType'>";
                           echo $cHelper->getLabelSelectBox( 0); // 0 nothing selected
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_LABEL_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               // title
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_HEADLINE' ) . ":</div> ";
                        echo "<div class='rialtoHeadline'>";
                           echo "<input type='text' name='entryHeadline' id='entryHeadline' size='50' maxlength='250' class='required'>";
                        echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_HEADLINE_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               // text
               echo "<tr>";
                  echo "<td class='noborder' align='left' valign='top' style='padding: 5px;' >";
                     echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_TEXT' ) . ":</div> ";
                        echo "<div class='rialtoText'>";
                           echo "<textarea name='entryText' cols='80' rows='10' wrap='VIRTUAL' id='entryText' class='required'>";
                        echo "</textarea>";
                     echo "</div>";
                        echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_TEXT_INFO' ) . "</div> ";
                  echo "</td>";
               echo "</tr>";

               // condition
               if ( $_use_condition == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_CONDITION' ) . ":</div> ";
                           echo "<div class='rialtoCondition'>";
                              echo "<input type='text' name='condition' id='condition' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_CONDITION_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               // price
               if ( $_use_price == 1) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_PRICE' ) . ":</div> ";
                           echo "<div class='rialtoPrice'>";
                              echo "<input type='text' name='price' id='price' size='50' maxlength='250'>";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_PRICE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 0) {
                  // image1
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 1:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image1' id='image1' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 1) {
                  // image2
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 2:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image2' id='image2' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 2) {
                  // image3
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 3:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image3' id='image3' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 3) {
                  // image4
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 4:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image4' id='image4' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 4) {
                  // image5
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 5:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image5' id='image5' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 5) {
                  // image6
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 6:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image6' id='image6' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 6) {
                  // image7
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 7:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image7' id='image7' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 7) {
                  // image8
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 8:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image8' id='image8' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 8) {
                  // image9
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 9:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image9' id='image9' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $images > 9) {
                  // image10
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_IMAGE' ) . " 10:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='file' name='image10' id='image10' value='' size='50' maxlength='250' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_IMAGE_INFO' ) . "</div> ";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $videos > 0 ) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_VIDEO' ) . " 1:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='text' name='video1' id='video1' value='' size='12' maxlength='12' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_VIDEO_INFO' ) . "</div> ";
                        echo JText::_( 'COM_RIALTO_FIELD_VIDEO_TYPE_LABEL' ) . " 1: ";
                        echo  "<select id='vtype1' name='vtype1' required='true' >";
                           echo "<option value='1' selected='selected' >".JText::_('COM_RIALTO_VTYPE_UTUBE')."</option>";
                           echo "<option value='2' >".JText::_('COM_RIALTO_VTYPE_VIMEO')."</option>";
                       echo "</select>";
                     echo "</td>";
                  echo "</tr>";
//                  echo $this->loadTemplate('video');
               }

               if ( $videos > 1 ) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_VIDEO' ) . " 2:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='text' name='video2' id='video2' value='' size='12' maxlength='12' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_VIDEO_INFO' ) . "</div> ";
                        echo JText::_( 'COM_RIALTO_FIELD_VIDEO_TYPE_LABEL' ) . " 2: ";
                        echo  "<select id='vtype2' name='vtype2' required='true' >";
                           echo "<option value='1' selected='selected' >".JText::_('COM_RIALTO_VTYPE_UTUBE')."</option>";
                           echo "<option value='2' >".JText::_('COM_RIALTO_VTYPE_VIMEO')."</option>";
                       echo "</select>";
                     echo "</td>";
                  echo "</tr>";
               }

               if ( $videos > 2 ) {
                  echo "<tr>";
                     echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoEntryHeader'>" . JText::_( 'COM_RIALTO_VIDEO' ) . " 3:</div> ";
                           echo "<div class='rialtoImage'>";
                              echo "<input type='text' name='video3' id='video3' value='' size='12' maxlength='12' />";
                           echo "</div>";
                           echo "<div class='rialtoEntryFooter'>" . JText::_( 'COM_RIALTO_VIDEO_INFO' ) . "</div> ";
                        echo JText::_( 'COM_RIALTO_FIELD_VIDEO_TYPE_LABEL' ) . " 3: ";
                        echo  "<select id='vtype3' name='vtype3' required='true' >";
                           echo "<option value='1' selected='selected' >".JText::_('COM_RIALTO_VTYPE_UTUBE')."</option>";
                           echo "<option value='2' >".JText::_('COM_RIALTO_VTYPE_VIMEO')."</option>";
                       echo "</select>";
                     echo "</td>";
                  echo "</tr>";
               }

               // button
               echo "<tr>";
                  echo "<td class='noborder' style='padding: 5px;' >";
                        echo "<div class='rialtoButton'>";
                        switch ( $this->task) {
                           case "edit": {
                              echo "<input type='hidden' name='dbmode' value='update'>";
                              break;
                           }
                           default: {
                              echo "<input type='hidden' name='dbmode' value='insert'>";
                              break;
                           }
                        }
                        echo "<input type='hidden' name='task' value='save'>";
                        echo "<input class='rialtoButton' type='submit' name='submit' value='" . JText::_( 'JSAVE' ) . "'>";
                     echo "</div> ";
                  echo "</td>";
               echo "</tr>";
            echo "</table>";
          echo "</form>";
      echo "</div>";
      break;
   }

   default: {  // show entry
      echo "<div class='rialtoEntryContent'>";
         echo "<div class='rialtoEntryContentHeadline'>";
            echo "<div class='rialtoEntryContentHeadline1'>";
               echo "<h3 style='margin: 0 0 0 0;'>";
                  echo $data->title;
               echo "</h3>";
            echo "</div>";
            echo "<div class='rialtoEntryContentHeadline2' style='text-align: right;'>";
               $_username = $data->user_name;

               echo "<table cellspacing='0' cellpadding='0' border='0' class='noborder'>";
                  echo "<tr>";
                     echo "<td align='left' valign='center' class='noborder' style='padding-left: 5px;'>";
                        echo JHTML::_('date', $data->date_created, JText::_('DATE_FORMAT_LC1'));
                           echo "<br />";
                           echo JText::_( 'COM_RIALTO_BY' ) . "&nbsp;";
                           echo "<b>";
                           echo $_username;
                           echo "</b>";
                     echo "</td>";
                  echo "</tr>";
               echo "</table>";
            echo "</div>";
            echo "<div style='clear:left;'></div>";
         echo "</div>";

         echo "<div class='rialtoEntryContentText'>";
         // Determine if we have any images or videos for this entry.
         $hasimages = 0;
         if ( $data->image1 != "" || $data->image2 != "" || $data->image3 != ""
            || $data->image4 != "" || $data->image5 != "" || $data->image6 != ""
            || $data->image7 != "" || $data->image8 != "" || $data->image9 != ""
            || $data->image10 != "" || $data->video1 != "" || $data->video2 != ""
            || $data->video3 != "" )
            $hasimages = 1;
         if ( $hasimages == 1) {
            echo "<div class='rialtoEntryContentText1'>";
         } else {
            echo "<div class='rialtoEntryContentText1' style='width: 100%; border-right: 0; border-style: none;'>";
         }
               echo "<div class='rialtoEntryInfoRow'>";
                  echo "<div class='rialtoEntryUsername'>";
                     echo $data->user_name;
                  echo "</div>";
                  if ( $data->label_image != "" ) {
                     echo "<img src='" . $_root . $data->label_image . "' class='rialtoEntryLabel' />";
                  } else {
                     echo "<div class='rialtoEntryLabel'>";
                        echo $cHelper->getLabelnameById($data->label_id);
                     echo "</div>";
                  }
                  if ( $_commercialEntries == 1) {
                     echo "<div class='rialtoEntryPrivateCommercial'>";
                        if ( $data->flag_commercial == 1) {
                           echo JText::_( 'COM_RIALTO_COMMERCIAL' );
                        } else {
                           echo JText::_( 'COM_RIALTO_PRIVATE' );
                        }
                     echo "</div>";
                  }
               echo "</div>";

               if ($params->get('show_tags', 1) && !empty($data->tags)) :
                  echo "<br style='clear:left;'>";
                  $data->tagLayout = new JLayoutFile('joomla.content.tags');
                  echo $data->tagLayout->render($data->tags->itemTags);
               endif;

               echo "<br style='clear:left;'>";
               echo nl2br($data->description);
               echo "<br />";
               echo "<br />";

               // condition
               if ( $_use_condition == 1 && !empty($data->condition) ) {
                  echo "<br />";
                  echo JText::_( 'COM_RIALTO_CONDITION' ) . ": ";
                  echo $data->condition;
               }

               // price
               if ( $_use_price == 1 && !empty($data->price) ) {
                  echo "<br />";
                  echo JText::_( 'COM_RIALTO_PRICE' ) . ": ";
                  echo $data->price;
               }

            echo "</div>";
            if ( $hasimages == 1) {
               echo "<div class='rialtoEntryContentText2'>";
               // prepare linktag for images
               $_titleprefix = "";
               switch ( $_imagesDisplayMode) { // set rel and target
                  case 1: { // Slimbox
                     $_linktag = " rel='lightbox-" . $data->id . "' ";
                     break;
                  }
                  case 2: { // RokBox
                     $_linktag = " rel='rokbox (" . $data->id . ")' ";
                     $_titleprefix = $data->title . " :: ";
                     break;
                  }
                  default: { // Set to Browser display by default
                     $_linktag = " target='_blank' ";
                     break;
                  }
               }

               if ( $data->image1 == "" ) {  // show default image only if no videos
                  if ( $videos == 0 ||
                     ($data->video1 == '' && $data->video2 == '' && $data->video3 == '') )
                     echo "<img src='". $_root ."/media/com_rialto/images/camera.png' class='rialtoEntryContentImage' />";
               } else {
                  echo "<a href='" . $_root . "images/rialto/entries/" . $data->id . "/large/" . $data->image1 . "' " . $_linktag . " title='".$_titleprefix.$data->title . " 1' >";
                  echo "<img src='" . $_root . "images/rialto/entries/" . $data->id . "/small/" . $data->image1 . "' class='rialtoEntryContentImage' />";
                  echo "</a>";
               }

               if ( $data->image2 != "") {
                  echo "<a href='" . $_root . "images/rialto/entries/" . $data->id . "/large/" . $data->image2 . "' " . $_linktag . " title='".$_titleprefix.$data->title . " 2' >";
                  echo "<img src='" . $_root . "images/rialto/entries/" . $data->id . "/small/" . $data->image2 . "' class='rialtoEntryContentImage' />";
                  echo "</a>";
               }

               if ( $data->image3 != "") {
                  echo "<a href='" . $_root . "images/rialto/entries/" . $data->id . "/large/" . $data->image3 . "' " . $_linktag . " title='".$_titleprefix.$data->title . " 3' >";
                  echo "<img src='" . $_root . "images/rialto/entries/" . $data->id . "/small/" . $data->image3 . "' class='rialtoEntryContentImage' />";
                  echo "</a>";
               }

               if ( $data->image4 != "") {
                  echo "<a href='" . $_root . "images/rialto/entries/" . $data->id . "/large/" . $data->image4 . "' " . $_linktag . " title='".$_titleprefix.$data->title . " 4' >";
                  echo "<img src='" . $_root . "images/rialto/entries/" . $data->id . "/small/" . $data->image4 . "' class='rialtoEntryContentImage' />";
                  echo "</a>";
               }

               if ( $data->image5 != "") {
                  echo "<a href='" . $_root . "images/rialto/entries/" . $data->id . "/large/" . $data->image5 . "' " . $_linktag . " title='".$_titleprefix.$data->title . " 5' >";
                  echo "<img src='" . $_root . "images/rialto/entries/" . $data->id . "/small/" . $data->image5 . "' class='rialtoEntryContentImage' />";
                  echo "</a>";
               }

               if ( $data->image6 != "") {
                  echo "<a href='" . $_root . "images/rialto/entries/" . $data->id . "/large/" . $data->image6 . "' " . $_linktag . " title='".$_titleprefix.$data->title . " 6' >";
                  echo "<img src='" . $_root . "images/rialto/entries/" . $data->id . "/small/" . $data->image6 . "' class='rialtoEntryContentImage' />";
                  echo "</a>";
               }

               if ( $data->image7 != "") {
                  echo "<a href='" . $_root . "images/rialto/entries/" . $data->id . "/large/" . $data->image7 . "' " . $_linktag . " title='".$_titleprefix.$data->title . " 7' >";
                  echo "<img src='" . $_root ."images/rialto/entries/" . $data->id . "/small/" . $data->image7 . "' class='rialtoEntryContentImage' />";
                  echo "</a>";
               }

               if ( $data->image8 != "") {
                  echo "<a href='" . $_root . "images/rialto/entries/" . $data->id . "/large/" . $data->image8 . "' " . $_linktag . " title='".$_titleprefix.$data->title . " 8' >";
                  echo "<img src='" . $_root ."images/rialto/entries/" . $data->id . "/small/" . $data->image8 . "' class='rialtoEntryContentImage' />";
                  echo "</a>";
               }

               if ( $data->image9 != "") {
                  echo "<a href='" . $_root . "images/rialto/entries/" . $data->id . "/large/" . $data->image9 . "' " . $_linktag . " title='".$_titleprefix.$data->title . " 9' >";
                  echo "<img src='" . $_root . "images/rialto/entries/" . $data->id . "/small/" . $data->image9 . "' class='rialtoEntryContentImage' />";
                  echo "</a>";
               }

               if ( $data->image10 != "") {
                  echo "<a href='" . $_root . "images/rialto/entries/" . $data->id . "/large/" . $data->image10 . "' " . $_linktag . " title='".$_titleprefix.$data->title . " 10' >";
                  echo "<img src='" . $_root . "images/rialto/entries/" . $data->id . "/small/" . $data->image10 . "' class='rialtoEntryContentImage' />";
                  echo "</a>";
               }

               if ( $videos > 0 )
                  echo $this->loadTemplate('video');

               echo "</div>";
            }
            echo "<div style='clear:left;'></div>";
         echo "</div>";

         echo "<div class='rialtoEntryContentContact'>";
            if ( $user->guest && $_showContactDetailsToPublic == 0) { // user is not logged in
               echo JText::_( 'COM_RIALTO_LOGIN_FOR_CONTACT_DETAILS_INFO' );
            } else { // user is logged in
               echo "<h3>";
               echo JText::_( 'COM_RIALTO_CONTACT_DATA' );
               echo "</h3>";
               echo "<table class='noborder'>";
                  if ( $_use_firstname == 1 || $_use_lastname == 1) {
                     echo "<tr>";
                        echo "<td colspan='2' class='noborder'>";
                           if ( $_use_firstname == 1) {
                              echo $data->firstname;
                              echo " ";
                           }
                           if ( $_use_lastname == 1) {
                              echo $data->lastname;
                           }
                        echo "</td>";
                     echo "</tr>";
                  }

                  if ( $_use_company == 1 && $data->company != "") {
                     echo "<tr>";
                        echo "<td colspan='2' class='noborder'>";
                           echo $data->company;
                        echo "</td>";
                     echo "</tr>";
                  }

                  if ( $_use_street == 1 && $data->street != "") {
                     echo "<tr>";
                        echo "<td colspan='2' class='noborder'>";
                           echo $data->street;
                        echo "</td>";
                     echo "</tr>";
                  }

                  if ( $_use_zip == 1 || $_use_city == 1) {
                     if ( $data->zip != "" || $data->city != "") {
                        echo "<tr>";
                           echo "<td colspan='2' class='noborder'>";
                              echo $data->zip . " ";
                              if ( $data->city != "") {
                                 echo $data->city;
                              }
                           echo "</td>";
                        echo "</tr>";
                     }
                  }

                  if ( $_use_state == 1 && $data->statename != "") {
                     echo "<tr>";
                        echo "<td colspan='2' class='noborder'>";
                           echo $data->statename;
                        echo "</td>";
                     echo "</tr>";
                  }

                  if ( $_use_country == 1 && $data->country != "") {
                     echo "<tr>";
                        echo "<td colspan='2' class='noborder'>";
                           echo $data->country;
                        echo "</td>";
                     echo "</tr>";
                  }

                  if ( $_use_phone == 1 && $data->phone != "") {
                     echo "<tr>";
                        echo "<td colspan='2' class='noborder'>";
                           echo JText::_( 'COM_RIALTO_PHONE' ) . ": ";
                           echo $data->phone;
                        echo "</td>";
                     echo "</tr>";
                  }

                  if ( $_use_mobile == 1 && $data->mobile != "") {
                     echo "<tr>";
                        echo "<td colspan='2' class='noborder'>";
                           echo JText::_( 'COM_RIALTO_MOBILE' ) . ": ";
                           echo $data->mobile;
                        echo "</td>";
                     echo "</tr>";
                  }

                  if ( $_use_email == 1 && $data->email != "") {
                     echo "<tr>";
                        echo "<td colspan='2' class='noborder'>";
                           echo JText::_( 'JGLOBAL_EMAIL' ) . ": ";
                           $_email = $data->email;
                           $_email = strtolower( $_email);
                           $_email = strip_tags( $_email);
                           $_email = str_replace( "mailto:", "", $_email);
                           $_emcloaked = JHTML::_('Email.cloak', $_email);
                           echo $_emcloaked;
                        echo "</td>";
                     echo "</tr>";
                  }

                  if ( $_use_web == 1 && $data->web != "") {
                     echo "<tr>";
                        echo "<td colspan='2' class='noborder'>";
                           echo JText::_( 'COM_RIALTO_WEB' ) . ": ";
                           $_web = $data->web;
                           $_web = strtolower( $_web);
                           $_web = strip_tags( $_web);
                           $_web = str_replace( "http://", "", $_web);
                           echo "<a href='http://" . $_web . "' title='" . $_web . "' rel='nofollow' target='_blank' >";
                           echo $_web;
                           echo "</a>";
                        echo "</td>";
                     echo "</tr>";
                  }

               echo "</table>";
               if ( !$user->guest  && ( $user->id != $this->data->user_id ) ) { // user is logged in and we are not the owner.
                  echo "<button id=\"contact_button\" class=\"btn btn-default\" type=\"submit\" onclick=\"jQuery('#contactformDiv').show();\">". JText::_('COM_RIALTO_CONTACT_SELLER'). "</button>";
                  echo "<br />";
                  echo $this->loadTemplate('contact');
               }
               echo "<br />";
            }
         echo "</div>";

         if ( !$user->guest) { // user is logged in
            $_backendMode = $params->get('backendMode', '0'); // 0 no, 1 yes
            if( $_backendMode == 0) {
               if ( ($user->id == $data->user_id) || $logUser->isModerator()) { // it's the entry owner or a moderator
                  echo "<div class='rialtoEntryContentActions'>";
                  // $editLink = JRoute::_( 'index.php?option=com_rialto&view=entry&task=edit&entry='.$data->id);
                  $editLink = JRoute::_( 'index.php?option=com_rialto&view=entryform&task=edit&id='.$data->id);
                  echo "<a href='$editLink'>" . JText::_( 'JACTION_EDIT' ) . "</a>";
                  echo "&nbsp;&nbsp;&nbsp;";
                  $deleteLink = JRoute::_( 'index.php?option=com_rialto&view=entry&task=delete&entry='.$data->id);
                  echo "<a href='$deleteLink' onclick='return confirmdelete();'>" . JText::_( 'JACTION_DELETE' ) . "</a>";

                  echo "&nbsp;&nbsp;&nbsp;";
                  echo JText::_( 'COM_RIALTO_ENTRY_STATE' ) . ": ";

                  if ( $data->state == 1) {
                     echo "<span class='rialtoStateActive'>";
                        echo JText::_( 'COM_RIALTO_STATE_ACTIVE' );
                     echo "</span>";
                  } else { // either expired or unpublished by admin
                     if ( $data->expired == 1) {
                        echo "<span class='rialtoStateExpired'>";
                           echo JText::_( 'COM_RIALTO_STATE_EXPIRED' );
                        echo "</span>";

                        $reactivateLink = JRoute::_( 'index.php?option=com_rialto&view=entry&task=reactivate&entry='.$data->id);
                        echo "(<a href='$reactivateLink'>" . JText::_( 'COM_RIALTO_REACTIVATE' ) . "</a>)";
                     } else {
                        echo "<span class='rialtoStateDeactivated'>";
                           echo JText::_( 'COM_RIALTO_STATE_DEACTIVATED' );
                        echo "</span>";
                     }
                  }

                  echo "</div>";
               }
            }
         }
      echo "</div>";
      break;
   } // end default
} ?>

<?php if ( $this->task == "") echo $this->loadTemplate('footer'); ?>

<?php include( JPATH_COMPONENT.DS.'includes/footer.php'); ?>
</div>

Youez - 2016 - github.com/yon3zu
LinuXploit