<?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=Avindra</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=Avindra"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Avindra"/>
	<updated>2026-08-10T19:28:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=User:Avindra_Goolcharan&amp;diff=39446</id>
		<title>User:Avindra Goolcharan</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=User:Avindra_Goolcharan&amp;diff=39446"/>
		<updated>2013-05-01T00:31:01Z</updated>

		<summary type="html">&lt;p&gt;Avindra: Created page with &amp;quot;I am a software developer working with Moodle and Totara.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I am a software developer working with Moodle and Totara.&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=testing_LDAP_on_a_Mac&amp;diff=39445</id>
		<title>testing LDAP on a Mac</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=testing_LDAP_on_a_Mac&amp;diff=39445"/>
		<updated>2013-05-01T00:29:29Z</updated>

		<summary type="html">&lt;p&gt;Avindra: format page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub}}&lt;br /&gt;
&lt;br /&gt;
It was quite a battle to install a LDAP server on my mac and make it work with Moodle. Here are the steps for OpenDS in Mac OSX Lion:&lt;br /&gt;
&lt;br /&gt;
# I had Moodle installed with Apache LDAP module installed too.&lt;br /&gt;
# I downloaded OpenDS for Mac and installed it.  I changed the hostname for jerome.moodle.local.  Which is translated into dc=jerome,dc=moodle,dc=local. I didn’t change cn= Directory Manager. I set the password to ‘admin’. Finally I selected to generate 5 users (if you missed out this step, you can uninstall and reinstall the server. That’s what I did when I ended up to have some difficulties to create a new user.).&lt;br /&gt;
# To test if the LDAP server was correctly installed I run the following command line (in OpenDS/bin folder): &amp;lt;code&amp;gt;./ldapsearch -h 127.0.0.1 -p 1389 -b uid=user2,ou=People,dc=jerome,dc=moodle,dc=local -D “uid=user2,ou=People,dc=jerome,dc=moodle,dc=local” -w admin “(objectClass=*)”&amp;lt;/code&amp;gt;&lt;br /&gt;
# I opended the control panel, and changed the user.2 username for user2. i also changed his password for ‘admin’.&lt;br /&gt;
# In the Moodle LDAP settings, I changed the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Host URL: 127.0.0.1:1389 (it didn’t work without the port LDAP number)&lt;br /&gt;
Distinguished name: uid=user2,ou=People,dc=jerome,dc=moodle,dc=local&lt;br /&gt;
Password: admin&lt;br /&gt;
Contexts: ou=People,dc=jerome,dc=moodle,dc=local (you need this entire linet, just ‘ou=People’ doesn’t work.)&lt;br /&gt;
User attribute: uid&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: disconnect your computer from the network, otherwise the LDAP server could send requests everywhere and you could be banned.&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Form_API&amp;diff=39444</id>
		<title>Form API</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Form_API&amp;diff=39444"/>
		<updated>2013-05-01T00:27:27Z</updated>

		<summary type="html">&lt;p&gt;Avindra: /* add_action_buttons($cancel = true, $submitlabel=null); */ syntax highlighting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
