Files
firefly-iii/app/Http/Controllers/ImportController.php

77 lines
2.1 KiB
PHP
Raw Normal View History

<?php
2016-08-06 06:21:25 +02:00
/**
* ImportController.php
2017-10-21 08:40:00 +02:00
* Copyright (c) 2017 thegrumpydictator@gmail.com
2016-08-06 06:21:25 +02:00
*
2017-10-21 08:40:00 +02:00
* This file is part of Firefly III.
*
2017-10-21 08:40:00 +02:00
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
2016-08-06 06:21:25 +02:00
*/
2017-03-24 15:15:12 +01:00
declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
2016-06-10 21:00:00 +02:00
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
use View;
/**
* Class ImportController.
*
* @package FireflyIII\Http\Controllers
*/
class ImportController extends Controller
{
/** @var ImportJobRepositoryInterface */
public $repository;
/**
*
*/
public function __construct()
{
parent::__construct();
2016-10-29 07:44:46 +02:00
$this->middleware(
function ($request, $next) {
View::share('mainTitleIcon', 'fa-archive');
2017-06-24 06:57:24 +02:00
View::share('title', trans('firefly.import_index_title'));
$this->repository = app(ImportJobRepositoryInterface::class);
2016-10-29 07:44:46 +02:00
return $next($request);
}
);
}
2016-07-02 23:08:47 +02:00
/**
* General import index
2016-06-24 14:24:34 +02:00
*
2016-07-23 21:37:06 +02:00
* @return View
*/
public function index()
{
2017-06-24 06:57:24 +02:00
$subTitle = trans('firefly.import_index_sub_title');
$subTitleIcon = 'fa-home';
$importFileTypes = [];
$defaultImportType = config('firefly.default_import_format');
foreach (array_keys(config('firefly.import_formats')) as $type) {
$importFileTypes[$type] = trans('firefly.import_file_type_' . $type);
}
return view('import.index', compact('subTitle', 'subTitleIcon', 'importFileTypes', 'defaultImportType'));
}
2016-06-10 21:00:00 +02:00
}