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

Go to the source code of this file.

Data Structures

class  course_request

Namespaces

namespace  core

Enumerations

enum  COURSE_MAX_LOGS_PER_PAGE
enum  COURSE_MAX_RECENT_PERIOD
enum  COURSE_MAX_SUMMARIES_PER_PAGE
enum  COURSE_MAX_COURSES_PER_DROPDOWN
enum  COURSE_MAX_USERS_PER_DROPDOWN
enum  FRONTPAGENEWS
enum  FRONTPAGECOURSELIST
enum  FRONTPAGECATEGORYNAMES
enum  FRONTPAGETOPICONLY
enum  FRONTPAGECATEGORYCOMBO
enum  FRONTPAGECOURSELIMIT
enum  EXCELROWS
enum  FIRSTUSEDEXCELROW
enum  MOD_CLASS_ACTIVITY
enum  MOD_CLASS_RESOURCE

Functions

 make_log_url ($module, $url)
 build_mnet_logs_array ($hostid, $course, $user=0, $date=0, $order="l.time ASC", $limitfrom='', $limitnum='', $modname="", $modid=0, $modaction="", $groupid=0)
 build_logs_array ($course, $user=0, $date=0, $order="l.time ASC", $limitfrom='', $limitnum='', $modname="", $modid=0, $modaction="", $groupid=0)
 print_log ($course, $user=0, $date=0, $order="l.time ASC", $page=0, $perpage=100, $url="", $modname="", $modid=0, $modaction="", $groupid=0)
 print_mnet_log ($hostid, $course, $user=0, $date=0, $order="l.time ASC", $page=0, $perpage=100, $url="", $modname="", $modid=0, $modaction="", $groupid=0)
 print_log_csv ($course, $user, $date, $order='l.time DESC', $modname, $modid, $modaction, $groupid)
 print_log_xls ($course, $user, $date, $order='l.time DESC', $modname, $modid, $modaction, $groupid)
 print_log_ods ($course, $user, $date, $order='l.time DESC', $modname, $modid, $modaction, $groupid)
 print_overview ($courses, array $remote_courses=array())
 print_recent_activity ($course)
 get_array_of_activities ($courseid)
 get_all_mods ($courseid, &$mods, &$modnames, &$modnamesplural, &$modnamesused)
 get_all_sections ($courseid)
 course_get_display ($courseid)
 course_set_display ($courseid, $display)
 set_section_visible ($courseid, $sectionnumber, $visibility)
 get_print_section_cm_text (cm_info $cm, $course)
 print_section_add_menus ($course, $section, $modnames, $vertical=false, $return=false)
 get_category_or_system_context ($categoryid)
 get_child_categories ($parentid)
 make_categories_list (&$list, &$parents, $requiredcapability= '', $excludeid=0, $category=NULL, $path="")
 get_course_category_tree ($id=0, $depth=0)
 print_whole_category_list ($category=NULL, $displaylist=NULL, $parentslist=NULL, $depth=-1, $showcourses=true)
 make_categories_options ()
 get_course_display_name_for_list ($course)
 print_category_info ($category, $depth=0, $showcourses=false)
 print_course_request_buttons ($systemcontext)
 can_edit_in_category ($categoryid=0)
 update_category_button ($categoryid=0)
 print_courses ($category)
 print_course ($course, $highlightterms= '')
 print_my_moodle ()
 print_course_search ($value="", $return=false, $format="plain")
 print_remote_course ($course, $width="100%")
 print_remote_host ($host, $width="100%")
 add_course_module ($mod)
 MODULE FUNCTIONS /////////////////////////////////////////////////////////////////.
 get_course_section ($section, $courseid)
 add_mod_to_section ($mod, $beforemod=NULL)
 set_coursemodule_groupmode ($id, $groupmode)
 set_coursemodule_idnumber ($id, $idnumber)
 set_coursemodule_visible ($id, $visible, $prevstateoverrides=false)
 delete_course_module ($id)
 delete_mod_from_section ($mod, $section)
 move_section ($course, $section, $move)
 move_section_to ($course, $section, $destination)
 reorder_sections ($sections, $origin_position, $target_position)
 moveto_module ($mod, $section, $beforemod=NULL)
 make_editing_buttons (stdClass $mod, $absolute_ignored=true, $moveselect=true, $indent=-1, $section=-1)
 course_format_name ($course, $max=100)
 update_restricted_mods ($course, $mods)
 course_allowed_module ($course, $mod)
 category_delete_full ($category, $showfeedback=true)
 category_delete_move ($category, $newparentid, $showfeedback=true)
 move_courses ($courseids, $categoryid)
 course_category_hide ($category)
 course_category_show ($category)
 move_category ($category, $newparentcat)
 get_section_name (stdClass $course, stdClass $section)
 get_generic_section_name ($format, stdClass $section)
 course_format_uses_sections ($format)
 course_format_ajax_support ($format)
 can_delete_course ($courseid)
 save_local_role_names ($courseid, $data)
 create_course ($data, $editoroptions=NULL)
 update_course ($data, $editoroptions=NULL)
 average_number_of_participants ()
 average_number_of_courses_modules ()
 course_page_type_list ($pagetype, $parentcontext, $currentcontext)

