|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
Namespaces | |
| namespace | core |
Functions | |
| sid_ob_rewrite ($buffer) | |
| update_log_display_entry ($module, $action, $mtable, $field) | |
| filter_text ($text, $courseid=NULL) | |
| httpsrequired () | |
| get_file_url ($path, $options=null, $type='coursefile') | |
| print_file_upload_error ($filearray= '', $returnerror=false) | |
| resolve_filename_collisions ($destination, $files, $format='%s_%d.%s') | |
| check_potential_filename ($destination, $filename, $files) | |
| upload_print_form_fragment ($numfiles=1, $names=null, $descriptions=null, $uselabels=false, $labelnames=null, $coursebytes=0, $modbytes=0, $return=false) | |
| auth_get_plugin_title ($authtype) | |
| enrol_into_course ($course, $user, $enrol) | |
| get_default_course_role ($course) | |
| get_my_courses ($userid, $sort='visible DESC, sortorder ASC', $fields=NULL, $doanything=false, $limit=0) | |
| get_list_of_languages ($refreshcache=false, $returnall=false) | |
| get_list_of_currencies () | |
| get_list_of_countries () | |
| isteacher () | |
| isteacherinanycourse () | |
| get_guest () | |
| isguest () | |
| get_teacher () | |
| get_course_participants ($courseid) | |
| is_course_participant ($userid, $courseid) | |
| get_recent_enrolments ($courseid, $timestart) | |
| make_context_subobj ($rec) | |
| is_context_subobj_valid ($rec, $contextlevel) | |
| ensure_context_subobj_present (&$rec, $contextlevel) | |
| print_simple_box ($message, $align='', $width='', $color='', $padding=5, $class='generalbox', $id='', $return=false) | |
| print_simple_box_start ($align='', $width='', $color='', $padding=5, $class='generalbox', $id='', $return=false) | |
| print_simple_box_end ($return=false) | |
| convert_urls_into_links ($text) | |
| get_emoticons_list_for_help_file () | |
| replace_smilies (&$text) | |
| detect_munged_arguments ($string, $allowdots=1) | |
| unzip_file ($zipfile, $destination= '', $showstatus_ignored=true) | |
| zip_files ($originalfiles, $destination) | |
| mygroupid ($courseid) | |
| groupmode ($course, $cm=null) | |
| set_current_group ($courseid, $groupid) | |
| get_current_group ($courseid, $full=false) | |
| error ($message, $link='') | |
| table_exists ($table) | |
| Deprecated DDL functions, to be removed soon ///. | |
| field_exists ($table, $field) | |
| find_index_name ($table, $index) | |
| index_exists ($table, $index) | |
| find_check_constraint_name ($table, $field) | |
| check_constraint_exists ($table, $field) | |
| find_key_name ($table, $xmldb_key) | |
| drop_table ($table) | |
| install_from_xmldb_file ($file) | |
| create_table ($table) | |
| create_temp_table ($table) | |
| rename_table ($table, $newname) | |
| add_field ($table, $field) | |
| drop_field ($table, $field) | |
| change_field_type ($table, $field) | |
| change_field_precision ($table, $field) | |
| change_field_unsigned ($table, $field) | |
| change_field_notnull ($table, $field) | |
| change_field_enum ($table, $field) | |
| change_field_default ($table, $field) | |
| rename_field ($table, $field, $newname) | |
| add_key ($table, $key) | |
| drop_key ($table, $key) | |
| rename_key ($table, $key, $newname) | |
| add_index ($table, $index) | |
| drop_index ($table, $index) | |
| rename_index ($table, $index, $newname) | |
| stripslashes_safe ($mixed) | |
| stripslashes_recursive ($var) | |
| addslashes_object ($dataobject) | |
| addslashes_recursive ($var) | |
| execute_sql ($command, $feedback=true) | |
| record_exists_select ($table, $select='') | |
| record_exists_sql ($sql) | |
| count_records_select ($table, $select='', $countitem='COUNT(*)') | |
| count_records_sql ($sql) | |
| get_record_sql ($sql, $expectmultiple=false, $nolimit=false) | |
| get_record_select ($table, $select='', $fields='*') | |
| get_recordset ($table, $field='', $value='', $sort='', $fields='*', $limitfrom='', $limitnum='') | |
| get_recordset_sql ($sql, $limitfrom=null, $limitnum=null) | |
| rs_fetch_record (&$rs) | |
| rs_next_record (&$rs) | |
| rs_fetch_next_record (&$rs) | |
| rs_EOF ($rs) | |
| rs_close (&$rs) | |
| get_records_select ($table, $select='', $sort='', $fields='*', $limitfrom='', $limitnum='') | |
| get_field_select ($table, $return, $select) | |
| get_field_sql ($sql) | |
| delete_records_select ($table, $select='') | |
| configure_dbconnection () | |
| sql_max ($field) | |
| sql_as () | |
| sql_paging_limit ($page, $recordsperpage) | |
| db_uppercase () | |
| db_lowercase () | |
| modify_database ($sqlfile='', $sqlstring='') | |
| where_clause ($field1='', $value1='', $field2='', $value2='', $field3='', $value3='') | |
| execute_sql_arr ($sqlarr, $continue=true, $feedback=true) | |
| get_records_list ($table, $field='', $values='', $sort='', $fields='*', $limitfrom='', $limitnum='') | |
| get_recordset_list ($table, $field='', $values='', $sort='', $fields='*', $limitfrom='', $limitnum='') | |
| get_records_menu ($table, $field='', $value='', $sort='', $fields='*', $limitfrom='', $limitnum='') | |
| get_records_select_menu ($table, $select='', $sort='', $fields='*', $limitfrom='', $limitnum='') | |
| get_records_sql_menu ($sql, $limitfrom='', $limitnum='') | |
| column_type ($table, $column) | |
| recordset_to_menu ($rs) | |
| records_to_menu ($records, $field1, $field2) | |
| set_field_select ($table, $newfield, $newvalue, $select, $localcall=false) | |
| get_fieldset_select ($table, $return, $select) | |
| get_fieldset_sql ($sql) | |
| sql_ilike () | |
| sql_fullname ($first='firstname', $last='lastname') | |
| sql_concat () | |
| sql_empty () | |
| sql_substr () | |
| sql_bitand ($int1, $int2) | |
| sql_bitnot ($int1) | |
| sql_bitor ($int1, $int2) | |
| sql_bitxor ($int1, $int2) | |
| sql_cast_char2int ($fieldname, $text=false) | |
| sql_compare_text ($fieldname, $numchars=32) | |
| sql_order_by_text ($fieldname, $numchars=32) | |
| sql_length ($fieldname) | |
| sql_concat_join ($separator="' '", $elements=array()) | |
| sql_isempty ($tablename, $fieldname, $nullablefield, $textfield) | |
| sql_isnotempty ($tablename, $fieldname, $nullablefield, $textfield) | |
| begin_sql () | |
| commit_sql () | |
| rollback_sql () | |
| insert_record ($table, $dataobject, $returnid=true, $primarykey='id') | |
| update_record ($table, $dataobject) | |
| get_records ($table, $field='', $value='', $sort='', $fields='*', $limitfrom='', $limitnum='') | |
| get_record ($table, $field1, $value1, $field2='', $value2='', $field3='', $value3='', $fields='*') | |
| set_field ($table, $newfield, $newvalue, $field1, $value1, $field2='', $value2='', $field3='', $value3='') | |
| count_records ($table, $field1='', $value1='', $field2='', $value2='', $field3='', $value3='') | |
| record_exists ($table, $field1='', $value1='', $field2='', $value2='', $field3='', $value3='') | |
| delete_records ($table, $field1='', $value1='', $field2='', $value2='', $field3='', $value3='') | |
| get_field ($table, $return, $field1, $value1, $field2='', $value2='', $field3='', $value3='') | |
| table_column ($table, $oldfield, $field, $type='integer', $size='10', $signed='unsigned', $default='0', $null='not null', $after='') | |
| use_html_editor ($name='', $editorhidebuttons='', $id='') | |
| require_js ($lib) | |
| make_mod_upload_directory ($courseid) | |
| theme_setup ($theme= '', $params=NULL) | |
| current_theme () | |
| page_id_and_class (&$getid, &$getclass) | |
| formerr ($error) | |
| skip_main_destination () | |
| print_headline ($text, $size=2, $return=false) | |
| print_heading ($text, $deprecated= '', $size=2, $class= 'main', $return=false, $id= '') | |
| print_heading_block ($heading, $class='', $return=false) | |
| print_box ($message, $classes='generalbox', $ids='', $return=false) | |
| print_box_start ($classes='generalbox', $ids='', $return=false) | |
| print_box_end ($return=false) | |
| print_container ($message, $clearfix=false, $classes='', $idbase='', $return=false) | |
| print_container_start ($clearfix=false, $classes='', $idbase='', $return=false) | |
| check_theme_arrows () | |
| print_container_end ($return=false) | |
| notify ($message, $classes= 'notifyproblem', $align= 'center', $return=false) | |
| print_continue ($link, $return=false) | |
| print_header ($title='', $heading='', $navigation='', $focus='', $meta='', $cache=true, $button=' ', $menu=null, $usexml=false, $bodytags='', $return=false) | |
| print_header_simple ($title='', $heading='', $navigation='', $focus='', $meta='', $cache=true, $button=' ', $menu='', $usexml=false, $bodytags='', $return=false) | |
| print_footer ($course=NULL, $usercourse=NULL, $return=false) | |
| user_login_string ($course='ignored', $user='ignored') | |
| print_side_block_start ($heading='', $attributes=array()) | |
| print_side_block_end ($attributes=array(), $title='') | |
| blocks_have_content (&$blockmanager, $region) | |
| blocks_print_group ($page, $blockmanager, $region) | |
| blocks_setup (&$page, $pinned=BLOCKS_PINNED_FALSE) | |
| blocks_preferred_width ($instances) | |
| blocks_execute_action ($page, &$blockmanager, $blockaction, $instanceorid, $pinned=false, $redirect=true) | |
| blocks_execute_url_action (&$PAGE, &$blockmanager, $pinned=false) | |
| blocks_execute_repositioning (&$instance, $newpos, $newweight, $pinned=false) | |
| blocks_move_block ($page, &$instance, $destpos, $destweight=NULL, $pinned=false) | |
| print_table ($table, $return=false) | |
| link_to_popup_window ($url, $name=null, $linkname=null, $height=400, $width=500, $title=null, $options=null, $return=false) | |
| button_to_popup_window ($url, $name=null, $linkname=null, $height=400, $width=500, $title=null, $options=null, $return=false, $id=null, $class=null) | |
| print_single_button ($link, $options, $label='OK', $method='get', $notusedanymore='', $return=false, $tooltip='', $disabled=false, $jsconfirmmessage='', $formid= '') | |
| print_spacer ($height=1, $width=1, $br=true, $return=false) | |
| print_file_picture ($path, $courseid=0, $height='', $width='', $link='', $return=false) | |
| print_user_picture ($user, $courseid, $picture=NULL, $size=0, $return=false, $link=true, $target='', $alttext=true) | |
| print_png () | |
| print_textarea ($usehtmleditor, $rows, $cols, $width, $height, $name, $value='', $obsolete=0, $return=false, $id='') | |
| helpbutton ($page, $title, $module='moodle', $image=true, $linktext=false, $text='', $return=false, $imagetext='') | |
| emoticonhelpbutton ($form, $field, $return=false) | |
| editorhelpbutton () | |
| editorshortcutshelpbutton () | |
| print_arrow ($direction='up', $strsort=null, $return=false) | |
| doc_link ($path='', $text='', $iconpath='ignored') | |
| print_paging_bar ($totalcount, $page, $perpage, $baseurl, $pagevar='page', $nocurr=false, $return=false) | |
| notice_yesno ($message, $linkyes, $linkno, $optionsyes=NULL, $optionsno=NULL, $methodyes='post', $methodno='post') | |
| print_scale_menu () | |
| choose_from_menu ($options, $name, $selected='', $nothing='choose', $script='', $nothingvalue='0', $return=false, $disabled=false, $tabindex=0, $id='', $listbox=false, $multiple=false, $class='') | |
| choose_from_menu_yesno ($name, $selected, $script= '', $return=false, $disabled=false, $tabindex=0) | |
| choose_from_menu_nested ($options, $name, $selected='', $nothing='choose', $script= '', $nothingvalue=0, $return=false, $disabled=false, $tabindex=0) | |
| print_scale_menu_helpbutton ($courseid, $scale, $return=false) | |
| print_timer_selector ($timelimit=0, $unit= '', $name= 'timelimit', $return=false) | |
| print_time_selector ($hour, $minute, $currenttime=0, $step=5, $return=false) | |
| print_date_selector ($day, $month, $year, $currenttime=0, $return=false) | |
| popup_form ($baseurl, $options, $formid, $selected='', $nothing='choose', $help='', $helptext='', $return=false, $targetwindow='self', $selectlabel='', $optionsextra=NULL, $submitvalue='', $disabled=false, $showbutton=false) | |
| close_window_button ($name='closewindow', $return=false, $reloadopener=false) | |
| choose_from_radio ($options, $name, $checked='', $return=false) | |
| print_checkbox ($name, $value, $checked=true, $label= '', $alt= '', $script='', $return=false) | |
| print_textfield ($name, $value, $alt= '', $size=50, $maxlength=0, $return=false) | |
| print_heading_with_help ($text, $helppage, $module='moodle', $icon=false, $return=false) | |
| update_mymoodle_icon () | |
| update_tag_button ($tagid) | |
| update_module_button ($cmid, $ignored, $string) | |
| update_categories_search_button ($search, $page, $perpage) | |
| print_user ($user, $course, $messageselect=false, $return=false) | |
| update_course_icon ($courseid) | |
| print_navigation ($navigation, $separator=0, $return=false) | |
| build_navigation ($extranavlinks, $cm=null) | |
| navmenu ($course, $cm=NULL, $targetwindow='self') | |
| switchroles_form ($courseid) | |
| admin_externalpage_print_header ($focus='') | |
| admin_externalpage_print_footer () | |
| add_event ($event) | |
| CALENDAR MANAGEMENT ////////////////////////////////////////////////////////////////. | |
| update_event ($event) | |
| delete_event ($id) | |
| hide_event ($event) | |
| show_event ($event) | |
| add_event | ( | $ | event | ) |
CALENDAR MANAGEMENT ////////////////////////////////////////////////////////////////.
Call this function to add an event to the calendar table and to call any calendar plugins
| object | $event | An object representing an event from the calendar table. The event will be identified by the id field. The object event should include the following:
|
Definition at line 3938 of file deprecatedlib.php.


