SystemConfiguration.php
Go to the documentation of this file.
00001 <?php 00002 00003 class SystemConfiguration { 00004 00005 # ---- PUBLIC INTERFACE -------------------------------------------------- 00006 00007 # object constructor 00008 function SystemConfiguration($DB = NULL) 00009 { 00010 $this->DB = new Database(); 00011 } 00012 00013 # data access methods 00014 function TopLinkString($NewValue = DB_NOVALUE){ return $this->UpdateValue("TopLinkString", $NewValue); } 00015 function TopLinkBeginLetter($NewValue = DB_NOVALUE) { return $this->UpdateValue("TopLinkBeginLetter", $NewValue); } 00016 function TopLinkEndLetter($NewValue = DB_NOVALUE) { return $this->UpdateValue("TopLinkEndLetter", $NewValue); } 00017 function AdminEmail($NewValue = DB_NOVALUE) { return $this->UpdateValue("AdminEmail", $NewValue); } 00018 function PasswordMailSubject($NewValue = DB_NOVALUE) { return $this->UpdateValue("PasswordMailSubject", $NewValue); } 00019 function PasswordMailBody($NewValue = DB_NOVALUE) { return $this->UpdateValue("PasswordMailBody", $NewValue); } 00020 function PasswordResetMailSubject($NewValue = DB_NOVALUE) { return $this->UpdateValue("PasswordResetMailSubject", $NewValue); } 00021 function PasswordResetMailBody($NewValue = DB_NOVALUE) { return $this->UpdateValue("PasswordResetMailBody", $NewValue); } 00022 function MailChangeMailSubject($NewValue = DB_NOVALUE) { return $this->UpdateValue("MailChangeMailSubject", $NewValue); } 00023 function MailChangeMailBody($NewValue = DB_NOVALUE) { return $this->UpdateValue("MailChangeMailBody", $NewValue); } 00024 function PortalName($NewValue = DB_NOVALUE) { return $this->UpdateValue("PortalName", $NewValue); } 00025 function DefaultActiveUI($NewValue = DB_NOVALUE) { return $this->UpdateValue("DefaultActiveUI", $NewValue); } 00026 function CurrentTheme($NewValue = DB_NOVALUE) { return $this->UpdateValue("CurrentTheme", $NewValue); } 00027 function DefaultCharacterSet($NewValue = DB_NOVALUE) { return $this->UpdateValue("DefaultCharacterSet", $NewValue); } 00028 function SearchTermsRequired($NewValue = DB_NOVALUE) { return $this->UpdateValue("SearchTermsRequired", $NewValue); } 00029 function AnnouncementsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("AnnouncementsEnabled", $NewValue); } 00030 function ForumsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("ForumsEnabled", $NewValue); } 00031 function AllowMultipleUIsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("AllowMultipleUIsEnabled", $NewValue); } 00032 function ResourceLaunchesNewWindowEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("ResourceLaunchesNewWindowEnabled", $NewValue); } 00033 function UserAgentsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("UserAgentsEnabled", $NewValue); } 00034 function ResourceRatingsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("ResourceRatingsEnabled", $NewValue); } 00035 function ResourceCommentsEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("ResourceCommentsEnabled", $NewValue); } 00036 function AccessibilityWizardEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("AccessibilityWizardEnabled", $NewValue); } 00037 function ReleaseFlagApproved($NewValue = DB_NOVALUE) { return $this->UpdateValue("ReleaseFlagApproved", $NewValue); } 00038 function SearchDBEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("SearchDBEnabled", $NewValue); } 00039 function RecommenderDBEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("RecommenderDBEnabled", $NewValue); } 00040 function OAISQEnabled($NewValue = DB_NOVALUE) { return $this->UpdateValue("OAISQEnabled", $NewValue); } 00041 function NumAnnounceOnHomePage($NewValue = DB_NOVALUE) { return $this->UpdateValue("NumAnnounceOnHomePage", $NewValue); } 00042 function NumResourcesOnHomePage($NewValue = DB_NOVALUE) { return $this->UpdateValue("NumResourcesOnHomePage", $NewValue); } 00043 function LegalNotice($NewValue = DB_NOVALUE) { return $this->UpdateValue("LegalNotice", $NewValue); } 00044 function DefaultRecordsPerPage($NewValue = DB_NOVALUE) { return $this->UpdateValue("DefaultRecordsPerPage", $NewValue); } 00045 function NumClassesPerBrowsePage($NewValue = DB_NOVALUE) 00046 { 00047 # if new classes per browse page has been specified 00048 if ($NewValue !== DB_NOVALUE && 00049 $NewValue != $this->UpdateValue("NumClassesPerBrowsePage",DB_NOVALUE)) 00050 { 00051 # clear all classification links 00052 $this->TopLinkString(""); 00053 $this->DB->Query("UPDATE Classifications SET LinkString=''"); 00054 } 00055 return $this->UpdateValue("NumClassesPerBrowsePage", $NewValue); 00056 } 00057 function NumColumnsPerBrowsePage($NewValue = DB_NOVALUE) { return $this->UpdateValue("NumColumnsPerBrowsePage", $NewValue); } 00058 function BrowsingFieldId($NewValue = DB_NOVALUE) { return $this->UpdateValue("BrowsingFieldId", $NewValue); } 00059 function OaiIdDomain($NewValue = DB_NOVALUE) { return $this->UpdateValue("OaiIdDomain", $NewValue); } 00060 function OaiIdPrefix($NewValue = DB_NOVALUE) { return $this->UpdateValue("OaiIdPrefix", $NewValue); } 00061 function OaiEarliestDate($NewValue = DB_NOVALUE) { return $this->UpdateValue("OaiEarliestDate", $NewValue); } 00062 function OaiDateGranularity($NewValue = DB_NOVALUE) { return $this->UpdateValue("OaiDateGranularity", $NewValue); } 00063 function SiteKeywords($NewValue = DB_NOVALUE) { return $this->UpdateValue("SiteKeywords", $NewValue); } 00064 function AboutText($NewValue = DB_NOVALUE) { return $this->UpdateValue("AboutText", $NewValue); } 00065 00066 function ContactName($NewValue = DB_NOVALUE) { return $this->UpdateValue("ContactName", $NewValue); } 00067 function ContactEmail($NewValue = DB_NOVALUE) { return $this->UpdateValue("ContactEmail", $NewValue); } 00068 function Organization($NewValue = DB_NOVALUE) { return $this->UpdateValue("Organization", $NewValue); } 00069 function OrganizationType($NewValue = DB_NOVALUE) { return $this->UpdateValue("OrganizationType", $NewValue); } 00070 function SiteType($NewValue = DB_NOVALUE) { return $this->UpdateValue("SiteType", $NewValue); } 00071 function OkayToListSite($NewValue = DB_NOVALUE) { return $this->UpdateValue("OkayToListSite", $NewValue); } 00072 function LastRegisteredOn($NewValue = DB_NOVALUE) { return $this->UpdateValue("LastRegisteredOn", $NewValue); } 00073 function AddAWStatsScript($NewValue = DB_NOVALUE) { return $this->UpdateValue("AddAWStatsScript", $NewValue); } 00074 function AddGoogleAnalytics($NewValue = DB_NOVALUE) { return $this->UpdateValue("AddGoogleAnalytics", $NewValue); } 00075 function GoogleAnalyticsCode($NewValue = DB_NOVALUE) { return $this->UpdateValue("GoogleAnalyticsCode", $NewValue); } 00076 function DisplayLimitsByDefault($NewValue = DB_NOVALUE) { return $this->UpdateValue("DisplayLimitsByDefault", $NewValue); } 00077 function DefaultSortField($NewValue = DB_NOVALUE) { return $this->UpdateValue("DefaultSortField", $NewValue); } 00078 00079 function LogoFileName() { return $this->UpdateValue("LogoFileName",DB_NOVALUE, "UIStyleConfiguration"); } 00080 function LogoAltText() { return $this->UpdateValue("LogoAltText",DB_NOVALUE, "UIStyleConfiguration"); } 00081 function LogoWidth() { return $this->UpdateValue("LogoWidth",DB_NOVALUE,"UIStyleConfiguration"); } 00082 function LogoHeight() { return $this->UpdateValue("LogoHeight",DB_NOVALUE,"UIStyleCOnfiguration"); } 00083 00084 function HasRegistered() { return strlen($this->UpdateValue("LastRegisteredOn",DB_NOVALUE)) ? TRUE : FALSE; } 00085 00086 function TitleField($NewValue = DB_NOVALUE) { return $this->UpdateValue("TitleField", $NewValue); } 00087 function DescriptionField($NewValue = DB_NOVALUE) { return $this->UpdateValue("DescriptionField", $NewValue); } 00088 function UrlField($NewValue = DB_NOVALUE) { return $this->UpdateValue("UrlField", $NewValue); } 00089 function ScreenshotField($NewValue = DB_NOVALUE) { return $this->UpdateValue("ScreenshotField", $NewValue); } 00090 00091 function SecureLogin($NewValue = DB_NOVALUE) { return $this->UpdateValue("SecureLogin", $NewValue); } 00092 00093 function DefaultUserPrivs($NewValue = DB_NOVALUE) 00094 { 00095 if ($NewValue !== DB_NOVALUE) 00096 { 00097 $NewValue = serialize($NewValue); 00098 } 00099 00100 $Result = unserialize($this->UpdateValue("DefaultUserPrivs", $NewValue)); 00101 00102 if (!is_array($Result)) 00103 { 00104 $Result = $this->DefaultUserPrivs(array()); 00105 } 00106 00107 return $Result; 00108 } 00109 00110 function Value($FieldName, $NewValue = DB_NOVALUE) 00111 { return $this->UpdateValue($FieldName, $NewValue); } 00112 00113 # ---- PRIVATE INTERFACE ------------------------------------------------- 00114 00115 private $DB; 00116 private $DBFields; 00117 private function UpdateValue($FieldName, $NewValue, $Table="SystemConfiguration") 00118 { 00119 return $this->DB->UpdateValue($Table, $FieldName, 00120 $NewValue, NULL, $this->DBFields); 00121 } 00122 }