Project

General

Profile

Feature #23044 ยป addhook.diff

Administrator Admin, 2010-06-29 17:12

View differences:

typo3_src-4.4.0/typo3/class.db_list_extra.inc 2010-06-29 10:48:14.199860126 -0400
* @return array all available buttons as an assoc. array
*/
public function getButtons() {
global $LANG;
global $LANG, $TYPO3_CONF_VARS;
$buttons = array(
'csh' => '',
......
'shortcut' => '',
'back' => '',
'csv' => '',
'export' => ''
'export' => '',
'custombuttons' => ''
);
// Get users permissions for this page record:
......
}
}
/*
Modification made by Cyril Janody <cyril.janody@sys-tech.net>,
adding of a hook which permits the adding of custom buttons
A marker needs to be added in the file typo3/templates/db_list.html in the section <!-- ###BUTTON_GROUP4### -->###CSV######EXPORT###<!-- ###BUTTON_GROUP4### --> (line 32)
The new marker is "###CUSTOMBUTTONS###" => <!-- ###BUTTON_GROUP4### -->###CSV######EXPORT######CUSTOMBUTTONS###<!-- ###BUTTON_GROUP4### -->
updated: 2010-06-22
*/
if(is_array($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getButtons'])) {
foreach($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getButtons'] as $classData) {
$hookObject = &t3lib_div::getUserObj($classData);
$buttons = $hookObject->getCustomButtons($buttons, $this);
}
}
return $buttons;
}
......
if ($this->csvOutput) $this->outputCSV($table); // This ends the page with exit.
}
/*
Modification made by Cyril Janody <cyril.janody@sys-tech.net>,
adding of a hook to define the action associated with the custom buttons
updated: 2010-06-22
*/
if(is_array($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['customOutput'])) {
foreach($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['customOutput'] as $classData) {
$hookObject = &t3lib_div::getUserObj($classData);
$hookObject->customOutput($accRows, $table, $this);
}
}
// Return content:
return $out;
}
typo3_src-4.4.0/typo3/templates/db_list.html 2010-06-29 10:44:44.495863213 -0400
<!-- ###BUTTON_GROUP1### -->###LEVEL_UP######BACK###<!-- ###BUTTON_GROUP1### -->
<!-- ###BUTTON_GROUP2### -->###NEW_RECORD######PASTE###<!-- ###BUTTON_GROUP2### -->
<!-- ###BUTTON_GROUP3### -->###VIEW######EDIT######HIDE_UNHIDE######MOVE###<!-- ###BUTTON_GROUP3### -->
<!-- ###BUTTON_GROUP4### -->###CSV######EXPORT###<!-- ###BUTTON_GROUP4### -->
<!--
Modification made by Cyril Janody <cyril.janody@sys-tech.net> related to the adding of a custom hook in class.db_list_extra.inc
which permits the adding of custom buttons
Original value for BUTTON_GROUP4 -> ###CSV######EXPORT###
updated: 2010-06-22
-->
<!-- ###BUTTON_GROUP4### -->###CSV######EXPORT######CUSTOMBUTTONS###<!-- ###BUTTON_GROUP4### -->
<!-- ###BUTTON_GROUPS_LEFT### -->
<!-- ###BUTTON_GROUPS_RIGHT### -->
    (1-1/1)