forked from wp-plugins/powerpress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
powerpressadmin-defaults.php
148 lines (126 loc) · 4.83 KB
/
powerpressadmin-defaults.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
function powerpressadmin_default_steps($FeedSettings, $General, $Step = 0)
{
?>
<div id="powerpress_steps">
<div class="powerpress-step active-step" id="powerpreess_step_1">
<h3><?php echo __('Step 1', 'powerpress'); ?></h3>
<p>
<?php echo __('Fill out the settings on this page', 'powerpress'); ?>
</p>
<?php powerpressadmin_complete_check($Step >= 1); ?>
</div>
<div class="powerpress-step<?php echo ($Step >= 1? ' active-step':''); ?>">
<h3><?php echo __('Step 2', 'powerpress'); ?></h3>
<p>
<a href="http://create.blubrry.com/resources/powerpress/using-powerpress/creating-your-first-episode-with-powerpress/" target="_blank"><?php echo __('Create a blog post with an episode', 'powerpress'); ?></a>
</p>
<p><a href="http://create.blubrry.com/resources/" target="_blank"><?php echo __('Need Help?', 'powerpress'); ?></a>
</p>
<?php powerpressadmin_complete_check($Step >= 2); ?>
</div>
<div class="powerpress-step<?php echo ($Step >= 2? ' active-step':''); ?>">
<h3><?php echo __('Step 3', 'powerpress'); ?></h3>
<p>
<a href="http://create.blubrry.com/manual/podcast-promotion/submit-podcast-to-itunes/?podcast-feed=<?php echo urlencode(get_feed_link('podcast')); ?>" target="_blank"><?php echo __('Submit your feed to iTunes and other podcast directories', 'powerpress'); ?></a>
</p>
<?php powerpressadmin_complete_check($Step == 3); ?>
</div>
<div class="clear"></div>
</div>
<?php
}
function powerpressadmin_complete_check($checked=false)
{
?>
<div class="powerpress-step-complete<?php echo ($checked?' powerpress-step-completed':''); ?>">
<p>complete
<span class="powerpress-step-complete-box"> </span>
</p>
</div>
<?php
}
function powerpress_admin_defaults()
{
$FeedAttribs = array('type'=>'general', 'feed_slug'=>'', 'category_id'=>0, 'term_taxonomy_id'=>0, 'term_id'=>0, 'taxonomy_type'=>'', 'post_type'=>'');
$General = powerpress_get_settings('powerpress_general');
$General = powerpress_default_settings($General, 'basic');
$FeedSettings = powerpress_get_settings('powerpress_feed');
$FeedSettings = powerpress_default_settings($FeedSettings, 'editfeed');
// Make sure variables are set
if( empty($FeedSettings['title']) )
$FeedSettings['title'] = '';
$Step = 0;
if( !empty($FeedSettings['itunes_cat_1']) && !empty($FeedSettings['email']) && !empty($FeedSettings['itunes_image']) )
$Step = 1;
$episode_total = 0;
if( $Step == 1 )
{
$episode_total = powerpress_admin_episodes_per_feed('podcast');
if( $episode_total > 0 )
$Step = 2;
}
if( $Step == 2 && !empty($FeedSettings['itunes_url']) )
$Step = 3;
$MultiSiteServiceSettings = false;
if( is_multisite() )
{
$MultiSiteSettings = get_site_option('powerpress_multisite');
if( !empty($MultiSiteSettings['services_multisite_only']) )
{
$MultiSiteServiceSettings = true;
}
}
?>
<script type="text/javascript"><!--
jQuery(document).ready(function($) {
jQuery('#powerpress_advanced_mode_button').click( function(event) {
event.preventDefault();
jQuery('#powerpress_advanced_mode').val('1');
jQuery(this).closest("form").submit();
} );
} );
//-->
</script>
<input type="hidden" name="action" value="powerpress-save-defaults" />
<input type="hidden" id="powerpress_advanced_mode" name="General[advanced_mode_2]" value="0" />
<div id="powerpress_admin_header">
<h2><?php echo __('Blubrry PowerPress Settings', 'powerpress'); ?></h2>
<span class="powerpress-mode"><?php echo __('Simple Mode', 'powerpress'); ?>
<a href="<?php echo admin_url("admin.php?page=powerpress/powerpressadmin_basic.php&mode=advanced"); ?>" id="powerpress_advanced_mode_button" class="button-primary"><?php echo __('Switch to Advanced Mode', 'powerpress'); ?></a>
</span>
</div>
<?php
powerpressadmin_default_steps($FeedSettings, $General, $Step);
if( $MultiSiteServiceSettings && defined('POWERPRESS_MULTISITE_VERSION') )
{
PowerPressMultiSitePlugin::edit_blubrry_services($General);
}
else
{
powerpressadmin_edit_blubrry_services($General);
}
?>
<h3><?php echo __('Podcast Settings', 'powerpress'); ?></h3>
<table class="form-table">
<tr valign="top">
<th scope="row">
<?php echo __('Program Title', 'powerpress'); ?>
</th>
<td>
<input type="text" name="Feed[title]" style="width: 60%;" value="<?php echo esc_attr($FeedSettings['title']); ?>" maxlength="250" />
(<?php echo __('leave blank to use blog title', 'powerpress'); ?>)
<p><?php echo __('Blog title:', 'powerpress') .' '. get_bloginfo_rss('name'); ?></p>
</td>
</tr>
</table>
<?php
if( $Step > 1 ) // Only display if we have episdoes in the feed!
powerpressadmin_edit_itunes_general($FeedSettings, $General, $FeedAttribs);
// iTunes settings (in simple mode of course)
powerpressadmin_edit_itunes_feed($FeedSettings, $General, $FeedAttribs);
powerpressadmin_edit_artwork($FeedSettings, $General);
powerpressadmin_appearance($General, $FeedSettings);
powerpressadmin_advanced_options($General);
}
?>