1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of Gitamin. |
5
|
|
|
* |
6
|
|
|
* Copyright (C) 2015-2016 The Gitamin Team |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Gitamin\Http\Controllers\Dashboard; |
13
|
|
|
|
14
|
|
|
use AltThree\Validator\ValidationException; |
15
|
|
|
use Gitamin\Commands\Project\AddProjectCommand; |
16
|
|
|
use Gitamin\Commands\Project\RemoveProjectCommand; |
17
|
|
|
use Gitamin\Commands\Project\UpdateProjectCommand; |
18
|
|
|
use Gitamin\Commands\ProjectTeam\AddProjectTeamCommand; |
19
|
|
|
use Gitamin\Commands\ProjectTeam\RemoveProjectTeamCommand; |
20
|
|
|
use Gitamin\Commands\ProjectTeam\UpdateProjectTeamCommand; |
21
|
|
|
use Gitamin\Models\Project; |
22
|
|
|
use Gitamin\Models\ProjectTeam; |
23
|
|
|
use Gitamin\Models\Tag; |
24
|
|
|
use GrahamCampbell\Binput\Facades\Binput; |
25
|
|
|
use Illuminate\Foundation\Bus\DispatchesJobs; |
26
|
|
|
use Illuminate\Routing\Controller; |
27
|
|
|
use Illuminate\Support\Facades\Redirect; |
28
|
|
|
use Illuminate\Support\Facades\View; |
29
|
|
|
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; |
30
|
|
|
|
31
|
|
|
class GroupsController extends Controller |
32
|
|
|
{ |
33
|
|
|
use DispatchesJobs; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Array of sub-menu items. |
37
|
|
|
* |
38
|
|
|
* @var array |
39
|
|
|
*/ |
40
|
|
|
protected $subMenu = []; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Creates a new project controller instance. |
44
|
|
|
* |
45
|
|
|
* @return void |
|
|
|
|
46
|
|
|
*/ |
47
|
|
|
public function __construct() |
48
|
|
|
{ |
49
|
|
|
$this->subMenu = [ |
50
|
|
|
'yours' => [ |
51
|
|
|
'title' => trans_choice('gitamin.groups.yours', 2), |
52
|
|
|
'url' => route('dashboard.groups.index'), |
53
|
|
|
'icon' => 'fa fa-folder', |
54
|
|
|
'active' => false, |
55
|
|
|
], |
56
|
|
|
'explore' => [ |
57
|
|
|
'title' => trans('gitamin.groups.explore'), |
58
|
|
|
'url' => route('explore.index'), |
59
|
|
|
'icon' => 'fa fa-eye', |
60
|
|
|
'active' => false, |
61
|
|
|
], |
62
|
|
|
]; |
63
|
|
|
|
64
|
|
|
View::share([ |
65
|
|
|
'sub_menu' => $this->subMenu, |
66
|
|
|
'sub_title' => trans_choice('dashboard.projects.projects', 2), |
67
|
|
|
]); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Shows the project group view. |
72
|
|
|
* |
73
|
|
|
* @return \Illuminate\View\View |
74
|
|
|
*/ |
75
|
|
View Code Duplication |
public function index() |
|
|
|
|
76
|
|
|
{ |
77
|
|
|
$this->subMenu['yours']['active'] = true; |
78
|
|
|
|
79
|
|
|
return View::make('dashboard.groups.index') |
80
|
|
|
->withPageTitle(trans_choice('gitamin.groups.groups', 2).' - '.trans('dashboard.dashboard')) |
81
|
|
|
->withTeams(ProjectTeam::orderBy('order')->get()) |
82
|
|
|
->withSubMenu($this->subMenu); |
83
|
|
|
} |
84
|
|
|
} |
85
|
|
|
|
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.