mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-17 05:48:49 +00:00
Continued:
- added new-line before curly brace in function/method definition - PR/PSR-2 - added some spaces - added TODOs for next wave Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
parent
f167730b16
commit
5260c920c5
4 changed files with 30 additions and 16 deletions
|
@ -17,11 +17,13 @@ function membersince_install()
|
|||
Addon::registerHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
|
||||
}
|
||||
|
||||
function membersince_uninstall() {
|
||||
function membersince_uninstall()
|
||||
{
|
||||
Addon::unregisterHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
|
||||
}
|
||||
|
||||
function membersince_display(App $a, array &$b) {
|
||||
function membersince_display(App $a, array &$b)
|
||||
{
|
||||
if ($a->getCurrentTheme() == 'frio') {
|
||||
// Works in Frio.
|
||||
$doc = new DOMDocument();
|
||||
|
|
|
@ -90,15 +90,18 @@ function openstreetmap_location($a, &$item)
|
|||
$nomserver = OSM_NOM;
|
||||
}
|
||||
|
||||
if (isset($item['coord'])) {
|
||||
if (!empty($item['coord'])) {
|
||||
$coords = explode(' ', $item['coord']);
|
||||
|
||||
if (count($coords) > 1) {
|
||||
$lat = urlencode(round($coords[0], 5));
|
||||
$lon = urlencode(round($coords[1], 5));
|
||||
$target = $tmsserver;
|
||||
|
||||
if ($marker > 0) {
|
||||
$target .= '?mlat=' . $lat . '&mlon=' . $lon;
|
||||
}
|
||||
|
||||
$target .= '#map='.intval($zoom).'/'.$lat.'/'.$lon;
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +110,7 @@ function openstreetmap_location($a, &$item)
|
|||
$target = $nomserver.'?q='.urlencode($item['location']);
|
||||
}
|
||||
|
||||
if (isset($item['location'])) {
|
||||
if (!empty($item['location'])) {
|
||||
$title = $item['location'];
|
||||
} else {
|
||||
$title = $item['coord'];
|
||||
|
|
|
@ -12,19 +12,22 @@ use Friendica\Core\Addon;
|
|||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
|
||||
function pledgie_install() {
|
||||
function pledgie_install()
|
||||
{
|
||||
Addon::registerHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active');
|
||||
Addon::registerHook('addon_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings');
|
||||
Addon::registerHook('addon_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post');
|
||||
}
|
||||
|
||||
function pledgie_uninstall() {
|
||||
function pledgie_uninstall()
|
||||
{
|
||||
Addon::unregisterHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active');
|
||||
Addon::unregisterHook('addon_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings');
|
||||
Addon::unregisterHook('addon_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post');
|
||||
}
|
||||
|
||||
function pledgie_addon_settings(App $a,&$s) {
|
||||
function pledgie_addon_settings(App $a, &$s)
|
||||
{
|
||||
|
||||
if(! is_site_admin())
|
||||
return;
|
||||
|
@ -59,8 +62,8 @@ function pledgie_addon_settings(App $a,&$s) {
|
|||
return;
|
||||
}
|
||||
|
||||
function pledgie_addon_settings_post(App $a, array &$b) {
|
||||
|
||||
function pledgie_addon_settings_post(App $a, array &$b)
|
||||
{
|
||||
if(! is_site_admin())
|
||||
return;
|
||||
|
||||
|
@ -71,9 +74,11 @@ function pledgie_addon_settings_post(App $a, array &$b) {
|
|||
}
|
||||
}
|
||||
|
||||
function pledgie_active(App $a, &$b) {
|
||||
function pledgie_active(App $a, &$b)
|
||||
{
|
||||
$campaign = Config::get('pledgie-campaign','text');
|
||||
$describe = Config::get('pledgie-describe','text');
|
||||
|
||||
$b .= '<div style="position: fixed; padding:5px; border-style:dotted; border-width:1px; background-color: white; line-height: 1; bottom: 5px; left: 20px; z-index: 1000; width: 150px; font-size: 12px;">';
|
||||
$b .= $describe . '<br/><a href="https://pledgie.com/campaigns/';
|
||||
$b .= $campaign;
|
||||
|
|
|
@ -25,7 +25,8 @@ require_once 'openpgp.php';
|
|||
require_once 'openpgp_crypt_symmetric.php';
|
||||
|
||||
|
||||
function securemail_install() {
|
||||
function securemail_install()
|
||||
{
|
||||
Addon::registerHook('addon_settings', 'addon/securemail/securemail.php', 'securemail_settings');
|
||||
Addon::registerHook('addon_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post');
|
||||
|
||||
|
@ -53,7 +54,8 @@ function securemail_uninstall() {
|
|||
*
|
||||
* @see App
|
||||
*/
|
||||
function securemail_settings(App $a, &$s){
|
||||
function securemail_settings(App $a, &$s)
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
}
|
||||
|
@ -82,8 +84,8 @@ function securemail_settings(App $a, &$s){
|
|||
*
|
||||
* @see App
|
||||
*/
|
||||
function securemail_settings_post(App $a, array &$b){
|
||||
|
||||
function securemail_settings_post(App $a, array &$b)
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
}
|
||||
|
@ -146,8 +148,10 @@ function securemail_settings_post(App $a, array &$b){
|
|||
* @param array $b hook data
|
||||
*
|
||||
* @see App
|
||||
* @todo x() is deprecated, next PR
|
||||
*/
|
||||
function securemail_emailer_send_prepare(App $a, array &$b) {
|
||||
function securemail_emailer_send_prepare(App $a, array &$b)
|
||||
{
|
||||
if (!x($b, 'uid')) {
|
||||
return;
|
||||
}
|
||||
|
@ -183,7 +187,7 @@ function securemail_emailer_send_prepare(App $a, array &$b) {
|
|||
$b['htmlVersion'] = null;
|
||||
}
|
||||
|
||||
|
||||
/// @TODO Old lost code? Next PR!
|
||||
/**
|
||||
* add addon composer autoloader maps to system autoloader
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue