List option with icon

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
elio42
User
Posts: 128

List option with icon

Post by elio42 »

Hi
In version 10 I added a graphic icon in the list of options using this script:

// ListOptions Rendered event
function ListOptions_Rendered() {
$body_emitir= "<a href=c_imprime_pedido.php?ID_PEDIDO=".CurrentTable()->ID_PEDIDO->CurrentValue." target='_blank'><img src='phpimages/print.gif' style='border: 0; height: 16px;' alt='Imprimir' title='Imprimir'></a>";
$item = &$this->ListOptions->Add("print");
$this->ListOptions->Items["print"]->Body =$body_emitir;
$this->ListOptions->Items["print"]->Visible=TRUE;
//var_dump($this->ListOptions->Items["edit"]);
}

How can I do the same in version 11.
Thanks


danielc
User
Posts: 1601

Post by danielc »

There is no print.gif file in phpimages folder any more. You have to copy the image to the corresponding folder. Or use bootstrap 3 glyphicon for printer, see http://getbootstrap.com/components/ on how to use it with <span> tag. Or use PHPMaker's icon-print. Refer to and copy the code from toolbar regarding export about how to display the icon.


mobhar
User
Posts: 11735

Post by mobhar »

Simply change this:
$body_emitir= "<a href=c_imprime_pedido.php?ID_PEDIDO=".CurrentTable()->ID_PEDIDO->CurrentValue." target='_blank'><img src='phpimages/print.gif' style='border: 0; height: 16px;' alt='Imprimir' title='Imprimir'></a>";

to:
$body_emitir= "<a href='c_imprime_pedido.php?ID_PEDIDO=".CurrentTable()->ID_PEDIDO->CurrentValue."' target='_blank' title='Imprimir'><span class='glyphicon glyphicon-remove ewIcon'></span></a>";


elio42
User
Posts: 128

Post by elio42 »

Dear Mobhar,
when using:
$body_emitir= "<a href='c_imprime_pedido.php?ID_PEDIDO=".CurrentTable()->ID_PEDIDO->CurrentValue."' target='_blank' title='Imprimir'><span class='glyphicon glyphicon-remove ewIcon'></span></a>";

appears the delete icon (X).


danielc
User
Posts: 1601

Post by danielc »

Just change this if you want to use Bootstrap 3 glyphicon (see http://getbootstrap.com/components/):
<span class='glyphicon glyphicon-remove ewIcon'></span>

to:
<span class='glyphicon glyphicon-print ewIcon'></span>


elio42
User
Posts: 128

Post by elio42 »

Thanks!
it works perfectly


Post Reply