mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
commit
cec5aa5ff1
@ -747,13 +747,21 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
if($num) {
|
||||
return sprintf(
|
||||
'<a class="cms-panel-link list-children-link" data-pjax-target="ListViewForm,Breadcrumbs" href="%s">%s</a>',
|
||||
Controller::join_links($controller->Link(), "?ParentID={$item->ID}&view=list"),
|
||||
Controller::join_links(
|
||||
$controller->Link(),
|
||||
sprintf("?ParentID=%d&view=list", (int)$item->ID)
|
||||
),
|
||||
$num
|
||||
);
|
||||
}
|
||||
},
|
||||
'getTreeTitle' => function($value, &$item) use($controller) {
|
||||
return '<a class="action-detail" href="' . singleton('CMSPageEditController')->Link('show') . '/' . $item->ID . '">' . $item->TreeTitle . '</a>';
|
||||
return sprintf(
|
||||
'<a class="action-detail" href="%s/%d">%s</a>',
|
||||
singleton('CMSPageEditController')->Link('show'),
|
||||
(int)$item->ID,
|
||||
$item->TreeTitle // returns HTML, does its own escaping
|
||||
);
|
||||
}
|
||||
));
|
||||
|
||||
|
@ -166,7 +166,13 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider {
|
||||
'title' => _t('ReportAdmin.ReportTitle', 'Title'),
|
||||
));
|
||||
$columns->setFieldFormatting(array(
|
||||
'title' => '<a href=\"$Link\" class=\"cms-panel-link\">$value</a>'
|
||||
'title' => function($value, &$item) {
|
||||
return sprintf(
|
||||
'<a href=\"%s\" class=\"cms-panel-link\">%s</a>',
|
||||
Convert::raw2xml($item->Link),
|
||||
Convert::raw2xml($value)
|
||||
);
|
||||
}
|
||||
));
|
||||
$gridField->addExtraClass('all-reports-gridfield');
|
||||
$fields->push($gridField);
|
||||
|
@ -117,6 +117,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
'Link' => 'Text',
|
||||
'RelativeLink' => 'Text',
|
||||
'AbsoluteLink' => 'Text',
|
||||
'TreeTitle' => 'HTMLText',
|
||||
);
|
||||
|
||||
static $defaults = array(
|
||||
@ -1826,8 +1827,20 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
);
|
||||
$dependentTable->getConfig()->getComponentByType('GridFieldDataColumns')
|
||||
->setFieldFormatting(array(
|
||||
'Title' => '<a href=\"admin/pages/edit/show/$ID\">$Title</a>',
|
||||
'AbsoluteLink' => '<a href=\"$value\">$value</a>',
|
||||
'Title' => function($value, &$item) {
|
||||
return sprintf(
|
||||
'<a href=\"admin/pages/edit/show/%d\">%s</a>',
|
||||
(int)$item->ID,
|
||||
Convert::raw2xml($item->Title)
|
||||
);
|
||||
},
|
||||
'AbsoluteLink' => function($value, &$item) {
|
||||
return sprintf(
|
||||
'<a href=\"%s\">%s</a>',
|
||||
Convert::raw2xml($value),
|
||||
Convert::raw2xml($value)
|
||||
);
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -301,8 +301,13 @@ class SS_Report extends ViewableData {
|
||||
if(isset($info['casting'])) $fieldCasting[$source] = $info['casting'];
|
||||
|
||||
if(isset($info['link']) && $info['link']) {
|
||||
$link = singleton('CMSPageEditController')->Link('show');
|
||||
$fieldFormatting[$source] = '<a href=\"' . $link . '/$ID\">$value</a>';
|
||||
$fieldFormatting[$source] = function($value, &$item) {
|
||||
return sprintf(
|
||||
'<a href=\"%s\">%s</a>',
|
||||
Controller::join_links(singleton('CMSPageEditController')->Link('show'), $item->ID),
|
||||
Convert::raw2xml($value)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
$displayFields[$source] = isset($info['title']) ? $info['title'] : $source;
|
||||
|
Loading…
Reference in New Issue
Block a user