Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
display.php
1<?php
2
8
10
11class Display implements IDisplay
12{
13 const MODE_EDIT = BaseType::MODE_EDIT;
14 const MODE_VIEW = BaseType::MODE_VIEW;
15
16 protected $userField;
17 protected $additionalParameters = array();
19 "bVarsFromForm" => false,
20 );
22 protected $tpl = '';
23
24 public function __construct($mode = self::MODE_VIEW, string $tpl = '')
25 {
26 $this->mode = $mode;
27 $this->tpl = $tpl;
28 $this->additionalParameters = $this->defaultAdditionalParameters;
29 }
30
34 public function getField()
35 {
36 return $this->userField;
37 }
38
42 public function setField(array $userField)
43 {
44 $this->userField = $userField;
45 }
46
47 public function setAdditionalParameter($param, $value, $storeAsDefault = false)
48 {
49 $this->additionalParameters[$param] = $value;
50 if($storeAsDefault)
51 {
52 $this->defaultAdditionalParameters[$param] = $value;
53 }
54 }
55
56 public function clear()
57 {
58 $this->userField = null;
59 $this->additionalParameters = $this->defaultAdditionalParameters;
60 }
61
62 protected function getAdditionalParameters()
63 {
65 }
66
67 public function display()
68 {
69 global $USER_FIELD_MANAGER;
70
71 $this->setAdditionalParameter('mode', $this->mode);
72 //$this->setAdditionalParameter('tpl', $this->tpl);
73
74 if($this->mode === self::MODE_EDIT)
75 {
76 return $USER_FIELD_MANAGER->GetPublicEdit(
77 $this->getField(),
79 );
80 }
81 else
82 {
83 return $USER_FIELD_MANAGER->GetPublicView(
84 $this->getField(),
86 );
87 }
88 }
89}
__construct($mode=self::MODE_VIEW, string $tpl='')
Definition display.php:24
setField(array $userField)
Definition display.php:42
setAdditionalParameter($param, $value, $storeAsDefault=false)
Definition display.php:47