Enumeration Type Documentation

Definition at line 35 of file lib.php.

Definition at line 32 of file lib.php.

Definition at line 33 of file lib.php.

Definition at line 34 of file lib.php.

Definition at line 36 of file lib.php.

enum EXCELROWS

Definition at line 43 of file lib.php.

Definition at line 44 of file lib.php.

Definition at line 41 of file lib.php.

Definition at line 39 of file lib.php.

Definition at line 42 of file lib.php.

Definition at line 38 of file lib.php.

Definition at line 37 of file lib.php.

Definition at line 40 of file lib.php.

Definition at line 46 of file lib.php.

Definition at line 47 of file lib.php.


Function Documentation

add_course_module ( mod)

MODULE FUNCTIONS /////////////////////////////////////////////////////////////////.

Definition at line 2680 of file lib.php.

Here is the caller graph for this function:

add_mod_to_section ( mod,
beforemod = NULL 
)

Given a full mod object with section and course already defined, adds this module to that section.

Parameters:
object$mod
int$beforemodAn existing ID which we will insert the new module before
Returns:
int The course_sections ID where the mod is inserted

Definition at line 2717 of file lib.php.

Here is the caller graph for this function:

Average number of course modules

Returns:
integer

Definition at line 3962 of file lib.php.

Here is the caller graph for this function:

Average number of participants

Returns:
integer

Definition at line 3929 of file lib.php.

Here is the caller graph for this function:

build_logs_array ( course,
user = 0,
date = 0,
order = "l.time ASC",
limitfrom = '',
limitnum = '',
modname = "",
modid = 0,
modaction = "",
groupid = 0 
)

Setup for group handling.

If the group mode is separate, and this user does not have editing privileges, then only the user's group can be viewed.

If this course doesn't have groups, no groupid can be specified.

Getting all members of a group.

Definition at line 218 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

build_mnet_logs_array ( hostid,
course,
user = 0,
date = 0,
order = "l.time ASC",
limitfrom = '',
limitnum = '',
modname = "",
modid = 0,
modaction = "",
groupid = 0 
)

Setup for group handling.

If the group mode is separate, and this user does not have editing privileges, then only the user's group can be viewed.

If this course doesn't have groups, no groupid can be specified.

Definition at line 127 of file lib.php.

Here is the caller graph for this function:

can_delete_course ( courseid)

Can the current user delete this course? Course creators have exception, 1 day after the creation they can sill delete the course.

Parameters:
int$courseid
Returns:
boolean

Definition at line 3692 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

can_edit_in_category ( categoryid = 0)

Does the user have permission to edit things in this category?

Parameters:
integer$categoryidThe id of the category we are showing, or 0 for system context.
Returns:
boolean has_any_capability(array(...), ...); in the appropriate context.

