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
4ea632ff
Commit
4ea632ff
authored
Feb 16, 2009
by
Richard Mansfield
Browse files
Add about me block to profile views (feature req 3093)
parent
467e7116
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/auth/user.php
View file @
4ea632ff
...
...
@@ -423,6 +423,28 @@ class User {
'title'
=>
get_field
(
'view'
,
'title'
,
'id'
,
$systemprofileviewid
),
'type'
=>
'profile'
,
),
$systemprofileviewid
,
$this
->
get
(
'id'
));
// Add about me block
$aboutme
=
new
BlockInstance
(
0
,
array
(
'blocktype'
=>
'profileinfo'
,
'title'
=>
get_string
(
'aboutme'
,
'blocktype.internal/profileinfo'
),
'view'
=>
$view
->
get
(
'id'
),
'column'
=>
1
,
'order'
=>
0
,
));
$configdata
=
array
(
'artefactids'
=>
array
());
if
(
$intro
=
get_field
(
'artefact'
,
'id'
,
'owner'
,
$this
->
get
(
'id'
),
'artefacttype'
,
'introduction'
))
{
$configdata
[
'artefactids'
][]
=
$intro
;
}
else
{
$configdata
[
'introtext'
]
=
display_name
(
$this
,
null
,
true
);
}
if
(
$this
->
get
(
'profileicon'
))
{
$configdata
[
'profileicon'
]
=
$this
->
get
(
'profileicon'
);
}
$aboutme
->
set
(
'configdata'
,
$configdata
);
$aboutme
->
commit
();
$view
->
set_access
(
array
(
array
(
'type'
=>
'loggedin'
,
...
...
htdocs/lib/user.php
View file @
4ea632ff
...
...
@@ -1323,7 +1323,7 @@ function install_system_profile_view() {
)));
$blocktypes
=
array
(
'myviews'
=>
1
,
'mygroups'
=>
1
,
'myfriends'
=>
2
,
'wall'
=>
2
);
// column ids
$installed
=
get_column_sql
(
'SELECT name FROM {blocktype_installed} WHERE name IN ('
.
join
(
','
,
array_map
(
'db_quote'
,
array_keys
(
$blocktypes
)))
.
')'
);
$weights
=
array
(
1
=>
0
,
2
=>
0
);
$weights
=
array
(
1
=>
1
,
2
=>
0
);
// Leave a space for About Me in the first column
foreach
(
array_keys
(
$blocktypes
)
as
$blocktype
)
{
if
(
in_array
(
$blocktype
,
$installed
))
{
$weights
[
$blocktypes
[
$blocktype
]]
++
;
...
...
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