[TYPO3-dev] Help with alt_doc.php

Tapio Markula tapio.markula at atwebteam.com
Wed Oct 25 23:12:03 CEST 2006


Michael Stucki kirjoitti:
 > Tapio Markula wrote:
 >
 >> As for HCI reasons my customer would like to replace
 >> icons in alt_doc.php with text buttons.
 >> But replacing <input type="image"
 >>
 >> with <button type="submit"
 >>
 >> 'Save' ect. didn' work anymore.
 >
 > Why not use "<input type="submit" name="KEY" value="LABEL" />" ?
 >
 > - michael


that doesn't work with the same values as for <input type="image"

peter at umloud.dk
" Usually when TYPO3 uses <input type="image" type of buttons, it also 
has a hidden field with the actual name of the submit button. If you 
remove the  <input type="image" type of button, and change the hidden 
field to a <input type="submit", it should work."


Well I working just 'Save' with that method. But now I figured how to 
get other working.

I began to understand how <input type="image" related command work


alt_doc.php has


  function doProcessData()    {
      $out = $this->doSave || isset($_POST['_savedok_x']) || 
isset($_POST['_saveandclosedok_x']) || isset($_POST['_savedokview_x']) 
|| isset($_POST['_savedoknew_x']);
      return $out;
  }


              // If a document is saved and a new one is created right 
after.
          if (isset($_POST['_savedoknew_x']) && 
is_array($this->editconf))    {


it seems as Peter Klein said that <input type="image" get *server-side* 
new $_POST variable

But what I could do is to send $_GET variable and add ||-statement to 
handle new $_GET variable at
the same way as server-side $_POST variables.

for example
if((isset($_POST['_savedoknew_x']) || isset($_GET['_savedoknew'])) && 
is_array($this->editconf)

I *can't* send $_POST['_savedoknew_x'] because the form use 
*client-side* $_GET-variables - I must
use client-side just $_GET variables.

But If I do that way, I must rewrite almost all functions in 
alt_doc.php, which is bad solution at that point of view.
At that point of view using alternative images is better solution.

This was totally new for me.
This seems to use some functionality of server-side image maps?
I didn't knew this kind of server-side command handling.

Now the problem is making Hide/unhide as link in the top of the page.


$itemData = t3lib_BEfunc::getRecord(key($myGET['edit']),$id); //Data for 
the record

		if($itemData['hidden']==1) {
			$hidden=0;
			$title='Publish'; // Unhide page or content element
			}
		else	{
			$hidden=1;
			$title='Unpublish';
			$un='un'; // prefix for 'publish' - 'Unpublish'
			}
			
		if($key=='pages' || $key=='tt_content') { 
//typo3FormFieldGet(\'data[tt_content]['.$uid.'][hidden]\',\'\',\'\','.$hidden.',\'\');
			$panel .= '<a href="#" 
onclick="typo3FormFieldGet(\'data[tt_content]['.$uid.'][hidden]\',\'\',\'\','.$hidden.',\'\');TBE_EDITOR_fieldChanged(\'tt_content\',\''.$uid.'\',\'hidden\',\'data[tt_content][['.$uid.'][hidden]\');">';
			$panel .= 
'<img'.t3lib_iconWorks::skinImg($imagePath,'gfx/'.$un.'publish'.$lang.'.gif','').' 
class="c-inputButton closedok-fe" title="'.$title.'" alt="" />'.
			'</a>';
			}

the link doesn't work I and I don't understand fully the used javascript.





More information about the TYPO3-dev mailing list