Definition at line 2325 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

category_delete_full ( category,
showfeedback = true 
)

Recursively delete category including all subcategories and courses.

Parameters:
stdClass$category
boolean$showfeedbackdisplay some notices
Returns:
array return deleted courses

Definition at line 3360 of file lib.php.

Here is the call graph for this function:

category_delete_move ( category,
newparentid,
showfeedback = true 
)

Delete category, but move contents to another category.

Parameters:
object$ccategory
int$newparentidcategory id
Returns:
bool status

Definition at line 3406 of file lib.php.

Here is the call graph for this function:

course_allowed_module ( course,
mod 
)

This function will take an int (module id) or a string (module name) and return true or false, whether it's allowed in the given course (object) $mod is not allowed to be an object, as the field for the module id is inconsistent depending on where in the code it's called from (sometimes $mod->id, sometimes $mod->module)

Definition at line 3329 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

course_category_hide ( category)

Hide course category and child course and subcategories

Parameters:
stdClass$category
Returns:
void

Definition at line 3503 of file lib.php.

Here is the caller graph for this function:

course_category_show ( category)

Show course category and child course and subcategories

Parameters:
stdClass$category
Returns:
void

Definition at line 3527 of file lib.php.

Returns the information about the ajax support in the given source format

The returned object's property (boolean)capable indicates that the course format supports Moodle course ajax features. The property (array)testedbrowsers can be used as a parameter for {

See also:
ajaxenabled()}.
Parameters:
string$format
Returns:
stdClass

Definition at line 3658 of file lib.php.

course_format_name ( course,
max = 100 
)

given a course object with shortname & fullname, this function will truncate the the number of chars allowed and add ... if it was too long

Definition at line 3286 of file lib.php.

Here is the call graph for this function:

Definition at line 3633 of file lib.php.

course_get_display ( courseid)

Returns the course section to display or 0 meaning show all sections. Returns 0 for guests. It also sets the $USER->display cache to array($courseid=>return value)

Parameters:
int$courseidThe course id
Returns:
int Course section to display, 0 means all

Definition at line 1284 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

course_page_type_list ( pagetype,
parentcontext,
currentcontext 
)

Return a list of page types

Parameters:
string$pagetypecurrent page type
stdClass$parentcontextBlock's parent context
stdClass$currentcontextCurrent context of block

Definition at line 4322 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

course_set_display ( courseid,
display 
)

Show one section only or all sections.

Parameters:
int$courseidThe course id
mixed$displayshow only this section, 0 or 'all' means show all sections
Returns:
int Course section to display, 0 means all

Definition at line 1310 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

create_course ( data,
editoroptions = NULL 
)

Create a course and either return a $course object

Please note this functions does not verify any access control, the calling code is responsible for all validation (usually it is the form definition).

Parameters:
array$editoroptionscourse description editor options
object$data- all the data needed for an entry in the 'course' table
Returns:
object new course instance

Definition at line 3758 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Delete a course module and any associated data at the course level (events) Until 1.5 this function simply marked a deleted flag ... now it deletes it completely.

Definition at line 2819 of file lib.php.

Here is the call graph for this function:

delete_mod_from_section ( mod,
section 
)

Definition at line 2851 of file lib.php.

Here is the caller graph for this function:

get_all_mods ( courseid,
&$  mods,
&$  modnames,
&$  modnamesplural,
&$  modnamesused 
)

Returns a number of useful structures for course displays

Definition at line 1208 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_all_sections ( courseid)

Returns an array of sections for the requested course id

This function stores the sections against the course id within a staticvar encase of subsequent requests. This is used all over + in some standard libs and course format callbacks so subsequent requests are a reality.

array $coursesections

Parameters:
int$courseid
Returns:
array Array of sections

Definition at line 1267 of file lib.php.

Here is the caller graph for this function:

get_array_of_activities ( courseid)

For a given course, returns an array of course activity objects Each item in the array contains he following properties:

