2020-04-18 00:51:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
function get_item_from_url($id, $fatal=false) {
|
2022-04-24 17:43:44 +02:00
|
|
|
if (!check_id($id))
|
|
|
|
logging('FATAL', _('Invalid element identifier.'));
|
2020-04-18 00:51:33 +02:00
|
|
|
|
2022-04-24 17:43:44 +02:00
|
|
|
$item = get_item($id);
|
|
|
|
if(!is_array($item)) {
|
|
|
|
$error = sprintf(_("Item #% s not found."), $id);
|
|
|
|
if ($fatal)
|
|
|
|
logging('FATAL', $error);
|
|
|
|
add_error($error);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return $item;
|
2020-04-18 00:51:33 +02:00
|
|
|
}
|