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 {
12 
18 
19  # ---- PUBLIC INTERFACE --------------------------------------------------
20 
24  public function __construct()
25  {
26  $this->DB = new Database();
27  }
28 
36  public function TopLinkString($NewValue = DB_NOVALUE)
37  {
38  return $this->UpdateValue("TopLinkString", $NewValue);
39  }
40 
48  public function TopLinkBeginLetter($NewValue = DB_NOVALUE)
49  {
50  return $this->UpdateValue("TopLinkBeginLetter", $NewValue);
51  }
52 
60  public function TopLinkEndLetter($NewValue = DB_NOVALUE)
61  {
62  return $this->UpdateValue("TopLinkEndLetter", $NewValue);
63  }
64 
71  public function AdminEmail($NewValue = DB_NOVALUE)
72  {
73  return $this->UpdateValue("AdminEmail", $NewValue);
74  }
75 
82  public function PasswordMailSubject($NewValue = DB_NOVALUE)
83  {
84  return $this->UpdateValue("PasswordMailSubject", $NewValue);
85  }
86 
93  public function PasswordMailBody($NewValue = DB_NOVALUE)
94  {
95  return $this->UpdateValue("PasswordMailBody", $NewValue);
96  }
97 
104  public function PasswordResetMailSubject($NewValue = DB_NOVALUE)
105  {
106  return $this->UpdateValue("PasswordResetMailSubject", $NewValue);
107  }
108 
115  public function PasswordResetMailBody($NewValue = DB_NOVALUE)
116  {
117  return $this->UpdateValue("PasswordResetMailBody", $NewValue);
118  }
119 
126  public function MailChangeMailSubject($NewValue = DB_NOVALUE)
127  {
128  return $this->UpdateValue("MailChangeMailSubject", $NewValue);
129  }
130 
137  public function MailChangeMailBody($NewValue = DB_NOVALUE)
138  {
139  return $this->UpdateValue("MailChangeMailBody", $NewValue);
140  }
141 
148  public function PortalName($NewValue = DB_NOVALUE)
149  {
150  return $this->UpdateValue("PortalName", $NewValue);
151  }
152 
159  public function DefaultActiveUI($NewValue = DB_NOVALUE)
160  {
161  return $this->UpdateValue("DefaultActiveUI", $NewValue);
162  }
163 
170  public function CurrentTheme($NewValue = DB_NOVALUE)
171  {
172  return $this->UpdateValue("CurrentTheme", $NewValue);
173  }
174 
181  public function DefaultCharacterSet($NewValue = DB_NOVALUE)
182  {
183  return $this->UpdateValue("DefaultCharacterSet", $NewValue);
184  }
185 
193  public function SearchTermsRequired($NewValue = DB_NOVALUE)
194  {
195  return $this->UpdateValue("SearchTermsRequired", $NewValue);
196  }
197 
205  public function ShowNumResourcesEnabled($NewValue = DB_NOVALUE)
206  {
207  return $this->UpdateValue("ShowNumResourcesEnabled", $NewValue);
208  }
209 
216  public function AnnouncementsEnabled($NewValue = DB_NOVALUE)
217  {
218  return $this->UpdateValue("AnnouncementsEnabled", $NewValue);
219  }
220 
227  public function ForumsEnabled($NewValue = DB_NOVALUE)
228  {
229  return $this->UpdateValue("ForumsEnabled", $NewValue);
230  }
231 
238  public function ForumsAllowHTML($NewValue = DB_NOVALUE)
239  {
240  return $this->UpdateValue("ForumsAllowHTML", $NewValue);
241  }
242 
249  public function ForumsUseWYSIWYG($NewValue = DB_NOVALUE)
250  {
251  return $this->UpdateValue("ForumsUseWYSIWYG", $NewValue);
252  }
253 
261  public function AllowMultipleUIsEnabled($NewValue = DB_NOVALUE)
262  {
263  return $this->UpdateValue("AllowMultipleUIsEnabled", $NewValue);
264  }
265 
275  public function ResourceLaunchesNewWindowEnabled($NewValue = DB_NOVALUE)
276  {
277  return $this->UpdateValue("ResourceLaunchesNewWindowEnabled", $NewValue);
278  }
279 
286  public function ResourceRatingsEnabled($NewValue = DB_NOVALUE)
287  {
288  return $this->UpdateValue("ResourceRatingsEnabled", $NewValue);
289  }
290 
297  public function ResourceCommentsEnabled($NewValue = DB_NOVALUE)
298  {
299  return $this->UpdateValue("ResourceCommentsEnabled", $NewValue);
300  }
301 
310  public function AccessibilityWizardEnabled($NewValue = DB_NOVALUE)
311  {
312  return FALSE;
313  }
314 
323  public function IncrementalKeywordSearchEnabled($NewValue = DB_NOVALUE)
324  {
325  return $this->UpdateValue("IncrementalKeywordSearchEnabled", $NewValue);
326  }
327 
335  public function ReleaseFlagApproved($NewValue = DB_NOVALUE)
336  {
337  return $this->UpdateValue("ReleaseFlagApproved", $NewValue);
338  }
339 
346  public function SearchDBEnabled($NewValue = DB_NOVALUE)
347  {
348  return $this->UpdateValue("SearchDBEnabled", $NewValue);
349  }
350 
358  public function RecommenderDBEnabled($NewValue = DB_NOVALUE)
359  {
360  return $this->UpdateValue("RecommenderDBEnabled", $NewValue);
361  }
362 
371  public function NumAnnounceOnHomePage($NewValue = DB_NOVALUE)
372  {
373  return $this->UpdateValue("NumAnnounceOnHomePage", $NewValue);
374  }
375 
383  public function NumResourcesOnHomePage($NewValue = DB_NOVALUE)
384  {
385  return $this->UpdateValue("NumResourcesOnHomePage", $NewValue);
386  }
387 
394  public function LegalNotice($NewValue = DB_NOVALUE)
395  {
396  return $this->UpdateValue("LegalNotice", $NewValue);
397  }
398 
405  public function DefaultRecordsPerPage($NewValue = DB_NOVALUE)
406  {
407  return $this->UpdateValue("DefaultRecordsPerPage", $NewValue);
408  }
409 
417  public function NumResourcesForSearchFacets($NewValue = DB_NOVALUE)
418  {
419  return $this->UpdateValue("NumResourcesForSearchFacets", $NewValue);
420  }
421 
429  public function MaxFacetsPerField($NewValue = DB_NOVALUE)
430  {
431  return $this->UpdateValue("MaxFacetsPerField", $NewValue);
432  }
433 
442  public function NumClassesPerBrowsePage($NewValue = DB_NOVALUE)
443  {
444  # if new classes per browse page has been specified
445  if ($NewValue !== DB_NOVALUE &&
446  $NewValue != $this->UpdateValue("NumClassesPerBrowsePage", DB_NOVALUE))
447  {
448  # clear all classification links
449  $this->TopLinkString("");
450  $this->DB->Query("UPDATE Classifications SET LinkString=''");
451  }
452  return $this->UpdateValue("NumClassesPerBrowsePage", $NewValue);
453  }
454 
463  public function NumColumnsPerBrowsePage($NewValue = DB_NOVALUE)
464  {
465  return $this->UpdateValue("NumColumnsPerBrowsePage", $NewValue);
466  }
467 
475  public function BrowsingFieldId($NewValue = DB_NOVALUE)
476  {
477  return $this->UpdateValue("BrowsingFieldId", $NewValue);
478  }
479 
486  public function OaiIdDomain($NewValue = DB_NOVALUE)
487  {
488  return $this->UpdateValue("OaiIdDomain", $NewValue);
489  }
490 
497  public function OaiIdPrefix($NewValue = DB_NOVALUE)
498  {
499  return $this->UpdateValue("OaiIdPrefix", $NewValue);
500  }
501 
508  public function OaiEarliestDate($NewValue = DB_NOVALUE)
509  {
510  return $this->UpdateValue("OaiEarliestDate", $NewValue);
511  }
512 
519  public function OaiDateGranularity($NewValue = DB_NOVALUE)
520  {
521  return $this->UpdateValue("OaiDateGranularity", $NewValue);
522  }
523 
530  public function SiteKeywords($NewValue = DB_NOVALUE)
531  {
532  return $this->UpdateValue("SiteKeywords", $NewValue);
533  }
534 
541  public function AboutText($NewValue = DB_NOVALUE)
542  {
543  return $this->UpdateValue("AboutText", $NewValue);
544  }
545 
552  public function ContactName($NewValue = DB_NOVALUE)
553  {
554  return $this->UpdateValue("ContactName", $NewValue);
555  }
556 
563  public function ContactEmail($NewValue = DB_NOVALUE)
564  {
565  return $this->UpdateValue("ContactEmail", $NewValue);
566  }
567 
574  public function Organization($NewValue = DB_NOVALUE)
575  {
576  return $this->UpdateValue("Organization", $NewValue);
577  }
578 
585  public function OrganizationType($NewValue = DB_NOVALUE)
586  {
587  return $this->UpdateValue("OrganizationType", $NewValue);
588  }
589 
596  public function SiteType($NewValue = DB_NOVALUE)
597  {
598  return $this->UpdateValue("SiteType", $NewValue);
599  }
600 
609  public function OkayToListSite($NewValue = DB_NOVALUE)
610  {
611  return $this->UpdateValue("OkayToListSite", $NewValue);
612  }
613 
620  public function LastRegisteredOn($NewValue = DB_NOVALUE)
621  {
622  return $this->UpdateValue("LastRegisteredOn", $NewValue);
623  }
624 
631  public function AddAWStatsScript($NewValue = DB_NOVALUE)
632  {
633  return $this->UpdateValue("AddAWStatsScript", $NewValue);
634  }
635 
644  public function DisplayLimitsByDefault($NewValue = DB_NOVALUE)
645  {
646  return $this->UpdateValue("DisplayLimitsByDefault", $NewValue);
647  }
648 
656  public function DefaultSortField($NewValue = DB_NOVALUE)
657  {
658  return $this->UpdateValue("DefaultSortField", $NewValue);
659  }
660 
668  public function FieldDisplayFolder($NewValue = DB_NOVALUE)
669  {
670  return $this->UpdateValue("FieldDisplayFolder", $NewValue);
671  }
672 
680  public function FieldEditFolder($NewValue = DB_NOVALUE)
681  {
682  return $this->UpdateValue("FieldEditFolder", $NewValue);
683  }
684 
693  public function CollapseMetadataFieldGroups($NewValue = DB_NOVALUE)
694  {
695  return $this->UpdateValue("CollapseMetadataFieldGroups", $NewValue);
696  }
697 
704  public function RequireEmailWithFeedback($NewValue = DB_NOVALUE)
705  {
706  return $this->UpdateValue("RequireEmailWithFeedback", $NewValue);
707  }
708 
716  public function SearchEngineUpdatePriority($NewValue = DB_NOVALUE)
717  {
718  return $this->UpdateValue("SearchEngineUpdatePriority", $NewValue);
719  }
720 
729  public function RecommenderEngineUpdatePriority($NewValue = DB_NOVALUE)
730  {
731  return $this->UpdateValue("RecommenderEngineUpdatePriority", $NewValue);
732  }
733 
738  public function LogoFileName()
739  {
740  return $this->UpdateValue("LogoFileName", DB_NOVALUE, "UIStyleConfiguration");
741  }
742 
747  public function LogoAltText()
748  {
749  return $this->UpdateValue("LogoAltText", DB_NOVALUE, "UIStyleConfiguration");
750  }
751 
756  public function LogoWidth()
757  {
758  return $this->UpdateValue("LogoWidth", DB_NOVALUE, "UIStyleConfiguration");
759  }
760 
765  public function LogoHeight()
766  {
767  return $this->UpdateValue("LogoHeight", DB_NOVALUE, "UIStyleConfiguration");
768  }
769 
774  public function HasRegistered()
775  {
776  return strlen($this->UpdateValue("LastRegisteredOn", DB_NOVALUE))
777  ? TRUE : FALSE;
778  }
779 
786  public function EmailLineEnding($NewValue = DB_NOVALUE)
787  {
788  return $this->UpdateValue("EmailLineEnding", $NewValue);
789  }
790 
797  public function DefaultUserPrivs($NewValue = DB_NOVALUE)
798  {
799  if ($NewValue !== DB_NOVALUE)
800  {
801  $NewValue = serialize($NewValue);
802  }
803 
804  $Result = unserialize($this->UpdateValue("DefaultUserPrivs", $NewValue));
805 
806  if (!is_array($Result))
807  {
808  $Result = $this->DefaultUserPrivs(array());
809  }
810 
811  return $Result;
812  }
813 
820  public function RootUrlOverride($NewValue = DB_NOVALUE)
821  {
822  return $this->UpdateValue("RootUrlOverride", $NewValue);
823  }
824 
831  public function PreferHttpHost($NewValue = DB_NOVALUE)
832  {
833  return $this->UpdateValue("PreferHttpHost", $NewValue);
834  }
835 
842  public function Value($FieldName, $NewValue = DB_NOVALUE)
843  {
844  return $this->UpdateValue($FieldName, $NewValue);
845  }
846 
853  public function AddGoogleAnalytics($NewValue = DB_NOVALUE)
854  {
855  return FALSE;
856  }
857 
864  public function ShowGroupNamesEnabled($NewValue = DB_NOVALUE)
865  {
866  return $this->UpdateValue("ShowGroupNamesEnabled", $NewValue);
867  }
868 
874  public function PasswordMinLength($NewValue = DB_NOVALUE)
875  {
876  return $this->UpdateValue("PasswordMinLength", $NewValue);
877  }
878 
884  public function PasswordUniqueChars($NewValue = DB_NOVALUE)
885  {
886  return $this->UpdateValue("PasswordUniqueChars", $NewValue);
887  }
888 
894  public function PasswordRequiresPunctuation($NewValue = DB_NOVALUE)
895  {
896  return $this->UpdateValue("PasswordRequiresPunctuation", $NewValue);
897  }
898 
904  public function PasswordRequiresMixedCase($NewValue = DB_NOVALUE)
905  {
906  return $this->UpdateValue("PasswordRequiresMixedCase", $NewValue);
907  }
908 
914  public function PasswordRequiresDigits($NewValue = DB_NOVALUE)
915  {
916  return $this->UpdateValue("PasswordRequiresDigits", $NewValue);
917  }
918 
919  # ---- PRIVATE INTERFACE -------------------------------------------------
920 
921  private $DB;
922  private $DBFields;
923 
932  private function UpdateValue($FieldName, $NewValue, $Table="SystemConfiguration")
933  {
934  if ($NewValue != DB_NOVALUE)
935  {
936  $SignalResult = $GLOBALS["AF"]->SignalEvent(
937  "EVENT_SET_SYSCONFIG_VALUE", array(
938  "FieldName" => $FieldName,
939  "NewValue" => $NewValue));
940  $NewValue = $SignalResult["NewValue"];
941  }
942  $Value = $this->DB->UpdateValue($Table, $FieldName,
943  $NewValue, NULL, $this->DBFields);
944  $SignalResult = $GLOBALS["AF"]->SignalEvent(
945  "EVENT_GET_SYSCONFIG_VALUE", array(
946  "FieldName" => $FieldName,
947  "Value" => $Value));
948  $Value = $SignalResult["Value"];
949  return $Value;
950  }
951 }
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.
Definition: Database.php:22
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.
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.
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.
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.
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.
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.
PasswordRequiresDigits($NewValue=DB_NOVALUE)
Get/set the PasswordRequiresDigits 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.
PasswordMinLength($NewValue=DB_NOVALUE)
Get/set the PasswordMinLength 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&#39;t display the facets...
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.
const DB_NOVALUE
Definition: Database.php:1784
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.
PasswordRequiresPunctuation($NewValue=DB_NOVALUE)
Get/set the PasswordRequiresPunctuation setting.
PasswordRequiresMixedCase($NewValue=DB_NOVALUE)
Get/set the PasswordRequiresMixedCase 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.
ShowGroupNamesEnabled($NewValue=DB_NOVALUE)
Gets or sets Show Group Names 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.
PasswordUniqueChars($NewValue=DB_NOVALUE)
Get/set the PasswordUniqueChars 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.
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.
OaiIdPrefix($NewValue=DB_NOVALUE)
Gets or sets the OAI ID prefix system configuration setting.