Comment 6 for bug 1510421

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5766
Committed: https://git.mahara.org/mahara/mahara/commit/2565f2d840a6617d4e3474cbabcb0d21ca5f5434
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.10_STABLE

commit 2565f2d840a6617d4e3474cbabcb0d21ca5f5434
Author: Aaron Wells <email address hidden>
Date: Mon Nov 23 19:19:22 2015 +1300

Display icons for 3rd-party blocktypes plugins

Bug 1510421

Defines a new static PluginBlocktype method, get_css_icon(), which
fetches the name of the CSS icon to use for this blocktype. It returns
false by default, which tells the theme to "fall back" to the old
thumbnail.png instead. 3rd-party plugins can override this to
specify a particular icon to use.

All the core blocktypes have been refactored to extend
MaharaCoreBlocktype, which uses the blocktype name as the name
of the CSS icon to use. I also deprecated the "SystemBlocktype"
class while I was at it.

PluginBlocktype::get_blocktypes_for_category() now returns both
the results of get_css_icon() and the thumbnail.png path, so that
themes can decide which they want to use. (And of course
thumbnail.png is served via thumbnail.php, so 3rd party themes
can provide their own custom image files if they wish.)

behatnotneeded: Requires installing third-party plugins to test

Change-Id: Idb1ecfc7b21175913708e695788906c11133b0c0
(cherry picked from commit 4f849ed2e47001190d46c3293863ab84f991bd08)