Dotclear 2.26
Loading...
Searching...
No Matches
dcMenu Class Reference

Public Member Functions

 __construct (string $id, string $title)
 
 addItem (string $title, string $url, $img, $active, bool $show=true, ?string $id=null, ?string $class=null, bool $pinned=false)
 
 prependItem (string $title, string $url, $img, $active, bool $show=true, ?string $id=null, ?string $class=null, bool $pinned=false)
 
 draw ()
 

Data Fields

 $title
 

Protected Member Functions

 itemDef (string $title, string $url, $img, $active, ?string $id=null, ?string $class=null)
 

Protected Attributes

 $pinned = []
 
 $items = []
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( string  $id,
string  $title 
)

Constructs a new instance.

Parameters
string$idThe identifier
string$titleThe title

References $title.

Member Function Documentation

◆ addItem()

addItem ( string  $title,
string  $url,
  $img,
  $active,
bool  $show = true,
?string  $id = null,
?string  $class = null,
bool  $pinned = false 
)

Adds an item.

Parameters
string$titleThe title
string$urlThe url
mixed$imgThe image(s)
mixed$activeThe active flag
bool$showThe show flag
null | string$idThe identifier
null | string$classThe class
bool$pinnedThe pinned flag

References $pinned, $title, and itemDef().

◆ prependItem()

prependItem ( string  $title,
string  $url,
  $img,
  $active,
bool  $show = true,
?string  $id = null,
?string  $class = null,
bool  $pinned = false 
)

Prepends an item.

Parameters
string$titleThe title
string$urlThe url
mixed$imgThe image(s)
mixed$activeThe active flag
bool$showThe show flag
null | string$idThe identifier
null | string$classThe class
bool$pinnedThe pinned flag

References $pinned, $title, and itemDef().

◆ draw()

draw ( )

Draw a menu

Returns
string

References $items, dcUtils\ADMIN_LOCALE, and dcUtils\lexicalKeySort().

◆ itemDef()

itemDef ( string  $title,
string  $url,
  $img,
  $active,
?string  $id = null,
?string  $class = null 
)
protected

Get a menu item HTML code

Parameters
string$titleThe title
string$urlThe url
mixed$imgThe image(s)
mixed$activeThe active flag
null | string$idThe identifier
null | string$classThe class
Returns
string

References $title, and dcAdminHelper\adminIcon().

Referenced by addItem(), and prependItem().

Field Documentation

◆ $pinned

$pinned = []
protected

Referenced by addItem(), and prependItem().

◆ $items

$items = []
protected

Referenced by draw().

◆ $title

$title

The documentation for this class was generated from the following file: