Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
trigger_condition_user_sysadmin.inc
1 <?php
30 {
31 
32 
49  public static function evaluate($settings, &$state)
50  {
51  $res = ($GLOBALS['SQ_SYSTEM']->userSystemAdmin() == $settings['is_sysadmin']);
52  return $res;
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_sysadmin', 1);
72  if ($write_access) {
73  combo_box($prefix.'[is_sysadmin]', $options, FALSE, $value);
74  } else {
75  echo '<b>'.$options[$value].'</b>';
76  }
77  $var = ob_get_contents();
78  ob_end_clean();
79  return translate('trigger_asset_sysadmin', $var);
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_sysadmin'] = $request_data['is_sysadmin'];
101  return FALSE;
102 
103  }//end processInterface()
104 
105 
106 }//end class
107 ?>