Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
2cd2223f
Commit
2cd2223f
authored
Dec 07, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
2f0c4209
'
* commit '
2f0c4209
': Squashed 'Modules/Menu/' changes from c345f10..cd29d47
parents
bf1c9e4c
2f0c4209
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
6 deletions
+56
-6
MenuItemController.php
Modules/Menu/Http/Controllers/Admin/MenuItemController.php
+13
-3
UpdateMenuRequest.php
Modules/Menu/Http/Requests/UpdateMenuRequest.php
+2
-1
EloquentMenuItemRepository.php
...Menu/Repositories/Eloquent/EloquentMenuItemRepository.php
+1
-1
create-fields.blade.php
...es/views/admin/menuitems/partials/create-fields.blade.php
+3
-0
edit-fields.blade.php
...rces/views/admin/menuitems/partials/edit-fields.blade.php
+5
-0
create-fields.blade.php
...ources/views/admin/menus/partials/create-fields.blade.php
+2
-1
composer.json
Modules/Menu/composer.json
+29
-0
module.json
Modules/Menu/module.json
+1
-0
No files found.
Modules/Menu/Http/Controllers/Admin/MenuItemController.php
View file @
2cd2223f
...
...
@@ -8,6 +8,7 @@ use Modules\Menu\Entities\Menuitem;
use
Modules\Menu\Http\Requests\CreateMenuItemRequest
;
use
Modules\Menu\Http\Requests\UpdateMenuItemRequest
;
use
Modules\Menu\Repositories\MenuItemRepository
;
use
Modules\Page\Repositories\PageRepository
;
class
MenuItemController
{
...
...
@@ -19,16 +20,23 @@ class MenuItemController
* @var Redirector
*/
private
$redirector
;
/**
* @var PageRepository
*/
private
$page
;
public
function
__construct
(
MenuItemRepository
$menuItem
,
Redirector
$redirector
)
public
function
__construct
(
MenuItemRepository
$menuItem
,
Redirector
$redirector
,
PageRepository
$page
)
{
$this
->
menuItem
=
$menuItem
;
$this
->
redirector
=
$redirector
;
$this
->
page
=
$page
;
}
public
function
create
(
Menu
$menu
)
{
return
view
(
'menu::admin.menuitems.create'
,
compact
(
'menu'
));
$pages
=
$this
->
page
->
all
();
return
view
(
'menu::admin.menuitems.create'
,
compact
(
'menu'
,
'pages'
));
}
public
function
store
(
Menu
$menu
,
CreateMenuItemRequest
$request
)
...
...
@@ -41,7 +49,9 @@ class MenuItemController
public
function
edit
(
Menu
$menu
,
Menuitem
$menuItem
)
{
return
view
(
'menu::admin.menuitems.edit'
,
compact
(
'menu'
,
'menuItem'
));
$pages
=
$this
->
page
->
all
();
return
view
(
'menu::admin.menuitems.edit'
,
compact
(
'menu'
,
'menuItem'
,
'pages'
));
}
public
function
update
(
Menu
$menu
,
Menuitem
$menuItem
,
UpdateMenuItemRequest
$request
)
...
...
Modules/Menu/Http/Requests/UpdateMenuRequest.php
View file @
2cd2223f
...
...
@@ -6,9 +6,10 @@ class UpdateMenuRequest extends FormRequest
{
public
function
rules
()
{
$menu
=
$this
->
route
()
->
getParameter
(
'menus'
);
return
[
'name'
=>
'required'
,
'primary'
=>
'unique:menus'
,
'primary'
=>
"unique:menus,primary,
{
$menu
->
id
}
"
,
];
}
...
...
Modules/Menu/Repositories/Eloquent/EloquentMenuItemRepository.php
View file @
2cd2223f
...
...
@@ -50,7 +50,7 @@ class EloquentMenuItemRepository extends EloquentBaseRepository implements MenuI
$menuitemsArray
=
[];
foreach
(
$menuitems
as
$menuitem
)
{
$menuitemsArray
[
$menuitem
->
module_name
][
$menuitem
->
locale
]
=
$menuitem
->
locale
.
'/'
.
$menuitem
->
uri
;
$menuitemsArray
[
$menuitem
->
module_name
][
$menuitem
->
locale
]
=
$menuitem
->
uri
;
}
return
$menuitemsArray
;
...
...
Modules/Menu/Resources/views/admin/menuitems/partials/create-fields.blade.php
View file @
2cd2223f
...
...
@@ -2,6 +2,9 @@
<label
for=
"page"
>
{{ trans('menu::menu-items.form.page') }}
</label>
<select
class=
"form-control"
name=
"page_id"
id=
"page"
>
<option
value=
""
></option>
<?php
foreach
(
$pages
as
$page
)
:
?>
<option
value=
"{{ $page->id }}"
>
{{ $page->title }}
</option>
<?php
endforeach
;
?>
</select>
</div>
...
...
Modules/Menu/Resources/views/admin/menuitems/partials/edit-fields.blade.php
View file @
2cd2223f
...
...
@@ -2,6 +2,11 @@
<label
for=
"page"
>
{{ trans('menu::menu-items.form.page') }}
</label>
<select
class=
"form-control"
name=
"page_id"
id=
"page"
>
<option
value=
""
></option>
<?php
foreach
(
$pages
as
$page
)
:
?>
<option
value=
"{{ $page->id }}"
{{
$
menuItem-
>
page_id == $page->id ? 'selected' : '' }}>
{{ $page->title }}
</option>
<?php
endforeach
;
?>
</select>
</div>
...
...
Modules/Menu/Resources/views/admin/menus/partials/create-fields.blade.php
View file @
2cd2223f
...
...
@@ -3,7 +3,7 @@
{!! Form::text('name', Input::old('name'), ['class' => 'form-control', 'placeholder' => trans('menu::menu.form.name')]) !!}
{!! $errors->first('Name', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</div>
<div
class=
"checkbox"
>
<div
class=
"checkbox
{{ $errors->has('primary') ? ' has-error' : '' }}
"
>
<label
for=
"primary"
>
<input
id=
"primary"
name=
"primary"
...
...
@@ -11,5 +11,6 @@
class=
"flat-blue"
value=
"1"
/>
{{ trans('menu::menu.form.primary') }}
{!! $errors->first('primary', '
<span
class=
"help-block"
>
:message
</span>
') !!}
</label>
</div>
Modules/Menu/composer.json
0 → 100644
View file @
2cd2223f
{
"name"
:
"asgardcms/menu-module"
,
"type"
:
"asgard-module"
,
"description"
:
"Menu module for AsgardCMS. Handles all the menus."
,
"keywords"
:
[
"asgardcms"
,
"menu"
,
"tree"
,
"nested sets"
],
"license"
:
"MIT"
,
"authors"
:
[
{
"name"
:
"Nicolas Widart"
,
"email"
:
"info@asgardcms.com"
,
"role"
:
"Developer"
}
],
"support"
:
{
"email"
:
"support@asgardcms.com"
,
"issues"
:
"https://github.com/AsgardCms/Menu/issues"
,
"source"
:
"https://github.com/AsgardCms/Menu"
},
"require"
:
{
"php"
:
">=5.4"
,
"composer/installers"
:
"~1.0"
},
"minimum-stability"
:
"dev"
}
Modules/Menu/module.json
View file @
2cd2223f
...
...
@@ -5,6 +5,7 @@
"keywords"
:
[
],
"active"
:
1
,
"priority"
:
2
,
"providers"
:
[
"Modules
\\
Menu
\\
Providers
\\
RouteServiceProvider"
,
"Modules
\\
Menu
\\
Providers
\\
MenuServiceProvider"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment