-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The type of 'content' field is changed to redactor in BlogController.
- Loading branch information
Showing
1 changed file
with
26 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,44 @@ | ||
<?php namespace Serverfireteam\blog\panel; | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
|
||
use Serverfireteam\Panel\CrudController; | ||
use \Illuminate\Routing\Controllers; | ||
/** | ||
* Description of Blog | ||
* | ||
* @author alireza | ||
*/ | ||
|
||
class BlogController extends \Serverfireteam\Panel\CrudController { | ||
//put your code here | ||
public function all($entity){ | ||
parent::all($entity); | ||
|
||
public function all($entity) { | ||
|
||
parent::all($entity); | ||
|
||
$this->filter = \DataFilter::source(new \App\Blog()); | ||
$this->filter->add('id', 'ID', 'text'); | ||
$this->filter->add('title', 'Title', 'text'); | ||
$this->filter->submit('search'); | ||
$this->filter->reset('reset'); | ||
$this->filter->build(); | ||
|
||
$this->grid = \DataGrid::source($this->filter); | ||
$this->grid->add('id','ID', true)->style("width:100px"); | ||
$this->grid->add('title','title'); | ||
$this->grid->add('socialPoint','social Point'); | ||
$this->addStylesToGrid(); | ||
$this->grid->add('id', 'ID', true)->style("width:100px"); | ||
$this->grid->add('title', 'title'); | ||
$this->grid->add('socialPoint', 'social Point'); | ||
$this->addStylesToGrid(); | ||
|
||
return $this->returnView(); | ||
} | ||
|
||
|
||
public function edit($entity){ | ||
|
||
|
||
public function edit($entity) { | ||
|
||
parent::edit($entity); | ||
|
||
$this->edit = \DataEdit::source(new \App\Blog()); | ||
|
||
$this->edit->label('Edit Project'); | ||
$this->edit->add('title','post title', 'text')->rule('required|min:3'); | ||
$this->edit->add('author','author', 'text')->rule('required|min:2'); | ||
$this->edit->add('content','content', 'textarea')->rule('required'); | ||
$this->edit->add('image','image', 'image')->move('uploads/'); | ||
$this->edit->add('color','Color','colorpicker'); | ||
$this->edit->add('public','public','radiogroup')->option(0,'Draft')->option(1,'Ready'); | ||
|
||
$this->edit->label('Edit Project'); | ||
$this->edit->add('title', 'post title', 'text')->rule('required|min:3'); | ||
$this->edit->add('author', 'author', 'text')->rule('required|min:2'); | ||
$this->edit->add('content', 'content', 'redactor')->rule('required'); | ||
$this->edit->add('image', 'image', 'image')->move('uploads/'); | ||
$this->edit->add('color', 'Color', 'colorpicker'); | ||
$this->edit->add('public', 'public', 'radiogroup')->option(0, 'Draft')->option(1, 'Ready'); | ||
|
||
return $this->returnEditView(); | ||
} | ||
} |