lib/lists.inc

Properties

Description

This file includes functions to manage the list views.

Classes

lamList

Properties

 
 
lists  
No 
No 

Description

Generates the list view.

Methods

__construct, addExtraInputElementsToTopArea, buildLDAPAttributeFilter, canBeFiltered, forceRefresh, getAdditionalLDAPAttributesToRead, getAdditionalTools, getFilterAsTextForURL, listBuildFilter, listConfigurationChanged, listCreateSortMapping, listDoPost, listDrawNavigationBar, listGetAllConfigOptions, listGetAttributeDescriptionList, listGetConfigOptionByID, listGetParams, listPrintButtons, listPrintConfigurationPage, listPrintFooter, listPrintHeader, listPrintRedirectMessages, listPrintTableBody, listPrintTableCellContent, listPrintTableHeader, listPrintToolLinks, listReadOptionsFromCookie, listRefreshData, listShowOUSelection, showPDFPage, showPage,

__construct( string   $type, ) : \lamList

Description

Constructor

Arguments

Name Type Description Default
$type string

account type

Return value

Type Description
\lamList list object

addExtraInputElementsToTopArea( \htmlGroup   $left, \htmlGroup   $right, ) : n/a

Description

Can be used by subclasses to add e.g. additional buttons to the top area.

Arguments

Name Type Description Default
$left \htmlGroup

left part

$right \htmlGroup

right part

Return value

Type Description
n/a n/a

buildLDAPAttributeFilter( ) : String

Description

Builds the LDAP filter based on the filter entries in the GUI.

Return value

Type Description
String LDAP filter

canBeFiltered( String   $attr, ) : boolean

Description

Returns if the given attribute can be filtered.
If filtering is not possible then no filter box will be displayed. By default all attributes can be filtered.

Arguments

Name Type Description Default
$attr String

attribute name

Return value

Type Description
boolean filtering possible

forceRefresh( ) : n/a

Description

Forces a refresh of the LDAP data.
Function must be called before $this->refresh option is checked to load new LDAP data (e.g. in listGetParams).

Return value

Type Description
n/a n/a

getAdditionalLDAPAttributesToRead( ) : array

Description

Returns a list of additional LDAP attributes that should be read.
This can be used to show additional data even if the user selected other attributes to show in the list.

Return value

Type Description
array additional attribute names

getAdditionalTools( ) : \lamListTool[]

Description

Returns a list of lamListTool objects to display next to the edit/delete buttons.

Return value

Type Description
\lamListTool[] tools

getFilterAsTextForURL( ) : String

Description

Returns the filter as text to be used as URL parameter.

Return value

Type Description
String filter text

listBuildFilter( ) : n/a

Description

Builds the regular expressions from the filter values.

Return value

Type Description
n/a n/a

listConfigurationChanged( ) : n/a

Description

Called when the configuration options changed.

Return value

Type Description
n/a n/a

listCreateSortMapping( array   $info, ) : n/a

Description

Determines the sort mapping and stores it in $this->sortMapping.
The sort mapping is used to display the right rows when the account table is created.

Arguments

Name Type Description Default
$info array

the account list

Return value

Type Description
n/a n/a

listDoPost( ) : String

Description

Manages all POST actions (e.g. button pressed) for the account lists.

Return value

Type Description
String HTML fragment to insert into beginning of account list

listDrawNavigationBar( integer   $count, ) : n/a

Description

Draws a navigation bar to switch between pages

Arguments

Name Type Description Default
$count integer

number of account entries

Return value

Type Description
n/a n/a

listGetAllConfigOptions( ) : array

Description

Returns a list of possible configuration options.

Return value

Type Description
array list of lamListOption objects

listGetAttributeDescriptionList( ) : array

Description

Returns an hash array containing with all attributes to be shown and their descriptions.
Format: array(attribute => description)

Return value

Type Description
array attribute list

listGetConfigOptionByID( String   $ID, ) : n/a

Description

Returns the configuration option with the given ID.

Arguments

Name Type Description Default
$ID String

ID

Return value

Type Description
n/a n/a

