本文整理汇总了PHP中Browser::isHTML5方法的典型用法代码示例。如果您正苦于以下问题:PHP Browser::isHTML5方法的具体用法?PHP Browser::isHTML5怎么用?PHP Browser::isHTML5使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browser
的用法示例。
在下文中一共展示了Browser::isHTML5方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wp_media_upload_button
public static function wp_media_upload_button($data = array())
{
$default = array('name' => 'front_media_uploader', 'class' => 'listing-images-uploads', 'value' => __('Upload', 'framework'), 'thumbnail_container' => 'photoList');
$data = $default + $data;
$data_button = '';
if (is_user_logged_in()) {
if (Browser::isHTML5() && self::check_file_input_method() == 0) {
$data_button .= '<input class="listing-images-uploads" type="file" name="images[]" id="photoimg" multiple accept="image/*" />';
} else {
$data_button .= '<div class="' . $data['class'] . '">';
$data_button .= '<input id="cbafu_button" data-container="' . $data['thumbnail_container'] . '" ';
$data_button .= ' class="' . $data['class'] . '"';
$data_button .= ' name="' . $data['name'] . '" type="button" value="' . $data['value'] . '" /></div>';
}
} else {
$data_button .= '<input type="file" name="images[]" disabled="disabled" multiple accept="image/*" />';
}
echo $data_button;
}
示例2: elseif
$step = 2;
} elseif ($steps == "listing-add-form-three") {
$step = 3;
} elseif ($steps == "listing-add-form-four") {
$step = 4;
} elseif ($steps == "listing-add-form-five") {
$step = 5;
}
$already_step = get_post_meta($pid, 'imic_plugin_ads_steps', true);
if ($already_step < $step) {
//update_post_meta($pid,'imic_plugin_ads_steps',$step);
}
$i = 1;
////////// check input method and browser //////////////
$files = array();
if (Browser::isHTML5() && FRONT_MEDIA_ALLOW::check_file_input_method() == 0) {
$files = isset($_FILES['images']) ? $_FILES['images'] : '';
} else {
$list_photo = $_REQUEST['listing_photos'];
foreach ($list_photo as $photo) {
if (!in_array($photo, $attached_images)) {
if ($i == 1) {
update_post_meta($pid, '_thumbnail_id', $photo);
}
add_post_meta($pid, 'imic_plugin_vehicle_images', $photo, false);
}
$i++;
}
}
/////////////////////////
if (!empty($files)) {