Definition at line 1043 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_category_or_system_context ( categoryid)

Return the course category context for the category with id $categoryid, except that if $categoryid is 0, return the system context.

Parameters:
integer$categoryida category id or 0.
Returns:
object the corresponding context

Definition at line 1911 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_child_categories ( parentid)

Gets the child categories of a given courses category. Uses a static cache to make repeat calls efficient.

Parameters:
int$parentidthe id of a course category.
Returns:
array all the child course categories.

Definition at line 1926 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_course_category_tree ( id = 0,
depth = 0 
)

This function generates a structured array of courses and categories.

The depth of categories is limited by $CFG->maxcategorydepth however there is no limit on the number of courses!

Suitable for use with the course renderers course_category_tree method: $renderer = $PAGE->get_renderer('core','course'); echo $renderer->course_category_tree(get_course_category_tree());

moodle_database $DB

Parameters:
int$id
int$depth

Definition at line 2056 of file lib.php.

Here is the call graph for this function:

Gets the name of a course to be displayed when showing a list of courses. By default this is just $course->fullname but user can configure it. The result of this function should be passed through print_string.

Parameters:
object$courseMoodle course object
Returns:
string Display name of course (either fullname or short + fullname)

Definition at line 2177 of file lib.php.

Here is the caller graph for this function:

get_course_section ( section,
courseid 
)

Returns course section - creates new if does not exist yet.

Parameters:
int$relativesection number
int$courseid
Returns:
object $course_section object

Definition at line 2695 of file lib.php.

Here is the caller graph for this function:

get_generic_section_name ( format,
stdClass $  section 
)

Gets the generic section name for a courses section.

Parameters:
string$formatCourse format ID e.g. 'weeks' $course->format
stdClass$sectionSection object from database
Returns:
Display name that the course format prefers, e.g. "Week 2"

Definition at line 3628 of file lib.php.

Here is the caller graph for this function:

get_print_section_cm_text ( cm_info cm,
course 
)

Obtains shared data that is used in print_section when displaying a course-module entry.

Calls format_text or format_string as appropriate, and obtains the correct icon.

This data is also used in other areas of the code.

Parameters:
cm_info$cmCourse-module data (must come from get_fast_modinfo)
object$courseMoodle course object
Returns:
array An array with the following values in this order: $content (optional extra content for after link), $instancename (text of link)

Definition at line 1376 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_section_name ( stdClass $  course,
stdClass $  section 
)

Returns the display name of the given section that the course prefers.

This function utilizes a callback that can be implemented within the course formats lib.php file to customize the display name that is used to reference the section.

By default (if callback is not defined) the method {

See also:
get_numeric_section_name} is called instead.
Parameters:
stdClass$courseThe course to get the section name for
stdClass$sectionSection object from database
Returns:
Display name that the course format prefers, e.g. "Week 2"
See also:
get_generic_section_name

Inelegant hack for bug 3408

Definition at line 3599 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

make_categories_list ( &$  list,
&$  parents,
requiredcapability = '',
excludeid = 0,
category = NULL,
path = "" 
)

This function recursively travels the categories, building up a nice list for display. It also makes an array that list all the parents for each category.

For example, if you have a tree of categories like: Miscellaneous (id = 1) Subcategory (id = 2) Sub-subcategory (id = 4) Other category (id = 3) Then after calling this function you will have $list = array(1 => 'Miscellaneous', 2 => 'Miscellaneous / Subcategory', 4 => 'Miscellaneous / Subcategory / Sub-subcategory', 3 => 'Other category'); $parents = array(2 => array(1), 4 => array(1, 2));

If you specify $requiredcapability, then only categories where the current user has that capability will be added to $list, although all categories will still be added to $parents, and if you only have $requiredcapability in a child category, not the parent, then the child catgegory will still be included.

If you specify the option $excluded, then that category, and all its children, are omitted from the tree. This is useful when you are doing something like moving categories, where you do not want to allow people to move a category to be the child of itself.

