Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/deprecatedlib.php File Reference

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)

Function Documentation

add_event ( event)

CALENDAR MANAGEMENT ////////////////////////////////////////////////////////////////.

Call this function to add an event to the calendar table and to call any calendar plugins

Parameters:
object$eventAn object representing an event from the calendar table. The event will be identified by the id field. The object event should include the following:
  • $event->name - Name for the event
  • $event->description - Description of the event (defaults to '')
  • $event->format - Format for the description (using formatting types defined at the top of weblib.php)
  • $event->courseid - The id of the course this event belongs to (0 = all courses)
  • $event->groupid - The id of the group this event belongs to (0 = no group)
  • $event->userid - The id of the user this event belongs to (0 = no user)
  • $event->modulename - Name of the module that creates this event
  • $event->instance - Instance of the module that owns this event
  • $event->eventtype - The type info together with the module info could be used by calendar plugins to decide how to display event
  • $event->timestart- Timestamp for start of event
  • $event->timeduration - Duration (defaults to zero)
  • $event->visible - 0 if the event should be hidden (e.g. because the activity that created it is hidden)
Returns:
int|false The id number of the resulting record or false if failed

Definition at line 3938 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

add_field ( table,
field 
)
Deprecated:
object
Parameters:
string$table
string$field
Returns:
bool

Definition at line 996 of file deprecatedlib.php.

Here is the call graph for this function:

add_index ( table,
index 
)
Deprecated:
object
Parameters:
string$table
string$index
Returns:
bool

Definition at line 1166 of file deprecatedlib.php.

Here is the call graph for this function:

add_key ( table,
key 
)
Deprecated:
object
Parameters:
string$table
string$key
Returns:
bool

Definition at line 1123 of file deprecatedlib.php.

Here is the call graph for this function:

addslashes_object ( dataobject)
Deprecated:
Parameters:
mixed$dataobject
Returns:
void Throws an error and does nothing

Definition at line 1228 of file deprecatedlib.php.

Deprecated:
Parameters:
mixed$var
Returns:
void Throws an error and does nothing

Definition at line 1236 of file deprecatedlib.php.

Deprecated:
since Moodle 1.9. Please use normal $OUTPUT->footer() instead

Definition at line 3906 of file deprecatedlib.php.

Here is the call graph for this function:

Print header for admin page

Deprecated:
since Moodle 20. Please use normal $OUTPUT->header() instead
Parameters:
string$focusfocus element

Definition at line 3895 of file deprecatedlib.php.

Here is the call graph for this function:

auth_get_plugin_title ( authtype)

Return the authentication plugin title

Parameters:
string$authtypeplugin type
Returns:
string

Definition at line 197 of file deprecatedlib.php.

Here is the call graph for this function:

begin_sql ( )
Deprecated:
Returns:
void Throws an error and does nothing

Definition at line 1769 of file deprecatedlib.php.

blocks_execute_action ( page,
&$  blockmanager,
blockaction,
instanceorid,
pinned = false,
redirect = true 
)
Deprecated:
since Moodle 2.0. See the replacements in blocklib.php.
Parameters:
object$pageThe page object
object$blockmanagerThe block manager object
string$blockactionOne of [config, add, delete]
int | object$instanceoridThe instance id or a block_instance object
bool$pinned
bool$redirectTo 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.

Deprecated:
since Moodle 2.0. See the replacements in blocklib.php.
Parameters:
$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

Deprecated:
since Moodle 2.0. Blocks have been changed. block_manager::process_url_actions is the closest replacement.
Parameters:
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.

Deprecated:
since Moodle 2.0. always returns false.
Parameters:
object$blockmanager
string$region
Returns:
bool

Definition at line 2550 of file deprecatedlib.php.

Here is the call graph for this function:

blocks_move_block ( page,
&$  instance,
destpos,
destweight = NULL,
pinned = false 
)

Moves a block to the new position (column) and weight (sort order).

Deprecated:
since Moodle 2.0. See the replacements in blocklib.php.
Parameters:
object$instanceThe block instance to be moved.
string$destposBLOCK_POS_LEFT or BLOCK_POS_RIGHT. The destination column.
string$destweightThe destination sort order. If NULL, we add to the end of the destination column.
bool$pinnedAre 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.
Returns:
boolean success or failure

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.

Deprecated:
since Moodle 2.0. Layout is now controlled by the theme.
Parameters:
mixed$instances

Definition at line 2594 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
since Moodle 2.0. does nothing.
Parameters:
object$page
object$blockmanager
string$region

Definition at line 2567 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
since Moodle 2.0.
Parameters:
object$page
Returns:
array

Definition at line 2581 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
since 2.0
Parameters:
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$cmdeprecated
Returns:
array Navigation array

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.

Deprecated:
since Moodle 2.0
Parameters:
string$urlWeb link. Either relative to $CFG->wwwroot, or a full URL.
string$nameName to be assigned to the popup window (this is used by client-side scripts to "talk" to the popup window)
string$linknameText to be displayed as web link
int$heightHeight to assign to popup window
int$widthHeight to assign to popup window
string$titleText to be displayed as popup page title
string$optionsList of additional options for popup window
bool$returnIf true, return as a string, otherwise print
string$idid added to the element
string$classclass added to the element
Returns:
string html code to display a link to a popup window.

Definition at line 2736 of file deprecatedlib.php.

Here is the call graph for this function:

change_field_default ( table,
field 
)
Deprecated:
object
Parameters:
string$table
string$field
Returns:
bool

Definition at line 1094 of file deprecatedlib.php.

Here is the call graph for this function:

change_field_enum ( table,
field 
)
Deprecated:
object
Parameters:
string$table
string$field
Returns:
bool

Definition at line 1080 of file deprecatedlib.php.

Here is the call graph for this function:

change_field_notnull ( table,
field 
)
Deprecated:
object
Parameters:
string$table
string$field
Returns:
bool

Definition at line 1066 of file deprecatedlib.php.

Here is the call graph for this function:

change_field_precision ( table,
field 
)
Deprecated:
object
Parameters:
string$table
string$field
Returns:
bool

Definition at line 1038 of file deprecatedlib.php.

Here is the call graph for this function:

change_field_type ( table,
field 
)
Deprecated:
object
Parameters:
string$table
string$field
Returns:
bool

Definition at line 1024 of file deprecatedlib.php.

Here is the call graph for this function:

change_field_unsigned ( table,
field 
)
Deprecated:
object
Parameters:
string$table
string$field
Returns:
bool

Definition at line 1052 of file deprecatedlib.php.

Here is the call graph for this function:

check_constraint_exists ( table,
field 
)
Deprecated:
object

Definition at line 904 of file deprecatedlib.php.

Here is the call graph for this function:

check_potential_filename ( destination,
filename,
files 
)

Checks a file name for any conflicts

Deprecated:
removed - use new file api

Definition at line 179 of file deprecatedlib.php.

Deprecated, now handled automatically in themes

Definition at line 2243 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
since Moodle 2.0

Normally, you only need to use the first few parameters.

Parameters:
array$optionsThe options to offer. An array of the form $options[{value}] = {text displayed for that option};
string$namethe name of this form control, as in <select name="..." ...
string$selectedthe option to select initially, default none.
string$nothingThe 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$scriptif not '', then this is added to the <select> element as an onchange handler.
string$nothingvalueThe value corresponding to the $nothing option. Defaults to 0.
boolean$returnif false (the default) the the output is printed directly, If true, the generated HTML is returned as a string.
boolean$disabledif true, the select is generated in a disabled state. Default, false.
int$tabindexif give, sets the tabindex attribute on the <select> element. Default none.
string$idvalue to use for the id attribute of the <select> element. If none is given, then a suitable one is constructed.
mixed$listboxif 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$multipleif true, enable multiple selections, else only 1 item can be selected. Used when $listbox display is enabled
string$classvalue to use for the class attribute of the <select> element. If none is given, then a suitable one is constructed.
Returns:
string|void If $return=true returns string, else echo's and returns void

