name = $name; $this->text = get_POST_var($name); $this->set = false; $this->search = new SearchBox(); // see getSelectionSubset(); $this->select_static = new SelectBox("static"); $this->select_drc = new SelectBox("drc"); $this->select_marks = new SelectBox("marks"); $this->terms = $this->search->get(); // hmmmm I wonder if we have to sanitise? } function get() { return $this->text; } function toForm(&$lines, $tab = ' ') { $this->_makeSet(); $action = ""; // $lines[] = "$tab
"; } function toFormTables(&$lines, $tab = ' ') { $drc_copy = "DRC are copyright © David Ross. See rossde.com/CA_review/ for more details."; // DRC $this->select_drc->toFormTable($lines, $tab . ' '); $lines[] = " | "; $lines[] = "";
$lines[] = " $drc_copy "; // Copyright $lines[] = " | ";
$lines[] = "
"; $this->select_static->toFormTable($lines, $tab . ' '); $lines[] = " | "; $lines[] = ""; // Search $this->search->toFormTable($lines, $tab . ' '); $lines[] = " | "; $lines[] = "
"; $this->select_marks->toFormTable($lines, $tab . ' '); $lines[] = " | "; $lines[] = "
in obj set " . count($obj_set) . " of $total total.
\n"; /* * Now apply filtering for marks. */ if ($count_marks) { // echo "Marks are: {$clicked_marks}
\n"; $searched = array(); foreach ($obj_set as $i => $k) { if ($k->hasMarks($clicked_marks)) $searched[] = $k; } $obj_set = $searched; // echo "found " . count($searched) . " of $total total.
\n"; } // echo "post marks in obj set " . count($obj_set) . " of $total total.
\n"; /* * Now apply Search Terms. */ if ($terms) { // echo "Search terms are: {$this->terms}
\n"; // echo "Fixed terms are: {$this->terms}
\n"; $searched = array(); foreach ($obj_set as $i => $k) { if ($k->includes($terms)) $searched[] = $k; } // $ccc = searchCriteria($this->terms, $this->set); $obj_set = $searched; // echo "found " . count($searched) . " of $total total.
\n"; } // echo "xxxxx " . count($obj_set) . " of $total total.
\n"; $this->set = $obj_set; // echo "found " . count($this->set) . " of $total total.
\n"; } function toDisplay(&$lines, $tab = ' ') { if ($this->isNone()) { $lines[] = "Select something, dude!
"; return ; } $this->toTable($lines, $tab); } function toTable(&$lines, $tab = ' ') { $this->_makeSet(); $terms = $this->terms; // $set = $this->set; $lines[] = TABLE; $lines[] = ""; foreach ($this->set as $i => $cn) { $cn->toTR2($lines, $terms); } $lines[] = ""; $lines[] = UNTABLE; $lines[] = ""; } } ?>