<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Development%3AGroups_API_for_modules</id>
	<title>Development:Groups API for modules - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Development%3AGroups_API_for_modules"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Groups_API_for_modules&amp;action=history"/>
	<updated>2026-05-07T11:36:23Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Development:Groups_API_for_modules&amp;diff=11206&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Groups_API_for_modules&amp;diff=11206&amp;oldid=prev"/>
		<updated>2024-10-21T08:51:19Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 08:51, 21 октября 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Олег Давидович</name></author>
	</entry>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Development:Groups_API_for_modules&amp;diff=11205&amp;oldid=prev</id>
		<title>1&gt;Dougiamas: Groups API for modules moved to Development:Groups API for modules</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Groups_API_for_modules&amp;diff=11205&amp;oldid=prev"/>
		<updated>2006-12-12T09:08:43Z</updated>

		<summary type="html">&lt;p&gt;Groups API for modules moved to Development:Groups API for modules&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt; &amp;lt;?php&lt;br /&gt;
 /*******************************************************************************&lt;br /&gt;
  * modulelib.php&lt;br /&gt;
  * &lt;br /&gt;
  * This file contains functions to be used by modules to support groups. More&lt;br /&gt;
  * documentation is available on the Developer&amp;#039;s Notes section of the Moodle &lt;br /&gt;
  * wiki. &lt;br /&gt;
  * &lt;br /&gt;
  * For queries, suggestions for improvements etc. please post on the Groups &lt;br /&gt;
  * forum on the moodle.org site.&lt;br /&gt;
  ******************************************************************************/&lt;br /&gt;
 &lt;br /&gt;
 /*******************************************************************************&lt;br /&gt;
  * Permission types&lt;br /&gt;
  * &lt;br /&gt;
  * There are six types of permission that a user can hold for a particular&lt;br /&gt;
  * group - &amp;#039;student view&amp;#039;, &amp;#039;student contribute&amp;#039;, &amp;#039;teacher view&amp;#039;, &lt;br /&gt;
  * &amp;#039;teacher contribute&amp;#039;, &amp;#039;view members list&amp;#039; and &amp;#039;view group existence&amp;#039;. &lt;br /&gt;
  * &lt;br /&gt;
  * A particular user need not to be a member of the group to have a specific &lt;br /&gt;
  * permission and may have more than one permission type. The permission that a &lt;br /&gt;
  * particular user has for a group used by an particular instance of the module &lt;br /&gt;
  * depends on whether the student is a teacher or student for the course and on &lt;br /&gt;
  * the settings for the set of groups (the &amp;#039;grouping&amp;#039;) being used by the &lt;br /&gt;
  * instance of the module  &lt;br /&gt;
  * &lt;br /&gt;
  * It is up to each module to decide how to interpret the different permission &lt;br /&gt;
  * types. The only exception is with &amp;#039;view members list&amp;#039; and &amp;#039;view group &lt;br /&gt;
  * existence&amp;#039;. The former means that the user can view the members of the group &lt;br /&gt;
  * while the latter means that the user can view information such as the group &lt;br /&gt;
  * name and description. It is possible that a user may have &amp;#039;view members list&amp;#039; &lt;br /&gt;
  * permission without &amp;#039;view group existence&amp;#039; permission - the members would just &lt;br /&gt;
  * appear as the other users on the course. &lt;br /&gt;
  * &lt;br /&gt;
  * Permission types can be combined with boolean expressions where they are used &lt;br /&gt;
  * if necessary. &lt;br /&gt;
  * &lt;br /&gt;
  * @name GROUPS_STUDENT Either &amp;#039;student view&amp;#039; or &amp;#039;student contribute&amp;#039; permission&lt;br /&gt;
  * @name GROUPS_TEACHER Either &amp;#039;teacher view&amp;#039; or &amp;#039;teacher contribute&amp;#039; permission&lt;br /&gt;
  * @name GROUPS_VIEW Either &amp;#039;teacher view&amp;#039; or &amp;#039;student view&amp;#039; permission&lt;br /&gt;
  * @name GROUPS_CONTRIBUTE Either &amp;#039;teacher contribute&amp;#039; or &amp;#039;student contribute&amp;#039; &lt;br /&gt;
  * permission&lt;br /&gt;
  * @name GROUPS_VIEW_GROUP_EXISTENCE &amp;#039;view group existence&amp;#039; permission&lt;br /&gt;
  * @name GROUPS_VIEW_MEMBERS_LIST &amp;#039;view members list&amp;#039; permission&lt;br /&gt;
  * @name GROUPS_STUDENT_VIEW &amp;#039;student view&amp;#039; permission&lt;br /&gt;
  * @name GROUPS_STUDENT_CONTRIBUTE &amp;#039;student contribute&amp;#039; permission&lt;br /&gt;
  * @name GROUPS_TEACHER_VIEW &amp;#039;teacher view&amp;#039; permission&lt;br /&gt;
  * @name GROUPS_TEACHER_CONTRIBUTE &amp;#039;teacher contribute&amp;#039; permission&lt;br /&gt;
  ******************************************************************************/&lt;br /&gt;
 define(&amp;#039;GROUPS_STUDENT&amp;#039;, 1);&lt;br /&gt;
 define(&amp;#039;GROUPS_TEACHER&amp;#039;, 2);&lt;br /&gt;
 define(&amp;#039;GROUPS_VIEW&amp;#039;, 4);&lt;br /&gt;
 define(&amp;#039;GROUPS_CONTRIBUTE&amp;#039;, 8);&lt;br /&gt;
 define(&amp;#039;GROUPS_VIEW_GROUP_EXISTENCE&amp;#039;, 16);&lt;br /&gt;
 define(&amp;#039;GROUPS_VIEW_MEMBERS_LIST&amp;#039;, 48);&lt;br /&gt;
 define(&amp;#039;GROUPS_STUDENT_VIEW&amp;#039;, 5);&lt;br /&gt;
 define(&amp;#039;GROUPS_STUDENT_CONTRIBUTE&amp;#039;, 9);&lt;br /&gt;
 define(&amp;#039;GROUPS_TEACHER_VIEW&amp;#039;, 6);&lt;br /&gt;
 define(&amp;#039;GROUPS_TEACHER_CONTRIBUTE&amp;#039;, 10);&lt;br /&gt;
 &lt;br /&gt;
 /**&lt;br /&gt;
  * Indicates if the instance of the module has been set up by an editor of the &lt;br /&gt;
  * course to use groups. This functionality can also be obtained using the &lt;br /&gt;
  * groups_m_get_groups() function, however it is sufficiently commonly needed &lt;br /&gt;
  * that this separate function has been provided and should be used instead. &lt;br /&gt;
  * @param int $cmid The id of the module instance&lt;br /&gt;
  * @return boolean True if the instance is set up to use groups, false otherwise&lt;br /&gt;
  */&lt;br /&gt;
 function groups_m_uses_groups($cmid) {&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /**&lt;br /&gt;
  * Prints a dropdown box to enable a user to select between the groups for the &lt;br /&gt;
  * module instance of which they are a member. If a user belongs to 0 or 1 &lt;br /&gt;
  * groups, no form is printed. The dropdown box belongs to a form and when a &lt;br /&gt;
  * user clicks on the box this form is automatically submitted so that the page &lt;br /&gt;
  * knows about the change. &lt;br /&gt;
  * @param int $cmid The id of the module instance&lt;br /&gt;
  * @param string $urlroot The url of the page - this is necessary so the form &lt;br /&gt;
  * can submit to the correct page. &lt;br /&gt;
  * @param int $permissiontype - see note on permissiontypes above. &lt;br /&gt;
  * @return boolean True unless an error occurred or the module instance does not &lt;br /&gt;
  * use groups in which case returns false. &lt;br /&gt;
  */&lt;br /&gt;
 function groups_m_print_group_selector($cmid, $urlroot, $permissiontype) {&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /**&lt;br /&gt;
  * Gets the group that a student has selected from the drop-down menu printed&lt;br /&gt;
  * by groups_m_print_group_selector and checks that the student has the &lt;br /&gt;
  * specified permission for the group and that the group is one of the groups&lt;br /&gt;
  * assigned for this module instance.&lt;br /&gt;
  * &lt;br /&gt;
  * Groups selected are saved between page changes within the module instance but &lt;br /&gt;
  * not necessarily if the user leaves the instance e.g. returns to the main &lt;br /&gt;
  * course page. If the selector has not been printed anywhere during the user&amp;#039;s &lt;br /&gt;
  * &amp;#039;visit&amp;#039; to the module instance, then the function returns false. This means &lt;br /&gt;
  * that you need to be particularly careful about pages that might be &lt;br /&gt;
  * bookmarked by the user.  &lt;br /&gt;
  * &lt;br /&gt;
  * @uses $USER   &lt;br /&gt;
  * @param int $cmid The id of the module instance&lt;br /&gt;
  * @param int $permissiontype The permission type - see note on permission types &lt;br /&gt;
  * above&lt;br /&gt;
  * @param int $userid The id of the user, defaults to the current user &lt;br /&gt;
  * @return boolean True if no error occurred, false otherwise. &lt;br /&gt;
  */&lt;br /&gt;
 function groups_m_get_selected_group($cmid, $permissiontype, &lt;br /&gt;
                                      $userid = $USER-&amp;gt;id) {&lt;br /&gt;
 }&lt;br /&gt;
 	 &lt;br /&gt;
 /**&lt;br /&gt;
  * Gets an array of the groupids of all the groups that the specified user has&lt;br /&gt;
  * particular permission for in this particular instance of the module&lt;br /&gt;
  * @uses $USER     &lt;br /&gt;
  * @param int $cmid The id of the module instance&lt;br /&gt;
  * @param int $permissiontype The permission type - see note on permission types &lt;br /&gt;
  * above&lt;br /&gt;
  * @param int $userid The id of the user, defaults to the current user &lt;br /&gt;
  * @return array An array of the group ids &lt;br /&gt;
  */	&lt;br /&gt;
 function groups_m_get_groups_for_user($cmid, $permissiontype, &lt;br /&gt;
                                       $userid = $USER-&amp;gt;id) {&lt;br /&gt;
 }  &lt;br /&gt;
 &lt;br /&gt;
 /**&lt;br /&gt;
  * Indicates if a specified user has a particular type of permission for a &lt;br /&gt;
  * particular group for this module instance.&lt;br /&gt;
  * @uses $USER      &lt;br /&gt;
  * @param int $cmid The id of the module instance. This is necessary because the &lt;br /&gt;
  * same group can be used in different module instances with different &lt;br /&gt;
  * permission setups. &lt;br /&gt;
  * @param int $groupid The id of the group&lt;br /&gt;
  * @param int $permissiontype The permission type - see note on permission types &lt;br /&gt;
  * above&lt;br /&gt;
  * @userid int $userid The id of the user, defaults to the current user&lt;br /&gt;
  * @return boolean True if the user has the specified permission type, false &lt;br /&gt;
  * otherwise or if an error occurred. &lt;br /&gt;
  */&lt;br /&gt;
  function groups_m_has_permission($cmid, $groupid, $permissiontype, &lt;br /&gt;
                                   $userid = $USER-&amp;gt;id) {&lt;br /&gt;
  } &lt;br /&gt;
 &lt;br /&gt;
 /**&lt;br /&gt;
  * Gets an array of members of a group that have a particular permission type &lt;br /&gt;
  * for this instance of the module and that are enrolled on the course that&lt;br /&gt;
  * the module instance belongs to. &lt;br /&gt;
  * &lt;br /&gt;
  * @param int $cmid The id of the module instance. This is necessary because the &lt;br /&gt;
  * same group can be used in different module instances with different &lt;br /&gt;
  * permission setups. &lt;br /&gt;
  * @param int $groupid The id of the group&lt;br /&gt;
  * @param int $permissiontype The permission type - see note on permission types &lt;br /&gt;
  * above&lt;br /&gt;
  * @return array An array containing the ids of the users with the specified &lt;br /&gt;
  * permission. &lt;br /&gt;
  */&lt;br /&gt;
 function groups_m_get_members_with_permission($cmid, $groupid, &lt;br /&gt;
                                               $permissiontype) {&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /**&lt;br /&gt;
  * Gets the group object associated with a group id. This group object can be &lt;br /&gt;
  * used to get information such as the name of the group and the file for the &lt;br /&gt;
  * group icon if it exists. (Look at the groups table in the database to see&lt;br /&gt;
  * the fields). &lt;br /&gt;
  * @param int $groupid The id of the group&lt;br /&gt;
  * @return group The group object &lt;br /&gt;
  */&lt;br /&gt;
 function groups_m_get_group($groupid) {&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /**&lt;br /&gt;
  * Gets the groups for the module instance. In general, you should use &lt;br /&gt;
  * groups_m_get_groups_for_user, however this function is provided for &lt;br /&gt;
  * circumstances where this function isn&amp;#039;t sufficient for some reason. &lt;br /&gt;
  * @param int $cmid The id of the module instance. &lt;br /&gt;
  * @return array An array of the ids of the groups for the module instance &lt;br /&gt;
  */&lt;br /&gt;
 function groups_m_get_groups($cmid) {&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /**&lt;br /&gt;
  * Gets the members of group that are enrolled on the course that the specified&lt;br /&gt;
  * module instance belongs to. &lt;br /&gt;
  * @param int $cmid The id of the module instance&lt;br /&gt;
  * @param int $groupid The id of the group&lt;br /&gt;
  * @return array An array of the userids of the members. &lt;br /&gt;
  */&lt;br /&gt;
 function groups_m_get_members($cmid, $groupid) {&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 /**&lt;br /&gt;
  * Indicates if a user is a member of a particular group. In general you should &lt;br /&gt;
  * use groups_m_has_permission, however this function is provided for &lt;br /&gt;
  * circumstances where this function isn&amp;#039;t sufficient for some reason. &lt;br /&gt;
  * @param int $groupid The id of the group&lt;br /&gt;
  * @param int $userid The id of the user &lt;br /&gt;
  * @return boolean True if the user is a member of the group, false otherwise &lt;br /&gt;
  */&lt;br /&gt;
 function groups_m_is_member($groupid, $userid) {&lt;br /&gt;
 }&lt;br /&gt;
 ?&amp;gt;&lt;/div&gt;</summary>
		<author><name>1&gt;Dougiamas</name></author>
	</entry>
</feed>