Non-core contributed modules

A new customizable theme for Moodle

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Labels:
    None
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE

Description

The objective of this improvement is creation of a new customizable theme, which gives the Moodle user various options like selecting a logo from the site files and/or uploads their own favicon, customize various CSS elements, selecting a parent theme etc. The main aim of the theme is to simplify the tasks of users who are still not ready to delve into CSS and HTML editing and yet give them the ability to customize the look and feel of Moodle.

To implement it, we shall select some of the CSS elements that we wish to make customizable by the user. For every user, we will create and store the CSS elements in the database and the theme shall use the values for each user along with the CSS sheets of the parent themes specified (if any).

For backend support we will use a MySQL database.

The deliverables that we initially set out with were bifurcated into creating a block (custom_theme) and creating a theme (custom_theme).

The details of the deliverables for the custom_theme block are as follows. These deliverables are dealt with in http://tracker.moodle.org/browse/CONTRIB-517 :-

  • Create the block as a means of access to the page to customize theme
  • Creation of database tables and storing it in \db\update.php & \db\install.xml
  • Limit who has the access to the block and who doesn't using capabilities and permissions

The details of the deliverables for the custom_theme theme are as follows:-

Activity

Hide
Akshit Sharma added a comment -

The "Configure Theme Block".

Show
Akshit Sharma added a comment - The "Configure Theme Block".
Hide
Akshit Sharma added a comment -

The "Display" capability of the block which along with the has_capability( ) displays or doesn't display the configure theme block depending on who is logged in.

Show
Akshit Sharma added a comment - The "Display" capability of the block which along with the has_capability( ) displays or doesn't display the configure theme block depending on who is logged in.
Hide
Akshit Sharma added a comment -

The configure theme page. The values of the CSS elements in the form are pre-loaded with the last values entered by the user or default values (in case this is the first time that this user has browsed this page).

Show
Akshit Sharma added a comment - The configure theme page. The values of the CSS elements in the form are pre-loaded with the last values entered by the user or default values (in case this is the first time that this user has browsed this page).
Hide
Akshit Sharma added a comment -

How different values are stored for different users in the database of the "Configure theme" block.

Show
Akshit Sharma added a comment - How different values are stored for different users in the database of the "Configure theme" block.
Hide
Akshit Sharma added a comment -

The theme changes as soon as we enter values in the configuration page.

Show
Akshit Sharma added a comment - The theme changes as soon as we enter values in the configuration page.
Hide
Akshit Sharma added a comment -

Copy this to the \moodle\theme folder. This is the theme folder that presents the new theme.

Show
Akshit Sharma added a comment - Copy this to the \moodle\theme folder. This is the theme folder that presents the new theme.
Hide
Akshit Sharma added a comment -

Copy this to the \moodle\block folder. This is the block that displays the configure theme option and sets up the database tables.

Show
Akshit Sharma added a comment - Copy this to the \moodle\block folder. This is the block that displays the configure theme option and sets up the database tables.
Hide
Helen Foster added a comment -

Assigning to Akshit

Show
Helen Foster added a comment - Assigning to Akshit
Hide
Anthony Borrow added a comment -

I have added the code to CVS and taken a very quick look but it looks good from what I saw. The only thing that stood out to me was the slight inconsistency in naming between the block and the theme (customtheme vs custom_theme). I think its OK and understand that the _ was probably not allowed for a block name (I think I recall a similar issue previously). Now that the code is in CVS I can take care of the CVS access. Thanks to Akshit for his work on this. Let me know if there is anything else I can do to be of help. Peace - Anthony

Show
Anthony Borrow added a comment - I have added the code to CVS and taken a very quick look but it looks good from what I saw. The only thing that stood out to me was the slight inconsistency in naming between the block and the theme (customtheme vs custom_theme). I think its OK and understand that the _ was probably not allowed for a block name (I think I recall a similar issue previously). Now that the code is in CVS I can take care of the CVS access. Thanks to Akshit for his work on this. Let me know if there is anything else I can do to be of help. Peace - Anthony
Hide
Akshit Sharma added a comment -

Final custom_theme block

Show
Akshit Sharma added a comment - Final custom_theme block
Hide
Akshit Sharma added a comment -

custom_theme theme folder.

Show
Akshit Sharma added a comment - custom_theme theme folder.
Hide
Akshit Sharma added a comment -

final and commented custom_theme block.

Show
Akshit Sharma added a comment - final and commented custom_theme block.
Hide
Akshit Sharma added a comment -

final and commented custom_theme theme.

Show
Akshit Sharma added a comment - final and commented custom_theme theme.
Hide
Akshit Sharma added a comment -

the final commented version of custom_theme theme.

Show
Akshit Sharma added a comment - the final commented version of custom_theme theme.

People

Vote (1)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: