PHP Class Geo_Map

Inheritance: extends DatabaseObject, implements IGeoMap
ファイルを表示 Open project: sourcefabric/newscoop Class Usage Examples

Public Properties

Property Type Description
$m_columnNames array
$m_dbTableName string
$m_keyColumnNames array

Public Methods

Method Description
GetArticleMapId ( $p_articleObj ) : integer Gives map id of the article
GetGeoSearchSQLQuery ( array $p_coordinates ) : string Gives the SQL query for article searching via their point inside the box specified by the p_coordinates.
GetLocationsByArticle ( $p_articleObj ) : array Gives array of artilce's map's points: just point names (of the article object language) and usage flags.
GetMapByArticle ( integer $p_articleNumber ) : Geo_Map
GetMapFilterBody ( ) : string Gives the body map-placement part for the map filtering
GetMapFilterCenter ( ) : string Gives the body map-centering (js call) part for the map filtering
GetMapFilterHeader ( integer $p_mapWidth, integer $p_mapHeight ) : string Gives the header part for the map filtering
GetMapFilterObjName ( ) : string Gives the name of the javascript object used for the map filtering
GetMapId ( ) TODO: obsolete, use $this->getId() instead.
GetMapIdByArticle ( integer $p_articleNumber ) : integer
GetMapIdsByArticle ( $p_articleObj ) : array Gives array of article's maps, with usage flags.
GetMapSearchBody ( ) : string Gives the body map-placement part for the map front end search by map-based rectangle selection
GetMapSearchCenter ( ) : string Gives the body map-centering (js call) part for the map front end search by map-based rectangle selection
GetMapSearchHeader ( integer $p_mapWidth, integer $p_mapHeight, mixed $p_bboxDivs = null ) : string Gives the header part for the map front end search by map-based rectangle selection the optional p_bboxDivs array of divs for automatical setting of the box corners coordinates.
GetMapTagBody ( integer $p_articleNumber, integer $p_languageId, $p_largeMap = false ) : string Gives the body map-placement part for the map front end presentation
GetMapTagCenter ( integer $p_articleNumber, integer $p_languageId ) : string Gives the body map-centering (js call) part for the map front end presentation
GetMapTagHeader ( integer $p_articleNumber, integer $p_languageId, integer $p_mapWidth, integer $p_mapHeight, array $p_options = null ) : string Gives the header part for the map front end presentation
GetMapTagList ( integer $p_articleNumber, integer $p_languageId ) : string
GetMapTagListData ( integer $p_articleNumber, integer $p_languageId ) : array Gives the body map-info and point-list part for the map front end presentation
GetMapTagOpen ( integer $p_articleNumber, integer $p_languageId, $p_specifier = null ) : string Gives the body open-large-map link part for the article-map front end presentation
GetMultiMapTagBody ( integer $p_languageId, integer $p_rank, $p_largeMap = false ) : string Gives the body map-placement part for the map front end presentation
GetMultiMapTagCenter ( integer $p_languageId, $p_rank ) : string Gives the body map-centering (js call) part for the map front end presentation
GetMultiMapTagHeader ( integer $p_languageId, $p_constraints, array $p_options, integer $p_offset, integer $p_limit, integer $p_mapWidth, integer $p_mapHeight, integer $p_rank ) : string Gives the header part for the multi-map front end presentation
GetMultiMapTagList ( integer $p_languageId, array $p_constraints, array $p_options, string $p_label, integer $p_offset, integer $p_limit, integer $p_rank ) : string
GetMultiMapTagListData ( integer $p_languageId, array $p_constraints, array $p_options, integer $p_offset, integer $p_limit, integer $p_rank ) : array Gives the body map-info and point-list part for the map front end presentation
GetMultiMapTagOpen ( integer $p_languageId, integer $p_rank, $p_specifier = null ) : string Gives the body open-large-map link part for the multi-map front end presentation
InsertPoints ( integer $p_mapId, integer $p_languageId, integer $p_articleNumber, array $p_insertion, array &$p_indices ) : array Inserts points (with locations and other contents) into the map.
LoadMapData ( integer $p_mapId, integer $p_languageId, integer $p_articleNumber, $p_preview = false, $p_textOnly = false ) : array Load map data
OnArticleCopy ( integer $p_srcArticleNumber, integer $p_destArticleNumber, array $p_copyTranslations, $p_userId = null ) : void Copy all the map-related pointers for the given article.
OnArticleDelete ( integer $p_articleNumber ) : void This is called when the (last language of the) article is deleted Remove map pointers to the given article.
OnCreateTranslation ( integer $p_articleNumber, integer $p_srcLanguageId, integer $p_destLanguageId ) : void Copy all the pointers for the given article.
OnLanguageDelete ( integer $p_articleNumber, integer $p_languageId ) : void This is called when a (non-last) language is deleted.
ReadLanguagesByArticle ( integer $p_articleNumber ) : array Gives languages used at the map's article
ReadLanguagesByMap ( integer $p_mapId ) : array Gives languages used at the map text contents
ReadMapId ( integer $p_articleNumber, integer $p_rank = 1 ) : integer Gives id of article's map id
ReadMapInfo ( string $p_type, integer $p_id ) : array Provides general information on a map, specified by map id or article number
ReadMultiMapInfo ( ) fn ReadMapInfo
RemovePoints ( integer $p_mapId, array $p_removal ) : boolean Removes points (with locations and other contents) from the map.
StoreMapData ( integer $p_mapId, integer $p_languageId, integer $p_articleNumber, mixed $p_map = '', mixed $p_remove = '', mixed $p_insert = '', mixed $p_locations = '', mixed $p_contents = '', mixed $p_order = '' ) : array The main dispatcher for ajax based editing of maps
UnlinkArticle ( $p_articleObj = null, $p_articleNumber ) : array Sets the article's map to be without an article link, to stay as a lone map.
UpdateMap ( integer &$p_mapId, integer $p_articleNumber, array $p_map ) : integer Updates the basic information on the map.
__construct ( integer $p_id = null ) : Map Constructor
delete ( ) : void Deletes the map with all its points, translations, and other associated data.
getArticleNumber ( ) : integer
getDimensions ( ) : array
getDisplayResolution ( ) : integer
getId ( ) : integer
getInitialCenterLatitude ( ) : double
getInitialCenterLongitude ( ) : double
getLastModified ( ) : timestamp
getLocations ( ) : array
getMapProvider ( ) : string
getName ( ) : string
getUser ( ) : User | null
isEnabled ( ) : boolean

