25 switch ($this->Field->Status())
32 return "Duplicate field name";
34 return "Duplicate database column";
36 return "Field does not exist";
38 return "Illegal field name";
40 return "Duplicate label name";
42 return "Illegal label name";
63 return $this->Field->TypeAsName();
72 return $this->Field->GetDisplayName();
81 return $this->Field->Name();
99 $Value = $this->Field->GetAllowedConversionTypes();
111 return $this->
GetYesNo($this->Field->IsTempItem());
120 return $this->Field->Id();
129 return $this->Field->DBFieldName();
138 # for our purposes, HTML code and some whitespace are not human-readable
139 $Value = strip_tags($this->Field->Description());
140 $Value = trim(str_replace(array(
"\r",
"\n",
"\t"),
" ", $Value));
141 $Value = preg_replace(
'/ +/',
" ", $Value);
152 # for our purposes, HTML code and some whitespace are not human-readable
153 $Value = strip_tags($this->Field->Instructions());
154 $Value = trim(str_replace(array(
"\r",
"\n",
"\t"),
" ", $Value));
155 $Value = preg_replace(
'/ +/',
" ", $Value);
176 return $this->
GetYesNo($this->Field->RequiredBySPT());
185 return $this->
GetYesNo($this->Field->Enabled());
194 return $this->
GetYesNo($this->Field->Optional());
203 return $this->
GetYesNo($this->Field->Editable());
212 return $this->
GetYesNo($this->Field->Viewable());
223 return $this->
GetYesNo($this->Field->AllowMultiple());
234 return $this->
GetYesNo($this->Field->IncludeInKeywordSearch());
245 return $this->
GetYesNo($this->Field->IncludeInAdvancedSearch());
256 return $this->
GetYesNo($this->Field->IncludeInSortOptions());
267 return $this->
GetYesNo($this->Field->IncludeInRecommender());
445 return $this->
GetYesNo($this->Field->UsesQualifiers());
456 return $this->
GetYesNo($this->Field->ShowQualifiers());
465 $DefaultQualifier = $this->Field->DefaultQualifier();
467 if ($DefaultQualifier > 0)
469 $Qualifier =
new Qualifier($DefaultQualifier);
471 return $Qualifier->Name();
484 return $this->
GetYesNo($this->Field->AllowHTML());
495 return $this->
GetYesNo($this->Field->UseWysiwygEditor());
506 return $this->
GetYesNo($this->Field->UseForOaiSets());
516 return $this->Field->NumAjaxResults();
525 $Value = $this->
MapPrivilege($this->Field->ViewingPrivilege());
536 $Value = $this->
MapPrivilege($this->Field->AuthoringPrivilege());
547 $Value = $this->
MapPrivilege($this->Field->EditingPrivilege());
558 $Value = $this->
MapPrivilege($this->Field->ImagePreviewPrivilege());
569 $Value = $this->
MapPrivilege($this->Field->TreeBrowsingPrivilege());
582 return $this->
GetYesNo($this->Field->EnableOnOwnerReturn());
591 $Value = $this->
MapUserIsValue($this->Field->ViewingUserIsValue());
602 $Value = $this->
MapUserIsValue($this->Field->AuthoringUserIsValue());
613 $Value = $this->
MapUserIsValue($this->Field->EditingUserIsValue());
624 $Value = $this->
MapUserValue($this->Field->ViewingUserValue());
635 $Value = $this->
MapUserValue($this->Field->AuthoringUserValue());
646 $Value = $this->
MapUserValue($this->Field->EditingUserValue());
657 $Value = $this->Field->UserPrivilegeRestrictions();
660 # need to map each privilege ID to its text
661 foreach ($Value as $Id)
693 $Type = $this->Field->Type();
694 $Value = $this->Field->DefaultValue();
709 return (strlen($XText) ? $XText .
", " :
"") .
"Y: " . $Y;
717 # multiple default values are set
718 if (is_array($Value))
720 foreach ($Value as $Id)
724 $Names[] = $ControlledName->Name();
727 return implode(
", ", $Names);
730 # only one default value
735 return $ControlledName->Name();
755 $Value = $this->Field->UpdateMethod();
768 $Value = $this->Field->GetPossibleValues();
791 return $this->
GetYesNo($this->Field->HasItemLevelQualifiers());
800 $Value = $this->Field->AssociatedQualifierList();
810 $Value = $this->Field->UnassociatedQualifierList();
861 $this->NotSetText = $Text;
871 return $Value ?
"Yes" :
"No";
893 $Privilege = $this->
MapPrivilege($this->Field->{$Mode.
"Privilege"}());
894 $UserIsValue = $this->
MapUserIsValue($this->Field->{$Mode.
"UserIsValue"}());
895 $UserValue = $this->MapUserValue($this->Field->{$Mode.
"UserValue"}());
899 # add the user privilege constraint first, if set
900 if (!is_null($Privilege))
902 $String = $Privilege;
905 # then add the "user is value of field" constraint, if set
906 if (!is_null($UserIsValue) && !is_null($UserValue))
908 if (is_null($String))
910 $String =
"User is value of " . $UserValue;
915 $String .=
" " . $UserIsValue .
" user is value of ";
916 $String .= $UserValue;
920 return is_null($String) ? $this->NotSetText : $String;
928 protected function MapPrivilege($Value)
930 if (!isset(self::$PrivilegeList))
932 $this->LoadPrivilegeList();
935 return $this->GetArrayValue(self::$PrivilegeList, $Value);
941 protected function LoadPrivilegeList()
945 self::$PrivilegeList = $PrivilegeFactory->GetPrivileges(TRUE, FALSE);
953 protected function MapUserIsValue($Value)
955 return $this->GetArrayValue(self::$UserIsValueList, $Value);
963 protected function MapUserValue($Value)
965 if (!isset(self::$UserFieldList))
967 $this->LoadUserFieldList();
970 return $this->GetArrayValue(self::$UserFieldList, $Value);
976 protected function LoadUserFieldList()
981 # make sure the list is set to something even if there are no user
983 self::$UserFieldList = array();
985 foreach ($UserFields as $Field)
987 self::$UserFieldList[$Field->Id()] = $Field->GetDisplayName();
1001 protected function GetArrayValue(array $Array, $Key, $Default=NULL)
1003 return array_key_exists($Key, $Array) ? $Array[$Key] : $Default;
1014 protected $NotSetText =
"--";
1024 protected static $UserIsValueList = array(