Definition at line 3265 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
since Moodle 2.0

This function is very similar to choose_from_menu_yesno() and choose_from_menu()

Todo:
Add datatype handling to make sure $options is an array
Parameters:
array$optionsAn array of objects to choose from
string$nameThe XHTML field name
string$selectedThe value to select by default
string$nothingThe label for the 'nothing is selected' option. Defaults to get_string('choose').
string$scriptIf not '', then this is added to the <select> element as an onchange handler.
string$nothingvalueThe value for the first `nothing` option if $nothing is set
bool$returnWhether this function should return a string or output it (defaults to false)
bool$disabledIs the field disabled by default
int | string$tabindexOverride the tabindex attribute [numeric]
Returns:
string|void If $return=true returns string, else echo's and returns void

Definition at line 3350 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
since Moodle 2.0

Calls choose_from_menu() with preset arguments

See also:
choose_from_menu()
Parameters:
string$namethe name of this form control, as in <select name="..." ...
string$selectedthe option to select initially, default none.
string$scriptif not '', then this is added to the <select> element as an onchange handler.
boolean$returnWhether this function should return a string or output it (defaults to false)
boolean$disabled(defaults to false)
int$tabindex
Returns:
string|void If $return=true returns string, else echo's and returns void

Definition at line 3308 of file deprecatedlib.php.

Here is the call graph for this function:

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

Deprecated:
since Moodle 2.0

int $idcounter

Parameters:
array$optionsAn array of value-label pairs for the radio group (values as keys)
string$nameName of the radiogroup (unique in the form)
string$checkedThe value that is already checked
bool$returnWhether this function should return a string or output it (defaults to false)
Returns:
string|void If $return=true returns string, else echo's and returns void

Definition at line 3561 of file deprecatedlib.php.

Here is the call graph for this function:

close_window_button ( name = 'closewindow',
return = false,
reloadopener = false 
)

Prints a simple button to close a window

Deprecated:
since Moodle 2.0

object

Parameters:
string$nameName of the window to close
boolean$returnwhether this function should return a string or output it.
boolean$reloadopenerif true, clicking the button will also reload the page that opend this popup window.
Returns:
string|void if $return is true, void otherwise

Definition at line 3535 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

column_type ( table,
column 
)
Deprecated:
Parameters:
mixed$table
mixed$column
Returns:
void Throws an error and does nothing

Definition at line 1572 of file deprecatedlib.php.

Deprecated:
Returns:
void Throws an error and does nothing

Definition at line 1776 of file deprecatedlib.php.

Deprecated:
Returns:
void Throws an error and does nothing

Definition at line 1423 of file deprecatedlib.php.

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

Parameters:
string$textPassed in by reference. The string to be searched for urls.

Definition at line 528 of file deprecatedlib.php.

Here is the call graph for this function:

count_records ( table,
field1 = '',
value1 = '',
field2 = '',
value2 = '',
field3 = '',
value3 = '' 
)
Deprecated:
use $DB->count_records() instead
See also:
moodle_database::count_records()
Parameters:
mixed$table
mixed$field1
mixed$value1
mixed$field2
mixed$value2
mixed$field3
mixed$value3
Returns:
void Throws an error and does nothing

Definition at line 1869 of file deprecatedlib.php.

count_records_select ( table,
select = '',
countitem = 'COUNT(*)' 
)
Deprecated:
use $DB->count_records_select() instead
See also:
moodle_database::count_records_select()
Parameters:
mixed$table
mixed$select
mixed$countitem
Returns:
void Throws an error and does nothing

Definition at line 1275 of file deprecatedlib.php.

count_records_sql ( sql)
Deprecated:
use $DB->count_records_sql() instead
See also:
moodle_database::count_records_sql()
Parameters:
mixed$sql
Returns:
void Throws an error and does nothing

Definition at line 1284 of file deprecatedlib.php.

create_table ( table)
Deprecated:
object
Parameters:
string$table
Returns:
bool

Definition at line 955 of file deprecatedlib.php.

Here is the call graph for this function:

create_temp_table ( table)
Deprecated:
object
Parameters:
string$table
Returns:
bool

Definition at line 968 of file deprecatedlib.php.

Here is the call graph for this function:

Deprecated:
use $PAGE->theme->name instead.
Returns:
string the name of the current theme.

Definition at line 2017 of file deprecatedlib.php.

Deprecated:
Returns:
void Throws an error and does nothing

Definition at line 1461 of file deprecatedlib.php.

Deprecated:
Returns:
void Throws an error and does nothing

Definition at line 1454 of file deprecatedlib.php.

delete_event ( id)

Call this function to delete the event with id $id from calendar table.

Parameters:
int$idThe id of an event from the 'event' table.
Returns:
bool

Definition at line 3969 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

delete_records ( table,
field1 = '',
value1 = '',
field2 = '',
value2 = '',
field3 = '',
value3 = '' 
)
Deprecated:
use $DB->delete_records() instead
See also:
moodle_database::delete_records()
Parameters:
mixed$table
mixed$field1
mixed$value1
mixed$field2
mixed$value2
mixed$field3
mixed$value3
Returns:
void Throws an error and does nothing

Definition at line 1899 of file deprecatedlib.php.

delete_records_select ( table,
select = '' 
)
Deprecated:
use $DB->delete_records_select() instead
See also:
moodle_database::delete_records_select()
Parameters:
mixed$sql
mixed$select
Returns:
void Throws an error and does nothing

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 ?

Todo:
Finish documenting this function - more detail needed in description as well as details on arguments
Parameters:
string$string?
int$allowdots?
Returns:
bool

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.

Deprecated:
since Moodle 2.0

object

Parameters:
string$pathThe page link after doc root and language, no leading slash.
string$textThe text to be displayed for the link
string$iconpathThe path to the icon to be displayed
Returns:
string Either the link or an empty string

Definition at line 3152 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

drop_field ( table,
field 
)
Deprecated:
object
Parameters:
string$table
string$field
Returns:
bool

Definition at line 1010 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

drop_index ( table,
index 
)
Deprecated:
object
Parameters:
string$table
string$index
Returns:
bool

Definition at line 1180 of file deprecatedlib.php.

Here is the call graph for this function:

drop_key ( table,
key 
)
Deprecated:
object
Parameters:
string$table
string$key
Returns:
bool

Definition at line 1137 of file deprecatedlib.php.

Here is the call graph for this function:

drop_table ( table)
Deprecated:
object
Parameters:
string$table
Returns:
bool

Definition at line 929 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
mixed$helptopicsvariable amount of params accepted. Each param may be a string or an array of arguments for helpbutton.
Returns:
string Link to help button

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:
Write code into this function! detect current editor and print correct info object
Returns:
string Only returns an empty string at the moment

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

Todo:
Finish documenting this function

object object

Parameters:
string$form?
string$field?
boolean$returnIf true then the output is returned as a string, if false it is printed to the current page.
Returns:
string|void Depending on value of $return

TODO: MDL-21215

Definition at line 3039 of file deprecatedlib.php.

Here is the call graph for this function:

enrol_into_course ( course,
user,
enrol 
)

Enrol someone without using the default role in a course

Deprecated:

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.

Deprecated:
since 2.0
Parameters:
object$reca thing that has an associated context.
integer$contextlevelthe 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.

