Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
440 changes: 175 additions & 265 deletions more-with-symfony/ru/03-Enhance-your-Productivity.markdown
100755 → 100644

Large diffs are not rendered by default.

477 changes: 190 additions & 287 deletions more-with-symfony/ru/04-Emails.markdown
100755 → 100644

Large diffs are not rendered by default.

293 changes: 97 additions & 196 deletions more-with-symfony/ru/05-Custom-Widgets-and-Validators.markdown
100755 → 100644

Large diffs are not rendered by default.

543 changes: 174 additions & 369 deletions more-with-symfony/ru/06-Advanced-Forms.markdown
100755 → 100644

Large diffs are not rendered by default.

37 changes: 18 additions & 19 deletions more-with-symfony/ru/A-sfWidgetFormGMapAddress.markdown
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
Appendix A - JavaScript code for sfWidgetFormGMapAddress
Приложение A - JavaScript-код для sfWidgetFormGMapAddress
========================================================

The following code is the JavaScript needed to make the
`sfWidgetFormGMapAddress` widget work:
Следующий JavaScript-код необходим для работы виджета `sfWidgetFormGMapAddress`:

[js]
function sfGmapWidgetWidget(options){
// this global attributes
// глобальные атрибуты
this.lng = null;
this.lat = null;
this.address = null;
Expand All @@ -26,39 +25,39 @@ The following code is the JavaScript needed to make the
return;
}

// retrieve dom element
// получение dom-элементов
this.lng = jQuery("#" + this.options.longitude);
this.lat = jQuery("#" + this.options.latitude);
this.address = jQuery("#" + this.options.address);
this.lookup = jQuery("#" + this.options.lookup);

// create the google geocoder object
// создание объекта google geocoder
this.geocoder = new GClientGeocoder();

// create the map
// создание карты
this.map = new GMap2(jQuery("#" + this.options.map).get(0));
this.map.setCenter(new GLatLng(this.lat.val(), this.lng.val()), 13);
this.map.setUIToDefault();

// cross reference object
// связывание объектов между собой
this.map.sfGmapWidgetWidget = this;
this.geocoder.sfGmapWidgetWidget = this;
this.lookup.get(0).sfGmapWidgetWidget = this;

// add the default location
// добавление позиции по умолчанию
var point = new GLatLng(this.lat.val(), this.lng.val());
var marker = new GMarker(point);
this.map.setCenter(point, 15);
this.map.addOverlay(marker);

// bind the move action on the map
// связывание действия move карты
GEvent.addListener(this.map, "move", function() {
var center = this.getCenter();
this.sfGmapWidgetWidget.lng.val(center.lng());
this.sfGmapWidgetWidget.lat.val(center.lat());
});

// bind the click action on the map
// связывание действия click по карте
GEvent.addListener(this.map, "click", function(overlay, latlng) {
if (latlng != null) {
sfGmapWidgetWidget.activeWidget = this.sfGmapWidgetWidget;
Expand All @@ -70,7 +69,7 @@ The following code is the JavaScript needed to make the
}
});

// bind the click action on the lookup field
// связывание действия click по полю lookup
this.lookup.bind('click', function(){
sfGmapWidgetWidget.activeWidget = this.sfGmapWidgetWidget;

Expand All @@ -86,12 +85,12 @@ The following code is the JavaScript needed to make the
sfGmapWidgetWidget.activeWidget = null;
sfGmapWidgetWidget.lookupCallback = function(point)
{
// get the widget and clear the state variable
// получение виджета и очистка переменной состояния
var widget = sfGmapWidgetWidget.activeWidget;
sfGmapWidgetWidget.activeWidget = null;

if (!point) {
alert("address not found");
alert("адрес не найден");
return;
}

Expand All @@ -103,27 +102,27 @@ The following code is the JavaScript needed to make the

sfGmapWidgetWidget.reverseLookupCallback = function(response)
{
// get the widget and clear the state variable
// получение виджета и очиста переменной состояния
var widget = sfGmapWidgetWidget.activeWidget;
sfGmapWidgetWidget.activeWidget = null;

widget.map.clearOverlays();

if (!response || response.Status.code != 200) {
alert('no address found');
alert('адрес не найден');
return;
}

// get information location and init variables
// получение информации о расположении и инициализация переменных
var place = response.Placemark[0];
var point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
var marker = new GMarker(point);

// add marker and center the map
// добавление маркера и центровка карты
widget.map.setCenter(point, 15);
widget.map.addOverlay(marker);

// update values
// обновление значений
widget.address.val(place.address);
widget.lat.val(place.Point.coordinates[1]);
widget.lng.val(place.Point.coordinates[0]);
Expand Down
6 changes: 3 additions & 3 deletions more-with-symfony/ru/B-Custom-Installer-Example.markdown
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Appendix B - Custom Installer Example
=====================================
Приложение B - Пример заказного установщика
===========================================

The following PHP code is a custom installer used in [Chapter 06](#chapter_06):
Ниже приведён пример PHP-кода, реализующего заказной установщик, который используется в [Главе 06](#chapter_06):

[php]
<?php
Expand Down