[TYPO3-dam-devel] RFC #8599: Replace dam extension of tx_rtehtmlarea_browse_links by implementation of interface t3lib_browselinkshook]

Uschi Renziehausen typo3news at otherone.de
Sat Jun 14 00:32:12 CEST 2008


Hi Stan, Benni and the rest who is involved :-)

Here is a little novel about Stan's media links patch. It works in 
principle, but I think there is a lot of stuff to do, some on RTE side, 
more on DAM side.

Issue 1)
When I insert a media link and assign a class for which the target 
attribute has been predefined [1] the target attribute does not get 
inserted with the link. This one is for Stan, I suppose.


Issue 2)
What to do with the title element? This is more complicated, because it 
involves transformation and references. Both RTE and DAM have to learn 
some things.


The current situation is this:

- When you insert a media link for the first time, no title attribute is 
transfered to RTE. HTML in code view looks like this:
   <a title="Datei herunterladen" class="download" 
href="http://spinne.uni-erfurt.t3/fileadmin/kladde/default_01.psd">Photoshop-Datei</a>

The title is coming from what has been defined under 
RTE.classesAnchor.download.titleText. But of course, there is also a 
possibility that an author has put in something manually.

- After first save the code in DB looks like this:

   <media 356 - download>Photoshop-Datei</media>

Our title has been parsed away by class 
tx_dam_rtetransform_ahref->tranform_db() located in dam/binding/mediatag/.

- In RTE, after first save, the HTML code looks like this:

<a href="http://spinne.uni-erfurt.t3/fileadmin/kladde/default_01.psd" 
txdam="356" class="download" title="UNDEFINED, Photoshop-Datei zum 
Collagen basteln, default_01.psd, 53 MB" rtekeep="1">

This happens in tx_dam_rtetransform_mediatag->transform_rte()

- In dam_mm_ref no entry is inserted for the two linked files, so if you 
look 'Usage' TAB you will be misinformed tha the file is neither 
referenced nor a copy is used. Also the Info module will not list the files.


And what happens if a linked file gets deleted via DAM-File-module?

- You are asked whether you really want to delete the file in question, 
but there is no hint that the file is used somewhere.
- The file gets deleted on the filesystem
- In FE the a-Tag is removed, so there is no warning that there is a 
missing link.
- In BE tt_content the code remains the same as before.
- In BE tx_dam the deleted flag is set.
- If you reload the code back into RTE, the code looks like this:
<a href="http://spinne.uni-erfurt.t3/383" txdam="383" class="download" 
rteerror="No media file found: 383" style="border: 2px solid red; 
background-color: yellow; color: black;" rtekeep="1">OOwriter-Dokument</a>
So here finally the poor author gets warned that there is something 
wrong with that link.


What should happen?

1) Whenever a media link is inserted/removed in RTE, DAM should do more 
or less the same thing as it does when an image is inserted via 
dam_ttcontent (that is creating an entry in dam_mm_ref). Thus, we can 
show it under TAB usage and in the Info module.

2) When a link is inserted, RTE should get the title attribute 
immediately so that the author can edit it, if he wants to. I suppose we 
need some similar config option as we have for image 
(buttons.media.title.useDAMColumn = caption)

3) DAM should not ruthlessly unset the an existing title on the way to 
the database, because there are situations where you might want to adapt 
the title to your current context.

4) As the possibility to overwrite the DAM title locally might not be 
wanted in some installations, DAM needs a configuration option (e.g. 
keepRTE = 1/0).

5) If keepRTE is 0, the title field becomes confusing and should be 
remove. That means a new configuration option for RTE necessary: 
buttons.link.titleField.disabled = 0

6) When someone wants to delete a file that is still in use somewhere 
he/she should be informed where that file is used so that he can either 
contact people who linked to that file or repair the affected CEs when 
he/she has the respective rights.

Sorry for being so long, but somehow we have to sort out things carefully.

Prosit, Uschi

______________________________________

[1] Footnote for those who do not know: Since rtehtmlarea 1.7.4 you can 
set a target attribute for those classes that are meant to open up in a 
new window. Thus you can safely disable the target-selector and save 
your authors one click they might forget.

   // class with predefined target
RTE.classesAnchor.internalLinkInNewWindow {
	class = internal-link-new-window
	type = page
	titleText = 
LLL:EXT:acadrteconf/locallang_rte.xml:title-internal-link-new-window
	target = _blank
}

   // disable target selector in link dialogue
buttons.link.targetSelector.disabled = 1


More information about the TYPO3-team-dam mailing list