[various] Replace remaining $a->page by DI::page()

This commit is contained in:
Hypolite Petovan 2019-12-30 15:53:43 -05:00
parent b351fabb4f
commit d3717045f7
27 changed files with 394 additions and 393 deletions

View file

@ -6,6 +6,7 @@
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike> * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
*/ */
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\DI;
function calc_install() { function calc_install() {
Hook::register('app_menu', 'addon/calc/calc.php', 'calc_app_menu'); Hook::register('app_menu', 'addon/calc/calc.php', 'calc_app_menu');
@ -284,7 +285,7 @@ id.value = ""
</script> </script>
EOT; EOT;
$a->page['htmlhead'] .= $x; DI::page()['htmlhead'] .= $x;
} }
function calc_content($app) { function calc_content($app) {

View file

@ -49,7 +49,7 @@ function fromapp_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="' . DI::baseUrl()->get() . '/addon/fromapp/fromapp.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/fromapp/fromapp.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */

View file

@ -70,7 +70,7 @@ function gnot_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="' . DI::baseUrl()->get() . '/addon/gnot/gnot.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/gnot/gnot.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */

View file

@ -65,7 +65,7 @@ function group_text_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="' . DI::baseUrl()->get() . '/addon/group_text/group_text.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/group_text/group_text.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */

View file

@ -62,7 +62,7 @@ function ijpost_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="' . DI::baseUrl()->get() . '/addon/ijpost/ijpost.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/ijpost/ijpost.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */

View file

@ -47,7 +47,7 @@ function impressum_footer($a, &$b) {
$text = ProxyUtils::proxifyHtml(BBCode::convert(Config::get('impressum','footer_text'))); $text = ProxyUtils::proxifyHtml(BBCode::convert(Config::get('impressum','footer_text')));
if (! $text == '') { if (! $text == '') {
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.DI::baseUrl()->get().'/addon/impressum/impressum.css" media="all" />'; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.DI::baseUrl()->get().'/addon/impressum/impressum.css" media="all" />';
$b .= '<div class="clear"></div>'; $b .= '<div class="clear"></div>';
$b .= '<div id="impressum_footer">'.$text.'</div>'; $b .= '<div id="impressum_footer">'.$text.'</div>';
} }

View file

@ -36,7 +36,7 @@ function infiniteimprobabilitydrive_content(&$a)
$baseurl = DI::baseUrl()->get() . '/addon/infiniteimprobabilitydrive'; $baseurl = DI::baseUrl()->get() . '/addon/infiniteimprobabilitydrive';
$o = ''; $o = '';
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.DI::baseUrl()->get().'/addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.css"/>'; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.DI::baseUrl()->get().'/addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.css"/>';
$baseurl = DI::baseUrl()->get(); $baseurl = DI::baseUrl()->get();

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"; // DI::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 */
@ -98,11 +98,11 @@ function irc_content(&$a) {
$chats = ['friendica','chat','chatback','hottub','ircbar','dateroom','debian']; $chats = ['friendica','chat','chatback','hottub','ircbar','dateroom','debian'];
$a->page['aside'] .= '<div class="widget"><h3>' . L10n::t('Popular Channels') . '</h3><ul>'; DI::page()['aside'] .= '<div class="widget"><h3>' . L10n::t('Popular Channels') . '</h3><ul>';
foreach($chats as $chat) { foreach($chats as $chat) {
$a->page['aside'] .= '<li><a href="' . DI::baseUrl()->get() . '/irc?channels=' . $chat . '" >' . '#' . $chat . '</a></li>'; DI::page()['aside'] .= '<li><a href="' . DI::baseUrl()->get() . '/irc?channels=' . $chat . '" >' . '#' . $chat . '</a></li>';
} }
$a->page['aside'] .= '</ul></div>'; DI::page()['aside'] .= '</ul></div>';
/* setting the channel(s) to auto connect */ /* setting the channel(s) to auto connect */
if (local_user()) { if (local_user()) {

View file

@ -143,7 +143,7 @@ function krynn_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="' . DI::baseUrl()->get() . '/addon/krynn/krynn.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/krynn/krynn.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */

View file

@ -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="' . DI::baseUrl()->get() . '/addon/libertree/libertree.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::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 */

View file

@ -62,7 +62,7 @@ function ljpost_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="' . DI::baseUrl()->get() . '/addon/ljpost/ljpost.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/ljpost/ljpost.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */

View file

@ -50,7 +50,7 @@ function newmemberwidget_network_mod_init ($a, $b)
} }
$t .= '</div><div class="clear"></div>'; $t .= '</div><div class="clear"></div>';
$a->page['aside'] = $t . $a->page['aside']; DI::page()['aside'] = $t . DI::page()['aside'];
} }
function newmemberwidget_addon_admin_post(&$a) function newmemberwidget_addon_admin_post(&$a)

View file

@ -42,7 +42,7 @@ function notimeline_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="' . DI::baseUrl()->get() . '/addon/notimeline/notimeline.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/notimeline/notimeline.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */

View file

@ -66,7 +66,7 @@ function nsfw_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="' . DI::baseUrl()->get() . '/addon/nsfw/nsfw.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/nsfw/nsfw.css' . '" media="all" />' . "\r\n";
$enable_checked = (intval(PConfig::get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" '); $enable_checked = (intval(PConfig::get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" ');
$words = PConfig::get(local_user(), 'nsfw', 'words'); $words = PConfig::get(local_user(), 'nsfw', 'words');

View file

@ -60,7 +60,7 @@ function numfriends_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="' . DI::baseUrl()->get() . '/addon/numfriends/numfriends.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/numfriends/numfriends.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */

View file

@ -57,7 +57,7 @@ function openstreetmap_load_config(\Friendica\App $a, ConfigFileLoader $loader)
function openstreetmap_alterheader($a, &$navHtml) function openstreetmap_alterheader($a, &$navHtml)
{ {
$addScriptTag = '<script type="text/javascript" src="' . DI::baseUrl()->get() . '/addon/openstreetmap/openstreetmap.js"></script>' . "\r\n"; $addScriptTag = '<script type="text/javascript" src="' . DI::baseUrl()->get() . '/addon/openstreetmap/openstreetmap.js"></script>' . "\r\n";
$a->page['htmlhead'] .= $addScriptTag; DI::page()['htmlhead'] .= $addScriptTag;
} }
/** /**

View file

@ -66,7 +66,7 @@ function piwik_analytics($a,&$b) {
* associated CSS file. We just have to tell Friendica to get it * associated CSS file. We just have to tell Friendica to get it
* into the page header. * into the page header.
*/ */
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/piwik/piwik.css' . '" media="all" />'; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/piwik/piwik.css' . '" media="all" />';
/* /*
* Get the configuration variables from the config/addon.config.php file. * Get the configuration variables from the config/addon.config.php file.

View file

@ -140,7 +140,7 @@ function planets_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="' . DI::baseUrl()->get() . '/addon/planets/planets.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/planets/planets.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */

View file

@ -43,7 +43,7 @@ function qcomment_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="' . DI::baseUrl()->get() . '/addon/qcomment/qcomment.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/qcomment/qcomment.css' . '" media="all" />' . "\r\n";
$words = PConfig::get(local_user(), 'qcomment', 'words', L10n::t(':-)') . "\n" . L10n::t(':-(') . "\n" . L10n::t('lol')); $words = PConfig::get(local_user(), 'qcomment', 'words', L10n::t(':-)') . "\n" . L10n::t(':-(') . "\n" . L10n::t('lol'));

View file

@ -159,7 +159,7 @@ function randplace_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="' . DI::baseUrl()->get() . '/addon/randplace/randplace.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/randplace/randplace.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */

View file

@ -39,7 +39,7 @@ function remote_permissions_settings(&$a,&$o) {
/* 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="' . DI::baseUrl()->get() . '/addon/remote_permissions/settings.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/remote_permissions/settings.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */

View file

@ -35,7 +35,7 @@ function showmore_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="'.DI::baseUrl()->get().'/addon/showmore/showmore.css'.'" media="all"/>'."\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="'.DI::baseUrl()->get().'/addon/showmore/showmore.css'.'" media="all"/>'."\r\n";
$enable_checked = (intval(PConfig::get(local_user(), 'showmore', 'disable')) ? '' : ' checked="checked"'); $enable_checked = (intval(PConfig::get(local_user(), 'showmore', 'disable')) ? '' : ' checked="checked"');
$chars = PConfig::get(local_user(), 'showmore', 'chars', 1100); $chars = PConfig::get(local_user(), 'showmore', 'chars', 1100);

View file

@ -72,7 +72,7 @@ function startpage_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="' . DI::baseUrl()->get() . '/addon/startpage/startpage.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/startpage/startpage.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variable */ /* Get the current state of our config variable */

View file

@ -38,7 +38,7 @@ function superblock_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="' . DI::baseUrl()->get() . '/addon/superblock/superblock.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/superblock/superblock.css' . '" media="all" />' . "\r\n";
$words = PConfig::get(local_user(), 'system', 'blocked'); $words = PConfig::get(local_user(), 'system', 'blocked');
if (!$words) { if (!$words) {
@ -112,7 +112,7 @@ function superblock_conversation_start(&$a, &$b)
if ($words) { if ($words) {
$a->data['superblock'] = explode(',', $words); $a->data['superblock'] = explode(',', $words);
} }
$a->page['htmlhead'] .= <<< EOT DI::page()['htmlhead'] .= <<< EOT
<script> <script>
function superblockBlock(author) { function superblockBlock(author) {

View file

@ -25,7 +25,7 @@ function viewsrc_uninstall() {
} }
function viewsrc_page_end(&$a, &$o){ function viewsrc_page_end(&$a, &$o){
$a->page['htmlhead'] .= <<< EOS DI::page()['htmlhead'] .= <<< EOS
<script> <script>
$(function(){ $(function(){
$('a[href*="/viewsrc/"]').each(function() { $('a[href*="/viewsrc/"]').each(function() {

View file

@ -107,7 +107,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="' . DI::baseUrl()->get() . '/addon/windowsphonepush/windowsphonepush.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::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

@ -70,7 +70,7 @@ function wppost_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="' . DI::baseUrl()->get() . '/addon/wppost/wppost.css' . '" media="all" />' . "\r\n"; DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/wppost/wppost.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */ /* Get the current state of our config variables */