Skip to content

Commit

Permalink
MINOR: SSF-168 code convention correction
Browse files Browse the repository at this point in the history
MINOR: SSF-168 add _t()'s where necessory in GridField print view
  • Loading branch information
normann committed Apr 4, 2012
1 parent 5826b36 commit a946096
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
22 changes: 16 additions & 6 deletions forms/gridfield/GridFieldPrintButton.php
Expand Up @@ -135,12 +135,22 @@ function generatePrintData($gridField) {
//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(
Expand Down
4 changes: 2 additions & 2 deletions templates/Includes/GridField_print.ss
Expand Up @@ -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>

0 comments on commit a946096

Please sign in to comment.