Ignore:
Timestamp:
Oct 9, 2010, 12:28:05 AM (14 years ago)
Author:
grum
Message:

KML files manager implemented + fixe some small bugs + forgotten file for the search page

Location:
extensions/GMaps/admin
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/GMaps/admin/gmaps_admin.tpl

    r7054 r7132  
    11<h2 style="float:right;top:-24px;position:relative;height:auto;font-size:12px;font-weight:normal;">{$plugin.GMAPS_VERSION}</h2>
    22
     3{if isset($errcode) and $errcode!=''}
     4<div class='errors' id='iErrorMsg'>
     5<p>{'gmaps_action_was_stopped'|@translate}</p>
     6<p style='font-style:italic;margin:0 30px;'>{$errcode}</p>
     7</div>
     8{/if}
     9
    310{$GMAPS_BODY_PAGE}
  • extensions/GMaps/admin/gmaps_category_maps.tpl

    r7125 r7132  
    4949
    5050      $('#iBDAssocMapId').bind('change', changeMapDisplayType);
     51      $('[name=fBDAssocKmlFile]').bind('change', changeKmlFileSource);
    5152
    5253      loadList();
    53 
     54    }
     55
     56    /**
     57     * called when the source of kml file changed
     58     */
     59    var changeKmlFileSource = function ()
     60    {
     61      switch($('[name=fBDAssocKmlFile]:checked').val())
     62      {
     63        case 'N':
     64          $('#iBDAssocKmlFileId').css('display', 'none');
     65          $('#iBDAssocKmlFileUrl').css('display', 'none');
     66          $('#iBDKmlWarning').css('display', 'none');
     67          break;
     68        case 'S':
     69          $('#iBDAssocKmlFileId').css('display', 'block');
     70          $('#iBDAssocKmlFileUrl').css('display', 'none');
     71          $('#iBDKmlWarning').css('display', 'block');
     72          break;
     73        case 'U':
     74          $('#iBDAssocKmlFileId').css('display', 'none');
     75          $('#iBDAssocKmlFileUrl').css('display', 'block');
     76          $('#iBDKmlWarning').css('display', 'block');
     77          break;
     78      }
    5479    }
    5580
     
    196221        $('#iBDAssocMapId').val($('#iBDAssocMapId option:first').val());
    197222        $('#iBDAssocApplySubCat').val('y');
     223        $('#iBDAssocKmlNone').attr('checked', true);
     224        $('#iBDAssocKmlFileId').val($('#iBDAssocKmlFileId option:first').val());
    198225        $('#iBDAssocKmlFileUrl').val('');
    199         $('#iBDAssocIcon').val($('#iBDAssocIcon option:visible:first').val());
     226        $('#iBDAssocIcon').val($('#iBDAssocIcon option:first').val());
    200227        $('#iBDAssocTitle').val('');
    201228      }
     
    207234        $('#iBDAssocMapId').val(tmp.mapId);
    208235        $('#iBDAssocApplySubCat').val(tmp.applySubCat);
     236        if(tmp.kmlFileId>0)
     237        {
     238          $('#iBDAssocKmlSelect').attr('checked', true);
     239        }
     240        else if(tmp.kmlFileUrl!='')
     241        {
     242          $('#iBDAssocKmlUrl').attr('checked', true);
     243        }
     244        else
     245        {
     246          $('#iBDAssocKmlNone').attr('checked', true);
     247        }
     248        $('#iBDAssocKmlFileId').val(tmp.kmlFileId);
    209249        $('#iBDAssocKmlFileUrl').val(tmp.kmlFileUrl);
    210250        $('#iBDAssocIcon').val(tmp.icon);
     
    213253
    214254      changeMapDisplayType();
     255      changeKmlFileSource();
    215256    }
    216257
     
    269310        mapId:$('#iBDAssocMapId').val(),
    270311        applySubCat:$('#iBDAssocApplySubCat').val(),
    271         kmlFileUrl:$('#iBDAssocKmlFileUrl').val(),
     312        kmlFileId:($('#iBDAssocKmlSelect').attr('checked'))?$('#iBDAssocKmlFileId').val():0,
     313        kmlFileUrl:($('#iBDAssocKmlSelect').attr('checked'))?'':$('#iBDAssocKmlFileUrl').val(),
    272314        icon:$('#iBDAssocIcon').val(),
    273315        title:$('#iBDAssocTitle').val(),
     
    339381    <th>{'gmaps_category'|@translate}</th>
    340382    <th style="width:90px;">{'gmaps_apply_subcat'|@translate}</th>
    341     <th style="width:90px;">{'gmaps_mapType'|@translate}</th>
    342     <th style="width:356px;">{'gmaps_map'|@translate}</th>
    343     <th style="width:90px;">{'gmaps_map_kmlfile'|@translate}</th>
     383    <th style="width:150px;">{'gmaps_mapType'|@translate}</th>
     384    <th style="width:350px;">{'gmaps_map'|@translate}</th>
     385    <th style="width:220px;">{'gmaps_map_associate_kmlfile'|@translate}</th>
    344386    <th width="40px">&nbsp;</th>
    345387  </tr>
     
    432474            <td>{'gmaps_map_associate_kmlfile'|@translate}</td>
    433475            <td>
    434               <input type="text" id="iBDAssocKmlFileUrl" maxlength='255' size='55' value="">
     476              <label><input type="radio" id='iBDAssocKmlNone' name="fBDAssocKmlFile" value="N">&nbsp;{'gmaps_kml_file_none'|@translate}</label><br>
     477              <label><input type="radio" id='iBDAssocKmlSelect' name="fBDAssocKmlFile" value="S">&nbsp;{'gmaps_kml_file_selected'|@translate}</label><br>
     478              <select style="margin-left:20px;margin-bottom:10px;"  id="iBDAssocKmlFileId">
     479                {foreach from=$datas.kmlFiles item=file}
     480                  <option value='{$file.id}'>{$file.name}</option>
     481                {/foreach}
     482              </select>
     483
     484              <label><input type="radio" id='iBDAssocKmlUrl' name="fBDAssocKmlFile" value="U">&nbsp;{'gmaps_kml_file_url'|@translate}</label><br>
     485              <input style="margin-left:20px;" type="text" id="iBDAssocKmlFileUrl" maxlength='255' size='55' value=""><br>
     486              <p id='iBDKmlWarning' class='helps' style="width:520px;padding-right:20px;">{'gmaps_kml_file_access'|@translate}</p>
     487
    435488            </td>
    436489          </tr>
  • extensions/GMaps/admin/gmaps_category_maps_iListMaps.tpl

    r7125 r7132  
    44    <td>{$data.catName}</td>
    55    <td style="width:90px;">{$data.applySubCat}</td>
    6     <th style="width:150px;">{$data.displayType}</th>
    7     <td style="width:300px;">{$data.mapName}</td>
    8     <td style="width:90px;">{$data.mapKmlFile}</td>
     6    <td style="width:150px;">{$data.displayType}</td>
     7    <td style="width:350px;">{$data.mapName}</td>
     8    <td style="width:220px;">
     9      {if $data.mapKmlFile==''}
     10        {'gmaps_n'|@translate}
     11      {else}
     12        {'gmaps_y'|@translate}&nbsp;<span style='font-style:italic;'>({$data.mapKmlFile})</span>
     13      {/if}
     14    </td>
    915
    1016    <td width="40px">
Note: See TracChangeset for help on using the changeset viewer.