| add_field | ( | $ | table, |
| $ | field | ||
| ) |
| string | $table | |
| string | $field |
Definition at line 996 of file deprecatedlib.php.

| add_index | ( | $ | table, |
| $ | index | ||
| ) |
| string | $table | |
| string | $index |
Definition at line 1166 of file deprecatedlib.php.

| add_key | ( | $ | table, |
| $ | key | ||
| ) |
| string | $table | |
| string | $key |
Definition at line 1123 of file deprecatedlib.php.

| addslashes_object | ( | $ | dataobject | ) |
| mixed | $dataobject |
Definition at line 1228 of file deprecatedlib.php.
| addslashes_recursive | ( | $ | var | ) |
| mixed | $var |
Definition at line 1236 of file deprecatedlib.php.
Definition at line 3906 of file deprecatedlib.php.

| admin_externalpage_print_header | ( | $ | focus = '' | ) |
Print header for admin page
| string | $focus | focus element |
Definition at line 3895 of file deprecatedlib.php.

| auth_get_plugin_title | ( | $ | authtype | ) |
Return the authentication plugin title
| string | $authtype | plugin type |
Definition at line 197 of file deprecatedlib.php.

| begin_sql | ( | ) |
Definition at line 1769 of file deprecatedlib.php.
| blocks_execute_action | ( | $ | page, |
| &$ | blockmanager, | ||
| $ | blockaction, | ||
| $ | instanceorid, | ||
| $ | pinned = false, |
||
| $ | redirect = true |
||
| ) |
| object | $page | The page object |
| object | $blockmanager | The block manager object |
| string | $blockaction | One of [config, add, delete] |
| int | object | $instanceorid | The instance id or a block_instance object |
| bool | $pinned | |
| bool | $redirect | To redirect or not to that is the question but you should stick with true |
Definition at line 2609 of file deprecatedlib.php.
| blocks_execute_repositioning | ( | &$ | instance, |
| $ | newpos, | ||
| $ | newweight, | ||
| $ | pinned = false |
||
| ) |
This shouldn't be used externally at all, it's here for use by blocks_execute_action() in order to reduce code repetition.
| $instance | ||
| $newpos | ||
| string | int | $newweight | |
| bool | $pinned |
Definition at line 2637 of file deprecatedlib.php.
| blocks_execute_url_action | ( | &$ | PAGE, |
| &$ | blockmanager, | ||
| $ | pinned = false |
||
| ) |
You can use this to get the blocks to respond to URL actions without much hassle
| object | $PAGE | |
| object | $blockmanager | |
| bool | $pinned |
Definition at line 2622 of file deprecatedlib.php.
| blocks_have_content | ( | &$ | blockmanager, |
| $ | region | ||
| ) |
This was used by old code to see whether a block region had anything in it, and hence wether that region should be printed.
We don't ever want old code to print blocks, so we now always return false. The function only exists to avoid fatal errors in old code.
| object | $blockmanager | |
| string | $region |
Definition at line 2550 of file deprecatedlib.php.

| blocks_move_block | ( | $ | page, |
| &$ | instance, | ||
| $ | destpos, | ||
| $ | destweight = NULL, |
||
| $ | pinned = false |
||
| ) |
Moves a block to the new position (column) and weight (sort order).
| object | $instance | The block instance to be moved. |
| string | $destpos | BLOCK_POS_LEFT or BLOCK_POS_RIGHT. The destination column. |
| string | $destweight | The destination sort order. If NULL, we add to the end of the destination column. |
| bool | $pinned | Are we moving pinned blocks? We can only move pinned blocks to a new position withing the pinned list. Likewise, we can only moved non-pinned blocks to a new position within the non-pinned list. |
Definition at line 2657 of file deprecatedlib.php.
| blocks_preferred_width | ( | $ | instances | ) |
This iterates over an array of blocks and calculates the preferred width Parameter passed by reference for speed; it's not modified.
| mixed | $instances |
Definition at line 2594 of file deprecatedlib.php.

| blocks_print_group | ( | $ | page, |
| $ | blockmanager, | ||
| $ | region | ||
| ) |
This was used by old code to print the blocks in a region.
We don't ever want old code to print blocks, so this is now a no-op. The function only exists to avoid fatal errors in old code.
| object | $page | |
| object | $blockmanager | |
| string | $region |
Definition at line 2567 of file deprecatedlib.php.

| blocks_setup | ( | &$ | page, |
| $ | pinned = BLOCKS_PINNED_FALSE |
||
| ) |
This used to be the old entry point for anyone that wants to use blocks. Since we don't want people people dealing with blocks this way any more, just return a suitable empty array.
| object | $page |
Definition at line 2581 of file deprecatedlib.php.

| build_navigation | ( | $ | extranavlinks, |
| $ | cm = null |
||
| ) |
This function will build the navigation string to be used by print_header and others.
It automatically generates the site and course level (if appropriate) links.
If you pass in a $cm object, the method will also generate the activity (e.g. 'Forums') and activityinstances (e.g. 'General Developer Forum') navigation levels.
If you want to add any further navigation links after the ones this function generates, the pass an array of extra link arrays like this: array( array('name' => $linktext1, 'link' => $url1, 'type' => $linktype1), array('name' => $linktext2, 'link' => $url2, 'type' => $linktype2) ) The normal case is to just add one further link, for example 'Editing forum' after 'General Developer Forum', with no link. To do that, you need to pass array(array('name' => $linktext, 'link' => '', 'type' => 'title')) However, becuase this is a very common case, you can use a shortcut syntax, and just pass the string 'Editing forum', instead of an array as $extranavlinks.
At the moment, the link types only have limited significance. Type 'activity' is recognised in order to implement the $CFG->hideactivitytypenavlink feature. Types that are known to appear are 'home', 'course', 'activity', 'activityinstance' and 'title'. This really needs to be documented better. In the mean time, try to be consistent, it will enable people to customise the navigation more in future.
When passing a $cm object, the fields used are $cm->modname, $cm->name and $cm->course. If you get the $cm object using the function get_coursemodule_from_instance or get_coursemodule_from_id (as recommended) then this will be done for you automatically. If you don't have $cm->modname or $cm->name, this fuction will attempt to find them using the $cm->module and $cm->instance fields, but this takes extra database queries, so a warning is printed in developer debug mode.
| mixed | $extranavlinks | - Normally an array of arrays, keys: name, link, type. If you only want one extra item with no link, you can pass a string instead. If you don't want any extra links, pass an empty string. |
| mixed | $cm | deprecated |
Definition at line 3832 of file deprecatedlib.php.
| button_to_popup_window | ( | $ | url, |
| $ | name = null, |
||
| $ | linkname = null, |
||
| $ | height = 400, |
||
| $ | width = 500, |
||
| $ | title = null, |
||
| $ | options = null, |
||
| $ | return = false, |
||
| $ | id = null, |
||
| $ | class = null |
||
| ) |
Creates and displays (or returns) a buttons to a popup window.
| string | $url | Web link. Either relative to $CFG->wwwroot, or a full URL. |
| string | $name | Name to be assigned to the popup window (this is used by client-side scripts to "talk" to the popup window) |
| string | $linkname | Text to be displayed as web link |
| int | $height | Height to assign to popup window |
| int | $width | Height to assign to popup window |
| string | $title | Text to be displayed as popup page title |
| string | $options | List of additional options for popup window |
| bool | $return | If true, return as a string, otherwise print |
| string | $id | id added to the element |
| string | $class | class added to the element |
Definition at line 2736 of file deprecatedlib.php.

| change_field_default | ( | $ | table, |
| $ | field | ||
| ) |
| string | $table | |
| string | $field |
Definition at line 1094 of file deprecatedlib.php.