Private Methods

Method Description
GetLargeMapOpener ( string $p_mapSuffix, integer $p_widthLargeMap, integer $p_heightLargeMap, string $p_labelLargeMap, string $p_tagStringPrev, string $p_tagStringBody ) : string Gives the large map opener part of the header part for all the presentation maps

Method Details

GetArticleMapId() public static method

Gives map id of the article
public static GetArticleMapId ( $p_articleObj ) : integer
return integer

GetGeoSearchSQLQuery() public static method

The (two) corner lon/lat coordinates should go west to east.
public static GetGeoSearchSQLQuery ( array $p_coordinates ) : string
$p_coordinates array
return string

GetLocationsByArticle() public static method

Gives array of artilce's map's points: just point names (of the article object language) and usage flags.
public static GetLocationsByArticle ( $p_articleObj ) : array
return array

GetMapByArticle() public static method

public static GetMapByArticle ( integer $p_articleNumber ) : Geo_Map
$p_articleNumber integer
return Geo_Map

GetMapFilterBody() public static method

Gives the body map-placement part for the map filtering
public static GetMapFilterBody ( ) : string
return string

GetMapFilterCenter() public static method

Gives the body map-centering (js call) part for the map filtering
public static GetMapFilterCenter ( ) : string
return string

GetMapFilterHeader() public static method

Gives the header part for the map filtering
public static GetMapFilterHeader ( integer $p_mapWidth, integer $p_mapHeight ) : string
$p_mapWidth integer
$p_mapHeight integer
return string

GetMapFilterObjName() public static method

Gives the name of the javascript object used for the map filtering
public static GetMapFilterObjName ( ) : string
return string

GetMapId() public method

TODO: obsolete, use $this->getId() instead.
public GetMapId ( )

GetMapIdByArticle() public static method

public static GetMapIdByArticle ( integer $p_articleNumber ) : integer
$p_articleNumber integer
return integer $map_id

GetMapIdsByArticle() public static method

Gives array of article's maps, with usage flags.
public static GetMapIdsByArticle ( $p_articleObj ) : array
return array

GetMapSearchBody() public static method

Gives the body map-placement part for the map front end search by map-based rectangle selection
public static GetMapSearchBody ( ) : string
return string

GetMapSearchCenter() public static method

Gives the body map-centering (js call) part for the map front end search by map-based rectangle selection
public static GetMapSearchCenter ( ) : string
return string

GetMapSearchHeader() public static method

The bounding-box corners are available by js calls too (see e.g. locations/search.php).
public static GetMapSearchHeader ( integer $p_mapWidth, integer $p_mapHeight, mixed $p_bboxDivs = null ) : string
$p_mapWidth integer
$p_mapHeight integer
$p_bboxDivs mixed
return string

