mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-07 08:38:45 +02:00
Move BlogFilter_GridField to its own class
This commit is contained in:
parent
bb08242edb
commit
3da05818af
@ -4,7 +4,7 @@ mappings:
|
||||
GridFieldMergeAction: SilverStripe\Blog\Admin\GridFieldMergeAction
|
||||
BlogCommentExtension: SilverStripe\Blog\Model\BlogCommentExtension
|
||||
BlogFilter: SilverStripe\Blog\Model\BlogFilter
|
||||
BlogFilter_GridField: SilverStripe\Blog\Model\BlogFilter_GridField
|
||||
BlogFilter_GridField: SilverStripe\Blog\Model\BlogFilter\BlogFilterGridField
|
||||
BlogMemberExtension: SilverStripe\Blog\Model\BlogMemberExtension
|
||||
BlogPostFilter: SilverStripe\Blog\Model\BlogPostFilter
|
||||
BlogPostNotifications: SilverStripe\Blog\Model\BlogPostNotifications
|
||||
|
@ -3,11 +3,11 @@
|
||||
namespace SilverStripe\Blog\Model;
|
||||
|
||||
use SilverStripe\Blog\Model\Blog;
|
||||
use SilverStripe\Blog\Model\BlogFilter\BlogFilterGridField;
|
||||
use SilverStripe\Blog\Model\BlogPost;
|
||||
use SilverStripe\Core\ClassInfo;
|
||||
use SilverStripe\Core\Convert;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\FormTransformation;
|
||||
use SilverStripe\Forms\GridField\GridField;
|
||||
use SilverStripe\Forms\Tab;
|
||||
use SilverStripe\Lumberjack\Model\Lumberjack;
|
||||
@ -59,7 +59,7 @@ class BlogFilter extends Lumberjack
|
||||
*/
|
||||
protected function subclassForBlog()
|
||||
{
|
||||
return in_array(get_class($this->owner), ClassInfo::subclassesFor('SilverStripe\\Blog\\Model\\Blog'));
|
||||
return in_array(get_class($this->owner), ClassInfo::subclassesFor(Blog::class));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -104,7 +104,7 @@ class BlogFilter extends Lumberjack
|
||||
'ClassName' => $excluded
|
||||
));
|
||||
|
||||
$gridField = BlogFilter_GridField::create(
|
||||
$gridField = BlogFilterGridField::create(
|
||||
'ChildPages',
|
||||
$this->getLumberjackTitle(),
|
||||
$pages,
|
||||
@ -117,20 +117,3 @@ class BlogFilter extends Lumberjack
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enables children of non-editable pages to be edited.
|
||||
*/
|
||||
class BlogFilter_GridField extends GridField
|
||||
{
|
||||
/**
|
||||
* @param FormTransformation $transformation
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function transform(FormTransformation $transformation)
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
21
src/Model/BlogFilter/BlogFilterGridField.php
Normal file
21
src/Model/BlogFilter/BlogFilterGridField.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace SilverStripe\Blog\Model\BlogFilter;
|
||||
|
||||
use SilverStripe\Forms\FormTransformation;
|
||||
|
||||
/**
|
||||
* Enables children of non-editable pages to be edited.
|
||||
*/
|
||||
class BlogFilterGridField extends GridField
|
||||
{
|
||||
/**
|
||||
* @param FormTransformation $transformation
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function transform(FormTransformation $transformation)
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user