SimpleMachines/SMF2.1 — pull request #230 by Akyhne (2012-11-15 20:17:49+00:00)
Title: Development

This pull adds an extra sub menu to the "Manage Membergroups".

The page is used to edit and manage membergroup and post based group's icons.

Reason:
At the moment, it is only possible to add new icons via FTP. It is only possible to change a MG or PB group's icon, by knowing it's exact name.
It is not possible to see if the icon is present in all themes in the forum.
In the edit page of a group, where you change the icon, you could use the $language to apparently change the path to the uer's language. This didn't work at all.

New with this modification:
On the page where you changed the icon, the textbox has been replaced by a hidden input and an image showing the current selected image.
Clicking the image, will call a dropdown that works similar to the way you change a posts icon (xx.png etc.). It uses jQuery.
The "option" to use $language as a part of the file path, has been removed. It had no effect.

The new page added, gives you the option to copy icons between different themes with drag'n drop (jQuery). You delete an image, by doubleclicking it.
New images can be uploaded and you can decide whether the image should be copied to any theme or to a specific theme. So you can still have different icons with the same name for different themes.
You can rename the file during upload (no conversion though) and you can choose whether existing files should be replaced.

To make all this work, the SMF forum software needs to have a separate folder for MG & PB group icons. And why not?! Almost all images have their own subfloder in the theme.
I chose to rename the subfolder to /default/images/membergroup_icons.
These images needs to be moved there in the default theme:
blank.png
icon.png
iconadmin.png
icongmod.png
iconmod.png

This commit doesn't contain these changes, cause I can' figure out how to upload folders and delete files.

Known Issues:
For good reasons, you can't use the drag and doubleclick features on smartphones.
The only thing that needs to be taken care of, besides moving the icons, is to look on how the upload handles errors and what steps should be taken if the folder membergroup_icons is not writable.