MINOR: SSF-168 code convention correction

MINOR: SSF-168 add _t()'s where necessory in GridField print view
This commit is contained in:
Normann Lou 2012-04-05 11:02:42 +12:00
parent 5826b36f8d
commit a946096e29
2 changed files with 18 additions and 8 deletions

View File

@ -135,12 +135,22 @@ class GridFieldPrintButton implements GridField_HTMLProvider, GridField_ActionPr
//get title for the print view
$form = $gridField->getForm();
$currentController = Controller::curr();
$title = method_exists($currentController, 'Title')?$currentController->Title():
($currentController->Title?$currentController->Title:
($form?$form->Name():''));
if($fieldTitle = $gridField->Title()) $title .= ($title?' - ':'').$fieldTitle;
//$state = $gridField->getState(false)->__toString();
$title = '';
if(method_exists($currentController, 'Title')) {
$title = $currentController->Title();
}else{
if($currentController->Title){
$title = $currentController->Title;
}else{
if($form->Name()){
$title = $form->Name();
}
}
}
if($fieldTitle = $gridField->Title()){
if($title) $title .= " - ";
$title .= $fieldTitle;
}
$ret = new ArrayData(
array(

View File

@ -16,9 +16,9 @@
</tbody>
</table>
<p>
Printed at $Datetime.Nice
<% _t('GridField.PRINTEDAT', 'Printed at') %> $Datetime.Time, $Datetime.Date
<br />
Printed by $Member.Name
<% _t('GridField.PRINTEDBY', 'Printed by') %> $Member.Name
</p>
</body>
</html>