mirror of
https://github.com/friendica/friendica
synced 2025-04-26 09:10:15 +00:00
Make BaseModule methods dynamic
This commit is contained in:
parent
714f0febc4
commit
489cd0884a
253 changed files with 397 additions and 385 deletions
|
@ -38,14 +38,14 @@ use Friendica\Util\Strings;
|
|||
*/
|
||||
class Advanced extends BaseModule
|
||||
{
|
||||
public static function init()
|
||||
public function init()
|
||||
{
|
||||
if (!Session::isAuthenticated()) {
|
||||
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||
}
|
||||
}
|
||||
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
$cid = static::$parameters['id'];
|
||||
|
||||
|
@ -96,7 +96,7 @@ class Advanced extends BaseModule
|
|||
return;
|
||||
}
|
||||
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
$cid = static::$parameters['id'];
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ use Friendica\Network\HTTPException;
|
|||
|
||||
class Contacts extends BaseModule
|
||||
{
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
$app = DI::app();
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ use Friendica\Util\Strings;
|
|||
*/
|
||||
class Hovercard extends BaseModule
|
||||
{
|
||||
public static function rawContent()
|
||||
public function rawContent()
|
||||
{
|
||||
$contact_url = $_REQUEST['url'] ?? '';
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ use Friendica\Network\HTTPException\BadRequestException;
|
|||
*/
|
||||
class Media extends BaseModule
|
||||
{
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
$cid = static::$parameters['id'];
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ use Friendica\Util\XML;
|
|||
|
||||
class Poke extends BaseModule
|
||||
{
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!local_user() || empty(static::$parameters['id'])) {
|
||||
return self::postReturn(false);
|
||||
|
@ -123,7 +123,7 @@ class Poke extends BaseModule
|
|||
return $success;
|
||||
}
|
||||
|
||||
public static function content()
|
||||
public function content(): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
|
||||
|
|
|
@ -37,7 +37,7 @@ class Revoke extends BaseModule
|
|||
/** @var array */
|
||||
private static $contact;
|
||||
|
||||
public static function init()
|
||||
public function init()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
|
@ -63,7 +63,7 @@ class Revoke extends BaseModule
|
|||
}
|
||||
}
|
||||
|
||||
public static function post()
|
||||
public function post()
|
||||
{
|
||||
if (!local_user()) {
|
||||
throw new HTTPException\UnauthorizedException();
|
||||
|
@ -83,7 +83,7 @@ class Revoke extends BaseModule
|
|||
DI::baseUrl()->redirect('contact/' . static::$parameters['id']);
|
||||
}
|
||||
|
||||
public static function content(): string
|
||||
public function content(): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
return Login::form($_SERVER['REQUEST_URI']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue