
43 changed files with 582 additions and 102 deletions
@ -0,0 +1,138 @@ |
|||
<?php |
|||
/*************************************************************** |
|||
* Copyright notice |
|||
* |
|||
* (c) 2011 Sebastian Meyer <sebastian.meyer@slub-dresden.de> |
|||
* All rights reserved |
|||
* |
|||
* This script is part of the TYPO3 project. The TYPO3 project is |
|||
* free software; you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation; either version 2 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* The GNU General Public License can be found at |
|||
* http://www.gnu.org/copyleft/gpl.html. |
|||
* |
|||
* This script is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* This copyright notice MUST APPEAR in all copies of the script! |
|||
***************************************************************/ |
|||
|
|||
/** |
|||
* [CLASS/FUNCTION INDEX of SCRIPT] |
|||
*/ |
|||
|
|||
/** |
|||
* Plugin 'DLF: Toolbox' for the 'dlf' extension. |
|||
* |
|||
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de> |
|||
* @copyright Copyright (c) 2011, Sebastian Meyer, SLUB Dresden |
|||
* @package TYPO3 |
|||
* @subpackage tx_dlf |
|||
* @access public |
|||
*/ |
|||
class tx_dlf_toolbox extends tx_dlf_plugin { |
|||
|
|||
public $scriptRelPath = 'plugins/toolbox/class.tx_dlf_toolbox.php'; |
|||
|
|||
/** |
|||
* The main method of the PlugIn |
|||
* |
|||
* @access public |
|||
* |
|||
* @param string $content: The PlugIn content |
|||
* @param array $conf: The PlugIn configuration |
|||
* |
|||
* @return string The content that is displayed on the website |
|||
*/ |
|||
public function main($content, $conf) { |
|||
|
|||
$this->init($conf); |
|||
|
|||
// Turn cache off. |
|||
$this->setCache(FALSE); |
|||
|
|||
// Quit without doing anything if required piVars are not set. |
|||
if (!$this->checkPIvars(TRUE)) { |
|||
|
|||
return $content; |
|||
|
|||
} |
|||
|
|||
// Load template file. |
|||
if (!empty($this->conf['templateFile'])) { |
|||
|
|||
$this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###'); |
|||
|
|||
} else { |
|||
|
|||
$this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/template.tmpl'), '###TEMPLATE###'); |
|||
|
|||
} |
|||
|
|||
// Set toolbox label. |
|||
$markerArray['###LABEL###'] = $this->pi_getLL('label', '', TRUE); |
|||
|
|||
// Build data array. |
|||
$data = array (); |
|||
|
|||
if (t3lib_div::testInt($this->piVars['id'])) { |
|||
|
|||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
|||
'*', |
|||
'tx_dlf_documents', |
|||
'tx_dlf_documents.uid='.intval($this->piVars['id']).tx_dlf_helper::whereClause('tx_dlf_documents'), |
|||
'', |
|||
'', |
|||
'1' |
|||
); |
|||
|
|||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) { |
|||
|
|||
$data = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result); |
|||
|
|||
} |
|||
|
|||
} else { |
|||
|
|||
// TODO: "data"-Array bei externen METS-Dateien selbst bauen. |
|||
|
|||
} |
|||
|
|||
// Get template subpart for tools. |
|||
$subpart = $this->cObj->getSubpart($this->template, '###TOOLS###'); |
|||
|
|||
if (!empty($data)) { |
|||
|
|||
$_tools = explode(',', $this->conf['tools']); |
|||
|
|||
// Add the tools to the toolbox. |
|||
foreach ($_tools as $_tool) { |
|||
|
|||
$_tool = trim($_tool); |
|||
|
|||
$cObj = t3lib_div::makeInstance('tslib_cObj'); |
|||
|
|||
$cObj->data = $data; |
|||
|
|||
$content .= $this->cObj->substituteMarkerArray($subpart, array ('###TOOL###' => $cObj->cObjGetSingle($GLOBALS['TSFE']->tmpl->setup['plugin.'][$_tool], $GLOBALS['TSFE']->tmpl->setup['plugin.'][$_tool.'.']))); |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
return $this->pi_wrapInBaseClass($this->cObj->substituteSubpart($this->cObj->substituteMarkerArray($this->template, $markerArray), '###TOOLS###', $content, TRUE)); |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/toolbox/class.tx_dlf_toolbox.php']) { |
|||
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/toolbox/class.tx_dlf_toolbox.php']); |
|||
} |
|||
|
|||
?> |
@ -0,0 +1,48 @@ |
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> |
|||
<T3DataStructure> |
|||
<meta> |
|||
<langDisable>1</langDisable> |
|||
</meta> |
|||
<sheets> |
|||
<sDEF> |
|||
<ROOT> |
|||
<TCEforms> |
|||
<sheetTitle>LLL:EXT:dlf/plugins/toolbox/locallang.xml:tt_content.pi_flexform.sheet_general</sheetTitle> |
|||
</TCEforms> |
|||
<type>array</type> |
|||
<el> |
|||
<tools> |
|||
<TCEforms> |
|||
<exclude>1</exclude> |
|||
<label>LLL:EXT:dlf/plugins/toolbox/locallang.xml:tt_content.pi_flexform.tools</label> |
|||
<config> |
|||
<type>select</type> |
|||
<items type="array"></items> |
|||
<itemsProcFunc>tx_dlf_tceforms->itemsProcFunc_toolList</itemsProcFunc> |
|||
<size>5</size> |
|||
<autoSizeMax>15</autoSizeMax> |
|||
<maxitems>1024</maxitems> |
|||
<minitems>1</minitems> |
|||
</config> |
|||
</TCEforms> |
|||
</tools> |
|||
<templateFile> |
|||
<TCEforms> |
|||
<exclude>1</exclude> |
|||
<label>LLL:EXT:dlf/plugins/toolbox/locallang.xml:tt_content.pi_flexform.templateFile</label> |
|||
<config> |
|||
<type>group</type> |
|||
<internal_type>file_reference</internal_type> |
|||
<allowed>tmpl,tpl,html,htm,txt</allowed> |
|||
<size>1</size> |
|||
<maxitems>1</maxitems> |
|||
<minitems>0</minitems> |
|||
<disable_controls>upload</disable_controls> |
|||
</config> |
|||
</TCEforms> |
|||
</templateFile> |
|||
</el> |
|||
</ROOT> |
|||
</sDEF> |
|||
</sheets> |
|||
</T3DataStructure> |
@ -0,0 +1,21 @@ |
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> |
|||
<T3locallang> |
|||
<meta type="array"> |
|||
<type>module</type> |
|||
<description>Language labels for plugin tx_dlf_toolbox</description> |
|||
</meta> |
|||
<data type="array"> |
|||
<languageKey index="default" type="array"> |
|||
<label index="tt_content.pi_flexform.sheet_general">Options</label> |
|||
<label index="tt_content.pi_flexform.tools">Tools</label> |
|||
<label index="tt_content.pi_flexform.templateFile">Template file</label> |
|||
<label index="label">Toolbox</label> |
|||
</languageKey> |
|||
<languageKey index="de" type="array"> |
|||
<label index="tt_content.pi_flexform.sheet_general">Einstellungen</label> |
|||
<label index="tt_content.pi_flexform.tools">Werkzeuge</label> |
|||
<label index="tt_content.pi_flexform.templateFile">HTML-Template</label> |
|||
<label index="label">Werkzeugkasten</label> |
|||
</languageKey> |
|||
</data> |
|||
</T3locallang> |
@ -0,0 +1,15 @@ |
|||
<!-- ###TEMPLATE### --> |
|||
<div class="tx-dlf-tools tx-dlf-window tx-dlf-rightwin tx-dlf-open"> |
|||
<div class="tx-dlf-minimize"></div> |
|||
<div class="tx-dlf-wincontainer"> |
|||
<h3 class="tx-dlf-windowhead">###LABEL###<span class="tx-dlf-moveit"></span></h3> |
|||
<div class="tx-dlf-wincontent tx-dlf-scrollbar"> |
|||
<ul> |
|||
<!-- ###TOOLS### --> |
|||
<li>###TOOL###</li> |
|||
<!-- ###TOOLS### --> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- ###TEMPLATE### --> |
@ -0,0 +1,72 @@ |
|||
<?php |
|||
/*************************************************************** |
|||
* Copyright notice |
|||
* |
|||
* (c) 2011 Sebastian Meyer <sebastian.meyer@slub-dresden.de> |
|||
* All rights reserved |
|||
* |
|||
* This script is part of the TYPO3 project. The TYPO3 project is |
|||
* free software; you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation; either version 2 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* The GNU General Public License can be found at |
|||
* http://www.gnu.org/copyleft/gpl.html. |
|||
* |
|||
* This script is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* This copyright notice MUST APPEAR in all copies of the script! |
|||
***************************************************************/ |
|||
|
|||
/** |
|||
* [CLASS/FUNCTION INDEX of SCRIPT] |
|||
*/ |
|||
|
|||
/** |
|||
* Tool 'Link to DFG Viewer' for the plugin 'DLF: Toolbox' of the 'dlf' extension. |
|||
* |
|||
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de> |
|||
* @copyright Copyright (c) 2011, Sebastian Meyer, SLUB Dresden |
|||
* @package TYPO3 |
|||
* @subpackage tx_dlf |
|||
* @access public |
|||
*/ |
|||
class tx_dlf_toolsDfgviewer extends tx_dlf_plugin { |
|||
|
|||
// Changed to prevent overwriting the main extension's parameters. |
|||
public $prefixId = 'tx_dlf_toolsDfgviewer'; |
|||
|
|||
public $scriptRelPath = 'plugins/toolbox/tools/dfgviewer/class.tx_dlf_toolsDfgviewer.php'; |
|||
|
|||
/** |
|||
* The main method of the PlugIn |
|||
* |
|||
* @access public |
|||
* |
|||
* @param string $content: The PlugIn content |
|||
* @param array $conf: The PlugIn configuration |
|||
* |
|||
* @return string The content that is displayed on the website |
|||
*/ |
|||
public function main($content, $conf) { |
|||
|
|||
$this->init($conf); |
|||
|
|||
// Turn cache off. |
|||
$this->setCache(FALSE); |
|||
|
|||
return ''; |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/toolbox/tools/dfgviewer/class.tx_dlf_toolsDfgviewer.php']) { |
|||
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/toolbox/tools/dfgviewer/class.tx_dlf_toolsDfgviewer.php']); |
|||
} |
|||
|
|||
?> |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> |
|||
<T3locallang> |
|||
<meta type="array"> |
|||
<type>module</type> |
|||
<description>Language labels for tool tx_dlf_dfgviewer</description> |
|||
</meta> |
|||
<data type="array"> |
|||
<languageKey index="default" type="array"> |
|||
<label index="label">Link to DFG Viewer</label> |
|||
</languageKey> |
|||
<languageKey index="de" type="array"> |
|||
<label index="label">Link zum DFG-Viewer</label> |
|||
</languageKey> |
|||
</data> |
|||
</T3locallang> |
@ -0,0 +1,3 @@ |
|||
plugin.tx_dlf_toolsDfgviewer { |
|||
recordId.field = record_id |
|||
} |
@ -0,0 +1,2 @@ |
|||
<!-- ###TEMPLATE### --> |
|||
<!-- ###TEMPLATE### --> |
@ -0,0 +1,96 @@ |
|||
<?php |
|||
/*************************************************************** |
|||
* Copyright notice |
|||
* |
|||
* (c) 2011 Sebastian Meyer <sebastian.meyer@slub-dresden.de> |
|||
* All rights reserved |
|||
* |
|||
* This script is part of the TYPO3 project. The TYPO3 project is |
|||
* free software; you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation; either version 2 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* The GNU General Public License can be found at |
|||
* http://www.gnu.org/copyleft/gpl.html. |
|||
* |
|||
* This script is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* This copyright notice MUST APPEAR in all copies of the script! |
|||
***************************************************************/ |
|||
|
|||
/** |
|||
* [CLASS/FUNCTION INDEX of SCRIPT] |
|||
*/ |
|||
|
|||
/** |
|||
* Tool 'PDF Download' for the plugin 'DLF: Toolbox' of the 'dlf' extension. |
|||
* |
|||
* @author Sebastian Meyer <sebastian.meyer@slub-dresden.de> |
|||
* @copyright Copyright (c) 2011, Sebastian Meyer, SLUB Dresden |
|||
* @package TYPO3 |
|||
* @subpackage tx_dlf |
|||
* @access public |
|||
*/ |
|||
class tx_dlf_toolsPdf extends tx_dlf_plugin { |
|||
|
|||
// Changed to prevent overwriting the main extension's parameters. |
|||
public $prefixId = 'tx_dlf_toolsPdf'; |
|||
|
|||
public $scriptRelPath = 'plugins/toolbox/tools/pdf/class.tx_dlf_toolsPdf.php'; |
|||
|
|||
/** |
|||
* The main method of the PlugIn |
|||
* |
|||
* @access public |
|||
* |
|||
* @param string $content: The PlugIn content |
|||
* @param array $conf: The PlugIn configuration |
|||
* |
|||
* @return string The content that is displayed on the website |
|||
*/ |
|||
public function main($content, $conf) { |
|||
|
|||
$this->init($conf); |
|||
|
|||
// Turn cache off. |
|||
$this->setCache(FALSE); |
|||
|
|||
// Load template file. |
|||
if (!empty($this->conf['templateFile'])) { |
|||
|
|||
$this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###'); |
|||
|
|||
} else { |
|||
|
|||
$this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/tools/pdf/template.tmpl'), '###TEMPLATE###'); |
|||
|
|||
} |
|||
|
|||
// Get document's UID. |
|||
//$this->piVars['id'] = $this->cObj->stdWrap($this->conf['docId'], $this->conf['docId.']); |
|||
|
|||
//if (!empty($this->piVars['id'])) { |
|||
|
|||
//$this->loadDocument(); |
|||
|
|||
// TODO: Just a quick and dirty hack so far! |
|||
$ppn = substr($this->cObj->data['record_id'], -9); |
|||
$content = $this->cObj->substituteMarkerArray($this->template, array ('###LINK###' => '<a href="http://digital.slub-dresden.de/fileadmin/data/'.$ppn.'/'.$ppn.'_tif/jpegs/'.$ppn.'.pdf" target="_blank" title="PDF Download">PDF Download</a>')); |
|||
|
|||
//} |
|||
|
|||
return $this->pi_wrapInBaseClass($content); |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/toolbox/tools/pdf/class.tx_dlf_toolsPdf.php']) { |
|||
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/plugins/toolbox/tools/pdf/class.tx_dlf_toolsPdf.php']); |
|||
} |
|||
|
|||
?> |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> |
|||
<T3locallang> |
|||
<meta type="array"> |
|||
<type>module</type> |
|||
<description>Language labels for tool tx_dlf_pdf</description> |
|||
</meta> |
|||
<data type="array"> |
|||
<languageKey index="default" type="array"> |
|||
<label index="label">PDF Download</label> |
|||
</languageKey> |
|||
<languageKey index="de" type="array"> |
|||
<label index="label">PDF-Download</label> |
|||
</languageKey> |
|||
</data> |
|||
</T3locallang> |
@ -0,0 +1,3 @@ |
|||
plugin.tx_dlf_toolsPdf { |
|||
docId.field = uid |
|||
} |
@ -0,0 +1,3 @@ |
|||
<!-- ###TEMPLATE### --> |
|||
<span class="tx-dlf-tools-pdf">###LINK###</span> |
|||
<!-- ###TEMPLATE### --> |
Loading…
Reference in new issue