RequireUIFile('jquery-ui.css', ApplicationFramework::ORDER_FIRST); $AF->RequireUIFile('jquery-ui.js', ApplicationFramework::ORDER_FIRST); # ----- EXPORTED FUNCTIONS --------------------------------------------------- /** * Print a text metadata field row. * @param MetadataField $Field text metadata field */ function PrintTextFieldRow(MetadataField $Field): void { $P = new MfeFieldValuePrinter($Field); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> DefaultValue(); ?> N/A N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> N/A TextFieldSize(); ?> MaxLength(); ?> AllowHTML(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A IncludeInKeywordSearch(); ?> IncludeInAdvancedSearch(); ?> N/A IncludeInSortOptions(); ?> SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> N/A N/A N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> N/A TextFieldSize(); ?> MaxLength(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A IncludeInKeywordSearch(); ?> IncludeInAdvancedSearch(); ?> N/A IncludeInSortOptions(); ?> SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> N/A N/A N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> N/A TextFieldSize(); ?> MaxLength(); ?> N/A N/A N/A N/A N/A N/A N/A i>N/A N/A N/A N/A IncludeInKeywordSearch(); ?> IncludeInAdvancedSearch(); ?> N/A IncludeInSortOptions(); ?> SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> DefaultValue(); ?> N/A N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> N/A N/A N/A AllowHTML(); ?> ParagraphRows(); ?> ParagraphCols(); ?> UseWysiwygEditor(); ?> N/A N/A N/A N/A N/A N/A N/A IncludeInKeywordSearch(); ?> IncludeInAdvancedSearch(); ?> N/A N/A SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> DefaultValue(); ?> N/A N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> N/A TextFieldSize(); ?> N/A N/A N/A N/A N/A MinValue(); ?> MaxValue(); ?> N/A N/A N/A N/A N/A IncludeInKeywordSearch(); ?> IncludeInAdvancedSearch(); ?> N/A IncludeInSortOptions(); ?> SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> N/A N/A N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> N/A TextFieldSize(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A IncludeInAdvancedSearch(); ?> N/A IncludeInSortOptions(); ?> SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> N/A N/A N/A UpdateMethod(); ?> UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A IncludeInAdvancedSearch(); ?> N/A IncludeInSortOptions(); ?> SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> DefaultValue(); ?> N/A N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A FlagOnLabel(); ?> FlagOffLabel(); ?> N/A N/A N/A N/A IncludeInAdvancedSearch(); ?> N/A N/A N/A
Enabled(); ?> Editable(); ?> Optional(); ?> N/A N/A N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> UseForOaiSets(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A NumAjaxResults(); ?> N/A N/A IncludeInKeywordSearch(); ?> IncludeInAdvancedSearch(); ?> IncludeInFacetedSearch(); ?> N/A SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> N/A N/A N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> UseForOaiSets(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A NumAjaxResults(); ?> N/A N/A IncludeInKeywordSearch(); ?> IncludeInAdvancedSearch(); ?> IncludeInFacetedSearch(); ?> N/A SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> N/A AllowMultiple(); ?> N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> UseForOaiSets(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A IncludeInKeywordSearch(); ?> IncludeInAdvancedSearch(); ?> IncludeInFacetedSearch(); ?> N/A SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> N/A N/A UserPrivilegeRestrictions(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A IncludeInKeywordSearch(); ?> IncludeInAdvancedSearch(); ?> N/A N/A SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> N/A N/A N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A IncludeInKeywordSearch(); ?> IncludeInAdvancedSearch(); ?> N/A N/A SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> N/A AllowMultiple(); ?> N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A IncludeInKeywordSearch(); ?> IncludeInAdvancedSearch(); ?> N/A N/A SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> DefaultValue(); ?> N/A N/A N/A UsesQualifiers(); ?> HasItemLevelQualifiers(); ?> DefaultQualifier(); ?> AssociatedQualifierList(); ?> ShowQualifiers(); ?> N/A TextFieldSize(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A PointPrecision(); ?> PointDecimalDigits(); ?> N/A IncludeInAdvancedSearch(); ?> N/A N/A SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A NumAjaxResults(); ?> N/A N/A N/A IncludeInAdvancedSearch(); ?> N/A N/A SearchWeight(); ?>
Enabled(); ?> Editable(); ?> Optional(); ?> N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A SearchWeight(); ?>
"PrintControlledNameFieldRow", MetadataSchema::MDFTYPE_DATE => "PrintDateFieldRow", MetadataSchema::MDFTYPE_EMAIL => "PrintEmailFieldRow", MetadataSchema::MDFTYPE_IMAGE => "PrintImageFieldRow", MetadataSchema::MDFTYPE_FILE => "PrintFileFieldRow", MetadataSchema::MDFTYPE_FLAG => "PrintFlagFieldRow", MetadataSchema::MDFTYPE_NUMBER => "PrintNumberFieldRow", MetadataSchema::MDFTYPE_OPTION => "PrintOptionFieldRow", MetadataSchema::MDFTYPE_PARAGRAPH => "PrintParagraphFieldRow", MetadataSchema::MDFTYPE_POINT => "PrintPointFieldRow", MetadataSchema::MDFTYPE_REFERENCE => "PrintReferenceFieldRow", MetadataSchema::MDFTYPE_SEARCHPARAMETERSET => "PrintSearchParameterSetFieldRow", MetadataSchema::MDFTYPE_URL => "PrintUrlFieldRow", MetadataSchema::MDFTYPE_USER => "PrintUserFieldRow", MetadataSchema::MDFTYPE_TEXT => "PrintTextFieldRow", MetadataSchema::MDFTYPE_TIMESTAMP => "PrintTimestampFieldRow", MetadataSchema::MDFTYPE_TREE => "PrintTreeFieldRow" ]; if (!array_key_exists($FieldType, $PrintFunctionMapping)) { throw new Exception("$FieldType is not a valid field type"); } $NameOfPrintFunction = "Metavus\\" . $PrintFunctionMapping[$FieldType]; if (!is_callable($NameOfPrintFunction)) { throw new Exception("$NameOfPrintFunction is not callable"); } # Get the fields for the schema $Fields = $Schema->getFields( $FieldType, MetadataSchema::MDFORDER_ALPHABETICAL, true ); foreach ($Fields as $Field) { $NameOfPrintFunction($Field); } } # ----- LOCAL FUNCTIONS ------------------------------------------------------ /** * Class used to make printing field values more convenient. * * These method declarations are here because this class is used to call methods * of HumanMetadataField via its __call() method. * @method void AllowHTML() * @method void AllowMultiple() * @method void AssociatedQualifierList() * @method void DefaultQualifier() * @method void DefaultValue() * @method void Editable() * @method void Enabled() * @method void FlagOffLabel() * @method void FlagOnLabel() * @method void HasItemLevelQualifiers() * @method void IncludeInAdvancedSearch() * @method void IncludeInFacetedSearch() * @method void IncludeInKeywordSearch() * @method void IncludeInSortOptions() * @method void MaxLength() * @method void MaxValue() * @method void MinValue() * @method void NumAjaxResults() * @method void Optional() * @method void ParagraphCols() * @method void ParagraphRows() * @method void PointDecimalDigits() * @method void PointPrecision() * @method void SearchWeight() * @method void ShowQualifiers() * @method void TextFieldSize() * @method void UpdateMethod() * @method void UseForOaiSets() * @method void UserPrivilegeRestrictions() * @method void UsesQualifiers() * @method void UseWysiwygEditor() */ class MfeFieldValuePrinter { /** * Set up the field value printer. * @param MetadataField $MetadataField metadata field */ public function __construct(MetadataField $MetadataField) { $this->MetadataField = $MetadataField; $this->HumanField = new HumanMetadataField($MetadataField); $this->HumanField->SetNotSetText("—"); } /** * Escape for HTML and print the value returned from * $this->HumanField->$Method($Arguments). * @param string $Method method name * @param array $Arguments method arguments * @throws Exception */ public function __call(string $Method, array $Arguments): void { $Callback = [$this->HumanField, $Method]; if (!is_callable($Callback)) { throw new Exception("Method $Method not found in HumanMetadataField"); } $Value = call_user_func_array($Callback, $Arguments); print defaulthtmlentities($Value); } /** * Print a 1 if the metadata field can be toggled (enabled/disabled) or a 0 * if it can't be. */ public function fieldIsTogglable(): void { if (!isset(self::$ActivePlugins)) { global $G_PluginManager; self::$ActivePlugins = $G_PluginManager->GetActivePluginList(); } $Id = $this->MetadataField->Id(); $Owner = $this->MetadataField->Owner(); $OwnerIsActive = in_array($Owner, self::$ActivePlugins); if (InterfaceConfiguration::getInstance()->getBool("ResourceRatingsEnabled") && $this->MetadataField->Name() == "Cumulative Rating") { $IsTogglable = false; } else { $Schema = new MetadataSchema($this->MetadataField->SchemaId()); $IsTogglable = !$Schema->FieldToStdNameMapping($Id) && !MetadataSchema::FieldUsedInPrivileges($Id); $IsTogglable = $IsTogglable && (!$Owner || $OwnerIsActive); } print defaulthtmlentities($IsTogglable ? "1" : "0"); } /** * @var array|null $ActivePlugins static array of active (enabled) plugins */ protected static $ActivePlugins; /** * @var MetadataField $MetadataField metadata field */ protected $MetadataField; /** * @var HumanMetadataField $HumanField $this->MetadataField wrapped in a * HumanMetadataField object */ protected $HumanField; } /** * Get the display text for the field, which includes the display name and the * name in parentheses if a label is set. The text will be properly escaped * HTML. * @param MetadataField $Field metadata field * @return string the display text for the field as escaped HTML */ function getFieldInfoDisplayText(MetadataField $Field): string { $DisplayName = defaulthtmlentities($Field->GetDisplayName()); $Name = defaulthtmlentities($Field->Name()); return $DisplayName . (strlen($Field->Label()) ? " (".$Name.")" : ""); } /** * Print "enabled" or "disabled" if the field is enabled or disabled, * respectively. * @param MetadataField $Field metadata field */ function printEnabledText(MetadataField $Field): void { print $Field->Enabled() ? "enabled" : "disabled"; } /** * Print the escaped metadata field ID. * @param MetadataField $Field metadata field */ function printFieldIdText(MetadataField $Field): void { print defaulthtmlentities($Field->Id()); } /** * Print the metadata field name text, which includes a link to the field * editing page, the name of the field, the label of the field, and a help * tooltip containing the field description. * @param MetadataField $Field metadata field */ function printFieldNameText(MetadataField $Field): void { global $AF; $SafeFieldId = defaulthtmlentities($Field->Id()); $SafeFieldName = defaulthtmlentities(GetFieldInfoDisplayText($Field)); $TooltipId = "mv-dialog-".$SafeFieldId; $HelpImage = $Field->Enabled() ? "help.png" : "help_disabled.png"; ?> getInterfaceSetting("TooltipsUseDialogs")) { ?>

Description() ?>

Id()); $EditButton = new HtmlButton("Edit"); $EditButton->setIcon("Pencil.svg"); $EditButton->setSize(HtmlButton::SIZE_SMALL); $EditButton->setLink("index.php?P=EditMetadataField&Id=".$SafeFieldId); print $EditButton->getHtml(); } /** * Print an option list containing metadata schemas. * @param MetadataSchema $SchemaInUse Metadata schema in use. */ function printSchemaOptionList(MetadataSchema $SchemaInUse): void { $Options = []; # get the metadata schema options foreach (MetadataSchema::GetAllSchemas() as $Schema) { $Options[$Schema->Id()] = $Schema->ResourceName() . " Schema"; } $OptList = new HtmlOptionList("SC", $Options, $SchemaInUse->Id()); $OptList->SubmitOnChange(true); $OptList->PrintHtml(); } # ----- SETUP ---------------------------------------------------------------- if (!isset($H_PromptDBRebuild)) { throw new Exception("H_PromptDBRebuild not defined."); } if (!isset($H_Schema)) { throw new Exception("H_Schema not defined."); } $SafeSchemaId = defaulthtmlentities($H_Schema->Id()); $AddButton = new HtmlButton("Add New Field"); $AddButton->setIcon("Plus.svg"); $AddButton->setSize(HtmlButton::SIZE_MEDIUM); $AddButton->setLink("index.php?P=EditMetadataField&SC=".$SafeSchemaId); $EditButton = new HtmlButton("Edit"); $EditButton->setIcon("Pencil.svg"); $EditButton->setSize(HtmlButton::SIZE_MEDIUM); $EditButton->setLink("index.php?P=EditMetadataSchema&SC=".$SafeSchemaId); $MetadataButton = new HtmlButton("Metadata"); $MetadataButton->setId("displayMetadataOnly"); $MetadataButton->setOnclick("displayMetadataOnly()"); $DisplayButton = new HtmlButton("Display"); $DisplayButton->setId("displayDisplayOnly"); $DisplayButton->setOnclick("displayDisplayOnly()"); $AccessButton = new HtmlButton("Access"); $AccessButton->setId("displayAccessOnly"); $SearchButton = new HtmlButton("Search"); $SearchButton->setId("displaySearchOnly"); $SearchButton->setOnclick("displaySearchOnly()"); $ChosenView = StdLib::getArrayValue($_GET, "View", "Metadata"); $Views = [ "Metadata" => ".mfe-group-metadata", "Display" => ".mfe-group-display", "Search" => ".mfe-group-search" ]; # remove the chosen view unset($Views[$ChosenView]); # settings that should not be displayed or otherwise used $DisabledSettings = [ ".mfe-field-userprivilegerestrictions", ".mfe-field-updatemethod", ".mfe-field-showqualifiers", ".mfe-field-associatedqualifierlist", ".mfe-field-useforoaisets", ".mfe-field-paragraphrows", ".mfe-field-paragraphcols", ".mfe-field-usewysiwygeditor", ".mfe-field-minvalue", ".mfe-field-maxvalue", ".mfe-field-flagonlabel", ".mfe-field-flagofflabel", ".mfe-field-pointprecision", ".mfe-field-pointdecimaldigits" ]; # ----- DISPLAY -------------------------------------------------------------- ?> getInterfaceSetting("TooltipsUseDialogs")) { ?>
requireUIFile("CW-Tooltips.js"); } ?>

In order for the Search settings updates to take place, please rebuild the search database.

# Metadata Field Editor

getHtml() ?> getHtml() ?>

- getHtml(); ?>
- getHtml(); ?>
- getHtml(); ?>

Hide Disabled Fields

Enabled | Field Name | Editable | Optional | Default Value | Allow Multiple | Restrict to | Update Method | Uses Qualifiers | Item-Level Qualifiers | Default Qualifier | Allowed Qualifiers | Show Qualifiers | Use for OAI Sets | Field Size | Max Length | Allow HTML | Rows | Columns | WYSIWYG | Min Value | Max Value | Flag On Label | Flag Off Label | Max Number of Search Results | Precision | Decimal Digits | Include in Keyword Search | Include in Advanced Search | Include in Faceted Search | Include in Sort Options | Search Weight | Edit
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
Enabled | Field Name | Editable | Optional | Default Value | Allow Multiple | Restrict to | Update Method | Uses Qualifiers | Item-Level Qualifiers | Default Qualifier | Allowed Qualifiers | Show Qualifiers | Use for OAI Sets | Field Size | Max Length | Allow HTML | Rows | Columns | WYSIWYG | Min Value | Max Value | Flag On Label | Flag Off Label | Max Number of Search Results | Precision | Decimal Digits | Include in Keyword Search | Include in Advanced Search | Include in Faceted Search | Include in Sort Options | Search Weight | Edit
GetFields(MetadataSchema::MDFTYPE_TEXT, null, true))) { ?>
Text Fields
GetFields(MetadataSchema::MDFTYPE_URL, null, true))) { ?>
Url Fields
GetFields(MetadataSchema::MDFTYPE_EMAIL, null, true))) { ?>
Email Fields
GetFields(MetadataSchema::MDFTYPE_PARAGRAPH, null, true))) { ?>
Paragraph Fields
GetFields(MetadataSchema::MDFTYPE_NUMBER, null, true))) { ?>
Number Fields
GetFields(MetadataSchema::MDFTYPE_DATE, null, true))) { ?>
Date Fields
GetFields(MetadataSchema::MDFTYPE_TIMESTAMP, null, true))) { ?>
Timestamp Fields
GetFields(MetadataSchema::MDFTYPE_FLAG, null, true))) { ?>
Flag Fields
GetFields(MetadataSchema::MDFTYPE_TREE, null, true))) { ?>
Tree Fields
GetFields(MetadataSchema::MDFTYPE_CONTROLLEDNAME, null, true))) { ?>
Controlled Name Fields
GetFields(MetadataSchema::MDFTYPE_OPTION, null, true))) { ?>
Option Fields
GetFields(MetadataSchema::MDFTYPE_USER, null, true))) { ?>
User Fields
GetFields(MetadataSchema::MDFTYPE_FILE, null, true))) { ?>
File Fields
GetFields(MetadataSchema::MDFTYPE_IMAGE, null, true))) { ?>
Image Fields
GetFields(MetadataSchema::MDFTYPE_POINT, null, true))) { ?>
Point Fields
GetFields(MetadataSchema::MDFTYPE_REFERENCE, null, true))) { ?>
Reference Fields
GetFields( MetadataSchema::MDFTYPE_SEARCHPARAMETERSET, null, true ))) { ?>
Search Parameter Set Fields

getHtml() ?>