aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-26 21:08:18 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-26 21:08:18 +0000
commit585a1ba974329a2915fefeb67f62740f0cd0613e (patch)
treef33603bd0a187722d9fb83d3055f7e00bfd60a03
parent840b0d624556fcdab1372b99ad59bf18a5bd35eb (diff)
downloadelgg-585a1ba974329a2915fefeb67f62740f0cd0613e.tar.gz
elgg-585a1ba974329a2915fefeb67f62740f0cd0613e.tar.bz2
Graceful degrading for non-JS users on the dropdown login box.
git-svn-id: http://code.elgg.org/elgg/trunk@5887 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/users.php20
-rw-r--r--mod/blog/manifest.xml10
-rw-r--r--mod/riverdashboard/index.php10
-rw-r--r--mod/riverdashboard/manifest.xml16
-rw-r--r--mod/riverdashboard/start.php5
-rw-r--r--mod/riverdashboard/views/default/river/item/list.php1
-rw-r--r--views/default/account/forms/login_dropdown.php42
7 files changed, 64 insertions, 40 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 02b0f9027..9bb2a3f15 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1672,6 +1672,22 @@ function registration_page_handler($page_elements) {
}
/**
+ * Display a login box.
+ *
+ * This is a fallback for non-JS users who click on the
+ * dropdown login link.
+ */
+function elgg_user_login_page_handler() {
+ $content = elgg_view_layout('one_column', elgg_view('account/forms/login'));
+ $content = '
+ <div id="elgg_content" class="clearfloat">
+ ' . elgg_view('account/forms/login') . '
+ </div>
+ ';
+ page_draw('test', $content);
+}
+
+/**
* Sets the last action time of the given user to right now.
*
* @param int $user_guid The user GUID
@@ -1775,10 +1791,10 @@ function users_init() {
register_page_handler('friends', 'friends_page_handler');
register_page_handler('friendsof', 'friends_of_page_handler');
- //register_page_handler('collections', 'collections_page_handler');
register_page_handler('dashboard', 'dashboard_page_handler');
register_page_handler('register', 'registration_page_handler');
register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler');
+ register_page_handler('login', 'elgg_user_login_page_handler');
register_action("register", true);
register_action("useradd", true);
@@ -1873,4 +1889,4 @@ function users_test($hook, $type, $value, $params) {
//register actions *************************************************************
register_elgg_event_handler('init','system','users_init',0);
register_elgg_event_handler('pagesetup','system','users_pagesetup',0);
-register_plugin_hook('unit_test', 'system', 'users_test');
+register_plugin_hook('unit_test', 'system', 'users_test'); \ No newline at end of file
diff --git a/mod/blog/manifest.xml b/mod/blog/manifest.xml
index 483e83fab..a2ef59d0a 100644
--- a/mod/blog/manifest.xml
+++ b/mod/blog/manifest.xml
@@ -1,5 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin_manifest>
+ <field key="name" value="Blogs" />
+ <field key="category" value="utilities" />
+ <field key="screenshot" value="graphics/ss1.png" />
+ <field key="screenshot" value="graphics/ss2.png" />
+ <field key="provides" value="blog" />
+<!--
+ <field key="provides" value="pingbacks" />
+-->
+ <field key="conflicts" value="blog1" />
+ <field key="conflicts" value="blog2" />
<field key="author" value="Curverider" />
<field key="version" value="1.8" />
<field key="description" value="Elgg blog plugin" />
diff --git a/mod/riverdashboard/index.php b/mod/riverdashboard/index.php
index 758aa4018..371845213 100644
--- a/mod/riverdashboard/index.php
+++ b/mod/riverdashboard/index.php
@@ -7,25 +7,25 @@
require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');
gatekeeper();
-
+
$type = get_input('type');
$subtype = get_input('subtype');
$orient = get_input('display');
if(!$orient)
$orient = 'all';
$callback = get_input('callback');
-
+
if ($type == 'all') {
$type = '';
$subtype = '';
}
$body = '';
-
+
switch($orient) {
case 'mine':
$subject_guid = $_SESSION['user']->guid;
- $relationship_type = '';
+ $relationship_type = '';
$title_wording = elgg_echo('river:mine');
break;
case 'friends': $subject_guid = $_SESSION['user']->guid;
@@ -49,7 +49,7 @@ else
// Replacing callback calls in the nav with something meaningless
$river = str_replace('callback=true','replaced=88,334',$river);
-
+
$nav = elgg_view('riverdashboard/nav',array('type' => $type,'subtype' => $subtype,'orient' => $orient));
if(isloggedin()){
$sidebar = elgg_view("riverdashboard/menu",array('type' => $type,'subtype' => $subtype,'orient' => $orient));
diff --git a/mod/riverdashboard/manifest.xml b/mod/riverdashboard/manifest.xml
index a29af8a61..24133b7d4 100644
--- a/mod/riverdashboard/manifest.xml
+++ b/mod/riverdashboard/manifest.xml
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<plugin_manifest>
- <field key="author" value="Curverider Ltd" />
- <field key="version" value="1.0" />
- <field key="description" value="Elgg river for use with v1.7 onward." />
- <field key="website" value="http://www.elgg.org/" />
- <field key="copyright" value="(C) Curverider 2010" />
- <field key="licence" value="GNU Public License version 2" />
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin_manifest>
+ <field key="author" value="Curverider Ltd" />
+ <field key="version" value="1.0" />
+ <field key="description" value="Elgg river for use with v1.7 onward." />
+ <field key="website" value="http://www.elgg.org/" />
+ <field key="copyright" value="(C) Curverider 2010" />
+ <field key="licence" value="GNU Public License version 2" />
</plugin_manifest> \ No newline at end of file
diff --git a/mod/riverdashboard/start.php b/mod/riverdashboard/start.php
index b95c2654d..9f64f4c9d 100644
--- a/mod/riverdashboard/start.php
+++ b/mod/riverdashboard/start.php
@@ -26,15 +26,10 @@ function riverdashboard_init() {
* @param unknown_type $page
*/
function riverdashboard_page_handler($page){
- global $CONFIG;
include(dirname(__FILE__) . "/index.php");
return true;
}
-function riverdashboard_dashboard() {
- include(dirname(__FILE__) . '/index.php');
-}
-
/**
* For users to make a comment on a river item
*
diff --git a/mod/riverdashboard/views/default/river/item/list.php b/mod/riverdashboard/views/default/river/item/list.php
index 0c0d7a4db..e7e1a9c07 100644
--- a/mod/riverdashboard/views/default/river/item/list.php
+++ b/mod/riverdashboard/views/default/river/item/list.php
@@ -1,4 +1,5 @@
<?php
+
if (isset($vars['items']) && is_array($vars['items'])) {
$i = 0;
diff --git a/views/default/account/forms/login_dropdown.php b/views/default/account/forms/login_dropdown.php
index 1e7ae4dc2..352e32e60 100644
--- a/views/default/account/forms/login_dropdown.php
+++ b/views/default/account/forms/login_dropdown.php
@@ -1,13 +1,13 @@
<?php
/**
* Elgg drop-down login form
-*
+*
*/
-
- if (!isloggedin()){
-
+
+if (!isloggedin()){
+
global $CONFIG;
-
+
$form_body = "<p class='loginbox'><label>" . elgg_echo('username') . "</label>" . elgg_view('input/text', array('internalname' => 'username', 'class' => 'login_textarea name'));
$form_body .= "<label>" . elgg_echo('password') . "</label>" . elgg_view('input/password', array('internalname' => 'password', 'class' => 'login_textarea'));
$form_body .= elgg_view('input/submit', array('value' => elgg_echo('login'))) . " <span class='remember'><label><input type=\"checkbox\" name=\"persistent\" value=\"true\" />".elgg_echo('user:persistent')."</label></span></p>";
@@ -16,17 +16,18 @@
$form_body .= "<p class='loginbox'>";
$form_body .= (!isset($CONFIG->disable_registration) || !($CONFIG->disable_registration)) ? "<a href=\"{$vars['url']}account/register.php\">" . elgg_echo('register') . "</a> | " : "";
- $form_body .= "<a href=\"{$vars['url']}account/forgotten_password.php\">" . elgg_echo('user:password:lost') . "</a></p>";
+ $form_body .= "<a href=\"{$vars['url']}account/forgotten_password.php\">" . elgg_echo('user:password:lost') . "</a></p>";
$form_body .= "<input type='hidden' name='returntoreferer' value='true' />";
$login_url = $vars['url'];
- if ((isset($CONFIG->https_login)) && ($CONFIG->https_login))
+ if ((isset($CONFIG->https_login)) && ($CONFIG->https_login)) {
$login_url = str_replace("http", "https", $vars['url']);
+ }
?>
-
+
<div id="login_dropdown">
<div id="signin_button" class="signin_button">
- <a href="login" class="signin"><span><?php echo elgg_echo('login') ?></span></a>
+ <a href="<?php echo $CONFIG->url; ?>pg/login" class="signin"><span><?php echo elgg_echo('login') ?></span></a>
</div>
<fieldset id="signin_menu">
<?php
@@ -36,30 +37,30 @@
</div>
<?php
- }
+}
?>
<script type="text/javascript">
$(document).ready(function() {
- $(".signin").click(function(e) {
+ $(".signin").click(function(e) {
e.preventDefault();
- $("fieldset#signin_menu").toggle();
+ $("fieldset#signin_menu").toggle();
$(".signin").toggleClass("menu_open");
$('.login_textarea.name').focus();
- });
-
+ });
+
$("fieldset#signin_menu").mouseup(function() {
return false
});
-
+
$(document).mouseup(function(e) {
if($(e.target).parent("a.signin").length==0) {
$(".signin").removeClass("menu_open");
$("fieldset#signin_menu").hide();
}
- });
-
+ });
+
});
</script>
@@ -127,8 +128,8 @@ $(document).ready(function() {
border:5px solid #CCCCCC;
text-align:left;
padding:12px;
- top: 26px;
- right: 0px;
+ top: 26px;
+ right: 0px;
margin-top:5px;
margin-right: 0px;
color:#333333;
@@ -150,9 +151,10 @@ $(document).ready(function() {
#login_dropdown #signin_menu .submit_button {
margin-right:15px;
}
+
/* ie7 fixes */
*:first-child+html #login_dropdown #signin_button {
- line-height:10px;
+ line-height:10px;
}
*:first-child+html #login_dropdown #signin_button a.signin span {
background-position:-150px -54px;