-
Notifications
You must be signed in to change notification settings - Fork 1
/
powerpressadmin-player.php
80 lines (60 loc) · 2.45 KB
/
powerpressadmin-player.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
69
70
71
72
73
74
75
76
77
78
79
80
<?php
// PowerPress Player administration
// Handle post processing here for the players page.
function powerpress_admin_players_init()
{
//wp_enqueue_script('jquery');
//echo "powerpres player init";
wp_enqueue_style('mediaelement');
wp_enqueue_style('wp-mediaelement');
wp_enqueue_script('mediaelement');
// wp_enqueue_script( 'wp-mediaelement' );
wp_enqueue_script( 'powerpress-mejs', powerpress_get_root_url() .'powerpress-mejs.js');
$Settings = false; // Important, never remove this
$Step = 1;
$action = (isset($_GET['action'])?$_GET['action']: (isset($_POST['action'])?$_POST['action']:false) );
//$type = (isset($_GET['type'])?$_GET['type']: (isset($_POST['type'])?$_POST['type']:'audio') );
if( !$action )
return;
switch($action)
{
case 'powerpress-select-player': {
$SaveSettings = array();
//$SaveSettings = $_POST['Player'];
if( isset($_POST['Player']) )
$SaveSettings = $_POST['Player'];
if( isset($_POST['VideoPlayer']) )
$SaveSettings += $_POST['VideoPlayer'];
powerpress_save_settings($SaveSettings, 'powerpress_general');
powerpress_page_message_add_notice( __('Player activated successfully.', 'powerpress') );
}; break;
case 'powerpress-audio-player': {
$SaveSettings = $_POST['Player'];
powerpress_save_settings($SaveSettings, 'powerpress_audio-player');
powerpress_page_message_add_notice( __('Audio Player settings saved successfully.', 'powerpress') );
}; break;
case 'powerpress-flashmp3-maxi': {
$SaveSettings = $_POST['Player'];
powerpress_save_settings($SaveSettings, 'powerpress_flashmp3-maxi');
powerpress_page_message_add_notice( __('Flash Mp3 Maxi settings saved successfully.', 'powerpress') );
} ; break;
case 'powerpress-audioplay':
{
$SaveSettings = $_POST['Player'];
powerpress_save_settings($SaveSettings, 'powerpress_audioplay');
powerpress_page_message_add_notice( __('AudioPlay settings saved successfully.', 'powerpress') );
}; break;
//TODO: PowerPress 5.0
//case 'powerpress-mediaelement':
//{
// $SaveSettings = $_POST['Player'];
// powerpress_save_settings($SaveSettings, 'powerpress_mediaelement');
// powerpress_page_message_add_notice( __('MediaElement.js settings saved successfully.', 'powerpress') );
//}; break;
}
}
// add_action('init', 'powerpress_admin_players_init');
function powerpress_admin_page_videoplayer_error()
{
}
?>