ICLStatus.php
871 Bytes
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
<?php
namespace WPML\ICLToATEMigration;
use WPML\FP\Relation;
use WPML\TM\API\TranslationServices;
class ICLStatus {
const ICL_NAME = 'ICanLocalize';
const ICL_ID = 67;
const SUID = 'dd17d48516ca4bce0b83043583fabd2e';
/** @var TranslationServices */
private $translationServices;
/**
* @param TranslationServices $translationServices
*/
public function __construct( TranslationServices $translationServices ) {
$this->translationServices = $translationServices;
}
/**
* @return bool
*/
public function isActivated() {
return $this->translationServices->getCurrentService() &&
Relation::propEq( 'name', self::ICL_NAME, $this->translationServices->getCurrentService() );
}
/**
* @return bool
*/
public function isActivatedAndAuthorized() {
return self::isActivated() && $this->translationServices->isAuthorized();
}
}