50 function import($doc,
$tx)
75 Settings::setDefaultValue(
"context_help",
"context_help_label",
"(?)", String,
"Text to display for context help links (HTML is ok)");
76 Settings::setDefaultValue(
"context_help",
"criteria_help_label",
"(criteria)", String,
"Text to display for criteria help links (HTML is ok)");
82 $this->classes = array();
83 $this->nonmatches = array();
93 if (!$records)
return null;
95 if (array_key_exists(
$field, $records))
97 return $records[
$field]->help;
107 if (!$records)
return null;
109 if (array_key_exists(
$field, $records))
111 return $records[
$field]->criteria;
122 if (!$records)
return null;
124 if (array_key_exists(
$field, $records))
139 $cl =
$obj->contextHelpProxy ?
$obj->contextHelpProxy : get_class(
$obj);
141 if ($this->nonmatches[
$cl])
return null;
143 if ($this->classes[
$cl])
145 return $this->classes[
$cl];
148 $records = indexedQuery(
ContextHelp,
"WHERE class_name='$cl'",
"field");
151 $this->classes[
$cl] = $records;
155 $this->nonmatches[
$cl] =
true;
171 $links .=
"<a class=\"context_link\" href=\"javascript:toggleContextHelp('help-{$field}');\" onmouseover=\"showContextHelp('help-{$field}');\" onmouseout=\"hideContextHelp('help-{$field}');\">{$this->contextHelpLabel}</a> ";
172 $text .=
"<div id=\"help-$field\" class=\"contexthelp\">\n";
173 if ($this->showTitle)
175 $text .=
"<p id=\"heading-$field\">$title Help</p>\n";
183 $links .=
"<a class=\"context_link\" href=\"javascript:toggleContextHelp('criteria-{$field}');\" onmouseover=\"showContextHelp('criteria-{$field}');\" onmouseout=\"hideContextHelp('criteria-{$field}');\">{$this->criteriaHelpLabel}</a>";
184 $text .=
"<div id=\"criteria-$field\" class=\"contexthelp\">\n";
185 if ($this->showTitle)
187 $text .=
"<h2 id=\"heading-$field\">$title Criteria</h2>\n";
193 return "{$links}\n{$text}";
199 $mgr->upgrade($version);
204 global $auto_form_defaults;
206 $auto_form_defaults[
"onFormatLabel"] =
"addContextHelp";
219 $label .=
" ".$contextHelpMgr->formatLinks(
$form,
$field);
static registerSerializationHandler()
formatLinks($form, $field)
getContextHelpRecords($obj)
static upgradeComponent($version)
getCriteria($form, $field)
ContextHelpSerializationHandler()
static serialize($class, $constraint="")
Serializes the specified DataItems to XML.
registerHandler($component, $title, $handler)
Registers a serialization handler for a component.
static unserialize($class, $doc, $tx, $save=true)
Instantiates DataItems from the supplied XML document and stores them in the database.
static getValue($component, $name)
Retrieve the value of the specified Setting.
static setDefaultValue($component, $name, $value, $field_type="String", $annotation="", $category="", $options="", $weight=0)
Sets the default value of the given component setting.
addContextHelp($form, $field, $label)