CorePlugins
[ class tree: CorePlugins ] [ index: CorePlugins ] [ all elements ]

Class: ClientLayers

Source Location: /coreplugins/layers/client/ClientLayers.php

Class Overview

PluginBase
   |
   --ClientPlugin
      |
      --ClientLayers

Handles layers selection interface


Variables

Constants

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: ClientPlugin

ClientPlugin::__construct()
Constructor
ClientPlugin::checkBool()
Checks if variable $variable has a boolean (0 or 1) value $value.
ClientPlugin::checkInt()
Checks if variable $variable has an integer positive or zero value $value.
ClientPlugin::checkNumeric()
Checks if variable $variable has a numeric value $value.
ClientPlugin::disable()
Sets the enable level to ClientPlugin::ENABLE_LEVEL_SERVERCALL.
ClientPlugin::enable()
Sets the enable level to ClientPlugin::ENABLE_LEVEL_FULL.
ClientPlugin::getCartoclient()
ClientPlugin::getConfig()
ClientPlugin::getEnabledLevel()
Returns the enable level.
ClientPlugin::getHttpValue()
Returns the user-submitted $key data if it is set.
ClientPlugin::initializeConfig()
Initializes plugin configuration
ClientPlugin::isEnabledAtLevel()
Sets the enable level to ClientPlugin::ENABLE_LEVEL_FULL.
ClientPlugin::setEnableLevel()
Sets the enable level (to be used with the AJAX mode).

Class: PluginBase

PluginBase::__construct()
Constructor
PluginBase::account()
Records an accounting message for plugins
PluginBase::getBasePath()
PluginBase::getExtendedName()
PluginBase::getName()
PluginBase::getRequest()
Get plugin's request or result out of MapRequest or MapResult
PluginBase::initialize()
Plugin initialization (can be extended in custom plugins)
PluginBase::initializeConfig()
Initializes plugin
PluginBase::preInitialize()
Plugin pre initialization. In most cases, plugins should use
PluginBase::replacePlugin()
Returns name of parent plugin in case of plugin extension
PluginBase::setBasePath()
PluginBase::setExtendedName()
PluginBase::setName()

Class Details

[line 202]
Handles layers selection interface



[ Top ]


Class Variables

$childrenCache = array()

[line 299]



Tags:

access:  protected

Type:   array


[ Top ]

$currentScale =

[line 304]



Tags:

access:  protected

Type:   float


[ Top ]

$frozenLayers = array()

[line 269]



Tags:

access:  protected

Type:   array


[ Top ]

$frozenSelectedLayers =

[line 244]



Tags:

access:  protected

Type:   array


[ Top ]

$frozenUnselectedLayers =

[line 249]



Tags:

access:  protected

Type:   array


[ Top ]

$hiddenLayers = array()

[line 264]



Tags:

access:  protected

Type:   array


[ Top ]

$hiddenSelectedLayers =

[line 234]



Tags:

access:  protected

Type:   array


[ Top ]

$hiddenUnselectedLayers =

[line 239]



Tags:

access:  protected

Type:   array


[ Top ]

$layerIds = array()

[line 294]



Tags:

access:  protected

Type:   array


[ Top ]

$layers =

[line 254]



Tags:

access:  protected

Type:   array


[ Top ]

$layersData =

[line 229]

List of LayerState objects. See LayerState.



Tags:

access:  protected

Type:   array


[ Top ]

$layersInit =

[line 218]



Tags:

access:  protected

Type:   LayersInit


[ Top ]

$layersState =

[line 223]



Tags:

access:  protected

Type:   LayersState


[ Top ]

$log =

[line 208]



Tags:

access:  private

Type:   Logger
Overrides:   Array


[ Top ]

$mapId =

[line 309]



Tags:

access:  protected

Type:   string


[ Top ]

$nodeId = array()

[line 284]



Tags:

access:  protected

Type:   array


[ Top ]

$nodesIds = array()

[line 289]



Tags:

access:  protected

Type:   array


[ Top ]

$notAvailableIcon =

[line 314]

Availability information icons



Tags:

access:  protected

Type:   mixed


[ Top ]

$notAvailableMinusIcon =

[line 316]



Tags:

access:  protected

Type:   mixed


[ Top ]

$notAvailablePlusIcon =

[line 315]



Tags:

access:  protected

Type:   mixed


[ Top ]

$overrideSwitch =  false

[line 327]

True if switch was overrided by another plugin



Tags:

access:  protected

Type:   mixed


[ Top ]

$selectedLayers = array()

[line 259]



Tags:

access:  protected

