*/
abstract class CRM_Utils_System_Base {
/**
- * deprecated property to check if this is a drupal install. The correct method is to have functions on the UF classes for all UF specific
+ * Deprecated property to check if this is a drupal install. The correct method is to have functions on the UF classes for all UF specific
* functions and leave the codebase oblivious to the type of CMS
* @deprecated
* @var bool
var $is_drupal = FALSE;
/**
- * deprecated property to check if this is a joomla install. The correct method is to have functions on the UF classes for all UF specific
+ * Deprecated property to check if this is a joomla install. The correct method is to have functions on the UF classes for all UF specific
* functions and leave the codebase oblivious to the type of CMS
* @deprecated
* @var bool
var $supports_form_extensions = FALSE;
/**
- * if we are using a theming system, invoke theme, else just print the
+ * If we are using a theming system, invoke theme, else just print the
* content
*
* @param string $content the content that will be themed
* @param boolean $maintenance for maintenance mode
*
* @return void prints content on stdout
- * @access public
*/
- function theme(&$content, $print = FALSE, $maintenance = FALSE) {
+ public function theme(&$content, $print = FALSE, $maintenance = FALSE) {
$ret = FALSE;
// TODO: Split up; this was copied verbatim from CiviCRM 4.0's multi-UF theming function
/**
* @return string
*/
- function getDefaultBlockLocation() {
+ public function getDefaultBlockLocation() {
return 'left';
}
/**
* @return string
*/
- function getVersion() {
+ public function getVersion() {
return 'Unknown';
}
*
* @return string|NULL local file system path to CMS root, or NULL if it cannot be determined
*/
- function cmsRootPath() {
+ public function cmsRootPath() {
return NULL;
}
/**
* Determine the native ID of the CMS user
*
- * @param $username
+ * @param string $username
*
* @throws CRM_Core_Exception
* @return int|NULL
*/
- function getUfId($username) {
+ public function getUfId($username) {
$className = get_class($this);
throw new CRM_Core_Exception("Not implemented: {$className}->getUfId");
}
*
* @param array $data array with user specific data
*
- * @access public
*/
- function setUserSession($data) {
+ public function setUserSession($data) {
list($userID, $ufID) = $data;
$session = CRM_Core_Session::singleton();
$session->set('ufID', $ufID);
* Reset any system caches that may be required for proper CiviCRM
* integration.
*/
- function flush() {
+ public function flush() {
+ // nullop by default
+ }
+
+ /**
+ * Flush css/js caches
+ */
+ public function clearResourceCache() {
// nullop by default
}
* - $siteName,
* - $siteRoot
*/
- function getDefaultSiteSettings($dir) {
+ public function getDefaultSiteSettings($dir) {
$config = CRM_Core_Config::singleton();
$url = $config->userFrameworkBaseURL;
return array($url, NULL, NULL);
*
* FIXME: Document values accepted/required by $params
*/
- function userLoginFinalize($params = array()){
+ public function userLoginFinalize($params = array()){
}
/**
* Set timezone in mysql so that timestamp fields show the correct time
*/
- function setMySQLTimeZone(){
+ public function setMySQLTimeZone(){
$timeZoneOffset = $this->getTimeZoneOffset();
if($timeZoneOffset){
$sql = "SET time_zone = '$timeZoneOffset'";
* Get timezone from Drupal
* @return boolean|string
*/
- function getTimeZoneOffset(){
+ public function getTimeZoneOffset(){
$timezone = $this->getTimeZoneString();
if($timezone){
$tzObj = new DateTimeZone($timezone);
* Over-ridable function to get timezone as a string eg.
* @return string Timezone e.g. 'America/Los_Angeles'
*/
- function getTimeZoneString() {
+ public function getTimeZoneString() {
return date_default_timezone_get();
}
* @return mixed $uniqueIdentifer Unique identifier from the user Framework system
*
*/
- function getUniqueIdentifierFromUserObject($user) {}
+ public function getUniqueIdentifierFromUserObject($user) {}
/**
* Get User ID from UserFramework system (CMS)
* @return mixed <NULL, number>
*
*/
- function getUserIDFromUserObject($user) {}
+ public function getUserIDFromUserObject($user) {}
/**
* Get currently logged in user uf id.
*
* @return int $userID logged in user uf id.
*/
- function getLoggedInUfID() {}
+ public function getLoggedInUfID() {}
/**
* Get currently logged in user unique identifier - this tends to be the email address or user name.
*
* @return string $userID logged in user unique identifier
*/
- function getLoggedInUniqueIdentifier() {}
+ public function getLoggedInUniqueIdentifier() {}
/**
- * return a UFID (user account ID from the UserFramework / CMS system being based on the user object
+ * Return a UFID (user account ID from the UserFramework / CMS system being based on the user object
* passed, defaulting to the logged in user if not passed. Note that ambiguous situation occurs
* in CRM_Core_BAO_UFMatch::synchronize - a cleaner approach would seem to be resolving the user id before calling
* the function
* @param object $user
* @return int $ufid - user ID of UF System
*/
- function getBestUFID($user = NULL) {
+ public function getBestUFID($user = NULL) {
if($user) {
return $this->getUserIDFromUserObject($user);
}
}
/**
- * return a unique identifier (usually an email address or username) from the UserFramework / CMS system being based on the user object
+ * Return a unique identifier (usually an email address or username) from the UserFramework / CMS system being based on the user object
* passed, defaulting to the logged in user if not passed. Note that ambiguous situation occurs
* in CRM_Core_BAO_UFMatch::synchronize - a cleaner approach would seem to be resolving the unique identifier before calling
* the function
* @param object $user
* @return string $uniqueIdentifier - unique identifier from the UF System
*/
- function getBestUFUniqueIdentifier($user = NULL) {
+ public function getBestUFUniqueIdentifier($user = NULL) {
if($user) {
return $this->getUniqueIdentifierFromUserObject($user);
}
*
* @return string
*/
- function getUserRecordUrl($contactID) {
+ public function getUserRecordUrl($contactID) {
return NULL;
}
/**
* Is the current user permitted to add a user
* @return bool
*/
- function checkPermissionAddUser() {
+ public function checkPermissionAddUser() {
return FALSE;
}
/**
- * output code from error function
+ * Output code from error function
* @param string $content
*/
- function outputError($content) {
+ public function outputError($content) {
echo CRM_Utils_System::theme($content);
}
/**
* Log error to CMS
*/
- function logger($message) {
+ public function logger($message) {
}
-}
+ /**
+ * Append to coreResourcesList
+ */
+ public function appendCoreResources(&$list) {}
+}