Actions

Proposals/External media block extension

From Mahara Wiki

< Proposals

This feature is funded by the University of Canberra and carried out by Catalyst IT.

Mahara 1.5 will have the SafeIFrame feature of HTML Purifier.

The existing "External media" block is to be expanded so that any iFrame that is allowed by the site admin can be used besides the special filters we already have which allow users not only to use the embed code but also to just provide the URL.

New config option for HTML Purifier

A site admin setting is created in the HTML Extensions (or the existing one is used) which allows a site admin to add URLs for iFrames from the frontend (add, edit, delete).

This setting will then pull the favicon from the service to be displayed and the admin can also add / edit / delete the alt text / title to be displayed with the favicon. The favicon is also displayed on the admin page so that the site admin sees them there.

External media block to use HTML Purifier

Currently, the external media block has a list of embedded code that it supports along with fragile parsers for each of these.

We will remove this custom parsing code and just let HTML Purifier filter the code when we detect that the user has pasted embed code (as opposed to just a URL). This will remove code duplication and will also enable admins to add new websites easily to the list of services supported by this block.

The current text field will be changed into a text area to make it easier to see the entire iframe code instead of only the first 50 or so characters.

Listing services supported by the external media block

  • The services for which a filter exists that allows users to put in the embed code or just the page URL are identified and listed first under a heading in alphabetical order according to their alt text.
  • All other embed codes for which only the entire iFrame embed code works are listed under another heading in alphabetical order according to their alt text.
  • The icon of any service displayed is linked to its homepage (as is currently the case already).

Add support for oEmbed/ogp to the external media block

Features carried out by the University of Geneva

When a url is added to the Media block the embed code is extracted/constructed using the oEmbed/ogp protocols. The allows to support any site that supports one of those protocols without having to write ad-hoc code - filter.