Issue Details (XML | Word | Printable)

Key: MDL-19690
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Tim Hunt
Reporter: Tim Hunt
Votes: 0
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-19077

Replace $CFG->pixpath with an $OUTPUT->icon_url_old($icon, $module);

Created: 02/Jul/09 01:40 PM   Updated: 03/Jul/09 03:56 PM
Return to search
Component/s: Lib
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Petr Skoda and Tim Hunt
Security Level: None
Resolved date: 03/Jul/09
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
We are having problems with $CFG->pixpath in HEAD>

To start with, it is a nasty global variables hack.

But the problem is that you cannot set up $CFG->pixpath until the theme is known. But the theme is only know after a variety of other things are done and it is hard to predict when that is.

However, we do currently have clever code to initialise $OUTPUT the first time it is used.


Old code that used the string "$CFG->modpixpath/$cm->modname/icon.gif" should be updated to $OUTPUT->mod_icon_url('icon', $cm->modname);

Old code that used the string "$CFG->pixpath/i/settings.gif" should be updated to $OUTPUT->old_icon_url('i/settings');

The reason for the slightly ugly function names is what we are planning (http://moodle.org/mod/forum/discuss.php?d=126543) to change the default icon-set in Moodle. When that happens we will probably adopt new names for all the icons. At that point, I propose that we move to a function $OUTPUT->icon_url($icon, $module); where $module is like the same argument to get_string. That is, we let all types of plugins supply their own icons in future, not just modules.


Note that the API does not include the file extension. We should not hard-code this. Instead themes should be able to choose png or gif.

Also, eventually, icon_url should do a search of theme, parent theme, standard theme, like smartpix.php does.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Tim Hunt added a comment - 02/Jul/09 01:47 PM
Add some relevant watchers.

Petr Skoda added a comment - 02/Jul/09 04:27 PM
Just one note, it might be better to call it "component" instead of "module".

Does this include the require_login() changes too?


Tim Hunt added a comment - 03/Jul/09 03:56 PM
Yay!