本文整理汇总了PHP中GFEntryList类的典型用法代码示例。如果您正苦于以下问题:PHP GFEntryList类的具体用法?PHP GFEntryList怎么用?PHP GFEntryList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GFEntryList类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: forms
public static function forms()
{
if (!GFCommon::ensure_wp_version()) {
return;
}
if (self::maybe_display_installation_wizard()) {
return;
}
$id = RGForms::get('id');
$view = RGForms::get('view');
if ($view == 'entries') {
require_once GFCommon::get_base_path() . '/entry_list.php';
GFEntryList::leads_page($id);
} else {
if ($view == 'entry') {
require_once GFCommon::get_base_path() . '/entry_detail.php';
GFEntryDetail::lead_detail_page();
} else {
if ($view == 'notification') {
require_once GFCommon::get_base_path() . '/notification.php';
//GFNotification::notification_page($id);
} else {
if ($view == 'settings') {
require_once GFCommon::get_base_path() . '/form_settings.php';
GFFormSettings::form_settings_page($id);
} else {
if (empty($view)) {
if (is_numeric($id)) {
self::forms_page($id);
} else {
self::form_list_page();
}
}
}
}
}
}
do_action('gform_view', $view, $id);
}
开发者ID:kidaak,项目名称:gravityforms,代码行数:39,代码来源:gravityforms.php
示例4: lead_detail_page
public static function lead_detail_page()
{
global $current_user;
if (!GFCommon::ensure_wp_version()) {
return;
}
echo GFCommon::get_remote_message();
$form = RGFormsModel::get_form_meta(absint($_GET['id']));
$form_id = absint($form['id']);
$form = gf_apply_filters(array('gform_admin_pre_render', $form_id), $form);
$lead_id = rgpost('entry_id') ? absint(rgpost('entry_id')) : absint(rgget('lid'));
$filter = rgget('filter');
$status = in_array($filter, array('trash', 'spam')) ? $filter : 'active';
$position = rgget('pos') ? rgget('pos') : 0;
$sort_direction = rgget('dir') ? rgget('dir') : 'DESC';
$sort_field = empty($_GET['sort']) ? 0 : $_GET['sort'];
$sort_field_meta = RGFormsModel::get_field($form, $sort_field);
$is_numeric = $sort_field_meta['type'] == 'number';
$search_criteria['status'] = $status;
require_once 'entry_list.php';
$filter_links = GFEntryList::get_filter_links($form, false);
foreach ($filter_links as $filter_link) {
if ($filter == $filter_link['id']) {
$search_criteria['field_filters'] = $filter_link['field_filters'];
break;
}
}
$search_field_id = rgget('field_id');
if (isset($_GET['field_id']) && $_GET['field_id'] !== '') {
$key = $search_field_id;
$val = rgget('s');
$strpos_row_key = strpos($search_field_id, '|');
if ($strpos_row_key !== false) {
//multi-row likert
$key_array = explode('|', $search_field_id);
$key = $key_array[0];
$val = $key_array[1] . ':' . $val;
}
$search_criteria['field_filters'][] = array('key' => $key, 'operator' => rgempty('operator', $_GET) ? 'is' : rgget('operator'), 'value' => $val);
$type = rgget('type');
if (empty($type)) {
if (rgget('field_id') == '0') {
$search_criteria['type'] = 'global';
}
}
}
/**
* Allow the entry list search criteria to be overridden.
*
* @since 1.9.14.30
*
* @param array $search_criteria An array containing the search criteria.
* @param int $form_id The ID of the current form.
*/
$search_criteria = gf_apply_filters(array('gform_search_criteria_entry_list', $form_id), $search_criteria, $form_id);
$paging = array('offset' => $position, 'page_size' => 1);
if (!empty($sort_field)) {
$sorting = array('key' => $_GET['sort'], 'direction' => $sort_direction, 'is_numeric' => $is_numeric);
} else {
$sorting = array();
}
$total_count = 0;
$leads = GFAPI::get_entries($form['id'], $search_criteria, $sorting, $paging, $total_count);
$prev_pos = !rgblank($position) && $position > 0 ? $position - 1 : false;
$next_pos = !rgblank($position) && $position < $total_count - 1 ? $position + 1 : false;
// unread filter requires special handling for pagination since entries are filter out of the query as they are read
if ($filter == 'unread') {
$next_pos = $position;
if ($next_pos + 1 == $total_count) {
$next_pos = false;
}
}
if (!$lead_id) {
$lead = !empty($leads) ? $leads[0] : false;
} else {
$lead = GFAPI::get_entry($lead_id);
}
if (!$lead) {
esc_html_e("Oops! We couldn't find your entry. Please try again", 'gravityforms');
return;
}
RGFormsModel::update_lead_property($lead['id'], 'is_read', 1);
switch (RGForms::post('action')) {
case 'update':
check_admin_referer('gforms_save_entry', 'gforms_save_entry');
//Loading files that have been uploaded to temp folder
$files = GFCommon::json_decode(stripslashes(RGForms::post('gform_uploaded_files')));
if (!is_array($files)) {
$files = array();
}
$original_entry = $lead;
GFFormsModel::$uploaded_files[$form_id] = $files;
GFFormsModel::save_lead($form, $lead);
/**
* Fires after the Entry is updated from the entry detail page.
*
* @param array $form The form object for the entry.
* @param integer $lead['id'] The entry ID.
* @param array $original_entry The entry object before being updated.
*/
//.........这里部分代码省略.........
开发者ID:slavic18,项目名称:cats,代码行数:101,代码来源:entry_detail.php
示例5: forms
public static function forms()
{
if (!GFCommon::ensure_wp_version()) {
return;
}
$id = RGForms::get("id");
$view = RGForms::get("view");
if ($view == "entries") {
require_once GFCommon::get_base_path() . "/entry_list.php";
GFEntryList::leads_page($id);
} else {
if ($view == "entry") {
require_once GFCommon::get_base_path() . "/entry_detail.php";
GFEntryDetail::lead_detail_page();
} else {
if ($view == "notification") {
require_once GFCommon::get_base_path() . "/notification.php";
GFNotification::notification_page($id);
} else {
if (is_numeric($id)) {
self::forms_page($id);
} else {
self::form_list_page();
}
}
}
}
}
开发者ID:Blueprint-Marketing,项目名称:interoccupy.net,代码行数:28,代码来源:gravityforms.php
示例6: show_screen_options
/**
* Returns the markup for the screen options for the entry list.
*
* Called by the screen_settings filter
*
* @since 2.0
* @access public
* @static
* @see Filter: screen_settings
* @see GFEntryList::get_screen_options_markup
*
* @param string $status The current screen settings
* @param object $args WP_Screen object
*
* @return string $return The filtered screen settings
*/
public static function show_screen_options($status, $args)
{
$return = $status;
if (self::get_page() == 'entry_list') {
require_once GFCommon::get_base_path() . '/entry_list.php';
$return = GFEntryList::get_screen_options_markup($status, $args);
}
return $return;
}
开发者ID:fjbeteiligung,项目名称:development,代码行数:25,代码来源:gravityforms.php
示例7: get_current_entry
public static function get_current_entry()
{
if (isset(self::$_entry)) {
return self::$_entry;
}
$form = self::get_current_form();
$form_id = absint($form['id']);
$lead_id = rgpost('entry_id') ? absint(rgpost('entry_id')) : absint(rgget('lid'));
$filter = rgget('filter');
$status = in_array($filter, array('trash', 'spam')) ? $filter : 'active';
$position = rgget('pos') ? rgget('pos') : 0;
$sort_direction = rgget('dir') ? rgget('dir') : 'DESC';
$sort_field = empty($_GET['sort']) ? 0 : $_GET['sort'];
$sort_field_meta = RGFormsModel::get_field($form, $sort_field);
$is_numeric = $sort_field_meta['type'] == 'number';
$search_criteria['status'] = $status;
require_once 'entry_list.php';
$filter_links = GFEntryList::get_filter_links($form, false);
foreach ($filter_links as $filter_link) {
if ($filter == $filter_link['id']) {
$search_criteria['field_filters'] = $filter_link['field_filters'];
break;
}
}
$search_field_id = rgget('field_id');
if (isset($_GET['field_id']) && $_GET['field_id'] !== '') {
$key = $search_field_id;
$val = rgget('s');
$strpos_row_key = strpos($search_field_id, '|');
if ($strpos_row_key !== false) {
//multi-row likert
$key_array = explode('|', $search_field_id);
$key = $key_array[0];
$val = $key_array[1] . ':' . $val;
}
$search_criteria['field_filters'][] = array('key' => $key, 'operator' => rgempty('operator', $_GET) ? 'is' : rgget('operator'), 'value' => $val);
$type = rgget('type');
if (empty($type)) {
if (rgget('field_id') == '0') {
$search_criteria['type'] = 'global';
}
}
}
/**
* Allow the entry list search criteria to be overridden.
*
* @since 1.9.14.30
*
* @param array $search_criteria An array containing the search criteria.
* @param int $form_id The ID of the current form.
*/
$search_criteria = gf_apply_filters(array('gform_search_criteria_entry_list', $form_id), $search_criteria, $form_id);
$paging = array('offset' => $position, 'page_size' => 1);
if (!empty($sort_field)) {
$sorting = array('key' => $_GET['sort'], 'direction' => $sort_direction, 'is_numeric' => $is_numeric);
} else {
$sorting = array();
}
$leads = GFAPI::get_entries($form['id'], $search_criteria, $sorting, $paging, self::$_total_count);
if (!$lead_id) {
$lead = !empty($leads) ? $leads[0] : false;
} else {
$lead = GFAPI::get_entry($lead_id);
}
self::set_current_entry($lead);
return $lead;
}
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:67,代码来源:entry_detail.php
示例8: update_lead_status
public static function update_lead_status()
{
check_ajax_referer('gf_delete_entry');
$status = rgpost('status');
$lead_id = rgpost('entry');
$entry = GFAPI::get_entry($lead_id);
$form = GFAPI::get_form($entry['form_id']);
switch ($status) {
case 'unspam':
RGFormsModel::update_lead_property($lead_id, 'status', 'active');
break;
case 'delete':
if (GFCommon::current_user_can_any('gravityforms_delete_entries')) {
RGFormsModel::delete_lead($lead_id);
}
break;
default:
RGFormsModel::update_lead_property($lead_id, 'status', $status);
break;
}
require_once 'entry_list.php';
$filter_links = GFEntryList::get_filter_links($form);
$counts = array();
foreach ($filter_links as $filter_link) {
$id = $filter_link['id'] == '' ? 'all' : $filter_link['id'];
$counts[$id . '_count'] = $filter_link['count'];
}
$x = new WP_Ajax_Response();
$x->add(array('what' => 'gf_entry', 'id' => $lead_id, 'supplemental' => $counts));
$x->send();
}
开发者ID:AgilData,项目名称:WordPress-Skeleton,代码行数:31,代码来源:gravityforms.php
示例9: get_filter_links
/**
* Returns the array of filter links.
*
* @param bool $include_counts
*
* @return array|mixed|void
*/
public function get_filter_links($include_counts = true)
{
$form = $this->get_form();
return GFEntryList::get_filter_links($form, $include_counts);
}
开发者ID:arobbins,项目名称:spellestate,代码行数:12,代码来源:entry_list.php
示例10: 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
示例11: all_leads_page
<?php
if (!class_exists('GFForms')) {
die;
}
GFForms::register_scripts();
GFEntryList::enqueue_gravity_forms_scripts();
class GFEntryList
{
static function enqueue_gravity_forms_scripts()
{
GFForms::register_scripts();
$scripts = array('thickbox', 'gform_gravityforms', 'wp-lists', 'gform_json', 'gform_field_filter', 'plupload-all');
foreach ($scripts as $script) {
wp_enqueue_script($script);
}
}
public static function all_leads_page()
{
if (!GFCommon::ensure_wp_version()) {
return;
}
$forms = RGFormsModel::get_forms(null, 'title');
$id = RGForms::get('id');
if (sizeof($forms) == 0) {
?>
<div style="margin:50px 0 0 10px;">
<?php
echo sprintf(__("You don't have any active forms. Let's go %screate one%s", 'gravityforms'), '<a href="?page=gf_new_form">', '</a>');
?>
</div>
开发者ID:hansstam,项目名称:makerfaire,代码行数:31,代码来源:entry_list_makerfaire.php
示例12: entries_list
function entries_list()
{
$view = rgget('view');
$lead_id = rgget('lid');
if ($view == 'mfentry' && (rgget('lid') || !rgblank(rgget('pos')))) {
//require_once( GFCommon::get_base_path() . '/entry_detail.php' );
include_once TEMPLATEPATH . '/classes/entry_detail_makerfaire.php';
GFEntryDetail::lead_detail_page();
} else {
if ($view == 'entries' || empty($view)) {
include_once TEMPLATEPATH . '/classes/entry_list_makerfaire.php';
if (!class_exists('GFEntryList')) {
require_once GFCommon::get_base_path() . "/entry_list.php";
}
GFEntryList::all_leads_page();
} else {
$form_id = rgget('id');
do_action('gform_entries_view', $view, $form_id, $lead_id);
}
}
}
开发者ID:hansstam,项目名称:makerfaire,代码行数:21,代码来源:functions.php
示例13: forms
public static function forms(){
if(!GFCommon::ensure_wp_version())
return;
$id = RGForms::get("id");
$view = RGForms::get("view");
if($view == "entries"){
require_once(GFCommon::get_base_path() . "/entry_list.php");
GFEntryList::leads_page($id);
} else if($view == "entry"){
require_once(GFCommon::get_base_path() . "/entry_detail.php");
GFEntryDetail::lead_detail_page();
} else if($view == "notification"){
require_once(GFCommon::get_base_path() . "/notification.php");
//GFNotification::notification_page($id);
} else if($view == 'settings') {
require_once(GFCommon::get_base_path() . "/form_settings.php");
GFFormSettings::form_settings_page($id);
} else if(empty($view)){
if(is_numeric($id)){
self::forms_page($id);
} else{
self::form_list_page();
}
}
do_action("gform_view", $view, $id);
}
开发者ID:bmontague,项目名称:sct,代码行数:30,代码来源:gravityforms.php
注:本文中的GFEntryList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论