Show Advanced KnowledgeHide Advanced KnowledgeMake plugins can use Skins
Page Overview
[Hide] [Show] 1 Requirements
Skinning an ilias installation is possible and easy. But it doesn't take effect on Plugins, specially on the plugin symbols shown in the "Add new..." menu within the repository. It should be possible to skin plugins too, for a global look and feel.
2 Status
- Scheduled for: Release 5.0
- Funding: Not necessary
- Maintainer: Alex Killing (killing (at) leifos.de)
- Development: Implementation of the feature is done by
3 Additional Information
3.1 Existing Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | /** * Get image path */ public static final function _getImagePath($a_ctype, $a_cname, $a_slot_id, $a_pname, $a_img) { return $d."/templates/images/".$a_img; } /** * Get image path */ public final function getImagePath($a_img) { return $this->getDirectory()."/templates/images/".$a_img; } /** * Get css file location */ public final function getStyleSheetLocation($a_css_file) { return $this->getDirectory()."/templates/".$a_css_file; } |
3.2 New Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | /** * Get image path */ public static final function _getImagePath($a_ctype, $a_cname, $a_slot_id, $a_pname, $a_img) { global $ilUser; $d = ilPlugin::_getDirectory($a_ctype, $a_cname, $a_slot_id, $a_pname); // Start added by Skin/Style for Plugins Patch if($ilUser->prefs['skin']!=='default') { // Check if special skin icon exists $imgPath = './Customizing/global/skin/'.$ilUser->prefs['skin'].'/images/'.$a_img; if(file_exists($imgPath)) { return $imgPath; } } // End added by Skin/Style for Plugins Patch return $d."/templates/images/".$a_img; } /** * Get image path */ public final function getImagePath($a_img) { // Start added by Skin/Style for Plugins Patch if($ilUser->prefs['skin']!=='default') { // Check if special skin icon exists $imgPath = './Customizing/global/skin/'.$ilUser->prefs['skin'].'/images/'.$a_img; if(file_exists($imgPath)) { return $imgPath; } } // End added by Skin/Style for Plugins Patch return $this->getDirectory()."/templates/images/".$a_img; } /** * Get css file location */ public final function getStyleSheetLocation($a_css_file) { // Start added by Skin/Style for Plugins Patch if($ilUser->prefs['skin']!=='default') { // Check if special skin icon exists $imgPath = './Customizing/global/skin/'.$ilUser->prefs['skin'].'/css/'.$a_css_file; if(file_exists($imgPath)) { return $imgPath; } } // End added by Skin/Style for Plugins Patch return $this->getDirectory()."/templates/".$a_css_file; } |
- If you want to know more about this feature, its implementation or funding, please contact: Florian Fehring <florian.fehring@fh-bielefeld.de>
4 Discussion
JF 28 Oct 2013: We support the idea and schedule it for 4.5. However to prevent name collisions, the files should be looked in subdirectories like images/[component_id]_[slot_id]_[plugin_id], e.g. rep_robj_xpad for the edupad plugin.
5 Implementation
...