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){ return $this->UpdateValue("TopLinkString", $NewValue); }
36 
44  function TopLinkBeginLetter($NewValue = DB_NOVALUE) { return $this->UpdateValue("TopLinkBeginLetter", $NewValue); }
45 
53  function TopLinkEndLetter($NewValue = DB_NOVALUE) { return $this->UpdateValue("TopLinkEndLetter", $NewValue); }
54 
61  function AdminEmail($NewValue = DB_NOVALUE) { return $this->UpdateValue("AdminEmail", $NewValue); }
62 
69  function PasswordMailSubject($NewValue = DB_NOVALUE) { return $this->UpdateValue("PasswordMailSubject", $NewValue); }
70 
77  function PasswordMailBody($NewValue = DB_NOVALUE) { return $this->UpdateValue("PasswordMailBody", $NewValue); }
78 
85  function PasswordResetMailSubject($NewValue = DB_NOVALUE) { return $this->UpdateValue("PasswordResetMailSubject", $NewValue); }
86 
93  function PasswordResetMailBody($NewValue = DB_NOVALUE) { return $this->UpdateValue("PasswordResetMailBody", $NewValue); }
94 
101  function MailChangeMailSubject($NewValue = DB_NOVALUE) { return $this->UpdateValue("MailChangeMailSubject", $NewValue); }
102 
109  function MailChangeMailBody($NewValue = DB_NOVALUE) { return $this->UpdateValue("MailChangeMailBody", $NewValue); }
110 
117  function PortalName($NewValue = DB_NOVALUE) { return $this->UpdateValue("PortalName", $NewValue); }
118 
125  function DefaultActiveUI($NewValue = DB_NOVALUE) { return $this->UpdateValue("DefaultActiveUI", $NewValue); }
126 
133  function CurrentTheme($NewValue = DB_NOVALUE) { return $this->UpdateValue("CurrentTheme", $NewValue); }
134 
141  function DefaultCharacterSet($NewValue = DB_NOVALUE) { return $this->UpdateValue("DefaultCharacterSet", $NewValue); }
142 
150  function SearchTermsRequired($NewValue = DB_NOVALUE) { return $this->UpdateValue("SearchTermsRequired", $NewValue); }
151 
159  function ShowNumResourcesEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("ShowNumResourcesEnabled", $NewValue); }
160 
167  function AnnouncementsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("AnnouncementsEnabled", $NewValue); }
168 
175  function ForumsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("ForumsEnabled", $NewValue); }
176 
182  function ForumsAllowHTML($NewValue = DB_NOVALUE) { return $this->UpdateValue("ForumsAllowHTML", $NewValue); }
183 
189  function ForumsUseWYSIWYG($NewValue = DB_NOVALUE) { return $this->UpdateValue("ForumsUseWYSIWYG", $NewValue); }
190 
198  function AllowMultipleUIsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("AllowMultipleUIsEnabled", $NewValue); }
199 
209  function ResourceLaunchesNewWindowEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("ResourceLaunchesNewWindowEnabled", $NewValue); }
210 
218  function UserAgentsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("UserAgentsEnabled", $NewValue); }
219 
226  function ResourceRatingsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("ResourceRatingsEnabled", $NewValue); }
227 
234  function ResourceCommentsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("ResourceCommentsEnabled", $NewValue); }
235 
244  function IncrementalKeywordSearchEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("IncrementalKeywordSearchEnabled", $NewValue); }
245 
253  function ReleaseFlagApproved($NewValue = DB_NOVALUE) { return $this->UpdateValue("ReleaseFlagApproved", $NewValue); }
254 
261  function SearchDBEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("SearchDBEnabled", $NewValue); }
262 
270  function RecommenderDBEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("RecommenderDBEnabled", $NewValue); }
271 
278  function OAISQEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("OAISQEnabled", $NewValue); }
279 
288  function NumAnnounceOnHomePage($NewValue = DB_NOVALUE) { return $this->UpdateValue("NumAnnounceOnHomePage", $NewValue); }
289 
297  function NumResourcesOnHomePage($NewValue = DB_NOVALUE) { return $this->UpdateValue("NumResourcesOnHomePage", $NewValue); }
298 
305  function LegalNotice($NewValue = DB_NOVALUE) { return $this->UpdateValue("LegalNotice", $NewValue); }
306 
313  function DefaultRecordsPerPage($NewValue = DB_NOVALUE) { return $this->UpdateValue("DefaultRecordsPerPage", $NewValue); }
314 
323  { return $this->UpdateValue("NumResourcesForSearchFacets", $NewValue); }
324 
331  function MaxFacetsPerField($NewValue = DB_NOVALUE)
332  { return $this->UpdateValue("MaxFacetsPerField", $NewValue); }
333 
342  function NumClassesPerBrowsePage($NewValue = DB_NOVALUE)
343  {
344  # if new classes per browse page has been specified
345  if ($NewValue !== DB_NOVALUE &&
346  $NewValue != $this->UpdateValue("NumClassesPerBrowsePage", DB_NOVALUE))
347  {
348  # clear all classification links
349  $this->TopLinkString("");
350  $this->DB->Query("UPDATE Classifications SET LinkString=''");
351  }
352  return $this->UpdateValue("NumClassesPerBrowsePage", $NewValue);
353  }
354 
363  function NumColumnsPerBrowsePage($NewValue = DB_NOVALUE) { return $this->UpdateValue("NumColumnsPerBrowsePage", $NewValue); }
364 
372  function BrowsingFieldId($NewValue = DB_NOVALUE) { return $this->UpdateValue("BrowsingFieldId", $NewValue); }
373 
380  function OaiIdDomain($NewValue = DB_NOVALUE) { return $this->UpdateValue("OaiIdDomain", $NewValue); }
381 
388  function OaiIdPrefix($NewValue = DB_NOVALUE) { return $this->UpdateValue("OaiIdPrefix", $NewValue); }
389 
396  function OaiEarliestDate($NewValue = DB_NOVALUE) { return $this->UpdateValue("OaiEarliestDate", $NewValue); }
397 
404  function OaiDateGranularity($NewValue = DB_NOVALUE) { return $this->UpdateValue("OaiDateGranularity", $NewValue); }
405 
412  function SiteKeywords($NewValue = DB_NOVALUE) { return $this->UpdateValue("SiteKeywords", $NewValue); }
413 
420  function AboutText($NewValue = DB_NOVALUE) { return $this->UpdateValue("AboutText", $NewValue); }
421 
428  function ContactName($NewValue = DB_NOVALUE) { return $this->UpdateValue("ContactName", $NewValue); }
429 
436  function ContactEmail($NewValue = DB_NOVALUE) { return $this->UpdateValue("ContactEmail", $NewValue); }
437 
444  function Organization($NewValue = DB_NOVALUE) { return $this->UpdateValue("Organization", $NewValue); }
445 
452  function OrganizationType($NewValue = DB_NOVALUE) { return $this->UpdateValue("OrganizationType", $NewValue); }
453 
460  function SiteType($NewValue = DB_NOVALUE) { return $this->UpdateValue("SiteType", $NewValue); }
461 
470  function OkayToListSite($NewValue = DB_NOVALUE) { return $this->UpdateValue("OkayToListSite", $NewValue); }
471 
478  function LastRegisteredOn($NewValue = DB_NOVALUE) { return $this->UpdateValue("LastRegisteredOn", $NewValue); }
479 
486  function AddAWStatsScript($NewValue = DB_NOVALUE) { return $this->UpdateValue("AddAWStatsScript", $NewValue); }
487 
494  function AddGoogleAnalytics($NewValue = DB_NOVALUE) { return $this->UpdateValue("AddGoogleAnalytics", $NewValue); }
495 
502  function GoogleAnalyticsCode($NewValue = DB_NOVALUE) { return $this->UpdateValue("GoogleAnalyticsCode", $NewValue); }
503 
512  function DisplayLimitsByDefault($NewValue = DB_NOVALUE) { return $this->UpdateValue("DisplayLimitsByDefault", $NewValue); }
513 
521  function DefaultSortField($NewValue = DB_NOVALUE) { return $this->UpdateValue("DefaultSortField", $NewValue); }
522 
530  function FieldDisplayFolder($NewValue = DB_NOVALUE) { return $this->UpdateValue("FieldDisplayFolder", $NewValue); }
531 
539  function FieldEditFolder($NewValue = DB_NOVALUE) { return $this->UpdateValue("FieldEditFolder", $NewValue); }
540 
549  function CollapseMetadataFieldGroups($NewValue = DB_NOVALUE) { return $this->UpdateValue("CollapseMetadataFieldGroups", $NewValue); }
550 
557  function RequireEmailWithFeedback($NewValue = DB_NOVALUE) { return $this->UpdateValue("RequireEmailWithFeedback", $NewValue); }
558 
565  function UseMinimizedJavascript($NewValue = DB_NOVALUE) { return $this->UpdateValue("UseMinimizedJavascript", $NewValue); }
566 
574  function SearchEngineUpdatePriority($NewValue = DB_NOVALUE) { return $this->UpdateValue("SearchEngineUpdatePriority", $NewValue); }
575 
584  function RecommenderEngineUpdatePriority($NewValue = DB_NOVALUE) { return $this->UpdateValue("RecommenderEngineUpdatePriority", $NewValue); }
585 
592  function LogoFileName()
593  {
594  return $this->UpdateValue("LogoFileName", DB_NOVALUE, "UIStyleConfiguration");
595  }
596 
603  function LogoAltText()
604  {
605  return $this->UpdateValue("LogoAltText", DB_NOVALUE, "UIStyleConfiguration");
606  }
607 
614  function LogoWidth()
615  {
616  return $this->UpdateValue("LogoWidth", DB_NOVALUE, "UIStyleConfiguration");
617  }
618 
625  function LogoHeight()
626  {
627  return $this->UpdateValue("LogoHeight", DB_NOVALUE, "UIStyleConfiguration");
628  }
629 
636  function HasRegistered()
637  {
638  return strlen($this->UpdateValue("LastRegisteredOn", DB_NOVALUE))
639  ? TRUE : FALSE;
640  }
641 
648  function TitleField($NewValue = DB_NOVALUE) { return $this->UpdateValue("TitleField", $NewValue); }
649 
656  function DescriptionField($NewValue = DB_NOVALUE) { return $this->UpdateValue("DescriptionField", $NewValue); }
657 
664  function UrlField($NewValue = DB_NOVALUE) { return $this->UpdateValue("UrlField", $NewValue); }
665 
672  function ScreenshotField($NewValue = DB_NOVALUE) { return $this->UpdateValue("ScreenshotField", $NewValue); }
673 
680  function SecureLogin($NewValue = DB_NOVALUE) { return $this->UpdateValue("SecureLogin", $NewValue); }
681 
688  function EmailLineEnding($NewValue = DB_NOVALUE) { return $this->UpdateValue("EmailLineEnding", $NewValue); }
689 
696  function SavedSearchMailTemplate($NewValue = DB_NOVALUE) { return $this->UpdateValue("SavedSearchMailTemplate", $NewValue); }
697 
704  function DefaultUserPrivs($NewValue = DB_NOVALUE)
705  {
706  if ($NewValue !== DB_NOVALUE)
707  {
708  $NewValue = serialize($NewValue);
709  }
710 
711  $Result = unserialize($this->UpdateValue("DefaultUserPrivs", $NewValue));
712 
713  if (!is_array($Result))
714  {
715  $Result = $this->DefaultUserPrivs(array());
716  }
717 
718  return $Result;
719  }
720 
727  function RootUrlOverride($NewValue = DB_NOVALUE) { return $this->UpdateValue("RootUrlOverride", $NewValue); }
728 
735  function PreferHttpHost($NewValue = DB_NOVALUE) { return $this->UpdateValue("PreferHttpHost", $NewValue); }
736 
743  function Value($FieldName, $NewValue = DB_NOVALUE)
744  { return $this->UpdateValue($FieldName, $NewValue); }
745 
746  # ---- PRIVATE INTERFACE -------------------------------------------------
747 
748  private $DB;
749  private $DBFields;
750 
759  private function UpdateValue($FieldName, $NewValue, $Table="SystemConfiguration")
760  {
761  if ($NewValue != DB_NOVALUE)
762  {
763  $SignalResult = $GLOBALS["AF"]->SignalEvent(
764  "EVENT_SET_SYSCONFIG_VALUE", array(
765  "FieldName" => $FieldName,
766  "NewValue" => $NewValue));
767  $NewValue = $SignalResult["NewValue"];
768  }
769  $Value = $this->DB->UpdateValue($Table, $FieldName,
770  $NewValue, NULL, $this->DBFields);
771  $SignalResult = $GLOBALS["AF"]->SignalEvent(
772  "EVENT_GET_SYSCONFIG_VALUE", array(
773  "FieldName" => $FieldName,
774  "Value" => $Value));
775  $Value = $SignalResult["Value"];
776  return $Value;
777  }
778 }
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.
GoogleAnalyticsCode($NewValue=DB_NOVALUE)
Gets or sets the Google Analytics code system configuration setting.
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)
Gets or sets the add Google Analytics system configuration setting.
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.
UseMinimizedJavascript($NewValue=DB_NOVALUE)
Gets or sets the use mimimized javascript 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.
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.