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
222ec0a0
Commit
222ec0a0
authored
Oct 25, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
b66d9325
'
* commit '
b66d9325
': Squashed 'Modules/Core/' changes from dab167b..8c8f7be
parents
4810bd58
b66d9325
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
136 additions
and
5 deletions
+136
-5
MasterViewComposer.php
Modules/Core/Composers/MasterViewComposer.php
+6
-4
settings.php
Modules/Core/Config/settings.php
+14
-0
Authentication.php
Modules/Core/Contracts/Authentication.php
+64
-0
Setting.php
Modules/Core/Contracts/Setting.php
+31
-0
core.php
Modules/Core/Resources/lang/en/core.php
+4
-0
settings.php
Modules/Core/Resources/lang/en/settings.php
+6
-0
core.php
Modules/Core/Resources/lang/fr/core.php
+4
-0
settings.php
Modules/Core/Resources/lang/fr/settings.php
+6
-0
master.blade.php
Modules/Core/Resources/views/layouts/master.blade.php
+1
-1
No files found.
Modules/Core/Composers/MasterViewComposer.php
View file @
222ec0a0
<?php
namespace
Modules\Core\Composers
;
use
Illuminate\Contracts\View\View
;
use
Modules\Setting\Repositories\SettingRepository
;
use
Illuminate\Support\Facades\App
;
use
Modules\Core\Contracts\Setting
;
class
MasterViewComposer
{
/**
* @var Setting
Repository
* @var Setting
*/
private
$setting
;
public
function
__construct
(
Setting
Repository
$setting
)
public
function
__construct
(
Setting
$setting
)
{
$this
->
setting
=
$setting
;
}
public
function
compose
(
View
$view
)
{
$view
->
with
(
'sitename'
,
$this
->
setting
->
findSettingForModule
(
'site-name'
));
$view
->
with
(
'sitename'
,
$this
->
setting
->
get
(
'core::site-name'
,
App
::
getLocale
()
));
}
}
Modules/Core/Config/settings.php
0 → 100644
View file @
222ec0a0
<?php
return
[
'site-name'
=>
[
'description'
=>
trans
(
'core::settings.site-name'
),
'view'
=>
'text'
,
'translatable'
=>
true
],
'site-description'
=>
[
'description'
=>
trans
(
'core::settings.site-description'
),
'view'
=>
'textarea'
,
'translatable'
=>
true
],
];
Modules/Core/Contracts/Authentication.php
0 → 100644
View file @
222ec0a0
<?php
namespace
Modules\Core\Contracts
;
interface
Authentication
{
/**
* Authenticate a user
* @param array $credentials
* @param bool $remember Remember the user
* @return mixed
*/
public
function
login
(
array
$credentials
,
$remember
=
false
);
/**
* Register a new user.
* @param array $user
* @return bool
*/
public
function
register
(
array
$user
);
/**
* Activate the given used id
* @param int $userId
* @param string $code
* @return mixed
*/
public
function
activate
(
$userId
,
$code
);
/**
* Assign a role to the given user.
* @param \Modules\User\Repositories\UserRepository $user
* @param \Modules\User\Repositories\RoleRepository $role
* @return mixed
*/
public
function
assignRole
(
$user
,
$role
);
/**
* Log the user out of the application.
* @return mixed
*/
public
function
logout
();
/**
* Create an activation code for the given user
* @param $user
* @return mixed
*/
public
function
createActivation
(
$user
);
/**
* Create a reminders code for the given user
* @param $user
* @return mixed
*/
public
function
createReminderCode
(
$user
);
/**
* Completes the reset password process
* @param $user
* @param string $code
* @param string $password
* @return bool
*/
public
function
completeResetPassword
(
$user
,
$code
,
$password
);
}
Modules/Core/Contracts/Setting.php
0 → 100644
View file @
222ec0a0
<?php
namespace
Modules\Core\Contracts
;
interface
Setting
{
/**
* Determine if the given configuration value exists.
*
* @param string $key
* @return bool
*/
public
function
has
(
$key
);
/**
* Get the specified configuration value in the given language
*
* @param string $key
* @param string $locale
* @param mixed $default
* @return string
*/
public
function
get
(
$key
,
$locale
=
null
,
$default
=
null
);
/**
* Set a given configuration value.
*
* @param string $key
* @param mixed $value
* @return void
*/
public
function
set
(
$key
,
$value
);
}
Modules/Core/Resources/lang/en/core.php
View file @
222ec0a0
...
...
@@ -21,5 +21,9 @@ return [
],
'breadcrumb'
=>
[
'home'
=>
'Home'
],
'title'
=>
[
'translatable fields'
=>
'Translatable fields'
,
'non translatable fields'
=>
'Non translatable fields'
,
]
];
Modules/Core/Resources/lang/en/settings.php
0 → 100644
View file @
222ec0a0
<?php
return
[
'site-name'
=>
'Site name'
,
'site-description'
=>
'Site description'
,
];
Modules/Core/Resources/lang/fr/core.php
View file @
222ec0a0
...
...
@@ -21,5 +21,9 @@ return [
'tab'
=>
[
'english'
=>
'Anglais'
,
'french'
=>
'Français'
,
],
'title'
=>
[
'translatable fields'
=>
'Champs traduisible'
,
'non translatable fields'
=>
'Champs non traduisible'
,
]
];
Modules/Core/Resources/lang/fr/settings.php
0 → 100644
View file @
222ec0a0
<?php
return
[
'site-name'
=>
'Nom du site'
,
'site-description'
=>
'Description du site'
,
];
Modules/Core/Resources/views/layouts/master.blade.php
View file @
222ec0a0
...
...
@@ -34,7 +34,7 @@
<header
class=
"header"
>
<a
href=
"{{ URL::route('dashboard.index') }}"
class=
"logo"
>
<?php
if
(
isset
(
$sitename
))
:
?>
{{ $sitename
->translate(App::getLocale())->value
}}
{{ $sitename }}
<?php
endif
;
?>
</a>
@include('core::partials.top-nav')
...
...
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