1: <?php
2:
3:
4:
5:
6: 7: 8: 9: 10: 11: 12: 13:
14:
15:
16:
17:
18: function bright_learning_paths_load_bright_customization_scripts() {
19: wp_enqueue_script('bright_learning_paths',
20: plugins_url('bright-learning-paths.js', __FILE__),
21: array('bright'));
22: }
23:
24: add_action('wp_enqueue_scripts', 'bright_learning_paths_load_bright_customization_scripts');
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37: global $bright_embedder_templates;
38:
39:
40:
41: if (empty($bright_embedder_templates)) {
42: $bright_embedder_templates = array();
43: }
44:
45:
46:
47: $bright_embedder_templates['bright-learning-path'] = <<<EOF
48: <table id="learning-path-{{attributes.path}}" class="tablesorter">
49: <thead>
50: <tr>
51: <th>Course</th>
52: <th>Step</th>
53: <th>Description</th>
54: <th>Completed</th>
55: <th>Success</th>
56: <th>Score</th>
57: <th>Launch</th>
58: </tr>
59: </thead>
60: <tbody>
61: {{#learning-path containerId courses attributes selector="learning_paths"}}
62: <tr>
63: <td><a href="/bright-course?bright_course_id={{course_guid}}">{{title}}</a></td>
64: <td>{{this_learning_path_step}}</td>
65: <td>{{{metadata.description}}}</td>
66: <td>{{registration.complete}}</td>
67: <td>{{registration.success}}</td>
68: <td>{{registration.score}}</td>
69: <td>
70: {{#if registration}} <!-- Always give a Launchbutton IF they are registered! -->
71: {{#courselist-launchbutton this}}{{/courselist-launchbutton}}
72: {{else}}
73: {{#if_in_learning_path_previous_course_completed this}}
74: {{#courselist-launchbutton this}}{{/courselist-launchbutton}}
75: {{else}}
76: You must complete the previous step to unlock this course.
77: {{/if_in_learning_path_previous_course_completed}}
78: {{/if}}
79: </td>
80: </tr>
81: {{/learning-path}}
82: </tbody>
83: </table>
84: EOF;
85:
86: $bright_embedder_templates['bright-learning-path-narrow'] = <<<EOF
87: <table id="learning-path-{{attributes.path}}" class="tablesorter">
88: <thead>
89: <tr>
90: <th>Course</th>
91: <th>Launch</th>
92: </tr>
93: </thead>
94: <tbody>
95: {{#learning-path containerId courses attributes selector="learning_paths"}}
96: <tr>
97: <td><a href="/bright-course?bright_course_id={{course_guid}}">{{title}}</a></td>
98: <td>
99: {{#if registration}} <!-- Always give a Launchbutton IF they are registered! -->
100: {{#courselist-launchbutton this}}{{/courselist-launchbutton}}
101: {{else}}
102: {{#if_in_learning_path_previous_course_completed this}}
103: {{#courselist-launchbutton this}}{{/courselist-launchbutton}}
104: {{else}}
105: Complete the previous step to unlock.
106: {{/if_in_learning_path_previous_course_completed}}
107: {{/if}}
108: </td>
109: </tr>
110: {{/learning-path}}
111: </tbody>
112: </table>
113: EOF;
114:
115: ?>
116: