\Horde_View_Sidebar

This is a view of the application-specific sidebar.

Useful properties:

  • newLink: (string, optional) Link of the "New" button
    • newText: (string) Text of the "New" button
  • newExtra: (string, optional) HTML content of the extra link
  • containers: (array, optional) HTML content of any sidebar sections. A list of hashes with the following properties:
    • id: (string, optional) The container's DOM ID.
    • header: (array, optional) Container header, also used to toggle the section:
      • id: (string) The header's DOM ID.
      • label: (string) Header label.
      • collapsed: (boolean, optional) Start section collapsed? Overriden by cookies.
      • add: (string|array, optional) Link to add something:
        • url: (string) Link URL.
        • label: (string) Link text.
    • content: (string, optional) The container's HTML content.
    • rows: (array, optional) A list of row hashes, if 'content' is not specified. @see addRow().
    • resources: (boolean, optional) Does the container contain switchable resource lists? Automatically set through addRow().
    • type: (string, optional) @see addRow().
  • content: (string, optional) HTML content of the sidebar, if 'containers' is not specified.

Copyright 2012-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL-2). If you did not receive this file, see http://www.horde.org/licenses/lgpl.

Summary

Methods
Properties
Constants
__construct()
render()
__toString()
addNewButton()
addRow()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(array  $config = array()) 

Constructor.

Parameters

array $config

Configuration key-value pairs.

render()

render(string  $name = 'sidebar',   $locals = array()) : string

Returns the HTML code for the sidebar.

Parameters

string $name

The template to process.

$locals

Returns

string —

The sidebar's HTML code.

__toString()

__toString() : string

Handler for string casting.

Returns

string —

The sidebar's HTML code.

addNewButton()

addNewButton(string  $label, string  $url, array  $extra = array()) 

Adds a "New .

.." button to the sidebar.

Parameters

string $label

The button text, including access key.

string $url

The button URL.

array $extra

Extra attributes for the link tag.

addRow()

addRow(array  $row, string  $container = '') 

Adds a row to the sidebar.

If containers/sections are not added explicitly to the view through the "containers" property, these rows will be used instead.

Parameters

array $row

A hash with the row information. Possible values:

  • label: (string) The row text.
  • selected: (boolean) Whether to mark the row as active.
  • style: (string) Additional CSS styles to apply to the row.
  • url (string) URL to link the row to.
  • type (string, optional) The row type, defaults to "tree". Further $row properties depending on the type:
    • tree:
      • cssClass: (string) CSS class for the icon.
      • id: (string) DOM ID for the row link.
    • checkbox:
    • radiobox:
      • color: (string, optional) Background color.
      • edit: (string, optional) URL for extra edit icon.
string $container

If using multiple sidebar sections, the ID of the section to add the row to. Sections will be rendered in the order of their first usage.