Sitemap node type base class.

package core

 Methods

Find details of a position in the Sitemap.

get_node(\ID_TEXT $page_link, \?string $callback = null, \?array $valid_node_types = null, \?integer $child_cutoff = null, \?integer $max_recurse_depth = null, integer $recurse_level = 0, integer $options = 0, \ID_TEXT $zone = '_SEARCH', integer $meta_gather = 0, \?array $row = null, boolean $return_anyway = false) : \?array

Parameters

$page_link

\ID_TEXT

The page-link we are finding.

$callback

\?string

Callback function to send discovered page-links to (null: return).

$valid_node_types

\?array

List of node types we will return/recurse-through (null: no limit)

$child_cutoff

\?integer

Maximum number of children before we cut off all children (null: no limit).

$max_recurse_depth

\?integer

How deep to go from the Sitemap root (null: no limit).

$recurse_level

integer

Our recursion depth (used to limit recursion, or to calculate importance of page-link, used for instance by XML Sitemap [deeper is typically less important]).

$options

integer

A bitmask of SITEMAPGEN* options.

$zone

\ID_TEXT

The zone we will consider ourselves to be operating in (needed due to transparent redirects feature)

$meta_gather

integer

A bitmask of SITEMAPGATHER* constants, of extra data to include.

$row

\?array

Database row (null: lookup).

$return_anyway

boolean

Whether to return the structure even if there was a callback. Do not pass this setting through via recursion due to memory concerns, it is used only to gather information to detect and prevent parent/child duplication of default entry points.

Returns

\?arrayNode structure (null: working via callback / error).

Get the permission page that nodes matching $page_link in this hook are tied to.

get_privilege_page(string $page_link) : \?ID_TEXT

The permission page is where privileges may be overridden against.

Parameters

$page_link

string

The page-link

Returns

\?ID_TEXTThe permission page (null: none)

Find all nodes at the top level position in the Sitemap for this hook.

get_virtual_nodes(\ID_TEXT $page_link, \?string $callback = null, \?array $valid_node_types = null, \?integer $child_cutoff = null, \?integer $max_recurse_depth = null, integer $recurse_level = 0, integer $options = 0, \ID_TEXT $zone = '_SEARCH', integer $meta_gather = 0, boolean $return_anyway = false) : \?array

May be a single node (i.e. a category root) or multiple nodes (if there's a flat structure).

Parameters

$page_link

\ID_TEXT

The page-link we are finding.

$callback

\?string

Callback function to send discovered page-links to (null: return).

$valid_node_types

\?array

List of node types we will return/recurse-through (null: no limit)

$child_cutoff

\?integer

Maximum number of children before we cut off all children (null: no limit).

$max_recurse_depth

\?integer

How deep to go from the Sitemap root (null: no limit).

$recurse_level

integer

Our recursion depth (used to limit recursion, or to calculate importance of page-link, used for instance by XML Sitemap [deeper is typically less important]).

$options

integer

A bitmask of SITEMAPGEN* options.

$zone

\ID_TEXT

The zone we will consider ourselves to be operating in (needed due to transparent redirects feature)

$meta_gather

integer

A bitmask of SITEMAPGATHER* constants, of extra data to include.

$return_anyway

boolean

Whether to return the structure even if there was a callback. Do not pass this setting through via recursion due to memory concerns, it is used only to gather information to detect and prevent parent/child duplication of default entry points.

Returns

\?arrayList of node structures (null: working via callback).

Find whether the hook is active.

is_active() : boolean

Returns

booleanWhether the hook is active.

Extend the node structure with added details from our row data (if we have it).

_ameliorate_with_row(integer $options, array $struct, \?array $row, integer $meta_gather) 

Parameters

$options

integer

A bitmask of SITEMAPGEN* options.

$struct

array

Structure.

$row

\?array

Faked database row (null: we don't have row data).

$meta_gather

integer

A bitmask of SITEMAPGATHER* constants, of extra data to include.

Check the permissions of the node structure, returning false if they fail for the current user.

_check_node_permissions(array $struct) : boolean

Parameters

$struct

array

Node structure

Returns

booleanWhether the permissions pass

Get a particular Sitemap object. Used for easily tying in a different kind of child node.

_get_sitemap_object(\ID_TEXT $hook) : object

Parameters

$hook

\ID_TEXT

The hook, i.e. the Sitemap object type. Usually the same as a content type.

Returns

objectThe Sitemap object.

Find whether a page should be omitted from the sitemap.

_is_page_omitted_from_sitemap(\ID_TEXT $zone, \ID_TEXT $page) : boolean

Parameters

$zone

\ID_TEXT

The zone the page is being loaded in

$page

\ID_TEXT

The codename of the page to load

Returns

booleanWhether the page should be omitted.

Find details for this node.

_load_row_from_page_groupings(\?array $row, \ID_TEXT $zone, \ID_TEXT $page, \ID_TEXT $type = 'browse', \?ID_TEXT $id = null) : \?array

Parameters

$row

\?array

Faked database row (null: derive).

$zone

\ID_TEXT

The zone.

$page

\ID_TEXT

The page.

$type

\ID_TEXT

The type.

$id

\?ID_TEXT

The ID (null: unknown).

Returns

\?arrayFaked database row (null: derive).

Remap '_SEARCH' zones if we can derive the zone from the page-link / or fix _SEARCH in the page-link if there's a known zone.

_make_zone_concrete(\ID_TEXT $zone, \ID_TEXT $page_link) : \ID_TEXT

Parameters

$zone

\ID_TEXT

The zone in the recurse tree (replaced by reference).

$page_link

\ID_TEXT

The page-link (replaced by reference).

Returns

\ID_TEXTThe page name (only returned because it could also be useful, saves some code).

Take the specified parameters, and try to find the corresponding page.

_request_page_details(\ID_TEXT $page, \ID_TEXT $zone) : \~array

Parameters

$page

\ID_TEXT

The codename of the page to load

$zone

\ID_TEXT

The zone the page is being loaded in

Returns

\~arrayA list of details (false: page not found)