Parameters:
string$messageThe message to display to the user about the error.
string$linkThe url where the user will be prompted to continue. If no url is provided the user will be directed to the site index page.
Returns:
void, always throws moodle_exception

Definition at line 830 of file deprecatedlib.php.

execute_sql ( command,
feedback = true 
)
Deprecated:
Parameters:
mixed$command
bool$feedback
Returns:
void Throws an error and does nothing

Definition at line 1245 of file deprecatedlib.php.

execute_sql_arr ( sqlarr,
continue = true,
feedback = true 
)
Deprecated:
Parameters:
mixed$sqlarr
mixed$continue
mixed$feedback
Returns:
void Throws an error and does nothing

Definition at line 1493 of file deprecatedlib.php.

field_exists ( table,
field 
)
Deprecated:
object
Parameters:
string$table
string$field
Returns:
bool

Definition at line 855 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
use the text formatting in a standard way instead, this was abused mostly for embedding of attachments
Parameters:
string$textThe text to be passed through format filters
int$courseidThe current course.
Returns:
string the filtered string.

Definition at line 71 of file deprecatedlib.php.

Here is the call graph for this function:

find_check_constraint_name ( table,
field 
)
Deprecated:
object
Parameters:
string$table
string$field
Returns:
bool

Definition at line 894 of file deprecatedlib.php.

Here is the call graph for this function:

find_index_name ( table,
index 
)
Deprecated:
object
Parameters:
string$table
string$index
Returns:
bool

Definition at line 868 of file deprecatedlib.php.

Here is the call graph for this function:

find_key_name ( table,
xmldb_key 
)
Deprecated:
object
Parameters:
string$table
string$xmldb_key
Returns:
bool

Definition at line 917 of file deprecatedlib.php.

Here is the call graph for this function:

formerr ( error)

Prints some red text using echo

Deprecated:
Parameters:
string$errorThe text to be displayed in red

Definition at line 2044 of file deprecatedlib.php.

Here is the call graph for this function:

get_course_participants ( courseid)

Return all course participant for a given course

Deprecated:
Parameters:
integer$courseid
Returns:
array of user

Definition at line 314 of file deprecatedlib.php.

Here is the call graph for this function:

get_current_group ( courseid,
full = false 
)

Gets the current group - either from the session variable or from the database.

object

Parameters:
int$courseidThe course being examined - relates to id field in 'course' table.
bool$fullIf true, the return value is a full record object. If false, just the id of the record.
Returns:
int|bool

Definition at line 789 of file deprecatedlib.php.

Here is the call graph for this function:

get_default_course_role ( course)

Returns a role object that is the default role for new enrolments in a given course

Deprecated:
Parameters:
object$course
Returns:
object returns a role or NULL if none set

Definition at line 219 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Used to be called from help.php to inject a list of smilies into the emoticons help file.

Returns:
string HTML

Definition at line 538 of file deprecatedlib.php.

Here is the call graph for this function:

get_field ( table,
return,
field1,
value1,
field2 = '',
value2 = '',
field3 = '',
value3 = '' 
)
Deprecated:
use $DB->get_field() instead
See also:
moodle_database::get_field()
Parameters:
mixed$table
mixed$return
mixed$field1
mixed$value1
mixed$field2
mixed$value2
mixed$field3
mixed$value3
Returns:
void Throws an error and does nothing

Definition at line 1915 of file deprecatedlib.php.

get_field_select ( table,
return,
select 
)
Deprecated:
use $DB->get_field_select() instead
See also:
moodle_database::get_field_select()
Parameters:
mixed$table
mixed$return
mixed$select
Returns:
void Throws an error and does nothing

Definition at line 1397 of file deprecatedlib.php.

get_field_sql ( sql)
Deprecated:
use $DB->get_field_sql() instead
See also:
moodle_database::get_field_sql()
Parameters:
mixed$sql
Returns:
void Throws an error and does nothing

Definition at line 1406 of file deprecatedlib.php.

get_fieldset_select ( table,
return,
select 
)
Deprecated:
use $DB->get_fieldset_select() instead
See also:
moodle_database::get_fieldset_select()
Parameters:
mixed$table
mixed$return
mixed$select
Returns:
void Throws an error and does nothing

Definition at line 1614 of file deprecatedlib.php.

get_fieldset_sql ( sql)
Deprecated:
use $DB->get_fieldset_sql() instead
See also:
moodle_database::get_fieldset_sql()
Parameters:
mixed$sql
Returns:
void Throws an error and does nothing

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.

Deprecated:
use moodle_url factory methods instead
Parameters:
string$pathPhysical path to a file
array$optionsassociative array of GET variables to append to the URL
string$type(questionfile|rssfile|httpscoursefile|coursefile)
Returns:
string URL to file

anchor dash character should not be encoded

Definition at line 108 of file deprecatedlib.php.

Here is the caller graph for this function:

get_guest ( )
Deprecated:

Definition at line 289 of file deprecatedlib.php.

Returns a list of all enabled country names in the current translation

Deprecated:
Returns:
array two-letter country code => translated name.

Definition at line 267 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns a list of currencies in the current language

Deprecated:
Returns:
array

Definition at line 257 of file deprecatedlib.php.

Here is the call graph for this function:

get_list_of_languages ( refreshcache = false,
returnall = false 
)

Was returning list of translations, use new string_manager instead

Deprecated:
Parameters:
bool$refreshcacheforce refreshing of lang cache
bool$returnallignore langlist, return all languages available
Returns:
array An associative array with contents in the form of LanguageCode => LanguageName

Definition at line 244 of file deprecatedlib.php.

Here is the call graph for this function:

get_my_courses ( userid,
sort = 'visible DESC,
sortorder ASC'  ,
fields = NULL,
doanything = false,
limit = 0 
)

Extremely slow enrolled courses query.

Deprecated:

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

Parameters:
int$courseidThe course in question.
int$timestartThe date to check forward of
Returns:
object|false $USER records or false if error.

Definition at line 341 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_record ( table,
field1,
value1,
field2 = '',
value2 = '',
field3 = '',
value3 = '',
fields = '*' 
)
Deprecated:
use $DB->get_record() instead
See also:
moodle_database::get_record()
Parameters:
mixed$table
mixed$field1
mixed$value1
mixed$field2
mixed$value2
mixed$field3
mixed$value3
mixed$fields
Returns:
void Throws an error and does nothing

Definition at line 1837 of file deprecatedlib.php.

Here is the caller graph for this function:

get_record_select ( table,
select = '',
fields = '*' 
)
Deprecated:
use $DB->get_record_select() instead
See also:
moodle_database::get_record_select()
Parameters:
mixed$table
mixed$select
mixed$fields
Returns:
void Throws an error and does nothing

Definition at line 1306 of file deprecatedlib.php.

get_record_sql ( sql,
expectmultiple = false,
nolimit = false 
)
Deprecated:
use $DB->get_record_sql() instead
See also:
moodle_database::get_record_sql()
Parameters:
mixed$sql
bool$expectmultiple
bool$nolimit
Returns:
void Throws an error and does nothing

Definition at line 1295 of file deprecatedlib.php.

get_records ( table,
field = '',
value = '',
sort = '',
fields = '*',
limitfrom = '',
limitnum = '' 
)
Deprecated:
use $DB->get_records() instead
See also:
moodle_database::get_records()
Parameters:
mixed$table
mixed$field
mixed$value
mixed$sort
mixed$fields
mixed$limitfrom
mixed$limitnum
Returns:
void Throws an error and does nothing

Definition at line 1821 of file deprecatedlib.php.

