<?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%3ASubplugins</id>
	<title>Development:Subplugins - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Development%3ASubplugins"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Subplugins&amp;action=history"/>
	<updated>2026-05-06T17:39:30Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Development:Subplugins&amp;diff=11912&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Subplugins&amp;diff=11912&amp;oldid=prev"/>
		<updated>2024-10-21T08:53:14Z</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:53, 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:Subplugins&amp;diff=11911&amp;oldid=prev</id>
		<title>1&gt;Marxjohnson: Fixed transposed parameters in example.</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Subplugins&amp;diff=11911&amp;oldid=prev"/>
		<updated>2011-03-23T13:45:52Z</updated>

		<summary type="html">&lt;p&gt;Fixed transposed parameters in example.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Sub plugins allow activity modules to be extended without having to change the module&amp;#039;s code.&lt;br /&gt;
&lt;br /&gt;
Each activity module can define a set of subplugin types in &amp;lt;tt&amp;gt;db/subplugins.php&amp;lt;/tt&amp;gt;.  The file must contain an array called &amp;lt;tt&amp;gt;$subplugins&amp;lt;/tt&amp;gt;, with the plugin type as the key for the directory containing the plugins. For example, from &amp;lt;tt&amp;gt;mod/workshop/db/subplugins.php&amp;lt;/tt&amp;gt;:&lt;br /&gt;
 $subplugins = array(&lt;br /&gt;
                    &amp;#039;workshopform&amp;#039;       =&amp;gt; &amp;#039;mod/workshop/form&amp;#039;,&lt;br /&gt;
                    &amp;#039;workshopallocation&amp;#039; =&amp;gt; &amp;#039;mod/workshop/allocation&amp;#039;,&lt;br /&gt;
                    &amp;#039;workshopeval&amp;#039;       =&amp;gt; &amp;#039;mod/workshop/eval&amp;#039;,&lt;br /&gt;
                    );&lt;br /&gt;
This defines 3 plugin types, &amp;lt;tt&amp;gt;workshopform&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;workshopallocation&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;workshopeval&amp;lt;/tt&amp;gt;. The plugins themselves can be found in &amp;lt;tt&amp;gt;mod/workshop/form&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;mod/workshop/allocation&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;mod/workshop/eval&amp;lt;/tt&amp;gt;, respectively.  Each of these directories can contain a number of plugins, each within it&amp;#039;s own subdirectory.&lt;br /&gt;
&lt;br /&gt;
=== Writing a sub-plugin ===&lt;br /&gt;
A sub-plugin has the same structure as a regular plugin.  It will have a &amp;lt;tt&amp;gt;version.php&amp;lt;/tt&amp;gt;, a &amp;lt;tt&amp;gt;lang&amp;lt;/tt&amp;gt; directory, and can have a &amp;lt;tt&amp;gt;db&amp;lt;/tt&amp;gt; directory with an &amp;lt;tt&amp;gt;install.xml&amp;lt;/tt&amp;gt; and all the other hooks you&amp;#039;d expect to see used in any other type of plugin, such as an activity, block, or admin report.&lt;br /&gt;
&lt;br /&gt;
An important thing to remember when using lang strings is to prefix the component with the plugin type, as you do with all non-activity blocks.  So to print the name of the &amp;quot;accumulative&amp;quot; workshopform plugin, you&amp;#039;d do&lt;br /&gt;
 print_string(&amp;#039;pluginname&amp;#039;, &amp;#039;workshopform_accumulative&amp;#039;);&lt;/div&gt;</summary>
		<author><name>1&gt;Marxjohnson</name></author>
	</entry>
</feed>