Fix some typos in variable names
This commit is contained in:
parent
d854c7ceef
commit
eaebfe699c
|
@ -708,7 +708,7 @@ final class tx_dlf_document {
|
|||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||
'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.xpath AS xpath,tx_dlf_metadata.xpath_sorting AS xpath_sorting,tx_dlf_metadata.is_sortable AS is_sortable,tx_dlf_metadata.default_value AS default_value',
|
||||
'tx_dlf_metadata,tx_dlf_formats',
|
||||
'tx_dlf_metadata.pid='.$cPid.' AND ((tx_dlf_metadata.encoded=tx_dlf_formats.uid AND tx_dlf_formats.type='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->dmdSec[$_dmdId]['type'], 'tx_dlf_formats').') OR tx_dlf_metadata.encoded=0)'.tx_dlf_helper::whereClause('tx_dlf_metadata', TRUE).tx_dlf_helper::whereClause('tx_dlf_formats'),
|
||||
'tx_dlf_metadata.pid='.$cPid.' AND ((tx_dlf_metadata.encoded=tx_dlf_formats.uid AND tx_dlf_formats.type='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->dmdSec[$dmdId]['type'], 'tx_dlf_formats').') OR tx_dlf_metadata.encoded=0)'.tx_dlf_helper::whereClause('tx_dlf_metadata', TRUE).tx_dlf_helper::whereClause('tx_dlf_formats'),
|
||||
'',
|
||||
'',
|
||||
''
|
||||
|
@ -947,7 +947,7 @@ final class tx_dlf_document {
|
|||
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dlf']);
|
||||
|
||||
// Set user-agent to identify self when fetching XML data.
|
||||
if (!empty($_extConf['useragent'])) {
|
||||
if (!empty($extConf['useragent'])) {
|
||||
|
||||
@ini_set('user_agent', $extConf['useragent']);
|
||||
|
||||
|
@ -1493,7 +1493,7 @@ final class tx_dlf_document {
|
|||
|
||||
$type = (string) $type[0];
|
||||
|
||||
$xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="'.$_type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']);
|
||||
$xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -828,7 +828,7 @@ class tx_dlf_helper {
|
|||
}
|
||||
|
||||
// Get labels from database.
|
||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||
'*',
|
||||
$table,
|
||||
'pid='.$pid.$additionalWhere.self::whereClause($table),
|
||||
|
@ -837,9 +837,9 @@ class tx_dlf_helper {
|
|||
''
|
||||
);
|
||||
|
||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($_result) > 0) {
|
||||
if ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0) {
|
||||
|
||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {
|
||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
||||
|
||||
// Overlay localized labels if available.
|
||||
if ($GLOBALS['TSFE']->sys_language_content > 0) {
|
||||
|
|
|
@ -55,23 +55,23 @@ class tx_dlf_hacks {
|
|||
|
||||
$xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3');
|
||||
|
||||
if (($_divs = $xml->xpath('//mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID]'))) {
|
||||
if (($divs = $xml->xpath('//mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID]'))) {
|
||||
|
||||
$_smLinks = $xml->xpath('//mets:structLink/mets:smLink');
|
||||
$smLinks = $xml->xpath('//mets:structLink/mets:smLink');
|
||||
|
||||
if ($_smLinks) {
|
||||
if ($smLinks) {
|
||||
|
||||
foreach ($_smLinks as $_smLink) {
|
||||
foreach ($smLinks as $smLink) {
|
||||
|
||||
$_links[(string) $_smLink->attributes('http://www.w3.org/1999/xlink')->from][] = (string) $_smLink->attributes('http://www.w3.org/1999/xlink')->to;
|
||||
$links[(string) $smLink->attributes('http://www.w3.org/1999/xlink')->from][] = (string) $smLink->attributes('http://www.w3.org/1999/xlink')->to;
|
||||
|
||||
}
|
||||
|
||||
foreach ($_divs as $_div) {
|
||||
foreach ($divs as $div) {
|
||||
|
||||
if (!empty($_links[(string) $_div['ID']])) {
|
||||
if (!empty($links[(string) $div['ID']])) {
|
||||
|
||||
$_id = (string) $_div['DMDID'];
|
||||
$id = (string) $div['DMDID'];
|
||||
|
||||
break;
|
||||
|
||||
|
@ -81,17 +81,17 @@ class tx_dlf_hacks {
|
|||
|
||||
}
|
||||
|
||||
if (empty($_id)) {
|
||||
if (empty($id)) {
|
||||
|
||||
$_id = (string) $_divs[0]['DMDID'];
|
||||
$id = (string) $divs[0]['DMDID'];
|
||||
|
||||
}
|
||||
|
||||
$_recordId = $xml->xpath('//mets:dmdSec[@ID="'.$_id.'"]//mods:mods/mods:recordInfo/mods:recordIdentifier');
|
||||
$recordIds = $xml->xpath('//mets:dmdSec[@ID="'.$id.'"]//mods:mods/mods:recordInfo/mods:recordIdentifier');
|
||||
|
||||
if (!empty($_recordId[0])) {
|
||||
if (!empty($recordIds[0])) {
|
||||
|
||||
return (string) $_recordId[0];
|
||||
return (string) $recordIds[0];
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -347,7 +347,7 @@ class tx_dlf_listview extends tx_dlf_plugin {
|
|||
// Translate document type.
|
||||
} 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.
|
||||
} elseif ($index_name == 'language' && !empty($value)) {
|
||||
|
@ -399,7 +399,7 @@ class tx_dlf_listview extends tx_dlf_plugin {
|
|||
*/
|
||||
protected function loadConfig() {
|
||||
|
||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||
'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.wrap AS wrap,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.is_sortable AS is_sortable',
|
||||
'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'),
|
||||
|
@ -408,7 +408,7 @@ class tx_dlf_listview extends tx_dlf_plugin {
|
|||
''
|
||||
);
|
||||
|
||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {
|
||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
||||
|
||||
if ($resArray['is_listed']) {
|
||||
|
||||
|
|
|
@ -643,9 +643,9 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
|||
} else {
|
||||
|
||||
// Add sets.
|
||||
foreach (explode(' ', $resArray['collections']) as $_spec) {
|
||||
foreach (explode(' ', $resArray['collections']) as $spec) {
|
||||
|
||||
$header->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'setSpec', htmlspecialchars($_spec, ENT_NOQUOTES, 'UTF-8')));
|
||||
$header->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'setSpec', htmlspecialchars($spec, ENT_NOQUOTES, 'UTF-8')));
|
||||
|
||||
}
|
||||
|
||||
|
@ -832,9 +832,9 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
|||
|
||||
} else {
|
||||
|
||||
foreach (explode(' ', $resArray['collections']) as $_spec) {
|
||||
foreach (explode(' ', $resArray['collections']) as $spec) {
|
||||
|
||||
$header->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'setSpec', htmlspecialchars($_spec, ENT_NOQUOTES, 'UTF-8')));
|
||||
$header->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'setSpec', htmlspecialchars($spec, ENT_NOQUOTES, 'UTF-8')));
|
||||
|
||||
}
|
||||
|
||||
|
@ -1195,9 +1195,9 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
|||
} else {
|
||||
|
||||
// Add sets.
|
||||
foreach (explode(' ', $resArray['collections']) as $_spec) {
|
||||
foreach (explode(' ', $resArray['collections']) as $spec) {
|
||||
|
||||
$header->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'setSpec', htmlspecialchars($_spec, ENT_NOQUOTES, 'UTF-8')));
|
||||
$header->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'setSpec', htmlspecialchars($spec, ENT_NOQUOTES, 'UTF-8')));
|
||||
|
||||
}
|
||||
|
||||
|
@ -1224,7 +1224,7 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
|||
'metadataPrefix' => $this->piVars['metadataPrefix'],
|
||||
);
|
||||
|
||||
$_result = $GLOBALS['TYPO3_DB']->exec_INSERTquery(
|
||||
$result = $GLOBALS['TYPO3_DB']->exec_INSERTquery(
|
||||
'tx_dlf_tokens',
|
||||
array (
|
||||
'tstamp' => $GLOBALS['EXEC_TIME'],
|
||||
|
@ -1234,7 +1234,7 @@ 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'));
|
||||
|
||||
|
@ -1571,9 +1571,9 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
|||
} else {
|
||||
|
||||
// Add sets.
|
||||
foreach (explode(' ', $resArray['collections']) as $_spec) {
|
||||
foreach (explode(' ', $resArray['collections']) as $spec) {
|
||||
|
||||
$header->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'setSpec', htmlspecialchars($_spec, ENT_NOQUOTES, 'UTF-8')));
|
||||
$header->appendChild($this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'setSpec', htmlspecialchars($spec, ENT_NOQUOTES, 'UTF-8')));
|
||||
|
||||
}
|
||||
|
||||
|
@ -1629,7 +1629,7 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
|||
'metadataPrefix' => $this->piVars['metadataPrefix'],
|
||||
);
|
||||
|
||||
$_result = $GLOBALS['TYPO3_DB']->exec_INSERTquery(
|
||||
$result = $GLOBALS['TYPO3_DB']->exec_INSERTquery(
|
||||
'tx_dlf_tokens',
|
||||
array (
|
||||
'tstamp' => $GLOBALS['EXEC_TIME'],
|
||||
|
@ -1639,7 +1639,7 @@ 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'));
|
||||
|
||||
|
@ -1702,7 +1702,7 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
|||
|
||||
}
|
||||
|
||||
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||
'tx_dlf_collections.oai_name AS oai_name,tx_dlf_collections.label AS label',
|
||||
'tx_dlf_collections',
|
||||
'tx_dlf_collections.sys_language_uid IN (-1,0) AND tx_dlf_collections.pid='.intval($this->conf['pages']).$additionalWhere.tx_dlf_helper::whereClause('tx_dlf_collections'),
|
||||
|
@ -1711,7 +1711,7 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
|||
''
|
||||
);
|
||||
|
||||
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($_result)) {
|
||||
if (!$GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
|
||||
|
||||
return $this->error('noSetHierarchy');
|
||||
|
||||
|
@ -1720,7 +1720,7 @@ class tx_dlf_oai extends tx_dlf_plugin {
|
|||
// Add set list node.
|
||||
$ListSets = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'ListSets');
|
||||
|
||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($_result)) {
|
||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
||||
|
||||
// Add set node.
|
||||
$set = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'set');
|
||||
|
|
|
@ -207,7 +207,7 @@ class tx_dlf_search extends tx_dlf_plugin {
|
|||
|
||||
$toplevel = array ();
|
||||
|
||||
$check = array ();
|
||||
$checks = array ();
|
||||
|
||||
// Get metadata configuration.
|
||||
if ($numHits) {
|
||||
|
@ -293,7 +293,7 @@ class tx_dlf_search extends tx_dlf_plugin {
|
|||
|
||||
if (!in_array($doc->uid, $check)) {
|
||||
|
||||
$check[] = $doc->uid;
|
||||
$checks[] = $doc->uid;
|
||||
|
||||
}
|
||||
|
||||
|
@ -302,15 +302,15 @@ class tx_dlf_search extends tx_dlf_plugin {
|
|||
}
|
||||
|
||||
// Check if the toplevel documents have metadata.
|
||||
foreach ($check as $_check) {
|
||||
foreach ($checks as $check) {
|
||||
|
||||
if (empty($toplevel[$_check]['uid'])) {
|
||||
if (empty($toplevel[$check]['uid'])) {
|
||||
|
||||
// Get information for toplevel document.
|
||||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
|
||||
'tx_dlf_documents.uid AS uid,tx_dlf_documents.metadata AS metadata,tx_dlf_documents.metadata_sorting AS metadata_sorting',
|
||||
'tx_dlf_documents',
|
||||
'tx_dlf_documents.uid='.intval($_check).tx_dlf_helper::whereClause('tx_dlf_documents'),
|
||||
'tx_dlf_documents.uid='.intval($check).tx_dlf_helper::whereClause('tx_dlf_documents'),
|
||||
'',
|
||||
'',
|
||||
'1'
|
||||
|
@ -371,18 +371,18 @@ class tx_dlf_search extends tx_dlf_plugin {
|
|||
|
||||
}
|
||||
|
||||
$toplevel[$_check] = array (
|
||||
$toplevel[$check] = array (
|
||||
'uid' => $resArray['uid'],
|
||||
'page' => 1,
|
||||
'metadata' => $metadata,
|
||||
'sorting' => $sorting,
|
||||
'subparts' => $toplevel[$_check]['subparts']
|
||||
'subparts' => $toplevel[$check]['subparts']
|
||||
);
|
||||
|
||||
} else {
|
||||
|
||||
// Clear entry if there is no (accessible) toplevel document.
|
||||
unset ($toplevel[$_check]);
|
||||
unset ($toplevel[$check]);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -116,16 +116,16 @@ class tx_dlf_toc extends tx_dlf_plugin {
|
|||
|
||||
$entryArray['_SUB_MENU'] = array ();
|
||||
|
||||
foreach ($entry['children'] as $_child) {
|
||||
foreach ($entry['children'] as $child) {
|
||||
|
||||
// Set "ITEM_STATE" to "ACT" if this entry points to current page and has sub-entries pointing to the same page.
|
||||
if (in_array($_child['id'], $this->activeEntries)) {
|
||||
if (in_array($child['id'], $this->activeEntries)) {
|
||||
|
||||
$entryArray['ITEM_STATE'] = 'ACT';
|
||||
|
||||
}
|
||||
|
||||
$entryArray['_SUB_MENU'][] = $this->getMenuEntry($_child, TRUE);
|
||||
$entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, TRUE);
|
||||
|
||||
}
|
||||
|
||||
|
@ -234,18 +234,18 @@ class tx_dlf_toc extends tx_dlf_plugin {
|
|||
}
|
||||
|
||||
// Go through table of contents and create all menu entries.
|
||||
foreach ($this->doc->tableOfContents as $_entry) {
|
||||
foreach ($this->doc->tableOfContents as $entry) {
|
||||
|
||||
$menuArray[] = $this->getMenuEntry($_entry, TRUE);
|
||||
$menuArray[] = $this->getMenuEntry($entry, TRUE);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// Go through table of contents and create top-level menu entries.
|
||||
foreach ($this->doc->tableOfContents as $_entry) {
|
||||
foreach ($this->doc->tableOfContents as $entry) {
|
||||
|
||||
$menuArray[] = $this->getMenuEntry($_entry, FALSE);
|
||||
$menuArray[] = $this->getMenuEntry($entry, FALSE);
|
||||
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ class tx_dlf_toc extends tx_dlf_plugin {
|
|||
|
||||
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
|
||||
|
||||
$_entry = array (
|
||||
$entry = array (
|
||||
'label' => $resArray['title'],
|
||||
'type' => $resArray['type'],
|
||||
'volume' => $resArray['volume'],
|
||||
|
@ -284,7 +284,7 @@ class tx_dlf_toc extends tx_dlf_plugin {
|
|||
'targetUid' => $resArray['uid']
|
||||
);
|
||||
|
||||
$menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($_entry, FALSE);
|
||||
$menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, FALSE);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue