Bug #20194 » saveAndView_configuration_62.diff
typo3/sysext/backend/Classes/Controller/EditDocumentController.php | ||
---|---|---|
$this->MCONF['name'] = 'xMOD_alt_doc.php';
|
||
// CLEANSE SETTINGS
|
||
$this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name']);
|
||
// Hook for processing preview popViewId_addParams, popViewId and viewUrl
|
||
// could be used to modify the save and view preview URL
|
||
if(sizeof($this->getHookObjects())) {
|
||
$parameters = array(
|
||
'editcont' => $this->editconf,
|
||
'popViewId_addParams' => &$this->popViewId_addParams,
|
||
'popViewId' => &$this->popViewId,
|
||
'viewUrl' => &$this->viewUrl,
|
||
);
|
||
foreach ($this->getHookObjects() as $hook) {
|
||
if ((method_exists($hook, 'processPreviewLink'))) {
|
||
$hook->processPreviewLink($parameters, $this);
|
||
}
|
||
}
|
||
}
|
||
// Create an instance of the document template object
|
||
$this->doc = $GLOBALS['TBE_TEMPLATE'];
|
||
$this->doc->backPath = $GLOBALS['BACK_PATH'];
|
||
... | ... | |
}
|
||
/**
|
||
* Get the pre created hook objects for the EditDocumentController
|
||
*
|
||
* @return array
|
||
*/
|
||
protected function getHookObjects(){
|
||
static $hookObjects = NULL;
|
||
if($hookObjects === NULL) {
|
||
$hookObjects = array();
|
||
if (is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['hookObject'])) {
|
||
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['hookObject'] as $classReference) {
|
||
$hook = GeneralUtility::getUserObj($classReference);
|
||
if (is_object($hook)) {
|
||
$hookObjects[] = $hook;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
return $hookObjects;
|
||
}
|
||
/**
|
||
* Main module operation
|
||
*
|
||
* @return void
|
||
... | ... | |
if ($GLOBALS['TCA'][$table]['ctrl']['languageField'] && $calcPRec[$GLOBALS['TCA'][$table]['ctrl']['languageField']] > 0) {
|
||
$this->viewId_addParams = '&L=' . $calcPRec[$GLOBALS['TCA'][$table]['ctrl']['languageField']];
|
||
}
|
||
$pagesTSC = \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($calcPRec['pid']);
|
||
if (is_array($pagesTSC['common.']['table.'][$table.'.']) && is_numeric($pagesTSC['common.']['table.'][$table.'.']['FePreviewPid'])) {
|
||
$this->viewId = $pagesTSC['common.']['table.'][$table.'.']['FePreviewPid'];
|
||
if(isset($pagesTSC['common.']['table.'][$table.'.']['additionalParams'])) {
|
||
$this->viewId_addParams .= '&' . str_replace('###UID###', $theUid, trim($pagesTSC['common.']['table.'][$table.'.']['additionalParams'], '& '));
|
||
}
|
||
}
|
||
}
|
||
// Check internals regarding access:
|
||
$isRootLevelRestrictionIgnored = BackendUtility::isRootLevelRestrictionIgnored($table);
|
||
... | ... | |
$buttons['save'] = IconUtility::getSpriteIcon('actions-document-save', array('html' => '<input type="image" name="_savedok" class="c-inputButton" src="clear.gif" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', 1) . '" />'));
|
||
// SAVE / VIEW button:
|
||
if ($this->viewId && !$this->noView && ExtensionManagementUtility::isLoaded('cms') && $this->getNewIconMode($this->firstEl['table'], 'saveDocView')) {
|
||
$buttons['save_view'] = IconUtility::getSpriteIcon('actions-document-save-view', array('html' => '<input type="image" class="c-inputButton" name="_savedokview" src="clear.gif" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow', 1) . '" />'));
|
||
$pagesTSC = \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($this->pageinfo['uid']);
|
||
if (isset($pagesTSC['properties']['excludeDokTypes'])) {
|
||
$excludeDokTypes = GeneralUtility::intExplode(',', $pagesTSC['properties']['excludeDokTypes'], TRUE);
|
||
} else {
|
||
// exclude sysfolders and recycler by default
|
||
$excludeDokTypes = array(254, 255);
|
||
}
|
||
if (!in_array($this->pageinfo['doktype'], $excludeDokTypes) || isset($pagesTSC['common.']['table.'][$table.'.']['FePreviewPid'])) {
|
||
$buttons['save_view'] = IconUtility::getSpriteIcon('actions-document-save-view', array('html' => '<input type="image" class="c-inputButton" name="_savedokview" src="clear.gif" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow', 1) . '" />'));
|
||
}
|
||
}
|
||
// SAVE / NEW button:
|
||
if (count($this->elementsData) == 1 && $this->getNewIconMode($this->firstEl['table'])) {
|
||
... | ... | |
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'TCEforms', $GLOBALS['BACK_PATH'], '', TRUE);
|
||
$buttons['shortcut'] = $this->shortCutLink();
|
||
$buttons['open_in_new_window'] = $this->openInNewWindowLink();
|
||
// Hook for change the behavior of the button generation
|
||
if(sizeof($this->getHookObjects())) {
|
||
$parameters = array(
|
||
'buttons' => &$buttons
|
||
);
|
||
foreach ($this->getHookObjects() as $hook) {
|
||
if ((method_exists($hook, 'manipulateButtons'))) {
|
||
$hook->manipulateButtons($parameters, $this);
|
||
}
|
||
}
|
||
}
|
||
return $buttons;
|
||
}
|
||
- « Previous
- 1
- 2
- 3
- 4
- Next »