Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| taoTests_actions_TestImport | |
0.00% |
0 / 9 |
|
0.00% |
0 / 2 |
30 | |
0.00% |
0 / 1 |
| index | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getAvailableImportHandlers | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
20 | |||
| 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) 2013 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | * |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | use taoTests_models_classes_TestsService as TestService; |
| 24 | |
| 25 | /** |
| 26 | * This controller provide the actions to import items |
| 27 | * |
| 28 | * @author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu} |
| 29 | * @license GPLv2 http://www.opensource.org/licenses/gpl-2.0.php |
| 30 | * @package taoItems |
| 31 | * |
| 32 | */ |
| 33 | class taoTests_actions_TestImport extends tao_actions_Import |
| 34 | { |
| 35 | /** |
| 36 | * overwrite the parent index to add the requiresRight for Tests |
| 37 | * |
| 38 | * @requiresRight id WRITE |
| 39 | * @requiresRight classUri WRITE |
| 40 | */ |
| 41 | public function index() |
| 42 | { |
| 43 | parent::index(); |
| 44 | } |
| 45 | |
| 46 | protected function getAvailableImportHandlers() |
| 47 | { |
| 48 | $returnValue = parent::getAvailableImportHandlers(); |
| 49 | |
| 50 | $testModelClass = new core_kernel_classes_Class(TestService::CLASS_TEST_MODEL); |
| 51 | foreach ($testModelClass->getInstances() as $model) { |
| 52 | $impl = taoTests_models_classes_TestsService::singleton()->getTestModelImplementation($model); |
| 53 | if (in_array('tao_models_classes_import_ImportProvider', class_implements($impl))) { |
| 54 | foreach ($impl->getImportHandlers() as $handler) { |
| 55 | array_unshift($returnValue, $handler); |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | return $returnValue; |
| 61 | } |
| 62 | } |