Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | List of all members
list_item Class Reference
Inheritance diagram for list_item:
question_category_list_item

Public Member Functions

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

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

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

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

◆ item_html()

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

Output the html just for this item.

Called by to_html which adds html for children.

Reimplemented in question_category_list_item.

◆ 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

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