<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cttxg</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cttxg"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Cttxg"/>
	<updated>2026-08-12T11:15:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Using_images_in_a_theme&amp;diff=47447</id>
		<title>Using images in a theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Using_images_in_a_theme&amp;diff=47447"/>
		<updated>2015-03-04T21:03:47Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* See also */ Adding MoodleBites YouTube video link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}&lt;br /&gt;
==A little background==&lt;br /&gt;
Moodle 2.0 has introduced a new improved method of making use of images within its pages enabling theme designers to take full control over what images are being used and when possible ensures images are passed through Moodle&#039;s new performance caching system to obtain the best possible performance.&lt;br /&gt;
&lt;br /&gt;
$CFG-&amp;gt;themewww and custom pix in Moodle 1.9 and lower are gone from Moodle 2.0 and have been replaced by this new system.&lt;br /&gt;
&lt;br /&gt;
==Before we start==&lt;br /&gt;
&lt;br /&gt;
# Make sure you have a theme and images to work with, one that you have a backup of just in case.&lt;br /&gt;
# Take note of your theme&#039;s main layout file e.g. &#039;&#039;standard.php&#039;&#039;.&lt;br /&gt;
# Take note of your theme&#039;s main CSS file e.g. &#039;&#039;core.css&#039;&#039;.&lt;br /&gt;
# Turn on &#039;&#039;&#039;Theme designer mode&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Image locations within Moodle==&lt;br /&gt;
&lt;br /&gt;
There are three main areas in which images are located - core, plugin and theme.&lt;br /&gt;
&lt;br /&gt;
Core images are used throughout Moodle and are stored in &#039;&#039;moodle/pix&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The pix directory contains the following subdirectories:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;a&#039;&#039; - Icons that are not widely used&lt;br /&gt;
:&#039;&#039;c&#039;&#039; - Calendar-related icons&lt;br /&gt;
:&#039;&#039;f&#039;&#039; - File icons for different file types&lt;br /&gt;
:&#039;&#039;g&#039;&#039; - Default user icons and thumbnails&lt;br /&gt;
:&#039;&#039;i&#039;&#039; - General icons&lt;br /&gt;
:&#039;&#039;m&#039;&#039; - Currency symbols&lt;br /&gt;
:&#039;&#039;s&#039;&#039; - Smileys&lt;br /&gt;
:&#039;&#039;t&#039;&#039; - General icons&lt;br /&gt;
:&#039;&#039;u&#039;&#039; - User icons and thumbnails&lt;br /&gt;
:&#039;&#039;y&#039;&#039; - YUI icons&lt;br /&gt;
&lt;br /&gt;
Plugin images are used by plugins and are stored within the plugin&#039;s directory e.g. &#039;&#039;mod/forum/*&#039;&#039; or &#039;&#039;blocks/navigation/*&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Theme images are used in themes and are stored in the &#039;&#039;pix&#039;&#039; subdirectory of a theme.&lt;br /&gt;
&lt;br /&gt;
==Adding new images to your theme==&lt;br /&gt;
&lt;br /&gt;
To add new images to your theme, such as a background image or a logo, you should start by creating a pix directory within your themes directory.&lt;br /&gt;
&lt;br /&gt;
Lets assume you have two images, gradient.png and logo.jpg. Copy both files to your themes pix directory.&lt;br /&gt;
&lt;br /&gt;
The plan is to use gradient.png as the background image for your theme (in CSS) and use logo.jpg in the header (in your theme&#039;s layout file).&lt;br /&gt;
&lt;br /&gt;
===Using images within CSS===&lt;br /&gt;
&lt;br /&gt;
Moodle parses all CSS files. When theme designer mode is off, Moodle combines them into a handful of large CSS files that get cached and served. At the same time Moodle also looks at the CSS and replaces special syntax rules. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&#039;padding:10px;background-color:#f7f7f7;border:1px dashed #123456&#039;&amp;gt;&amp;lt;nowiki&amp;gt;[[pix:theme|&amp;lt;/nowiki&amp;gt;&amp;lt;span style=&#039;color:#336699;font-weight:bold;&#039;&amp;gt;&amp;lt;nowiki&amp;gt;path/to/image/&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span style=&#039;color:#33993A;font-weight:bold;&#039;&amp;gt;imagename&amp;lt;/span&amp;gt;&amp;lt;nowiki&amp;gt;]]&amp;lt;/nowiki&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above pattern is looked for by Moodle and gets replaced with the correct image URL when found.&lt;br /&gt;
You should note the following things about this pattern when using your own images within CSS:&lt;br /&gt;
&lt;br /&gt;
# The bits in black don&#039;t change&lt;br /&gt;
# The bit in blue is the path to your image within the pix directory. It shouldn&#039;t start with a / but should end with one.&lt;br /&gt;
# The bit in green is the filename (&#039;&#039;&#039;no need to include the file extension&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
To use background.png as the background for our pages, add the following line of CSS to the themes core.css.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
body {background-image:url([[pix:theme|gradient]]);}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we look at how to use your own images within your themes layout files we should first look at how this changes if the image is in a sub directory.&lt;br /&gt;
&lt;br /&gt;
Lets assume gradient.png is located here: &#039;&#039;&#039;pix/myimages/gradients/gradient.png&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The CSS would need to be as follows:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
body {background-image:url([[pix:theme|myimages/gradients/gradient]]);}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to refer to an image belonging to a plugin, you can do it like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
body {background-image:url([[pix:quiz|icon]]);}&lt;br /&gt;
body {background-image:url([[pix:qtype_ddmarker|grid]]);}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That refers to mod/quiz/pix/icon.png/gif and question/type/ddmarker/pix/grid.png/gif respectively (or whatever icons you have put in your theme to override these).&lt;br /&gt;
&lt;br /&gt;
===Using your images within your layout files===&lt;br /&gt;
&lt;br /&gt;
To use logo.jpg within the header of the layout file, open the layout file e.g. general.php and find the correct spot to put your logo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;div id=&amp;quot;page-header&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- Logo should go here --&amp;gt;&lt;br /&gt;
    &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
        echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;lang_menu();&lt;br /&gt;
        echo $PAGE-&amp;gt;headingmenu;&lt;br /&gt;
    ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To achieve this I simply need to add the following line of code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;img src=&amp;quot;&amp;lt;?php echo $OUTPUT-&amp;gt;pix_url(&#039;logo&#039;, &#039;theme&#039;); ?&amp;gt;&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
As before, the image&#039;s file extension is not needed as Moodle finds it automatically.&lt;br /&gt;
&lt;br /&gt;
Combined the solution is very simple:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;div id=&amp;quot;page-header&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;img src=&amp;quot;&amp;lt;?php echo $OUTPUT-&amp;gt;pix_url(&#039;logo&#039;, &#039;theme&#039;); ?&amp;gt;&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;headermenu&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
        echo $OUTPUT-&amp;gt;login_info();&lt;br /&gt;
        echo $OUTPUT-&amp;gt;lang_menu();&lt;br /&gt;
        echo $PAGE-&amp;gt;headingmenu;&lt;br /&gt;
    ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The only other thing to consider is how this example would look if logo.jpg was located in a subfolder e.g. &#039;&#039;&#039;pix/myimages/logos/logo.jpg&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The code for this would be:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;img src=&amp;quot;&amp;lt;?php echo $OUTPUT-&amp;gt;pix_url(&#039;myimages/logos/logo&#039;, &#039;theme&#039;); ?&amp;gt;&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Note that&#039;theme&#039; above means the word theme, and not the name of your theme&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Overriding images in your theme==&lt;br /&gt;
&lt;br /&gt;
Overriding images within your theme can be an important part of creating and/or modifying themes.&lt;br /&gt;
&lt;br /&gt;
As mentioned, there are three main areas for images within Moodle, core, plugins, and themes. Obviously we won&#039;t be overriding theme images as we are in a theme and have full control over that already which just leaves core and plugin images that you may want to override.&lt;br /&gt;
&lt;br /&gt;
Within your theme create the following two directories:&lt;br /&gt;
; /pix_core/ : This is where your images to override core images will need to be.&lt;br /&gt;
; /pix_plugins/ : This is where images to override plugins will need to be.&lt;br /&gt;
&lt;br /&gt;
Next, copy the images that you wish to override into either the pix_core or pix_plugins directory. You need to replicate the directory structure that the images are located in.&lt;br /&gt;
&lt;br /&gt;
The following two examples illustrate how this works for both core and plugin images.&lt;br /&gt;
&lt;br /&gt;
===Overriding core images===&lt;br /&gt;
For this example I am going to override the following two images:&lt;br /&gt;
# &#039;&#039;&#039;moodle/pix/help.gif&#039;&#039;&#039; This image is used for all help image icons and is shown throughout Moodle.&lt;br /&gt;
# &#039;&#039;&#039;moodle/pix/i/info.gif&#039;&#039;&#039; This image is used in several places, most notably the front page if the combo list is being displayed.&lt;br /&gt;
&lt;br /&gt;
So first up help.gif. This is the most basic example of overriding an image. Because the image is directly within Moodle&#039;s pix directory we can simply place our new help image into our themes pix_core directory. There&#039;s nothing more to it!&lt;br /&gt;
&lt;br /&gt;
The second example if not really any more difficult. Because the image is located within the subdirectory &#039;&#039;&#039;i&#039;&#039;&#039; we must create a sub directory within our pix_core directory into which we will copy our new help image. That is, the image ends up at &#039;&#039;&#039;/pix_core/i/info.png&#039;&#039;&#039; inside your theme folder. And again done!&lt;br /&gt;
&lt;br /&gt;
You should also note that, as with any other image in Moodle, the extension doesn&#039;t matter. If you want to replace help.gif with a help.png you can just put the png into the correct directory. As long as the filename is the same Moodle will find it.&lt;br /&gt;
&lt;br /&gt;
===Overriding plugin images===&lt;br /&gt;
This is a little bit more difficult than overriding core images, but not too much so. For this example, let&#039;s say I want to override the following two plugin images:&lt;br /&gt;
# &#039;&#039;&#039;moodle/mod/forum/icon.gif&#039;&#039;&#039; This is the icon that is used everywhere for the forum.&lt;br /&gt;
# &#039;&#039;&#039;moodle/blocks/customblock/activate.png&#039;&#039;&#039; This is an icon in a custom block I have installed.&lt;br /&gt;
&lt;br /&gt;
First up, the forum icon. Just as with core images, we need to put the image in the correct directory structure. In this case it is going to be within our theme&#039;s pix_plugins directory.&lt;br /&gt;
&lt;br /&gt;
Here we need to create the directory structure between &#039;&#039;&#039;/mod/&#039;&#039;&#039; and the image, so we need the following structure &#039;&#039;&#039;/pix_plugins/mod/forum/&#039;&#039;&#039; and into the final forum directory we put our replacement image.&lt;br /&gt;
&lt;br /&gt;
The second example is done in exactly the same way, but with the blocks path. We simply need to put our replacement image in &#039;&#039;&#039;/pix_plugins/blocks/customblock/&#039;&#039;&#039; and it will automatically be overridden.&lt;br /&gt;
&lt;br /&gt;
When looking for an overriding image the following path is used.&lt;br /&gt;
&lt;br /&gt;
# theme (static)&lt;br /&gt;
# themename =&amp;gt; mytheme&lt;br /&gt;
# area =&amp;gt; pix_plugins for plugin images, pix_core for core images, pix for theme images.&lt;br /&gt;
# plugin type =&amp;gt; booktool for the book tool sub plugin for example.&lt;br /&gt;
# plugin name =&amp;gt; print for the name of the sub plugin.&lt;br /&gt;
# file name =&amp;gt; book for the name of the image.&lt;br /&gt;
&lt;br /&gt;
It then searches for the image with the following extensions gif, png, jpg, jpeg in that order.&lt;br /&gt;
&lt;br /&gt;
So you end up with:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
/theme/themename/area/plugintype/pluginname/filename.gif&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example: Silkicons theme==&lt;br /&gt;
As an example of how this all looks when done I have attached a screen shot of a theme I quickly created using the Silk icon set created by Mark James available at [http://famfamfam.com/lab/icons/silk/ http://famfamfam.com/lab/icons/silk/].&lt;br /&gt;
&lt;br /&gt;
[[Image:Silkicon.theme.screenshot.jpg]]&lt;br /&gt;
&lt;br /&gt;
I have also uploaded the this file to this forum discussion if you would like to check it out for yourself.&lt;br /&gt;
[http://moodle.org/mod/forum/discuss.php?d=151581 http://moodle.org/mod/forum/discuss.php?d=151581]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Plugins]]&lt;br /&gt;
* [[Replacing icons with CSS3]]&lt;br /&gt;
* [http://youtu.be/g_9VM9OMs3Y Adding Images to your Theme]  MoodleBites video on YouTube&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=151581 Using images within your themes (and the silk icon theme)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=151581#p689883 choosing images based on the users current language]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=157935&amp;amp;parent=691903 how to add a category(categorias) img-bullet]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Themes&amp;diff=47273</id>
		<title>Themes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Themes&amp;diff=47273"/>
		<updated>2015-01-24T08:50:02Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* See also */ Adding MoodleBites YouTube video link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a starting point for Moodle theme developers.&lt;br /&gt;
&lt;br /&gt;
For documentation on installing and using themes, please see the [[:en:Themes|Themes user documentation]] and [[:en:Themes FAQ|Themes FAQ]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Moodle has a powerful themes system that allows for a variety of effects through the use of XHTML and CSS.&lt;br /&gt;
&lt;br /&gt;
* [[Themes overview]]&lt;br /&gt;
* [[Creating a theme]] - A quick step by step guide to creating your first theme.&lt;br /&gt;
* [[Cloning a theme]]&lt;br /&gt;
* [[Using images in a theme]] - How to use and override images within your theme.&lt;br /&gt;
* [[Creating a theme settings page]] - Looks at how to add a setting page making your theme easily customisable.&lt;br /&gt;
* [[Extending the theme custom menu]] - Customising the custom menu.&lt;br /&gt;
* [[Overriding a renderer]] - A tutorial on creating a custom renderer and changing the HTML Moodle produces. &lt;br /&gt;
* [[Theme checklist]] - Things that you might miss when you think you have finished your theme.&lt;br /&gt;
* [[Clean theme]] (new in 2.5) - How to copy and customise the Clean theme to create your own theme.&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=224651 How to add a &#039;Watermark&#039; as a background image to your theme.]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Themes|List of all themes-related developer documentation]]&lt;br /&gt;
* [http://youtu.be/K3MYE8am7M4 Install a New Theme]  MoodleBites video on YouTube &lt;br /&gt;
&lt;br /&gt;
[[Category:Themes]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Clean_theme&amp;diff=47272</id>
		<title>Clean theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Clean_theme&amp;diff=47272"/>
		<updated>2015-01-23T21:06:20Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* See also */ Adding MoodleBites YouTube video link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}{{Moodle 2.5}}This document describes how to copy and customise the Clean (bootstrapbase) theme so that you can build on this to create a theme of your own. It assumes you have some understanding of how themes work within Moodle 2.5, as well as a basic understanding of HTML and CSS. Also, because of the rapid development within Moodle, resulting in a number of versions available namely 2.3.x and 2.4.x, and 2.5.x it is important to understand that this tutorial is only valid for the Moodle 2.5+ Clean theme.&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on the &#039;&#039;&#039;clean&#039;&#039;&#039; theme and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of clean&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So rename this folder to your choosen theme name, using only lower case letters, and if needed, underscores. For the purpose of this tutorial we will call the theme &#039;cleantheme&#039;.&lt;br /&gt;
&lt;br /&gt;
On opening &#039;cleantheme&#039; you will find several files and sub-directories which have files within them.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme configurations are made. &#039;&#039;(contains some elements that require renaming)&#039;&#039;&lt;br /&gt;
; lib.php :  Where all the functions for the themes settings are found. &#039;&#039;(contains some elements that require renaming)&#039;&#039;&lt;br /&gt;
; settings.php :  Where all the setting for this theme are created. &#039;&#039;(contains some elements that require renaming)&#039;&#039;&lt;br /&gt;
; version.php :  Where the version number and plugin componant information is kept. &#039;&#039;(contains some elements that require renaming)&#039;&#039;&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories for other languages if and when you want to add them.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_clean.php : This file contains all the language strings for your theme. &#039;&#039;(contains some elements that require renaming as well as the filename itself)&#039;&#039;  &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/columns1.php : Layout file for a one column layout (content only).&lt;br /&gt;
; /layout/columns2.php : Layout file for a two column layout (side-pre and content).&lt;br /&gt;
; /layout/columns3.php : Layout file for a three column layout (side-pre, content and side-post) and the front page.&lt;br /&gt;
; /layout/embedded.php : Embedded layout file for embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible.&lt;br /&gt;
; /layout/maintenance.php : Maintenance layout file which does not have any blocks, links, or API calls that would lead to database or cache interaction.&lt;br /&gt;
; /layout/secure.php : Secure layout file for safebrowser and securewindow.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/custom.css : This is where all the settings CSS is generated.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
&lt;br /&gt;
==Renaming Elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the old theme name occurs, in this case &#039;&#039;&#039;clean&#039;&#039;&#039;. So using the above list as a guide, search through and change all the instances of the theme name &#039;clean&#039; to &#039;cleantheme&#039;. This includes the filename of the lang/en/theme_clean.php. You need to change this to &#039;theme_cleantheme.php&#039;.&lt;br /&gt;
&lt;br /&gt;
==Installing your theme==&lt;br /&gt;
&lt;br /&gt;
Once all the changes to the name have been made, you can safely install the theme. If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install &#039;Plugins Check&#039;. If not then navigate to Administration &amp;gt; Notifications.&lt;br /&gt;
&lt;br /&gt;
Once your theme is successfully installed you can select it and begin to modify it using the custom settings page found by navigating to Administration &amp;gt; Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt;&amp;gt; and then click on (Cleantheme) or whatever you renamed your theme to, from the list of theme names that appear at this point in the side block.&lt;br /&gt;
&lt;br /&gt;
==Include a renderer in a bootstrap based theme==&lt;br /&gt;
&lt;br /&gt;
If you need to override any renderers in your theme, then make sure you override the renderers by extending the parent theme renderers, which in this case is bootstrapbase. For example the class that you need to start your renderer with is as follows...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
class theme_yourtheme_core_renderer extends theme_bootstrapbase_core_renderer {&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...where &#039;&#039;&#039;&#039;yourtheme&#039;&#039;&#039;&#039; requires you to change it to your theme name otherwise it will not work.&lt;br /&gt;
&lt;br /&gt;
(Please note: The normal recipe &amp;lt;tt&amp;gt;class theme_&#039;&#039;&#039;yourtheme&#039;&#039;&#039;_core_renderer extends core_renderer&amp;lt;/tt&amp;gt; is wrong for themes whose parent theme uses renderers, because this method will ultimately conflict with the parent theme&#039;s renderers.)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [http://youtu.be/ctEYt_z2bNE Cloning the Clean Theme]  MoodleBites video on YouTube &lt;br /&gt;
* [http://www.somerandomthoughts.com/blog/2013/05/08/moodle-2-5-and-the-bootstrap-based-theme-clean/ Moodle 2.5 and the Bootstrap based theme – Clean] blog post by Gavin Henrick&lt;br /&gt;
* [http://basbrands.nl/blog/2013/05/21/building-with-bootstrap/ Building With Bootstrap] blog post by Bas Brands&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=239967 Problems cloning &amp;quot;clean&amp;quot; theme] Discussion in &#039;&#039;Themes&#039;&#039; Forum&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Cloning_a_theme&amp;diff=47271</id>
		<title>Cloning a theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Cloning_a_theme&amp;diff=47271"/>
		<updated>2015-01-23T21:04:23Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* See also */ Adding MoodleBites YouTube video link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}This document describes how to clone a theme from an existing Moodle 2 theme. It assumes you have some understanding of how themes work within Moodle, as well as a basic understanding of XHTML and CSS. Also, because of the rapid development within Moodle, resulting in a number of versions available namely 2.0.x, 2.1.x 2.2.x 2.3.x 2.4.x and soon to be announced Moodle 2.5.x it is important to know that this tutorial is valid for ONLY Moodle Boxxie theme, and as such does not take into account the various other elements you will find in other Moodle versions of themes like Afterburner, Formal White, Sky High, to name but a few. If you are looking to clone one of these themes then checkout my new tutorials. [https://docs.moodle.org/dev/Themes_2.2_how_to_clone_a_Moodle_2.2_theme How to clone a Moodle 2.2 theme].  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
&lt;br /&gt;
Since this is a very easy introduction to creating a custom theme, the first thing to create is a copy of the version of the theme you want to clone. For the purpose of this tutorial, we will be cloning &#039;&#039;&#039;Boxxie&#039;&#039;&#039;, which is one of several Moodle &#039;&#039;&#039;core&#039;&#039;&#039; themes. There are other themes you can &#039;clone&#039; which are a little harder to do, but once you are familiar with this easy one, you can tackle the harder ones later.&lt;br /&gt;
&lt;br /&gt;
OK...let&#039;s get started. From your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory &#039;&#039;&#039;right click&#039;&#039;&#039; on &#039;&#039;&#039;boxxie&#039;&#039;&#039; and then &#039;&#039;&#039;&#039;&#039;copy&#039;&#039;&#039; and  &#039;&#039;&#039;paste&#039;&#039;&#039;&#039;&#039; back into your Moodle &#039;&#039;&#039;theme&#039;&#039;&#039; directory. You should now have a folder called &#039;&#039;&#039;Copy of boxxie&#039;&#039;&#039;. If you &#039;&#039;&#039;right click&#039;&#039;&#039; this folder you are given the option to &#039;&#039;&#039;Rename&#039;&#039;&#039; it. So let&#039;s rename this folder to &#039;&#039;&#039;foxxie&#039;&#039;&#039; (or to whatever name you want to call your &#039;&#039;&#039;cloned&#039;&#039;&#039; theme).  It is important to use only lower case letters and underscores.&lt;br /&gt;
&lt;br /&gt;
If you open the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory you will find several directories, sub-directories and files within it. One of these sub-directories &#039;&#039;&#039;&#039;&#039;lang/en/&#039;&#039;&#039;&#039;&#039; contain a file called &#039;&#039;&#039;theme_boxxie.php&#039;&#039;&#039; which will need to be re-named to &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;. But we shall address this later. For now just familiarise yourself with what you find in the &#039;&#039;&#039;foxxie&#039;&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
; config.php :  Where all the theme configurations are made.&lt;br /&gt;
; /lang/ : This directory contains all language sub-directories for other languages if and when you want to add them.&lt;br /&gt;
; /lang/en/ : This sub-directory contains your language files, in this case &#039;&#039;English&#039;&#039;.&lt;br /&gt;
; /lang/en/theme_boxxie.php : This file contains all the language strings for your theme.   &lt;br /&gt;
; /layout/ : This directory contains all the layout files for this theme.&lt;br /&gt;
; /layout/frontpage.php : Layout file for front page.&lt;br /&gt;
; /layout/general.php : Layout file for all pages other than the front page.&lt;br /&gt;
; /layout/embedded.php : Layout file for embedded pages.&lt;br /&gt;
; /style/ : This directory contains all the CSS files for this theme.&lt;br /&gt;
; /style/core.css : Contains all the CSS rules for this theme.&lt;br /&gt;
; /style/boilerplate.css : Contains all the &#039;&#039;reset&#039;&#039; CSS rules for this theme.&lt;br /&gt;
; /pix/ : This directory contains a screen shot of this theme as well as a favicon and any images used in the theme.&lt;br /&gt;
; /pix/tabs : This contains all the tab images for this theme.&lt;br /&gt;
&lt;br /&gt;
==Renaming Elements==&lt;br /&gt;
&lt;br /&gt;
The problem when &#039;&#039;&#039;cloning&#039;&#039;&#039; a theme is that you need to rename all those instances where the theme name, in this case &#039;&#039;&#039;boxxie&#039;&#039;&#039;, occurs. The first place to look is &#039;&#039;&#039;config.php&#039;&#039;&#039;, where you need to change the theme name.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;boxxie&#039;;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
// Name of the theme. Most likely the name of&lt;br /&gt;
// the directory in which this file resides.&lt;br /&gt;
////////////////////////////////////////////////////&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
The next place to look, as mentioned above, is &#039;&#039;&#039;lang/en/theme_boxxie.php&#039;&#039;&#039;. This file, as well as needing to be renamed, also needs some of its content renaming too. So before we forget, let&#039;s &#039;&#039;&#039;right click&#039;&#039;&#039; on this file and &#039;&#039;&#039;rename&#039;&#039;&#039; it &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; before we open it.&lt;br /&gt;
&lt;br /&gt;
=== Language Strings ===&lt;br /&gt;
&lt;br /&gt;
When you open &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039; the first thing you will see are the &#039;&#039;&#039;credits&#039;&#039;&#039; for the theme. &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Strings for component &#039;theme_boxxie&#039;, language &#039;en&#039;, branch &#039;MOODLE_20_STABLE&#039;&lt;br /&gt;
 *&lt;br /&gt;
 * @package   moodlecore&lt;br /&gt;
 * @copyright 2010 Patrick Malley&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Here you will need to change the reference from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;, you can leave the rest of this as it is.&lt;br /&gt;
&lt;br /&gt;
The next things you will find in this file are what are known as the &#039;&#039;&#039;language strings&#039;&#039;&#039;. These are used for any customised &#039;&#039;&#039;&#039;&#039;words&#039;&#039; or &#039;&#039;phrases&#039;&#039;&#039;&#039;&#039; used in a theme. And because this is in the &#039;&#039;&#039;foxxie/lang/en/&#039;&#039;&#039; directory all the $strings are in English. But if you wanted to add some foreign words and phrases for whenever a user switched languages, you just need to create a new sub-directory in the &#039;&#039;&#039;foxxie/lang/&#039;&#039;&#039; directory for the language files you need to add there, and then copy and paste this file to that new sub-directory. For example: &#039;&#039;&#039;foxxie/lang/it/theme_foxxie.php&#039;&#039;&#039; (where &#039;&#039;&#039;it&#039;&#039;&#039; is the code which represents the Italian language). We will explore the Language aspect of themes in another Moodle Doc. So let&#039;s just concentrate on the changes we need to make to rest of the contents of &#039;&#039;&#039;theme_foxxie.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Boxxie&#039;;&lt;br /&gt;
$string[&#039;region-side-post&#039;] = &#039;Right&#039;;&lt;br /&gt;
$string[&#039;region-side-pre&#039;] = &#039;Left&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the $string section above, the only thing you need to change here is the &#039;&#039;&#039;pluginname&#039;&#039;&#039; from &#039;&#039;&#039;boxxie&#039;&#039;&#039; to &#039;&#039;&#039;foxxie&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In this next section, the &#039;&#039;&#039;choosereadme&#039;&#039;&#039;, which is written in XHTML and is the contents of the page that you will see when selecting &#039;&#039;&#039;Foxxie&#039;&#039;&#039; in the Theme Selector. However, you are advised to read what is actually written there and change it accordingly, renaming &#039;Boxxie&#039; to &#039;Foxxie&#039;, and changing the contents of this part to suit yourself. You might not want to keep all that is written here. You could actually condense it, but that&#039;s up to you. Just as long as you give credit, where credit is due, to the original theme designer by stating something on similar lines to what I have written below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$string[&#039;choosereadme&#039;] = &#039;Foxxie is a customised Moodle theme&lt;br /&gt;
by Mary Evans based on the original Boxxie theme by Patrick Malley&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now open version.php file and change $plugin-&amp;gt;component&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$plugin-&amp;gt;component = &#039;theme_foxxie&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Recipe for the Impatient==&lt;br /&gt;
For those who want a minimal set of instructions to semi-blindly blast through this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.&#039;&#039;&#039; Copy &#039;&#039;[moodleroot]/theme/boxxie&#039;&#039; to &#039;&#039;[moodleroot]/theme/foxxie&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2.&#039;&#039;&#039; Rename &#039;&#039;[moodleroot]/theme/foxxie/lang/en/theme_boxxie.php&#039;&#039; to &#039;&#039;[moodleroot]/theme/foxxie/lang/en/theme_foxxie.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3.&#039;&#039;&#039; In &#039;&#039;[moodleroot]/theme/foxxie/lang/en/theme_foxxie.php&#039;&#039;, replace any instances of &amp;quot;boxxie&amp;quot; with &amp;quot;foxxie&amp;quot;, likewise for &amp;quot;Boxxie&amp;quot; and &amp;quot;Foxxie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4.&#039;&#039;&#039; Edit &#039;&#039;[moodleroot]/theme/foxxie/config.php&#039;&#039; to replace instance(s) of &amp;quot;boxxie&amp;quot; with &amp;quot;foxxie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5.&#039;&#039;&#039; Edit &#039;&#039;[moodleroot]/theme/foxxie/version.php&#039;&#039; to replace instance(s) of &amp;quot;boxxie&amp;quot; with &amp;quot;foxxie&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Please Note: All theme names, directory names, and file names MUST be in lowercase.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://youtu.be/ctEYt_z2bNE Cloning the Clean Theme]  MoodleBites video on YouTube &lt;br /&gt;
* [[Making a horizontal dock]] - Modifying the dock to make it horizontal.&lt;br /&gt;
* [[Styling and customising the dock]] - How to style and customise the dock.&lt;br /&gt;
* [[Adding theme upgrade code]]&lt;br /&gt;
* [[Theme changes in 2.0]]&lt;br /&gt;
* [[jQuery]]&lt;br /&gt;
&lt;br /&gt;
[[es:Clonar un tema]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_theme_settings_page&amp;diff=45976</id>
		<title>Creating a theme settings page</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_theme_settings_page&amp;diff=45976"/>
		<updated>2014-07-25T07:16:11Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Finishing settings.php */ Correcting the $choices options&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Themes}}This document looks at how to create a settings page for your Moodle 2.x.x theme and how to make use of those settings within the CSS and layout files for your theme.&lt;br /&gt;
&lt;br /&gt;
This is a pretty advanced topic and will require that you have at least an intermediate knowledge of PHP, CSS, and development in general.&lt;br /&gt;
&lt;br /&gt;
==Before we begin==&lt;br /&gt;
[[Image:Theme.settings.page.03.png|350px|thumb|Our end goal. The settings page.]]&lt;br /&gt;
[[Image:Theme.settings.page.10.png|350px|thumb|And what it can do.]]&lt;br /&gt;
There is a huge body of knowledge that we must cover in following through this document and as such I think the best way to write this is as a tutorial.&lt;br /&gt;
&lt;br /&gt;
My intentions for this tutorial are to replicate the standard theme but with a settings page that allows the administrator to set a background colour, set a logo to use with the page, and probably several other minor settings to change the way in which the theme is displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will start this tutorial by creating a new theme which will be largely a copy/paste of the current standard theme. I expect that anyone working through this tutorial has previously read the tutorial I wrote on [[Themes 2.0 creating your first theme|creating your first theme]]. If you haven&#039;t go read it now because I&#039;m not going to go into much detail until we get to the actual process of customising the theme and introducing the settings page.&lt;br /&gt;
&lt;br /&gt;
So before we finally get this started please ensure you can check off everything on the following requirements list.&lt;br /&gt;
* Have a Moodle installation that has already been installed and configured and is ready to use.&lt;br /&gt;
* Have full read/write access to that installation.&lt;br /&gt;
* Be prepared to delete that installation at the end of this... we will destroy it!&lt;br /&gt;
* Have a development environment prepared and ready to use. This includes:&lt;br /&gt;
** Your favourite editor installed, running, and pointed at the themes directory of your installation.&lt;br /&gt;
** Your browser open and your site visible.&lt;br /&gt;
** A bottomless coffee pot... decaf won&#039;t help you with this one.&lt;br /&gt;
* Have set the following settings:&lt;br /&gt;
** &#039;&#039;&#039;themedesignermode&#039;&#039;&#039; if you don&#039;t know what this is please read the [[Themes 2.0 creating your first theme|creating your first theme]] tutorial.&lt;br /&gt;
** &#039;&#039;&#039;allowthemechangeonurl&#039;&#039;&#039; turn this on, it allows you to change themes on the URL and is very handy when developing themes. &#039;&#039;Site Administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Theme settings&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;langstringcache&#039;&#039;&#039; if you don&#039;t turn this off you won&#039;t see your strings when they are added. &#039;&#039;Site Administration &amp;gt; Language &amp;gt; Language settings&#039;&#039;&lt;br /&gt;
* And finally an insane ambition to create a customisable theme.&lt;br /&gt;
&lt;br /&gt;
For those interested the theme that I create throughout this tutorial can be downloaded from the forum post in which I announce this document: http://moodle.org/mod/forum/discuss.php?d=152053&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Our goals for this tutorial==&lt;br /&gt;
The following is just a list goals that I hope to achieve during this tutorial. They are laid out here so that I can easily refer back to them and so that you can easily find them.&lt;br /&gt;
# Create a new theme called &#039;&#039;&#039;demystified&#039;&#039;&#039; based upon the standard theme within Moodle 2.0.&lt;br /&gt;
# Make some minor changes to that theme to allow us to more easily see what is going on.&lt;br /&gt;
# Create a settings page for the demystified theme.&lt;br /&gt;
# Add several settings to our settings page.&lt;br /&gt;
# Use some of those settings to alter our CSS.&lt;br /&gt;
# Use the rest of those settings within our layout file..&lt;br /&gt;
# Discuss the good, the bad, and limits of what we have just created.&lt;br /&gt;
&lt;br /&gt;
So I can see you are all very excited about this point and that you would love to know what settings we are going to create; So here they are:&lt;br /&gt;
&lt;br /&gt;
A setting to ...&lt;br /&gt;
* change the background colour (CSS).&lt;br /&gt;
* set the path to an image that we will use as a logo on all pages (Layout files).&lt;br /&gt;
* override the width of the block regions (CSS).&lt;br /&gt;
* allow a note to be added to the footer of all pages (Layout files).&lt;br /&gt;
* allow custom CSS to be written to do anything the user wants. (CSS)&lt;br /&gt;
&lt;br /&gt;
==Creating the demystified theme==&lt;br /&gt;
Before we start here I want to remind you that I am going to look at this only briefly as I am making the assumption that you have read the [[Themes 2.0 creating your first theme|creating your first theme]] tutorial.&lt;br /&gt;
&lt;br /&gt;
Well lets get into it....&lt;br /&gt;
&lt;br /&gt;
The first thing we need to do is create a directory for our theme which we will call demystified. &lt;br /&gt;
&lt;br /&gt;
So within your Moodle directory create the following folder &#039;&#039;&#039;moodle/theme/demystified&#039;&#039;&#039;. At the same time you can also create the following files and folders which we will get to soon.&lt;br /&gt;
* The file &#039;&#039;&#039;moodle/theme/demystified/config.php&#039;&#039;&#039; for our config information.&lt;br /&gt;
* The directory &#039;&#039;&#039;moodle/theme/demystified/layout&#039;&#039;&#039; for our layout files.&lt;br /&gt;
* The directory &#039;&#039;&#039;moodle/theme/demystified/style&#039;&#039;&#039; for our css files.&lt;br /&gt;
* The file &#039;&#039;&#039;moodle/theme/demystified/style/core.css&#039;&#039;&#039; which will contain our special CSS.&lt;br /&gt;
&lt;br /&gt;
Next we will copy the layout files from the base theme to our new theme demystified. We are basing the demystified theme on the standard theme however that doesn&#039;t use it&#039;s own layout files it uses the base theme&#039;s layout files so those are the ones we want. &lt;br /&gt;
&lt;br /&gt;
The reason that we are coping these layout files is that later on in this tutorial we will be modifying them to make use of our new settings... so copy all of the layout files from &#039;&#039;&#039;moodle/theme/base/layout&#039;&#039;&#039; to &#039;&#039;&#039;moodle/theme/demystified/layout&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
There should be three files that you just copied:&lt;br /&gt;
# embedded.php&lt;br /&gt;
# frontpage.php&lt;br /&gt;
# general.php&lt;br /&gt;
&lt;br /&gt;
Now we need to populate demystified/config.php with the settings for our new theme. They are as follows:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;name = &#039;demystified&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Simply sets the name of our theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;parents = array(&#039;standard&#039;,&#039;base&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This theme is extending both the standard theme and the base theme. Remember when extending a theme you also need to extend its parents or things might not work correctly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;sheets = array(&#039;core&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This tells our theme that we want to use the file &#039;&#039;&#039;demystified/style/core.css&#039;&#039;&#039; with this theme.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;height:300px;overflow-y:scroll;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;layouts = array(&lt;br /&gt;
    // Most backwards compatible layout without the blocks - this is the layout used by default&lt;br /&gt;
    &#039;base&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Standard layout with blocks, this is recommended for most pages with general information&lt;br /&gt;
    &#039;standard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Main course page&lt;br /&gt;
    &#039;course&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;coursecategory&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // part of course, typical for modules - default page layout if $cm specified in require_login()&lt;br /&gt;
    &#039;incourse&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The site home page.&lt;br /&gt;
    &#039;frontpage&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Server administration scripts.&lt;br /&gt;
    &#039;admin&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // My dashboard page&lt;br /&gt;
    &#039;mydashboard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
    // My public page&lt;br /&gt;
    &#039;mypublic&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;login&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
    // Pages that appear in pop-up windows - no navigation, no blocks, no header.&lt;br /&gt;
    &#039;popup&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
    // No blocks and minimal footer - used for legacy frame layouts only!&lt;br /&gt;
    &#039;frametop&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible&lt;br /&gt;
    &#039;embedded&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Used during upgrade and install, and for the &#039;This site is undergoing maintenance&#039; message.&lt;br /&gt;
    // This must not have any blocks, and it is good idea if it does not have links to&lt;br /&gt;
    // other places - for example there should not be a home link in the footer...&lt;br /&gt;
    &#039;maintenance&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;noblocks&#039;=&amp;gt;true, &#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Now that all looks very complicated however its really not too bad as it is just copied from the base theme&#039;s config.php file. We can do this because we copied the layout files from the base theme to begin with and for the time being there are no changes that we wish to make. Simply open up &#039;&#039;&#039;theme/base/config.php&#039;&#039;&#039; and copy the layouts from there.&lt;br /&gt;
&lt;br /&gt;
And that is it. The config.php file for our demystified theme is complete. The full source is shown below:&lt;br /&gt;
&amp;lt;div style=&amp;quot;height:300px;overflow-y:scroll;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// This file is part of Moodle - http://moodle.org/&lt;br /&gt;
//&lt;br /&gt;
// Moodle is free software: you can redistribute it and/or modify&lt;br /&gt;
// it under the terms of the GNU General Public License as published by&lt;br /&gt;
// the Free Software Foundation, either version 3 of the License, or&lt;br /&gt;
// (at your option) any later version.&lt;br /&gt;
//&lt;br /&gt;
// Moodle is distributed in the hope that it will be useful,&lt;br /&gt;
// but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
// GNU General Public License for more details.&lt;br /&gt;
//&lt;br /&gt;
// You should have received a copy of the GNU General Public License&lt;br /&gt;
// along with Moodle.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * The demystified theme config file&lt;br /&gt;
 *&lt;br /&gt;
 * This theme was created to document the process of adding a settings page to a theme&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright 2010 Sam Hemelryk&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// The name of our theme&lt;br /&gt;
$THEME-&amp;gt;name = &#039;demystified&#039;;&lt;br /&gt;
&lt;br /&gt;
// The other themes this theme extends&lt;br /&gt;
$THEME-&amp;gt;parents = array(&#039;standard&#039;,&#039;base&#039;);&lt;br /&gt;
&lt;br /&gt;
// The CSS files this theme uses (located in the style directory)&lt;br /&gt;
$THEME-&amp;gt;sheets = array(&#039;core&#039;);&lt;br /&gt;
&lt;br /&gt;
// The layout definitions for this theme&lt;br /&gt;
$THEME-&amp;gt;layouts = array(&lt;br /&gt;
    // Most backwards compatible layout without the blocks - this is the layout used by default&lt;br /&gt;
    &#039;base&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
    ),&lt;br /&gt;
    // Standard layout with blocks, this is recommended for most pages with general information&lt;br /&gt;
    &#039;standard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Main course page&lt;br /&gt;
    &#039;course&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;coursecategory&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // part of course, typical for modules - default page layout if $cm specified in require_login()&lt;br /&gt;
    &#039;incourse&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // The site home page.&lt;br /&gt;
    &#039;frontpage&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;frontpage.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // Server administration scripts.&lt;br /&gt;
    &#039;admin&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-pre&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    // My dashboard page&lt;br /&gt;
    &#039;mydashboard&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
    // My public page&lt;br /&gt;
    &#039;mypublic&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(&#039;side-pre&#039;, &#039;side-post&#039;),&lt;br /&gt;
        &#039;defaultregion&#039; =&amp;gt; &#039;side-post&#039;,&lt;br /&gt;
    ),&lt;br /&gt;
    &#039;login&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;langmenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
    // Pages that appear in pop-up windows - no navigation, no blocks, no header.&lt;br /&gt;
    &#039;popup&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
    // No blocks and minimal footer - used for legacy frame layouts only!&lt;br /&gt;
    &#039;frametop&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible&lt;br /&gt;
    &#039;embedded&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;embedded.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
    // Used during upgrade and install, and for the &#039;This site is undergoing maintenance&#039; message.&lt;br /&gt;
    // This must not have any blocks, and it is good idea if it does not have links to&lt;br /&gt;
    // other places - for example there should not be a home link in the footer...&lt;br /&gt;
    &#039;maintenance&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;file&#039; =&amp;gt; &#039;general.php&#039;,&lt;br /&gt;
        &#039;regions&#039; =&amp;gt; array(),&lt;br /&gt;
        &#039;options&#039; =&amp;gt; array(&#039;noblocks&#039;=&amp;gt;true, &#039;nofooter&#039;=&amp;gt;true, &#039;nonavbar&#039;=&amp;gt;true, &#039;nocustommenu&#039;=&amp;gt;true),&lt;br /&gt;
    ),&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows both the directory structure we have now created and the theme presently.&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.01.png]]&lt;br /&gt;
&lt;br /&gt;
To view the theme so far open you browser and enter the URL of your site followed by &#039;&#039;&#039;?theme=demystified&#039;&#039;&#039;. You should see the theme that we just created which will look exactly like the base standard theme.&lt;br /&gt;
&lt;br /&gt;
The final thing that we want to do is add a little bit of CSS to the demystified theme that will both visually set this theme apart from the standard theme and second build a the base which our settings can later extend.&lt;br /&gt;
&lt;br /&gt;
I added the following snippet of CSS to the file &#039;&#039;&#039;demystified/style/core.css&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
html {background-color:#DDD;}&lt;br /&gt;
body {margin:30px;padding:0;border:1px solid #333;border-width:0 10px 0 10px;background-color:#333;}&lt;br /&gt;
body #page {background-color:#FFF;position:relative;top:-10px;}&lt;br /&gt;
.block .header {background-image:none;background-color:#0C5CAC;border:1px solid #0C5CAC;color:#FFF;}&lt;br /&gt;
.block {border-color:#4BA7FF;background-color:#DDEEFF;}&lt;br /&gt;
.block .content {background-color:#F1F8FF;}&lt;br /&gt;
a:link,&lt;br /&gt;
a:visited {color:#0C5CAC;}&lt;br /&gt;
a:hover {color:#C77500;}&lt;br /&gt;
#page #page-header {background-color:#0C5CAC;margin:0;padding:0;width:100%;color:#fff;}&lt;br /&gt;
#page #page-header a:link, #page #page-header a:visited {color:#FFAC02}&lt;br /&gt;
#page #page-header .navbar, #page #page-header .navbar a:link, #page #page-header .navbar a:visited {color:#0C5CAC;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CSS that we have just added to our theme sets a couple of colours on the front page. Presently this is the only CSS I will add, I know it isn&#039;t complete by any means but it achieves it&#039;s purpose as the screenshot below illustrates.&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.02.png|715px|thumb|left|The newly styles demystified theme]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And with that I will move on to the real purpose of this tutorial, creating the settings page&lt;br /&gt;
&lt;br /&gt;
==Setting up the settings page==&lt;br /&gt;
With the demystified theme set up it is time to create the settings page. This is where the real PHP fun begins.&lt;br /&gt;
&lt;br /&gt;
For those of you who happen to be familiar with development of modules, blocks or other plugin types you have probably encountered settings pages before and this is not going to be any different.&lt;br /&gt;
&lt;br /&gt;
However for those who haven&#039;t which I imagine is most of you this is going to be quite a challenge. I will try to walk through this step by step however if at any point you get stuck don&#039;t hesitate to ask in the forums as I imagine you will get a speedy response.&lt;br /&gt;
&lt;br /&gt;
===How settings pages work in Moodle===&lt;br /&gt;
Settings pages can be used by nearly every plugin type, of which themes is of course one. The way in which it all works isn&#039;t too tricky to understand. &lt;br /&gt;
&lt;br /&gt;
All of the settings for Moodle can be configured through the administrator interfaces when logged in. I am sure that everyone here has seen those pages and has changed a setting or two before so you will all know what I am talking about. Well the settings page for a theme is no different. It will be shown in the administration pages tree under &#039;&#039;&#039;Appearance &amp;gt; Themes&#039;&#039;&#039; and all we have to do is tell Moodle what settings there are.&lt;br /&gt;
&lt;br /&gt;
This is done by creating a settings.php file within our theme into which we will add code that tells Moodle about the settings we want to add/use.&lt;br /&gt;
&lt;br /&gt;
When telling Moodle about each setting we are simply creating a new &#039;&#039;admin_setting&#039;&#039; instance of the type we want and the properties we want and then adding it to our settings page.&lt;br /&gt;
&lt;br /&gt;
There is really not much more too it at this level. Things can get very complex very fast so the best thing we can do now is start creating our settings.php file for the demystified theme and see where it leads us.&lt;br /&gt;
&lt;br /&gt;
===Creating the settings page===&lt;br /&gt;
So as mentioned before we need a settings.php file which we will create now. To begin with create the file &#039;&#039;&#039;theme/demystified/settings.php&#039;&#039;&#039; and open it in your favourite editor so its ready to go.&lt;br /&gt;
&lt;br /&gt;
Before we start adding code however lets just remember the settings that we want to create:&lt;br /&gt;
* change the background colour (CSS).&lt;br /&gt;
* set the path to an image that we will use as a logo on all pages (Layout files).&lt;br /&gt;
* override the width of the block regions (CSS).&lt;br /&gt;
* allow a note to be added to the footer of all pages (Layout files).&lt;br /&gt;
* allow custom CSS to be written to do anything the user wants. (CSS)&lt;br /&gt;
&lt;br /&gt;
Alright.&lt;br /&gt;
&lt;br /&gt;
Now thinking about this the first setting is as basic as it gets, all we need is a text box that the user can type a colour into.&lt;br /&gt;
&lt;br /&gt;
The second is to allow a logo to be used in the header of each page. What we want here is a path but should it be a physical path e.g. C:/path/to/image.png or should it be a web path e.g. &amp;lt;nowiki&amp;gt;http://mysite.com/path/to/image.png&amp;lt;/nowiki&amp;gt;?&lt;br /&gt;
For the purpose of this tutorial I am going to go with a web path because it is going to be easier to code and will hopefully be a little easier to understand to begin with.&lt;br /&gt;
&lt;br /&gt;
The third setting is a little more complex. For this I want a drop down box with some specific widths that the administrator can select.&lt;br /&gt;
&lt;br /&gt;
The forth and the fifth settings are both pretty straight forward, there we want a textarea into which the user can enter what ever they want and we will do something useful with it.&lt;br /&gt;
&lt;br /&gt;
Now that we have an understanding about the settings we wish to define pull up your editor and lets start coding....&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Settings for the demystified theme&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
$temp = new admin_settingpage(&#039;theme_demystified&#039;, get_string(&#039;configtitle&#039;,&#039;theme_demystified&#039;));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This is the first bit of code we must enter, the first line is of course just the opening php tag, secondly we have a comment that describes this file, and then we get create a new &#039;&#039;&#039;admin_settingspage object&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This admin_settingspage object that we have just created is a representation of our settings page and is the what we add our new settings to. When creating it we give it two arguments, first the name of the page which is in this case &#039;&#039;&#039;theme_&#039;&#039;themename&#039;&#039;&#039;&#039;&#039; and the title for the page which we get with the get_string method.&lt;br /&gt;
&lt;br /&gt;
At the moment I&#039;m not going to worry about adding the string, we will get to that later once we have defined all of our settings.&lt;br /&gt;
&lt;br /&gt;
====Background colour====&lt;br /&gt;
&lt;br /&gt;
With the page now created as &#039;&#039;$temp&#039;&#039; lets add our first setting: Background colour.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Background colour setting&lt;br /&gt;
$name = &#039;theme_demystified/backgroundcolor&#039;;&lt;br /&gt;
$title = get_string(&#039;backgroundcolor&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;backgroundcolordesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$default = &#039;#DDD&#039;;&lt;br /&gt;
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_CLEAN, 12);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Thankfully this isn&#039;t as difficult as it initially looks.&lt;br /&gt;
&lt;br /&gt;
The first line of code is creating a variable for the name of the background colour setting. In this case it is &#039;&#039;&#039;theme_demystified/backgroundcolor&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The name is very important, for the setting to be usable we have to follow a strict naming convention. &#039;&#039;&#039;theme_&#039;&#039;themename&#039;&#039;/&#039;&#039;settingname&#039;&#039;&#039;&#039;&#039; where &#039;&#039;&#039;&#039;&#039;themename&#039;&#039;&#039;&#039;&#039; is the name of the theme the setting belongs to and &#039;&#039;&#039;&#039;&#039;settingname&#039;&#039;&#039;&#039;&#039; is the name for the setting by which we will use it.&lt;br /&gt;
&lt;br /&gt;
The second line of code creates a variable that contains the title of the setting. This is what the user sees to the right of the setting on the settings page and should be a short description of the setting. Here we are again using the &#039;&#039;get_string&#039;&#039; method so we will need to remember to add that string later on.&lt;br /&gt;
&lt;br /&gt;
The third line of code sets the description. This should describe what the setting does or how it works and again we will use the get_string method.&lt;br /&gt;
&lt;br /&gt;
The fourth line creates a variable that will be used as the default value for the setting. Because this setting is a colour we want an HTML colour to be the default value.&lt;br /&gt;
&lt;br /&gt;
The fifth line is where we put it all together. Here we create a new &#039;&#039;&#039;admin_setting_configtext&#039;&#039;&#039; object. This object will represent the background colour setting.&lt;br /&gt;
&lt;br /&gt;
When we create it we need to give it 6 different things.&lt;br /&gt;
# The name of the setting. In this case we have a variable &#039;&#039;&#039;$name&#039;&#039;&#039;.&lt;br /&gt;
# The title for this setting. We used the variable &#039;&#039;&#039;$title&#039;&#039;&#039;.&lt;br /&gt;
# The description of the setting &#039;&#039;&#039;$description&#039;&#039;&#039;.&lt;br /&gt;
# The default value for the setting. &#039;&#039;&#039;$default&#039;&#039;&#039; is the variable this.&lt;br /&gt;
# The type of value we want the user to enter. For this we have used PARAM_CLEAN which tells Moodle to get rid of any nasties from what the user enters.&lt;br /&gt;
# The size of the field. In our case 12 characters will be plenty.&lt;br /&gt;
&lt;br /&gt;
The sixth and final line of code adds our newly created setting to the administration page we created earlier.&lt;br /&gt;
&lt;br /&gt;
That is it we have successfully created and added our first setting, however there are several more to settings to do, and there are a couple of important things that you need to be aware of before we move on.&lt;br /&gt;
&lt;br /&gt;
First: There are several different types of settings that you can create and add to a page, and each one may differ in what they need you to give them. In this case it was name, title, description, default, type, and size. However other settings will likely require different things. Smart editors like Netbeans or Eclipse can tell you what is required, otherwise you will need to research it.&lt;br /&gt;
&lt;br /&gt;
Second: Normally settings are declared on one line as follows:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$temp-&amp;gt;add(new admin_setting_configtext(&#039;theme_demystified/backgroundcolor&#039;, get_string(&#039;backgroundcolor&#039;,&#039;theme_demystified&#039;), get_string(&#039;backgroundcolordesc&#039;, &#039;theme_demystified&#039;), &#039;#DDD&#039;, PARAM_CLEAN, 12));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
While this is structurally identical as all we have done is move everything onto one line and do away with the variables it is a little harder to read when you are learning all of this.&lt;br /&gt;
&lt;br /&gt;
====The logo file====&lt;br /&gt;
Time to create the second setting that will allow the user to enter a URL to an image they wish to use as the logo on their site.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Logo file setting&lt;br /&gt;
$name = &#039;theme_demystified/logo&#039;;&lt;br /&gt;
$title = get_string(&#039;logo&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;logodesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_configtext($name, $title, $description, &#039;&#039;, PARAM_URL);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The first thing that you will notice about this setting that it is very similar to the first setting, in fact all we have changed is the name, title, description, and default value. We have however changed the value type from PARAM_CLEAN to PARAM_URL, this makes sure the user enters a URL. You will also notice that for this one we don&#039;t set a size for the field as we have no idea how long the URL will be.&lt;br /&gt;
&lt;br /&gt;
====Block region width====&lt;br /&gt;
The third setting should allow the user to set a width for the block regions that will be used as columns.&lt;br /&gt;
&lt;br /&gt;
For this setting I want to do something a little different from the previous two, here I want to use a select box so that the user selects a width for the column from a list I provide.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Block region width&lt;br /&gt;
$name = &#039;theme_demystified/regionwidth&#039;;&lt;br /&gt;
$title = get_string(&#039;regionwidth&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;regionwidthdesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$default = 200;&lt;br /&gt;
$choices = array(150=&amp;gt;&#039;150px&#039;, 170=&amp;gt;&#039;170px&#039;, 200=&amp;gt;&#039;200px&#039;, 240=&amp;gt;&#039;240px&#039;, 290=&amp;gt;&#039;290px&#039;, 350=&amp;gt;&#039;350px&#039;, 420=&amp;gt;&#039;420px&#039;);&lt;br /&gt;
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
So looking at the code: The first four lines you will recognise. $name, $title, $description, and $default are all being set.&lt;br /&gt;
&lt;br /&gt;
The fifth line of code however introduces something new. Of course in order to have a select box we have to have options, in this case we have an array of options stored in the variable $choices.&lt;br /&gt;
&lt;br /&gt;
The array of options is constructed of a collection of &#039;&#039;&#039;&#039;&#039;value&#039;&#039;&#039; =&amp;gt; &#039;&#039;&#039;label&#039;&#039;&#039;&#039;&#039; pairs. Notice how we don&#039;t add &#039;&#039;&#039;px&#039;&#039;&#039; to the value. This is is very intentional as later on I need to do a little bit of math with that value so we need it to be a number.&lt;br /&gt;
&lt;br /&gt;
The lines after should look familiar again, the only difference being that instead of a &#039;&#039;admin_setting_configtext&#039;&#039; setting we have created a &#039;&#039;admin_setting_configselect&#039;&#039; for which we must give the choices for the select box as the fifth argument.&lt;br /&gt;
&lt;br /&gt;
Woohoo, we&#039;ve just created our first select box setting.&lt;br /&gt;
&lt;br /&gt;
====Foot note====&lt;br /&gt;
Now to create the foot note setting. Here we want the user to be able to enter some arbitrary text that will be used in the footer of the page. For this I want the user to be able to enter some HTML so I will create an editor setting.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Foot note setting&lt;br /&gt;
$name = &#039;theme_demystified/footnote&#039;;&lt;br /&gt;
$title = get_string(&#039;footnote&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;footnotedesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_confightmleditor($name, $title, $description, &#039;&#039;);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
How simple is that!&lt;br /&gt;
&lt;br /&gt;
It is just about identical to the first two settings except that for this we have created a &#039;&#039;admin_setting_confightmleditor&#039;&#039; setting rather than a text setting.&lt;br /&gt;
&lt;br /&gt;
Note: You can also set the columns and rows for the editor setting using the fifth and sixth arguments.&lt;br /&gt;
&lt;br /&gt;
====Custom CSS====&lt;br /&gt;
The final setting is to allow the user to add some custom CSS to the theme that will be used on every page. I want this to be a plain textarea into which the user can enter CSS.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Custom CSS file&lt;br /&gt;
$name = &#039;theme_demystified/customcss&#039;;&lt;br /&gt;
$title = get_string(&#039;customcss&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;customcssdesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_configtextarea($name, $title, $description, &#039;&#039;);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Just like the editor or text settings. It&#039;s getting very easy now!&lt;br /&gt;
&lt;br /&gt;
====Finishing settings.php====&lt;br /&gt;
With all of our settings defined and added to our page that we created right at the beginning it is time to finish it all off.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Add our page to the structure of the admin tree&lt;br /&gt;
$ADMIN-&amp;gt;add(&#039;themes&#039;, $temp);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The above line of code is the final line for the page. It is adding the page that we have created &#039;&#039;&#039;$temp&#039;&#039;&#039; to the admin tree structure. In this case it is adding it to the themes branch.&lt;br /&gt;
&lt;br /&gt;
The following is the completed source for our settings.php ..... for your copy/paste pleasure.&lt;br /&gt;
&amp;lt;div style=&#039;height:300px;overflow:auto;&#039;&amp;gt;&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Settings for the demystified theme&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// Create our admin page&lt;br /&gt;
$temp = new admin_settingpage(&#039;theme_demystified&#039;, get_string(&#039;configtitle&#039;,&#039;theme_demystified&#039;));&lt;br /&gt;
&lt;br /&gt;
// Background colour setting&lt;br /&gt;
$name = &#039;theme_demystified/backgroundcolor&#039;;&lt;br /&gt;
$title = get_string(&#039;backgroundcolor&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;backgroundcolordesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$default = &#039;#DDD&#039;;&lt;br /&gt;
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_CLEAN, 12);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&lt;br /&gt;
// Logo file setting&lt;br /&gt;
$name = &#039;theme_demystified/logo&#039;;&lt;br /&gt;
$title = get_string(&#039;logo&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;logodesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_configtext($name, $title, $description, &#039;&#039;, PARAM_URL);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&lt;br /&gt;
// Block region width&lt;br /&gt;
$name = &#039;theme_demystified/regionwidth&#039;;&lt;br /&gt;
$title = get_string(&#039;regionwidth&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;regionwidthdesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$default = 200;&lt;br /&gt;
$choices = array(150=&amp;gt;&#039;150px&#039;, 170=&amp;gt;&#039;170px&#039;, 200=&amp;gt;&#039;200px&#039;, 240=&amp;gt;&#039;240px&#039;, 290=&amp;gt;&#039;290px&#039;, 350=&amp;gt;&#039;350px&#039;, 420=&amp;gt;&#039;420px&#039;);&lt;br /&gt;
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&lt;br /&gt;
// Foot note setting&lt;br /&gt;
$name = &#039;theme_demystified/footnote&#039;;&lt;br /&gt;
$title = get_string(&#039;footnote&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;footnotedesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_confightmleditor($name, $title, $description, &#039;&#039;);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&lt;br /&gt;
// Custom CSS file&lt;br /&gt;
$name = &#039;theme_demystified/customcss&#039;;&lt;br /&gt;
$title = get_string(&#039;customcss&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;customcssdesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$setting = new admin_setting_configtextarea($name, $title, $description, &#039;&#039;);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&lt;br /&gt;
// Add our page to the structure of the admin tree&lt;br /&gt;
$ADMIN-&amp;gt;add(&#039;themes&#039;, $temp);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Creating a language file and adding our strings===&lt;br /&gt;
As I&#039;m sure none of you have forgotten, throughout the creation of the our settings.php page, we used a lot of strings that I mentioned we would set later on. Well now is the time to set those strings.&lt;br /&gt;
&lt;br /&gt;
First up create the following directories and file for our language strings:&lt;br /&gt;
* Directory &#039;&#039;&#039;theme/demystified/lang&#039;&#039;&#039;&lt;br /&gt;
* Directory &#039;&#039;&#039;theme/demystified/lang/en&#039;&#039;&#039;&lt;br /&gt;
* File &#039;&#039;&#039;theme/demystified/lang/theme_demystified.php&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
What we have created here is the required structure for Moodle to start looking for language strings.&lt;br /&gt;
&lt;br /&gt;
First Moodle locates the lang directory, once found it looks within that directory for another directory that uses the character code for the language the user has selected, by default this is &#039;&#039;&#039;en&#039;&#039;&#039; for English. Once that is found it looks for the appropriate language file, in this case &#039;&#039;&#039;theme_demystified.php&#039;&#039;&#039; from which it will load all language strings for our theme.&lt;br /&gt;
&lt;br /&gt;
If English isn&#039;t your chosen language simply replace the &#039;&#039;en&#039;&#039; directory with one that uses your chosen languages character code (two letters).&lt;br /&gt;
&lt;br /&gt;
We can now add our language strings to &#039;&#039;&#039;theme/demystified/lang/theme_demystified.php&#039;&#039;&#039;. Copy and paste the following lines of PHP into this file.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * This file contains the strings used by the demystified theme&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
$string[&#039;backgroundcolor&#039;] = &#039;Background colour&#039;;&lt;br /&gt;
$string[&#039;backgroundcolordesc&#039;] = &#039;This sets the background colour for the theme.&#039;;&lt;br /&gt;
$string[&#039;configtitle&#039;] = &#039;Demystified theme&#039;;&lt;br /&gt;
$string[&#039;customcss&#039;] = &#039;Custom CSS&#039;;&lt;br /&gt;
$string[&#039;customcssdesc&#039;] = &#039;Any CSS you enter here will be added to every page allowing your to easily customise this theme.&#039;;&lt;br /&gt;
$string[&#039;footnote&#039;] = &#039;Footnote&#039;;&lt;br /&gt;
$string[&#039;footnotedesc&#039;] = &#039;The content from this textarea will be displayed in the footer of every page.&#039;;&lt;br /&gt;
$string[&#039;logo&#039;] = &#039;Logo&#039;;&lt;br /&gt;
$string[&#039;logodesc&#039;] = &#039;Enter the URL to an image to use as the logo for this site. Should be http://www.yoursite.com/path/to/logo.png&#039;;&lt;br /&gt;
$string[&#039;pluginname&#039;] = &#039;Demystified&#039;;&lt;br /&gt;
$string[&#039;regionwidth&#039;] = &#039;Column width&#039;;&lt;br /&gt;
$string[&#039;regionwidthdesc&#039;] = &#039;This sets the width of the two block regions that form the left and right columns.&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above lines of code I have added an entry for each language string we used within &#039;&#039;settings.php&#039;&#039;. When adding language strings like this make sure you use single quotes and try to keep things alphabetical - it helps greatly when managing strings.&lt;br /&gt;
&lt;br /&gt;
Now when we view the settings page there will not be any errors or strings missing.&lt;br /&gt;
&lt;br /&gt;
===Having a look at what we have created===&lt;br /&gt;
Now that we have created our settings page (settings.php) and added all of the language strings it is time to have a look at things in your browser.&lt;br /&gt;
&lt;br /&gt;
Open your browser and enter the URL to your site. When you arrive at your site login as an administrator.&lt;br /&gt;
&lt;br /&gt;
If you are not redirected to view the new settings change your URL to &amp;lt;nowiki&amp;gt;http://www.yoursite.com/admin/&amp;lt;/nowiki&amp;gt; and your will see a screen to set the new theme settings we have just created. This lets us know that everything has worked correctly.&lt;br /&gt;
&lt;br /&gt;
At any point now you are able to log in as administrator and within the settings block browse to &#039;&#039;&#039;Site administration &amp;gt; Appearance &amp;gt; Themes &amp;gt; Demystified theme&#039;&#039;&#039; to change those settings.&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows you what you should see at this point:&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.03.png|715px|thumb|left|The settings page we just created]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using the settings in CSS==&lt;br /&gt;
With the settings page now created and operational it is time to make use of our new settings. The settings that we want to use within our CSS is as follows:&lt;br /&gt;
&lt;br /&gt;
; backgroundcolor : Will be used to set the background colour in CSS.&lt;br /&gt;
; regionwidth : Will be the width of the column for CSS.&lt;br /&gt;
; customcss : Will be some custom CSS to add to our stylesheet.&lt;br /&gt;
&lt;br /&gt;
At this point those names are the names we used for our setting with the slash and everything before it having been removed.&lt;br /&gt;
&lt;br /&gt;
Before we start tearing into some code it is important that we have a look at what we are going to do and how we are going to go about it.&lt;br /&gt;
&lt;br /&gt;
===How it all works within Moodle===&lt;br /&gt;
The first thing to understand is that while Moodle allows you to create a settings page and automates it inclusion and management right into the administration interfaces there is no smart equivalent for using the settings. This is simply because there is no way to predict how people will want to use the settings.&lt;br /&gt;
&lt;br /&gt;
However don&#039;t think of this as a disadvantage, in fact it is quite the contrary. Although we can&#039;t just &#039;&#039;use&#039;&#039; our settings we can take full control over how and where we use them. It means it will take a little more code but in the end that will work to our advantage as we can do anything we want.&lt;br /&gt;
&lt;br /&gt;
Moodle does help us out a little but not in an obvious way. The first thing that Moodle does is look for a config variable &#039;&#039;&#039;csspostprocess&#039;&#039;&#039; that should be the name of a function which we want called to make any changes to the CSS after it has been prepared.&lt;br /&gt;
&lt;br /&gt;
The second thing Moodle does is include a lib.php from the theme&#039;s directory if one exists (also for the themes the current theme extends.) which ensures that as long as we write our code within &#039;&#039;&#039;theme/demystified/lib.php&#039;&#039;&#039; it will be included and ready to be used.&lt;br /&gt;
&lt;br /&gt;
The third and final thing Moodle does that will help us out here is ensure that by the time any of code is ready to execute the settings have been prepared and are ready to be used within a theme config object which is passed into our &#039;&#039;csspostprocess&#039;&#039; function.&lt;br /&gt;
&lt;br /&gt;
===Our plan===&lt;br /&gt;
As you have already probably guessed we will need to create a function to make the changes to the CSS that we want. We will then set the theme config option &#039;&#039;&#039;$THEME-&amp;gt;csspostprocess&#039;&#039;&#039; to the name of our function.&lt;br /&gt;
&lt;br /&gt;
By doing this when Moodle builds the CSS file it will call our function afterwards with the CSS and the theme object that contains our setting.&lt;br /&gt;
&lt;br /&gt;
Now we know that we will use the &#039;&#039;csspostprocess&#039;&#039; function but how are we going to change the CSS, we could get the function to add CSS, or we could get the function to replace something within the CSS. My personal preference is to replace something within the CSS, just like what is happening with images. If you want to use an image within CSS you would write &amp;lt;nowiki&amp;gt;[[pix:theme|imagename]]&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For settings I am going to use &amp;lt;nowiki&amp;gt;[[setting:settingname]]&amp;lt;/nowiki&amp;gt;, this way it looks a bit like something you are already familiar with.&lt;br /&gt;
&lt;br /&gt;
What we need to decide upon next is the best way in which to replace our settings tag with the settings that the user has set.&lt;br /&gt;
&lt;br /&gt;
There are two immediate options available to us:&lt;br /&gt;
# Make the &#039;&#039;csspostprocess&#039;&#039; function do all the work.&lt;br /&gt;
# Make the &#039;&#039;csspostprocess&#039;&#039; function call a separate function for each setting.&lt;br /&gt;
Solution 1 might sound like the simplest however it is going to result in a &#039;&#039;&#039;VERY&#039;&#039;&#039; complex function. Remember the user might have left settings blank or entered something that wouldn&#039;t be valid so we would need to make the sure there is some validation and a good default.&lt;br /&gt;
Because of this I think that solution 2 is the better solution.&lt;br /&gt;
&lt;br /&gt;
So we are going to need a &#039;&#039;csspostprocess&#039;&#039; function and then a function for each of the three settings we have that will do the replacements.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// This is our css post process function&lt;br /&gt;
function demystified_process_css($css, $theme) {};&lt;br /&gt;
// This replaces [[setting:backgroundcolor]] with the background colour&lt;br /&gt;
function demystified_set_backgroundcolor($css, $backgroundcolor) {};&lt;br /&gt;
// This replaces [[setting:regionwidth]] with the correct region width&lt;br /&gt;
function demystified_set_regionwidth() {$css, $regionwidth};&lt;br /&gt;
// This replaces [[setting:customcss]] with the custom css&lt;br /&gt;
function demystified_set_customcss() {$css, $customcss};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you should note about the above functions is that they all start with the theme&#039;s name. This is required to ensure that the functions are named uniquely as it is VERY unlikely that someone has already created these functions.&lt;br /&gt;
&lt;br /&gt;
So with our plan set out lets start writing the code.&lt;br /&gt;
&lt;br /&gt;
===Writing the code===&lt;br /&gt;
The very first thing that we need to do is create a lib.php for our theme into which our css processing functions are going to go. So please at this point create &#039;&#039;&#039;theme/demystified/lib.php&#039;&#039;&#039; and open it in your editor ready to go.&lt;br /&gt;
&lt;br /&gt;
The first bit of code we have to write is the function that will be called by Moodle to do the processing &#039;&#039;&#039;demystified_process_css&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Before we start out please remember that the wonderful thing about coding is that there is any number of solutions to a problem. The solutions that you are seeing here in this tutorial are solutions that I have come up with to meet fulfil the needs of the tutorial without being so complex that they are hard to understand. This probably isn&#039;t how I would go about it normally but this is a little easier to understand for those who aren&#039;t overly familiar with PHP and object orientation.&lt;br /&gt;
&lt;br /&gt;
====The function: demystified_process_css====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function demystified_process_css($css, $theme) {&lt;br /&gt;
&lt;br /&gt;
    if (!empty($theme-&amp;gt;settings-&amp;gt;backgroundcolor)) {&lt;br /&gt;
        $backgroundcolor = $theme-&amp;gt;settings-&amp;gt;backgroundcolor;&lt;br /&gt;
    } else {&lt;br /&gt;
        $backgroundcolor = null;&lt;br /&gt;
    }&lt;br /&gt;
    $css = demystified_set_backgroundcolor($css, $backgroundcolor);&lt;br /&gt;
&lt;br /&gt;
    if (!empty($theme-&amp;gt;settings-&amp;gt;regionwidth)) {&lt;br /&gt;
        $regionwidth = $theme-&amp;gt;settings-&amp;gt;regionwidth;&lt;br /&gt;
    } else {&lt;br /&gt;
        $regionwidth = null;&lt;br /&gt;
    }&lt;br /&gt;
    $css = demystified_set_regionwidth($css, $regionwidth);&lt;br /&gt;
&lt;br /&gt;
    if (!empty($theme-&amp;gt;settings-&amp;gt;customcss)) {&lt;br /&gt;
        $customcss = $theme-&amp;gt;settings-&amp;gt;customcss;&lt;br /&gt;
    } else {&lt;br /&gt;
        $customcss = null;&lt;br /&gt;
    }&lt;br /&gt;
    $css = demystified_set_customcss($css, $customcss);&lt;br /&gt;
&lt;br /&gt;
    return $css;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So lets look at the things that make up this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function demystified_process_css($css, $theme) {&lt;br /&gt;
    //.....&lt;br /&gt;
    return $css&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This of course is the function declaration. &lt;br /&gt;
&lt;br /&gt;
The function gets given two variables, the first &#039;&#039;&#039;$css&#039;&#039;&#039; is a pile of CSS as one big string, and the second is the theme object &#039;&#039;&#039;$theme&#039;&#039;&#039; that contains all of the configuration, options, and settings for our theme.&lt;br /&gt;
&lt;br /&gt;
It then returns the &#039;&#039;$css&#039;&#039; variable, essentially returning the modified CSS.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    //...&lt;br /&gt;
    if (!empty($theme-&amp;gt;settings-&amp;gt;backgroundcolor)) {&lt;br /&gt;
        $backgroundcolor = $theme-&amp;gt;settings-&amp;gt;backgroundcolor;&lt;br /&gt;
    } else {&lt;br /&gt;
        $backgroundcolor = null;&lt;br /&gt;
    }&lt;br /&gt;
    $css = demystified_set_backgroundcolor($css, $backgroundcolor);&lt;br /&gt;
    //...&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we are processing our first setting &#039;&#039;backgroundcolor&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The first thing that we need to do is check whether it has been set and whether it has a value. If it has then we store that value in &#039;&#039;&#039;$backgroundcolor&#039;&#039;&#039;. It is doesn&#039;t have a value then we set &#039;&#039;$backgroundcolor&#039;&#039; to null. This ensures that &#039;&#039;$backgroundcolor&#039;&#039; is set because if it isn&#039;t then you are going to get a notice (if you have debugging on).&lt;br /&gt;
&lt;br /&gt;
The final line of this block calls the function &#039;&#039;&#039;demystified_set_backgroundcolor&#039;&#039;&#039;. We haven&#039;t written this function yet but we will shortly. When we call it we give it the &#039;&#039;$css&#039;&#039; variable that contains all of the CSS and we give it the background colour variable &#039;&#039;$backgroundcolor&#039;&#039;. Once this function is finished it returns the &#039;&#039;$css&#039;&#039; variable with all of the changes made much like how our css processing function works.&lt;br /&gt;
&lt;br /&gt;
What you should also note about this code is this:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$theme-&amp;gt;settings-&amp;gt;backgroundcolor&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
As mentioned earlier &#039;&#039;$theme&#039;&#039; is an object that contains all of the configuration and settings for our theme. The &#039;&#039;$theme&#039;&#039; object has a $settings property which contains all of the settings for our theme, and finally the settings property contains a variable backgroundcolor that is the value the user entered for that setting. That is how we get a settings value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (!empty($theme-&amp;gt;settings-&amp;gt;regionwidth)) {&lt;br /&gt;
    $regionwidth = $theme-&amp;gt;settings-&amp;gt;regionwidth;&lt;br /&gt;
} else {&lt;br /&gt;
    $regionwidth = null;&lt;br /&gt;
}&lt;br /&gt;
$css = demystified_set_regionwidth($css, $regionwidth);&lt;br /&gt;
&lt;br /&gt;
if (!empty($theme-&amp;gt;settings-&amp;gt;customcss)) {&lt;br /&gt;
    $customcss = $theme-&amp;gt;settings-&amp;gt;customcss;&lt;br /&gt;
} else {&lt;br /&gt;
    $customcss = null;&lt;br /&gt;
}&lt;br /&gt;
$css = demystified_set_customcss($css, $customcss);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These two routines are nearly identical to the routine above. For both the regionwidth and the customcss we make sure it has a value and then store it in a variable. We then call the relevant function to make the changes for that setting.&lt;br /&gt;
&lt;br /&gt;
Now that we have the general processing function it is time to write the three functions we have used but not written, &#039;&#039;demystified_set_backgroundcolor&#039;&#039;, &#039;&#039;demystified_set_regionwidth&#039;&#039;, &#039;&#039;demystified_set_customcss&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
====The function: demystified_set_backgroundcolor====&lt;br /&gt;
&lt;br /&gt;
First up demystified_set_backgroundcolor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Sets the background colour variable in CSS&lt;br /&gt;
 *&lt;br /&gt;
 * @param string $css&lt;br /&gt;
 * @param mixed $backgroundcolor&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function demystified_set_backgroundcolor($css, $backgroundcolor) {&lt;br /&gt;
    $tag = &#039;[[setting:backgroundcolor]]&#039;;&lt;br /&gt;
    $replacement = $backgroundcolor;&lt;br /&gt;
    if (is_null($replacement)) {&lt;br /&gt;
        $replacement = &#039;#DDDDDD&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    $css = str_replace($tag, $replacement, $css);&lt;br /&gt;
    return $css;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ok so what is happening here?&lt;br /&gt;
&lt;br /&gt;
First we need a variable &#039;&#039;&#039;$tag&#039;&#039;&#039; that contains the tag we are going to replace. As mentioned earlier we are going to use tags that look like the image tags you are already familiar with &#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:settingname]]&amp;lt;/nowiki&amp;gt;&#039;&#039;, in this case &#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:backgroundcolor]]&amp;lt;/nowiki&amp;gt;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Next I am going to create a variable called &#039;&#039;&#039;$replacement&#039;&#039;&#039; into which I put &#039;&#039;&#039;$backgroundcolor&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;IF&#039;&#039;&#039; statement that comes next checks &#039;&#039;$replacement&#039;&#039; to make sure it is not null. If it is then we need to set it to a default value. In this case I have used &#039;&#039;#DDD&#039;&#039; as that was the default for the settings.&lt;br /&gt;
&lt;br /&gt;
The line after the IF statement puts it all together. The &#039;&#039;str_replace&#039;&#039; function that we are calling takes three arguments in this order:&lt;br /&gt;
# The text to search for.&lt;br /&gt;
# The text to replace it with.&lt;br /&gt;
# The text to do the replacement in.&lt;br /&gt;
It then returns the text with all of the replacements made. So in this case we are replacing the tag with the background colour and it is returning the changed CSS.&lt;br /&gt;
&lt;br /&gt;
The final thing is to return the &#039;&#039;$css&#039;&#039; variable which now contains the correct background colour.&lt;br /&gt;
&lt;br /&gt;
====The function: demystified_set_regionwidth====&lt;br /&gt;
&lt;br /&gt;
Next we have the demystified_set_regionwidth function.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Sets the region width variable in CSS&lt;br /&gt;
 *&lt;br /&gt;
 * @param string $css&lt;br /&gt;
 * @param mixed $regionwidth&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function demystified_set_regionwidth($css, $regionwidth) {&lt;br /&gt;
    $tag = &#039;[[setting:regionwidth]]&#039;;&lt;br /&gt;
    $doubletag = &#039;[[setting:regionwidthdouble]]&#039;;&lt;br /&gt;
    $replacement = $regionwidth;&lt;br /&gt;
    if (is_null($replacement)) {&lt;br /&gt;
        $replacement = 200;&lt;br /&gt;
    }&lt;br /&gt;
    $css = str_replace($tag, $replacement.&#039;px&#039;, $css);&lt;br /&gt;
    $css = str_replace($doubletag, ($replacement*2).&#039;px&#039;, $css);&lt;br /&gt;
    return $css;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is very similar to the above function however there is one key thing we are doing different. We are doing two replacements.&lt;br /&gt;
&lt;br /&gt;
# The first replacement is for the width that the user selected. In this case I am replacing the tag &#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:regionwidth]]&amp;lt;/nowiki&amp;gt;&#039;&#039; with the width.&lt;br /&gt;
# The second replacement is for the width x 2. This is because the page layout requires that the width be doubled for some of the CSS. Here I will replace &#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:regionwidthdouble]]&amp;lt;/nowiki&amp;gt;&#039;&#039; with the doubled width.&lt;br /&gt;
&lt;br /&gt;
Remember because it is still just a number we need to add &#039;&#039;&#039;px&#039;&#039;&#039; to the end of each before we do the replacement.&lt;br /&gt;
&lt;br /&gt;
So the overall process of this function is:&lt;br /&gt;
# Define the two tags as &#039;&#039;&#039;$tag&#039;&#039;&#039; and &#039;&#039;&#039;$doubletag&#039;&#039;&#039;.&lt;br /&gt;
# Make &#039;&#039;&#039;$replacement&#039;&#039;&#039; the region width &#039;&#039;$regionwidth&#039;&#039;.&lt;br /&gt;
# Set &#039;&#039;$replacement&#039;&#039; to a default value of 200 is it is null.&lt;br /&gt;
# Replace &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:regionwidth]]&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; with the width.&lt;br /&gt;
# Replace &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;[[setting:regionwidthdouble]]&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; with the width x 2.&lt;br /&gt;
# Return the changed CSS.&lt;br /&gt;
&lt;br /&gt;
====The function: demystified_set_customcss====&lt;br /&gt;
&lt;br /&gt;
The final function that we need to write is the demystified_set_customcss function.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Sets the custom css variable in CSS&lt;br /&gt;
 *&lt;br /&gt;
 * @param string $css&lt;br /&gt;
 * @param mixed $customcss&lt;br /&gt;
 * @return string&lt;br /&gt;
 */&lt;br /&gt;
function demystified_set_customcss($css, $customcss) {&lt;br /&gt;
    $tag = &#039;[[setting:customcss]]&#039;;&lt;br /&gt;
    $replacement = $customcss;&lt;br /&gt;
    if (is_null($replacement)) {&lt;br /&gt;
        $replacement = &#039;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    $css = str_replace($tag, $replacement, $css);&lt;br /&gt;
    return $css;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is just like the first function. I&#039;m going to let you work it out on your own.&lt;br /&gt;
&lt;br /&gt;
And that is it no more PHP... Hallelujah I can hear you yelling. The final thing we need to do is tell our theme about the functions we have written and put the settings tags into the CSS.&lt;br /&gt;
&lt;br /&gt;
===Finishing it all off===&lt;br /&gt;
&lt;br /&gt;
So there are two things we have to do in order to complete this section and have our the settings page implemented and our settings being used.&lt;br /&gt;
&lt;br /&gt;
First we need to tell our theme that we want to use the function &#039;&#039;demystified_process_css&#039;&#039; as the &#039;&#039;csspostprocess&#039;&#039; function. This is done very simply by adding the following line of PHP to the bottom of our theme&#039;s config.php file &#039;&#039;&#039;theme/demystified/config.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$THEME-&amp;gt;csspostprocess = &#039;demystified_process_css&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that done the only thing left is to add the settings tag into the CSS. Remember those settings tags are:&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;nowiki&amp;gt;[[setting:backgroundcolor]]&amp;lt;/nowiki&amp;gt; : We need to add this where ever we want the background colour setting to be used.&lt;br /&gt;
; &amp;lt;nowiki&amp;gt;[[setting:regionwidth]]&amp;lt;/nowiki&amp;gt; : We need to add this where ever we want to set the width of the block regions.&lt;br /&gt;
; &amp;lt;nowiki&amp;gt;[[setting:regionwidthdouble]]&amp;lt;/nowiki&amp;gt; : We need to add this where ever we want to set the doubled width of the block regions.&lt;br /&gt;
; &amp;lt;nowiki&amp;gt;[[setting:customcss]]&amp;lt;/nowiki&amp;gt; : We need to add this to the bottom of the CSS file that we want the custom CSS added to.&lt;br /&gt;
&lt;br /&gt;
So lets make those changes in CSS now, open up your &#039;&#039;core.css&#039;&#039; file and replace the CSS with the CSS below:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
/** Background color is a setting **/&lt;br /&gt;
html {background-color:[[setting:backgroundcolor]];}&lt;br /&gt;
body {margin:30px;padding:0;border:1px solid #333;border-width:0 10px 0 10px;background-color:#333;}&lt;br /&gt;
body #page {background-color:#FFF;position:relative;top:-10px;}&lt;br /&gt;
.block .header {background-image:none;background-color:#0C5CAC;border:1px solid #0C5CAC;color:#FFF;}&lt;br /&gt;
.block {border-color:#4BA7FF;background-color:#DDEEFF;}&lt;br /&gt;
.block .content {background-color:#F1F8FF;}&lt;br /&gt;
a:link,&lt;br /&gt;
a:visited {color:#0C5CAC;}&lt;br /&gt;
a:hover {color:#C77500;}&lt;br /&gt;
#page #page-header {background-color:#0C5CAC;margin:0;padding:0;width:100%;color:#fff;}&lt;br /&gt;
#page #page-header a:link, #page #page-header a:visited {color:#FFAC02}&lt;br /&gt;
#page #page-header .navbar, #page #page-header .navbar a:link, #page #page-header .navbar a:visited {color:#0C5CAC;}&lt;br /&gt;
/** Override the region width **/&lt;br /&gt;
#page-content #region-main-box {left:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box {margin-left:-[[setting:regionwidthdouble]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-pre {width:[[setting:regionwidth]];left:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-post {width:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-main-wrap #region-main {margin-left:[[setting:regionwidthdouble]];}&lt;br /&gt;
.side-pre-only #page-content #region-main-box #region-post-box {margin-left:-[[setting:regionwidth]];}&lt;br /&gt;
.side-pre-only #page-content #region-main-box #region-post-box #region-main-wrap #region-main {margin-left:[[setting:regionwidth]];}&lt;br /&gt;
.side-post-only #page-content #region-main-box #region-post-box {margin-left:-[[setting:regionwidth]];}&lt;br /&gt;
.side-post-only #page-content #region-main-box #region-post-box #region-main-wrap #region-main {margin-left:[[setting:regionwidth]];}&lt;br /&gt;
/** Custom CSS **/&lt;br /&gt;
[[setting:customcss]]&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice that &amp;lt;nowiki&amp;gt;[[setting:backgroundcolor]]&amp;lt;/nowiki&amp;gt; has been used for the html tags background colour:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
html {background-color:[[setting:backgroundcolor]];}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have also set the width of the block regions by adding &amp;lt;nowiki&amp;gt;[[setting:regionwidth]]&amp;lt;/nowiki&amp;gt; as the width for region-pre and region-post as shown below:&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
#page-content #region-main-box {left:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box {margin-left:-[[setting:regionwidthdouble]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-pre {width:[[setting:regionwidth]];left:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-post {width:[[setting:regionwidth]];}&lt;br /&gt;
#page-content #region-main-box #region-post-box #region-main-wrap #region-main {margin-left:[[setting:regionwidthdouble]];}&lt;br /&gt;
.side-pre-only #page-content #region-main-box #region-post-box {margin-left:-[[setting:regionwidth]];}&lt;br /&gt;
.side-pre-only #page-content #region-main-box #region-post-box #region-main-wrap #region-main {margin-left:[[setting:regionwidth]];}&lt;br /&gt;
.side-post-only #page-content #region-main-box #region-post-box {margin-left:-[[setting:regionwidth]];}&lt;br /&gt;
.side-post-only #page-content #region-main-box #region-post-box #region-main-wrap #region-main {margin-left:[[setting:regionwidth]];}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
You&#039;ll notice here that we have to set several different widths and margins using the regionwidth setting and make use of the special regionwidthdouble setting that we added.&lt;br /&gt;
&lt;br /&gt;
The final thing that we did was add the &amp;lt;nowiki&amp;gt;[[setting:customcss]]&amp;lt;/nowiki&amp;gt; to the bottom of the file to ensure that the custom CSS comes last (and therefore can override all other CSS).&lt;br /&gt;
&lt;br /&gt;
And with that we are finished. The screenshot below shows how this now looks in the browser if I set the background colour setting to &#039;&#039;&#039;&amp;lt;span style=&#039;color:#FFA800;&#039;&amp;gt;#FFA800&amp;lt;/span&amp;gt;&#039;&#039;&#039; and made the column width 240px;&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.04.png|715px|thumb|left|Our settings in action]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using the settings within our layout files==&lt;br /&gt;
Now that we have utilised the first three settings within our theme&#039;s CSS file it is time to implement the other two settings within the layout files so that they are written directly into the page.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll be glad to know this is no where near as difficult as utilising settings within a CSS file although it still does require a little bit of PHP.&lt;br /&gt;
&lt;br /&gt;
First up is the logo setting. Into this setting the user is able to enter the URL to an image to use as the logo for the site. In my case I want this to be just a background logo on top of which I want to position the page header.&lt;br /&gt;
&lt;br /&gt;
Before I start there is one thing I need to do however and that is create a default logo background that gets shown if the user hasn&#039;t set a specific logo file. To do this I simply created an image &#039;&#039;&#039;logo.jpg&#039;&#039;&#039; and put it into a pix directory within the demystified theme. You should end up with &#039;&#039;&#039;theme/demystified/pix/logo.jpg&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Next open up the front-page layout file &#039;&#039;theme/demystified/layout/frontpage.php&#039;&#039;. At the top of the file is the PHP that checks what blocks regions the page has and a bit of other stuff. Well right below the existing bit of PHP we want to add the following code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (!empty($PAGE-&amp;gt;theme-&amp;gt;settings-&amp;gt;logo)) {&lt;br /&gt;
    $logourl = $PAGE-&amp;gt;theme-&amp;gt;settings-&amp;gt;logo;&lt;br /&gt;
} else {&lt;br /&gt;
    $logourl = $OUTPUT-&amp;gt;pix_url(&#039;logo&#039;, &#039;theme&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
What we are doing here is creating a variable called $logourl that will contain the URL to a logo file that was either entered by the user or if they left it blank is that of our default logo file.&lt;br /&gt;
&lt;br /&gt;
There are two things that you should notice about this. First the logo setting can be retrieved through &#039;&#039;&#039;$PAGE-&amp;gt;theme-&amp;gt;settings-&amp;gt;logo&#039;&#039;&#039; and second we get the default logo url by calling &#039;&#039;&#039;$OUTPUT-&amp;gt;pix_url(&#039;logo&#039;, &#039;theme&#039;)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Now that we have the logo URL we are going to use we need to add an image to the header section of the page as shown below:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;page-header&amp;quot; class=&amp;quot;clearfix&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;img class=&amp;quot;sitelogo&amp;quot; src=&amp;quot;&amp;lt;?php echo $logourl;?&amp;gt;&amp;quot; alt=&amp;quot;Custom logo here&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;h1 class=&amp;quot;headermain&amp;quot;&amp;gt;&amp;lt;?php echo $PAGE-&amp;gt;heading ?&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you save that and browse to your sites front page you will notice that the logo file is now being shown. Hooray. However it is probably not styled too nicely so lets quickly fix that. Open up the core.css file and add the following lines of CSS to the bottom of the file.&lt;br /&gt;
&amp;lt;code css&amp;gt;&lt;br /&gt;
#page-header {position:relative;min-height:100px;}&lt;br /&gt;
#page-header .sitelogo {float:left;}&lt;br /&gt;
#page-header .headermain {position:absolute;left:0.5em;top:50px;margin:0;float:none;font-size:40px;}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
These three lines position the image correctly and if you now refresh everything should appear perfectly. &lt;br /&gt;
&lt;br /&gt;
With the logo done the last setting we need to deal with is the footnote setting. The idea with this setting was that the administrator could enter some text into the editor and it would be displayed in the footer of the page.&lt;br /&gt;
&lt;br /&gt;
This is probably the easiest setting to implement.&lt;br /&gt;
&lt;br /&gt;
Within the front page layout file that we edited above add the following lines below those we added previously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (!empty($PAGE-&amp;gt;theme-&amp;gt;settings-&amp;gt;footnote)) {&lt;br /&gt;
    $footnote = $PAGE-&amp;gt;theme-&amp;gt;settings-&amp;gt;footnote;&lt;br /&gt;
} else {&lt;br /&gt;
    $footnote = &#039;&amp;lt;!-- There was no custom footnote set --&amp;gt;&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we are just collecting the footnote into a variable &#039;&#039;&#039;$footnote&#039;&#039;&#039; and setting a default footnote comment if the user hasn&#039;t entered one.&lt;br /&gt;
&lt;br /&gt;
We can now echo the $footnote variable within the page footer. This can be done as shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;!-- START OF FOOTER --&amp;gt;&lt;br /&gt;
    &amp;lt;div id=&amp;quot;page-footer&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;div class=&amp;quot;footnote&amp;quot;&amp;gt;&amp;lt;?php echo $footnote; ?&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
        &amp;lt;p class=&amp;quot;helplink&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php echo page_doc_link(get_string(&#039;moodledocslink&#039;)) ?&amp;gt;&lt;br /&gt;
        &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And with that done we are finished! Congratulations if you got this far.&lt;br /&gt;
&lt;br /&gt;
The screenshot below shows the demystified theme we have just created that is styled by the settings page.&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.05.png|715px|thumb|left|My finished demystified theme]]&amp;lt;br style=&amp;quot;clear:both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing our creation==&lt;br /&gt;
Congratulations to you! If you&#039;ve made it this far you have done very well. Now it is time to have a look at what we have created and give it a quick test run.&lt;br /&gt;
&lt;br /&gt;
So in this tutorial we have achieved the following:&lt;br /&gt;
&lt;br /&gt;
* We created a theme called demystified that is based on the standard theme.&lt;br /&gt;
* We added a settings page to our new theme.&lt;br /&gt;
* We added the following settings to our settings page:&lt;br /&gt;
** We can set a background colour through the admin interface.&lt;br /&gt;
** We can change the logo of the site.&lt;br /&gt;
** We can change the block region width.&lt;br /&gt;
** We can add a footnote to the page footer&lt;br /&gt;
** We can add some custom CSS to seal the deal.&lt;br /&gt;
* Those settings were then used in the CSS files for our theme.&lt;br /&gt;
* They were also used in the layout files for our theme.&lt;br /&gt;
* And here we are testing it all.&lt;br /&gt;
&lt;br /&gt;
The screenshots below show my testing process and I change each setting and view the outcome. The great thing about this is that with theme designer mode on you see the changes as soon as the form refreshes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Theme.settings.page.06.png|300px|thumb|left|Default settings]]&lt;br /&gt;
[[Image:Theme.settings.page.07.png|300px|thumb|left|Changed the background colour setting]]&lt;br /&gt;
[[Image:Theme.settings.page.08.png|300px|thumb|left|Changed the logo and region width]]&lt;br /&gt;
[[Image:Theme.settings.page.09.png|300px|thumb|left|Added a footnote]]&lt;br /&gt;
[[Image:Theme.settings.page.10.png|300px|thumb|left|Added some custom CSS]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The different settings you can use==&lt;br /&gt;
During this tutorial we use four different kinds of settings, a text box, text area, a select (dropdown) and the editor however as I&#039;m sure you have all guessed there is many more some of which will certainly be useful for theme settings.&lt;br /&gt;
&lt;br /&gt;
The following are examples of some of the different settings. I should add that these build upon what we have already done within the tutorial but are not included in the download.&lt;br /&gt;
&lt;br /&gt;
===Colour picker===&lt;br /&gt;
[[Image:Theme.settings.page.11.png|400px|thumb|The colour picker]]&lt;br /&gt;
I can hear you all asking now &#039;Why didn&#039;t you mention this one earlier?&#039; well the answer is simple it didn&#039;t exist when I first wrote the tutorial. It is an admin setting that I wrote several days after because of the fantastic effort people were putting into trying out settings pages.&lt;br /&gt;
&lt;br /&gt;
A bit about the colour picker. First up it is a text box that when the page loads turns into a colour picker that can be used to select a colour and can even preview the selected colour in the page (by clicking the preview button). It is designed to be very easy to use and the code is just about as simple as creating a normal text box setting.&lt;br /&gt;
&lt;br /&gt;
In the image to the left I have replaced the background colour setting we created during the tutorial with the colour picker. Lets have a look at the code involved for that.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
// Background colour setting&lt;br /&gt;
$name = &#039;theme_demystified/backgroundcolor&#039;;&lt;br /&gt;
$title = get_string(&#039;backgroundcolor&#039;,&#039;theme_demystified&#039;);&lt;br /&gt;
$description = get_string(&#039;backgroundcolordesc&#039;, &#039;theme_demystified&#039;);&lt;br /&gt;
$default = &#039;#DDD&#039;;&lt;br /&gt;
$previewconfig = array(&#039;selector&#039;=&amp;gt;&#039;html&#039;, &#039;style&#039;=&amp;gt;&#039;backgroundColor&#039;);&lt;br /&gt;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);&lt;br /&gt;
$temp-&amp;gt;add($setting);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
So first thing you should notice is that the first four lines of code have not changed at all!&lt;br /&gt;
&lt;br /&gt;
The first change we have is to create a variable &#039;&#039;&#039;$previewconfig&#039;&#039;&#039;. &lt;br /&gt;
This variable is used to tell the colour picker what to do when the user clicks the preview button. It should be an array that contains two things, first a selector, and second a style. &lt;br /&gt;
# The selector is a CSS selector like &#039;&#039;.page .header h2&#039;&#039;.&lt;br /&gt;
# The style is a what should change, there are two immediate values it can be, either &#039;&#039;&#039;backgroundColor&#039;&#039;&#039; or &#039;&#039;&#039;color&#039;&#039;&#039;.&lt;br /&gt;
In my case the selector is &#039;&#039;&#039;html&#039;&#039;&#039; to target the html tag and the style is backgroundColor to change the background colour.&lt;br /&gt;
&lt;br /&gt;
The second change is to use &#039;&#039;&#039;admin_setting_configcolourpicker&#039;&#039;&#039; instead of &#039;&#039;admin_setting_configtext&#039;&#039;. The arguments are nearly identical as well except that there is an extra argument to which we give the &#039;&#039;&#039;$previewconfig&#039;&#039;&#039; variable.&lt;br /&gt;
&lt;br /&gt;
And that is it! it is all you need to get the colour picker up and running.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Extra note:&#039;&#039;&#039; The $previewconfig variable is optional. If you don&#039;t want a preview button the simply set &#039;&#039;$previewconfig = null&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Common pitfalls and useful notes==&lt;br /&gt;
&lt;br /&gt;
This section is really just a collection of pointers, tips, notes, and other short useful stuff that may be of use to those attempting this tutorial.&lt;br /&gt;
&lt;br /&gt;
# First up and most importantly there are very few limitations to what you achieve in this fashion.&lt;br /&gt;
# If you get stuck or need a hand ask in the forums, there&#039;s always someone round who can help.&lt;br /&gt;
# If you do something really cool let us know, I know everyone in the community loves finding our what others are achieving.&lt;br /&gt;
# You don&#039;t have to use &#039;&#039;admin_settingpage&#039;&#039; you can also use &#039;&#039;&#039;admin_externalpage&#039;&#039;&#039; if you prefer. It should be noted however that it is not the preferred way to do it as admin_externalpage&#039;s were only left in Moodle 2.0 for backwards compatibility (although they are more flexible one day they will be deprecated or removed). Thank you to Darryl for raising this.&lt;br /&gt;
# If you find that your language strings aren&#039;t being used (you are getting language string notices) and you have double checked that you have turned &#039;&#039;&#039;langstringcache&#039;&#039;&#039; off then you may need to delete the language cache directory. This is located in the moodledata directory for you installation: moodledata/cache/lang/*. You should delete the directory for your chosen language by default &#039;&#039;en&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Adding theme upgrade code]]&lt;br /&gt;
* [[Styling and customising the dock]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=152053 Theme 2.0: Adding a settings page to your theme] forum discussion&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:Dialogue_2.0_specification&amp;diff=28686</id>
		<title>Talk:Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:Dialogue_2.0_specification&amp;diff=28686"/>
		<updated>2011-07-20T00:39:06Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: adding note about more than one teacher being able to see/participate&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes to remember - sometimes there is more than one teacher who needs to see all / participate any with an easy way to set this (instead of tweaking roles &amp;amp; permissions)&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18247</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18247"/>
		<updated>2010-09-13T21:58:58Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Group support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
* Teacher posts the same message to all students in ‘Course A’, future enrolled students also receive the same message.  Individual conversation created between teacher and each student.  Multiple replies are allowed.&lt;br /&gt;
* Teacher posts the same message to all members of ‘Group A’, future group members also receive the same message.  Individual conversation created between teacher and each user (any role) in ‘Group A’.  Multiple replies are allowed.&lt;br /&gt;
* Teacher posts the same message to specific students in ‘Course A’.  Individual conversation created between teacher and each student.  Multiple replies are allowed.&lt;br /&gt;
* Teacher posts a message to a specific student in ‘Course A’.  Individual conversation created between teacher and specific student .  Student can view but not reply.  Multiple followup replies are allowed for teacher.&lt;br /&gt;
* Student posts a message to a specific teacher in ‘Course A’.  Individual conversation created between teacher and student.  Multiple followup replies are allowed.&lt;br /&gt;
* Teacher A leaves, Teacher B needs to manage all conversations to allow followup replies, close and delete.&lt;br /&gt;
* Specific Student (eg Class Rep with own role) posts a message to all students in ‘Course A’.  Individual conversation created between Class Rep and each student.  Multiple followup replies are allowed.&lt;br /&gt;
* Specific Student (eg Class Rep with own role) posts a message to a specific student in ‘Course A’.  Individual conversation created between Class Rep and specific student.  Multiple followup replies are allowed.&lt;br /&gt;
* Specific Student posts a message into a specific role (eg Class Rep role).  Individual conversation created between specific student and Class Rep.  Multiple followup replies are allowed.&lt;br /&gt;
* All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
&lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending on time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User will see all groups listed in the recipient picker.  User can open a conversation with any user or group of users.&lt;br /&gt;
&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User will see groups they are a member of listed in the recipient picker.  User can open a conversation with any user in a group they are a member of.&lt;br /&gt;
&lt;br /&gt;
User with capability moodle/site:accessallgroups with permission allow will see all groups listed in the recipient picker and can open a conversation with any user regardless of group membership.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
The following options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled notification will include post content and a link to specific dialogue conversation.  If not enabled notification will include post title and a link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id of this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the dialogue &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
Restoring a 1.9x backup into a 2.0 Moodle? TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18246</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18246"/>
		<updated>2010-09-13T21:50:02Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Usage scenarios */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
* Teacher posts the same message to all students in ‘Course A’, future enrolled students also receive the same message.  Individual conversation created between teacher and each student.  Multiple replies are allowed.&lt;br /&gt;
* Teacher posts the same message to all members of ‘Group A’, future group members also receive the same message.  Individual conversation created between teacher and each user (any role) in ‘Group A’.  Multiple replies are allowed.&lt;br /&gt;
* Teacher posts the same message to specific students in ‘Course A’.  Individual conversation created between teacher and each student.  Multiple replies are allowed.&lt;br /&gt;
* Teacher posts a message to a specific student in ‘Course A’.  Individual conversation created between teacher and specific student .  Student can view but not reply.  Multiple followup replies are allowed for teacher.&lt;br /&gt;
* Student posts a message to a specific teacher in ‘Course A’.  Individual conversation created between teacher and student.  Multiple followup replies are allowed.&lt;br /&gt;
* Teacher A leaves, Teacher B needs to manage all conversations to allow followup replies, close and delete.&lt;br /&gt;
* Specific Student (eg Class Rep with own role) posts a message to all students in ‘Course A’.  Individual conversation created between Class Rep and each student.  Multiple followup replies are allowed.&lt;br /&gt;
* Specific Student (eg Class Rep with own role) posts a message to a specific student in ‘Course A’.  Individual conversation created between Class Rep and specific student.  Multiple followup replies are allowed.&lt;br /&gt;
* Specific Student posts a message into a specific role (eg Class Rep role).  Individual conversation created between specific student and Class Rep.  Multiple followup replies are allowed.&lt;br /&gt;
* All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
&lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending on time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any user in any visible group.&lt;br /&gt;
&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any other user in a group they are a member of.  User with capability moodle/site:accessallgroups with permission allow can open a conversation with any user regardless of group membership.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
The following options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled notification will include post content and a link to specific dialogue conversation.  If not enabled notification will include post title and a link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id of this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the dialogue &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
Restoring a 1.9x backup into a 2.0 Moodle? TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18245</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18245"/>
		<updated>2010-09-13T21:44:54Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Usage scenarios */ updated wording for scenarios&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
* Teacher posts the same message to all students in ‘Course A’, future enrolled students also receive the same message.  Individual conversation created between teacher and each student.  Multiple replies are allowed.&lt;br /&gt;
* Teacher posts the same message to all members of ‘Group A’, future group members also receive the same message.  Individual conversation created between teacher and each user (any role) in ‘Group A’.  Multiple replies are allowed.&lt;br /&gt;
* Teacher posts the same message to specific students in ‘Course A’.  Individual conversation created between teacher and each student.  Multiple replies are allowed.&lt;br /&gt;
* Teacher posts a message to a specific student in ‘Course A’.  Individual conversation created between teacher and specific student .  Student can view but not reply.  Multiple followup replies are allowed for teacher.&lt;br /&gt;
* Student posts a message to a specific teacher in ‘Course A’.  Individual conversation created between teacher and student.  Multiple followup replies are allowed.&lt;br /&gt;
* Teacher A leaves, Teacher B needs to manage all conversations to allow followup replies, close and delete.&lt;br /&gt;
* Specific Student (eg Class Rep with own role) posts a message to all students in ‘Course A’.  Individual conversation created between Class Rep and each student.  Multiple followup replies are allowed.&lt;br /&gt;
* Specific Student (eg Class Rep with own role) posts a message to a specific student in ‘Course A’.  Individual conversation created between Class Rep and specific student.  Multiple followup replies are allowed.&lt;br /&gt;
* Students posts a message into a specific role (eg Class Rep role).  Individual conversation created between specific student and Class Rep.  Multiple followup replies are allowed.&lt;br /&gt;
* All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
&lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending on time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any user in any visible group.&lt;br /&gt;
&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any other user in a group they are a member of.  User with capability moodle/site:accessallgroups with permission allow can open a conversation with any user regardless of group membership.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
The following options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled notification will include post content and a link to specific dialogue conversation.  If not enabled notification will include post title and a link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id of this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the dialogue &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
Restoring a 1.9x backup into a 2.0 Moodle? TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18242</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18242"/>
		<updated>2010-09-13T06:47:52Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Usage scenarios */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
* Teacher posts the same message in a conversation to all students in ‘Course A’, future enrolled students also receive the same conversation.  Multiple followup replies are allowed.&lt;br /&gt;
* Teacher posts the same message in a conversation to all members of ‘Group A’, future group members also receive the same conversation.  All roles in ‘Group A’ receive the conversation.  Multiple followup replies are allowed.&lt;br /&gt;
* Teacher posts the same message in a conversation to specific students in ‘Course A’.  Multiple followup replies are allowed.&lt;br /&gt;
* Teacher posts a message in a conversation to a specific student in ‘Course A’.  Student can view but not respond.  Multiple followup replies are not allowed.&lt;br /&gt;
* Student posts a message in a conversation to a specific teacher in ‘Course A’.  Multiple followup replies are allowed.&lt;br /&gt;
* Teacher A leaves, Teacher B needs to transfer ownership of conversations to allow followup replies, close and delete.&lt;br /&gt;
* Specific Student (eg Class Rep with own role) posts a message in a conversation to all students in ‘Course A’.  Multiple followup replies are allowed.&lt;br /&gt;
* Specific Student (eg Class Rep with own role) posts a message in a conversation to a specific student in ‘Course A’.  Multiple followup replies are allowed.&lt;br /&gt;
* Students posts a message in a conversation to a specific student(eg Class Rep with own role).  Multiple followup replies are allowed.&lt;br /&gt;
* All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
&lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending on time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any user in any visible group.&lt;br /&gt;
&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any other user in a group they are a member of.  User with capability moodle/site:accessallgroups with permission allow can open a conversation with any user regardless of group membership.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
The following options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled notification will include post content and a link to specific dialogue conversation.  If not enabled notification will include post title and a link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id of this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the dialogue &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18241</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18241"/>
		<updated>2010-09-13T06:47:09Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Usage scenarios */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
* Teacher posts the same message in a conversation to all students in ‘Course A’, future enrolled students also receive the same conversation.  Multiple followup replies are allowed.&lt;br /&gt;
* Teacher posts the same message in a conversation to all members of ‘Group A’, future group members also receive the same conversation.  All roles in ‘Group A’ receive the conversation.  Multiple followup replies are allowed.&lt;br /&gt;
* Teacher posts the same message in a conversation to specific students in ‘Course A’.  Multiple followup replies are allowed.&lt;br /&gt;
* Teacher posts a message in a conversation to a specific student in ‘Course A’.  Student can view but not respond.  Multiple followup replies are not allowed.&lt;br /&gt;
* Student posts a message in a conversation to a specific teacher in ‘Course A’.  Multiple followup replies are allowed.&lt;br /&gt;
* Teacher A leaves, Teacher B needs to transfer ownership of conversations to allow followup replies, close and delete.&lt;br /&gt;
* Specific Student (eg Class Rep with own role) posts a message in a conversation to all students in ‘Course A’.  Multiple followup replies are allowed.&lt;br /&gt;
* Specific Student (eg Class Rep with own role) posts a message in a conversation to a specific student in ‘Course A’.  Multiple followup replies are allowed.&lt;br /&gt;
* Students posts a message in a conversation to a specific role (eg Class Rep role).  Multiple followup replies are allowed.&lt;br /&gt;
* All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
&lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending on time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any user in any visible group.&lt;br /&gt;
&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any other user in a group they are a member of.  User with capability moodle/site:accessallgroups with permission allow can open a conversation with any user regardless of group membership.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
The following options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled notification will include post content and a link to specific dialogue conversation.  If not enabled notification will include post title and a link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id of this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the dialogue &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18240</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18240"/>
		<updated>2010-09-13T06:28:25Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* dialogue_read */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
*Teacher sends same course welcome message to all students in “Course A” including future students. Not other roles. Multiple messages.&lt;br /&gt;
*Teacher sends same group welcome message to all members of “Group A” including future members. All roles in “Group A”. Multiple messages.&lt;br /&gt;
*Teacher sends same message to some students. Multiple messages.&lt;br /&gt;
*A Teacher can send “Message” to a student. Student can view but not respond. Single user message.&lt;br /&gt;
*A Student can send “Message” to a Teacher. But not to other students. Single user message.&lt;br /&gt;
*Teacher A leaves, Teacher B needs to close a Dialogue that posts to all Students.&lt;br /&gt;
*A specific Student (eg Class Rep with specified role) can send a “Message” to all students. Ongoing conversation allowed. &lt;br /&gt;
*A Student can send a “Message” to a specific students (eg Class Rep with specified role). Ongoing conversation allowed.&lt;br /&gt;
*All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
&lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending on time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any user in any visible group.&lt;br /&gt;
&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any other user in a group they are a member of.  User with capability moodle/site:accessallgroups with permission allow can open a conversation with any user regardless of group membership.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
The following options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled notification will include post content and a link to specific dialogue conversation.  If not enabled notification will include post title and a link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id of this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the dialogue &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18239</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18239"/>
		<updated>2010-09-13T06:25:58Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* dialogue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
*Teacher sends same course welcome message to all students in “Course A” including future students. Not other roles. Multiple messages.&lt;br /&gt;
*Teacher sends same group welcome message to all members of “Group A” including future members. All roles in “Group A”. Multiple messages.&lt;br /&gt;
*Teacher sends same message to some students. Multiple messages.&lt;br /&gt;
*A Teacher can send “Message” to a student. Student can view but not respond. Single user message.&lt;br /&gt;
*A Student can send “Message” to a Teacher. But not to other students. Single user message.&lt;br /&gt;
*Teacher A leaves, Teacher B needs to close a Dialogue that posts to all Students.&lt;br /&gt;
*A specific Student (eg Class Rep with specified role) can send a “Message” to all students. Ongoing conversation allowed. &lt;br /&gt;
*A Student can send a “Message” to a specific students (eg Class Rep with specified role). Ongoing conversation allowed.&lt;br /&gt;
*All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
&lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending on time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any user in any visible group.&lt;br /&gt;
&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any other user in a group they are a member of.  User with capability moodle/site:accessallgroups with permission allow can open a conversation with any user regardless of group membership.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
The following options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled notification will include post content and a link to specific dialogue conversation.  If not enabled notification will include post title and a link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id of this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the dialogue &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user if of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18238</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18238"/>
		<updated>2010-09-13T06:19:05Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Dialogue module instance options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
*Teacher sends same course welcome message to all students in “Course A” including future students. Not other roles. Multiple messages.&lt;br /&gt;
*Teacher sends same group welcome message to all members of “Group A” including future members. All roles in “Group A”. Multiple messages.&lt;br /&gt;
*Teacher sends same message to some students. Multiple messages.&lt;br /&gt;
*A Teacher can send “Message” to a student. Student can view but not respond. Single user message.&lt;br /&gt;
*A Student can send “Message” to a Teacher. But not to other students. Single user message.&lt;br /&gt;
*Teacher A leaves, Teacher B needs to close a Dialogue that posts to all Students.&lt;br /&gt;
*A specific Student (eg Class Rep with specified role) can send a “Message” to all students. Ongoing conversation allowed. &lt;br /&gt;
*A Student can send a “Message” to a specific students (eg Class Rep with specified role). Ongoing conversation allowed.&lt;br /&gt;
*All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
&lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending on time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any user in any visible group.&lt;br /&gt;
&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any other user in a group they are a member of.  User with capability moodle/site:accessallgroups with permission allow can open a conversation with any user regardless of group membership.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
The following options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled notification will include post content and a link to specific dialogue conversation.  If not enabled notification will include post title and a link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the workshop &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user if of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18237</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18237"/>
		<updated>2010-09-13T06:11:00Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Separate groups mode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
*Teacher sends same course welcome message to all students in “Course A” including future students. Not other roles. Multiple messages.&lt;br /&gt;
*Teacher sends same group welcome message to all members of “Group A” including future members. All roles in “Group A”. Multiple messages.&lt;br /&gt;
*Teacher sends same message to some students. Multiple messages.&lt;br /&gt;
*A Teacher can send “Message” to a student. Student can view but not respond. Single user message.&lt;br /&gt;
*A Student can send “Message” to a Teacher. But not to other students. Single user message.&lt;br /&gt;
*Teacher A leaves, Teacher B needs to close a Dialogue that posts to all Students.&lt;br /&gt;
*A specific Student (eg Class Rep with specified role) can send a “Message” to all students. Ongoing conversation allowed. &lt;br /&gt;
*A Student can send a “Message” to a specific students (eg Class Rep with specified role). Ongoing conversation allowed.&lt;br /&gt;
*All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
&lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending on time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any user in any visible group.&lt;br /&gt;
&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any other user in a group they are a member of.  User with capability moodle/site:accessallgroups with permission allow can open a conversation with any user regardless of group membership.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
Follow options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled will include post content and link to specific dialogue conversation else will new post type message and link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the workshop &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user if of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18236</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18236"/>
		<updated>2010-09-13T06:09:42Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Visible groups mode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
*Teacher sends same course welcome message to all students in “Course A” including future students. Not other roles. Multiple messages.&lt;br /&gt;
*Teacher sends same group welcome message to all members of “Group A” including future members. All roles in “Group A”. Multiple messages.&lt;br /&gt;
*Teacher sends same message to some students. Multiple messages.&lt;br /&gt;
*A Teacher can send “Message” to a student. Student can view but not respond. Single user message.&lt;br /&gt;
*A Student can send “Message” to a Teacher. But not to other students. Single user message.&lt;br /&gt;
*Teacher A leaves, Teacher B needs to close a Dialogue that posts to all Students.&lt;br /&gt;
*A specific Student (eg Class Rep with specified role) can send a “Message” to all students. Ongoing conversation allowed. &lt;br /&gt;
*A Student can send a “Message” to a specific students (eg Class Rep with specified role). Ongoing conversation allowed.&lt;br /&gt;
*All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
&lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending on time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any user in any visible group.&lt;br /&gt;
&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any person in a group they are a member of unless has capability moodle/site:accessallgroups with permission allow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
Follow options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled will include post content and link to specific dialogue conversation else will new post type message and link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the workshop &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user if of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18235</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18235"/>
		<updated>2010-09-13T05:19:59Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Auto open multiple */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
*Teacher sends same course welcome message to all students in “Course A” including future students. Not other roles. Multiple messages.&lt;br /&gt;
*Teacher sends same group welcome message to all members of “Group A” including future members. All roles in “Group A”. Multiple messages.&lt;br /&gt;
*Teacher sends same message to some students. Multiple messages.&lt;br /&gt;
*A Teacher can send “Message” to a student. Student can view but not respond. Single user message.&lt;br /&gt;
*A Student can send “Message” to a Teacher. But not to other students. Single user message.&lt;br /&gt;
*Teacher A leaves, Teacher B needs to close a Dialogue that posts to all Students.&lt;br /&gt;
*A specific Student (eg Class Rep with specified role) can send a “Message” to all students. Ongoing conversation allowed. &lt;br /&gt;
*A Student can send a “Message” to a specific students (eg Class Rep with specified role). Ongoing conversation allowed.&lt;br /&gt;
*All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
&lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending on time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any person in any visible group.&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any person in a group they are a member of unless has capability moodle/site:accessallgroups with permission allow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
Follow options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled will include post content and link to specific dialogue conversation else will new post type message and link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the workshop &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user if of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18234</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18234"/>
		<updated>2010-09-13T05:11:18Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Glossary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
*Teacher sends same course welcome message to all students in “Course A” including future students. Not other roles. Multiple messages.&lt;br /&gt;
*Teacher sends same group welcome message to all members of “Group A” including future members. All roles in “Group A”. Multiple messages.&lt;br /&gt;
*Teacher sends same message to some students. Multiple messages.&lt;br /&gt;
*A Teacher can send “Message” to a student. Student can view but not respond. Single user message.&lt;br /&gt;
*A Student can send “Message” to a Teacher. But not to other students. Single user message.&lt;br /&gt;
*Teacher A leaves, Teacher B needs to close a Dialogue that posts to all Students.&lt;br /&gt;
*A specific Student (eg Class Rep with specified role) can send a “Message” to all students. Ongoing conversation allowed. &lt;br /&gt;
*A Student can send a “Message” to a specific students (eg Class Rep with specified role). Ongoing conversation allowed.&lt;br /&gt;
*All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of a dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between two users within a dialogue activity. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending of time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any person in any visible group.&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any person in a group they are a member of unless has capability moodle/site:accessallgroups with permission allow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
Follow options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled will include post content and link to specific dialogue conversation else will new post type message and link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the workshop &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user if of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18233</id>
		<title>Dialogue 2.0 specification</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Dialogue_2.0_specification&amp;diff=18233"/>
		<updated>2010-09-13T05:10:04Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: /* Introduction */ email and backup info added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page tracks and summarises the progress of rewrite of the [[Dialogue]] module for Moodle 2.0. {{Moodle 2.0}}&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot; style=&amp;quot;float: right;&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Dialogue 2.0 specification&lt;br /&gt;
|-&lt;br /&gt;
| Status&lt;br /&gt;
| &#039;&#039;&#039;Draft&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Tracker&lt;br /&gt;
| http://tracker.moodle.org/browse/CONTRIB-2059 | CONTRIB-2059&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The Dialogue module  allows students or teachers to start a two-way conversation with another person. The Dialogue is a course activity that can be useful when the teacher wants a place to give private feedback to a student on their online activity. For example, if a student is participating in a language forum and made a grammatical error that the teacher wants to point out without embarrassing the student, a dialogue is the perfect place. A dialogue activity would also be an excellent way for counselors within an institution to interact with students - all activities are logged and email is available but not necessarily required.  The Dialogue is also a useful alternative to email or private Messages as the conversations are located within a course.  The Dialogue module can be backed up with other course activities.&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
*Teacher sends same course welcome message to all students in “Course A” including future students. Not other roles. Multiple messages.&lt;br /&gt;
*Teacher sends same group welcome message to all members of “Group A” including future members. All roles in “Group A”. Multiple messages.&lt;br /&gt;
*Teacher sends same message to some students. Multiple messages.&lt;br /&gt;
*A Teacher can send “Message” to a student. Student can view but not respond. Single user message.&lt;br /&gt;
*A Student can send “Message” to a Teacher. But not to other students. Single user message.&lt;br /&gt;
*Teacher A leaves, Teacher B needs to close a Dialogue that posts to all Students.&lt;br /&gt;
*A specific Student (eg Class Rep with specified role) can send a “Message” to all students. Ongoing conversation allowed. &lt;br /&gt;
*A Student can send a “Message” to a specific students (eg Class Rep with specified role). Ongoing conversation allowed.&lt;br /&gt;
*All Teachers can view and participate in any existing conversation in a shared teaching situation.&lt;br /&gt;
=== Design goals ===&lt;br /&gt;
# Retain existing functionality.&lt;br /&gt;
# Enhance usage scenarios, flexibility and control.&lt;br /&gt;
# Enhance user interface.&lt;br /&gt;
&lt;br /&gt;
== Glossary ==&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Term&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| Dialogue&lt;br /&gt;
| An instance of an dialogue activity module. &lt;br /&gt;
|-&lt;br /&gt;
| Conversation&lt;br /&gt;
| An instance of communication between to two users within a dialogue. Follow vertical linear pattern.&lt;br /&gt;
|-&lt;br /&gt;
| Reply&lt;br /&gt;
| A message posted in reply to conversational text.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== User interface mock-ups ==&lt;br /&gt;
=== Dialogue listing ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-mainindex.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue view ===&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-readnpost.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-closed.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
=== Dialogue new ===&lt;br /&gt;
==== Recipient picker ====&lt;br /&gt;
&#039;&#039;&#039;Basic features&#039;&#039;&#039;&lt;br /&gt;
Use a standard drop down for single recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-recipentpicker.png]]&lt;br /&gt;
&lt;br /&gt;
Multiple user selection&lt;br /&gt;
&lt;br /&gt;
[[Image:DRAFT dialogue2.0 mockup-standardmultirecipentpicker.png | sample | 600px]]&lt;br /&gt;
&lt;br /&gt;
Use standard multiple user selection interface as found in enrol users, groups e.t.c&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced features&#039;&#039;&#039;&lt;br /&gt;
Ajax recipient picker, must be able to handle both single and multiple recipient selection.&lt;br /&gt;
&lt;br /&gt;
[[Image: DRAFT_dialogue2.0_mockup-ajaxrecipentpicker.png | sample | 300px ]]&lt;br /&gt;
&lt;br /&gt;
== Implementation plan ==&lt;br /&gt;
=== Multiple dialogue open ===&lt;br /&gt;
If user has capability mod/dialogue:openmultiple with permission set to allow, they can select multiple users to open a conversation with that will contain the same subject, body, attachment(s).&lt;br /&gt;
&lt;br /&gt;
=== Auto open multiple ===&lt;br /&gt;
If a user has the capability mod/dialogue:autoopenmultiple with permission set to allow, they can open a automated conversation that will contain the same subject, body, attachment(s) with:&lt;br /&gt;
* &amp;quot;All Participants&amp;quot; -&amp;gt; All course members&lt;br /&gt;
Any newly enrolled users will receive dialogue. &lt;br /&gt;
If in group mode&lt;br /&gt;
* &amp;quot;A Group&amp;quot; -&amp;gt; All members in that group.&lt;br /&gt;
* &amp;quot;Multiple Groups&amp;quot; -&amp;gt; e.g Group A, Group C will open with any member of a selected group.&lt;br /&gt;
Any new group member will receive dialogue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a dialogue with. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This information will be stored to a new table &#039;&#039;&#039;mdl_dialogue_automated&#039;&#039;&#039; this will allow user to delete conversation at anytime if they want to stop opening conversations with newly enrolled users or group members. Depending of time, could also add a date range option to control opening.&lt;br /&gt;
&lt;br /&gt;
=== Group support ===&lt;br /&gt;
==== Visible groups mode ====&lt;br /&gt;
User can open a conversation with any person in any visible group.&lt;br /&gt;
==== Separate groups mode ====&lt;br /&gt;
User can open a conversation with any person in a group they are a member of unless has capability moodle/site:accessallgroups with permission allow.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; New capability mod/dialogue:receive will also determine what roles (student, teacher e.t.c) a user can open a conversation with.&lt;br /&gt;
&lt;br /&gt;
=== File attachments ===&lt;br /&gt;
==== File API ====&lt;br /&gt;
Use filemanager element in the formslib to get one or more file from user for each post, file(s) stored permanently for future viewing.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
==== Messaging API ====&lt;br /&gt;
Setup messageprovider for routing notifications.&lt;br /&gt;
&lt;br /&gt;
==== Dialogue module instance options ====&lt;br /&gt;
Follow options can be configured when creating a new dialogue module instance or updating/editing a dialogue module instance.&lt;br /&gt;
*Enable notifications&lt;br /&gt;
:Allow notifications, passed on to Messaging API.&lt;br /&gt;
*Include post content in notification&lt;br /&gt;
:If enabled will include post content and link to specific dialogue conversation else will new post type message and link to specific dialogue conversation.&lt;br /&gt;
&lt;br /&gt;
=== Event API ===&lt;br /&gt;
&#039;&#039;&#039;user_enrolled()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new course participants when all participants were selected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;groups_member_added()&#039;&#039;&#039;&lt;br /&gt;
:Can be used for any automated opening of dialogues for new group members when group(s) were elected in a multi-open dialogue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;user_unenrolled()&#039;&#039;&#039;&lt;br /&gt;
:Cleanup function, delete any dialogues that user is a recipient.&lt;br /&gt;
&lt;br /&gt;
=== Navigation functions ===&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_navigation($navref, $course, $module, $cm)&#039;&#039;&#039;&lt;br /&gt;
:Can use for dialogue unread count, filters(All, Unread, Read e.t.c) providing direct linking.&lt;br /&gt;
&#039;&#039;&#039;dialogue_extend_settings_navigation(settings_navigation $settingsnav, navigation_node $dialoguenode)&#039;&#039;&#039;&lt;br /&gt;
:Can use for showing automated multiple open dialogue???&lt;br /&gt;
&lt;br /&gt;
=== Logging ===&lt;br /&gt;
Dialogue events that will be logged.&lt;br /&gt;
* open&lt;br /&gt;
* view&lt;br /&gt;
* reply&lt;br /&gt;
* edit&lt;br /&gt;
* close&lt;br /&gt;
* delete&lt;br /&gt;
&lt;br /&gt;
=== Database structures ===&lt;br /&gt;
[[Image:DRAFT_dialogue2.0_schema.png | sample | 600px ]]&lt;br /&gt;
==== dialogue ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| intro&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &lt;br /&gt;
| the description/assignment of the workshop &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| introformat &lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format of the intro field &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| edittime&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| maxattachments &lt;br /&gt;
| int (3)&lt;br /&gt;
| 1&lt;br /&gt;
| number of attachments &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| maxbytes &lt;br /&gt;
| int (10) &lt;br /&gt;
| 100000&lt;br /&gt;
| maximum size of the one attached file &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| notifications&lt;br /&gt;
| int (2)&lt;br /&gt;
| 1&lt;br /&gt;
| allow post notifications, will use MessagingAPI&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| notificationcontent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| include post content in notification&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_conversations ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipientid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who is to receive conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastreply&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| reply id of last post in the conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| closed&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if conversation has been closed&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| deleted&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate conversation as deleted&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; Unsure&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified &lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_replies ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| parentid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the previous reply if exists, else if 0 directly follows conversation&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; unsure&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who posted reply&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| attachment&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| if post contains attachment(s) &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| sent&lt;br /&gt;
| int (2)&lt;br /&gt;
| 0&lt;br /&gt;
| flag to indicate if message has been sent to recipient&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_read ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user if of person who viewed conversation or reply&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue id that the conversation relates to.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| conversationid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the conversation id that reply relates to&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| replyid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the reply id, can be 0 if user has just viewed start of conversation&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| firstread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime first read&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| lastread&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| datetime last read&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== dialogue_automated ====&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field&lt;br /&gt;
! Type&lt;br /&gt;
! Default&lt;br /&gt;
! Description&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
| int (10)&lt;br /&gt;
| &lt;br /&gt;
| auto-numbered &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| course&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the course id this dialogue&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| dialogueid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the dialogue instance id &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| subject&lt;br /&gt;
| varchar (255)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| brief summary of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ownerid&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| user id of person who started conversation &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| recipients&lt;br /&gt;
| text (small)&lt;br /&gt;
| 0&lt;br /&gt;
| indicators for &amp;quot;All participants&amp;quot; or selected groups&lt;br /&gt;
| serialised array or object&lt;br /&gt;
|-&lt;br /&gt;
| text&lt;br /&gt;
| text (medium)&lt;br /&gt;
| &#039;&#039;&lt;br /&gt;
| message text&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| format&lt;br /&gt;
| int (3)&lt;br /&gt;
| 0&lt;br /&gt;
| the format type of message &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| timestart&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime start range, users enrolled after will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timeend&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the datetime end range, users enrolled before will receive&lt;br /&gt;
| &#039;&#039;&#039;???&#039;&#039;&#039; may be later implemented&lt;br /&gt;
|-&lt;br /&gt;
| timemodified&lt;br /&gt;
| int (10)&lt;br /&gt;
| 0&lt;br /&gt;
| the timestamp when the module was modified&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Capabilities and Permissions ===&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Capability&lt;br /&gt;
! Description&lt;br /&gt;
! Role permissions(defaults)&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:open&lt;br /&gt;
| Open a dialogue with single recipient &lt;br /&gt;
| teacher&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:receive&lt;br /&gt;
| Can receive a dialogue&lt;br /&gt;
| student&lt;br /&gt;
| Can be used to control what roles are displayed in the recipient picker&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:reply&lt;br /&gt;
| Can reply to a dialogue&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeown&lt;br /&gt;
| Can close a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteown&lt;br /&gt;
| Can delete a dialogue if have ownership&lt;br /&gt;
| teacher, student&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteownreply&lt;br /&gt;
| Can delete own reply&lt;br /&gt;
| teacher, student&lt;br /&gt;
| Add ability to delete last reply in dialogue thread. &#039;&#039;&#039;Maybe/Maybe not?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:openmultiple&lt;br /&gt;
| Can start a dialogue with multiple recipients&lt;br /&gt;
| teacher&lt;br /&gt;
| For sending the same dialogue to multiple recipients. Used for targeting particular group(s) of users or whole class. &lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:autoopenmultiple&lt;br /&gt;
| Can start a automated dialogue with course participants or group members which includes future members.&lt;br /&gt;
| teacher&lt;br /&gt;
|&lt;br /&gt;
|- &lt;br /&gt;
| mod/dialogue:viewany&lt;br /&gt;
| view any conversation, reply&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:replyany&lt;br /&gt;
| can reply in any conversation to any reply &lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:closeany&lt;br /&gt;
| can close any conversation&lt;br /&gt;
| administrator&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| mod/dialogue:deleteany&lt;br /&gt;
| can delete any conversation &lt;br /&gt;
| administrator&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Backup and Restore ===&lt;br /&gt;
Create backup and restore functions under 2.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.9x&#039;&#039;&#039;&lt;br /&gt;
TO-DO&lt;br /&gt;
&lt;br /&gt;
=== Upgrade Process ===&lt;br /&gt;
Will need to map existing table structure to new table structure once finalised.&lt;br /&gt;
&lt;br /&gt;
===  Translations ===&lt;br /&gt;
Current 1.9x translations&lt;br /&gt;
* en English&lt;br /&gt;
* de Deutsch German&lt;br /&gt;
* es Español Spanish&lt;br /&gt;
* it Italiano Italian&lt;br /&gt;
&lt;br /&gt;
== Project schedule ==&lt;br /&gt;
=== Milestone 1 ===&lt;br /&gt;
Date: 28/09/2010&lt;br /&gt;
Goal: The specification is reviewed and agreed on by the community. The implementation plan is transferred into sub-tasks in the tracker&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User:Teresa_Gibbison&amp;diff=21762</id>
		<title>User:Teresa Gibbison</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User:Teresa_Gibbison&amp;diff=21762"/>
		<updated>2009-07-08T03:34:22Z</updated>

		<summary type="html">&lt;p&gt;Cttxg: New page: Moodle Administrator for the University of Waikato, Hamilton, NZ. I have been working with Moodle since 2004 having previously worked on two eCDF Funded projects and as the Moodle Administ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Moodle Administrator for the University of Waikato, Hamilton, NZ. I have been working with Moodle since 2004 having previously worked on two eCDF Funded projects and as the Moodle Administration Specialist at the Waikato Institute of Technology.&lt;/div&gt;</summary>
		<author><name>Cttxg</name></author>
	</entry>
</feed>