Assembla home | Assembla project page
 

Changeset 85

Show
Ignore:
Timestamp:
07/12/07 14:35:33 (1 year ago)
Author:
digitalspaghetti
Message:

Changes in GMapp, Added new maps system to events view pages, improved events

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branch/controllers/events_controller.php

    r79 r85  
    141141                } 
    142142        } 
     143         
     144        function upcoming() 
     145        { 
     146                $events = $this->Event->findAll('Event.event_date >= NOW()'); 
     147                if(isset($this->params['requested'])) { 
     148                        return $events; 
     149                } 
     150                $this->set('events',$events); 
     151        } 
    143152 
    144153} 
  • branch/views/elements/js_include.ctp

    r80 r85  
    22<?php echo $javascript->link('http://www.google.com/uds/api?file=uds.js&v=1.0&key=ABQIAAAApCYnM8S-TSRBhQk16Ynr4BRA04cqJrHarhjq-7w24zYog0j8lRSudZ1P7zGx8GlIuWk6PlgJYmhZtw') ?> 
    33<?php e($javascript->link('jquery'));?> 
     4<?php e($javascript->link('jquery.fastid.js'));?> 
    45<?php e($javascript->link('jquery.dimensions'));?> 
    56<?php e($javascript->link('jquery.bgiframe.min'));?> 
  • branch/views/events/admin_add.ctp

    r79 r85  
    88                echo $form->input('event_type_id'); 
    99                echo $form->input('event_url'); 
    10                 echo $form->input('body'); 
     10                echo $form->input('event_ticket1', array('label'=>'Ticket URL')); 
     11                echo $form->input('event_ticket2', array('label'=>'Ticket Phone')); 
     12                echo $form->input('event_price', array('label'=>'Ticket Price')); 
     13                echo $form->input('body', array('class'=>'wymeditor')); 
    1114        ?> 
    1215        </fieldset> 
     
    2225        <fieldset> 
    2326                <legend><?php __('Event Metadata');?></legend> 
    24                         <?php echo $form->input('tags', array('type'=>'text'));?> 
     27                        <?php echo $form->input('tags', array('type'=>'text', 'class'=>'tags'));?> 
    2528        </fieldset> 
    2629         
     
    2932                        <?php echo $form->input('published'); ?> 
    3033        </fieldset> 
    31 <?php echo $form->end('Submit');?> 
     34<?php echo $form->end('Submit',  array('class'=>'wymupdate'));?> 
    3235</div> 
  • branch/views/events/view.ctp

    r79 r85  
     1<?php e($javascript->codeBlock('$j().ready(function(){$j("#gmap").gmapp({center: ['. $event['Venue']['latitude'] .','. $event['Venue']['longitude'] .']});});'));?> 
     2<?php e($javascript->codeBlock('$j().ready(function(){$("#gmap").addPoint("' . $event['Venue']['latitude'] . '","' . $event['Venue']['longitude'] . '","' . $event['Venue']['name'] . '<br />' . $event['Venue']['street'] . '<br />' . $event['Venue']['city'] . ',' . $event['Venue']['postcode'] . '");});'));?> 
     3 
    14<div class="event"> 
    25        <h2><?php  __('Event');?></h2> 
    36 
    4         <div style="float:left;width:400px;"> 
    5                 <?php 
    6                         $default = array('type'=>'2','zoom'=>$event['Venue']['zoom'],'lat'=>$event['Venue']['latitude'],'long'=>$event['Venue']['longitude']); 
    7                         $draw[0]['Venue']['latitude'] = $event['Venue']['latitude']; 
    8                         $draw[0]['Venue']['longitude'] = $event['Venue']['longitude']; 
    9                         $draw[0]['Venue']['title'] = $event['Venue']['name']; 
    10                         $draw[0]['Venue']['html'] = $event['Venue']['street'] . ",<br />" . $event['Venue']['city'] . ",<br />" . $event['Venue']['postcode']; 
    11                         echo $googleMap->map($default, $style = 'width:100%; height: 400px' ); 
    12                         echo $googleMap->addMarkers($draw); 
    13                 ?> 
    14         </div> 
     7        <div style="float:left;width:400px;height:400px;" id="gmap"></div> 
    158        <div style="float:left;width:15%"> 
    169                <dl> 
  • branch/views/layouts/default.ctp

    r80 r85  
    3838                                </div> 
    3939                                <div class="yui-u"> 
    40                                                 <?php e($this->element('tagcloud'));?> 
     40                                                <?php e($this->element('upcoming'));?> 
    4141                                </div> 
    4242                                <div class="yui-u"> 
  • branch/webroot/js/jquery.gmapp.js

    r84 r85  
    4646                                 
    4747                                this.GMap2.setCenter(new GLatLng(settings.center[0],settings.center[1]),settings.zoom,settings.maptype); 
    48                                  
    4948                                switch(settings.control) 
    5049                                { 
     
    6564                                        this.GMap2.addControl(new GOverviewMapControl()); 
    6665                                } 
     66                                 
    6767                                /*jQuery(this).after('<p><strong>Google Map Application Version ' + version + '</strong></p>');*/ 
    6868                                 
    6969                                /* Seach for the lat & lng of our address*/ 
    7070                                jQuery('#findaddress').bind('click', function(){ 
    71                                         jQuery.gmapp.searchAddress(jQuery(settings.geocode).attr('value'), GGeocoder, infoarea); 
     71                                        jQuery.gmapp.searchAddress(jQuery(settings.geocode).attr('value'), GGeocoder, infoarea, settings); 
    7272                                });      
     73                                 
    7374                        }); 
    7475                } 
     
    7677         
    7778        /* FIXME: Search for an address or postcode, return the GLatLng and center map.  Then add a dragable marker*/ 
    78         searchAddress : function(address, GGeocoder, infoarea) { 
     79        searchAddress : function(address, GGeocoder, infoarea, settings) { 
    7980                GGeocoder.getLatLng( 
    8081                address, 
     
    8384                                alert(address + " not found"); 
    8485                        } else { 
    85                                 this.GMap2.setCenter(point,12); 
     86                                return this[0].GMap2.setCenter(point,settings.zoom); 
    8687                                var marker = new GMarker(point, {draggable: true}); 
    87                                 this.GMap2.addOverlay(marker); 
     88                                return this[0].GMap2.addOverlay(marker); 
    8889                                marker.openInfoWindowHtml("Lat: " + point.lat() + " Lng: " + point.lng()); 
    8990                                GEvent.addListener(marker, "dragend", function(){ 
     
    104105        /* FIXME: Add's a point to the current map (this function currently does not give the desired results)*/ 
    105106        /* Example: $("#gmap").addPoint({pointlat:55.958387,pointlnt:-3.162367, pointhtml:"My Point", isdraggable:true});*/ 
    106         addPoint : function(pointlat, pointlng, pointhtml, isdraggable,centermap) { 
     107        addPoint : function(pointlat, pointlng, pointhtml, isdraggable) { 
    107108                var marker = new GMarker(new GLatLng(pointlat,pointlng), { draggable: isdraggable } ); 
     109                GEvent.addListener(marker, "click", function(){ 
     110                        marker.openInfoWindowHtml(pointhtml); 
     111                }); 
    108112                return this[0].GMap2.addOverlay(marker); 
    109                 if (centermap == true) { 
    110                         return this[0].GMap2.setCenter(new GLatLng(pointlat,pointlng),10); 
    111                 } 
     113                 
    112114        } 
    113115}