Skip to content

Commit 254533e

Browse files
committed
Martin Yde - Changed display of form
1 parent 532a354 commit 254533e

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

loop_saml.module

+16-7
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,24 @@ function loop_saml_form_user_login_alter(&$form, &$form_state) {
8282
$idp = saml_sp_idp_load($idp_selection);
8383

8484
$options = array('query' => array('returnTo' => url('user')));
85-
$items[] = array(
86-
'data' => l(t('Log in using @idp_name', array('@idp_name' => $idp->name)), 'saml/drupal_login', $options),
85+
$items['link'] = array(
86+
'content' => l(t('Log in using @idp_name', array('@idp_name' => $idp->name)), 'saml/drupal_login', $options),
8787
'class' => array('saml-link'),
8888
);
8989

90-
$form['saml_sp_drupal_login_links'] = array(
91-
'#theme' => 'item_list',
92-
'#items' => $items,
93-
'#attributes' => array('class' => array('saml_sp_drupal_login-links')),
94-
'#weight' => 1,
90+
$form['name']['#prefix'] = theme('loop_saml_prefix_login', $items);
91+
unset($form['saml_sp_drupal_login_links']);
92+
}
93+
94+
/**
95+
* Implements hook_theme().
96+
*/
97+
function loop_saml_theme() {
98+
return array(
99+
'loop_saml_prefix_login' => array(
100+
'variables' => array(),
101+
'template' => 'templates/loop-saml--prefix-login',
102+
),
95103
);
96104
}
97105

@@ -114,3 +122,4 @@ function _loop_saml_setup_account($account, $attributes) {
114122
$wrapper->field_last_name->set($names[1]);
115123
$wrapper->save();
116124
}
125+
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/**
3+
* @file
4+
* loop-saml--prefix-login.tpl.php
5+
* My content block for user account
6+
*
7+
* Available variables:
8+
* - $link
9+
*/
10+
11+
?>
12+
<div class="user-profile--login-text">
13+
<?php if (!empty($link)) : ?>
14+
<p class="user-profile--login-link button--action"><?php print $link['content']; ?></p>
15+
<p><?php print t('If you are an external user without an AZ-ident, use the form below to login.');?></p>
16+
<?php endif;?>
17+
</div>

0 commit comments

Comments
 (0)