Revision: 1919
Author: andreassolberg
Date: Tue Oct 27 00:44:01 2009
Log: Now sets preferred IdP button in focus when available, and if not
available sets focus to incremental search field
http://code.google.com/p/simplesamlphp/source/detail?r=1919
Modified:
/trunk/modules/discopower/templates/disco-tpl.php
=======================================
--- /trunk/modules/discopower/templates/disco-tpl.php Tue Oct 20 03:18:26
2009
+++ /trunk/modules/discopower/templates/disco-tpl.php Tue Oct 27 00:44:01
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
-~----------~----~----~----~------~----~------~--~---