Type:   array


[ Top ]

$smarty =

[line 213]



Tags:

access:  protected

Type:   Smarty_Plugin


[ Top ]

$unfoldedIds = array()

[line 279]



Tags:

access:  protected

Type:   array


[ Top ]

$unfoldedLayerGroups = array()

[line 274]



Tags:

access:  protected

Type:   array


[ Top ]

$useNewSwitch =  false

[line 321]



Tags:

access:  protected

Type:   boolean


[ Top ]



Class Methods


constructor __construct [line 336]

ClientLayers __construct( )

Constructor



Tags:

access:  public


Overrides ClientPlugin::__construct() (Constructor)

[ Top ]

method adjustExportMapRequest [line 1538]

void adjustExportMapRequest( ExportConfiguration $configuration, MapRequest $mapRequest)



Tags:

access:  public
see:  Exportable::adjustExportMapRequest()


[ Top ]

method ajaxGetPluginResponse [line 1366]

void ajaxGetPluginResponse( AjaxPluginResponse $ajaxPluginResponse)



Tags:

access:  public
see:  Ajaxable::ajaxGetPluginResponse()


[ Top ]

method ajaxHandleAction [line 1377]

void ajaxHandleAction( mixed $actionName, PluginEnabler $pluginEnabler)



Tags:

access:  public
see:  Ajaxable::ajaxHandleAction()


[ Top ]

method buildRequest [line 942]

void buildRequest( )



Tags:

access:  public
see:  ServerCaller::buildRequest()


[ Top ]

method createSession [line 404]

void createSession( MapInfo $mapInfo, InitialMapState $initialMapState)

Initializes layers session data and initially populates some properties.



Tags:

access:  public
see:  Sessionable::CreateSession()


[ Top ]

method drawLayersList [line 1300]

string drawLayersList( )

Initializes layers selector interface.



Tags:

return:  result of a Smarty fetch
access:  protected


[ Top ]

method drawSwitches [line 1326]

string drawSwitches( )

Draws switches dropdown



Tags:

return:  result of a smarty fetch
access:  protected


[ Top ]

method fetchChildrenFromLayerGroup [line 868]

array fetchChildrenFromLayerGroup( array $layersList)

Determines activated layers by recursively browsing LayerGroups.

Only keeps Layer objects that are not detected as {hidden AND not selected}.




Tags:

return:  list of children, grand-children... of given layers
access:  public


Parameters:

array   $layersList   list of layers names

[ Top ]

method fetchFrozenSelectedLayers [line 802]

array fetchFrozenSelectedLayers( string $layerId, [boolean $forceFrozen = false], [boolean $forceSelected = false])

Recursively retrieves selected frozen layers.



Tags:

access:  protected
see:  ClientLayers::fetchHiddenSelectedLayers()


Parameters:

string   $layerId   layer name
boolean   $forceFrozen   (default: false) if true, transmits 'frozen' status to children layers
boolean   $forceSelected   (default: false) if true, transmits 'selected' status to children layers

[ Top ]

method fetchHiddenSelectedLayers [line 782]

array fetchHiddenSelectedLayers( string $layerId, [boolean $forceHidden = false], [boolean $forceSelected = false])

Recursively retrieves selected hidden layers (not transmitted by the browser). Since "hidden" property is inheritated by layers from their declared-as-hidden parents, those layers selection statuses are retrieved as well.



Tags:

access:  protected


Parameters:

string   $layerId   layer name
boolean   $forceHidden   (default: false) if true, transmits 'hidden' status to children layers
boolean   $forceSelected   (default: false) if true, transmits 'selected' status to children layers

[ Top ]

method fetchLayer [line 1139]

array fetchLayer( LayerBase $layer, [boolean $forceSelection = false], [boolean $forceFrozen = false], [string $layerRendering = self::RENDERING_TREE], [int $parentId = 0])

Deals with every single layer and recursively calls itself to build sublayers.



Tags:

return:  array of layer children and grand-children... data
access:  protected


Parameters:

LayerBase   $layer  
boolean   $forceSelection   (default: false) if true transmits 'selected' status to children
boolean   $forceFrozen   (default: false) if true transmits 'frozen' status to children
string   $layerRendering   (default: 'tree') rendering of layers
int   $parentId   (default: 0) id of parent layer in displayed interface

[ Top ]

method fetchLayerIcon [line 1063]

string fetchLayerIcon( LayerBase $layer, [array &$children = array()])

Returns layer icon filename if any.



Tags:

access:  protected


Parameters:

LayerBase   $layer  
array   &$children   list of layer children names (default: empty array)

