2020-03-31 23:21:35 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Zotlabs\Module;
|
|
|
|
|
|
2026-07-16 10:29:49 +03:00
|
|
|
use Zotlabs\Web\Controller;
|
2020-03-31 23:21:35 +03:00
|
|
|
|
2026-07-16 10:29:49 +03:00
|
|
|
class Link extends Controller {
|
2020-03-31 23:21:35 +03:00
|
|
|
|
2026-07-16 10:29:49 +03:00
|
|
|
function init() {
|
2020-03-31 23:21:35 +03:00
|
|
|
|
2020-11-07 16:02:21 +03:00
|
|
|
}
|
2020-03-31 23:21:35 +03:00
|
|
|
|
2026-07-16 10:29:49 +03:00
|
|
|
function get() {
|
2020-04-04 23:18:26 +03:00
|
|
|
|
2026-07-16 10:29:49 +03:00
|
|
|
$item_id = ((argc() > 1) ? intval(argv(1)) : 0);
|
2020-03-31 23:21:35 +03:00
|
|
|
|
2026-07-16 10:29:49 +03:00
|
|
|
if(! $item_id) {
|
|
|
|
|
\App::$error = 404;
|
|
|
|
|
notice( t('Item not found.') . EOL);
|
|
|
|
|
return;
|
2020-11-07 16:02:21 +03:00
|
|
|
}
|
|
|
|
|
|
2026-07-16 10:29:49 +03:00
|
|
|
$r = q("select uuid from item where id = %d limit 1",
|
|
|
|
|
intval($item_id)
|
2020-11-07 16:02:21 +03:00
|
|
|
);
|
2020-03-31 23:21:35 +03:00
|
|
|
|
2026-07-16 10:29:49 +03:00
|
|
|
if (!$r) {
|
|
|
|
|
notice( t('Item not found.') . EOL);
|
|
|
|
|
return;
|
2020-11-07 16:02:21 +03:00
|
|
|
}
|
2020-03-31 23:21:35 +03:00
|
|
|
|
2026-07-16 10:29:49 +03:00
|
|
|
if (get_config('link','hideasides')) {
|
|
|
|
|
goaway(z_root() . '/display/' . $r[0]['uuid'] . '?link_hideasides=1');
|
2020-11-07 16:02:21 +03:00
|
|
|
}
|
2020-04-04 23:18:26 +03:00
|
|
|
|
2026-07-16 10:29:49 +03:00
|
|
|
goaway(z_root() . '/display/' . $r[0]['uuid']);
|
2020-04-04 23:18:26 +03:00
|
|
|
|
|
|
|
|
}
|
2020-03-31 23:21:35 +03:00
|
|
|
|
2020-04-04 23:18:26 +03:00
|
|
|
}
|