-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlexicon.php
68 lines (56 loc) · 2.39 KB
/
lexicon.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* *************************************************************************
* * OOHOO - TTS - Text To Speech **
* *************************************************************************
* @package block **
* @subpackage TTS **
* @name TTS **
* @copyright oohoo.biz **
* @link http://oohoo.biz **
* @author Ryan Thomas (Original Author) **
* @author Dustin Durand **
* @author Nicolas Bretin **
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later **
* *************************************************************************
* ************************************************************************ */
require_once('../../config.php');
global $CFG, $OUTPUT, $PAGE;
$courseid = required_param('courseid', PARAM_INT);
print<<<HERE
<script type='text/javascript'>
window.courseid = $courseid;
</script>
HERE;
$context = get_context_instance(CONTEXT_COURSE, $courseid);
//Replace get_context_instance by the class for moodle 2.6+
if(class_exists('context_module'))
{
$context = context_course::instance($courseid);
}
else
{
$context = get_context_instance(CONTEXT_COURSE, $courseid);
}
if (!has_capability('block/tts:lexicon', $context))
{
redirect($CFG->wwwroot . '/course/view.php?id=' . $courseid);
}
require_login($courseid);
$PAGE->set_title('Lexicon');
$PAGE->set_url('/blocks/tts/lexicon.php');
$PAGE->navbar->add('TTS Lexicon');
$PAGE->requires->css('/blocks/tts/grid/jquery-ui-1.8.13.custom.css');
$PAGE->requires->css('/blocks/tts/grid/ui.jqgrid.css');
$PAGE->requires->css('/blocks/tts/styles.css');
$PAGE->requires->js('/blocks/tts/grid/jquery-1.5.1.min.js');
$PAGE->requires->js('/blocks/tts/grid/grid.locale.php');
$PAGE->requires->js('/blocks/tts/grid/jquery.jqGrid.min.js');
$PAGE->requires->js('/blocks/tts/grid/grid.js');
echo $OUTPUT->header();
echo '<div id="lexicon_wrapper">';
echo '<table id="lexicon_table"><tr><td></td></tr></table>';
echo '<div id="lexicon_pager"></div>';
echo '</div>';
echo $OUTPUT->footer();
?>