mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Sort by creation date desc
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@39814 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ab89c8dd7a
commit
c4fd1281e1
@ -4,13 +4,15 @@ class CommentTableField extends ComplexTableField {
|
|||||||
protected $template = "CommentTableField";
|
protected $template = "CommentTableField";
|
||||||
protected $mode;
|
protected $mode;
|
||||||
|
|
||||||
function __construct($controller, $name, $sourceClass, $mode, $fieldList, $detailFormFields = null, $sourceFilter = "", $sourceSort = "", $sourceJoin = "") {
|
function __construct($controller, $name, $sourceClass, $mode, $fieldList, $detailFormFields = null, $sourceFilter = "", $sourceSort = "Created DESC", $sourceJoin = "") {
|
||||||
$this->mode = $mode;
|
$this->mode = $mode;
|
||||||
|
|
||||||
parent::__construct($controller, $name, $sourceClass, $fieldList, $detailFormFields, $sourceFilter, $sourceSort, $sourceJoin);
|
parent::__construct($controller, $name, $sourceClass, $fieldList, $detailFormFields, $sourceFilter, $sourceSort, $sourceJoin);
|
||||||
|
|
||||||
$this->Markable = true;
|
$this->Markable = true;
|
||||||
// search
|
$this->setPageSize(15);
|
||||||
|
|
||||||
|
// search
|
||||||
$search = isset($_REQUEST['CommentSearch']) ? Convert::raw2sql($_REQUEST['CommentSearch']) : null;
|
$search = isset($_REQUEST['CommentSearch']) ? Convert::raw2sql($_REQUEST['CommentSearch']) : null;
|
||||||
if(!empty($_REQUEST['CommentSearch'])) {
|
if(!empty($_REQUEST['CommentSearch'])) {
|
||||||
$this->sourceFilter[] = "( `Name` LIKE '%$search%' OR `Comment` LIKE '%$search%')";
|
$this->sourceFilter[] = "( `Name` LIKE '%$search%' OR `Comment` LIKE '%$search%')";
|
||||||
|
Loading…
Reference in New Issue
Block a user