-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAudioNotes.php
More file actions
57 lines (52 loc) · 1.53 KB
/
Copy pathAudioNotes.php
File metadata and controls
57 lines (52 loc) · 1.53 KB
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
<?php
/**
* AudioNotes - A MantisBT plugin to record audio notes in the browser.
*
* @package AudioNotes
*/
class AudioNotesPlugin extends MantisPlugin {
/**
* A method that populates the plugin information and requirements.
* @return void
*/
public function register() {
$this->name = plugin_lang_get( 'title' );
$this->description = plugin_lang_get( 'description' );
$this->page = '';
$this->version = '1.0.0';
$this->requires = array(
'MantisCore' => '2.0.0',
);
$this->author = 'Franklin';
$this->contact = 'franklin.haut@gmail.com';
$this->url = '';
}
/**
* Event hook declaration.
* @return array
*/
public function hooks() {
return array(
'EVENT_LAYOUT_RESOURCES' => 'resources',
);
}
/**
* Inject stylesheets and javascript scripts into layout headers.
* @return string
*/
public function resources() {
$t_lang = json_encode( array(
'title' => plugin_lang_get( 'title' ),
'record_audio' => plugin_lang_get( 'record_audio' ),
'cancel' => plugin_lang_get( 'cancel' ),
'save' => plugin_lang_get( 'save' ),
'mic_error' => plugin_lang_get( 'mic_error' ),
'recording_saved' => plugin_lang_get( 'recording_saved' ),
'no_mic' => plugin_lang_get( 'no_mic' ),
) );
return '
<script>var AudioNotesLang = ' . $t_lang . ';</script>
<link rel="stylesheet" type="text/css" href="' . plugin_file( 'audionotes.css' ) . '"/>
<script src="' . plugin_file( 'audionotes.js' ) . '"></script>';
}
}