Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
trigger_condition.inc
1 <?php
17 require_once SQ_INCLUDE_PATH.'/asset.inc';
30 class Trigger_Condition extends Asset
31 {
32 
33 
43  public static function evaluate($settings, &$state)
44  {
45  return FALSE;
46 
47  }//end evaluate()
48 
49 
60  public static function getInterface($settings, $prefix, $write_access=FALSE)
61  {
62  // create HTML
63  // populate HTML with settings
64  // this should handle new (empty) conditions as well as saved ones
65 
66  // IMPORTANT NOTE:
67  // Any Form elements that use the prefix should use the prefix as an array index
68  // i.e. <input name="$prefix['whatever']" value="someting" >
69  // or <input name="$prefix" value="something" >
70 
71  // NOT <input name="$prefix_something" />
72  // if you do this your processInterface function will not be getting any data back.
73 
74  // in short, you can either use prefix to either reference one value or be
75  // an array of values, you cannot change the prefix to whatever you like as it will
76  // a) conflict with some other prefix, or
77  // b) make the interface useless
78 
79  // see the trigger_condition_asset_type condition for an example of use
80 
81  return $interface_string;
82 
83  }//end getInterface()
84 
85 
96  public static function processInterface(&$settings, $request_data)
97  {
98  // decompose interface
99  // populate the settings
100  // return status
101 
102  return FALSE;
103 
104  }//end processInterface()
105 
106 
119  public static function setHash(&$settings, &$hash)
120  {
121  return FALSE;
122 
123  }//end setHash()
124 
125 
133  public static function allowMultiple()
134  {
135  // default to to disallow
136  return FALSE;
137 
138  }//end allowMultiple()
139 
140 
141 }//end class
142 
143 ?>