aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-09-22 05:06:19 +0200
committerSem <sembrestels@riseup.net>2012-09-22 05:06:19 +0200
commite69825051c3d19f188e68801ba945c1cd8b8cfdd (patch)
tree356d890af39dc2798ceb3b83e79a2078062d6b5e /views
parent1c1fe3b50e5a3297115c57543932a210d585a539 (diff)
downloadelgg-e69825051c3d19f188e68801ba945c1cd8b8cfdd.tar.gz
elgg-e69825051c3d19f188e68801ba945c1cd8b8cfdd.tar.bz2
Removed comercial openid providers and refactored openid login form.
Diffstat (limited to 'views')
-rw-r--r--views/default/forms/openid_client/login.php42
-rw-r--r--views/default/openid_client/css.php51
-rw-r--r--views/default/openid_client/js.php22
-rw-r--r--views/default/openid_client/login.php18
4 files changed, 56 insertions, 77 deletions
diff --git a/views/default/forms/openid_client/login.php b/views/default/forms/openid_client/login.php
index eba6dbe4b..1f440dc49 100644
--- a/views/default/forms/openid_client/login.php
+++ b/views/default/forms/openid_client/login.php
@@ -3,11 +3,41 @@
* OpenID login if username or full url required
*/
-echo '<label>';
-echo elgg_echo('username');
-echo '</label>';
-echo elgg_view('input/text', array('name' => 'openid_username', 'class' => 'mbs'));
+$options_values = array_flip(elgg_get_config('openid_providers'));
+$options_values['others'] = elgg_echo('openid_client:others');
-echo elgg_view('input/hidden', array('name' => 'openid_provider'));
+?>
+<div>
+<label><?php echo elgg_echo('openid_client:login:header'); ?></label>
+<br />
+<?php
+echo elgg_view('input/dropdown', array(
+ 'name' => 'openid_provider',
+ 'options_values' => $options_values,
+));
+?>
+</div>
+
+<div class="openid-client-url hidden">
+<label><?php echo elgg_echo('openid_client:url'); ?> </label>
+
+<?php
+echo elgg_view('input/text', array('name' => 'openid_url', 'class' => 'mbs'));
+?>
+
+</div>
-echo elgg_view('input/submit', array('value' => elgg_echo('submit'))); \ No newline at end of file
+<div class="elgg-foot">
+ <label class="mtm float-alt">
+ <input type="checkbox" name="persistent" value="true" />
+ <?php echo elgg_echo('user:persistent'); ?>
+ </label>
+
+ <?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?>
+
+ <?php
+ if (isset($vars['returntoreferer'])) {
+ echo elgg_view('input/hidden', array('name' => 'returntoreferer', 'value' => 'true'));
+ }
+ ?>
+</div> \ No newline at end of file
diff --git a/views/default/openid_client/css.php b/views/default/openid_client/css.php
index 900de7e6e..d01fc6b5a 100644
--- a/views/default/openid_client/css.php
+++ b/views/default/openid_client/css.php
@@ -2,53 +2,12 @@
/**
* OpenID client CSS
*/
-
-$site_url = elgg_get_site_url();
-
?>
-.openid-client-login-or {
- margin-top: 5px;
- text-align: center;
- color: #333;
-}
-
-.elgg-menu-openid-login {
- text-align: center;
-}
-
-.elgg-menu-openid-login > li {
- margin: 3px;
-}
-
-.elgg-menu-openid-login span {
- display: block;
- background: url("<?php echo $site_url; ?>mod/openid_client/graphics/openid_providers.png") no-repeat left;
- border: 1px solid #ccc;
-}
-
-.elgg-menu-openid-login-large span {
- height: 32px;
- width: 92px;
+.elgg-icon-openid {
+ background-image: url(<?php echo elgg_get_site_url(); ?>mod/openid_client/graphics/openid_icon.png);
}
-.elgg-menu-openid-login-small span {
- height: 20px;
- width: 20px;
-}
-
-.elgg-menu-item-google span {
- background-position: -5px -14px;
-}
-
-.elgg-menu-openid-login-large > .elgg-menu-item-yahoo span {
- background-position: -105px -14px;
-}
-
-.elgg-menu-item-blogger span {
- background-position: -170px -62px;
-}
-
-.elgg-menu-item-wordpress span {
- background-position: -146px -62px;
-}
+.elgg-form-login {
+ margin-bottom: 10px;
+} \ No newline at end of file
diff --git a/views/default/openid_client/js.php b/views/default/openid_client/js.php
index 175577719..171215593 100644
--- a/views/default/openid_client/js.php
+++ b/views/default/openid_client/js.php
@@ -7,12 +7,20 @@
// OpenID toggle
elgg.register_hook_handler('init', 'system', function() {
- $(".openid-client-toggle").click(function(event) {
- $("#openid-client-login-form").slideDown();
-
- var provider_input = $("#openid-client-login-form input[name=openid_provider]");
- provider_input.attr('value', $(this).attr('rel'));
-
- event.preventDefault();
+ $('.openid-login-icon').click(function(e) {
+ var openid_box = $(this).prev('.elgg-form-openid-client-login');
+ var shown = openid_box.is(':visible') ? openid_box : openid_box.prev();
+ var hidden = !openid_box.is(':visible') ? openid_box : openid_box.prev();
+ shown.fadeOut(function() {
+ hidden.fadeIn();
+ });
+ e.preventDefault();
+ });
+ $(".elgg-form-openid-client-login [name='openid_provider']").change(function(event) {
+ if (this.value == 'others') {
+ $(".openid-client-url").slideDown().find('input').focus();
+ } else {
+ $(".openid-client-url").slideUp();
+ }
});
});
diff --git a/views/default/openid_client/login.php b/views/default/openid_client/login.php
deleted file mode 100644
index 30685fe51..000000000
--- a/views/default/openid_client/login.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-/**
- * OpenID client login choices
- */
-
-echo '<h3 class="openid-client-login-or">' . elgg_echo('openid_client:or:header') . '</h3>';
-echo '<h3>' . elgg_echo('openid_client:login:header') . '</h3>';
-
-echo elgg_view_menu('openid_login', array(
- 'class' => 'elgg-menu-hz',
- 'sort_by' => 'priority',
-));
-
-$form_vars = array(
- 'class' => 'hidden',
- 'id' => 'openid-client-login-form',
-);
-echo elgg_view_form('openid_client/login', $form_vars);