Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
trigger_condition_user_public.inc
1 <?php
17 require_once SQ_CORE_PACKAGE_PATH.'/system/triggers/trigger_condition/trigger_condition.inc';
18 
31 {
32 
33 
50  public static function evaluate($settings, &$state)
51  {
52  return ($GLOBALS['SQ_SYSTEM']->userPublic() == $settings['is_public_user']);
53 
54  }//end evaluate()
55 
56 
67  public static function getInterface($settings, $prefix, $write_access=FALSE)
68  {
69  ob_start();
70  $options = Array(0 => translate('is_not'), 1 => translate('is'));
71  $value = array_get_index($settings, 'is_public_user', 1);
72  if ($write_access) {
73  combo_box($prefix.'[is_public_user]', $options, FALSE, $value);
74  } else {
75  echo '<b>'.$options[$value].'</b>';
76  }
77  $is_public_user_str = ob_get_clean();
78 
79  return translate('trigger_asset_public_user', $is_public_user_str);
80 
81  }//end getInterface()
82 
83 
94  public static function processInterface(&$settings, $request_data)
95  {
96  if (empty($request_data)) {
97  return translate('trigger_input_data_error');
98  }
99 
100  $settings['is_public_user'] = $request_data['is_public_user'];
101 
102  return FALSE;
103 
104  }//end processInterface()
105 
106 
107 }//end class
108 ?>