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': $MinItem=$GLOBALS['TYPO3_DB']->exec_SELECTquery('MIN(uid_local)','sys_dmail_ttaddress_category_mm','','', '', ''); $MinItem=$GLOBALS['TYPO3_DB']->sql_fetch_row($MinItem); $MinItem=$MinItem[0]; $MaxItem=$GLOBALS['TYPO3_DB']->exec_SELECTquery('MAX(uid_local)','sys_dmail_ttaddress_category_mm','','', '', ''); $MaxItem=$GLOBALS['TYPO3_DB']->sql_fetch_row($MaxItem); $MaxItem=$MaxItem[0]; if($MinItem && $MaxItem) { for($i=$MinItem;$i<=$MaxItem;$i++) { // delete relations for 'tt_address' records, which has been marked as deleted in the current page if(!$this->modTSconfig['properties']['disableClearDirectMailRelations']) { $isDeleted=$GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)','tt_address','uid="'.$i.'" AND pid="'.$this->id.'" AND deleted="1"','', '', ''); $isDeleted=$GLOBALS['TYPO3_DB']->sql_fetch_row($isDeleted); $isDeleted=$isDeleted[0]; } // delete possible relations with unexisting items in the main table (lost relations to the table 'tt_address') $exists=$GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)','tt_address','uid="'.$i.'"','', '', ''); $exists=$GLOBALS['TYPO3_DB']->sql_fetch_row($exists); $exists=$exists[0]; if($isDeleted || !$exists) $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_dmail_ttaddress_category_mm','uid_local='.$i.''); } } break; CASE 'fe_users': $MinItem=$GLOBALS['TYPO3_DB']->exec_SELECTquery('MIN(uid_local)','sys_dmail_feuser_category_mm','','', '', ''); $MinItem=$GLOBALS['TYPO3_DB']->sql_fetch_row($MinItem); $MinItem=$MinItem[0]; $MaxItem=$GLOBALS['TYPO3_DB']->exec_SELECTquery('MAX(uid_local)','sys_dmail_feuser_category_mm','','', '', ''); $MaxItem=$GLOBALS['TYPO3_DB']->sql_fetch_row($MaxItem); $MaxItem=$MaxItem[0]; if($MinItem && $MaxItem) { for($i=$MinItem;$i<=$MaxItem;$i++) { // delete relations for 'fe_users' records, which has been marked as deleted in the current page if(!$this->modTSconfig['properties']['disableClearDirectMailRelations']) { $isDeleted=$GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)','fe_users','uid="'.$i.'" AND pid="'.$this->id.'" AND deleted="1"','', '', ''); $isDeleted=$GLOBALS['TYPO3_DB']->sql_fetch_row($isDeleted); $isDeleted=$isDeleted[0]; } // delete possible relations with unexisting items in the main table (lost relations to the table 'fe_users') $exists=$GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)','fe_users','uid="'.$i.'"','', '', ''); $exists=$GLOBALS['TYPO3_DB']->sql_fetch_row($exists); $exists=$exists[0]; if($isDeleted || !$exists) $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_dmail_feuser_category_mm','uid_local='.$i.''); } } break; CASE 'sys_dmail_group': $MinItem=$GLOBALS['TYPO3_DB']->exec_SELECTquery('MIN(uid_local)','sys_dmail_group_mm','','', '', ''); $MinItem=$GLOBALS['TYPO3_DB']->sql_fetch_row($MinItem); $MinItem=$MinItem[0]; $MaxItem=$GLOBALS['TYPO3_DB']->exec_SELECTquery('MAX(uid_local)','sys_dmail_group_mm','','', '', ''); $MaxItem=$GLOBALS['TYPO3_DB']->sql_fetch_row($MaxItem); $MaxItem=$MaxItem[0]; if($MinItem && $MaxItem) { for($i=$MinItem;$i<=$MaxItem;$i++) { // delete relations for 'sys_dmail_group' records, which has been marked as deleted in the current page if(!$this->modTSconfig['properties']['disableClearDirectMailRelations']) { $isDeleted=$GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)','sys_dmail_group','uid="'.$i.'" AND pid="'.$this->id.'" AND deleted="1"','', '', ''); $isDeleted=$GLOBALS['TYPO3_DB']->sql_fetch_row($isDeleted); $isDeleted=$isDeleted[0]; } // delete possible relations with unexisting items in the main table (lost relations to the table 'sys_dmail_group') $exists=$GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)','sys_dmail_group','uid="'.$i.'"','', '', ''); $exists=$GLOBALS['TYPO3_DB']->sql_fetch_row($exists); $exists=$exists[0]; if($isDeleted || !$exists) $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_dmail_group_mm','uid_local='.$i.''); } } break; } } }