]> git.mjollnir.org Git - moodle.git/commitdiff
weblib: Improve PHPdoc comment and parameter names.
authortjhunt <tjhunt>
Tue, 24 Feb 2009 05:09:29 +0000 (05:09 +0000)
committertjhunt <tjhunt>
Tue, 24 Feb 2009 05:09:29 +0000 (05:09 +0000)
lib/weblib.php

index d1303b496e72e54475aa007ee219350a4f4ca1e1..95f400479cb55bf9768bb2c330c3adfec3da57cf 100644 (file)
@@ -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 "<form $CFG->frametarget method=\"get\" action=\"$CFG->wwwroot/course/mod.php\" onsubmit=\"this.target='{$CFG->framename}'; return true\">".//hack to allow edit on framed resources
                "<div>".
-               "<input type=\"hidden\" name=\"update\" value=\"$moduleid\" />".
+               "<input type=\"hidden\" name=\"update\" value=\"$cmid\" />".
                "<input type=\"hidden\" name=\"return\" value=\"true\" />".
                "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />".
                "<input type=\"submit\" value=\"$string\" /></div></form>";