get_records_list ( table,
field = '',
values = '',
sort = '',
fields = '*',
limitfrom = '',
limitnum = '' 
)
Deprecated:
use $DB->get_records_list() instead
See also:
moodle_database::get_records_list()
Parameters:
mixed$table
mixed$field
mixed$values
mixed$sort
mixed$fields
mixed$limitfrom
mixed$limitnum
Returns:
void Throws an error and does nothing

Definition at line 1508 of file deprecatedlib.php.

get_records_menu ( table,
field = '',
value = '',
sort = '',
fields = '*',
limitfrom = '',
limitnum = '' 
)
Deprecated:
use $DB->get_records_menu() instead
See also:
moodle_database::get_records_menu()
Parameters:
mixed$table
mixed$field
mixed$value
mixed$sort
mixed$fields
mixed$limitfrom
mixed$limitnum
Returns:
void Throws an error and does nothing

Definition at line 1538 of file deprecatedlib.php.

get_records_select ( table,
select = '',
sort = '',
fields = '*',
limitfrom = '',
limitnum = '' 
)
Deprecated:
use $DB->get_records_select() instead
See also:
moodle_database::get_records_select()
Parameters:
mixed$table
mixed$select
mixed$sort
mixed$fields
mixed$limitfrom
mixed$limitnum
Returns:
void Throws an error and does nothing

Definition at line 1386 of file deprecatedlib.php.

get_records_select_menu ( table,
select = '',
sort = '',
fields = '*',
limitfrom = '',
limitnum = '' 
)
Deprecated:
use $DB->get_records_select_menu() instead
See also:
moodle_database::get_records_select_menu()
Parameters:
mixed$table
mixed$select
mixed$sort
mixed$fields
mixed$limitfrom
mixed$limitnum
Returns:
void Throws an error and does nothing

Definition at line 1552 of file deprecatedlib.php.

get_records_sql_menu ( sql,
limitfrom = '',
limitnum = '' 
)
Deprecated:
use $DB->get_records_sql_menu() instead
See also:
moodle_database::get_records_sql_menu()
Parameters:
mixed$sql
mixed$limitfrom
mixed$limitnum
Returns:
void Throws an error and does nothing

Definition at line 1563 of file deprecatedlib.php.

get_recordset ( table,
field = '',
value = '',
sort = '',
fields = '*',
limitfrom = '',
limitnum = '' 
)
Deprecated:
use $DB->get_recordset() instead
See also:
moodle_database::get_recordset()
Parameters:
mixed$table
mixed$field
mixed$value
mixed$sort
mixed$fields
mixed$limitfrom
mixed$limitnum
Returns:
void Throws an error and does nothing

Definition at line 1321 of file deprecatedlib.php.

get_recordset_list ( table,
field = '',
values = '',
sort = '',
fields = '*',
limitfrom = '',
limitnum = '' 
)
Deprecated:
use $DB->get_recordset_list() instead
See also:
moodle_database::get_recordset_list()
Parameters:
mixed$table
mixed$field
mixed$values
mixed$sort
mixed$fields
mixed$limitfrom
mixed$limitnum
Returns:
void Throws an error and does nothing

Definition at line 1523 of file deprecatedlib.php.

get_recordset_sql ( sql,
limitfrom = null,
limitnum = null 
)
Deprecated:
use $DB->get_recordset_sql() instead
See also:
moodle_database::get_recordset_sql()
Parameters:
mixed$sql
mixed$limitfrom
mixed$limitnum
Returns:
void Throws an error and does nothing

Definition at line 1332 of file deprecatedlib.php.

Deprecated:

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)

Parameters:
object$courseCourse Object
object$cmCourse Manager Object
Returns:
mixed $course->groupmode

Definition at line 753 of file deprecatedlib.php.

Here is the caller graph for this function:

helpbutton ( page,
title,
module = 'moodle',
image = true,
linktext = false,
text = '',
return = false,
imagetext = '' 
)

Print a help button.

Deprecated:
since Moodle 2.0
Parameters:
string$pageThe keyword that defines a help page
string$titleThe title of links, rollover tips, alt tags etc 'Help with' (or the language equivalent) will be prefixed and '...' will be stripped.
string$moduleWhich module is the page defined in
mixed$imageUse a help image for the link? (true/false/"both")
boolean$linktextIf true, display the title next to the help icon.
string$textIf defined then this text is used in the page, and the $page variable is ignored. DEPRECATED!
boolean$returnIf true then the output is returned as a string, if false it is printed to the current page.
string$imagetextThe full text for the helpbutton icon. If empty use default help.gif
Returns:
string|void Depending on value of $return

Definition at line 3009 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Parameters:
object$eventAn object representing an event from the calendar table. The event will be identified by the id field.
Returns:
true

Definition at line 3983 of file deprecatedlib.php.

Here is the caller graph for this function:

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)

Deprecated:
use $PAGE->https_required() instead

Definition at line 93 of file deprecatedlib.php.

index_exists ( table,
index 
)
Deprecated:
object
Parameters:
string$table
string$index
Returns:
bool

Definition at line 881 of file deprecatedlib.php.

Here is the call graph for this function:

insert_record ( table,
dataobject,
returnid = true,
primarykey = 'id' 
)
Deprecated:
use $DB->insert_record() instead
See also:
moodle_database::insert_record()
Parameters:
mixed$table
mixed$dataobject
mixed$returnid
mixed$primarykey
Returns:
void Throws an error and does nothing

Definition at line 1795 of file deprecatedlib.php.

Deprecated:
object
Parameters:
string$file
Returns:
bool

Definition at line 942 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
since 2.0
Parameters:
object$reca think that has a context, for example a course, course category, course modules, etc.
int$contextlevelthe type of thing $rec is, one of the CONTEXT_... constants.
Returns:
bool whether $rec->context looks like the correct context object for this thing.

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

Deprecated:
Parameters:
integer$userid
integer$courseid
Returns:
boolean

Definition at line 326 of file deprecatedlib.php.

Here is the call graph for this function:

isguest ( )
Deprecated:

Definition at line 296 of file deprecatedlib.php.

isteacher ( )
Deprecated:

Definition at line 275 of file deprecatedlib.php.

Deprecated:

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

Deprecated:
since Moodle 2.0
Parameters:
string$urlWeb link. Either relative to $CFG->wwwroot, or a full URL.
string$nameName to be assigned to the popup window (this is used by client-side scripts to "talk" to the popup window)
string$linknameText to be displayed as web link
int$heightHeight to assign to popup window
int$widthHeight to assign to popup window
string$titleText to be displayed as popup page title
string$optionsList of additional options for popup window
bool$returnIf true, return as a string, otherwise print
string$idid added to the element
string$classclass added to the element
Returns:
string html code to display a link to a popup window.

Definition at line 2712 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
since 2.0
Parameters:
object$rec
Returns:
object

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.

Deprecated:
Parameters:
int$courseidThe id of the course in question - maps to id field of 'course' table.
Returns:
string|false Returns full path to directory if successful, false if not

Definition at line 1990 of file deprecatedlib.php.

modify_database ( sqlfile = '',
sqlstring = '' 
)
Deprecated:
Parameters:
mixed$sqlfile
mixed$sqlstring
Returns:
void Throws an error and does nothing

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

Parameters:
int$courseidThe course being examined - the 'course' table id field.
Returns:
array|bool An _array_ of groupids, or false (Was return $groupids[0] - consequences!)

Definition at line 734 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
object$courseA $COURSE object.
object$cmA $COURSE object.
string$targetwindowThe target window attribute to us
Returns:
string

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.

Deprecated:
since Moodle 2.0

object

