本文整理汇总了PHP中FrmField::is_read_only方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmField::is_read_only方法的具体用法?PHP FrmField::is_read_only怎么用?PHP FrmField::is_read_only使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmField
的用法示例。
在下文中一共展示了FrmField::is_read_only方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
FrmFieldsHelper::include_other_input(array('other_opt' => $other_opt, 'read_only' => $read_only, 'checked' => $checked, 'name' => $other_args['name'], 'value' => $other_args['value'], 'field' => $field, 'html_id' => $html_id, 'opt_key' => $opt_key));
unset($other_opt, $other_args);
?>
</div>
<?php
}
}
}
} else {
if ($field['type'] == 'select') {
include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/front-end/dropdown-field.php';
} else {
if ($field['type'] == 'checkbox') {
$checked_values = $field['value'];
$read_only = false;
if (FrmField::is_read_only($field) && !FrmAppHelper::is_admin()) {
$read_only = true;
if ($checked_values) {
foreach ((array) $checked_values as $checked_value) {
?>
<input type="hidden" value="<?php
echo esc_attr($checked_value);
?>
" name="<?php
echo esc_attr($field_name);
?>
[]" />
<?php
}
} else {
?>
示例2: is_read_only
public static function is_read_only($field)
{
_deprecated_function(__FUNCTION__, '2.0.9', 'FrmField::is_read_only');
return FrmField::is_read_only($field);
}
示例3: add_field_class
public static function add_field_class($class, $field)
{
if ($field['type'] == 'scale' && FrmField::is_option_true($field, 'star')) {
$class .= ' star';
} else {
if ($field['type'] == 'date') {
$class .= ' frm_date';
} else {
if ($field['type'] == 'file' && FrmField::is_option_true($field, 'multiple')) {
$class .= ' frm_multiple_file';
}
}
}
// Hide the "No files selected" text if files are selected
if ($field['type'] == 'file' && !FrmField::is_option_empty($field, 'value')) {
$class .= ' frm_transparent';
}
if (!FrmAppHelper::is_admin() && FrmField::is_option_true($field, 'autocom') && ($field['type'] == 'select' || $field['type'] == 'data' && isset($field['data_type']) && $field['data_type'] == 'select') && !empty($field['options']) && !FrmField::is_read_only($field)) {
global $frm_vars;
$frm_vars['chosen_loaded'] = true;
$class .= ' frm_chzn';
$style = FrmStylesController::get_form_style($field['form_id']);
if ($style && 'rtl' == $style->post_content['direction']) {
$class .= ' chosen-rtl';
}
}
return $class;
}
示例4: foreach
<?php
// Check if field is read only
$disabled = FrmField::is_read_only($field) && !FrmAppHelper::is_admin() ? ' disabled="disabled"' : '';
// Dynamic Dropdowns
if ($field['data_type'] == 'select') {
if (!empty($field['options'])) {
?>
<select <?php
echo $disabled;
?>
name="<?php
echo esc_attr($field_name);
?>
" id="<?php
echo esc_attr($html_id);
?>
" <?php
do_action('frm_field_input_html', $field);
?>
>
<?php
if ($field['options']) {
foreach ($field['options'] as $opt_key => $opt) {
$selected = $field['value'] == $opt_key || in_array($opt_key, (array) $field['value']) ? ' selected="selected"' : '';
?>
<option value="<?php
echo esc_attr($opt_key);
?>
"<?php
echo $selected;
示例5: do_action
width:<?php
echo FrmStylesController::get_style_val('field_width');
}
?>
" <?php
do_action('frm_field_input_html', $field);
?>
><?php
echo FrmAppHelper::esc_textarea($field['value']);
?>
</textarea>
<?php
}
} else {
if ($field['type'] == 'file') {
if (FrmField::is_read_only($field)) {
// Read only file upload field shows the entry without an upload button
foreach ((array) maybe_unserialize($field['value']) as $media_id) {
if (!is_numeric($media_id)) {
continue;
}
?>
<input type="hidden" name="<?php
echo esc_attr($field_name);
if (FrmField::is_option_true($field, 'multiple')) {
echo '[]';
}
?>
" value="<?php
echo esc_attr($media_id);
?>
示例6: array
<?php
$read_only = false;
if (isset($field['post_field']) && $field['post_field'] == 'post_category' && FrmAppHelper::pro_is_installed()) {
echo FrmProPost::get_category_dropdown($field, array('location' => 'front', 'name' => $field_name, 'id' => $html_id));
} else {
if (FrmAppHelper::pro_is_installed() && FrmField::is_read_only($field)) {
$read_only = true;
echo FrmProDropdownFieldsController::get_hidden_fields_with_readonly_values($field, $field_name, $html_id);
?>
<select <?php
do_action('frm_field_input_html', $field);
?>
> <?php
} else {
?>
<select name="<?php
echo esc_attr($field_name);
?>
" id="<?php
echo esc_attr($html_id);
?>
" <?php
do_action('frm_field_input_html', $field);
?>
>
<?php
}
$other_opt = $other_checked = false;
foreach ($field['options'] as $opt_key => $opt) {
$field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);