Commit 74c63b82 authored by Nicolas Widart's avatar Nicolas Widart

Squashed 'Modules/Core/' changes from 3c53b2a..a064d78

a064d78 Removing typehints
a7e0ddf Removing typehinting
3b9a647 Updating base repositories
7474fb0 Adding update method as core
7f297e9 Removing unused commented code
faa6270 Adding sensiolab config file
439d777 Adding travis config
fc5f07e Including flash messages partial in master tmp
8c80071 Adding a select theme option

git-subtree-dir: Modules/Core
git-subtree-split: a064d7827f924da65ba75aab02bd929fc8ed4cc7
parent 51d9c090
rules:
php.interface_has_no_interface_suffix:
enabled: false
language: php
php:
- 5.6
- 5.5
- 5.4
- hhvm
...@@ -11,5 +11,15 @@ return [ ...@@ -11,5 +11,15 @@ return [
'Dashboard', 'Dashboard',
'User', 'User',
'Workshop' 'Workshop'
],
/*
|--------------------------------------------------------------------------
| Specify all the front-end themes
| These will be available as a core setting
|--------------------------------------------------------------------------
*/
'front-themes' => [
'bootstrap',
'default'
] ]
]; ];
...@@ -11,4 +11,8 @@ return [ ...@@ -11,4 +11,8 @@ return [
'view' => 'textarea', 'view' => 'textarea',
'translatable' => true 'translatable' => true
], ],
'template' => [
'description' => trans('core::settings.template'),
'view' => 'core::fields.select-theme'
],
]; ];
...@@ -3,18 +3,17 @@ ...@@ -3,18 +3,17 @@
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class CoreDatabaseSeeder extends Seeder { class CoreDatabaseSeeder extends Seeder
{
/** /**
* Run the database seeds. * Run the database seeds.
* *
* @return void * @return void
*/ */
public function run() public function run()
{ {
Model::unguard(); Model::unguard();
}
// $this->call("OthersTableSeeder");
}
} }
...@@ -7,17 +7,19 @@ ...@@ -7,17 +7,19 @@
interface BaseRepository interface BaseRepository
{ {
/** /**
* @param $id * @param int $id
* @return mixed * @return $model
*/ */
public function find($id); public function find($id);
/** /**
* Return a collection of all elements of the resource
* @return mixed * @return mixed
*/ */
public function all(); public function all();
/** /**
* Create a resource
* @param $data * @param $data
* @return mixed * @return mixed
*/ */
...@@ -25,15 +27,16 @@ interface BaseRepository ...@@ -25,15 +27,16 @@ interface BaseRepository
/** /**
* Update a resource * Update a resource
* @param $id * @param $model
* @param $data * @param array $data
* @return mixed * @return mixed
*/ */
public function update($id, $data); public function update($model, $data);
/** /**
* @param $ids * Destroy a resource
* @param $model
* @return mixed * @return mixed
*/ */
public function destroy($ids); public function destroy($model);
} }
<?php namespace Modules\Core\Repositories\Eloquent; <?php namespace Modules\Core\Repositories\Eloquent;
use Illuminate\Database\Eloquent\Model;
use Modules\Core\Repositories\BaseRepository; use Modules\Core\Repositories\BaseRepository;
/** /**
...@@ -17,7 +16,7 @@ abstract class EloquentBaseRepository implements BaseRepository ...@@ -17,7 +16,7 @@ abstract class EloquentBaseRepository implements BaseRepository
/** /**
* @param Model $model * @param Model $model
*/ */
public function __construct(Model $model) public function __construct($model)
{ {
$this->model = $model; $this->model = $model;
} }
...@@ -48,12 +47,17 @@ abstract class EloquentBaseRepository implements BaseRepository ...@@ -48,12 +47,17 @@ abstract class EloquentBaseRepository implements BaseRepository
return $this->model->create($data); return $this->model->create($data);
} }
public function update($model, $data)
{
return $model->update($data);
}
/** /**
* @param int|int[] $ids * @param Model $model
* @return mixed * @return mixed
*/ */
public function destroy($ids) public function destroy($model)
{ {
return $this->model->destroy($ids); return $model->delete();
} }
} }
...@@ -3,4 +3,5 @@ ...@@ -3,4 +3,5 @@
return [ return [
'site-name' => 'Site name', 'site-name' => 'Site name',
'site-description' => 'Site description', 'site-description' => 'Site description',
'template' => 'Front end template',
]; ];
...@@ -3,4 +3,5 @@ ...@@ -3,4 +3,5 @@
return [ return [
'site-name' => 'Nom du site', 'site-name' => 'Nom du site',
'site-description' => 'Description du site', 'site-description' => 'Description du site',
'template' => 'Template front end',
]; ];
<div class="form-group">
<label for="{{ $settingName }}">{{ $moduleInfo['description'] }}</label>
<select class="form-control" name="{{ $settingName }}" id="{{ $settingName }}">
<?php foreach(Config::get('core::config.front-themes') as $theme): ?>
<option value="{{ $theme }}" {{ isset($dbSettings[$settingName]) && $dbSettings[$settingName]->plainValue == $theme ? 'selected' : '' }}>
{{ ucfirst($theme) }}
</option>
<?php endforeach; ?>
</select>
</div>
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<![endif]--> <![endif]-->
</head> </head>
<body class="skin-blue"> <body class="skin-blue">
@include('flash::message')
<header class="header"> <header class="header">
<a href="{{ URL::route('dashboard.index') }}" class="logo"> <a href="{{ URL::route('dashboard.index') }}" class="logo">
<?php if (isset($sitename)): ?> <?php if (isset($sitename)): ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment