This service manages the toolbars used for the on-site administration system.
For each context, it provides the following set of toolbars:
The Node toolbar is applicable to the current
node, which is usually a topic. MidCOM places the topic management operations
into this toolbar, where applicable.
The View toolbar is applicable to the specific view ("url"). Usually
this maps to a single displayed object (see also the bind_to_object() member
function). MidCOM places the object-specific management operations (like
Metadata controls) into this toolbar, if it is bound to an object. Otherwise,
this toolbar is not touched by MidCOM.
It is important to understand that the default toolbars made available through this
service are completely specific to a given request context. If you have a dynamic_load
running on a given site, it will have its own set of toolbars for each instance.
In addition, components may retrieve a third kind of toolbars, which are not under
the general control of MidCOM, the Object toolbars. They apply to a single
database object (like a bound View toolbar). The usage of this kind of
toolbars is completely component-specific.
It has yet to prove if the toolbar system is needed for a dynamic_load environments.
The main reason for this is that dl'ed stuff is often quite tight in space and thus cannot
display any toolbars in a sane way. Usually, the administrative tasks will be bound to the
This could be different for portal applications, which display several components on the
welcome page, each with its own management options.
See midcom_config for configuration options.
This array is indexed by context id; each value consists of a flat array
of two toolbars, the first object being the Node toolbar, the second
View toolbar. The toolbars are created on-demand.
$_enable_centralized : boolean
midcom.services.toolbars has two modes, it can either display one centralized toolbar
for authenticated users, or the node and view toolbars separately for others. This
property controls whether centralized mode is enabled.
$_centralized_mode : boolean
Whether we're in centralized mode, i.e. centralized toolbar has been shown
Binds the a toolbar to a DBA object. This will append a number of globally available
toolbar options. For example, expect Metadata- and Version Control-related options
to be added.
This call is available through convenience functions throughout the framework: The
toolbar main class has a mapping for it (midcom_helper_toolbar::bind_to($object))
and object toolbars created by this service will automatically be bound to the
Repeated bind calls are intercepted, you can only bind a toolbar to a single object.