Completed
Push — master ( 1ef690...5e5bda )
by Phecho
03:54
created

ProfilesController::updateAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4286
cc 1
eloc 3
nc 1
nop 0
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;
13
14
use Illuminate\Support\Facades\Redirect;
15
use Illuminate\Support\Facades\View;
16
17
class ProfilesController extends Controller
18
{
19
    /**
20
     * Array of sub-menu items.
21
     *
22
     * @var array
23
     */
24
    protected $subMenu = [];
25
26
    /**
27
     * Creates a new project controller instance.
28
     */
29
    public function __construct()
30
    {
31
        $this->subMenu = [
32
            'profiles' => [
33
                'title' => trans('gitamin.profiles.profiles'),
34
                'url' => route('profile.index'),
35
                'icon' => 'fa fa-user',
36
                'active' => false,
37
            ],
38
            'account' => [
39
                'title' => trans('gitamin.profiles.account'),
40
                'url' => route('profile.index'),
41
                'icon' => 'fa fa-gear',
42
                'active' => false,
43
            ],
44
            'emails' => [
45
                'title' => trans('gitamin.profiles.emails'),
46
                'url' => route('profile.index'),
47
                'icon' => 'fa fa-envelope-o',
48
                'active' => false,
49
            ],
50
            'password' => [
51
                'title' => trans('gitamin.profiles.password'),
52
                'url' => route('profile.index'),
53
                'icon' => 'fa fa-lock',
54
                'active' => false,
55
            ],
56
            'notifications' => [
57
                'title' => trans('gitamin.profiles.notifications'),
58
                'url' => route('profile.index'),
59
                'icon' => 'fa fa-inbox',
60
                'active' => false,
61
            ],
62
            'ssh_keys' => [
63
                'title' => trans('gitamin.profiles.ssh_keys'),
64
                'url' => route('profile.index'),
65
                'icon' => 'fa fa-key',
66
                'active' => false,
67
            ],
68
            'applications' => [
69
                'title' => trans('gitamin.profiles.applications'),
70
                'url' => route('profile.index'),
71
                'icon' => 'fa fa-cloud',
72
                'active' => false,
73
            ],
74
            'preferences' => [
75
                'title' => trans('gitamin.profiles.preferences'),
76
                'url' => route('profile.index'),
77
                'icon' => 'fa fa-image',
78
                'active' => false,
79
            ],
80
            'audit_log' => [
81
                'title' => trans('gitamin.profiles.audit_log'),
82
                'url' => route('profile.index'),
83
                'icon' => 'fa fa-history',
84
                'active' => false,
85
            ],
86
        ];
87
88
        View::share([
89
            'sub_menu' => $this->subMenu,
90
            'sub_title' => trans_choice('dashboard.projects.projects', 2),
91
        ]);
92
    }
93
94
    /**
95
     * Display a listing of the resource.
96
     *
97
     * @return \Illuminate\Http\Response
98
     */
99
    public function indexAction()
100
    {
101
        //
102
        $this->subMenu['profiles']['active'] = true;
103
104
        return View::make('profiles.index')
105
            ->withSubMenu($this->subMenu)
106
            ->withPageTitle(trans('gitamin.profiles.profiles').' - '.trans('dashboard.dashboard'));
107
    }
108
109
    /**
110
     * Update the specified resource in storage.
111
     *
112
     * @return \Illuminate\Http\Response
113
     */
114
    public function updateAction()
115
    {
116
        // Do something
117
118
        return Redirect::route('profile.index')
119
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('gitamin.profiles.edit.success')));
120
    }
121
}
122