| change_field_enum | ( | $ | table, |
| $ | field | ||
| ) |
| string | $table | |
| string | $field |
Definition at line 1080 of file deprecatedlib.php.

| change_field_notnull | ( | $ | table, |
| $ | field | ||
| ) |
| string | $table | |
| string | $field |
Definition at line 1066 of file deprecatedlib.php.

| change_field_precision | ( | $ | table, |
| $ | field | ||
| ) |
| string | $table | |
| string | $field |
Definition at line 1038 of file deprecatedlib.php.

| change_field_type | ( | $ | table, |
| $ | field | ||
| ) |
| string | $table | |
| string | $field |
Definition at line 1024 of file deprecatedlib.php.

| change_field_unsigned | ( | $ | table, |
| $ | field | ||
| ) |
| string | $table | |
| string | $field |
Definition at line 1052 of file deprecatedlib.php.

| check_constraint_exists | ( | $ | table, |
| $ | field | ||
| ) |
Definition at line 904 of file deprecatedlib.php.

| check_potential_filename | ( | $ | destination, |
| $ | filename, | ||
| $ | files | ||
| ) |
Checks a file name for any conflicts
Definition at line 179 of file deprecatedlib.php.
Deprecated, now handled automatically in themes
Definition at line 2243 of file deprecatedlib.php.

| choose_from_menu | ( | $ | options, |
| $ | name, | ||
| $ | selected = '', |
||
| $ | nothing = 'choose', |
||
| $ | script = '', |
||
| $ | nothingvalue = '0', |
||
| $ | return = false, |
||
| $ | disabled = false, |
||
| $ | tabindex = 0, |
||
| $ | id = '', |
||
| $ | listbox = false, |
||
| $ | multiple = false, |
||
| $ | class = '' |
||
| ) |
Given an array of values, output the HTML for a select element with those options.
Normally, you only need to use the first few parameters.
| array | $options | The options to offer. An array of the form $options[{value}] = {text displayed for that option}; |
| string | $name | the name of this form control, as in <select name="..." ... |
| string | $selected | the option to select initially, default none. |
| string | $nothing | The label for the 'nothing is selected' option. Defaults to get_string('choose'). Set this to '' if you don't want a 'nothing is selected' option. |
| string | $script | if not '', then this is added to the <select> element as an onchange handler. |
| string | $nothingvalue | The value corresponding to the $nothing option. Defaults to 0. |
| boolean | $return | if false (the default) the the output is printed directly, If true, the generated HTML is returned as a string. |
| boolean | $disabled | if true, the select is generated in a disabled state. Default, false. |
| int | $tabindex | if give, sets the tabindex attribute on the <select> element. Default none. |
| string | $id | value to use for the id attribute of the <select> element. If none is given, then a suitable one is constructed. |
| mixed | $listbox | if false, display as a dropdown menu. If true, display as a list box. By default, the list box will have a number of rows equal to min(10, count($options)), but if $listbox is an integer, that number is used for size instead. |
| boolean | $multiple | if true, enable multiple selections, else only 1 item can be selected. Used when $listbox display is enabled |
| string | $class | value to use for the class attribute of the <select> element. If none is given, then a suitable one is constructed. |
Definition at line 3265 of file deprecatedlib.php.

| choose_from_menu_nested | ( | $ | options, |
| $ | name, | ||
| $ | selected = '', |
||
| $ | nothing = 'choose', |
||
| $ | script = '', |
||
| $ | nothingvalue = 0, |
||
| $ | return = false, |
||
| $ | disabled = false, |
||
| $ | tabindex = 0 |
||
| ) |
Just like choose_from_menu, but takes a nested array (2 levels) and makes a dropdown menu including option headings with the first level.
This function is very similar to choose_from_menu_yesno() and choose_from_menu()
| array | $options | An array of objects to choose from |
| string | $name | The XHTML field name |
| string | $selected | The value to select by default |
| string | $nothing | The label for the 'nothing is selected' option. Defaults to get_string('choose'). |
| string | $script | If not '', then this is added to the <select> element as an onchange handler. |
| string | $nothingvalue | The value for the first `nothing` option if $nothing is set |
| bool | $return | Whether this function should return a string or output it (defaults to false) |
| bool | $disabled | Is the field disabled by default |
| int | string | $tabindex | Override the tabindex attribute [numeric] |
Definition at line 3350 of file deprecatedlib.php.

| choose_from_menu_yesno | ( | $ | name, |
| $ | selected, | ||
| $ | script = '', |
||
| $ | return = false, |
||
| $ | disabled = false, |
||
| $ | tabindex = 0 |
||
| ) |
Choose value 0 or 1 from a menu with options 'No' and 'Yes'. Other options like choose_from_menu.
Calls choose_from_menu() with preset arguments
| string | $name | the name of this form control, as in <select name="..." ... |
| string | $selected | the option to select initially, default none. |
| string | $script | if not '', then this is added to the <select> element as an onchange handler. |
| boolean | $return | Whether this function should return a string or output it (defaults to false) |
| boolean | $disabled | (defaults to false) |
| int | $tabindex |
Definition at line 3308 of file deprecatedlib.php.

| choose_from_radio | ( | $ | options, |
| $ | name, | ||
| $ | checked = '', |
||
| $ | return = false |
||
| ) |
Given an array of values, creates a group of radio buttons to be part of a form
int $idcounter
| array | $options | An array of value-label pairs for the radio group (values as keys) |
| string | $name | Name of the radiogroup (unique in the form) |
| string | $checked | The value that is already checked |
| bool | $return | Whether this function should return a string or output it (defaults to false) |
Definition at line 3561 of file deprecatedlib.php.

| close_window_button | ( | $ | name = 'closewindow', |
| $ | return = false, |
||
| $ | reloadopener = false |
||
| ) |
Prints a simple button to close a window
object
| string | $name | Name of the window to close |
| boolean | $return | whether this function should return a string or output it. |
| boolean | $reloadopener | if true, clicking the button will also reload the page that opend this popup window. |
Definition at line 3535 of file deprecatedlib.php.


| column_type | ( | $ | table, |
| $ | column | ||
| ) |
| mixed | $table | |
| mixed | $column |
Definition at line 1572 of file deprecatedlib.php.
| commit_sql | ( | ) |
Definition at line 1776 of file deprecatedlib.php.
Definition at line 1423 of file deprecatedlib.php.
| convert_urls_into_links | ( | $ | text | ) |
Given some text this function converted any URLs it found into HTML links
This core function has been replaced with filter_urltolink since Moodle 2.0
| string | $text | Passed in by reference. The string to be searched for urls. |
Definition at line 528 of file deprecatedlib.php.

| count_records | ( | $ | table, |
| $ | field1 = '', |
||
| $ | value1 = '', |
||
| $ | field2 = '', |
||
| $ | value2 = '', |
||
| $ | field3 = '', |
||
| $ | value3 = '' |
||
| ) |
| mixed | $table | |
| mixed | $field1 | |
| mixed | $value1 | |
| mixed | $field2 | |
| mixed | $value2 | |
| mixed | $field3 | |
| mixed | $value3 |
Definition at line 1869 of file deprecatedlib.php.
| count_records_select | ( | $ | table, |
| $ | select = '', |
||
| $ | countitem = 'COUNT(*)' |
||
| ) |
| mixed | $table | |
| mixed | $select | |
| mixed | $countitem |
Definition at line 1275 of file deprecatedlib.php.
| count_records_sql | ( | $ | sql | ) |
| mixed | $sql |
Definition at line 1284 of file deprecatedlib.php.
| create_table | ( | $ | table | ) |
| string | $table |
Definition at line 955 of file deprecatedlib.php.

| create_temp_table | ( | $ | table | ) |
| string | $table |
Definition at line 968 of file deprecatedlib.php.

| current_theme | ( | ) |
Definition at line 2017 of file deprecatedlib.php.
| db_lowercase | ( | ) |
Definition at line 1461 of file deprecatedlib.php.
| db_uppercase | ( | ) |
Definition at line 1454 of file deprecatedlib.php.
| delete_event | ( | $ | id | ) |
Call this function to delete the event with id $id from calendar table.
| int | $id | The id of an event from the 'event' table. |
Definition at line 3969 of file deprecatedlib.php.


| delete_records | ( | $ | table, |
| $ | field1 = '', |
||
| $ | value1 = '', |
||
| $ | field2 = '', |
||
| $ | value2 = '', |
||
| $ | field3 = '', |
||
| $ | value3 = '' |
||
| ) |
| mixed | $table | |
| mixed | $field1 | |
| mixed | $value1 | |
| mixed | $field2 | |
| mixed | $value2 | |
| mixed | $field3 | |
| mixed | $value3 |
Definition at line 1899 of file deprecatedlib.php.
| delete_records_select | ( | $ | table, |
| $ | select = '' |
||
| ) |
| mixed | $sql | |
| mixed | $select |
Definition at line 1416 of file deprecatedlib.php.
| detect_munged_arguments | ( | $ | string, |
| $ | allowdots = 1 |
||
| ) |
deprecated - use clean_param($string, PARAM_FILE); instead Check for bad characters ?
| string | $string | ? |
| int | $allowdots | ? |
Definition at line 562 of file deprecatedlib.php.
| doc_link | ( | $ | path = '', |
| $ | text = '', |
||
| $ | iconpath = 'ignored' |
||
| ) |
Returns a string containing a link to the user documentation. Also contains an icon by default. Shown to teachers and admin only.
object
| string | $path | The page link after doc root and language, no leading slash. |
| string | $text | The text to be displayed for the link |
| string | $iconpath | The path to the icon to be displayed |
Definition at line 3152 of file deprecatedlib.php.


| drop_field | ( | $ | table, |
| $ | field | ||
| ) |
| string | $table | |
| string | $field |
Definition at line 1010 of file deprecatedlib.php.


| drop_index | ( | $ | table, |
| $ | index | ||
| ) |
| string | $table | |
| string | $index |
Definition at line 1180 of file deprecatedlib.php.

| drop_key | ( | $ | table, |
| $ | key | ||
| ) |
| string | $table | |
| string | $key |
Definition at line 1137 of file deprecatedlib.php.

| drop_table | ( | $ | table | ) |
| string | $table |
Definition at line 929 of file deprecatedlib.php.


| editorhelpbutton | ( | ) |
Returns a string of html with an image of a help icon linked to a help page on a number of help topics. Should be used only with htmleditor or textarea.
object object
| mixed | $helptopics | variable amount of params accepted. Each param may be a string or an array of arguments for helpbutton. |
TODO: MDL-21215
Definition at line 3055 of file deprecatedlib.php.
Print a help button.
Prints a special help button for html editors (htmlarea in this case)
TODO: MDL-21215
Definition at line 3070 of file deprecatedlib.php.
| emoticonhelpbutton | ( | $ | form, |
| $ | field, | ||
| $ | return = false |
||
| ) |
Print a help button.
Prints a special help button that is a link to the "live" emoticon popup
object object
| string | $form | ? |
| string | $field | ? |
| boolean | $return | If true then the output is returned as a string, if false it is printed to the current page. |
TODO: MDL-21215
Definition at line 3039 of file deprecatedlib.php.

