Fewo Mails / Booking Country Services
This commit is contained in:
parent
b9c26d06d0
commit
48a6eb2282
154 changed files with 7761 additions and 1643 deletions
|
|
@ -12,8 +12,12 @@ use Validator;
|
|||
class CMSContentController extends Controller
|
||||
{
|
||||
|
||||
protected $identifier_content;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->identifier_content = 'general';
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -21,7 +25,8 @@ class CMSContentController extends Controller
|
|||
public function index()
|
||||
{
|
||||
$data = [
|
||||
'contents' => CMSContent::all()->sortByDesc('id')
|
||||
'contents' => CMSContent::where('identifier', '=', $this->identifier_content)->get()->sortByDesc('id'),
|
||||
'identifier_content' => $this->identifier_content,
|
||||
];
|
||||
return view('cms.content.all.index', $data);
|
||||
}
|
||||
|
|
@ -30,18 +35,17 @@ class CMSContentController extends Controller
|
|||
public function store()
|
||||
{
|
||||
$data = Request::all();
|
||||
|
||||
if(Request::ajax()) {
|
||||
//upload file
|
||||
if($data['file']){
|
||||
$cmsFileRepo = new CMSFileRepository(new CMSContent());
|
||||
$cmsFileRepo->_set('data', $data);
|
||||
$cmsFileRepo->_set('disk', 'public');
|
||||
$cmsFileRepo->_set('dir', '/cms_files/'.date('Y/m').'/');
|
||||
$cmsFileRepo->_set('identifier', 'cms_file');
|
||||
return $cmsFileRepo->uploadFile(Request::all());
|
||||
}
|
||||
return response()->json(['response' => $data, 'html'=>""]);
|
||||
|
||||
}
|
||||
$rules = array(
|
||||
'name' => 'required',
|
||||
|
|
@ -68,6 +72,10 @@ class CMSContentController extends Controller
|
|||
|
||||
}
|
||||
\Session()->flash('alert-save', '1');
|
||||
if(isset($data['back'])){
|
||||
return redirect($data['back']);
|
||||
|
||||
}
|
||||
return redirect(route('cms_content_all'));
|
||||
}
|
||||
|
||||
|
|
@ -78,9 +86,11 @@ class CMSContentController extends Controller
|
|||
$data = Request::all();
|
||||
$returnHTML = "";
|
||||
if(isset($data['model']) && isset($data['id']) ){
|
||||
if($data['model'] == 'content'){
|
||||
if($data['id'] == "new"){
|
||||
if($data['model'] === 'content'){
|
||||
if($data['id'] === "new"){
|
||||
$value = new CMSContent();
|
||||
$value->identifier = $data['identifier'];
|
||||
$value->field = isset($data['field']) ? $data['field'] : null;
|
||||
}else {
|
||||
$value = CMSContent::find($data['id']);
|
||||
}
|
||||
|
|
@ -93,19 +103,16 @@ class CMSContentController extends Controller
|
|||
|
||||
//public
|
||||
|
||||
|
||||
public function delete($id){
|
||||
$content = CMSContent::findOrFail($id);
|
||||
if($content->isFile()){
|
||||
$content->deleteFile();
|
||||
}
|
||||
$content->delete();
|
||||
$m = \App\Models\Sym\CmsContent::find($id);
|
||||
$m->delete();
|
||||
\Session()->flash('alert-success', __('Content gelöscht'));
|
||||
return redirect(route('cms_content_all'));
|
||||
return back(); //redirect(route('cms_content_all'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue