コード例 #1
0
ファイル: default.php プロジェクト: raulrotundo/jpmoser_guide
$i = 0;
if ($this->hgconf->listheight_hotel) {
    $margin = $this->hgconf->listheight_hotel;
} else {
    $margin = 84;
}
echo '<div id="itembox">' . "\n";
foreach ($this->items as $hotels) {
    if ($k == 0) {
        echo '<div class="titlerow" style="height:' . $margin . 'px; background: transparent url(' . JURI::base() . 'components/com_hotelguide/assets/images/back_light.png) 0 0 repeat;">' . "\n";
    } else {
        echo '<div class="titlerow" style="height:' . $margin . 'px; background: transparent url(' . JURI::base() . 'components/com_hotelguide/assets/images/back_dark.png) 0 0 repeat;">' . "\n";
    }
    echo '<div class="leftcell">' . "\n";
    echo '<div class="inner">' . "\n";
    $link = JRoute::_(hotelguideHelperRoute::getItemRoute($hotels->slug));
    if ($hotels->mainimage) {
        echo '<a href="' . $link . '"><img class="img_left imgshadow" style="padding:4px; border-color:' . $this->hgconf->bordercolor . '" src="' . JURI::base() . 'images/hotelguide/gallery/hotel_' . $hotels->id . '/thumb/' . $hotels->mainimage . '"  width="' . $margin . 'px"; title="' . htmlentities($hotels->title) . '" alt="' . htmlentities($hotels->title) . '"/></a>';
    } else {
        echo '<a href="' . $link . '"><img class="img_left imgshadow" style="padding:4px; border-color:' . $this->hgconf->bordercolor . '" src="' . JURI::base() . 'components/com_hotelguide/assets/images/no_thumb.gif" width="' . $margin . 'px"; title="No Image" alt="No Image"/></a>';
    }
    echo '</div>' . "\n";
    echo '</div>' . "\n";
    echo '<div class="centercell">' . "\n";
    echo '<div class="inner" style="text-align:left;">' . "\n";
    echo '<p style="margin-right:10px; position:relative;"><a class="titleitem" style="font-weight:bold;" href="' . $link . '">';
    echo stripslashes($hotels->title);
    echo '</a>';
    if ($hotels->starrate && $this->hgconf->showstarrate) {
        echo '&nbsp;&nbsp;<img style="margin:0" src="' . JURI::base() . 'components/com_hotelguide/assets/images/' . $hotels->starrate . 'star.png"  alt="Star Rate"/>';
    }
コード例 #2
0
ファイル: default.php プロジェクト: raulrotundo/jpmoser_guide
 * modify it under the terms of the GNU General Public License 2
 * as published by the Free Software Foundation.
 * HotelGuide is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with HOTELGUIDE; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
defined('_JEXEC') or die('Restricted access');
echo '<div id="hotel"><div class="hotellist" style="width:100%">' . "\n";
echo '<div class="hotel_row">' . "\n";
foreach ($hotels as $sub) {
    echo '<div class="inbox" style="width:25%;"><div class="hotel_col">';
    $link = hotelguideHelperRoute::getItemRoute($sub->slug);
    echo '<div class="inframe">' . "\n";
    echo '<div class="trans">' . "\n";
    if ($sub->starrate > 0) {
        echo '<img src="' . JURI::base() . 'components/com_hotelguide/assets/images/' . $sub->starrate . 'star.png"  alt="Star Rate"/>';
    }
    echo '</div>' . "\n";
    echo '<a href="' . $link . '" title="' . $sub->title . '">';
    if ($sub->mainimage) {
        echo '<img style="border:1px solid #bbbbbb;" src="' . JURI::base() . 'images/hotelguide/gallery/hotel_' . $sub->id . '/crop/' . $sub->mainimage . '" width="120px" alt="" /></a></div>' . "\n";
    } else {
        echo '<img src="' . JURI::base() . 'components/com_hotelguide/assets/images/no_image.gif" /></a></div>' . "\n";
    }
    echo '<div class="cap">' . "\n";
    //		echo '<div class="caption">' . "\n";
    echo '<i style="height:3em">' . "\n";
コード例 #3
0
    function showmap($config, $base, $mapdatas, $regione, $cattitle, $child, $ajaxmap, $googlead, $adid, $slot)
    {
        $lat = $base['lat'];
        $lon = $base['lon'];
        $zoom = $base['zoom'];
        $maptype = $base['maptype'];
        if (!$maptype) {
            $maptype = 'Map';
        }
        switch ($maptype) {
            case 'Map':
            case 'roadmap':
                $maptype = 'G_NORMAL_MAP';
                break;
            case 'Satellite':
                $maptype = 'G_SATELLITE_MAP';
                break;
            case 'Hybrid':
            case 'hybrid':
                $maptype = 'G_HYBRID_MAP';
                break;
            case 'Terrain':
            case 'terrain':
                $maptype = 'G_PHYSICAL_MAP';
                break;
        }
        ?>

		<script language="javascript" type="text/javascript">
            var map;
            var container;
            var lat;
            var lon;
            var maptype;
            var title;
            var thumbLink;
            var point;
			var toggle = 0;

			function loadMap() {

				container = document.getElementById("map_canvas");
					   
				lat = <?php 
        echo $lat;
        ?>
;
				lon = <?php 
        echo $lon;
        ?>
;
				zoom = <?php 
        echo $zoom;
        ?>
;
				maptype = <?php 
        echo $maptype;
        ?>
;
				point = new GLatLng (lat, lon);
				map = new google.maps.Map2(container); 
				map.addControl(new GLargeMapControl3D(), new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(0,5)));
				map.addControl(new GMenuMapTypeControl(), new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7,7)));
				map.addMapType(G_PHYSICAL_MAP);
				map.addControl(new GScaleControl());
				map.setCenter(new google.maps.LatLng(lat, lon), zoom, maptype);

				//var clusterer = new Clusterer(map); 
				//var sidebar = new SideBar(document.getElementById("sidebar"));
		
				GEvent.addListener(map, "mouseover", function(){
					map.showControls();
				});
				GEvent.addListener(map, "mouseout", function(){
					map.hideControls(); 
				});
	
				// ================= infoOpened LISTENER ===========
				GEvent.addListener(map, "infowindowopen", function()  {
					infoOpened = true;	// set infoOpened to true to change the history text
					Slimbox.scanPage();
				});
		
				// ================= infoClosed LISTENER ===========
				GEvent.addListener(map, "infowindowclose", function()  {
					infoOpened = false;	// set infoOpened to false
				});
		
				var autoCenterBounds = new GLatLngBounds();
				var maxZoom = 0;	
				var marker; 
				var width;
				var height;
				var ratio;
				var imagelink;
				var itemlink;
				var slimboxlink;
				var logopath;
				var logowidth = <?php 
        echo $config->logowidth;
        ?>
;
				var logoheight = <?php 
        echo $config->logoheight;
        ?>
;
				toggle = 1;
				<?php 
        if ($config->logoimage) {
            ?>
					logopath = "<?php 
            echo JURI::base();
            ?>
administrator/components/com_hotelguide/assets/images/<?php 
            echo $config->logoimage;
            ?>
"; <?php 
        } else {
            ?>
					logopath = "<?php 
            echo JURI::base();
            ?>
administrator/components/com_hotelguide/assets/images/yourlogo.gif";
					logowidth = 160;
					logoheight = 25; <?php 
        }
        ?>
				
				<?php 
        if ($child) {
            foreach ($mapdatas as $mapdata) {
                $text = substr($mapdata[0]->hoteltype, 0, 18) . "....";
                ?>
						CreateMarker(clusterer, sidebar, "", "", "", "", "", "", "","", "", "", "", "", "", "<?php 
                echo $text;
                ?>
");
						<?php 
                foreach ($mapdata as $item) {
                    if ($item->lon == 0) {
                        continue;
                    }
                    ?>
							point = new GLatLng(<?php 
                    echo $item->lat;
                    ?>
, <?php 
                    echo $item->lon;
                    ?>
);
							<?php 
                    if ($item->zoom < 1 || !$item->zoom) {
                        $item->zoom = 3;
                    }
                    ?>
							maxZoom = Math.max(maxZoom, <?php 
                    echo $item->zoom;
                    ?>
);
							autoCenterBounds.extend(point);
							
							<?php 
                    if ($regione == 'hotel' && $item->mainimage) {
                        ?>
                                                                        
								itemlink = "<?php 
                        echo JRoute::_(hotelguideHelperRoute::getItemRoute($item->slug));
                        ?>
";
								thumblink = "<?php 
                        echo JURI::base();
                        ?>
images/hotelguide/gallery/hotel_<?php 
                        echo $item->id;
                        ?>
/smallcrop/<?php 
                        echo $item->mainimage;
                        ?>
";
								imagelink = "<?php 
                        echo JURI::base();
                        ?>
images/hotelguide/gallery/hotel_<?php 
                        echo $item->id;
                        ?>
/resize/<?php 
                        echo $item->mainimage;
                        ?>
";
								slimboxlink = "<?php 
                        echo JURI::base();
                        ?>
images/hotelguide/gallery/hotel_<?php 
                        echo $item->id;
                        ?>
/album/<?php 
                        echo $item->mainimage;
                        ?>
";
							<?php 
                    } else {
                        ?>
								thumblink = "<?php 
                        echo JURI::base();
                        ?>
components/com_hotelguide/assets/images/no_list.gif";
								imagelink = "<?php 
                        echo JURI::base();
                        ?>
components/com_hotelguide/assets/images/no_image.gif";
								slimboxlink = "<?php 
                        echo JURI::base();
                        ?>
components/com_hotelguide/assets/images/no_thumb.jpg";
								<?php 
                        $item->imagewidth = 160;
                        $item->imageheight = 120;
                    }
                    $desc = $item->title;
                    ?>
							
							//CreateMarker(clusterer, sidebar, <?php 
                    //echo $item->lat;
                    ?>
, <?php 
                    //echo $item->lon;
                    ?>
, "<?php 
                    //echo $desc;
                    ?>
", thumblink, imagelink, itemlink, slimboxlink, <?php 
                    //echo $item->zoom;
                    ?>
, <?php 
                    //echo $item->imagewidth;
                    ?>
, <?php 
                    //echo $item->imageheight;
                    ?>
, logopath, logowidth, logoheight, ""); <?php 
                }
            }
        } else {
            if ($regione == 'city') {
                $cattitle = JText::sprintf('HG_ACCOMMODATIONS_IN', $cattitle);
            } else {
                if ($regione == 'country' || $regione == 'states') {
                    $cattitle = JText::sprintf('HG_CITIES_IN', $cattitle);
                } else {
                    if ($regione == 'continent') {
                        $cattitle = JText::sprintf('HG_COUNTRIES_IN', $cattitle);
                    }
                }
            }
            ?>
						
					//CreateMarker(clusterer, sidebar, "", "", "", "", "", "", "","", "", "", "", "", "", "<?php 
            //echo $cattitle;
            ?>
");
					<?php 
            foreach ($mapdatas as $item) {
                if ($item->lon == 0) {
                    continue;
                }
                ?>
						point = new GLatLng(<?php 
                echo $item->lat;
                ?>
, <?php 
                echo $item->lon;
                ?>
);
						<?php 
                if ($item->zoom < 1 || !$item->zoom) {
                    $item->zoom = 3;
                }
                ?>
						maxZoom = Math.max(maxZoom, <?php 
                echo $item->zoom;
                ?>
);
						autoCenterBounds.extend(point);
						
						<?php 
                if (($regione == 'city' || $regione == 'states') && $item->image) {
                    ?>
							itemlink = "<?php 
                    echo JRoute::_(hotelguideHelperRoute::getCityRoute($item->cityslug));
                    ?>
";
							thumblink = "<?php 
                    echo JURI::base();
                    ?>
images/hotelguide/city/scrop/<?php 
                    echo $item->image;
                    ?>
";
							imagelink = "<?php 
                    echo JURI::base();
                    ?>
images/hotelguide/city/resize/<?php 
                    echo $item->image;
                    ?>
";
							slimboxlink = "<?php 
                    echo JURI::base();
                    ?>
images/hotelguide/city/album/<?php 
                    echo $item->image;
                    ?>
";
						<?php 
                } else {
                    if (($regione == 'country' || $regione == 'continent') && $item->image) {
                        ?>
							itemlink = "<?php 
                        echo JRoute::_(hotelguideHelperRoute::getCountryRoute($item->slug));
                        ?>
";
							thumblink = "<?php 
                        echo JURI::base();
                        ?>
images/hotelguide/country/scrop/<?php 
                        echo $item->image;
                        ?>
";
							imagelink = "<?php 
                        echo JURI::base();
                        ?>
images/hotelguide/country/resize/<?php 
                        echo $item->image;
                        ?>
";
							slimboxlink = "<?php 
                        echo JURI::base();
                        ?>
images/hotelguide/country/album/<?php 
                        echo $item->image;
                        ?>
";
						<?php 
                    } else {
                        if ($regione == 'hotel' && $item->mainimage) {
                            ?>
							itemlink = "<?php 
                            echo JRoute::_(hotelguideHelperRoute::getItemRoute($item->slug));
                            ?>
";
							thumblink = "<?php 
                            echo JURI::base();
                            ?>
images/hotelguide/gallery/hotel_<?php 
                            echo $item->id;
                            ?>
/smallcrop/<?php 
                            echo $item->mainimage;
                            ?>
";
							imagelink = "<?php 
                            echo JURI::base();
                            ?>
images/hotelguide/gallery/hotel_<?php 
                            echo $item->id;
                            ?>
/resize/<?php 
                            echo $item->mainimage;
                            ?>
";
							slimboxlink = "<?php 
                            echo JURI::base();
                            ?>
images/hotelguide/gallery/hotel_<?php 
                            echo $item->id;
                            ?>
/album/<?php 
                            echo $item->mainimage;
                            ?>
";
						<?php 
                        } else {
                            ?>
							//thumblink = "<?php 
                            echo JURI::base();
                            ?>
components/com_hotelguide/assets/images/no_list.gif";
                                                        thumblink = "<?php 
                            echo JURI::base();
                            ?>
images/hotelguide/gallery/hotel_<?php 
                            echo $item->id;
                            ?>
/smallcrop/<?php 
                            echo $item->mainimage;
                            ?>
";
                                                        imagelink = "<?php 
                            echo JURI::base();
                            ?>
images/hotelguide/gallery/hotel_<?php 
                            echo $item->id;
                            ?>
/resize/<?php 
                            echo $item->mainimage;
                            ?>
";
							slimboxlink = "<?php 
                            echo JURI::base();
                            ?>
images/hotelguide/gallery/hotel_<?php 
                            echo $item->id;
                            ?>
/album/<?php 
                            echo $item->mainimage;
                            ?>
";
							//imagelink = "<?php 
                            echo JURI::base();
                            ?>
components/com_hotelguide/assets/images/no_image.gif";
							//slimboxlink = "<?php 
                            echo JURI::base();
                            ?>
components/com_hotelguide/assets/images/no_image.gif";
							<?php 
                            $item->imagewidth = 120;
                            $item->imageheight = 120;
                        }
                    }
                }
                if (isset($item->assignedrestos)) {
                    $desc = JText::sprintf('HG_MAP_ACCOMMODATIONS', $item->nam, $item->assignedrestos);
                } else {
                    if ($regione == 'hotel') {
                        $desc = $item->title;
                    } else {
                        $desc = $item->title;
                    }
                }
                ?>
				
						//CreateMarker(clusterer, sidebar, <?php 
                //echo $item->lat;
                ?>
, <?php 
                //echo $item->lat;
                ?>
, "<?php 
                //echo $desc;
                ?>
", thumblink, imagelink, itemlink, slimboxlink, <?php 
                //echo $item->zoom;
                ?>
, <?php 
                //echo $item->imagewidth;
                ?>
, <?php 
                //echo $item->imageheight;
                ?>
, logopath, logowidth, logoheight, "");
						
					<?php 
            }
        }
        ?>
                                        
                                // Create our "tiny" marker icon
                                var blueIcon = new GIcon(G_DEFAULT_ICON);
                                blueIcon.image = "http://gmaps-samples.googlecode.com/svn/trunk/markers/red/blank.png";

                                // Set up our GMarkerOptions object
                                markerOptions = { icon:blueIcon };
                                var latlng = new GLatLng(<?php 
        echo $item->lat;
        ?>
,<?php 
        echo $item->lon;
        ?>
);
                                map.addOverlay(new GMarker(latlng, markerOptions));
				map.setCenter(autoCenterBounds.getCenter(), Math.min(map.getBoundsZoomLevel(autoCenterBounds), maxZoom), maptype);
				
				<?php 
        /*if ($googlead) { ?>
        					var publisherID = '<?php echo $adid ?>';
        	
        					var adsManagerOptions = {
        						maxAdsOnMap : 1,
        						style: G_ADSMANAGER_STYLE_ADUNIT,
        						// The channel field is optional - replace this field with a channel number 
        						// of your own for Google AdSense tracking
        						channel: '<?php echo $slot ?>' 
        					};
        					
        					adsManager = new GAdsManager(map, publisherID, adsManagerOptions);
        					adsManager.enable();
        					<?php
        				}*/
        ?>
				
				//give the map a little time to fully load then remove the background
				setTimeout('document.getElementById("map_canvas").style.backgroundImage = "";',1000);
			}

			<?php 
        if ($ajaxmap) {
            ?>
				function loadScript() {
					if (toggle == 0) {
						loadMap();
						
					}
				}
			<?php 
        } else {
            ?>
				function addLoadEvent(func) { 
					var oldonload = window.onload; 
					if (typeof window.onload != 'function'){ 
						window.onload = func
					} else { 
						window.onload = function() {
							oldonload();
							func();
						}
					}
				}
				 
				addLoadEvent(loadMap); 
			<?php 
        }
        ?>
		
		</script> 
