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
a3c602c8
Commit
a3c602c8
authored
Oct 22, 2008
by
Richard Mansfield
Browse files
Update profile sideblock on username change
parent
9bafc473
Changes
2
Show whitespace changes
Inline
Side-by-side
htdocs/account/index.php
View file @
a3c602c8
...
...
@@ -205,13 +205,17 @@ function accountprefs_submit(Pieform $form, $values) {
}
}
$returndata
=
array
();
if
(
isset
(
$values
[
'username'
])
&&
$values
[
'username'
]
!=
$USER
->
get
(
'username'
))
{
$USER
->
username
=
$values
[
'username'
];
$USER
->
commit
();
$returndata
[
'username'
]
=
$values
[
'username'
];
}
db_commit
();
$form
->
json_reply
(
PIEFORM_OK
,
get_string
(
'prefssaved'
,
'account'
));
$returndata
[
'message'
]
=
get_string
(
'prefssaved'
,
'account'
);
$form
->
json_reply
(
PIEFORM_OK
,
$returndata
);
}
...
...
@@ -227,7 +231,12 @@ function clearPasswords(form, data) {
$('accountprefs_password1').value = '';
$('accountprefs_password2').value = '';
}
}"
);
if (data.username) {
var username = getFirstElementByTagAndClassName('a', null, 'profile-sideblock-username');
replaceChildNodes(username, data.username);
}
}
"
);
$smarty
->
assign
(
'heading'
,
get_string
(
'preferences'
));
$smarty
->
display
(
'account/index.tpl'
);
...
...
htdocs/theme/default/templates/sideblocks/profile.tpl
View file @
a3c602c8
<h3><a
href=
"
{
$WWWROOT
}
user/view.php?id=
{
$data.id
}
"
>
{
$data.myname
|
escape
}
</a>
<span
class=
"s"
>
(
<a
href=
"
{
$WWWROOT
}
user/view.php?id=
{
$data.id
}
"
>
{
$data.username
|
escape
}
</a>
)
</span></h3>
<h3><a
href=
"
{
$WWWROOT
}
user/view.php?id=
{
$data.id
}
"
>
{
$data.myname
|
escape
}
</a>
<span
class=
"s"
id=
"profile-sideblock-username"
>
(
<a
href=
"
{
$WWWROOT
}
user/view.php?id=
{
$data.id
}
"
>
{
$data.username
|
escape
}
</a>
)
</span></h3>
<div
class=
"fr"
><a
href=
"
{
$WWWROOT
}
user/view.php?id=
{
$data.id
}
"
><div
class=
"center"
style=
"width: 50px; height: 50px;"
><img
src=
"
{
$WWWROOT
}
thumb.php?type=profileiconbyid&maxwidth=50&maxheight=50&id=
{
$data.profileicon
}
"
alt=
""
></div></a></div>
{
if
$data.mnetloggedinfrom
}
<p>
{
$data.mnetloggedinfrom
}
</p>
{/
if
}
<ul
class=
"sidebar-ul-title"
>
...
...
Write
Preview
Supports
Markdown
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