| enrol_into_course | ( | $ | course, |
| $ | user, | ||
| $ | enrol | ||
| ) |
Enrol someone without using the default role in a course
Definition at line 208 of file deprecatedlib.php.
| ensure_context_subobj_present | ( | &$ | rec, |
| $ | contextlevel | ||
| ) |
Ensure that $rec->context is present and correct before you continue
When you have a record (for example a $category, $course, $user or $cm that may, or may not, have come from a place that does make_context_subobj, you can use this method to ensure that $rec->context is present and correct before you continue.
Use context_instance_preload() instead.
| object | $rec | a thing that has an associated context. |
| integer | $contextlevel | the type of thing $rec is, one of the CONTEXT_... constants. |
Definition at line 406 of file deprecatedlib.php.
| error | ( | $ | message, |
| $ | link = '' |
||
| ) |
Inndicates fatal error. This function was originally printing the error message directly, since 2.0 it is throwing exception instead. The error printing is handled in default exception handler.
Old method, don't call directly in new code - use print_error instead.
| string | $message | The message to display to the user about the error. |
| string | $link | The url where the user will be prompted to continue. If no url is provided the user will be directed to the site index page. |
Definition at line 830 of file deprecatedlib.php.
| execute_sql | ( | $ | command, |
| $ | feedback = true |
||
| ) |
| mixed | $command | |
| bool | $feedback |
Definition at line 1245 of file deprecatedlib.php.
| execute_sql_arr | ( | $ | sqlarr, |
| $ | continue = true, |
||
| $ | feedback = true |
||
| ) |
| mixed | $sqlarr | |
| mixed | $continue | |
| mixed | $feedback |
Definition at line 1493 of file deprecatedlib.php.
| field_exists | ( | $ | table, |
| $ | field | ||
| ) |
| string | $table | |
| string | $field |
Definition at line 855 of file deprecatedlib.php.

| filter_text | ( | $ | text, |
| $ | courseid = NULL |
||
| ) |
Given some text in HTML format, this function will pass it through any filters that have been configured for this context.
| string | $text | The text to be passed through format filters |
| int | $courseid | The current course. |
Definition at line 71 of file deprecatedlib.php.

| find_check_constraint_name | ( | $ | table, |
| $ | field | ||
| ) |
| string | $table | |
| string | $field |
Definition at line 894 of file deprecatedlib.php.

| find_index_name | ( | $ | table, |
| $ | index | ||
| ) |
| string | $table | |
| string | $index |
Definition at line 868 of file deprecatedlib.php.

| find_key_name | ( | $ | table, |
| $ | xmldb_key | ||
| ) |
| string | $table | |
| string | $xmldb_key |
Definition at line 917 of file deprecatedlib.php.

| formerr | ( | $ | error | ) |
Prints some red text using echo
| string | $error | The text to be displayed in red |
Definition at line 2044 of file deprecatedlib.php.

| get_course_participants | ( | $ | courseid | ) |
Return all course participant for a given course
| integer | $courseid |
Definition at line 314 of file deprecatedlib.php.

| get_current_group | ( | $ | courseid, |
| $ | full = false |
||
| ) |
Gets the current group - either from the session variable or from the database.
object
| int | $courseid | The course being examined - relates to id field in 'course' table. |
| bool | $full | If true, the return value is a full record object. If false, just the id of the record. |
Definition at line 789 of file deprecatedlib.php.

| get_default_course_role | ( | $ | course | ) |
Returns a role object that is the default role for new enrolments in a given course
| object | $course |
Definition at line 219 of file deprecatedlib.php.


Used to be called from help.php to inject a list of smilies into the emoticons help file.
Definition at line 538 of file deprecatedlib.php.

| get_field | ( | $ | table, |
| $ | return, | ||
| $ | field1, | ||
| $ | value1, | ||
| $ | field2 = '', |
||
| $ | value2 = '', |
||
| $ | field3 = '', |
||
| $ | value3 = '' |
||
| ) |
| mixed | $table | |
| mixed | $return | |
| mixed | $field1 | |
| mixed | $value1 | |
| mixed | $field2 | |
| mixed | $value2 | |
| mixed | $field3 | |
| mixed | $value3 |
Definition at line 1915 of file deprecatedlib.php.
| get_field_select | ( | $ | table, |
| $ | return, | ||
| $ | select | ||
| ) |
| mixed | $table | |
| mixed | $return | |
| mixed | $select |
Definition at line 1397 of file deprecatedlib.php.
| get_field_sql | ( | $ | sql | ) |
| mixed | $sql |
Definition at line 1406 of file deprecatedlib.php.
| get_fieldset_select | ( | $ | table, |
| $ | return, | ||
| $ | select | ||
| ) |
| mixed | $table | |
| mixed | $return | |
| mixed | $select |
Definition at line 1614 of file deprecatedlib.php.
| get_fieldset_sql | ( | $ | sql | ) |
| mixed | $sql |
Definition at line 1623 of file deprecatedlib.php.
| get_file_url | ( | $ | path, |
| $ | options = null, |
||
| $ | type = 'coursefile' |
||
| ) |
Given a physical path to a file, returns the URL through which it can be reached in Moodle.
| string | $path | Physical path to a file |
| array | $options | associative array of GET variables to append to the URL |
| string | $type | (questionfile|rssfile|httpscoursefile|coursefile) |
anchor dash character should not be encoded
Definition at line 108 of file deprecatedlib.php.

| get_guest | ( | ) |
Definition at line 289 of file deprecatedlib.php.
Returns a list of all enabled country names in the current translation
Definition at line 267 of file deprecatedlib.php.


Returns a list of currencies in the current language
Definition at line 257 of file deprecatedlib.php.

| get_list_of_languages | ( | $ | refreshcache = false, |
| $ | returnall = false |
||
| ) |
Was returning list of translations, use new string_manager instead
| bool | $refreshcache | force refreshing of lang cache |
| bool | $returnall | ignore langlist, return all languages available |
Definition at line 244 of file deprecatedlib.php.

| get_my_courses | ( | $ | userid, |
| $ | sort = 'visible DESC, |
||
| sortorder ASC' | , | ||
| $ | fields = NULL, |
||
| $ | doanything = false, |
||
| $ | limit = 0 |
||
| ) |
Extremely slow enrolled courses query.
Definition at line 232 of file deprecatedlib.php.
| get_recent_enrolments | ( | $ | courseid, |
| $ | timestart | ||
| ) |
Searches logs to find all enrolments since a certain date
used to print recent activity
object CONTEXT_COURSE
| int | $courseid | The course in question. |
| int | $timestart | The date to check forward of |
Definition at line 341 of file deprecatedlib.php.


| get_record | ( | $ | table, |
| $ | field1, | ||
| $ | value1, | ||
| $ | field2 = '', |
||
| $ | value2 = '', |
||
| $ | field3 = '', |
||
| $ | value3 = '', |
||
| $ | fields = '*' |
||
| ) |
| mixed | $table | |
| mixed | $field1 | |
| mixed | $value1 | |
| mixed | $field2 | |
| mixed | $value2 | |
| mixed | $field3 | |
| mixed | $value3 | |
| mixed | $fields |
Definition at line 1837 of file deprecatedlib.php.

| get_record_select | ( | $ | table, |
| $ | select = '', |
||
| $ | fields = '*' |
||
| ) |
| mixed | $table | |
| mixed | $select | |
| mixed | $fields |
Definition at line 1306 of file deprecatedlib.php.
| get_record_sql | ( | $ | sql, |
| $ | expectmultiple = false, |
||
| $ | nolimit = false |
||
| ) |
| mixed | $sql | |
| bool | $expectmultiple | |
| bool | $nolimit |
Definition at line 1295 of file deprecatedlib.php.
| get_records | ( | $ | table, |
| $ | field = '', |
||
| $ | value = '', |
||
| $ | sort = '', |
||
| $ | fields = '*', |
||
| $ | limitfrom = '', |
||
| $ | limitnum = '' |
||
| ) |
| mixed | $table | |
| mixed | $field | |
| mixed | $value | |
| mixed | $sort | |
| mixed | $fields | |
| mixed | $limitfrom | |
| mixed | $limitnum |
Definition at line 1821 of file deprecatedlib.php.
| get_records_list | ( | $ | table, |
| $ | field = '', |
||
| $ | values = '', |
||
| $ | sort = '', |
||
| $ | fields = '*', |
||
| $ | limitfrom = '', |
||
| $ | limitnum = '' |
||
| ) |
| mixed | $table | |
| mixed | $field | |
| mixed | $values | |
| mixed | $sort | |
| mixed | $fields | |
| mixed | $limitfrom | |
| mixed | $limitnum |
Definition at line 1508 of file deprecatedlib.php.
| get_records_menu | ( | $ | table, |
| $ | field = '', |
||
| $ | value = '', |
||
| $ | sort = '', |
||
| $ | fields = '*', |
||
| $ | limitfrom = '', |
||
| $ | limitnum = '' |
||
| ) |
| mixed | $table | |
| mixed | $field | |
| mixed | $value | |
| mixed | $sort | |
| mixed | $fields | |
| mixed | $limitfrom | |
| mixed | $limitnum |
Definition at line 1538 of file deprecatedlib.php.
| get_records_select | ( | $ | table, |
| $ | select = '', |
||
| $ | sort = '', |
||
| $ | fields = '*', |
||
| $ | limitfrom = '', |
||
| $ | limitnum = '' |
||
| ) |
| mixed | $table | |
| mixed | $select | |
| mixed | $sort | |
| mixed | $fields | |
| mixed | $limitfrom | |
| mixed | $limitnum |
Definition at line 1386 of file deprecatedlib.php.
| get_records_select_menu | ( | $ | table, |
| $ | select = '', |
||
| $ | sort = '', |
||
| $ | fields = '*', |
||
| $ | limitfrom = '', |
||
| $ | limitnum = '' |
||
| ) |
| mixed | $table | |
| mixed | $select | |
| mixed | $sort | |
| mixed | $fields | |
| mixed | $limitfrom | |
| mixed | $limitnum |
Definition at line 1552 of file deprecatedlib.php.
| get_records_sql_menu | ( | $ | sql, |
| $ | limitfrom = '', |
||
| $ | limitnum = '' |
||
| ) |
| mixed | $sql | |
| mixed | $limitfrom | |
| mixed | $limitnum |
Definition at line 1563 of file deprecatedlib.php.
| get_recordset | ( | $ | table, |
| $ | field = '', |
||
| $ | value = '', |
||
| $ | sort = '', |
||
| $ | fields = '*', |
||
| $ | limitfrom = '', |
||
| $ | limitnum = '' |
||
| ) |
| mixed | $table | |
| mixed | $field | |
| mixed | $value | |
| mixed | $sort | |
| mixed | $fields | |
| mixed | $limitfrom | |
| mixed | $limitnum |
Definition at line 1321 of file deprecatedlib.php.
| get_recordset_list | ( | $ | table, |
| $ | field = '', |
||
| $ | values = '', |
||
| $ | sort = '', |
||
| $ | fields = '*', |
||
| $ | limitfrom = '', |
||
| $ | limitnum = '' |
||
| ) |
| mixed | $table | |
| mixed | $field | |
| mixed | $values | |
| mixed | $sort | |
| mixed | $fields | |
| mixed | $limitfrom | |
| mixed | $limitnum |
Definition at line 1523 of file deprecatedlib.php.
| get_recordset_sql | ( | $ | sql, |
| $ | limitfrom = null, |
||
| $ | limitnum = null |
||
| ) |
| mixed | $sql | |
| mixed | $limitfrom | |
| mixed | $limitnum |
Definition at line 1332 of file deprecatedlib.php.
| get_teacher | ( | ) |
Definition at line 303 of file deprecatedlib.php.
| groupmode | ( | $ | course, |
| $ | cm = null |
||
| ) |
Returns the current group mode for a given course or activity module
Could be false, SEPARATEGROUPS or VISIBLEGROUPS (<-- Martin)
| object | $course | Course Object |
| object | $cm | Course Manager Object |
Definition at line 753 of file deprecatedlib.php.

| helpbutton | ( | $ | page, |
| $ | title, | ||
| $ | module = 'moodle', |
||
| $ | image = true, |
||
| $ | linktext = false, |
||
| $ | text = '', |
||
| $ | return = false, |
||
| $ | imagetext = '' |
||
| ) |
Print a help button.
| string | $page | The keyword that defines a help page |
| string | $title | The title of links, rollover tips, alt tags etc 'Help with' (or the language equivalent) will be prefixed and '...' will be stripped. |
| string | $module | Which module is the page defined in |
| mixed | $image | Use a help image for the link? (true/false/"both") |
| boolean | $linktext | If true, display the title next to the help icon. |
| string | $text | If defined then this text is used in the page, and the $page variable is ignored. DEPRECATED! |
| boolean | $return | If true then the output is returned as a string, if false it is printed to the current page. |
| string | $imagetext | The full text for the helpbutton icon. If empty use default help.gif |
Definition at line 3009 of file deprecatedlib.php.

| hide_event | ( | $ | event | ) |
Call this function to hide an event in the calendar table the event will be identified by the id field of the $event object.
| object | $event | An object representing an event from the calendar table. The event will be identified by the id field. |
Definition at line 3983 of file deprecatedlib.php.

| httpsrequired | ( | ) |
This function indicates that current page requires the https when $CFG->loginhttps enabled.
By using this function properly, we can ensure 100% https-ized pages at our entire discretion (login, forgot_password, change_password)
Definition at line 93 of file deprecatedlib.php.
| index_exists | ( | $ | table, |
| $ | index | ||
| ) |
| string | $table | |
| string | $index |
Definition at line 881 of file deprecatedlib.php.

| insert_record | ( | $ | table, |
| $ | dataobject, | ||
| $ | returnid = true, |
||
| $ | primarykey = 'id' |
||
| ) |
| mixed | $table | |
| mixed | $dataobject | |
| mixed | $returnid | |
| mixed | $primarykey |
Definition at line 1795 of file deprecatedlib.php.
| install_from_xmldb_file | ( | $ | file | ) |
| string | $file |
Definition at line 942 of file deprecatedlib.php.

| is_context_subobj_valid | ( | $ | rec, |
| $ | contextlevel | ||
| ) |
Do some basic, quick checks to see whether $rec->context looks like a valid context object.
Use context_instance_preload() instead.
| object | $rec | a think that has a context, for example a course, course category, course modules, etc. |
| int | $contextlevel | the type of thing $rec is, one of the CONTEXT_... constants. |
Definition at line 389 of file deprecatedlib.php.
| is_course_participant | ( | $ | userid, |
| $ | courseid | ||
| ) |
Return true if the user is a participant for a given course
| integer | $userid | |
| integer | $courseid |
Definition at line 326 of file deprecatedlib.php.

| isguest | ( | ) |
Definition at line 296 of file deprecatedlib.php.
| isteacher | ( | ) |
Definition at line 275 of file deprecatedlib.php.
Definition at line 282 of file deprecatedlib.php.
| link_to_popup_window | ( | $ | url, |
| $ | name = null, |
||
| $ | linkname = null, |
||
| $ | height = 400, |
||
| $ | width = 500, |
||
| $ | title = null, |
||
| $ | options = null, |
||
| $ | return = false |
||
| ) |
Creates and displays (or returns) a link to a popup window
| string | $url | Web link. Either relative to $CFG->wwwroot, or a full URL. |
| string | $name | Name to be assigned to the popup window (this is used by client-side scripts to "talk" to the popup window) |
| string | $linkname | Text to be displayed as web link |
| int | $height | Height to assign to popup window |
| int | $width | Height to assign to popup window |
| string | $title | Text to be displayed as popup page title |
| string | $options | List of additional options for popup window |
| bool | $return | If true, return as a string, otherwise print |
| string | $id | id added to the element |
| string | $class | class added to the element |
Definition at line 2712 of file deprecatedlib.php.

| make_context_subobj | ( | $ | rec | ) |
Turn the ctx* fields in an objectlike record into a context subobject This allows us to SELECT from major tables JOINing with context at no cost, saving a ton of context lookups...
Use context_instance_preload() instead.
| object | $rec |
Definition at line 373 of file deprecatedlib.php.
| make_mod_upload_directory | ( | $ | courseid | ) |
Makes an upload directory for a particular module.
This function has been deprecated by the file API changes in Moodle 2.0.
| int | $courseid | The id of the course in question - maps to id field of 'course' table. |
Definition at line 1990 of file deprecatedlib.php.
| modify_database | ( | $ | sqlfile = '', |
| $ | sqlstring = '' |
||
| ) |
| mixed | $sqlfile | |
| mixed | $sqlstring |
Definition at line 1470 of file deprecatedlib.php.
| mygroupid | ( | $ | courseid | ) |
Old functions not used anymore - candidates for removal various deprecated groups function Get the IDs for the user's groups in the given course.
object
| int | $courseid | The course being examined - the 'course' table id field. |
Definition at line 734 of file deprecatedlib.php.


| navmenu | ( | $ | course, |
| $ | cm = NULL, |
||
| $ | targetwindow = 'self' |
||
| ) |
Returns a small popup menu of course activity modules
Given a course and a (current) coursemodule his function returns a small popup menu with all the course activity modules in it, as a navigation menu The data is taken from the serialised array stored in the course record
object object object object CONTEXT_COURSE
| object | $course | A $COURSE object. |
| object | $cm | A $COURSE object. |
| string | $targetwindow | The target window attribute to us |
Definition at line 3871 of file deprecatedlib.php.
| notice_yesno | ( | $ | message, |
| $ | linkyes, | ||
| $ | linkno, | ||
| $ | optionsyes = NULL, |
||
| $ | optionsno = NULL, |
||
| $ | methodyes = 'post', |
||
| $ | methodno = 'post' |
||
| ) |
Print a message along with "Yes" and "No" links for the user to continue.
object
| string | $message | The text to display |
| string | $linkyes | The link to take the user to if they choose "Yes" |
| string | $linkno | The link to take the user to if they choose "No" |
| string | $optionyes | The yes option to show on the notice |
| string | $optionsno | The no option to show |
| string | $methodyes | Form action method to use if yes [post, get] |
| string | $methodno | Form action method to use if no [post, get] |
Definition at line 3215 of file deprecatedlib.php.

| notify | ( | $ | message, |
| $ | classes = 'notifyproblem', |
||
| $ | align = 'center', |
||
| $ | return = false |
||
| ) |
Print a bold message in an optional color.
| string | $message | The message to print out |
| string | $style | Optional style to display message text in |
| string | $align | Alignment option |
| bool | $return | whether to return an output string or echo now |
Definition at line 2274 of file deprecatedlib.php.


| page_id_and_class | ( | &$ | getid, |
| &$ | getclass | ||
| ) |
| string | $getid | used to return $PAGE->pagetype. |
| string | $getclass | used to return $PAGE->legacyclass. |
Definition at line 2031 of file deprecatedlib.php.

| popup_form | ( | $ | baseurl, |
| $ | options, | ||
| $ | formid, | ||
| $ | selected = '', |
||
| $ | nothing = 'choose', |
||
| $ | help = '', |
||
| $ | helptext = '', |
||
| $ | return = false, |
||
| $ | targetwindow = 'self', |
||
| $ | selectlabel = '', |
||
| $ | optionsextra = NULL, |
||
| $ | submitvalue = '', |
||
| $ | disabled = false, |
||
| $ | showbutton = false |
||
| ) |
Implements a complete little form with a dropdown menu.
When JavaScript is on selecting an option from the dropdown automatically submits the form (while avoiding the usual acessibility problems with this appoach). With JavaScript off, a 'Go' button is printed.
object object
| string | $baseurl | The target URL up to the point of the variable that changes |
| array | $options | A list of value-label pairs for the popup list |
| string | $formid | id for the control. Must be unique on the page. Used in the HTML. |
| string | $selected | The option that is initially selected |
| string | $nothing | The label for the "no choice" option |
| string | $help | The name of a help page if help is required |
| string | $helptext | The name of the label for the help button |
| boolean | $return | Indicates whether the function should return the HTML as a string or echo it directly to the page being rendered |
| string | $targetwindow | The name of the target page to open the linked page in. |
| string | $selectlabel | Text to place in a [label] element - preferred for accessibility. |
| array | $optionsextra | an array with the same keys as $options. The values are added within the corresponding <option ...> tag. |
| string | $submitvalue | Optional label for the 'Go' button. Defaults to get_string('go'). |
| boolean | $disabled | If true, the menu will be displayed disabled. |
| boolean | $showbutton | If true, the button will always be shown even if JavaScript is available |
Definition at line 3484 of file deprecatedlib.php.

| print_arrow | ( | $ | direction = 'up', |
| $ | strsort = null, |
||
| $ | return = false |
||
| ) |
Returns an image of an up or down arrow, used for column sorting. To avoid unnecessary DB accesses, please provide this function with the language strings for sortasc and sortdesc.
TODO migrate to outputlib If no sort string is associated with the direction, an arrow with no alt text will be printed/returned.
object
| string | $direction | 'up' or 'down' |
| string | $strsort | The language string used for the alt attribute of this image |
| bool | $return | Whether to print directly or return the html string |
Definition at line 3099 of file deprecatedlib.php.

| print_box | ( | $ | message, |
| $ | classes = 'generalbox', |
||
| $ | ids = '', |
||
| $ | return = false |
||
| ) |
Print a message in a standard themed box. Replaces print_simple_box (see deprecatedlib.php)
| string | $message,the | content of the box |
| string | $classes,space-separated | class names. |
| string | $ids | |
| boolean | $return,return | as string or just print it |
Definition at line 2142 of file deprecatedlib.php.

| print_box_end | ( | $ | return = false | ) |
Simple function to end a box (see above) Replaces print_simple_box_end (see deprecatedlib.php)
| boolean | $return,return | as string or just print it |
Definition at line 2182 of file deprecatedlib.php.

| print_box_start | ( | $ | classes = 'generalbox', |
| $ | ids = '', |
||
| $ | return = false |
||
| ) |
Starts a box using divs Replaces print_simple_box_start (see deprecatedlib.php)
| string | $classes,space-separated | class names. |
| string | $ids | |
| boolean | $return,return | as string or just print it |
Definition at line 2163 of file deprecatedlib.php.

| print_checkbox | ( | $ | name, |
| $ | value, | ||
| $ | checked = true, |
||
| $ | label = '', |
||
| $ | alt = '', |
||
| $ | script = '', |
||
| $ | return = false |
||
| ) |
Display an standard html checkbox with an optional label
int $idcounter
| string | $name | The name of the checkbox |
| string | $value | The valus that the checkbox will pass when checked |
| bool | $checked | The flag to tell the checkbox initial state |
| string | $label | The label to be showed near the checkbox |
| string | $alt | The info to be inserted in the alt tag |
| string | $script | If not '', then this is added to the checkbox element as an onchange handler. |
| bool | $return | Whether this function should return a string or output it (defaults to false) |
Definition at line 3582 of file deprecatedlib.php.

| print_container | ( | $ | message, |
| $ | clearfix = false, |
||
| $ | classes = '', |
||
| $ | idbase = '', |
||
| $ | return = false |
||
| ) |
Print a message in a standard themed container.
| string | $message,the | content of the container |
| boolean | $clearfix | clear both sides |
| string | $classes,space-separated | class names. |
| string | $idbase | |
| boolean | $return,return | as string or just print it |
Definition at line 2204 of file deprecatedlib.php.
| print_container_end | ( | $ | return = false | ) |
Simple function to end a container (see above)
| boolean | $return,return | as string or just print it |
Definition at line 2254 of file deprecatedlib.php.
| print_container_start | ( | $ | clearfix = false, |
| $ | classes = '', |
||
| $ | idbase = '', |
||
| $ | return = false |
||
| ) |
Starts a container using divs
| boolean | $clearfix | clear both sides |
| string | $classes,space-separated | class names. |
| string | $idbase | |
| boolean | $return,return | as string or just print it |
Definition at line 2227 of file deprecatedlib.php.
| print_continue | ( | $ | link, |
| $ | return = false |
||
| ) |
Print a continue button that goes to a particular URL.
| string | $link | The url to create a link to. |
| bool | $return | If set to true output is returned rather than echoed, default false |
Definition at line 2299 of file deprecatedlib.php.
| print_date_selector | ( | $ | day, |
| $ | month, | ||
| $ | year, | ||
| $ | currenttime = 0, |
||
| $ | return = false |
||
| ) |
Prints form items with the names $day, $month and $year
| string | $day | fieldname |
| string | $month | fieldname |
| string | $year | fieldname |
| int | $currenttime | A default timestamp in GMT |
| boolean | $return | If set to true returns rather than echo's |
Definition at line 3440 of file deprecatedlib.php.

| print_file_picture | ( | $ | path, |
| $ | courseid = 0, |
||
| $ | height = '', |
||
| $ | width = '', |
||
| $ | link = '', |
||
| $ | return = false |
||
| ) |
Given the path to a picture file in a course, or a URL, this function includes the picture in the page.
Definition at line 2862 of file deprecatedlib.php.
| print_file_upload_error | ( | $ | filearray = '', |
| $ | returnerror = false |
||
| ) |
If there has been an error uploading a file, print the appropriate error message Numerical constants used as constant definitions not added until PHP version 4.2.0
Definition at line 162 of file deprecatedlib.php.
| print_footer | ( | $ | course = NULL, |
| $ | usercourse = NULL, |
||
| $ | return = false |
||
| ) |
Definition at line 2420 of file deprecatedlib.php.


| print_header | ( | $ | title = '', |
| $ | heading = '', |
||
| $ | navigation = '', |
||
| $ | focus = '', |
||
| $ | meta = '', |
||
| $ | cache = true, |
||
| $ | button = ' ', |
||
| $ | menu = null, |
||
| $ | usexml = false, |
||
| $ | bodytags = '', |
||
| $ | return = false |
||
| ) |
Print a standard header
| string | $title | Appears at the top of the window |
| string | $heading | Appears at the top of the page |
| string | $navigation | Array of $navlinks arrays (keys: name, link, type) for use as breadcrumbs links |
| string | $focus | Indicates form element to get cursor focus on load eg inputform.password |
| string | $meta | Meta tags to be added to the header |
| boolean | $cache | Should this page be cacheable? |
| string | $button | HTML code for a button (usually for module editing) |
| string | $menu | HTML code for a popup menu |
| boolean | $usexml | use XML for this page |
| string | $bodytags | This text will be included verbatim in the <body> tag (useful for onload() etc) |
| bool | $return | If true, return the visible elements of the header instead of echoing them. |
Definition at line 2335 of file deprecatedlib.php.

| print_header_simple | ( | $ | title = '', |
| $ | heading = '', |
||
| $ | navigation = '', |
||
| $ | focus = '', |
||
| $ | meta = '', |
||
| $ | cache = true, |
||
| $ | button = ' ', |
||
| $ | menu = '', |
||
| $ | usexml = false, |
||
| $ | bodytags = '', |
||
| $ | return = false |
||
| ) |
This version of print_header is simpler because the course name does not have to be provided explicitly in the strings. It can be used on the site page as in courses Eventually all print_header could be replaced by print_header_simple
| string | $title | Appears at the top of the window |
| string | $heading | Appears at the top of the page |
| string | $navigation | Premade navigation string (for use as breadcrumbs links) |
| string | $focus | Indicates form element to get cursor focus on load eg inputform.password |
| string | $meta | Meta tags to be added to the header |
| boolean | $cache | Should this page be cacheable? |
| string | $button | HTML code for a button (usually for module editing) |
| string | $menu | HTML code for a popup menu |
| boolean | $usexml | use XML for this page |
| string | $bodytags | This text will be included verbatim in the <body> tag (useful for onload() etc) |
| bool | $return | If true, return the visible elements of the header instead of echoing them. |
Definition at line 2390 of file deprecatedlib.php.
| print_heading | ( | $ | text, |
| $ | deprecated = '', |
||
| $ | size = 2, |
||
| $ | class = 'main', |
||
| $ | return = false, |
||
| $ | id = '' |
||
| ) |
Prints text in a format for use in headings.
| string | $text | The text to be displayed |
| string | $deprecated | No longer used. (Use to do alignment.) |
| int | $size | The size to set the font for text display. |
| string | $class | |
| bool | $return | If set to true output is returned rather than echoed, default false |
| string | $id | The id to use in the element |
Definition at line 2096 of file deprecatedlib.php.

| print_heading_block | ( | $ | heading, |
| $ | class = '', |
||
| $ | return = false |
||
| ) |
Output a standard heading block
| string | $heading | The text to write into the heading |
| string | $class | An additional Class Attr to use for the heading |
| bool | $return | If set to true output is returned rather than echoed, default false |
Definition at line 2120 of file deprecatedlib.php.

| print_heading_with_help | ( | $ | text, |
| $ | helppage, | ||
| $ | module = 'moodle', |
||
| $ | icon = false, |
||
| $ | return = false |
||
| ) |
Centered heading with attached help button (same title text) and optional icon attached
| string | $text | The text to be displayed |
| string | $helppage | The help page to link to |
| string | $module | The module whose help should be linked to |
| string | $icon | Image to display if needed |
| bool | $return | If set to true output is returned rather than echoed, default false |
Definition at line 3652 of file deprecatedlib.php.

| print_headline | ( | $ | text, |
| $ | size = 2, |
||
| $ | return = false |
||
| ) |
Prints a string in a specified size (retained for backward compatibility)
| string | $text | The text to be displayed |
| int | $size | The size to set the font for text display. |
| bool | $return | If set to true output is returned rather than echoed Default false |
Definition at line 2073 of file deprecatedlib.php.

| print_navigation | ( | $ | navigation, |
| $ | separator = 0, |
||
| $ | return = false |
||
| ) |
Prints breadcrumb trail of links, called in theme/-/header.html
This function has now been deprecated please use output's navbar method instead as shown below
echo $OUTPUT->navbar();
| mixed | $navigation | deprecated |
| string | $separator | OBSOLETE, and now deprecated |
| boolean | $return | False to echo the breadcrumb string (default), true to return it. |
Definition at line 3776 of file deprecatedlib.php.
| print_paging_bar | ( | $ | totalcount, |
| $ | page, | ||
| $ | perpage, | ||
| $ | baseurl, | ||
| $ | pagevar = 'page', |
||
| $ | nocurr = false, |
||
| $ | return = false |
||
| ) |
Prints a single paging bar to provide access to other pages (usually in a search)
| int | $totalcount | Thetotal number of entries available to be paged through |
| int | $page | The page you are currently viewing |
| int | $perpage | The number of entries that should be shown per page |
| mixed | $baseurl | If this is a string then it is the url which will be appended with $pagevar, an equals sign and the page number. If this is a moodle_url object then the pagevar param will be replaced by the page no, for each page. |
| string | $pagevar | This is the variable name that you use for the page number in your code (ie. 'tablepage', 'blogpage', etc) |
| bool | $nocurr | do not display the current page as a link (dropped, link is never displayed for the current page) |
| bool | $return | whether to return an output string or echo now |
Definition at line 3179 of file deprecatedlib.php.

| print_png | ( | ) |
Print a png image.
Definition at line 2918 of file deprecatedlib.php.
| print_scale_menu | ( | ) |
Prints a scale menu (as part of an existing form) including help button
Definition at line 3231 of file deprecatedlib.php.
| print_scale_menu_helpbutton | ( | $ | courseid, |
| $ | scale, | ||
| $ | return = false |
||
| ) |
Prints a help button about a scale
object
| id | $courseid | |
| object | $scale | |
| boolean | $return | If set to true returns rather than echo's |
Definition at line 3368 of file deprecatedlib.php.
| print_side_block_end | ( | $ | attributes = array(), |
| $ | title = '' |
||
| ) |
Print table ending tags for a side block box.
object object
| array | $attributes | HTML attributes to apply if possible [id] |
| string | $title |
Definition at line 2533 of file deprecatedlib.php.
| print_side_block_start | ( | $ | heading = '', |
| $ | attributes = array() |
||
| ) |
Starts a nice side block with an optional header.
object object
| string | $heading | HTML for the heading. Can include full HTML or just plain text - plain text will automatically be enclosed in the appropriate heading tags. |
| array | $attributes | HTML attributes to apply if possible |
Definition at line 2520 of file deprecatedlib.php.
| print_simple_box | ( | $ | message, |
| $ | align = '', |
||
| $ | width = '', |
||
| $ | color = '', |
||
| $ | padding = 5, |
||
| $ | class = 'generalbox', |
||
| $ | id = '', |
||
| $ | return = false |
||
| ) |
Print a message in a standard themed box. This old function used to implement boxes using tables. Now it uses a DIV, but the old parameters remain. If possible, $align, $width and $color should not be defined at all. Preferably just use print_box() in weblib.php
| string | $message | The message to display |
| string | $align | alignment of the box, not the text (default center, left, right). |
| string | $width | width of the box, including units %, for example '100'. |
| string | $color | background colour of the box, for example '#eee'. |
| int | $padding | padding in pixels, specified without units. |
| string | $class | space-separated class names. |
| string | $id | space-separated id names. |
| boolean | $return | return as string or just print it |
Definition at line 430 of file deprecatedlib.php.

| print_simple_box_end | ( | $ | return = false | ) |
Print the end portion of a standard themed box. Preferably just use print_box_end() in weblib.php
| boolean | $return | return as string or just print it |
Definition at line 512 of file deprecatedlib.php.

| print_simple_box_start | ( | $ | align = '', |
| $ | width = '', |
||
| $ | color = '', |
||
| $ | padding = 5, |
||
| $ | class = 'generalbox', |
||
| $ | id = '', |
||
| $ | return = false |
||
| ) |
This old function used to implement boxes using tables. Now it uses a DIV, but the old parameters remain. If possible, $align, $width and $color should not be defined at all. Even better, please use print_box_start() in weblib.php
| string | $align | alignment of the box, not the text (default center, left, right). DEPRECATED |
| string | $width | width of the box, including % units, for example '100'. DEPRECATED |
| string | $color | background colour of the box, for example '#eee'. DEPRECATED |
| int | $padding | padding in pixels, specified without units. OBSOLETE |
| string | $class | space-separated class names. |
| string | $id | space-separated id names. |
| boolean | $return | return as string or just print it |
Definition at line 459 of file deprecatedlib.php.


| print_single_button | ( | $ | link, |
| $ | options, | ||
| $ | label = 'OK', |
||
| $ | method = 'get', |
||
| $ | notusedanymore = '', |
||
| $ | return = false, |
||
| $ | tooltip = '', |
||
| $ | disabled = false, |
||
| $ | jsconfirmmessage = '', |
||
| $ | formid = '' |
||
| ) |
Print a self contained form with a single submit button.
| string | $link | used as the action attribute on the form, so the URL that will be hit if the button is clicked. |
| array | $options | these become hidden form fields, so these options get passed to the script at $link. |
| string | $label | the caption that appears on the button. |
| string | $method | HTTP method used on the request of the button is clicked. 'get' or 'post'. |
| string | $notusedanymore | no longer used. |
| boolean | $return | if false, output the form directly, otherwise return the HTML as a string. |
| string | $tooltip | a tooltip to add to the button as a title attribute. |
| boolean | $disabled | if true, the button will be disabled. |
| string | $jsconfirmmessage | if not empty then display a confirm dialogue with this string as the question. |
| string | $formid | The id attribute to use for the form |
Definition at line 2808 of file deprecatedlib.php.

| print_spacer | ( | $ | height = 1, |
| $ | width = 1, |
||
| $ | br = true, |
||
| $ | return = false |
||
| ) |
Print a spacer image with the option of including a line break.
object
| int | $height | The height in pixels to make the spacer |
| int | $width | The width in pixels to make the spacer |
| boolean | $br | If set to true a BR is written after the spacer |
Definition at line 2842 of file deprecatedlib.php.

| print_table | ( | $ | table, |
| $ | return = false |
||
| ) |
Print a nicely formatted table.
| array | $table | is an object with several properties. |
Definition at line 2668 of file deprecatedlib.php.

| print_textarea | ( | $ | usehtmleditor, |
| $ | rows, | ||
| $ | cols, | ||
| $ | width, | ||
| $ | height, | ||
| $ | name, | ||
| $ | value = '', |
||
| $ | obsolete = 0, |
||
| $ | return = false, |
||
| $ | id = '' |
||
| ) |
Prints a basic textarea field.
When using this function, you should
object
| bool | $usehtmleditor | Enables the use of the htmleditor for this field. |
| int | $rows | Number of rows to display (minimum of 10 when $height is non-null) |
| int | $cols | Number of columns to display (minimum of 65 when $width is non-null) |
| null | $width | (Deprecated) Width of the element; if a value is passed, the minimum value for $cols will be 65. Value is otherwise ignored. |
| null | $height | (Deprecated) Height of the element; if a value is passe, the minimum value for $rows will be 10. Value is otherwise ignored. |
| string | $name | Name to use for the textarea element. |
| string | $value | Initial content to display in the textarea. |
| int | $obsolete | deprecated |
| bool | $return | If false, will output string. If true, will return string value. |
| string | $id | CSS ID to add to the textarea element. |
$width and height are legacy fields and no longer used as pixels like they used to be. However, you can set them to zero to override the mincols and minrows values below.
Definition at line 2943 of file deprecatedlib.php.


| print_textfield | ( | $ | name, |
| $ | value, | ||
| $ | alt = '', |
||
| $ | size = 50, |
||
| $ | maxlength = 0, |
||
| $ | return = false |
||
| ) |
Display an standard html text field with an optional label
| string | $name | The name of the text field |
| string | $value | The value of the text field |
| string | $alt | The info to be inserted in the alt tag |
| int | $size | Sets the size attribute of the field. Defaults to 50 |
| int | $maxlength | Sets the maxlength attribute of the field. Not set by default |
| bool | $return | Whether this function should return a string or output it (defaults to false) |
Definition at line 3616 of file deprecatedlib.php.

| print_time_selector | ( | $ | hour, |
| $ | minute, | ||
| $ | currenttime = 0, |
||
| $ | step = 5, |
||
| $ | return = false |
||
| ) |
Prints form items with the names $hour and $minute
| string | $hour | fieldname |
| string | $minute | fieldname |
| int | $currenttime | A default timestamp in GMT |
| int | $step | minute spacing |
| boolean | $return | If set to true returns rather than echo's |
Definition at line 3413 of file deprecatedlib.php.

| print_timer_selector | ( | $ | timelimit = 0, |
| $ | unit = '', |
||
| $ | name = 'timelimit', |
||
| $ | return = false |
||
| ) |
Prints time limit value selector
Uses choose_from_menu() to generate HTML
object
| int | $timelimit | default |
| string | $unit | |
| string | $name | |
| boolean | $return | If set to true returns rather than echo's |
Definition at line 3397 of file deprecatedlib.php.
| print_user | ( | $ | user, |
| $ | course, | ||
| $ | messageselect = false, |
||
| $ | return = false |
||
| ) |
Prints a summary of a user in a nice little box.
Definition at line 3737 of file deprecatedlib.php.
| print_user_picture | ( | $ | user, |
| $ | courseid, | ||
| $ | picture = NULL, |
||
| $ | size = 0, |
||
| $ | return = false, |
||
| $ | link = true, |
||
| $ | target = '', |
||
| $ | alttext = true |
||
| ) |
Print the specified user's avatar.
object object
| mixed | $user | Should be a $user object with at least fields id, picture, imagealt, firstname, lastname, email If any of these are missing, or if a userid is passed, the the database is queried. Avoid this if at all possible, particularly for reports. It is very bad for performance. |
| int | $courseid | The course id. Used when constructing the link to the user's profile. |
| boolean | $picture | The picture to print. By default (or if NULL is passed) $user->picture is used. |
| int | $size | Size in pixels. Special values are (true/1 = 100px) and (false/0 = 35px) for backward compatibility |
| boolean | $return | If false print picture to current page, otherwise return the output as string |
| boolean | $link | enclose printed image in a link the user's profile (default true). |
| string | $target | link target attribute. Makes the profile open in a popup window. |
| boolean | $alttext | add non-blank alt-text to the image. (Default true, set to false for purely decorative images, or where the username will be printed anyway.) |
Definition at line 2886 of file deprecatedlib.php.

| record_exists | ( | $ | table, |
| $ | field1 = '', |
||
| $ | value1 = '', |
||
| $ | field2 = '', |
||
| $ | value2 = '', |
||
| $ | field3 = '', |
||
| $ | value3 = '' |
||
| ) |
| mixed | $table | |
| mixed | $field1 | |
| mixed | $value1 | |
| mixed | $field2 | |
| mixed | $value2 | |
| mixed | $field3 | |
| mixed | $value3 |
Definition at line 1884 of file deprecatedlib.php.
| record_exists_select | ( | $ | table, |
| $ | select = '' |
||
| ) |
| mixed | $table | |
| mixed | $select |
Definition at line 1255 of file deprecatedlib.php.
| record_exists_sql | ( | $ | sql | ) |
| mixed | $sql |
Definition at line 1264 of file deprecatedlib.php.
| records_to_menu | ( | $ | records, |
| $ | field1, | ||
| $ | field2 | ||
| ) |
| mixed | $records | |
| mixed | $field1 | |
| mixed | $field2 |
Definition at line 1590 of file deprecatedlib.php.
| recordset_to_menu | ( | $ | rs | ) |
| mixed | $rs |
Definition at line 1580 of file deprecatedlib.php.
| rename_field | ( | $ | table, |
| $ | field, | ||
| $ | newname | ||
| ) |
| string | $table | |
| string | $field | |
| string | $newname |
Definition at line 1109 of file deprecatedlib.php.

| rename_index | ( | $ | table, |
| $ | index, | ||
| $ | newname | ||
| ) |
| string | $table | |
| string | $index | |
| string | $newname |
Definition at line 1195 of file deprecatedlib.php.

| rename_key | ( | $ | table, |
| $ | key, | ||
| $ | newname | ||
| ) |
| string | $table | |
| string | $key | |
| string | $newname |
Definition at line 1152 of file deprecatedlib.php.

| rename_table | ( | $ | table, |
| $ | newname | ||
| ) |
| string | $table | |
| string | $newname |
Definition at line 982 of file deprecatedlib.php.

| replace_smilies | ( | &$ | text | ) |
Was used to replace all known smileys in the text with image equivalents
This core function has been replaced with filter_emoticon since Moodle 2.0
Definition at line 548 of file deprecatedlib.php.

| require_js | ( | $ | lib | ) |
The old method that was used to include JavaScript libraries. Please use $PAGE->requires->js_module() instead.
| mixed | $lib | The library or libraries to load (a string or array of strings) There are three way to specify the library: 1. a shorname like 'yui_yahoo'. This translates into a call to $PAGE->requires->yui2_lib('yahoo'); 2. the path to the library relative to wwwroot, for example 'lib/javascript-static.js' 3. (legacy) a full URL like $CFG->wwwroot . '/lib/javascript-static.js'. 2. and 3. lead to a call $PAGE->requires->js('/lib/javascript-static.js'). |
Definition at line 1957 of file deprecatedlib.php.

| resolve_filename_collisions | ( | $ | destination, |
| $ | files, | ||
| $ | format = '%s_%d.%s' |
||
| ) |
Handy function for resolving file conflicts
Definition at line 171 of file deprecatedlib.php.
| rollback_sql | ( | ) |
Definition at line 1783 of file deprecatedlib.php.
| rs_close | ( | &$ | rs | ) |
| mixed | $rs |
Definition at line 1372 of file deprecatedlib.php.
| rs_EOF | ( | $ | rs | ) |
| mixed | $rs |
Definition at line 1364 of file deprecatedlib.php.
| rs_fetch_next_record | ( | &$ | rs | ) |
| mixed | $rs |
Definition at line 1356 of file deprecatedlib.php.
| rs_fetch_record | ( | &$ | rs | ) |
| mixed | $rs |
Definition at line 1340 of file deprecatedlib.php.
| rs_next_record | ( | &$ | rs | ) |
| mixed | $rs |
Definition at line 1348 of file deprecatedlib.php.
| set_current_group | ( | $ | courseid, |
| $ | groupid | ||
| ) |
Sets the current group in the session variable When $SESSION->currentgroup[$courseid] is set to 0 it means, show all groups. Sets currentgroup[$courseid] in the session variable appropriately. Does not do any permission checking.
object
| int | $courseid | The course being examined - relates to id field in 'course' table. |
| int | $groupid | The group being examined. |
Definition at line 773 of file deprecatedlib.php.

| set_field | ( | $ | table, |
| $ | newfield, | ||
| $ | newvalue, | ||
| $ | field1, | ||
| $ | value1, | ||
| $ | field2 = '', |
||
| $ | value2 = '', |
||
| $ | field3 = '', |
||
| $ | value3 = '' |
||
| ) |
| mixed | $table | |
| mixed | $newfield | |
| mixed | $newvalue | |
| mixed | $field1 | |
| mixed | $value1 | |
| mixed | $field2 | |
| mixed | $value2 | |
| mixed | $field3 | |
| mixed | $value3 |
Definition at line 1854 of file deprecatedlib.php.
| set_field_select | ( | $ | table, |
| $ | newfield, | ||
| $ | newvalue, | ||
| $ | select, | ||
| $ | localcall = false |
||
| ) |
| mixed | $table | |
| mixed | $newfield | |
| mixed | $newvalue | |
| mixed | $select | |
| mixed | $localcall |
Definition at line 1603 of file deprecatedlib.php.
| show_event | ( | $ | event | ) |
Call this function to unhide an event in the calendar table the event will be identified by the id field of the $event object.
| object | $event | An object representing an event from the calendar table. The event will be identified by the id field. |
Definition at line 3997 of file deprecatedlib.php.

| sid_ob_rewrite | ( | $ | buffer | ) |
Unsupported session id rewriting.
| string | $buffer |
Definition at line 38 of file deprecatedlib.php.
Return the markup for the destination of the 'Skip to main content' links. Accessibility improvement for keyboard-only users.
Used in course formats, /index.php and /course/index.php
Definition at line 2059 of file deprecatedlib.php.
| sql_as | ( | ) |
Definition at line 1438 of file deprecatedlib.php.
| sql_bitand | ( | $ | int1, |
| $ | int2 | ||
| ) |
| mixed | $int1 | |
| mixed | $int2 |
Definition at line 1670 of file deprecatedlib.php.
| sql_bitnot | ( | $ | int1 | ) |
| mixed | $int1 |
Definition at line 1678 of file deprecatedlib.php.
| sql_bitor | ( | $ | int1, |
| $ | int2 | ||
| ) |
| mixed | $int1 | |
| mixed | $int2 |
Definition at line 1687 of file deprecatedlib.php.
| sql_bitxor | ( | $ | int1, |
| $ | int2 | ||
| ) |
| mixed | $int1 | |
| mixed | $int2 |
Definition at line 1696 of file deprecatedlib.php.
| sql_cast_char2int | ( | $ | fieldname, |
| $ | text = false |
||
| ) |
| mixed | $fieldname | |
| mixed | $text |
Definition at line 1705 of file deprecatedlib.php.
| sql_compare_text | ( | $ | fieldname, |
| $ | numchars = 32 |
||
| ) |
| mixed | $fieldname | |
| mixed | $numchars |
Definition at line 1714 of file deprecatedlib.php.
| sql_concat | ( | ) |
Definition at line 1647 of file deprecatedlib.php.
| sql_concat_join | ( | $ | separator = "' '", |
| $ | elements = array() |
||
| ) |
| mixed | $separator | |
| mixed | $elements |
Definition at line 1740 of file deprecatedlib.php.
| sql_empty | ( | ) |
Definition at line 1654 of file deprecatedlib.php.
| sql_fullname | ( | $ | first = 'firstname', |
| $ | last = 'lastname' |
||
| ) |
| mixed | $first | |
| mixed | $last |
Definition at line 1640 of file deprecatedlib.php.
| sql_ilike | ( | ) |
Definition at line 1631 of file deprecatedlib.php.
| sql_isempty | ( | $ | tablename, |
| $ | fieldname, | ||
| $ | nullablefield, | ||
| $ | textfield | ||
| ) |
| mixed | $tablename | |
| mixed | $fieldname | |
| mixed | $nullablefield | |
| mixed | $textfield |
Definition at line 1751 of file deprecatedlib.php.
| sql_isnotempty | ( | $ | tablename, |
| $ | fieldname, | ||
| $ | nullablefield, | ||
| $ | textfield | ||
| ) |
| mixed | $tablename | |
| mixed | $fieldname | |
| mixed | $nullablefield | |
| mixed | $textfield |
Definition at line 1762 of file deprecatedlib.php.
| sql_length | ( | $ | fieldname | ) |
| mixed | $fieldname |
Definition at line 1731 of file deprecatedlib.php.
| sql_max | ( | $ | field | ) |
| mixed | $field |
Definition at line 1431 of file deprecatedlib.php.
| sql_order_by_text | ( | $ | fieldname, |
| $ | numchars = 32 |
||
| ) |
| mixed | $fieldname | |
| mixed | $numchars |
Definition at line 1723 of file deprecatedlib.php.
| sql_paging_limit | ( | $ | page, |
| $ | recordsperpage | ||
| ) |
| mixed | $page | |
| mixed | $recordsperpage |
Definition at line 1447 of file deprecatedlib.php.
| sql_substr | ( | ) |
Definition at line 1661 of file deprecatedlib.php.
| stripslashes_recursive | ( | $ | var | ) |
| mixed | $var |
Definition at line 1220 of file deprecatedlib.php.
| stripslashes_safe | ( | $ | mixed | ) |
removed functions ////
| mixed | $mixed |
Definition at line 1212 of file deprecatedlib.php.
| switchroles_form | ( | $ | courseid | ) |
Returns a little popup menu for switching roles
| int | $courseid | The course to update by id as found in 'course' table |
Definition at line 3885 of file deprecatedlib.php.

| table_column | ( | $ | table, |
| $ | oldfield, | ||
| $ | field, | ||
| $ | type = 'integer', |
||
| $ | size = '10', |
||
| $ | signed = 'unsigned', |
||
| $ | default = '0', |
||
| $ | null = 'not null', |
||
| $ | after = '' |
||
| ) |
| mixed | $table | |
| mixed | $oldfield | |
| mixed | $field | |
| mixed | $type | |
| mixed | $size | |
| mixed | $signed | |
| mixed | $default | |
| mixed | $null | |
| mixed | $after |
Definition at line 1931 of file deprecatedlib.php.
| table_exists | ( | $ | table | ) |
Deprecated DDL functions, to be removed soon ///.
| string | $table |
Definition at line 842 of file deprecatedlib.php.

| theme_setup | ( | $ | theme = '', |
| $ | params = NULL |
||
| ) |
Used to be used for setting up the theme. No longer used by core code, and should not have been used elsewhere.
The theme is now automatically initialised before it is first used. If you really need to force this to happen, just reference $PAGE->theme.
To force a particular theme on a particular page, you can use $PAGE->force_theme(...). However, I can't think of any valid reason to do that outside the theme selector UI.
| string | $theme | The theme to use defaults to current theme |
| array | $params | An array of parameters to use |
Definition at line 2008 of file deprecatedlib.php.
| unzip_file | ( | $ | zipfile, |
| $ | destination = '', |
||
| $ | showstatus_ignored = true |
||
| ) |
Unzip one zip file to a destination dir Both parameters must be FULL paths If destination isn't specified, it will be the SAME directory where the zip file resides.
object
| string | $zipfile | The zip file to unzip |
| string | $destination | The location to unzip to |
| bool | $showstatus_ignored | Unused |
Definition at line 588 of file deprecatedlib.php.


| update_categories_search_button | ( | $ | search, |
| $ | page, | ||
| $ | perpage | ||
| ) |
Prints the editing button on search results listing For bulk move courses to another category
Definition at line 3729 of file deprecatedlib.php.
| update_course_icon | ( | $ | courseid | ) |
Returns a turn edit on/off button for course in a self contained form. Used to be an icon, but it's now a simple form button
Note that the caller is responsible for capchecks.
object object
| int | $courseid | The course to update by id as found in 'course' table |
Definition at line 3752 of file deprecatedlib.php.

| update_event | ( | $ | event | ) |
Call this function to update an event in the calendar table the event will be identified by the id field of the $event object.
| object | $event | An object representing an event from the calendar table. The event will be identified by the id field. |
Definition at line 3955 of file deprecatedlib.php.


| update_log_display_entry | ( | $ | module, |
| $ | action, | ||
| $ | mtable, | ||
| $ | field | ||
| ) |
Insert or update log display entry. Entry may already exist. $module, $action must be unique
| string | $module | |
| string | $action | |
| string | $mtable | |
| string | $field |
Definition at line 54 of file deprecatedlib.php.

| update_module_button | ( | $ | cmid, |
| $ | ignored, | ||
| $ | string | ||
| ) |
Prints the 'update this xxx' button that appears on module pages.
| string | $cmid | the course_module id. |
| string | $ignored | not used any more. (Used to be courseid.) |
| string | $string | the module name - get_string('modulename', 'xxx') |
Definition at line 3707 of file deprecatedlib.php.


Returns a turn edit on/off button for course in a self contained form. Used to be an icon, but it's now a simple form button
Definition at line 3680 of file deprecatedlib.php.
| update_record | ( | $ | table, |
| $ | dataobject | ||
| ) |
| mixed | $table | |
| mixed | $dataobject |
Definition at line 1805 of file deprecatedlib.php.
| update_tag_button | ( | $ | tagid | ) |
Returns a turn edit on/off button for tag in a self contained form.
| string | $tagid | The ID attribute |
Definition at line 3690 of file deprecatedlib.php.

| upload_print_form_fragment | ( | $ | numfiles = 1, |
| $ | names = null, |
||
| $ | descriptions = null, |
||
| $ | uselabels = false, |
||
| $ | labelnames = null, |
||
| $ | coursebytes = 0, |
||
| $ | modbytes = 0, |
||
| $ | return = false |
||
| ) |
This function prints out a number of upload form elements.
Definition at line 187 of file deprecatedlib.php.
| use_html_editor | ( | $ | name = '', |
| $ | editorhidebuttons = '', |
||
| $ | id = '' |
||
| ) |
| mixed | $name | |
| mixed | $editorhidebuttons | |
| mixed | $id |
Definition at line 1942 of file deprecatedlib.php.
| user_login_string | ( | $ | course = 'ignored', |
| $ | user = 'ignored' |
||
| ) |
Returns text to be displayed to the user which reflects their login status
object object object object CONTEXT_COURSE
| course | $course | $COURSE object containing course information |
| user | $user | $USER object containing user information |
Definition at line 2454 of file deprecatedlib.php.

| where_clause | ( | $ | field1 = '', |
| $ | value1 = '', |
||
| $ | field2 = '', |
||
| $ | value2 = '', |
||
| $ | field3 = '', |
||
| $ | value3 = '' |
||
| ) |
| mixed | $field1 | |
| mixed | $value1 | |
| mixed | $field2 | |
| mixed | $value2 | |
| mixed | $field3 | |
| mixed | $value3 |
Definition at line 1483 of file deprecatedlib.php.
| zip_files | ( | $ | originalfiles, |
| $ | destination | ||
| ) |
Zip an array of files/dirs to a destination zip file Both parameters must be FULL paths to the files/dirs
object
| array | $originalfiles | Files to zip |
| string | $destination | The destination path |
Definition at line 654 of file deprecatedlib.php.

