CWIS Developer Documentation
SystemConfiguration.php
Go to the documentation of this file.
1 <?php
2 #
3 # FILE: SystemConfiguration.php
4 #
5 # Part of the Collection Workflow Integration System (CWIS)
6 # Copyright 2013 Edward Almasy and Internet Scout Research Group
7 # http://scout.wisc.edu/cwis/
8 #
9 
11 
17 
18  # ---- PUBLIC INTERFACE --------------------------------------------------
19 
23  function __construct()
24  {
25  $this->DB = new Database();
26  }
27 
35  function TopLinkString($NewValue = DB_NOVALUE)
36  {
37  return $this->UpdateValue("TopLinkString", $NewValue);
38  }
39 
47  function TopLinkBeginLetter($NewValue = DB_NOVALUE)
48  {
49  return $this->UpdateValue("TopLinkBeginLetter", $NewValue);
50  }
51 
59  function TopLinkEndLetter($NewValue = DB_NOVALUE)
60  {
61  return $this->UpdateValue("TopLinkEndLetter", $NewValue);
62  }
63 
70  function AdminEmail($NewValue = DB_NOVALUE)
71  {
72  return $this->UpdateValue("AdminEmail", $NewValue);
73  }
74 
81  function PasswordMailSubject($NewValue = DB_NOVALUE)
82  {
83  return $this->UpdateValue("PasswordMailSubject", $NewValue);
84  }
85 
92  function PasswordMailBody($NewValue = DB_NOVALUE)
93  {
94  return $this->UpdateValue("PasswordMailBody", $NewValue);
95  }
96 
103  function PasswordResetMailSubject($NewValue = DB_NOVALUE)
104  {
105  return $this->UpdateValue("PasswordResetMailSubject", $NewValue);
106  }
107 
114  function PasswordResetMailBody($NewValue = DB_NOVALUE)
115  {
116  return $this->UpdateValue("PasswordResetMailBody", $NewValue);
117  }
118 
125  function MailChangeMailSubject($NewValue = DB_NOVALUE)
126  {
127  return $this->UpdateValue("MailChangeMailSubject", $NewValue);
128  }
129 
136  function MailChangeMailBody($NewValue = DB_NOVALUE)
137  {
138  return $this->UpdateValue("MailChangeMailBody", $NewValue);
139  }
140 
147  function PortalName($NewValue = DB_NOVALUE)
148  {
149  return $this->UpdateValue("PortalName", $NewValue);
150  }
151 
158  function DefaultActiveUI($NewValue = DB_NOVALUE)
159  {
160  return $this->UpdateValue("DefaultActiveUI", $NewValue);
161  }
162 
169  function CurrentTheme($NewValue = DB_NOVALUE)
170  {
171  return $this->UpdateValue("CurrentTheme", $NewValue);
172  }
173 
180  function DefaultCharacterSet($NewValue = DB_NOVALUE)
181  {
182  return $this->UpdateValue("DefaultCharacterSet", $NewValue);
183  }
184 
192  function SearchTermsRequired($NewValue = DB_NOVALUE)
193  {
194  return $this->UpdateValue("SearchTermsRequired", $NewValue);
195  }
196 
204  function ShowNumResourcesEnabled($NewValue = DB_NOVALUE)
205  {
206  return $this->UpdateValue("ShowNumResourcesEnabled", $NewValue);
207  }
208 
215  function AnnouncementsEnabled($NewValue = DB_NOVALUE)
216  {
217  return $this->UpdateValue("AnnouncementsEnabled", $NewValue);
218  }
219 
226  function ForumsEnabled($NewValue = DB_NOVALUE)
227  {
228  return $this->UpdateValue("ForumsEnabled", $NewValue);
229  }
230 
237  function ForumsAllowHTML($NewValue = DB_NOVALUE)
238  {
239  return $this->UpdateValue("ForumsAllowHTML", $NewValue);
240  }
241 
248  function ForumsUseWYSIWYG($NewValue = DB_NOVALUE)
249  {
250  return $this->UpdateValue("ForumsUseWYSIWYG", $NewValue);
251  }
252 
260  function AllowMultipleUIsEnabled($NewValue = DB_NOVALUE)
261  {
262  return $this->UpdateValue("AllowMultipleUIsEnabled", $NewValue);
263  }
264 
275  {
276  return $this->UpdateValue("ResourceLaunchesNewWindowEnabled", $NewValue);
277  }
278 
286  function UserAgentsEnabled($NewValue = DB_NOVALUE)
287  {
288  return $this->UpdateValue("UserAgentsEnabled", $NewValue);
289  }
290 
297  function ResourceRatingsEnabled($NewValue = DB_NOVALUE)
298  {
299  return $this->UpdateValue("ResourceRatingsEnabled", $NewValue);
300  }
301 
308  function ResourceCommentsEnabled($NewValue = DB_NOVALUE)
309  {
310  return $this->UpdateValue("ResourceCommentsEnabled", $NewValue);
311  }
312 
322  {
323  return FALSE;
324  }
325 
335  {
336  return $this->UpdateValue("IncrementalKeywordSearchEnabled", $NewValue);
337  }
338 
346  function ReleaseFlagApproved($NewValue = DB_NOVALUE)
347  {
348  return $this->UpdateValue("ReleaseFlagApproved", $NewValue);
349  }
350 
357  function SearchDBEnabled($NewValue = DB_NOVALUE)
358  {
359  return $this->UpdateValue("SearchDBEnabled", $NewValue);
360  }
361 
369  function RecommenderDBEnabled($NewValue = DB_NOVALUE)
370  {
371  return $this->UpdateValue("RecommenderDBEnabled", $NewValue);
372  }
373 
380  function OAISQEnabled($NewValue = DB_NOVALUE)
381  {
382  return $this->UpdateValue("OAISQEnabled", $NewValue);
383  }
384 
393  function NumAnnounceOnHomePage($NewValue = DB_NOVALUE)
394  {
395  return $this->UpdateValue("NumAnnounceOnHomePage", $NewValue);
396  }
397 
405  function NumResourcesOnHomePage($NewValue = DB_NOVALUE)
406  {
407  return $this->UpdateValue("NumResourcesOnHomePage", $NewValue);
408  }
409 
416  function LegalNotice($NewValue = DB_NOVALUE)
417  {
418  return $this->UpdateValue("LegalNotice", $NewValue);
419  }
420 
427  function DefaultRecordsPerPage($NewValue = DB_NOVALUE)
428  {
429  return $this->UpdateValue("DefaultRecordsPerPage", $NewValue);
430  }
431 
440  {
441  return $this->UpdateValue("NumResourcesForSearchFacets", $NewValue);
442  }
443 
451  function MaxFacetsPerField($NewValue = DB_NOVALUE)
452  {
453  return $this->UpdateValue("MaxFacetsPerField", $NewValue);
454  }
455 
464  function NumClassesPerBrowsePage($NewValue = DB_NOVALUE)
465  {
466  # if new classes per browse page has been specified
467  if ($NewValue !== DB_NOVALUE &&
468  $NewValue != $this->UpdateValue("NumClassesPerBrowsePage", DB_NOVALUE))
469  {
470  # clear all classification links
471  $this->TopLinkString("");
472  $this->DB->Query("UPDATE Classifications SET LinkString=''");
473  }
474  return $this->UpdateValue("NumClassesPerBrowsePage", $NewValue);
475  }
476 
485  function NumColumnsPerBrowsePage($NewValue = DB_NOVALUE)
486  {
487  return $this->UpdateValue("NumColumnsPerBrowsePage", $NewValue);
488  }
489 
497  function BrowsingFieldId($NewValue = DB_NOVALUE)
498  {
499  return $this->UpdateValue("BrowsingFieldId", $NewValue);
500  }
501 
508  function OaiIdDomain($NewValue = DB_NOVALUE)
509  {
510  return $this->UpdateValue("OaiIdDomain", $NewValue);
511  }
512 
519  function OaiIdPrefix($NewValue = DB_NOVALUE)
520  {
521  return $this->UpdateValue("OaiIdPrefix", $NewValue);
522  }
523 
530  function OaiEarliestDate($NewValue = DB_NOVALUE)
531  {
532  return $this->UpdateValue("OaiEarliestDate", $NewValue);
533  }
534 
541  function OaiDateGranularity($NewValue = DB_NOVALUE)
542  {
543  return $this->UpdateValue("OaiDateGranularity", $NewValue);
544  }
545 
552  function SiteKeywords($NewValue = DB_NOVALUE)
553  {
554  return $this->UpdateValue("SiteKeywords", $NewValue);
555  }
556 
563  function AboutText($NewValue = DB_NOVALUE)
564  {
565  return $this->UpdateValue("AboutText", $NewValue);
566  }
567 
574  function ContactName($NewValue = DB_NOVALUE)
575  {
576  return $this->UpdateValue("ContactName", $NewValue);
577  }
578 
585  function ContactEmail($NewValue = DB_NOVALUE)
586  {
587  return $this->UpdateValue("ContactEmail", $NewValue);
588  }
589 
596  function Organization($NewValue = DB_NOVALUE)
597  {
598  return $this->UpdateValue("Organization", $NewValue);
599  }
600 
607  function OrganizationType($NewValue = DB_NOVALUE)
608  {
609  return $this->UpdateValue("OrganizationType", $NewValue);
610  }
611 
618  function SiteType($NewValue = DB_NOVALUE)
619  {
620  return $this->UpdateValue("SiteType", $NewValue);
621  }
622 
631  function OkayToListSite($NewValue = DB_NOVALUE)
632  {
633  return $this->UpdateValue("OkayToListSite", $NewValue);
634  }
635 
642  function LastRegisteredOn($NewValue = DB_NOVALUE)
643  {
644  return $this->UpdateValue("LastRegisteredOn", $NewValue);
645  }
646 
653  function AddAWStatsScript($NewValue = DB_NOVALUE)
654  {
655  return $this->UpdateValue("AddAWStatsScript", $NewValue);
656  }
657 
666  function DisplayLimitsByDefault($NewValue = DB_NOVALUE)
667  {
668  return $this->UpdateValue("DisplayLimitsByDefault", $NewValue);
669  }
670 
678  function DefaultSortField($NewValue = DB_NOVALUE)
679  {
680  return $this->UpdateValue("DefaultSortField", $NewValue);
681  }
682 
690  function FieldDisplayFolder($NewValue = DB_NOVALUE)
691  {
692  return $this->UpdateValue("FieldDisplayFolder", $NewValue);
693  }
694 
702  function FieldEditFolder($NewValue = DB_NOVALUE)
703  {
704  return $this->UpdateValue("FieldEditFolder", $NewValue);
705  }
706 
716  {
717  return $this->UpdateValue("CollapseMetadataFieldGroups", $NewValue);
718  }
719 
726  function RequireEmailWithFeedback($NewValue = DB_NOVALUE)
727  {
728  return $this->UpdateValue("RequireEmailWithFeedback", $NewValue);
729  }
730 
739  {
740  return $this->UpdateValue("SearchEngineUpdatePriority", $NewValue);
741  }
742 
752  {
753  return $this->UpdateValue("RecommenderEngineUpdatePriority", $NewValue);
754  }
755 
762  function LogoFileName()
763  {
764  return $this->UpdateValue("LogoFileName", DB_NOVALUE, "UIStyleConfiguration");
765  }
766 
773  function LogoAltText()
774  {
775  return $this->UpdateValue("LogoAltText", DB_NOVALUE, "UIStyleConfiguration");
776  }
777 
784  function LogoWidth()
785  {
786  return $this->UpdateValue("LogoWidth", DB_NOVALUE, "UIStyleConfiguration");
787  }
788 
795  function LogoHeight()
796  {
797  return $this->UpdateValue("LogoHeight", DB_NOVALUE, "UIStyleConfiguration");
798  }
799 
806  function HasRegistered()
807  {
808  return strlen($this->UpdateValue("LastRegisteredOn", DB_NOVALUE))
809  ? TRUE : FALSE;
810  }
811 
818  function TitleField($NewValue = DB_NOVALUE)
819  {
820  return $this->UpdateValue("TitleField", $NewValue);
821  }
822 
829  function DescriptionField($NewValue = DB_NOVALUE)
830  {
831  return $this->UpdateValue("DescriptionField", $NewValue);
832  }
833 
840  function UrlField($NewValue = DB_NOVALUE)
841  {
842  return $this->UpdateValue("UrlField", $NewValue);
843  }
844 
851  function ScreenshotField($NewValue = DB_NOVALUE)
852  {
853  return $this->UpdateValue("ScreenshotField", $NewValue);
854  }
855 
862  function SecureLogin($NewValue = DB_NOVALUE)
863  {
864  return $this->UpdateValue("SecureLogin", $NewValue);
865  }
866 
873  function EmailLineEnding($NewValue = DB_NOVALUE)
874  {
875  return $this->UpdateValue("EmailLineEnding", $NewValue);
876  }
877 
884  function SavedSearchMailTemplate($NewValue = DB_NOVALUE)
885  {
886  return $this->UpdateValue("SavedSearchMailTemplate", $NewValue);
887  }
888 
895  function DefaultUserPrivs($NewValue = DB_NOVALUE)
896  {
897  if ($NewValue !== DB_NOVALUE)
898  {
899  $NewValue = serialize($NewValue);
900  }
901 
902  $Result = unserialize($this->UpdateValue("DefaultUserPrivs", $NewValue));
903 
904  if (!is_array($Result))
905  {
906  $Result = $this->DefaultUserPrivs(array());
907  }
908 
909  return $Result;
910  }
911 
918  function RootUrlOverride($NewValue = DB_NOVALUE)
919  {
920  return $this->UpdateValue("RootUrlOverride", $NewValue);
921  }
922 
929  function PreferHttpHost($NewValue = DB_NOVALUE)
930  {
931  return $this->UpdateValue("PreferHttpHost", $NewValue);
932  }
933 
940  function Value($FieldName, $NewValue = DB_NOVALUE)
941  {
942  return $this->UpdateValue($FieldName, $NewValue);
943  }
944 
949  function AddGoogleAnalytics($NewValue = DB_NOVALUE)
950  {
951  return FALSE;
952  }
953 
954 
955  # ---- PRIVATE INTERFACE -------------------------------------------------
956 
957  private $DB;
958  private $DBFields;
959 
968  private function UpdateValue($FieldName, $NewValue, $Table="SystemConfiguration")
969  {
970  if ($NewValue != DB_NOVALUE)
971  {
972  $SignalResult = $GLOBALS["AF"]->SignalEvent(
973  "EVENT_SET_SYSCONFIG_VALUE", array(
974  "FieldName" => $FieldName,
975  "NewValue" => $NewValue));
976  $NewValue = $SignalResult["NewValue"];
977  }
978  $Value = $this->DB->UpdateValue($Table, $FieldName,
979  $NewValue, NULL, $this->DBFields);
980  $SignalResult = $GLOBALS["AF"]->SignalEvent(
981  "EVENT_GET_SYSCONFIG_VALUE", array(
982  "FieldName" => $FieldName,
983  "Value" => $Value));
984  $Value = $SignalResult["Value"];
985  return $Value;
986  }
987 }
const UNCHANGED_VALUE
This value is used to determine if a value is changed.
NumResourcesForSearchFacets($NewValue=DB_NOVALUE)
Gets or sets the number of resources considered to build search facets.
ContactName($NewValue=DB_NOVALUE)
Gets or sets the contact name system configuration setting.
DefaultCharacterSet($NewValue=DB_NOVALUE)
Gets or sets the default character set system configuration setting.
ResourceRatingsEnabled($NewValue=DB_NOVALUE)
Gets or sets the resource ratings enabled system configuration setting.
DefaultUserPrivs($NewValue=DB_NOVALUE)
Gets or sets the default user privileges system configuration setting.
ReleaseFlagApproved($NewValue=DB_NOVALUE)
Gets or sets the release flag approved system configuration setting.
OkayToListSite($NewValue=DB_NOVALUE)
Gets or sets the okay to list site system configuration setting.
ForumsAllowHTML($NewValue=DB_NOVALUE)
Gets or sets the forums allow html system configuration setting.
PortalName($NewValue=DB_NOVALUE)
Gets or sets the portal name system configuration setting.
ContactEmail($NewValue=DB_NOVALUE)
Gets or sets the contact email system configuration setting.
AddAWStatsScript($NewValue=DB_NOVALUE)
Gets or sets the add AW stats script system configuration setting.
FieldDisplayFolder($NewValue=DB_NOVALUE)
Gets or sets the field display folder system configuration setting.
ResourceLaunchesNewWindowEnabled($NewValue=DB_NOVALUE)
Gets or sets the resource launches new window enabled system configuration setting.
AddGoogleAnalytics($NewValue=DB_NOVALUE)
Method retained for backward compatibility with old interfaces.
MailChangeMailBody($NewValue=DB_NOVALUE)
Gets or sets the mail change mail body system configuration setting.
RecommenderEngineUpdatePriority($NewValue=DB_NOVALUE)
Gets or sets the recommender engine update priority system configuration setting. ...
SQL database abstraction object with smart query caching.
RecommenderDBEnabled($NewValue=DB_NOVALUE)
Gets or sets the recommender database enabled system configuration setting.
TopLinkString($NewValue=DB_NOVALUE)
Gets or sets the top link string system configuration setting.
const DB_NOVALUE
NumClassesPerBrowsePage($NewValue=DB_NOVALUE)
Gets or sets the number of classes per browse page system configuration setting.
LogoFileName()
Gets or sets the logo file name system configuration setting.
SecureLogin($NewValue=DB_NOVALUE)
Gets or sets the secure login system configuration setting.
MailChangeMailSubject($NewValue=DB_NOVALUE)
Gets or sets the mail change mail subject system configuration setting.
DefaultSortField($NewValue=DB_NOVALUE)
Gets or sets the default sort field system configuration setting.
NumColumnsPerBrowsePage($NewValue=DB_NOVALUE)
Gets or sets the number of columns per browse page system configuration setting.
UrlField($NewValue=DB_NOVALUE)
Gets or sets the url field system configuration setting.
CurrentTheme($NewValue=DB_NOVALUE)
Gets or sets the current theme system configuration setting.
SearchEngineUpdatePriority($NewValue=DB_NOVALUE)
Gets or sets the search engine update priority system configuration setting.
LogoHeight()
Gets or sets the logo height system configuration setting.
DefaultActiveUI($NewValue=DB_NOVALUE)
Gets or sets the default active UI system configuration setting.
UserAgentsEnabled($NewValue=DB_NOVALUE)
Gets or sets the user agents enabled system configuration setting.
ResourceCommentsEnabled($NewValue=DB_NOVALUE)
Gets or sets the resource comments enabled system configuration setting.
OaiDateGranularity($NewValue=DB_NOVALUE)
Gets or sets the OAI date granularity system configuration setting.
SavedSearchMailTemplate($NewValue=DB_NOVALUE)
Gets or sets the saved search mail template system configuration setting.
HasRegistered()
Gets or sets the has registered system configuration setting.
NumAnnounceOnHomePage($NewValue=DB_NOVALUE)
Gets or sets the number of announcements on homepage system configuration setting.
ForumsEnabled($NewValue=DB_NOVALUE)
Gets or sets the forums enabled system configuration setting.
RequireEmailWithFeedback($NewValue=DB_NOVALUE)
Gets or sets the require email with feedback system configuration setting.
CollapseMetadataFieldGroups($NewValue=DB_NOVALUE)
Gets or sets the collapse metadata field groups system configuration setting.
OaiIdDomain($NewValue=DB_NOVALUE)
Gets or sets the OAI ID domain system configuration setting.
__construct()
Constructs a new SystemConfiguration object.
AdminEmail($NewValue=DB_NOVALUE)
Gets or sets the admin email system configuration setting.
ForumsUseWYSIWYG($NewValue=DB_NOVALUE)
Gets or sets the forums use WYSIWYG editor setting.
IncrementalKeywordSearchEnabled($NewValue=DB_NOVALUE)
Gets or sets the incremental keyword search enabled system configuration setting. ...
SearchTermsRequired($NewValue=DB_NOVALUE)
Gets or sets the search terms required system configuration setting.
AllowMultipleUIsEnabled($NewValue=DB_NOVALUE)
Gets or sets the allow multiple UIs enabled system configuration setting.
AnnouncementsEnabled($NewValue=DB_NOVALUE)
Gets or sets the announcements enabled system configuration setting.
OrganizationType($NewValue=DB_NOVALUE)
Gets or sets the organization type system configuration setting.
Value($FieldName, $NewValue=DB_NOVALUE)
Gets or changes a value in the database.
SiteType($NewValue=DB_NOVALUE)
Gets or sets the site type system configuration setting.
DisplayLimitsByDefault($NewValue=DB_NOVALUE)
Gets or sets the display limits by default system configuration setting.
MaxFacetsPerField($NewValue=DB_NOVALUE)
Gets or sets the number of facets considered excessive, above which we won't display the facets...
DescriptionField($NewValue=DB_NOVALUE)
Gets or sets the description field system configuration setting.
LegalNotice($NewValue=DB_NOVALUE)
Gets or sets the legal notice system configuration setting.
OaiEarliestDate($NewValue=DB_NOVALUE)
Gets or sets the OAI earliest date system configuration setting.
Organization($NewValue=DB_NOVALUE)
Gets or sets the organization system configuration setting.
SearchDBEnabled($NewValue=DB_NOVALUE)
Gets or sets the search database enabled system configuration setting.
NumResourcesOnHomePage($NewValue=DB_NOVALUE)
Gets or sets the number of resources on homepage system configuration setting.
AccessibilityWizardEnabled($NewValue=DB_NOVALUE)
Gets or sets the accessibility wizard enabled system configuration setting.
EmailLineEnding($NewValue=DB_NOVALUE)
Gets or sets the email line ending system configuration setting.
SiteKeywords($NewValue=DB_NOVALUE)
Gets or sets the site keywords system configuration setting.
PasswordResetMailBody($NewValue=DB_NOVALUE)
Gets or sets the password reset mail body system configuration setting.
FieldEditFolder($NewValue=DB_NOVALUE)
Gets or sets the field edit folder system configuration setting.
ShowNumResourcesEnabled($NewValue=DB_NOVALUE)
Gets or sets the show number of resources enabled system configuration setting.
TopLinkBeginLetter($NewValue=DB_NOVALUE)
Gets or sets the top link begin letter system configuration setting.
PasswordMailSubject($NewValue=DB_NOVALUE)
Gets or sets the password mail subject system configuration setting.
LogoWidth()
Gets or sets the logo width system configuration setting.
RootUrlOverride($NewValue=DB_NOVALUE)
Gets or sets the root URL override system configuration setting.
LogoAltText()
Gets or sets the logo alt text system configuration setting.
PasswordResetMailSubject($NewValue=DB_NOVALUE)
Gets or sets the password reset mail subject system configuration setting.
LastRegisteredOn($NewValue=DB_NOVALUE)
Gets or sets the last registered on system configuration setting.
TopLinkEndLetter($NewValue=DB_NOVALUE)
Gets or sets the top link end letter system configuration setting.
ScreenshotField($NewValue=DB_NOVALUE)
Gets or sets the screenshot field system configuration setting.
DefaultRecordsPerPage($NewValue=DB_NOVALUE)
Gets or sets the default records per page system configuration setting.
BrowsingFieldId($NewValue=DB_NOVALUE)
Gets or sets the browsing field ID system configuration setting.
AboutText($NewValue=DB_NOVALUE)
Gets or sets the about text system configuration setting.
PasswordMailBody($NewValue=DB_NOVALUE)
Gets or sets the password mail body system configuration setting.
PreferHttpHost($NewValue=DB_NOVALUE)
Gets or sets the prefer HTTP_HOST system configuration setting.
OAISQEnabled($NewValue=DB_NOVALUE)
Gets or sets OAISQ enabled system configuration setting.
OaiIdPrefix($NewValue=DB_NOVALUE)
Gets or sets the OAI ID prefix system configuration setting.
TitleField($NewValue=DB_NOVALUE)
Gets or sets the title field system configuration setting.