: <span class="cvm_height" id="cvm_calc_height"><?php 
echo cvm_player_height($player_opt['aspect_ratio'], $player_opt['width']);
?>
</span>px
						</td>
					</tr>
					
					<tr>
						<th><label for="cvm_video_position"><?php 
_e('Display video in custom post', 'cvm_video');
?>
:</label></th>
						<td>
							<?php 
$args = array('options' => array('above-content' => __('Above post content', 'cvm_video'), 'below-content' => __('Below post content', 'cvm_video')), 'name' => 'video_position', 'id' => 'cvm_video_position', 'selected' => $player_opt['video_position']);
cvm_select($args);
?>
						</td>
					</tr>
					
					<tr>
						<th><label for="cvm_volume"><?php 
_e('Volume', 'cvm_video');
?>
</label>:</th>
						<td>
							<input type="text" name="volume" id="cvm_volume" value="<?php 
echo $player_opt['volume'];
?>
" size="1" maxlength="3" />
							<label for="cvm_volume"><span class="description">( <?php 
Пример #2
0
/**
 * Modal window post edit shortcode output
 */
function cvm_post_edit_modal()
{
    global $post, $CVM_POST_TYPE;
    if (!$post || $CVM_POST_TYPE->get_post_type() == $post->post_type) {
        return;
    }
    $options = cvm_get_player_settings();
    ?>
	<div id="CVMVideo_Modal_Window" style="display:none;">	
		<div class="wrap">
			<div id="cvm-playlist-items">
				<div class="inside">
					<h2><?php 
    _e('Playlist settings', 'cvm_video');
    ?>
</h2>
					<div id="cvm-playlist-settings" class="cvm-player-settings-options">
						<table>
							<tr>
								<th><label for="cvm_playlist_theme"><?php 
    _e('Theme', 'cvm_video');
    ?>
:</label></th>
								<td>
								<?php 
    $playlist_themes = cvm_playlist_themes();
    cvm_select(array('name' => 'cvm_playlist_theme', 'id' => 'cvm_playlist_theme', 'options' => $playlist_themes));
    ?>
								</td>
							</tr>
							<tr>
								<th><label for="cvm_aspect_ratio"><?php 
    _e('Aspect', 'cvm_video');
    ?>
:</label></th>
								<td>
								<?php 
    $args = array('options' => array('4x3' => '4x3', '16x9' => '16x9'), 'name' => 'aspect_ratio', 'id' => 'aspect_ratio', 'class' => 'cvm_aspect_ratio');
    cvm_select($args);
    ?>
								</td>
							</tr>
							
							<tr>
								<th><label for="width"><?php 
    _e('Width', 'cvm_video');
    ?>
:</label></th>
								<td>
									<input type="text" class="cvm_width" name="width" id="width" value="<?php 
    echo $options['width'];
    ?>
" size="2" />px
									| <?php 
    _e('Height', 'cvm_video');
    ?>
 : <span class="cvm_height" id="cvm_calc_height"><?php 
    echo cvm_player_height($options['aspect_ratio'], $options['width']);
    ?>
</span>px
								</td>
							</tr>
							
							<tr>
								<th><label for="volume"><?php 
    _e('Volume', 'cvm_video');
    ?>
</label>:</th>
								<td>
									<input type="text" name="volume" id="volume" value="<?php 
    echo $options['volume'];
    ?>
" size="1" maxlength="3" />
									<label for="volume"><span class="description"><?php 
    _e('number between 0 (mute) and 100 (max)', 'cvm_video');
    ?>
</span></label>
								</td>
							</tr>
						</table>
						<input type="button" id="cvm-insert-playlist-shortcode" class="button primary" value="<?php 
    _e('Insert playlist', 'cvm_video');
    ?>
" />						
					</div>
					
					<input type="hidden" name="cvm_selected_items"  value="" />
					<h2><?php 
    _e('Videos in playlist', 'cvm_video');
    ?>
</h2>
					
					<div id="cvm-list-items">
						<em><?php 
    _e('No video selected', 'cvm_video');
    ?>
<br /><?php 
    _e('To create a playlist check some videos from the list on the right.', 'cvm_video');
    ?>
</em>
					</div>
				</div>	
			</div>
			<div id="cvm-display-videos">
				<iframe src="edit.php?post_type=<?php 
    echo $CVM_POST_TYPE->get_post_type();
    ?>
&page=cvm_videos" frameborder="0" width="100%" height="100%"></iframe>
			</div>
		</div>	
	</div>
	<?php 
}
    public function post_video_settings_meta_box()
    {
        global $post;
        $settings = cvm_get_video_settings($post->ID);
        wp_nonce_field('cvm-save-video-settings', 'cvm-video-nonce');
        ?>
<table class="form-table cvm-player-settings-options">
	<tbody>
		<tr>
			<th><label for="cvm_aspect_ratio"><?php 
        _e('Player size', 'cvm_video');
        ?>
:</label></th>
			<td>
				<label for="cvm_aspect_ratio"><?php 
        _e('Aspect ratio');
        ?>
:</label>
				<?php 
        $args = array('options' => array('4x3' => '4x3', '16x9' => '16x9'), 'name' => 'aspect_ratio', 'id' => 'cvm_aspect_ratio', 'class' => 'cvm_aspect_ratio', 'selected' => $settings['aspect_ratio']);
        cvm_select($args);
        ?>
				<label for="cvm_width"><?php 
        _e('Width', 'cvm_video');
        ?>
 :</label>
				<input type="text" name="width" id="cvm_width" class="cvm_width" value="<?php 
        echo $settings['width'];
        ?>
" size="2" />px
				| <?php 
        _e('Height', 'cvm_video');
        ?>
 : <span class="cvm_height" id="cvm_calc_height"><?php 
        echo cvm_player_height($settings['aspect_ratio'], $settings['width']);
        ?>
</span>px
			</td>
		</tr>
				
		<tr>
			<th><label for="cvm_video_position"><?php 
        _e('Video position', 'cvm_video');
        ?>
:</label></th>
			<td>
				<?php 
        $args = array('options' => array('above-content' => __('Above post content', 'cvm_video'), 'below-content' => __('Below post content', 'cvm_video')), 'name' => 'video_position', 'id' => 'cvm_video_position', 'selected' => $settings['video_position']);
        cvm_select($args);
        ?>
			</td>
		</tr>
		<tr>
			<th><label for="cvm_volume"><?php 
        _e('Volume', 'cvm_video');
        ?>
:</label></th>
			<td>
				<input type="text" name="volume" id="cvm_volume" value="<?php 
        echo $settings['volume'];
        ?>
" size="1" maxlength="3" />
				<label for="cvm_volume"><span class="description">( <?php 
        _e('number between 0 (mute) and 100 (max)', 'cvm_video');
        ?>
 )</span></label>
			</td>
		</tr>
		<tr>
			<th><label for="cvm_autoplay"><?php 
        _e('Autoplay', 'cvm_video');
        ?>
:</label></th>
			<td>
				<input name="autoplay" id="cvm_autoplay" type="checkbox" value="1"<?php 
        cvm_check((bool) $settings['autoplay']);
        ?>
 />
				<label for="cvm_autoplay"><span class="description">( <?php 
        _e('when checked, video will start playing once page is loaded', 'cvm_video');
        ?>
 )</span></label>
			</td>
		</tr>
		
		<tr>
			<th><label for="title"><?php 
        _e('Show video title', 'cvm_video');
        ?>
:</label></th>
			<td>
				<input name="title" id="cvm_title" class="cvm_title" type="checkbox" value="1"<?php 
        cvm_check((bool) $settings['title']);
        ?>
 />
				<label for="cvm_title"><span class="description">( <?php 
        _e('when checked, player will display video title', 'cvm_video');
        ?>
 )</span></label>
			</td>
		</tr>
		
		<tr>
			<th><label for="cvm_fullscreen"><?php 
        _e('Allow full screen', 'cvm_video');
        ?>
:</label></th>
			<td>
				<input name="fullscreen" id="cvm_fullscreen" type="checkbox" value="1"<?php 
        cvm_check((bool) $settings['fullscreen']);
        ?>
 />
			</td>
		</tr>
		
		<tr>
			<th><label for="cvm_color"><?php 
        _e('Player color', 'cvm_video');
        ?>
:</label></th>
			<td>#<input type="text" name="color" id="cvm_color" value="<?php 
        echo $settings['color'];
        ?>
" /></td>
		</tr>
		
		<tr valign="top">
			<th scope="row"><label for="byline"><?php 
        _e('Show video author', 'cvm_video');
        ?>
:</label></th>
			<td>
				<input type="checkbox" value="1" id="byline" name="byline"<?php 
        cvm_check((bool) $settings['byline']);
        ?>
 />
				<span class="description"><?php 
        _e('When checked, player will display video uploader.', 'cvm_video');
        ?>
</span>
			</td>
		</tr>
		
		<tr valign="top">
			<th scope="row"><label for="portrait"><?php 
        _e('Author portrait', 'cvm_video');
        ?>
:</label></th>
			<td>
				<input type="checkbox" value="1" id="portrait" name="portrait"<?php 
        cvm_check((bool) $settings['portrait']);
        ?>
 />
				<span class="description"><?php 
        _e('When checked, player will display uploader image.', 'cvm_video');
        ?>
</span>
			</td>
		</tr>
		
	</tbody>
</table>
<?php 
    }