PageRenderTime 36ms CodeModel.GetById 27ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/php/component/deleter.class.php

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