GetMapTagBody() public static method

Gives the body map-placement part for the map front end presentation
public static GetMapTagBody ( integer $p_articleNumber, integer $p_languageId, $p_largeMap = false ) : string
$p_articleNumber integer
$p_languageId integer
return string

GetMapTagCenter() public static method

Gives the body map-centering (js call) part for the map front end presentation
public static GetMapTagCenter ( integer $p_articleNumber, integer $p_languageId ) : string
$p_articleNumber integer
$p_languageId integer
return string

GetMapTagHeader() public static method

Gives the header part for the map front end presentation
public static GetMapTagHeader ( integer $p_articleNumber, integer $p_languageId, integer $p_mapWidth, integer $p_mapHeight, array $p_options = null ) : string
$p_articleNumber integer
$p_languageId integer
$p_mapWidth integer
$p_mapHeight integer
$p_options array
return string

GetMapTagList() public static method

public static GetMapTagList ( integer $p_articleNumber, integer $p_languageId ) : string
$p_articleNumber integer
$p_languageId integer
return string

GetMapTagListData() public static method

Gives the body map-info and point-list part for the map front end presentation
public static GetMapTagListData ( integer $p_articleNumber, integer $p_languageId ) : array
$p_articleNumber integer
$p_languageId integer
return array

GetMapTagOpen() public static method

Gives the body open-large-map link part for the article-map front end presentation
public static GetMapTagOpen ( integer $p_articleNumber, integer $p_languageId, $p_specifier = null ) : string
$p_articleNumber integer
$p_languageId integer
return string

GetMultiMapTagBody() public static method

Gives the body map-placement part for the map front end presentation
public static GetMultiMapTagBody ( integer $p_languageId, integer $p_rank, $p_largeMap = false ) : string
$p_languageId integer
$p_rank integer The rank of the current multi-map, used to make unique ids
return string

GetMultiMapTagCenter() public static method

Gives the body map-centering (js call) part for the map front end presentation
public static GetMultiMapTagCenter ( integer $p_languageId, $p_rank ) : string
$p_languageId integer
return string

GetMultiMapTagHeader() public static method

Gives the header part for the multi-map front end presentation
public static GetMultiMapTagHeader ( integer $p_languageId, $p_constraints, array $p_options, integer $p_offset, integer $p_limit, integer $p_mapWidth, integer $p_mapHeight, integer $p_rank ) : string
$p_languageId integer
$p_options array
$p_offset integer
$p_limit integer
$p_mapWidth integer
$p_mapHeight integer
$p_rank integer The rank of the current multi-map, used to make unique ids
return string

GetMultiMapTagList() public static method

public static GetMultiMapTagList ( integer $p_languageId, array $p_constraints, array $p_options, string $p_label, integer $p_offset, integer $p_limit, integer $p_rank ) : string
$p_languageId integer
$p_constraints array
$p_options array
$p_label string
$p_offset integer
$p_limit integer
$p_rank integer The rank of the current multi-map, used to make unique ids
return string

GetMultiMapTagListData() public static method

Gives the body map-info and point-list part for the map front end presentation
public static GetMultiMapTagListData ( integer $p_languageId, array $p_constraints, array $p_options, integer $p_offset, integer $p_limit, integer $p_rank ) : array
$p_languageId integer
$p_constraints array
$p_options array
$p_offset integer
$p_limit integer
$p_rank integer The rank of the current multi-map, used to make unique ids
return array

GetMultiMapTagOpen() public static method

Gives the body open-large-map link part for the multi-map front end presentation
public static GetMultiMapTagOpen ( integer $p_languageId, integer $p_rank, $p_specifier = null ) : string
$p_languageId integer
$p_rank integer The rank of the current multi-map, used to make unique ids
return string

InsertPoints() public static method

NB: The result indices are used at the point order updating, since that order-updating would not know id's of the new points otherwise.
public static InsertPoints ( integer $p_mapId, integer $p_languageId, integer $p_articleNumber, array $p_insertion, array &$p_indices ) : array
$p_mapId integer
$p_languageId integer
$p_articleNumber integer
$p_insertion array
$p_indices array
return array

LoadMapData() public static method

Load map data
public static LoadMapData ( integer $p_mapId, integer $p_languageId, integer $p_articleNumber, $p_preview = false, $p_textOnly = false ) : array
$p_mapId integer
$p_languageId integer
$p_articleNumber integer
return array

OnArticleCopy() public static method

