Rename Alias "A" to "AppR"

This commit is contained in:
nupplaPhil 2020-01-11 22:17:36 +01:00
parent c7ce4a9672
commit 03ebfb6b42
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
30 changed files with 123 additions and 123 deletions

View file

@ -11,7 +11,7 @@ use Friendica\App;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\Strings; use Friendica\Util\Strings;
function blockem_install() function blockem_install()
@ -44,7 +44,7 @@ function blockem_addon_settings (App $a, &$s)
} }
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/blockem/blockem.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/blockem/blockem.css' . '" media="all" />' . "\r\n";
$words = PConfig::get(local_user(), 'blockem', 'words'); $words = PConfig::get(local_user(), 'blockem', 'words');
@ -149,7 +149,7 @@ function blockem_prepare_body_content_filter(App $a, array &$hook_data)
function blockem_display_item(App $a, array &$b = null) function blockem_display_item(App $a, array &$b = null)
{ {
if (!empty($b['output']['body']) && strstr($b['output']['body'], 'id="blockem-wrap-')) { if (!empty($b['output']['body']) && strstr($b['output']['body'], 'id="blockem-wrap-')) {
$b['output']['thumb'] = A::baseUrl()->get() . "/images/person-80.jpg"; $b['output']['thumb'] = AppR::baseUrl()->get() . "/images/person-80.jpg";
} }
} }
@ -165,7 +165,7 @@ function blockem_conversation_start(App $a, array &$b)
$a->data['blockem'] = explode(',', $words); $a->data['blockem'] = explode(',', $words);
} }
A::page()['htmlhead'] .= <<< EOT AppR::page()['htmlhead'] .= <<< EOT
<script> <script>
function blockemBlock(author) { function blockemBlock(author) {

View file

@ -12,7 +12,7 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Util\XML; use Friendica\Util\XML;
@ -69,7 +69,7 @@ function blogger_settings(App $a, &$s)
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/blogger/blogger.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/blogger/blogger.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */

View file

@ -18,7 +18,7 @@ use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\ItemContent; use Friendica\Model\ItemContent;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Strings; use Friendica\Util\Strings;
@ -111,7 +111,7 @@ function buffer_connect(App $a)
$client_secret = Config::get('buffer','client_secret'); $client_secret = Config::get('buffer','client_secret');
// The callback URL is the script that gets called after the user authenticates with buffer // The callback URL is the script that gets called after the user authenticates with buffer
$callback_url = A::baseUrl()->get() . "/buffer/connect"; $callback_url = AppR::baseUrl()->get() . "/buffer/connect";
$buffer = new BufferApp($client_id, $client_secret, $callback_url); $buffer = new BufferApp($client_id, $client_secret, $callback_url);
@ -120,7 +120,7 @@ function buffer_connect(App $a)
} else { } else {
Logger::log("buffer_connect: authenticated"); Logger::log("buffer_connect: authenticated");
$o = L10n::t("You are now authenticated to buffer. "); $o = L10n::t("You are now authenticated to buffer. ");
$o .= '<br /><a href="' . A::baseUrl()->get() . '/settings/connectors">' . L10n::t("return to the connector page") . '</a>'; $o .= '<br /><a href="' . AppR::baseUrl()->get() . '/settings/connectors">' . L10n::t("return to the connector page") . '</a>';
PConfig::set(local_user(), 'buffer','access_token', $buffer->access_token); PConfig::set(local_user(), 'buffer','access_token', $buffer->access_token);
} }
@ -153,7 +153,7 @@ function buffer_settings(App $a, &$s)
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/buffer/buffer.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/buffer/buffer.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
@ -182,7 +182,7 @@ function buffer_settings(App $a, &$s)
if ($access_token == "") { if ($access_token == "") {
$s .= '<div id="buffer-authenticate-wrapper">'; $s .= '<div id="buffer-authenticate-wrapper">';
$s .= '<a href="' . A::baseUrl()->get() . '/buffer/connect">' . L10n::t("Authenticate your Buffer connection") . '</a>'; $s .= '<a href="' . AppR::baseUrl()->get() . '/buffer/connect">' . L10n::t("Authenticate your Buffer connection") . '</a>';
$s .= '</div><div class="clear"></div>'; $s .= '</div><div class="clear"></div>';
} else { } else {
$s .= '<div id="buffer-enable-wrapper">'; $s .= '<div id="buffer-enable-wrapper">';
@ -201,7 +201,7 @@ function buffer_settings(App $a, &$s)
$s .= '</div><div class="clear"></div>'; $s .= '</div><div class="clear"></div>';
// The callback URL is the script that gets called after the user authenticates with buffer // The callback URL is the script that gets called after the user authenticates with buffer
$callback_url = A::baseUrl()->get() . '/buffer/connect'; $callback_url = AppR::baseUrl()->get() . '/buffer/connect';
$buffer = new BufferApp($client_id, $client_secret, $callback_url, $access_token); $buffer = new BufferApp($client_id, $client_secret, $callback_url, $access_token);

View file

@ -18,7 +18,7 @@ use Friendica\Database\DBA;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Photo; use Friendica\Model\Photo;
use Friendica\Network\HTTPException\NotFoundException; use Friendica\Network\HTTPException\NotFoundException;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
define("CATAVATAR_SIZE", 256); define("CATAVATAR_SIZE", 256);
@ -85,7 +85,7 @@ function catavatar_addon_settings_post(App $a, &$s)
$seed = PConfig::get(local_user(), 'catavatar', 'seed', md5(trim(strtolower($user['email'])))); $seed = PConfig::get(local_user(), 'catavatar', 'seed', md5(trim(strtolower($user['email']))));
if (!empty($_POST['catavatar-usecat'])) { if (!empty($_POST['catavatar-usecat'])) {
$url = A::baseUrl()->get() . '/catavatar/' . local_user() . '?ts=' . time(); $url = AppR::baseUrl()->get() . '/catavatar/' . local_user() . '?ts=' . time();
$self = DBA::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]); $self = DBA::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]);
if (!DBA::isResult($self)) { if (!DBA::isResult($self)) {
@ -112,7 +112,7 @@ function catavatar_addon_settings_post(App $a, &$s)
Contact::updateSelfFromUserID(local_user(), true); Contact::updateSelfFromUserID(local_user(), true);
// Update global directory in background // Update global directory in background
$url = A::baseUrl()->get() . '/profile/' . $a->user['nickname']; $url = AppR::baseUrl()->get() . '/profile/' . $a->user['nickname'];
if ($url && strlen(Config::get('system', 'directory'))) { if ($url && strlen(Config::get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, 'Directory', $url); Worker::add(PRIORITY_LOW, 'Directory', $url);
} }
@ -141,7 +141,7 @@ function catavatar_addon_settings_post(App $a, &$s)
function catavatar_lookup(App $a, &$b) function catavatar_lookup(App $a, &$b)
{ {
$user = DBA::selectFirst('user', ['uid'], ['email' => $b['email']]); $user = DBA::selectFirst('user', ['uid'], ['email' => $b['email']]);
$url = A::baseUrl()->get() . '/catavatar/' . $user['uid']; $url = AppR::baseUrl()->get() . '/catavatar/' . $user['uid'];
switch($b['size']) { switch($b['size']) {
case 300: $url .= "/4"; break; case 300: $url .= "/4"; break;

View file

@ -12,7 +12,7 @@ use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
/** /**
* cookienotice_install * cookienotice_install
@ -91,8 +91,8 @@ function cookienotice_page_content_top(App $a, &$b)
$stylesheetPath = __DIR__ . '/cookienotice.css'; $stylesheetPath = __DIR__ . '/cookienotice.css';
$footerscriptPath = __DIR__ . '/cookienotice.js'; $footerscriptPath = __DIR__ . '/cookienotice.js';
A::page()->registerStylesheet($stylesheetPath); AppR::page()->registerStylesheet($stylesheetPath);
A::page()->registerFooterScript($footerscriptPath); AppR::page()->registerFooterScript($footerscriptPath);
} }
/** /**

View file

@ -17,7 +17,7 @@ use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\Session; use Friendica\Core\Session;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Registry\Core; use Friendica\Registry\Core;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Proxy as ProxyUtils;
@ -105,7 +105,7 @@ function curweather_network_mod_init(App $a, &$b)
return; return;
} }
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/curweather/curweather.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/curweather/curweather.css' . '" media="all" />' . "\r\n";
// $rpt value is needed for location // $rpt value is needed for location
// $lang will be taken from the browser session to honour user settings // $lang will be taken from the browser session to honour user settings
@ -162,7 +162,7 @@ function curweather_network_mod_init(App $a, &$b)
]); ]);
} }
A::page()['aside'] = $curweather . A::page()['aside']; AppR::page()['aside'] = $curweather . AppR::page()['aside'];
} }
function curweather_addon_settings_post(App $a, $post) function curweather_addon_settings_post(App $a, $post)

View file

@ -17,7 +17,7 @@ use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
function diaspora_install() function diaspora_install()
{ {
@ -65,7 +65,7 @@ function diaspora_settings(App $a, &$s)
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/diaspora/diaspora.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/diaspora/diaspora.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
@ -231,7 +231,7 @@ function diaspora_post_local(App $a, array &$b)
function diaspora_send(App $a, array &$b) function diaspora_send(App $a, array &$b)
{ {
$hostname = A::baseUrl()->getHostname(); $hostname = AppR::baseUrl()->getHostname();
Logger::log('diaspora_send: invoked'); Logger::log('diaspora_send: invoked');

View file

@ -15,7 +15,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Util\XML; use Friendica\Util\XML;
@ -64,7 +64,7 @@ function dwpost_settings(App $a, &$s)
} }
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/dwpost/dwpost.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/dwpost/dwpost.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
$enabled = PConfig::get(local_user(), 'dwpost', 'post'); $enabled = PConfig::get(local_user(), 'dwpost', 'post');

View file

@ -16,7 +16,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\Profile; use Friendica\Model\Profile;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\Strings; use Friendica\Util\Strings;
function forumdirectory_install() function forumdirectory_install()
@ -42,7 +42,7 @@ function forumdirectory_app_menu(App $a, array &$b)
function forumdirectory_init(App $a) function forumdirectory_init(App $a)
{ {
if (local_user()) { if (local_user()) {
A::page()['aside'] .= Widget::findPeople(); AppR::page()['aside'] .= Widget::findPeople();
} }
} }
@ -108,7 +108,7 @@ function forumdirectory_content(App $a)
$total = $cnt['total']; $total = $cnt['total'];
} }
$pager = new Pager(A::args()->getQueryString(), 60); $pager = new Pager(AppR::args()->getQueryString(), 60);
$order = " ORDER BY `name` ASC "; $order = " ORDER BY `name` ASC ";

View file

@ -13,7 +13,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\ConfigFileLoader; use Friendica\Util\ConfigFileLoader;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Util\XML; use Friendica\Util\XML;
@ -137,7 +137,7 @@ function geonames_addon_settings(App $a, &$s)
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
$stylesheetPath = __DIR__ . '/geonames.css'; $stylesheetPath = __DIR__ . '/geonames.css';
A::page()->registerStylesheet($stylesheetPath); AppR::page()->registerStylesheet($stylesheetPath);
/* Get the current state of our config variable */ /* Get the current state of our config variable */
$enabled = intval(PConfig::get(local_user(), 'geonames', 'enable')); $enabled = intval(PConfig::get(local_user(), 'geonames', 'enable'));

View file

@ -8,7 +8,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
function highlightjs_install() function highlightjs_install()
{ {
@ -30,11 +30,11 @@ function highlightjs_head(App $a, &$b)
$style = 'default'; $style = 'default';
} }
A::page()->registerStylesheet(__DIR__ . '/asset/styles/' . $style . '.css'); AppR::page()->registerStylesheet(__DIR__ . '/asset/styles/' . $style . '.css');
} }
function highlightjs_footer(App $a, &$b) function highlightjs_footer(App $a, &$b)
{ {
A::page()->registerFooterScript(__DIR__ . '/asset/highlight.pack.js'); AppR::page()->registerFooterScript(__DIR__ . '/asset/highlight.pack.js');
A::page()->registerFooterScript(__DIR__ . '/highlightjs.js'); AppR::page()->registerFooterScript(__DIR__ . '/highlightjs.js');
} }

View file

@ -15,7 +15,7 @@ use Friendica\Core\PConfig;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\Item; use Friendica\Model\Item;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\Strings; use Friendica\Util\Strings;
function ifttt_install() function ifttt_install()
@ -64,7 +64,7 @@ function ifttt_settings(App $a, &$s)
$s .= '<div id="ifttt-configuration-wrapper">'; $s .= '<div id="ifttt-configuration-wrapper">';
$s .= '<p>' . L10n::t('Create an account at <a href="http://www.ifttt.com">IFTTT</a>. Create three Facebook recipes that are connected with <a href="https://ifttt.com/maker">Maker</a> (In the form "if Facebook then Maker") with the following parameters:') . '</p>'; $s .= '<p>' . L10n::t('Create an account at <a href="http://www.ifttt.com">IFTTT</a>. Create three Facebook recipes that are connected with <a href="https://ifttt.com/maker">Maker</a> (In the form "if Facebook then Maker") with the following parameters:') . '</p>';
$s .= '<h4>URL</h4>'; $s .= '<h4>URL</h4>';
$s .= '<p>' . A::baseUrl()->get() . '/ifttt/' . $a->user['nickname'] . '</p>'; $s .= '<p>' . AppR::baseUrl()->get() . '/ifttt/' . $a->user['nickname'] . '</p>';
$s .= '<h4>Method</h4>'; $s .= '<h4>Method</h4>';
$s .= '<p>POST</p>'; $s .= '<p>POST</p>';
$s .= '<h4>Content Type</h4>'; $s .= '<h4>Content Type</h4>';

View file

@ -33,7 +33,7 @@ function irc_addon_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
// A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->getBaseURL() . '/addon/irc/irc.css' . '" media="all" />' . "\r\n"; // AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->getBaseURL() . '/addon/irc/irc.css' . '" media="all" />' . "\r\n";
/* setting popular channels, auto connect channels */ /* setting popular channels, auto connect channels */
$sitechats = PConfig::get( local_user(), 'irc','sitechats'); /* popular channels */ $sitechats = PConfig::get( local_user(), 'irc','sitechats'); /* popular channels */

View file

@ -71,7 +71,7 @@ use Friendica\Core\PConfig;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\Network; use Friendica\Util\Network;
function jappixmini_install() function jappixmini_install()
@ -325,10 +325,10 @@ function jappixmini_settings(App $a, &$s)
if (!$activate) { if (!$activate) {
// load scripts if not yet activated so that password can be saved // load scripts if not yet activated so that password can be saved
A::page()['htmlhead'] .= '<script type="text/javascript" src="' . A::baseUrl()->get() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;g=mini.xml"></script>' . "\r\n"; AppR::page()['htmlhead'] .= '<script type="text/javascript" src="' . AppR::baseUrl()->get() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;g=mini.xml"></script>' . "\r\n";
A::page()['htmlhead'] .= '<script type="text/javascript" src="' . A::baseUrl()->get() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=presence.js~caps.js~name.js~roster.js"></script>' . "\r\n"; AppR::page()['htmlhead'] .= '<script type="text/javascript" src="' . AppR::baseUrl()->get() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=presence.js~caps.js~name.js~roster.js"></script>' . "\r\n";
A::page()['htmlhead'] .= '<script type="text/javascript" src="' . A::baseUrl()->get() . '/addon/jappixmini/lib.js"></script>' . "\r\n"; AppR::page()['htmlhead'] .= '<script type="text/javascript" src="' . AppR::baseUrl()->get() . '/addon/jappixmini/lib.js"></script>' . "\r\n";
} }
$s .= '<span id="settings_jappixmini_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_jappixmini_expanded\'); openClose(\'settings_jappixmini_inflated\');">'; $s .= '<span id="settings_jappixmini_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_jappixmini_expanded\'); openClose(\'settings_jappixmini_inflated\');">';
@ -387,7 +387,7 @@ function jappixmini_settings(App $a, &$s)
$s .= '</div>'; $s .= '</div>';
A::page()['htmlhead'] .= "<script type=\"text/javascript\"> AppR::page()['htmlhead'] .= "<script type=\"text/javascript\">
function jappixmini_set_password() { function jappixmini_set_password() {
encrypt = document.getElementById('jappixmini-encrypt').checked; encrypt = document.getElementById('jappixmini-encrypt').checked;
password = document.getElementById('jappixmini-password'); password = document.getElementById('jappixmini-password');
@ -491,10 +491,10 @@ function jappixmini_script(App $a)
return; return;
} }
A::page()['htmlhead'] .= '<script type="text/javascript" src="' . A::baseUrl()->get() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;g=mini.xml"></script>' . "\r\n"; AppR::page()['htmlhead'] .= '<script type="text/javascript" src="' . AppR::baseUrl()->get() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;g=mini.xml"></script>' . "\r\n";
A::page()['htmlhead'] .= '<script type="text/javascript" src="' . A::baseUrl()->get() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=presence.js~caps.js~name.js~roster.js"></script>' . "\r\n"; AppR::page()['htmlhead'] .= '<script type="text/javascript" src="' . AppR::baseUrl()->get() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=presence.js~caps.js~name.js~roster.js"></script>' . "\r\n";
A::page()['htmlhead'] .= '<script type="text/javascript" src="' . A::baseUrl()->get() . '/addon/jappixmini/lib.js"></script>' . "\r\n"; AppR::page()['htmlhead'] .= '<script type="text/javascript" src="' . AppR::baseUrl()->get() . '/addon/jappixmini/lib.js"></script>' . "\r\n";
$username = PConfig::get(local_user(), 'jappixmini', 'username'); $username = PConfig::get(local_user(), 'jappixmini', 'username');
$username = str_replace("'", "\\'", $username); $username = str_replace("'", "\\'", $username);
@ -515,7 +515,7 @@ function jappixmini_script(App $a)
// set proxy if necessary // set proxy if necessary
$use_proxy = Config::get('jappixmini', 'bosh_proxy'); $use_proxy = Config::get('jappixmini', 'bosh_proxy');
if ($use_proxy) { if ($use_proxy) {
$proxy = A::baseUrl()->get() . '/addon/jappixmini/proxy.php'; $proxy = AppR::baseUrl()->get() . '/addon/jappixmini/proxy.php';
} else { } else {
$proxy = ""; $proxy = "";
} }
@ -557,7 +557,7 @@ function jappixmini_script(App $a)
} }
// add javascript to start Jappix Mini // add javascript to start Jappix Mini
A::page()['htmlhead'] .= "<script type=\"text/javascript\"> AppR::page()['htmlhead'] .= "<script type=\"text/javascript\">
jQuery(document).ready(function() { jQuery(document).ready(function() {
jappixmini_addon_start('$server', '$username', '$proxy', '$bosh', $encrypt, '$password', $nickname, $contacts_json, '$contacts_hash', $autoapprove, $autosubscribe, $groupchats); jappixmini_addon_start('$server', '$username', '$proxy', '$bosh', $encrypt, '$password', $nickname, $contacts_json, '$contacts_hash', $autoapprove, $autosubscribe, $groupchats);
}); });
@ -570,10 +570,10 @@ function jappixmini_login(App $a, &$o)
{ {
// create client secret on login to be able to encrypt jabber passwords // create client secret on login to be able to encrypt jabber passwords
// for setDB and str_sha1, needed by jappixmini_addon_set_client_secret // for setDB and str_sha1, needed by jappixmini_addon_set_client_secret
A::page()['htmlhead'] .= '<script type="text/javascript" src="' . A::baseUrl()->get() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=datastore.js~jsjac.js"></script>' . "\r\n"; AppR::page()['htmlhead'] .= '<script type="text/javascript" src="' . AppR::baseUrl()->get() . '/addon/jappixmini/jappix/php/get.php?t=js&amp;f=datastore.js~jsjac.js"></script>' . "\r\n";
// for jappixmini_addon_set_client_secret // for jappixmini_addon_set_client_secret
A::page()['htmlhead'] .= '<script type="text/javascript" src="' . A::baseUrl()->get() . '/addon/jappixmini/lib.js"></script>' . "\r\n"; AppR::page()['htmlhead'] .= '<script type="text/javascript" src="' . AppR::baseUrl()->get() . '/addon/jappixmini/lib.js"></script>' . "\r\n";
// save hash of password // save hash of password
$o = str_replace("<form ", "<form onsubmit=\"jappixmini_addon_set_client_secret(this.elements['id_password'].value);return true;\" ", $o); $o = str_replace("<form ", "<form onsubmit=\"jappixmini_addon_set_client_secret(this.elements['id_password'].value);return true;\" ", $o);
@ -701,6 +701,6 @@ function jappixmini_download_source(App $a, &$b)
{ {
// Jappix Mini source download link on About page // Jappix Mini source download link on About page
$b .= '<h1>Jappix Mini</h1>'; $b .= '<h1>Jappix Mini</h1>';
$b .= '<p>This site uses the jappixmini addon, which includes Jappix Mini by the <a href="' . A::baseUrl()->get() . '/addon/jappixmini/jappix/AUTHORS">Jappix authors</a> and is distributed under the terms of the <a href="' . A::baseUrl()->get() . '/addon/jappixmini/jappix/COPYING">GNU Affero General Public License</a>.</p>'; $b .= '<p>This site uses the jappixmini addon, which includes Jappix Mini by the <a href="' . AppR::baseUrl()->get() . '/addon/jappixmini/jappix/AUTHORS">Jappix authors</a> and is distributed under the terms of the <a href="' . AppR::baseUrl()->get() . '/addon/jappixmini/jappix/COPYING">GNU Affero General Public License</a>.</p>';
$b .= '<p>You can download the <a href="' . A::baseUrl()->get() . '/addon/jappixmini.tgz">source code of the addon</a>. The rest of Friendica is distributed under compatible licenses and can be retrieved from <a href="https://github.com/friendica/friendica">https://github.com/friendica/friendica</a> and <a href="https://github.com/friendica/friendica-addons">https://github.com/friendica/friendica-addons</a></p>'; $b .= '<p>You can download the <a href="' . AppR::baseUrl()->get() . '/addon/jappixmini.tgz">source code of the addon</a>. The rest of Friendica is distributed under compatible licenses and can be retrieved from <a href="https://github.com/friendica/friendica">https://github.com/friendica/friendica</a> and <a href="https://github.com/friendica/friendica-addons">https://github.com/friendica/friendica-addons</a></p>';
} }

View file

@ -13,7 +13,7 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
function js_upload_install() function js_upload_install()
{ {
@ -27,8 +27,8 @@ function js_upload_form(App $a, array &$b)
{ {
$b['default_upload'] = false; $b['default_upload'] = false;
A::page()->registerStylesheet('addon/js_upload/file-uploader/client/fileuploader.css'); AppR::page()->registerStylesheet('addon/js_upload/file-uploader/client/fileuploader.css');
A::page()->registerFooterScript('addon/js_upload/file-uploader/client/fileuploader.js'); AppR::page()->registerFooterScript('addon/js_upload/file-uploader/client/fileuploader.js');
$tpl = Renderer::getMarkupTemplate('js_upload.tpl', 'addon/js_upload'); $tpl = Renderer::getMarkupTemplate('js_upload.tpl', 'addon/js_upload');
$b['addon_text'] .= Renderer::replaceMacros($tpl, [ $b['addon_text'] .= Renderer::replaceMacros($tpl, [

View file

@ -13,7 +13,7 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
/* Define the hooks we want to use /* Define the hooks we want to use
* that is, we have settings, we need to save the settings and we want * that is, we have settings, we need to save the settings and we want
@ -123,7 +123,7 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data)
// Never filter own messages // Never filter own messages
// TODO: find a better way to extract this // TODO: find a better way to extract this
$logged_user_profile = A::baseUrl()->get() . '/profile/' . $a->user['nickname']; $logged_user_profile = AppR::baseUrl()->get() . '/profile/' . $a->user['nickname'];
if ($logged_user_profile == $hook_data['item']['author-link']) { if ($logged_user_profile == $hook_data['item']['author-link']) {
return; return;
} }

View file

@ -13,7 +13,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\Network; use Friendica\Util\Network;
function libertree_install() function libertree_install()
@ -62,7 +62,7 @@ function libertree_settings(&$a,&$s) {
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/libertree/libertree.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/libertree/libertree.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
@ -207,7 +207,7 @@ function libertree_send(&$a,&$b) {
$ltree_api_token = PConfig::get($b['uid'],'libertree','libertree_api_token'); $ltree_api_token = PConfig::get($b['uid'],'libertree','libertree_api_token');
$ltree_url = PConfig::get($b['uid'],'libertree','libertree_url'); $ltree_url = PConfig::get($b['uid'],'libertree','libertree_url');
$ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token"; $ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token";
$ltree_source = A::baseUrl()->getHostname(); $ltree_source = AppR::baseUrl()->getHostname();
if ($b['app'] != "") if ($b['app'] != "")
$ltree_source .= " (".$b['app'].")"; $ltree_source .= " (".$b['app'].")";

View file

@ -15,7 +15,7 @@ use Friendica\Core\Cache\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Registry\Core; use Friendica\Registry\Core;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Proxy as ProxyUtils;
@ -42,7 +42,7 @@ function mastodoncustomemojis_uninstall()
function mastodoncustomemojis_css_hook(App $a) function mastodoncustomemojis_css_hook(App $a)
{ {
A::page()['htmlhead'] .= <<<HTML AppR::page()['htmlhead'] .= <<<HTML
<!-- Style added by mastodoncustomemojis --> <!-- Style added by mastodoncustomemojis -->
<style type="text/css"> <style type="text/css">
.emoji.mastodon { .emoji.mastodon {

View file

@ -13,7 +13,7 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
function mathjax_install() function mathjax_install()
{ {
@ -65,7 +65,7 @@ function mathjax_footer(App $a, &$b)
// if the visitor of the page is not a local_user, use MathJax // if the visitor of the page is not a local_user, use MathJax
// otherwise check the users settings. // otherwise check the users settings.
if (!local_user() || PConfig::get(local_user(), 'mathjax', 'use', false)) { if (!local_user() || PConfig::get(local_user(), 'mathjax', 'use', false)) {
A::page()->registerFooterScript(__DIR__ . '/asset/MathJax.js?config=TeX-MML-AM_CHTML'); AppR::page()->registerFooterScript(__DIR__ . '/asset/MathJax.js?config=TeX-MML-AM_CHTML');
A::page()->registerFooterScript(__DIR__ . '/mathjax.js'); AppR::page()->registerFooterScript(__DIR__ . '/mathjax.js');
} }
} }

View file

@ -14,7 +14,7 @@ use Friendica\Core\Config;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\Emailer; use Friendica\Util\Emailer;
function notifyall_install() function notifyall_install()
@ -31,7 +31,7 @@ function notifyall_module() {}
function notifyall_addon_admin(App $a, &$o) function notifyall_addon_admin(App $a, &$o)
{ {
$o = '<div></div>&nbsp;&nbsp;&nbsp;&nbsp;<a href="' . A::baseUrl()->get() . '/notifyall">' . L10n::t('Send email to all members') . '</a></br/>'; $o = '<div></div>&nbsp;&nbsp;&nbsp;&nbsp;<a href="' . AppR::baseUrl()->get() . '/notifyall">' . L10n::t('Send email to all members') . '</a></br/>';
} }
@ -56,7 +56,7 @@ function notifyall_post(App $a)
} }
if (!Config::get('config', 'sender_email')) { if (!Config::get('config', 'sender_email')) {
$sender_email = 'noreply@' . A::baseUrl()->getHostname(); $sender_email = 'noreply@' . AppR::baseUrl()->getHostname();
} else { } else {
$sender_email = Config::get('config', 'sender_email'); $sender_email = Config::get('config', 'sender_email');
} }
@ -96,7 +96,7 @@ function notifyall_post(App $a)
} }
notice(L10n::t('Emails sent')); notice(L10n::t('Emails sent'));
A::baseUrl()->redirect('admin'); AppR::baseUrl()->redirect('admin');
} }
function notifyall_content(&$a) function notifyall_content(&$a)

View file

@ -13,7 +13,7 @@ use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
function pageheader_install() { function pageheader_install() {
Hook::register('page_content_top', __FILE__, 'pageheader_fetch'); Hook::register('page_content_top', __FILE__, 'pageheader_fetch');
@ -27,7 +27,7 @@ function pageheader_addon_admin(App &$a, &$s)
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
$stylesheetPath = __DIR__ . '/pageheader.css'; $stylesheetPath = __DIR__ . '/pageheader.css';
A::page()->registerStylesheet($stylesheetPath); AppR::page()->registerStylesheet($stylesheetPath);
$words = Config::get('pageheader','text'); $words = Config::get('pageheader','text');
if(! $words) if(! $words)
@ -66,7 +66,7 @@ function pageheader_fetch(App $a, &$b)
} }
$stylesheetPath = __DIR__ .'/pageheader.css'; $stylesheetPath = __DIR__ .'/pageheader.css';
A::page()->registerStylesheet($stylesheetPath); AppR::page()->registerStylesheet($stylesheetPath);
if ($s) { if ($s) {
$b .= '<div class="pageheader">' . $s . '</div>'; $b .= '<div class="pageheader">' . $s . '</div>';

View file

@ -14,7 +14,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\ConfigFileLoader; use Friendica\Util\ConfigFileLoader;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings; use Friendica\Util\Strings;
@ -75,8 +75,8 @@ function public_server_cron($a, $b)
'to_name' => $rr['username'], 'to_name' => $rr['username'],
'to_email' => $rr['email'], 'to_email' => $rr['email'],
'source_name' => L10n::t('Administrator'), 'source_name' => L10n::t('Administrator'),
'source_link' => A::baseUrl()->get(), 'source_link' => AppR::baseUrl()->get(),
'source_photo' => A::baseUrl()->get() . '/images/person-80.jpg', 'source_photo' => AppR::baseUrl()->get() . '/images/person-80.jpg',
]); ]);
$fields = ['expire_notification_sent' => DateTimeFormat::utcNow()]; $fields = ['expire_notification_sent' => DateTimeFormat::utcNow()];
@ -127,7 +127,7 @@ function public_server_enotify(&$a, &$b)
{ {
if (!empty($b['params']) && $b['params']['type'] == NOTIFY_SYSTEM if (!empty($b['params']) && $b['params']['type'] == NOTIFY_SYSTEM
&& !empty($b['params']['system_type']) && $b['params']['system_type'] === 'public_server_expire') { && !empty($b['params']['system_type']) && $b['params']['system_type'] === 'public_server_expire') {
$b['itemlink'] = A::baseUrl()->get(); $b['itemlink'] = AppR::baseUrl()->get();
$b['epreamble'] = $b['preamble'] = L10n::t('Your account on %s will expire in a few days.', Config::get('system', 'sitename')); $b['epreamble'] = $b['preamble'] = L10n::t('Your account on %s will expire in a few days.', Config::get('system', 'sitename'));
$b['subject'] = L10n::t('Your Friendica account is about to expire.'); $b['subject'] = L10n::t('Your Friendica account is about to expire.');
$b['body'] = L10n::t("Hi %1\$s,\n\nYour account on %2\$s will expire in less than five days. You may keep your account by logging in at least once every 30 days", $b['params']['to_name'], "[url=" . Config::get('system', 'url') . "]" . Config::get('config', 'sitename') . "[/url]"); $b['body'] = L10n::t("Hi %1\$s,\n\nYour account on %2\$s will expire in less than five days. You may keep your account by logging in at least once every 30 days", $b['params']['to_name'], "[url=" . Config::get('system', 'url') . "]" . Config::get('config', 'sitename') . "[/url]");

View file

@ -23,7 +23,7 @@ use Friendica\Model\Item;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Protocol\Activity; use Friendica\Protocol\Activity;
use Friendica\Protocol\ActivityNamespace; use Friendica\Protocol\ActivityNamespace;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\ConfigFileLoader; use Friendica\Util\ConfigFileLoader;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network; use Friendica\Util\Network;
@ -106,7 +106,7 @@ function pumpio_registerclient(App $a, $host)
$application_name = Config::get('pumpio', 'application_name'); $application_name = Config::get('pumpio', 'application_name');
if ($application_name == "") { if ($application_name == "") {
$application_name = A::baseUrl()->getHostname(); $application_name = AppR::baseUrl()->getHostname();
} }
$adminlist = explode(",", str_replace(" ", "", Config::get('config', 'admin_email'))); $adminlist = explode(",", str_replace(" ", "", Config::get('config', 'admin_email')));
@ -115,8 +115,8 @@ function pumpio_registerclient(App $a, $host)
$params["contacts"] = $adminlist[0]; $params["contacts"] = $adminlist[0];
$params["application_type"] = "native"; $params["application_type"] = "native";
$params["application_name"] = $application_name; $params["application_name"] = $application_name;
$params["logo_url"] = A::baseUrl()->get() . "/images/friendica-256.png"; $params["logo_url"] = AppR::baseUrl()->get() . "/images/friendica-256.png";
$params["redirect_uris"] = A::baseUrl()->get() . "/pumpio/connect"; $params["redirect_uris"] = AppR::baseUrl()->get() . "/pumpio/connect";
Logger::log("pumpio_registerclient: ".$url." parameters ".print_r($params, true), Logger::DEBUG); Logger::log("pumpio_registerclient: ".$url." parameters ".print_r($params, true), Logger::DEBUG);
@ -167,7 +167,7 @@ function pumpio_connect(App $a)
} }
// The callback URL is the script that gets called after the user authenticates with pumpio // The callback URL is the script that gets called after the user authenticates with pumpio
$callback_url = A::baseUrl()->get() . "/pumpio/connect"; $callback_url = AppR::baseUrl()->get() . "/pumpio/connect";
// Let's begin. First we need a Request Token. The request token is required to send the user // Let's begin. First we need a Request Token. The request token is required to send the user
// to pumpio's login page. // to pumpio's login page.
@ -204,7 +204,7 @@ function pumpio_connect(App $a)
if ($success) { if ($success) {
Logger::log("pumpio_connect: authenticated"); Logger::log("pumpio_connect: authenticated");
$o = L10n::t("You are now authenticated to pumpio."); $o = L10n::t("You are now authenticated to pumpio.");
$o .= '<br /><a href="' . A::baseUrl()->get() . '/settings/connectors">' . L10n::t("return to the connector page") . '</a>'; $o .= '<br /><a href="' . AppR::baseUrl()->get() . '/settings/connectors">' . L10n::t("return to the connector page") . '</a>';
} else { } else {
Logger::log("pumpio_connect: could not connect"); Logger::log("pumpio_connect: could not connect");
$o = 'Could not connect to pumpio. Refresh the page or try again later.'; $o = 'Could not connect to pumpio. Refresh the page or try again later.';
@ -239,7 +239,7 @@ function pumpio_settings(App $a, &$s)
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/pumpio/pumpio.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/pumpio/pumpio.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
@ -289,7 +289,7 @@ function pumpio_settings(App $a, &$s)
$s .= '<div id="pumpio-password-wrapper">'; $s .= '<div id="pumpio-password-wrapper">';
if (($oauth_token == "") || ($oauth_token_secret == "")) { if (($oauth_token == "") || ($oauth_token_secret == "")) {
$s .= '<div id="pumpio-authenticate-wrapper">'; $s .= '<div id="pumpio-authenticate-wrapper">';
$s .= '<a href="' . A::baseUrl()->get() . '/pumpio/connect">' . L10n::t("Authenticate your pump.io connection") . '</a>'; $s .= '<a href="' . AppR::baseUrl()->get() . '/pumpio/connect">' . L10n::t("Authenticate your pump.io connection") . '</a>';
$s .= '</div><div class="clear"></div>'; $s .= '</div><div class="clear"></div>';
} else { } else {
$s .= '<div id="pumpio-import-wrapper">'; $s .= '<div id="pumpio-import-wrapper">';
@ -773,7 +773,7 @@ function pumpio_fetchtimeline(App $a, $uid)
$application_name = Config::get('pumpio', 'application_name'); $application_name = Config::get('pumpio', 'application_name');
} }
if ($application_name == "") { if ($application_name == "") {
$application_name = A::baseUrl()->getHostname(); $application_name = AppR::baseUrl()->getHostname();
} }
$first_time = ($lastdate == ""); $first_time = ($lastdate == "");

View file

@ -13,7 +13,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\Emailer; use Friendica\Util\Emailer;
require_once __DIR__ . '/vendor/autoload.php'; require_once __DIR__ . '/vendor/autoload.php';
@ -93,7 +93,7 @@ function securemail_settings_post(App &$a, array &$b)
if ($_POST['securemail-submit'] == L10n::t('Save and send test')) { if ($_POST['securemail-submit'] == L10n::t('Save and send test')) {
$sitename = Config::get('config', 'sitename'); $sitename = Config::get('config', 'sitename');
$hostname = A::baseUrl()->getHostname(); $hostname = AppR::baseUrl()->getHostname();
if (strpos($hostname, ':')) { if (strpos($hostname, ':')) {
$hostname = substr($hostname, 0, strpos($hostname, ':')); $hostname = substr($hostname, 0, strpos($hostname, ':'));
} }

View file

@ -57,7 +57,7 @@ use Friendica\Model\ItemContent;
use Friendica\Model\Photo; use Friendica\Model\Photo;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Protocol\Activity; use Friendica\Protocol\Activity;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Util\Strings; use Friendica\Util\Strings;
@ -168,7 +168,7 @@ function statusnet_settings_post(App $a, $post)
} }
} }
} }
A::baseUrl()->redirect('settings/connectors'); AppR::baseUrl()->redirect('settings/connectors');
} else { } else {
if (isset($_POST['statusnet-consumersecret'])) { if (isset($_POST['statusnet-consumersecret'])) {
// check if we can reach the API of the GNU Social server // check if we can reach the API of the GNU Social server
@ -196,7 +196,7 @@ function statusnet_settings_post(App $a, $post)
notice(L10n::t('We could not contact the GNU Social API with the Path you entered.') . EOL); notice(L10n::t('We could not contact the GNU Social API with the Path you entered.') . EOL);
} }
} }
A::baseUrl()->redirect('settings/connectors'); AppR::baseUrl()->redirect('settings/connectors');
} else { } else {
if (isset($_POST['statusnet-pin'])) { if (isset($_POST['statusnet-pin'])) {
// if the user supplied us with a PIN from GNU Social, let the magic of OAuth happen // if the user supplied us with a PIN from GNU Social, let the magic of OAuth happen
@ -214,7 +214,7 @@ function statusnet_settings_post(App $a, $post)
PConfig::set(local_user(), 'statusnet', 'post', 1); PConfig::set(local_user(), 'statusnet', 'post', 1);
PConfig::set(local_user(), 'statusnet', 'post_taglinks', 1); PConfig::set(local_user(), 'statusnet', 'post_taglinks', 1);
// reload the Addon Settings page, if we don't do it see Bug #42 // reload the Addon Settings page, if we don't do it see Bug #42
A::baseUrl()->redirect('settings/connectors'); AppR::baseUrl()->redirect('settings/connectors');
} else { } else {
// if no PIN is supplied in the POST variables, the user has changed the setting // if no PIN is supplied in the POST variables, the user has changed the setting
// to post a dent for every new __public__ posting to the wall // to post a dent for every new __public__ posting to the wall
@ -239,7 +239,7 @@ function statusnet_settings(App $a, &$s)
if (!local_user()) { if (!local_user()) {
return; return;
} }
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/statusnet/statusnet.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/statusnet/statusnet.css' . '" media="all" />' . "\r\n";
/* * * /* * *
* 1) Check that we have a base api url and a consumer key & secret * 1) Check that we have a base api url and a consumer key & secret
* 2) If no OAuthtoken & stuff is present, generate button to get some * 2) If no OAuthtoken & stuff is present, generate button to get some
@ -736,7 +736,7 @@ function statusnet_prepare_body(App $a, &$b)
} }
$item = $b["item"]; $item = $b["item"];
$item["plink"] = A::baseUrl()->get() . "/display/" . $item["guid"]; $item["plink"] = AppR::baseUrl()->get() . "/display/" . $item["guid"];
$condition = ['uri' => $item["thr-parent"], 'uid' => local_user()]; $condition = ['uri' => $item["thr-parent"], 'uid' => local_user()];
$orig_post = Item::selectFirst(['author-link', 'uri'], $condition); $orig_post = Item::selectFirst(['author-link', 'uri'], $condition);
@ -838,7 +838,7 @@ function statusnet_fetchtimeline(App $a, $uid)
$application_name = Config::get('statusnet', 'application_name'); $application_name = Config::get('statusnet', 'application_name');
} }
if ($application_name == "") { if ($application_name == "") {
$application_name = A::baseUrl()->getHostname(); $application_name = AppR::baseUrl()->getHostname();
} }
$connection = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret); $connection = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret);
@ -1529,7 +1529,7 @@ function statusnet_convertmsg(App $a, $body, $no_tags = false)
if ($mtch[1] == "#") { if ($mtch[1] == "#") {
// Replacing the hash tags that are directed to the GNU Social server with internal links // Replacing the hash tags that are directed to the GNU Social server with internal links
$snhash = "#[url=" . $mtch[2] . "]" . $mtch[3] . "[/url]"; $snhash = "#[url=" . $mtch[2] . "]" . $mtch[3] . "[/url]";
$frdchash = '#[url=' . A::baseUrl()->get() . '/search?tag=' . $mtch[3] . ']' . $mtch[3] . '[/url]'; $frdchash = '#[url=' . AppR::baseUrl()->get() . '/search?tag=' . $mtch[3] . ']' . $mtch[3] . '[/url]';
$body = str_replace($snhash, $frdchash, $body); $body = str_replace($snhash, $frdchash, $body);
$str_tags .= $frdchash; $str_tags .= $frdchash;

View file

@ -13,7 +13,7 @@ use Friendica\Core\L10n;
use Friendica\Core\Search; use Friendica\Core\Search;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\ConfigFileLoader; use Friendica\Util\ConfigFileLoader;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
@ -77,8 +77,8 @@ function testdrive_cron($a,$b) {
'to_name' => $rr['username'], 'to_name' => $rr['username'],
'to_email' => $rr['email'], 'to_email' => $rr['email'],
'source_name' => L10n::t('Administrator'), 'source_name' => L10n::t('Administrator'),
'source_link' => A::baseUrl()->get(), 'source_link' => AppR::baseUrl()->get(),
'source_photo' => A::baseUrl()->get() . '/images/person-80.jpg', 'source_photo' => AppR::baseUrl()->get() . '/images/person-80.jpg',
]); ]);
q("update user set expire_notification_sent = '%s' where uid = %d", q("update user set expire_notification_sent = '%s' where uid = %d",
@ -100,7 +100,7 @@ function testdrive_cron($a,$b) {
function testdrive_enotify(&$a, &$b) { function testdrive_enotify(&$a, &$b) {
if (!empty($b['params']) && $b['params']['type'] == NOTIFY_SYSTEM if (!empty($b['params']) && $b['params']['type'] == NOTIFY_SYSTEM
&& !empty($b['params']['system_type']) && $b['params']['system_type'] === 'testdrive_expire') { && !empty($b['params']['system_type']) && $b['params']['system_type'] === 'testdrive_expire') {
$b['itemlink'] = A::baseUrl()->get(); $b['itemlink'] = AppR::baseUrl()->get();
$b['epreamble'] = $b['preamble'] = L10n::t('Your account on %s will expire in a few days.', Config::get('system', 'sitename')); $b['epreamble'] = $b['preamble'] = L10n::t('Your account on %s will expire in a few days.', Config::get('system', 'sitename'));
$b['subject'] = L10n::t('Your Friendica test account is about to expire.'); $b['subject'] = L10n::t('Your Friendica test account is about to expire.');
$b['body'] = L10n::t("Hi %1\$s,\n\nYour test account on %2\$s will expire in less than five days. We hope you enjoyed this test drive and use this opportunity to find a permanent Friendica website for your integrated social communications. A list of public sites is available at %s/siteinfo - and for more information on setting up your own Friendica server please see the Friendica project website at https://friendi.ca.", $b['params']['to_name'], "[url=".Config::get('system', 'url')."]".Config::get('config', 'sitename')."[/url]", Search::getGlobalDirectory()); $b['body'] = L10n::t("Hi %1\$s,\n\nYour test account on %2\$s will expire in less than five days. We hope you enjoyed this test drive and use this opportunity to find a permanent Friendica website for your integrated social communications. A list of public sites is available at %s/siteinfo - and for more information on setting up your own Friendica server please see the Friendica project website at https://friendi.ca.", $b['params']['to_name'], "[url=".Config::get('system', 'url')."]".Config::get('config', 'sitename')."[/url]", Search::getGlobalDirectory());

View file

@ -18,7 +18,7 @@ use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\Strings; use Friendica\Util\Strings;
function tumblr_install() function tumblr_install()
@ -110,7 +110,7 @@ function tumblr_connect(App $a)
// The callback URL is the script that gets called after the user authenticates with tumblr // The callback URL is the script that gets called after the user authenticates with tumblr
// In this example, it would be the included callback.php // In this example, it would be the included callback.php
$callback_url = A::baseUrl()->get() . "/tumblr/callback"; $callback_url = AppR::baseUrl()->get() . "/tumblr/callback";
// Let's begin. First we need a Request Token. The request token is required to send the user // Let's begin. First we need a Request Token. The request token is required to send the user
// to Tumblr's login page. // to Tumblr's login page.
@ -189,7 +189,7 @@ function tumblr_callback(App $a)
PConfig::set(local_user(), "tumblr", "oauth_token_secret", $access_token['oauth_token_secret']); PConfig::set(local_user(), "tumblr", "oauth_token_secret", $access_token['oauth_token_secret']);
$o = L10n::t("You are now authenticated to tumblr."); $o = L10n::t("You are now authenticated to tumblr.");
$o .= '<br /><a href="' . A::baseUrl()->get() . '/settings/connectors">' . L10n::t("return to the connector page") . '</a>'; $o .= '<br /><a href="' . AppR::baseUrl()->get() . '/settings/connectors">' . L10n::t("return to the connector page") . '</a>';
return $o; return $o;
} }
@ -220,7 +220,7 @@ function tumblr_settings(App $a, &$s)
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/tumblr/tumblr.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/tumblr/tumblr.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
@ -243,7 +243,7 @@ function tumblr_settings(App $a, &$s)
$s .= '</span>'; $s .= '</span>';
$s .= '<div id="tumblr-username-wrapper">'; $s .= '<div id="tumblr-username-wrapper">';
$s .= '<a href="' . A::baseUrl()->get() . '/tumblr/connect">' . L10n::t("(Re-)Authenticate your tumblr page") . '</a>'; $s .= '<a href="' . AppR::baseUrl()->get() . '/tumblr/connect">' . L10n::t("(Re-)Authenticate your tumblr page") . '</a>';
$s .= '</div><div class="clear"></div>'; $s .= '</div><div class="clear"></div>';
$s .= '<div id="tumblr-enable-wrapper">'; $s .= '<div id="tumblr-enable-wrapper">';

View file

@ -85,7 +85,7 @@ use Friendica\Model\Item;
use Friendica\Model\ItemContent; use Friendica\Model\ItemContent;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Protocol\Activity; use Friendica\Protocol\Activity;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\ConfigFileLoader; use Friendica\Util\ConfigFileLoader;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Images; use Friendica\Util\Images;
@ -264,7 +264,7 @@ function twitter_settings_post(App $a)
info($e->getMessage()); info($e->getMessage());
} }
// reload the Addon Settings page, if we don't do it see Bug #42 // reload the Addon Settings page, if we don't do it see Bug #42
A::baseUrl()->redirect('settings/connectors'); AppR::baseUrl()->redirect('settings/connectors');
} else { } else {
// if no PIN is supplied in the POST variables, the user has changed the setting // if no PIN is supplied in the POST variables, the user has changed the setting
// to post a tweet for every new __public__ posting to the wall // to post a tweet for every new __public__ posting to the wall
@ -288,7 +288,7 @@ function twitter_settings(App $a, &$s)
if (!local_user()) { if (!local_user()) {
return; return;
} }
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/twitter/twitter.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/twitter/twitter.css' . '" media="all" />' . "\r\n";
/* * * /* * *
* 1) Check that we have global consumer key & secret * 1) Check that we have global consumer key & secret
* 2) If no OAuthtoken & stuff is present, generate button to get some * 2) If no OAuthtoken & stuff is present, generate button to get some
@ -839,7 +839,7 @@ function twitter_prepare_body(App $a, array &$b)
if ($b["preview"]) { if ($b["preview"]) {
$max_char = 280; $max_char = 280;
$item = $b["item"]; $item = $b["item"];
$item["plink"] = A::baseUrl()->get() . "/display/" . $item["guid"]; $item["plink"] = AppR::baseUrl()->get() . "/display/" . $item["guid"];
$condition = ['uri' => $item["thr-parent"], 'uid' => local_user()]; $condition = ['uri' => $item["thr-parent"], 'uid' => local_user()];
$orig_post = Item::selectFirst(['author-link'], $condition); $orig_post = Item::selectFirst(['author-link'], $condition);
@ -940,7 +940,7 @@ function twitter_fetchtimeline(App $a, $uid)
$application_name = Config::get('twitter', 'application_name'); $application_name = Config::get('twitter', 'application_name');
if ($application_name == "") { if ($application_name == "") {
$application_name = A::baseUrl()->getHostname(); $application_name = AppR::baseUrl()->getHostname();
} }
$has_picture = false; $has_picture = false;
@ -1146,7 +1146,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
$tags_arr = []; $tags_arr = [];
foreach ($item->entities->hashtags AS $hashtag) { foreach ($item->entities->hashtags AS $hashtag) {
$url = '#[url=' . A::baseUrl()->get() . '/search?tag=' . $hashtag->text . ']' . $hashtag->text . '[/url]'; $url = '#[url=' . AppR::baseUrl()->get() . '/search?tag=' . $hashtag->text . ']' . $hashtag->text . '[/url]';
$tags_arr['#' . $hashtag->text] = $url; $tags_arr['#' . $hashtag->text] = $url;
$body = str_replace('#' . $hashtag->text, $url, $body); $body = str_replace('#' . $hashtag->text, $url, $body);
} }
@ -1279,7 +1279,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
} }
$basetag = str_replace('_', ' ', substr($tag, 1)); $basetag = str_replace('_', ' ', substr($tag, 1));
$url = '#[url=' . A::baseUrl()->get() . '/search?tag=' . $basetag . ']' . $basetag . '[/url]'; $url = '#[url=' . AppR::baseUrl()->get() . '/search?tag=' . $basetag . ']' . $basetag . '[/url]';
$body = str_replace($tag, $url, $body); $body = str_replace($tag, $url, $body);
$tags_arr['#' . $basetag] = $url; $tags_arr['#' . $basetag] = $url;
} elseif (strpos($tag, '@') === 0) { } elseif (strpos($tag, '@') === 0) {
@ -1633,7 +1633,7 @@ function twitter_fetchhometimeline(App $a, $uid)
$application_name = Config::get('twitter', 'application_name'); $application_name = Config::get('twitter', 'application_name');
if ($application_name == "") { if ($application_name == "") {
$application_name = A::baseUrl()->getHostname(); $application_name = AppR::baseUrl()->getHostname();
} }
$connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret); $connection = new TwitterOAuth($ckey, $csecret, $otoken, $osecret);

View file

@ -36,7 +36,7 @@ use Friendica\Core\PConfig;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\Item; use Friendica\Model\Item;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Registry\Core; use Friendica\Registry\Core;
function windowsphonepush_install() function windowsphonepush_install()
@ -108,7 +108,7 @@ function windowsphonepush_settings(&$a, &$s)
} }
/* Add our stylesheet to the page so we can make our settings look nice */ /* Add our stylesheet to the page so we can make our settings look nice */
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/windowsphonepush/windowsphonepush.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/windowsphonepush/windowsphonepush.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */
$enabled = PConfig::get(local_user(), 'windowsphonepush', 'enable'); $enabled = PConfig::get(local_user(), 'windowsphonepush', 'enable');

View file

@ -13,7 +13,7 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Registry\App as A; use Friendica\Registry\App as AppR;
use Friendica\Util\Strings; use Friendica\Util\Strings;
function xmpp_install() function xmpp_install()
@ -53,7 +53,7 @@ function xmpp_addon_settings(App $a, &$s)
/* Add our stylesheet to the xmpp so we can make our settings look nice */ /* Add our stylesheet to the xmpp so we can make our settings look nice */
A::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . A::baseUrl()->get() . '/addon/xmpp/xmpp.css' . '" media="all" />' . "\r\n"; AppR::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . AppR::baseUrl()->get() . '/addon/xmpp/xmpp.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */
@ -143,7 +143,7 @@ function xmpp_converse(App $a)
return; return;
} }
if (A::mode()->isMobile() || A::mode()->isMobile()) { if (AppR::mode()->isMobile() || AppR::mode()->isMobile()) {
return; return;
} }
@ -151,12 +151,12 @@ function xmpp_converse(App $a)
return; return;
} }
if (in_array(A::args()->getQueryString(), ["admin/federation/"])) { if (in_array(AppR::args()->getQueryString(), ["admin/federation/"])) {
return; return;
} }
A::page()['htmlhead'] .= '<link type="text/css" rel="stylesheet" media="screen" href="addon/xmpp/converse/css/converse.css" />' . "\n"; AppR::page()['htmlhead'] .= '<link type="text/css" rel="stylesheet" media="screen" href="addon/xmpp/converse/css/converse.css" />' . "\n";
A::page()['htmlhead'] .= '<script src="addon/xmpp/converse/builds/converse.min.js"></script>' . "\n"; AppR::page()['htmlhead'] .= '<script src="addon/xmpp/converse/builds/converse.min.js"></script>' . "\n";
if (Config::get("xmpp", "central_userbase") && !PConfig::get(local_user(), "xmpp", "individual")) { if (Config::get("xmpp", "central_userbase") && !PConfig::get(local_user(), "xmpp", "individual")) {
$bosh_proxy = Config::get("xmpp", "bosh_proxy"); $bosh_proxy = Config::get("xmpp", "bosh_proxy");
@ -168,7 +168,7 @@ function xmpp_converse(App $a)
PConfig::set(local_user(), "xmpp", "password", $password); PConfig::set(local_user(), "xmpp", "password", $password);
} }
$jid = $a->user["nickname"] . "@" . A::baseUrl()->getHostname() . "/converse-" . Strings::getRandomHex(5); $jid = $a->user["nickname"] . "@" . AppR::baseUrl()->getHostname() . "/converse-" . Strings::getRandomHex(5);
$auto_login = "auto_login: true, $auto_login = "auto_login: true,
authentication: 'login', authentication: 'login',
@ -216,7 +216,7 @@ function xmpp_converse(App $a)
xhr_user_search: false xhr_user_search: false
});\n"; });\n";
A::page()['htmlhead'] .= "<script> AppR::page()['htmlhead'] .= "<script>
require(['converse'], function (converse) { require(['converse'], function (converse) {
$initialize $initialize
converse.listen.on('ready', function (event) { converse.listen.on('ready', function (event) {