Relative Linking within Moodle using the HTML Editor

Re: Relative Linking within Moodle using the HTML Editor

av David Sturrock -
Antall svar: 0

Copy, paste and rename an existing filter folder like censor or activitynames as a starting point. You'll need to know some php & reg expressions to get the specifics - sorry can't be much help there. Have attached the original hacked filter I got an IT tutor to do for me. We've since moved onto a more advanced solution but the principles should be similar to your requirements.

The filter has the following logic:

  1. Check for urls
  2. Check if the URL already has the the ezproxy prefix
  3. Loop thru the text checking for the defined domains and adding the ezproxy prefix where necessary
  4. Array of domains we are interested in
  5. Identify URLs with expired ezproxy domains (foundincorrect)
  6. Substitute a correct domain for the incorrect one (changeincorrect)