Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added tracking of adding/dropping classes for Google Analytics

commit d8a59bf12237b0e8244f4a91bd959898a9e778f6 1 parent 0675def
@anastasds anastasds authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 supporting_functions.php
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;
Please sign in to comment.
Something went wrong with that request. Please try again.