mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
MINOR Localized reports (from r99137)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@111610 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
994e60aea8
commit
405a9c4563
@ -21,7 +21,7 @@ class SideReportView extends ViewableData {
|
||||
}
|
||||
|
||||
function group() {
|
||||
return 'Other';
|
||||
return _t('SideReport.OtherGroupTitle', "Other");
|
||||
}
|
||||
|
||||
function sort() {
|
||||
@ -132,7 +132,7 @@ class SideReport_EmptyPages extends SS_Report {
|
||||
}
|
||||
|
||||
function group() {
|
||||
return "Content reports";
|
||||
return _t('SideReport.ContentGroupTitle', "Content reports");
|
||||
}
|
||||
function sort() {
|
||||
return 100;
|
||||
@ -161,7 +161,7 @@ class SideReport_RecentlyEdited extends SS_Report {
|
||||
return _t('SideReport.LAST2WEEKS',"Pages edited in the last 2 weeks");
|
||||
}
|
||||
function group() {
|
||||
return "Content reports";
|
||||
return _t('SideReport.ContentGroupTitle', "Content reports");
|
||||
}
|
||||
function sort() {
|
||||
return 200;
|
||||
@ -189,7 +189,7 @@ class SideReport_ToDo extends SS_Report {
|
||||
return _t('SideReport.TODO',"Pages with To Do items");
|
||||
}
|
||||
function group() {
|
||||
return "Content reports";
|
||||
return _t('SideReport.ContentGroupTitle', "Content reports");
|
||||
}
|
||||
function sort() {
|
||||
return 0;
|
||||
@ -222,7 +222,7 @@ class SideReport_BrokenLinks extends SS_Report {
|
||||
return _t('SideReport.BROKENLINKS',"Pages with broken links");
|
||||
}
|
||||
function group() {
|
||||
return "Broken links reports";
|
||||
return _t('SideReport.BrokenLinksGroupTitle', "Broken links reports");
|
||||
}
|
||||
function sourceRecords($params = null) {
|
||||
// Get class names for page types that are not virtual pages or redirector pages
|
||||
@ -243,7 +243,7 @@ class SideReport_BrokenLinks extends SS_Report {
|
||||
}
|
||||
function parameterFields() {
|
||||
return new FieldSet(
|
||||
new CheckboxField('OnLive', 'Check live site')
|
||||
new CheckboxField('OnLive', _t('SideReport.ParameterLiveCheckbox', 'Check live site'))
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -260,7 +260,7 @@ class SideReport_BrokenFiles extends SS_Report {
|
||||
return _t('SideReport.BROKENFILES',"Pages with broken files");
|
||||
}
|
||||
function group() {
|
||||
return "Broken links reports";
|
||||
return _t('SideReport.BrokenLinksGroupTitle', "Broken links reports");
|
||||
}
|
||||
function sourceRecords($params = null) {
|
||||
// Get class names for page types that are not virtual pages or redirector pages
|
||||
@ -281,7 +281,7 @@ class SideReport_BrokenFiles extends SS_Report {
|
||||
}
|
||||
function parameterFields() {
|
||||
return new FieldSet(
|
||||
new CheckboxField('OnLive', 'Check live site')
|
||||
new CheckboxField('OnLive', _t('SideReport.ParameterLiveCheckbox', 'Check live site'))
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -295,7 +295,7 @@ class SideReport_BrokenVirtualPages extends SS_Report {
|
||||
return _t('SideReport.BROKENVIRTUALPAGES', 'VirtualPages pointing to deleted pages');
|
||||
}
|
||||
function group() {
|
||||
return "Broken links reports";
|
||||
return _t('SideReport.BrokenLinksGroupTitle', "Broken links reports");
|
||||
}
|
||||
function sourceRecords($params = null) {
|
||||
$classNames = "'".join("','", ClassInfo::subclassesFor('VirtualPage'))."'";
|
||||
@ -314,7 +314,7 @@ class SideReport_BrokenVirtualPages extends SS_Report {
|
||||
}
|
||||
function parameterFields() {
|
||||
return new FieldSet(
|
||||
new CheckboxField('OnLive', 'Check live site')
|
||||
new CheckboxField('OnLive', _t('SideReport.ParameterLiveCheckbox', 'Check live site'))
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -328,7 +328,7 @@ class SideReport_BrokenRedirectorPages extends SS_Report {
|
||||
return _t('SideReport.BROKENREDIRECTORPAGES', 'RedirectorPages pointing to deleted pages');
|
||||
}
|
||||
function group() {
|
||||
return "Broken links reports";
|
||||
return _t('SideReport.BrokenLinksGroupTitle', "Broken links reports");
|
||||
}
|
||||
function sourceRecords($params = null) {
|
||||
$classNames = "'".join("','", ClassInfo::subclassesFor('RedirectorPage'))."'";
|
||||
@ -348,7 +348,7 @@ class SideReport_BrokenRedirectorPages extends SS_Report {
|
||||
}
|
||||
function parameterFields() {
|
||||
return new FieldSet(
|
||||
new CheckboxField('OnLive', 'Check live site')
|
||||
new CheckboxField('OnLive', _t('SideReport.ParameterLiveCheckbox', 'Check live site'))
|
||||
);
|
||||
}
|
||||
}
|
@ -7,9 +7,11 @@
|
||||
*/
|
||||
|
||||
class BrokenLinksReport extends SS_Report {
|
||||
|
||||
function title() {
|
||||
return _t('BrokenLinksReport.BROKENLINKS',"Broken links report");
|
||||
}
|
||||
|
||||
function sourceRecords($params, $sort, $limit) {
|
||||
$join = '';
|
||||
$sortBrokenReason = false;
|
||||
@ -39,23 +41,23 @@ class BrokenLinksReport extends SS_Report {
|
||||
|
||||
if ($isVirtualPage) {
|
||||
if ($record->HasBrokenLink) {
|
||||
$reason = "virtual page pointing to non-existent page";
|
||||
$reason = _t('BrokenLinksReport.VirtualPageNonExistent', "virtual page pointing to non-existent page");
|
||||
$reasonCodes = array("VPBROKENLINK");
|
||||
}
|
||||
} else if ($isRedirectorPage) {
|
||||
if ($record->HasBrokenLink) {
|
||||
$reason = "redirector page pointing to non-existent page";
|
||||
$reason = _t('BrokenLinksReport.RedirectorNonExistent', "redirector page pointing to non-existent page");
|
||||
$reasonCodes = array("RPBROKENLINK");
|
||||
}
|
||||
} else {
|
||||
if ($record->HasBrokenLink && $record->HasBrokenFile) {
|
||||
$reason = "has broken link and file";
|
||||
$reason = _t('BrokenLinksReport.HasBrokenLinkAndFile', "has broken link and file");
|
||||
$reasonCodes = array("BROKENFILE", "BROKENLINK");
|
||||
} else if ($record->HasBrokenLink && !$record->HasBrokenFile) {
|
||||
$reason = "has broken link";
|
||||
$reason = _t('BrokenLinksReport.HasBrokenLink', "has broken link");
|
||||
$reasonCodes = array("BROKENLINK");
|
||||
} else if (!$record->HasBrokenLink && $record->HasBrokenFile) {
|
||||
$reason = "has broken file";
|
||||
$reason = _t('BrokenLinksReport.HasBrokenFile', "has broken file");
|
||||
$reasonCodes = array("BROKENFILE");
|
||||
}
|
||||
}
|
||||
@ -72,20 +74,29 @@ class BrokenLinksReport extends SS_Report {
|
||||
return $returnSet;
|
||||
}
|
||||
function columns() {
|
||||
if(isset($_REQUEST['CheckSite']) && $_REQUEST['CheckSite'] == 'Draft') {
|
||||
$dateTitle = _t('BrokenLinksReport.ColumnDateLastModified', 'Date last modified');
|
||||
} else {
|
||||
$dateTitle = _t('BrokenLinksReport.ColumnDateLastPublished', 'Date last published');
|
||||
}
|
||||
|
||||
$fields = array(
|
||||
"Title" => array(
|
||||
"title" => "Page name",
|
||||
'formatting' => '<a href=\"admin/show/$ID\" title=\"Edit page\">$value</a>'
|
||||
'formatting' => sprintf(
|
||||
'<a href=\"admin/show/$ID\" title=\"%s\">$value</a>',
|
||||
_t('BrokenLinksReport.HoverTitleEditPage', 'Edit page')
|
||||
)
|
||||
),
|
||||
"LastEdited" => array(
|
||||
"title" => "Date ".(isset($_REQUEST['CheckSite']) && ($_REQUEST['CheckSite'] == 'Draft')?'last modified':'published'),
|
||||
"title" => $dateTitle,
|
||||
'casting' => 'SSDatetime->Full'
|
||||
),
|
||||
"BrokenReason" => array(
|
||||
"title" => "Problem type"
|
||||
"title" => _t('BrokenLinksReport.ColumnProblemType', "Problem type")
|
||||
),
|
||||
'AbsoluteLink' => array(
|
||||
'title' => 'URL',
|
||||
'title' => _t('BrokenLinksReport.ColumnURL', 'URL'),
|
||||
'formatting' => '$value " . ($AbsoluteLiveLink ? "<a href=\"$AbsoluteLiveLink\">(live)</a>" : "") . " <a href=\"$value?stage=Stage\">(draft)</a>'
|
||||
)
|
||||
);
|
||||
@ -95,16 +106,20 @@ class BrokenLinksReport extends SS_Report {
|
||||
function parameterFields() {
|
||||
return new FieldSet(
|
||||
new DropdownField('CheckSite', 'Check site', array(
|
||||
'Published' => 'Published Site',
|
||||
'Draft' => 'Draft Site'
|
||||
'Published' => _t('BrokenLinksReport.CheckSiteDropdownPublished', 'Published Site'),
|
||||
'Draft' => _t('BrokenLinksReport.CheckSiteDropdownDraft', 'Draft Site')
|
||||
)),
|
||||
new DropdownField('Reason', 'Problem to check', array(
|
||||
'' => 'Any',
|
||||
'BROKENFILE' => 'Broken file',
|
||||
'BROKENLINK' => 'Broken link',
|
||||
'VPBROKENLINK' => 'Virtual page pointing to non-existent page',
|
||||
'RPBROKENLINK' => 'Redirector page pointing to non-existent page',
|
||||
))
|
||||
new DropdownField(
|
||||
'Reason',
|
||||
_t('BrokenLinksReport.ReasonDropdown', 'Problem to check'),
|
||||
array(
|
||||
'' => 'Any',
|
||||
'BROKENFILE' => _t('BrokenLinksReport.ReasonDropdownBROKENFILE', 'Broken file'),
|
||||
'BROKENLINK' => _t('BrokenLinksReport.ReasonDropdownBROKENLINK', 'Broken link'),
|
||||
'VPBROKENLINK' => _t('BrokenLinksReport.ReasonDropdownVPBROKENLINK', 'Virtual page pointing to non-existent page'),
|
||||
'RPBROKENLINK' => _t('BrokenLinksReport.ReasonDropdownRPBROKENLINK', 'Redirector page pointing to non-existent page'),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user