listGetParams( ) : n/a

Description

Sets some internal parameters.

Return value

Type Description
n/a n/a

listPrintButtons( boolean   $createOnly, ) : n/a

Description

Prints the create and delete buttons.

Arguments

Name Type Description Default
$createOnly boolean

true if only the create button should be displayed

Return value

Type Description
n/a n/a

listPrintConfigurationPage( ) : n/a

Description

Prints the list configuration page.

Return value

Type Description
n/a n/a

listPrintFooter( ) : n/a

Description

Prints the HTML footer.

Return value

Type Description
n/a n/a

listPrintHeader( ) : n/a

Description

Prints the HTML header.

Return value

Type Description
n/a n/a

listPrintRedirectMessages( ) : n/a

Description

Prints messages when another page (e.g. delete/upload) redirects to the list view.

Return value

Type Description
n/a n/a

listPrintTableBody( array   $info, ) : n/a

Description

Prints the entry list

Arguments

Name Type Description Default
$info array

entries

Return value

Type Description
n/a n/a

listPrintTableCellContent( array   $entry, string   $attribute, ) : n/a

Description

Prints the content of a cell in the account list for a given LDAP entry and attribute.

Arguments

Name Type Description Default
$entry array

LDAP attributes

$attribute string

attribute name

Return value

Type Description
n/a n/a

listPrintTableHeader( ) : n/a

Description

Prints the attribute and filter row at the account table head

Return value

Type Description
n/a n/a

listPrintToolLinks( array   $account, String   $id, ) : n/a

Description

Prints the tool image links (e.g. edit and delete) for each account.

Arguments

Name Type Description Default
$account array

LDAP attributes

$id String

account ID

Return value

Type Description
n/a n/a

listReadOptionsFromCookie( ) : n/a

Description

Reads the list options from the cookie value.

Return value

Type Description
n/a n/a

listRefreshData( ) : n/a

Description

Rereads the entries from LDAP.

Return value

Type Description
n/a n/a

listShowOUSelection( ) : \htmlGroup

Description

Prints a combobox with possible sub-DNs.

Return value

Type Description
\htmlGroup OU selection (may be empty)

showPDFPage( String   $id, ) : n/a

Description

Shows the page where the user may select the PDF options.

Arguments

Name Type Description Default
$id String

account ID

Return value

Type Description
n/a n/a

showPage( ) : n/a

Description

Prints the HTML code to display the list view.

Return value

Type Description
n/a n/a

Properties

$attrArray, $configOptions, $descArray, $entries, $filters, $labels, $maxPageEntries, $page, $possibleSuffixes, $refresh, $sortColumn, $sortDirection, $sortMapping, $suffix, $tabindex, $type,

  protected  $attrArray = array()

list of LDAP attributes


  private  $configOptions =

configuration options


  protected  $descArray = array()

list of attribute descriptions


  protected  $entries =

LDAP entries


  protected  $filters = array()

list of filters (attribute name => filter input)


  protected  $labels =

list of account specific labels


  protected  $maxPageEntries = 30

maximum count of entries per page


  protected  $page = 1

current page number


  protected  $possibleSuffixes =

list of possible LDAP suffixes(organizational units)


  protected  $refresh = true

refresh page switch


  protected  $sortColumn =

sort column name


  protected  $sortDirection = 1

sort direction: 1 for ascending, -1 for descending


  protected  $sortMapping =

sort mapping for entries array(original index => sorted index)


  protected  $suffix =

LDAP suffix


  protected  $tabindex = 1

tabindex for GUI elements


  protected  $type =

Account type


Constants

  LIST_SIZE_OPTION_NAME = "L_SIZE"

ID for list size config option


  VIRTUAL_ATTRIBUTE_PREFIX = 'lam_virtual_'

prefix for virtual (non-LDAP) attributes


lamListTool

Properties

 
 
lists  
No 
No 

Description

Represents a tool which can be included in the account lists.

Methods

__construct, getImage, getLinkTarget, getName,

__construct( String   $name, String   $image, String   $target, ) : \lamListTool

Description

