function writeTop($row) { global $LANG,$extraBEIcons,$Typo4,$Typo4_1; $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->pageinfo['uid'],'mod.web_list'); #t3lib_div::debug($this->modTSconfig); // deleting all records in the same page $deleteAllRecords=t3lib_div::_GP('delete_record'); // the value is the name of a table, for example 'tt_address' if($deleteAllRecords) { $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery($deleteAllRecords, 'deleted="0" AND pid="'.$this->id.'"', array('deleted' => 1)); // hook for handling relation tables if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['mm_'.$deleteAllRecords]) && is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['mm_'.$deleteAllRecords])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['mm_'.$deleteAllRecords] as $classRef) { $hookObj= &t3lib_div::getUserObj($classRef); $hookName='mm_'.$deleteAllRecords; if (method_exists($hookObj,$hookName)) $hookObj->$hookName($this->id,$this->modTSconfig); } $hookObj=NULL;$hookName=NULL; } // special conditions if direct_mail has been installed in order to delete relations too (this could be put also using the previous mentioned hook) elseif($Typo4 && t3lib_extMgm::isLoaded('direct_mail')) { switch($deleteAllRecords) { CASE 'tt_address': $mm_table='sys_dmail_ttaddress_category_mm'; break; CASE 'fe_users': $mm_table='sys_dmail_feuser_category_mm'; break; CASE 'sys_dmail_group': $mm_table='sys_dmail_group_mm'; break; } // delete relations for records in the main table (relates to the variable '$deleteAllRecords'), which has been marked as deleted in the current page if($this->modTSconfig['properties']['clearDeletedRelations']) { $query = array( 'SELECT' => 'uid', 'FROM' => $deleteAllRecords, 'WHERE' => 'deleted="1" AND pid="'.$this->id.'"', 'GROUPBY' => ''); $query = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($query); $i=0; while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($query)) { if($i==0) $uidList .= $row['uid']; else $uidList .= ','.$row['uid']; $i++; } $GLOBALS['TYPO3_DB']->exec_DELETEquery($mm_table,'uid_local IN ('.$uidList.')'); } // delete possible relations with unexisting items in the main table (lost relations to the table, which relates to the variable '$deleteAllRecords') if($this->modTSconfig['properties']['deleteLostRelations']) { $MinItem=$GLOBALS['TYPO3_DB']->exec_SELECTquery('MIN(uid_local)',$mm_table,'','', '', ''); $MinItem=$GLOBALS['TYPO3_DB']->sql_fetch_row($MinItem); $MinItem=$MinItem[0]; $MaxItem=$GLOBALS['TYPO3_DB']->exec_SELECTquery('MAX(uid_local)',$mm_table,'','', '', ''); $MaxItem=$GLOBALS['TYPO3_DB']->sql_fetch_row($MaxItem); $MaxItem=$MaxItem[0]; if($MinItem && $MaxItem) { for($i=$MinItem;$i<=$MaxItem;$i++) { $exists=$GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)',$deleteAllRecords,'uid="'.$i.'"','', '', ''); $exists=$GLOBALS['TYPO3_DB']->sql_fetch_row($exists); $exists=$exists[0]; if(!$exists) $GLOBALS['TYPO3_DB']->exec_DELETEquery($mm_table,'uid_local='.$i.''); } } } } }