1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Gitamin\Http\Controllers\Dashboard; |
4
|
|
|
|
5
|
|
|
use Illuminate\Routing\Controller; |
6
|
|
|
use Illuminate\Support\Facades\View; |
7
|
|
|
|
8
|
|
|
class ActivityController extends Controller |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* Display a listing of the resource. |
12
|
|
|
* |
13
|
|
|
* @return \Illuminate\Http\Response |
14
|
|
|
*/ |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Array of sub-menu items. |
18
|
|
|
* |
19
|
|
|
* @var array |
20
|
|
|
*/ |
21
|
|
|
protected $subMenu = []; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Creates a new activity controller instance. |
25
|
|
|
* |
26
|
|
|
* @return void |
|
|
|
|
27
|
|
|
*/ |
28
|
|
|
public function __construct() |
29
|
|
|
{ |
30
|
|
|
$this->subMenu = [ |
31
|
|
|
'activity' => [ |
32
|
|
|
'title' => trans('dashboard.activity.all'), |
33
|
|
|
'url' => route('dashboard.activity.index'), |
34
|
|
|
'icon' => 'fa fa-sliders', |
35
|
|
|
'active' => false, |
36
|
|
|
], |
37
|
|
|
'project_update' => [ |
38
|
|
|
'title' => trans('dashboard.activity.project_update'), |
39
|
|
|
'url' => route('dashboard.activity.index'), |
40
|
|
|
'icon' => 'fa fa-edit', |
41
|
|
|
'active' => false, |
42
|
|
|
], |
43
|
|
|
'topic' => [ |
44
|
|
|
'title' => trans('dashboard.activity.topic'), |
45
|
|
|
'url' => route('dashboard.activity.index'), |
46
|
|
|
'icon' => 'fa fa-comment', |
47
|
|
|
'active' => false, |
48
|
|
|
], |
49
|
|
|
'watched_project' => [ |
50
|
|
|
'title' => trans('dashboard.activity.watched_project'), |
51
|
|
|
'url' => route('dashboard.activity.index'), |
52
|
|
|
'icon' => 'fa fa-eye', |
53
|
|
|
'active' => false, |
54
|
|
|
], |
55
|
|
|
]; |
56
|
|
|
|
57
|
|
|
View::share([ |
58
|
|
|
'sub_menu' => $this->subMenu, |
59
|
|
|
'sub_title' => trans_choice('dashboard.activity.activity', 2), |
60
|
|
|
]); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function index() |
64
|
|
|
{ |
65
|
|
|
$activities = []; |
66
|
|
|
|
67
|
|
|
$this->subMenu['activity']['active'] = true; |
68
|
|
|
|
69
|
|
|
return View::make('dashboard.activity.index') |
70
|
|
|
->withPageTitle('Activity') |
71
|
|
|
->withActivities($activities) |
72
|
|
|
->withSubMenu($this->subMenu); |
73
|
|
|
} |
74
|
|
|
} |
75
|
|
|
|
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.