$arr = ['content' => $content];
Hook::callAll($moduleClass . '_mod_content', $arr);
$content = $arr['content'];
- $arr = ['content' => call_user_func([$moduleClass, 'content'])];
+ $arr = ['content' => call_user_func([$moduleClass, 'content'], [])];
Hook::callAll($moduleClass . '_mod_aftercontent', $arr);
$content .= $arr['content'];
} catch (HTTPException $e) {
* Extend this method if you need to do any shared processing before both
* content() or post()
*/
- public static function init()
+ public static function init($parameters)
{
}
*/
public static function rawContent($parameters)
{
- // echo '';
- // exit;
}
/**
*
* @return string
*/
- public static function content()
+ public static function content($parameters)
{
$o = '';
* Extend this method if the module is supposed to process POST requests.
* Doesn't display any content
*/
- public static function post()
+ public static function post($parameters)
{
- // $a = self::getApp();
- // $a->internalRedirect('module');
}
/**
*
* Unknown purpose
*/
- public static function afterpost()
+ public static function afterpost($parameters)
{
-
}
/*
require_once $file_path;
}
- public static function init()
+ public static function init($parameters)
{
- self::runModuleFunction('init');
+ self::runModuleFunction('init', $parameters);
}
- public static function content()
+ public static function content($parameters)
{
- return self::runModuleFunction('content');
+ return self::runModuleFunction('content', $parameters);
}
- public static function post()
+ public static function post($parameters)
{
- self::runModuleFunction('post');
+ self::runModuleFunction('post', $parameters);
}
- public static function afterpost()
+ public static function afterpost($parameters)
{
- self::runModuleFunction('afterpost');
+ self::runModuleFunction('afterpost', $parameters);
}
/**
* @return string
* @throws \Exception
*/
- private static function runModuleFunction($function_suffix)
+ private static function runModuleFunction($function_suffix, $parameters)
{
$function_name = static::$moduleName . '_' . $function_suffix;
$a = self::getApp();
return $function_name($a);
} else {
- return parent::{$function_suffix}();
+ return parent::{$function_suffix}($parameters);
}
}
}
*/
class Acctlink extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$addr = trim($_GET['addr'] ?? '');
class Details extends BaseAdminModule
{
- public static function post()
+ public static function post($parameters)
{
- parent::post();
+ parent::post($parameters);
$a = self::getApp();
$a->internalRedirect('admin/addons');
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class Index extends BaseAdminModule
{
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class Contact extends BaseAdminModule
{
- public static function post()
+ public static function post($parameters)
{
- parent::post();
+ parent::post($parameters);
$contact_url = $_POST['contact_url'] ?? '';
$block_reason = $_POST['contact_block_reason'] ?? '';
self::getApp()->internalRedirect('admin/blocklist/contact');
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class Server extends BaseAdminModule
{
- public static function post()
+ public static function post($parameters)
{
- parent::post();
+ parent::post($parameters);
if (empty($_POST['page_blocklist_save']) && empty($_POST['page_blocklist_edit'])) {
return;
self::getApp()->internalRedirect('admin/blocklist/server');
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class DBSync extends BaseAdminModule
{
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class Features extends BaseAdminModule
{
- public static function post()
+ public static function post($parameters)
{
- parent::post();
+ parent::post($parameters);
parent::checkFormSecurityTokenRedirectOnError('/admin/features', 'admin_manage_features');
self::getApp()->internalRedirect('admin/features');
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$arr = [];
$features = Feature::get(false);
class Federation extends BaseAdminModule
{
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
// get counts on active friendica, diaspora, redmatrix, hubzilla, gnu
// social and statusnet nodes this node is knowing
class Delete extends BaseAdminModule
{
- public static function post()
+ public static function post($parameters)
{
- parent::post();
+ parent::post($parameters);
if (empty($_POST['page_deleteitem_submit'])) {
return;
self::getApp()->internalRedirect('admin/item/delete');
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$t = Renderer::getMarkupTemplate('admin/item/delete.tpl');
class Source extends BaseAdminModule
{
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class Settings extends BaseAdminModule
{
- public static function post()
+ public static function post($parameters)
{
- parent::post();
+ parent::post($parameters);
if (!empty($_POST['page_logs'])) {
parent::checkFormSecurityTokenRedirectOnError('/admin/logs', 'admin_logs');
self::getApp()->internalRedirect('admin/logs');
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class View extends BaseAdminModule
{
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$t = Renderer::getMarkupTemplate('admin/logs/view.tpl');
$f = Config::get('system', 'logfile');
*/
class Queue extends BaseAdminModule
{
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class Site extends BaseAdminModule
{
- public static function post()
+ public static function post($parameters)
{
- parent::post();
+ parent::post($parameters);
self::checkFormSecurityTokenRedirectOnError('/admin/site', 'admin_site');
$a->internalRedirect('admin/site' . $active_panel);
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class Summary extends BaseAdminModule
{
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class Details extends BaseAdminModule
{
- public static function post()
+ public static function post($parameters)
{
- parent::post();
+ parent::post($parameters);
$a = self::getApp();
}
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class Embed extends BaseAdminModule
{
- public static function init()
+ public static function init($parameters)
{
$a = self::getApp();
}
}
- public static function post()
+ public static function post($parameters)
{
- parent::post();
+ parent::post($parameters);
$a = self::getApp();
}
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class Index extends BaseAdminModule
{
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
class Tos extends BaseAdminModule
{
- public static function post()
+ public static function post($parameters)
{
- parent::post();
+ parent::post($parameters);
parent::checkFormSecurityTokenRedirectOnError('/admin/tos', 'admin_tos');
self::getApp()->internalRedirect('admin/tos');
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$tos = new \Friendica\Module\Tos();
$t = Renderer::getMarkupTemplate('admin/tos.tpl');
class Users extends BaseAdminModule
{
- public static function post()
+ public static function post($parameters)
{
- parent::post();
+ parent::post($parameters);
$a = self::getApp();
$a->internalRedirect('admin/users');
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
$a = self::getApp();
*/
class AllFriends extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$app = self::getApp();
*/
class Apps extends BaseModule
{
- public static function init()
+ public static function init($parameters)
{
$privateaddons = Config::get('config', 'private_addons');
if ($privateaddons === "1" && !local_user()) {
}
}
- public static function content()
+ public static function content($parameters)
{
$apps = Nav::getAppMenu();
*/
abstract class BaseAdminModule extends BaseModule
{
- public static function post()
+ public static function post($parameters)
{
if (!is_site_admin()) {
return;
return '';
}
- public static function content()
+ public static function content($parameters)
{
$a = self::getApp();
class BaseSettingsModule extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$a = self::getApp();
*/
class Bookmarklet extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$_GET['mode'] = 'minimal';
$a->internalRedirect('contact');
}
- public static function post()
+ public static function post($parameters)
{
$a = self::getApp();
*/
class Credits extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
/* fill the page with credits */
$credits_string = file_get_contents('CREDITS.txt');
*/
class Babel extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
function visible_whitespace($s)
{
*/
class Feed extends BaseModule
{
- public static function init()
+ public static function init($parameters)
{
if (!local_user()) {
info(L10n::t('You must be logged in to use this module'));
}
}
- public static function content()
+ public static function content($parameters)
{
$result = [];
if (!empty($_REQUEST['url'])) {
*/
class ItemBody extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(L10n::t('Access denied.'));
class Localtime extends BaseModule
{
- public static function post()
+ public static function post($parameters)
{
$time = ($_REQUEST['time'] ?? '') ?: 'now';
}
}
- public static function content()
+ public static function content($parameters)
{
$app = self::getApp();
*/
class Probe extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
$e = new HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.'));
*/
class WebFinger extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
$e = new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.'));
*/
class Delegation extends BaseModule
{
- public static function post()
+ public static function post($parameters)
{
if (!local_user()) {
return;
// NOTREACHED
}
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
throw new ForbiddenException(L10n::t('Permission denied.'));
/** @var LoggerInterface */
private static $logger;
- public static function init()
+ public static function init($parameters)
{
/** @var LoggerInterface $logger */
self::$logger = self::getClass(LoggerInterface::class);
}
- public static function post()
+ public static function post($parameters)
{
/** @var Configuration $config */
$config = self::getClass(Configuration::class);
*/
class Directory extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$app = self::getApp();
$config = $app->getConfig();
*/
class Feed extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$a = self::getApp();
*/
class RemoveTag extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
throw new HTTPException\ForbiddenException();
*/
class SaveTag extends BaseModule
{
- public static function init()
+ public static function init($parameters)
{
if (!local_user()) {
info(L10n::t('You must be logged in to use this module'));
*/
class FollowConfirm extends BaseModule
{
- public static function post()
+ public static function post($parameters)
{
$a = self::getApp();
*/
class Friendica extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$app = self::getApp();
$config = $app->getConfig();
class Group extends BaseModule
{
- public static function post()
+ public static function post($parameters)
{
$a = self::getApp();
}
}
- public static function content()
+ public static function content($parameters)
{
$change = false;
class MethodNotAllowed extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
throw new HTTPException\MethodNotAllowedException(L10n::t('Method Not Allowed.'));
}
class PageNotFound extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
throw new HTTPException\NotFoundException(L10n::t('Page not found.'));
}
class Hashtag extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$result = [];
*/
class Help extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
Nav::setSelected('help');
*/
class Home extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$app = self::getApp();
$config = $app->getConfig();
*/
private static $installer;
- public static function init()
+ public static function init($parameters)
{
$a = self::getApp();
self::$currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK;
}
- public static function post()
+ public static function post($parameters)
{
$a = self::getApp();
$configCache = $a->getConfigCache();
}
}
- public static function content()
+ public static function content($parameters)
{
$a = self::getApp();
$configCache = $a->getConfigCache();
*/
class Invite extends BaseModule
{
- public static function post()
+ public static function post($parameters)
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
notice(L10n::tt('%d message sent.', '%d messages sent.', $total) . EOL);
}
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
class Compose extends BaseModule
{
- public static function post()
+ public static function post($parameters)
{
if (!empty($_REQUEST['body'])) {
$_REQUEST['return'] = 'network';
}
}
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
return Login::form('compose', false);
*/
class Login extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$a = self::getApp();
return self::form(Session::get('return_path'), intval(Config::get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED);
}
- public static function post()
+ public static function post($parameters)
{
$openid_identity = Session::get('openid_identity');
$openid_server = Session::get('openid_server');
/**
* @brief Process logout requests
*/
- public static function init()
+ public static function init($parameters)
{
$visitor_home = null;
if (remote_user()) {
*/
class Magic extends BaseModule
{
- public static function init()
+ public static function init($parameters)
{
$a = self::getApp();
$ret = ['success' => false, 'url' => '', 'message' => ''];
*/
class Maintenance extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$config = self::getApp()->getConfig();
*/
class NodeInfo extends BaseModule
{
- public static function init()
+ public static function init($parameters)
{
$config = self::getApp()->getConfig();
*/
class Notify extends BaseModule
{
- public static function init()
+ public static function init($parameters)
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(L10n::t('Permission denied.'));
* @return string|void
* @throws HTTPException\InternalServerErrorException
*/
- public static function content()
+ public static function content($parameters)
{
$a = self::getApp();
*/
class Oembed extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$a = self::getApp();
*/
class Owa extends BaseModule
{
- public static function init()
+ public static function init($parameters)
{
$ret = [ 'success' => false ];
* Fetch a photo or an avatar, in optional size, check for permissions and
* return the image
*/
- public static function init()
+ public static function init($parameters)
{
$a = self::getApp();
// @TODO: Replace with parameter from router
public static $which = '';
public static $profile = 0;
- public static function init()
+ public static function init($parameters)
{
$a = self::getApp();
class Contacts extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
if (Config::get('system', 'block_public') && !Session::isAuthenticated()) {
throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('User not found.'));
* Sets application instance and checks if /proxy/ path is writable.
*
*/
- public static function init()
+ public static function init($parameters)
{
// Set application instance here
$a = self::getApp();
*/
class RandomProfile extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$a = self::getApp();
*
* @return string
*/
- public static function content()
+ public static function content($parameters)
{
// logged in users can register others (people/pages/groups)
// even with closed registrations, unless specifically prohibited by site policy.
* Extend this method if the module is supposed to process POST requests.
* Doesn't display any content
*/
- public static function post()
+ public static function post($parameters)
{
BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register');
*/
class Directory extends BaseSearchModule
{
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
notice(L10n::t('Permission denied.'));
class Index extends BaseSearchModule
{
- public static function content()
+ public static function content($parameters)
{
$search = (!empty($_GET['q']) ? Strings::escapeTags(trim(rawurldecode($_GET['q']))) : '');
class Saved extends BaseModule
{
- public static function init()
+ public static function init($parameters)
{
/** @var Arguments $args */
$args = self::getClass(Arguments::class);
*/
class Delegation extends BaseSettingsModule
{
- public static function post()
+ public static function post($parameters)
{
if (!local_user() || !empty(self::getApp()->user['uid']) && self::getApp()->user['uid'] != local_user()) {
throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]);
}
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
if (!local_user()) {
throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
{
private static $appSpecificPassword = null;
- public static function init()
+ public static function init($parameters)
{
if (!local_user()) {
return;
}
}
- public static function post()
+ public static function post($parameters)
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
return Login::form('settings/2fa/app_specific');
}
- parent::content();
+ parent::content($parameters);
$appSpecificPasswords = AppSpecificPassword::getListForUser(local_user());
class Index extends BaseSettingsModule
{
- public static function post()
+ public static function post($parameters)
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
return Login::form('settings/2fa');
}
- parent::content();
+ parent::content($parameters);
$has_secret = (bool) PConfig::get(local_user(), '2fa', 'secret');
$verified = PConfig::get(local_user(), '2fa', 'verified');
*/
class Recovery extends BaseSettingsModule
{
- public static function init()
+ public static function init($parameters)
{
if (!local_user()) {
return;
}
}
- public static function post()
+ public static function post($parameters)
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
return Login::form('settings/2fa/recovery');
}
- parent::content();
+ parent::content($parameters);
if (!RecoveryCode::countValidForUser(local_user())) {
RecoveryCode::generateForUser(local_user());
*/
class Verify extends BaseSettingsModule
{
- public static function init()
+ public static function init($parameters)
{
if (!local_user()) {
return;
}
}
- public static function post()
+ public static function post($parameters)
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
return Login::form('settings/2fa/verify');
}
- parent::content();
+ parent::content($parameters);
$company = 'Friendica';
$holder = Session::get('my_address');
* If there is an action required through the URL / path, react
* accordingly and export the requested data.
**/
- public static function content()
+ public static function content($parameters)
{
- parent::content();
+ parent::content($parameters);
/**
* options shown on "Export personal data" page
}
}
- public static function content()
+ public static function content($parameters)
{
$smilies = Content\Smilies::getList();
$count = count($smilies['texts'] ?? []);
use Friendica\BaseModule;
use Friendica\Model\Item;
-use Friendica\Core\System;
/**
* Toggle starred items
exit();
}
- $starred = !$item['starred'];
+ $starred = !(bool)$item['starred'];
Item::update(['starred' => $starred], ['id' => $itemId]);
}
// the json doesn't really matter, it will either be 0 or 1
- System::jsonExit($starred);
+ echo json_encode((int)$starred);
+ exit();
}
}
class Statistics extends BaseModule
{
- public static function init()
+ public static function init($parameters)
{
$config = self::getApp()->getConfig();
*/
class ToggleMobile extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$a = self::getApp();
* dealings with their own node so a TOS is not necessary.
*
**/
- public static function init()
+ public static function init($parameters)
{
if (strlen(Config::get('system','singleuser'))) {
self::getApp()->internalRedirect('profile/' . Config::get('system','singleuser'));
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function content() {
+ public static function content($parameters) {
$tpl = Renderer::getMarkupTemplate('tos.tpl');
if (Config::get('system', 'tosdisplay')) {
return Renderer::replaceMacros($tpl, [
*/
class Recovery extends BaseModule
{
- public static function init()
+ public static function init($parameters)
{
if (!local_user()) {
return;
}
}
- public static function post()
+ public static function post($parameters)
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
self::getApp()->internalRedirect();
{
private static $errors = [];
- public static function post()
+ public static function post($parameters)
{
if (!local_user()) {
return;
}
}
- public static function content()
+ public static function content($parameters)
{
if (!local_user()) {
self::getApp()->internalRedirect();
*/
class Welcome extends BaseModule
{
- public static function content()
+ public static function content($parameters)
{
$config = self::getApp()->getConfig();