projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CRM-15678 hookable invalid page handling
[civicrm-core.git]
/
CRM
/
Utils
/
System
/
Base.php
diff --git
a/CRM/Utils/System/Base.php
b/CRM/Utils/System/Base.php
index e52558d3b7432ad74d10d5a444da6b6207f200be..4ed43e16b9340a1545a21880414d61424ee574b4 100644
(file)
--- a/
CRM/Utils/System/Base.php
+++ b/
CRM/Utils/System/Base.php
@@
-5,7
+5,7
@@
*/
abstract class CRM_Utils_System_Base {
/**
*/
abstract class CRM_Utils_System_Base {
/**
- *
d
eprecated property to check if this is a drupal install. The correct method is to have functions on the UF classes for all UF specific
+ *
D
eprecated 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
* functions and leave the codebase oblivious to the type of CMS
* @deprecated
* @var bool
@@
-13,7
+13,7
@@
abstract class CRM_Utils_System_Base {
var $is_drupal = FALSE;
/**
var $is_drupal = FALSE;
/**
- *
d
eprecated property to check if this is a joomla install. The correct method is to have functions on the UF classes for all UF specific
+ *
D
eprecated 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
* functions and leave the codebase oblivious to the type of CMS
* @deprecated
* @var bool
@@
-41,7
+41,7
@@
abstract class CRM_Utils_System_Base {
var $supports_form_extensions = FALSE;
/**
var $supports_form_extensions = FALSE;
/**
- *
i
f we are using a theming system, invoke theme, else just print the
+ *
I
f we are using a theming system, invoke theme, else just print the
* content
*
* @param string $content the content that will be themed
* content
*
* @param string $content the content that will be themed
@@
-49,9
+49,8
@@
abstract class CRM_Utils_System_Base {
* @param boolean $maintenance for maintenance mode
*
* @return void prints content on stdout
* @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
$ret = FALSE;
// TODO: Split up; this was copied verbatim from CiviCRM 4.0's multi-UF theming function
@@
-99,14
+98,14
@@
abstract class CRM_Utils_System_Base {
/**
* @return string
*/
/**
* @return string
*/
- function getDefaultBlockLocation() {
+
public
function getDefaultBlockLocation() {
return 'left';
}
/**
* @return string
*/
return 'left';
}
/**
* @return string
*/
- function getVersion() {
+
public
function getVersion() {
return 'Unknown';
}
return 'Unknown';
}
@@
-134,7
+133,7
@@
abstract class CRM_Utils_System_Base {
*
* @return string|NULL local file system path to CMS root, or NULL if it cannot be determined
*/
*
* @return string|NULL local file system path to CMS root, or NULL if it cannot be determined
*/
- function cmsRootPath() {
+
public
function cmsRootPath() {
return NULL;
}
return NULL;
}
@@
-151,12
+150,12
@@
abstract class CRM_Utils_System_Base {
/**
* Determine the native ID of the CMS user
*
/**
* Determine the native ID of the CMS user
*
- * @param $username
+ * @param
string
$username
*
* @throws CRM_Core_Exception
* @return int|NULL
*/
*
* @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");
}
$className = get_class($this);
throw new CRM_Core_Exception("Not implemented: {$className}->getUfId");
}
@@
-166,9
+165,8
@@
abstract class CRM_Utils_System_Base {
*
* @param array $data array with user specific data
*
*
* @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);
list($userID, $ufID) = $data;
$session = CRM_Core_Session::singleton();
$session->set('ufID', $ufID);
@@
-179,14
+177,14
@@
abstract class CRM_Utils_System_Base {
* Reset any system caches that may be required for proper CiviCRM
* integration.
*/
* Reset any system caches that may be required for proper CiviCRM
* integration.
*/
- function flush() {
+
public
function flush() {
// nullop by default
}
/**
* Flush css/js caches
*/
// nullop by default
}
/**
* Flush css/js caches
*/
- function clearResourceCache() {
+
public
function clearResourceCache() {
// nullop by default
}
// nullop by default
}
@@
-200,7
+198,7
@@
abstract class CRM_Utils_System_Base {
* - $siteName,
* - $siteRoot
*/
* - $siteName,
* - $siteRoot
*/
- function getDefaultSiteSettings($dir) {
+
public
function getDefaultSiteSettings($dir) {
$config = CRM_Core_Config::singleton();
$url = $config->userFrameworkBaseURL;
return array($url, NULL, NULL);
$config = CRM_Core_Config::singleton();
$url = $config->userFrameworkBaseURL;
return array($url, NULL, NULL);
@@
-215,13
+213,13
@@
abstract class CRM_Utils_System_Base {
*
* FIXME: Document values accepted/required by $params
*/
*
* 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
*/
}
/**
* 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'";
$timeZoneOffset = $this->getTimeZoneOffset();
if($timeZoneOffset){
$sql = "SET time_zone = '$timeZoneOffset'";
@@
-238,7
+236,7
@@
abstract class CRM_Utils_System_Base {
* Get timezone from Drupal
* @return boolean|string
*/
* Get timezone from Drupal
* @return boolean|string
*/
- function getTimeZoneOffset(){
+
public
function getTimeZoneOffset(){
$timezone = $this->getTimeZoneString();
if($timezone){
$tzObj = new DateTimeZone($timezone);
$timezone = $this->getTimeZoneString();
if($timezone){
$tzObj = new DateTimeZone($timezone);
@@
-262,7
+260,7
@@
abstract class CRM_Utils_System_Base {
* Over-ridable function to get timezone as a string eg.
* @return string Timezone e.g. 'America/Los_Angeles'
*/
* 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 date_default_timezone_get();
}
@@
-272,7
+270,7
@@
abstract class CRM_Utils_System_Base {
* @return mixed $uniqueIdentifer Unique identifier from the user Framework system
*
*/
* @return mixed $uniqueIdentifer Unique identifier from the user Framework system
*
*/
- function getUniqueIdentifierFromUserObject($user) {}
+
public
function getUniqueIdentifierFromUserObject($user) {}
/**
* Get User ID from UserFramework system (CMS)
/**
* Get User ID from UserFramework system (CMS)
@@
-280,24
+278,24
@@
abstract class CRM_Utils_System_Base {
* @return mixed <NULL, number>
*
*/
* @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.
*/
/**
* 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
*/
/**
* 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() {}
/**
/**
- *
r
eturn a UFID (user account ID from the UserFramework / CMS system being based on the user object
+ *
R
eturn 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
* 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
@@
-307,7
+305,7
@@
abstract class CRM_Utils_System_Base {
* @param object $user
* @return int $ufid - user ID of UF System
*/
* @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);
}
if($user) {
return $this->getUserIDFromUserObject($user);
}
@@
-315,7
+313,7
@@
abstract class CRM_Utils_System_Base {
}
/**
}
/**
- *
r
eturn a unique identifier (usually an email address or username) from the UserFramework / CMS system being based on the user object
+ *
R
eturn 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
* 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
@@
-323,7
+321,7
@@
abstract class CRM_Utils_System_Base {
* @param object $user
* @return string $uniqueIdentifier - unique identifier from the UF System
*/
* @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);
}
if($user) {
return $this->getUniqueIdentifierFromUserObject($user);
}
@@
-336,30
+334,34
@@
abstract class CRM_Utils_System_Base {
*
* @return string
*/
*
* @return string
*/
- function getUserRecordUrl($contactID) {
+
public
function getUserRecordUrl($contactID) {
return NULL;
}
/**
* Is the current user permitted to add a user
* @return bool
*/
return NULL;
}
/**
* Is the current user permitted to add a user
* @return bool
*/
- function checkPermissionAddUser() {
+
public
function checkPermissionAddUser() {
return FALSE;
}
/**
return FALSE;
}
/**
- *
o
utput code from error function
+ *
O
utput code from error function
* @param string $content
*/
* @param string $content
*/
- function outputError($content) {
+
public
function outputError($content) {
echo CRM_Utils_System::theme($content);
}
/**
* Log error to CMS
*/
echo CRM_Utils_System::theme($content);
}
/**
* Log error to CMS
*/
- function logger($message) {
+
public
function logger($message) {
}
}
-}
+ /**
+ * Append to coreResourcesList
+ */
+ public function appendCoreResources(&$list) {}
+}