Parameters:
string$messageThe text to display
string$linkyesThe link to take the user to if they choose "Yes"
string$linknoThe link to take the user to if they choose "No"
string$optionyesThe yes option to show on the notice
string$optionsnoThe no option to show
string$methodyesForm action method to use if yes [post, get]
string$methodnoForm action method to use if no [post, get]
Returns:
void Output is echo'd

Definition at line 3215 of file deprecatedlib.php.

Here is the call graph for this function:

notify ( message,
classes = 'notifyproblem',
align = 'center',
return = false 
)

Print a bold message in an optional color.

Deprecated:
use $OUTPUT->notification instead.
Parameters:
string$messageThe message to print out
string$styleOptional style to display message text in
string$alignAlignment option
bool$returnwhether to return an output string or echo now
Returns:
string|bool Depending on $result

Definition at line 2274 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

page_id_and_class ( &$  getid,
&$  getclass 
)
Todo:
Remove this deprecated function when no longer used
Deprecated:
since Moodle 2.0 - use $PAGE->pagetype instead of the .
Parameters:
string$getidused to return $PAGE->pagetype.
string$getclassused to return $PAGE->legacyclass.

Definition at line 2031 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
since Moodle 2.0

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

Parameters:
string$baseurlThe target URL up to the point of the variable that changes
array$optionsA list of value-label pairs for the popup list
string$formidid for the control. Must be unique on the page. Used in the HTML.
string$selectedThe option that is initially selected
string$nothingThe label for the "no choice" option
string$helpThe name of a help page if help is required
string$helptextThe name of the label for the help button
boolean$returnIndicates whether the function should return the HTML as a string or echo it directly to the page being rendered
string$targetwindowThe name of the target page to open the linked page in.
string$selectlabelText to place in a [label] element - preferred for accessibility.
array$optionsextraan array with the same keys as $options. The values are added within the corresponding <option ...> tag.
string$submitvalueOptional label for the 'Go' button. Defaults to get_string('go').
boolean$disabledIf true, the menu will be displayed disabled.
boolean$showbuttonIf true, the button will always be shown even if JavaScript is available
Returns:
string|void If $return=true returns string, else echo's and returns void

Definition at line 3484 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
since Moodle 2.0

TODO migrate to outputlib If no sort string is associated with the direction, an arrow with no alt text will be printed/returned.

object

Parameters:
string$direction'up' or 'down'
string$strsortThe language string used for the alt attribute of this image
bool$returnWhether to print directly or return the html string
Returns:
string|void depending on $return

Definition at line 3099 of file deprecatedlib.php.

Here is the caller graph for this function:

print_box ( message,
classes = 'generalbox',
ids = '',
return = false 
)

Print a message in a standard themed box. Replaces print_simple_box (see deprecatedlib.php)

Deprecated:
Parameters:
string$message,thecontent of the box
string$classes,space-separatedclass names.
string$ids
boolean$return,returnas string or just print it
Returns:
string|void mixed string or void

Definition at line 2142 of file deprecatedlib.php.

Here is the call graph for this function:

print_box_end ( return = false)

Simple function to end a box (see above) Replaces print_simple_box_end (see deprecatedlib.php)

Deprecated:
Parameters:
boolean$return,returnas string or just print it
Returns:
string|void Depending on value of return

Definition at line 2182 of file deprecatedlib.php.

Here is the call graph for this function:

print_box_start ( classes = 'generalbox',
ids = '',
return = false 
)

Starts a box using divs Replaces print_simple_box_start (see deprecatedlib.php)

Deprecated:
Parameters:
string$classes,space-separatedclass names.
string$ids
boolean$return,returnas string or just print it
Returns:
string|void string or void

Definition at line 2163 of file deprecatedlib.php.

Here is the call graph for this function:

print_checkbox ( name,
value,
checked = true,
label = '',
alt = '',
script = '',
return = false 
)

Display an standard html checkbox with an optional label

Deprecated:
since Moodle 2.0

int $idcounter

Parameters:
string$nameThe name of the checkbox
string$valueThe valus that the checkbox will pass when checked
bool$checkedThe flag to tell the checkbox initial state
string$labelThe label to be showed near the checkbox
string$altThe info to be inserted in the alt tag
string$scriptIf not '', then this is added to the checkbox element as an onchange handler.
bool$returnWhether this function should return a string or output it (defaults to false)
Returns:
string|void If $return=true returns string, else echo's and returns void

Definition at line 3582 of file deprecatedlib.php.

Here is the call graph for this function:

print_container ( message,
clearfix = false,
classes = '',
idbase = '',
return = false 
)

Print a message in a standard themed container.

Deprecated:
Parameters:
string$message,thecontent of the container
boolean$clearfixclear both sides
string$classes,space-separatedclass names.
string$idbase
boolean$return,returnas string or just print it
Returns:
string|void Depending on value of $return

Definition at line 2204 of file deprecatedlib.php.

print_container_end ( return = false)

Simple function to end a container (see above)

Deprecated:
Parameters:
boolean$return,returnas string or just print it
Returns:
string|void Based on $return

Definition at line 2254 of file deprecatedlib.php.

print_container_start ( clearfix = false,
classes = '',
idbase = '',
return = false 
)

Starts a container using divs

Deprecated:
Parameters:
boolean$clearfixclear both sides
string$classes,space-separatedclass names.
string$idbase
boolean$return,returnas string or just print it
Returns:
string|void Based on value of $return

Definition at line 2227 of file deprecatedlib.php.

print_continue ( link,
return = false 
)

Print a continue button that goes to a particular URL.

Deprecated:
since Moodle 2.0
Parameters:
string$linkThe url to create a link to.
bool$returnIf set to true output is returned rather than echoed, default false
Returns:
string|void HTML String if return=true nothing otherwise

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

Deprecated:
since Moodle 2.0
Parameters:
string$dayfieldname
string$monthfieldname
string$yearfieldname
int$currenttimeA default timestamp in GMT
boolean$returnIf set to true returns rather than echo's
Returns:
string|bool Depending on value of $return

Definition at line 3440 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
since Moodle 2.0

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

Deprecated:
removed - use new file api

Definition at line 162 of file deprecatedlib.php.

print_footer ( course = NULL,
usercourse = NULL,
return = false 
)

Definition at line 2420 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_header ( title = '',
heading = '',
navigation = '',
focus = '',
meta = '',
cache = true,
button = '&nbsp;',
menu = null,
usexml = false,
bodytags = '',
return = false 
)

Print a standard header

Parameters:
string$titleAppears at the top of the window
string$headingAppears at the top of the page
string$navigationArray of $navlinks arrays (keys: name, link, type) for use as breadcrumbs links
string$focusIndicates form element to get cursor focus on load eg inputform.password
string$metaMeta tags to be added to the header
boolean$cacheShould this page be cacheable?
string$buttonHTML code for a button (usually for module editing)
string$menuHTML code for a popup menu
boolean$usexmluse XML for this page
string$bodytagsThis text will be included verbatim in the <body> tag (useful for onload() etc)
bool$returnIf true, return the visible elements of the header instead of echoing them.
Returns:
string|void If return=true then string else void

Definition at line 2335 of file deprecatedlib.php.

Here is the caller graph for this function:

