[TYPO3-dev] A new feature to edit panels - a possible solution!
tapio
tapio.markula at dnainternet.net
Mon Jan 23 11:29:07 CET 2006
> must be for example
>
>
> 20=EDITPANEL
> 20 {
> newRecordFromTable=tt_content
> allow = new
> colPos=1
> label = Luo uusi sisältöelementti
> line = 0
> }
>
> I would add this feature in my plugin if someone could give me some advice
I found a possible solution
1) send a new variable as a $_GET variable
function editPanelLinkWrap_doWrap($string,$url,$currentRecord) {
global $confEP;
if(isset($confEP['colPos']) &&
$confEP['newRecordFromTable']=="tt_content")
$colPos='&colPos='.$confEP['colPos'];
else
$colPos="";
$confEP comes from here:
function editPanel($content, $conf, $currentRecord='', $dataArr=array()) {
global $TCA,$BE_USER,$confEP;
$confEP = array();
$confEP= $conf;
BTW. I used a global variable to get the $conf used in also in
editPanelLinkWrap_doWrap. Could that be avoided?
2) Manipulate the record array before rendering using that variable
if(isset($_GET['colPos']))
$rec['colPos']=$_GET['colPos'];
$panel = '';
if ($this->columnsOnly) {
$panel.=
$this->tceforms->getListedFields($table,$rec,$this->columnsOnly);
} else {
$panel.= $this->tceforms->getMainFields($table,$rec);
}
More information about the TYPO3-dev
mailing list