Code Coverage  | 
      ||||||||||
Lines  | 
       Functions and Methods  | 
       Classes and Traits  | 
      ||||||||
| Total |         | 
       0.00%  | 
       0 / 12  | 
               | 
       0.00%  | 
       0 / 2  | 
       CRAP |         | 
       0.00%  | 
       0 / 1  | 
      
| tao_actions_form_Role |         | 
       0.00%  | 
       0 / 12  | 
               | 
       0.00%  | 
       0 / 2  | 
       20 |         | 
       0.00%  | 
       0 / 1  | 
      
| initElements |         | 
       0.00%  | 
       0 / 9  | 
               | 
       0.00%  | 
       0 / 1  | 
       12 | |||
| getTopClazz |         | 
       0.00%  | 
       0 / 3  | 
               | 
       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) 2008-2010 (original work) Deutsche Institut für Internationale Pädagogische Forschung | 
| 19 | * (under the project TAO-TRANSFER); | 
| 20 | * 2009-2012 (update and modification) Public Research Centre Henri Tudor | 
| 21 | * (under the project TAO-SUSTAIN & TAO-DEV); | 
| 22 | * | 
| 23 | */ | 
| 24 | |
| 25 | use oat\generis\model\GenerisRdf; | 
| 26 | |
| 27 | /** | 
| 28 | * Short description of class tao_actions_form_Role | 
| 29 | * | 
| 30 | * @access public | 
| 31 | * @author Joel Bout, <joel@taotesting.com> | 
| 32 | * @package tao | 
| 33 | |
| 34 | */ | 
| 35 | class tao_actions_form_Role extends tao_actions_form_Instance | 
| 36 | { | 
| 37 | // --- ASSOCIATIONS --- | 
| 38 | |
| 39 | |
| 40 | // --- ATTRIBUTES --- | 
| 41 | |
| 42 | // --- OPERATIONS --- | 
| 43 | |
| 44 | /** | 
| 45 | * Short description of method initElements | 
| 46 | * | 
| 47 | * @access public | 
| 48 | * @author Joel Bout, <joel@taotesting.com> | 
| 49 | * @return mixed | 
| 50 | */ | 
| 51 | public function initElements() | 
| 52 | { | 
| 53 | |
| 54 | parent::initElements(); | 
| 55 | |
| 56 | $encodedIncludesRolePropertyUri = tao_helpers_Uri::encode(GenerisRdf::PROPERTY_ROLE_INCLUDESROLE); | 
| 57 | $encodedInstanceUri = tao_helpers_Uri::encode($this->getInstance()->getUri()); | 
| 58 | $rolesElement = $this->form->getElement($encodedIncludesRolePropertyUri); | 
| 59 | if (!is_null($rolesElement)) { | 
| 60 | $rolesOptions = $rolesElement->getOptions(); | 
| 61 | |
| 62 | // remove the role itself in the list of includable roles | 
| 63 | // to avoid cyclic inclusions (even if the system supports it). | 
| 64 | if (array_key_exists($encodedInstanceUri, $rolesOptions)) { | 
| 65 | unset($rolesOptions[$encodedInstanceUri]); | 
| 66 | } | 
| 67 | |
| 68 | $rolesElement->setOptions($rolesOptions); | 
| 69 | } | 
| 70 | } | 
| 71 | |
| 72 | /** | 
| 73 | * Short description of method getTopClazz | 
| 74 | * | 
| 75 | * @access public | 
| 76 | * @author Joel Bout, <joel@taotesting.com> | 
| 77 | * @return core_kernel_classes_Class | 
| 78 | * @see tao_actions_form_Generis::getTopClazz() | 
| 79 | */ | 
| 80 | public function getTopClazz() | 
| 81 | { | 
| 82 | $returnValue = null; | 
| 83 | |
| 84 | |
| 85 | $returnValue = new core_kernel_classes_Class(GenerisRdf::CLASS_ROLE); | 
| 86 | |
| 87 | |
| 88 | return $returnValue; | 
| 89 | } | 
| 90 | } |