print_header_simple ( title = '',
heading = '',
navigation = '',
focus = '',
meta = '',
cache = true,
button = '&nbsp;',
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

Deprecated:
since Moodle 2.0
Parameters:
string$titleAppears at the top of the window
string$headingAppears at the top of the page
string$navigationPremade navigation string (for use as breadcrumbs links)
string$focusIndicates form element to get cursor focus on load eg inputform.password
string$metaMeta tags to be added to the header
boolean$cacheShould this page be cacheable?
string$buttonHTML code for a button (usually for module editing)
string$menuHTML code for a popup menu
boolean$usexmluse XML for this page
string$bodytagsThis text will be included verbatim in the <body> tag (useful for onload() etc)
bool$returnIf true, return the visible elements of the header instead of echoing them.
Returns:
string|void If $return=true the return string else nothing

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.

Deprecated:
Parameters:
string$textThe text to be displayed
string$deprecatedNo longer used. (Use to do alignment.)
int$sizeThe size to set the font for text display.
string$class
bool$returnIf set to true output is returned rather than echoed, default false
string$idThe id to use in the element
Returns:
string|void String if return=true nothing otherwise

Definition at line 2096 of file deprecatedlib.php.

Here is the call graph for this function:

print_heading_block ( heading,
class = '',
return = false 
)

Output a standard heading block

Deprecated:
Parameters:
string$headingThe text to write into the heading
string$classAn additional Class Attr to use for the heading
bool$returnIf set to true output is returned rather than echoed, default false
Returns:
string|void HTML String if return=true nothing otherwise

Definition at line 2120 of file deprecatedlib.php.

Here is the call graph for this function:

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

Deprecated:
since Moodle 2.0
Parameters:
string$textThe text to be displayed
string$helppageThe help page to link to
string$moduleThe module whose help should be linked to
string$iconImage to display if needed
bool$returnIf set to true output is returned rather than echoed, default false
Returns:
string|void String if return=true nothing otherwise

Definition at line 3652 of file deprecatedlib.php.

Here is the call graph for this function:

print_headline ( text,
size = 2,
return = false 
)

Prints a string in a specified size (retained for backward compatibility)

Deprecated:
Parameters:
string$textThe text to be displayed
int$sizeThe size to set the font for text display.
bool$returnIf set to true output is returned rather than echoed Default false
Returns:
string|void String if return is true

Definition at line 2073 of file deprecatedlib.php.

Here is the call graph for this function:

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();

Deprecated:
since 2.0
Parameters:
mixed$navigationdeprecated
string$separatorOBSOLETE, and now deprecated
boolean$returnFalse to echo the breadcrumb string (default), true to return it.
Returns:
string|void String or null, depending on $return.

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)

Deprecated:
since Moodle 2.0
Parameters:
int$totalcountThetotal number of entries available to be paged through
int$pageThe page you are currently viewing
int$perpageThe number of entries that should be shown per page
mixed$baseurlIf 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$pagevarThis is the variable name that you use for the page number in your code (ie. 'tablepage', 'blogpage', etc)
bool$nocurrdo not display the current page as a link (dropped, link is never displayed for the current page)
bool$returnwhether to return an output string or echo now
Returns:
bool|string depending on $result

Definition at line 3179 of file deprecatedlib.php.

Here is the call graph for this function:

print_png ( )

Print a png image.

Deprecated:
since Moodle 2.0: no replacement

Definition at line 2918 of file deprecatedlib.php.

Prints a scale menu (as part of an existing form) including help button

Deprecated:
since Moodle 2.0

Definition at line 3231 of file deprecatedlib.php.

print_scale_menu_helpbutton ( courseid,
scale,
return = false 
)

Prints a help button about a scale

Deprecated:
since Moodle 2.0

object

Parameters:
id$courseid
object$scale
boolean$returnIf set to true returns rather than echo's
Returns:
string|bool Depending on value of $return

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

Parameters:
array$attributesHTML attributes to apply if possible [id]
string$title
Deprecated:

Definition at line 2533 of file deprecatedlib.php.

print_side_block_start ( heading = '',
attributes = array() 
)

Starts a nice side block with an optional header.

Todo:
Finish documenting this function

object object

Parameters:
string$headingHTML for the heading. Can include full HTML or just plain text - plain text will automatically be enclosed in the appropriate heading tags.
array$attributesHTML attributes to apply if possible
Deprecated:

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

Deprecated:
Parameters:
string$messageThe message to display
string$alignalignment of the box, not the text (default center, left, right).
string$widthwidth of the box, including units %, for example '100'.
string$colorbackground colour of the box, for example '#eee'.
int$paddingpadding in pixels, specified without units.
string$classspace-separated class names.
string$idspace-separated id names.
boolean$returnreturn as string or just print it
Returns:
string|void Depending on $return

Definition at line 430 of file deprecatedlib.php.

Here is the call graph for this function:

print_simple_box_end ( return = false)

Print the end portion of a standard themed box. Preferably just use print_box_end() in weblib.php

Parameters:
boolean$returnreturn as string or just print it
Returns:
string|void Depending on $return

Definition at line 512 of file deprecatedlib.php.

Here is the caller graph for this function:

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

Parameters:
string$alignalignment of the box, not the text (default center, left, right). DEPRECATED
string$widthwidth of the box, including % units, for example '100'. DEPRECATED
string$colorbackground colour of the box, for example '#eee'. DEPRECATED
int$paddingpadding in pixels, specified without units. OBSOLETE
string$classspace-separated class names.
string$idspace-separated id names.
boolean$returnreturn as string or just print it
Returns:
string|void Depending on $return

Definition at line 459 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Deprecated:
since Moodle 2.0
Parameters:
string$linkused as the action attribute on the form, so the URL that will be hit if the button is clicked.
array$optionsthese become hidden form fields, so these options get passed to the script at $link.
string$labelthe caption that appears on the button.
string$methodHTTP method used on the request of the button is clicked. 'get' or 'post'.
string$notusedanymoreno longer used.
boolean$returnif false, output the form directly, otherwise return the HTML as a string.
string$tooltipa tooltip to add to the button as a title attribute.
boolean$disabledif true, the button will be disabled.
string$jsconfirmmessageif not empty then display a confirm dialogue with this string as the question.
string$formidThe id attribute to use for the form
Returns:
string|void Depending on the $return paramter.

Definition at line 2808 of file deprecatedlib.php.

Here is the call graph for this function:

print_spacer ( height = 1,
width = 1,
br = true,
return = false 
)

Print a spacer image with the option of including a line break.

Deprecated:
since Moodle 2.0

object

Parameters:
int$heightThe height in pixels to make the spacer
int$widthThe width in pixels to make the spacer
boolean$brIf set to true a BR is written after the spacer

Definition at line 2842 of file deprecatedlib.php.

Here is the call graph for this function:

print_table ( table,
return = false 
)

Print a nicely formatted table.

Deprecated:
since Moodle 2.0
Parameters:
array$tableis an object with several properties.

Definition at line 2668 of file deprecatedlib.php.

Here is the call graph for this function:

print_textarea ( usehtmleditor,
rows,
cols,
width,
height,
name,
value = '',
obsolete = 0,
return = false,
id = '' 
)

Prints a basic textarea field.

Deprecated:
since Moodle 2.0

When using this function, you should

object

Parameters:
bool$usehtmleditorEnables the use of the htmleditor for this field.
int$rowsNumber of rows to display (minimum of 10 when $height is non-null)
int$colsNumber 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$nameName to use for the textarea element.
string$valueInitial content to display in the textarea.
int$obsoletedeprecated
bool$returnIf false, will output string. If true, will return string value.
string$idCSS ID to add to the textarea element.
Returns:
string|void depending on the value of $return

$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.

Here is the call graph for this function:

Here is the caller graph for this function:

print_textfield ( name,
value,
alt = '',
size = 50,
maxlength = 0,
return = false 
)

Display an standard html text field with an optional label

