Skip to content
GitLab
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
5b07a0c6
Commit
5b07a0c6
authored
Nov 21, 2006
by
Penny Leach
Browse files
more work on watchlist
parent
bc9a36a2
Changes
5
Hide whitespace changes
Inline
Side-by-side
htdocs/account/watchlist/index.json.php
View file @
5b07a0c6
...
...
@@ -75,11 +75,12 @@ $prefix = get_config('dbprefix');
if
(
$type
==
'views'
)
{
$count
=
count_records
(
'usr_watchlist_view'
,
'usr'
,
$userid
);
$sql
=
'SELECT v.*
$sql
=
'SELECT v.*
, v.title AS name
FROM '
.
$prefix
.
'view v
JOIN '
.
$prefix
.
'usr_watchlist_view w ON w.view = v.id
WHERE w.usr = ?'
;
if
(
$records
=
get_rows_sql
(
$sql
,
array
(
$userid
),
'v.mtime DESC'
,
'*'
,
$offset
,
$limit
))
{
WHERE w.usr = ?
ORDER BY v.mtime DESC'
;
if
(
$records
=
get_rows_sql
(
$sql
,
array
(
$userid
),
$offset
,
$limit
))
{
foreach
(
$records
as
&
$r
)
{
// @todo session expandey stuff
}
...
...
@@ -90,23 +91,23 @@ else if ($type == 'communities') {
$sql
=
'SELECT c.*
FROM '
.
$prefix
.
'community c
JOIN '
.
$prefix
.
'usr_watchlist_community w ON w.community = c.id
WHERE w.usr = ?'
;
$records
=
get_rows_sql
(
$sql
,
array
(
$userid
),
'c.mtime DESC'
,
'*'
,
$offset
,
$limit
);
WHERE w.usr = ?
ORDER BY c.mtime DESC'
;
$records
=
get_rows_sql
(
$sql
,
array
(
$userid
),
$offset
,
$limit
);
}
if
(
empty
(
$records
))
{
$records
=
array
();
}
$activity
=
array
(
'count'
=>
$count
,
'offset'
=>
$offset
,
'limit'
=>
$limit
,
'data'
=>
$records
,
'type'
=>
$type
,
'minusicon'
=>
theme_get_image_path
(
'minus.
gif
'
),
'plusicon'
=>
theme_get_image_path
(
'plus.
gif
'
),
'minusicon'
=>
theme_get_image_path
(
'minus.
png
'
),
'plusicon'
=>
theme_get_image_path
(
'plus.
png
'
),
'minusalt'
=>
get_string
(
'collapse'
),
'plusalt'
=>
get_string
(
'expand'
),
);
...
...
htdocs/account/watchlist/index.php
View file @
5b07a0c6
...
...
@@ -44,12 +44,12 @@ var watchlist = new TableRenderer(
return TD(null, '');
}
if (r.expanded) {
return TD(null, A({'href': '', 'on
C
lick'
: 'collapse(' + r.id
|
')'}
)
,
IMG({'src' : d.minusicon, 'alt' : d.minusalt
}
));
return TD(null, A({'href': '', 'on
c
lick': 'collapse(' + r.id
+
')
; return false;
'},
IMG({'src' : d.minusicon, 'alt' : d.minusalt
, 'border': 0})
));
}
else {
return TD(null, A({'href': '', 'on
C
lick'
: '
collapse
(' + r.id
|
')'}
)
,
IMG({'src' : d.plusicon, 'alt' : d.plusalt
}
));
return TD(null, A({'href': '', 'on
c
lick': '
expand
(' + r.id
+
')
; return false;
'},
IMG({'src' : d.plusicon, 'alt' : d.plusalt
, 'border': 0})
));
}
},
function(r) {
...
...
@@ -59,7 +59,7 @@ var watchlist = new TableRenderer(
return TD(null,r.name);
},
function (r) {
return TD(null, INPUT({'type' : 'checkbox', 'class'
: '
view
check', 'name'
: 'view-' + r.id}));
return TD(null, INPUT({'type' : 'checkbox', 'class': '
to
check', 'name': 'view-' + r.id}));
}
]
);
...
...
@@ -73,6 +73,14 @@ function changeTitle(title) {
$('typeheader').innerHTML = '{$monitoredstring} ' + titles[title];
}
function collapse(id) {
}
function expand(id) {
}
JAVASCRIPT;
$typechange
=
'watchlist.doupdate({\'type\':this.options[this.selectedIndex].value}); changeTitle(this.options[this.selectedIndex].value);'
;
...
...
@@ -81,6 +89,7 @@ $smarty = smarty(array('tablerenderer'));
$smarty
->
assign
(
'site_menu'
,
site_menu
());
$smarty
->
assign
(
'typechange'
,
$typechange
);
$smarty
->
assign
(
'typestr'
,
get_string
(
'viewsandartefacts'
,
'activity'
));
$smarty
->
assign
(
'selectall'
,
'toggleChecked(\'tocheck\'); return false;'
);
$smarty
->
assign
(
'INLINEJAVASCRIPT'
,
$javascript
);
$smarty
->
display
(
'account/watchlist/index.tpl'
);
...
...
htdocs/lang/en.utf8/activity.php
View file @
5b07a0c6
...
...
@@ -55,5 +55,6 @@ $string['stopmonitoring'] = 'Stop monitoring';
$string
[
'viewsandartefacts'
]
=
'Views and artefacts'
;
$string
[
'communities'
]
=
'Communities'
;
$string
[
'monitored'
]
=
'Monitored'
;
$string
[
'stopmonitoring'
]
=
'Stop monitoring'
;
?>
htdocs/lang/en.utf8/mahara.php
View file @
5b07a0c6
...
...
@@ -214,6 +214,8 @@ $string['height'] = 'Height';
$string
[
'widthshort'
]
=
'w'
;
$string
[
'heightshort'
]
=
'h'
;
$string
[
'filter'
]
=
'Filter'
;
$string
[
'expand'
]
=
'Expand'
;
$string
[
'collapse'
]
=
'Collapse'
;
$string
[
'nohelpfound'
]
=
'There was no help found for this item'
;
...
...
htdocs/theme/default/templates/account/watchlist/index.tpl
View file @
5b07a0c6
...
...
@@ -12,7 +12,7 @@
<option
value=
"communities"
>
{
str
section
=
'activity'
tag
=
'communities'
}
</option>
</select>
</form>
<div
id=
"typeheader"
>
{
str
section
=
'activity'
tag
=
'monitored'
}
{
$typestr
}
</div>
<p><b>
<div
id=
"typeheader"
>
{
str
section
=
'activity'
tag
=
'monitored'
}
{
$typestr
}
</div>
</b></p>
<form
method=
"post"
onSubmit=
"
{
$stopmonitoring
}
"
>
<table
id=
"watchlist"
>
<thead>
...
...
@@ -28,7 +28,7 @@
<tfoot>
<tr>
<td
align=
"right"
colspan=
"4"
><div
id=
"messagediv"
></div></td>
<td
align=
"right"
><input
type=
"submit"
value=
"
{
str
tag
=
'
update
'
}
"
/></td>
<td
align=
"right"
><input
type=
"submit"
value=
"
{
str
tag
=
'
stopmonitoring'
section
=
'activity
'
}
"
/></td>
</tr>
</tfoot>
</table>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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