TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv

TYPO3 Mailingliste: nicht fragen - lesen!

TYPO3 Mailingliste: nicht fragen - lesen!_RR_1-->
Zurück   TYPO3Jack.net - Das TYPO3 Mailinglist Forum Archiv > TYPO3-Mailinglists: ENGLISH > typo3-english@lists.netfielders.de

Registrieren Hilfe Benutzerliste Kalender Suchen Heutige Beiträge Alle Foren als gelesen markieren
  #1  
Alt 06.06.2007, 00:09
Matthias Stuebner
Gast
 
Beiträge: n/a
Standard [TYPO3] Hook when saving content element in BE

Hello all,

because I just don't know where and what to search for:

What hook (or similar) can I use, if I want to verify/modify data entered
into a content elements BE-Form before it is saved?

Detailed example: If the user uploads a file as part of the content element
I want to fill the file size of that file into a db field automatically
instead of letting the user enter the data. But how to hook in?

And as add on: How do I define which data of a content element is shown in
the summary when WEB/PAGE is selected, i.e. in the list of content elements
in column normal?

Thanx in advance,
--
br Matthias
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #2  
Alt 06.06.2007, 08:50
Dmitry Dulepov
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] Hook when saving content element in BE

Hi!

Matthias Stuebner wrote:
> What hook (or similar) can I use, if I want to verify/modify data entered
> into a content elements BE-Form before it is saved?


You need to search in t3lib/class.tcemain.php. Look in function named
process_datamap(). You will find at least three hooks there. All of them
accept parameters from record array. But examine the functin carefully
because parameters may have unexpected values to you (like negative pid,
which is not a pid but a pointer to another content element, etc).

--
Dmitry Dulepov
TYPO3 freelancer / TYPO3 core team member
Web: http://typo3bloke.net/
Skype: callto:liels_bugs
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #3  
Alt 06.06.2007, 23:57
Matthias Stuebner
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] Hook when saving content element in BE

On Wed, 06 Jun 2007 09:50:02 +0300, Dmitry Dulepov wrote:

> You need to search in t3lib/class.tcemain.php. Look in function named
> process_datamap(). You will find at least three hooks there. All of them
> accept parameters from record array. But examine the functin carefully
> because parameters may have unexpected values to you (like negative pid,
> which is not a pid but a pointer to another content element, etc).


Thanx for that great pointer, somehow I think I begin to understand
something more....
--
br Matthias
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #4  
Alt 07.06.2007, 15:46
Matthias Stuebner
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] Hook when saving content element in BE

On Wed, 06 Jun 2007 09:50:02 +0300, Dmitry Dulepov wrote:

> You need to search in t3lib/class.tcemain.php. Look in function named
> process_datamap()


One add-on:

Setting a hook works fine up to the point where I discovered that the
return of the hook function isn't used by the caller at all. I want to
modify/set the value of a field that then should be shown in the form as it
would have been entered, but when I set $incomingFieldArray['field'] in my
function, the process_datamap() doesn't care.

Is there a way to modify $incomingFieldArray in the way I would like?
--
br Matthias
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #5  
Alt 07.06.2007, 15:58
Matthias Stuebner
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] Hook when saving content element in BE

On Thu, 7 Jun 2007 15:46:25 +0200, Matthias Stuebner wrote:

> Is there a way to modify $incomingFieldArray in the way I would like?


Maybe important: More detailed the thing I miss is that the data I set (and
which can be verified even in the post-Hook doesn't get shown in the form.
How can I achive this?
--
br Matthias
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #6  
Alt 07.06.2007, 16:42
serge vleugels
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] Hook when saving content element in BE

On Thu, 2007-06-07 at 15:58 +0200, Matthias Stuebner wrote:
> On Thu, 7 Jun 2007 15:46:25 +0200, Matthias Stuebner wrote:
>
> > Is there a way to modify $incomingFieldArray in the way I would like?

>
> Maybe important: More detailed the thing I miss is that the data I set (and
> which can be verified even in the post-Hook doesn't get shown in the form.
> How can I achive this?


i use processDatamap_afterDatabaseOperations hook
and in my function i reference the variables :
processDatamap_postProcessFieldArray ($status, $table, $id, &
$fieldArray, &$pObj)

this way i can modify and add data to the field array, since i reference
the pObj variable, i use it to return warning and errors to the editor

hope this helps,

Serge

_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #7  
Alt 07.06.2007, 16:47
serge vleugels
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] Hook when saving content element in BE

On Thu, 2007-06-07 at 16:42 +0200, serge vleugels wrote:
> On Thu, 2007-06-07 at 15:58 +0200, Matthias Stuebner wrote:
> > On Thu, 7 Jun 2007 15:46:25 +0200, Matthias Stuebner wrote:
> >
> > > Is there a way to modify $incomingFieldArray in the way I would like?

> >
> > Maybe important: More detailed the thing I miss is that the data I set (and
> > which can be verified even in the post-Hook doesn't get shown in the form.
> > How can I achive this?

>
> i use processDatamap_afterDatabaseOperations hook
> and in my function i reference the variables :
> processDatamap_postProcessFieldArray ($status, $table, $id, &
> $fieldArray, &$pObj)
>
> this way i can modify and add data to the field array, since i reference
> the pObj variable, i use it to return warning and errors to the editor
>
> hope this helps,
>
> Serge
>


Oh yes,

If you want data stored in fields not editable by the user, define them
in the tca, but do not put them in the types array, i have used it this
way and works like a charm, or better, put them in the types array, but
dont give none admins access (using "exclude" => 1 in the tca)

_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
  #8  
Alt 07.06.2007, 20:14
Matthias Stuebner
Gast
 
Beiträge: n/a
Standard Re: [TYPO3] Hook when saving content element in BE

On Thu, 07 Jun 2007 16:47:50 +0200, serge vleugels wrote:

> If you want data stored in fields not editable by the user, define them
> in the tca, but do not put them in the types array, i have used it this
> way and works like a charm, or better, put them in the types array, but
> dont give none admins access (using "exclude" => 1 in the tca)


The thing I struggle with is, that as soon as I set the type in TCA
= "none" to make it read-only the datafield seems not to be processed by
that hook anymore. I tested it several times and could reproduce it.

So setting it to admin only might give the same result, but I would call it
a hack only.

Anyway, thanx for your help.
--
br Matthias
_______________________________________________
TYPO3-english mailing list
TYPO3-english (AT) lists (DOT) netfielders.de
http://lists.netfielders.de/cgi-bin/.../typo3-english
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
 

Lesezeichen

Themen-Optionen
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an


Ähnliche Themen

Thema Autor Forum Antworten Letzter Beitrag
[TYPO3-templavoila] Data structure selector content missing inflexible content element Hans van Dijk typo3-project-templavoila@lists.netfielders.de 5 06.06.2007 08:44
[TYPO3-dev] new content element in new table? Thomas Mammitzsch typo3-dev@lists.netfielders.de 5 14.05.2007 20:12
[TYPO3-dev] Hook for additional content-related information Tapio Markula typo3-dev@lists.netfielders.de 0 25.04.2007 16:58
[TYPO3] Error when saving content with users that lacks adminrights? Oscar Winter typo3-english@lists.netfielders.de 0 09.02.2007 22:59
[TYPO3] assign a content element to the end of a content area Jamie Lawrence Jenner typo3-english@lists.netfielders.de 4 30.01.2007 17:02


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:23 Uhr.


Powered by vBulletin® Version 3.7.4 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
Template-Modifikationen durch TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75