Hey there
I’m trying to make use of the Display Class’s built-in confirmation with the following code:
$r = $DSP->delete_confirmation(
array(
'url' => 'C=modules'.AMP.'M=documents'.AMP.'P=delete_class_confirm',
'heading' => 'delete_module_heading',
'message' => 'Are you sure you would like to delete this classification? All associated documents will also be deleted.',
'item' => $delete_query->row['class_name'],
'extra' => 'This is extra',
'hidden' => array('class_key' => $IN->GBL('class_key'))
)
);
$DSP->body = $r;
.. and all I get is this (lousy 😉 display: (see attachment)
From what I can tell, I have followed everything fine, which is reflected by the delete screen appearing, but no heading? No message? Its a little strange.
I have not yet tested it for function.
Is anyone able to spot what i might be doing wrong or have any tips/tricks to get this to work?
Thanks.
EDIT:: Strangely, its the passed variable “$delete_query->row[‘class_name’]” that’s providing the correct item name in green.
Unfortunately, that’s not what’s up. Now I have:
$r = $DSP->delete_confirmation(
array(
'url' => 'C=modules'.AMP.'M=documents'.AMP.'P=delete_class_confirm',
'heading' => $LANG->line('delete_class'),
'message' => $LANG->line('delete_class_msg'),
'item' => $delete_query->row['class_name'],
'extra' => 'This is extra',
'hidden' => array('class_key' => $IN->GBL('class_key'))
)
);
$DSP->body = $r;
Global $LANG is being pulled.. and yet the delete_confirmation is identical to the previous.
But logically, it shouldn’t require pulling a string from a Lang file to populate a variable with a string..
Sorry, I meant it requires the language keys. The $LANG->line is done internally, but you can use that by itself to make sure that the language variables are actually there.
So something like this:
$r = $DSP->delete_confirmation(
array(
'url' => 'C=modules'.AMP.'M=documents'.AMP.'P=delete_class_confirm',
'heading' => 'delete_class',
'message' => 'delete_class_msg',
'item' => $delete_query->row['class_name'],
'extra' => 'This is extra',
'hidden' => array('class_key' => $IN->GBL('class_key'))
)
);
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.