Web Forms in moodle are created using forms API. Form API supports all html elements (checkbox, radio, textbox etc), with improved accessibility and security.&lt;br /&gt;
==Highlights==&lt;br /&gt;
# Tested and optimised for use on major screen-readers Dragon and JAWS. &lt;br /&gt;
# Tableless layout.&lt;br /&gt;
# Process form data securely, with required_param, optional_param and session key.&lt;br /&gt;
# Supports client-side validation&lt;br /&gt;
# Facility to add Moodle help buttons to forms. &lt;br /&gt;
# Support for file repository using [[File_API]]&lt;br /&gt;
# Support for many custom moodle specific and non-specific form elements.&lt;br /&gt;
# Addition for repeated elements.&lt;br /&gt;
# Addition for form elements in advance group&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
For creating a form in moodle, you have to create class extending moodleform class and override [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#definition.28.29 definition] for including form elements.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//moodleform is defined in formslib.php&lt;br /&gt;
require_once(&amp;quot;$CFG-&amp;gt;libdir/formslib.php&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
class simplehtml_form extends moodleform {&lt;br /&gt;
    //Add elements to form&lt;br /&gt;
    public function definition() {&lt;br /&gt;
        global $CFG;&lt;br /&gt;
       &lt;br /&gt;
        $mform = $this-&amp;gt;_form; // Don&#039;t forget the underscore! &lt;br /&gt;
&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;text&#039;, &#039;email&#039;, get_string(&#039;email&#039;)); // Add elements to your form&lt;br /&gt;
        $mform-&amp;gt;setType(&#039;email&#039;, PARAM_NOTAGS);                   //Set type of element&lt;br /&gt;
        $mform-&amp;gt;setDefault(&#039;email&#039;, &#039;Please enter email&#039;);        //Default value&lt;br /&gt;
            ...&lt;br /&gt;
    }&lt;br /&gt;
    //Custom validation should be added here&lt;br /&gt;
    function validation($data, $files) {&lt;br /&gt;
        return array();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Then instantiate form (in this case simplehtml_form) on your page.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
//include simplehtml_form.php&lt;br /&gt;
require_once(&#039;PATH_TO/simplehtml_form.php&#039;);&lt;br /&gt;
&lt;br /&gt;
//Instantiate simplehtml_form &lt;br /&gt;
$mform = new simplehtml_form();&lt;br /&gt;
&lt;br /&gt;
//Form processing and displaying is done here&lt;br /&gt;
if ($mform-&amp;gt;is_cancelled()) {&lt;br /&gt;
    //Handle form cancel operation, if cancel button is present on form&lt;br /&gt;
} else if ($fromform = $mform-&amp;gt;get_data()) {&lt;br /&gt;
  //In this case you process validated data. $mform-&amp;gt;get_data() returns data posted in form.&lt;br /&gt;
} else {&lt;br /&gt;
  // this branch is executed if the form is submitted but the data doesn&#039;t validate and the form should be redisplayed&lt;br /&gt;
  // or on the first display of the form.&lt;br /&gt;
&lt;br /&gt;
  //Set default data (if any)&lt;br /&gt;
  $mform-&amp;gt;set_data($toform);&lt;br /&gt;
  //displays the form&lt;br /&gt;
  $mform-&amp;gt;display();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Form elements==&lt;br /&gt;
===Basic form elements===&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#button button]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#checkbox checkbox]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#radio radio]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#select select]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#multi-select multi-select]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#password password]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#hidden hidden]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#html html] - div element&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#static static] - Display a static text.&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#text text]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#textarea textarea]&lt;br /&gt;
&lt;br /&gt;
===Custom form elements===&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#advcheckbox advcheckbox] - Advance checkbox&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#passwordunmask passwordunmask] - A password element with option to show the password in plaintext.&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#recaptcha recaptcha]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#selectyesno selectyesno]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#selectwithlink selectwithlink]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#date_selector date_selector]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#date_time_selector date_time_selector]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#duration duration]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#editor editor]&lt;br /&gt;
# [https://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms#filepicker filepicker] - upload single file&lt;br /&gt;
# [https://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms#filemanager filemanager] - upload multiple files&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#tags tags]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#addGroup addGroup]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#modgrade modgrade]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#modvisible modvisible]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#choosecoursefile choosecoursefile]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#grading grading]&lt;br /&gt;
# [https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#questioncategory questioncategory]&lt;br /&gt;
&lt;br /&gt;
==Commonly used functions==&lt;br /&gt;
&lt;br /&gt;
====add_action_buttons($cancel = true, $submitlabel=null);====&lt;br /&gt;
&lt;br /&gt;
You will normally use this helper function which is a method of moodleform to add all the &#039;action&#039; buttons to the end of your form. A boolean parameter allow you to specify whether to include a cancel button and specify the label for your submit button (pass the result of get_string). Default for the submit button label is get_string(&#039;savechanges&#039;). Note the &#039;&#039;&#039;$this&#039;&#039;&#039; not &#039;&#039;&#039;$mform&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
   $this-&amp;gt;add_action_buttons();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====[[lib/formslib.php_Form_Definition#setDefault_2|setDefault()]]]====&lt;br /&gt;
To set the default value for an element.&lt;br /&gt;
&lt;br /&gt;
====[[lib/formslib.php_Form_Definition#disabledIf|disableif()]]====&lt;br /&gt;
For any element or groups of element in a form you can conditionally disable the group or individual element depending on conditions.&lt;br /&gt;
&lt;br /&gt;
====[[lib/formslib.php_Form_Definition#addRule|addRule()]]====&lt;br /&gt;
Add rule for server/client side validation. Like text field is required element and is of type email.&lt;br /&gt;
&lt;br /&gt;
====[[lib/formslib.php_Form_Definition#setHelpButton|setHelpButton()]]====&lt;br /&gt;
Sets pop-up help button to a form element.&lt;br /&gt;
&lt;br /&gt;
====[[lib/formslib.php_Form_Definition#addHelpButton|addHelpButton()]]====&lt;br /&gt;
Adds pop-up help button to a form element&lt;br /&gt;
&lt;br /&gt;
====[[lib/formslib.php_Form_Definition#setType|setType()]]====&lt;br /&gt;
PARAM_* types are used to specify how a submitted variable should be cleaned.&lt;br /&gt;
&lt;br /&gt;
====[[lib/formslib.php_Form_Definition#disable_form_change_checker|disable_form_change_checker()]]====&lt;br /&gt;
By default, any Moodle form will pop-up an &amp;quot;Are you sure?&amp;quot; alert if you make some changes and then try to leave the page without saving. Occasionally, that is undesirable, in which case you can call &amp;lt;tt&amp;gt;$mform-&amp;gt;disable_form_change_checker()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
[https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#Use_Fieldsets_to_group_Form_Elements How to group elements]&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Core_APIs]]&lt;br /&gt;
* [[lib/formslib.php_Usage]] &lt;br /&gt;
* [[lib/formslib.php_Form_Definition]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Progress_Bar&amp;diff=39443</id>
		<title>Progress Bar</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Progress_Bar&amp;diff=39443"/>
		<updated>2013-05-01T00:24:44Z</updated>

		<summary type="html">&lt;p&gt;Avindra: syntax highlighting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Progress Bar Lib =&lt;br /&gt;
There are two Progress Bar libs avaiable in Moodle, the old one and a OOP one.&lt;br /&gt;
&lt;br /&gt;
== Old Progress Bar ==&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function print_progress($done, $total, $updatetime=5, $sleeptime=1, $donetext=&#039;&#039;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
== OOP Progress Bar ==&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
set_time_limit(0);&lt;br /&gt;
$pb = new progressbar(&#039;bar&#039;, 500);&lt;br /&gt;
$pb-&amp;gt;create();&lt;br /&gt;
$num_tasks = 200; // the number of tasks to be completed.&lt;br /&gt;
for($cur_task = 0; $cur_task &amp;lt;= $num_tasks; $cur_task++)&lt;br /&gt;
{&lt;br /&gt;
    for ($i=0; $i&amp;lt;100000; $i++)&lt;br /&gt;
    {&lt;br /&gt;
        ;;;&lt;br /&gt;
    }&lt;br /&gt;
    $pb-&amp;gt;update_adv($cur_task, $num_tasks, &#039;this is&#039;. $cur_task . &#039;h&#039;);&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$pt = new progressbar(&#039;zbar&#039;, 900);&lt;br /&gt;
$pt-&amp;gt;create();&lt;br /&gt;
$num_tasks = 200; // the number of tasks to be completed.&lt;br /&gt;
for($cur_task = 0; $cur_task &amp;lt;= $num_tasks; $cur_task++)&lt;br /&gt;
{&lt;br /&gt;
    for ($i=0; $i&amp;lt;100000; $i++)&lt;br /&gt;
    {&lt;br /&gt;
        ;;;&lt;br /&gt;
    }&lt;br /&gt;
    $pt-&amp;gt;update_adv($cur_task, $num_tasks, &#039;this is&#039;. $cur_task . &#039;h&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Student_projects/Admin_page_cleanup/XML_file_format&amp;diff=39442</id>
		<title>Student projects/Admin page cleanup/XML file format</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Student_projects/Admin_page_cleanup/XML_file_format&amp;diff=39442"/>
		<updated>2013-05-01T00:23:31Z</updated>

		<summary type="html">&lt;p&gt;Avindra: /* Sample XML Files */ syntax highlight, reword&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Part of the [[Student projects/Admin page cleanup]] project involves coming up with a format for storing the hierarchy of admin settings and general information about the settings. (N.B. the XML file is for storing &#039;&#039;how&#039;&#039; the settings are organized, not the setting themselves -- those are still stored in the database for reasons of efficiency.) &lt;br /&gt;
&lt;br /&gt;
== XML DTD ==&lt;br /&gt;
The following XML DTD defines the format for the file that&#039;ll store the Moodle Admin structure:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!DOCTYPE moodleadmin [&lt;br /&gt;
   &amp;lt;!ELEMENT moodleadmin (category|settinggroup|settingpage)*&amp;gt;&lt;br /&gt;
   &amp;lt;!ELEMENT category (category|settinggroup|settingpage)*&amp;gt;&lt;br /&gt;
     &amp;lt;!ATTLIST category name CDATA #REQUIRED&lt;br /&gt;
                        visiblename CDATA #REQUIRED&lt;br /&gt;
                        auth CDATA #REQUIRED&amp;gt;&lt;br /&gt;
   &amp;lt;!ELEMENT settinggroup (setting*)&amp;gt;&lt;br /&gt;
     &amp;lt;!ATTLIST settinggroup name CDATA #REQUIRED&lt;br /&gt;
                            visiblename CDATA #REQUIRED&lt;br /&gt;
                            auth CDATA #REQUIRED&lt;br /&gt;
                            icon CDATA #IMPLIED&amp;gt;&lt;br /&gt;
     &amp;lt;!ELEMENT setting EMPTY&amp;gt;&lt;br /&gt;
       &amp;lt;!ATTLIST setting name CDATA #REQUIRED&lt;br /&gt;
                         visiblename CDATA #REQUIRED&lt;br /&gt;
                         type (text|select|htmledit|checkbox|multiselect) #REQUIRED&lt;br /&gt;
                         selectoptions CDATA #IMPLIED&lt;br /&gt;
                         description CDATA #REQUIRED&lt;br /&gt;
                         setoninstall (true|false) #IMPLIED&lt;br /&gt;
                         writeproc CDATA #REQUIRED&lt;br /&gt;
                         readproc CDATA #REQUIRED&amp;gt;&lt;br /&gt;
   &amp;lt;!ELEMENT settingpage EMPTY&amp;gt;&lt;br /&gt;
     &amp;lt;!ATTLIST settingpage name CDATA #REQUIRED&lt;br /&gt;
                           visiblename CDATA #REQUIRED&lt;br /&gt;
                           auth CDATA #REQUIRED&lt;br /&gt;
                           icon CDATA #IMPLIED&lt;br /&gt;
                           hardcoded CDATA #REQUIRED&amp;gt;&lt;br /&gt;
 ]&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sample XML Files ==&lt;br /&gt;
&lt;br /&gt;
The following code represents a short, sample XML file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code xml&amp;gt;&lt;br /&gt;
 &amp;lt;moodleadmin&amp;gt;&lt;br /&gt;
   &amp;lt;category name=&amp;quot;php_code_must_return_string&amp;quot; &lt;br /&gt;
             auth=&amp;quot;php_code_must_return_boolean&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;settinggroup name=&amp;quot;php_code_must_return_string&amp;quot; &lt;br /&gt;
                   auth=&amp;quot;php_code_that_must_return_boolean&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;setting name=&amp;quot;php_code_must_return_string&amp;quot; &lt;br /&gt;
                type=&amp;quot;(text|select|htmledit|checkbox)&amp;quot; &lt;br /&gt;
                selectoptions=&amp;quot;option1,option2,option3&amp;quot; &lt;br /&gt;
                description=&amp;quot;php_code_must_return_string&amp;quot; &lt;br /&gt;
                setoninstall=&amp;quot;(true|false)&amp;quot; &lt;br /&gt;
                writeproc=&amp;quot;php_code_must_return_boolean&amp;quot;&lt;br /&gt;
                readproc=&amp;quot;php_code_must_return_string&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/settinggroup&amp;gt;&lt;br /&gt;
     &amp;lt;settingpage name=&amp;quot;php_code_must_return_string&amp;quot; &lt;br /&gt;
                  hardcoded=&amp;quot;filename.php&amp;quot; &lt;br /&gt;
                  auth=&amp;quot;php_code_must_return_boolean&amp;quot; /&amp;gt;&lt;br /&gt;
   &amp;lt;/category&amp;gt;&lt;br /&gt;
 &amp;lt;/moodleadmin&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A more complete sample is available [http://betaserv.vkm.ca:82/moodle/lib/admin_sample_2.xml here]. The files were validated using [http://www.stg.brown.edu/service/xmlvalid/ this service].&lt;br /&gt;
&lt;br /&gt;
== Explanations ==&lt;br /&gt;
&lt;br /&gt;
Categories appear in the hierarchical menu as folders, while settinggroups and settingpages appear as actual clickable items. Thus, categories can be nested, while settinggroups and settingpages must appear either within a category or at the moodleadmin root level. Settings &#039;&#039;&#039;must&#039;&#039;&#039; appear in a settinggroup.&lt;br /&gt;
&lt;br /&gt;
Next, the attributes. If an attribute has the same name in two different tags (e.g. auth in settingpage and settinggroup), it&#039;s because it serves the same purpose in both tags. To that end, I&#039;ll only describe what happens to each attribute, not each tag/attribute combination. Also, note that many attributes actually take PHP code and not just plaintext, allowing for much more expandability without having to redo the XML DTD every time we need a new feature.&lt;br /&gt;
* name should contain an internal name for the element. This name must be unique within the parent tag (e.g. the same name could exist in two different categories, but all tags one level below a category must have unique names)&lt;br /&gt;
* visiblename should contain the actual text to be displayed to the user (e.g. as the name of the folder, of a settingpage, of an actual setting, etc.) It is parsed through PHP and must contain code that returns a string, for example&lt;br /&gt;
  &amp;amp;amp;quot;User Settings&amp;amp;amp;quot;&lt;br /&gt;
  get_string(&#039;Administration&#039;)&lt;br /&gt;
* auth should contain PHP code that evaluates to either true or false to determine whether or not the current user should be given access to the settinggroup, settingpage or category. The auth field is also used to detect whether we&#039;re on a course page or the main page (since admin links are page-context-sensitive). For example&lt;br /&gt;
  isadmin()&lt;br /&gt;
  iscreator()&lt;br /&gt;
  (($this-&amp;gt;instance-&amp;gt;pageid == SITEID) &amp;amp;amp;amp;&amp;amp;amp;amp; isadmin())&lt;br /&gt;
&lt;br /&gt;
(in progress...)&lt;br /&gt;
&lt;br /&gt;
== Remarks and Things Remaining To Be Done ==&lt;br /&gt;
&lt;br /&gt;
* Defaults aren&#039;t being stored in the XML DTD since the PHP simplexml extension seems unable to process those defaults. Instead, PHP code that deals with the XML must appropriately replace default text when an implied attribute is blank.&lt;br /&gt;
* The main XML file will be stored in lib/admin.xml&lt;br /&gt;
&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Firefox&amp;diff=39441</id>
		<title>Firefox</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Firefox&amp;diff=39441"/>
		<updated>2013-05-01T00:20:24Z</updated>

		<summary type="html">&lt;p&gt;Avindra: /* What is Firefox? */ cleanup section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is Firefox? ==&lt;br /&gt;
Firefox is a free internet browser owned by Mozilla. You can download it from http://www.mozilla-europe.org/en/products/firefox/.&lt;br /&gt;
&lt;br /&gt;
There are a number of very useful developer tools available for Firefox, such as [[Firebug]], the [[Web developer toolbar]], [[Stylish]], and DOM Inspector. These are useful for investigating and fixing bugs in Moodle, especially when working on themes.&lt;br /&gt;
&lt;br /&gt;
== Add-ons ==&lt;br /&gt;
You can customize Firefox with a host of [https://addons.mozilla.org/en-US/firefox/ add-ons].&lt;br /&gt;
&lt;br /&gt;
=== Search plugins ===&lt;br /&gt;
A search plugin allows you to search certain websites directly from the search bar of the browser. &lt;br /&gt;
&lt;br /&gt;
You can find all search plugins for Moodle at http://mycroft.mozdev.org/search-engines.html?name=moodle. &lt;br /&gt;
&lt;br /&gt;
[[Image:Firefox search plugins.png]]&lt;br /&gt;
&lt;br /&gt;
== See also: ==&lt;br /&gt;
* [[Themes FAQ]]&lt;br /&gt;
* [[CSS FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools|Firefox]]&lt;br /&gt;
[[Category:Firefox extensions|Firefox]]&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Setting_up_Eclipse&amp;diff=39440</id>
		<title>Setting up Eclipse</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Setting_up_Eclipse&amp;diff=39440"/>
		<updated>2013-05-01T00:17:07Z</updated>

		<summary type="html">&lt;p&gt;Avindra: remove signatures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://www.eclipse.org/ Eclipse] is an IDE originally designed for Java, but now with plugins for many languages including PHP. It has lots of very powerful features, and it is the editor that some Moodle developers like to use. Other (more) popular choices are vim and emacs.&lt;br /&gt;
&lt;br /&gt;
However, Eclipse is not the easiest program in the world to get started with, so I&#039;m going to take you through it step by step. These instructions assume Eclipse 3.2, the current version at the time of writing. It should not change much between releases.&lt;br /&gt;
&lt;br /&gt;
This article started off as a brain-dump by [[User:Tim Hunt|Tim Hunt]]. Since then, several other people have worked through it and made corrections and the information should be pretty accurate.&lt;br /&gt;
&lt;br /&gt;
A new PHP plugin called PDT, which is better, but uses more memory. Follow the instructions [[#Installing_the_necessary_plugins,_for_Eclipse_Classic]] PART 1. The following instructions, from the section [[#Setting_the_preferences_for_Moodle_development]] mostly still apply after you have done the install, but some of the details are a bit different.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
Eclipse is written in Java, so I recommend getting the latest Java runtime environment from http://java.com/ for maximum speed and reliability.&lt;br /&gt;
&lt;br /&gt;
Eclipse is quite big, so I recommend lots of memory in your computer. I have used it on Windows, MacOS X and Linux, in each case with 1GB of memory, and that is plenty.&lt;br /&gt;
&lt;br /&gt;
==Installing Eclipse==&lt;br /&gt;
&lt;br /&gt;
Go to http://www.eclipse.org/downloads/. Click on the link corresponding to your operating system where it says &#039;&#039;&#039;Eclipse Classic&#039;&#039;&#039;. Choose a Mirror, and wait for the ~100MB download.&lt;br /&gt;
&lt;br /&gt;
You will notice that what you have got is a zip file (unless your system automatically decompresses it for you).&lt;br /&gt;
&lt;br /&gt;
On Windows, unzip it into &#039;&#039;&#039;C:\Program Files&#039;&#039;&#039; (all the files go into an &#039;&#039;&#039;Eclipse&#039;&#039;&#039; folder there). Then look in the Eclipse folder and drag Eclipse.exe to the Start menu/Desktop/Quicklaunch bar to make a shortcut for starting it.&lt;br /&gt;
&lt;br /&gt;
On MacOS, unzip and copy the Eclipse folder into Applications. Go into the Eclipse folder and drag the Eclipse app to the Dock for ease of launching.&lt;br /&gt;
&lt;br /&gt;
On Linux, unzip somewhere suitable, and make an easy way to launch it.&lt;br /&gt;
&lt;br /&gt;
==The first time you run Eclipse==&lt;br /&gt;
&lt;br /&gt;
The first time you launch Eclipse it does a bit of setup stuff, for instance, it creates a &#039;&#039;&#039;workspace&#039;&#039;&#039;. This is where it stores the things you are working on. The default location is sensible on all platforms, so use that. &lt;br /&gt;
&lt;br /&gt;
For some reason, every time you start Eclipse, it asks you which workspace you want to use. I have never seen the need to have more than one, so I recommend turning on the checkbox that says &amp;quot;Use this as the default and do not ask again&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Another thing that happens the first time you run Eclipse is that you arrive at a welcome screen. This has links to various bits of help, which you can read if you like, but you probably don&#039;t need to if you are following these instructions. So find the button on the welcome page that closes it and gets you to the main Eclipse screen.&lt;br /&gt;
&lt;br /&gt;
==Installing the necessary plugins, for Eclipse Classic==&lt;br /&gt;
&lt;br /&gt;
By default, Eclipse comes with the Java tools. For everything else you will need to install some plugins. Before we begin make sure Eclipse is up to date. &#039;&#039;&#039;Help &amp;gt; Check for Updates&#039;&#039;&#039;. For old versions of Eclipse, Eclipse 3.4 or before go to Part 2.&lt;br /&gt;
&lt;br /&gt;
====PART 1====&lt;br /&gt;
PHP Development Tools (PDT) is part of the Eclipse&#039;s standard plugins.&lt;br /&gt;
#Open up Eclipse and on the menu bar go to &#039;&#039;&#039;Help &amp;gt; Install New Software&#039;&#039;&#039;&lt;br /&gt;
#In the &amp;quot;Work with&amp;quot; box type in &amp;lt;nowiki&amp;gt;http://download.eclipse.org/releases/&amp;lt;/nowiki&amp;gt;&#039;&#039;&amp;lt;release name&amp;gt;&#039;&#039;/ &lt;br /&gt;
::for example http://download.eclipse.org/releases/juno/&lt;br /&gt;
#In the next box &amp;quot;type filter text&amp;quot; type in &amp;quot;&#039;&#039;&#039;php&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
#Select the plugin &amp;quot;&#039;&#039;&#039;PHP Development Tools (PDT) SDK Feature&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
#Make sure &amp;quot;Contact all update sites during install ...&amp;quot; is selected and click &amp;quot;&#039;&#039;&#039;Next&#039;&#039;&#039;&amp;quot; &lt;br /&gt;
# Follow the rest of the installation process.&lt;br /&gt;
&lt;br /&gt;
====PART 2====&lt;br /&gt;
The following information of this section about plugins for PHP is for Eclipse 3.4 Ganymede or before.&lt;br /&gt;
&lt;br /&gt;
If you are sitting behind a web proxy, from the &#039;&#039;&#039;Window&#039;&#039;&#039; menu  choose &#039;&#039;&#039;Preferences ...&#039;&#039;&#039;. Choose &#039;&#039;&#039;Install/Update&#039;&#039;&#039; from the tree view on the left, and enter the proxy information in the boxes on the right. If you aren&#039;t behind a proxy, ignore this step. (On Eclipse 3.4.0 on OSX this is in &#039;&#039;&#039;Eclipse &amp;gt; Preferences &amp;gt; General &amp;gt; Network Connections&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
From the &#039;&#039;&#039;Help&#039;&#039;&#039; menu choose &#039;&#039;&#039;Check for Updates&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
On the first screen of the wizard, make sure that &amp;quot;Search for new features to install&amp;quot; is selected, then click &#039;&#039;&#039;Next &amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The next screen is a list of upgrade sites to check. You need to add one to the list, so click the &#039;&#039;&#039;New Remote Site ...&#039;&#039;&#039; Button.&lt;br /&gt;
&lt;br /&gt;
In the pop-up dialog, give the remote site a name like &#039;&#039;&#039;PHPeclipse Update Site&#039;&#039;&#039;; set the URL to http://update.phpeclipse.net/update/nightly; then click &#039;&#039;&#039;OK&#039;&#039;&#039;. Click &#039;&#039;&#039;Finish&#039;&#039;&#039;. Under &#039;&#039;&#039;PHPEclipse Nightly Builds&#039;&#039;&#039;, check &#039;&#039;&#039;PHPeclipse&#039;&#039;&#039;. Click &#039;&#039;&#039;Finish&#039;&#039;&#039;. Wait while it downloads (this may take a few minutes). Click &#039;&#039;&#039;Install&#039;&#039;&#039;. You will be prompted to restart Eclipse, click &#039;&#039;&#039;Restart&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note, there is now also another PHP editor for Eclipse. The update URL is http://download.eclipse.org/tools/pdt/updates/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Restart the wizard (from the &#039;&#039;&#039;Help&#039;&#039;&#039; menu choose &#039;&#039;&#039;Software Updates -&amp;gt; Find and Install&#039;&#039;&#039;). &lt;br /&gt;
&lt;br /&gt;
On the first screen of the wizard, make sure that &amp;quot;Search for new features to install&amp;quot; is selected, then click &#039;&#039;&#039;Next &amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Select just two things in the box &amp;quot;Sites to include in search&amp;quot;:&lt;br /&gt;
* Your newly created &#039;&#039;&#039;Phpeclipse Update Site&#039;&#039;&#039;; and&lt;br /&gt;
* the one called &#039;&#039;&#039;Europa Discovery Site&#039;&#039;&#039; (or possibly &#039;&#039;&#039;Callisto Discovery Site&#039;&#039;&#039;).&lt;br /&gt;
Then click &#039;&#039;&#039;Finish&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
It goes off and sees what updates are available at those sites. As it does so, it may occasionally pop up a dialog asking you to choose a mirror. Each time, select a sensible one.&lt;br /&gt;
&lt;br /&gt;
Eventually, you get to a new wizard for selecting and installing the updates you want (Select the features to install). The ones you want (you may have to expand and search the tree structure) are: all the &#039;&#039;&#039;PHPEclipse Nightly Builds&#039;&#039;&#039; (from your newly created PHPEclipse Update Site) and the &#039;&#039;&#039;Web Standard Tools (WST)&#039;&#039;&#039; (usually under Callisto or Europa Discovery Site --&amp;gt; Web and J2EE Development). &lt;br /&gt;
&lt;br /&gt;
Next, and very importantly, you must click the &#039;&#039;&#039;Select Required&#039;&#039;&#039; button which should resolve dependencies and remove the warning message you are probably worrying about. Then you can click the &#039;&#039;&#039;Next &amp;gt;&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
Read and agree to all the license agreements. Then click &#039;&#039;&#039;Next &amp;gt;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;&#039;Finish&#039;&#039;&#039;, and wait for the plugins to download.&lt;br /&gt;
&lt;br /&gt;
Once the downloads have finished, a warning will pop-up telling you that all the plugins you downloaded are not digitally signed. The Eclipse Foundation built digital signing of plugins into their architecture as a security measure, and then did not sign any of their own plugins! Anyway, click the &#039;&#039;&#039;Install All&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
Finally, a window will pop up asking you to restart Eclipse. Do so.&lt;br /&gt;
&lt;br /&gt;
==Setting the preferences for Moodle development==&lt;br /&gt;
&lt;br /&gt;
Now go to the &#039;&#039;&#039;Window&#039;&#039;&#039; menu, and choose &#039;&#039;&#039;Preferences ...&#039;&#039;&#039; (&#039;&#039;&#039;Eclipse&#039;&#039;&#039; menu on Mac OS X).&lt;br /&gt;
&lt;br /&gt;
The Eclipse preferences are immense, with a tree view on the left, which selects which screen to display on the right. Don&#039;t panic, we&#039;ll guide you through it.&lt;br /&gt;
&lt;br /&gt;
===General settings===&lt;br /&gt;
&lt;br /&gt;
If you have strong feelings about fonts (I would hate to edit code an anything except Andale Mono), choose &#039;&#039;&#039;General -&amp;gt; Appearance -&amp;gt; Colors and Fonts&#039;&#039;&#039; from the tree on the left. Then on the right look under &#039;&#039;&#039;Basic&#039;&#039;&#039; and change &#039;&#039;&#039;Text Font&#039;&#039;&#039;. All the other editor font settings will inherit from this, so this is probably the only one you have to change.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General -&amp;gt; Content Types&#039;&#039;&#039;, select PHP Source File, and add &#039;&#039;&#039;*.html&#039;&#039;&#039; to the box at the bottom.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General -&amp;gt; Editors -&amp;gt; File Associations&#039;&#039;&#039;, if it is not already there, add &#039;&#039;&#039;*.php&#039;&#039;&#039; to the top box. With &#039;&#039;&#039;*.php&#039;&#039;&#039; selected in the top box, make sure &#039;&#039;&#039;PHP Editor&#039;&#039;&#039; is set to default in the bottom box (use the &#039;&#039;&#039;Default&#039;&#039;&#039; button - the default will appear at the top of the list). &lt;br /&gt;
&lt;br /&gt;
With &#039;&#039;&#039;*.html&#039;&#039;&#039; selected in the top box, if it is not already there, add &#039;&#039;&#039;PHP Editor&#039;&#039;&#039; to the bottom box. Then select &#039;&#039;&#039;PHP Editor&#039;&#039;&#039; in the bottom box and click the &#039;&#039;&#039;Default&#039;&#039;&#039; button to change it, because in Moodle, most HTML files actually contain PHP code.&lt;br /&gt;
&lt;br /&gt;
If you use a web proxy, enter the details under &#039;&#039;&#039;Network Connections&#039;&#039;&#039;. (Yes, I know you have entered them somewhere else before. Now you have to enter them again here. I don&#039;t know why. You just do.)&lt;br /&gt;
&lt;br /&gt;
===PHP Settings===&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General -&amp;gt; Editors -&amp;gt; Text Editors&#039;&#039;&#039;, check &#039;&#039;&#039;Show line numbers&#039;&#039;&#039; to display line numbers in the left margin (optional). Click &#039;&#039;&#039;Apply&#039;&#039;&#039;. (When you are editing a PHP file, you could left-click in the left margin and tick the &#039;&#039;&#039;Show Line Numbers&#039;&#039;&#039; line in the contextual menu. However, this toggle only applies to plain text files, &#039;&#039;not&#039;&#039; to HTML or PHP files. The only place where you can toggle line numbers on/off for such files is in the PHP/Appearance menu.)&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;PHPeclipse -&amp;gt; Browser Preview Defaults&#039;&#039;&#039;, turn off all checkboxes (if necessary). Click &#039;&#039;&#039;Apply&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;PHPeclipse -&amp;gt; PHP&#039;&#039;&#039;, on the &#039;&#039;&#039;Appearance&#039;&#039;&#039; tab, set &#039;&#039;&#039;Displayed tab width&#039;&#039;&#039; to 4 (if necessary). Click &#039;&#039;&#039;Apply&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;PHPeclipse -&amp;gt; PHP&#039;&#039;&#039;, on the &#039;&#039;&#039;Typing&#039;&#039;&#039; tab, turn off all the options except &#039;&#039;&#039;Pasting for correct indentation&#039;&#039;&#039;, &#039;&#039;&#039;Insert spaces for tab&#039;&#039;&#039; and &#039;&#039;&#039;Close PHPdocs and comments&#039;&#039;&#039;.  Click &#039;&#039;&#039;Apply&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;PHPeclipse -&amp;gt; PHP -&amp;gt; Editor&#039;&#039;&#039;, turn on &#039;&#039;&#039;Remove trailing spaces on editor save&#039;&#039;&#039;. Click &#039;&#039;&#039;Apply&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;PHPeclipse -&amp;gt; PHP -&amp;gt; Formatter&#039;&#039;&#039;, on the &#039;&#039;&#039;New Lines&#039;&#039;&#039; tab, turn on &#039;&#039;&#039;Clear all blank lines&#039;&#039;&#039;. Click &#039;&#039;&#039;Apply&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;PHPeclipse -&amp;gt; PHP -&amp;gt; Formatter&#039;&#039;&#039;, on the &#039;&#039;&#039;Style&#039;&#039;&#039; tab, turn off &#039;&#039;&#039;Indentation is represented by a tab&#039;&#039;&#039;. Click &#039;&#039;&#039;Apply&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;PHPeclipse -&amp;gt; PHP -&amp;gt; Templates&#039;&#039;&#039;, I like to define a new template to help with debugging:&lt;br /&gt;
;Name&lt;br /&gt;
:dump &lt;br /&gt;
;Description&lt;br /&gt;
:Dump a PHP variable&lt;br /&gt;
;Pattern&lt;br /&gt;
&amp;lt;pre&amp;gt;print_object(${word_selection}${cursor}); // DONOTCOMMIT&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can do other useful things with templates too. Here are two more I use:&lt;br /&gt;
&amp;lt;pre&amp;gt;debugging(&amp;quot;&#039;${word_selection}${cursor}&#039;&amp;quot;); // DONOTCOMMIT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;$$string[&#039;${word_selection}${cursor}&#039;] = &#039;.&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
That is, a simple debug message with a stack trace, and a new language string.&lt;br /&gt;
&lt;br /&gt;
There is a really stupid bug. Under &#039;&#039;&#039;PHPeclipse -&amp;gt; Project Defaults&#039;&#039;&#039;, you would like to add &amp;quot;.&amp;quot; to the &#039;&#039;&#039;Include Paths&#039;&#039;&#039;, but you can&#039;t using the GUI. You will have to edit one of the Eclipse config files by hand. So&lt;br /&gt;
# Note down the path to your Eclipse profile. On Windows it will be something like &#039;&#039;&#039;C:/Documents and settings/XXXX/workspace&#039;&#039;&#039;, and on Unixy systems something like &#039;&#039;&#039;~/workspace&#039;&#039;&#039;.&lt;br /&gt;
# Close Eclipse. &lt;br /&gt;
# Open the file &#039;&#039;&#039;net.sourceforge.phpeclipse.ui.prefs&#039;&#039;&#039; that is in the directory &#039;&#039;&#039;(your workspace)/.metadata/.plugins/org.eclipse.core.runtime/.settings&#039;&#039;&#039; in a text editor.&lt;br /&gt;
# Look for a line in the file that starts &#039;&#039;&#039;_php_include_paths=&#039;&#039;&#039; If it is not there, add it at the end.&lt;br /&gt;
# Change this line to say &#039;&#039;&#039;_php_include_paths=.&#039;&#039;&#039;&lt;br /&gt;
# Run Eclipse again.&lt;br /&gt;
&lt;br /&gt;
===SSH2===&lt;br /&gt;
Information about generating SSH2 keys for the purpose of connecting to cvs.moodle.org can be found here at https://docs.moodle.org/en/Development:SSH_key , but please finish reading this section before reading that material.&lt;br /&gt;
&lt;br /&gt;
The Eclipse installation has its own SSH client plugin so you do not have to use a separate ssh client in connection with your use of Eclipse (this is one reason you will be using extssh below,  instead of just ext,  however,  if you wish you may alter the configuration to use an external client but please post news of your success and configuration). See, http://www.jcraft.com/eclipse-cvsssh2/ , for additional information on this plugin.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039; Since Eclipse 3.0M6 the CVSSSH plugin is incorporated into Eclipse, [http://www.jroller.com/prane/entry/eclipse_3_0_cvs_support as &amp;quot;extssh&amp;quot; instead of &amp;quot;extssh2&amp;quot;]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Please note that Eclipse is fully equipped to generate ssh2 rsa and dsa keys as well as import keys.  You may encounter issues with passphrases that are too long (a bug reportedly fixed but which may still in fact be present) and some issues with using keypairs generated by other applications have been seen, so it may be best to generate a key pair with Eclipse. Additional details on how to do this will be added.&lt;br /&gt;
&lt;br /&gt;
Sourceforge, at http://sourceforge.net/docs/F02/ , provides instructions on how to create a SSH key for it&#039;s CVS (remember,  Moodle does not use sourceforge for its CVS now and you will need to generate keys for cvs.moodle.org, not sourceforge). This is mentioned by way of general explanation, not for the purposes of providing instructions on how to generate your keys for Eclipse. To make use of the public key, login to Moodle.org and add it via the Update My Developer Information tab under CVS Developers (http://moodle.org/cvs). Remember,  public keys provided to Moodle must be in the Openssh format.&lt;br /&gt;
&lt;br /&gt;
===CVS Settings===&lt;br /&gt;
&lt;br /&gt;
These are almost all hidden under the &#039;&#039;&#039;Team&#039;&#039;&#039; bit of the tree.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;General -&amp;gt; Network Connections -&amp;gt; SSH2 -&amp;gt; Key Management&#039;&#039;&#039;, you can set up a public/private key pair. If you do this, you won&#039;t have to keep typing your password when doing CVS operations. &lt;br /&gt;
&lt;br /&gt;
The rest of the ones in this section are personal preferences, but I recommend them because the default settings are very irritating.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Team&#039;&#039;&#039;, set &#039;&#039;&#039;Perspectives&#039;&#039;&#039; to &#039;&#039;&#039;None&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Team -&amp;gt; CVS&#039;&#039;&#039;, on the &#039;&#039;&#039;Files and Folders&#039;&#039;&#039; tab, set &#039;&#039;&#039;Default text mode&#039;&#039;&#039; to &#039;&#039;&#039;ASCII with keyword expansion (-kkv)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Team -&amp;gt; CVS -&amp;gt; Annotate&#039;&#039;&#039; set &#039;&#039;&#039;Use Quick Diff annotate mode for local file annotations&#039;&#039;&#039; to &#039;&#039;&#039;Yes&#039;&#039;&#039;, and &#039;&#039;&#039;Open perspective after a &#039;Show Annotations&#039; operation&#039;&#039;&#039; to &#039;&#039;&#039;No&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Team -&amp;gt; CVS -&amp;gt; Label Decorations&#039;&#039;&#039;, switch to the &#039;&#039;&#039;Icon Decorations&#039;&#039;&#039; tab and turn on all the settings, and then on the &#039;&#039;&#039;Text Decorations&#039;&#039;&#039; tab change both &#039;&#039;&#039;File Decoration&#039;&#039;&#039; and &#039;&#039;&#039;Folder Decoration&#039;&#039;&#039; to be just &#039;&#039;&#039;{name}&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Web and XML settings===&lt;br /&gt;
&lt;br /&gt;
For each XXX in CSS, HTML, Javascript, XML:&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Web and XML -&amp;gt; XML Files -&amp;gt; Source&#039;&#039;&#039;, choose &#039;&#039;&#039;Indent using spaces&#039;&#039;&#039; and &#039;&#039;&#039;indentation size&#039;&#039;&#039; 4.&lt;br /&gt;
&lt;br /&gt;
==Checking out the Moodle code==&lt;br /&gt;
&lt;br /&gt;
From the &#039;&#039;&#039;File&#039;&#039;&#039; menu, choose &#039;&#039;&#039;New -&amp;gt; Project ...&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In the wizard that pops up, choose &#039;&#039;&#039;CVS -&amp;gt; Projects from CVS&#039;&#039;&#039;, then click &#039;&#039;&#039;Next &amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Select &#039;&#039;&#039;Create a new repository location&#039;&#039;&#039;, then click &#039;&#039;&#039;Next &amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Fill in&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; border: 1px solid orange; padding: 0 1em;&amp;quot;&amp;gt;&lt;br /&gt;
For anonymous CVS access use&lt;br /&gt;
;Host&lt;br /&gt;
:XX.cvs.moodle.org&lt;br /&gt;
where XX.cvs.moodle.org is one of [[:en:CVS_for_Administrators#CVS_Servers|these mirrors]]&lt;br /&gt;
;Repository path&lt;br /&gt;
:/cvsroot/moodle&lt;br /&gt;
;User&lt;br /&gt;
:anonymous&lt;br /&gt;
;Password&lt;br /&gt;
:(leave blank)&lt;br /&gt;
;Connection type&lt;br /&gt;
:pserver&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
;Host&lt;br /&gt;
:cvs.moodle.org&lt;br /&gt;
;Repository path&lt;br /&gt;
:/cvsroot/moodle&lt;br /&gt;
;User&lt;br /&gt;
:(your Moodle CVS username)&lt;br /&gt;
;Password&lt;br /&gt;
:(if you set up the SSH2 key thing in preferences, leave this blank, otherwise, type in your Moodle CVS password.)&lt;br /&gt;
;Connection type&lt;br /&gt;
:extssh&lt;br /&gt;
(CVS experts, if you are confused by that last one, know it is an Eclipse-specific thing.) Then click &#039;&#039;&#039;Next &amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
On the next screen of the Wizard, choose &#039;&#039;&#039;Use an existing module&#039;&#039;&#039;. Wait a moment, then select &#039;&#039;&#039;moodle&#039;&#039;&#039; from the list. Click &#039;&#039;&#039;Next &amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
On the next screen, make sure the option &#039;&#039;&#039;Check out as a project configured using the New Project Wizard&#039;&#039;&#039; is selected, then click &#039;&#039;&#039;Next &amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;&#039;Refresh Tags&#039;&#039;&#039;, then choose the branch you want. For now leave it set to &#039;&#039;&#039;HEAD&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;&#039;Finish&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you  will find yourself back at the start of the &#039;&#039;&#039;New Project&#039;&#039;&#039; Wizard. This is because of the option you chose three paragraphs ago. This time you should select &#039;&#039;&#039;PHP -&amp;gt; PHP Project&#039;&#039;&#039;, then click &#039;&#039;&#039;Next &amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Make up a project name. &#039;&#039;&#039;moodle&#039;&#039;&#039; would be sensible.&lt;br /&gt;
&lt;br /&gt;
Click &#039;&#039;&#039;Finish&#039;&#039;&#039;, and wait while all the moodle files are checked out of CVS.&lt;br /&gt;
&lt;br /&gt;
Once it has finished, it will probably ask you if you want to switch to the PHP perspective. Answer &#039;&#039;&#039;Yes&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you also need another branch (1.6, 1.7, 1.8, ...) repeat all the other steps with a few changes:&lt;br /&gt;
* This time you can choose &#039;&#039;&#039;Use an existing repository location&#039;&#039;&#039; instead of typing all the sourceforge CVS details again.&lt;br /&gt;
* Select the appropriate branch. If you don&#039;t see the branch you want, see [https://docs.moodle.org/en/Development:Setting_up_Eclipse#Resetting_the_branch_information this Troubleshooting tip].&lt;br /&gt;
* Use a different project name (e.g. moodle16, moodle17, etc.).&lt;br /&gt;
&lt;br /&gt;
==Let your development web server know where your files are==&lt;br /&gt;
&lt;br /&gt;
Either by editing you web server&#039;s config files, or using a symbolic link. Make sure your webserver can see your new working set of files at a sensible URL, so you can test the code you are working on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Quick tour of some cool features, and remaining configuration changes==&lt;br /&gt;
&lt;br /&gt;
I find the default workbench setup is pretty good. Here is a quick guide to some of the bits.&lt;br /&gt;
&lt;br /&gt;
===Navigator===&lt;br /&gt;
&lt;br /&gt;
To the left is the &#039;&#039;&#039;Navigator&#039;&#039;&#039;. This is a tree view of all your files. If you double-click on a file, it opens in the editor in the middle. Try opening &#039;&#039;&#039;course/lib.php&#039;&#039;&#039; now. You will notice that it comes up nicely syntax-highlighted.&lt;br /&gt;
&lt;br /&gt;
===Error highlighting===&lt;br /&gt;
&lt;br /&gt;
In the middle of the file, just type any old text, for example &amp;quot;I like Eclipse&amp;quot;. Obviously, this is not valid PHP syntax, and Eclipse will notice this, and put a red underline under it. Also, by the scrollbar is a ruler with a red mark in it to show the error.&lt;br /&gt;
&lt;br /&gt;
You will see some yellow marks lower down the ruler. There are warnings. Click on one, and you will be taken to where that warning is in the file. Hover your mouse over the warning, and you will get a tooltip explaining what the problem might be.&lt;br /&gt;
&lt;br /&gt;
Save the edited file. (Don&#039;t worry that it is broken, we&#039;ll clean up the mess later.) Notice that a red error marker is added to the file in the navigator, so you can see that there is a problem. Also, error markers are added to the course folder, and the whole project, so you could see there was an error even if the navigator tree was collapsed.&lt;br /&gt;
&lt;br /&gt;
You will probably find lots of warnings that the config.php file can&#039;t be found. In the navigator, find the file &#039;&#039;&#039;config-dist.php&#039;&#039;&#039;. Do &#039;&#039;&#039;Copy&#039;&#039;&#039; then &#039;&#039;&#039;Paste&#039;&#039;&#039; and choose to call the new file &#039;&#039;&#039;config.php&#039;&#039;&#039;. Edit this new config.php as normal. You should find that most of the include file warnings have gone now.&lt;br /&gt;
&lt;br /&gt;
Notice also that there is another marker on each file icon. A little yellow cylinder on most files, but a white-on-brown star on the one you have edited. This is telling you the CVS status of each file. The brown stars are changes you have made but not checked in yet.&lt;br /&gt;
&lt;br /&gt;
===Outline===&lt;br /&gt;
&lt;br /&gt;
Over to the right is the Outline view. This shows a list of functions and classes defined in this file. By default, they are listed in the same order as in the file, but if you click on the &#039;&#039;&#039;az&#039;&#039;&#039; toolbar button, they are sorted into alphabetical order.&lt;br /&gt;
&lt;br /&gt;
Click on the function name &#039;&#039;&#039;add_course_module&#039;&#039;&#039; in the Outline. You will see that the editor scrolls to the definition of that function.&lt;br /&gt;
&lt;br /&gt;
===Code navigation===&lt;br /&gt;
&lt;br /&gt;
In that function, hover the mouse pointer over the function name &#039;&#039;&#039;insert_record&#039;&#039;&#039;. After a while, the documentation for that function will appear in a big tooltip.&lt;br /&gt;
&lt;br /&gt;
Hold down CTRL, move the mouse pointer over the function name &#039;&#039;&#039;insert_record&#039;&#039;&#039;, then click. Eclipse should load &#039;&#039;&#039;dmllib.php&#039;&#039;&#039;, and scroll you to where this function is defined. (You can also do this by clicking on the function name and pressing the F3 key.)&lt;br /&gt;
&lt;br /&gt;
In the main Eclipse toolbar, there are forward and back arrows like in a web browser. Click back now to get back to &#039;&#039;&#039;course/lib.php&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Open resource===&lt;br /&gt;
&lt;br /&gt;
From the &#039;&#039;&#039;Navigate&#039;&#039;&#039; menu, choose &#039;&#039;&#039;Open Resource...&#039;&#039;&#039;. In the dialog that pops up, start typing a filename for instance type &#039;&#039;&#039;moodlel&#039;&#039;&#039;. In the box in the middle of the dialog, you will see it list all the files in the project whose names start that way. At the bottom is a box which lists the different folders that contain a file with that name. This can be a very quick way of opening files with fairly unique names like moodlelib.php, without having to click through the levels of the navigator tree. Of course, it is not so useful for an index.php file! Click OK now to open moodlelib.php. (It would actually work if you just did CTRL + Shift + R, moodlel, Enter.)&lt;br /&gt;
&lt;br /&gt;
===Multi-file search===&lt;br /&gt;
&lt;br /&gt;
Scroll down moodlelib a little bit, and double click on the name of the constant &#039;&#039;&#039;MOODLE_INTERNAL&#039;&#039;&#039; where it is defined, so that the text is selected. Then, from the &#039;&#039;&#039;Search&#039;&#039;&#039; menu, choose &#039;&#039;&#039;Search...&#039;&#039;&#039;. Notice that the &#039;&#039;&#039;Containing text&#039;&#039;&#039; box has already been filled in for you with the text you just selected. Of course you can just type text into this box without selecting it first. Notice that you can do regular expression searches, but leave that turned off for now. In the &#039;&#039;&#039;File name patterns&#039;&#039;&#039; box type &#039;&#039;&#039;*.css, *.html, *.inc, *.js, *.php, *.xml&#039;&#039;&#039;. (This is the most useful general setting for working on moodle. Eclipse will remember this setting, so you only have to enter it once.) Click &#039;&#039;&#039;Search&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The search results will appear in a new view underneath the editor. That view has a toolbar with yellow up and down arrows. Click the down arrow a few times and it will take you to the first few matches in the code, opening the relevant files as necessary.&lt;br /&gt;
&lt;br /&gt;
===Synchronize view===&lt;br /&gt;
&lt;br /&gt;
I think this is my favorite feature. From the &#039;&#039;&#039;Window&#039;&#039;&#039; menu, select &#039;&#039;&#039;Show View -&amp;gt; Other...&#039;&#039;&#039;. In the dialog that pops up, select &#039;&#039;&#039;Team -&amp;gt; Synchronize&#039;&#039;&#039;, then click &#039;&#039;&#039;OK&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This opens the Synchronize view below the editor. The view has a toolbar. Click on the first toolbar button, which pops up the Synchronize wizard.&lt;br /&gt;
&lt;br /&gt;
On the first screen, there will probably only be one option: &#039;&#039;&#039;CVS&#039;&#039;&#039;. Make sure that is selected, then click &#039;&#039;&#039;Next &amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Under &#039;&#039;&#039;Scope&#039;&#039;&#039;, choose &#039;&#039;&#039;Workspace&#039;&#039;&#039;, then click &#039;&#039;&#039;Finish&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Wait while it talks to the CVS server. After a while, you will see that the Synchronize view lists course/lib.php, and something called &#039;&#039;&#039;.project...&#039;&#039;&#039; That is, it is listing just the files you have edited, but not checked in yet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;.project&#039;&#039;&#039; is something that belongs to Eclipse that we don&#039;t care about. So select it and bring up the context menu, and choose &#039;&#039;&#039;Add to .cvsignore...&#039;&#039;&#039;. In the dialog that pops up, choose the top option, then click &#039;&#039;&#039;OK&#039;&#039;&#039;. Then you will find the Synchronize view shows you a &#039;&#039;&#039;.cvsignore&#039;&#039;&#039; file that you aren&#039;t interested in, so add that to .cvsignore too!&lt;br /&gt;
&lt;br /&gt;
If you double-click on &#039;&#039;&#039;course/lib.php&#039;&#039;&#039; here, you will see that it opens the compare editor, which is a nice graphical display of the changes in this file.&lt;br /&gt;
&lt;br /&gt;
If you select a file or files here, then bring up the context menu, you will see the option to &#039;&#039;&#039;Commit...&#039;&#039;&#039; the changes. (But don&#039;t do that now!). This is the easiest way to commit things in Eclipse.&lt;br /&gt;
&lt;br /&gt;
However, our changes were rubbish, so we want to undo them. So open the context menu again, and choose &#039;&#039;&#039;Override and Update&#039;&#039;&#039;. This checks a clean copy of the file out of CVS, removing our changes.&lt;br /&gt;
&lt;br /&gt;
Note that the easiest way to do an ordinary CVS Update is to select the top-level project-folder in the Navigator view on the left, open the context menu, and choose &#039;&#039;&#039;Team -&amp;gt; Update&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
That&#039;s all of the really important features. I&#039;m sure you can learn everything else on your own. And you can always read the built in help!&lt;br /&gt;
&lt;br /&gt;
===Creating a patch===&lt;br /&gt;
&lt;br /&gt;
In the synchronise view, right-click an item (file or folder) and choose &#039;&#039;&#039;Create Patch...&#039;&#039;&#039;. Or in the navigator, right-click an item and choose &#039;&#039;&#039;Team -&amp;gt; Create Patch...&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This brings up a two-page wizard. On the first page you can select where you want the patch made. For small patches it can be useful to create them on the clipboard, but normally you will want to save them in a file.&lt;br /&gt;
&lt;br /&gt;
On the second page, you can set some options, but normally you don&#039;t need to change the defaults which are &#039;&#039;&#039;Unified&#039;&#039;&#039; diff format, and Patch root set to &#039;&#039;&#039;Workspace&#039;&#039;&#039;. Well, sometimes it is helpful to change the second one to &#039;&#039;&#039;Project&#039;&#039;&#039; but it is not important.&lt;br /&gt;
&lt;br /&gt;
There is a corresponding apply patch wizard that you can use to apply a patch to a project.&lt;br /&gt;
&lt;br /&gt;
===Switching to another branch or version===&lt;br /&gt;
&lt;br /&gt;
Suppose you have been using a check-out of HEAD from CVS, and then as the 1.9 release approaches, the MOODLE_19_STABLE branch is created, and you want to start following that instead.&lt;br /&gt;
# Right click on the moodle project in the navigator view, and select &#039;&#039;&#039;Team -&amp;gt; Switch to Another Branch or Version ...&#039;&#039;&#039;.&lt;br /&gt;
# choose the second radio button: &#039;&#039;&#039;Select the tag from the following list&#039;&#039;&#039;.&lt;br /&gt;
# If the branch you want is not in the &#039;&#039;&#039;Matching tags&#039;&#039;&#039; box, see [[Setting_up_Eclipse#Resetting the branch information|Resetting the branch information]] below.&lt;br /&gt;
# Select the branch you want and click &#039;&#039;&#039;Finish&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
Some tips on how to solve common problems that may crop up.&lt;br /&gt;
&lt;br /&gt;
===Resetting the branch information===&lt;br /&gt;
&lt;br /&gt;
Every now and then, Eclipse may lose information on the branch tags it knows about. Hitting refresh tags may fix it, but if not, try the following:&lt;br /&gt;
&lt;br /&gt;
#Bring up the tag dialogue (example using &amp;quot;Team / Switch to Another Branch or Version&amp;quot;).&lt;br /&gt;
#Click on Configure tags... (not Refresh tags).&lt;br /&gt;
#Select config-dist.php in the top left box (if this is a Moodle checkout).&lt;br /&gt;
#Click Add Checked tags.&lt;br /&gt;
#Click OK.&lt;br /&gt;
#Then you will have all tags.&lt;br /&gt;
&lt;br /&gt;
(thanks to Tim Hunt)&lt;br /&gt;
&lt;br /&gt;
This info saved my day to find all branches:&lt;br /&gt;
   1. Window-&amp;gt;Show View-&amp;gt;Other. Select CVS-&amp;gt;CVS Repositories.&lt;br /&gt;
   2. Context Menu-&amp;gt;New-&amp;gt;Repository Location...&lt;br /&gt;
   3. Fill in the location information identifying your repository and click Finish.&lt;br /&gt;
   4. Expand the newly-created repository location.&lt;br /&gt;
   5. Add the branch:&lt;br /&gt;
         1. Right-click it and expand configure branches and versions.&lt;br /&gt;
         2. Expand HEAD and select the project moodle.&lt;br /&gt;
         3. Context Menu-&amp;gt;Configure Branches and Versions...&lt;br /&gt;
         4. In the &amp;quot;Browse files for tags&amp;quot; table, select one or more files &lt;br /&gt;
            that contain tags you would like to see (for example scroll down &lt;br /&gt;
            to find config.php).&lt;br /&gt;
         5. On the right the existing tags will appear.&lt;br /&gt;
         6. Select the tags: for example MOODLE_15_STABLE&lt;br /&gt;
         7. Click &amp;quot;Add Selected Tags&amp;quot;.&lt;br /&gt;
         8. Click &amp;quot;OK&amp;quot;.&lt;br /&gt;
   6. Locate branches, MOODLE_19_STABLE, moodle MOODLE_19_STABLE.&lt;br /&gt;
   7. Context Menu-&amp;gt;Check Out As Project.&lt;br /&gt;
(&amp;quot;stolen&amp;quot; from  Joan Codina Filba	&lt;br /&gt;
General developer forum -&amp;gt; Moodle floating &amp;quot;block&amp;quot;/toolbar released -&amp;gt; Re: Moodle floating &amp;quot;block--PATCH FOR GRADES &amp;amp; ASIGNMENT --PROBLEM)&lt;br /&gt;
&lt;br /&gt;
===Error loading php files after Ubuntu 7.04 Install===&lt;br /&gt;
&lt;br /&gt;
A java issue with Ubuntu 7.04 may cause an error when you attempt to load php pages. Refer to:&lt;br /&gt;
http://www.plog4u.org/index.php/Using_PHPEclipse_:_Installation_:_Installing_PHPEclipse for details about how to fix this in Ubuntu 7.04.&lt;br /&gt;
&lt;br /&gt;
After upgrading from Ubuntu 7.04 to 7.10, I had to go in and re-edit the /etc/eclipse/java_home file in order to get the CVS functions to work and be able to open PHP files. When I tried to do a CVS update, I initially received an error about org.eclipse.team.internal.ccvs.ui.wizards.CheckoutWizard). Everything seemed to work again after reapplying the fix for the aforementioned 7.04 java issue.&lt;br /&gt;
&lt;br /&gt;
===Strange mouse behavior in Eclipse with Ubuntu 9.10===&lt;br /&gt;
&lt;br /&gt;
After upgrading to Ubuntu 9.10 I began have left mouse clicks that did not appear to be actually firing off the expected events. I stumbled across https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/452938. Essentially what I did was modify /usr/bin/eclipse and added in the line: export GDK_NATIVE_WINDOWS=true so that it executes before starting Eclipse.&lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
There is an excellent series of articles published by IBM on using Eclipse for Drupal developement here : [http://www-128.ibm.com/developerworks/ibm/osource/index.html Using open source software to design, develop, and deploy a collaborative Web site Tools and techniques for getting relatively complicated Web sites up and running quickly].&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer tools|Eclipse]]&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Admin_reports&amp;diff=36327</id>
		<title>Admin reports</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Admin_reports&amp;diff=36327"/>
		<updated>2012-11-13T01:59:33Z</updated>

		<summary type="html">&lt;p&gt;Avindra: syntax highlighting, formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.1}}&lt;br /&gt;
This document applies to Moodle versions before 2.2.  See [[Reports]] for the new unified reports in Moodle 2.2 and later.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
An admin report is a folder of code under admin/report. For example, you might make a folder in there called &#039;&#039;&#039;myreport&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In there, the only code you are required to have is an index.php file. This will normally display a simple HTML form for controlling the report, and, the code for displaying the report. You will probably also want a language file, which would be called lang/en_utf8/report_myreport.php following the example above. &lt;br /&gt;
&lt;br /&gt;
In addition, you can add any other PHP code you like, and then link people to it from index.php.&lt;br /&gt;
&lt;br /&gt;
So, the minimal code layout is:&lt;br /&gt;
&lt;br /&gt;
 admin/&lt;br /&gt;
   ...&lt;br /&gt;
   report/&lt;br /&gt;
     backups/&lt;br /&gt;
     capability/&lt;br /&gt;
     ...&lt;br /&gt;
     myreport/&lt;br /&gt;
       lang/&lt;br /&gt;
         en_utf8/&lt;br /&gt;
           report_myreport.php&lt;br /&gt;
       index.php&lt;br /&gt;
     ...&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
==What to do in index.php==&lt;br /&gt;
&lt;br /&gt;
The simplest way to work this out is by example. You should look at some of the reports that ship with Moodle. [http://cvs.moodle.org/moodle/admin/report/capability/index.php?view=markup admin/report/capability], is a good one to start with. Let us go through that example to see what is there (I will put into italics the bits that are more advanced - the things that the capability report does, but which a simple report will not need to do.):&lt;br /&gt;
# Require some libraries. Admin reports will always need config.php and adminlib.php.&lt;br /&gt;
# Check the user is logged in and has appropriate permissions. &#039;&#039;(Normally admin reports are controlled by the &#039;moodle/site:viewreports&#039; capability, the capability report is a special case.)&#039;&#039;&lt;br /&gt;
# Get the parameters from the URL that control the report, and clean them up a bit.&lt;br /&gt;
# &#039;&#039;Include some JavaScript code that enhances the report for people with JavaScript turned on in their browser.&#039;&#039;&lt;br /&gt;
# Log this request.&lt;br /&gt;
# Print the page header. Since this is an administration page, we need to do this using the admin_externalpage... functions. You probably just need to copy these two lines exactly, then replace &#039;capability&#039; with your report name.&lt;br /&gt;
# Display a form to control the report.&lt;br /&gt;
# If the URL contains all the parameters needed to generate the report, do so, and display the results. &#039;&#039;(You don&#039;t need to understand the details of what the capability report is doing, because your report will do something different. However, the general structure will probably be the same: get some data out of the database, then display it.)&#039;&#039;&lt;br /&gt;
# Print the footer, using the admin_externalpage... function.&lt;br /&gt;
# &#039;&#039;Define some functions, if that is the best way to structure the code of your report. You could, of course, create a separate lib.php file inside your report folder.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==How your report gets included in the admin tree==&lt;br /&gt;
&lt;br /&gt;
By default, your report will be included in the admin tree under the &#039;Reports&#039; section, and it will only appear to people with the &#039;moodle/site:viewreports&#039; capability. If the report is in the &#039;&#039;myreport&#039;&#039; folder, then the report name will be get_string(&amp;quot;myreport&amp;quot;, &amp;quot;report_&#039;&#039;myreport&#039;&#039;&amp;quot;). The report name, needed for the call to admin_externalpage_setup, will be &amp;quot;report&#039;&#039;myreport&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you want more control over how your report appears, for example, if you want it to appear somewhere other than under Reports, or if you want it to be controlled by another capability, then you can create a settings.php file. For example, for the capability report, there is a settings.php file that contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 &amp;lt;?php  // $Id$&lt;br /&gt;
 $ADMIN-&amp;gt;add(&#039;&#039;&#039;&amp;quot;roles&amp;quot;&#039;&#039;&#039;, new admin_externalpage(&#039;reportcapability&#039;,&lt;br /&gt;
	get_string(&#039;capability&#039;, &#039;report_capability&#039;),&lt;br /&gt;
	&amp;quot;$CFG-&amp;gt;wwwroot/$CFG-&amp;gt;admin/report/capability/index.php&amp;quot;,&lt;br /&gt;
	&amp;quot;moodle/role:manage&amp;quot;&lt;br /&gt;
));&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(The two non-standard bits there have been put into bold.)&lt;br /&gt;
&lt;br /&gt;
==Strings you must define in you lang/en_utf8/report_&#039;&#039;myreport&#039;&#039;.php==&lt;br /&gt;
&lt;br /&gt;
You just need to define&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 $string[&amp;quot;myreport&amp;quot;] = &#039;What my report is called&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to make the report show up properly in the admin tree, but if your report does anything interesting, you will almost certainly need more.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating a new report in admin block ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am using Moodle 1.9. I have created a new reporting module in my local moodle server.  I tried following the examples on this page but was not able to get the new report folder to show in my menu, the admin_externalpage functions where failing. To accomplish the same thing, I completed these steps:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1 -&#039;&#039;&#039; Created a new folder under admin\report, called AU_ProfessionalDevelopment&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2 -&#039;&#039;&#039; Copied index.php and settings.php from the admin\report\question folder into the AU_ProfessionalDevelopment folder.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3 -&#039;&#039;&#039; edited setting.php, updating the string &#039;&#039;&#039;question&#039;&#039;&#039; with folder name &#039;&#039;&#039;AU_ProfessionalDevelopment&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4 -&#039;&#039;&#039; edited index.php, stripping out most of the code, leaving the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    require_once(&#039;../../../config.php&#039;);&lt;br /&gt;
    require_once($CFG-&amp;gt;libdir.&#039;/adminlib.php&#039;);&lt;br /&gt;
    admin_externalpage_setup(&#039;reportAU_ProfessionalDevelopment&#039;);&lt;br /&gt;
    admin_externalpage_print_header();&lt;br /&gt;
    admin_externalpage_print_footer();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5&#039;&#039;&#039; Reloaded the moodle page (i am logged in as the admin - and can see the Admin. Block). I can see &#039;&#039;&#039;AU_ProfessionalDevelopment&#039;&#039;&#039; in the admin\report block.  Clicking on it loads my page with the admin header and footer.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=913 System images report] this is another very simple report, in contrib. Might be a good one to look at.&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Admin_settings&amp;diff=36267</id>
		<title>Admin settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Admin_settings&amp;diff=36267"/>
		<updated>2012-11-09T21:36:10Z</updated>

		<summary type="html">&lt;p&gt;Avindra: syntax highlighting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Moodle&#039;s configuration is stored in a mixture of the config, config_plugins, and a few other tables. These settings are edited through the administration screens, which can be accessed by going to the .../admin/index.php URL on your moodle site, or using the Administration block that appears to administrators of the Moodle front page. This page explains how the code for displaying and editing of these settings works.&lt;br /&gt;
&lt;br /&gt;
==Where to find the code==&lt;br /&gt;
&lt;br /&gt;
This is explained further below, but in summary:&lt;br /&gt;
* The library code is all in lib/adminlib.php.&lt;br /&gt;
* The definition of the all the parts of the admin tree is in admin/settings/* some of which call out to plugins to see if they have settings they want to add.&lt;br /&gt;
* The editing and saving of settings is managed by admin/settings.php, admin/upgradesettings.php, and admin/search.php.&lt;br /&gt;
* The administration blocks that appear on the front page and on most of the admin screens is in blocks/admin_tree and blocks/admin_bookmarks.&lt;br /&gt;
&lt;br /&gt;
In my experience most of this code is pretty easy to understand and work with, so here I will focus on giving an overview. For details, see the code.&lt;br /&gt;
&lt;br /&gt;
==The building blocks==&lt;br /&gt;
&lt;br /&gt;
All the settings are arranged into a tree structure. This tree structure is represented in memory as a tree of PHP objects.&lt;br /&gt;
&lt;br /&gt;
At the root of the tree is an &#039;&#039;&#039;admin_root&#039;&#039;&#039; object.&lt;br /&gt;
&lt;br /&gt;
That has children that are &#039;&#039;&#039;admin_category&#039;&#039;&#039;s.&lt;br /&gt;
&lt;br /&gt;
Admin categories contain other categories, &#039;&#039;&#039;admin_settingpage&#039;&#039;&#039;s, and &#039;&#039;&#039;admin_externalpage&#039;&#039;&#039;s.&lt;br /&gt;
&lt;br /&gt;
Settings pages contain individual &#039;&#039;&#039;admin_setting&#039;&#039;&#039;s.&lt;br /&gt;
&lt;br /&gt;
admin_setting is a base class with lots of subclasses like &#039;&#039;&#039;admin_setting_configtext&#039;&#039;&#039;, &#039;&#039;&#039;admin_setting_configcheckbox&#039;&#039;&#039;, and so on. If you need to, you can create new subclasses.&lt;br /&gt;
&lt;br /&gt;
External pages are for things that do not fit into the normal settings structure. For example the global assign roles page, or the page for managing activity modules.&lt;br /&gt;
&lt;br /&gt;
==How the tree is built==&lt;br /&gt;
&lt;br /&gt;
When Moodle needs the admin tree, it calls admin_get_root in lib/adminlib.php, which&lt;br /&gt;
# creates a global $ADMIN object which is an instance of admin_root.&lt;br /&gt;
# does require_once admin/settings/top.php, which adds the top level categories to $ADMIN.&lt;br /&gt;
# does require_once on all the other files in admin/settings to add more specific settings pages and the settings themselves. Some of these settings files additionally make calls out to various types of plugins. For example&lt;br /&gt;
#* admin/settings/plugins.php gives activity modules, blocks, question types, ... a chance to add admin settings.&lt;br /&gt;
# adds the admin reports to the tree.&lt;br /&gt;
&lt;br /&gt;
As an optimisation, before building each bit of the tree, some capability checks are performed, and bits of the tree are skipped if the current user does not have permission to access them.&lt;br /&gt;
&lt;br /&gt;
Exactly how different types of plugin should add their settings to the tree should be documented in the [[Developer_documentation#Make_a_new_plugin|instructions for writing that sort of plugin]].&lt;br /&gt;
&lt;br /&gt;
==Individual settings==&lt;br /&gt;
&lt;br /&gt;
Let us look at a simple example: [http://cvs.moodle.org/moodle/mod/forum/settings.php?view=markup mod/forum/settings.php]. This is included by admin/settings/plugins.php, which has already created $settings, which is an admin_settingpage that we can add to. The file contains lots of lines that look a bit like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 $settings-&amp;gt;add(new admin_setting_configcheckbox(&#039;forum_replytouser&#039;, get_string(&#039;replytouser&#039;, &#039;forum&#039;),&lt;br /&gt;
                    get_string(&#039;replytouser_desc&#039;, &#039;forum&#039;), 1));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What this means is that to our settings page, we are adding a checkbox setting. To understand this in more detail, we need to know what arguments the constructor for an admin_setting takes. The definition of the constructor is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 function admin_setting($name, $visiblename, $description, $defaultsetting) {&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, $name here is &#039;forum_replytouser&#039;. This means that this setting is stored in the database in the row of the config table where name=&#039;forum_replytouser&#039;, and is accessible as $CFG-&amp;gt;forum_replytouser.&lt;br /&gt;
&lt;br /&gt;
$visiblename is get_string(&#039;replytouser&#039;, &#039;forum&#039;), this is the label that is put in front of setting on the admin screen.&lt;br /&gt;
&lt;br /&gt;
$description is get_string(&#039;replytouser_desc&#039;, &#039;forum&#039;), this is a short bit of text displayed underneath the setting to explain it further.&lt;br /&gt;
&lt;br /&gt;
$defaultsetting is the default value for this setting. This value is used when Moodle is installed. For simple settings like checkboxes and text fields, this is a simple value. For some more complicated settings, this is an array.&lt;br /&gt;
&lt;br /&gt;
Let as now look at a more complicated example, from mod/quiz/settingstree.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 $quizsettings-&amp;gt;add(new admin_setting_text_with_advanced(&#039;quiz/timelimit&#039;,&lt;br /&gt;
         get_string(&#039;timelimit&#039;, &#039;quiz&#039;), get_string(&#039;timelimit_desc&#039;, &#039;quiz&#039;),&lt;br /&gt;
         array(&#039;value&#039; =&amp;gt; &#039;0&#039;, &#039;fix&#039; =&amp;gt; false), PARAM_INT));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This shows two new things:&lt;br /&gt;
&lt;br /&gt;
$name here is &#039;quiz/timelimit&#039;. This is more complicated than a simple setting name. It means that this setting is stored in the config_plugins table, in the row where plugin=&#039;quiz&#039; and name=&#039;timelimit&#039;. It is not accessible through $CFG, to get it you can use get_config(&#039;quiz&#039;, &#039;timelimit&#039;).&lt;br /&gt;
&lt;br /&gt;
And this example shows a $defaultsetting that is an array.&lt;br /&gt;
&lt;br /&gt;
Normally, if you want a particular sort of setting, the easiest way is to look around the admin screens of your Moodle site, and find a setting like the one you want. Then go and copy the code and edit it. Therefore, we do not include a complete list of setting types here.&lt;br /&gt;
&lt;br /&gt;
==External pages==&lt;br /&gt;
&lt;br /&gt;
admin_externalpages represent screens of settings that do not fall into the standard pattern of admin_settings. The admin_externalpage object in the settings tree holds the URL of a PHP page that controls various settings.&lt;br /&gt;
&lt;br /&gt;
In that PHP page, near the start you need to call the function admin_externalpage_setup($pagename), then, instead of the usual print_header and print_footer functions, you use admin_externalpage_print_header() and admin_externalpage_print_footer() functions. This ensures that your page appears with the administration blocks and appropriate navigation.&lt;br /&gt;
&lt;br /&gt;
Note that if your external page relies on additional optional or required params, you may need to use the optional arguments to admin_externalpage_print_header to ensure that the Blocks editing on/off button works.&lt;br /&gt;
&lt;br /&gt;
Note that there are some subclasses of admin_externalpage, for example admin_page_managemods. In a lot of cases, these subclasses only exist to override the search method so this page can be found by appropriate searches.&lt;br /&gt;
&lt;br /&gt;
Once again, to understand this in more depth, your best approach is to look at how some of the external pages in Moodle work.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Modules|adding settings for actvitiy modules]]&lt;br /&gt;
* [[Admin_reports#How_your_report_gets_included_in_the_admin_tree|adding admin reports to the tree]]&lt;br /&gt;
* [[Repository_plugins#APIs_for_Administration|configuration of repository plugins]]&lt;br /&gt;
* [[Filters#Adding_a_settings_screen|configuration for filter]]&lt;br /&gt;
* [[Developer_documentation|Other developer documentation]]&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Reports&amp;diff=36252</id>
		<title>Reports</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Reports&amp;diff=36252"/>
		<updated>2012-11-09T17:48:48Z</updated>

		<summary type="html">&lt;p&gt;Avindra: syntax highlighting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.2}}&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.2 the [[Course reports]] and [[Admin reports]] were combined into one Reports directory (/report) that serves both needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
A report is a folder of code under /report. For example, you might make a folder in there called &#039;&#039;&#039;myreport&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
In there, the only code you are required to have is an index.php file. This will normally display a simple HTML form for controlling the report, and, the code for displaying the report. You will probably also want a language file, which would be called lang/en_utf8/report_myreport.php following the example above. &lt;br /&gt;
&lt;br /&gt;
In addition, you can add any other PHP code you like, and then link people to it from index.php.&lt;br /&gt;
&lt;br /&gt;
So, the minimal code layout is:&lt;br /&gt;
&lt;br /&gt;
 report/&lt;br /&gt;
  backups/&lt;br /&gt;
  completion/&lt;br /&gt;
  ...&lt;br /&gt;
  myreport/&lt;br /&gt;
   lang/&lt;br /&gt;
    en/&lt;br /&gt;
     report_myreport.php&lt;br /&gt;
   index.php&lt;br /&gt;
   version.php&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
==What to do in index.php==&lt;br /&gt;
&lt;br /&gt;
The simplest way to work this out is by example. You should look at some of the reports that ship with Moodle. [https://github.com/moodle/moodle/blob/master/report/configlog/index.php report/log] is a good one to start with. Let us go through that example to see what is there (I will put into italics the bits that are more advanced):&lt;br /&gt;
&lt;br /&gt;
# Require some libraries.&lt;br /&gt;
# Check the user is logged in and has appropriate permissions - all external admin pages use admin_externalpage_setup() which by default requires &#039;moodle/site:config&#039; capability&lt;br /&gt;
# Get the parameters from the URL that control the report, and clean them up a bit.&lt;br /&gt;
# Print the page header. Since this is an administration page, we need to do this using the admin_externalpage... functions. &lt;br /&gt;
# Display a table with data and paging controls&lt;br /&gt;
# Print the footer&lt;br /&gt;
&lt;br /&gt;
==How your report gets included in the navigation ==&lt;br /&gt;
&lt;br /&gt;
Reports can present itself in different contexts:&lt;br /&gt;
* system level - controlled by settings.php&lt;br /&gt;
* at user level - controlled by *_extend_navigation_user() callbacks&lt;br /&gt;
* at course level - controlled by *_extend_navigation_course() callbacks&lt;br /&gt;
* at module level - controlled by *_extend_navigation_module() callbacks&lt;br /&gt;
&lt;br /&gt;
In our example the configlog report is usable only at the system level, the admin tree integration is done through settings.php file&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$ADMIN-&amp;gt;add(&#039;reports&#039;, new admin_externalpage(&#039;reportconfiglog&#039;, get_string(&#039;configlog&#039;, &#039;report_configlog&#039;), &amp;quot;$CFG-&amp;gt;wwwroot/report/configlog/index.php&amp;quot;));&lt;br /&gt;
$settings = null;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;$settings = null&amp;lt;/code&amp;gt; tells moodle that plugin does not have any settings and only want to display link to external admin page.&lt;br /&gt;
&lt;br /&gt;
If you want to include your report in course navigation for example you need to create lib.php file and add following function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function report_myreport_extend_navigation_course($navigation, $course, $context) {&lt;br /&gt;
    if (has_capability(&#039;report/myreport:view&#039;, $context)) {&lt;br /&gt;
        $url = new moodle_url(&#039;/report/myreport/index.php&#039;, array(&#039;id&#039;=&amp;gt;$course-&amp;gt;id));&lt;br /&gt;
        $navigation-&amp;gt;add(get_string(&#039;pluginname&#039;, &#039;report_myreport&#039;), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon(&#039;i/report&#039;, &#039;&#039;));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will also need access.php file with definition of  &#039;report/myreport:view&#039; capability.&lt;br /&gt;
&lt;br /&gt;
==Strings you must define in you lang/en/report_&#039;&#039;myreport&#039;&#039;.php==&lt;br /&gt;
&lt;br /&gt;
You just need to define&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 $string[&#039;pluginname&#039;] = &#039;What my report is called&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to make the report show up properly in the admin tree, but if your report does anything interesting, you will almost certainly need more.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=913 System images report] this is another very simple report, in contrib. Might be a good one to look at.&lt;br /&gt;
* [[General report plugins]] - new reports in 2.2+&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Plugin_types&amp;diff=36251</id>
		<title>Plugin types</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Plugin_types&amp;diff=36251"/>
		<updated>2012-11-09T17:45:45Z</updated>

		<summary type="html">&lt;p&gt;Avindra: syntax highlighting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The M in Moodle stands for modular.  The easiest and most maintainable way to add new functionality to Moodle is by writing one of these types of plugin. &lt;br /&gt;
If none of the standardized types fits your needs, you can use the &amp;quot;local&amp;quot; type.&lt;br /&gt;
&lt;br /&gt;
You can get the most recent list of types with the following script, or refer to the table below.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 &amp;lt;?php                                                                                                        &lt;br /&gt;
 define(&#039;CLI_SCRIPT&#039;, true);&lt;br /&gt;
 require(&#039;path/to/config.php&#039;); // global moodle config file.&lt;br /&gt;
 print_object(get_plugin_types());&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Plugin type&lt;br /&gt;
! Component name&lt;br /&gt;
! Moodle path&lt;br /&gt;
! Description&lt;br /&gt;
! Moodle versions&lt;br /&gt;
|-&lt;br /&gt;
| [[Activity modules]]&lt;br /&gt;
| mod&lt;br /&gt;
| /mod&lt;br /&gt;
| Activity modules are the most important type of plugins.  They provide activities in courses.  For example: Forum, Quiz and Assignment.&lt;br /&gt;
| All&lt;br /&gt;
|-&lt;br /&gt;
| [[Admin reports]]&lt;br /&gt;
| report&lt;br /&gt;
| /admin/report&lt;br /&gt;
| Provides useful views of data in a Moodle site, for admins only.&lt;br /&gt;
| Up to 2.1 (for 2.2+ see [[Reports]])&lt;br /&gt;
|-&lt;br /&gt;
| [[Admin tools]]&lt;br /&gt;
| tool&lt;br /&gt;
| /admin/tool&lt;br /&gt;
| Provides utility scripts useful for admins to examine and modify a Moodle site&lt;br /&gt;
| 2.2+&lt;br /&gt;
|-&lt;br /&gt;
| [[Assignment types|Assignment 2.2 types]]&lt;br /&gt;
| assignment&lt;br /&gt;
| /mod/assignment/type&lt;br /&gt;
| Different forms of assignments to be graded by teachers&lt;br /&gt;
| 1.x - 2.2&lt;br /&gt;
|-&lt;br /&gt;
| Assignment 2.3 submissions&lt;br /&gt;
| assignsubmission&lt;br /&gt;
| /mod/assign/submission&lt;br /&gt;
| Different forms of assignment submissions&lt;br /&gt;
| 2.3+&lt;br /&gt;
|-&lt;br /&gt;
| Assignment 2.3 feedbacks&lt;br /&gt;
| assignfeedback&lt;br /&gt;
| /mod/assign/feedback&lt;br /&gt;
| Different forms of assignment feedbacks&lt;br /&gt;
| 2.3+&lt;br /&gt;
|-&lt;br /&gt;
| [[Authentication plugins]]&lt;br /&gt;
| auth&lt;br /&gt;
| /auth&lt;br /&gt;
| Allows connection to external sources of authentication&lt;br /&gt;
| 2.0&lt;br /&gt;
|-&lt;br /&gt;
| [[Blocks]]&lt;br /&gt;
| block&lt;br /&gt;
| /blocks&lt;br /&gt;
| Small information-displays or tools that can be moved around pages&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Course formats]]&lt;br /&gt;
| format&lt;br /&gt;
| /course/format&lt;br /&gt;
| Different ways of laying out the activities and blocks in a course&lt;br /&gt;
| 1.3+&lt;br /&gt;
|-&lt;br /&gt;
| [[Course reports]]&lt;br /&gt;
| coursereport&lt;br /&gt;
| /course/report&lt;br /&gt;
| Reports of activity within the course&lt;br /&gt;
| Up to 2.1 (for 2.2+ see [[Reports]])&lt;br /&gt;
|-&lt;br /&gt;
| [[Database fields]]&lt;br /&gt;
| datafield&lt;br /&gt;
| /mod/data/field&lt;br /&gt;
| Different types of data that may be added to the Database activity module&lt;br /&gt;
| 1.6+&lt;br /&gt;
|-&lt;br /&gt;
| [[Database presets]]&lt;br /&gt;
| datapreset&lt;br /&gt;
| /mod/data/preset&lt;br /&gt;
| Pre-defined templates for the Database activity module&lt;br /&gt;
| 1.6+&lt;br /&gt;
|-&lt;br /&gt;
| [[Editors]]&lt;br /&gt;
| editor&lt;br /&gt;
| /lib/editor&lt;br /&gt;
| Alternative text editors for editing content&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Enrolment plugins]]&lt;br /&gt;
| enrol&lt;br /&gt;
| /enrol&lt;br /&gt;
| Ways to control who is enrolled in courses&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Filters]]&lt;br /&gt;
| filter&lt;br /&gt;
| /filter&lt;br /&gt;
| Automatically convert, highlight, and transmogrify text posted into Moodle.&lt;br /&gt;
| 1.4+&lt;br /&gt;
|-&lt;br /&gt;
| [[Gradebook export]]&lt;br /&gt;
| gradeexport&lt;br /&gt;
| /grade/export&lt;br /&gt;
| Export grades in various formats&lt;br /&gt;
| 1.9+&lt;br /&gt;
|-&lt;br /&gt;
| [[Gradebook import]]&lt;br /&gt;
| gradeimport&lt;br /&gt;
| /grade/import&lt;br /&gt;
| Import grades in various formats &lt;br /&gt;
| 1.9+&lt;br /&gt;
|-&lt;br /&gt;
| [[Gradebook reports]]&lt;br /&gt;
| gradereport&lt;br /&gt;
| /grade/report&lt;br /&gt;
| Display/edit grades in various layouts and reports&lt;br /&gt;
| 1.9+&lt;br /&gt;
|-&lt;br /&gt;
| [[Grading methods]]&lt;br /&gt;
| gradingform&lt;br /&gt;
| /grade/grading/form&lt;br /&gt;
| Interfaces for actually performing grading in activity modules (eg Rubrics).&lt;br /&gt;
| 2.2+&lt;br /&gt;
|-&lt;br /&gt;
| [[Local plugins]]&lt;br /&gt;
| local&lt;br /&gt;
| /local&lt;br /&gt;
| Generic plugins for local customisations&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Messaging consumers]]&lt;br /&gt;
| message&lt;br /&gt;
| /message/output&lt;br /&gt;
| Send messages to users via different methods (email, sms, jabber, etc)&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Plagiarism plugins]]&lt;br /&gt;
| plagiarism&lt;br /&gt;
| /plagiarism&lt;br /&gt;
| Define external services to process submitted files and content&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Portfolio plugins]]&lt;br /&gt;
| portfolio&lt;br /&gt;
| /portfolio&lt;br /&gt;
| Connect external portfolio services as destinations for users to store Moodle content&lt;br /&gt;
| 1.9+&lt;br /&gt;
|-&lt;br /&gt;
| [[Question behaviours]]&lt;br /&gt;
| qbehaviour&lt;br /&gt;
| /question/behaviour&lt;br /&gt;
| Control how student interact with questions during an attempt&lt;br /&gt;
| 2.1+&lt;br /&gt;
|-&lt;br /&gt;
| [[Question formats]]&lt;br /&gt;
| qformat&lt;br /&gt;
| /question/format&lt;br /&gt;
| Import and export question definitions to/from the question bank&lt;br /&gt;
| 1.6+&lt;br /&gt;
|-&lt;br /&gt;
| [[Question types]]&lt;br /&gt;
| qtype&lt;br /&gt;
| /question/type&lt;br /&gt;
| Different types of question (e.g. multiple-choice, drag-and-drop) that can be used in quizzes and other activities&lt;br /&gt;
| 1.6+&lt;br /&gt;
|-&lt;br /&gt;
| [[Quiz access rules]]&lt;br /&gt;
| quizaccess&lt;br /&gt;
| /mod/quiz/accessrule&lt;br /&gt;
| Add conditions to when or where quizzes can be attempted, for example only from some IP addresses, or student must enter a password first&lt;br /&gt;
| 2.2+&lt;br /&gt;
|-&lt;br /&gt;
| [[Quiz reports]]&lt;br /&gt;
| quiz&lt;br /&gt;
| /mod/quiz/report&lt;br /&gt;
| Display and analyse the results of quizzes, or just plug miscellaneous behaviour into the quiz module&lt;br /&gt;
| 1.1+&lt;br /&gt;
|-&lt;br /&gt;
| [[Reports]]&lt;br /&gt;
| report&lt;br /&gt;
| /report&lt;br /&gt;
| Provides useful views of data in a Moodle site for admins and teachers&lt;br /&gt;
| 2.2+&lt;br /&gt;
|-&lt;br /&gt;
| [[Repository plugins]]&lt;br /&gt;
| repository&lt;br /&gt;
| /repository&lt;br /&gt;
| Connect to external sources of files to use in Moodle&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[SCORM reports]]&lt;br /&gt;
| scormreport&lt;br /&gt;
| /mod/scorm/report&lt;br /&gt;
| Analysis of SCORM attempts&lt;br /&gt;
| 2.2+&lt;br /&gt;
|-&lt;br /&gt;
| [[Themes]]&lt;br /&gt;
| theme&lt;br /&gt;
| /theme&lt;br /&gt;
| Change the look of Moodle by changing the the HTML and the CSS.  See also [[Themes 1.9]].&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[User profile fields]]&lt;br /&gt;
| profilefield&lt;br /&gt;
| /user/profile/field&lt;br /&gt;
| Add new types of data to user profiles&lt;br /&gt;
| 1.9+&lt;br /&gt;
|-&lt;br /&gt;
| [[Webservice protocols]]&lt;br /&gt;
| webservice&lt;br /&gt;
| /webservice&lt;br /&gt;
| Define new protocols for web service communication (such as SOAP, XML-RPC, JSON, REST ...)&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Workshop allocation methods]]&lt;br /&gt;
| workshopallocation&lt;br /&gt;
| /mod/workshop/allocation&lt;br /&gt;
| Define ways how submissions are assigned for assessment in the [[Workshop]] module&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Workshop evaluation methods]]&lt;br /&gt;
| workshopeval&lt;br /&gt;
| /mod/workshop/eval&lt;br /&gt;
| Implement the calculation of the grade for assessment (grading grade) in the [[Workshop]] module&lt;br /&gt;
| 2.0+&lt;br /&gt;
|-&lt;br /&gt;
| [[Workshop grading strategies]]&lt;br /&gt;
| workshopform&lt;br /&gt;
| /mod/workshop/form&lt;br /&gt;
| Define the type of the grading form and implement the calculation of the grade for submission in the [[Workshop]] module&lt;br /&gt;
| 2.0+&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Guidelines_for_contributed_code|Guidelines for contributing code]]&lt;br /&gt;
* [[Core APIs]]&lt;br /&gt;
* [[Frankenstyle]]&lt;br /&gt;
* [http://moodle.org/plugins Moodle Plugins database] - lists all the modules that people have contributed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines|Plugins]]&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Finding_your_way_into_the_Moodle_code&amp;diff=36250</id>
		<title>Finding your way into the Moodle code</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Finding_your_way_into_the_Moodle_code&amp;diff=36250"/>
		<updated>2012-11-09T17:44:13Z</updated>

		<summary type="html">&lt;p&gt;Avindra: syntax highlighting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is aimed at people totally new to Moodle development and have some PHP experience, if you don&#039;t have that experience please visit [[PHP for novices|PHP for novices]]. It is a few tips to help you get started with the mass of Moodle code.&lt;br /&gt;
&lt;br /&gt;
Please feel free to add more tips here, but I think it is also good if we can keep this article quite short.&lt;br /&gt;
&lt;br /&gt;
==Developer documentation==&lt;br /&gt;
&lt;br /&gt;
If you have not already found it, the main source of developer documentation is [[Developer_documentation]].&lt;br /&gt;
&lt;br /&gt;
==Finding a way in==&lt;br /&gt;
&lt;br /&gt;
For finding where to start, you need to know that when you are looking at, for example, http://moodle.org/mod/forum/discuss.php?d=82799, then the code for that is in /mod/forum/discuss.php, and you just need to follow through what it does.&lt;br /&gt;
&lt;br /&gt;
It calls functions in the main Moodle libraries, and the three most important are:&lt;br /&gt;
&lt;br /&gt;
*lib/moodlelib.php - general stuff.&lt;br /&gt;
*lib/weblib.php - things to do with output of HTML&lt;br /&gt;
*lib/dmllib.php - things to do with getting data in and out of the database.&lt;br /&gt;
&lt;br /&gt;
==Understanding what you find==&lt;br /&gt;
&lt;br /&gt;
As you look at the code, it is often a good idea, to insert statements like&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 debugging(&#039;In function require_login&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
which will print the message above if it gets far enough so you know the code has not stalled before there, or&lt;br /&gt;
 print_object($course);&lt;br /&gt;
which will print out a variable, showing you what it contains. &lt;br /&gt;
&lt;br /&gt;
Variable like $course are often objects with lots of fields. Seeing what they contain will help you understand what is going on. The first of these prints out whatever text you give it, and information about the sequence of function calls that the code took to get there. (It only works if you go to &#039;&#039;Administration &amp;gt; Server &amp;gt; [[:en:Debugging|Debugging]]&#039;&#039;, and turn the debug level to ALL or DEVELOPER.)&lt;br /&gt;
&lt;br /&gt;
==Tools that can help==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Eclipse&#039;&#039;&#039;, for instance helps finding function definitions. You can hold down CTRL and click on the name of a function, it immediately jumps you to where that function is defined. ([[Setting_up_Eclipse]])&lt;br /&gt;
*&#039;&#039;&#039;Emacs&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;Vim&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;TextMate&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See also [[Developer documentation#Tools]] and [[:Category:Developer tools]].&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [http://dev.moodle.org/course/view.php?id=2 Introduction to Moodle Programming] a course at dev.moodle.org&lt;br /&gt;
* [[Development FAQ]]&lt;br /&gt;
* [[Developer_documentation]]&lt;br /&gt;
* [[Overview]]&lt;br /&gt;
* [[ctags]]&lt;br /&gt;
* [http://blog.danpoltawski.co.uk/archives/2009-05-Secrets-of-Learning-Moodle-Development!.html &amp;quot;Secrets of Learning Moodle Development!&amp;quot;] by Moodle core developer [[User:Dan Poltawski| Dan Poltawski]]&lt;br /&gt;
* [http://www.slideshare.net/tjh1000/a-basic-introduciton-to-the-moodle-architecture-5442122 A basic introduction to the Moodle architecture] by Moodle core developer Tim Hunt&lt;br /&gt;
* [http://www.aosabook.org/en/moodle.html The Architecture of Open Source Applications: Moodle] by Tim Hunt&lt;/div&gt;</summary>
		<author><name>Avindra</name></author>
	</entry>
</feed>