Details
-
Type:
New Feature
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9
-
Fix Version/s: None
-
Component/s: Theme: Customisable theme
-
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:-
- Create a form using formslib.php where user enters all the values and this page is linked from the custom_theme block (http://tracker.moodle.org/browse/CONTRIB-519)
- Allow users to provide their parent theme which goes on top of Moodle Standard Stylesheets (http://tracker.moodle.org/browse/CONTRIB-519)
- Allow users to provide their own CSS file which goes on top of parent theme (if any) (http://tracker.moodle.org/browse/CONTRIB-519)
- Allow users to upload their own Favicon which overrides the favicon of the parent theme (http://tracker.moodle.org/browse/CONTRIB-519)
- Allow users to upload their own Moodle logo which overrides the logo of the parent theme (goes in the header and footer of the page) (http://tracker.moodle.org/browse/CONTRIB-519)
- Allow users to enter values of various CSS fields in the customize page (http://tracker.moodle.org/browse/CONTRIB-518)
- Provide a palette to use and review the color easily (http://tracker.moodle.org/browse/CONTRIB-520)
Attachments
-
$i18n.getText("admin.common.words.hide")
- custom_theme_(block)_final.zip
- 18/Aug/08 8:30 AM
- 4 kB
- Akshit Sharma
-
- custom_theme/block_custom_theme.php 0.8 kB
- custom_theme/db/access.php 2 kB
- custom_theme/db/install.xml 3 kB
- custom_theme/db/upgrade.php 2 kB
- custom_theme/lang/.../block_custom_theme.php 0.1 kB
$i18n.getText("admin.common.words.show")- custom_theme_(block)_final.zip
- 18/Aug/08 8:30 AM
- 4 kB
- Akshit Sharma
-
$i18n.getText("admin.common.words.hide")
- custom_theme_(theme)_final.zip
- 18/Aug/08 8:31 AM
- 12 kB
- Akshit Sharma
-
- custom_theme/clear.gif 0.1 kB
- custom_theme/colours.html 6 kB
- custom_theme/config.php 6 kB
- custom_theme/docstyles.php 0.4 kB
- custom_theme/favicon.ico 0.9 kB
- custom_theme/footer.html 2 kB
- custom_theme/get_file.php 0.5 kB
- custom_theme/header.html 2 kB
- custom_theme/settings.php 12 kB
- custom_theme/settings_form.php 14 kB
- custom_theme/styles.php 2 kB
$i18n.getText("admin.common.words.show")- custom_theme_(theme)_final.zip
- 18/Aug/08 8:31 AM
- 12 kB
- Akshit Sharma
-
$i18n.getText("admin.common.words.hide")
- custom_theme.zip
- 25/Jun/08 4:16 AM
- 6 kB
- Akshit Sharma
-
- custom_theme/config.php 6 kB
- custom_theme/docstyles.php 0.4 kB
- custom_theme/favicon.ico 0.9 kB
- custom_theme/footer.html 1 kB
- custom_theme/header.html 2 kB
- custom_theme/settings.php 3 kB
- custom_theme/styles.php 1 kB
-
$i18n.getText("admin.common.words.hide")
- custom_theme(block)_commented.zip
- 19/Aug/08 6:25 AM
- 4 kB
- Akshit Sharma
-
- custom_theme/block_custom_theme.php 2 kB
- custom_theme/db/access.php 2 kB
- custom_theme/db/install.xml 3 kB
- custom_theme/db/upgrade.php 3 kB
- custom_theme/lang/.../block_custom_theme.php 0.1 kB
$i18n.getText("admin.common.words.show")- custom_theme(block)_commented.zip
- 19/Aug/08 6:25 AM
- 4 kB
- Akshit Sharma
-
$i18n.getText("admin.common.words.hide")
- custom_theme(theme)_commented.zip
- 19/Aug/08 6:33 AM
- 15 kB
- Akshit Sharma
-
- custom_theme/clear.gif 0.1 kB
- custom_theme/colours.html 6 kB
- custom_theme/config.php 6 kB
- custom_theme/docstyles.php 0.4 kB
- custom_theme/favicon.ico 0.9 kB
- custom_theme/footer.html 2 kB
- custom_theme/get_file.php 0.5 kB
- custom_theme/header.html 3 kB
- custom_theme/settings.php 19 kB
- custom_theme/settings_form.php 21 kB
- custom_theme/styles.php 2 kB
$i18n.getText("admin.common.words.show")- custom_theme(theme)_commented.zip
- 19/Aug/08 6:33 AM
- 15 kB
- Akshit Sharma
-
$i18n.getText("admin.common.words.hide")
- custom_theme(theme)_commmented.zip
- 19/Aug/08 6:25 AM
- 15 kB
- Akshit Sharma
-
- custom_theme/clear.gif 0.1 kB
- custom_theme/colours.html 6 kB
- custom_theme/config.php 6 kB
- custom_theme/docstyles.php 0.4 kB
- custom_theme/favicon.ico 0.9 kB
- custom_theme/footer.html 2 kB
- custom_theme/get_file.php 0.5 kB
- custom_theme/header.html 3 kB
- custom_theme/settings.php 19 kB
- custom_theme/settings_form.php 21 kB
- custom_theme/styles.php 2 kB
$i18n.getText("admin.common.words.show")- custom_theme(theme)_commmented.zip
- 19/Aug/08 6:25 AM
- 15 kB
- Akshit Sharma
-
$i18n.getText("admin.common.words.hide")
- customtheme.zip
- 25/Jun/08 4:18 AM
- 3 kB
- Akshit Sharma
-
- customtheme/block_customtheme.php 0.8 kB
- customtheme/db/access.php 2 kB
- customtheme/db/install.xml 2 kB
- customtheme/db/upgrade.php 2 kB
1. |
Create the custom theme block. | |
|
Akshit Sharma | |
2. |
Create the Custom Theme theme. | |
|
Akshit Sharma | |
3. |
Modify the Custom Theme theme to include more features. | |
|
Akshit Sharma | |
4. |
Provide a GUI for choosing of CSS elements. | |
|
Akshit Sharma |
Activity
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.
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).
How different values are stored for different users in the database of the "Configure theme" block.
The theme changes as soon as we enter values in the configuration page.
Copy this to the \moodle\theme folder. This is the theme folder that presents the new theme.
Copy this to the \moodle\block folder. This is the block that displays the configure theme option and sets up the database tables.
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
The "Configure Theme Block".