]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13630 - merge from 1.9
authorscyrma <scyrma>
Mon, 25 Feb 2008 02:50:21 +0000 (02:50 +0000)
committerscyrma <scyrma>
Mon, 25 Feb 2008 02:50:21 +0000 (02:50 +0000)
tag/edit.php
tag/lib.php

index 33294df4e23887fc8f7429f4c81320e8bac7723d..6ee097a9dafef3eb05c0c5352c683c67102b58bb 100644 (file)
@@ -15,7 +15,7 @@ if (empty($CFG->usetags)) {
 $tag_id = optional_param('id', 0, PARAM_INT);
 $tag_name = optional_param('tag', '', PARAM_TAG);
 if ($tag_name) {
-    $tag = array_shift(tag_get_id($tag_name, TAG_RETURN_OBJECT));
+    $tag = tag_get_id($tag_name, TAG_RETURN_OBJECT);
 } elseif ( $tag_id ) {
     $tag = tag_get_tag_by_id($tag_id);
 } else {
index d6a1b53323973236085998a1ee55afc5761543b6..96d7de59869f0a3986d43051f135ce5036c09365 100644 (file)
@@ -245,9 +245,13 @@ function tag_get_tags_ids($record) {
  * Returns the database ID of a set of tags.
  * 
  * @param mixed $tags one tag, or array of tags, to look for.
- * @param bool $return_object get the object returned by get_recordset_sql instead 
- *     of the id only (default: false)
- * @return mixed tag-indexed array of ids (or objects, if second parameter is TAG_RETURN_OBJECT), or only an int, if only one tag is given *and* the second parameter is null. No value for a key means the tag wasn't found.
+ * @param bool $return_value specify the type of the returned value. Either 
+ *     TAG_RETURN_OBJECT, or TAG_RETURN_ARRAY (default). If TAG_RETURN_ARRAY 
+ *     is specified, an array will be returned even if only one tag was 
+ *     passed in $tags.
+ * @return mixed tag-indexed array of ids (or objects, if second parameter is 
+ *     TAG_RETURN_OBJECT), or only an int, if only one tag is given *and* the 
+ *     second parameter is null. No value for a key means the tag wasn't found.
  */
 function tag_get_id($tags, $return_value=null) {
     global $CFG;