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
c9f40fc9
Commit
c9f40fc9
authored
Nov 21, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
5be6994d
'
* commit '
5be6994d
': Squashed 'Modules/Core/' changes from fac6305..aa20d4a
parents
d91dcb11
5be6994d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
109 additions
and
28 deletions
+109
-28
app.js
Modules/Core/Assets/js/app.js
+1
-1
jquery.slug.js
Modules/Core/Assets/js/vendor/jquery.slug.js
+2
-1
PermissionManager.php
Modules/Core/Permissions/PermissionManager.php
+4
-6
CoreServiceProvider.php
Modules/Core/Providers/CoreServiceProvider.php
+18
-3
RoutingServiceProvider.php
Modules/Core/Providers/RoutingServiceProvider.php
+55
-0
master.blade.php
Modules/Core/Resources/views/layouts/master.blade.php
+15
-15
form-tab-headers.blade.php
.../Core/Resources/views/partials/form-tab-headers.blade.php
+9
-0
module.json
Modules/Core/module.json
+5
-2
No files found.
Modules/Core/Assets/js/app.js
View file @
c9f40fc9
...
...
@@ -140,7 +140,7 @@ $(function() {
if
(
$
(
'
.slugify
'
).
length
)
{
$
(
'
.slugify
'
).
slug
({
slug
:
'
slug
'
,
// class of input / span that contains the generated slug
slug
:
'
slug
'
,
// class of input / span that contains the generated slug
hide
:
false
// hide the text input, true by default
});
}
...
...
Modules/Core/Assets/js/vendor/jquery.slug.js
View file @
c9f40fc9
...
...
@@ -5,7 +5,8 @@
jQuery
.
fn
.
slug
=
function
(
options
)
{
var
settings
=
{
slug
:
'
slug
'
,
// Class used for slug destination input and span. The span is created on $(document).ready()
hide
:
true
// Boolean - By default the slug input field is hidden, set to false to show the input field and hide the span.
hide
:
true
,
// Boolean - By default the slug input field is hidden, set to false to show the input field and hide the span.
override
:
false
};
if
(
options
)
{
...
...
Modules/Core/Permissions/PermissionManager.php
View file @
c9f40fc9
<?php
namespace
Modules\Core\Permissions
;
use
Illuminate\Support\Facades\Config
;
use
Pingpong\Modules\Module
;
class
PermissionManager
{
...
...
@@ -11,11 +10,10 @@ class PermissionManager
private
$module
;
/**
* @param Module $module
*/
public
function
__construct
(
Module
$module
)
public
function
__construct
()
{
$this
->
module
=
$module
;
$this
->
module
=
app
(
'modules'
)
;
}
/**
...
...
@@ -26,9 +24,9 @@ class PermissionManager
{
$permissions
=
[];
foreach
(
$this
->
module
->
enabled
()
as
$enabledModule
)
{
$configuration
=
Config
::
get
(
strtolower
(
$enabledModule
)
.
'::permissions'
);
$configuration
=
Config
::
get
(
strtolower
(
$enabledModule
->
getName
()
)
.
'::permissions'
);
if
(
$configuration
)
{
$permissions
[
$enabledModule
]
=
$configuration
;
$permissions
[
$enabledModule
->
getName
()
]
=
$configuration
;
}
}
return
$permissions
;
...
...
Modules/Core/Providers/CoreServiceProvider.php
View file @
c9f40fc9
<?php
namespace
Modules\Core\Providers
;
use
Illuminate\Contracts\Foundation\Application
;
use
Illuminate\Routing\Router
;
use
Illuminate\Support\ServiceProvider
;
use
Modules\Core\Console\InstallCommand
;
use
Modules\Menu\Entities\Menuitem
;
use
Modules\Menu\Repositories\Eloquent\EloquentMenuItemRepository
;
class
CoreServiceProvider
extends
ServiceProvider
{
...
...
@@ -38,9 +41,8 @@ class CoreServiceProvider extends ServiceProvider
public
function
register
()
{
$this
->
loadModuleProviders
();
$this
->
app
->
booted
(
function
(
$app
)
{
$this
->
registerFilters
(
$app
[
'router'
]);
});
$this
->
registerMenuRoutes
();
$this
->
registerFilters
(
$this
->
app
[
'router'
]);
$this
->
registerCommands
();
}
...
...
@@ -113,4 +115,17 @@ class CoreServiceProvider extends ServiceProvider
'command.asgard.install'
);
}
private
function
registerMenuRoutes
()
{
$this
->
app
->
bind
(
'Modules\Menu\Repositories\MenuItemRepository'
,
function
()
{
return
new
EloquentMenuItemRepository
(
new
Menuitem
);
}
);
$this
->
app
->
singleton
(
'Asgard.routes'
,
function
(
Application
$app
)
{
return
$app
->
make
(
'Modules\Menu\Repositories\MenuItemRepository'
)
->
getForRoutes
();
});
}
}
Modules/Core/Providers/RoutingServiceProvider.php
0 → 100644
View file @
c9f40fc9
<?php
namespace
Modules\Core\Providers
;
use
Illuminate\Foundation\Support\Providers\RouteServiceProvider
as
ServiceProvider
;
use
Illuminate\Routing\Router
;
use
Mcamara\LaravelLocalization\Facades\LaravelLocalization
;
class
RoutingServiceProvider
extends
ServiceProvider
{
public
function
before
(
Router
$router
)
{
// $modules = app('modules');
// $routes = app('Asgard.routes');
// foreach ($modules->enabled() as $module) {
// $router->group(
// ['namespace' => "Modules\\$module\\Http\\Controllers"],
// function (Router $router) use ($module, $routes) {
// foreach (LaravelLocalization::getSupportedLocales() as $locale => $language) {
// if ($this->moduleHasRoute($routes, $module, $locale)) {
// $uri = $routes[strtolower($module)][$locale];
// $router->get(
// $uri,
// [
// 'as' => "{$locale}.{$module}",
// 'uses' => 'PublicController@index'
// ]
// );
// $router->get(
// $uri . '/{slug}',
// [
// 'as' => "{$locale}.{$module}.slug",
// 'uses' => 'PublicController@show'
// ]
// );
// }
// }
// }
// );
// }
}
/**
* @param $routes
* @param $module
* @param $locale
* @return bool
*/
private
function
moduleHasRoute
(
$routes
,
$module
,
$locale
)
{
return
isset
(
$routes
[
strtolower
(
$module
)][
$locale
]);
}
public
function
map
(
Router
$router
)
{
}
}
Modules/Core/Resources/views/layouts/master.blade.php
View file @
c9f40fc9
...
...
@@ -9,17 +9,17 @@
</title>
<meta
content=
'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
name=
'viewport'
>
<!-- bootstrap 3.0.2 -->
<link
href=
"{{{ Module::asset('core
', '
css/vendor/bootstrap.min.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"{{{ Module::asset('core
:
css/vendor/bootstrap.min.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<!-- font Awesome -->
<link
href=
"{{{ Module::asset('core
', '
css/vendor/font-awesome.min.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"{{{ Module::asset('core
:
css/vendor/font-awesome.min.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<!-- Ionicons -->
<link
href=
"{{{ Module::asset('core
', '
css/vendor/ionicons.min.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"{{{ Module::asset('core
', '
css/vendor/alertify/alertify.core.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"{{{ Module::asset('core
', '
css/vendor/alertify/alertify.default.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"{{{ Module::asset('core
', '
css/vendor/datatables/dataTables.bootstrap.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"{{{ Module::asset('core
:
css/vendor/ionicons.min.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"{{{ Module::asset('core
:
css/vendor/alertify/alertify.core.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"{{{ Module::asset('core
:
css/vendor/alertify/alertify.default.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<link
href=
"{{{ Module::asset('core
:
css/vendor/datatables/dataTables.bootstrap.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<!-- Theme style -->
<link
href=
"{{{ Module::asset('core
', '
css/AdminLTE.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<script
src=
"{{{ Module::asset('core
', '
js/vendor/jquery.min.js') }}}"
></script>
<link
href=
"{{{ Module::asset('core
:
css/AdminLTE.css') }}}"
rel=
"stylesheet"
type=
"text/css"
/>
<script
src=
"{{{ Module::asset('core
:
js/vendor/jquery.min.js') }}}"
></script>
@section('styles')
@show
...
...
@@ -56,13 +56,13 @@
</aside>
<!-- /.right-side -->
</div>
<!-- ./wrapper -->
<script
src=
"{!! Module::asset('core
', '
js/vendor/bootstrap.min.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
', '
js/vendor/alertify/alertify.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
', '
js/vendor/iCheck/icheck.min.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
', '
js/vendor/datatables/jquery.dataTables.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
', '
js/vendor/datatables/dataTables.bootstrap.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
', '
js/vendor/jquery.slug.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
', '
js/app.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
:
js/vendor/bootstrap.min.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
:
js/vendor/alertify/alertify.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
:
js/vendor/iCheck/icheck.min.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
:
js/vendor/datatables/jquery.dataTables.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
:
js/vendor/datatables/dataTables.bootstrap.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
:
js/vendor/jquery.slug.js') !!}"
type=
"text/javascript"
></script>
<script
src=
"{!! Module::asset('core
:
js/app.js') !!}"
type=
"text/javascript"
></script>
@section('scripts')
@show
</body>
...
...
Modules/Core/Resources/views/partials/form-tab-headers.blade.php
0 → 100644
View file @
c9f40fc9
<ul
class=
"nav nav-tabs"
>
<?php
$i
=
0
;
?>
<?php
foreach
(
LaravelLocalization
::
getSupportedLocales
()
as
$locale
=>
$language
)
:
?>
<?php
$i
++
;
?>
<li
class=
"{{ App::getLocale() == $locale ? 'active' : '' }}"
>
<a
href=
"#tab_{{ $i }}"
data-toggle=
"tab"
>
{{ trans('core::core.tab.'. strtolower($language['name'])) }}
</a>
</li>
<?php
endforeach
;
?>
</ul>
Modules/Core/module.json
View file @
c9f40fc9
...
...
@@ -12,5 +12,8 @@
"dimsav/laravel-translatable"
:
"dev-laravel-5"
,
"mcamara/laravel-localization"
:
"dev-Laravel5Support"
},
"active"
:
1
}
\ No newline at end of file
"active"
:
1
,
"providers"
:
[
"Modules
\\
Core
\\
Providers
\\
RoutingServiceProvider"
]
}
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