コード例 #1
0
 function edit_category_form($input)
 {
     global $wp_version, $action;
     //~ echo "\n<pre>\n";
     //~ var_dump('in function edit_category_form');
     //~ var_dump($input);
     //~ var_dump($input->taxonomy);
     //~ var_dump($action);
     //~ var_dump($_GET['action']);
     //~ var_dump($wp_version);
     //~ echo "\n</pre>\n";
     if ('edit' == $_GET['action'] and TRUE == version_compare($wp_version, '2.7', '>=') or 'editedcat' == $action) {
         // show the following form only when an existing category is going to be edited.
         if (FALSE === isset($input->taxonomy) or TRUE === empty($input->taxonomy) or 'post_tag' !== $input->taxonomy and 'category' !== $input->taxonomy) {
             $taxonomy = 'misc';
             $taxonomy_str = __('Taxonomy', 'podpress');
         } else {
             $taxonomy = $input->taxonomy;
             switch ($taxonomy) {
                 case 'post_tag':
                     $taxonomy_str = __('Tag', 'podpress');
                     break;
                 case 'category':
                     $taxonomy_str = __('Category', 'podpress');
                     break;
             }
         }
         //~ printphpnotices_var_dump('print edit_'.$taxonomy.'_form');
         //~ printphpnotices_var_dump($input);
         $data = podPress_get_option('podPress_' . $taxonomy . '_' . $input->term_id);
         $blog_charset = get_bloginfo('charset');
         if (empty($data['podcastFeedURL'])) {
             if (TRUE == version_compare($wp_version, '2.9.3', '>')) {
                 // since WP 3.0 the cat_ID isreplaced by tag_ID
                 $data['podcastFeedURL'] = get_term_feed_link($input->term_id, $taxonomy);
             } elseif (TRUE == version_compare($wp_version, '2.9.3', '<=') and TRUE == version_compare($wp_version, '2.4', '>')) {
                 switch ($taxonomy) {
                     default:
                     case 'post_tag':
                         $data['podcastFeedURL'] = get_tag_feed_link($input->term_id);
                         break;
                     case 'category':
                         $data['podcastFeedURL'] = get_category_feed_link($input->term_id);
                         break;
                 }
             } else {
                 $data['podcastFeedURL'] = site_url() . '/?feed=rss2&cat=' . $input->term_id;
             }
         } else {
             $url_parts = parse_url($data['podcastFeedURL']);
             if (isset($url_parts['query'])) {
                 $output = '';
                 parse_str($url_parts['query'], $output);
                 if (TRUE === isset($output['cat']) and FALSE !== empty($output['cat'])) {
                     if (TRUE == version_compare($wp_version, '2.9.3', '>')) {
                         // since WP 3.0 the cat_ID isreplaced by tag_ID
                         $data['podcastFeedURL'] = get_term_feed_link($input->term_id, $taxonomy);
                     } elseif (TRUE == version_compare($wp_version, '2.9.3', '<=') and TRUE == version_compare($wp_version, '2.4', '>')) {
                         switch ($taxonomy) {
                             default:
                             case 'post_tag':
                                 $data['podcastFeedURL'] = get_tag_feed_link($input->term_id);
                                 break;
                             case 'category':
                                 $data['podcastFeedURL'] = get_category_feed_link($input->term_id);
                                 break;
                         }
                     } else {
                         $data['podcastFeedURL'] = site_url() . '/?feed=rss2&cat=' . $input->term_id;
                     }
                 }
             }
         }
         // some ids of category input fields have changed with WP 3.0
         $wp_version_parts = explode('.', $wp_version);
         if (is_array($wp_version_parts)) {
             $main_wp_version = $wp_version_parts[0];
         } else {
             $main_wp_version = 0;
         }
         echo '<div class="wrap">' . "\n";
         if (TRUE == version_compare($wp_version, '2.7', '>=')) {
             echo '<div id="podpress-icon" class="icon32"><br /></div>';
         }
         echo '	<h2>' . sprintf(__('podPress %1$s Casting', 'podpress'), $taxonomy_str) . '</h2>' . "\n";
         echo '	<label for="categoryCasting"><strong>' . sprintf(__('Enable %1$s Casting', 'podpress'), $taxonomy_str) . '</strong></label>  <a href="javascript:void(null);" onclick="javascript: podPressShowHideDiv(\'categoryCastingHelp\');">(?)</a>:';
         echo '	<input type="checkbox" name="categoryCasting" id="categoryCasting" ';
         if ($data['categoryCasting'] == 'true') {
             echo 'checked="checked"';
         }
         echo ' onclick="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>' . "\n";
         echo '	<div id="categoryCastingHelp" style="display: none;">' . "\n";
         echo '		' . __('This feature is for cases in which you want to host more than one podcast in one blog or if you want to have different podcast feeds with different media files of certain file types per feed (e.g a feed which contains only .mp3 files).<br />Basically this feature gives you the opportunity to modify some of the feed elements and set them to other then as the general value from the Feed/iTunes Settings of podPress.<br/>For instance: If you organize your audio episodes in one category and the video episodes in a different category then you can modify the feed content describing values like the title or the description in the form below. This your category feeds will be more distinguishable from another.', 'podpress') . '<br />' . "\n";
         echo '	</div>' . "\n";
         echo '  <div class="wrap" id="iTunesSpecificSettings" style="display: none; border: 0;">' . "\n";
         podPress_DirectoriesPreview('edit_category_form');
         echo '		<fieldset class="options">' . "\n";
         echo '		<legend>' . sprintf(__('%1$s Feed Options', 'podpress'), $taxonomy_str) . '</legend>' . "\n";
         echo '		<h3>' . __('iTunes Settings', 'podpress') . '</h3>' . "\n";
         echo '		<table class="podpress_feed_gensettings">' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesSubtitleChoice">' . __('iTunes:Subtitle', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesSubtitleChoice" name="iTunesSubtitleChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesSubtitleChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesSubtitleChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesSubtitleWrapper" style="display: none;">' . "\n";
         echo '						<textarea name="iTunesSubtitle" class="podpress_wide_text_field" rows="2" cols="40">' . stripslashes($data['iTunesSubtitle']) . '</textarea>' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesSubtitleHelp">' . "\n";
         echo '						' . __('A few words which describe the feed title a little bit more (max. 255 characters).', 'podpress') . ' ' . __('By default this is taken from the default iTunes:subtitle.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesSummaryChoice">' . __('iTunes:Summary', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesSummaryChoice" name="iTunesSummaryChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesSummaryChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesSummaryChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_iTunesSummary" value="' . attribute_escape(stripslashes($this->settings['iTunes']['summary'])) . '" />' . "\n";
         echo '					<div id="iTunesSummaryWrapper" style="display: none;">' . "\n";
         echo '						<textarea name="iTunesSummary" id="iTunesSummary" class="podpress_wide_text_field" rows="6" cols="40" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . stripslashes($data['iTunesSummary']) . '</textarea>' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesSummaryHelp">' . "\n";
         echo '						' . __('The description of the podcast.', 'podpress') . ' ' . __('By default this is taken from the default iTunes:Summary or the default description.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesImageChoice">' . __('iTunes:Image', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					' . __('The iTunes image should be a square image with <a href="http://www.apple.com/itunes/podcasts/specs.html#image" target="_blank">at least 1400 x 1400 pixels</a> as Apple writes in "<a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank">Making a Podcast</a>" of their own Podcasting Resources. iTunes supports JPEG and PNG images (the file name extensions should ".jpg" or ".png").', 'podpress') . "\n";
         echo '					<br/>';
         echo '					<select id="iTunesImageChoice" name="iTunesImageChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesImageChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesImageChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesImageWrapper" style="display: none;">' . "\n";
         echo '						<br/>';
         echo '						<input id="iTunesImage" type="text" name="iTunesImage" value="' . $data['iTunesImage'] . '" class="podpress_wide_text_field" size="40" onchange="podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>' . "\n";
         echo '						<input id="global_iTunesImage" type="hidden" value="' . $this->settings['iTunes']['image'] . '"/>' . "\n";
         echo '					</div>' . "\n";
         echo '					<br/>';
         echo '					<img id="itunes_image_display" style="width:300px; height:300px;" alt="' . __('Podcast Image - Big (If you can not see an image then the URL is wrong.)', 'podpress') . '" src="" /><br />' . "\n";
         echo '					<em>' . __('(This image is only a preview which is limited to 300 x 300 pixels.) ', 'podpress') . '</em>';
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesAuthorChoice">' . __('iTunes:Author/Owner', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesAuthorChoice" name="iTunesAuthorChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesAuthorChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes($this->settings['iTunes']['author'])), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesAuthorChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesAuthorWrapper" style="display: none;">' . "\n";
         echo '						<input type="text" name="iTunesAuthor" class="podpress_wide_text_field" size="40" id="iTunesAuthor" value="' . attribute_escape(stripslashes($data['iTunesAuthor'])) . '" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>';
         echo '						<input type="hidden" id="global_iTunesAuthor" value="' . attribute_escape(stripslashes($this->settings['iTunes']['author'])) . '" />' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesAuthorHelp">' . "\n";
         echo '						' . __('Used if this Author is different than the feeds author.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			<tr>' . "\n";
         echo '			</tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesAuthorEmailChoice">' . __('Owner E-mail address', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesAuthorEmailChoice" name="iTunesAuthorEmailChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesAuthorEmailChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes(get_option('admin_email'))), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesAuthorEmailChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesAuthorEmailWrapper" style="display: none;">' . "\n";
         echo '						<input type="text" name="iTunesAuthorEmail" class="podpress_wide_text_field" size="40" id="iTunesAuthorEmail" value="' . attribute_escape(stripslashes($data['iTunesAuthorEmail'])) . '" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>';
         echo '						<input type="hidden" id="global_iTunesAuthorEmail" value="' . attribute_escape(stripslashes(get_option('admin_email'))) . '" />' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesAuthorEmailHelp">' . "\n";
         echo '						' . __('Used if the owner of this category is different than the feeds owner.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesKeywordsChoice">' . __('iTunes:Keywords', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesKeywordsChoice" name="iTunesKeywordsChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['iTunesKeywordsChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(stripslashes($this->settings['iTunes']['keywords']), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['iTunesKeywordsChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesKeywordsWrapper">' . "\n";
         echo '						' . __('a list of max. 12 comma separated words', 'podpress') . '<br/><textarea name="iTunesKeywords" rows="4" cols="40">' . stripslashes($data['iTunesKeywords']) . '</textarea>' . "\n";
         echo '					</div>' . "\n";
         echo '					<div id="iTunesKeywordsHelp">' . "\n";
         echo '						' . __('Not visible in iTunes, but used for searches.', 'podpress') . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr> ' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesCategory_0">' . __('iTunes:Categories', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesCategory_0" name="iTunesCategory[0]" onchange="podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<optgroup label="' . __('Select Primary', 'podpress') . '">' . "\n";
         if ('' == trim($this->settings['iTunes']['category'][0])) {
             $current_global = '[ ' . __('nothing', 'podpress') . ' ]';
         } else {
             $current_global = $this->settings['iTunes']['category'][0];
         }
         echo '						<option value="##Global##" ';
         if ($data['iTunesCategory'][0] == '##Global##' || empty($data['iTunesCategory'][0])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $current_global . ')</option>' . "\n";
         if (empty($data['iTunesCategory'][0])) {
             podPress_itunesCategoryOptions('##Global##');
         } else {
             podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][0]));
         }
         echo '						</optgroup>' . "\n";
         echo '					</select><br/>' . "\n";
         echo '					<input type="hidden" id="global_iTunesCategory" value="' . attribute_escape($this->settings['iTunes']['category'][0]) . '" />' . "\n";
         echo '					<select name="iTunesCategory[1]">' . "\n";
         echo '						<optgroup label="' . __('Select Second', 'podpress') . '">' . "\n";
         if ('' == trim($this->settings['iTunes']['category'][1])) {
             $current_global = '[ ' . __('nothing', 'podpress') . ' ]';
         } else {
             $current_global = $this->settings['iTunes']['category'][1];
         }
         echo '						<option value="##Global##" ';
         if ($data['iTunesCategory'][1] == '##Global##' || empty($data['iTunesCategory'][1])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $current_global . ')</option>' . "\n";
         if (empty($data['iTunesCategory'][1])) {
             podPress_itunesCategoryOptions('##Global##');
         } else {
             podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][1]));
         }
         echo '						</optgroup>' . "\n";
         echo '					</select><br/>' . "\n";
         echo '					<select name="iTunesCategory[2]">' . "\n";
         echo '						<optgroup label="' . __('Select Third', 'podpress') . '">' . "\n";
         if ('' == trim($this->settings['iTunes']['category'][2])) {
             $current_global = '[ ' . __('nothing', 'podpress') . ' ]';
         } else {
             $current_global = $this->settings['iTunes']['category'][2];
         }
         echo '						<option value="##Global##" ';
         if ($data['iTunesCategory'][2] == '##Global##' || empty($data['iTunesCategory'][2])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $current_global . ')</option>' . "\n";
         if (empty($data['iTunesCategory'][2])) {
             podPress_itunesCategoryOptions('##Global##');
         } else {
             podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][2]));
         }
         echo '						</optgroup>' . "\n";
         echo '					</select>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesExplicit">' . __('iTunes:Explicit', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesExplicit" name="iTunesExplicit" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['iTunesExplicit'] == '##Global##' || empty($data['iTunesExplicit'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $this->settings['iTunes']['explicit'] . ')</option>' . "\n";
         echo '						<option value="No" ';
         if ($data['iTunesExplicit'] == 'No') {
             echo 'selected="selected"';
         }
         echo '>' . __('No', 'podpress') . '</option>' . "\n";
         echo '						<option value="Yes" ';
         if ($data['iTunesExplicit'] == 'Yes') {
             echo 'selected="selected"';
         }
         echo '>' . __('Yes', 'podpress') . '</option>' . "\n";
         echo '						<option value="Clean" ';
         if ($data['iTunesExplicit'] == 'Clean') {
             echo 'selected="selected"';
         }
         echo '>' . __('Clean', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="iTunesExplicitHelp">' . "\n";
         echo '					' . __('Setting to indicate (in iTunes) whether or not your podcast contains explicit language or adult content', 'podpress') . "\n";
         echo '					<br/>' . __('"No" (default) - no indicator will show up', 'podpress') . "\n";
         echo '					<br/>' . __('"Yes" - an "EXPLICIT" parental advisory graphic will appear next to your podcast artwork or name in iTunes', 'podpress') . "\n";
         echo '					<br/>' . __('"Clean" - means that you are sure that no explicit language or adult content is included any of the episodes, and a "CLEAN" graphic will appear', 'podpress') . "\n";
         echo '					<p>' . __('You have also the possibility to adjust this option for each post or page with at least one podcast episode (in the post/page editor).', 'podpress') . '</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesBlock">' . __('iTunes:Block', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="iTunesBlock" name="iTunesBlock" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['iTunesBlock'] != '##Global##' || empty($data['itunesBlock'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . $this->settings['iTunes']['block'] . ')</option>' . "\n";
         echo '						<option value="No" ';
         if ($data['iTunesBlock'] == 'No') {
             echo 'selected="selected"';
         }
         echo '>' . __('No', 'podpress') . '</option>' . "\n";
         echo '						<option value="Yes" ';
         if ($data['iTunesBlock'] == 'Yes') {
             echo 'selected="selected"';
         }
         echo '>' . __('Yes', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="itunesBlockHelp">' . "\n";
         echo '					' . __('Use this if you are no longer creating a podcast and you want it removed from the iTunes Store.', 'podpress') . "\n";
         echo '					<br/>' . __('"No" (default) - the podcast appears in the iTunes Podcast directory', 'podpress') . "\n";
         echo '					<br/>' . __('"Yes" - prevent the entire podcast from appearing in the iTunes Podcast directory', 'podpress') . "\n";
         echo '					<p>' . __('You can also use such an option for each of your podcast episodes (in the post/page editor).', 'podpress') . '</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr> ' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesFeedID">' . __('iTunes:FeedID', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<input name="iTunesFeedID" id="iTunesFeedID" type="text" value="' . attribute_escape($data['iTunesFeedID']) . '" size="10" /> ' . __('(Only relevant for the podPress Feed Buttons widget)', 'podpress');
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr> ' . "\n";
         echo '				<th>';
         echo '					<label for="iTunesNewFeedURL">' . __('iTunes:New-Feed-Url', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td>';
         echo '					<select name="iTunesNewFeedURL" id="iTunesNewFeedURL">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['iTunesNewFeedURL'] == '##Global##' || empty($data['iTunesNewFeedURL'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Disable" ';
         if ($data['iTunesNewFeedURL'] == 'Disable') {
             echo 'selected="selected"';
         }
         echo '>' . __('Disable', 'podpress') . '</option>' . "\n";
         echo '						<option value="Enable" ';
         if ($data['iTunesNewFeedURL'] == 'Enable') {
             echo 'selected="selected"';
         }
         echo '>' . __('Enable', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '				</td>';
         echo '				<td>';
         echo '					' . __('If you want to change the URL of your podcast feed which you have used in the iTunes Store then change the "Podcast Feed URL" and set this option to "Enable" until the iTunes Store recognizes the new URL. This may take several days. "Enable" will add the <code>&lt;itunes:new-feed-url&gt;</code> tag to the RSS feeds and set the "Podcast Feed URL" as the new URL. For further information about "<a href="http://www.apple.com/itunes/podcasts/specs.html#changing" title="iTunes Podcasting Resources: Changing Your Feed URL" target="_blank">Changing Your Feed URL</a>" read on in the <a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank" title="iTunes Podcasting Resources: Making a Podcast">iTunes Podcasting Resources</a>.', 'podpress') . "\n";
         echo '					<p><label for="podcastFeedURL"><strong>' . __('the new Feed URL', 'podpress') . '</strong></label>';
         echo '					<br/>';
         echo '					<input type="text" id="podcastFeedURL" name="podcastFeedURL" class="podpress_wide_text_field" size="40" value="' . attribute_escape($data['podcastFeedURL']) . '" /><br />' . __('The URL of your Podcast Feed. If you want to register your podcast at the iTunes Store or if your podcast is already listed there then this input field should contain the same URL as in the iTunes Store settings. If you want change the URL at the iTunes Store then please read first the help text of the iTunes:New-Feed-Url option.', 'podpress');
         echo '					<br /><input type="button" value="' . __('Validate your Feed', 'podpress') . '" onclick="javascript: if(document.getElementById(\'podcastFeedURL\').value != \'\') { window.open(\'http://www.feedvalidator.org/check.cgi?url=\'+document.getElementById(\'podcastFeedURL\').value); }"/>' . "\n";
         echo '				</p></td>' . "\n";
         echo '			</tr>' . "\n";
         echo '		</table>' . "\n";
         echo '		<h3>' . __('General Feed Settings', 'podpress') . '</h3>' . "\n";
         echo '		<table class="podpress_feed_gensettings">' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="blognameChoice">' . __('Podcast title / Feed title', 'podpress') . '</label>';
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="blognameChoice" name="blognameChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Append" ';
         if ($data['blognameChoice'] == 'Append' || empty($data['blognameChoice'])) {
             echo 'selected="selected"';
         }
         echo '>' . sprintf(__('Use the Site Title and append the name of the %1$s', 'podpress'), $taxonomy_str) . '</option>' . "\n";
         echo '						<option value="Global" ';
         if ($data['blognameChoice'] == 'Global') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use the Site Title', 'podpress') . '</option>' . "\n";
         echo '						<option value="CategoryName" ';
         if ($data['blognameChoice'] == 'CategoryName') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use the name of the category', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_blogname" value="' . attribute_escape(stripslashes(get_option('blogname'))) . '" /></td>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="blogdescriptionChoice">' . __('Description (Tagline)', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="blogdescriptionChoice" name="blogdescriptionChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['blogdescriptionChoice'] != 'CategoryDescription') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="CategoryDescription" ';
         if ($data['blogdescriptionChoice'] == 'CategoryDescription') {
             echo 'selected="selected"';
         }
         echo '>' . sprintf(__('Use %1$s Description', 'podpress'), $taxonomy_str) . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_blogdescription" value="' . attribute_escape(stripslashes(get_option('blogdescription'))) . '" />' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="rss_imageChoice">' . __('Blog/RSS Image (144 x 144 pixels)', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="rss_imageChoice" name="rss_imageChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['rss_imageChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . '</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['rss_imageChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="rss_imageWrapper" style="display: none;">' . "\n";
         echo '						<br/>';
         echo '						<input id="rss_image" type="text" name="rss_image" value="' . $data['rss_image'] . '" class="podpress_wide_text_field" size="40" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>' . "\n";
         echo '						<input id="global_rss_image" type="hidden" value="' . get_option('rss_image') . '"/>' . "\n";
         echo '					</div>' . "\n";
         echo '					<br/>';
         echo '					<img id="rss_image_Display" style="width:144px; height:144px;" alt="' . __('Podcast Image - Small (If you can not see an image then the URL is wrong.)', 'podpress') . '" src="" />' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '					<label for="rss_language">' . __('Language', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         $langs = podPress_itunesLanguageArray();
         echo '					<select id="rss_language" name="rss_language" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<optgroup label="' . __('Select Language', 'podpress') . '">' . "\n";
         echo '						<option value="##Global##" ';
         if ($data['rss_language'] == '##Global##' || empty($data['rss_language'])) {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' - ' . $langs[get_option('rss_language')] . ' [' . get_option('rss_language') . ']</option>' . "\n";
         podPress_itunesLanguageOptions($data['rss_language']);
         echo '						</optgroup>' . "\n";
         echo '					</select>' . "\n";
         echo '					<input type="hidden" id="global_rss_language" value="' . $langs[get_option('rss_language')] . '[' . attribute_escape(get_option('rss_language')) . ']" /></td>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '		</table>' . "\n";
         echo '		<h3>' . __('Further Feed Settings', 'podpress') . '</h3>' . "\n";
         echo '		<table class="podpress_feed_gensettings">' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>' . "\n";
         echo '					<label for="rss_copyrightChoice">' . __('Feed Copyright / license name', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="rss_copyrightChoice" name="rss_copyrightChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['rss_copyrightChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes($this->settings['rss_copyright'])), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['rss_copyrightChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="rss_copyrightWrapper" style="display: none;">' . "\n";
         echo '						<input type="text" name="rss_copyright" class="podpress_wide_text_field" size="40" id="rss_copyright" value="' . attribute_escape(stripslashes($data['rss_copyright'])) . '" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');"/>';
         echo '					</div>' . "\n";
         echo '					<input type="hidden" id="global_rss_copyright" value="' . attribute_escape(stripslashes($this->settings['rss_copyright'])) . '" />' . "\n";
         echo '					<div id="rss_copyrightHelp">' . "\n";
         echo '						' . __('Enter the copyright string or license name. For example: Copyright &#169 by Jon Doe, 2009 OR <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">CreativeCommons Attribution-Noncommercial-Share Alike 2.5</a>', 'podpress') . "\n";
         echo '						<p>' . "\n";
         echo '						' . __('Used if this copyright phrase should be different than the global copyright phrase.', 'podpress') . "\n";
         echo '						</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>' . "\n";
         echo '					<label for="rss_license_urlChoice">' . __('URL to the full Copyright / license text', 'podpress') . '</label>' . "\n";
         echo '				</th>';
         echo '				<td colspan="2">';
         echo '					<select id="rss_license_urlChoice" name="rss_license_urlChoice" onchange="javascript: podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\');">' . "\n";
         echo '						<option value="Global" ';
         if ($data['rss_license_urlChoice'] != 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Use Global', 'podpress') . ' (' . podPress_stringLimiter(ucfirst(stripslashes($this->settings['rss_license_url'])), 40) . ')</option>' . "\n";
         echo '						<option value="Custom" ';
         if ($data['rss_license_urlChoice'] == 'Custom') {
             echo 'selected="selected"';
         }
         echo '>' . __('Insert custom value', 'podpress') . '</option>' . "\n";
         echo '					</select>' . "\n";
         echo '					<div id="rss_license_urlWrapper" style="display: none;">' . "\n";
         echo '						<input name="rss_license_url" type="text" id="rss_license_url" class="podpress_wide_text_field" value="' . attribute_escape($data['rss_license_url']) . '" size="65%" />' . "\n";
         echo '					</div>' . "\n";
         echo '					<input type="hidden" id="global_rss_license_url" value="' . attribute_escape($this->settings['rss_license_url']) . '" />' . "\n";
         echo '					<div id="rss_license_urlHelp">' . "\n";
         echo '						' . __('If you use a special license like a <a href="http://creativecommons.org/licenses" target="_blank" title="Creative Commons">Creative Commons</a> License for your news feeds then enter the complete URL (e.g. <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">http://creativecommons.org/licenses/by-nc-sa/2.5/</a>) to the full text of this particular license here.', 'podpress') . "\n";
         echo '						<p>' . __('Used if this license URL should be different than the global license URL.', 'podpress') . '</p>' . "\n";
         echo '					</div>' . "\n";
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         $filetypes = podPress_filetypes();
         $selected_types = $data['FileTypes'];
         if (FALSE === is_array($data['FileTypes'])) {
             $selected_types = array();
         }
         echo '				<th>';
         echo '				' . __('inlude only files of this(these) type(s)', 'podpress');
         echo '				</th>' . "\n";
         echo '				<td>';
         echo '					<select id="filenameextensionfilter" name="FileTypes[]" size="5" multiple="multiple" style="height:15em;">' . "\n";
         echo '					<optgroup label="' . attribute_escape(__('Select file types', 'podpress')) . '">' . "\n";
         foreach ($filetypes as $key => $value) {
             if (TRUE == in_array($key, $selected_types)) {
                 $selected = ' selected="selected"';
             } else {
                 $selected = '';
             }
             if ($key !== 'audio_mp4') {
                 echo '						<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
             }
         }
         echo '					</optgroup>' . "\n";
         echo '					</select>' . "\n";
         echo '				</td>' . "\n";
         echo '				<td>';
         echo '					' . __('You can select one or more media file types and limit by this choice the number of posts which will appear in the this Feed. For instance: if you select MP4 Video then this Feed will only contain posts (of this category) with MP4 files. If a post has also files of other types then only the files of the selected type will be attached in this feed. (This filter bypasses the "Included in:" selection.)', 'podpress') . '</p><p>' . __('Hold the key [SHIFT] or [CTRL] and use the left mouse button to select more than one value.<br />Hold [CTRL] and use the left mouse button to deselect values.', 'podpress');
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '			<tr>' . "\n";
         echo '				<th>';
         echo '				<label for="show_only_podPress_podcasts">' . __('Include only posts with podPress attachments in this Feed', 'podpress') . '</label>' . "\n";
         echo '				</th>' . "\n";
         echo '				<td>';
         if (TRUE == isset($data['show_only_podPress_podcasts']) and FALSE === $data['show_only_podPress_podcasts']) {
             echo '					<input type="checkbox" name="show_only_podPress_podcasts" id="show_only_podPress_podcasts" value="yes" />' . "\n";
         } else {
             echo '					<input type="checkbox" name="show_only_podPress_podcasts" id="show_only_podPress_podcasts" value="yes" checked="checked" />' . "\n";
         }
         echo '				</td>' . "\n";
         echo '				<td>';
         echo '					' . __('works only while the File Type Filter is not in use', 'podpress');
         echo '				</td>' . "\n";
         echo '			</tr>' . "\n";
         echo '		</table>' . "\n";
         echo '		</fieldset>' . "\n";
         echo '	</div>' . "\n";
         echo '<script type="text/javascript">podPress_updateCategoryCasting(' . $main_wp_version . ', \'' . $taxonomy . '\'); </script>';
         echo '</div>' . "\n";
     }
 }
コード例 #2
0
function podPress_itunesLanguageOptions($current = 'en-us')
{
    $langs = podPress_itunesLanguageArray();
    reset($langs);
    foreach ($langs as $key => $value) {
        echo '<option value="' . $key . '"';
        if ($key == $current) {
            echo ' selected="selected"';
        }
        echo '>' . $value . ' [' . $key . ']</option>' . "\n";
    }
}