@@ -309,7 +309,7 @@ public function handleRequest(): void
309309 $ t ->data ['entityID ' ] = $ this ->spEntityId ;
310310 $ t ->data ['defaulttab ' ] = $ this ->discoconfig ->getValue ('defaulttab ' , 0 );
311311
312- $ idpList = $ this ->processMetadata ($ t , $ idpList, $ preferredIdP );
312+ $ idpList = $ this ->processMetadata ($ t , $ idpList );
313313
314314 $ t ->data ['idplist ' ] = $ idpList ;
315315 $ t ->data ['faventry ' ] = null ;
@@ -353,65 +353,22 @@ public function handleRequest(): void
353353 /**
354354 * @param \SimpleSAML\XHTML\Template $t
355355 * @param array $metadata
356- * @param string|null $favourite
357356 * @return array
358357 */
359- private function processMetadata (Template $ t , array $ metadata, ? string $ favourite ): array
358+ private function processMetadata (Template $ t , array $ metadata ): array
360359 {
361360 $ basequerystring = '? ' .
362361 'entityID= ' . urlencode ($ t ->data ['entityID ' ]) . '& ' .
363362 'return= ' . urlencode ($ t ->data ['return ' ]) . '& ' .
364363 'returnIDParam= ' . urlencode ($ t ->data ['returnIDParam ' ]) . '&idpentityid= ' ;
365364
366- $ translator = $ t ->getTranslator ();
367365 $ httpUtils = new Utils \HTTP ();
368366 foreach ($ metadata as $ tab => $ idps ) {
369367 foreach ($ idps as $ entityid => $ entity ) {
370- $ translation = false ;
371-
372- // Translate name
373- if (isset ($ entity ['UIInfo ' ]['DisplayName ' ])) {
374- $ displayName = $ entity ['UIInfo ' ]['DisplayName ' ];
375-
376- // Should always be an array of language code -> translation
377- Assert::isArray ($ displayName );
378-
379- if (!empty ($ displayName )) {
380- $ translation = $ translator ->getPreferredTranslation ($ displayName );
381- }
382- }
383-
384- if (($ translation === false ) && array_key_exists ('name ' , $ entity )) {
385- if (is_array ($ entity ['name ' ])) {
386- $ translation = $ translator ->getPreferredTranslation ($ entity ['name ' ]);
387- } else {
388- $ translation = $ entity ['name ' ];
389- }
390- }
391-
392- if ($ translation === false ) {
393- $ translation = $ entity ['entityid ' ];
394- }
395- $ entity ['translated ' ] = $ translation ;
396-
397- // HTML output
398- if ($ entity ['entityid ' ] === $ favourite ) {
399- $ html = '<a class="metaentry favourite" href=" ' .
400- $ basequerystring . urlencode ($ entity ['entityid ' ]) . '"> ' ;
401- } else {
402- $ html = '<a class="metaentry" href=" ' .
403- $ basequerystring . urlencode ($ entity ['entityid ' ]) . '"> ' ;
404- }
405- $ html .= $ entity ['translated ' ];
368+ $ entity ['actionUrl ' ] = $ basequerystring . urlencode ($ entity ['entityid ' ]);
406369 if (array_key_exists ('icon ' , $ entity ) && $ entity ['icon ' ] !== null ) {
407- $ iconUrl = $ httpUtils ->resolveURL ($ entity ['icon ' ]);
408- $ html .= '<img alt="Icon for identity provider" class="entryicon" src=" ' .
409- htmlspecialchars ($ iconUrl ) . '" /> ' ;
370+ $ entity ['iconUrl ' ] = $ httpUtils ->resolveURL ($ entity ['icon ' ]);
410371 }
411- $ html .= '</a> ' ;
412- $ entity ['html ' ] = $ html ;
413-
414- // Save processed data
415372 $ metadata [$ tab ][$ entityid ] = $ entity ;
416373 }
417374 }
0 commit comments