Parameters:
array$listFor output, accumulates an array categoryid => full category path name
array$parentsFor output, accumulates an array categoryid => list of parent category ids.
string/array$requiredcapability if given, only categories where the current user has this capability will be added to $list. Can also be an array of capabilities, in which case they are all required.
integer$excludeidOmit this category and its children from the lists built.
object$categoryBuild the tree starting at this category - otherwise starts at the top level.
string$pathFor internal use, as part of recursive calls.

Definition at line 1985 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

This function will return $options array for html_writer::select(), with whitespace to denote nesting.

Definition at line 2156 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

make_editing_buttons ( stdClass $  mod,
absolute_ignored = true,
moveselect = true,
indent = -1,
section = -1 
)

Produces the editing buttons for a module

core_renderer $OUTPUT type $str

Parameters:
stdClass$modThe module to produce editing buttons for
bool$absolute_ignoredignored - all links are absolute
bool$moveselectIf true a move seleciton process is used (default true)
int$indentThe current indenting
int$sectionThe section to link back to
Returns:
string XHTML for the editing buttons

Definition at line 3079 of file lib.php.

Here is the call graph for this function:

make_log_url ( module,
url 
)

Definition at line 49 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

move_category ( category,
newparentcat 
)

Efficiently moves a category - NOTE that this can have a huge impact access-control-wise...

Definition at line 3549 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

move_courses ( courseids,
categoryid 
)

Efficiently moves many courses around while maintaining sortorder in order.

Parameters:
array$courseidsis an array of course ids
int$categoryid
Returns:
bool success

Definition at line 3459 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

move_section ( course,
section,
move 
)

Moves a section up or down by 1. CANNOT BE USED DIRECTLY BY AJAX!

Parameters:
object$course
int$section
int$move(-1 or 1)

Moves a whole course section up and down within the course

Definition at line 2877 of file lib.php.

Here is the call graph for this function:

move_section_to ( course,
section,
destination 
)

Moves a section within a course, from a position to another. Be very careful: $section and $destination refer to section number, not id!.

Parameters:
object$course
int$sectionSection number (not id!!!)
int$destination
Returns:
boolean Result

Moves a whole course section up and down within the course

Definition at line 2930 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

moveto_module ( mod,
section,
beforemod = NULL 
)

Move the module object $mod to the specified $section If $beforemod exists then that is the module before which $modid should be inserted All parameters are objects

Remove original module from original section

Update module itself if necessary

Add the module into the new section

Definition at line 3035 of file lib.php.

Here is the call graph for this function:

print_category_info ( category,
depth = 0,
showcourses = false 
)

Prints the category info in indented fashion This function is only used by print_whole_category_list() above

Definition at line 2190 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_course ( course,
highlightterms = '' 
)

Print a description of a course, suitable for browsing in a list.

Parameters:
object$coursethe course object.
string$highlightterms(optional) some search terms that should be highlighted in the display.

first find all roles that are supposed to be displayed

Rename some of the role names if needed

Definition at line 2424 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_course_request_buttons ( systemcontext)

Print the buttons relating to course requests.

Parameters:
object$systemcontextthe system context.

Print a button to request a new course

Print a button to manage pending requests

Definition at line 2303 of file lib.php.

Here is the call graph for this function:

print_course_search ( value = "",
return = false,
format = "plain" 
)

Definition at line 2592 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_courses ( category)

Category is 0 (for all courses) or an object

Definition at line 2368 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_log ( course,
user = 0,
date = 0,
order = "l.time ASC",
page = 0,
perpage = 100,
url = "",
modname = "",
modid = 0,
modaction = "",
groupid = 0 
)

Definition at line 309 of file lib.php.

Here is the call graph for this function:

print_log_csv ( course,
user,
date,
order = 'l.time DESC',
modname,
modid,
modaction,
groupid 
)

Definition at line 532 of file lib.php.

Here is the call graph for this function:

