當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Browser::isHTML5方法代碼示例

本文整理匯總了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;
 }
開發者ID:zruiz,項目名稱:NG,代碼行數:19,代碼來源:wp_media_custom.php

示例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)) {
開發者ID:zruiz,項目名稱:NG,代碼行數:31,代碼來源:template-image-by-ajax-back.php


注:本文中的Browser::isHTML5方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。