Announcement

  •  » Extensions
  •  » Simple way to output a warning in an extension

#1 2018-01-07 13:31:42

ramack
Member
2015-07-17
14

Simple way to output a warning in an extension

Hello

in the very simple extension exiftool_gps I call the command line binary exiftool via shell_exec and in case the tool is not available on the server a php warning is output ([Github] exiftool_gps issue #2).

What is the simplest way to output a warning from the extension - maybe during installation? - I do not want to add a smarty template for the extension just for the output of this check...

Thanks,
Rapha

Offline

 

#2 2018-01-20 20:15:23

ramack
Member
2015-07-17
14

Re: Simple way to output a warning in an extension

Really nobody knows an easy way to print a warning from an extension?

Offline

 

Notice: Undefined offset: 5 in /var/www/piwigo.org/forum/include/parser.php on line 551

#3 2018-01-21 03:34:51

windracer
Member
St. Pete, FL
2014-12-28
444

Re: Simple way to output a warning in an extension

Here's what I use:

Code:

    array_push(
      $page['warnings'],
      l10n('CONSTANT') -or-
      sprintf('your warning message')
      );

Put the message in a yellow box with the exclamation point like this:

[Github] Piwigo-physical_photo_move file resources/ppm-virtual-merge.jpg

Last edited by windracer (2018-01-21 03:35:19)

Offline

 
  •  » Extensions
  •  » Simple way to output a warning in an extension

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact