From 42d476585881e2ff757d9e2fc0f06229b513cdb9 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Fri, 7 Sep 2012 12:55:01 +0200 Subject: [PATCH] Make unhiding of hidden documents configurable --- dlf/common/class.tx_dlf_document.php | 12 ++++++++++++ dlf/ext_conf_template.txt | 3 +++ dlf/locallang.xml | 6 ++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dlf/common/class.tx_dlf_document.php b/dlf/common/class.tx_dlf_document.php index 045ab818..9108927d 100644 --- a/dlf/common/class.tx_dlf_document.php +++ b/dlf/common/class.tx_dlf_document.php @@ -1395,6 +1395,8 @@ final class tx_dlf_document { // Fill data array. $data['tx_dlf_documents'][$this->uid] = array ( 'pid' => $pid, + $GLOBALS['TCA']['tx_dlf_documents']['ctrl']['enablecolumns']['starttime'] => 0, + $GLOBALS['TCA']['tx_dlf_documents']['ctrl']['enablecolumns']['endtime'] => 0, 'prod_id' => $metadata['prod_id'][0], 'record_id' => $metadata['record_id'][0], 'opac_id' => $metadata['opac_id'][0], @@ -1418,12 +1420,22 @@ final class tx_dlf_document { 'status' => 0, ); + // Set location. if ($location) { $data['tx_dlf_documents'][$this->uid]['location'] = $location; } + // Unhide hidden documents. + $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]); + + if (!empty($conf['unhideOnIndex'])) { + + $data['tx_dlf_documents'][$this->uid][$GLOBALS['TCA']['tx_dlf_documents']['ctrl']['enablecolumns']['disabled']] = 0; + + } + // Process data. $newIds = tx_dlf_helper::processDB($data); diff --git a/dlf/ext_conf_template.txt b/dlf/ext_conf_template.txt index 7caa6937..cdc53b83 100644 --- a/dlf/ext_conf_template.txt +++ b/dlf/ext_conf_template.txt @@ -10,6 +10,9 @@ useragent = Goobi.Presentation # cat=Basic; type=boolean; label=LLL:EXT:dlf/locallang.xml:config.caching caching = 0 +# cat=Basic; type=boolean; label=LLL:EXT:dlf/locallang.xml:config.unhideOnIndex +unhideOnIndex = 0 + # cat=Files; type=string; label=LLL:EXT:dlf/locallang.xml:config.fileGrps fileGrps = MIN,DEFAULT,MAX diff --git a/dlf/locallang.xml b/dlf/locallang.xml index 1ac9bab2..a1a896cf 100644 --- a/dlf/locallang.xml +++ b/dlf/locallang.xml @@ -119,9 +119,10 @@ + + - @@ -273,9 +274,10 @@ + + -