Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
link.php
1<?php
2
3
5
6
7class Link
8{
9 private static $instance = null;
10 protected $type;
11
12 public function __construct()
13 {
14 $this->type = static::resolveModeType();
15 }
16
17 public function getType()
18 {
19 return $this->type;
20 }
21
22 protected function resolveModeType()
23 {
24 $fields = new \Bitrix\Sale\Internals\Fields(
25 \Bitrix\Main\Context::getCurrent()->getRequest()->toArray());
26
27 if($this->isRestAppLayoutMode($fields))
28 {
30 }
31 else
32 {
34 }
35
36 return $type;
37 }
38
39 protected function isRestAppLayoutMode(\Bitrix\Sale\Internals\Fields $fields)
40 {
41 return $fields->get('restAppLayoutMode') == 'Y';
42 }
43
44 public function create()
45 {
46 return Factory::create($this->getType());
47 }
48
49 public static function getInstance()
50 {
51 if(self::$instance === null)
52 {
53 self::$instance = new static();
54 }
55 return self::$instance;
56 }
57}
static getCurrent()
Definition context.php:241