Skip to content
Sign up
Sign in
This repository
Explore
Features
Enterprise
Blog
Watch
21
Star
83
Fork
11
ureddit
/
ureddit
Code
Issues
Pull requests
Wiki
Pulse
Graphs
HTTPS
clone URL
Subversion
checkout URL
You can clone with
HTTPS
or
Subversion
.
Download ZIP
Permalink
Browse files
added tracking of adding/dropping classes for Google Analytics
master
commit
d8a59bf12237b0e8244f4a91bd959898a9e778f6
1 parent
0675def
anastasds
authored
Nov 10, 2012
Unified
Split
Showing
1 changed file
with
10 additions
and
3 deletions
.
+10
−3
supporting_functions.php
Show notes
View
13
supporting_functions.php
@@ -137,7 +137,7 @@ class statuses:
{
?
>
<
div
class
=
"
signup-button
"
>
- <
a
onclick
=
"
$.get('
<?=
PREFIX
?
>
/enroll.php',{id: '
<?=
$class
->
id
?
>
'}, function(data) { $('#button
<?=
$class
->
id
?
>
').html(data) });
"
>
+ <
a
onclick
=
"
$.get('
<?=
PREFIX
?
>
/enroll.php',{id: '
<?=
$class
->
id
?
>
'}, function(data) { $('#button
<?=
$class
->
id
?
>
').html(data) });
_gaq.push(['_trackEvent', 'Enrollment', 'Add', '
<?=
$class
->
id
?
>
']);
"
>
<
button
class
=
"
button-add
"
>
+add
</
button
>
@@ -189,7 +189,7 @@ class statuses:
{
?
>
<
div
class
=
"
signup-button
"
>
- <
a
onclick
=
"
$.get('
<?=
PREFIX
?
>
/drop_class.php',{id: '
<?=
$class
->
id
?
>
'}, function(data) { $('#button
<?=
$class
->
id
?
>
').html(data) });
"
class
=
"
link-signup-button
"
>
+ <
a
onclick
=
"
$.get('
<?=
PREFIX
?
>
/drop_class.php',{id: '
<?=
$class
->
id
?
>
'}, function(data) { $('#button
<?=
$class
->
id
?
>
').html(data) });
_gaq.push(['_trackEvent', 'Enrollment', 'Drop', '
<?=
$class
->
id
?
>
']);
"
class
=
"
link-signup-button
"
>
<
button
class
=
"
button-added
"
>
enrolled
</
button
>
@@ -274,7 +274,14 @@ function list_teacher_classes($user)
$categories
=
array
();
foreach
(
$user
->
teaching
as
$class_id
)
{
-
$class
=
new
course
(
$user
->
dbpdo
,
$class_id
);
+
try
+
{
+
$class
=
new
course
(
$user
->
dbpdo
,
$class_id
);
+
}
+
catch
(
CourseNotFoundException
$e
)
+
{
+
continue
;
+
}
$class
->
get_categories();
foreach
(
$class
->
categories
as
$category_id
)
$categories
[
$category_id
][]
=
$class
;
Toggle all file notes
Please
sign in
to comment.
Something went wrong with that request. Please try again.