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

/php/component/exporter.class.php

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