Does anybody know how it could be possible to implement a 'scheme scroller' for a theme in its 'settings.php' such that the user could move between preset colour schemes and then the code adapt and select the appropriate selectors?
I know how to add a scroller in a layout page, but setting this in settings.php would definitely be a test of my php coding skills.
To tell you the truth I don't think there is a mechanism in place to allowing you to do this. We are struggling for someone to come up with getting the file-picker to work in the settings page, so people can upload a logo or header background image for their theme, to no avail.
So I am guessing this needs to be written into the HTML constructor, wherever that happens to be, for the Admin settings page which a theme's setting page is based on.
Do you have an example of the scroller on a layout page please? As looking at http://docs.moodle.org/dev/Admin_settings - custom setting classes can be created. Also, looking in '/lib/adminlib.php' there is a class 'admin_setting_configfile' which I think puts a file value into the 'config_plugins' table - might work.
Plus been thinking about the file picker issue, I think will be a hybrid of the file picker form and a text value stored in the database of the location of the local storage uploaded image using the editimage.php code from the Grid Format - not a trivial task. Need to finish some other ideas first!
To get the BoxSlider to work in a layout file is as follows:
ADD the HTML list of images as suggested (see below) inside a div container in the layout file where you want this to be.Usually in the frontpage.php just above <div id="page-content"> and after the end of the page header like so... <!-- End of Header --> <div id="bxslider-container"> <ul class="bxslider"> <li><img src="<?php echo $OUTPUT->pix_url('pic1', 'theme'); ?>" /></li> <li><img src="<?php echo $OUTPUT->pix_url('pic2', 'theme'); ?>" /></li> <li><img src="<?php echo $OUTPUT->pix_url('pic3', 'theme'); ?>" /></li> <li><img src="<?php echo $OUTPUT->pix_url('pic4', 'theme'); ?>" /></li> </ul> </div> <!-- Start of Main Content --> <div id="page-content">
What I intend to do is extend one of the text input admin settings, then pass in an array of associative array of labels => images, then detect the selected item and put in the text input box which is then passed back to the server on submit in the normal way. This is a medium term implementation, so might be a while to see results, thank you for your help.
Yes, Gareth, there is a tracker set up for this already. MDL-35434 assigned to Rajesh, who is very helpful so I am sure he would be able to point you in the right direction if you asked him. I've added you as a watcher so you should get notification shortly, if you haven't already!