Deprecated:
since Moodle 2.0
Parameters:
string$nameThe name of the text field
string$valueThe value of the text field
string$altThe info to be inserted in the alt tag
int$sizeSets the size attribute of the field. Defaults to 50
int$maxlengthSets the maxlength attribute of the field. Not set by default
bool$returnWhether this function should return a string or output it (defaults to false)
Returns:
string|void If $return=true returns string, else echo's and returns void

Definition at line 3616 of file deprecatedlib.php.

Here is the call graph for this function:

print_time_selector ( hour,
minute,
currenttime = 0,
step = 5,
return = false 
)

Prints form items with the names $hour and $minute

Deprecated:
since Moodle 2.0
Parameters:
string$hourfieldname
string$minutefieldname
int$currenttimeA default timestamp in GMT
int$stepminute spacing
boolean$returnIf set to true returns rather than echo's
Returns:
string|bool Depending on value of $return

Definition at line 3413 of file deprecatedlib.php.

Here is the call graph for this function:

print_timer_selector ( timelimit = 0,
unit = '',
name = 'timelimit',
return = false 
)

Prints time limit value selector

Deprecated:
since Moodle 2.0

Uses choose_from_menu() to generate HTML

See also:
choose_from_menu()

object

Parameters:
int$timelimitdefault
string$unit
string$name
boolean$returnIf set to true returns rather than echo's
Returns:
string|bool Depending on value of $return

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.

Deprecated:
since Moodle 2.0

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.

Deprecated:
since Moodle 2.0

object object

Parameters:
mixed$userShould 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$courseidThe course id. Used when constructing the link to the user's profile.
boolean$pictureThe picture to print. By default (or if NULL is passed) $user->picture is used.
int$sizeSize in pixels. Special values are (true/1 = 100px) and (false/0 = 35px) for backward compatibility
boolean$returnIf false print picture to current page, otherwise return the output as string
boolean$linkenclose printed image in a link the user's profile (default true).
string$targetlink target attribute. Makes the profile open in a popup window.
boolean$alttextadd non-blank alt-text to the image. (Default true, set to false for purely decorative images, or where the username will be printed anyway.)
Returns:
string|void String or nothing, depending on $return.

Definition at line 2886 of file deprecatedlib.php.

Here is the call graph for this function:

record_exists ( table,
field1 = '',
value1 = '',
field2 = '',
value2 = '',
field3 = '',
value3 = '' 
)
Deprecated:
use $DB->record_exists() instead
See also:
moodle_database::record_exists()
Parameters:
mixed$table
mixed$field1
mixed$value1
mixed$field2
mixed$value2
mixed$field3
mixed$value3
Returns:
void Throws an error and does nothing

Definition at line 1884 of file deprecatedlib.php.

record_exists_select ( table,
select = '' 
)
Deprecated:
use $DB->record_exists_select() instead
See also:
moodle_database::record_exists_select()
Parameters:
mixed$table
mixed$select
Returns:
void Throws an error and does nothing

Definition at line 1255 of file deprecatedlib.php.

record_exists_sql ( sql)
Deprecated:
use $DB->record_exists_sql() instead
See also:
moodle_database::record_exists_sql()
Parameters:
mixed$sql
Returns:
void Throws an error and does nothing

Definition at line 1264 of file deprecatedlib.php.

records_to_menu ( records,
field1,
field2 
)
Deprecated:
Parameters:
mixed$records
mixed$field1
mixed$field2
Returns:
void Throws an error and does nothing

Definition at line 1590 of file deprecatedlib.php.

recordset_to_menu ( rs)
Deprecated:
Parameters:
mixed$rs
Returns:
void Throws an error and does nothing

Definition at line 1580 of file deprecatedlib.php.

rename_field ( table,
field,
newname 
)
Deprecated:
object
Parameters:
string$table
string$field
string$newname
Returns:
bool

Definition at line 1109 of file deprecatedlib.php.

Here is the call graph for this function:

rename_index ( table,
index,
newname 
)
Deprecated:
object
Parameters:
string$table
string$index
string$newname
Returns:
bool

Definition at line 1195 of file deprecatedlib.php.

Here is the call graph for this function:

rename_key ( table,
key,
newname 
)
Deprecated:
object
Parameters:
string$table
string$key
string$newname
Returns:
bool

Definition at line 1152 of file deprecatedlib.php.

Here is the call graph for this function:

rename_table ( table,
newname 
)
Deprecated:
object
Parameters:
string$table
string$newname
Returns:
bool

Definition at line 982 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Here is the call graph for this function:

require_js ( lib)

The old method that was used to include JavaScript libraries. Please use $PAGE->requires->js_module() instead.

Parameters:
mixed$libThe 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.

Here is the call graph for this function:

resolve_filename_collisions ( destination,
files,
format = '%s_%d.%s' 
)

Handy function for resolving file conflicts

Deprecated:
removed - use new file api

Definition at line 171 of file deprecatedlib.php.

Deprecated:
Returns:
void Throws an error and does nothing

Definition at line 1783 of file deprecatedlib.php.

rs_close ( &$  rs)
Deprecated:
Parameters:
mixed$rs
Returns:
void Throws an error and does nothing

Definition at line 1372 of file deprecatedlib.php.

rs_EOF ( rs)
Deprecated:
Parameters:
mixed$rs
Returns:
void Throws an error and does nothing

Definition at line 1364 of file deprecatedlib.php.

Deprecated:
Parameters:
mixed$rs
Returns:
void Throws an error and does nothing

Definition at line 1356 of file deprecatedlib.php.

rs_fetch_record ( &$  rs)
Deprecated:
Parameters:
mixed$rs
Returns:
void Throws an error and does nothing

Definition at line 1340 of file deprecatedlib.php.

rs_next_record ( &$  rs)
Deprecated:
Parameters:
mixed$rs
Returns:
void Throws an error and does nothing

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

Parameters:
int$courseidThe course being examined - relates to id field in 'course' table.
int$groupidThe group being examined.
Returns:
int Current group id which was set by this function

Definition at line 773 of file deprecatedlib.php.

Here is the caller graph for this function:

set_field ( table,
newfield,
newvalue,
field1,
value1,
field2 = '',
value2 = '',
field3 = '',
value3 = '' 
)
Deprecated:
use $DB->set_field() instead
See also:
moodle_database::set_field()
Parameters:
mixed$table
mixed$newfield
mixed$newvalue
mixed$field1
mixed$value1
mixed$field2
mixed$value2
mixed$field3
mixed$value3
Returns:
void Throws an error and does nothing

Definition at line 1854 of file deprecatedlib.php.

set_field_select ( table,
newfield,
newvalue,
select,
localcall = false 
)
Deprecated:
use $DB->set_field_select() instead
See also:
moodle_database::set_field_select()
Parameters:
mixed$table
mixed$newfield
mixed$newvalue
mixed$select
mixed$localcall
Returns:
void Throws an error and does nothing

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.

Parameters:
object$eventAn object representing an event from the calendar table. The event will be identified by the id field.
Returns:
true

Definition at line 3997 of file deprecatedlib.php.

Here is the caller graph for this function:

sid_ob_rewrite ( buffer)

Unsupported session id rewriting.

Deprecated:
Parameters:
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

Deprecated:
use $OUTPUT->skip_link_target() in instead.
Returns:
string HTML element.

Definition at line 2059 of file deprecatedlib.php.

sql_as ( )
Deprecated:
Returns:
void Throws an error and does nothing

Definition at line 1438 of file deprecatedlib.php.

sql_bitand ( int1,
int2 
)
Deprecated:
Parameters:
mixed$int1
mixed$int2
Returns:
void Throws an error and does nothing

Definition at line 1670 of file deprecatedlib.php.

