eesyphp/includes/url-helpers.php

19 lines
404 B
PHP
Raw Normal View History

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
}
# vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab