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
f644bdcc
Commit
f644bdcc
authored
May 05, 2015
by
Son Nguyen
Committed by
Gerrit Code Review
May 05, 2015
Browse files
Merge "Tidying up watchlist block - phase 1 (Bug #1444784)"
parents
bcb5a507
c92e3d3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/blocktype/watchlist/lib.php
View file @
f644bdcc
...
@@ -43,7 +43,7 @@ class PluginBlocktypeWatchlist extends SystemBlocktype {
...
@@ -43,7 +43,7 @@ class PluginBlocktypeWatchlist extends SystemBlocktype {
$smarty
=
smarty_core
();
$smarty
=
smarty_core
();
$sql
=
'
$sql
=
'
SELECT v.id, v.title, v.owner, v.group, v.institution, v.ownerformat, v.urlid
SELECT v.id, v.title, v.owner, v.group, v.institution, v.ownerformat, v.urlid
, v.ctime, v.mtime
FROM {view} v
FROM {view} v
JOIN {usr_watchlist_view} wv ON wv.view = v.id
JOIN {usr_watchlist_view} wv ON wv.view = v.id
WHERE wv.usr = ?
WHERE wv.usr = ?
...
@@ -63,7 +63,7 @@ class PluginBlocktypeWatchlist extends SystemBlocktype {
...
@@ -63,7 +63,7 @@ class PluginBlocktypeWatchlist extends SystemBlocktype {
$r
=
(
object
)
$r
;
$r
=
(
object
)
$r
;
}
}
$smarty
->
assign
(
'
b
lo
ckid'
,
'blockinstance_'
.
$instance
->
get
(
'id'
));
$smarty
->
assign
(
'lo
ggedin'
,
$USER
->
is_logged_in
(
));
$smarty
->
assign
(
'views'
,
array_values
(
$results
));
$smarty
->
assign
(
'views'
,
array_values
(
$results
));
return
$smarty
->
fetch
(
'blocktype:watchlist:watchlist.tpl'
);
return
$smarty
->
fetch
(
'blocktype:watchlist:watchlist.tpl'
);
}
}
...
...
htdocs/theme/raw/blocktype/watchlist/templates/watchlist.tpl
View file @
f644bdcc
{
if
$watchlistempty
}
{
if
$watchlistempty
}
{
str
tag
=
nopages
section
=
blocktype
.
watchlist
}
{
str
tag
=
nopages
section
=
blocktype
.
watchlist
}
{
else
}
{
else
}
<table
id=
"watchlistblock"
class=
"viewlist fullwidth"
>
<div
id=
"watchlistblock"
class=
"viewlist fullwidth listing"
>
{*
I wanted to put author_link_index in templates/author.tpl, but its
state is non-persistent. So until Dwoo gets smarter...
*}
{
assign
var
=
'author_link_index'
value
=
1
}
{
foreach
$views
as
item
=
view
}
{
foreach
$views
as
item
=
view
}
<tr>
<div
class=
"
{
cycle
values
=
'r0,r1'
}
listrow"
>
<td
class=
"
{
cycle
values
=
'r0,r1'
}
"
>
<h3
class=
"title"
><a
href=
"
{
$view
->
fullurl
}
"
>
{
$view
->
title
}
</a></h3>
<h4
class=
"title"
><a
href=
"
{
$view
->
fullurl
}
"
class=
"watchlist-showview"
>
{
$view
->
title
}
</a></h4>
{
if
$view
->
sharedby
}
</td>
<div
class=
"groupuserdate"
>
</tr>
{
if
$view
->
group
&&
$loggedin
}
<a
href=
"
{
group_homepage_url
(
$view
->
groupdata
)
}
"
>
{
$view
->
sharedby
}
</a>
{
elseif
$view
>
owner
&&
$loggedin
}
{
if
$view
->
anonymous
}
{
if
$view
->
staff_or_admin
}
{
assign
var
=
'realauthor'
value
=
$view
>
sharedby
}
{
assign
var
=
'realauthorlink'
value
=
profile_url
(
$view.user
)
}
{/
if
}
{
assign
var
=
'author'
value
=
get_string
(
'anonymoususer'
)
}
{
include
file
=
author
.
tpl
}
{
if
$view.staff_or_admin
}
{
assign
var
=
'author_link_index'
value
=
$author_link_index
+
1
}
{/
if
}
{
else
}
<a
href=
"
{
profile_url
(
$view
->
user
)
}
"
>
{
$view
->
sharedby
}
</a>
{/
if
}
{
else
}
{
$view
->
sharedby
}
{/
if
}
<span
class=
"postedon"
>
-
{
if
$view
->
mtime
==
$view
->
ctime
}{
str
tag
=
Created
}{
else
}{
str
tag
=
Updated
}{/
if
}
{
$view
->
mtime
|
strtotime
|
format_date
:
'strftimedate'
}
</span>
</div>
{/
if
}
</div>
{/
foreach
}
{/
foreach
}
</
table
>
</
div
>
<div
class=
"cb"
></div>
<div
class=
"cb"
></div>
{/
if
}
{/
if
}
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