-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Schleevoigt
committed
Nov 26, 2019
1 parent
98b8ed3
commit 9d8c53e
Showing
5 changed files
with
86 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
<?php | ||
|
||
namespace Subhh\Hosfindfacetviews\Utility\OpenGraph; | ||
namespace Subhh\Hosfindfacetviews\Utility\Ajax; | ||
|
||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Frontend\Utility\EidUtility; | ||
use Vendor\Hosfindfacetviews\Utility\OpenGraph; | ||
|
||
$og = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Subhh\\Hosfindfacetviews\\Utility\\OpenGraph\\OpenGraphLib'); | ||
$graph = $og::fetch(GeneralUtility::_GET('site')); | ||
return json_encode($graph); | ||
|
||
$og = GeneralUtility::makeInstance('Subhh\Hosfindfacetviews\Utility\OpenGraph\OpenGraph'); | ||
$og->main(); | ||
|
||
class GetOpenGraph { | ||
function main(){ | ||
$graph = $og::fetch(GeneralUtility::_GET('site')); | ||
return json_encode($graph); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
/* * ************************************************************* | ||
* Copyright notice | ||
* | ||
* (c) 2019 Rainer Schleevoigt <[email protected]> | ||
* Hamburg State and University Library | ||
* | ||
* All rights reserved | ||
* | ||
* This script is part of the TYPO3 project. The TYPO3 project is | ||
* free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* The GNU General Public License can be found at | ||
* http://www.gnu.org/copyleft/gpl.html. | ||
* | ||
* This script is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* This copyright notice MUST APPEAR in all copies of the script! | ||
* ************************************************************* */ | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Frontend\Utility\EidUtility; | ||
|
||
|
||
function getOptionsFromTS() { | ||
/** @var TypoScriptFrontendController $tsfc */ | ||
$tsfc = GeneralUtility::makeInstance( | ||
'TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', | ||
$GLOBALS['TYPO3_CONF_VARS'], | ||
GeneralUtility::_GET('id') ? : 1, | ||
0, | ||
true | ||
); | ||
$GLOBALS['TSFE'] = $tsfc; | ||
$tsfc->fe_user = EidUtility::initFeUser(); | ||
$tsfc->determineId(); | ||
//$tsfc->getCompressedTCarray(); | ||
$tsfc->initTemplate(); | ||
$tsfc->getConfigArray(); | ||
|
||
/** @var TypoScriptService $typoScriptService */ | ||
$typoScriptService = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService'); | ||
try { | ||
$typoscriptArray = $tsfc->tmpl->setup['plugin.']['tx_find.']['settings.']['connections.']['default.']['options.']; | ||
$token = $typoScriptService->convertTypoScriptArrayToPlainArray($typoscriptArray); | ||
return $token; | ||
} catch (Exception $e) { | ||
error_log("Missing TS parameter `plugin.tx_find.settings.connections.options`"); | ||
return ""; | ||
} | ||
return ""; | ||
} | ||
|
||
$opts = getOptionsFromTS(); | ||
$action= 'select'; | ||
$ACTIONS = ['select','suggest','query','browse','spell','tvrh','elevate','terms']; | ||
|
||
|
||
$params = 'q=*:*'; | ||
foreach ($ACTIONS as $action) { | ||
$params = GeneralUtility::_GET($action); | ||
if ($params) { | ||
$url = $opts['scheme']. '://'.$opts['host'] .':' .$opts['port'] . $opts['path'] . '/' | ||
. $action . '?'. urldecode($params); | ||
header('Content-type: application/json'); | ||
// echo $url; | ||
system('wget -qO- \''. $url.'\''); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters