<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
return $o;
}
+ /**
+ * Module DELETE method to process submitted data
+ *
+ * Extend this method if the module is supposed to process DELETE requests.
+ * Doesn't display any content
+ */
+ public static function delete(array $parameters = [])
+ {
+ }
+
+ /**
+ * Module PATCH method to process submitted data
+ *
+ * Extend this method if the module is supposed to process PATCH requests.
+ * Doesn't display any content
+ */
+ public static function patch(array $parameters = [])
+ {
+ }
+
/**
* Module POST method to process submitted data
*
{
}
+ /**
+ * Module PUT method to process submitted data
+ *
+ * Extend this method if the module is supposed to process PUT requests.
+ * Doesn't display any content
+ */
+ public static function put(array $parameters = [])
+ {
+ }
+
/*
* Functions used to protect against Cross-Site Request Forgery
* The security token has to base on at least one value that an attacker can't know - here it's the session ID and the private key.
return false;
}
- $sec_hash = hash('whirlpool', $a->user['guid'] . $a->user['prvkey'] . session_id() . $x[0] . $typename);
+ $sec_hash = hash('whirlpool', ($a->user['guid'] ?? '') . ($a->user['prvkey'] ?? '') . session_id() . $x[0] . $typename);
return ($sec_hash == $x[1]);
}
throw new \Friendica\Network\HTTPException\ForbiddenException();
}
}
+
+ protected static function getContactFilterTabs(string $baseUrl, string $current, bool $displayCommonTab)
+ {
+ $tabs = [
+ [
+ 'label' => DI::l10n()->t('All contacts'),
+ 'url' => $baseUrl . '/contacts',
+ 'sel' => !$current || $current == 'all' ? 'active' : '',
+ ],
+ [
+ 'label' => DI::l10n()->t('Followers'),
+ 'url' => $baseUrl . '/contacts/followers',
+ 'sel' => $current == 'followers' ? 'active' : '',
+ ],
+ [
+ 'label' => DI::l10n()->t('Following'),
+ 'url' => $baseUrl . '/contacts/following',
+ 'sel' => $current == 'following' ? 'active' : '',
+ ],
+ [
+ 'label' => DI::l10n()->t('Mutual friends'),
+ 'url' => $baseUrl . '/contacts/mutuals',
+ 'sel' => $current == 'mutuals' ? 'active' : '',
+ ],
+ ];
+
+ if ($displayCommonTab) {
+ $tabs[] = [
+ 'label' => DI::l10n()->t('Common'),
+ 'url' => $baseUrl . '/contacts/common',
+ 'sel' => $current == 'common' ? 'active' : '',
+ ];
+ }
+
+ return $tabs;
+ }
}