Commit 49a24d94 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Move restore home page info instructions to the session message area (bug #620261)


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 5bb0b8c8
......@@ -63,9 +63,12 @@ if ($USER->is_logged_in()) {
if ($USER->get_account_preference('showhomeinfo')) {
// allow the user to choose never to see the info boxes again
$strhowtodisable = json_encode(get_string('howtodisable', 'mahara', get_config('wwwroot') . 'account'));
$js = <<<JAVASCRIPT
function hideinfo() {
slideUp($('home-info-container'));
var m = SPAN();
m.innerHTML = {$strhowtodisable};
slideUp('home-info-container', {afterFinish: function() {displayMessage(m, 'ok');}});
}
function nevershow() {
......@@ -73,12 +76,7 @@ function nevershow() {
sendjsonrequest('homeinfo.json.php', data, 'POST', hideinfo);
}
addLoadEvent(function () {
hideElement($('home-info-help'));
showElement($('hideinfo'));
$('hideinfo').onclick = nevershow;
connect('hideinfo', 'onmouseenter', function(e) {
if ($('home-info-help').style.display == 'none') blindDown('home-info-help', {'duration': 0.25});
});
});
JAVASCRIPT;
......@@ -103,7 +101,6 @@ $urls = array(
'views' => $wwwroot . 'view',
'friends' => $wwwroot . 'user/find.php',
'groups' => $wwwroot . 'group/find.php',
'settings'=> $wwwroot . 'account',
);
$smarty->assign('url', $urls);
......
......@@ -927,5 +927,5 @@ $string['sharenetworksubtitle'] = 'Meet friends and join groups';
$string['findfriendslinked'] = 'Find <a href="%s">Friends</a>';
$string['joingroups'] = 'Join <a href="%s">Groups</a>';
$string['sharenetworkdescription'] = 'You can fine-tune who has access to each view, and for how long.';
$string['howtodisable'] = '* You may control this box visibility in <a href="%s">Settings</a>.';
$string['howtodisable'] = 'You have hidden the information box. You can control its visibility in <a href="%s">Settings</a>.';
?>
......@@ -1965,7 +1965,6 @@ form#search, form#filter, div.searchform {
margin: 0 -4px;
position: relative;
float: right;
display: none;
}
.home-info-table td {
width: 1%;
......
......@@ -63,7 +63,7 @@
</div>
</td>
<td>
{if $USER->is_logged_in()}<div id="hideinfo"><a title="{str tag=Hide}"><img src="{theme_url filename='images/icon_close.gif'}" alt="[x]" /></a></div>{/if}
{if $USER->is_logged_in()}<div id="hideinfo" class="nojs-hidden-block"><a title="{str tag=Hide}"><img src="{theme_url filename='images/icon_close.gif'}" alt="[x]" /></a></div>{/if}
<div class="home-info home-info-3">
<div class="home-info-inner">
<h3>{str tag=sharenetwork}</h3>
......@@ -91,12 +91,5 @@
</div>
</td>
</tr>
<tr>
<td colspan="3">
<div id="home-info-help" class="s">
{if $USER->is_logged_in()}{assign var=s value="howtodisable"|str:mahara:$url.settings}{$s|safe}{/if}
</div>
</td>
</tr>
</table>
</div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment