Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
condition_user_frequency_edit_fns.inc
1 <?php
17 require_once SQ_CORE_PACKAGE_PATH.'/system/conditions/condition/condition_edit_fns.inc';
18 
32 {
33 
34 
40  function __construct()
41  {
42  parent::__construct();
43 
44  }//end constructor
45 
46 
58  public static function paintEditInterface(Array $condition_data, Backend_Outputter $o, $prefix, $write_access)
59  {
60  $value = array_get_index($condition_data, 'value', 0);
61  $units = array_get_index($condition_data, 'units', 'hits');
62  $options = Array(
63  'hits' => 'Hits',
64  'session' => 'Session',
65  'days' => 'Days',
66  'hours' => 'Hours',
67  'minutes' => 'Minutes',
68  );
69  ?>
70  <table>
71  <tr>
72  <td><strong>Value</strong></td>
73  <td>
74  <?php
75  if ($write_access) {
76  text_box($prefix.'[value]', $value, 10);
77  } else {
78  echo $value;
79  }
80  ?>
81  </td>
82  </tr>
83  <tr>
84  <td><strong>Units</strong></td>
85  <td>
86  <?php
87  if ($write_access) {
88  combo_box($prefix.'[units]', $options, 0, $units);
89  } else {
90  echo $options[$units];
91  }
92  ?>
93  </td>
94  </tr>
95  </table>
96  <?php
97  echo translate('condition_user_frequency_note');
98 
99  }//end paintEditInterface()
100 
101 
111  public static function processEditInterface(Backend_Outputter $o, $prefix)
112  {
113  $results = Array(
114  'units' => $_REQUEST[$prefix]['units'],
115  'value' => $_REQUEST[$prefix]['value'],
116  );
117 
118  return $results;
119 
120  }//end processEditInterface()
121 
122 
123 }//end class
124 
125 ?>