-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitial.php
More file actions
40 lines (35 loc) · 1.31 KB
/
initial.php
File metadata and controls
40 lines (35 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
//////// DO NOT EDIT THIS FILE /////////////////////
//Copy this file to the root of the Drupal installation
//this function will be included in the index.php at top level or inside the vals_soc module
//it will lead to the constant of the url location of the SOC Drupal installation: /vals or ''
function getInitialPath($path1, $path2){
$pos = strpos($path1, $path2);
if (! $pos) {
$pos = strpos($path1, '/index.php');
if (!$pos){
return '';
} else {
$arr1 = str_split($path1, $pos);
return $arr1[0];
}
}
$arr1 = str_split($path1, $pos);
return $arr1[0];
}
function isAministratorType(){
global $user;
if ($user && $user->roles){
return in_array('administrator', $user->roles);
} else {
return false;
}
}
//TODO: fix this in the future
//The Timeline is working with UTC so GMT and not GMT -1 (==CET) so the change to CET should be worked through
//in both the js/timeline.melange.js and the classes/StatelessTimeline.php etc.
//all date/time functions take this timezone as the default if left empty
// TODO find out what to change to make this work: date_default_timezone_set('CET');
$vals = getInitialPath($_SERVER['PHP_SELF'], '/sites/all/modules');
define('_WEB_URL', $vals);
//////// EDIT THE FILE UNDER THE ROOT IF YOU HAVE ALREADY INSTALLED THE APPLICATION