|
3 | 3 | namespace Piwik\Plugins\DisableTracking; |
4 | 4 |
|
5 | 5 | use Exception; |
6 | | -use Piwik\Container\StaticContainer; |
7 | 6 | use Piwik\Piwik; |
8 | 7 | use Piwik\Plugin\API as BaseAPI; |
9 | 8 |
|
|
12 | 11 | */ |
13 | 12 | class API extends BaseAPI |
14 | 13 | { |
15 | | - private static $instance = null; |
16 | | - |
17 | | - /** |
18 | | - * Get Disable Tracking API instance. |
19 | | - * |
20 | | - * @throws \Exception if unable to bind to the container |
21 | | - * |
22 | | - * @return API the class instance |
23 | | - */ |
24 | | - public static function getInstance() |
25 | | - { |
26 | | - try { |
27 | | - $instance = StaticContainer::get('DisableTracking_API'); |
28 | | - if (!($instance instanceof API)) { |
29 | | - // Exception is caught below and corrected |
30 | | - throw new Exception('DisableTracking_API must inherit API'); |
31 | | - } |
32 | | - self::$instance = $instance; |
33 | | - } catch (Exception $e) { |
34 | | - self::$instance = StaticContainer::get('Piwik\Plugins\DisableTracking\API'); |
35 | | - StaticContainer::getContainer()->set('DisableTracking_API', self::$instance); |
36 | | - } |
37 | | - |
38 | | - return self::$instance; |
39 | | - } |
40 | | - |
41 | 14 | /** |
42 | | - * Change archive status for websites. |
| 15 | + * Change disabled status for websites. |
43 | 16 | * |
44 | 17 | * @param string $idSites the list of comma separated websites IDs |
45 | | - * @param $archive 'on' to archive, 'off' to re-enable |
| 18 | + * @param $disable 'on' to disable, 'off' to re-enable |
46 | 19 | * |
47 | 20 | * @throws Exception if an error occurred |
48 | 21 | */ |
49 | | - public function changeArchiveState($idSites, $archive) |
| 22 | + public function changeDisableState($idSites, $disable) |
50 | 23 | { |
51 | 24 | Piwik::checkUserHasAdminAccess($idSites); |
52 | 25 |
|
53 | | - DisableTracking::changeArchiveState(explode(',', $idSites), $archive); |
| 26 | + DisableTracking::changeDisableState(explode(',', $idSites), $disable); |
54 | 27 | } |
55 | 28 | } |
0 commit comments