PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

/php/component/deleter.class.php

https://bitbucket.org/chamilo/chamilo-ext-repo-box-dev/
PHP | 37 lines | 31 code | 6 blank | 0 comment | 1 complexity | 98f9d63c8b586fdee1a13bb4fa34acd1 MD5 | raw file
 1<?php
 2namespace common\extensions\external_repository_manager\implementation\box;
 3
 4use common\libraries\Utilities;
 5
 6use common\libraries\Translation;
 7use common\libraries\UtilitUtilities;
 8
 9use common\extensions\external_repository_manager\ExternalRepositoryManager;
10use common\extensions\external_repository_manager\ExternalRepositoryComponent;
11
12class BoxExternalRepositoryManagerDeleterComponent extends BoxExternalRepositoryManager
13{
14
15    function run()
16    {
17        ExternalRepositoryComponent :: launch($this);
18    }
19
20    function delete_external_repository_object($id)
21    {
22        $success = parent :: delete_external_repository_object($id);
23        if ($success)
24        {
25            $parameters = $this->get_parameters();
26            $parameters[ExternalRepositoryManager :: PARAM_EXTERNAL_REPOSITORY_MANAGER_ACTION] = ExternalRepositoryManager :: ACTION_BROWSE_EXTERNAL_REPOSITORY;
27            $this->redirect(Translation :: get('ObjectDeleted', null, Utilities :: COMMON_LIBRARIES), false, $parameters);
28        }
29        else
30        {
31            $parameters = $this->get_parameters();
32            $parameters[ExternalRepositoryManager :: PARAM_EXTERNAL_REPOSITORY_MANAGER_ACTION] = ExternalRepositoryManager :: ACTION_VIEW_EXTERNAL_REPOSITORY;
33            $parameters[ExternalRepositoryManager :: PARAM_EXTERNAL_REPOSITORY_ID] = $id;
34            $this->redirect(Translation :: get('ObjectFailedDeleted', null, Utilities :: COMMON_LIBRARIES), true, $parameters);
35        }
36    }
37}