sql_bitnot ( int1)
Deprecated:
Parameters:
mixed$int1
Returns:
void Throws an error and does nothing

Definition at line 1678 of file deprecatedlib.php.

sql_bitor ( int1,
int2 
)
Deprecated:
Parameters:
mixed$int1
mixed$int2
Returns:
void Throws an error and does nothing

Definition at line 1687 of file deprecatedlib.php.

sql_bitxor ( int1,
int2 
)
Deprecated:
Parameters:
mixed$int1
mixed$int2
Returns:
void Throws an error and does nothing

Definition at line 1696 of file deprecatedlib.php.

sql_cast_char2int ( fieldname,
text = false 
)
Deprecated:
Parameters:
mixed$fieldname
mixed$text
Returns:
void Throws an error and does nothing

Definition at line 1705 of file deprecatedlib.php.

sql_compare_text ( fieldname,
numchars = 32 
)
Deprecated:
Parameters:
mixed$fieldname
mixed$numchars
Returns:
void Throws an error and does nothing

Definition at line 1714 of file deprecatedlib.php.

Deprecated:
Returns:
void Throws an error and does nothing

Definition at line 1647 of file deprecatedlib.php.

sql_concat_join ( separator = "' '",
elements = array() 
)
Deprecated:
Parameters:
mixed$separator
mixed$elements
Returns:
void Throws an error and does nothing

Definition at line 1740 of file deprecatedlib.php.

sql_empty ( )
Deprecated:
Returns:
void Throws an error and does nothing

Definition at line 1654 of file deprecatedlib.php.

sql_fullname ( first = 'firstname',
last = 'lastname' 
)
Deprecated:
Parameters:
mixed$first
mixed$last
Returns:
void Throws an error and does nothing

Definition at line 1640 of file deprecatedlib.php.

sql_ilike ( )
Deprecated:
use $DB->sql_like() instead
See also:
moodle_database::sql_like()
Returns:
void Throws an error and does nothing

Definition at line 1631 of file deprecatedlib.php.

sql_isempty ( tablename,
fieldname,
nullablefield,
textfield 
)
Deprecated:
Parameters:
mixed$tablename
mixed$fieldname
mixed$nullablefield
mixed$textfield
Returns:
void Throws an error and does nothing

Definition at line 1751 of file deprecatedlib.php.

sql_isnotempty ( tablename,
fieldname,
nullablefield,
textfield 
)
Deprecated:
Parameters:
mixed$tablename
mixed$fieldname
mixed$nullablefield
mixed$textfield
Returns:
void Throws an error and does nothing

Definition at line 1762 of file deprecatedlib.php.

sql_length ( fieldname)
Deprecated:
Parameters:
mixed$fieldname
Returns:
void Throws an error and does nothing

Definition at line 1731 of file deprecatedlib.php.

sql_max ( field)
Deprecated:
Parameters:
mixed$field
Returns:
void Throws an error and does nothing

Definition at line 1431 of file deprecatedlib.php.

sql_order_by_text ( fieldname,
numchars = 32 
)
Deprecated:
Parameters:
mixed$fieldname
mixed$numchars
Returns:
void Throws an error and does nothing

Definition at line 1723 of file deprecatedlib.php.

sql_paging_limit ( page,
recordsperpage 
)
Deprecated:
Parameters:
mixed$page
mixed$recordsperpage
Returns:
void Throws an error and does nothing

Definition at line 1447 of file deprecatedlib.php.

Deprecated:
Returns:
void Throws an error and does nothing

Definition at line 1661 of file deprecatedlib.php.

Deprecated:
Parameters:
mixed$var
Returns:
void Throws an error and does nothing

Definition at line 1220 of file deprecatedlib.php.

stripslashes_safe ( mixed)

removed functions ////

Deprecated:
Parameters:
mixed$mixed
Returns:
void Throws an error and does nothing

Definition at line 1212 of file deprecatedlib.php.

switchroles_form ( courseid)

Returns a little popup menu for switching roles

Deprecated:
in Moodle 2.0
Parameters:
int$courseidThe course to update by id as found in 'course' table
Returns:
string

Definition at line 3885 of file deprecatedlib.php.

Here is the call graph for this function:

table_column ( table,
oldfield,
field,
type = 'integer',
size = '10',
signed = 'unsigned',
default = '0',
null = 'not null',
after = '' 
)
Deprecated:
Parameters:
mixed$table
mixed$oldfield
mixed$field
mixed$type
mixed$size
mixed$signed
mixed$default
mixed$null
mixed$after
Returns:
void Throws an error and does nothing

Definition at line 1931 of file deprecatedlib.php.

table_exists ( table)

Deprecated DDL functions, to be removed soon ///.

Deprecated:
object
Parameters:
string$table
Returns:
bool

Definition at line 842 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
Parameters:
string$themeThe theme to use defaults to current theme
array$paramsAn 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

Parameters:
string$zipfileThe zip file to unzip
string$destinationThe location to unzip to
bool$showstatus_ignoredUnused

Definition at line 588 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

update_categories_search_button ( search,
page,
perpage 
)

Prints the editing button on search results listing For bulk move courses to another category

Deprecated:
since Moodle 2.0

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

Parameters:
int$courseidThe course to update by id as found in 'course' table
Returns:
string

Definition at line 3752 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Parameters:
object$eventAn object representing an event from the calendar table. The event will be identified by the id field.
Returns:
bool Success

Definition at line 3955 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

update_log_display_entry ( module,
action,
mtable,
field 
)

Insert or update log display entry. Entry may already exist. $module, $action must be unique

Deprecated:
Parameters:
string$module
string$action
string$mtable
string$field
Returns:
void

Definition at line 54 of file deprecatedlib.php.

Here is the call graph for this function:

update_module_button ( cmid,
ignored,
string 
)

Prints the 'update this xxx' button that appears on module pages.

Deprecated:
since Moodle 2.0
Parameters:
string$cmidthe course_module id.
string$ignorednot used any more. (Used to be courseid.)
string$stringthe module name - get_string('modulename', 'xxx')
Returns:
string the HTML for the button, if this user has permission to edit it, else an empty string.

Definition at line 3707 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Deprecated:
since Moodle 2.0

Definition at line 3680 of file deprecatedlib.php.

update_record ( table,
dataobject 
)
Deprecated:
use $DB->update_record() instead
See also:
moodle_database::update_record()
Parameters:
mixed$table
mixed$dataobject
Returns:
void Throws an error and does nothing

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.

Deprecated:
since Moodle 2.0
Parameters:
string$tagidThe ID attribute
Returns:
string

Definition at line 3690 of file deprecatedlib.php.

Here is the call graph for this function:

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.

Deprecated:
removed - use new file api

Definition at line 187 of file deprecatedlib.php.

use_html_editor ( name = '',
editorhidebuttons = '',
id = '' 
)
Deprecated:
Parameters:
mixed$name
mixed$editorhidebuttons
mixed$id
Returns:
void Throws an error and does nothing

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

Parameters:
course$course$COURSE object containing course information
user$user$USER object containing user information
Returns:
string HTML

Definition at line 2454 of file deprecatedlib.php.

Here is the call graph for this function:

where_clause ( field1 = '',
value1 = '',
field2 = '',
value2 = '',
field3 = '',
value3 = '' 
)
Deprecated:
Parameters:
mixed$field1
mixed$value1
mixed$field2
mixed$value2
mixed$field3
mixed$value3
Returns:
void Throws an error and does nothing

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

Parameters:
array$originalfilesFiles to zip
string$destinationThe destination path
Returns:
bool Outcome

Definition at line 654 of file deprecatedlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations