mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-11-24 19:43:42 +00:00
Merge pull request #1158 from MrPetovan/task/remove-remaining-app-argv
[various] Remove remaining mentions of App->argc/argv
This commit is contained in:
commit
63d6c3f40f
3 changed files with 23 additions and 23 deletions
|
@ -25,7 +25,7 @@ function saml_module($a)
|
||||||
|
|
||||||
function saml_init($a)
|
function saml_init($a)
|
||||||
{
|
{
|
||||||
if ($a->argc < 2) {
|
if (DI::args()->getArgc() < 2) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ function saml_init($a)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($a->argv[1]) {
|
switch (DI::args()->get(1)) {
|
||||||
case 'metadata.xml':
|
case 'metadata.xml':
|
||||||
saml_metadata();
|
saml_metadata();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -30,16 +30,16 @@ function tictac_content(&$a) {
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
if($_POST['move']) {
|
if($_POST['move']) {
|
||||||
$handicap = $a->argv[1];
|
$handicap = DI::args()->get(1);
|
||||||
$mefirst = $a->argv[2];
|
$mefirst = DI::args()->get(2);
|
||||||
$dimen = $a->argv[3];
|
$dimen = DI::args()->get(3);
|
||||||
$yours = $a->argv[4];
|
$yours = DI::args()->get(4);
|
||||||
$mine = $a->argv[5];
|
$mine = DI::args()->get(5);
|
||||||
|
|
||||||
$yours .= $_POST['move'];
|
$yours .= $_POST['move'];
|
||||||
}
|
}
|
||||||
elseif($a->argc > 1) {
|
elseif(DI::args()->getArgc() > 1) {
|
||||||
$handicap = $a->argv[1];
|
$handicap = DI::args()->get(1);
|
||||||
$dimen = 3;
|
$dimen = 3;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -82,7 +82,7 @@ function _randomAlphaNum($length){
|
||||||
function widgets_content(&$a) {
|
function widgets_content(&$a) {
|
||||||
|
|
||||||
if (!isset($_GET['k'])) {
|
if (!isset($_GET['k'])) {
|
||||||
if($a->argv[2]=="cb"){header('HTTP/1.0 400 Bad Request'); exit();}
|
if(DI::args()->get(2)=="cb"){header('HTTP/1.0 400 Bad Request'); exit();}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ function widgets_content(&$a) {
|
||||||
DBA::escape($_GET['k'])
|
DBA::escape($_GET['k'])
|
||||||
);
|
);
|
||||||
if (!count($r)){
|
if (!count($r)){
|
||||||
if($a->argv[2]=="cb"){header('HTTP/1.0 400 Bad Request'); exit();}
|
if(DI::args()->get(2)=="cb"){header('HTTP/1.0 400 Bad Request'); exit();}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$conf = [];
|
$conf = [];
|
||||||
|
@ -99,11 +99,11 @@ function widgets_content(&$a) {
|
||||||
|
|
||||||
$o = "";
|
$o = "";
|
||||||
|
|
||||||
$widgetfile =dirname(__file__)."/widget_".$a->argv[1].".php";
|
$widgetfile =dirname(__file__)."/widget_".DI::args()->get(1).".php";
|
||||||
if (file_exists($widgetfile)){
|
if (file_exists($widgetfile)){
|
||||||
require_once($widgetfile);
|
require_once($widgetfile);
|
||||||
} else {
|
} else {
|
||||||
if($a->argv[2]=="cb"){header('HTTP/1.0 400 Bad Request'); exit();}
|
if(DI::args()->get(2)=="cb"){header('HTTP/1.0 400 Bad Request'); exit();}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,9 +111,9 @@ function widgets_content(&$a) {
|
||||||
|
|
||||||
|
|
||||||
//echo "<pre>"; var_dump($a->argv); die();
|
//echo "<pre>"; var_dump($a->argv); die();
|
||||||
if ($a->argv[2]=="cb"){
|
if (DI::args()->get(2)=="cb"){
|
||||||
/*header('Access-Control-Allow-Origin: *');*/
|
/*header('Access-Control-Allow-Origin: *');*/
|
||||||
$o .= call_user_func($a->argv[1].'_widget_content',$a, $conf);
|
$o .= call_user_func(DI::args()->get(1).'_widget_content',$a, $conf);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -123,8 +123,8 @@ function widgets_content(&$a) {
|
||||||
$o .= "<h1>Preview Widget</h1>";
|
$o .= "<h1>Preview Widget</h1>";
|
||||||
$o .= '<a href="'.DI::baseUrl()->get().'/settings/addon">'. DI::l10n()->t("Addon Settings") .'</a>';
|
$o .= '<a href="'.DI::baseUrl()->get().'/settings/addon">'. DI::l10n()->t("Addon Settings") .'</a>';
|
||||||
|
|
||||||
$o .= "<h4>".call_user_func($a->argv[1].'_widget_name')."</h4>";
|
$o .= "<h4>".call_user_func(DI::args()->get(1).'_widget_name')."</h4>";
|
||||||
$o .= call_user_func($a->argv[1].'_widget_help');
|
$o .= call_user_func(DI::args()->get(1).'_widget_help');
|
||||||
$o .= "<br style='clear:left'/><br/>";
|
$o .= "<br style='clear:left'/><br/>";
|
||||||
$o .= "<script>";
|
$o .= "<script>";
|
||||||
} else {
|
} else {
|
||||||
|
@ -133,23 +133,23 @@ function widgets_content(&$a) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$widget_size = call_user_func($a->argv[1].'_widget_size');
|
$widget_size = call_user_func(DI::args()->get(1).'_widget_size');
|
||||||
|
|
||||||
$script = file_get_contents(dirname(__file__)."/widgets.js");
|
$script = file_get_contents(dirname(__file__)."/widgets.js");
|
||||||
$o .= Renderer::replaceMacros($script, [
|
$o .= Renderer::replaceMacros($script, [
|
||||||
'$entrypoint' => DI::baseUrl()->get()."/widgets/".$a->argv[1]."/cb/",
|
'$entrypoint' => DI::baseUrl()->get()."/widgets/".DI::args()->get(1)."/cb/",
|
||||||
'$key' => $conf['key'],
|
'$key' => $conf['key'],
|
||||||
'$widget_id' => 'f9a_'.$a->argv[1]."_"._randomAlphaNum(6),
|
'$widget_id' => 'f9a_'.DI::args()->get(1)."_"._randomAlphaNum(6),
|
||||||
'$loader' => DI::baseUrl()->get()."/images/rotator.gif",
|
'$loader' => DI::baseUrl()->get()."/images/rotator.gif",
|
||||||
'$args' => (isset($_GET['a'])?$_GET['a']:''),
|
'$args' => (isset($_GET['a'])?$_GET['a']:''),
|
||||||
'$width' => $widget_size[0],
|
'$width' => $widget_size[0],
|
||||||
'$height' => $widget_size[1],
|
'$height' => $widget_size[1],
|
||||||
'$type' => $a->argv[1],
|
'$type' => DI::args()->get(1),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
if (isset($_GET['p'])) {
|
if (isset($_GET['p'])) {
|
||||||
$wargs = call_user_func($a->argv[1].'_widget_args');
|
$wargs = call_user_func(DI::args()->get(1).'_widget_args');
|
||||||
$jsargs = implode("</em>,<em>", $wargs);
|
$jsargs = implode("</em>,<em>", $wargs);
|
||||||
if ($jsargs!='') $jsargs = "&a=<em>".$jsargs."</em>";
|
if ($jsargs!='') $jsargs = "&a=<em>".$jsargs."</em>";
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ function widgets_content(&$a) {
|
||||||
<h4>Copy and paste this code</h4>
|
<h4>Copy and paste this code</h4>
|
||||||
<code>"
|
<code>"
|
||||||
|
|
||||||
.htmlspecialchars('<script src="'.DI::baseUrl()->get().'/widgets/'.$a->argv[1].'?k='.$conf['key'])
|
.htmlspecialchars('<script src="'.DI::baseUrl()->get().'/widgets/'.DI::args()->get(1).'?k='.$conf['key'])
|
||||||
.$jsargs
|
.$jsargs
|
||||||
.htmlspecialchars('"></script>')
|
.htmlspecialchars('"></script>')
|
||||||
."</code>";
|
."</code>";
|
||||||
|
|
Loading…
Reference in a new issue