|
Moodle
2.2.1
http://www.collinsharper.com
|

Public Member Functions | |
| __construct ($type='ul', $attributes='', $editable=false, $pageurl=null, $page=0, $pageparamname= 'page', $itemsperpage=20) | |
| to_html ($indent=0, $extraargs=array()) | |
| find_item ($id, $suppresserror=false) | |
| add_item ($item) | |
| set_parent ($parent) | |
| list_from_records ($paged=false, $offset=0) | |
| get_records () | |
| display_page_numbers () | |
| get_items_peers ($itemid) | |
| get_child_ids () | |
| move_item_up_down ($direction, $id) | |
| reorder_peers ($peers) | |
| move_item_left ($id) | |
| move_item_right ($id) | |
| process_actions ($left, $right, $moveup, $movedown) | |
| item_is_first_on_page ($itemid) | |
| item_is_last_on_page ($itemid) | |
Data Fields | |
| $attributes | |
| $listitemclassname = 'list_item' | |
| $items = array() | |
| $type | |
| $parentitem = null | |
| $table | |
| $fieldnamesparent = 'parent' | |
| $records = array() | |
| $editable | |
| $childparent | |
| $page = 0 | |
| $firstitem = 1 | |
| $lastitem = 999999 | |
| $pagecount | |
| $paged = false | |
| $offset = 0 | |
| $pageurl | |
| $pageparamname | |
Definition at line 47 of file listlib.php.
| __construct | ( | $ | type = 'ul', |
| $ | attributes = '', |
||
| $ | editable = false, |
||
| $ | pageurl = null, |
||
| $ | page = 0, |
||
| $ | pageparamname = 'page', |
||
| $ | itemsperpage = 20 |
||
| ) |
Constructor.
| string | $type | |
| string | $attributes | |
| boolean | $editable | |
| moodle_url | $pageurl | url for this page |
| integer | $page | if 0 no pagination. (These three params only used in top level list.) |
| string | $pageparamname | name of url param that is used for passing page no |
| integer | $itemsperpage | no of top level items. |
Definition at line 93 of file listlib.php.
| add_item | ( | $ | item | ) |
Definition at line 179 of file listlib.php.
display list of page numbers for navigation
Definition at line 255 of file listlib.php.
| find_item | ( | $ | id, |
| $ | suppresserror = false |
||
| ) |
Recurse down the tree and find an item by it's id.
| integer | $id | |
| boolean | $suppresserror | error if not item found? |
Definition at line 157 of file listlib.php.


| get_child_ids | ( | ) |
Returns an array of ids of child items.
Definition at line 292 of file listlib.php.
| get_items_peers | ( | $ | itemid | ) |
Returns an array of ids of peers of an item.
| int | itemid - if given, restrict records to those with this parent id. |
Definition at line 281 of file listlib.php.


| get_records | ( | ) | [abstract] |
Should be overriden to return an array of records of list items.
Reimplemented in question_category_list.

| item_is_first_on_page | ( | $ | itemid | ) |
| integer | $itemid | an item id. |
Definition at line 444 of file listlib.php.

| item_is_last_on_page | ( | $ | itemid | ) |
| integer | $itemid | an item id. |
Definition at line 454 of file listlib.php.

| list_from_records | ( | $ | paged = false, |
| $ | offset = 0 |
||
| ) |
Produces a hierarchical tree of list items from a flat array of records. 'parent' field is expected to point to a parent record. records are already sorted. If the parent field doesn't point to another record in the array then this is a top level list
| integer | $offset | how many list toplevel items are there in lists before this one |
Definition at line 198 of file listlib.php.

| move_item_left | ( | $ | id | ) |
| integer | $id | an item index. |
Definition at line 344 of file listlib.php.


| move_item_right | ( | $ | id | ) |
Make item with id $id the child of the peer that is just above it in the sort order.
| integer | $id |
Definition at line 370 of file listlib.php.


| move_item_up_down | ( | $ | direction, |
| $ | id | ||
| ) |
Move a record up or down
| string | $direction | up / down |
| integer | $id |
Definition at line 306 of file listlib.php.


| process_actions | ( | $ | left, |
| $ | right, | ||
| $ | moveup, | ||
| $ | movedown | ||
| ) |
process any actions.
| integer | $left | id of item to move left |
| integer | $right | id of item to move right |
| integer | $moveup | id of item to move up |
| integer | $movedown | id of item to move down |
Definition at line 399 of file listlib.php.

| reorder_peers | ( | $ | peers | ) |
| set_parent | ( | $ | parent | ) |
Definition at line 183 of file listlib.php.
Returns html string.
| integer | $indent | depth of indentation. |
Definition at line 115 of file listlib.php.
Definition at line 48 of file listlib.php.
| $childparent |
Definition at line 68 of file listlib.php.
| $editable |
Definition at line 65 of file listlib.php.
| $fieldnamesparent = 'parent' |
Definition at line 60 of file listlib.php.
| $firstitem = 1 |
Definition at line 73 of file listlib.php.
Definition at line 52 of file listlib.php.
| $lastitem = 999999 |
Definition at line 74 of file listlib.php.
| $listitemclassname = 'list_item' |
Reimplemented in question_category_list.
Definition at line 49 of file listlib.php.
| $offset = 0 |
Definition at line 77 of file listlib.php.
| $page = 0 |
Definition at line 72 of file listlib.php.
| $pagecount |
Definition at line 75 of file listlib.php.
| $paged = false |
Definition at line 76 of file listlib.php.
| $pageparamname |
Definition at line 80 of file listlib.php.
| $pageurl |
Definition at line 79 of file listlib.php.
| $parentitem = null |
Definition at line 58 of file listlib.php.
| $records = array() |
Definition at line 63 of file listlib.php.
Reimplemented in question_category_list.
Definition at line 59 of file listlib.php.
| $type |
Definition at line 55 of file listlib.php.