/
form.php
100 lines (87 loc) · 2.23 KB
/
form.php
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
namespace Concrete\Controller\Element\Attribute;
use Concrete\Core\Entity\Attribute\Type;
use Concrete\Core\Controller\ElementController;
class Form extends ElementController
{
protected $back_button_url;
protected $type;
protected $dashboard_page_submit_action = 'add';
protected $dashboard_page_parameters = array();
protected $category;
public function __construct(Type $type)
{
$this->type = $type;
parent::__construct();
}
/**
* @return mixed
*/
public function getBackButtonUrl()
{
return $this->back_button_url;
}
/**
* @param mixed $back_button_url
*/
public function setBackButtonUrl($back_button_url)
{
$this->back_button_url = $back_button_url;
}
public function getElement()
{
return 'attribute/key/form';
}
/**
* @return mixed
*/
public function getCategory()
{
return $this->category;
}
/**
* @param mixed $category
*/
public function setCategory($category)
{
$this->category = $category;
}
/**
* @return array
*/
public function getDashboardPageParameters()
{
return $this->dashboard_page_parameters;
}
/**
* @param array $dashboard_page_parameters
*/
public function setDashboardPageParameters($dashboard_page_parameters)
{
$this->dashboard_page_parameters = $dashboard_page_parameters;
}
/**
* @return string
*/
public function getDashboardPageSubmitAction()
{
return $this->dashboard_page_submit_action;
}
/**
* @param string $dashboard_page_submit_action
*/
public function setDashboardPageSubmitAction($dashboard_page_submit_action)
{
$this->dashboard_page_submit_action = $dashboard_page_submit_action;
}
public function view()
{
$category = $this->category->getAttributeKeyCategory();
$this->set('category', $category);
$this->set('type', $this->type);
$this->set('back', $this->getBackButtonUrl());
$this->set('action', $this->getViewObject()->action($this->getDashboardPageSubmitAction(),
$this->getDashboardPageParameters()
));
}
}