Functions

Add a menu item.

add_menu_item(\SHORT_TEXT $menu, integer $order, \?AUTO_LINK $parent, \SHORT_TEXT $caption, \SHORT_TEXT $url, \BINARY $check_permissions, \SHORT_TEXT $page_only, \BINARY $expanded, \BINARY $new_window, \SHORT_TEXT $caption_long, \ID_TEXT $theme_image_code = '', \SHORT_INTEGER $include_sitemap = 0, \?AUTO_LINK $id = null) : \AUTO_LINK
package core_menus

Parameters

$menu

\SHORT_TEXT

The name of the menu to add the item to.

$order

integer

The relative order of this item on the menu.

$parent

\?AUTO_LINK

The menu item ID of the parent branch of the menu item (null: is on root).

$caption

\SHORT_TEXT

The caption.

$url

\SHORT_TEXT

The URL (in entry point form).

$check_permissions

\BINARY

Whether people who may not view the entry point do not see the link.

$page_only

\SHORT_TEXT

Match-keys to identify what pages the item is shown on.

$expanded

\BINARY

Whether it is an expanded branch.

$new_window

\BINARY

Whether the link will open in a new window.

$caption_long

\SHORT_TEXT

The tooltip (blank: none).

$theme_image_code

\ID_TEXT

The theme image code.

$include_sitemap

\SHORT_INTEGER

An INCLUDESITEMAP* constant

$id

\?AUTO_LINK

The ID (null: auto-increment)

Returns

\AUTO_LINKThe ID of the newly added menu item.

Add a menu item, without giving tedious/unnecessary detail.

add_menu_item_simple(\SHORT_TEXT $menu, \?mixed $parent, \SHORT_TEXT $caption, \SHORT_TEXT $url = '', \BINARY $expanded = 0, \BINARY $check_permissions = 0, boolean $dereference_caption = true, \SHORT_TEXT $caption_long = '', \BINARY $new_window = 0, \ID_TEXT $theme_image_code = '', \SHORT_INTEGER $include_sitemap = 0, \?integer $order = null) : \AUTO_LINK
package core_menus

Parameters

$menu

\SHORT_TEXT

The name of the menu to add the item to.

$parent

\?mixed

The menu item ID of the parent branch of the menu item (AUTO_LINK) / the URL of something else on the same menu (URLPATH) (null: is on root).

$caption

\SHORT_TEXT

The caption.

$url

\SHORT_TEXT

The URL (in entry point form).

$expanded

\BINARY

Whether it is an expanded branch.

$check_permissions

\BINARY

Whether people who may not view the entry point do not see the link.

$dereference_caption

boolean

Whether the caption is a language code.

$caption_long

\SHORT_TEXT

The tooltip (blank: none).

$new_window

\BINARY

Whether the link will open in a new window.

$theme_image_code

\ID_TEXT

The theme image code.

$include_sitemap

\SHORT_INTEGER

An INCLUDESITEMAP* constant

$order

\?integer

Order to use (null: automatic, after the ones that have it specified).

Returns

\AUTO_LINKThe ID of the newly added menu item.

Takes some Comcode, and return an XHTML menu created from it.

build_comcode_menu(\LONG_TEXT $comcode, \SHORT_TEXT $menu, \MEMBER $source_member, \ID_TEXT $type) : \Tempcode
package core_menus

Parameters

$comcode

\LONG_TEXT

The contents of the Comcode menu tag

$menu

\SHORT_TEXT

An identifier for this menu (will be used as a unique ID by menu javascript code)

$source_member

\MEMBER

The member the menu is being built as

$type

\ID_TEXT

The menu type (determines what templates get used)

Returns

\TempcodeThe generated Tempcode of the menu

Take a menu identifier, and return a menu created from it.

build_menu(\ID_TEXT $type, \SHORT_TEXT $menu, boolean $silent_failure = false) : \Tempcode
package core_menus

Parameters

$type

\ID_TEXT

The type of the menu (determines which templates to use)

$menu

\SHORT_TEXT

The menu identifier to use (may be the name of a stored menu, or syntax to load from the Sitemap)

$silent_failure

boolean

Whether to silently return blank if the menu does not exist

Returns

\TempcodeThe generated Tempcode of the menu

Copy a part of the Sitemap to a new menu.

copy_from_sitemap_to_new_menu(\ID_TEXT $target_menu, \SHORT_TEXT $source) 
package core_menus

Parameters

$target_menu

\ID_TEXT

The ID of the menu to save into.

$source

\SHORT_TEXT

Sitemap details.

Delete a menu.

delete_menu(\ID_TEXT $menu_id) 
package core_menus

Parameters

$menu_id

\ID_TEXT

The ID of the menu.

Delete a menu item.

delete_menu_item(\AUTO_LINK $id) 
package core_menus

Parameters

$id

\AUTO_LINK

The ID of the menu item to delete.

Delete a menu item, without giving tedious/unnecessary detail.

delete_menu_item_simple(\SHORT_TEXT $url) 
package core_menus

Parameters

$url

\SHORT_TEXT

The URL (in entry point form).

Edit a menu item.

edit_menu_item(\AUTO_LINK $id, \SHORT_TEXT $menu, integer $order, \?AUTO_LINK $parent, \SHORT_TEXT $caption, \SHORT_TEXT $url, \BINARY $check_permissions, \SHORT_TEXT $page_only, \BINARY $expanded, \BINARY $new_window, \SHORT_TEXT $caption_long, \ID_TEXT $theme_image_code, \SHORT_INTEGER $include_sitemap) 
package core_menus

Parameters

$id

\AUTO_LINK

The ID of the menu item to edit.

$menu

\SHORT_TEXT

The name of the menu to add the item to.

$order

integer

The relative order of this item on the menu.

$parent

\?AUTO_LINK

The menu item ID of the parent branch of the menu item (null: is on root).

$caption

\SHORT_TEXT

The caption.

$url

\SHORT_TEXT

The URL (in entry point form).

$check_permissions

\BINARY

Whether people who may not view the entry point do not see the link.

$page_only

\SHORT_TEXT

Match-keys to identify what pages the item is shown on.

$expanded

\BINARY

Whether it is an expanded branch.

$new_window

\BINARY

Whether the link will open in a new window.

$caption_long

\SHORT_TEXT

The tooltip (blank: none).

$theme_image_code

\ID_TEXT

The theme image code.

$include_sitemap

\SHORT_INTEGER

An INCLUDESITEMAP* constant

Export a menu structure to a CSV file.

export_menu_csv(\?PATH $file_path = null
package core_menus

Parameters

$file_path

\?PATH

The path to the CSV file (null: uploads/website_specific/cms_menu_items.csv).

Import a CSV menu structure, after ERASING whole current menu structure.

import_menu_csv(\?PATH $file_path = null

This function is intended for programmers, writing upgrade scripts for a custom site (dev>staging>live). Assumes CSV was generated with export_menu_csv.

package core_menus

Parameters

$file_path

\?PATH

The path to the CSV file (null: uploads/website_specific/cms_menu_items.csv).

Move a menu branch.

menu_management_script() 
package core_menus

Constants

 

INCLUDE_SITEMAP_NO

INCLUDE_SITEMAP_NO = 0 
package core_menus
 

INCLUDE_SITEMAP_OVER

INCLUDE_SITEMAP_OVER = 1 
package core_menus
 

INCLUDE_SITEMAP_UNDER

INCLUDE_SITEMAP_UNDER = 2 
package core_menus