Constructor

Arguments

Name Type Description Default
$name String

tool name

$image String

image file

$target String

target page

Return value

Type Description
\lamListTool tool object

getImage( ) : String

Description

Returns the name of the tool image.
The image is returned without path (e.g. mytool.png). All images must reside in the graphics folder.

Return value

Type Description
String image name

getLinkTarget( ) : String

Description

Returns the PHP file (relative to 'templates/lists') which will be the target for this tool.
The target page will be opened with two GET parameters: DN and type (e.g. user)

Return value

Type Description
String page file (e.g. 'mytool.php')

getName( ) : String

Description

Returns the tool name.
This is used for the tool tip.

Return value

Type Description
String name

Properties

$image, $name, $target,

  private  $image =

tool image


  private  $name =

tool name


  private  $target =

link target


lamListOption

Properties

 
 
lists  
Yes 
No 

Description

Represents a list configuration option.

Methods

__construct, fillFromPostData, getID, getMetaHTML, getValue, setValue,

__construct( String   $ID, ) : \lamConfigOption

Description

Creates a new config option.

Arguments

Name Type Description Default
$ID String

unique ID

Return value

Type Description
\lamConfigOption config option

fillFromPostData( ) : array

Description

Fills the config option from POST data.

Return value

Type Description
array list of StatusMessages (array(<type>, <head line>, <body>))

getID( ) : String

Description

Returns the option ID.

Return value

Type Description
String ID

getMetaHTML( ) : \htmlTable

Description

Returns the meta HTML data to display this option.

Return value

Type Description
\htmlTable meta HTML

getValue( ) : String

Description

Returns the option value. The value must not contain "=" and ";".

Return value

Type Description
String value

setValue( String   $value, ) : n/a

Description

Sets the config option value. The value must not contain "=" and ";".

Arguments

Name Type Description Default
$value String

Return value

Type Description
n/a n/a

Properties

$ID, $value,

  private  $ID =

unique ID


  private  $value =

option value


lamBooleanListOption

Properties

 
 
lists  
No 
No 

Description

Boolean option for list configuration.

Methods

__construct, fillFromPostData, getMetaHTML, isSelected,

__construct( String   $name, String   $ID, ) : \lamBooleanListOption

Description

Creates a new boolean option.

Arguments

Name Type Description Default
$name String

name to show on config page

$ID String

unique ID

Return value

Type Description
\lamBooleanListOption config option

fillFromPostData( ) : array

Description

Fills the config option from POST data.

Return value

Type Description
array list of StatusMessages (array(<type>, <head line>, <body>))

getMetaHTML( ) : \htmlTable

Description

Returns the meta HTML data to display this option.

Return value

Type Description
\htmlTable meta HTML

isSelected( ) : boolean

Description

Returns if this option is selected.

Return value

Type Description
boolean true, if selected

Properties

$name,

  private  $name =

option name


lamSelectListOption

Properties

 
 
lists  
No 
No 

Description

Boolean option for list configuration.

Methods

__construct, fillFromPostData, getMetaHTML, setHelpID,

__construct( String   $name, array   $options, String   $ID, ) : \lamBooleanListOption

Description

Creates a new selection list option.

Arguments

Name Type Description Default
$name String

name to show on config page

$options array

list of possible values

$ID String

unique ID

Return value

Type Description
\lamBooleanListOption config option

fillFromPostData( ) : array

Description

Fills the config option from POST data.

Return value

Type Description
array list of StatusMessages (array(<type>, <head line>, <body>))

getMetaHTML( ) : \htmlTable

Description

Returns the meta HTML data to display this option.

Return value

Type Description
\htmlTable meta HTML

setHelpID( \Strign   $id, ) : n/a

Description

Sets the help ID.

Arguments

Name Type Description Default
$id \Strign

help ID

Return value

Type Description
n/a n/a

Properties

$helpID, $name, $options,

  private  $helpID =

help ID


  private  $name =

option name


  private  $options =

possible select options


Documentation was generated by phpDocumentor 2.0.1 .

Namespaces

  • global

    Packages