new SetOfCriteria('RLO', $rlo,
array("Risks/Liabilities/Obligations")),
'roots' => new SetOfCriteria('roots', $roots,
array("Root Key Managemnt")),
'privacy' => new SetOfCriteria('privacy', $privacy,
array("Privacy Policy")),
'security' => new SetOfCriteria('security', $security,
array("Security Manual")),
'oophaga' => new SetOfCriteria('oophaga', $oophaga,
array("Oophaga Hardware")),
'RA' => new SetOfCriteria('RA', $ra,
array("Registration Authorities (Assurance)")),
'dispute' => new SetOfCriteria('dispute', $dispute,
array("Dispute Resolution (Arbitration)")),
'pingtest' => new SetOfCriteria('pingtest', $pingtest,
array("Ping Testing of Domains/Emails")),
'A' => new SetOfCriteria('A', $A, array('DRC A', 'Documentation')),
'B' => new SetOfCriteria('B', $B, array('DRC B - Public Access')),
'C' => new SetOfCriteria('C', $C, array('DRC C - Operational Review')),
);
}
/*
* @return array of SetOfCriteria, indexed by name.
*/
function &getCriteriaSelections()
{
global $_all_selections;
if (false === $_all_selections)
_makeCriteriaSelections();
return $_all_selections;
}
/*
* @return array of SetOfCriteria, indexed by name.
*/
function &getSelectionSubset($name)
{
global $rlo, $roots, $privacy, $security, $oophaga, $dispute,
$pingtest, $ra, $A, $B, $C;
switch ($name)
{
case "static":
$s = array(
'RLO' => new SetOfCriteria('RLO', $rlo,
array("Risks/Liabilities/Obligations")),
'roots' => new SetOfCriteria('roots', $roots,
array("Root Key Managemnt")),
'privacy' => new SetOfCriteria('privacy', $privacy,
array("Privacy Policy")),
'security' => new SetOfCriteria('security', $security,
array("Security Manual")),
'oophaga' => new SetOfCriteria('oophaga', $oophaga,
array("Oophaga Hardware")),
'RA' => new SetOfCriteria('RA', $ra,
array("Registration Authorities (Assurance)")),
'dispute' => new SetOfCriteria('dispute', $dispute,
array("Dispute Resolution (Arbitration)")),
'pingtest' => new SetOfCriteria('pingtest', $pingtest,
array("Ping Testing of Domains/Emails")),
);
break;
case "drc":
$s = array(
'A' => new SetOfCriteria('A', $A, array('DRC A - Documentation')),
'B' => new SetOfCriteria('B', $B, array('DRC B - Public Access')),
'C' => new SetOfCriteria('C', $C, array('DRC C - Operational Review')),
);
break;
case "marks":
$fail = preg_replace('/\+[34]/', '+2', getMarkHtml('fail'));
$pass = preg_replace('/\+[34]/', '+2', getMarkHtml('pass'));
$q = preg_replace('/\+[34]/', '+2', getMarkHtml('q'));
$policy = getMarkHtml('policy');
$draft = getMarkHtml('draft');
$wip = preg_replace('/\+[34]/', '+2', getMarkHtml('wip'));
$change = getMarkHtml('change');
$warning = getMarkHtml('warning');
$s = array(
'pass' => new SetOfCriteria('pass', false,
array("All those that are marked $pass")),
'fail' => new SetOfCriteria('fail', false,
array("All those that are marked $fail")),
'other' => new SetOfCriteria('other', false,
array("not marked 'pass' or fail'")),
'policy' => new SetOfCriteria('policy', false,
array("document is in POLICY status $policy")),
'wip' => new SetOfCriteria('wip', false,
array("document is work-in-progress only $wip")),
'draft' => new SetOfCriteria('draft', false,
array("document is in DRAFT status $draft")),
'change' => new SetOfCriteria('change', false,
array("a change is required $change")),
'warning' => new SetOfCriteria('warning', false,
array("this area raises questions, watch carefully $warning")),
);
break;
default:
exit(" what is $name as a SelectionSubset?");
}
return $s;
}
// http://www.danshort.com/HTMLentities/index.php?w=dingb
$_mark_html = array(
'fail' => ' ✘ ',
'pass' => ' ✔ ',
'q' => '?❢? ',
'wip' => ' ✍ ',
'draft' => ' ✂ ',
'policy' => ' ✩ ',
'change' => ' Δ ',
'warning' => ' δ ',
'unknown' => ' ??? ',
);
function &getMarkArray()
{
global $_mark_html;
return $_mark_html;
}
function getMarkHtml($mark)
{
global $_mark_html;
if (array_key_exists($mark, $_mark_html))
return $_mark_html[$mark];
else
return $_mark_html['unknown'];
}
$_group_names = array(
'RLO' => $rlo,
'roots' => $roots,
'privacy' => $privacy,
'RA' => $ra,
'security' => $security,
'oophaga' => $oophaga,
'dispute' => $dispute,
'pingtest' => $pingtest,
'A' => $A,
'B' => $B,
'C' => $C,
);
/*
* @return array of SetOfCriteria, indexed by name, filtered by names
*/
function &getNamedGroup($group)
{
global $_group_names;
if (array_key_exists($group, $_group_names))
{
$gp = $_group_names[$group];
return $gp;
}
$gp = array();
return $gp;
}
/*
* @return array of SetOfCriteria, indexed by name, filtered by names
*/
function &getGroups($groups)
{
$all = array();
foreach ($groups as $i => $group)
{
// echo "filter /$i/ => !$group! ...
\n";
$selection = getNamedGroup($group);
// echo count($selection) . " ...
\n";
$all = array_merge($all, $selection);
}
$uniq = array_unique($all);
return $uniq;
}
/*
* @return array of SetOfCriteria, indexed by name, filtered by names
function &getSetsByNames($groups)
{
$filtered = array();
foreach ($groups as $i => $group)
{
// echo "filter /$i/ => !$group! ...
\n";
$selection = getOneSetByName
$selection = $all[$group];
if (!$selection)
continue;
$filtered[$group] = $selection;
}
return $filtered;
}
*/
/*
* @return array of SetOfCriteria, indexed by name, filtered by names
function &filterSetsByNames($names)
{
$all = getCriteriaSelections();
$filtered = array();
foreach ($names as $i => $name)
{
// echo "filter /$i/ => !$name! ...
\n";
$selection = $all[$name];
if (!$selection)
continue;
$filtered[$name] = $selection;
}
return $filtered;
}
*/
/*
* @arg array of SetOfCriteria
* @return new SetOfCriteria, with name of 'merge'
*/
function &mergeCriteriaSets($sets)
{
$merged = array();
$names = array();
foreach ($sets as $i => $set)
{
$names[] = $set->getName();
$selection = $set->getSetAsStrings();
$merged = array_merge($merged, $selection);
}
$mergedSet = new SetOfCriteria('merge', $merged, $names);
return $mergedSet;
}
?>