Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Deprecated functions in 2.0: Difference between revisions

From MoodleDocs
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.

Moodle 2.0


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_menu (192)

choose_from_menu_nested (6)

choose_from_menu_yesno (5)

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)

print_footer (569)

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_scale_menu_helpbutton (6)

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.

blocks_print_group

print_file_picture

print_png

print_scale_menu

print_side_block_end

print_side_block_start

print_timer_selector

print_user

update_categories_search_button

update_mymoodle_icon