本文整理汇总了PHP中media_upload_header函数的典型用法代码示例。如果您正苦于以下问题:PHP media_upload_header函数的具体用法?PHP media_upload_header怎么用?PHP media_upload_header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了media_upload_header函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: S2FilePicker_frame
function S2FilePicker_frame()
{
media_upload_header();
$path = WP_PLUGIN_DIR . '/s2member-files';
$files = glob($path . '/*.{mp3,mp4,avi,mpeg,doc,docx,pdf,txt}', GLOB_BRACE);
$html = '<form action="" id="s2member-files-archive-form">';
foreach ($files as $i => $file) {
$html .= '<input type="checkbox" data-filename="' . basename($file) . '" class="file" name="file[]" />';
$html .= basename($file);
}
$html .= '
<br />
<br />
<button type="button" onclick="javascript:s2member_files_pick();">' . esc_attr(__('Link selected files')) . '</button>
<script>
function s2member_files_pick() {
jQuery("#s2member-files-archive-form").find("input[type=checkbox]:checked").each(function(index, el) {
var $check = jQuery(el);
parent.send_to_editor(\'[s2Link download="\' +$check.data("filename")+ \'" download_key="true" /]\');
});
parent.tb_remove();
}
</script>
</form>
';
echo $html;
}
开发者ID:hiryu85,项目名称:s2member-secure-file-picker,代码行数:28,代码来源:s2member-secure-file-picker.php
示例2: insert_media_upload
function insert_media_upload()
{
global $wp_version;
if ($wp_version < '2.6') {
add_action('admin_head_middmedia_media_upload', 'media_admin_css');
} else {
wp_admin_css('media');
}
media_upload_header();
return wp_iframe('middmedia_media_upload', $this);
}
开发者ID:adamfranco,项目名称:middmedia-wordpressplugin,代码行数:11,代码来源:middmedia.php
示例3: media_upload_crystal_form
function media_upload_crystal_form()
{
global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types, $redir_tab;
$redir_tab = 'crystal';
media_upload_header();
$post_id = intval($_REQUEST['post_id']);
$form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=crystal&post_id={$post_id}");
?>
<script type="text/javascript">
<!--
jQuery(function($){
var preloaded = $(".media-item.preloaded");
if ( preloaded.length > 0 ) {
preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
}
updateMediaForm();
});
-->
</script>
<form enctype="multipart/form-data" method="post" action="<?php
echo attribute_escape($form_action_url);
?>
" class="media-upload-form validate" id="gallery-form">
<div id="media-items">
<?php
echo get_media_items($post_id, $errors);
?>
</div>
<input type="submit" class="button" name="save" value="<?php
echo attribute_escape(__('Save all changes'));
?>
" />
<input type="submit" class="button" name="insert-gallery" value="<?php
echo attribute_escape(__('Insert Crystal gallery!'));
?>
" />
<input type="hidden" name="post_id" id="post_id" value="<?php
echo (int) $post_id;
?>
" />
<input type="hidden" name="type" value="<?php
echo attribute_escape($GLOBALS['type']);
?>
" />
<input type="hidden" name="tab" value="<?php
echo attribute_escape($GLOBALS['tab']);
?>
" />
</p>
</form>
<?php
}
开发者ID:shell,项目名称:Crystal-Gallery,代码行数:52,代码来源:crystal.php
示例4: media_upload_gallery_form
function media_upload_gallery_form($errors)
{
global $redir_tab, $type;
$redir_tab = 'gallery';
media_upload_header();
$post_id = intval($_REQUEST['post_id']);
$form_action_url = admin_url("media-upload.php?type={$type}&tab=gallery&post_id={$post_id}");
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
$form_class = 'media-upload-form validate';
if (get_user_setting('uploader')) {
$form_class .= ' html-uploader';
}
require_once dirname(__FILE__) . '/view/gallery_form.php';
}
开发者ID:par-orillonsoft,项目名称:creationOfSociety,代码行数:14,代码来源:init.php
示例5: upload_test_upload_form
function upload_test_upload_form()
{
//echos the tabs at the top of the media window
media_upload_header();
//Adds your javascript
upload_test_scripts();
?>
<div class="test-form">
<input type='text' id='name' />
<input id='insert_shortcode' type='button' class='button' value='Insert Shortcode'>
</div>
<?php
}
开发者ID:aaronbrosef,项目名称:Wordpress-Plugin--Media-Upload-Skeleton,代码行数:14,代码来源:upload-media.php
示例6: media_imgbedtab_form
function media_imgbedtab_form()
{
$post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
$files = imgbed_get_files($post_id);
media_upload_header();
if (is_array($files) && count($files) > 0) {
$msg = '点击图片添加到文章';
} else {
$msg = '还没有上传图片';
}
echo '<div style="margin-top:20px; margin:1em;"><h3 class="media-title">' . $msg . '</h3>';
echo '<script type="text/javascript">imgbed_files = ' . json_encode($files, true) . '</script>';
echo '<div id="media-tuku"></div></div>';
}
开发者ID:yakeing,项目名称:imgbed,代码行数:14,代码来源:media_imgbedtab_form.php
示例7: media_upload_flickr_form
function media_upload_flickr_form()
{
global $type, $tab, $post_mime_types, $flickr_manager;
add_filter('media_upload_tabs', array($flickr_manager, 'modifyMediaTab'));
?>
<div id="media-upload-header">
<?php
media_upload_header();
?>
</div>
<?php
flickrMediaBrowse();
}
开发者ID:jeremylightsmith,项目名称:blog,代码行数:15,代码来源:MediaPanel.php
示例8: media_cincopabox_process
function media_cincopabox_process()
{
if (isset($_REQUEST['wrt'])) {
_cpmp_media_upload_type_cincopa();
return;
}
if (sizeof($_POST) > 0) {
var_dump($_POST);
}
media_upload_header();
?>
<iframe src="<?php
echo _cpmp_url() . '/media-platform/start.aspx?ver=' . _cpmp_plugin_ver() . '&rdt=' . urlencode(_cpmp_selfURL() . "&");
?>
&" width="100%" height="98%"></iframe>
<?php
}
开发者ID:samuelshih,项目名称:daily-gazette,代码行数:17,代码来源:wp-media-cincopa.php
示例9: media_upload_type_s2sfu
/**
* Modified From media_upload_type_form in WordPress 3.2.1 Core
* {@internal Missing Short Description}}
*
* @since 2.5.0
*
* @param unknown_type $type
* @param unknown_type $errors
* @param unknown_type $id
*/
function media_upload_type_s2sfu($type = 'file', $errors = null, $id = null)
{
media_upload_header();
$post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
$form_action_url = admin_url("media-upload.php?type={$type}&tab=type&post_id={$post_id}");
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
?>
<form enctype="multipart/form-data" method="post" action="<?php
echo esc_attr($form_action_url);
?>
" class="media-upload-form type-form validate" id="<?php
echo $type;
?>
-form">
<?php
submit_button('', 'hidden', 'save', false);
?>
<input type="hidden" name="post_id" id="post_id" value="<?php
echo (int) $post_id;
?>
" />
<?php
wp_nonce_field('media-form');
?>
<h3 class="media-title"><?php
_e('Add media files from your computer');
?>
</h3>
<?php
s2sfu_media_upload_form($errors);
?>
</form>
<?php
}
开发者ID:hiryu85,项目名称:s2member-secure-file-uploader,代码行数:48,代码来源:s2member-secure-file-uploader.php
示例10: media_pac_pickapic_final_form
/**
* Download the picture selected, associate it to the post and displays the
* final form using get_media_item()
*
* @param noting.
* @return noting.
**/
function media_pac_pickapic_final_form()
{
global $type, $wp_version;
$post_id = absint($_REQUEST['post_id']);
$form_action_url = admin_url("media-upload.php?type={$type}&tab=pickapictab&post_id={$post_id}");
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
media_upload_header();
$flickr_info = pac_pickapic_flickr_getInfo($_POST['pac_pickapic_flickr_id']);
$photo_url = pac_pickapic_flickr_getSizes($_POST['pac_pickapic_flickr_id']);
if (is_wp_error($photo_url)) {
pac_pickapic_show_error($rsp_obj);
return;
}
?>
<form id="pickapic-media-form" enctype="multipart/form-data" action="<?php
echo esc_html($form_action_url);
?>
" class="media-upload-form type-form validate" method="post">
<?php
wp_nonce_field('media-form');
?>
<div id="media-items">
<?php
if (version_compare($wp_version, '3.4', '<')) {
$excerpt = __('Foto: ' . $flickr_info['owner'], 'pickapic');
} else {
$excerpt = __('Foto: ', 'pickapic') . "<a href='" . $flickr_info['url'] . "' target='_blank'>" . $flickr_info['owner'] . "</a>";
$show_license = pac_pickapic_get_option('flickrshowlicense');
if ($show_license) {
$flickr_licenses = unserialize(PICKAPIC_FLICKR_LICENSES);
$excerpt .= ' - ' . $flickr_licenses[$flickr_info['license']];
}
}
$attachment_id = pac_pickapic_media_sideload_image($photo_url, $post_id, '', array('post_title' => __($flickr_info['title'], 'pickapic'), 'post_excerpt' => $excerpt), $flickr_info['url'], $flickr_info['owner']);
if (is_wp_error($attachment_id)) {
echo '<div id="media-upload-error">' . esc_html($attachment_id->get_error_message()) . '</div></div>';
} else {
// Render the form content using get_media_item
$args = array('toggle' => false, 'show_title' => true);
echo get_media_item($attachment_id, $args);
}
?>
</div>
</form>
<?php
}
开发者ID:AK-Digitale-Gesellschaft,项目名称:flickr-pick-a-picture,代码行数:54,代码来源:pick-a-pic.php
示例11: thickboxInclude
function thickboxInclude()
{
$pages = array('ecordia-score', 'ecordia-keyword-analysis', 'ecordia-change-keywords', 'ecordia-tags', 'ecordia-serp', 'ecordia-seo-best-practices', 'ecordia-error');
if (defined('ECORDIA_DEBUG') && ECORDIA_DEBUG) {
$pages[] = 'ecordia-debug';
}
$tab = in_array($_GET['tab'], $pages) ? $_GET['tab'] : 'ecordia-score';
$page = str_replace('ecordia-', '', $tab);
if (false === strpos($tab, 'error')) {
add_filter('media_upload_tabs', array(&$this, 'thickboxTabs'));
media_upload_header();
}
$info = $this->getSeoInfoForPost($_GET['post']);
if (false === $info && false === strpos($tab, 'error')) {
print '<form><p>No analysis present.</p></form>';
return;
}
include 'views/popup/' . $page . '.php';
}
开发者ID:simpsonjulian,项目名称:puppet-wordpress,代码行数:19,代码来源:scribe.php
示例12: media_upload_shared_media
/**
* {@internal Missing Short Description}}
*
* @since 2.5.0
*
* @param unknown_type $errors
*/
function media_upload_shared_media($errors)
{
global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types, $blog_id;
media_upload_header();
if (count($this->blogs) == 0) {
echo '<form><h3 class="media-title">' . __("You don't have access to any other sites media...", 'networksharedmedia') . '</h3></form>';
return;
}
// set the first part of the form action url now, to the current active site, to prevent X-Frame-Options problems
$form_action_url = plugins_url('media-upload.php', __FILE__);
$nsm_blog_id = null;
if (!array_key_exists('blog_id', $_GET)) {
$_GET['blog_id'] = null;
}
foreach ($this->blogs as $blog) {
if ($_GET['blog_id'] == $blog['blog_id']) {
$nsm_blog_id = $blog['blog_id'];
break;
}
}
if (null == $nsm_blog_id) {
$nsm_blog_id = $this->blogs[0]['blog_id'];
}
switch_to_blog($nsm_blog_id);
?>
<?php
$post_id = intval($_REQUEST['post_id']);
// fix to make get_media_item add "Insert" button
unset($_GET['post_id']);
$form_action_url .= "?type={$type}&tab=library&post_id={$post_id}&blog_id={$blog_id}";
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
$form_class = 'media-upload-form validate';
$_GET['paged'] = isset($_GET['paged']) ? intval($_GET['paged']) : 0;
if ($_GET['paged'] < 1) {
$_GET['paged'] = 1;
}
$start = ($_GET['paged'] - 1) * 10;
if ($start < 1) {
$start = 0;
}
add_filter('post_limits', create_function('$a', "return 'LIMIT {$start}, 10';"));
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
?>
<form id="filter" action="" method="get">
<input type="hidden" name="type" value="<?php
echo esc_attr($type);
?>
" />
<input type="hidden" name="tab" value="<?php
echo esc_attr($tab);
?>
" />
<input type="hidden" name="post_id" value="<?php
echo (int) $post_id;
?>
" />
<input type="hidden" name="blog_id" value="<?php
echo (int) $blog_id;
?>
" />
<input type="hidden" name="post_mime_type" value="<?php
echo isset($_GET['post_mime_type']) ? esc_attr($_GET['post_mime_type']) : '';
?>
" />
<?php
if (isset($_GET['chromeless'])) {
?>
<input type="hidden" name="chromeless" value="<?php
echo (bool) $_GET['chromeless'];
?>
" />
<?php
}
?>
<style type="text/css">
#media-upload #filter .nsm-site-select { float: none; width: 100%; margin: 0 1em 2em 1em; white-space: normal; }
</style>
<ul class="subsubsub nsm-site-select">
<?php
if (count($this->blogs) == 1) {
$blog = reset($this->blogs);
echo "<li>" . __('Selected site:', 'networksharedmedia') . "</li>" . "<li><a href='" . esc_url(add_query_arg(array('blog_id' => $blog['blog_id'], 'paged' => false))) . "' class='current'>" . $blog['name'] . '</a>' . '</li>';
} else {
$all_blog_names = array();
foreach ($this->blogs as $blog) {
$all_blog_names[] = $blog['name'];
}
if (strlen(__('Select site:', 'networksharedmedia') . ' ' . implode(' | ', $all_blog_names)) < 71) {
$blog_links = array();
//.........这里部分代码省略.........
开发者ID:Buooy,项目名称:wp_network_shared_media,代码行数:101,代码来源:network_shared_media.php
示例13: popup_wp_upload
function popup_wp_upload($errors)
{
global $redir_tab, $type, $tab;
$redir_tab = 'wp_upload';
media_upload_header();
$flash_action_url = admin_url('async-upload.php');
// If Mac and mod_security, no Flash. :(
$flash = true;
/*
if(false !== stripos($_SERVER['HTTP_USER_AGENT'], 'mac') && apache_mod_loaded('mod_security')) {
$flash = false;
}*/
$flash = apply_filters('flash_uploader', $flash);
$post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
$upload_size_unit = $max_upload_size = wp_max_upload_size();
$sizes = array('KB', 'MB', 'GB');
for ($u = -1; $upload_size_unit > 1024 && $u < count($sizes) - 1; $u++) {
$upload_size_unit /= 1024;
}
if ($u < 0) {
$upload_size_unit = 0;
$u = 0;
} else {
$upload_size_unit = (int) $upload_size_unit;
}
echo $this->messages(true);
?>
<div class="updated"><ul><li><?php
_e('Please update your WordPress to the latest version, in order to get the latest uploading system.', WYSIJA);
?>
</li></ul></div>
<div id="overlay"><img id="loader" src="<?php
echo WYSIJA_URL;
?>
img/wpspin_light.gif" /></div>
<div class="popup_content media-wp-upload">
<script type="text/javascript">
//<![CDATA[
var uploaderMode = 0;
jQuery(document).ready(function($){
uploaderMode = getUserSetting('uploader');
$('.upload-html-bypass a').click(function(){deleteUserSetting('uploader');uploaderMode=0;swfuploadPreLoad();return false;});
$('.upload-flash-bypass a').click(function(){setUserSetting('uploader', '1');uploaderMode=1;swfuploadPreLoad();return false;});
});
//]]>
</script>
<div id="media-upload-notice">
<?php
if (isset($errors['upload_notice'])) {
?>
<?php
echo $errors['upload_notice'];
?>
<?php
}
?>
</div>
<div id="media-upload-error">
<?php
if (isset($errors['upload_error']) && is_wp_error($errors['upload_error'])) {
?>
<?php
echo $errors['upload_error']->get_error_message();
?>
<?php
}
?>
</div>
<?php
// Check quota for this blog if multisite
if (is_multisite() && !is_upload_space_available()) {
echo '<p>' . sprintf(__('Sorry, you have filled your storage quota (%s MB).'), get_space_allowed()) . '</p>';
return;
}
do_action('pre-upload-ui');
if ($flash) {
?>
<script type="text/javascript">
//<![CDATA[
var swfu;
SWFUpload.onload = function() {
var settings = {
button_text: '<span class="button"><?php
_e('Select Files');
?>
<\/span>',
button_text_style: '.button { text-align: center; font-weight: bold; font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; font-size: 11px; text-shadow: 0 1px 0 #FFFFFF; color:#464646; }',
button_height: "23",
button_width: "132",
button_text_top_padding: 3,
button_image_url: '<?php
echo includes_url('images/upload.png?ver=20100531');
?>
',
button_placeholder_id: "flash-browse-button",
upload_url : "<?php
echo esc_attr($flash_action_url);
?>
",
//.........这里部分代码省略.........
开发者ID:sontv1003,项目名称:fashionbeans,代码行数:101,代码来源:campaigns.php
示例14: fpGrabFromURLIframe
function fpGrabFromURLIframe()
{
media_upload_header();
if (isset($_POST['grabfrom_url'])) {
// this is an upload request. let's see!
$attachmentId = fpHandleUpload();
if (is_wp_error($attachmentId)) {
fpUploadForm('<div class="error form-invalid">' . $attachmentId->get_error_message() . '</div>');
} else {
echo "<style>h3, #plupload-upload-ui,.max-upload-size { display: none }</style>";
media_upload_type_form("image", null, $attachmentId);
}
} else {
fpUploadForm();
}
}
开发者ID:basteln3rk,项目名称:save-import-image-from-url,代码行数:16,代码来源:save-import-image-from-url.php
示例15: media_tab_process
function media_tab_process()
{
media_upload_header();
?>
<form id="new_royalslider_add_shortcode" action="media-new.php" method="post">
<?php
submit_button(__('Add RoyalSlider', 'new_royalslider'));
?>
</form>
<?php
}
开发者ID:elliottoman,项目名称:shero2016,代码行数:11,代码来源:NewRoyalSliderBackend.php
示例16: powerpress_media_upload_type_form
/**
* {@internal Missing Short Description}}
*
* @since unknown
*
* @param unknown_type $type
* @param unknown_type $errors
* @param unknown_type $id
*/
function powerpress_media_upload_type_form($type = 'file', $errors = null, $id = null)
{
media_upload_header();
$post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
$form_action_url = admin_url("media-upload.php?type={$type}&tab=type&post_id={$post_id}");
$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
if ($id && !is_wp_error($id)) {
$image_url = wp_get_attachment_url($id);
powerpress_send_to_episode_entry_box($image_url);
}
?>
<form enctype="multipart/form-data" method="post" action="<?php
echo esc_attr($form_action_url);
?>
" class="media-upload-form type-form validate" id="<?php
echo $type;
?>
-form">
<input type="submit" class="hidden" name="save" value="" />
<input type="hidden" name="post_id" id="post_id" value="<?php
echo (int) $post_id;
?>
" />
<?php
wp_nonce_field('media-form');
?>
<h3 class="media-title"><?php
echo __('Select poster image from your computer.', 'powerpress');
?>
</h3>
<?php
media_upload_form($errors);
?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready( function() {
jQuery('#sidemenu').css('display','none');
jQuery('body').css('margin','0px 20px');
jQuery('body').css('height','auto');
jQuery('html').css('height','auto'); // Elimate the weird scroll bar
});
//]]>
</script>
<div id="media-items">
<?php
if ($id && is_wp_error($id)) {
echo '<div id="media-upload-error">' . esc_html($id->get_error_message()) . '</div>';
}
?>
</div>
</form>
<?php
}
开发者ID:KimcoBlogSC,项目名称:Blog,代码行数:66,代码来源:powerpressadmin-metabox.php
示例17: gmshc_tab_process
function gmshc_tab_process()
{
gmshc_head();
if (!isset($_REQUEST['map'])) {
media_upload_header();
$options = get_gmshc_options();
$post_id = $_REQUEST["post_id"];
$custom_fieds = get_post_custom($post_id);
$address = isset($_REQUEST['new_address']) ? gmshc_clean_string($_REQUEST['new_address']) : "";
$latitude = isset($_REQUEST['latitude']) ? gmshc_clean_string($_REQUEST['latitude']) : "";
$longitude = isset($_REQUEST['longitude']) ? gmshc_clean_string($_REQUEST['longitude']) : "";
$verify = isset($_REQUEST['verify']) ? true : false;
$verify_point = true;
if ($latitude != "" && $longitude != "") {
$ltlg = $latitude . "," . $longitude;
if ($verify) {
$verify_point = true;
} else {
$verify_point = false;
}
} else {
$ltlg = "";
}
$title = isset($_REQUEST['new_title']) ? gmshc_clean_string($_REQUEST['new_title']) : get_the_title($post_id);
$description = isset($_REQUEST['new_description']) ? gmshc_clean_string($_REQUEST['new_description']) : "";
$icon = isset($_REQUEST['default_icon']) ? stripslashes($_REQUEST['default_icon']) : "";
$selected_thumbnail = isset($_REQUEST['selected_thumbnail']) ? stripslashes($_REQUEST['selected_thumbnail']) : "";
$add_point = isset($_REQUEST['add_point']) ? $_REQUEST['add_point'] : '';
$del_point = isset($_REQUEST['delp']) ? $_REQUEST['delp'] : '';
$update_point = isset($_REQUEST['update']) ? $_REQUEST['update'] : '';
$width = isset($_REQUEST['width']) ? $_REQUEST['width'] : $options['width'];
$height = isset($_REQUEST['height']) ? $_REQUEST['height'] : $options['height'];
$margin = isset($_REQUEST['margin']) ? $_REQUEST['margin'] : $options['margin'];
$align = isset($_REQUEST['align']) ? $_REQUEST['align'] : $options['align'];
$zoom = isset($_REQUEST['zoom']) ? $_REQUEST['zoom'] : $options['zoom'];
$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : $options['type'];
$focus = isset($_REQUEST['focus']) ? $_REQUEST['focus'] : $options['focus'];
$focus_type = isset($_REQUEST['focus_type']) ? $_REQUEST['focus_type'] : $options['focus_type'];
$id_list = isset($_REQUEST['pid']) ? $_REQUEST['pid'] : "";
$address_list = isset($_REQUEST['addr']) ? gmshc_stripslashes_deep($_REQUEST['addr']) : "";
$title_list = isset($_REQUEST['title']) ? gmshc_stripslashes_deep($_REQUEST['title']) : "";
$desc_list = isset($_REQUEST['desc']) ? gmshc_stripslashes_deep($_REQUEST['desc']) : "";
$ltlg_list = isset($_REQUEST['ltlg']) ? $_REQUEST['ltlg'] : "";
$icon_list = isset($_REQUEST['icon']) ? $_REQUEST['icon'] : "";
$thumb_list = isset($_REQUEST['thumb']) ? $_REQUEST['thumb'] : "";
$post_points = new GMSHC_Post_Map();
$post_points->create_post_map($post_id);
if (!empty($add_point)) {
$new_point = new GMSHC_Point();
if ($new_point->create_point($ltlg, $address, $ltlg, $title, $description, $icon, $selected_thumbnail, $post_id, $verify_point)) {
if ($post_points->add_point($new_point)) {
echo "<div class='updated'><p>" . __("The Point was added.", "google-map-sc") . "</p></div>";
} else {
echo "<div class='error'><p>" . __("The point can't be saved or already exist.", "google-map-sc") . "</p></div>";
}
} else {
echo "<div class='error'><p>" . __("The Address can't be located.", "google-map-sc") . "</p></div>";
}
} else {
if (!empty($update_point)) {
if ($post_points->update_point($id_list, $address_list, $ltlg_list, $title_list, $desc_list, $icon_list, $thumb_list)) {
echo "<div class='updated'><p>" . __("The Point was updated.", "google-map-sc") . "</p></div>";
} else {
echo "<div class='error'><p>" . __("The Points can't be updated.", "google-map-sc") . "</p></div>";
}
} else {
if ($del_point != "") {
if ($post_points->delete_point($del_point)) {
echo "<div class='updated'><p>" . __("The Point was deleted.", "google-map-sc") . "</p></div>";
}
}
}
}
?>
<?php
$post_points->load_points();
?>
<script type="text/javascript" src="<?php
echo GMSC_PLUGIN_URL;
?>
/js/gmshc-admin.js"></script>
<link href="<?php
echo GMSC_PLUGIN_URL;
?>
/styles/gmshc-admin-styles.css" rel="stylesheet" type="text/css"/>
<div style="width:620px; margin:10px auto">
<?php
echo gmshc_plugin_menu();
?>
<form action="#" method="post">
<input id="default_width" type="hidden" value="<?php
echo $width;
?>
//.........这里部分代码省略.........
开发者ID:rmaloney,项目名称:simplewp_restaurant,代码行数:101,代码来源:google-map-shortcode.php
示例18: wpgmp_google_map_icon
function wpgmp_google_map_icon()
{
echo media_upload_header();
$form_action_url = site_url("wp-admin/media-upload.php?type={$GLOBALS['type']}&tab=ell_insert_gmap_tab", 'admin');
?>
<script type="text/javascript">
function add_icon_to_images()
{
if(jQuery('.read_icons').hasClass('active'))
{
imgsrc = jQuery('.active').find('img').attr('src');
var win = window.dialogArguments || opener || parent || top;
win.send_icon_to_map(imgsrc);
}
else
{
alert('Choose your icon.');
}
}
</script>
<form enctype="multipart/form-data" method="post" action="<?php
echo esc_attr($form_action_url);
?>
" class="media-upload-form" id="library-form">
<h3 class="media-title" style="color: #5A5A5A; font-family: Georgia, 'Times New Roman', Times, serif; font-weight: normal; font-size: 1.6em; margin-left: 10px;"><?php
_e('Select Icons', 'wpgmp_google_map');
?>
</h3>
<div style="margin-bottom:30px; float:left;">
<ul style="margin-left:10px; float:left;" id="select_icons">
<?php
$dir = plugin_dir_path(__FILE__) . 'icons/';
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
?>
<li class="read_icons" style="float:left;">
<img src="<?php
echo plugins_url('/icons/' . $file . '', __FILE__);
?>
" style="cursor:pointer;" />
</li>
<?php
}
closedir($dh);
}
}
?>
</ul>
<button type="button" class="button" style="margin-left:10px;" value="1" onclick="add_icon_to_images();" name="send[<?php
echo $picid;
?>
]"><?php
_e('Insert into Post', 'wpgmp_google_map');
?>
</button>
</div>
</form>
<?php
}
开发者ID:manhhung86it,项目名称:builder-site,代码行数:64,代码来源:wp-google-map-plugin.php
示例19: media_html
public function media_html()
{
$type = 'document';
wp_enqueue_media();
wp_enqueue_script('jquery');
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
wp_enqueue_script('pdfjs', $this->myBase . '/classes/pdf.js/pdf.js');
wp_enqueue_script('pdf-viewer-admin', $this->myBase . '/classes/script-admin.js');
wp_enqueue_style('pdf-viewer-admin', $this->myBase . '/classes/style-admin.css');
//wp_enqueue_script('jquery-validate', $this->myBase .'/classes/jquery.validate.min.js');
media_upload_header();
//get current user id
global $current_user;
get_currentuserinfo();
//insert new doc into post
$error = array();
if (isset($_POST['insert_existing'])) {
//validate
$post = $_POST;
$post['linktext'] = sanitize_text_field($post['linktext']);
if (!$post['post_id']) {
$error[] = "Oops. Looks like you forgot to pick a document to insert.";
}
//submit
if (empty($error)) {
$this->insert_doc_into_post($post);
}
}
if (isset($_POST['insert_new'])) {
//validate
$post = $_POST;
$post['title'] = sanitize_text_field($post['title']);
$post['linktext'] = sanitize_text_field($post['linktext']);
if ($post['title'] == '') {
$error[] = "Oops. You forgot to include a title for the document.";
}
if ($_FILES["uploadfile"]["error"] > 0) {
$error[] = "Hmm. Somthing went wrong. Will you try uploading the file again?";
}
if ($_FILES["uploadfile"]["type"] != "application/pdf") {
$error[] = "Oops. Looks like you didn't upload a PDF file. Sadly, that's all you can embed right now.";
}
//submit
if (empty($error)) {
$post_id = $this->upload($post);
if (is_numeric($post_id)) {
$post['post_id'] = $post_id;
$this->insert_doc_into_post($post);
} else {
$error[] = "Hmm. Somthing went wrong. Will you try uploading the file again?";
}
}
}
//Upload new doc
?>
<div class='document-nav-menu'>
<div id="upload" class="active">Upload Document</div>
<div id="doc-lib" class="">Document Library</div>
</div>
<div style="clear:both;" id="upload_div"></div>
<div id="upload-div" class="major-sec">
<?php
if (isset($_POST['insert_new']) && !empty($error)) {
$error_msg = "<div class='error'><ul>";
foreach ($error as $e) {
$error_msg .= "<li>{$e}</li>";
}
$error_msg .= "</ul></div>";
echo $error_msg;
}
?>
<form id="upload-form" action="" method="post" enctype="multipart/form-data">
<input type="hidden" name="insert_new" value="1">
<div id="media-items">
<h3 class="media-title">Upload a new document</h3>
<table class="describe">
<tr>
<th valign="top" scope="row" class="label">
<label for="title">Document title</label><span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field">
<input type="text" name="title" aria-required="true" placeholder="Used as the document's title" class="required" minlength="2" value="<?php
echo $post['title'];
?>
">
</td></tr>
<tr>
<th valign="top" scope="row" class="label">
<label for="uploadfile">Choose a PDF file</label><span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
<td class="field">
<input type="file" name="uploadfile" id="uploadfile" size="40" aria-required="true" class="required" accept="application/pdf"> The file <em>must</em> be a PDF!
</td></tr>
<tr class="extra-space">
<th valign="top" scope="row" class="label">
//.........这里部分代码省略.........
开发者ID:ryanshoover,项目名称:seufolios,代码行数:101,代码来源:pdf-viewer.php
示例20: tab_handler
function tab_handler()
{
if (!$this->user_allowed()) {
return;
}
//Set the body ID
$GLOBALS['body_id'] = 'media-upload';
//Do an IFrame header
iframe_header(__('Add From Server', 'add-from-server'));
//Add the Media buttons
media_upload_header();
//Handle any imports:
$this->handle_imports();
//Do the content
$this->main_content();
//Do a footer
iframe_footer();
}
开发者ID:tmhaoge,项目名称:moped,代码行数:18,代码来源:class.add-from-server.php
|
请发表评论