Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
18b4f9e7
Commit
18b4f9e7
authored
Dec 24, 2010
by
Richard Mansfield
Browse files
Revert "Rewrite blog link in menu when changing multipleblogs setting (bug #691548)"
This reverts commit
d8e97612
.
parent
09c7e038
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/account/index.php
View file @
18b4f9e7
...
...
@@ -192,7 +192,7 @@ $prefsform = array(
'jsform'
=>
true
,
'plugintype'
=>
'core'
,
'pluginname'
=>
'account'
,
'jssuccesscallback'
=>
'
accountPrefsSucces
s'
,
'jssuccesscallback'
=>
'
clearPassword
s'
,
'elements'
=>
$elements
);
...
...
@@ -266,19 +266,14 @@ function accountprefs_submit(Pieform $form, $values) {
update_send_count
(
$u
,
true
);
}
$returndata
=
array
();
if
(
isset
(
$values
[
'multipleblogs'
]))
{
if
((
bool
)
$USER
->
get_account_preference
(
'multipleblogs'
)
!==
(
bool
)
$values
[
'multipleblogs'
])
{
$returndata
[
'multipleblogs'
]
=
$values
[
'multipleblogs'
]
?
'on'
:
'off'
;
// Rewrite the blogs link in the menu
}
}
foreach
(
array_keys
(
$expectedprefs
)
as
$pref
)
{
if
(
isset
(
$values
[
$pref
]))
{
$USER
->
set_account_preference
(
$pref
,
$values
[
$pref
]);
}
}
$returndata
=
array
();
if
(
isset
(
$values
[
'username'
])
&&
$values
[
'username'
]
!=
$USER
->
get
(
'username'
))
{
$USER
->
username
=
$values
[
'username'
];
$USER
->
commit
();
...
...
@@ -298,7 +293,7 @@ $smarty = smarty();
$smarty
->
assign
(
'form'
,
$prefsform
);
$smarty
->
assign
(
'candeleteself'
,
$USER
->
can_delete_self
());
$smarty
->
assign
(
'INLINEJAVASCRIPT'
,
"
function
accountPrefsSucces
s(form, data) {
function
clearPassword
s(form, data) {
formSuccess(form, data);
if ($('accountprefs_oldpassword')) {
$('accountprefs_oldpassword').value = '';
...
...
@@ -309,14 +304,6 @@ function accountPrefsSuccess(form, data) {
var username = getFirstElementByTagAndClassName('a', null, 'profile-sideblock-username');
replaceChildNodes(username, data.username);
}
if (data.multipleblogs) {
var newhref = data.multipleblogs == 'on' ? 'artefact/blog/' : 'artefact/blog/view/';
forEach(getElementsByTagAndClassName('a', null, 'main-nav'), function (link) {
if (getNodeAttribute(link, 'href').match(new RegExp('/artefact/blog/'))) {
setNodeAttribute(link, 'href', config.wwwroot + newhref);
}
});
}
}
"
);
$smarty
->
assign
(
'PAGEHEADING'
,
TITLE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment