Sitemap node type for content types.

package core
inherited_from \Hook_sitemap_base

 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
Inherited

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
Inherited

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
Inherited

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
Inherited

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) 
Inherited

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
Inherited

Parameters

$struct

array

Node structure

Returns

booleanWhether the permissions pass

Pre-fill part of the node structure, from what we know from the CMA hook.

_create_partial_node_structure(\ID_TEXT $page_link, \?string $callback, \?array $valid_node_types, \?integer $child_cutoff, \?integer $max_recurse_depth, integer $recurse_level, integer $options, \ID_TEXT $zone, integer $meta_gather, \?array $row) : \?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).

Returns

\?arrayA tuple: content ID, row, partial node structure (null: filtered).

Get a list of child nodes, from what we know from the CMA hook.

_get_children_nodes(\ID_TEXT $content_id, \ID_TEXT $page_link, \?string $callback, \?array $valid_node_types, \?integer $child_cutoff, \?integer $max_recurse_depth, integer $recurse_level, integer $options, \ID_TEXT $zone, integer $meta_gather, \?array $row, string $extra_where_entries = '', \?string $explicit_order_by_entries = null, \?string $explicit_order_by_subcategories = null) : \?array

Parameters

$content_id

\ID_TEXT

The content ID.

$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).

$extra_where_entries

string

Extra SQL piece for considering which entries to load.

$explicit_order_by_entries

\?string

Order by for entries (null: alphabetical title).

$explicit_order_by_subcategories

\?string

Order by for categories (null: alphabetical title).

Returns

\?arrayChild nodes (null: not retrieved yet).

Get the CMA info for our content hook.

_get_cma_info() : array

Returns

arrayThe CMA info.

Get the database row for some content.

_get_row(\ID_TEXT $content_id) : array

Parameters

$content_id

\ID_TEXT

The content ID.

Returns

arrayThe content row.

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

_get_sitemap_object(\ID_TEXT $hook) : object
Inherited

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
Inherited

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
Inherited

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
Inherited

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
Inherited

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)

 Properties

 

$cma_info

$cma_info 

Default

null
 

$content_type

$content_type 

Default

null
 

$entry_content_type

$entry_content_type 

Default

null
 

$entry_sitetree_hook

$entry_sitetree_hook 

Default

null
 

$screen_type

$screen_type 

Default

'browse'