silverstripe-cms/code/Reports/RecentlyEditedReport.php

37 lines
890 B
PHP
Raw Normal View History

<?php
2016-07-22 01:32:32 +02:00
namespace SilverStripe\CMS\Reports;
use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\ORM\DataObject;
2016-09-09 01:26:24 +02:00
use SilverStripe\Reports\Report;
2016-09-09 01:26:24 +02:00
class RecentlyEditedReport extends Report {
public function title() {
return _t('SideReport.LAST2WEEKS',"Pages edited in the last 2 weeks");
}
public function group() {
return _t('SideReport.ContentGroupTitle', "Content reports");
}
public function sort() {
return 200;
}
public function sourceRecords($params = null) {
$threshold = strtotime('-14 days', DBDatetime::now()->Format('U'));
2016-07-22 01:32:32 +02:00
return DataObject::get("SilverStripe\\CMS\\Model\\SiteTree", "\"SiteTree\".\"LastEdited\" > '".date("Y-m-d H:i:s", $threshold)."'", "\"SiteTree\".\"LastEdited\" DESC");
}
2016-03-08 21:50:55 +01:00
public function columns() {
return array(
"Title" => array(
"title" => "Title", // todo: use NestedTitle(2)
"link" => true,
),
);
}
2015-11-10 03:23:58 +01:00
}