Esempio n. 1
0
" />
<?php 
    if (!empty($all)) {
        ?>
<input type="button" value="<?php 
        _e('Cancel');
        ?>
" onclick="cancelUpload()" />
<?php 
    }
    ?>
</div>
</td>
</tr>
</table>
</div>
</form>
<?php 
} elseif ($action == 'links') {
    ?>
<div id="links">
<?php 
    the_attachment_links($attachment);
    ?>
</div>
<?php 
}
?>
</body>
</html>
function wp_upload_view() {
	global $style, $post_id, $style;
	$id = get_the_ID();
	$attachment_data = wp_get_attachment_metadata( $id );
?>
	<div id="upload-file">
		<div id="file-title">
			<h2><?php if ( !isset($attachment_data['width']) && 'inline' != $style )
					echo "<a href='" . wp_get_attachment_url() . "' title='" . __('Direct link to file') . "'>";
				the_title();
				if ( !isset($attachment_data['width']) && 'inline' != $style )
					echo '</a>';
			?></h2>
			<span><?php
				echo '[&nbsp;';
				echo '<a href="' . get_permalink() . '">' . __('view') . '</a>';
				echo '&nbsp;|&nbsp;';
					echo '<a href="' . clean_url(add_query_arg('action', 'edit')) . '" title="' . __('Edit this file') . '">' . __('edit') . '</a>';
				echo '&nbsp;|&nbsp;';
				echo '<a href="' . clean_url(remove_query_arg(array('action', 'ID'))) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>';
				echo '&nbsp;]'; ?></span>
		</div>

		<div id="upload-file-view" class="alignleft">
<?php		if ( isset($attachment_data['width']) && 'inline' != $style )
			echo "<a href='" . wp_get_attachment_url() . "' title='" . __('Direct link to file') . "'>";
		echo wp_upload_display( array(171, 128) );
		if ( isset($attachment_data['width']) && 'inline' != $style )
			echo '</a>'; ?>
		</div>
		<?php the_attachment_links( $id ); ?>
	</div>
<?php	echo "<form action='' id='browse-form'><input type='hidden' id='nonce-value' value='" . wp_create_nonce( 'inlineuploading' )  . "' /></form>\n";
}
<tr>
<th scope="row" align="right"><label for="descr"><?php _e('Description:'); ?></label></th>
<td><input type="textarea" name="descr" id="descr" value="" /></td>
</tr>
<tr id="buttons">
<th></th>
<td>
<input type="hidden" name="action" value="save" />
<input type="hidden" name="post" value="<?php echo $post; ?>" />
<input type="hidden" name="all" value="<?php echo $all; ?>" />
<input type="hidden" name="start" value="<?php echo $start; ?>" />
<?php wp_nonce_field( 'inlineuploading' ); ?>
<div id="submit">
<input type="submit" value="<?php _e('Upload'); ?>" />
<?php if ( !empty($all) ) : ?>
<input type="button" value="<?php _e('Cancel'); ?>" onclick="cancelUpload()" />
<?php endif; ?>
</div>
</td>
</tr>
</table>
</div>
</form>
<?php elseif ( $action == 'links' ) : ?>
<div id="links">
<?php the_attachment_links($attachment); ?>
</div>
<?php endif; ?>
</body>
</html>