PHP Class Geo_Map

Inheritance: extends DatabaseObject, implements IGeoMap
Afficher le fichier Open project: sourcefabric/newscoop Class Usage Examples

Méthodes publiques

Свойство Type Description
$m_columnNames array
$m_dbTableName string
$m_keyColumnNames array

Méthodes publiques

Méthode 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

Méthode 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 méthode

Gives map id of the article
public static GetArticleMapId ( $p_articleObj ) : integer
Résultat integer

GetGeoSearchSQLQuery() public static méthode

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

GetLocationsByArticle() public static méthode

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
Résultat array

GetMapByArticle() public static méthode

public static GetMapByArticle ( integer $p_articleNumber ) : Geo_Map
$p_articleNumber integer
Résultat Geo_Map

GetMapFilterBody() public static méthode

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

GetMapFilterCenter() public static méthode

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

GetMapFilterHeader() public static méthode

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

GetMapFilterObjName() public static méthode

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

GetMapId() public méthode

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

GetMapIdByArticle() public static méthode

public static GetMapIdByArticle ( integer $p_articleNumber ) : integer
$p_articleNumber integer
Résultat integer $map_id

GetMapIdsByArticle() public static méthode

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

GetMapSearchBody() public static méthode

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

GetMapSearchCenter() public static méthode

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

GetMapSearchHeader() public static méthode

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
Résultat string

GetMapTagBody() public static méthode

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
Résultat string

GetMapTagCenter() public static méthode

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
Résultat string

GetMapTagHeader() public static méthode

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
Résultat string

GetMapTagList() public static méthode

public static GetMapTagList ( integer $p_articleNumber, integer $p_languageId ) : string
$p_articleNumber integer
$p_languageId integer
Résultat string

GetMapTagListData() public static méthode

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
Résultat array

GetMapTagOpen() public static méthode

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
Résultat string

GetMultiMapTagBody() public static méthode

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
Résultat string

GetMultiMapTagCenter() public static méthode

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
Résultat string

GetMultiMapTagHeader() public static méthode

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
Résultat string

GetMultiMapTagList() public static méthode

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
Résultat string

GetMultiMapTagListData() public static méthode

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
Résultat array

GetMultiMapTagOpen() public static méthode

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
Résultat string

InsertPoints() public static méthode

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
Résultat array

LoadMapData() public static méthode

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
Résultat array

OnArticleCopy() public static méthode

- 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
Résultat void

OnArticleDelete() public static méthode

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
Résultat void

OnCreateTranslation() public static méthode

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
Résultat void

OnLanguageDelete() public static méthode

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
Résultat void

ReadLanguagesByArticle() public static méthode

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

ReadLanguagesByMap() public static méthode

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

ReadMapId() public static méthode

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

ReadMapInfo() public static méthode

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
Résultat array

ReadMultiMapInfo() public static méthode

fn ReadMapInfo
public static ReadMultiMapInfo ( )

RemovePoints() public static méthode

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
Résultat boolean

StoreMapData() public static méthode

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
Résultat array

UnlinkArticle() public static méthode

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
Résultat array

UpdateMap() public static méthode

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
Résultat integer

__construct() public méthode

Constructor
public __construct ( integer $p_id = null ) : Map
$p_id integer
Résultat Map

delete() public méthode

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

getArticleNumber() public méthode

public getArticleNumber ( ) : integer
Résultat integer

getDimensions() public méthode

public getDimensions ( ) : array
Résultat array

getDisplayResolution() public méthode

public getDisplayResolution ( ) : integer
Résultat integer

getId() public méthode

public getId ( ) : integer
Résultat integer

getInitialCenterLatitude() public méthode

public getInitialCenterLatitude ( ) : double
Résultat double

getInitialCenterLongitude() public méthode

public getInitialCenterLongitude ( ) : double
Résultat double

getLastModified() public méthode

public getLastModified ( ) : timestamp
Résultat timestamp

getLocations() public méthode

public getLocations ( ) : array
Résultat array of IGeoMapLocation

getMapProvider() public méthode

public getMapProvider ( ) : string
Résultat string

getName() public méthode

public getName ( ) : string
Résultat string

getUser() public méthode

public getUser ( ) : User | null
Résultat User | null

isEnabled() public méthode

public isEnabled ( ) : boolean
Résultat boolean

Property Details

$m_columnNames public_oe property

public array $m_columnNames
Résultat array

$m_dbTableName public_oe property

public string $m_dbTableName
Résultat string

$m_keyColumnNames public_oe property

public array $m_keyColumnNames
Résultat array