/
attributes.php
73 lines (64 loc) · 1.86 KB
/
attributes.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
<?php
namespace Concrete\Controller\SinglePage\Dashboard\Users;
use Concrete\Core\Attribute\Key\Category;
use Concrete\Core\Attribute\Key\UserKey;
use Concrete\Core\Attribute\TypeFactory;
use Concrete\Core\Page\Controller\DashboardAttributesPageController;
class Attributes extends DashboardAttributesPageController
{
public function view()
{
$this->renderList();
}
public function edit($akID = null)
{
$key = UserKey::getByID($akID);
$this->renderEdit($key,
\URL::to('/dashboard/users/attributes', 'view')
);
}
public function update($akID = null)
{
$this->edit($akID);
$key = UserKey::getByID($akID);
$this->executeUpdate($key,
\URL::to('/dashboard/users/attributes', 'view')
);
}
public function select_type($type = null)
{
$typeFactory = $this->app->make(TypeFactory::class);
$type = $typeFactory->getByID($type);
$this->renderAdd($type,
\URL::to('/dashboard/users/attributes', 'view')
);
}
public function add($type = null)
{
$this->select_type($type);
$typeFactory = $this->app->make(TypeFactory::class);
$type = $typeFactory->getByID($type);
$this->executeAdd($type, \URL::to('/dashboard/users/attributes', 'view'));
}
/**
* @param int $akID
*/
public function delete($akID = null)
{
$key = UserKey::getByID($akID);
$this->executeDelete($key,
\URL::to('/dashboard/users/attributes', 'view')
);
}
/**
* {@inheritdoc}
*
* @see \Concrete\Core\Page\Controller\DashboardAttributesPageController::getCategoryObject()
*
* @return \Concrete\Core\Entity\Attribute\Category
*/
protected function getCategoryObject()
{
return Category::getByHandle('user');
}
}