Fix Bug #1021218: Refactor error reporting to use devlog extension
This commit is contained in:
parent
dd63035b61
commit
c6f599c3c0
File diff suppressed because it is too large
Load Diff
|
@ -231,15 +231,25 @@ class tx_dlf_helper {
|
||||||
// Check for PHP extension "mcrypt".
|
// Check for PHP extension "mcrypt".
|
||||||
if (!extension_loaded('mcrypt')) {
|
if (!extension_loaded('mcrypt')) {
|
||||||
|
|
||||||
trigger_error('PHP extension "mcrypt" not available', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
return NULL;
|
t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] PHP extension "mcrypt" not available', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($encrypted) || empty($hash)) {
|
if (empty($encrypted) || empty($hash)) {
|
||||||
|
|
||||||
return NULL;
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] Invalid parameters given for decryption', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +263,13 @@ class tx_dlf_helper {
|
||||||
|
|
||||||
if ($hashed !== $hash) {
|
if ($hashed !== $hash) {
|
||||||
|
|
||||||
return NULL;
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] Invalid hash "'.$hash.'" given for decryption', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,9 +292,13 @@ class tx_dlf_helper {
|
||||||
// Check for PHP extension "mcrypt".
|
// Check for PHP extension "mcrypt".
|
||||||
if (!extension_loaded('mcrypt')) {
|
if (!extension_loaded('mcrypt')) {
|
||||||
|
|
||||||
trigger_error('PHP extension "mcrypt" not available', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
return NULL;
|
t3lib_div::devLog('[tx_dlf_helper->encrypt('.$string.')] PHP extension "mcrypt" not available', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,11 +336,16 @@ class tx_dlf_helper {
|
||||||
|
|
||||||
} elseif (TYPO3_MODE === 'BE') {
|
} elseif (TYPO3_MODE === 'BE') {
|
||||||
|
|
||||||
|
// Return current backend user.
|
||||||
return $GLOBALS['BE_USER'];
|
return $GLOBALS['BE_USER'];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->getBeUser()] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -341,11 +366,21 @@ class tx_dlf_helper {
|
||||||
*/
|
*/
|
||||||
public static function getIndexName($uid, $table, $pid = -1) {
|
public static function getIndexName($uid, $table, $pid = -1) {
|
||||||
|
|
||||||
|
// Save parameters for logging purposes.
|
||||||
|
$_uid = $uid;
|
||||||
|
|
||||||
|
$_pid = $pid;
|
||||||
|
|
||||||
|
// Sanitize input.
|
||||||
$uid = max(intval($uid), 0);
|
$uid = max(intval($uid), 0);
|
||||||
|
|
||||||
if (!$uid || !in_array($table, array ('tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures', 'tx_dlf_solrcores'))) {
|
if (!$uid || !in_array($table, array ('tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures', 'tx_dlf_solrcores'))) {
|
||||||
|
|
||||||
trigger_error('At least one argument is not valid: UID='.$uid.' or TABLE='.$table, E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->getIndexName('.$_uid.', '.$table.', '.$_pid.')] Invalid UID "'.$uid.'" or table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
|
@ -353,6 +388,7 @@ class tx_dlf_helper {
|
||||||
|
|
||||||
$where = '';
|
$where = '';
|
||||||
|
|
||||||
|
// Should we check for a specific PID, too?
|
||||||
if ($pid !== -1) {
|
if ($pid !== -1) {
|
||||||
|
|
||||||
$pid = max(intval($pid), 0);
|
$pid = max(intval($pid), 0);
|
||||||
|
@ -361,7 +397,8 @@ class tx_dlf_helper {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
// Get index_name from database.
|
||||||
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
$table.'.index_name AS index_name',
|
$table.'.index_name AS index_name',
|
||||||
$table,
|
$table,
|
||||||
$table.'.uid='.$uid.$where.self::whereClause($table),
|
$table.'.uid='.$uid.$where.self::whereClause($table),
|
||||||
|
@ -370,18 +407,24 @@ class tx_dlf_helper {
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
||||||
|
|
||||||
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);
|
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
|
||||||
|
|
||||||
return $resArray['index_name'];
|
return $resArray['index_name'];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->getIndexName('.$_uid.', '.$table.', '.$_pid.')] No "index_name" with UID "'.$uid.'" and PID "'.$pid.'" found in table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error('No "index_name" with UID '.$uid.' found for PID '.$pid.' in TABLE '.$table, E_USER_WARNING);
|
|
||||||
|
|
||||||
return '';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -395,45 +438,52 @@ class tx_dlf_helper {
|
||||||
*/
|
*/
|
||||||
public static function getLanguageName($code) {
|
public static function getLanguageName($code) {
|
||||||
|
|
||||||
$_code = strtolower(trim($code));
|
// Analyze code and set appropriate ISO table.
|
||||||
|
$isoCode = strtolower(trim($code));
|
||||||
|
|
||||||
if (preg_match('/^[a-z]{3}$/', $_code)) {
|
if (preg_match('/^[a-z]{3}$/', $isoCode)) {
|
||||||
|
|
||||||
$_file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-2b.xml';
|
$file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-2b.xml';
|
||||||
|
|
||||||
} elseif (preg_match('/^[a-z]{2}$/', $_code)) {
|
} elseif (preg_match('/^[a-z]{2}$/', $isoCode)) {
|
||||||
|
|
||||||
$_file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-1.xml';
|
$file = t3lib_extMgm::extPath(self::$extKey).'lib/ISO-639/iso-639-1.xml';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
// No ISO code, return unchanged.
|
||||||
return $code;
|
return $code;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load ISO table and get localized full name of language.
|
||||||
if (TYPO3_MODE === 'FE') {
|
if (TYPO3_MODE === 'FE') {
|
||||||
|
|
||||||
$iso639 = $GLOBALS['TSFE']->readLLfile($_file);
|
$iso639 = $GLOBALS['TSFE']->readLLfile($file);
|
||||||
|
|
||||||
if (!empty($iso639['default'][$_code])) {
|
if (!empty($iso639['default'][$isoCode])) {
|
||||||
|
|
||||||
$lang = $GLOBALS['TSFE']->getLLL($_code, $iso639);
|
$lang = $GLOBALS['TSFE']->getLLL($isoCode, $iso639);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif (TYPO3_MODE === 'BE') {
|
} elseif (TYPO3_MODE === 'BE') {
|
||||||
|
|
||||||
$iso639 = $GLOBALS['LANG']->includeLLFile($_file, FALSE, TRUE);
|
$iso639 = $GLOBALS['LANG']->includeLLFile($file, FALSE, TRUE);
|
||||||
|
|
||||||
if (!empty($iso639['default'][$_code])) {
|
if (!empty($iso639['default'][$isoCode])) {
|
||||||
|
|
||||||
$lang = $GLOBALS['LANG']->getLLL($_code, $iso639, FALSE);
|
$lang = $GLOBALS['LANG']->getLLL($isoCode, $iso639, FALSE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->getLanguageName('.$code.')] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $code;
|
return $code;
|
||||||
|
|
||||||
|
@ -445,7 +495,11 @@ class tx_dlf_helper {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Language code "'.$code.'" not found', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->getLanguageName('.$code.')] Language code "'.$code.'" not found in ISO-639 table', $this->extKey, SYSLOG_SEVERITY_NOTICE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $code;
|
return $code;
|
||||||
|
|
||||||
|
@ -466,7 +520,7 @@ class tx_dlf_helper {
|
||||||
*/
|
*/
|
||||||
public static function getURN($base, $id) {
|
public static function getURN($base, $id) {
|
||||||
|
|
||||||
$concordance = array(
|
$concordance = array (
|
||||||
'0' => 1,
|
'0' => 1,
|
||||||
'1' => 2,
|
'1' => 2,
|
||||||
'2' => 3,
|
'2' => 3,
|
||||||
|
@ -511,7 +565,11 @@ class tx_dlf_helper {
|
||||||
|
|
||||||
if (preg_match('/[^a-z0-9:-]/', $urn)) {
|
if (preg_match('/[^a-z0-9:-]/', $urn)) {
|
||||||
|
|
||||||
trigger_error('Invalid chars in URN', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->getURN('.$base.', '.$id.')] Invalid chars in given parameters', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
|
@ -559,23 +617,31 @@ class tx_dlf_helper {
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*
|
*
|
||||||
* @param string $key: Session key for retrieval
|
* @param string $key: Session data key for retrieval
|
||||||
*
|
*
|
||||||
* @return mixed Session value for given key or NULL on failure
|
* @return mixed Session value for given key or NULL on failure
|
||||||
*/
|
*/
|
||||||
public static function loadFromSession($key) {
|
public static function loadFromSession($key) {
|
||||||
|
|
||||||
|
// Save parameter for logging purposes.
|
||||||
|
$_key = $key;
|
||||||
|
|
||||||
// Cast to string for security reasons.
|
// Cast to string for security reasons.
|
||||||
$key = (string) $key;
|
$key = (string) $key;
|
||||||
|
|
||||||
if (!$key) {
|
if (!$key) {
|
||||||
|
|
||||||
trigger_error('No session key given', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->loadFromSession('.$_key.')] Invalid key "'.$key.'" for session data retrieval', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the session data.
|
||||||
if (TYPO3_MODE === 'FE') {
|
if (TYPO3_MODE === 'FE') {
|
||||||
|
|
||||||
return $GLOBALS['TSFE']->fe_user->getKey('ses', $key);
|
return $GLOBALS['TSFE']->fe_user->getKey('ses', $key);
|
||||||
|
@ -586,7 +652,11 @@ class tx_dlf_helper {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->loadFromSession('.$_key.')] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -647,23 +717,31 @@ class tx_dlf_helper {
|
||||||
* @access public
|
* @access public
|
||||||
*
|
*
|
||||||
* @param string $value: Value to save
|
* @param string $value: Value to save
|
||||||
* @param string $key: Session key for retrieval
|
* @param string $key: Session data key for saving
|
||||||
*
|
*
|
||||||
* @return boolean TRUE on success, FALSE on failure
|
* @return boolean TRUE on success, FALSE on failure
|
||||||
*/
|
*/
|
||||||
public static function saveToSession($value, $key) {
|
public static function saveToSession($value, $key) {
|
||||||
|
|
||||||
|
// Save parameter for logging purposes.
|
||||||
|
$_key = $key;
|
||||||
|
|
||||||
// Cast to string for security reasons.
|
// Cast to string for security reasons.
|
||||||
$key = (string) $key;
|
$key = (string) $key;
|
||||||
|
|
||||||
if (!$key) {
|
if (!$key) {
|
||||||
|
|
||||||
trigger_error('No session key given', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->saveToSession('.$value.', '.$_key.')] Invalid key "'.$key.'" for session data saving', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save value in session data.
|
||||||
if (TYPO3_MODE === 'FE') {
|
if (TYPO3_MODE === 'FE') {
|
||||||
|
|
||||||
$GLOBALS['TSFE']->fe_user->setKey('ses', $key, $value);
|
$GLOBALS['TSFE']->fe_user->setKey('ses', $key, $value);
|
||||||
|
@ -680,7 +758,11 @@ class tx_dlf_helper {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Unexpected TYPO3_MODE', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->saveToSession('.$value.', '.$_key.')] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -688,82 +770,6 @@ class tx_dlf_helper {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This validates a METS file against its schemas
|
|
||||||
* TODO: nicht funktionstüchtig!
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
*
|
|
||||||
* @param SimpleXMLElement $xml:
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public static function schemaValidate(SimpleXMLElement $xml) {
|
|
||||||
|
|
||||||
$_libxmlErrors = libxml_use_internal_errors(TRUE);
|
|
||||||
|
|
||||||
// Get schema locations.
|
|
||||||
$xml->registerXPathNamespace('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
|
||||||
|
|
||||||
$_schemaLocations = $xml->xpath('//*[@xsi:schemaLocation]');
|
|
||||||
|
|
||||||
foreach ($_schemaLocations as $_schemaLocation) {
|
|
||||||
|
|
||||||
$_schemas = explode(' ', (string) $_schemaLocation->attributes('http://www.w3.org/2001/XMLSchema-instance')->schemaLocation);
|
|
||||||
|
|
||||||
for ($i = 1, $j = count($_schemas); $i <= $j; $i++) {
|
|
||||||
|
|
||||||
if ($_schemas[$i] == 'http://www.loc.gov/METS/') {
|
|
||||||
|
|
||||||
$schema['mets'] = $_schemas[$i + 1];
|
|
||||||
|
|
||||||
} elseif ($_schemas[$i] == 'http://www.loc.gov/mods/v3') {
|
|
||||||
|
|
||||||
$schema['mods'] = $_schemas[$i + 1];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// TODO: Error-Handling (keine Schemas gefunden)
|
|
||||||
|
|
||||||
// Validate METS part against schema.
|
|
||||||
$dom = new DOMDocument('1.0', 'UTF-8');
|
|
||||||
|
|
||||||
$dom->appendChild($dom->importNode(dom_import_simplexml($this->mets), TRUE));
|
|
||||||
|
|
||||||
$dom->schemaValidate($schema['mets']);
|
|
||||||
|
|
||||||
// TODO: Error-Handling (invalider METS-Part)
|
|
||||||
// libxml_get_last_error() || libxml_get_errors() || libxml_clear_errors()
|
|
||||||
|
|
||||||
// Validate dmdSec parts against schema.
|
|
||||||
foreach ($this->dmdSec as $dmdSec) {
|
|
||||||
|
|
||||||
switch ($dmdSec['type']) {
|
|
||||||
|
|
||||||
case 'MODS':
|
|
||||||
|
|
||||||
$dom = new DOMDocument('1.0', 'UTF-8');
|
|
||||||
|
|
||||||
$dom->appendChild($dom->importNode(dom_import_simplexml($dmdSec['xml']), TRUE));
|
|
||||||
|
|
||||||
$dom->schemaValidate($schema['mods']);
|
|
||||||
|
|
||||||
// TODO: Error-Handling (invalider MODS-Part)
|
|
||||||
// libxml_get_last_error() || libxml_get_errors() || libxml_clear_errors()
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
libxml_use_internal_errors($_libxmlErrors);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This translates an internal "index_name"
|
* This translates an internal "index_name"
|
||||||
*
|
*
|
||||||
|
@ -777,13 +783,24 @@ class tx_dlf_helper {
|
||||||
*/
|
*/
|
||||||
public static function translate($index_name, $table, $pid) {
|
public static function translate($index_name, $table, $pid) {
|
||||||
|
|
||||||
|
// Save parameters for logging purposes.
|
||||||
|
$_index_name = $index_name;
|
||||||
|
|
||||||
|
$_pid = $pid;
|
||||||
|
|
||||||
|
// Load labels into static variable for future use.
|
||||||
static $labels = array ();
|
static $labels = array ();
|
||||||
|
|
||||||
|
// Sanitize input.
|
||||||
$pid = max(intval($pid), 0);
|
$pid = max(intval($pid), 0);
|
||||||
|
|
||||||
if (!$pid) {
|
if (!$pid) {
|
||||||
|
|
||||||
trigger_error('No PID given for translations', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->translate('.$_index_name.', '.$table.', '.$_pid.')] Invalid PID "'.$pid.'" for translation', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $index_name;
|
return $index_name;
|
||||||
|
|
||||||
|
@ -841,13 +858,21 @@ class tx_dlf_helper {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('There are no entries with PID '.$pid.' in table '.$table.' or you are not allowed to access them', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->translate('.$_index_name.', '.$table.', '.$_pid.')] No translation with PID "'.$pid.'" available in table "'.$table.'" or translation not accessible', $this->extKey, SYSLOG_SEVERITY_NOTICE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('The table '.$table.' is not allowed for translation', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->translate('.$_index_name.', '.$table.', '.$_pid.')] No translations available for table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -916,7 +941,11 @@ class tx_dlf_helper {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Unexpected TYPO3_MODE', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_helper->whereClause('.$table.', ['.($showHidden ? 'TRUE' : 'FALSE').'])] Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return ' AND 1=-1';
|
return ' AND 1=-1';
|
||||||
|
|
||||||
|
|
|
@ -37,15 +37,6 @@
|
||||||
*/
|
*/
|
||||||
class tx_dlf_indexing {
|
class tx_dlf_indexing {
|
||||||
|
|
||||||
/**
|
|
||||||
* Array of autocompletable metadata
|
|
||||||
* @see loadIndexConf()
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
* @access protected
|
|
||||||
*/
|
|
||||||
protected static $autocompleted = array ();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The extension key
|
* The extension key
|
||||||
*
|
*
|
||||||
|
@ -55,31 +46,21 @@ class tx_dlf_indexing {
|
||||||
public static $extKey = 'dlf';
|
public static $extKey = 'dlf';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of facets
|
* Array of metadata fields' configuration
|
||||||
* @see loadIndexConf()
|
* @see loadIndexConf()
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
protected static $facets = array ();
|
protected static $fields = array (
|
||||||
|
'autocompleted' => array (),
|
||||||
/**
|
'facets' => array (),
|
||||||
* Array of fields' boost values
|
'sortables' => array (),
|
||||||
* @see loadIndexConf()
|
'indexed' => array (),
|
||||||
*
|
'stored' => array (),
|
||||||
* @var array
|
'tokenized' => array (),
|
||||||
* @access protected
|
'fieldboost' => array ()
|
||||||
*/
|
);
|
||||||
protected static $fieldboost = array ();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Array of indexed metadata
|
|
||||||
* @see loadIndexConf()
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
* @access protected
|
|
||||||
*/
|
|
||||||
protected static $indexed = array ();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of already processed documents
|
* List of already processed documents
|
||||||
|
@ -97,33 +78,6 @@ class tx_dlf_indexing {
|
||||||
*/
|
*/
|
||||||
protected static $solr;
|
protected static $solr;
|
||||||
|
|
||||||
/**
|
|
||||||
* Array of sortable metadata
|
|
||||||
* @see loadIndexConf()
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
* @access protected
|
|
||||||
*/
|
|
||||||
protected static $sortables = array ();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Array of stored metadata
|
|
||||||
* @see loadIndexConf()
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
* @access protected
|
|
||||||
*/
|
|
||||||
protected static $stored = array ();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Array of tokenized metadata
|
|
||||||
* @see loadIndexConf()
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
* @access protected
|
|
||||||
*/
|
|
||||||
protected static $tokenized = array ();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of toplevel structure elements
|
* Array of toplevel structure elements
|
||||||
* @see loadIndexConf()
|
* @see loadIndexConf()
|
||||||
|
@ -164,7 +118,11 @@ class tx_dlf_indexing {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Could not load multi-volume work with UID '.$doc->parentid, E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not load parent document with UID "'.$doc->parentid.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -195,7 +153,7 @@ class tx_dlf_indexing {
|
||||||
self::$solr->commit();
|
self::$solr->commit();
|
||||||
|
|
||||||
// Get document title from database.
|
// Get document title from database.
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_documents.title AS title',
|
'tx_dlf_documents.title AS title',
|
||||||
'tx_dlf_documents',
|
'tx_dlf_documents',
|
||||||
'tx_dlf_documents.uid='.intval($doc->uid).tx_dlf_helper::whereClause('tx_dlf_documents'),
|
'tx_dlf_documents.uid='.intval($doc->uid).tx_dlf_helper::whereClause('tx_dlf_documents'),
|
||||||
|
@ -204,11 +162,11 @@ class tx_dlf_indexing {
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);
|
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
|
||||||
|
|
||||||
if (!defined('TYPO3_cliMode')) {
|
if (!defined('TYPO3_cliMode')) {
|
||||||
|
|
||||||
$_message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentIndexed'), $resArray['title'], $doc->uid)),
|
htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentIndexed'), $resArray['title'], $doc->uid)),
|
||||||
$GLOBALS['LANG']->getLL('flash.done', TRUE),
|
$GLOBALS['LANG']->getLL('flash.done', TRUE),
|
||||||
|
@ -216,7 +174,7 @@ class tx_dlf_indexing {
|
||||||
TRUE
|
TRUE
|
||||||
);
|
);
|
||||||
|
|
||||||
t3lib_FlashMessageQueue::addMessage($_message);
|
t3lib_FlashMessageQueue::addMessage($message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +184,7 @@ class tx_dlf_indexing {
|
||||||
|
|
||||||
if (!defined('TYPO3_cliMode')) {
|
if (!defined('TYPO3_cliMode')) {
|
||||||
|
|
||||||
$_message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
|
$GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
|
||||||
$GLOBALS['LANG']->getLL('flash.error', TRUE),
|
$GLOBALS['LANG']->getLL('flash.error', TRUE),
|
||||||
|
@ -234,11 +192,15 @@ class tx_dlf_indexing {
|
||||||
TRUE
|
TRUE
|
||||||
);
|
);
|
||||||
|
|
||||||
t3lib_FlashMessageQueue::addMessage($_message);
|
t3lib_FlashMessageQueue::addMessage($message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error('Apache Solr exception thrown: '.$e->getMessage(), E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Apache Solr threw exception: "'.$e->getMessage().'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -248,7 +210,7 @@ class tx_dlf_indexing {
|
||||||
|
|
||||||
if (!defined('TYPO3_cliMode')) {
|
if (!defined('TYPO3_cliMode')) {
|
||||||
|
|
||||||
$_message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE),
|
$GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE),
|
||||||
$GLOBALS['LANG']->getLL('flash.warning', TRUE),
|
$GLOBALS['LANG']->getLL('flash.warning', TRUE),
|
||||||
|
@ -256,11 +218,15 @@ class tx_dlf_indexing {
|
||||||
TRUE
|
TRUE
|
||||||
);
|
);
|
||||||
|
|
||||||
t3lib_FlashMessageQueue::addMessage($_message);
|
t3lib_FlashMessageQueue::addMessage($message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error('Could not connect to Apache Solr server', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_indexing->add(['.$doc->uid.'], '.$core.')] Could not connect to Apache Solr server', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -279,6 +245,9 @@ class tx_dlf_indexing {
|
||||||
*/
|
*/
|
||||||
public static function delete($uid) {
|
public static function delete($uid) {
|
||||||
|
|
||||||
|
// Save parameter for logging purposes.
|
||||||
|
$_uid = $uid;
|
||||||
|
|
||||||
// Sanitize input.
|
// Sanitize input.
|
||||||
$uid = max(intval($uid), 0);
|
$uid = max(intval($uid), 0);
|
||||||
|
|
||||||
|
@ -310,7 +279,7 @@ class tx_dlf_indexing {
|
||||||
|
|
||||||
if (!defined('TYPO3_cliMode')) {
|
if (!defined('TYPO3_cliMode')) {
|
||||||
|
|
||||||
$_message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
|
$GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
|
||||||
$GLOBALS['LANG']->getLL('flash.error', TRUE),
|
$GLOBALS['LANG']->getLL('flash.error', TRUE),
|
||||||
|
@ -318,11 +287,15 @@ class tx_dlf_indexing {
|
||||||
TRUE
|
TRUE
|
||||||
);
|
);
|
||||||
|
|
||||||
t3lib_FlashMessageQueue::addMessage($_message);
|
t3lib_FlashMessageQueue::addMessage($message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error('Apache Solr exception thrown: '.$e->getMessage(), E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_indexing->delete('.$_uid.')] Apache Solr threw exception: "'.$e->getMessage().'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -332,7 +305,7 @@ class tx_dlf_indexing {
|
||||||
|
|
||||||
if (!defined('TYPO3_cliMode')) {
|
if (!defined('TYPO3_cliMode')) {
|
||||||
|
|
||||||
$_message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE),
|
$GLOBALS['LANG']->getLL('flash.solrNoConnection', TRUE),
|
||||||
$GLOBALS['LANG']->getLL('flash.error', TRUE),
|
$GLOBALS['LANG']->getLL('flash.error', TRUE),
|
||||||
|
@ -340,11 +313,15 @@ class tx_dlf_indexing {
|
||||||
TRUE
|
TRUE
|
||||||
);
|
);
|
||||||
|
|
||||||
t3lib_FlashMessageQueue::addMessage($_message);
|
t3lib_FlashMessageQueue::addMessage($message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error('Could not connect to Apache Solr server', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_indexing->delete('.$_uid.')] Could not connect to Apache Solr server', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -352,7 +329,7 @@ class tx_dlf_indexing {
|
||||||
|
|
||||||
if (!defined('TYPO3_cliMode')) {
|
if (!defined('TYPO3_cliMode')) {
|
||||||
|
|
||||||
$_message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentDeleted'), $title, $uid)),
|
htmlspecialchars(sprintf($GLOBALS['LANG']->getLL('flash.documentDeleted'), $title, $uid)),
|
||||||
$GLOBALS['LANG']->getLL('flash.done', TRUE),
|
$GLOBALS['LANG']->getLL('flash.done', TRUE),
|
||||||
|
@ -360,7 +337,7 @@ class tx_dlf_indexing {
|
||||||
TRUE
|
TRUE
|
||||||
);
|
);
|
||||||
|
|
||||||
t3lib_FlashMessageQueue::addMessage($_message);
|
t3lib_FlashMessageQueue::addMessage($message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -368,7 +345,11 @@ class tx_dlf_indexing {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Could not find document with UID '.$uid, E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_indexing->delete('.$_uid.')] Invalid UID "'.$uid.'" for document deletion', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -388,7 +369,7 @@ class tx_dlf_indexing {
|
||||||
protected static function loadIndexConf($pid) {
|
protected static function loadIndexConf($pid) {
|
||||||
|
|
||||||
// Get the list of toplevel structures.
|
// Get the list of toplevel structures.
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_structures.index_name AS index_name',
|
'tx_dlf_structures.index_name AS index_name',
|
||||||
'tx_dlf_structures',
|
'tx_dlf_structures',
|
||||||
'tx_dlf_structures.toplevel=1 AND tx_dlf_structures.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_structures'),
|
'tx_dlf_structures.toplevel=1 AND tx_dlf_structures.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_structures'),
|
||||||
|
@ -397,14 +378,14 @@ class tx_dlf_indexing {
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
while ($_toplevel = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {
|
while ($toplevel = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
||||||
|
|
||||||
self::$toplevel[] = $_toplevel['index_name'];
|
self::$toplevel[] = $toplevel['index_name'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the metadata indexing options.
|
// Get the metadata indexing options.
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.tokenized AS tokenized,tx_dlf_metadata.stored AS stored,tx_dlf_metadata.indexed AS indexed,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.is_facet AS is_facet,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.autocomplete AS autocomplete,tx_dlf_metadata.boost AS boost',
|
'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.tokenized AS tokenized,tx_dlf_metadata.stored AS stored,tx_dlf_metadata.indexed AS indexed,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.is_facet AS is_facet,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.autocomplete AS autocomplete,tx_dlf_metadata.boost AS boost',
|
||||||
'tx_dlf_metadata',
|
'tx_dlf_metadata',
|
||||||
'tx_dlf_metadata.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_metadata'),
|
'tx_dlf_metadata.pid='.intval($pid).tx_dlf_helper::whereClause('tx_dlf_metadata'),
|
||||||
|
@ -413,51 +394,51 @@ class tx_dlf_indexing {
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
while ($_indexing = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {
|
while ($indexing = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
||||||
|
|
||||||
if ($_indexing['tokenized']) {
|
if ($indexing['tokenized']) {
|
||||||
|
|
||||||
self::$tokenized[] = $_indexing['index_name'];
|
self::$fields['tokenized'][] = $indexing['index_name'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_indexing['stored'] || $_indexing['is_listed']) {
|
if ($indexing['stored'] || $indexing['is_listed']) {
|
||||||
|
|
||||||
self::$stored[] = $_indexing['index_name'];
|
self::$fields['stored'][] = $indexing['index_name'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_indexing['indexed']) {
|
if ($indexing['indexed']) {
|
||||||
|
|
||||||
self::$indexed[] = $_indexing['index_name'];
|
self::$fields['indexed'][] = $indexing['index_name'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_indexing['is_sortable']) {
|
if ($indexing['is_sortable']) {
|
||||||
|
|
||||||
self::$sortables[] = $_indexing['index_name'];
|
self::$fields['sortables'][] = $indexing['index_name'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_indexing['is_facet']) {
|
if ($indexing['is_facet']) {
|
||||||
|
|
||||||
self::$facets[] = $_indexing['index_name'];
|
self::$fields['facets'][] = $indexing['index_name'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_indexing['autocomplete']) {
|
if ($indexing['autocomplete']) {
|
||||||
|
|
||||||
self::$autocompleted[] = $_indexing['index_name'];
|
self::$fields['autocompleted'][] = $indexing['index_name'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_indexing['boost'] > 0.0) {
|
if ($indexing['boost'] > 0.0) {
|
||||||
|
|
||||||
self::$fieldboost[$_indexing['index_name']] = floatval($_indexing['boost']);
|
self::$fields['fieldboost'][$indexing['index_name']] = floatval($indexing['boost']);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
self::$fieldboost[$_indexing['index_name']] = FALSE;
|
self::$fields['fieldboost'][$indexing['index_name']] = FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,39 +494,39 @@ class tx_dlf_indexing {
|
||||||
|
|
||||||
$solrDoc->setField('toplevel', in_array($logicalUnit['type'], self::$toplevel));
|
$solrDoc->setField('toplevel', in_array($logicalUnit['type'], self::$toplevel));
|
||||||
|
|
||||||
$solrDoc->setField('type', $logicalUnit['type'], self::$fieldboost['type']);
|
$solrDoc->setField('type', $logicalUnit['type'], self::$fields['fieldboost']['type']);
|
||||||
|
|
||||||
$solrDoc->setField('title', $metadata['title'][0], self::$fieldboost['title']);
|
$solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']);
|
||||||
|
|
||||||
$solrDoc->setField('volume', $metadata['volume'][0], self::$fieldboost['volume']);
|
$solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']);
|
||||||
|
|
||||||
foreach ($metadata as $index_name => $data) {
|
foreach ($metadata as $index_name => $data) {
|
||||||
|
|
||||||
if (!empty($data) && substr($index_name, -8) !== '_sorting') {
|
if (!empty($data) && substr($index_name, -8) !== '_sorting') {
|
||||||
|
|
||||||
$suffix = (in_array($index_name, self::$tokenized) ? 't' : 'u');
|
$suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u');
|
||||||
|
|
||||||
$suffix .= (in_array($index_name, self::$stored) ? 's' : 'u');
|
$suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u');
|
||||||
|
|
||||||
$suffix .= (in_array($index_name, self::$indexed) ? 'i' : 'u');
|
$suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u');
|
||||||
|
|
||||||
$solrDoc->setField($index_name.'_'.$suffix, $data, self::$fieldboost[$index_name]);
|
$solrDoc->setField($index_name.'_'.$suffix, $data, self::$fields['fieldboost'][$index_name]);
|
||||||
|
|
||||||
if (in_array($index_name, self::$sortables)) {
|
if (in_array($index_name, self::$fields['sortables'])) {
|
||||||
|
|
||||||
// Add sortable fields to index.
|
// Add sortable fields to index.
|
||||||
$solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]);
|
$solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($index_name, self::$facets)) {
|
if (in_array($index_name, self::$fields['facets'])) {
|
||||||
|
|
||||||
// Add facets to index.
|
// Add facets to index.
|
||||||
$solrDoc->setField($index_name.'_faceting', $data);
|
$solrDoc->setField($index_name.'_faceting', $data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($index_name, self::$autocompleted)) {
|
if (in_array($index_name, self::$fields['autocompleted'])) {
|
||||||
|
|
||||||
// Add autocomplete values to index.
|
// Add autocomplete values to index.
|
||||||
$solrDoc->setField($index_name.'_suggest', $data);
|
$solrDoc->setField($index_name.'_suggest', $data);
|
||||||
|
@ -564,7 +545,7 @@ class tx_dlf_indexing {
|
||||||
|
|
||||||
if (!defined('TYPO3_cliMode')) {
|
if (!defined('TYPO3_cliMode')) {
|
||||||
|
|
||||||
$_message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
|
$GLOBALS['LANG']->getLL('flash.solrException', TRUE).'<br />'.htmlspecialchars($e->getMessage()),
|
||||||
$GLOBALS['LANG']->getLL('flash.error', TRUE),
|
$GLOBALS['LANG']->getLL('flash.error', TRUE),
|
||||||
|
@ -572,7 +553,7 @@ class tx_dlf_indexing {
|
||||||
TRUE
|
TRUE
|
||||||
);
|
);
|
||||||
|
|
||||||
t3lib_FlashMessageQueue::addMessage($_message);
|
t3lib_FlashMessageQueue::addMessage($message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,11 +92,18 @@ class tx_dlf_list implements t3lib_Singleton {
|
||||||
*/
|
*/
|
||||||
public function remove($position) {
|
public function remove($position) {
|
||||||
|
|
||||||
|
// Save parameter for logging purposes.
|
||||||
|
$_position = $position;
|
||||||
|
|
||||||
$position = intval($position);
|
$position = intval($position);
|
||||||
|
|
||||||
if ($position < 0 || $position >= $this->count) {
|
if ($position < 0 || $position >= $this->count) {
|
||||||
|
|
||||||
trigger_error('No valid list position for removal', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_list->remove('.$_position.')] Invalid position "'.$position.'" for element removing', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -122,12 +129,21 @@ class tx_dlf_list implements t3lib_Singleton {
|
||||||
*/
|
*/
|
||||||
public function move($position, $steps) {
|
public function move($position, $steps) {
|
||||||
|
|
||||||
|
// Save parameters for logging purposes.
|
||||||
|
$_position = $position;
|
||||||
|
|
||||||
|
$_steps = $steps;
|
||||||
|
|
||||||
$position = intval($position);
|
$position = intval($position);
|
||||||
|
|
||||||
// Check if list position is valid.
|
// Check if list position is valid.
|
||||||
if ($position < 0 || $position >= $this->count) {
|
if ($position < 0 || $position >= $this->count) {
|
||||||
|
|
||||||
trigger_error('Invalid list position '.$position, E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid position "'.$position.'" for element moving', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -138,7 +154,11 @@ class tx_dlf_list implements t3lib_Singleton {
|
||||||
// Check if moving given amount of steps is possible.
|
// Check if moving given amount of steps is possible.
|
||||||
if (($position + $steps) < 0 || ($position + $steps) >= $this->count) {
|
if (($position + $steps) < 0 || ($position + $steps) >= $this->count) {
|
||||||
|
|
||||||
trigger_error('Element at position '.$position.' can not be moved '.$steps.' steps', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_list->move('.$_position.', '.$_steps.')] Invalid steps "'.$steps.'" for moving element at position "'.$position.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -273,6 +293,14 @@ class tx_dlf_list implements t3lib_Singleton {
|
||||||
|
|
||||||
$this->elements = $newOrder;
|
$this->elements = $newOrder;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_list->sort('.$by.', ['.($asc ? 'TRUE' : 'FALSE').'])] Sorted list elements do not match unsorted elements', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -400,17 +428,21 @@ class tx_dlf_list implements t3lib_Singleton {
|
||||||
*/
|
*/
|
||||||
public function __get($var) {
|
public function __get($var) {
|
||||||
|
|
||||||
$_method = '_get'.ucfirst($var);
|
$method = '_get'.ucfirst($var);
|
||||||
|
|
||||||
if (!property_exists($this, $var) || !method_exists($this, $_method)) {
|
if (!property_exists($this, $var) || !method_exists($this, $method)) {
|
||||||
|
|
||||||
trigger_error('There is no get function for property '.$var, E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_list->__get('.$var.')] There is no getter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
return $this->$_method();
|
return $this->$method();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,15 +460,19 @@ class tx_dlf_list implements t3lib_Singleton {
|
||||||
*/
|
*/
|
||||||
public function __set($var, $value) {
|
public function __set($var, $value) {
|
||||||
|
|
||||||
$_method = '_set'.ucfirst($var);
|
$method = '_set'.ucfirst($var);
|
||||||
|
|
||||||
if (!property_exists($this, $var) || !method_exists($this, $_method)) {
|
if (!property_exists($this, $var) || !method_exists($this, $method)) {
|
||||||
|
|
||||||
trigger_error('There is no set function for property '.$var, E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_list->__set('.$var.', '.$value.')] There is no setter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$this->$_method($value);
|
$this->$method($value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,12 +107,6 @@ class tx_dlf_mods implements tx_dlf_format {
|
||||||
|
|
||||||
$metadata['author'][$i] = trim(implode(', ', $name));
|
$metadata['author'][$i] = trim(implode(', ', $name));
|
||||||
|
|
||||||
if (!$metadata['author_sorting'][0]) {
|
|
||||||
|
|
||||||
$metadata['author_sorting'][0] = trim(implode(', ', $name));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if there is a display form.
|
// Check if there is a display form.
|
||||||
|
@ -120,12 +114,6 @@ class tx_dlf_mods implements tx_dlf_format {
|
||||||
|
|
||||||
$metadata['author'][$i] = (string) $displayForm[0];
|
$metadata['author'][$i] = (string) $displayForm[0];
|
||||||
|
|
||||||
if (!$metadata['author_sorting'][0]) {
|
|
||||||
|
|
||||||
$metadata['author_sorting'][0] = (string) $displayForm[0];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,13 +147,13 @@ abstract class tx_dlf_module extends t3lib_SCbase {
|
||||||
// Set $this->MOD_MENU array here or leave empty.
|
// Set $this->MOD_MENU array here or leave empty.
|
||||||
|
|
||||||
/* Example code:
|
/* Example code:
|
||||||
$this->MOD_MENU = array (
|
$this->MOD_MENU = array (
|
||||||
'function' => array (
|
'function' => array (
|
||||||
'1' => $GLOBALS['LANG']->getLL('function1'),
|
'1' => $GLOBALS['LANG']->getLL('function1'),
|
||||||
'2' => $GLOBALS['LANG']->getLL('function2'),
|
'2' => $GLOBALS['LANG']->getLL('function2'),
|
||||||
'3' => $GLOBALS['LANG']->getLL('function3'),
|
'3' => $GLOBALS['LANG']->getLL('function3'),
|
||||||
)
|
)
|
||||||
); */
|
); */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,17 +182,15 @@ abstract class tx_dlf_module extends t3lib_SCbase {
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
script_ended = 0;
|
script_ended = 0;
|
||||||
function jumpToUrl(URL) {
|
function jumpToUrl(URL) {
|
||||||
document.location = URL;
|
document.location = URL;
|
||||||
}
|
}
|
||||||
</script>
|
</script>';
|
||||||
';
|
|
||||||
|
|
||||||
// Add Javascript for convenient module switch.
|
// Add Javascript for convenient module switch.
|
||||||
$this->doc->postCode .= '
|
$this->doc->postCode .= '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
script_ended = 1;
|
script_ended = 1;
|
||||||
</script>
|
</script>';
|
||||||
';
|
|
||||||
|
|
||||||
// Render output.
|
// Render output.
|
||||||
$this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
|
$this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
|
||||||
|
@ -233,7 +231,7 @@ abstract class tx_dlf_module extends t3lib_SCbase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No xclasses for abstract classes!
|
/* No xclasses for abstract classes!
|
||||||
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']) {
|
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']) {
|
||||||
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']);
|
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_module.php']);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -155,7 +155,11 @@ abstract class tx_dlf_plugin extends tslib_pibase {
|
||||||
if (!$this->doc->ready) {
|
if (!$this->doc->ready) {
|
||||||
|
|
||||||
// Destroy the incomplete object.
|
// Destroy the incomplete object.
|
||||||
trigger_error('Failed to load document with UID '.$this->piVars['id'], E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_plugin->loadDocument()] Failed to load document with UID "'.$this->piVars['id'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$this->doc = NULL;
|
$this->doc = NULL;
|
||||||
|
|
||||||
|
@ -170,12 +174,12 @@ abstract class tx_dlf_plugin extends tslib_pibase {
|
||||||
|
|
||||||
// Get UID of document with given record identifier.
|
// Get UID of document with given record identifier.
|
||||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_documents.uid',
|
'tx_dlf_documents.uid',
|
||||||
'tx_dlf_documents',
|
'tx_dlf_documents',
|
||||||
'tx_dlf_documents.record_id='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['recordId'], 'tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_documents'),
|
'tx_dlf_documents.record_id='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['recordId'], 'tx_dlf_documents').tx_dlf_helper::whereClause('tx_dlf_documents'),
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) == 1) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) == 1) {
|
||||||
|
@ -193,13 +197,21 @@ abstract class tx_dlf_plugin extends tslib_pibase {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Failed to load document with record ID '.$this->piVars['recordId'], E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_plugin->loadDocument()] Failed to load document with record ID "'.$this->piVars['recordId'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('No UID or PID given for document', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_plugin->loadDocument()] Invalid UID "'.$this->piVars['id'].'" or PID "'.$this->conf['pages'].'" for document loading', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,7 +316,7 @@ abstract class tx_dlf_plugin extends tslib_pibase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No xclasses for abstract classes!
|
/* No xclasses for abstract classes!
|
||||||
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']) {
|
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']) {
|
||||||
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']);
|
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_plugin.php']);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -93,6 +93,9 @@ class tx_dlf_solr {
|
||||||
*/
|
*/
|
||||||
public static function solrConnect($core = 0) {
|
public static function solrConnect($core = 0) {
|
||||||
|
|
||||||
|
// Save parameter for logging purposes.
|
||||||
|
$_core = $core;
|
||||||
|
|
||||||
// Load class.
|
// Load class.
|
||||||
if (!class_exists('Apache_Solr_Service')) {
|
if (!class_exists('Apache_Solr_Service')) {
|
||||||
|
|
||||||
|
@ -122,7 +125,11 @@ class tx_dlf_solr {
|
||||||
|
|
||||||
if (empty($core)) {
|
if (empty($core)) {
|
||||||
|
|
||||||
trigger_error('Could not find Solr core with UID '.$core, E_USER_NOTICE);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_solr->solrConnect('.$_core.')] Invalid UID "'.$_core.'" for Apache Solr core', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -146,7 +153,11 @@ class tx_dlf_solr {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Could not connect to Solr server with core "'.$core.'"', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_solr->solrConnect('.$_core.')] Could not connect to Apache Solr server with core "'.$core.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -191,7 +202,7 @@ class tx_dlf_solr {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No xclasses for static classes!
|
/* No xclasses for static classes!
|
||||||
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']) {
|
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']) {
|
||||||
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']);
|
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/dlf/common/class.tx_dlf_solr.php']);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -25,36 +25,36 @@
|
||||||
$extensionPath = t3lib_extMgm::extPath('dlf');
|
$extensionPath = t3lib_extMgm::extPath('dlf');
|
||||||
|
|
||||||
return array (
|
return array (
|
||||||
'tx_dlf_cli' => $extensionPath.'cli/class.tx_dlf_cli.php',
|
'tx_dlf_cli' => $extensionPath.'cli/class.tx_dlf_cli.php',
|
||||||
'tx_dlf_document' => $extensionPath.'common/class.tx_dlf_document.php',
|
'tx_dlf_document' => $extensionPath.'common/class.tx_dlf_document.php',
|
||||||
'tx_dlf_format' => $extensionPath.'common/class.tx_dlf_format.php',
|
'tx_dlf_format' => $extensionPath.'common/class.tx_dlf_format.php',
|
||||||
'tx_dlf_helper' => $extensionPath.'common/class.tx_dlf_helper.php',
|
'tx_dlf_helper' => $extensionPath.'common/class.tx_dlf_helper.php',
|
||||||
'tx_dlf_indexing' => $extensionPath.'common/class.tx_dlf_indexing.php',
|
'tx_dlf_indexing' => $extensionPath.'common/class.tx_dlf_indexing.php',
|
||||||
'tx_dlf_list' => $extensionPath.'common/class.tx_dlf_list.php',
|
'tx_dlf_list' => $extensionPath.'common/class.tx_dlf_list.php',
|
||||||
'tx_dlf_mods' => $extensionPath.'common/class.tx_dlf_mods.php',
|
'tx_dlf_mods' => $extensionPath.'common/class.tx_dlf_mods.php',
|
||||||
'tx_dlf_module' => $extensionPath.'common/class.tx_dlf_module.php',
|
'tx_dlf_module' => $extensionPath.'common/class.tx_dlf_module.php',
|
||||||
'tx_dlf_plugin' => $extensionPath.'common/class.tx_dlf_plugin.php',
|
'tx_dlf_plugin' => $extensionPath.'common/class.tx_dlf_plugin.php',
|
||||||
'tx_dlf_solr' => $extensionPath.'common/class.tx_dlf_solr.php',
|
'tx_dlf_solr' => $extensionPath.'common/class.tx_dlf_solr.php',
|
||||||
'tx_dlf_em' => $extensionPath.'hooks/class.tx_dlf_em.php',
|
'tx_dlf_em' => $extensionPath.'hooks/class.tx_dlf_em.php',
|
||||||
'tx_dlf_hacks' => $extensionPath.'hooks/class.tx_dlf_hacks.php',
|
'tx_dlf_hacks' => $extensionPath.'hooks/class.tx_dlf_hacks.php',
|
||||||
'tx_dlf_tceforms' => $extensionPath.'hooks/class.tx_dlf_tceforms.php',
|
'tx_dlf_tceforms' => $extensionPath.'hooks/class.tx_dlf_tceforms.php',
|
||||||
'tx_dlf_tcemain' => $extensionPath.'hooks/class.tx_dlf_tcemain.php',
|
'tx_dlf_tcemain' => $extensionPath.'hooks/class.tx_dlf_tcemain.php',
|
||||||
'tx_dlf_modIndexing' => $extensionPath.'modules/indexing/index.php',
|
'tx_dlf_modIndexing' => $extensionPath.'modules/indexing/index.php',
|
||||||
'tx_dlf_modNewclient' => $extensionPath.'modules/newclient/index.php',
|
'tx_dlf_modNewclient' => $extensionPath.'modules/newclient/index.php',
|
||||||
'tx_dlf_collection' => $extensionPath.'plugins/collection/class.tx_dlf_collection.php',
|
'tx_dlf_collection' => $extensionPath.'plugins/collection/class.tx_dlf_collection.php',
|
||||||
'tx_dlf_feeds' => $extensionPath.'plugins/feeds/class.tx_dlf_feeds.php',
|
'tx_dlf_feeds' => $extensionPath.'plugins/feeds/class.tx_dlf_feeds.php',
|
||||||
'tx_dlf_listview' => $extensionPath.'plugins/listview/class.tx_dlf_listview.php',
|
'tx_dlf_listview' => $extensionPath.'plugins/listview/class.tx_dlf_listview.php',
|
||||||
'tx_dlf_metadata' => $extensionPath.'plugins/metadata/class.tx_dlf_metadata.php',
|
'tx_dlf_metadata' => $extensionPath.'plugins/metadata/class.tx_dlf_metadata.php',
|
||||||
'tx_dlf_navigation' => $extensionPath.'plugins/navigation/class.tx_dlf_navigation.php',
|
'tx_dlf_navigation' => $extensionPath.'plugins/navigation/class.tx_dlf_navigation.php',
|
||||||
'tx_dlf_oai' => $extensionPath.'plugins/oai/class.tx_dlf_oai.php',
|
'tx_dlf_oai' => $extensionPath.'plugins/oai/class.tx_dlf_oai.php',
|
||||||
'tx_dlf_pageview' => $extensionPath.'plugins/pageview/class.tx_dlf_pageview.php',
|
'tx_dlf_pageview' => $extensionPath.'plugins/pageview/class.tx_dlf_pageview.php',
|
||||||
'tx_dlf_search' => $extensionPath.'plugins/search/class.tx_dlf_search.php',
|
'tx_dlf_search' => $extensionPath.'plugins/search/class.tx_dlf_search.php',
|
||||||
'tx_dlf_search_suggest' => $extensionPath.'plugins/search/class.tx_dlf_search_suggest.php',
|
'tx_dlf_search_suggest' => $extensionPath.'plugins/search/class.tx_dlf_search_suggest.php',
|
||||||
'tx_dlf_statistics' => $extensionPath.'plugins/statistics/class.tx_dlf_statistics.php',
|
'tx_dlf_statistics' => $extensionPath.'plugins/statistics/class.tx_dlf_statistics.php',
|
||||||
'tx_dlf_toc' => $extensionPath.'plugins/toc/class.tx_dlf_toc.php',
|
'tx_dlf_toc' => $extensionPath.'plugins/toc/class.tx_dlf_toc.php',
|
||||||
'tx_dlf_toolbox' => $extensionPath.'plugins/toolbox/class.tx_dlf_toolbox.php',
|
'tx_dlf_toolbox' => $extensionPath.'plugins/toolbox/class.tx_dlf_toolbox.php',
|
||||||
'tx_dlf_toolsDfgviewer' => $extensionPath.'plugins/toolbox/tools/dfgviewer/class.tx_dlf_toolsDfgviewer.php',
|
'tx_dlf_toolsDfgviewer' => $extensionPath.'plugins/toolbox/tools/dfgviewer/class.tx_dlf_toolsDfgviewer.php',
|
||||||
'tx_dlf_toolsPdf' => $extensionPath.'plugins/toolbox/tools/pdf/class.tx_dlf_toolsPdf.php'
|
'tx_dlf_toolsPdf' => $extensionPath.'plugins/toolbox/tools/pdf/class.tx_dlf_toolsPdf.php'
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -26,173 +26,173 @@ if (!defined ('TYPO3_MODE')) die ('Access denied.');
|
||||||
|
|
||||||
// Register database tables.
|
// Register database tables.
|
||||||
$TCA['tx_dlf_documents'] = array (
|
$TCA['tx_dlf_documents'] = array (
|
||||||
'ctrl' => array (
|
'ctrl' => array (
|
||||||
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents',
|
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_documents',
|
||||||
'label' => 'title',
|
'label' => 'title',
|
||||||
'tstamp' => 'tstamp',
|
'tstamp' => 'tstamp',
|
||||||
'crdate' => 'crdate',
|
'crdate' => 'crdate',
|
||||||
'cruser_id' => 'cruser_id',
|
'cruser_id' => 'cruser_id',
|
||||||
'default_sortby' => 'ORDER BY title_sorting',
|
'default_sortby' => 'ORDER BY title_sorting',
|
||||||
'delete' => 'deleted',
|
'delete' => 'deleted',
|
||||||
'enablecolumns' => array (
|
'enablecolumns' => array (
|
||||||
'disabled' => 'hidden',
|
'disabled' => 'hidden',
|
||||||
'fe_group' => 'fe_group',
|
'fe_group' => 'fe_group',
|
||||||
),
|
|
||||||
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
|
||||||
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfdocuments.png',
|
|
||||||
'rootLevel' => 0,
|
|
||||||
'dividers2tabs' => 2,
|
|
||||||
'searchFields' => 'title,volume,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn',
|
|
||||||
),
|
),
|
||||||
'feInterface' => array (
|
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
||||||
'fe_admin_fieldList' => '',
|
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfdocuments.png',
|
||||||
)
|
'rootLevel' => 0,
|
||||||
|
'dividers2tabs' => 2,
|
||||||
|
'searchFields' => 'title,volume,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn',
|
||||||
|
),
|
||||||
|
'feInterface' => array (
|
||||||
|
'fe_admin_fieldList' => '',
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$TCA['tx_dlf_structures'] = array (
|
$TCA['tx_dlf_structures'] = array (
|
||||||
'ctrl' => array (
|
'ctrl' => array (
|
||||||
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures',
|
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures',
|
||||||
'label' => 'label',
|
'label' => 'label',
|
||||||
'tstamp' => 'tstamp',
|
'tstamp' => 'tstamp',
|
||||||
'crdate' => 'crdate',
|
'crdate' => 'crdate',
|
||||||
'cruser_id' => 'cruser_id',
|
'cruser_id' => 'cruser_id',
|
||||||
'languageField' => 'sys_language_uid',
|
'languageField' => 'sys_language_uid',
|
||||||
'transOrigPointerField' => 'l18n_parent',
|
'transOrigPointerField' => 'l18n_parent',
|
||||||
'transOrigDiffSourceField' => 'l18n_diffsource',
|
'transOrigDiffSourceField' => 'l18n_diffsource',
|
||||||
'default_sortby' => 'ORDER BY label',
|
'default_sortby' => 'ORDER BY label',
|
||||||
'delete' => 'deleted',
|
'delete' => 'deleted',
|
||||||
'enablecolumns' => array (
|
'enablecolumns' => array (
|
||||||
'disabled' => 'hidden',
|
'disabled' => 'hidden',
|
||||||
),
|
|
||||||
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
|
||||||
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfstructures.png',
|
|
||||||
'rootLevel' => 0,
|
|
||||||
'dividers2tabs' => 2,
|
|
||||||
'searchFields' => 'label,index_name,oai_name',
|
|
||||||
),
|
),
|
||||||
'feInterface' => array (
|
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
||||||
'fe_admin_fieldList' => '',
|
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfstructures.png',
|
||||||
)
|
'rootLevel' => 0,
|
||||||
|
'dividers2tabs' => 2,
|
||||||
|
'searchFields' => 'label,index_name,oai_name',
|
||||||
|
),
|
||||||
|
'feInterface' => array (
|
||||||
|
'fe_admin_fieldList' => '',
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$TCA['tx_dlf_metadata'] = array (
|
$TCA['tx_dlf_metadata'] = array (
|
||||||
'ctrl' => array (
|
'ctrl' => array (
|
||||||
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata',
|
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_metadata',
|
||||||
'label' => 'label',
|
'label' => 'label',
|
||||||
'tstamp' => 'tstamp',
|
'tstamp' => 'tstamp',
|
||||||
'crdate' => 'crdate',
|
'crdate' => 'crdate',
|
||||||
'cruser_id' => 'cruser_id',
|
'cruser_id' => 'cruser_id',
|
||||||
'languageField' => 'sys_language_uid',
|
'languageField' => 'sys_language_uid',
|
||||||
'transOrigPointerField' => 'l18n_parent',
|
'transOrigPointerField' => 'l18n_parent',
|
||||||
'transOrigDiffSourceField' => 'l18n_diffsource',
|
'transOrigDiffSourceField' => 'l18n_diffsource',
|
||||||
'sortby' => 'sorting',
|
'sortby' => 'sorting',
|
||||||
'delete' => 'deleted',
|
'delete' => 'deleted',
|
||||||
'enablecolumns' => array (
|
'enablecolumns' => array (
|
||||||
'disabled' => 'hidden',
|
'disabled' => 'hidden',
|
||||||
),
|
|
||||||
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
|
||||||
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfmetadata.png',
|
|
||||||
'rootLevel' => 0,
|
|
||||||
'dividers2tabs' => 2,
|
|
||||||
'searchFields' => 'label,index_name,encoding,xpath,xpath_sorting,default',
|
|
||||||
'requestUpdate' => 'is_sortable',
|
|
||||||
),
|
),
|
||||||
'feInterface' => array (
|
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
||||||
'fe_admin_fieldList' => '',
|
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfmetadata.png',
|
||||||
)
|
'rootLevel' => 0,
|
||||||
|
'dividers2tabs' => 2,
|
||||||
|
'searchFields' => 'label,index_name,encoding,xpath,xpath_sorting,default',
|
||||||
|
'requestUpdate' => 'is_sortable',
|
||||||
|
),
|
||||||
|
'feInterface' => array (
|
||||||
|
'fe_admin_fieldList' => '',
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$TCA['tx_dlf_formats'] = array (
|
$TCA['tx_dlf_formats'] = array (
|
||||||
'ctrl' => array (
|
'ctrl' => array (
|
||||||
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats',
|
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats',
|
||||||
'label' => 'type',
|
'label' => 'type',
|
||||||
'tstamp' => 'tstamp',
|
'tstamp' => 'tstamp',
|
||||||
'crdate' => 'crdate',
|
'crdate' => 'crdate',
|
||||||
'cruser_id' => 'cruser_id',
|
'cruser_id' => 'cruser_id',
|
||||||
'default_sortby' => 'ORDER BY type',
|
'default_sortby' => 'ORDER BY type',
|
||||||
'delete' => 'deleted',
|
'delete' => 'deleted',
|
||||||
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
||||||
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfformats.png',
|
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfformats.png',
|
||||||
'rootLevel' => 1,
|
'rootLevel' => 1,
|
||||||
'dividers2tabs' => 2,
|
'dividers2tabs' => 2,
|
||||||
'searchFields' => 'type,class',
|
'searchFields' => 'type,class',
|
||||||
),
|
),
|
||||||
'feInterface' => array (
|
'feInterface' => array (
|
||||||
'fe_admin_fieldList' => '',
|
'fe_admin_fieldList' => '',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$TCA['tx_dlf_solrcores'] = array (
|
$TCA['tx_dlf_solrcores'] = array (
|
||||||
'ctrl' => array (
|
'ctrl' => array (
|
||||||
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_solrcores',
|
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_solrcores',
|
||||||
'label' => 'label',
|
'label' => 'label',
|
||||||
'tstamp' => 'tstamp',
|
'tstamp' => 'tstamp',
|
||||||
'crdate' => 'crdate',
|
'crdate' => 'crdate',
|
||||||
'cruser_id' => 'cruser_id',
|
'cruser_id' => 'cruser_id',
|
||||||
'default_sortby' => 'ORDER BY label',
|
'default_sortby' => 'ORDER BY label',
|
||||||
'delete' => 'deleted',
|
'delete' => 'deleted',
|
||||||
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
||||||
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfsolrcores.png',
|
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfsolrcores.png',
|
||||||
'rootLevel' => -1,
|
'rootLevel' => -1,
|
||||||
'adminOnly' => 1,
|
'adminOnly' => 1,
|
||||||
'dividers2tabs' => 2,
|
'dividers2tabs' => 2,
|
||||||
'searchFields' => 'label,index_name',
|
'searchFields' => 'label,index_name',
|
||||||
),
|
),
|
||||||
'feInterface' => array (
|
'feInterface' => array (
|
||||||
'fe_admin_fieldList' => '',
|
'fe_admin_fieldList' => '',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$TCA['tx_dlf_collections'] = array (
|
$TCA['tx_dlf_collections'] = array (
|
||||||
'ctrl' => array (
|
'ctrl' => array (
|
||||||
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_collections',
|
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_collections',
|
||||||
'label' => 'label',
|
'label' => 'label',
|
||||||
'tstamp' => 'tstamp',
|
'tstamp' => 'tstamp',
|
||||||
'crdate' => 'crdate',
|
'crdate' => 'crdate',
|
||||||
'cruser_id' => 'cruser_id',
|
'cruser_id' => 'cruser_id',
|
||||||
'fe_cruser_id' => 'fe_cruser_id',
|
'fe_cruser_id' => 'fe_cruser_id',
|
||||||
'fe_admin_lock' => 'fe_admin_lock',
|
'fe_admin_lock' => 'fe_admin_lock',
|
||||||
'languageField' => 'sys_language_uid',
|
'languageField' => 'sys_language_uid',
|
||||||
'transOrigPointerField' => 'l18n_parent',
|
'transOrigPointerField' => 'l18n_parent',
|
||||||
'transOrigDiffSourceField' => 'l18n_diffsource',
|
'transOrigDiffSourceField' => 'l18n_diffsource',
|
||||||
'default_sortby' => 'ORDER BY label',
|
'default_sortby' => 'ORDER BY label',
|
||||||
'delete' => 'deleted',
|
'delete' => 'deleted',
|
||||||
'enablecolumns' => array (
|
'enablecolumns' => array (
|
||||||
'disabled' => 'hidden',
|
'disabled' => 'hidden',
|
||||||
'fe_group' => 'fe_group',
|
'fe_group' => 'fe_group',
|
||||||
),
|
|
||||||
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
|
||||||
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfcollections.png',
|
|
||||||
'rootLevel' => 0,
|
|
||||||
'dividers2tabs' => 2,
|
|
||||||
'searchFields' => 'label,index_name,oai_name,fe_cruser_id',
|
|
||||||
),
|
),
|
||||||
'feInterface' => array (
|
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
||||||
'fe_admin_fieldList' => 'label,description,documents',
|
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlfcollections.png',
|
||||||
)
|
'rootLevel' => 0,
|
||||||
|
'dividers2tabs' => 2,
|
||||||
|
'searchFields' => 'label,index_name,oai_name,fe_cruser_id',
|
||||||
|
),
|
||||||
|
'feInterface' => array (
|
||||||
|
'fe_admin_fieldList' => 'label,description,documents',
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$TCA['tx_dlf_libraries'] = array (
|
$TCA['tx_dlf_libraries'] = array (
|
||||||
'ctrl' => array (
|
'ctrl' => array (
|
||||||
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_libraries',
|
'title' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_libraries',
|
||||||
'label' => 'label',
|
'label' => 'label',
|
||||||
'tstamp' => 'tstamp',
|
'tstamp' => 'tstamp',
|
||||||
'crdate' => 'crdate',
|
'crdate' => 'crdate',
|
||||||
'cruser_id' => 'cruser_id',
|
'cruser_id' => 'cruser_id',
|
||||||
'languageField' => 'sys_language_uid',
|
'languageField' => 'sys_language_uid',
|
||||||
'transOrigPointerField' => 'l18n_parent',
|
'transOrigPointerField' => 'l18n_parent',
|
||||||
'transOrigDiffSourceField' => 'l18n_diffsource',
|
'transOrigDiffSourceField' => 'l18n_diffsource',
|
||||||
'default_sortby' => 'ORDER BY label',
|
'default_sortby' => 'ORDER BY label',
|
||||||
'delete' => 'deleted',
|
'delete' => 'deleted',
|
||||||
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
|
||||||
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlflibraries.png',
|
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'res/icons/txdlflibraries.png',
|
||||||
'rootLevel' => 0,
|
'rootLevel' => 0,
|
||||||
'dividers2tabs' => 2,
|
'dividers2tabs' => 2,
|
||||||
'searchFields' => 'label,website,contact',
|
'searchFields' => 'label,website,contact',
|
||||||
),
|
),
|
||||||
'feInterface' => array (
|
'feInterface' => array (
|
||||||
'fe_admin_fieldList' => '',
|
'fe_admin_fieldList' => '',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Register static typoscript.
|
// Register static typoscript.
|
||||||
|
|
|
@ -109,7 +109,6 @@ CREATE TABLE tx_dlf_formats (
|
||||||
cruser_id int(11) DEFAULT '0' NOT NULL,
|
cruser_id int(11) DEFAULT '0' NOT NULL,
|
||||||
deleted tinyint(4) DEFAULT '0' NOT NULL,
|
deleted tinyint(4) DEFAULT '0' NOT NULL,
|
||||||
type tinytext NOT NULL,
|
type tinytext NOT NULL,
|
||||||
other_type tinyint(4) DEFAULT '0' NOT NULL,
|
|
||||||
root tinytext NOT NULL,
|
root tinytext NOT NULL,
|
||||||
namespace text NOT NULL,
|
namespace text NOT NULL,
|
||||||
class text NOT NULL,
|
class text NOT NULL,
|
||||||
|
|
|
@ -9,7 +9,6 @@ CREATE TABLE tx_dlf_formats (
|
||||||
cruser_id int(11) DEFAULT '0' NOT NULL,
|
cruser_id int(11) DEFAULT '0' NOT NULL,
|
||||||
deleted tinyint(4) DEFAULT '0' NOT NULL,
|
deleted tinyint(4) DEFAULT '0' NOT NULL,
|
||||||
type tinytext NOT NULL,
|
type tinytext NOT NULL,
|
||||||
other_type tinyint(4) DEFAULT '0' NOT NULL,
|
|
||||||
root tinytext NOT NULL,
|
root tinytext NOT NULL,
|
||||||
namespace text NOT NULL,
|
namespace text NOT NULL,
|
||||||
class text NOT NULL,
|
class text NOT NULL,
|
||||||
|
@ -18,4 +17,4 @@ CREATE TABLE tx_dlf_formats (
|
||||||
KEY parent (pid)
|
KEY parent (pid)
|
||||||
);
|
);
|
||||||
|
|
||||||
INSERT INTO tx_dlf_formats VALUES ('1', '0', '0', '0', '0', '0', 'MODS', '0', 'mods', 'http://www.loc.gov/mods/v3', 'tx_dlf_mods');
|
INSERT INTO tx_dlf_formats VALUES ('1', '0', '0', '0', '0', '0', 'MODS', 'mods', 'http://www.loc.gov/mods/v3', 'tx_dlf_mods');
|
||||||
|
|
|
@ -84,10 +84,10 @@ class tx_dlf_em {
|
||||||
$url = 'http://'.$host.':'.$port.'/'.$path.'admin/cores';
|
$url = 'http://'.$host.':'.$port.'/'.$path.'admin/cores';
|
||||||
|
|
||||||
$context = stream_context_create(array (
|
$context = stream_context_create(array (
|
||||||
'http' => array (
|
'http' => array (
|
||||||
'method' => 'GET',
|
'method' => 'GET',
|
||||||
'user_agent' => (!empty($conf['useragent']) ? $conf['useragent'] : ini_get('user_agent'))
|
'user_agent' => (!empty($conf['useragent']) ? $conf['useragent'] : ini_get('user_agent'))
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Try to connect to Solr server.
|
// Try to connect to Solr server.
|
||||||
|
@ -101,11 +101,11 @@ class tx_dlf_em {
|
||||||
if (is_array($status)) {
|
if (is_array($status)) {
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
sprintf($GLOBALS['LANG']->getLL('solr.status'), (string) $status[0]),
|
sprintf($GLOBALS['LANG']->getLL('solr.status'), (string) $status[0]),
|
||||||
$GLOBALS['LANG']->getLL('solr.connected'),
|
$GLOBALS['LANG']->getLL('solr.connected'),
|
||||||
($status[0] == 0 ? t3lib_FlashMessage::OK : t3lib_FlashMessage::WARNING),
|
($status[0] == 0 ? t3lib_FlashMessage::OK : t3lib_FlashMessage::WARNING),
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->content .= $message->render();
|
$this->content .= $message->render();
|
||||||
|
@ -117,11 +117,11 @@ class tx_dlf_em {
|
||||||
}
|
}
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
sprintf($GLOBALS['LANG']->getLL('solr.error'), $url),
|
sprintf($GLOBALS['LANG']->getLL('solr.error'), $url),
|
||||||
$GLOBALS['LANG']->getLL('solr.notConnected'),
|
$GLOBALS['LANG']->getLL('solr.notConnected'),
|
||||||
t3lib_FlashMessage::WARNING,
|
t3lib_FlashMessage::WARNING,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->content .= $message->render();
|
$this->content .= $message->render();
|
||||||
|
@ -147,9 +147,9 @@ class tx_dlf_em {
|
||||||
|
|
||||||
// Check if user "_cli_dlf" exists, is no admin and is not disabled.
|
// Check if user "_cli_dlf" exists, is no admin and is not disabled.
|
||||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'uid,admin,usergroup',
|
'uid,admin,usergroup',
|
||||||
'be_users',
|
'be_users',
|
||||||
'username='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_users').t3lib_BEfunc::deleteClause('be_users')
|
'username='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_users').t3lib_BEfunc::deleteClause('be_users')
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
||||||
|
@ -160,25 +160,25 @@ class tx_dlf_em {
|
||||||
$resArray['usergroup'] = explode(',', $resArray['usergroup']);
|
$resArray['usergroup'] = explode(',', $resArray['usergroup']);
|
||||||
|
|
||||||
// Check if user is not disabled.
|
// Check if user is not disabled.
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'1',
|
'1',
|
||||||
'be_users',
|
'be_users',
|
||||||
'uid='.intval($resArray['uid']).t3lib_BEfunc::BEenableFields('be_users')
|
'uid='.intval($resArray['uid']).t3lib_BEfunc::BEenableFields('be_users')
|
||||||
);
|
);
|
||||||
|
|
||||||
// Check if user is configured properly.
|
// Check if user is configured properly.
|
||||||
if (count(array_diff(array ($groupUid), $resArray['usergroup'])) == 0
|
if (count(array_diff(array ($groupUid), $resArray['usergroup'])) == 0
|
||||||
&& !$resArray['admin']
|
&& !$resArray['admin']
|
||||||
&& $GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) {
|
&& $GLOBALS['TYPO3_DB']->sql_num_rows($result2) > 0) {
|
||||||
|
|
||||||
$usrUid = $resArray['uid'];
|
$usrUid = $resArray['uid'];
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrOkayMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrOkayMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrOkay'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrOkay'),
|
||||||
t3lib_FlashMessage::OK,
|
t3lib_FlashMessage::OK,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -186,15 +186,15 @@ class tx_dlf_em {
|
||||||
if (!$checkOnly && $groupUid) {
|
if (!$checkOnly && $groupUid) {
|
||||||
|
|
||||||
// Keep exisiting values and add the new ones.
|
// Keep exisiting values and add the new ones.
|
||||||
$_usergroup = array_unique(array_merge(array ($groupUid), $resArray['usergroup']));
|
$usergroup = array_unique(array_merge(array ($groupUid), $resArray['usergroup']));
|
||||||
|
|
||||||
// Try to configure user.
|
// Try to configure user.
|
||||||
$data['be_users'][$resArray['uid']] = array (
|
$data['be_users'][$resArray['uid']] = array (
|
||||||
'admin' => 0,
|
'admin' => 0,
|
||||||
'usergroup' => implode(',', $_usergroup),
|
'usergroup' => implode(',', $usergroup),
|
||||||
$GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['disabled'] => 0,
|
$GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['disabled'] => 0,
|
||||||
$GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['starttime'] => 0,
|
$GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['starttime'] => 0,
|
||||||
$GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['endtime'] => 0
|
$GLOBALS['TCA']['be_users']['ctrl']['enablecolumns']['endtime'] => 0
|
||||||
);
|
);
|
||||||
|
|
||||||
tx_dlf_helper::processDB($data);
|
tx_dlf_helper::processDB($data);
|
||||||
|
@ -205,21 +205,21 @@ class tx_dlf_em {
|
||||||
$usrUid = $resArray['uid'];
|
$usrUid = $resArray['uid'];
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrConfiguredMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrConfiguredMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrConfigured'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrConfigured'),
|
||||||
t3lib_FlashMessage::INFO,
|
t3lib_FlashMessage::INFO,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'),
|
||||||
t3lib_FlashMessage::ERROR,
|
t3lib_FlashMessage::ERROR,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -227,11 +227,11 @@ class tx_dlf_em {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfiguredMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotConfigured'),
|
||||||
t3lib_FlashMessage::ERROR,
|
t3lib_FlashMessage::ERROR,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -243,39 +243,39 @@ class tx_dlf_em {
|
||||||
if (!$checkOnly && $groupUid) {
|
if (!$checkOnly && $groupUid) {
|
||||||
|
|
||||||
// Try to create user.
|
// Try to create user.
|
||||||
$_tempUid = uniqid('NEW');
|
$tempUid = uniqid('NEW');
|
||||||
|
|
||||||
$data['be_users'][$_tempUid] = array (
|
$data['be_users'][$tempUid] = array (
|
||||||
'pid' => 0,
|
'pid' => 0,
|
||||||
'username' => '_cli_dlf',
|
'username' => '_cli_dlf',
|
||||||
'password' => md5($_tempUid),
|
'password' => md5($tempUid),
|
||||||
'realName' => $GLOBALS['LANG']->getLL('cliUserGroup.usrRealName'),
|
'realName' => $GLOBALS['LANG']->getLL('cliUserGroup.usrRealName'),
|
||||||
'usergroup' => intval($groupUid)
|
'usergroup' => intval($groupUid)
|
||||||
);
|
);
|
||||||
|
|
||||||
$_substUid = tx_dlf_helper::processDB($data);
|
$substUid = tx_dlf_helper::processDB($data);
|
||||||
|
|
||||||
// Check if creation was successful.
|
// Check if creation was successful.
|
||||||
if (!empty($_substUid[$_tempUid])) {
|
if (!empty($substUid[$tempUid])) {
|
||||||
|
|
||||||
$usrUid = $_substUid[$_tempUid];
|
$usrUid = $substUid[$tempUid];
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrCreatedMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrCreatedMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrCreated'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrCreated'),
|
||||||
t3lib_FlashMessage::INFO,
|
t3lib_FlashMessage::INFO,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'),
|
||||||
t3lib_FlashMessage::ERROR,
|
t3lib_FlashMessage::ERROR,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -283,11 +283,11 @@ class tx_dlf_em {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreatedMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.usrNotCreated'),
|
||||||
t3lib_FlashMessage::ERROR,
|
t3lib_FlashMessage::ERROR,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -319,21 +319,21 @@ class tx_dlf_em {
|
||||||
if (empty($settings)) {
|
if (empty($settings)) {
|
||||||
|
|
||||||
$settings = array (
|
$settings = array (
|
||||||
'non_exclude_fields' => array (),
|
'non_exclude_fields' => array (),
|
||||||
'tables_select' => array (
|
'tables_select' => array (
|
||||||
'tx_dlf_documents',
|
'tx_dlf_documents',
|
||||||
'tx_dlf_collections',
|
'tx_dlf_collections',
|
||||||
'tx_dlf_libraries',
|
'tx_dlf_libraries',
|
||||||
'tx_dlf_structures',
|
'tx_dlf_structures',
|
||||||
'tx_dlf_metadata',
|
'tx_dlf_metadata',
|
||||||
'tx_dlf_formats',
|
'tx_dlf_formats',
|
||||||
'tx_dlf_solrcores'
|
'tx_dlf_solrcores'
|
||||||
),
|
),
|
||||||
'tables_modify' => array (
|
'tables_modify' => array (
|
||||||
'tx_dlf_documents',
|
'tx_dlf_documents',
|
||||||
'tx_dlf_collections',
|
'tx_dlf_collections',
|
||||||
'tx_dlf_libraries'
|
'tx_dlf_libraries'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Set allowed exclude fields.
|
// Set allowed exclude fields.
|
||||||
|
@ -357,9 +357,9 @@ class tx_dlf_em {
|
||||||
|
|
||||||
// Check if group "_cli_dlf" exists and is not disabled.
|
// Check if group "_cli_dlf" exists and is not disabled.
|
||||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'uid,non_exclude_fields,tables_select,tables_modify,inc_access_lists,'.$GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'],
|
'uid,non_exclude_fields,tables_select,tables_modify,inc_access_lists,'.$GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'],
|
||||||
'be_groups',
|
'be_groups',
|
||||||
'title='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_groups').t3lib_BEfunc::deleteClause('be_groups')
|
'title='.$GLOBALS['TYPO3_DB']->fullQuoteStr('_cli_dlf', 'be_groups').t3lib_BEfunc::deleteClause('be_groups')
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
||||||
|
@ -383,11 +383,11 @@ class tx_dlf_em {
|
||||||
$grpUid = $resArray['uid'];
|
$grpUid = $resArray['uid'];
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpOkayMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpOkayMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpOkay'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpOkay'),
|
||||||
t3lib_FlashMessage::OK,
|
t3lib_FlashMessage::OK,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -395,19 +395,19 @@ class tx_dlf_em {
|
||||||
if (!$checkOnly) {
|
if (!$checkOnly) {
|
||||||
|
|
||||||
// Keep exisiting values and add the new ones.
|
// Keep exisiting values and add the new ones.
|
||||||
$_non_exclude_fields = array_unique(array_merge($settings['non_exclude_fields'], $resArray['non_exclude_fields']));
|
$non_exclude_fields = array_unique(array_merge($settings['non_exclude_fields'], $resArray['non_exclude_fields']));
|
||||||
|
|
||||||
$_tables_select = array_unique(array_merge($settings['tables_select'], $resArray['tables_select']));
|
$tables_select = array_unique(array_merge($settings['tables_select'], $resArray['tables_select']));
|
||||||
|
|
||||||
$_tables_modify = array_unique(array_merge($settings['tables_modify'], $resArray['tables_modify']));
|
$tables_modify = array_unique(array_merge($settings['tables_modify'], $resArray['tables_modify']));
|
||||||
|
|
||||||
// Try to configure usergroup.
|
// Try to configure usergroup.
|
||||||
$data['be_groups'][$resArray['uid']] = array (
|
$data['be_groups'][$resArray['uid']] = array (
|
||||||
'non_exclude_fields' => implode(',', $_non_exclude_fields),
|
'non_exclude_fields' => implode(',', $non_exclude_fields),
|
||||||
'tables_select' => implode(',', $_tables_select),
|
'tables_select' => implode(',', $tables_select),
|
||||||
'tables_modify' => implode(',', $_tables_modify),
|
'tables_modify' => implode(',', $tables_modify),
|
||||||
'inc_access_lists' => 1,
|
'inc_access_lists' => 1,
|
||||||
$GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'] => 0
|
$GLOBALS['TCA']['be_groups']['ctrl']['enablecolumns']['disabled'] => 0
|
||||||
);
|
);
|
||||||
|
|
||||||
tx_dlf_helper::processDB($data);
|
tx_dlf_helper::processDB($data);
|
||||||
|
@ -418,21 +418,21 @@ class tx_dlf_em {
|
||||||
$grpUid = $resArray['uid'];
|
$grpUid = $resArray['uid'];
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpConfiguredMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpConfiguredMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpConfigured'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpConfigured'),
|
||||||
t3lib_FlashMessage::INFO,
|
t3lib_FlashMessage::INFO,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'),
|
||||||
t3lib_FlashMessage::ERROR,
|
t3lib_FlashMessage::ERROR,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -440,11 +440,11 @@ class tx_dlf_em {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfiguredMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotConfigured'),
|
||||||
t3lib_FlashMessage::ERROR,
|
t3lib_FlashMessage::ERROR,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -456,41 +456,41 @@ class tx_dlf_em {
|
||||||
if (!$checkOnly) {
|
if (!$checkOnly) {
|
||||||
|
|
||||||
// Try to create usergroup.
|
// Try to create usergroup.
|
||||||
$_tempUid = uniqid('NEW');
|
$tempUid = uniqid('NEW');
|
||||||
|
|
||||||
$data['be_groups'][$_tempUid] = array (
|
$data['be_groups'][$tempUid] = array (
|
||||||
'pid' => 0,
|
'pid' => 0,
|
||||||
'title' => '_cli_dlf',
|
'title' => '_cli_dlf',
|
||||||
'description' => $GLOBALS['LANG']->getLL('cliUserGroup.grpDescription'),
|
'description' => $GLOBALS['LANG']->getLL('cliUserGroup.grpDescription'),
|
||||||
'non_exclude_fields' => implode(',', $settings['non_exclude_fields']),
|
'non_exclude_fields' => implode(',', $settings['non_exclude_fields']),
|
||||||
'tables_select' => implode(',', $settings['tables_select']),
|
'tables_select' => implode(',', $settings['tables_select']),
|
||||||
'tables_modify' => implode(',', $settings['tables_modify']),
|
'tables_modify' => implode(',', $settings['tables_modify']),
|
||||||
'inc_access_lists' => 1
|
'inc_access_lists' => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
$_substUid = tx_dlf_helper::processDB($data);
|
$substUid = tx_dlf_helper::processDB($data);
|
||||||
|
|
||||||
// Check if creation was successful.
|
// Check if creation was successful.
|
||||||
if (!empty($_substUid[$_tempUid])) {
|
if (!empty($substUid[$tempUid])) {
|
||||||
|
|
||||||
$grpUid = $_substUid[$_tempUid];
|
$grpUid = $substUid[$tempUid];
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpCreatedMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpCreatedMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpCreated'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpCreated'),
|
||||||
t3lib_FlashMessage::INFO,
|
t3lib_FlashMessage::INFO,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'),
|
||||||
t3lib_FlashMessage::ERROR,
|
t3lib_FlashMessage::ERROR,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -498,11 +498,11 @@ class tx_dlf_em {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreatedMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.grpNotCreated'),
|
||||||
t3lib_FlashMessage::ERROR,
|
t3lib_FlashMessage::ERROR,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -549,21 +549,21 @@ class tx_dlf_em {
|
||||||
if (is_executable(PATH_typo3.'cli_dispatch.phpsh')) {
|
if (is_executable(PATH_typo3.'cli_dispatch.phpsh')) {
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.cliOkayMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.cliOkayMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.cliOkay'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.cliOkay'),
|
||||||
t3lib_FlashMessage::OK,
|
t3lib_FlashMessage::OK,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$message = t3lib_div::makeInstance(
|
$message = t3lib_div::makeInstance(
|
||||||
't3lib_FlashMessage',
|
't3lib_FlashMessage',
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkayMsg'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkayMsg'),
|
||||||
$GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkay'),
|
$GLOBALS['LANG']->getLL('cliUserGroup.cliNotOkay'),
|
||||||
t3lib_FlashMessage::ERROR,
|
t3lib_FlashMessage::ERROR,
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,21 +59,21 @@ class tx_dlf_tceforms {
|
||||||
// i.e. instead of "18" it reads "pages_18|Title"
|
// i.e. instead of "18" it reads "pages_18|Title"
|
||||||
if (!t3lib_div::testInt($pages)) {
|
if (!t3lib_div::testInt($pages)) {
|
||||||
|
|
||||||
$_parts = explode('|', $pages);
|
$parts = explode('|', $pages);
|
||||||
|
|
||||||
$pages = array_pop(explode('_', $_parts[0]));
|
$pages = array_pop(explode('_', $parts[0]));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pages > 0) {
|
if ($pages > 0) {
|
||||||
|
|
||||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'label,uid',
|
'label,uid',
|
||||||
'tx_dlf_collections',
|
'tx_dlf_collections',
|
||||||
'pid='.intval($pages).' AND (sys_language_uid IN (-1,0) OR l18n_parent=0)'.tx_dlf_helper::whereClause('tx_dlf_collections'),
|
'pid='.intval($pages).' AND (sys_language_uid IN (-1,0) OR l18n_parent=0)'.tx_dlf_helper::whereClause('tx_dlf_collections'),
|
||||||
'',
|
'',
|
||||||
'label',
|
'label',
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
||||||
|
@ -114,21 +114,21 @@ class tx_dlf_tceforms {
|
||||||
// i.e. instead of "18" it reads "pages_18|Title"
|
// i.e. instead of "18" it reads "pages_18|Title"
|
||||||
if (!t3lib_div::testInt($pages)) {
|
if (!t3lib_div::testInt($pages)) {
|
||||||
|
|
||||||
$_parts = explode('|', $pages);
|
$parts = explode('|', $pages);
|
||||||
|
|
||||||
$pages = array_pop(explode('_', $_parts[0]));
|
$pages = array_pop(explode('_', $parts[0]));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pages > 0) {
|
if ($pages > 0) {
|
||||||
|
|
||||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'label,uid',
|
'label,uid',
|
||||||
'tx_dlf_libraries',
|
'tx_dlf_libraries',
|
||||||
'pid='.intval($pages).' AND (sys_language_uid IN (-1,0) OR l18n_parent=0)'.tx_dlf_helper::whereClause('tx_dlf_libraries'),
|
'pid='.intval($pages).' AND (sys_language_uid IN (-1,0) OR l18n_parent=0)'.tx_dlf_helper::whereClause('tx_dlf_libraries'),
|
||||||
'',
|
'',
|
||||||
'label',
|
'label',
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
||||||
|
@ -169,21 +169,21 @@ class tx_dlf_tceforms {
|
||||||
// i.e. instead of "18" it reads "pages_18|Title"
|
// i.e. instead of "18" it reads "pages_18|Title"
|
||||||
if (!t3lib_div::testInt($pages)) {
|
if (!t3lib_div::testInt($pages)) {
|
||||||
|
|
||||||
$_parts = explode('|', $pages);
|
$parts = explode('|', $pages);
|
||||||
|
|
||||||
$pages = array_pop(explode('_', $_parts[0]));
|
$pages = array_pop(explode('_', $parts[0]));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pages > 0) {
|
if ($pages > 0) {
|
||||||
|
|
||||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'label,uid',
|
'label,uid',
|
||||||
'tx_dlf_solrcores',
|
'tx_dlf_solrcores',
|
||||||
'pid IN ('.intval($pages).',0)'.tx_dlf_helper::whereClause('tx_dlf_solrcores'),
|
'pid IN ('.intval($pages).',0)'.tx_dlf_helper::whereClause('tx_dlf_solrcores'),
|
||||||
'',
|
'',
|
||||||
'label',
|
'label',
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
||||||
|
|
|
@ -59,37 +59,13 @@ class tx_dlf_tcemain {
|
||||||
// Field post-processing for table "tx_dlf_documents".
|
// Field post-processing for table "tx_dlf_documents".
|
||||||
case 'tx_dlf_documents':
|
case 'tx_dlf_documents':
|
||||||
|
|
||||||
// Set sorting fields if empty.
|
// Set sorting field if empty.
|
||||||
if (empty($fieldArray['title_sorting']) && !empty($fieldArray['title'])) {
|
if (empty($fieldArray['title_sorting']) && !empty($fieldArray['title'])) {
|
||||||
|
|
||||||
$fieldArray['title_sorting'] = $fieldArray['title'];
|
$fieldArray['title_sorting'] = $fieldArray['title'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($fieldArray['author_sorting']) && !empty($fieldArray['author'])) {
|
|
||||||
|
|
||||||
$fieldArray['author_sorting'] = $fieldArray['author'];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($fieldArray['year_sorting']) && !empty($fieldArray['year'])) {
|
|
||||||
|
|
||||||
$fieldArray['year_sorting'] = str_ireplace('x', '5', preg_replace('/[^\d.x]/i', '', (string) $fieldArray['year']));
|
|
||||||
|
|
||||||
if (strpos($fieldArray['year_sorting'], '.') || strlen($fieldArray['year_sorting']) < 3) {
|
|
||||||
|
|
||||||
$fieldArray['year_sorting'] = ((intval(trim($fieldArray['year_sorting'], '.')) - 1) * 100) + 50;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($fieldArray['place_sorting']) && !empty($fieldArray['place'])) {
|
|
||||||
|
|
||||||
$fieldArray['place_sorting'] = preg_replace('/[[:punct:]]/', '', (string) $fieldArray['place']);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Field post-processing for tables "tx_dlf_collections", "tx_dlf_libraries", "tx_dlf_metadata" and "tx_dlf_structures".
|
// Field post-processing for tables "tx_dlf_collections", "tx_dlf_libraries", "tx_dlf_metadata" and "tx_dlf_structures".
|
||||||
|
@ -119,12 +95,12 @@ class tx_dlf_tcemain {
|
||||||
|
|
||||||
// Get number of existing cores.
|
// Get number of existing cores.
|
||||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'*',
|
'*',
|
||||||
'tx_dlf_solrcores',
|
'tx_dlf_solrcores',
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
// Get first unused core number.
|
// Get first unused core number.
|
||||||
|
@ -155,10 +131,10 @@ class tx_dlf_tcemain {
|
||||||
$url = 'http://'.$host.':'.$port.'/'.$path.'admin/cores?action=CREATE&name=dlfCore'.$coreNumber.'&instanceDir=.&dataDir=dlfCore'.$coreNumber;
|
$url = 'http://'.$host.':'.$port.'/'.$path.'admin/cores?action=CREATE&name=dlfCore'.$coreNumber.'&instanceDir=.&dataDir=dlfCore'.$coreNumber;
|
||||||
|
|
||||||
$context = stream_context_create(array (
|
$context = stream_context_create(array (
|
||||||
'http' => array (
|
'http' => array (
|
||||||
'method' => 'GET',
|
'method' => 'GET',
|
||||||
'user_agent' => ($conf['useragent'] ? $conf['useragent'] : ini_get('user_agent'))
|
'user_agent' => ($conf['useragent'] ? $conf['useragent'] : ini_get('user_agent'))
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
$response = @simplexml_load_string(file_get_contents($url, FALSE, $context));
|
$response = @simplexml_load_string(file_get_contents($url, FALSE, $context));
|
||||||
|
@ -178,7 +154,11 @@ class tx_dlf_tcemain {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error('Could not create new Solr core "dlfCore'.$coreNumber.'"', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_tcemain->processDatamap_postProcessFieldArray('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Could not create new Apache Solr core "dlfCore'.$coreNumber.'"', $this->extKey, SYSLOG_SEVERITY_ERROR, $fieldArray);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$fieldArray = NULL;
|
$fieldArray = NULL;
|
||||||
|
|
||||||
|
@ -206,12 +186,12 @@ class tx_dlf_tcemain {
|
||||||
|
|
||||||
// Get current index name.
|
// Get current index name.
|
||||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
$table.'.index_name AS index_name',
|
$table.'.index_name AS index_name',
|
||||||
$table,
|
$table,
|
||||||
$table.'.uid='.intval($id).tx_dlf_helper::whereClause($table),
|
$table.'.uid='.intval($id).tx_dlf_helper::whereClause($table),
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||||
|
@ -225,7 +205,11 @@ class tx_dlf_tcemain {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error('Prevented change of "index_name" for UID '.intval($id).' in table "'.htmlspecialchars($table).'"', E_USER_NOTICE);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_tcemain->processDatamap_postProcessFieldArray('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Prevented change of "index_name" for UID "'.$id.'" in table "'.$table.'"', $this->extKey, SYSLOG_SEVERITY_NOTICE, $fieldArray);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +236,7 @@ class tx_dlf_tcemain {
|
||||||
*/
|
*/
|
||||||
public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray, $pObj) {
|
public function processDatamap_afterDatabaseOperations($status, $table, $id, &$fieldArray, $pObj) {
|
||||||
|
|
||||||
if ($status == "update") {
|
if ($status == 'update') {
|
||||||
|
|
||||||
switch ($table) {
|
switch ($table) {
|
||||||
|
|
||||||
|
@ -264,12 +248,12 @@ class tx_dlf_tcemain {
|
||||||
|
|
||||||
// Get Solr core.
|
// Get Solr core.
|
||||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_solrcores.uid',
|
'tx_dlf_solrcores.uid',
|
||||||
'tx_dlf_solrcores,tx_dlf_documents',
|
'tx_dlf_solrcores,tx_dlf_documents',
|
||||||
'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.intval($id).tx_dlf_helper::whereClause('tx_dlf_solrcores'),
|
'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.intval($id).tx_dlf_helper::whereClause('tx_dlf_solrcores'),
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||||
|
@ -299,7 +283,11 @@ class tx_dlf_tcemain {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Failed to reindex document with UID '.$id, E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_tcemain->processDatamap_afterDatabaseOperations('.$status.', '.$table.', '.$id.', [data], ['.get_class($pObj).'])] Failed to re-index document with UID "'.$id.'"', $this->extKey, SYSLOG_SEVERITY_ERROR, $fieldArray);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,12 +324,12 @@ class tx_dlf_tcemain {
|
||||||
|
|
||||||
// Get Solr core.
|
// Get Solr core.
|
||||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_solrcores.uid',
|
'tx_dlf_solrcores.uid',
|
||||||
'tx_dlf_solrcores,tx_dlf_documents',
|
'tx_dlf_solrcores,tx_dlf_documents',
|
||||||
'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.intval($id).tx_dlf_helper::whereClause('tx_dlf_solrcores'),
|
'tx_dlf_solrcores.uid=tx_dlf_documents.solrcore AND tx_dlf_documents.uid='.intval($id).tx_dlf_helper::whereClause('tx_dlf_solrcores'),
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||||
|
@ -380,7 +368,11 @@ class tx_dlf_tcemain {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Failed to reindex document with UID '.$id, E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_tcemain->processCmdmap_postProcess('.$command.', '.$table.', '.$id.', '.$value.', ['.get_class($pObj).'])] Failed to re-index document with UID "'.$id.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,6 @@
|
||||||
<label index="tx_dlf_metadata.tab3">Access</label>
|
<label index="tx_dlf_metadata.tab3">Access</label>
|
||||||
<label index="tx_dlf_formats">Data Formats</label>
|
<label index="tx_dlf_formats">Data Formats</label>
|
||||||
<label index="tx_dlf_formats.type">METS Name</label>
|
<label index="tx_dlf_formats.type">METS Name</label>
|
||||||
<label index="tx_dlf_formats.other_type">Is it @MDTYPE="OTHER" in METS?</label>
|
|
||||||
<label index="tx_dlf_formats.root">Root Element</label>
|
<label index="tx_dlf_formats.root">Root Element</label>
|
||||||
<label index="tx_dlf_formats.namespace">Namespace URI</label>
|
<label index="tx_dlf_formats.namespace">Namespace URI</label>
|
||||||
<label index="tx_dlf_formats.class">Class Name</label>
|
<label index="tx_dlf_formats.class">Class Name</label>
|
||||||
|
@ -219,7 +218,6 @@
|
||||||
<label index="tx_dlf_metadata.tab3">Zugriff</label>
|
<label index="tx_dlf_metadata.tab3">Zugriff</label>
|
||||||
<label index="tx_dlf_formats">Datenformate</label>
|
<label index="tx_dlf_formats">Datenformate</label>
|
||||||
<label index="tx_dlf_formats.type">Bezeichnung in METS</label>
|
<label index="tx_dlf_formats.type">Bezeichnung in METS</label>
|
||||||
<label index="tx_dlf_formats.other_type">@MDTYPE="OTHER" in METS?</label>
|
|
||||||
<label index="tx_dlf_formats.root">Root-Element</label>
|
<label index="tx_dlf_formats.root">Root-Element</label>
|
||||||
<label index="tx_dlf_formats.namespace">Namensraum URI</label>
|
<label index="tx_dlf_formats.namespace">Namensraum URI</label>
|
||||||
<label index="tx_dlf_formats.class">Klassenname</label>
|
<label index="tx_dlf_formats.class">Klassenname</label>
|
||||||
|
|
|
@ -56,7 +56,11 @@ class tx_dlf_collection extends tx_dlf_plugin {
|
||||||
// Quit without doing anything if required configuration variables are not set.
|
// Quit without doing anything if required configuration variables are not set.
|
||||||
if (empty($this->conf['pages'])) {
|
if (empty($this->conf['pages'])) {
|
||||||
|
|
||||||
trigger_error('Incomplete configuration for plugin '.get_class($this), E_USER_NOTICE);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_collection->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
|
|
||||||
|
@ -201,9 +205,9 @@ class tx_dlf_collection extends tx_dlf_plugin {
|
||||||
// Add feed link if applicable.
|
// Add feed link if applicable.
|
||||||
if (!empty($this->conf['targetFeed'])) {
|
if (!empty($this->conf['targetFeed'])) {
|
||||||
|
|
||||||
$_img = '<img src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/icons/txdlffeeds.png" alt="'.$this->pi_getLL('feedAlt', '', TRUE).'" title="'.$this->pi_getLL('feedTitle', '', TRUE).'" />';
|
$img = '<img src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/icons/txdlffeeds.png" alt="'.$this->pi_getLL('feedAlt', '', TRUE).'" title="'.$this->pi_getLL('feedTitle', '', TRUE).'" />';
|
||||||
|
|
||||||
$markerArray[$resArray['uid']]['###FEED###'] = $this->pi_linkTP($_img, array ($this->prefixId => array ('collection' => $resArray['uid'])), FALSE, $this->conf['targetFeed']);
|
$markerArray[$resArray['uid']]['###FEED###'] = $this->pi_linkTP($img, array ($this->prefixId => array ('collection' => $resArray['uid'])), FALSE, $this->conf['targetFeed']);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -215,21 +219,21 @@ class tx_dlf_collection extends tx_dlf_plugin {
|
||||||
$markerArray[$resArray['uid']]['###DESCRIPTION###'] = $this->pi_RTEcssText($resArray['description']);
|
$markerArray[$resArray['uid']]['###DESCRIPTION###'] = $this->pi_RTEcssText($resArray['description']);
|
||||||
|
|
||||||
// Build statistic's output.
|
// Build statistic's output.
|
||||||
$_labelTitles = $this->pi_getLL(($resArray['titles'] > 1 ? 'titles' : 'title'), '', FALSE);
|
$labelTitles = $this->pi_getLL(($resArray['titles'] > 1 ? 'titles' : 'title'), '', FALSE);
|
||||||
|
|
||||||
$markerArray[$resArray['uid']]['###COUNT_TITLES###'] = htmlspecialchars($resArray['titles'].$_labelTitles);
|
$markerArray[$resArray['uid']]['###COUNT_TITLES###'] = htmlspecialchars($resArray['titles'].$labelTitles);
|
||||||
|
|
||||||
$_labelVolumes = $this->pi_getLL(($volumes[$resArray['uid']] > 1 ? 'volumes' : 'volume'), '', FALSE);
|
$labelVolumes = $this->pi_getLL(($volumes[$resArray['uid']] > 1 ? 'volumes' : 'volume'), '', FALSE);
|
||||||
|
|
||||||
$markerArray[$resArray['uid']]['###COUNT_VOLUMES###'] = htmlspecialchars($volumes[$resArray['uid']].$_labelVolumes);
|
$markerArray[$resArray['uid']]['###COUNT_VOLUMES###'] = htmlspecialchars($volumes[$resArray['uid']].$labelVolumes);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$entry = $this->cObj->getSubpart($this->template, '###ENTRY###');
|
$entry = $this->cObj->getSubpart($this->template, '###ENTRY###');
|
||||||
|
|
||||||
foreach ($markerArray as $_markerArray) {
|
foreach ($markerArray as $marker) {
|
||||||
|
|
||||||
$content .= $this->cObj->substituteMarkerArray($entry, $_markerArray);
|
$content .= $this->cObj->substituteMarkerArray($entry, $marker);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,9 +275,9 @@ class tx_dlf_collection extends tx_dlf_plugin {
|
||||||
// Process results.
|
// Process results.
|
||||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
||||||
|
|
||||||
if (empty($_metadata)) {
|
if (empty($listMetadata)) {
|
||||||
|
|
||||||
$_metadata = array (
|
$listMetadata = array (
|
||||||
'label' => htmlspecialchars($resArray['collLabel']),
|
'label' => htmlspecialchars($resArray['collLabel']),
|
||||||
'description' => $this->pi_RTEcssText($resArray['collDesc']),
|
'description' => $this->pi_RTEcssText($resArray['collDesc']),
|
||||||
'options' => array (
|
'options' => array (
|
||||||
|
@ -379,7 +383,7 @@ class tx_dlf_collection extends tx_dlf_plugin {
|
||||||
|
|
||||||
$list->add(array_values($toplevel));
|
$list->add(array_values($toplevel));
|
||||||
|
|
||||||
$list->metadata = $_metadata;
|
$list->metadata = $listMetadata;
|
||||||
|
|
||||||
$list->save();
|
$list->save();
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ class tx_dlf_feeds extends tx_dlf_plugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_libraries.label AS label',
|
'tx_dlf_libraries.label AS label',
|
||||||
'tx_dlf_libraries',
|
'tx_dlf_libraries',
|
||||||
'tx_dlf_libraries.pid='.intval($this->conf['pages']).' AND tx_dlf_libraries.uid='.intval($this->conf['library']).tx_dlf_helper::whereClause('tx_dlf_libraries'),
|
'tx_dlf_libraries.pid='.intval($this->conf['pages']).' AND tx_dlf_libraries.uid='.intval($this->conf['library']).tx_dlf_helper::whereClause('tx_dlf_libraries'),
|
||||||
|
@ -86,11 +86,11 @@ class tx_dlf_feeds extends tx_dlf_plugin {
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result)) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||||
|
|
||||||
$_resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);
|
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
|
||||||
|
|
||||||
$channel->appendChild($rss->createElement('copyright', htmlspecialchars($_resArray['label'], ENT_NOQUOTES, 'UTF-8')));
|
$channel->appendChild($rss->createElement('copyright', htmlspecialchars($resArray['label'], ENT_NOQUOTES, 'UTF-8')));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -162,71 +162,71 @@ class tx_dlf_listview extends tx_dlf_plugin {
|
||||||
|
|
||||||
$element = $this->list->elements[$number];
|
$element = $this->list->elements[$number];
|
||||||
|
|
||||||
foreach ($this->metadata as $_index_name => $_metaConf) {
|
foreach ($this->metadata as $index_name => $metaConf) {
|
||||||
|
|
||||||
$value = '';
|
$parsedValue = '';
|
||||||
|
|
||||||
$fieldwrap = $this->parseTS($_metaConf['wrap']);
|
$fieldwrap = $this->parseTS($metaConf['wrap']);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
$_value = @array_shift($element['metadata'][$_index_name]);
|
$value = @array_shift($element['metadata'][$index_name]);
|
||||||
|
|
||||||
// Link title to pageview.
|
// Link title to pageview.
|
||||||
if ($_index_name == 'title') {
|
if ($index_name == 'title') {
|
||||||
|
|
||||||
// Get title of parent document if needed.
|
// Get title of parent document if needed.
|
||||||
if (empty($_value) && $this->conf['getTitle']) {
|
if (empty($value) && $this->conf['getTitle']) {
|
||||||
|
|
||||||
$_value = '['.tx_dlf_document::getTitle($element['uid'], TRUE).']';
|
$value = '['.tx_dlf_document::getTitle($element['uid'], TRUE).']';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set fake title if still not present.
|
// Set fake title if still not present.
|
||||||
if (empty($_value)) {
|
if (empty($value)) {
|
||||||
|
|
||||||
$_value = $this->pi_getLL('noTitle');
|
$value = $this->pi_getLL('noTitle');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_value = $this->pi_linkTP(htmlspecialchars($_value), array ($this->prefixId => array ('id' => $this->list->elements[$number]['uid'], 'page' => $element['page'], 'pointer' => $this->piVars['pointer'])), TRUE, $this->conf['targetPid']);
|
$value = $this->pi_linkTP(htmlspecialchars($value), array ($this->prefixId => array ('id' => $this->list->elements[$number]['uid'], 'page' => $element['page'], 'pointer' => $this->piVars['pointer'])), TRUE, $this->conf['targetPid']);
|
||||||
|
|
||||||
// Translate name of holding library.
|
// Translate name of holding library.
|
||||||
} elseif ($_index_name == 'owner' && !empty($_value)) {
|
} elseif ($index_name == 'owner' && !empty($value)) {
|
||||||
|
|
||||||
$_value = htmlspecialchars(tx_dlf_helper::translate($_value, 'tx_dlf_libraries', $this->conf['pages']));
|
$value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages']));
|
||||||
|
|
||||||
// Translate document type.
|
// Translate document type.
|
||||||
} elseif ($_index_name == 'type' && !empty($_value)) {
|
} elseif ($index_name == 'type' && !empty($value)) {
|
||||||
|
|
||||||
$_value = htmlspecialchars(tx_dlf_helper::translate($_value, 'tx_dlf_structures', $this->conf['pages']));
|
$value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages']));
|
||||||
|
|
||||||
// Translate ISO 639 language code.
|
// Translate ISO 639 language code.
|
||||||
} elseif ($_index_name == 'language' && !empty($_value)) {
|
} elseif ($index_name == 'language' && !empty($value)) {
|
||||||
|
|
||||||
$_value = htmlspecialchars(tx_dlf_helper::getLanguageName($_value));
|
$value = htmlspecialchars(tx_dlf_helper::getLanguageName($value));
|
||||||
|
|
||||||
} elseif (!empty($_value)) {
|
} elseif (!empty($value)) {
|
||||||
|
|
||||||
$_value = htmlspecialchars($_value);
|
$value = htmlspecialchars($value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_value = $this->cObj->stdWrap($_value, $fieldwrap['value.']);
|
$value = $this->cObj->stdWrap($value, $fieldwrap['value.']);
|
||||||
|
|
||||||
if (!empty($_value)) {
|
if (!empty($value)) {
|
||||||
|
|
||||||
$value .= $_value;
|
$parsedValue .= $value;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (count($element['metadata'][$_index_name]));
|
} while (count($element['metadata'][$index_name]));
|
||||||
|
|
||||||
if (!empty($value)) {
|
if (!empty($parsedValue)) {
|
||||||
|
|
||||||
$field = $this->cObj->stdWrap(htmlspecialchars($_metaConf['label']), $fieldwrap['key.']);
|
$field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']);
|
||||||
|
|
||||||
$field .= $value;
|
$field .= $parsedValue;
|
||||||
|
|
||||||
$markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);
|
$markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);
|
||||||
|
|
||||||
|
@ -276,9 +276,9 @@ class tx_dlf_listview extends tx_dlf_plugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_uniqId = uniqid($prefix.'-');
|
$uniqId = uniqid($prefix.'-');
|
||||||
|
|
||||||
$sorting .= '<label for="'.$_uniqId.'">'.$this->pi_getLL('orderBy', '', TRUE).'</label><select id="'.$_uniqId.'" name="'.$this->prefixId.'[order]" onchange="javascript:this.form.submit();"><option value=""></option>';
|
$sorting .= '<label for="'.$uniqId.'">'.$this->pi_getLL('orderBy', '', TRUE).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[order]" onchange="javascript:this.form.submit();"><option value=""></option>';
|
||||||
|
|
||||||
foreach ($this->sortables as $index_name => $label) {
|
foreach ($this->sortables as $index_name => $label) {
|
||||||
|
|
||||||
|
@ -310,71 +310,71 @@ class tx_dlf_listview extends tx_dlf_plugin {
|
||||||
|
|
||||||
$markerArray['###SUBMETADATA###'] = '';
|
$markerArray['###SUBMETADATA###'] = '';
|
||||||
|
|
||||||
foreach ($this->metadata as $_index_name => $_metaConf) {
|
foreach ($this->metadata as $index_name => $metaConf) {
|
||||||
|
|
||||||
$value = '';
|
$parsedValue = '';
|
||||||
|
|
||||||
$fieldwrap = $this->parseTS($_metaConf['wrap']);
|
$fieldwrap = $this->parseTS($metaConf['wrap']);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
$_value = @array_shift($subpart['metadata'][$_index_name]);
|
$value = @array_shift($subpart['metadata'][$index_name]);
|
||||||
|
|
||||||
// Link title to pageview.
|
// Link title to pageview.
|
||||||
if ($_index_name == 'title') {
|
if ($index_name == 'title') {
|
||||||
|
|
||||||
// Get title of parent document if needed.
|
// Get title of parent document if needed.
|
||||||
if (empty($_value) && $this->conf['getTitle']) {
|
if (empty($value) && $this->conf['getTitle']) {
|
||||||
|
|
||||||
$_value = '['.tx_dlf_document::getTitle($subpart['uid'], TRUE).']';
|
$value = '['.tx_dlf_document::getTitle($subpart['uid'], TRUE).']';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set fake title if still not present.
|
// Set fake title if still not present.
|
||||||
if (empty($_value)) {
|
if (empty($value)) {
|
||||||
|
|
||||||
$_value = $this->pi_getLL('noTitle');
|
$value = $this->pi_getLL('noTitle');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_value = $this->pi_linkTP(htmlspecialchars($_value), array ($this->prefixId => array ('id' => $subpart['uid'], 'page' => $subpart['page'], 'pointer' => $this->piVars['pointer'])), TRUE, $this->conf['targetPid']);
|
$value = $this->pi_linkTP(htmlspecialchars($value), array ($this->prefixId => array ('id' => $subpart['uid'], 'page' => $subpart['page'], 'pointer' => $this->piVars['pointer'])), TRUE, $this->conf['targetPid']);
|
||||||
|
|
||||||
// Translate name of holding library.
|
// Translate name of holding library.
|
||||||
} elseif ($_index_name == 'owner' && !empty($_value)) {
|
} elseif ($index_name == 'owner' && !empty($value)) {
|
||||||
|
|
||||||
$_value = htmlspecialchars(tx_dlf_helper::translate($_value, 'tx_dlf_libraries', $this->conf['pages']));
|
$value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages']));
|
||||||
|
|
||||||
// Translate document type.
|
// Translate document type.
|
||||||
} elseif ($_index_name == 'type' && !empty($_value)) {
|
} elseif ($index_name == 'type' && !empty($value)) {
|
||||||
|
|
||||||
$_value = $this->pi_getLL($_value, tx_dlf_helper::translate($_value, 'tx_dlf_structures', $this->conf['pages']), FALSE);
|
$value = $this->pi_getLL($value, tx_dlf_helper::translate($_value, 'tx_dlf_structures', $this->conf['pages']), FALSE);
|
||||||
|
|
||||||
// Translate ISO 639 language code.
|
// Translate ISO 639 language code.
|
||||||
} elseif ($_index_name == 'language' && !empty($_value)) {
|
} elseif ($index_name == 'language' && !empty($value)) {
|
||||||
|
|
||||||
$_value = htmlspecialchars(tx_dlf_helper::getLanguageName($_value));
|
$value = htmlspecialchars(tx_dlf_helper::getLanguageName($value));
|
||||||
|
|
||||||
} elseif (!empty($_value)) {
|
} elseif (!empty($value)) {
|
||||||
|
|
||||||
$_value = htmlspecialchars($_value);
|
$value = htmlspecialchars($value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_value = $this->cObj->stdWrap($_value, $fieldwrap['value.']);
|
$value = $this->cObj->stdWrap($value, $fieldwrap['value.']);
|
||||||
|
|
||||||
if (!empty($_value)) {
|
if (!empty($value)) {
|
||||||
|
|
||||||
$value .= $_value;
|
$parsedValue .= $value;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (count($subpart['metadata'][$_index_name]));
|
} while (count($subpart['metadata'][$index_name]));
|
||||||
|
|
||||||
if (!empty($value)) {
|
if (!empty($parsedValue)) {
|
||||||
|
|
||||||
$field = $this->cObj->stdWrap(htmlspecialchars($_metaConf['label']), $fieldwrap['key.']);
|
$field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']);
|
||||||
|
|
||||||
$field .= $value;
|
$field .= $parsedValue;
|
||||||
|
|
||||||
$markerArray['###SUBMETADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);
|
$markerArray['###SUBMETADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);
|
||||||
|
|
||||||
|
@ -456,11 +456,11 @@ class tx_dlf_listview extends tx_dlf_plugin {
|
||||||
$this->list->sort($this->piVars['order'], TRUE);
|
$this->list->sort($this->piVars['order'], TRUE);
|
||||||
|
|
||||||
// Update list's metadata.
|
// Update list's metadata.
|
||||||
$_metadata = $this->list->metadata;
|
$listMetadata = $this->list->metadata;
|
||||||
|
|
||||||
$_metadata['options']['order'] = $this->piVars['order'];
|
$listMetadata['options']['order'] = $this->piVars['order'];
|
||||||
|
|
||||||
$this->list->metadata = $_metadata;
|
$this->list->metadata = $listMetadata;
|
||||||
|
|
||||||
// Save updated list.
|
// Save updated list.
|
||||||
$this->list->save();
|
$this->list->save();
|
||||||
|
|
|
@ -68,36 +68,36 @@ class tx_dlf_metadata extends tx_dlf_plugin {
|
||||||
if ($this->conf['rootline'] < 2) {
|
if ($this->conf['rootline'] < 2) {
|
||||||
|
|
||||||
// Get current structure's @ID.
|
// Get current structure's @ID.
|
||||||
$_ids = array ();
|
$ids = array ();
|
||||||
|
|
||||||
if (!empty($this->doc->physicalPages[$this->piVars['page']]) && !empty($this->doc->smLinks['p2l'][$this->doc->physicalPages[$this->piVars['page']]])) {
|
if (!empty($this->doc->physicalPages[$this->piVars['page']]) && !empty($this->doc->smLinks['p2l'][$this->doc->physicalPages[$this->piVars['page']]])) {
|
||||||
|
|
||||||
foreach ($this->doc->smLinks['p2l'][$this->doc->physicalPages[$this->piVars['page']]] as $_logId) {
|
foreach ($this->doc->smLinks['p2l'][$this->doc->physicalPages[$this->piVars['page']]] as $logId) {
|
||||||
|
|
||||||
$_count = count($this->doc->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$_logId.'"]/ancestor::*'));
|
$count = count($this->doc->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*'));
|
||||||
|
|
||||||
$_ids[$_count][] = $_logId;
|
$ids[$count][] = $logId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ksort($_ids);
|
ksort($ids);
|
||||||
|
|
||||||
reset($_ids);
|
reset($ids);
|
||||||
|
|
||||||
// Check if we should display all metadata up to the root.
|
// Check if we should display all metadata up to the root.
|
||||||
if ($this->conf['rootline'] == 1) {
|
if ($this->conf['rootline'] == 1) {
|
||||||
|
|
||||||
foreach ($_ids as $_id) {
|
foreach ($ids as $id) {
|
||||||
|
|
||||||
foreach ($_id as $id) {
|
foreach ($id as $sid) {
|
||||||
|
|
||||||
$_data = $this->doc->getMetadata($id, $this->conf['pages']);
|
$data = $this->doc->getMetadata($sid, $this->conf['pages']);
|
||||||
|
|
||||||
$_data['_id'] = $id;
|
$data['_id'] = $sid;
|
||||||
|
|
||||||
$metadata[] = $_data;
|
$metadata[] = $data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,17 +105,17 @@ class tx_dlf_metadata extends tx_dlf_plugin {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$_id = array_pop($_ids);
|
$id = array_pop($ids);
|
||||||
|
|
||||||
if (is_array($_id)) {
|
if (is_array($id)) {
|
||||||
|
|
||||||
foreach ($_id as $id) {
|
foreach ($id as $sid) {
|
||||||
|
|
||||||
$_data = $this->doc->getMetadata($id, $this->conf['pages']);
|
$data = $this->doc->getMetadata($sid, $this->conf['pages']);
|
||||||
|
|
||||||
$_data['_id'] = $id;
|
$data['_id'] = $sid;
|
||||||
|
|
||||||
$metadata[] = $_data;
|
$metadata[] = $data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,17 +128,21 @@ class tx_dlf_metadata extends tx_dlf_plugin {
|
||||||
// Get titledata?
|
// Get titledata?
|
||||||
if (empty($metadata)) {
|
if (empty($metadata)) {
|
||||||
|
|
||||||
$_data = $this->doc->getTitleData($this->conf['pages']);
|
$data = $this->doc->getTitleData($this->conf['pages']);
|
||||||
|
|
||||||
$_data['_id'] = $this->doc->toplevelId;
|
$data['_id'] = $this->doc->toplevelId;
|
||||||
|
|
||||||
$metadata[] = $_data;
|
$metadata[] = $data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($metadata)) {
|
if (empty($metadata)) {
|
||||||
|
|
||||||
trigger_error('No metadata found', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_metadata->main('.$content.', [data])] No metadata found for document with UID "'.$this->doc->uid.'"', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
|
|
||||||
|
@ -157,11 +161,11 @@ class tx_dlf_metadata extends tx_dlf_plugin {
|
||||||
*
|
*
|
||||||
* @access protected
|
* @access protected
|
||||||
*
|
*
|
||||||
* @param array $metadata: The metadata array
|
* @param array $metadataArray: The metadata array
|
||||||
*
|
*
|
||||||
* @return string The metadata array ready for output
|
* @return string The metadata array ready for output
|
||||||
*/
|
*/
|
||||||
protected function printMetadata(array $metadata) {
|
protected function printMetadata(array $metadataArray) {
|
||||||
|
|
||||||
// Load template file.
|
// Load template file.
|
||||||
if (!empty($this->conf['templateFile'])) {
|
if (!empty($this->conf['templateFile'])) {
|
||||||
|
@ -181,7 +185,7 @@ class tx_dlf_metadata extends tx_dlf_plugin {
|
||||||
// Get list of metadata to show.
|
// Get list of metadata to show.
|
||||||
$metaList = array ();
|
$metaList = array ();
|
||||||
|
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.wrap AS wrap',
|
'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.wrap AS wrap',
|
||||||
'tx_dlf_metadata',
|
'tx_dlf_metadata',
|
||||||
'tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'),
|
'tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'),
|
||||||
|
@ -190,7 +194,7 @@ class tx_dlf_metadata extends tx_dlf_plugin {
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {
|
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
||||||
|
|
||||||
if ($this->conf['showFull'] || $resArray['is_listed']) {
|
if ($this->conf['showFull'] || $resArray['is_listed']) {
|
||||||
|
|
||||||
|
@ -207,7 +211,7 @@ class tx_dlf_metadata extends tx_dlf_plugin {
|
||||||
$cObjData = $this->cObj->data;
|
$cObjData = $this->cObj->data;
|
||||||
|
|
||||||
// Parse the metadata arrays.
|
// Parse the metadata arrays.
|
||||||
foreach ($metadata as $_metadata) {
|
foreach ($metadataArray as $metadata) {
|
||||||
|
|
||||||
$markerArray['###METADATA###'] = '';
|
$markerArray['###METADATA###'] = '';
|
||||||
|
|
||||||
|
@ -215,92 +219,92 @@ class tx_dlf_metadata extends tx_dlf_plugin {
|
||||||
$this->cObj->data = $cObjData;
|
$this->cObj->data = $cObjData;
|
||||||
|
|
||||||
// Load all the metadata values into the content object's data array.
|
// Load all the metadata values into the content object's data array.
|
||||||
foreach ($_metadata as $_index_name => $_value) {
|
foreach ($metadata as $index_name => $value) {
|
||||||
|
|
||||||
if (is_array($_value)) {
|
if (is_array($value)) {
|
||||||
|
|
||||||
$this->cObj->data[$_index_name] = implode($this->conf['separator'], $_value);
|
$this->cObj->data[$index_name] = implode($this->conf['separator'], $value);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$this->cObj->data[$_index_name] = $_value;
|
$this->cObj->data[$index_name] = $value;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process each metadate.
|
// Process each metadate.
|
||||||
foreach ($metaList as $_index_name => $_metaConf) {
|
foreach ($metaList as $index_name => $metaConf) {
|
||||||
|
|
||||||
$value = '';
|
$parsedValue = '';
|
||||||
|
|
||||||
$fieldwrap = $this->parseTS($_metaConf['wrap']);
|
$fieldwrap = $this->parseTS($metaConf['wrap']);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
||||||
$_value = @array_shift($_metadata[$_index_name]);
|
$value = @array_shift($metadata[$index_name]);
|
||||||
|
|
||||||
if ($_index_name == 'title') {
|
if ($index_name == 'title') {
|
||||||
|
|
||||||
// Get title of parent document if needed.
|
// Get title of parent document if needed.
|
||||||
if (empty($_value) && $this->conf['getTitle'] && $this->doc->parentid) {
|
if (empty($value) && $this->conf['getTitle'] && $this->doc->parentid) {
|
||||||
|
|
||||||
$_value = '['.tx_dlf_document::getTitle($this->doc->parentid, TRUE).']';
|
$value = '['.tx_dlf_document::getTitle($this->doc->parentid, TRUE).']';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_value)) {
|
if (!empty($value)) {
|
||||||
|
|
||||||
$_value = htmlspecialchars($_value);
|
$value = htmlspecialchars($value);
|
||||||
|
|
||||||
// Link title to pageview.
|
// Link title to pageview.
|
||||||
if ($this->conf['linkTitle'] && $_metadata['_id']) {
|
if ($this->conf['linkTitle'] && $metadata['_id']) {
|
||||||
|
|
||||||
$details = $this->doc->getLogicalStructure($_metadata['_id']);
|
$details = $this->doc->getLogicalStructure($metadata['_id']);
|
||||||
|
|
||||||
$_value = $this->pi_linkTP(htmlspecialchars($_value), array ($this->prefixId => array ('id' => $this->doc->uid, 'page' => (!empty($details['points']) ? intval($details['points']) : 1))), TRUE, $this->conf['targetPid']);
|
$value = $this->pi_linkTP(htmlspecialchars($value), array ($this->prefixId => array ('id' => $this->doc->uid, 'page' => (!empty($details['points']) ? intval($details['points']) : 1))), TRUE, $this->conf['targetPid']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif ($_index_name == 'owner' && !empty($_value)) {
|
} elseif ($index_name == 'owner' && !empty($value)) {
|
||||||
|
|
||||||
// Translate name of holding library.
|
// Translate name of holding library.
|
||||||
$_value = htmlspecialchars(tx_dlf_helper::translate($_value, 'tx_dlf_libraries', $this->conf['pages']));
|
$value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_libraries', $this->conf['pages']));
|
||||||
|
|
||||||
} elseif ($_index_name == 'type' && !empty($_value)) {
|
} elseif ($index_name == 'type' && !empty($value)) {
|
||||||
|
|
||||||
// Translate document type.
|
// Translate document type.
|
||||||
$_value = htmlspecialchars(tx_dlf_helper::translate($_value, 'tx_dlf_structures', $this->conf['pages']));
|
$value = htmlspecialchars(tx_dlf_helper::translate($value, 'tx_dlf_structures', $this->conf['pages']));
|
||||||
|
|
||||||
} elseif ($_index_name == 'language' && !empty($_value)) {
|
} elseif ($index_name == 'language' && !empty($value)) {
|
||||||
|
|
||||||
// Translate ISO 639 language code.
|
// Translate ISO 639 language code.
|
||||||
$_value = htmlspecialchars(tx_dlf_helper::getLanguageName($_value));
|
$value = htmlspecialchars(tx_dlf_helper::getLanguageName($value));
|
||||||
|
|
||||||
} elseif (!empty($_value)) {
|
} elseif (!empty($value)) {
|
||||||
|
|
||||||
// Sanitize value for output.
|
// Sanitize value for output.
|
||||||
$_value = htmlspecialchars($_value);
|
$value = htmlspecialchars($value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_value = $this->cObj->stdWrap($_value, $fieldwrap['value.']);
|
$value = $this->cObj->stdWrap($value, $fieldwrap['value.']);
|
||||||
|
|
||||||
if (!empty($_value)) {
|
if (!empty($value)) {
|
||||||
|
|
||||||
$value .= $_value;
|
$parsedValue .= $value;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (count($_metadata[$_index_name]));
|
} while (count($metadata[$index_name]));
|
||||||
|
|
||||||
if (!empty($value)) {
|
if (!empty($parsedValue)) {
|
||||||
|
|
||||||
$field = $this->cObj->stdWrap(htmlspecialchars($_metaConf['label']), $fieldwrap['key.']);
|
$field = $this->cObj->stdWrap(htmlspecialchars($metaConf['label']), $fieldwrap['key.']);
|
||||||
|
|
||||||
$field .= $value;
|
$field .= $parsedValue;
|
||||||
|
|
||||||
$markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);
|
$markerArray['###METADATA###'] .= $this->cObj->stdWrap($field, $fieldwrap['all.']);
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ class tx_dlf_navigation extends tx_dlf_plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build page selector.
|
// Build page selector.
|
||||||
$_uniqId = uniqid($prefix.'-');
|
$uniqId = uniqid($prefix.'-');
|
||||||
|
|
||||||
$markerArray['###PAGESELECT###'] = '<form action="'.$this->pi_getPageLink($GLOBALS['TSFE']->id).'" class="'.$prefix.'-pageselect" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />';
|
$markerArray['###PAGESELECT###'] = '<form action="'.$this->pi_getPageLink($GLOBALS['TSFE']->id).'" class="'.$prefix.'-pageselect" method="get"><div><input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />';
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ class tx_dlf_navigation extends tx_dlf_plugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$markerArray['###PAGESELECT###'] .= '<label for="'.$_uniqId.'">'.$this->pi_getLL('selectPage', '', TRUE).'</label><select id="'.$_uniqId.'" name="'.$this->prefixId.'[page]" onchange="javascript:this.form.submit();">';
|
$markerArray['###PAGESELECT###'] .= '<label for="'.$uniqId.'">'.$this->pi_getLL('selectPage', '', TRUE).'</label><select id="'.$uniqId.'" name="'.$this->prefixId.'[page]" onchange="javascript:this.form.submit();">';
|
||||||
|
|
||||||
for ($i = 1; $i <= $this->doc->numPages; $i++) {
|
for ($i = 1; $i <= $this->doc->numPages; $i++) {
|
||||||
|
|
||||||
|
|
|
@ -89,15 +89,19 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
protected function deleteExpiredTokens() {
|
protected function deleteExpiredTokens() {
|
||||||
|
|
||||||
// Delete expired resumption tokens.
|
// Delete expired resumption tokens.
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_DELETEquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_DELETEquery(
|
||||||
'tx_dlf_tokens',
|
'tx_dlf_tokens',
|
||||||
'tx_dlf_tokens.ident="oai" AND tx_dlf_tokens.tstamp<'.intval($GLOBALS['EXEC_TIME'] - $this->conf['expired'])
|
'tx_dlf_tokens.ident="oai" AND tx_dlf_tokens.tstamp<'.intval($GLOBALS['EXEC_TIME'] - $this->conf['expired'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_affected_rows($_result) === -1) {
|
if ($GLOBALS['TYPO3_DB']->sql_affected_rows($result) === -1) {
|
||||||
|
|
||||||
// Deletion failed.
|
// Deletion failed.
|
||||||
trigger_error('Could not delete expired resumption tokens', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_oai->deleteExpiredTokens()] Could not delete expired resumption tokens', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +137,7 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
*/
|
*/
|
||||||
protected function getUrlParams() {
|
protected function getUrlParams() {
|
||||||
|
|
||||||
$_allowedParams = array (
|
$allowedParams = array (
|
||||||
'verb',
|
'verb',
|
||||||
'identifier',
|
'identifier',
|
||||||
'metadataPrefix',
|
'metadataPrefix',
|
||||||
|
@ -147,11 +151,11 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
$this->piVars = array ();
|
$this->piVars = array ();
|
||||||
|
|
||||||
// Set only allowed parameters.
|
// Set only allowed parameters.
|
||||||
foreach ($_allowedParams as $_param) {
|
foreach ($allowedParams as $param) {
|
||||||
|
|
||||||
if (t3lib_div::_GP($_param)) {
|
if (t3lib_div::_GP($param)) {
|
||||||
|
|
||||||
$this->piVars[$_param] = t3lib_div::_GP($_param);
|
$this->piVars[$param] = t3lib_div::_GP($param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,7 +227,7 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
|
|
||||||
if (!empty($metadata['partof'])) {
|
if (!empty($metadata['partof'])) {
|
||||||
|
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_documents.record_id',
|
'tx_dlf_documents.record_id',
|
||||||
'tx_dlf_documents',
|
'tx_dlf_documents',
|
||||||
'tx_dlf_documents.uid='.intval($metadata['partof']).tx_dlf_helper::whereClause('tx_dlf_documents'),
|
'tx_dlf_documents.uid='.intval($metadata['partof']).tx_dlf_helper::whereClause('tx_dlf_documents'),
|
||||||
|
@ -232,11 +236,11 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result)) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||||
|
|
||||||
$_partof = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);
|
$partof = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
|
||||||
|
|
||||||
$oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:relation', htmlspecialchars($_partof['record_id'], ENT_NOQUOTES, 'UTF-8')));
|
$oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:relation', htmlspecialchars($partof['record_id'], ENT_NOQUOTES, 'UTF-8')));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -359,12 +363,21 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('No METS node found in file "'.$location.'"', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_oai->getMetsData([data])] No METS part found in document with location "'.$location.'"', $this->extKey, SYSLOG_SEVERITY_ERROR, $metadata);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Could not load file "'.$location.'"', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_oai->getMetsData([data])] Could not load XML file from "'.$location.'"', $this->extKey, SYSLOG_SEVERITY_ERROR, $metadata);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,26 +424,26 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
// Resolve "EXT:" prefix in file path.
|
// Resolve "EXT:" prefix in file path.
|
||||||
if (substr($this->conf['stylesheet'], 0, 4) == 'EXT:') {
|
if (substr($this->conf['stylesheet'], 0, 4) == 'EXT:') {
|
||||||
|
|
||||||
list ($_extKey, $_filePath) = explode('/', substr($this->conf['stylesheet'], 4), 2);
|
list ($extKey, $filePath) = explode('/', substr($this->conf['stylesheet'], 4), 2);
|
||||||
|
|
||||||
if (t3lib_extMgm::isLoaded($_extKey)) {
|
if (t3lib_extMgm::isLoaded($extKey)) {
|
||||||
|
|
||||||
$this->conf['stylesheet'] = t3lib_extMgm::siteRelPath($_extKey).$_filePath;
|
$this->conf['stylesheet'] = t3lib_extMgm::siteRelPath($extKey).$filePath;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_stylesheet = t3lib_div::locationHeaderUrl($this->conf['stylesheet']);
|
$stylesheet = t3lib_div::locationHeaderUrl($this->conf['stylesheet']);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Use default stylesheet if no custom stylesheet is given.
|
// Use default stylesheet if no custom stylesheet is given.
|
||||||
$_stylesheet = t3lib_div::locationHeaderUrl(t3lib_extMgm::siteRelPath($this->extKey).'plugins/oai/transform.xsl');
|
$stylesheet = t3lib_div::locationHeaderUrl(t3lib_extMgm::siteRelPath($this->extKey).'plugins/oai/transform.xsl');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="'.htmlspecialchars($_stylesheet, ENT_NOQUOTES, 'UTF-8').'"'));
|
$this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="'.htmlspecialchars($stylesheet, ENT_NOQUOTES, 'UTF-8').'"'));
|
||||||
|
|
||||||
// Create root element.
|
// Create root element.
|
||||||
$root = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'OAI-PMH');
|
$root = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'OAI-PMH');
|
||||||
|
@ -545,7 +558,7 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
protected function resume() {
|
protected function resume() {
|
||||||
|
|
||||||
// Get resumption token.
|
// Get resumption token.
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_tokens.options AS options',
|
'tx_dlf_tokens.options AS options',
|
||||||
'tx_dlf_tokens',
|
'tx_dlf_tokens',
|
||||||
'tx_dlf_tokens.ident="oai" AND tx_dlf_tokens.token='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['resumptionToken'], 'tx_dlf_tokens'),
|
'tx_dlf_tokens.ident="oai" AND tx_dlf_tokens.token='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['resumptionToken'], 'tx_dlf_tokens'),
|
||||||
|
@ -554,16 +567,16 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($_result)) {
|
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||||
|
|
||||||
// No resumption token found or resumption token expired.
|
// No resumption token found or resumption token expired.
|
||||||
return $this->error('badResumptionToken');
|
return $this->error('badResumptionToken');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);
|
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
|
||||||
|
|
||||||
$resultSet = unserialize($_resArray['options']);
|
$resultSet = unserialize($resArray['options']);
|
||||||
|
|
||||||
$complete = FALSE;
|
$complete = FALSE;
|
||||||
|
|
||||||
|
@ -692,7 +705,7 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
'metadataPrefix' => $resultSet->metadata['metadataPrefix'],
|
'metadataPrefix' => $resultSet->metadata['metadataPrefix'],
|
||||||
);
|
);
|
||||||
|
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_INSERTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_INSERTquery(
|
||||||
'tx_dlf_tokens',
|
'tx_dlf_tokens',
|
||||||
array (
|
array (
|
||||||
'tstamp' => $GLOBALS['EXEC_TIME'],
|
'tstamp' => $GLOBALS['EXEC_TIME'],
|
||||||
|
@ -702,13 +715,17 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_affected_rows($_result) == 1) {
|
if ($GLOBALS['TYPO3_DB']->sql_affected_rows($result) == 1) {
|
||||||
|
|
||||||
$resumptionToken = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'resumptionToken', htmlspecialchars($token, ENT_NOQUOTES, 'UTF-8'));
|
$resumptionToken = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'resumptionToken', htmlspecialchars($token, ENT_NOQUOTES, 'UTF-8'));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Could not create resumption token', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_oai->resume()] Could not create resumption token', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -763,7 +780,7 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
|
||||||
'tx_dlf_documents.*,GROUP_CONCAT(DISTINCT tx_dlf_collections.oai_name ORDER BY tx_dlf_collections.oai_name SEPARATOR " ") AS collections',
|
'tx_dlf_documents.*,GROUP_CONCAT(DISTINCT tx_dlf_collections.oai_name ORDER BY tx_dlf_collections.oai_name SEPARATOR " ") AS collections',
|
||||||
'tx_dlf_documents',
|
'tx_dlf_documents',
|
||||||
'tx_dlf_relations',
|
'tx_dlf_relations',
|
||||||
|
@ -774,13 +791,13 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($_result)) {
|
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||||
|
|
||||||
return $this->error('idDoesNotExist');
|
return $this->error('idDoesNotExist');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);
|
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
|
||||||
|
|
||||||
// Check for required fields.
|
// Check for required fields.
|
||||||
foreach ($this->formats[$this->piVars['metadataPrefix']]['requiredFields'] as $required) {
|
foreach ($this->formats[$this->piVars['metadataPrefix']]['requiredFields'] as $required) {
|
||||||
|
@ -879,7 +896,7 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get repository name and administrative contact.
|
// Get repository name and administrative contact.
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_libraries.oai_label AS oai_label,tx_dlf_libraries.contact AS contact',
|
'tx_dlf_libraries.oai_label AS oai_label,tx_dlf_libraries.contact AS contact',
|
||||||
'tx_dlf_libraries',
|
'tx_dlf_libraries',
|
||||||
'tx_dlf_libraries.pid='.intval($this->conf['pages']).' AND tx_dlf_libraries.uid='.intval($this->conf['library']).tx_dlf_helper::whereClause('tx_dlf_libraries'),
|
'tx_dlf_libraries.pid='.intval($this->conf['pages']).' AND tx_dlf_libraries.uid='.intval($this->conf['library']).tx_dlf_helper::whereClause('tx_dlf_libraries'),
|
||||||
|
@ -888,12 +905,12 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result)) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||||
|
|
||||||
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);
|
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
|
||||||
|
|
||||||
// Get earliest datestamp.
|
// Get earliest datestamp.
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_documents.tstamp AS tstamp',
|
'tx_dlf_documents.tstamp AS tstamp',
|
||||||
'tx_dlf_documents',
|
'tx_dlf_documents',
|
||||||
'tx_dlf_documents.pid='.intval($this->conf['pages']),
|
'tx_dlf_documents.pid='.intval($this->conf['pages']),
|
||||||
|
@ -902,17 +919,21 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result)) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||||
|
|
||||||
list ($_timestamp) = $GLOBALS['TYPO3_DB']->sql_fetch_row($_result);
|
list ($timestamp) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result);
|
||||||
|
|
||||||
$datestamp = gmdate('Y-m-d\TH:i:s\Z', $_timestamp);
|
$datestamp = gmdate('Y-m-d\TH:i:s\Z', $timestamp);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$datestamp = '0000-00-00T00:00:00Z';
|
$datestamp = '0000-00-00T00:00:00Z';
|
||||||
|
|
||||||
trigger_error('No records found with PID '.$this->conf['pages'], E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_oai->verbIdentify()] No records found with PID "'.$this->conf['pages'].'"', $this->extKey, SYSLOG_SEVERITY_NOTICE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -937,7 +958,11 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('OAI interface needs more configuration', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_oai->verbIdentify()] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
@ -997,32 +1022,32 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
if (!empty($this->piVars['set'])) {
|
if (!empty($this->piVars['set'])) {
|
||||||
|
|
||||||
// Get set information.
|
// Get set information.
|
||||||
$_additionalWhere = '';
|
$additionalWhere = '';
|
||||||
|
|
||||||
if (!$this->conf['show_userdefined']) {
|
if (!$this->conf['show_userdefined']) {
|
||||||
|
|
||||||
$_additionalWhere = ' AND tx_dlf_collections.fe_cruser_id=0';
|
$additionalWhere = ' AND tx_dlf_collections.fe_cruser_id=0';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_collections.uid AS uid',
|
'tx_dlf_collections.uid AS uid',
|
||||||
'tx_dlf_collections',
|
'tx_dlf_collections',
|
||||||
'tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.oai_name='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['set'], 'tx_dlf_collections').$_additionalWhere.tx_dlf_helper::whereClause('tx_dlf_collections'),
|
'tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.oai_name='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['set'], 'tx_dlf_collections').$additionalWhere.tx_dlf_helper::whereClause('tx_dlf_collections'),
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($_result)) {
|
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||||
|
|
||||||
return $this->error('noSetHierarchy');
|
return $this->error('noSetHierarchy');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$_resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);
|
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
|
||||||
|
|
||||||
$where .= ' AND tx_dlf_collections.uid='.intval($_resArray['uid']);
|
$where .= ' AND tx_dlf_collections.uid='.intval($resArray['uid']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1031,9 +1056,9 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
// Check "from" for valid value.
|
// Check "from" for valid value.
|
||||||
if (!empty($this->piVars['from'])) {
|
if (!empty($this->piVars['from'])) {
|
||||||
|
|
||||||
if (is_array($_from = strptime($this->piVars['from'], '%Y-%m-%dT%H:%M:%SZ')) || is_array($_from = strptime($this->piVars['from'], '%Y-%m-%d'))) {
|
if (is_array($from = strptime($this->piVars['from'], '%Y-%m-%dT%H:%M:%SZ')) || is_array($from = strptime($this->piVars['from'], '%Y-%m-%d'))) {
|
||||||
|
|
||||||
$_from = gmmktime($_from['tm_hour'], $_from['tm_min'], $_from['tm_sec'], $_from['tm_mon'] + 1, $_from['tm_mday'], $_from['tm_year'] + 1900);
|
$from = gmmktime($from['tm_hour'], $from['tm_min'], $from['tm_sec'], $from['tm_mon'] + 1, $from['tm_mday'], $from['tm_year'] + 1900);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1041,16 +1066,16 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$where .= ' AND tx_dlf_documents.tstamp>='.intval($_from);
|
$where .= ' AND tx_dlf_documents.tstamp>='.intval($from);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check "until" for valid value.
|
// Check "until" for valid value.
|
||||||
if (!empty($this->piVars['until'])) {
|
if (!empty($this->piVars['until'])) {
|
||||||
|
|
||||||
if (is_array($_until = strptime($this->piVars['until'], '%Y-%m-%dT%H:%M:%SZ')) || is_array($_until = strptime($this->piVars['until'], '%Y-%m-%d'))) {
|
if (is_array($until = strptime($this->piVars['until'], '%Y-%m-%dT%H:%M:%SZ')) || is_array($until = strptime($this->piVars['until'], '%Y-%m-%d'))) {
|
||||||
|
|
||||||
$_until = gmmktime($_until['tm_hour'], $_until['tm_min'], $_until['tm_sec'], $_until['tm_mon'] + 1, $_until['tm_mday'], $_until['tm_year'] + 1900);
|
$until = gmmktime($until['tm_hour'], $until['tm_min'], $until['tm_sec'], $until['tm_mon'] + 1, $until['tm_mday'], $until['tm_year'] + 1900);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1058,13 +1083,13 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_from) && $_from > $_until) {
|
if (!empty($from) && $from > $until) {
|
||||||
|
|
||||||
return $this->error('badArgument');
|
return $this->error('badArgument');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$where .= ' AND tx_dlf_documents.tstamp<='.intval($_until);
|
$where .= ' AND tx_dlf_documents.tstamp<='.intval($until);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1223,7 +1248,11 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Could not create resumption token', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_oai->verbListIdentifiers()] Could not create resumption token', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1369,32 +1398,32 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
if (!empty($this->piVars['set'])) {
|
if (!empty($this->piVars['set'])) {
|
||||||
|
|
||||||
// Get set information.
|
// Get set information.
|
||||||
$_additionalWhere = '';
|
$additionalWhere = '';
|
||||||
|
|
||||||
if (!$this->conf['show_userdefined']) {
|
if (!$this->conf['show_userdefined']) {
|
||||||
|
|
||||||
$_additionalWhere = ' AND tx_dlf_collections.fe_cruser_id=0';
|
$additionalWhere = ' AND tx_dlf_collections.fe_cruser_id=0';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_collections.uid AS uid',
|
'tx_dlf_collections.uid AS uid',
|
||||||
'tx_dlf_collections',
|
'tx_dlf_collections',
|
||||||
'tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.oai_name='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['set'], 'tx_dlf_collections').$_additionalWhere.tx_dlf_helper::whereClause('tx_dlf_collections'),
|
'tx_dlf_collections.pid='.intval($this->conf['pages']).' AND tx_dlf_collections.oai_name='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['set'], 'tx_dlf_collections').$additionalWhere.tx_dlf_helper::whereClause('tx_dlf_collections'),
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($_result)) {
|
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||||
|
|
||||||
return $this->error('noSetHierarchy');
|
return $this->error('noSetHierarchy');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$_resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);
|
$resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
|
||||||
|
|
||||||
$where .= ' AND tx_dlf_collections.uid='.intval($_resArray['uid']);
|
$where .= ' AND tx_dlf_collections.uid='.intval($resArray['uid']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1403,9 +1432,9 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
// Check "from" for valid value.
|
// Check "from" for valid value.
|
||||||
if (!empty($this->piVars['from'])) {
|
if (!empty($this->piVars['from'])) {
|
||||||
|
|
||||||
if (is_array($_from = strptime($this->piVars['from'], '%Y-%m-%dT%H:%M:%SZ')) || is_array($_from = strptime($this->piVars['from'], '%Y-%m-%d'))) {
|
if (is_array($from = strptime($this->piVars['from'], '%Y-%m-%dT%H:%M:%SZ')) || is_array($from = strptime($this->piVars['from'], '%Y-%m-%d'))) {
|
||||||
|
|
||||||
$_from = gmmktime($_from['tm_hour'], $_from['tm_min'], $_from['tm_sec'], $_from['tm_mon'] + 1, $_from['tm_mday'], $_from['tm_year'] + 1900);
|
$from = gmmktime($from['tm_hour'], $from['tm_min'], $from['tm_sec'], $from['tm_mon'] + 1, $from['tm_mday'], $from['tm_year'] + 1900);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1413,16 +1442,16 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$where .= ' AND tx_dlf_documents.tstamp>='.intval($_from);
|
$where .= ' AND tx_dlf_documents.tstamp>='.intval($from);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check "until" for valid value.
|
// Check "until" for valid value.
|
||||||
if (!empty($this->piVars['until'])) {
|
if (!empty($this->piVars['until'])) {
|
||||||
|
|
||||||
if (is_array($_until = strptime($this->piVars['until'], '%Y-%m-%dT%H:%M:%SZ')) || is_array($_until = strptime($this->piVars['until'], '%Y-%m-%d'))) {
|
if (is_array($until = strptime($this->piVars['until'], '%Y-%m-%dT%H:%M:%SZ')) || is_array($until = strptime($this->piVars['until'], '%Y-%m-%d'))) {
|
||||||
|
|
||||||
$_until = gmmktime($_until['tm_hour'], $_until['tm_min'], $_until['tm_sec'], $_until['tm_mon'] + 1, $_until['tm_mday'], $_until['tm_year'] + 1900);
|
$until = gmmktime($until['tm_hour'], $until['tm_min'], $until['tm_sec'], $until['tm_mon'] + 1, $until['tm_mday'], $until['tm_year'] + 1900);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1430,13 +1459,13 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_from) && $_from > $_until) {
|
if (!empty($from) && $from > $until) {
|
||||||
|
|
||||||
return $this->error('badArgument');
|
return $this->error('badArgument');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$where .= ' AND tx_dlf_documents.tstamp<='.intval($_until);
|
$where .= ' AND tx_dlf_documents.tstamp<='.intval($until);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1624,7 +1653,11 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('Could not create resumption token', E_USER_ERROR);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_oai->verbListRecords()] Could not create resumption token', $this->extKey, SYSLOG_SEVERITY_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,11 +54,11 @@ class tx_dlf_pageview extends tx_dlf_plugin {
|
||||||
// Add localization file for OpenLayers.
|
// Add localization file for OpenLayers.
|
||||||
if ($GLOBALS['TSFE']->lang) {
|
if ($GLOBALS['TSFE']->lang) {
|
||||||
|
|
||||||
$_langFile = t3lib_extMgm::siteRelPath($this->extKey).'lib/OpenLayers/lib/OpenLayers/Lang/'.strtolower($GLOBALS['TSFE']->lang).'.js';
|
$langFile = t3lib_extMgm::siteRelPath($this->extKey).'lib/OpenLayers/lib/OpenLayers/Lang/'.strtolower($GLOBALS['TSFE']->lang).'.js';
|
||||||
|
|
||||||
if (file_exists($_langFile)) {
|
if (file_exists($langFile)) {
|
||||||
|
|
||||||
$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId.'_olJS_lang'] = ' <script type="text/javascript" src="'.$_langFile.'"></script>';
|
$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId.'_olJS_lang'] = ' <script type="text/javascript" src="'.$langFile.'"></script>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,6 +82,9 @@ class tx_dlf_pageview extends tx_dlf_plugin {
|
||||||
*/
|
*/
|
||||||
protected function getImageData($page = 0) {
|
protected function getImageData($page = 0) {
|
||||||
|
|
||||||
|
// Save parameter for logging purposes.
|
||||||
|
$_page = $page;
|
||||||
|
|
||||||
// Cast to integer for security reasons.
|
// Cast to integer for security reasons.
|
||||||
$page = intval($page);
|
$page = intval($page);
|
||||||
|
|
||||||
|
@ -94,32 +97,36 @@ class tx_dlf_pageview extends tx_dlf_plugin {
|
||||||
|
|
||||||
$imageData = array ();
|
$imageData = array ();
|
||||||
|
|
||||||
$_fileGrps = t3lib_div::trimExplode(',', $this->conf['fileGrps']);
|
$fileGrps = t3lib_div::trimExplode(',', $this->conf['fileGrps']);
|
||||||
|
|
||||||
foreach ($_fileGrps as $_fileGrp) {
|
foreach ($fileGrps as $fileGrp) {
|
||||||
|
|
||||||
$_fileGrp = strtolower($_fileGrp);
|
$fileGrp = strtolower($fileGrp);
|
||||||
|
|
||||||
if (!empty($this->doc->physicalPagesInfo[$this->doc->physicalPages[$page]]['files'][$_fileGrp])) {
|
if (!empty($this->doc->physicalPagesInfo[$this->doc->physicalPages[$page]]['files'][$fileGrp])) {
|
||||||
|
|
||||||
$_fileGrpUrl = $this->doc->getFileLocation($this->doc->physicalPagesInfo[$this->doc->physicalPages[$page]]['files'][$_fileGrp]);
|
$fileGrpUrl = $this->doc->getFileLocation($this->doc->physicalPagesInfo[$this->doc->physicalPages[$page]]['files'][$fileGrp]);
|
||||||
|
|
||||||
// Check file's existence.
|
// Check file's existence.
|
||||||
$_headers = @get_headers($_fileGrpUrl);
|
$headers = @get_headers($fileGrpUrl);
|
||||||
|
|
||||||
if (is_array($_headers) && preg_match('/^HTTP\\/\\d+\\.\\d+\\s+2\\d\\d\\s+.*$/', $_headers[0])) {
|
if (is_array($headers) && preg_match('/^HTTP\\/\\d+\\.\\d+\\s+2\\d\\d\\s+.*$/', $headers[0])) {
|
||||||
|
|
||||||
$_fileGrpSize = getimagesize($_fileGrpUrl);
|
$fileGrpSize = getimagesize($fileGrpUrl);
|
||||||
|
|
||||||
$imageData[] = array (
|
$imageData[] = array (
|
||||||
'width' => $_fileGrpSize[0],
|
'width' => $fileGrpSize[0],
|
||||||
'height' => $_fileGrpSize[1],
|
'height' => $fileGrpSize[1],
|
||||||
'url' => $_fileGrpUrl
|
'url' => $fileGrpUrl
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
trigger_error('File "'.$_fileGrpUrl.'" not found', E_USER_WARNING);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_pageview->getImageData('.$_page.')] File not found: "'.$fileGrpUrl.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,13 +238,13 @@ class tx_dlf_pageview extends tx_dlf_plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
$viewer .= '
|
$viewer .= '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
dlfViewer = new Viewer();
|
dlfViewer = new Viewer();
|
||||||
'.implode("\n ", $addImages).'
|
'.implode("\n", $addImages).'
|
||||||
dlfViewer.run();
|
dlfViewer.run();
|
||||||
/* ]]> */
|
/* ]]> */
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
return $viewer;
|
return $viewer;
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,11 @@ class tx_dlf_search extends tx_dlf_plugin {
|
||||||
// Quit without doing anything if required variables are not set.
|
// Quit without doing anything if required variables are not set.
|
||||||
if (empty($this->conf['solrcore'])) {
|
if (empty($this->conf['solrcore'])) {
|
||||||
|
|
||||||
trigger_error('Incomplete configuration for plugin '.get_class($this), E_USER_NOTICE);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_search->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
|
|
||||||
|
@ -153,11 +157,11 @@ class tx_dlf_search extends tx_dlf_plugin {
|
||||||
// Set last query if applicable.
|
// Set last query if applicable.
|
||||||
$lastQuery = '';
|
$lastQuery = '';
|
||||||
|
|
||||||
$_list = t3lib_div::makeInstance('tx_dlf_list');
|
$list = t3lib_div::makeInstance('tx_dlf_list');
|
||||||
|
|
||||||
if (!empty($_list->metadata['options']['source']) && $_list->metadata['options']['source'] == 'search') {
|
if (!empty($list->metadata['options']['source']) && $list->metadata['options']['source'] == 'search') {
|
||||||
|
|
||||||
$lastQuery = $_list->metadata['options']['select'];
|
$lastQuery = $list->metadata['options']['select'];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,10 +194,8 @@ class tx_dlf_search extends tx_dlf_plugin {
|
||||||
|
|
||||||
$numHits = count($query->response->docs);
|
$numHits = count($query->response->docs);
|
||||||
|
|
||||||
$_list = array ();
|
|
||||||
|
|
||||||
// Set metadata for search.
|
// Set metadata for search.
|
||||||
$_metadata = array (
|
$listMetadata = array (
|
||||||
'label' => htmlspecialchars(sprintf($this->pi_getLL('searchfor', ''), $this->piVars['query'])),
|
'label' => htmlspecialchars(sprintf($this->pi_getLL('searchfor', ''), $this->piVars['query'])),
|
||||||
'description' => '<p class="tx-dlf-search-numHits">'.htmlspecialchars(sprintf($this->pi_getLL('hits', ''), $numHits)).'</p>',
|
'description' => '<p class="tx-dlf-search-numHits">'.htmlspecialchars(sprintf($this->pi_getLL('hits', ''), $numHits)).'</p>',
|
||||||
'options' => array (
|
'options' => array (
|
||||||
|
@ -210,7 +212,7 @@ class tx_dlf_search extends tx_dlf_plugin {
|
||||||
// Get metadata configuration.
|
// Get metadata configuration.
|
||||||
if ($numHits) {
|
if ($numHits) {
|
||||||
|
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.tokenized AS tokenized,tx_dlf_metadata.indexed AS indexed,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.is_sortable AS is_sortable',
|
'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.tokenized AS tokenized,tx_dlf_metadata.indexed AS indexed,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.is_sortable AS is_sortable',
|
||||||
'tx_dlf_metadata',
|
'tx_dlf_metadata',
|
||||||
'(tx_dlf_metadata.is_listed=1 OR tx_dlf_metadata.is_sortable=1) AND tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'),
|
'(tx_dlf_metadata.is_listed=1 OR tx_dlf_metadata.is_sortable=1) AND tx_dlf_metadata.pid='.intval($this->conf['pages']).tx_dlf_helper::whereClause('tx_dlf_metadata'),
|
||||||
|
@ -223,7 +225,7 @@ class tx_dlf_search extends tx_dlf_plugin {
|
||||||
|
|
||||||
$sorting = array ();
|
$sorting = array ();
|
||||||
|
|
||||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {
|
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
||||||
|
|
||||||
if ($resArray['is_listed']) {
|
if ($resArray['is_listed']) {
|
||||||
|
|
||||||
|
@ -395,7 +397,7 @@ class tx_dlf_search extends tx_dlf_plugin {
|
||||||
|
|
||||||
$list->add(array_values($toplevel));
|
$list->add(array_values($toplevel));
|
||||||
|
|
||||||
$list->metadata = $_metadata;
|
$list->metadata = $listMetadata;
|
||||||
|
|
||||||
$list->save();
|
$list->save();
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,11 @@ class tx_dlf_statistics extends tx_dlf_plugin {
|
||||||
// Quit without doing anything if required configuration variables are not set.
|
// Quit without doing anything if required configuration variables are not set.
|
||||||
if (empty($this->conf['pages'])) {
|
if (empty($this->conf['pages'])) {
|
||||||
|
|
||||||
trigger_error('Incomplete configuration for plugin '.get_class($this), E_USER_NOTICE);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_statistics->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,11 @@ class tx_dlf_toc extends tx_dlf_plugin {
|
||||||
// Check for typoscript configuration to prevent fatal error.
|
// Check for typoscript configuration to prevent fatal error.
|
||||||
if (empty($this->conf['menuConf.'])) {
|
if (empty($this->conf['menuConf.'])) {
|
||||||
|
|
||||||
trigger_error('No typoscript configuration for table of contents available', E_USER_NOTICE);
|
if (TYPO3_DLOG) {
|
||||||
|
|
||||||
|
t3lib_div::devLog('[tx_dlf_toc->main('.$content.', [data])] Incomplete plugin configuration', $this->extKey, SYSLOG_SEVERITY_WARNING, $conf);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
|
|
||||||
|
@ -174,15 +178,15 @@ class tx_dlf_toc extends tx_dlf_plugin {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_TSconfig = array ();
|
$TSconfig = array ();
|
||||||
|
|
||||||
$_TSconfig['special'] = 'userfunction';
|
$TSconfig['special'] = 'userfunction';
|
||||||
|
|
||||||
$_TSconfig['special.']['userFunc'] = 'tx_dlf_toc->makeMenuArray';
|
$TSconfig['special.']['userFunc'] = 'tx_dlf_toc->makeMenuArray';
|
||||||
|
|
||||||
$_TSconfig = t3lib_div::array_merge_recursive_overrule($this->conf['menuConf.'], $_TSconfig);
|
$TSconfig = t3lib_div::array_merge_recursive_overrule($this->conf['menuConf.'], $TSconfig);
|
||||||
|
|
||||||
$markerArray['###TOCMENU###'] = $this->cObj->HMENU($_TSconfig);
|
$markerArray['###TOCMENU###'] = $this->cObj->HMENU($TSconfig);
|
||||||
|
|
||||||
$content .= $this->cObj->substituteMarkerArray($this->template, $markerArray);
|
$content .= $this->cObj->substituteMarkerArray($this->template, $markerArray);
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ class tx_dlf_toolbox extends tx_dlf_plugin {
|
||||||
|
|
||||||
if (t3lib_div::testInt($this->piVars['id'])) {
|
if (t3lib_div::testInt($this->piVars['id'])) {
|
||||||
|
|
||||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||||
'*',
|
'*',
|
||||||
'tx_dlf_documents',
|
'tx_dlf_documents',
|
||||||
'tx_dlf_documents.uid='.intval($this->piVars['id']).tx_dlf_helper::whereClause('tx_dlf_documents'),
|
'tx_dlf_documents.uid='.intval($this->piVars['id']).tx_dlf_helper::whereClause('tx_dlf_documents'),
|
||||||
|
@ -88,15 +88,15 @@ class tx_dlf_toolbox extends tx_dlf_plugin {
|
||||||
'1'
|
'1'
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) {
|
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
||||||
|
|
||||||
$data = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result);
|
$data = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// TODO: "data"-Array bei externen METS-Dateien selbst bauen.
|
// TODO: Build data array "by hand" for external METS files.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,18 +105,18 @@ class tx_dlf_toolbox extends tx_dlf_plugin {
|
||||||
|
|
||||||
if (!empty($data)) {
|
if (!empty($data)) {
|
||||||
|
|
||||||
$_tools = explode(',', $this->conf['tools']);
|
$tools = explode(',', $this->conf['tools']);
|
||||||
|
|
||||||
// Add the tools to the toolbox.
|
// Add the tools to the toolbox.
|
||||||
foreach ($_tools as $_tool) {
|
foreach ($tools as $tool) {
|
||||||
|
|
||||||
$_tool = trim($_tool);
|
$tool = trim($tool);
|
||||||
|
|
||||||
$cObj = t3lib_div::makeInstance('tslib_cObj');
|
$cObj = t3lib_div::makeInstance('tslib_cObj');
|
||||||
|
|
||||||
$cObj->data = $data;
|
$cObj->data = $data;
|
||||||
|
|
||||||
$content .= $this->cObj->substituteMarkerArray($subpart, array ('###TOOL###' => $cObj->cObjGetSingle($GLOBALS['TSFE']->tmpl->setup['plugin.'][$_tool], $GLOBALS['TSFE']->tmpl->setup['plugin.'][$_tool.'.'])));
|
$content .= $this->cObj->substituteMarkerArray($subpart, array ('###TOOL###' => $cObj->cObjGetSingle($GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool], $GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool.'.'])));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -634,13 +634,6 @@ $TCA['tx_dlf_formats'] = array (
|
||||||
'eval' => 'required,nospace,alphanum_x,unique',
|
'eval' => 'required,nospace,alphanum_x,unique',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'other_type' => array (
|
|
||||||
'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats.other_type',
|
|
||||||
'config' => array (
|
|
||||||
'type' => 'check',
|
|
||||||
'default' => 0,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
'root' => array (
|
'root' => array (
|
||||||
'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats.root',
|
'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_formats.root',
|
||||||
'config' => array (
|
'config' => array (
|
||||||
|
@ -670,7 +663,7 @@ $TCA['tx_dlf_formats'] = array (
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
'types' => array (
|
'types' => array (
|
||||||
'0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_formats.tab1, type;;;;1-1-1, other, root;;;;2-2-2, namespace, class;;;;3-3-3'),
|
'0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_formats.tab1, type;;;;1-1-1, root;;;;2-2-2, namespace, class;;;;3-3-3'),
|
||||||
),
|
),
|
||||||
'palettes' => array (
|
'palettes' => array (
|
||||||
'1' => array ('showitem' => ''),
|
'1' => array ('showitem' => ''),
|
||||||
|
|
Loading…
Reference in New Issue