if (!$row) {
return;
}
-
+
$user = NULL;
if (!empty($row)) {
return FALSE;
}
// If the path is within the drupal directory we can add in the normal way
- if (CRM_Utils_System_Drupal::formatResourceUrl($url)) {
+ if ($this->formatResourceUrl($url)) {
drupal_add_js($url, 'module', $scope);
return TRUE;
}
* @access public
*/
public function addStyleUrl($url, $region) {
- if ($region != 'html-header' || !CRM_Utils_System_Drupal::formatResourceUrl($url)) {
+ if ($region != 'html-header' || !$this->formatResourceUrl($url)) {
return FALSE;
}
drupal_add_css($url);
og_delete_subscription( $ogID, $drupalID );
}
+ /**
+ * Get timezone from Drupal
+ * @return boolean|string
+ */
+ function getTimeZoneOffset(){
+ global $user;
+ if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
+ $timezone = $user->timezone;
+ } else {
+ $timezone = variable_get('date_default_timezone', null);
+ }
+ if(empty($timezone)){
+ return false;
+ }
+ $hour = $user->timezone / 3600;
+ $timeZoneOffset = sprintf("%02d:%02d", $timezone / 3600, ($timezone/60)%60 );
+ if($timeZoneOffset > 0){
+ $timeZoneOffset = '+' . $timeZoneOffset;
+ }
+ return $timeZoneOffset;
+ }
+
+
/**
* Reset any system caches that may be required for proper CiviCRM
* integration.