Lines Matching refs:predicate
54 if ($INPUT->str('action') && $INPUT->arr('predicate') && checkSecurityToken()) {
55 $predicate = $INPUT->arr('predicate');
57 $errors = $this->validate($predicate);
62 $ok = $sqlite->storeEntry('predicate', $predicate);
63 if(!$ok) msg('failed to add predicate', -1);
65 $ok = $sqlite->query('DELETE FROM predicate WHERE id=?', $predicate['id']);
66 if(!$ok) msg('failed to delete predicate', -1);
68 $errors = $this->validate($predicate);
77 $predicate['id'] = $INPUT->str('edit');
78 $ok = $sqlite->query("UPDATE predicate SET $set WHERE id=?", $predicate);
79 if(!$ok) msg('failed to update predicate', -1);
115 $q = 'SELECT * FROM predicate';
120 foreach ($predicates as $predicate) {
121 if ($INPUT->str('edit') == $predicate['id']) {
122 if (!$INPUT->has('predicate')) {
123 $INPUT->set('predicate', $predicate);
132 $value = $predicate[$header];
146 'edit' => $predicate['id']
157 'predicate[id]' => $predicate['id']
179 $form->addTextInput('predicate[schema]')->attr('style', 'width: 8em');
183 $form->addTextInput('predicate[field]')->attr('style', 'width: 8em');
187 $form->addDropdown('predicate[operator]', $this->operators);
191 $form->addTextInput('predicate[value]')->attr('style', 'width: 12em');
195 $form->addTextInput('predicate[users_and_groups]')->attr('style', 'width: 12em');
201 $form->addTextarea('predicate[message]')
224 protected function validate($predicate)
227 if (blank($predicate['schema'])) {
231 if (blank($predicate['field'])) {
235 if (blank($predicate['operator'])) {
239 if (blank($predicate['value'])) {
243 if (blank($predicate['users_and_groups'])) {
247 if (blank($predicate['message'])) {