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


PHP GFEntryList::get_icon_url方法代碼示例

本文整理匯總了PHP中GFEntryList::get_icon_url方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFEntryList::get_icon_url方法的具體用法?PHP GFEntryList::get_icon_url怎麽用?PHP GFEntryList::get_icon_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GFEntryList的用法示例。


在下文中一共展示了GFEntryList::get_icon_url方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_value_entry_list

 public function get_value_entry_list($value, $entry, $field_id, $columns, $form)
 {
     list($url, $title, $caption, $description) = rgexplode('|:|', $value, 4);
     if (!empty($url)) {
         //displaying thumbnail (if file is an image) or an icon based on the extension
         $thumb = GFEntryList::get_icon_url($url);
         $value = "<a href='" . esc_attr($url) . "' target='_blank' title='" . __('Click to view', 'gravityforms') . "'><img src='{$thumb}'/></a>";
     }
     return $value;
 }
開發者ID:arobbins,項目名稱:davis,代碼行數:10,代碼來源:class-gf-field-post-image.php

示例2: get_value_entry_list

 public function get_value_entry_list($value, $entry, $field_id, $columns, $form)
 {
     if ($this->multipleFiles) {
         $uploaded_files_arr = empty($value) ? array() : json_decode($value, true);
         $file_count = count($uploaded_files_arr);
         if ($file_count > 1) {
             $value = empty($uploaded_files_arr) ? '' : sprintf(esc_html__('%d files', 'gravityforms'), count($uploaded_files_arr));
             return $value;
         } elseif ($file_count == 1) {
             $value = $uploaded_files_arr[0];
         } elseif ($file_count == 0) {
             return;
         }
     }
     $file_path = $value;
     if (!empty($file_path)) {
         //displaying thumbnail (if file is an image) or an icon based on the extension
         $thumb = GFEntryList::get_icon_url($file_path);
         $file_path = esc_attr($file_path);
         $value = "<a href='{$file_path}' target='_blank' title='" . esc_attr__('Click to view', 'gravityforms') . "'><img src='{$thumb}'/></a>";
     }
     return $value;
 }
開發者ID:wesleykepke,項目名稱:ARIA,代碼行數:23,代碼來源:class-gf-field-fileupload.php

示例3: render_image_link

 /**
  * Render image link HTML
  *
  * @since  3.7
  * @param  [type] $url         [description]
  * @param  string $title       [description]
  * @param  string $caption     [description]
  * @param  string $description [description]
  * @return [type]              [description]
  */
 private static function render_image_link($url, $lead, $options, $title = '', $caption = '', $description = '')
 {
     extract($options);
     $target = $linknewwindow && empty($lightboxsettings['images']) ? ' target="_blank"' : '';
     $size = false;
     if (!empty($options['getimagesize'])) {
         $size = @getimagesize($url);
     }
     //displaying thumbnail (if file is an image) or an icon based on the extension
     $icon = GFEntryList::get_icon_url($url);
     if (!preg_match('/icon\\_image\\.gif/ism', $icon)) {
         $src = $icon;
         if (!empty($size)) {
             $img = "<img src='{$src}' {$size[3]}/>";
         } else {
             $img = "<img src='{$src}' />";
         }
     } else {
         // No thickbox for non-images please
         switch (strtolower(trim($options['postimage']))) {
             case 'image':
                 $src = $url;
                 break;
             case 'icon':
             default:
                 $src = $icon;
                 break;
         }
     }
     $img = array('src' => $src, 'size' => $size, 'title' => $title, 'caption' => $caption, 'description' => $description, 'url' => esc_url_raw($url), 'code' => isset($size[3]) ? "<img src='{$src}' {$size[3]} />" : "<img src='{$src}' />");
     $img = apply_filters('kws_gf_directory_lead_image', apply_filters('kws_gf_directory_lead_image_' . $options['postimage'], apply_filters('kws_gf_directory_lead_image_' . $lead['id'], $img)));
     $lightboxclass = '';
     if (!empty($lightboxsettings['images']) && self::is_image_file($url)) {
         if (wp_script_is('colorbox', 'registered')) {
             $lightboxclass = ' class="colorbox lightbox"';
         } else {
             if (wp_script_is('thickbox', 'registered')) {
                 $lightboxclass = ' class="thickbox lightbox"';
             }
         }
         if (in_array('images', $lightboxsettings) || !empty($lightboxsettings['images'])) {
             $lightboxclass .= ' rel="directory_all directory_images"';
         }
     }
     $value = "<a href='{$url}'{$target}{$lightboxclass}>{$img['code']}</a>";
     $value = apply_filters('kws_gf_directory_render_image_link', $value, $url, $lead, $options, $title, $caption, $description);
     return $value;
 }
開發者ID:healthcommcore,項目名稱:osnap,代碼行數:58,代碼來源:gravity-forms-addons.php


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