[ Top ]

method fetchRecursively [line 826]

array fetchRecursively( LayerBase $layer, string $type, boolean $forceFixed, boolean $forceSelected)

Performs common recursive job for fetchHiddenSelectedLayers() and fetchFrozenSelectedLayers().



Tags:



Parameters:

LayerBase   $layer  
string   $type   type of layers detection: 'hidden' or 'frozen'
boolean   $forceFixed   inherited status (see above type)
boolean   $forceSelected   inherited selection status

[ Top ]

method getClassChildren [line 1010]

array getClassChildren( LayerBase $layer)

Recursively retrieves the list of Mapserver Classes bound to the layer or its sublayers.



Tags:

return:  array of layers names
access:  protected


Parameters:

LayerBase   $layer  

[ Top ]

method getCurrentScale [line 1031]

float getCurrentScale( )

Retrieves current scale from location plugin



Tags:

access:  protected


[ Top ]

method getFrozenLayers [line 766]

array getFrozenLayers( )

Returns the list of explicitely frozen layers.



Tags:

access:  protected


[ Top ]

method getHiddenLayers [line 758]

array getHiddenLayers( )

Returns the list of explicitely hidden layers.



Tags:

access:  protected


[ Top ]

method getLayerByName [line 547]

LayerBase getLayerByName( string $layername, [boolean $strict = true])

Returns the Layer|LayerGroup|LayerClass object whose name is passed.



Tags:

return:  layer object of type Layer|LayerGroup|LayerClass
access:  public


Parameters:

string   $layername   name of layer
boolean   $strict   if true (default), throws exception if invalid layername

[ Top ]

method getLayerChildren [line 562]

array getLayerChildren( LayerBase $layer)

Returns a list of current layer children, taking into account some criteria such as aggregation, LayerClass name validity.



Tags:

return:  array of layers names
access:  protected


Parameters:

LayerBase   $layer   layer object of type Layer|LayerGroup|LayerClass

[ Top ]

method getLayerIds [line 522]

array getLayerIds( )



Tags:

return:  layerIds, list of server-asked layers
access:  public


[ Top ]

method getLayerNode [line 483]

LayerNode getLayerNode( )

Construct a new tree of layerNodes by getting the layers from the mapInfo.



Tags:

return:  The root node of the hierarchy of layerNodes.
access:  protected


[ Top ]

method getLayers [line 532]

array getLayers( [boolean $forceRefresh = false])

Returns the list of Layer|LayerGroup|LayerClass objects available in MapInfo.



Tags:

access:  public


Parameters:

boolean   $forceRefresh   if true, force refresh list (default: false)

[ Top ]

method getLayersInit [line 1531]

array getLayersInit( )



Tags:

return:  layersInit
access:  public


[ Top ]

method getLayersMask [line 906]

array getLayersMask( [string $layerId = 'root'], [bool $resetCache = false])

Recursively determines layers that can be selected in layers selector.



Tags:

return:  layers list
access:  protected


Parameters:

string   $layerId   layer id
bool   $resetCache   if true, children cache is ignored (default: false)

[ Top ]

method getLayersSecurityFiltered [line 504]

array getLayersSecurityFiltered( )

Filters the layers which are not allowed to be viewed by the current user. It returns a flat map of (layerId => Layer object).



Tags:

return:  An array of LayerBase object.
access:  protected


[ Top ]

method getMatchingLayers [line 721]

array getMatchingLayers( string $stateProperty, string $storageName, [boolean $refresh = false])

Returns a list of layers that match passed condition.

Is in fact a code factorizer for get*Layers() methods.




Tags:

access:  protected


Parameters:

string   $stateProperty   name of some LayerBase property. See LayerBase.
string   $storageName   name of ClientLayers property that contains data
boolean   $refresh   if true, refreshes storage content (default to false)

[ Top ]

method getNewSessionObject [line 396]

LayersState getNewSessionObject( )

Gets a new instance of layers-plugin session-storage class.

Usefull in extended ClientLayers class when using extended session storage class.




Tags:

access:  protected


[ Top ]

method getPrintedIconPath [line 1396]

string getPrintedIconPath( string $icon)

Returns icon full path.



Tags:

return:  full path
access:  protected


Parameters:

string   $icon   icon filename

[ Top ]

method getPrintedLayerData [line 1409]

array getPrintedLayerData( string $layerId)

Returns given layer printing data (icon, label, children...).



Tags:

access:  protected


Parameters:

string   $layerId   layer id

[ Top ]

method getPrintedLayers [line 1501]

