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
b91da79f
Commit
b91da79f
authored
Mar 25, 2008
by
Penny Leach
Committed by
Penny Leach
Sep 15, 2008
Browse files
teeny changes to wall
parent
17cd1ac0
Changes
4
Hide whitespace changes
Inline
Side-by-side
htdocs/blocktype/wall/lang/en.utf8/blocktype.wall.php
View file @
b91da79f
...
...
@@ -34,5 +34,6 @@ $string['viewwall'] = 'View wall';
$string
[
'backtoprofile'
]
=
'Back to profile'
;
$string
[
'wall'
]
=
'Wall'
;
$string
[
'wholewall'
]
=
'View whole wall'
;
$string
[
'reply'
]
=
'reply'
;
$string
[
'delete'
]
=
'delete post'
;
?>
htdocs/blocktype/wall/lib.php
View file @
b91da79f
...
...
@@ -49,8 +49,13 @@ class PluginBlocktypeWall extends SystemBlocktype {
}
public
static
function
render_instance
(
BlockInstance
$instance
,
$editing
=
false
)
{
global
$USER
;
$owner
=
$instance
->
get_view
()
->
get
(
'owner'
);
$userid
=
(
!
empty
(
$USER
)
?
$USER
->
get
(
'id'
)
:
0
);
$smarty
=
smarty_core
();
$smarty
->
assign
(
'instanceid'
,
$instance
->
get
(
'id'
));
$smarty
->
assign
(
'ownwall'
,
(
!
empty
(
$USER
)
&&
$USER
->
get
(
'id'
)
==
$owner
));
if
(
$posts
=
self
::
fetch_posts
(
$instance
))
{
$smarty
->
assign
(
'wallposts'
,
$posts
);
}
...
...
@@ -136,7 +141,7 @@ class PluginBlocktypeWall extends SystemBlocktype {
$sql
=
'
SELECT bwp.*,'
.
db_format_tsfield
(
'postdate'
)
.
',
u.firstname,u.lastname,u.preferredname
u.
username,
firstname,u.lastname,u.preferredname
FROM {blocktype_wall_post} bwp
JOIN {usr} u ON bwp.from = u.id
WHERE bwp.instance = ? AND u.deleted = 0
...
...
htdocs/blocktype/wall/theme/default/inlineposts.tpl
View file @
b91da79f
...
...
@@ -5,10 +5,21 @@
{
if
$wallposts
}
{
foreach
from
=
$wallposts
item
=
wallpost
}
<div
id=
"wallpost"
>
{* TODO THIS BADLY NEEDS FORMATTING *}
<div
id=
"icon"
><img
src=
"
{
$WWWROOT
}
thumb.php?type=profileicon&maxwidth=50&maxheight=50&id=
{
$wallpost
->
from
}
"
/></div>
<div
id=
"userinfo"
>
{
$wallpost
->
displayname
|
escape
}
</div>
<div
id=
"text"
>
{
$wallpost
->
text
|
escape
}
</div>
<div
id=
"postedon"
>
{
$wallpost
->
postdate
|
format_date
}
</div>
<div
id=
"controls"
>
controls
</div>
<div
id=
"controls"
>
{
if
$ownwall
}
[
<a
href=
"
{
$WWWROOT
}
blocktype/wall/wall.php?instance=
{
$instanceid
}
&replyto=
{
$wallpost
->
id
}
"
>
{
str
tag
=
'reply'
section
=
'blocktype.wall'
}
</a>
]
{/
if
}
{
if
$ownwall
||
$wallpost
->
from
==
$userid
}
[
<a
href=
"
{
$WWWROOT
}
blocktype/wall/deletepost.php?instance=
{
$instanceid
}
&return=
{
if
$wholewall
}
wall
{
else
}
profile
{/
if
}
"
>
{
str
tag
=
'delete'
section
=
'blocktype.wall'
}
</a>
]
{/
if
}
</div>
</div>
{/
foreach
}
{
if
!
$wholewall
}
...
...
htdocs/blocktype/wall/wall.php
View file @
b91da79f
...
...
@@ -33,14 +33,22 @@ safe_require('blocktype', 'wall');
define
(
'TITLE'
,
get_string
(
'viewwall'
,
'blocktype.wall'
));
$instanceid
=
param_integer
(
'id'
);
$reply
=
param_boolean
(
'reply'
,
false
);
// TODO send this to the form
$postid
=
0
;
if
(
$reply
)
{
$postid
=
param_integer
(
'postid'
);
// TODO just fetch this thread
}
$postid
=
param_integer
(
'postid'
,
0
);
$block
=
new
BlockInstance
(
$instanceid
);
$view
=
$block
->
get_view
();
$owner
=
$view
->
get_owner_object
();
$owner
->
displayname
=
display_name
(
$owner
);
$smarty
=
smarty
();
$smarty
->
assign
(
'instanceid'
,
$instanceid
);
$smarty
->
assign
(
'owner'
,
$owner
);
$smarty
->
assign
(
'wholewall'
,
true
);
$smarty
->
assign
(
'ownwall'
,
(
!
empty
(
$USER
)
&&
$USER
->
get
(
'id'
)
==
$owner
->
id
));
if
(
$posts
=
PluginBlocktypeWall
::
fetch_posts
(
$block
))
{
$smarty
->
assign
(
'wallposts'
,
$posts
);
}
...
...
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