Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 10 |
CRAP | |
0.00% |
0 / 1 |
| AdminAction | |
0.00% |
0 / 16 |
|
0.00% |
0 / 10 |
110 | |
0.00% |
0 / 1 |
| getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getUrl | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getBinding | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getContext | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getGroup | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getIcon | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| isMultiple | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getRequiredRights | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| getWeight | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2015 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | namespace oat\taoDacSimple\model\action; |
| 24 | |
| 25 | use oat\tao\model\menu\Icon; |
| 26 | use oat\taoBackOffice\model\menuStructure\Action as MenuAction; |
| 27 | use oat\oatbox\PhpSerializeStateless; |
| 28 | use oat\oatbox\PhpSerializable; |
| 29 | |
| 30 | /** |
| 31 | * Admin Action, based on xml: |
| 32 | * |
| 33 | * <action id="access-control-admin" name="Access control" url="/taoDacSimple/AdminAccessController/adminPermissions" |
| 34 | * group="tree" context="resource"> |
| 35 | * <icon id="icon-unlock" /> |
| 36 | * </action> |
| 37 | */ |
| 38 | class AdminAction implements MenuAction, PhpSerializable |
| 39 | { |
| 40 | use PhpSerializeStateless; |
| 41 | |
| 42 | /** |
| 43 | * @return string Identifier of action |
| 44 | */ |
| 45 | public function getId() |
| 46 | { |
| 47 | return 'access-control-admin'; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * @return string Label of the action |
| 52 | */ |
| 53 | public function getName() |
| 54 | { |
| 55 | return __('Access control'); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * @return string fully qualified URL of the action |
| 60 | */ |
| 61 | public function getUrl() |
| 62 | { |
| 63 | return _url('adminPermissions', 'AdminAccessController', 'taoDacSimple'); |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * @return string Java script bindings of action |
| 68 | */ |
| 69 | public function getBinding() |
| 70 | { |
| 71 | return self::BINDING_DEFAULT; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * @return string Context of the action |
| 76 | */ |
| 77 | public function getContext() |
| 78 | { |
| 79 | return self::CONTEXT_RESOURCE; |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * @return string Group of the action (where to display) |
| 84 | */ |
| 85 | public function getGroup() |
| 86 | { |
| 87 | return self::GROUP_DEFAULT; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * @return Icon Icon to be used with action |
| 92 | */ |
| 93 | public function getIcon() |
| 94 | { |
| 95 | return new Icon([ |
| 96 | 'id' => 'icon-unlock', |
| 97 | 'ext' => 'taoDacSimple', |
| 98 | 'src' => null |
| 99 | ]); |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * The action applies on a single resource |
| 104 | * @return boolean |
| 105 | */ |
| 106 | public function isMultiple() |
| 107 | { |
| 108 | return false; |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * @return array this action requires GRANT permissions |
| 113 | */ |
| 114 | public function getRequiredRights() |
| 115 | { |
| 116 | return [ |
| 117 | 'id' => 'GRANT' |
| 118 | ]; |
| 119 | } |
| 120 | public function getWeight() |
| 121 | { |
| 122 | return self::WEIGHT_DEFAULT; |
| 123 | } |
| 124 | } |