Documentation

Horde_Core_Ajax_Imple_Geocoder_Geonames extends Horde_Core_Ajax_Imple
in package

Geocode client for the Geonames API.

Copyright 2009-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Tags
author

Michael J. Rubinsky mrubinsk@horde.org

category

Horde

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

Properties

$_auth  : bool
Does this imple require authentication?
$_domid  : int
DOM ID incrementer. Shared by all Imple instances.
$_init  : bool
Has this imple been initialized?
$_observe  : string
The javascript event to observe.
$_params  : array<string|int, mixed>
Parameters needed by the subclasses.

Methods

__construct()  : mixed
Constructor.
attach()  : mixed
Attach the object to a javascript event.
getDomId()  : string
Return the DOM ID this Imple is attached to.
getImpleUrl()  : Horde_Url
The URL to the imple AJAX endpoint. This should only be used if the javascript code.
handle()  : mixed
Imple handler.
_attach()  : mixed
Attach the object to a javascript event.
_handle()  : mixed
Imple handler.
_impleParams()  : array<string|int, mixed>
Add the necessary parameters to the imple AJAX request.
_jsOnComplete()  : mixed
Javascript code to run on a successful AJAX response.
_jsOnDoAction()  : mixed
Javascript code to run before the action is sent to the AJAX endpoint.

Properties

$_auth

Does this imple require authentication?

protected bool $_auth = \true

$_domid

DOM ID incrementer. Shared by all Imple instances.

protected static int $_domid = 0

$_init

Has this imple been initialized?

protected bool $_init = \false

$_observe

The javascript event to observe.

protected string $_observe = 'click'

$_params

Parameters needed by the subclasses.

protected array<string|int, mixed> $_params = array()

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $params = array() ]) : mixed
Parameters
$params : array<string|int, mixed> = array()

Configuration parameters:

  • id: (string) [OPTIONAL] The DOM ID to attach to.

attach()

Attach the object to a javascript event.

public attach() : mixed

getDomId()

Return the DOM ID this Imple is attached to.

public getDomId() : string
Return values
string

DOM ID.

getImpleUrl()

The URL to the imple AJAX endpoint. This should only be used if the javascript code.

public final getImpleUrl() : Horde_Url
Return values
Horde_Url

URL to the AJAX endpoint.

handle()

Imple handler.

public handle(Horde_Variables $vars) : mixed
Parameters
$vars : Horde_Variables

A variables object.

Return values
mixed

Data to return to the browser.

_attach()

Attach the object to a javascript event.

protected _attach(mixed $init) : mixed
Parameters
$init : mixed

Is this the first time this imple has been initialized?

Return values
mixed

An array of javascript parameters. If false, the imple handler will ignore this instance (calling code will be responsible for calling imple endpoint).

_handle()

Imple handler.

protected _handle(Horde_Variables $vars) : mixed
Parameters
$vars : Horde_Variables

A variables object.

Tags
TODO:

For reverse requests come up with a reasonable algorithm for checking if we have a lat/lng in the US since the findNearestAddress method is US only. If non-us, fallback to a findNearest or findPostalcode or similar request. Also will need to normalize the various response structures.

'locations' will trigger a forward geocoding request. 'lat' and 'lon' will trigger a reverse geocoding request.

throws
Horde_Exception
Return values
mixed

Data to return to the browser.

_impleParams()

Add the necessary parameters to the imple AJAX request.

protected final _impleParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

URL parameter hash.

_jsOnComplete()

Javascript code to run on a successful AJAX response.

protected _jsOnComplete(string $js) : mixed

e.memo contains the AJAX response.

Parameters
$js : string

JS code to run.

_jsOnDoAction()

Javascript code to run before the action is sent to the AJAX endpoint.

protected _jsOnDoAction(string $js) : mixed

e.memo contains the list of URL parameters.

Parameters
$js : string

JS code to run.


        
On this page

Search results