From: tjhunt Date: Tue, 24 Feb 2009 05:09:29 +0000 (+0000) Subject: weblib: Improve PHPdoc comment and parameter names. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=60cd5b5a346283d607a93b7334df94794c4ce497;p=moodle.git weblib: Improve PHPdoc comment and parameter names. --- diff --git a/lib/weblib.php b/lib/weblib.php index d1303b496e..95f400479c 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -5163,21 +5163,21 @@ function update_tag_button($tagid) { } /** - * Prints the editing button on a module "view" page - * - * @uses $CFG - * @param type description - * @todo Finish documenting this function + * Prints the 'update this xxx' button that appears on module pages. + * @param $cmid the course_module id. + * @param $ignored not used any more. (Used to be courseid.) + * @param $string the module name - get_string('modulename', 'xxx') + * @return string the HTML for the button, if this user has permission to edit it, else an empty string. */ -function update_module_button($moduleid, $courseid, $string) { +function update_module_button($cmid, $ignored, $string) { global $CFG, $USER; - if (has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_MODULE, $moduleid))) { + if (has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_MODULE, $cmid))) { $string = get_string('updatethis', '', $string); return "
frametarget method=\"get\" action=\"$CFG->wwwroot/course/mod.php\" onsubmit=\"this.target='{$CFG->framename}'; return true\">".//hack to allow edit on framed resources "
". - "". + "". "". "". "
";