array getPrintedLayers( array $selectedLayers, float $scale)

Returns the list of layers actually printed on mainmap as well as their classes and parent LayerGroups if any (mainly used for PDF printing).



Tags:

return:  complete list of printed layers, layergroups, layerclasses
access:  public


Parameters:

array   $selectedLayers   list of layers explicitely asked to CartoServer
float   $scale   scale value

[ Top ]

method getPrintedParents [line 1458]

void getPrintedParents( string $layerId, array &$selectedLayers, array &$printedNodes)

Recursively detects selected layers parent nodes and substitutes them if parents are aggregated.



Tags:

access:  protected


Parameters:

string   $layerId   current layer id
array   &$selectedLayers   selected layers list
array   &$printedNodes   structure containing data of layers to print

[ Top ]

method getSelectedLayers [line 741]

array getSelectedLayers( [boolean $refresh = false])

Returns the list of activated layers.



Tags:

access:  protected


Parameters:

boolean   $refresh   optional (default: false), if true, forces result refresh

[ Top ]

method getUnfoldedLayerGroups [line 750]

array getUnfoldedLayerGroups( )

Returns the list of LayerGroups that must be rendered unfolded.



Tags:

access:  protected


[ Top ]

method handleHttpGetRequest [line 688]

void handleHttpGetRequest( mixed $request)

Handles data from GET request.



Tags:

access:  public
see:  GuiProvider::handleHttpGetRequest()


[ Top ]

method handleHttpPostRequest [line 632]

void handleHttpPostRequest( mixed $request)

Handles layers-related POST'ed data and updates layers statuses.



Tags:

access:  public
see:  GuiProvider::handleHttpPostRequest()


[ Top ]

method handleInit [line 344]

void handleInit( mixed $layersInit)



Tags:

access:  public
see:  InitUser::handleInit()


[ Top ]

method handleResult [line 1002]

void handleResult( mixed $layersResult)



Tags:

access:  public
see:  ServerCaller::handleResult()


[ Top ]

method handleSwitches [line 598]

void handleSwitches( array $request)

Handles switches form



Tags:

access:  protected


Parameters:

array   $request  

[ Top ]

method initializeResult [line 960]

void initializeResult( mixed $layersResult)



Tags:

access:  public
see:  ServerCaller::initializeResult()


[ Top ]

method isLayerVisibleAtCurrentScale [line 1436]

boolean isLayerVisibleAtCurrentScale( string $layerId)

Tells if given layer is visible at current scale

Checks for classes scale visibility




Tags:

access:  public


Parameters:

string   $layerId   layer id

[ Top ]

method isOutOfRangeIcon [line 1051]

boolean isOutOfRangeIcon( string $icon)



Tags:

return:  True if this icon is an out of range icon (below or above scale).
access:  protected


Parameters:

string   $icon   icon filename

[ Top ]

method loadSession [line 356]

void loadSession( mixed $sessionObject)

Retrieves session-saved layers data.



Tags:

access:  public
see:  Sessionable::loadSession()


[ Top ]

method nodesFilterSecurity [line 465]

boolean nodesFilterSecurity( LayerNode $node)

Callback used to remove nodes which are not visible by the current user.

If it returns true, the node will be ignored in the tree.




Tags:

return:  True of this node is not accepted (meaning access denied)
access:  public


Parameters:

LayerNode   $node   The node on which to check access

[ Top ]

method renderForm [line 1356]

void renderForm( Smarty $template)

Assigns the layers interface output in the general Cartoclient template.



Tags:

access:  public
see:  GuiProvider::renderForm()


[ Top ]

method saveSession [line 1521]

void saveSession( )

Saves layers data in session.



Tags:

access:  public
see:  Sessionable::saveSession()


[ Top ]

method setOutofScaleIcon [line 1109]

boolean setOutofScaleIcon( LayerBase $layer)

Substitutes out-of-scale icons if current scale is out of the layer range of scales.



Tags:

access:  protected


Parameters:

LayerBase   $layer  

[ Top ]

method setSwitch [line 611]

void setSwitch( string $newSwitch)

Changes switch from another plugin



Tags:

access:  public


Parameters:

string   $newSwitch  

[ Top ]


Class Constants

RENDERING_DROPDOWN =  'dropdown'

[line 331]


[ Top ]

RENDERING_RADIO =  'radio'

[line 330]


[ Top ]

RENDERING_TREE =  'tree'

[line 329]


[ Top ]



Documentation generated on Wed, 30 Aug 2006 21:56:58 +0200 by phpDocumentor 1.3.0RC3