本文整理汇总了PHP中FrmField::get_type方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmField::get_type方法的具体用法?PHP FrmField::get_type怎么用?PHP FrmField::get_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmField
的用法示例。
在下文中一共展示了FrmField::get_type方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare_items
public function prepare_items()
{
global $wpdb, $per_page;
$per_page = $this->get_items_per_page('formidable_page_formidable_entries_per_page');
$form_id = $this->params['form'];
if (!$form_id) {
$this->items = array();
$this->set_pagination_args(array('total_items' => 0, 'per_page' => $per_page));
return;
}
$default_orderby = 'id';
$default_order = 'DESC';
$s_query = array('it.form_id' => $form_id);
$s = isset($_REQUEST['s']) ? stripslashes($_REQUEST['s']) : '';
if ($s != '' && FrmAppHelper::pro_is_installed()) {
$fid = isset($_REQUEST['fid']) ? sanitize_title($_REQUEST['fid']) : '';
$s_query = FrmProEntriesHelper::get_search_str($s_query, $s, $form_id, $fid);
}
$orderby = isset($_REQUEST['orderby']) ? sanitize_title($_REQUEST['orderby']) : $default_orderby;
if (strpos($orderby, 'meta') !== false) {
$order_field_type = FrmField::get_type(str_replace('meta_', '', $orderby));
$orderby .= in_array($order_field_type, array('number', 'scale')) ? ' +0 ' : '';
}
$order = isset($_REQUEST['order']) ? sanitize_title($_REQUEST['order']) : $default_order;
$order = ' ORDER BY ' . $orderby . ' ' . $order;
$page = $this->get_pagenum();
$start = (int) isset($_REQUEST['start']) ? absint($_REQUEST['start']) : ($page - 1) * $per_page;
$this->items = FrmEntry::getAll($s_query, $order, ' LIMIT ' . $start . ',' . $per_page, true, false);
$total_items = FrmEntry::getRecordCount($s_query);
$this->set_pagination_args(array('total_items' => $total_items, 'per_page' => $per_page));
}
示例2: get_dynamic_list_values
/**
* Get the values for Dynamic List fields based on the conditional logic settings
*
* @since 2.0.08
* @param object $field
* @param object $entry
* @param string|array|int $field_value, pass by reference
*/
public static function get_dynamic_list_values($field, $entry, &$field_value)
{
// Exit now if a value is already set, field type is not Dynamic List, or conditional logic is not set
if ($field_value || $field->type != 'data' || !FrmProField::is_list_field($field) || !isset($field->field_options['hide_field'])) {
return;
}
$field_value = array();
foreach ((array) $field->field_options['hide_field'] as $hfield) {
if (isset($entry->metas[$hfield])) {
// Check if field in conditional logic is a Dynamic field
$cl_field_type = FrmField::get_type($hfield);
if ($cl_field_type == 'data') {
$cl_field_val = maybe_unserialize($entry->metas[$hfield]);
if (is_array($cl_field_val)) {
$field_value += $cl_field_val;
} else {
$field_value[] = $cl_field_val;
}
}
}
}
}
示例3: get_html_id_for_hidden_other_fields
/**
* Get the HTML ID for hidden other fields inside of repeating sections
*
* @since 2.0.8
* @param array $parts (array of the field name)
* @param string|boolean|int $opt_key
* @param string $html_id, pass by reference
*/
private static function get_html_id_for_hidden_other_fields($parts, $opt_key, &$html_id)
{
$field_id = absint($parts[3]);
$field_key = FrmField::get_type($field_id, 'field_key');
if ($field_key) {
$html_id = 'field_' . $field_key . '-' . $parts[1];
// If checkbox field or multi-select dropdown
if ($opt_key && FrmFieldsHelper::is_other_opt($opt_key)) {
$html_id .= '-' . $opt_key . '-otext';
} else {
$html_id .= '-otext';
}
}
}