Invoking the node/object browser

You can use the eZContentBrowse class to invoke a content browser, with which the user can select one or multiple objects / nodes. The most important method, browse(), actually ensures that certain session variables are set, and that the user agent gets redirect to the content/browse view. When the user submits the selection he made in content/browse, it will be posted to the initial module that invoked eZContentBrowse.

The browse() method accepts an array with quite some options which are not very well documented in the source code. What follows is an overview of the options and a short description on how to use them.

Key

Default value when omitted

Description

from_page

 

URL to post the browser selection to, obligatory

cancel_page

value of from_page

A value for the BrowseCancelURI field that will be posted back.

action_name

value of the INI setting browse.ini [BrowseSettings] DefaultActionName

A value for the BrowseActionName field that will be posted back. When a module view might invoke the content browser for different purposes then it should use this post field to find out for which purpose it called the content browser. Usually the value of the BrowseActionName post variable is used to automatically trigger an action in the module view. See the post_actions key in the module view definition.

type

value of action_name

Corresponding browse type in browse.ini, make sure this type exists otherwise you will get an error in the content/browse module.

selection

value of the INI setting browse.ini [BrowseSettings] DefaultSelectionType

The type of selection, either single or multiple. Can also be configured with the SelectionType setting in browse.ini.

return_type

value of the INI setting browse.ini [BrowseSettings] DefaultReturnType

The type of the return values, either ObjectID or NodeID. Can also be configured with the ReturnType setting in browse.ini.

description_template

 

Template to include containing a description, which is showed by the content/browse view

start_node

 

Node ID to start browsing on.

class_array

 

Class IDs of objects that can be selected. Other content objects can't be selected. Can also be configured with the Class setting in browse.ini.

ignore_nodes_select

 

IDs of nodes that can not be selected.

ignore_nodes_select_subtree

 

IDs of nodes of which no descending nodes (subnodes) can be selected. Seems like the admin design respects this setting, but the standard design does not.

ignore_nodes_click

 

IDs of nodes that can not be browsed into.

keys

 

An associative array of browse override keys that will be used to fetch settings from browse.ini. See http://ez.no/community/forum/install_configuration/set_startnode_when_browsing_in_browse_ini.

persistent_data

 

Associative array of persistent data, will be posted back.

permission

 

This parameter can be used to make only certain nodes selectable, based on the permission system. It must be a policy array that, together with the object ID of each node in the content browser, can be passed to the content/access fetch function. The fetch function will return if access is granted or not. If not, the node won't be selectable.
Example value: array( 'access' => 'create', 'contentclass_id' => $class->attribute( 'id' ) ). Only nodes under which the current user can create objects of the class $class will be selectable.

top_level_nodes

   

browse_custom_action

   

custom_action_data