- read and copy all links / basic data on: - maps (Map table) with links into the given src article, set link into dest art no. - points (MapLocation table) with links into read map ids, set link into new map ids - text contents (MapLocationLanguages table) with links into read maploc ids and into the given languages - multimedia (MapLocationMultimedia table) with links into read maploc ids
public static OnArticleCopy ( integer $p_srcArticleNumber, integer $p_destArticleNumber, array $p_copyTranslations, $p_userId = null ) : void
$p_srcArticleNumber integer
$p_destArticleNumber integer
$p_copyTranslations array
return void

OnArticleDelete() public static method

After article removal (with all its languages), the map is preserved with just the last language.
public static OnArticleDelete ( integer $p_articleNumber ) : void
$p_articleNumber integer
return void

OnCreateTranslation() public static method

Copy all the pointers for the given article.
public static OnCreateTranslation ( integer $p_articleNumber, integer $p_srcLanguageId, integer $p_destLanguageId ) : void
$p_articleNumber integer
$p_srcLanguageId integer
$p_destLanguageId integer
return void

OnLanguageDelete() public static method

It will remove the links on location contents, and the possible free contents. Finally left maps are just with the last language (that is not processed herein).
public static OnLanguageDelete ( integer $p_articleNumber, integer $p_languageId ) : void
$p_articleNumber integer
$p_languageId integer
return void

ReadLanguagesByArticle() public static method

Gives languages used at the map's article
public static ReadLanguagesByArticle ( integer $p_articleNumber ) : array
$p_articleNumber integer
return array

ReadLanguagesByMap() public static method

Gives languages used at the map text contents
public static ReadLanguagesByMap ( integer $p_mapId ) : array
$p_mapId integer
return array

ReadMapId() public static method

Gives id of article's map id
public static ReadMapId ( integer $p_articleNumber, integer $p_rank = 1 ) : integer
$p_articleNumber integer
$p_rank integer
return integer

ReadMapInfo() public static method

Provides general information on a map, specified by map id or article number
public static ReadMapInfo ( string $p_type, integer $p_id ) : array
$p_type string
$p_id integer
return array

ReadMultiMapInfo() public static method

fn ReadMapInfo
public static ReadMultiMapInfo ( )

RemovePoints() public static method

Removes points (with locations and other contents) from the map.
public static RemovePoints ( integer $p_mapId, array $p_removal ) : boolean
$p_mapId integer
$p_removal array
return boolean

StoreMapData() public static method

The main dispatcher for ajax based editing of maps
public static StoreMapData ( integer $p_mapId, integer $p_languageId, integer $p_articleNumber, mixed $p_map = '', mixed $p_remove = '', mixed $p_insert = '', mixed $p_locations = '', mixed $p_contents = '', mixed $p_order = '' ) : array
$p_mapId integer
$p_languageId integer
$p_articleNumber integer
$p_map mixed
$p_remove mixed
$p_insert mixed
$p_locations mixed
$p_contents mixed
$p_order mixed
return array

UnlinkArticle() public static method

Sets the article's map to be without an article link, to stay as a lone map.
public static UnlinkArticle ( $p_articleObj = null, $p_articleNumber ) : array
return array

UpdateMap() public static method

If the p_mapId is not set, a new map is created (and the p_mapId is set then) on the p_articleNumber article.
public static UpdateMap ( integer &$p_mapId, integer $p_articleNumber, array $p_map ) : integer
$p_mapId integer
$p_articleNumber integer
$p_map array
return integer

__construct() public method

Constructor
public __construct ( integer $p_id = null ) : Map
$p_id integer
return Map

delete() public method

This does real removals, unlike the OnArticleDelete/UnlinkArticle methods.
public delete ( ) : void
return void

getArticleNumber() public method

public getArticleNumber ( ) : integer
return integer

getDimensions() public method

public getDimensions ( ) : array
return array

getDisplayResolution() public method

public getDisplayResolution ( ) : integer
return integer

getId() public method

public getId ( ) : integer
return integer

getInitialCenterLatitude() public method

public getInitialCenterLatitude ( ) : double
return double

getInitialCenterLongitude() public method

public getInitialCenterLongitude ( ) : double
return double

getLastModified() public method

public getLastModified ( ) : timestamp
return timestamp

getLocations() public method

public getLocations ( ) : array
return array of IGeoMapLocation

getMapProvider() public method

public getMapProvider ( ) : string
return string

getName() public method

public getName ( ) : string
return string

getUser() public method

public getUser ( ) : User | null
return User | null

isEnabled() public method

public isEnabled ( ) : boolean
return boolean

Property Details

$m_columnNames public_oe property

public array $m_columnNames
return array

$m_dbTableName public_oe property

public string $m_dbTableName
return string

$m_keyColumnNames public_oe property

public array $m_keyColumnNames
return array