forked from wp-plugins/powerpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
powerpressadmin-player.php
42 lines (32 loc) · 1.26 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
<?php
// PowerPress Player administration
// Handle post processing here for the players page.
function powerpress_admin_players_init()
{
wp_enqueue_style('wp-mediaelement');
wp_enqueue_script( 'wp-mediaelement' );
$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;
}
}