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 [
'Dashboard',
'User',
'Workshop'
],
/*
|--------------------------------------------------------------------------
| Specify all the front-end themes
| These will be available as a core setting
|--------------------------------------------------------------------------
*/
'front-themes' => [
'bootstrap',
'default'
]
];
......@@ -11,4 +11,8 @@ return [
'view' => 'textarea',
'translatable' => true
],
'template' => [
'description' => trans('core::settings.template'),
'view' => 'core::fields.select-theme'
],
];
......@@ -3,18 +3,17 @@
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class CoreDatabaseSeeder extends Seeder {
class CoreDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call("OthersTableSeeder");
}
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
}
}
......@@ -7,17 +7,19 @@
interface BaseRepository
{
/**
* @param $id
* @return mixed
* @param int $id
* @return $model
*/
public function find($id);
/**
* Return a collection of all elements of the resource
* @return mixed
*/
public function all();
/**
* Create a resource
* @param $data
* @return mixed
*/
......@@ -25,15 +27,16 @@ interface BaseRepository
/**
* Update a resource
* @param $id
* @param $data
* @param $model
* @param array $data
* @return mixed
*/
public function update($id, $data);
public function update($model, $data);
/**
* @param $ids
* Destroy a resource
* @param $model
* @return mixed
*/
public function destroy($ids);
public function destroy($model);
}
<?php namespace Modules\Core\Repositories\Eloquent;
use Illuminate\Database\Eloquent\Model;
use Modules\Core\Repositories\BaseRepository;
/**
......@@ -17,7 +16,7 @@ abstract class EloquentBaseRepository implements BaseRepository
/**
* @param Model $model
*/
public function __construct(Model $model)
public function __construct($model)
{
$this->model = $model;
}
......@@ -48,12 +47,17 @@ abstract class EloquentBaseRepository implements BaseRepository
return $this->model->create($data);
}
public function update($model, $data)
{
return $model->update($data);
}
/**
* @param int|int[] $ids
* @param Model $model
* @return mixed
*/
public function destroy($ids)
public function destroy($model)
{
return $this->model->destroy($ids);
return $model->delete();
}
}
......@@ -3,4 +3,5 @@
return [
'site-name' => 'Site name',
'site-description' => 'Site description',
'template' => 'Front end template',
];
......@@ -3,4 +3,5 @@
return [
'site-name' => 'Nom 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 @@
<![endif]-->
</head>
<body class="skin-blue">
@include('flash::message')
<header class="header">
<a href="{{ URL::route('dashboard.index') }}" class="logo">
<?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