Development:Deprecated functions in 2.0: Difference between revisions
Line 32: | Line 32: | ||
Old code: | Old code: | ||
<code php> | <code php> | ||
print_footer(); | print_footer($course, $usercourse, $return); | ||
</code> | </code> | ||
New code: | New code: | ||
Line 38: | Line 38: | ||
echo $OUTPUT->footer(); | echo $OUTPUT->footer(); | ||
</code> | </code> | ||
Notes: No parameters are required. | |||
=== print_header (501) === | === print_header (501) === |
Revision as of 03:58, 5 August 2009
Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.
This page lists the old HTML-outputting functions of pre-2.0 lib/weblib.php and their 2.0 equivalents using $OUTPUT functions.
General notes
The principle of the new rendering API is to let the developer build metadata-rich components that represent HTML elements, but may be rendered in many different ways. A menu component, for example, could be rendered as a <select> element, or as a list of radio buttons or check boxes.
The following functions have been arranged in alphabetical order, although some of them are very closely related to each other. The number of occurrences of these function calls at the time of writing are indicated in parentheses.
Functions to migrate
button_to_popup_window (4)
choose_from_radio (6)
close_window_button (34)
continue (102)
doc_link (30)
helpbutton (391)
link_to_popup_window (54)
notice_yesno (79)
notify (548)
page_doc_link (20)
popup_form (51)
print_arrow (15)
print_box* (380)
print_checkbox (33)
print_container* (153)
print_date_selector (11)
Old code:
print_footer($course, $usercourse, $return);
New code:
echo $OUTPUT->footer();
Notes: No parameters are required.
print_header (501)
print_header_with_help (0)
print_heading (436)
print_heading_block (9)
print_headline (11)
print_paging_bar (41)
print_side_block (4)
print_single_button (108)
print_spacer (20)
print_table (140)
print_textarea (55)
print_textfield (2)
print_time_selector (9)
print_user_picture (77)
update_course_button (2)
update_module_button (94)
update_tag_button (4)
Non-supported functions
These functions have been completely dropped in 2.0, most likely because they were used very little or not at all. All calls to these functions in core should have been replaced.