<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jp76</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jp76"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/Special:Contributions/Jp76"/>
	<updated>2026-04-26T20:07:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Migrating_to_2.0_checklist&amp;diff=80921</id>
		<title>Development:Migrating to 2.0 checklist</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Migrating_to_2.0_checklist&amp;diff=80921"/>
		<updated>2011-01-28T10:37:01Z</updated>

		<summary type="html">&lt;p&gt;Jp76: /* General */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are things that OU developers have found so far to check/do in code we&#039;re migrating from Moodle 1.9 to 2.0.  All information on the detail of this checklist can be found elsewhere in Moodle Docs, and particularly from the [[Development:Migrating_contrib_code_to_2.0]]&lt;br /&gt;
&lt;br /&gt;
Not all these things are essential for a rush job, but if you did all of them, then that&#039;d be great.  We should really mark each one with a priority of some sort!&lt;br /&gt;
&lt;br /&gt;
Please add/edit this list!&lt;br /&gt;
&lt;br /&gt;
==Database==&lt;br /&gt;
&lt;br /&gt;
* 	Leave empty db/update.php file&lt;br /&gt;
* 	New $DB global objects with functions replace old db functions&lt;br /&gt;
* 	$DB parameters swapped to ? &lt;br /&gt;
* 	Add and strip slashes no longer required&lt;br /&gt;
* 	Remove use of ENUM and ENUMVALUES in install.xml file&lt;br /&gt;
* 	check use of sql_substr() &lt;br /&gt;
* 	Get_records() etc now always returning arrays, empty array in case of no records found. &lt;br /&gt;
* 	Db functions throw errors not return false on error&lt;br /&gt;
* 	DB functions offer strictness parameters e.g MUST_EXIST&lt;br /&gt;
* 	Update version.php numbers (esp required)&lt;br /&gt;
&lt;br /&gt;
==Page display==&lt;br /&gt;
&lt;br /&gt;
* 	New $OUTPUT header and footer functions&lt;br /&gt;
* Navigation links need to use $PAGE-&amp;gt;navbar&lt;br /&gt;
* 	Make sure that you instantiate the moodle form before any call to $OUTPUT-&amp;gt;header()&lt;br /&gt;
* 	Create a renderer&lt;br /&gt;
*       Change the way image urls are displayed (not $CFG-&amp;gt;pixpath any more)&lt;br /&gt;
*       CSS changes&lt;br /&gt;
**      Change styles.php to styles.css&lt;br /&gt;
**      Change page id to new structure e.g. course-format-studyplan to page-course-view-studyplan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Roles and Permissions:==&lt;br /&gt;
&lt;br /&gt;
* 	array name to $capabilities in access.php&lt;br /&gt;
* 	Remove references to admin in access.php&lt;br /&gt;
* 	Rename legacy to archetypes in access.php&lt;br /&gt;
* 	Add manager archetype in access.php&lt;br /&gt;
* 	Ensure require_login as well as require_capability checks&lt;br /&gt;
*       isguest() is depreicated, use !isloggedin() || isguestuser() instead&lt;br /&gt;
&lt;br /&gt;
==Language strings==&lt;br /&gt;
&lt;br /&gt;
* 	Rename language folder&lt;br /&gt;
* 	Change $a to {$a} in language files&lt;br /&gt;
* 	Change popup help files to _help lang strings and shorten&lt;br /&gt;
* 	Add $string[‘pluginname’] to lang file&lt;br /&gt;
* 	Add $string[‘pluginadministration’] to lang file&lt;br /&gt;
&lt;br /&gt;
==Forms==&lt;br /&gt;
&lt;br /&gt;
* 	Param_clean parameter type removed&lt;br /&gt;
* 	type required parameter for optional_and required_param&lt;br /&gt;
* 	Replace file form elements with new filepicker&lt;br /&gt;
* 	Replace htmleditor with editor form field type&lt;br /&gt;
*       Change setHelpButton to addHelpButton. (You need to change the arguments, but the new ones are simpler.)&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
* 	Swap config_ files to edit and settings php files&lt;br /&gt;
* 	Fix whitespace &amp;amp; coding style&lt;br /&gt;
* 	rs_fetch_next_record($rs) is deprecated, in favour of the simple foreach($rs as $var). Calls to rs_close() must be replaced by $rs-&amp;gt;close();&lt;br /&gt;
* 	Check functions deprecated list: https://docs.moodle.org/en/Development:Deprecated_functions_in_2.0&lt;br /&gt;
* 	Use print_error() or throw new moodle_exception not error()&lt;br /&gt;
* 	Replace all url strings e.g. in redirect() calls with moodle_url instances&lt;br /&gt;
* Move install/uninstall functions from lib to db/install.php, lib/uninstall.php&lt;br /&gt;
* Move images into pix folder (especially icon.gif), get path by calling $OUTPUT-&amp;gt;pix_url(&#039;icon&#039;, &#039;local_whatever&#039;);&lt;br /&gt;
* Add &#039;supports&#039; function in lib (modname_supports()) for modules (and blocks?).&lt;br /&gt;
* New Backup and Restore process - https://docs.moodle.org/en/Development:Backup_2.0_for_developers https://docs.moodle.org/en/Development:Restore_2.0_for_developers&lt;br /&gt;
* Add db/log.php file if you have log calls (see a code module code for example)&lt;/div&gt;</summary>
		<author><name>Jp76</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Migrating_to_2.0_checklist&amp;diff=80917</id>
		<title>Development:Migrating to 2.0 checklist</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Migrating_to_2.0_checklist&amp;diff=80917"/>
		<updated>2011-01-28T10:08:03Z</updated>

		<summary type="html">&lt;p&gt;Jp76: Added backup and restore details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are things that OU developers have found so far to check/do in code we&#039;re migrating from Moodle 1.9 to 2.0.  All information on the detail of this checklist can be found elsewhere in Moodle Docs, and particularly from the [[Development:Migrating_contrib_code_to_2.0]]&lt;br /&gt;
&lt;br /&gt;
Not all these things are essential for a rush job, but if you did all of them, then that&#039;d be great.  We should really mark each one with a priority of some sort!&lt;br /&gt;
&lt;br /&gt;
Please add/edit this list!&lt;br /&gt;
&lt;br /&gt;
==Database==&lt;br /&gt;
&lt;br /&gt;
* 	Leave empty db/update.php file&lt;br /&gt;
* 	New $DB global objects with functions replace old db functions&lt;br /&gt;
* 	$DB parameters swapped to ? &lt;br /&gt;
* 	Add and strip slashes no longer required&lt;br /&gt;
* 	Remove use of ENUM and ENUMVALUES in install.xml file&lt;br /&gt;
* 	check use of sql_substr() &lt;br /&gt;
* 	Get_records() etc now always returning arrays, empty array in case of no records found. &lt;br /&gt;
* 	Db functions throw errors not return false on error&lt;br /&gt;
* 	DB functions offer strictness parameters e.g MUST_EXIST&lt;br /&gt;
* 	Update version.php numbers (esp required)&lt;br /&gt;
&lt;br /&gt;
==Page display==&lt;br /&gt;
&lt;br /&gt;
* 	New $OUTPUT header and footer functions&lt;br /&gt;
* Navigation links need to use $PAGE-&amp;gt;navbar&lt;br /&gt;
* 	Make sure that you instantiate the moodle form before any call to $OUTPUT-&amp;gt;header()&lt;br /&gt;
* 	Create a renderer&lt;br /&gt;
*       Change the way image urls are displayed (not $CFG-&amp;gt;pixpath any more)&lt;br /&gt;
*       CSS changes&lt;br /&gt;
**      Change styles.php to styles.css&lt;br /&gt;
**      Change page id to new structure e.g. course-format-studyplan to page-course-view-studyplan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Roles and Permissions:==&lt;br /&gt;
&lt;br /&gt;
* 	array name to $capabilities in access.php&lt;br /&gt;
* 	Remove references to admin in access.php&lt;br /&gt;
* 	Rename legacy to archetypes in access.php&lt;br /&gt;
* 	Add manager archetype in access.php&lt;br /&gt;
* 	Ensure require_login as well as require_capability checks&lt;br /&gt;
*       isguest() is depreicated, use !isloggedin() || isguestuser() instead&lt;br /&gt;
&lt;br /&gt;
==Language strings==&lt;br /&gt;
&lt;br /&gt;
* 	Rename language folder&lt;br /&gt;
* 	Change $a to {$a} in language files&lt;br /&gt;
* 	Change popup help files to _help lang strings and shorten&lt;br /&gt;
* 	Add $string[‘pluginname’] to lang file&lt;br /&gt;
* 	Add $string[‘pluginadministration’] to lang file&lt;br /&gt;
&lt;br /&gt;
==Forms==&lt;br /&gt;
&lt;br /&gt;
* 	Param_clean parameter type removed&lt;br /&gt;
* 	type required parameter for optional_and required_param&lt;br /&gt;
* 	Replace file form elements with new filepicker&lt;br /&gt;
* 	Replace htmleditor with editor form field type&lt;br /&gt;
*       Change setHelpButton to addHelpButton. (You need to change the arguments, but the new ones are simpler.)&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
* 	Swap config_ files to edit and settings php files&lt;br /&gt;
* 	Fix whitespace &amp;amp; coding style&lt;br /&gt;
* 	rs_fetch_next_record($rs) is deprecated, in favour of the simple foreach($rs as $var). Calls to rs_close() must be replaced by $rs-&amp;gt;close();&lt;br /&gt;
* 	Check functions deprecated list: https://docs.moodle.org/en/Development:Deprecated_functions_in_2.0&lt;br /&gt;
* 	Use print_error() or throw new moodle_exception not error()&lt;br /&gt;
* 	Replace all url strings e.g. in redirect() calls with moodle_url instances&lt;br /&gt;
* Move install/uninstall functions from lib to db/install.php, lib/uninstall.php&lt;br /&gt;
* Move images into pix folder (especially icon.gif), get path by calling $OUTPUT-&amp;gt;pix_url(&#039;icon&#039;, &#039;local_whatever&#039;);&lt;br /&gt;
* Add &#039;supports&#039; function in lib (modname_supports()) for modules (and blocks?).&lt;br /&gt;
* New Backup and Restore process - https://docs.moodle.org/en/Development:Backup_2.0_for_developers https://docs.moodle.org/en/Development:Restore_2.0_for_developers&lt;/div&gt;</summary>
		<author><name>Jp76</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Filters&amp;diff=65448</id>
		<title>Development:Filters</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Filters&amp;diff=65448"/>
		<updated>2009-11-19T12:04:33Z</updated>

		<summary type="html">&lt;p&gt;Jp76: Removed warning as bug no longer present in 1.9 (language strings work in filters)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Please note:&#039;&#039;&#039; This page contains information for developers. You may prefer to read the [[Filters| information about filters for teachers and administrators]].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Filters&#039;&#039;&#039; allow for the for the automatic transformation of entered text into different, often more complex forms. For example the titles of [[Resources]] can automatically become hyperlinks that take you to the relevant resource, URLs pointing to [[mp3]] files can become [[Flash]] controls embedded in the webpage that let you pause and rewind the audio. The possibilities are endless and there are a number of standard filters included with Moodle and many more specialized filters contributed by the community.&lt;br /&gt;
&lt;br /&gt;
==To create a filter==&lt;br /&gt;
&lt;br /&gt;
To create a filter that removes all occurrences of the letter &amp;quot;x&amp;quot; - we&#039;ll call it &amp;quot;removex&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
# Create a new folder inside Moodle&#039;s /filter/ folder, called &amp;quot;removex&amp;quot;&lt;br /&gt;
# Create a new PHP script file inside the folder you&#039;ve just created - name it &amp;quot;filter.php&amp;quot;&lt;br /&gt;
# Write a new PHP function in this file, called &amp;quot;removex_filter()&amp;quot; which takes two parameters - a course ID and a piece of text to be filtered - and returns the processed text.&lt;br /&gt;
&lt;br /&gt;
For our example the filter.php file would look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
function removex_filter($courseid, $text) {&lt;br /&gt;
    return str_replace(&#039;x&#039;, &#039;&#039;, $text);&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When trying this out, remember to make sure that you activate the filter in the [[Filters|filters administration screen]].&lt;br /&gt;
&lt;br /&gt;
Also remember that text filtering functions, when activated, will be used intensively by the server, so you should optimise the filters as far as possible (cut down on database calls etc). Moodle caches the results of filtering to help with processing speed, but it&#039;s still worth being careful about your filter design.&lt;br /&gt;
&lt;br /&gt;
Filters are applied to all text that is printed with the [[Development:Output functions|output functions]] format_text() or format_string(). One thing to keep in mind when designing the filter is that the function format_text() first applies other transformations (for example text_to_html() or replace_smilies()) before the strings are passed to your filter. The function format_string() on the other hand passes the string as it is.&lt;br /&gt;
&lt;br /&gt;
==Adding a settings screen==&lt;br /&gt;
&lt;br /&gt;
Moodle 1.6 added the options for filters to have their own settings screen. To do this perform the following steps:&lt;br /&gt;
* In the same folder as the filter create a file called &#039;&#039;&#039;filtersettings.php&#039;&#039;&#039;.&lt;br /&gt;
* Add admin_setting objects to the $settings page like this:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$settings-&amp;gt;add(new admin_setting_configcheckbox(&#039;filter_myfilter/mysetting&#039;,&lt;br /&gt;
        get_string(&#039;mysetting&#039;, &#039;filter_myfilter&#039;),&lt;br /&gt;
        get_string(&#039;configmysetting&#039;, &#039;filter_myfilter&#039;), 0));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In standard Moodle, the censor, mediaplugin and tex filters have good examples of what you need to do.&lt;br /&gt;
&lt;br /&gt;
==A note on language strings==&lt;br /&gt;
&lt;br /&gt;
As the sharp-eyed will have noticed in the last section, the language strings for your filter (if any) should go in the file filter/myfilter/lang/en_utf8/filter_myfilter.php, and can be accessed using&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
get_string(&#039;mystring&#039;, &#039;filter_myfilter&#039;).&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can copy and paste the following to start your filter_myfilter.php file:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php // $Id$&lt;br /&gt;
// Language string for filter/myfilter.&lt;br /&gt;
&lt;br /&gt;
$string[&#039;filtername&#039;] = &#039;My magic filter.&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Development:Filters 2.0]] The new version of these instructions for after Moodle 2.0 is released.&lt;br /&gt;
* [[Filters schema]] - a page containing some ideas and thoughts about modifications to the filters system&lt;br /&gt;
* [[Filters]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Filters]]&lt;br /&gt;
[[Category:Filter]]&lt;/div&gt;</summary>
		<author><name>Jp76</name></author>
	</entry>
</feed>