Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Listing_Engine Class Reference
Inheritance diagram for Listing_Engine:
Page Asset MySource_Object Ecommerce_Cart Funnelback_Search_Page Page_Asset_Listing Page_Hit_Count_Listing Page_Whats_New Search_List Search_Page Google_Map Page_Link_Manager Page_Online_Quiz Page_Related_Asset_Listing Page_Tag_Listing Page_Calendar_Events_Search

Public Member Functions

 __construct ($assetid=0)
 
 _createAdditional (&$link)
 
 _createBodycopies ()
 
 _getDefaultBodycopyContent ($bodycopy_code)
 
 lockTypes ()
 
 prepareLink (&$asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 cloneComponentsAdditional (&$clone, $components)
 
 _getAllowedLinks ()
 
getFolder ($type='type_formats')
 
 getFormats ($type='type_formats')
 
 printBody ()
 
 _getFormUrlComponents ()
 
 printNoResultsBodycopy (&$keywords)
 
 printContents ()
 
 _getCacheKey ()
 
 _getNumPerPage ()
 
 getAssetList ()
 
 sortAssetList ($asset_list, $sort_info)
 
 filterAssetList (&$todo)
 
 filterAssetStatuses (&$todo)
 
 filterAssetTypes (&$todo)
 
 getAllowedAssetTypeMap ()
 
 adjustAssetPositions (&$todo)
 
getChunk (&$children, &$replacements, $keywords, $result_page, $num_per_page, $group_by=NULL)
 
 _getPageList ($total_pages, $current_page, $window_size=NULL)
 
 _groupChunk (&$todo, &$chunk, &$remaining_count, $num_per_page, $group_limit=NULL)
 
 printAssetList ($todo)
 
 _printGroups (&$todo, $group_info)
 
 _printAssetList ($todo)
 
 _getShadowAssetKeywordReplacements ($assetid, $bc_keywords)
 
 _printAsset ($assetid, $list_position, $num_items=0)
 
_getTypeFormatBodycopy ($type_code)
 
 _getSelectionFieldNamePrefix ($selection_name)
 
 getSortableAssetInfo ()
 
 getRootNodes ($reload=TRUE)
 
 getExtendedAssetKeywordReplacements ()
 
 isDescending ()
 
 registerFormField ($field_name)
 
 getUsedFormFields ()
 
 getSortInfo ()
 
 groupAssetsRecursively ($group_levels, $assetids, &$results)
 
 limitAssetsRecursively (&$results, $limit_array)
 
 getGroupableParentAssetids ($child_assetid, $restrict_types=Array(), $direct_parent_only=FALSE)
 
convertProxyAssetTypes (&$results)
 
 _getGroupableParentAssetids ($child_assetid, $restrict_types=Array(), $root_nodes=Array(), $direct_parent_only=FALSE)
 
 sortGroups ($group_levels, $assetids, &$results)
 
 reindexGroupFormats ()
 
 processAssetSelections ()
 
 getAssetSelectionValue ($selection_name, $assetid)
 
 getAssetSelectionDefaults ()
 
 getAssetTargetDefaults ()
 
 _arrayCountRecursive (&$array, $limit=NULL)
 
 _getPositionFormats ()
 
 onRequestKeywords (&$broadcaster, $vars=Array())
 
 _getGenericSingleAssetFormatKeywords ($type=NULL)
 
 _getAdditionalSingleAssetFormatKeywords ()
 
 getAvailableKeywords ()
 
 _getContentsKeywords ()
 
 _getTypeFormatsKeywords ()
 
 _getGroupFolderKeywords ()
 
 getKeywordReplacement ($original_keyword)
 
 getContentsKeywordReplacements ($keywords=Array())
 
 getSortByKeywordReplacement ()
 
 getSortOrderKeywordReplacement ()
 
 getSubmitButtonKeywordReplacement ()
 
 getResetButtonKeywordReplacement ()
 
 getRootNodesKeywordReplacement ()
 
 getAssetTargetKeywordReplacement ($name)
 
 getStructuredRootNodeKeywordReplacement ()
 
 getSelectAllJSCodeKeywordReplacement ()
 
 _recurseCheckAllRelations (&$todo, &$relations, $prefix, $limit=NULL)
 
 _analyseCheckAllRelations ($todo)
 
 _buildRelationsJS ()
 
 _getFormSubmitMethod ()
 
 createNoResultsBodycopy ($enable_on_create=TRUE)
 
getNoResultsBodycopy ($only_if_enabled=TRUE)
 
 isNoResultsBodycopyEnabled ()
 
 setUseNoResultsBodycopy ($enabled)
 
- Public Member Functions inherited from Page
 __construct ($assetid=0)
 
 _getAllowedLinks ()
 
 printBody ()
 
- Public Member Functions inherited from Asset
 Asset ($assetid=0)
 
 create (Array &$link)
 
 load ($assetid)
 
 _loadDataPaths ()
 
 reload ()
 
 canDelete ()
 
 delete ($release_lock=TRUE, $check_locked=TRUE)
 
 useSystemVersion ()
 
 loadSystemVersion ()
 
 saveSystemVersion ()
 
 clearSystemVersion ()
 
 revertToSystemVersion ()
 
 revertNoticeLinksToSystemVersion ()
 
 _updated ($update_parents=TRUE)
 
 type ()
 
 getTypeAncestors ($include_asset=TRUE)
 
 incrementVersion ($number='micro', $update_parents=TRUE)
 
 getLanguages ()
 
 setLanguages (Array $languages)
 
 setCharset ($charset)
 
 setForceSecure ($force_secure)
 
 remapAssetids (Array $map)
 
 morph ($new_type_code)
 
 _morphCleanup ($new_type_code)
 
 onRequestKeywords (Asset $broadcaster, Array $vars=Array())
 
 canClone ()
 
 cloneComponents (Asset $clone, Array $components, $override=FALSE)
 
 cloneComponentsAdditional (Asset $clone, Array $components)
 
 cloneLinks (Asset $clone)
 
 getStatus ()
 
 getAvailableStatii ()
 
 getStatusDescription ()
 
 processStatusChange ($new_status, $update_parents=TRUE, $run_updated=TRUE)
 
 setDate ($date_type, $time=NULL, $userid=NULL)
 
 lockTypes ()
 
 canForceablyAcquireLock ($lock_type)
 
 getEditingLocks ($keywords)
 
 _getAllowedLinks ()
 
 createLink (Asset $minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE, $locked=0)
 
 prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 canCreateLink (Asset $minor, $link_type, $exclusive)
 
 canMoveLink (Asset $minor, Asset $old_major, $link_type)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 canDeleteLink ($linkid)
 
 deleteLink ($linkid, $check_locked=TRUE)
 
 linksUpdated ()
 
 canCloneLink ()
 
 saveAttributes ($dont_run_updated=FALSE, $log_message=TRUE)
 
 setAttrValue ($name, $value)
 
 attr ($name)
 
attrByRef ($name)
 
 getAttribute ($name, $mute_errors=FALSE)
 
 getAssetKeywords ($descriptions=FALSE)
 
 getAvailableKeywords ()
 
 getKeywordReplacement ($keyword)
 
 getAssetWebPathKeywordReplacement ()
 
 getCustomKeywordReplacements ($keywords=Array(), $invoke_backend=FALSE)
 
 processCustomKeywords ($keywords=Array())
 
 getContent ()
 
 setContent ()
 
 getEffectiveLastUpdatedTime ($assetids)
 
 readAccess (Array $assetids=Array())
 
 writeAccess ($lock_type='', Array $assetids=Array(), $only_workflow=TRUE)
 
 adminAccess ($lock_type='', Array $assetids=Array())
 
 backendAccess ()
 
 liveEditAccess ($lock_type)
 
 canliveEdit ($lock_type)
 
 effectiveUnrestricted ()
 
 checkAccess ($perm, $lock_type, Array $assetids=Array(), $only_workflow=TRUE)
 
 accessEffective ()
 
 permissionsUpdated ()
 
 printFrontend ()
 
 printFrontendAsset (Asset $asset, $design=NULL)
 
 getValidProtocols ()
 
 printHead ()
 
 printBody ()
 
 getCurrentPaintLayoutName ()
 
 getCurrentDesignName ()
 
 printBodyWithPaintLayout ($layout_id='')
 
 initLimbo ()
 
 printLimbo ()
 
 paintBackend (Backend_Outputter $o)
 
 getPrefix ()
 
 processBackend (Backend_Outputter $o, Array &$link)
 
 getEI ()
 
 getEditFns ()
 
 getBackendHref ($screen='', $backend_page=TRUE)
 
 getURL ($base_url=NULL, $ignore_rollback=FALSE, $base_contextid=NULL)
 
 getURLs ()
 
 getHref ($base_url=NULL, $ignore_rollback=FALSE)
 
 getWebDataPath ()
 
 getWebPaths ()
 
 saveWebPaths ($paths, $auto_add_remaps=TRUE)
 
 getLookups ($field='')
 
 getDesignLookups ()
 
 getLookupValues ($inherited=NULL, $prefix='', $like_search=TRUE, $ignore_override=FALSE)
 
 deleteLookupValue ($layout_name, $layout_value)
 
 setPaintLayouts ($layouts)
 
 updateLookups ($auto_add_remaps=TRUE)
 
 setLookupValues (Array $values)
 
 getAssetStatusDescriptionKeywordReplacement ()
 
 getAssetStatusColourKeywordReplacement ()
 
 replaceKeywordsInString ($string)
 
 fastTrack ($tasks)
 
 unFastTrack ($tasks)
 
 shouldFastTrack ($task, $assetid=NULL)
 
 getFaskTrackedTaskAssetids ($task)
 
 getDependantParentsURL ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

Data Fields

 $requires_form = FALSE
 
 $performance_log_file_name = 'performance'
 
 $performance_threshold = 1000
 

Protected Member Functions

 _getAssetContentsBCKeywordReplacement (Asset $asset, $contextid=NULL)
 
 _getAssetContentsRawBCKeywordReplacement (Asset $asset, $contextid=NULL)
 
 _getAssetContentsPaintBCKeywordReplacement (Asset $asset, $paint_layout, $contextid=NULL)
 
- Protected Member Functions inherited from Page
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _getName ($short_name=FALSE)
 
- Protected Member Functions inherited from Asset
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _abortCreate ($trigger_level_changed=FALSE, $linkid=0)
 
 _loadVars ()
 
 _getName ($short_name=FALSE, $contextid=NULL)
 
 _getKeywordReplacement ($keyword)
 
 _checkPermissionAccess ($perm, $assetids=Array(), $only_workflow=TRUE)
 
 makeAndSaveInitialWebPath ($path, $parent_link=NULL)
 

Detailed Description

Definition at line 43 of file listing_engine.inc.

Member Function Documentation

_analyseCheckAllRelations (   $todo)

Kick off analysing "check-all" relations

The results of this function are cached in the _tmp member variable as $this->_tmp['check_all_relations'].

Parameters
array$todoassets to check
Returns
void private

Definition at line 4825 of file listing_engine.inc.

_arrayCountRecursive ( $array,
  $limit = NULL 
)

Recursively count array elements

Parameters
array&$arrayArray to count
string$limitNumber of levels to traverse
Returns
int private

Definition at line 4126 of file listing_engine.inc.

_buildRelationsJS ( )

Build 'on click' code to ensure 'select all' functionality works

Returns
void private

Definition at line 4859 of file listing_engine.inc.

_createAdditional ( $link)

Perform any additional processing required during the creation of this asset

Asset listings create bopycopy and folder asset when they are created

Parameters
array&$linkinformation used to create the initial link
Returns
boolean private

Definition at line 83 of file listing_engine.inc.

_createBodycopies ( )

Creates bodycopies for this asset Override if different bodycopies are needed (eg. in search page).

Returns
boolean protected

Definition at line 128 of file listing_engine.inc.

_getAdditionalSingleAssetFormatKeywords ( )

Get additional keywords to be used in the single-asset format

Provides keywords to be used alongside those provided by assets themselves. These keywords are understood only by this asset

Returns
void private

Definition at line 4267 of file listing_engine.inc.

_getAllowedLinks ( )

Returns an array of all the permitted link type, the type asset and the cardinality

Returns
array private
See Also
Asset::_getAllowedLinks()

Definition at line 377 of file listing_engine.inc.

_getAssetContentsBCKeywordReplacement ( Asset  $asset,
  $contextid = NULL 
)
protected

Get the "asset_contents" bodycopy keyword replacement

This is the asset contents being printed with the "default" inherited bodycopy. In most cases, this will be inherited from the listing engine.

Parameters
Asset$assetAsset being painted
int$contextidReturn keyword from a different context. Leave NULL (or omit) for current context.
Returns
string

Definition at line 3002 of file listing_engine.inc.

_getAssetContentsPaintBCKeywordReplacement ( Asset  $asset,
  $paint_layout,
  $contextid = NULL 
)
protected

Get the "asset_contents_paint_*" bodycopy keyword replacement

The paint layout (represented by "*" above) can be an asset ID of a Paint Layout Page asset if it exists, or the name of a User Defined paint layout (as defined on the Lookup Settings page of the painted asset). If it looks like an asset ID, it will always interpret it as that.

If the $paint_layout does not resolve to a valid paint layout either way, an empty string will be returned.

Parameters
Asset$assetAsset being painted
string$paint_layoutAsset ID of a paint layout asset, OR name of a User Defined paint layout for the painted asset
int$contextidReturn keyword from a different context. Leave NULL (or omit) for current context.
Returns
string

Definition at line 3095 of file listing_engine.inc.

_getAssetContentsRawBCKeywordReplacement ( Asset  $asset,
  $contextid = NULL 
)
protected

Get the "asset_contents_raw" bodycopy keyword replacement

This is the contents of the asset without any paint layout applied at all.

Parameters
Asset$assetAsset being painted
int$contextidReturn keyword from a different context. Leave NULL (or omit) for current context.
Returns
string

Definition at line 3044 of file listing_engine.inc.

_getCacheKey ( )

Work out the unique cache key to represent the current page

Returns
string private

Definition at line 930 of file listing_engine.inc.

_getContentsKeywords ( )

Return the available keywords in the Page Contents Bodycopy for this asset

The return value is in the form:

Array(
    'keyword' => 'name',
)
Returns
array public

Definition at line 4327 of file listing_engine.inc.

_getDefaultBodycopyContent (   $bodycopy_code)

Get the default content for a bodycopy

Parameters
string$bodycopy_codeThe code name for the bodycopy
Returns
string private

Definition at line 154 of file listing_engine.inc.

_getFormSubmitMethod ( )

Get the current form submit method

Returns
string protected

Definition at line 4904 of file listing_engine.inc.

_getFormUrlComponents ( )

Returns the URL that the form will use for its target

Returns
string private

Definition at line 558 of file listing_engine.inc.

_getGenericSingleAssetFormatKeywords (   $type = NULL)

Get keywords from another asset

Gets a list of keywords either from a base asset or a specified asset type

Parameters
string$typeAsset type to get keywords from
Returns
array private

Definition at line 4240 of file listing_engine.inc.

_getGroupableParentAssetids (   $child_assetid,
  $restrict_types = Array(),
  $root_nodes = Array(),
  $direct_parent_only = FALSE 
)

Get all the parents of this asset which can be used for grouping.

Parameters
array$child_assetidthe asset to find the parents of
array$restrict_typesGroup type restrictions
array$root_nodesRoot Nodes for this listing
boolean$direct_parent_onlyinclude the direct parent which matches the restriction type
Returns
array public

Definition at line 3806 of file listing_engine.inc.

_getGroupFolderKeywords ( )

Get the keywords which are specific in Group Folder

Returns
array protected

Definition at line 4420 of file listing_engine.inc.

_getNumPerPage ( )

Get the num of items per page

Returns
int protected

Definition at line 1040 of file listing_engine.inc.

_getPageList (   $total_pages,
  $current_page,
  $window_size = NULL 
)

Get a page list with the supplied params

Parameters
int$total_pagesThe total number of pages in the listing
int$current_pageThe current page number
int$window_sizeThe window size for the page list (optional; if absent, all pages shown)
Returns
string protected

Definition at line 1957 of file listing_engine.inc.

_getPositionFormats ( )

Return a list of position formats

Returns
array private

Definition at line 4150 of file listing_engine.inc.

_getSelectionFieldNamePrefix (   $selection_name)

Get the prefix to use for input elements relevant to the specified selection

Parameters
string$selection_nameThe name of the selection
Returns
string protected

Definition at line 3165 of file listing_engine.inc.

_getShadowAssetKeywordReplacements (   $assetid,
  $bc_keywords 
)

Print a shadow asset from the list

Parameters
string$assetidthe ID of the asset we are printing
array$bc_keywordsthe tyope format body copy keywords that are to be replaced
Returns
array private
See Also
printAssetList()

Definition at line 2476 of file listing_engine.inc.

& _getTypeFormatBodycopy (   $type_code)

Get the appropriate type format bodycopy for the specified type code

Parameters
string$type_codeThe type code for which we want the type format
Returns
object private

Definition at line 3141 of file listing_engine.inc.

_getTypeFormatsKeywords ( )

Get the keywords which are specific in Type Formats

Marked deprecated on 15/09/2005

Deprecated:
Returns
array protected

Definition at line 4390 of file listing_engine.inc.

_groupChunk ( $todo,
$chunk,
$remaining_count,
  $num_per_page,
  $group_limit = NULL 
)

Returns a specified chunk of elements

will traverse a multidimensional array and return a chunk equal to the size the user specifies, works for single and multi dimensional arrays

Parameters
array&$todopointer to the array we want to traverse
array&$chunkpointer to array we want to fill
int&$remaining_counthow many assets in we want our chunk including the chunk we want
mixed$num_per_pagethe number of assets we want returned
int$group_limitgroup limit
Returns
void private

Definition at line 1999 of file listing_engine.inc.

_printAsset (   $assetid,
  $list_position,
  $num_items = 0 
)

Print a single asset from the list

Parameters
string$assetidthe ID of the asset we are printing
int$list_positionthe position of this asset in the list
int$num_itemsthe number of items in the current list
Returns
void private
See Also
printAssetList()

Definition at line 2500 of file listing_engine.inc.

_printAssetList (   $todo)

Called by printAssetList to take care of the layout of the asset list

This method ensures the list is printed in columns if required, and keeps track of what position in the list we are printing

Parameters
array$todoan array of assets to list in the same format as the return value of getAssetList() unless we have a single paged A-Z asset listing which is an array of letter grouped assets to print.
Returns
void private
See Also
printAssetList()
_printAsset()

Definition at line 2294 of file listing_engine.inc.

_printGroups ( $todo,
  $group_info 
)

Prints groups and their asset listings

Treats each group as an asset listing to display, if we're not working with groups then it will just skip and call _printAssetList as if nothing happened

Parameters
array&$todoOur list of groups/assets to print
array$group_infoCurrent group information we are working with
Returns
void private

Definition at line 2099 of file listing_engine.inc.

_recurseCheckAllRelations ( $todo,
$relations,
  $prefix,
  $limit = NULL 
)

Analyse "check-all" relations recursively

Parameters
array&$todoassets to list
array&$relationsrelations
string$prefixprefix
int$limitlimit
Returns
void private

Definition at line 4791 of file listing_engine.inc.

adjustAssetPositions ( $todo)

Place assets in hard set list positions

Parameters
array&$todoan array of assets to list in the same format as the return value of getAssetList()
Returns
void protected
See Also
getAssetList()

Definition at line 1568 of file listing_engine.inc.

cloneComponentsAdditional ( $clone,
  $components 
)

Perform any additional processing required during the cloning of this asset

This function is being called by asset_manager after the dependants of asset have been cloned.

Parameters
object&$clonethe clone asset shell
array$componentsthe wanted components to clone eg. Array( 'attributes', 'metadata_schemas', 'metadata', 'workflow', 'permissions', 'data', ); or alternately Array('all');
Returns
boolean public
See Also
asset::cloneComponentsAdditional()

Definition at line 319 of file listing_engine.inc.

& convertProxyAssetTypes ( $results)

Takes an array of results and modifies it according to the rules set on the Proxy Asset Types screen. Any asset set as a proxy is replaced with its children of specified type_code. The children inherit the score from the proxy

Parameters
array&$resultsProxy Types
Returns
array private

Definition at line 3734 of file listing_engine.inc.

createNoResultsBodycopy (   $enable_on_create = TRUE)

Creates the no-results bodycopy

Parameters
boolean$enable_on_createif TRUE, will set the bodycopy to be enabled (TYPE_2 link) when it is created. If FALSE, creates it disabled (TYPE_3 link).
Returns
boolean public

Definition at line 4924 of file listing_engine.inc.

describeLink (   $linkid)

Return a human readable description of the passed link

Parameters
int$linkidthe link ID of the link to describe
Returns
string public

Definition at line 229 of file listing_engine.inc.

filterAssetList ( $todo)

Remove unwanted assets from the todo list

Parameters
array&$todoan array of assets to list in the same format as the return value of getAssetList()
Returns
void protected
See Also
getAssetList()

Definition at line 1297 of file listing_engine.inc.

filterAssetStatuses ( $todo)

Remove assets with a status that we do not want to show

For assets with a status less than LIVE, the asset is loaded and read access is checked.

Parameters
array&$todoan array of assets to list in the same format as the return value of getAssetList()
Returns
void protected
See Also
getAssetList()

Definition at line 1354 of file listing_engine.inc.

filterAssetTypes ( $todo)

Remove and/or update the todo list based on the types of the assets in it

If an entry in the list is a child of a wanted asset type, its type code is changed to the wanted parent type. If an entry is not a wanted type or a child thereof, it is removed. Otherwise it's left alone.

Parameters
array&$todoan array of assets to list in the same format as the return value of getAssetList()
Returns
void protected
See Also
getAssetList()

Definition at line 1483 of file listing_engine.inc.

getAllowedAssetTypeMap ( )

Get the mapping from assets type to the parent type that is handling presentation

Returns the map in array format, with allowed asset type as an index with the parent asset being one of the elements of $this->attr('types'); Because presentation (type format) is defined only for each of $this->attr('types'), this helps determine the handler of the presentation for a particular type Also, if a particular asset type is defined as the index, that type is allowed to be displayed Handler Asset Type can be the same as Asset Type. Resulting array is in following format: Array['Asset Type'] = 'Handler Asset Type' where Handler Asset Types are unique

Returns
array public

Definition at line 1527 of file listing_engine.inc.

getAssetList ( )

Get the list of asset that should be printed

This is defined as an abstract method of sorts; it's up to the kids to override this The return array is in the form Array(assetid => type_code) unless we are grouping by letter, in which case the return array is

Array(assetid => Array(
                    'type_code' => type_code,
                    'first_letter' => first_letter,
                    );
    );
Returns
array protected

Definition at line 1078 of file listing_engine.inc.

getAssetSelectionDefaults ( )

List the default settings format for Asset Selections

Returns
array public

Definition at line 4077 of file listing_engine.inc.

getAssetSelectionValue (   $selection_name,
  $assetid 
)

Provide the default values for each of the selection fields Overwritten by the children

Parameters
string$selection_namename
string$assetidasset id
Returns
int public

Definition at line 4064 of file listing_engine.inc.

getAssetTargetDefaults ( )

List the default settings format for Asset Targets

Returns
array private

Definition at line 4102 of file listing_engine.inc.

getAssetTargetKeywordReplacement (   $name)

Get the replacements for the dynamic "_asset_target" keyword

Parameters
string$namename
Returns
string public

Definition at line 4689 of file listing_engine.inc.

getAvailableKeywords ( )

Return the available keywords from the parents

The return value is in the form:

Array(
    'keyword' => 'name',
)
Returns
array public

Definition at line 4306 of file listing_engine.inc.

& getChunk ( $children,
$replacements,
  $keywords,
  $result_page,
  $num_per_page,
  $group_by = NULL 
)

Gets the specified chunk based on group-by and pagination options

Parameters
array&$childrenthe list of assets that qualify to be printed
array&$replacementsthe current replacements array, which will be added to by this function
array$keywordsKeywords that need replacing
array$result_pageresult page
array$num_per_pagenumber of assets per page
array$group_bywhat to group by
Returns
array public

Definition at line 1657 of file listing_engine.inc.

getContentsKeywordReplacements (   $keywords = Array())

Return a subset of the replacements for the keywords available to the Page Contents Bodycopy for this asset

The return value is in the form:

Array(
    'keyword' => 'name',
)
Parameters
array$keywordsthe keywords from the content
Returns
array public

Definition at line 4525 of file listing_engine.inc.

getExtendedAssetKeywordReplacements ( )

Returns a list of extra keywords that should be replaced for a particular listing asset

This allows search page, for instance, to define its result number and score fields so they don't blank out when keywords are replaced in listing engine. Return data format: Array(string => string) keyword name => replacement

Returns
array public

Definition at line 3279 of file listing_engine.inc.

& getFolder (   $type = 'type_formats')

Return a reference to a folder linked to this asset determined by the passed in value on the link

Parameters
string$typethe value on the link for this folder
Returns
object public

Definition at line 397 of file listing_engine.inc.

getFormats (   $type = 'type_formats')

Get a list of all formats of a certain type

The results of this function are cached for the length of the script execution

Parameters
string$typethe value on the link for the formats folder
Returns
array public

Definition at line 421 of file listing_engine.inc.

getGroupableParentAssetids (   $child_assetid,
  $restrict_types = Array(),
  $direct_parent_only = FALSE 
)

Get all the parents of this asset which can be used for grouping.

If we are grouping by a type that is selected as a proxy parent, then we only want to group by those parents of that type which are actually acting as proxies.

Parameters
int$child_assetidthe asset to find the parents of
array$restrict_typesGroup type restrictions
boolean$direct_parent_onlyinclude the direct parent which matches the restriction type
Returns
array public

Definition at line 3684 of file listing_engine.inc.

getKeywordReplacement (   $original_keyword)

Get bodycopy keyword replacement

Provides a mechanism for providing keyword replacement functions by looking up the function named 'getKeywordNameKeywordReplacement' so an asset wishing to add support for 'best_ever' custom keyword should implement a function getBestEverKeywordReplacement() which returns a replacement string

  • Overridden in listing_engine to handle dynamic keywords in the page contents, such as Asset Targets
Parameters
string$keywordKeyword to find a replacement for
Returns
string public

Definition at line 4470 of file listing_engine.inc.

& getNoResultsBodycopy (   $only_if_enabled = TRUE)

Returns the no-results bodycopy

Parameters
boolean$only_if_enabledif TRUE, will return NULL if the bodycopy is disabled. If FALSE, will only return NULL if never created.
Returns
mixed object|NULL public

Definition at line 4969 of file listing_engine.inc.

getResetButtonKeywordReplacement ( )

Get the replacement for "reset_button" keyword

Returns
string public

Definition at line 4648 of file listing_engine.inc.

getRootNodes (   $reload = TRUE)

Gets the list of current root nodes

This function has optional caching. The assumption is that it will be called with $reload=TRUE (the default) any time the root nodes change

Parameters
string$reloadwhether to refresh the root node cache
Returns
array public

Definition at line 3196 of file listing_engine.inc.

getRootNodesKeywordReplacement ( )

Get the replacement for "root_nodes" keyword

Returns
string public

Definition at line 4669 of file listing_engine.inc.

getSelectAllJSCodeKeywordReplacement ( )

Get the replacement for "select_all_js_code" keyword

Returns
string public

Definition at line 4770 of file listing_engine.inc.

getSortableAssetInfo ( )

Gets the list of available asset info fields that can be used

Returns
array public

Definition at line 3178 of file listing_engine.inc.

getSortByKeywordReplacement ( )

Get the replacement for "sort_by" keyword

Produces a dropdown list of all the sorting options registered for this asset

Returns
string public

Definition at line 4571 of file listing_engine.inc.

getSortInfo ( )

Gets current sort option

Looks at the state to determine which sort option is currently selected Returns one entry from the 'sort_by' attribute or an empty Array.

  • Array( name => String type => String params => Array() )
  • params array changes depending on the type value valid types are: field, asset_attrib
  • if type = "field", params is Array( field => 'assetid' ) where field contains has a name of db column in the asset table to sort by
  • if type is "asset_attrib" params is Array( type_code => 'page' attribute => 'short_name' ) where type_code is the type code of the asset whose attribute is being used and 'attribute' is the name of that attribute (as defined by the management class)
Returns
array public

Definition at line 3388 of file listing_engine.inc.

getSortOrderKeywordReplacement ( )

Get the replacement for "sort_order" keyword

Returns
string public

Definition at line 4603 of file listing_engine.inc.

getStructuredRootNodeKeywordReplacement ( )

Get the replacement for "structured_root_node" keyword

Returns
string public

Definition at line 4733 of file listing_engine.inc.

getSubmitButtonKeywordReplacement ( )

Get the replacement for "submit_button" keyword

Returns
string public

Definition at line 4627 of file listing_engine.inc.

getUsedFormFields ( )

Return an array of form fields registered for this asset

Registered fields are those that have already been used i.e. as a result of a Keyword replacement request

Returns
array public

Definition at line 3348 of file listing_engine.inc.

groupAssetsRecursively (   $group_levels,
  $assetids,
$results 
)

Recursive function to build multi level grouping

(actually this is now non-recursive, function name will have to be fixed!) Will construct an array in the following form: if it is a group its index will be group name (assetid or string) and its contents an array if its an asset in a group its index will be an assetid and its contents will be a typecode The last paramater &$results will hold the contents at the end of the recursive calling instead of working off a return basis

Parameters
array$group_levelsremaining group levels to iterate
array$assetidsasset ids that we are working with in this iteration
array&$resultsreference to the array/section of array we are working on
Returns
void public

If we haven't grabbed the assetid's from the tree before, do it - then cache the results. Saves hitting the db for the same info for each asset that we're grouping

Definition at line 3423 of file listing_engine.inc.

isDeletableLink (   $linkid)

Returns TRUE if we can delete the passed link, or a string with the error msg

Parameters
int$linkidthe link id of the link to remove
Returns
mixed boolean|string public

Definition at line 252 of file listing_engine.inc.

isDescending ( )

Determine if descending sort option was selected

Looks at request data before consulting saved attributes

Returns
boolean public

Definition at line 3294 of file listing_engine.inc.

isNoResultsBodycopyEnabled ( )

Returns whether the no-results bodycopy is enabled

Returns
boolean public

Definition at line 4997 of file listing_engine.inc.

limitAssetsRecursively ( $results,
  $limit_array 
)

Recursive function to limit the number of assets in each group

The second parameter, $limit_array, contains a list of integers that determine how many assets/child groups will be kept at each level. eg. in a listing engine-derived asset with two groups, a $limit_array of Array(2,3) means that the top-level group will contain at most 2 child groups, and each child group will contain at most 3 child assets. Any value can be NULL or zero for all assets to be kept. The $limit_array passed to each recursive level is reduced by one (the top level) each time.

Parameters
array&$resultsThe grouped and sorted results list (array of mixed)
array$limit_arrayContains group limits for each level (array of int|null)
Returns
void public

Definition at line 3651 of file listing_engine.inc.

lockTypes ( )

Returns a list of lock types available for this asset type

Only maps Content lock type to the Menu lock type (Attributes|Links) for backward compatibilty purposes with Asset Listing. (

Definition at line 179 of file listing_engine.inc.

onRequestKeywords ( $broadcaster,
  $vars = Array() 
)

Add valid keywords for this asset to an array of keywords when asked

Parameters
object&$broadcasterthe asset that triggered the event
array$varsthe vars that get submitted by the broadcaster we add keywords to the $vars['keywords'] array
Returns
boolean private

Definition at line 4181 of file listing_engine.inc.

prepareLink ( $asset,
  $side_of_link,
$link_type,
$value,
$sort_order,
$dependant,
$exclusive 
)

Prepares for linking by checking that the link values are valid for this link

This function will be called if this asset is the major or minor party in the link, so the side_of_link flag should be checked to work out what side of the link this asset is on. The return value should indicate if any of the link fields were changed.

Parameters
object&$assetthe major or minor asset that we are linking to
string$side_of_linkthe side of the link we are on (major or minor)
string&$link_typethe type of link we are creating
string&$valuethe value that is to be associated with the link
string&$sort_orderthe position in the links list that this link should take,
string&$dependant'0' / '1' on whether the this asset is dependant on the asset that will be linked by the new link
string&$exclusive'0' / '1' on whether the this asset is linked exclusivly to the asset that will be linked by the new link
Returns
boolean public

Definition at line 208 of file listing_engine.inc.

printAssetList (   $todo)

Print the list of assets that we are listing

Parameters
array$todoan array of assets to list in the same format as the return value of getAssetList()
Returns
void public
See Also
getAssetList()
_printAssetList()

Definition at line 2035 of file listing_engine.inc.

printBody ( )

Called by the design to print the body of this asset

Returns
void public

Definition at line 445 of file listing_engine.inc.

printContents ( )

Called by the design to print the body of this asset

Returns
void public

Definition at line 644 of file listing_engine.inc.

printNoResultsBodycopy ( $keywords)

Prints the "No Results found" bodycopy (if available)

Parameters
array&$keywordsa set of keyword replacements to use in the bodycopy
Returns
boolean public

Definition at line 588 of file listing_engine.inc.

processAssetSelections ( )

Preprocess the Asset Selection values before displaying the page or redirecting Overwritten by the children

Returns
boolean public

Definition at line 4047 of file listing_engine.inc.

registerFormField (   $field_name)

Register a form field name

This is useful if we want to determine whether a field has been used in the form This functionality is required for being able to determine if a field was used during output creation in the printContents. This is useful if to avoid field name conflicts or to perform additional logic like using it in javascript, etc

Parameters
string$field_nameName of the form field
Returns
void public

Definition at line 3330 of file listing_engine.inc.

reindexGroupFormats ( )

Reindexes the group format bodycopies so any gaps are closed and bodycopy names are referring to their correct group numbers

Returns
boolean public

Definition at line 4006 of file listing_engine.inc.

setUseNoResultsBodycopy (   $enabled)

Handles the enabling or disabling of the no-results bodycopy

Parameters
boolean$enabledset to TRUE to enable the format bodycopy, set to FALSE to disable it
Returns
boolean public

Definition at line 5023 of file listing_engine.inc.

sortAssetList (   $asset_list,
  $sort_info 
)

Sort the list of assets

Parameters
array$asset_listan array of assets to be sorted
array$sort_infosorting information as provided by getSortInfo()
Returns
array public
See Also
Listing_Engine::getSortInfo()

Definition at line 1095 of file listing_engine.inc.

sortGroups (   $group_levels,
  $assetids,
$results 
)

Recursive function to sort the group keys

Returns void but returns a modified array (in sort order only, contents themselves are unaffected) in &$results

Parameters
array$group_levelsremaining group levels to iterate
array$assetidsasset ids that we are working with in this iteration
array&$resultsreference to the array/section of array we are working on
Returns
void public

Definition at line 3887 of file listing_engine.inc.


The documentation for this class was generated from the following file: