mirror of
https://github.com/friendica/friendica
synced 2025-04-19 20:30:11 +00:00
Move mod/notice to src/Module/Notice
This commit is contained in:
parent
33ec3d8051
commit
9092cb1beb
4 changed files with 71 additions and 23 deletions
34
src/Module/GnuSocial/Notice.php
Normal file
34
src/Module/GnuSocial/Notice.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module\GnuSocial;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Model\ItemUser;
|
||||
use Friendica\Network\HTTPException;
|
||||
|
||||
/**
|
||||
* GNU Social -> friendica items permanent-url compatibility
|
||||
*/
|
||||
class Notice extends BaseModule
|
||||
{
|
||||
public static function rawContent()
|
||||
{
|
||||
$a = self::getApp();
|
||||
|
||||
// @TODO: Replace with parameter from router
|
||||
$id = ($a->argc > 1) ? $a->argv[1] : 0;
|
||||
|
||||
if (empty($id)) {
|
||||
throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
|
||||
}
|
||||
|
||||
$user = ItemUser::getUserForItemId($id, ['nickname']);
|
||||
|
||||
if (empty($user)) {
|
||||
throw new HTTPException\NotFoundException(L10n::t('Item not found.'));
|
||||
} else {
|
||||
$a->internalRedirect('display/' . $user['nickname'] . '/' . $id);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue