Remove remaining mentions of $a->argc/argv
- This was breaking the layout of specific pages in Frio
This commit is contained in:
parent
64d6df659d
commit
37a30434bb
|
@ -158,13 +158,13 @@ Addons may also act as "modules" and intercept all page requests for a given URL
|
||||||
In order for a addon to act as a module it needs to declare an empty function `<addon>_module()`.
|
In order for a addon to act as a module it needs to declare an empty function `<addon>_module()`.
|
||||||
|
|
||||||
If this function exists, you will now receive all page requests for `https://my.web.site/<addon>` - with any number of URL components as additional arguments.
|
If this function exists, you will now receive all page requests for `https://my.web.site/<addon>` - with any number of URL components as additional arguments.
|
||||||
These are parsed into an array $a->argv, with a corresponding $a->argc indicating the number of URL components.
|
These are parsed into the `App\Arguments` object.
|
||||||
So `https://my.web.site/addon/arg1/arg2` would look for a module named "addon" and pass its module functions the $a App structure (which is available to many components).
|
So `https://my.web.site/addon/arg1/arg2` would give this:
|
||||||
This will include:
|
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$a->argc = 3
|
DI::args()->getArgc(); // = 3
|
||||||
$a->argv = array(0 => 'addon', 1 => 'arg1', 2 => 'arg2');
|
DI::args()->get(0); // = 'addon'
|
||||||
|
DI::args()->get(1); // = 'arg1'
|
||||||
|
DI::args()->get(2); // = 'arg2'
|
||||||
```
|
```
|
||||||
|
|
||||||
To display a module page, you need to declare the function `<addon>_content(App $a)`, which defines and returns the page body content.
|
To display a module page, you need to declare the function `<addon>_content(App $a)`, which defines and returns the page body content.
|
||||||
|
|
|
@ -61,11 +61,14 @@ Addons können auch als "Module" agieren und alle Seitenanfragen für eine besti
|
||||||
Um ein Addon als Modul zu nutzen, ist es nötig, die Funktion "addon_name_module()" zu definieren, die keine Argumente benötigt und nichts weiter machen muss.
|
Um ein Addon als Modul zu nutzen, ist es nötig, die Funktion "addon_name_module()" zu definieren, die keine Argumente benötigt und nichts weiter machen muss.
|
||||||
|
|
||||||
Wenn diese Funktion existiert, wirst du nun alle Seitenanfragen für "http://example.com/addon_name" erhalten - mit allen URL-Komponenten als zusätzliche Argumente.
|
Wenn diese Funktion existiert, wirst du nun alle Seitenanfragen für "http://example.com/addon_name" erhalten - mit allen URL-Komponenten als zusätzliche Argumente.
|
||||||
Diese werden in ein Array $a->argv geparst und stimmen mit $a->argc überein, wobei sie die Anzahl der URL-Komponenten abbilden.
|
Diese werden in das App\Arguments Objekt geparst.
|
||||||
So würde http://example.com/addon/arg1/arg2 nach einem Modul "addon" suchen und seiner Modulfunktion die $a-App-Strukur übergeben (dies ist für viele Komponenten verfügbar). Das umfasst:
|
So würde `http://example.com/addon/arg1/arg2` dies ergeben:
|
||||||
|
```php
|
||||||
$a->argc = 3
|
DI::args()->getArgc(); // = 3
|
||||||
$a->argv = array(0 => 'addon', 1 => 'arg1', 2 => 'arg2');
|
DI::args()->get(0); // = 'addon'
|
||||||
|
DI::args()->get(1); // = 'arg1'
|
||||||
|
DI::args()->get(2); // = 'arg2'
|
||||||
|
```
|
||||||
|
|
||||||
Deine Modulfunktionen umfassen oft die Funktion addon_name_content(App $a), welche den Seiteninhalt definiert und zurückgibt.
|
Deine Modulfunktionen umfassen oft die Funktion addon_name_content(App $a), welche den Seiteninhalt definiert und zurückgibt.
|
||||||
Sie können auch addon_name_post(App $a) umfassen, welches vor der content-Funktion aufgerufen wird und normalerweise die Resultate der POST-Formulare handhabt.
|
Sie können auch addon_name_post(App $a) umfassen, welches vor der content-Funktion aufgerufen wird und normalerweise die Resultate der POST-Formulare handhabt.
|
||||||
|
|
|
@ -125,7 +125,7 @@ $is_singleuser_class = $is_singleuser ? "is-singleuser" : "is-not-singleuser";
|
||||||
|
|
||||||
<div class="col-lg-7 col-md-7 col-sm-12 col-xs-12" id="content">
|
<div class="col-lg-7 col-md-7 col-sm-12 col-xs-12" id="content">
|
||||||
<section class="sectiontop ';
|
<section class="sectiontop ';
|
||||||
echo $a->argv[0] ?? '';
|
echo DI::args()->get(0, 'generic');
|
||||||
echo '-content-wrapper">';
|
echo '-content-wrapper">';
|
||||||
if (!empty($page['content'])) {
|
if (!empty($page['content'])) {
|
||||||
echo $page['content'];
|
echo $page['content'];
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
|
||||||
|
$frio = 'view/theme/frio';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html >
|
<!DOCTYPE html >
|
||||||
<html>
|
<html>
|
||||||
|
@ -30,18 +32,16 @@ use Friendica\DI;
|
||||||
<meta name="viewport" content="initial-scale=1.0">
|
<meta name="viewport" content="initial-scale=1.0">
|
||||||
<meta request="<?php echo htmlspecialchars($_REQUEST['pagename']) ?>">
|
<meta request="<?php echo htmlspecialchars($_REQUEST['pagename']) ?>">
|
||||||
<script type="text/javascript">var baseurl="<?php echo DI::baseUrl() ?>";</script>
|
<script type="text/javascript">var baseurl="<?php echo DI::baseUrl() ?>";</script>
|
||||||
<script type="text/javascript">var frio="<?php echo "view/theme/frio"; ?>";</script>
|
<script type="text/javascript">var frio="<?php echo $frio; ?>";</script>
|
||||||
<?php $baseurl = DI::baseUrl(); ?>
|
|
||||||
<?php $frio = "view/theme/frio"; ?>
|
|
||||||
<?php if(!empty($page['htmlhead'])) echo $page['htmlhead']; ?>
|
<?php if(!empty($page['htmlhead'])) echo $page['htmlhead']; ?>
|
||||||
</head>
|
</head>
|
||||||
<body id="top">
|
<body id="top">
|
||||||
<?php if($_SERVER['REQUEST_URI'] == "/"){header('Location: /login');} ?>
|
<?php if($_SERVER['REQUEST_URI'] == '/'){header('Location: /login');} ?>
|
||||||
<a href="#content" class="sr-only sr-only-focusable"><?php echo DI::l10n()->t('Skip to main content'); ?></a>
|
<a href="#content" class="sr-only sr-only-focusable"><?php echo DI::l10n()->t('Skip to main content'); ?></a>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($page['nav'])) {
|
if(!empty($page['nav'])) {
|
||||||
echo str_replace("~config.sitename~", DI::config()->get('config','sitename'),
|
echo str_replace('~config.sitename~', DI::config()->get('config','sitename'),
|
||||||
str_replace("~system.banner~", DI::config()->get('system','banner'),
|
str_replace('~system.banner~', DI::config()->get('system','banner'),
|
||||||
$page['nav']
|
$page['nav']
|
||||||
));};
|
));};
|
||||||
?>
|
?>
|
||||||
|
@ -50,24 +50,24 @@ use Friendica\DI;
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<?php
|
<?php
|
||||||
echo"
|
echo '
|
||||||
<aside class=\"col-lg-3 col-md-3 hidden-sm hidden-xs\">
|
<aside class="col-lg-3 col-md-3 hidden-sm hidden-xs">
|
||||||
"; if(!empty($page['aside'])) echo $page['aside']; echo"
|
'; if(!empty($page['aside'])) echo $page['aside']; echo'
|
||||||
"; if(!empty($page['right_aside'])) echo $page['right_aside']; echo"
|
'; if(!empty($page['right_aside'])) echo $page['right_aside']; echo'
|
||||||
"; include('includes/photo_side.php'); echo"
|
'; include('includes/photo_side.php'); echo'
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<div class=\"col-lg-8 col-md-8 col-sm-12 col-xs-12\" id=\"content\">
|
<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12" id="content">
|
||||||
<section class=\"sectiontop\">
|
<section class="sectiontop">
|
||||||
<div class=\"panel "; echo $a->argv[0]; echo "-content-wrapper\">
|
<div class="panel ' . DI::args()->get(0, 'generic') . '-content-wrapper">
|
||||||
<div class=\"panel-body\">";
|
<div class="panel-body">';
|
||||||
if(!empty($page['content'])) echo $page['content']; echo"
|
if(!empty($page['content'])) echo $page['content']; echo'
|
||||||
<div id=\"pause\"></div> <!-- The pause/resume Ajax indicator -->
|
<div id="pause"></div> <!-- The pause/resume Ajax indicator -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
";
|
';
|
||||||
?>
|
?>
|
||||||
</div><!--row-->
|
</div><!--row-->
|
||||||
</div><!-- container -->
|
</div><!-- container -->
|
||||||
|
@ -76,11 +76,10 @@ use Friendica\DI;
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<span id="notifsound"></span>
|
|
||||||
<script>
|
<script>
|
||||||
$("#menu-toggle").click(function(e) {
|
$('#menu-toggle').click(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$("#wrapper").toggleClass("toggled");
|
$('#wrapper').toggleClass('toggled');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@ -101,14 +100,13 @@ use Friendica\DI;
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var pagetitle = null;
|
var pagetitle = null;
|
||||||
$("nav").bind('nav-update', function(e,data)
|
$('nav').bind('nav-update', function(e,data)
|
||||||
{
|
{
|
||||||
if (pagetitle==null) pagetitle = document.title;
|
if (pagetitle==null) pagetitle = document.title;
|
||||||
var count = $(data).find('notif').attr('count');
|
var count = $(data).find('notif').attr('count');
|
||||||
if (count>0)
|
if (count>0)
|
||||||
{
|
{
|
||||||
document.title = "("+count+") "+pagetitle;
|
document.title = '('+count+') '+pagetitle;
|
||||||
/* document.getElementById('notifsound').innerHTML='<object type="audio/mpeg" width="0" height="0" data="<?=$frio?>/audios/901.mp3"><param name="notif" value="<?=$frio?>/audios/901.mp3" /><param name="autostart" value="true" /><param name="loop" value="false" /></object>'; */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user