Feature #24309
closed
Add custom status icons to BE sprites
Added by Myroslav Holyak almost 14 years ago.
Updated over 10 years ago.
Description
t3lib_iconworks::mapRecordOverlayToSpriteIconName returns overlay icon according to hardcoded TCA fields. It's bad - if i have custom page types with additional fields, i need a possibility to configure "status" fields via TCA.
Example: hotels are represented in DB and page-tree as pages, i added a checkbox-field named "This is draft hotel" (so do not show it on site as regular public element, but allow to see it by direct link). In that case I need add special icon to visually see in tree what hotels are "draft". I cant' make that without using one of hardcoded fields.
I can extend both $GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayPriorities'] and $GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayNames'] but status icons array is hardcoded. I propose append to that hardcoded array some data from TCA, according to page type.
(issue imported from #M16701)
Files
I propose to patch this situation like in attached patch. Seems to be fully backwards compatible. In short, logic is so: add to the end of status array items from corresponding tca array.
But that will not work even after extending needed config option in TCA. I figured out, that $row variable passed to t3lib_iconWorks::getSpriteIconForRecord is not full db-row, but only part of them. The problem is in class webPageTree (responsible for page tree drawing in second frame). There are all selectable columns hardcoded. I don't think that using of $GLOBALS['TCA'] here is a good style. It will be nice to have hook here, in this class. I will try to do it with XCLASS.
Ok, it finally works via XCLASSing of class webPageTree. Have attached core-patch and extension with XCLASS. Note, that it will not work without core patching.
Hi Myroslav,
thanks for your efforts!
Do you know, that you must now send the patch, which changes the Core, to the TYPO3 Core List? There this change will be checked and finally integrated into the Core. For more information on how your mail should look like, see here:
http://typo3.org/teams/core/core-mailinglist-rules/
PS: Your patch should be made against the TYPO3 home directory. I attached an updated version, which applies for trunk.
Ok, i'will send it to mail list. Could you give me an advise? Changes in Xclass are very little (just a few lines), maybe i should just patch class webPageTree instead of making xclass?
Yes, if that change does not destroy something else, make it in the file in the Core.
Xclasses have many disadvantages (e.g. you still use the old version, when the official code changes and you can only use one xclass per file).
So change that file too and send your mail to Core List! Just attach all the needed changes in one patch/diff file.
1) Made single-file diff (both t3lib_iconWorks and webPageTree inside). File was made by hands (diff utility), looks a bit another than yours. I tried also to use NetBeans with SVN-features but reached same file-result. What IDE do you use?
2) My letters to core-team are automatically rejected (probably due to required admin confirmation of my registration). Yes, they are generated strictly according to their rules.
1) is no problem. Applying the patch seems to work for me.
I use Eclipse with SVN Integration (which has to be installed seperately into Eclipse). For me it is slow and some things just don't work correctly, e.g. the diff view is broken since an upgrade some months before. I don't really like it, but searching, installing and getting to work something else would be even more work than accepting those issues.
2) You must subscribe to the mailing list here:
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-team-core
Use the email address you use for sending your mails. Afterwards you still have to confirm your subscription; see the mail you get after subscribing. This is an automatic process (if I remember correctly from subscribing myself). So after you did it, you should be able to send mails to the list.
Ahh, I just saw Steffen's response in the mailing lists. He is right...
Sorry, I forgot that we currently are in feature freeze! My mistake!
Do the following: Do not forget this issue and send a reminder to your thread in Core List (just an empty mail only with the word "Reminder" in it) when TYPO3 4.5 is released. This will be at the end of January. People will then have a look at the topic again.
Your work won't be for nothing. :-)
Ok, i wait for typo3 4.5 with huge impatience, there are so many new cool features (especially i like file API and html5 in backend). After release i'll will send needed letters to mailing list.
- Status changed from New to Needs Feedback
- Target version deleted (
0)
Whats the state of this issue?
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this ticket.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
Also available in: Atom
PDF