Project

General

Profile

Actions

Feature #24309

closed

Add custom status icons to BE sprites

Added by Myroslav Holyak over 13 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-12-08
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

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

hotel-custom-status-icon.png (118 KB) hotel-custom-status-icon.png Administrator Admin, 2010-12-08 12:44
patch.diff (531 Bytes) patch.diff Administrator Admin, 2010-12-08 13:05
patch-09-12-2010.patch (1.52 KB) patch-09-12-2010.patch Administrator Admin, 2010-12-09 21:10
status_icons-1_0_0.t3x (2.22 KB) status_icons-1_0_0.t3x Administrator Admin, 2010-12-09 22:23
16701_v2.diff (1.22 KB) 16701_v2.diff Administrator Admin, 2010-12-09 22:44
bug_16701_v3.diff (2.25 KB) bug_16701_v3.diff Administrator Admin, 2010-12-10 18:02
Actions #1

Updated by Myroslav Holyak over 13 years ago

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.

Actions #2

Updated by Myroslav Holyak over 13 years ago

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.

Actions #3

Updated by Chris topher over 13 years ago

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.

Actions #4

Updated by Myroslav Holyak over 13 years ago

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?

Actions #5

Updated by Chris topher over 13 years ago

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.

Actions #6

Updated by Myroslav Holyak over 13 years ago

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.

Actions #7

Updated by Chris topher over 13 years ago

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.

Actions #8

Updated by Myroslav Holyak over 13 years ago

Ok, have added to mail list http://lists.typo3.org/pipermail/typo3-team-core/2010-December/046907.html
Thank you for supporting a newbie :)

Actions #9

Updated by Chris topher over 13 years ago

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. :-)

Actions #10

Updated by Myroslav Holyak over 13 years ago

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.

Actions #11

Updated by Alexander Opitz over 10 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)

Whats the state of this issue?

Actions #12

Updated by Alexander Opitz about 10 years ago

  • 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.

Actions

Also available in: Atom PDF