# HG changeset patch # User Nathan Phillip Brink # Date 2011-03-24 12:06:54 # Node ID fcf10ab116db911f2e2f234833362830621bcfe6 # Parent 0e55e98d752c2414bbb26291feea5a26071d442f New functions which may be useful for crawlers. diff --git a/inc/school.crawl.inc b/inc/school.crawl.inc --- a/inc/school.crawl.inc +++ b/inc/school.crawl.inc @@ -448,6 +448,14 @@ function school_crawl_form(DOMElement $f { if ($input_node->hasAttribute('name')) { + /* + * Skip over checkboxes which are not ``successful'' + * (http://w3.org/ terminology). + */ + if (!stricmp($input_node->getAttribute('type'), 'checkbox') + && !$input_node->hasAttribute('checked')) + continue; + $input_name = $input_node->getAttribute('name'); if (!isset($form[$input_name])) $form[$input_name] = array(); @@ -477,6 +485,46 @@ function school_crawl_form(DOMElement $f /** * \brief + * Parses a . + * \param $get_textcontent + * Whether or not the returned array should point at DOMElements or + * at the textcontent of each