当前位置: 首页>>代码示例>>PHP>>正文


PHP FrmFieldsHelper::value_meets_condition方法代码示例

本文整理汇总了PHP中FrmFieldsHelper::value_meets_condition方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmFieldsHelper::value_meets_condition方法的具体用法?PHP FrmFieldsHelper::value_meets_condition怎么用?PHP FrmFieldsHelper::value_meets_condition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FrmFieldsHelper的用法示例。


在下文中一共展示了FrmFieldsHelper::value_meets_condition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_conditions_met

 public static function action_conditions_met($action, $entry)
 {
     $notification = $action->post_content;
     $stop = false;
     $met = array();
     if (!isset($notification['conditions']) || empty($notification['conditions'])) {
         return $stop;
     }
     foreach ($notification['conditions'] as $k => $condition) {
         if (!is_numeric($k)) {
             continue;
         }
         if ($stop && 'any' == $notification['conditions']['any_all'] && 'stop' == $notification['conditions']['send_stop']) {
             continue;
         }
         if (is_array($condition['hide_opt'])) {
             $condition['hide_opt'] = reset($condition['hide_opt']);
         }
         $observed_value = isset($entry->metas[$condition['hide_field']]) ? $entry->metas[$condition['hide_field']] : '';
         if ($condition['hide_opt'] == 'current_user') {
             $condition['hide_opt'] = get_current_user_id();
         }
         $stop = FrmFieldsHelper::value_meets_condition($observed_value, $condition['hide_field_cond'], $condition['hide_opt']);
         if ($notification['conditions']['send_stop'] == 'send') {
             $stop = $stop ? false : true;
         }
         $met[$stop] = $stop;
     }
     if ($notification['conditions']['any_all'] == 'all' && !empty($met) && isset($met[0]) && isset($met[1])) {
         $stop = $notification['conditions']['send_stop'] == 'send';
     } else {
         if ($notification['conditions']['any_all'] == 'any' && $notification['conditions']['send_stop'] == 'send' && isset($met[0])) {
             $stop = false;
         }
     }
     return $stop;
 }
开发者ID:EyesX,项目名称:formidable-forms,代码行数:37,代码来源:FrmFormAction.php

示例2: action_conditions_met

 public static function action_conditions_met($action, $entry)
 {
     $notification = $action->post_content;
     $stop = false;
     $met = array();
     if (!isset($notification['conditions']) || empty($notification['conditions'])) {
         return $stop;
     }
     foreach ($notification['conditions'] as $k => $condition) {
         if (!is_numeric($k)) {
             continue;
         }
         if ($stop && 'any' == $notification['conditions']['any_all'] && 'stop' == $notification['conditions']['send_stop']) {
             continue;
         }
         self::prepare_logic_value($condition['hide_opt']);
         $observed_value = self::get_value_from_entry($entry, $condition['hide_field']);
         $stop = FrmFieldsHelper::value_meets_condition($observed_value, $condition['hide_field_cond'], $condition['hide_opt']);
         if ($notification['conditions']['send_stop'] == 'send') {
             $stop = $stop ? false : true;
         }
         $met[$stop] = $stop;
     }
     if ($notification['conditions']['any_all'] == 'all' && !empty($met) && isset($met[0]) && isset($met[1])) {
         $stop = $notification['conditions']['send_stop'] == 'send';
     } else {
         if ($notification['conditions']['any_all'] == 'any' && $notification['conditions']['send_stop'] == 'send' && isset($met[0])) {
             $stop = false;
         }
     }
     return $stop;
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:32,代码来源:FrmFormAction.php

示例3: is_field_hidden

 public static function is_field_hidden($field, $values)
 {
     if ($field->type == 'user_id' || $field->type == 'hidden' || !isset($field->field_options['hide_field']) || empty($field->field_options['hide_field'])) {
         return false;
     }
     $field->field_options['hide_field'] = (array) $field->field_options['hide_field'];
     if (!isset($field->field_options['hide_field_cond'])) {
         $field->field_options['hide_field_cond'] = array('==');
     }
     $field->field_options['hide_field_cond'] = (array) $field->field_options['hide_field_cond'];
     $field->field_options['hide_opt'] = (array) $field->field_options['hide_opt'];
     if (!isset($field->field_options['show_hide'])) {
         $field->field_options['show_hide'] = 'show';
     }
     if (!isset($field->field_options['any_all'])) {
         $field->field_options['any_all'] = 'any';
     }
     $hidden = false;
     $hide = array();
     foreach ($field->field_options['hide_field'] as $hide_key => $hide_field) {
         if ($hidden && $field->field_options['any_all'] == 'any' && $field->field_options['show_hide'] == 'hide') {
             continue;
         }
         $observed_value = '';
         if (isset($values['item_meta'][$hide_field])) {
             $observed_value = $values['item_meta'][$hide_field];
         } else {
             if (isset($field->temp_id) && $field->id != $field->temp_id) {
                 // this field depends on a field in a repeating section
                 $id_parts = explode('-', $field->temp_id);
                 if (isset($_POST['item_meta'][$id_parts[1]]) && isset($_POST['item_meta'][$id_parts[1]][$id_parts[2]]) && isset($_POST['item_meta'][$id_parts[1]][$id_parts[2]][$hide_field])) {
                     $observed_value = stripslashes_deep($_POST['item_meta'][$id_parts[1]][$id_parts[2]][$hide_field]);
                 }
             }
         }
         if ($field->type == 'data') {
             // Don't require a Dynamic Field with no available options
             self::is_dynamic_field_empty($field, $hide_key, $hide_field, $observed_value);
         }
         $hidden = FrmFieldsHelper::value_meets_condition($observed_value, $field->field_options['hide_field_cond'][$hide_key], $field->field_options['hide_opt'][$hide_key]);
         if ($field->field_options['show_hide'] == 'show') {
             $hidden = $hidden ? false : true;
         }
         $hide[$hidden] = $hidden;
     }
     if ($field->field_options['any_all'] == 'all' && !empty($hide) && isset($hide[0]) && isset($hide[1])) {
         $hidden = $field->field_options['show_hide'] == 'show' ? true : false;
     } else {
         if ($field->field_options['any_all'] == 'any' && $field->field_options['show_hide'] == 'show' && isset($hide[0])) {
             $hidden = false;
         }
     }
     return $hidden;
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:54,代码来源:FrmProFieldsHelper.php


注:本文中的FrmFieldsHelper::value_meets_condition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。