Revision: 1925 Author: olavmrk Date: Tue Oct 27 06:57:27 2009 Log: Now sets preferred IdP button in focus when available, and if not available sets focus to incremental search field
Merged into 1.5 branch from r1919. http://code.google.com/p/simplesamlphp/source/detail?r=1925 Modified: /branches/simplesamlphp-1.5/modules/discopower/templates/disco-tpl.php ======================================= --- /branches/simplesamlphp-1.5/modules/discopower/templates/disco-tpl.php Tue Oct 20 03:18:26 2009 +++ /branches/simplesamlphp-1.5/modules/discopower/templates/disco-tpl.php Tue Oct 27 06:57:27 2009 @@ -1,5 +1,17 @@ <?php + +$faventry = NULL; +foreach( $this->data['idplist'] AS $tab => $slist) { + if (!empty($this->data['preferredidp']) && array_key_exists($this->data['preferredidp'], $slist)) + $faventry = $slist[$this->data['preferredidp']]; +} + + + + + + if(!array_key_exists('header', $this->data)) { $this->data['header'] = 'selectidp'; } @@ -19,7 +31,7 @@ $i = 0; foreach ($this->data['idplist'] AS $tab => $slist) { $this->data['head'] .= "\n" . '$("#query_' . $tab . '").liveUpdate("#list_' . $tab . '")' . - ($i++ == 0 ? '.focus()' : '') . + (($i++ == 0) && (empty($faventry)) ? '.focus()' : '') . ';'; @@ -30,7 +42,11 @@ </script>'; -# $this->data['autofocus'] = 'preferredidp'; + + + + +if (!empty($faventry)) $this->data['autofocus'] = 'favouritesubmit'; $this->includeAtTemplateBase('includes/header.php'); @@ -97,11 +113,6 @@ } -$faventry = NULL; -foreach( $this->data['idplist'] AS $tab => $slist) { - if (!empty($this->data['preferredidp']) && array_key_exists($this->data['preferredidp'], $slist)) - $faventry = $slist[$this->data['preferredidp']]; -} if (!empty($faventry)) { @@ -117,7 +128,7 @@ <input type="hidden" name="returnIDParam" value="' . htmlspecialchars($this->data['returnIDParam']) . '" /> <input type="hidden" name="idpentityid" value="' . htmlspecialchars($faventry['entityid']) . '" /> - <input type="submit" style="" name="formsubmit" id="formsubmit" value="' . $this->t('login_at') . ' ' . getTranslatedName($this, $faventry) . '" /> + <input type="submit" name="formsubmit" id="favouritesubmit" value="' . $this->t('login_at') . ' ' . getTranslatedName($this, $faventry) . '" /> </form>'); echo('</div>'); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "simpleSAMLphp commits" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/simplesamlphp-commits?hl=en -~----------~----~----~----~------~----~------~--~---
