|
1
|
|
|
<?php |
|
2
|
|
|
/* For licensing terms, see /license.txt */ |
|
3
|
|
|
|
|
4
|
|
|
namespace Chamilo\CoreBundle\Component\Utils; |
|
5
|
|
|
|
|
6
|
|
|
/** |
|
7
|
|
|
* Class ChamiloApi |
|
8
|
|
|
* @package Chamilo\CoreBundle\Component |
|
9
|
|
|
*/ |
|
10
|
|
|
class ChamiloApi |
|
11
|
|
|
{ |
|
12
|
|
|
private static $configuration; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* ChamiloApi constructor. |
|
16
|
|
|
* @param $configuration |
|
17
|
|
|
*/ |
|
18
|
|
|
public function __construct(array $configuration) |
|
19
|
|
|
{ |
|
20
|
|
|
self::$configuration = $configuration; |
|
21
|
|
|
} |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* @return array |
|
25
|
|
|
*/ |
|
26
|
|
|
public static function getConfigurationArray() |
|
27
|
|
|
{ |
|
28
|
|
|
return self::$configuration; |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @param string $variable |
|
33
|
|
|
* @return bool|string |
|
34
|
|
|
*/ |
|
35
|
|
|
public static function getConfigurationValue($variable) |
|
36
|
|
|
{ |
|
37
|
|
|
$configuration = self::getConfigurationArray(); |
|
38
|
|
|
if (array_key_exists($variable, $configuration)) { |
|
39
|
|
|
return $configuration[$variable]; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
return false; |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* Returns an array of resolutions that can be used for the conversion of documents to images |
|
48
|
|
|
* @return array |
|
49
|
|
|
*/ |
|
50
|
|
|
public static function getDocumentConversionSizes() |
|
51
|
|
|
{ |
|
52
|
|
|
return array( |
|
53
|
|
|
'540x405' => '540x405 (3/4)', |
|
54
|
|
|
'640x480' => '640x480 (3/4)', |
|
55
|
|
|
'720x540' => '720x540 (3/4)', |
|
56
|
|
|
'800x600' => '800x600 (3/4)', |
|
57
|
|
|
'1024x576' => '1024x576 (16/9)', |
|
58
|
|
|
'1024x768' => '1000x750 (3/4)', |
|
59
|
|
|
'1280x720' => '1280x720 (16/9)', |
|
60
|
|
|
'1280x860' => '1280x960 (3/4)', |
|
61
|
|
|
'1400x1050' => '1400x1050 (3/4)', |
|
62
|
|
|
'1600x900' => '1600x900 (16/9)', |
|
63
|
|
|
); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
} |
|
67
|
|
|
|