public static function getLinksUrl($urlVar, $includeReset = FALSE, $includeForce = TRUE, $skipUFVar = TRUE) {
// Sort out query string to prevent messy urls
$querystring = array();
- $qs = array();
- $arrays = array();
+ $qs = array();
+ $arrays = array();
if (!empty($_SERVER['QUERY_STRING'])) {
$qs = explode('&', str_replace('&', '&', $_SERVER['QUERY_STRING']));
*
* @return string
*/
- static function theme(
+ public static function theme(
&$content,
$print = FALSE,
$maintenance = FALSE
* @return string
* An HTML string containing a link to the given path.
*/
- static function url(
+ public static function url(
$path = NULL,
$query = NULL,
$absolute = FALSE,
*
* @return string
*/
- static function href(
+ public static function href(
$text, $path = NULL, $query = NULL, $absolute = TRUE,
$fragment = NULL, $htmlize = TRUE, $frontend = FALSE, $forceBackend = FALSE
) {
return $config->userSystem->logout();
}
- // this is a very drupal specific function for now
+ /**
+ * this is a very drupal specific function for now
+ */
public static function updateCategories() {
$config = CRM_Core_Config::singleton();
if ($config->userSystem->is_drupal) {
* @param string $message
* (optional) The message to provide in the body of the redirect page.
*/
- static function jsRedirect(
+ public static function jsRedirect(
$url = NULL,
$title = NULL,
$message = NULL
$config->userFrameworkResourceURL = str_replace('http://', 'https://', $config->userFrameworkResourceURL);
$config->resourceBase = $config->userFrameworkResourceURL;
- if (! empty($config->extensionsURL)) {
+ if (!empty($config->extensionsURL)) {
$config->extensionsURL = str_replace('http://', 'https://', $config->extensionsURL);
}
$s = ob_get_contents();
ob_end_clean();
- $s = strip_tags($s, '<h2><th><td>');
- $s = preg_replace('/<th[^>]*>([^<]+)<\/th>/', "<info>\\1</info>", $s);
- $s = preg_replace('/<td[^>]*>([^<]+)<\/td>/', "<info>\\1</info>", $s);
- $vTmp = preg_split('/(<h2>[^<]+<\/h2>)/', $s, -1, PREG_SPLIT_DELIM_CAPTURE);
+ $s = strip_tags($s, '<h2><th><td>');
+ $s = preg_replace('/<th[^>]*>([^<]+)<\/th>/', "<info>\\1</info>", $s);
+ $s = preg_replace('/<td[^>]*>([^<]+)<\/td>/', "<info>\\1</info>", $s);
+ $vTmp = preg_split('/(<h2>[^<]+<\/h2>)/', $s, -1, PREG_SPLIT_DELIM_CAPTURE);
$vModules = array();
for ($i = 1; $i < count($vTmp); $i++) {
if (preg_match('/<h2>([^<]+)<\/h2>/', $vTmp[$i], $vMat)) {
$vName = trim($vMat[1]);
$vTmp2 = explode("\n", $vTmp[$i + 1]);
foreach ($vTmp2 as $vOne) {
- $vPat = '<info>([^<]+)<\/info>';
+ $vPat = '<info>([^<]+)<\/info>';
$vPat3 = "/$vPat\s*$vPat\s*$vPat/";
$vPat2 = "/$vPat\s*$vPat/";
// 3cols
* @param bool $output
* @param string $disposition
*/
- static function download(
+ public static function download(
$name, $mimeType, &$buffer,
$ext = NULL,
$output = TRUE,
if ($abort) {
CRM_Core_Error::fatal(ts('This feature requires PHP Version %1 or greater',
- array(1 => $ver)
- ));
+ array(1 => $ver)
+ ));
}
return FALSE;
}
array(dirname(__FILE__), '..', '..', 'xml', 'version.xml')
);
if (file_exists($verFile)) {
- $str = file_get_contents($verFile);
- $xmlObj = simplexml_load_string($str);
+ $str = file_get_contents($verFile);
+ $xmlObj = simplexml_load_string($str);
$version = (string) $xmlObj->version_no;
}
}
$headers[str_replace(' ',
'-',
ucwords(strtolower(str_replace('_',
- ' ',
- substr($name, 5)
- )
- ))
+ ' ',
+ substr($name, 5)
+ )
+ ))
)] = $value;
}
}
}
}
- /*
+ /**
* Get logged in user's IP address.
*
* Get IP address from HTTP REMOTE_ADDR header. If the CMS is Drupal then use
* @return string
* IP address of logged in user.
*/
- /**
- * @param bool $strictIPV4
- *
- * @return mixed|string
- */
public static function ipAddress($strictIPV4 = TRUE) {
$address = CRM_Utils_Array::value('REMOTE_ADDR', $_SERVER);
* @param array $params
* An array of parameters (see CRM_Utils_System::docURL2 method for names)
*
- * @return string
+ * @return string|void
* URL or link to documentation page, based on provided parameters.
*/
public static function docURL($params) {
// if db.ver > code.ver, sth really wrong
if (version_compare($dbVersion, $codeVersion) > 0) {
$errorMessage = '<p>' . ts('Your database is marked with an unexpected version number: %1. The v%2 codebase may not be compatible with your database state. You will need to determine the correct version corresponding to your current database state. You may want to revert to the codebase you were using until you resolve this problem.',
- array(1 => $dbVersion, 2 => $codeVersion)
- ) . '</p>';
+ array(1 => $dbVersion, 2 => $codeVersion)
+ ) . '</p>';
$errorMessage .= "<p>" . ts('OR if this is a manual install from git, you might want to fix civicrm-version.php file.') . "</p>";
return FALSE;
}
CRM_ACL_BAO_Cache::resetCache();
// reset various static arrays used here
- CRM_Contact_BAO_Contact::$_importableFields =
- CRM_Contact_BAO_Contact::$_exportableFields =
- CRM_Contribute_BAO_Contribution::$_importableFields =
- CRM_Contribute_BAO_Contribution::$_exportableFields =
- CRM_Pledge_BAO_Pledge::$_exportableFields =
- CRM_Contribute_BAO_Query::$_contributionFields =
- CRM_Core_BAO_CustomField::$_importFields =
- CRM_Core_BAO_Cache::$_cache =
- CRM_Core_DAO::$_dbColumnValueCache = NULL;
+ CRM_Contact_BAO_Contact::$_importableFields
+ = CRM_Contact_BAO_Contact::$_exportableFields
+ = CRM_Contribute_BAO_Contribution::$_importableFields
+ = CRM_Contribute_BAO_Contribution::$_exportableFields
+ = CRM_Pledge_BAO_Pledge::$_exportableFields
+ = CRM_Contribute_BAO_Query::$_contributionFields
+ = CRM_Core_BAO_CustomField::$_importFields
+ = CRM_Core_BAO_Cache::$_cache
+ = CRM_Core_DAO::$_dbColumnValueCache
+ = NULL;
CRM_Core_OptionGroup::flushAll();
CRM_Utils_PseudoConstant::flushAll();
DIRECTORY_SEPARATOR . 'sites' .
DIRECTORY_SEPARATOR . 'all' .
DIRECTORY_SEPARATOR . 'modules'
- ) === FALSE) {
+ ) === FALSE
+ ) {
$startPos = strpos($civicrm_root,
DIRECTORY_SEPARATOR . 'sites' . DIRECTORY_SEPARATOR
);
* @return string
* , formatted url.
*/
- static function languageNegotiationURL(
+ public static function languageNegotiationURL(
$url,
$addLanguagePart = TRUE,
$removeLanguagePart = FALSE
* (optional) Sent by contribution/event reg/profile pages which uses a id
* specific extra file name if present.
*/
- static function appendTPLFile(
+ public static function appendTPLFile(
$fileName,
&$content,
$overideFileName = NULL
*
* @param array $crudLinkSpec
* With keys:.
- * - action: int, CRM_Core_Action::UPDATE or CRM_Core_Action::VIEW [default: VIEW]
- * - entity_table: string, eg "civicrm_contact"
- * - entity_id: int
- * @return array|NULL NULL if unavailable, or an array. array has keys:
- * - path: string
- * - query: array
- * - title: string
- * - url: string
+ * - action: int, CRM_Core_Action::UPDATE or CRM_Core_Action::VIEW [default: VIEW]
+ * - entity_table: string, eg "civicrm_contact"
+ * - entity_id: int
+ * @return array|NULL
+ * NULL if unavailable, or an array. array has keys:
+ * - path: string
+ * - query: array
+ * - title: string
+ * - url: string
*/
public static function createDefaultCrudLink($crudLinkSpec) {
$crudLinkSpec['action'] = CRM_Utils_Array::value('action', $crudLinkSpec, CRM_Core_Action::VIEW);