Created
March 1, 2010 14:36
-
-
Save alpacaaa/318407 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function customDBMS($context) | |
{ | |
$fieldName = 'changeMe'; // change this to your checkbox field name | |
$event = $context['event']; | |
$section = $event->getSource(); | |
require_once(TOOLKIT . '/class.sectionmanager.php'); | |
if (!$this->sectionManager) | |
$this->sectionManager = new SectionManager($context['parent']); | |
$section = $this->sectionManager->fetch($section); | |
$schema = $section->fetchFieldsSchema(); | |
$found = false; | |
foreach ($schema as $field) { | |
if ($field['element_name'] == $fieldName) { | |
$found = true; | |
break; | |
} | |
} | |
if($found && $context['fields'][$fieldName] != 'on') | |
{ | |
$context['messages'][] = array($fieldName, NULL, 'You must agree to the terms and conditions by checking the waiver box.'); | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment