Changeset 240 for trunk/install


Ignore:
Timestamp:
06/15/2011 09:07:03 PM (11 months ago)
Author:
sque
Message:

[installer] Moved keydragzoom script locally
[installer] Added output_buffer to prevent error for too late sent headers
[installer] Moved map scripts only inside mapbounds step.
[installer] Dropped constrain for existing database server name. undefined is acceptable.

Location:
trunk/install
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/install/index.php

    r239 r240  
    2323header('Content-Type: text/html;charset=utf-8;'); 
    2424 
     25 
    2526installation_session(); 
    26  
     27ob_start(); 
    2728/* 
    2829 * Step initialization and calculation 
     
    5758        <title>WiND - Installation</title> 
    5859        <link rel="stylesheet" href="<?php echo surl('/../templates/basic/css/styles_packed.css')?>" > 
    59         <link rel="stylesheet" href="install.css"> 
    60         <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false" ></script> 
    61         <script src="http://google-maps-utility-library-v3.googlecode.com/svn/tags/keydragzoom/2.0.5/src/keydragzoom_packed.js" type="text/javascript"></script> 
     60        <link rel="stylesheet" href="install.css">       
    6261        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>   
    6362</head> 
     
    9998</body> 
    10099</html> 
     100 
     101<?php 
     102ob_end_flush();  
     103?> 
  • trunk/install/steps/step_dbinit.php

    r239 r240  
    3838if (!isset($row[0][0])) { 
    3939        show_error('Error getting data from database.' . mysql_error($link)); 
    40         exit; 
     40        return false; 
    4141} 
    4242if ($row[0][0] > 0) { 
  • trunk/install/steps/step_dbsetup.php

    r239 r240  
    3434        $def_values = array_merge($def_values, $_POST); 
    3535         
    36         // Validation 
    37         if (empty($def_values['server'])) { 
    38                 show_error('You need to define a <strong>server</strong> to connect.'); 
    39                 $step_result = false; 
    40         } 
    4136        if (empty($def_values['database'])) { 
    4237                show_error('You need to define a <strong>database</strong> to connect.'); 
  • trunk/install/steps/step_mapbounds.php

    r239 r240  
    4545        $step_result = false; 
    4646?> 
    47  
    4847<p class="description">Hold down <strong>shift</strong> and select the area of all wireless networks that this installation will handle. 
    4948</p> 
     
    5958</form> 
    6059 
    61 <script> 
    62  
    63 // Render selection box on map 
    64 function selection_box(bounds) { 
    65         // Remove previous 
    66         if (typeof(rect) != 'undefined') { 
    67                 rect.setMap(null); 
     60<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false" ></script> 
     61<script type="text/javascript" src="js/keydragzoom_packed.js" ></script> 
     62<script type="text/javascript"> 
     63$(document).ready(function(){ 
     64        // Render selection box on map 
     65        function selection_box(bounds) { 
     66                // Remove previous 
     67                if (typeof(rect) != 'undefined') { 
     68                        rect.setMap(null); 
     69                } 
     70                rect = new google.maps.Rectangle({ 
     71                        bounds : bounds, 
     72                        clickable: false, 
     73                        map: map, 
     74                        strokeColor: 'red' 
     75                }); 
    6876        } 
    69         rect = new google.maps.Rectangle({ 
    70                 bounds : bounds, 
    71                 clickable: false, 
    72                 map: map, 
    73                 strokeColor: 'red' 
    74         }); 
    75 } 
    76  
    77 var myLatlng = new google.maps.LatLng(-34.397, 150.644); 
    78 var myOptions = { 
    79   zoom: 8, 
    80   center: myLatlng, 
    81   mapTypeId: google.maps.MapTypeId.ROADMAP 
    82 }; 
    83 var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 
    84 var initial_bounds = new google.maps.LatLngBounds( 
    85                 new google.maps.LatLng( 
    86                         parseInt(document.getElementsByName('min_latitude')[0].value), 
    87                         parseInt(document.getElementsByName('min_longitude')[0].value) 
    88                 ), 
    89                 new google.maps.LatLng( 
    90                         parseInt(document.getElementsByName('max_latitude')[0].value), 
    91                         parseInt(document.getElementsByName('max_longitude')[0].value) 
    92                 )); 
    93 selection_box(initial_bounds); 
    94 map.fitBounds(initial_bounds); 
    95  
    96 // simple drag zoom  
    97 map.enableKeyDragZoom( 
    98  
    99         {       key: "shift",  
     77         
     78        var myLatlng = new google.maps.LatLng(-34.397, 150.644); 
     79        var myOptions = { 
     80          zoom: 8, 
     81          center: myLatlng, 
     82          mapTypeId: google.maps.MapTypeId.ROADMAP 
     83        }; 
     84        var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 
     85        var initial_bounds = new google.maps.LatLngBounds( 
     86                        new google.maps.LatLng( 
     87                                parseInt(document.getElementsByName('min_latitude')[0].value), 
     88                                parseInt(document.getElementsByName('min_longitude')[0].value) 
     89                        ), 
     90                        new google.maps.LatLng( 
     91                                parseInt(document.getElementsByName('max_latitude')[0].value), 
     92                                parseInt(document.getElementsByName('max_longitude')[0].value) 
     93                        )); 
     94        selection_box(initial_bounds); 
     95        map.fitBounds(initial_bounds); 
     96         
     97        // simple drag zoom  
     98        map.enableKeyDragZoom({ 
     99                key: "shift",  
    100100                boxStyle: { border: "thin solid black", backgroundColor: "transparent", opacity: 1}, 
    101101                paneStyle: { backgroundColor: "gray", opacity: 0.4 } 
    102         } 
    103 ); 
     102                }); 
    104103 
    105 // Handle selection event 
    106 google.maps.event.addListener(map.getDragZoomObject(), 'dragend', function (bnds) { 
    107         document.getElementsByName('min_latitude')[0].value = bnds.getSouthWest().lat(); 
    108         document.getElementsByName('min_longitude')[0].value = bnds.getSouthWest().lng(); 
    109         document.getElementsByName('max_latitude')[0].value = bnds.getNorthEast().lat(); 
    110         document.getElementsByName('max_longitude')[0].value = bnds.getNorthEast().lng(); 
    111         selection_box(bnds);     
     104        // Handle selection event 
     105        google.maps.event.addListener(map.getDragZoomObject(), 'dragend', function (bnds) { 
     106                document.getElementsByName('min_latitude')[0].value = bnds.getSouthWest().lat(); 
     107                document.getElementsByName('min_longitude')[0].value = bnds.getSouthWest().lng(); 
     108                document.getElementsByName('max_latitude')[0].value = bnds.getNorthEast().lat(); 
     109                document.getElementsByName('max_longitude')[0].value = bnds.getNorthEast().lng(); 
     110                selection_box(bnds);     
     111        }); 
    112112}); 
    113113 
Note: See TracChangeset for help on using the changeset viewer.