Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor

Showing 2 changed files with 16 additions and 18 deletions. Show diff stats Hide diff stats

  1. +8 11 courses/course.php
  2. +8 7 courses/index.php
19 courses/course.php
@@ -23,19 +23,16 @@
23 23 ?>
24 24 <div id="course">
25 25 <?
26   - //
27   - // Description: Load the course file specified by the GET variable 'id'
28   - //
  26 + $category = isset($_GET['category']) ? $_GET['category'] : null;
  27 + $course = isset($_GET['course']) ? $_GET['course'] : null;
  28 + $chapter = isset($_GET['chapter']) ? $_GET['chapter'] : null;
  29 + //TODO: implement static pages for non-js browsers (via url rewriting)
  30 + $mincourseid = 0;
  31 + $maxcourseid = 100000;
29 32
30   - if(isset($_GET['id'])){
31   -
32   - }
33   -
34   - $errorstring = "<p class=\"center\"><img alt=\"Y U NO GIVE ID\" src=\"images/yuno.png\" /><br /><br />No active course, select a valid course from the navigation on the left!
  33 + $selectCourse = "<p class=\"center\"><img alt=\"Y U NO GIVE ID\" src=\"images/yuno.png\" /><br /><br />No active course, select a valid course from the navigation on the left!
35 34 </p>";
36 35
37   - $mincourseid = 0;
38   - $maxcourseid = 100000;
39 36
40 37 echo '<div id="coursenavigation">
41 38 <ol class="tree">';
@@ -84,5 +81,5 @@
84 81 </div><!-- end div id="coursenavigation" -->';
85 82
86 83 ?>
87   - <div id="coursecontent"><?php echo $errorstring; ?></div>
  84 + <div id="coursecontent"><?php echo $selectCourse; ?></div>
88 85 </div>
15 courses/index.php
@@ -62,18 +62,18 @@
62 62 updateState = function(e){
63 63 var parts = e.path.split('/')
64 64 , tab = parts[1]
65   - , panel = parts[2] || ''
  65 + , category = parts[2] || ''
66 66 , course = parts[3] || ''
67 67 , chapter = parts[4] || '';
68 68 if(tab.length){ //select tab
69 69 $("#tabs").tabs("select", '#'+tab.replace(/^#/,''));
70 70 }
71   - if(panel.length){ //select accordion panel
72   - $("#courses").accordion("activate", getPanelIndex(panel));
73   - $('a[href$="/course/'+panel+'"]').siblings('input').attr('checked', true);
  71 + if(category.length){ //select accordion panel
  72 + $("#courses").accordion("activate", getPanelIndex(category));
  73 + $('a[href$="/course/'+category+'"]').siblings('input').attr('checked', true);
74 74 }
75 75 if(course.length){ //select course
76   - $('a[href$="/course/'+panel+'/'+course+'"]').siblings('input').attr('checked', true);
  76 + $('a[href$="/course/'+category+'/'+course+'"]').siblings('input').attr('checked', true);
77 77 }
78 78 if(chapter.length){ //select chapter
79 79 $('#coursenavigation li.file a').each(function(){
@@ -83,7 +83,7 @@
83 83 });
84 84 $('#coursecontent').html(
85 85 $('[id="'
86   - + $('a[href$="/course/'+panel+'/'+course+'/'+chapter+'"]:not([rel=overview])').data('chapterid')
  86 + + $('a[href$="/course/'+category+'/'+course+'/'+chapter+'"]:not([rel=overview])').data('chapterid')
87 87 + '"]').html());
88 88 }
89 89 };
@@ -98,7 +98,8 @@
98 98 }
99 99 });
100 100 $("#courses").accordion({
101   - autoHeight: false
  101 + autoHeight: false,
  102 + animated: false
102 103 });
103 104
104 105 $.address.init(function(e){

No commit comments for this range

Something went wrong with that request. Please try again.