print_log_ods ( course,
user,
date,
order = 'l.time DESC',
modname,
modid,
modaction,
groupid 
)

Definition at line 723 of file lib.php.

Here is the call graph for this function:

print_log_xls ( course,
user,
date,
order = 'l.time DESC',
modname,
modid,
modaction,
groupid 
)

Definition at line 610 of file lib.php.

Here is the call graph for this function:

print_mnet_log ( hostid,
course,
user = 0,
date = 0,
order = "l.time ASC",
page = 0,
perpage = 100,
url = "",
modname = "",
modid = 0,
modaction = "",
groupid = 0 
)

Definition at line 427 of file lib.php.

Here is the call graph for this function:

Prints custom user information on the home page. Over time this can include all sorts of information

Definition at line 2527 of file lib.php.

Here is the call graph for this function:

print_overview ( courses,
array remote_courses = array() 
)

Definition at line 837 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_recent_activity ( course)

This function trawls through the logs looking for anything new since the user's last login

Firstly, have there been any new enrolments?

Next, have there been any modifications to the course structure?

Now display new things from each module

Definition at line 888 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_remote_course ( course,
width = "100%" 
)

Definition at line 2635 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_remote_host ( host,
width = "100%" 
)

Definition at line 2660 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_section_add_menus ( course,
section,
modnames,
vertical = false,
return = false 
)

Prints the menus to add activities and resources.

Definition at line 1801 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

print_whole_category_list ( category = NULL,
displaylist = NULL,
parentslist = NULL,
depth = -1,
showcourses = true 
)

Recursive function to print out all the categories in a nice format with or without courses included

Definition at line 2110 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

reorder_sections ( sections,
origin_position,
target_position 
)

Reordering algorithm for course sections. Given an array of section->section indexed by section->id, an original position number and a target position number, rebuilds the array so that the move is made without any duplication of section positions. Note: The target_position is the position AFTER WHICH the moved section will be inserted. If you want to insert a section before the first one, you must give 0 as the target (section 0 can never be moved).

Parameters:
array$sections
int$origin_position
int$target_position
Returns:
array

Definition at line 2974 of file lib.php.

Here is the caller graph for this function:

save_local_role_names ( courseid,
data 
)

Save the Your name for 'Some role' strings.

Parameters:
integer$courseidthe id of this course.
array$datathe data that came from the course settings form.

Definition at line 3720 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_coursemodule_groupmode ( id,
groupmode 
)

Definition at line 2756 of file lib.php.

set_coursemodule_idnumber ( id,
idnumber 
)

Definition at line 2761 of file lib.php.

Here is the caller graph for this function:

set_coursemodule_visible ( id,
visible,
prevstateoverrides = false 
)

$prevstateoverrides = true will set the visibility of the course module to what is defined in visibleold. This enables us to remember the current visibility when making a whole section hidden, so that when we toggle that section back to visible, we are able to return the visibility of the course module back to what it was originally.

Definition at line 2773 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_section_visible ( courseid,
sectionnumber,
visibility 
)

For a given course section, marks it visible or hidden, and does the same for every activity in that section

Definition at line 1348 of file lib.php.

Here is the call graph for this function:

update_category_button ( categoryid = 0)

Prints the turn editing on/off button on course/index.php or course/category.php.

Parameters:
integer$categoryidThe id of the category we are showing, or 0 for system context.
Returns:
string HTML of the editing button, or empty string, if this user is not allowed to see it.

Definition at line 2337 of file lib.php.

Here is the call graph for this function:

update_course ( data,
editoroptions = NULL 
)

Update a course.

Please note this functions does not verify any access control, the calling code is responsible for all validation (usually it is the form definition).

Parameters:
object$data- all the data needed for an entry in the 'course' table
array$editoroptionscourse description editor options
Returns:
void

Definition at line 3857 of file lib.php.

Here is the call graph for this function:

update_restricted_mods ( course,
mods 
)

Delete all the current restricted list

Insert the new list of restricted mods

Definition at line 3300 of file lib.php.

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations