当前位置: 首页>>代码示例>>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;未经允许,请勿转载。