-
Notifications
You must be signed in to change notification settings - Fork 13
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
Showing
19 changed files
with
214 additions
and
168 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
namespace EWW\Dpf\Controller; | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
use EWW\Dpf\Domain\Model\InputOptionList; | ||
use EWW\Dpf\Services\FeUser\GndDataService; | ||
|
||
/** | ||
* DataServiceAjaxController | ||
*/ | ||
class DataServiceAjaxController extends \EWW\Dpf\Controller\AbstractController | ||
{ | ||
/** | ||
* @param string $searchTerm | ||
* @return false|string | ||
*/ | ||
public function searchGndKeywordAction(string $searchTerm) { | ||
$gndUserDataService = new GndDataService(); | ||
$result = $gndUserDataService->searchKeywordRequest($searchTerm); | ||
|
||
$listArray = array(); | ||
$i = 0; | ||
foreach ($result as $value) { | ||
$listArray[$i]['value'] = $value->label; | ||
$listArray[$i]['label'] = htmlentities($value->label); | ||
$listArray[$i]['key'] = $value->id; | ||
$i++; | ||
} | ||
|
||
return json_encode($listArray); | ||
} | ||
|
||
/** | ||
* @param InputOptionList $inputOptionList | ||
* @param string $searchTerm | ||
* @return false|string | ||
*/ | ||
public function autocompleteAction(InputOptionList $inputOptionList, string $searchTerm) | ||
{ | ||
$listArray = array(); | ||
$i = 0; | ||
|
||
if ( | ||
!empty( | ||
$arr = preg_grep( | ||
'/.*?'.$searchTerm.'.*?/i', $inputOptionList->getInputOptions() | ||
) | ||
) | ||
) { | ||
foreach ($arr as $key => $value) { | ||
$listArray[$i]['value'] = $value; | ||
$listArray[$i]['label'] = htmlentities($value); | ||
$listArray[$i]['key'] = $key; | ||
$i++; | ||
} | ||
} | ||
|
||
return json_encode($listArray); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.