Moodle PHP Documentation 4.5
Moodle 4.5.5+ (Build: 20250711) (ce34e8ff087)
list_item Class Reference
Inheritance diagram for list_item:
qbank_managecategories\question_category_list_item

Public Member Functions

 __construct ($item, $parent, $attributes='', $display=true)
 Constructor.
 
 create_children (&$records, &$children, $thisrecordid)
 Recurse down tree creating list_items, called from moodle_list::list_from_records.
 
 image_icon ($action, $url, $icon)
 Return image icon HTML.
 
 image_spacer ()
 Return image spacer HTML.
 
 item_html ($extraargs=array())
 Output the html just for this item.
 
 set_icon_html ($first, $last, $lastitem)
 Set icon HTML.
 
 set_parent ($parent)
 Set parent list.
 
 to_html ($indent=0, $extraargs=array())
 Returns html.
 

Public Attributes

 $attributes
 
moodle_list $children
 Set if there are any children of this listitem.
 
 $display
 
 $fieldnamesname = 'name'
 
 $icons = array()
 
integer $id
 id of record, used if list is editable.
 
mixed $item
 The object or string representing this item.
 
string $name
 name of this item, used if list is editable.
 
moodle_list $parentlist
 

Detailed Description

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Deprecated
Since Moodle 4.5 MDL-72397. This is no longer used in core code.
Todo
Final removal in Moodle 6.0 MDL-80804.

Constructor & Destructor Documentation

◆ __construct()

list_item::__construct ( $item,
$parent,
$attributes = '',
$display = true )

Constructor.

Parameters
mixed$itemfragment of html for list item or record
object$parentreference to parent of this item
string$attributesattributes for li tag
boolean$displaywhether this item is displayed. Some items may be loaded so we have a complete structure in memory to work with for actions but are not displayed.
Return values
list_item
Deprecated
Since Moodle 4.5 MDL-72397. This is no longer used in core code.
Todo
Final removal in Moodle 6.0 MDL-80804.

Member Function Documentation

◆ create_children()

list_item::create_children ( & $records,
& $children,
$thisrecordid )

Recurse down tree creating list_items, called from moodle_list::list_from_records.

Parameters
array$records
array$children
integer$thisrecordid
Deprecated
Since Moodle 4.5 MDL-72397. This is no longer used in core code.
Todo
Final removal in Moodle 6.0 MDL-80804.

◆ image_icon()

list_item::image_icon ( $action,
$url,
$icon )

Return image icon HTML.

Parameters
$action
$url
$icon
Return values
string
Deprecated
Since Moodle 4.5 MDL-72397. This is no longer used in core code.
Todo
Final removal in Moodle 6.0 MDL-80804.

◆ image_spacer()

list_item::image_spacer ( )

Return image spacer HTML.

Return values
mixed
Deprecated
Since Moodle 4.5 MDL-72397. This is no longer used in core code.
Todo
Final removal in Moodle 6.0 MDL-80804.

◆ item_html()

list_item::item_html ( $extraargs = array())

Output the html just for this item.

Called by to_html which adds html for children.

Deprecated
Since Moodle 4.5 MDL-72397. This is no longer used in core code.
Todo
Final removal in Moodle 6.0 MDL-80804.

Reimplemented in qbank_managecategories\question_category_list_item.

◆ set_icon_html()

list_item::set_icon_html ( $first,
$last,
$lastitem )

Set icon HTML.

Parameters
$first
$last
$lastitem
Return values
void
Deprecated
Since Moodle 4.5 MDL-72397. This is no longer used in core code.
Todo
Final removal in Moodle 6.0 MDL-80804.

Reimplemented in qbank_managecategories\question_category_list_item.

◆ set_parent()

list_item::set_parent ( $parent)

Set parent list.

Parameters
$parent
Return values
void
Deprecated
Since Moodle 4.5 MDL-72397. This is no longer used in core code.
Todo
Final removal in Moodle 6.0 MDL-80804.

◆ to_html()

list_item::to_html ( $indent = 0,
$extraargs = array() )

Returns html.

Parameters
integer$indent
array$extraargsany extra data that is needed to print the list item may be used by sub class.
Return values
stringhtml
Deprecated
Since Moodle 4.5 MDL-72397. This is no longer used in core code.
Todo
Final removal in Moodle 6.0 MDL-80804.

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