<?php 
    }
コード例 #4
0
        $ad_width = $this->hgconf->world_ad_width;
        $ad_height = $this->hgconf->world_ad_height;
        break;
}
$n = 0;
$i = 0;
$total = count($this->sponsors);
$norow = 100 / $this->hgconf->no_sponsorrow;
echo '<div class="boxlist">' . "\n";
echo '<div class="box_row">' . "\n";
foreach ($this->sponsors as $sponsor) {
    if ($n == 0) {
        echo '<div class="box_row">' . "\n";
    }
    echo '<div class="inbox" style="width:' . $norow . '%;"><div class="hg_box">';
    $link = JRoute::_(hotelguideHelperRoute::getItemRoute($sponsor->slug));
    echo '<div class="inframe">' . "\n";
    if ($sponsor->starrate > 0) {
        echo '<div class="trans">' . "\n";
        echo '<img src="' . JURI::base() . 'components/com_hotelguide/assets/images/' . $sponsor->starrate . 'star.png" alt="Star Rate"/>';
        echo '</div>' . "\n";
    }
    echo '<a href="' . $link . '" title="' . $sponsor->title . '">';
    if ($sponsor->mainimage) {
        echo '<img style="margin: 0; border:1px solid #bbbbbb;" src="' . JURI::base() . 'images/hotelguide/gallery/hotel_' . $sponsor->id . '/crop/' . $sponsor->mainimage . '" width="120px" alt="' . $sponsor->title . '" /></a>' . "\n";
    } else {
        echo '<img style="margin: 0; border:1px solid #cccccc;" src="' . JURI::base() . 'components/com_hotelguide/assets/images/no_image.gif" /></a>' . "\n";
    }
    echo '</div>' . "\n";
    echo '<div class="cap">' . "\n";
    echo '<div class="captionbar">' . "\n";
コード例 #5
0
 /**
  * Creates the item page
  *
  * @since 1.0
  */
 function display($tpl = null)
 {
     global $mainframe, $hgconf, $option;
     //initialize variables
     $document =& JFactory::getDocument();
     $user =& JFactory::getUser();
     $menus =& JSite::getMenu();
     $lang =& JFactory::getLanguage();
     $menu = $menus->getActive();
     $db =& JFactory::getDBO();
     $uri =& JFactory::getURI();
     $task = JRequest::getVar('task');
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     $cid = JRequest::getInt('cid', 0);
     //get hotel item data
     $model =& $this->getModel();
     $item =& $this->get('Item');
     $mapdatas =& $this->get('MapData');
     $rooms =& $this->get('Rooms');
     $restaurants =& $this->get('Restaurants');
     $spas =& $this->get('Spas');
     $promotions =& $this->get('Promotions');
     $galleries =& $this->get('Gallery');
     $articles =& $this->get('Articles');
     //Begin Jquery UI
     //Va primero la libreria Jquery para no crear conflictos con Mootools
     $document->addScript($this->baseurl . '/media/system/jquery/js/jquery-1.6.2.min.js');
     $document->addScript($this->baseurl . '/media/system/jquery/js/jquery-ui-1.8.16.custom.min.js');
     $document->addStyleSheet($this->baseurl . '/media/system/jquery/css/redmond/jquery-ui-1.8.16.custom.css');
     //End Jquery UI
     //add css file
     JHTML::_('behavior.mootools');
     if ($item->slideshow == 1 && count($galleries) > 0) {
         //$document->addScript( $this->baseurl.'/components/com_hotelguide/assets/js/jd.gallery.js');
         //$document->addScript( $this->baseurl.'/components/com_hotelguide/assets/js/jd.gallery.transitions.js');
         $document->addScript($this->baseurl . '/components/com_hotelguide/assets/js/galleria/galleria-1.2.8.min.js');
     }
     //$document->addScript( $this->baseurl.'/components/com_hotelguide/assets/js/slider.js');
     $document->addScript($this->baseurl . '/components/com_hotelguide/assets/js/slimbox.js');
     //$document->addScript( $this->baseurl.'/components/com_hotelguide/assets/js/qtabs.js');
     $document->addScript($this->baseurl . '/media/system/js/tabview.js');
     $document->addScript($this->baseurl . '/components/com_hotelguide/assets/js/roomrate.js');
     $document->addScript('http://www.jpmoser.com/hotelheading/js/collapsible_reviews.js');
     /*$document->addScript( $this->baseurl.'/components/com_hotelguide/assets/js/datepicker.packed_v6.js');
       $document->addStyleSheet($this->baseurl.'/components/com_hotelguide/assets/css/datepicker.css');*/
     $document->addScript($this->baseurl . '/media/system/js/modal.js');
     $document->addStyleSheet($this->baseurl . '/media/system/css/modal.css');
     //$document->addStyleSheet($this->baseurl.'/media/system/jquery/captcha/captcha.css');
     $key = $hgconf->api_key;
     $a_lang = explode('-', $document->getLanguage());
     if ($key && $hgconf->conti_map == 1) {
         $document->addScript('http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=' . $key . '&amp;hl=' . $a_lang[0]);
         //$document->addScript( $this->baseurl.'/components/com_hotelguide/assets/js/hotel_cluster.js');
     }
     JPluginHelper::importPlugin('content');
     $dispatcher =& JDispatcher::getInstance();
     $params =& $mainframe->getParams('com_content');
     //call the params from content
     $results = $dispatcher->trigger('onPrepareContent', array(&$item, &$params, 1));
     $filter_class = $mainframe->getUserStateFromRequest($option . '.hotel.filter_class', 'filter_class', '*', 'word');
     if ($filter_class == '*') {
         $filter_class = $hgconf->classification;
     }
     if ($this->getLayout() == 'form') {
         $db->setQuery("SELECT * FROM #__hg_facilities WHERE published = 1 ORDER BY name ASC");
         $facilities = $db->loadObjectList();
         if ($db->getErrorNum()) {
             return $db->getErrorMsg();
         }
         $aSelected = explode(",", $item->facilities);
         $i = 1;
         $facilityList = "";
         foreach ($facilities as $facility) {
             $bChecked = false;
             if (in_array($facility->id, $aSelected)) {
                 $bChecked = true;
             }
             if ($i == 1) {
                 $facilityList .= "<tr>";
             }
             $facilityList .= '<td width="300"><input type="checkbox" name="isFacility" value="' . $facility->id . '" onClick="updateCheckedList();" ';
             $facilityList .= $bChecked ? " checked" : "";
             $facilityList .= "/>";
             $facilityList .= $facility->name;
             $facilityList .= "</td>";
             if ($i == 2) {
                 $i = 1;
                 $facilityList .= "</tr>";
             } else {
                 $i++;
             }
         }
         $db->setQuery("SELECT * FROM #__hg_roomfacilities WHERE published = 1 ORDER BY name ASC");
         $roomfacilities = $db->loadObjectList();
         if ($db->getErrorNum()) {
             return $db->getErrorMsg();
         }
         $bSelected = explode(",", $item->roomfacilities);
         $i = 1;
         $roomfacilityList = "";
         foreach ($roomfacilities as $roomfacility) {
             $bChecked = false;
             if (in_array($roomfacility->id, $bSelected)) {
                 $bChecked = true;
             }
             if ($i == 1) {
                 $roomfacilityList .= "<tr>";
             }
             $roomfacilityList .= '<td width="300"><input type="checkbox" name="isRoomFacility" value="' . $roomfacility->id . '" onClick="updateCheckedRoomList();" ';
             $roomfacilityList .= $bChecked ? " checked" : "";
             $roomfacilityList .= "/>";
             $roomfacilityList .= $roomfacility->name;
             $roomfacilityList .= "</td>";
             if ($i == 2) {
                 $i = 1;
                 $roomfacilityList .= "</tr>";
             } else {
                 $i++;
             }
         }
         $this->assignRef('hgconf', $hgconf);
         $this->assignRef('facilityList', $facilityList);
         $this->assignRef('roomfacilityList', $roomfacilityList);
         $this->_displayForm($tpl);
         return;
     }
     $iparams =& $item->attribs;
     $params->merge($iparams);
     if ($item->id == 0) {
         $id = JRequest::getInt('id', 0);
         //			return JError::raiseError( 404, JText::sprintf( 'ITEM #%d NOT FOUND', $id ) );
     } else {
         $nextItem = $model->getNextItem($item->id, $item->ordering);
         if ($nextItem) {
             $nextItem->nextLink = urldecode(JRoute::_(hotelguideHelperRoute::getItemRoute(urlencode($nextItem->slug))));
         }
         $prevItem = $model->getPreviousItem($item->id, $item->ordering);
         if ($prevItem) {
             $prevItem->prevLink = urldecode(JRoute::_(hotelguideHelperRoute::getItemRoute(urlencode($prevItem->slug))));
         }
         // Absolute URL
         $item->absoluteURL = $uri->_uri;
         //Email link
         $item->emailLink = JRoute::_('index.php?option=com_mailto&tmpl=component&link=' . base64_encode($item->absoluteURL));
         //Social link
         $item->socialLink = urlencode($item->absoluteURL);
     }
     //get tags if enabled
     //		if ($params->get('show_tags')) {
     //        	$tags		= & $this->get('Tags');
     //		}
     if ($hgconf->show_favourite) {
         $favourites =& $this->get('Favourites');
         $favoured =& $this->get('Favoured');
     }
     //pathway
     //		$cats		= new hotelguide_cats($cid);
     //        $parents	= $cats->getParentlist();
     $pathway =& $mainframe->getPathWay();
     //		foreach($parents as $parent) {
     //			$pathway->addItem( $this->escape($parent->title), JRoute::_('index.php?view=category&cid='.$parent->categoryslug));
     //		}
     $pathway->addItem($this->escape($item->title), JRoute::_('index.php?view=hotel&id=' . $item->slug));
     // because the application sets a default page title, we need to get it
     // right from the menu item itself
     // Get the menu item object
     if (is_object($menu)) {
         $menu_params = new JParameter($menu->params);
         if (!$menu_params->get('page_title')) {
             $params->set('page_title', $item->title);
         }
     } else {
         $params->set('page_title', $item->title);
     }
     /*
     		if($cid) {
     			$parentcat = array_pop($parents);
     			$doc_title = $item->title.' - '.$parentcat->title;
     		} else {
     			$doc_title = $params->get( 'page_title' );
     		}
     
     		$document->setTitle($doc_title);
     */
     if ($item->meta_description) {
         $document->setDescription($item->meta_description);
     }
     if ($item->meta_keywords) {
         $document->setMetadata('keywords', $item->meta_keywords);
     }
     if ($mainframe->getCfg('MetaTitle') == '1') {
         $mainframe->addMetaTag('title', $item->title . ' - ' . $item->cityinfo->name . ' - ' . $item->countryinfo->name);
     }
     if ($mainframe->getCfg('MetaAuthor') == '1') {
         $mainframe->addMetaTag('author', $item->author);
     }
     $mdata = new JParameter($item->metadata);
     $mdata = $mdata->toArray();
     foreach ($mdata as $k => $v) {
         if ($v) {
             $document->setMetadata($k, $v);
         }
     }
     $print_link = JRoute::_('index.php?view=hotel&id=' . $item->slug . '&pop=1&tmpl=component');
     if (isset($item->facilitylist)) {
         $i = 0;
         $facilityList = '<div id="dropdown_3columns">';
         foreach ($item->facilitylist as $facility) {
             $imagelink = JURI::base() . 'images/hotelguide/pictogram/' . $facility->pictogram;
             $facilityList .= '<div class="col_1" style="width:22%">';
             if (strlen(strip_tags($facility->name)) > 25) {
                 $facilityList .= '<p style="height:30px; line-height:14px; display:inline"><img src="' . $imagelink . '" width="19px" height="19px" class="img_left imgshadow" style="padding:1px;" align="left" alt="' . $facility->name . '" />';
             } else {
                 //$facilityList .= '<p style="height:30px; line-height:30px; display:inline"><img src="'.$imagelink. '" width="19px" height="19px" class="img_left imgshadow" style="padding:1px;" align="left" alt="'.$facility->name.'" />';
                 $facilityList .= '<p style="height:30px; line-height:18px; display:inline"><img src="' . $imagelink . '" width="19px" height="19px" class="img_left imgshadow" style="padding:1px;" align="left" alt="' . $facility->name . '" />';
             }
             $facilityList .= $facility->name . '</p></div>';
             if ($i == 3) {
                 $i = 0;
                 $facilityList .= '<div style="clear:both;"></div>' . "\n";
             } else {
                 $i++;
             }
         }
         $facilityList .= "</div>";
     }
     /*		
     		if ($item->roomfacilities) {
     			$db->setQuery( "SELECT * FROM #__hg_roomfacilities WHERE id IN (".$item->roomfacilities.") ORDER BY name ASC");
     			$roomfacilities = $db->loadObjectList();
     	
     			if ($db->getErrorNum()) 
     			{
     				return $db->getErrorMsg();
     			}
     
     			$roomfacilityList = '<div id="list_wrapper"><ul class="multiple_columns">' . "\n";
     			foreach ( $roomfacilities as $roomfacility )
     			{
     				$roomfacilityList .= '<li>';
     				$roomfacilityList .= $roomfacility->name;
     				$roomfacilityList .='</li>' . "\n";
     			}
     			$roomfacilityList .= '</ul></div>' . "\n";
     			$roomfacilityList .= '<div style="clear:both;padding-bottom:10px;"></div>' . "\n";
     		}
     */
     $modelcity =& $this->getModel('city');
     $modelcity->setId($item->city);
     $modelcity->setState('limit', 1000);
     $hotelitems = $modelcity->getData();
     $totalhotels = 0;
     /*$hotelList = '<ul id="menu" style="margin-bottom:10px">' . "\n";
     		$hotelList .= '<li><a href="#" class="drop">'.JText::_('HG_OTHER_ACCOMMODATIONS').'</a>' . "\n";
     		$hotelList .= '<div class="dropdown_4columns">' . "\n";
     		$i = 0;
     		foreach ( $hotelitems as $hotel ) {
     			if ($hotel->id == $item->id) continue;
     			$link =  JRoute::_( hotelguideHelperRoute::getItemRoute($hotel->slug));
     				
     			if ($hotel->mainimage)
     				$imagelink = JURI::base() .'images/hotelguide/gallery/hotel_'.$hotel->id.'/smallcrop/' .$hotel->mainimage;
     			else
     				$imagelink = JURI::base() .'/components/com_hotelguide/assets/images/no_list.gif';
     
     			$hotelList .= '<div class="col_1" style="height:34px; overflow:hidden;">';
     			if (strlen(strip_tags($hotel->title)) > 22) {
     				$hotel->text = substr($hotel->text, 0, 30);
     				$hotel->text = trim($hotel->text) . "...\n\n";
     				$hotelList .= '<p style="line-height:16px;"><a href="'.$link.'"><img src="'.$imagelink.'" width="20px" class="img_left imgshadow" align="left" alt="'.$hotel->title.'" />';
     			} else {
     				$hotelList .= '<p style="line-height:32px;"><a href="'.$link.'"><img src="'.$imagelink.'" width="20px" class="img_left imgshadow" align="left" alt="'.$hotel->title.'" />';
     			}
     			$hotelList .= JText::_($hotel->title).'</a></p></div>';
     				
     			$i++;
     			if ($i == 4) {
     				$hotelList .= '<div style="clear:both;"></div>' . "\n"; 
     				$i = 0;
     			}  
     			$totalhotels++;
     		} 
     		$hotelList .= '</div></li>' . "\n";	
     		
     		if ($user->id > 0) {
     			$hotelList .= '<li>'.hg_html::favoure( $item, $favoured ).'</li>' . "\n";
     			$hotelList .= '<li>'.hg_html::favourites().'</li>' . "\n";
     //			$hotelList .= '<li class="dif">'.hg_html::registerhotel().'<b class="s4"></b>' . "\n";
     		}
     		$hotelList .= '<li>'.hg_html::search().'</li>' . "\n";
     		
     		$hotelList .= '</ul>' . "\n";*/
     $modelreview =& $this->getModel('Userrates');
     $modelreview->setId($item->id);
     $testimonials = $modelreview->getTestimonial();
     $totaltestimonials = $modelreview->getTotalTestimonials();
     $edittestimonials = $modelreview->getEditTestimonial();
     $editor =& JFactory::getEditor();
     $lan = substr($lang->_lang, 0, 2);
     $this->assignRef('hgconf', $hgconf);
     $this->assignRef('db', $db);
     $this->assignRef('url', $url);
     $this->assignRef('user', $user);
     $this->assignRef('document', $document);
     $this->assignRef('a_lang', $a_lang);
     $this->assignRef('model', $model);
     $this->assignRef('item', $item);
     $this->assignRef('rooms', $rooms);
     $this->assignRef('categories', $categories);
     $this->assignRef('restaurants', $restaurants);
     $this->assignRef('spas', $spas);
     $this->assignRef('promotions', $promotions);
     $this->assignRef('galleries', $galleries);
     $this->assignRef('user', $user);
     $this->assignRef('params', $params);
     $this->assignRef('print_link', $print_link);
     $this->assignRef('facilityList', $facilityList);
     $this->assignRef('mapdatas', $mapdatas);
     $this->assignRef('directory', $directory);
     $this->assignRef('prevItem', $prevItem);
     $this->assignRef('nextItem', $nextItem);
     $this->assignRef('hotelList', $hotelList);
     $this->assignRef('articles', $articles);
     $this->assignRef('totalhotels', $totalhotels);
     $this->assignRef('task', $task);
     $this->assignRef('lan', $lan);
     $this->assignRef('favourites', $favourites);
     $this->assignRef('favoured', $favoured);
     $this->assignRef('totaltestimonials', $totaltestimonials);
     $this->assignRef('testimonials', $testimonials);
     $this->assignRef('edittestimonials', $edittestimonials);
     /*
     		echo "<pre>";
     		echo "view=";
     		print_r($rooms);
     		echo "</pre>";
     */
     parent::display($tpl);
 }
コード例 #6
0
 echo '<div class="colmask">' . "\n";
 $imagewidth = $this->event->imagewidth + 30;
 if ($this->event->image) {
     echo '<div class="leftcol" style="width:' . $imagewidth . 'px">' . "\n";
     echo '<img class="img_left imgshadow" style="padding:4px; margin: 6px 6px; border-color:' . $this->hgconf->bordercolor . '" src="' . JURI::base() . 'images/hotelguide/event/resize/' . $this->event->image . '" align="left" width="' . $this->event->imagewidth . 'px" height="' . $this->event->imageheight . 'px" />';
     if ($this->event->lat) {
         echo '<div class="clear"></div>' . "\n";
         echo '<div class="img_left imgshadow" style="width: ' . $this->event->imagewidth . 'px; padding:4px; margin: 6px 6px; border-color:' . $this->hgconf->bordercolor . '">' . "\n";
         echo '<h2 style="font-size: 1.0em; line-height:1.4em; text-align: center; color: #888; background-color: #1B1B1B; margin:0;">' . JText::_('HG_LOCATION_MAP') . '</h2>' . "\n";
         echo '<div id="map" ><div id="map_canvas" style="width: ' . $this->event->imagewidth . 'px; height: ' . $this->event->imagewidth . 'px; border:none;"></div></div>' . "\n";
         echo '</div>' . "\n";
     }
     echo '</div>' . "\n";
 }
 if ($this->event->description) {
     $link = JRoute::_(hotelguideHelperRoute::getItemRoute($this->event->hotelslug));
     echo '<div class="rightcol" style="margin:10px 0 0 10px">' . "\n";
     if ($this->event->hits > 0) {
         echo '<p><span style="position: absolute; right:0px; font-size:11px;">';
         if ($this->event->hits == 1) {
             echo JText::_('HG_VISIT');
         }
         if ($this->event->hits > 1) {
             echo JText::sprintf('HG_VISITS', $this->event->hits);
         }
         echo '</span></p>' . "\n";
     }
     echo '<ul id="top" class="feature">' . "\n";
     echo '<li class="feature">' . "\n";
     echo '<strong>' . JText::_('HOTEL') . ':&nbsp;</strong>' . "\n";
     echo '<a href="' . $link . '">' . $this->event->hotelname . '</a></li>' . "\n";