[various] Replace remaining $a->page by DI::page()
parent
b351fabb4f
commit
d3717045f7
727
calc/calc.php
727
calc/calc.php
|
@ -1,363 +1,364 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Name: Calculator App
|
* Name: Calculator App
|
||||||
* Description: Simple Calculator Application
|
* Description: Simple Calculator Application
|
||||||
* Version: 1.0
|
* Version: 1.0
|
||||||
* 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() {
|
|
||||||
Hook::register('app_menu', 'addon/calc/calc.php', 'calc_app_menu');
|
function calc_install() {
|
||||||
}
|
Hook::register('app_menu', 'addon/calc/calc.php', 'calc_app_menu');
|
||||||
|
}
|
||||||
function calc_uninstall() {
|
|
||||||
Hook::unregister('app_menu', 'addon/calc/calc.php', 'calc_app_menu');
|
function calc_uninstall() {
|
||||||
|
Hook::unregister('app_menu', 'addon/calc/calc.php', 'calc_app_menu');
|
||||||
}
|
|
||||||
|
}
|
||||||
function calc_app_menu($a,&$b) {
|
|
||||||
$b['app_menu'][] = '<div class="app-title"><a href="calc">Calculator</a></div>';
|
function calc_app_menu($a,&$b) {
|
||||||
}
|
$b['app_menu'][] = '<div class="app-title"><a href="calc">Calculator</a></div>';
|
||||||
|
}
|
||||||
|
|
||||||
function calc_module() {}
|
|
||||||
|
function calc_module() {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function calc_init($a) {
|
|
||||||
|
function calc_init($a) {
|
||||||
$x = <<< EOT
|
|
||||||
|
$x = <<< EOT
|
||||||
<script language="JavaScript">
|
|
||||||
/**************************************
|
<script language="JavaScript">
|
||||||
* www.FemaleNerd.com *
|
/**************************************
|
||||||
**************************************/
|
* www.FemaleNerd.com *
|
||||||
|
**************************************/
|
||||||
// Declare global variables
|
|
||||||
var displayText = ""
|
// Declare global variables
|
||||||
var num1
|
var displayText = ""
|
||||||
var num2
|
var num1
|
||||||
var operatorType
|
var num2
|
||||||
|
var operatorType
|
||||||
// Write to display
|
|
||||||
function addDisplay(n){
|
// Write to display
|
||||||
id = document.getElementById("display");
|
function addDisplay(n){
|
||||||
id.value = ""
|
id = document.getElementById("display");
|
||||||
displayText += n
|
id.value = ""
|
||||||
id.value = displayText
|
displayText += n
|
||||||
}
|
id.value = displayText
|
||||||
|
}
|
||||||
// Addition
|
|
||||||
function addNumbers() {
|
// Addition
|
||||||
if (displayText == "") {
|
function addNumbers() {
|
||||||
displayText = result
|
if (displayText == "") {
|
||||||
}
|
displayText = result
|
||||||
num1 = parseFloat(displayText)
|
}
|
||||||
operatorType = "add"
|
num1 = parseFloat(displayText)
|
||||||
displayText = ""
|
operatorType = "add"
|
||||||
}
|
displayText = ""
|
||||||
|
}
|
||||||
// Subtraction
|
|
||||||
function subtractNumbers() {
|
// Subtraction
|
||||||
if (displayText == "") {
|
function subtractNumbers() {
|
||||||
displayText = result
|
if (displayText == "") {
|
||||||
}
|
displayText = result
|
||||||
num1 = parseFloat(displayText)
|
}
|
||||||
operatorType = "subtract"
|
num1 = parseFloat(displayText)
|
||||||
displayText = ""
|
operatorType = "subtract"
|
||||||
}
|
displayText = ""
|
||||||
|
}
|
||||||
// Multiplication
|
|
||||||
function multiplyNumbers() {
|
// Multiplication
|
||||||
if (displayText == "") {
|
function multiplyNumbers() {
|
||||||
displayText = result
|
if (displayText == "") {
|
||||||
}
|
displayText = result
|
||||||
num1 = parseFloat(displayText)
|
}
|
||||||
operatorType = "multiply"
|
num1 = parseFloat(displayText)
|
||||||
displayText = ""
|
operatorType = "multiply"
|
||||||
}
|
displayText = ""
|
||||||
|
}
|
||||||
// Division
|
|
||||||
function divideNumbers() {
|
// Division
|
||||||
if (displayText == "") {
|
function divideNumbers() {
|
||||||
displayText = result
|
if (displayText == "") {
|
||||||
}
|
displayText = result
|
||||||
num1 = parseFloat(displayText)
|
}
|
||||||
operatorType = "divide"
|
num1 = parseFloat(displayText)
|
||||||
displayText = ""
|
operatorType = "divide"
|
||||||
}
|
displayText = ""
|
||||||
|
}
|
||||||
// Sine
|
|
||||||
function sin() {
|
// Sine
|
||||||
id = document.getElementById("display");
|
function sin() {
|
||||||
if (displayText == "") {
|
id = document.getElementById("display");
|
||||||
num1 = result
|
if (displayText == "") {
|
||||||
}
|
num1 = result
|
||||||
else {
|
}
|
||||||
num1 = parseFloat(displayText)
|
else {
|
||||||
}
|
num1 = parseFloat(displayText)
|
||||||
if (num1 != "") {
|
}
|
||||||
result = Math.sin(num1)
|
if (num1 != "") {
|
||||||
id.value = result
|
result = Math.sin(num1)
|
||||||
displayText = ""
|
id.value = result
|
||||||
}
|
displayText = ""
|
||||||
else {
|
}
|
||||||
alert("Please write the number first")
|
else {
|
||||||
}
|
alert("Please write the number first")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Cosine
|
|
||||||
function cos() {
|
// Cosine
|
||||||
id = document.getElementById("display");
|
function cos() {
|
||||||
if (displayText == "") {
|
id = document.getElementById("display");
|
||||||
num1 = result
|
if (displayText == "") {
|
||||||
}
|
num1 = result
|
||||||
else {
|
}
|
||||||
num1 = parseFloat(displayText)
|
else {
|
||||||
}
|
num1 = parseFloat(displayText)
|
||||||
if (num1 != "") {
|
}
|
||||||
result = Math.cos(num1)
|
if (num1 != "") {
|
||||||
id.value = result
|
result = Math.cos(num1)
|
||||||
displayText = ""
|
id.value = result
|
||||||
}
|
displayText = ""
|
||||||
else {
|
}
|
||||||
alert("Please write the number first")
|
else {
|
||||||
}
|
alert("Please write the number first")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// ArcSine
|
|
||||||
function arcSin() {
|
// ArcSine
|
||||||
id = document.getElementById("display");
|
function arcSin() {
|
||||||
if (displayText == "") {
|
id = document.getElementById("display");
|
||||||
num1 = result
|
if (displayText == "") {
|
||||||
}
|
num1 = result
|
||||||
else {
|
}
|
||||||
num1 = parseFloat(displayText)
|
else {
|
||||||
}
|
num1 = parseFloat(displayText)
|
||||||
if (num1 != "") {
|
}
|
||||||
result = Math.asin(num1)
|
if (num1 != "") {
|
||||||
id.value = result
|
result = Math.asin(num1)
|
||||||
displayText = ""
|
id.value = result
|
||||||
}
|
displayText = ""
|
||||||
else {
|
}
|
||||||
alert("Please write the number first")
|
else {
|
||||||
}
|
alert("Please write the number first")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// ArcCosine
|
|
||||||
function arcCos() {
|
// ArcCosine
|
||||||
id = document.getElementById("display");
|
function arcCos() {
|
||||||
if (displayText == "") {
|
id = document.getElementById("display");
|
||||||
num1 = result
|
if (displayText == "") {
|
||||||
}
|
num1 = result
|
||||||
else {
|
}
|
||||||
num1 = parseFloat(displayText)
|
else {
|
||||||
}
|
num1 = parseFloat(displayText)
|
||||||
if (num1 != "") {
|
}
|
||||||
result = Math.acos(num1)
|
if (num1 != "") {
|
||||||
id.value = result
|
result = Math.acos(num1)
|
||||||
displayText = ""
|
id.value = result
|
||||||
}
|
displayText = ""
|
||||||
else {
|
}
|
||||||
alert("Please write the number first")
|
else {
|
||||||
}
|
alert("Please write the number first")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Square root
|
|
||||||
function sqrt() {
|
// Square root
|
||||||
id = document.getElementById("display");
|
function sqrt() {
|
||||||
if (displayText == "") {
|
id = document.getElementById("display");
|
||||||
num1 = result
|
if (displayText == "") {
|
||||||
}
|
num1 = result
|
||||||
else {
|
}
|
||||||
num1 = parseFloat(displayText)
|
else {
|
||||||
}
|
num1 = parseFloat(displayText)
|
||||||
if (num1 != "") {
|
}
|
||||||
result = Math.sqrt(num1)
|
if (num1 != "") {
|
||||||
id.value = result
|
result = Math.sqrt(num1)
|
||||||
displayText = ""
|
id.value = result
|
||||||
}
|
displayText = ""
|
||||||
else {
|
}
|
||||||
alert("Please write the number first")
|
else {
|
||||||
}
|
alert("Please write the number first")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Square number (number to the power of two)
|
|
||||||
function square() {
|
// Square number (number to the power of two)
|
||||||
id = document.getElementById("display");
|
function square() {
|
||||||
if (displayText == "") {
|
id = document.getElementById("display");
|
||||||
num1 = result
|
if (displayText == "") {
|
||||||
}
|
num1 = result
|
||||||
else {
|
}
|
||||||
num1 = parseFloat(displayText)
|
else {
|
||||||
}
|
num1 = parseFloat(displayText)
|
||||||
if (num1 != "") {
|
}
|
||||||
result = num1 * num1
|
if (num1 != "") {
|
||||||
id.value = result
|
result = num1 * num1
|
||||||
displayText = ""
|
id.value = result
|
||||||
}
|
displayText = ""
|
||||||
else {
|
}
|
||||||
alert("Please write the number first")
|
else {
|
||||||
}
|
alert("Please write the number first")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Convert degrees to radians
|
|
||||||
function degToRad() {
|
// Convert degrees to radians
|
||||||
id = document.getElementById("display");
|
function degToRad() {
|
||||||
if (displayText == "") {
|
id = document.getElementById("display");
|
||||||
num1 = result
|
if (displayText == "") {
|
||||||
}
|
num1 = result
|
||||||
else {
|
}
|
||||||
num1 = parseFloat(displayText)
|
else {
|
||||||
}
|
num1 = parseFloat(displayText)
|
||||||
if (num1 != "") {
|
}
|
||||||
result = num1 * Math.PI / 180
|
if (num1 != "") {
|
||||||
id.value = result
|
result = num1 * Math.PI / 180
|
||||||
displayText = ""
|
id.value = result
|
||||||
}
|
displayText = ""
|
||||||
else {
|
}
|
||||||
alert("Please write the number first")
|
else {
|
||||||
}
|
alert("Please write the number first")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Convert radians to degrees
|
|
||||||
function radToDeg() {
|
// Convert radians to degrees
|
||||||
id = document.getElementById("display");
|
function radToDeg() {
|
||||||
if (displayText == "") {
|
id = document.getElementById("display");
|
||||||
num1 = result
|
if (displayText == "") {
|
||||||
}
|
num1 = result
|
||||||
else {
|
}
|
||||||
num1 = parseFloat(displayText)
|
else {
|
||||||
}
|
num1 = parseFloat(displayText)
|
||||||
if (num1 != "") {
|
}
|
||||||
result = num1 * 180 / Math.PI
|
if (num1 != "") {
|
||||||
id.value = result
|
result = num1 * 180 / Math.PI
|
||||||
displayText = ""
|
id.value = result
|
||||||
}
|
displayText = ""
|
||||||
else {
|
}
|
||||||
alert("Please write the number first")
|
else {
|
||||||
}
|
alert("Please write the number first")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Calculations
|
|
||||||
function calculate() {
|
// Calculations
|
||||||
id = document.getElementById("display");
|
function calculate() {
|
||||||
|
id = document.getElementById("display");
|
||||||
if (displayText != "") {
|
|
||||||
num2 = parseFloat(displayText)
|
if (displayText != "") {
|
||||||
// Calc: Addition
|
num2 = parseFloat(displayText)
|
||||||
if (operatorType == "add") {
|
// Calc: Addition
|
||||||
result = num1 + num2
|
if (operatorType == "add") {
|
||||||
id.value = result
|
result = num1 + num2
|
||||||
}
|
id.value = result
|
||||||
// Calc: Subtraction
|
}
|
||||||
if (operatorType == "subtract") {
|
// Calc: Subtraction
|
||||||
result = num1 - num2
|
if (operatorType == "subtract") {
|
||||||
id.value = result
|
result = num1 - num2
|
||||||
}
|
id.value = result
|
||||||
// Calc: Multiplication
|
}
|
||||||
if (operatorType == "multiply") {
|
// Calc: Multiplication
|
||||||
result = num1 * num2
|
if (operatorType == "multiply") {
|
||||||
id.value = result
|
result = num1 * num2
|
||||||
}
|
id.value = result
|
||||||
// Calc: Division
|
}
|
||||||
if (operatorType == "divide") {
|
// Calc: Division
|
||||||
result = num1 / num2
|
if (operatorType == "divide") {
|
||||||
id.value = result
|
result = num1 / num2
|
||||||
}
|
id.value = result
|
||||||
displayText = ""
|
}
|
||||||
}
|
displayText = ""
|
||||||
else {
|
}
|
||||||
id.value = "Oops! Error!"
|
else {
|
||||||
}
|
id.value = "Oops! Error!"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Clear the display
|
|
||||||
function clearDisplay() {
|
// Clear the display
|
||||||
id = document.getElementById("display");
|
function clearDisplay() {
|
||||||
|
id = document.getElementById("display");
|
||||||
displayText = ""
|
|
||||||
id.value = ""
|
displayText = ""
|
||||||
}
|
id.value = ""
|
||||||
</script>
|
}
|
||||||
|
</script>
|
||||||
EOT;
|
|
||||||
$a->page['htmlhead'] .= $x;
|
EOT;
|
||||||
}
|
DI::page()['htmlhead'] .= $x;
|
||||||
|
}
|
||||||
function calc_content($app) {
|
|
||||||
|
function calc_content($app) {
|
||||||
$o = '';
|
|
||||||
|
$o = '';
|
||||||
$o .= <<< EOT
|
|
||||||
|
$o .= <<< EOT
|
||||||
<h3>Calculator</h3>
|
|
||||||
<br /><br />
|
<h3>Calculator</h3>
|
||||||
<table>
|
<br /><br />
|
||||||
<tbody><tr><td>
|
<table>
|
||||||
<table bgcolor="#af9999" border="1">
|
<tbody><tr><td>
|
||||||
<tbody><tr><td>
|
<table bgcolor="#af9999" border="1">
|
||||||
<table border="1" cellpadding="2" cellspacing="2">
|
<tbody><tr><td>
|
||||||
<form name="calc">
|
<table border="1" cellpadding="2" cellspacing="2">
|
||||||
<!--
|
<form name="calc">
|
||||||
<TR><TD VALIGN=top colspan=6 ALIGN="center"> <H2>Calculator</H2> </TD>
|
<!--
|
||||||
-->
|
<TR><TD VALIGN=top colspan=6 ALIGN="center"> <H2>Calculator</H2> </TD>
|
||||||
<tbody><tr>
|
-->
|
||||||
<td colspan="5"><input size="22" id="display" name="display" type="text"></td>
|
<tbody><tr>
|
||||||
</tr><tr align="left" valign="middle">
|
<td colspan="5"><input size="22" id="display" name="display" type="text"></td>
|
||||||
<td><input name="one" value=" 1 " onclick="addDisplay(1)" type="button"></td>
|
</tr><tr align="left" valign="middle">
|
||||||
<td><input name="two" value=" 2 " onclick="addDisplay(2)" type="button"></td>
|
<td><input name="one" value=" 1 " onclick="addDisplay(1)" type="button"></td>
|
||||||
<td><input name="three" value=" 3 " onclick="addDisplay(3)" type="button"></td>
|
<td><input name="two" value=" 2 " onclick="addDisplay(2)" type="button"></td>
|
||||||
<td><input name="plus" value=" + " onclick="addNumbers()" type="button"></td>
|
<td><input name="three" value=" 3 " onclick="addDisplay(3)" type="button"></td>
|
||||||
</tr><tr align="left" valign="middle">
|
<td><input name="plus" value=" + " onclick="addNumbers()" type="button"></td>
|
||||||
<td><input name="four" value=" 4 " onclick="addDisplay(4)" type="button"></td>
|
</tr><tr align="left" valign="middle">
|
||||||
<td><input name="five" value=" 5 " onclick="addDisplay(5)" type="button"></td>
|
<td><input name="four" value=" 4 " onclick="addDisplay(4)" type="button"></td>
|
||||||
<td><input name="six" value=" 6 " onclick="addDisplay(6)" type="button"></td>
|
<td><input name="five" value=" 5 " onclick="addDisplay(5)" type="button"></td>
|
||||||
<td><input name="minus" value=" - " onclick="subtractNumbers()" type="button"></td>
|
<td><input name="six" value=" 6 " onclick="addDisplay(6)" type="button"></td>
|
||||||
</tr><tr align="left" valign="middle">
|
<td><input name="minus" value=" - " onclick="subtractNumbers()" type="button"></td>
|
||||||
<td><input name="seven" value=" 7 " onclick="addDisplay(7)" type="button"></td>
|
</tr><tr align="left" valign="middle">
|
||||||
<td><input name="eight" value=" 8 " onclick="addDisplay(8)" type="button"></td>
|
<td><input name="seven" value=" 7 " onclick="addDisplay(7)" type="button"></td>
|
||||||
<td><input name="nine" value=" 9 " onclick="addDisplay(9)" type="button"></td>
|
<td><input name="eight" value=" 8 " onclick="addDisplay(8)" type="button"></td>
|
||||||
<td><input name="multiplication" value=" * " onclick="multiplyNumbers()" type="button"></td>
|
<td><input name="nine" value=" 9 " onclick="addDisplay(9)" type="button"></td>
|
||||||
</tr><tr align="left" valign="middle">
|
<td><input name="multiplication" value=" * " onclick="multiplyNumbers()" type="button"></td>
|
||||||
<td><input name="zero" value=" 0 " onclick="addDisplay(0)" type="button"></td>
|
</tr><tr align="left" valign="middle">
|
||||||
<td><input name="pi" value=" Pi " onclick="addDisplay(Math.PI)" type="button"> </td>
|
<td><input name="zero" value=" 0 " onclick="addDisplay(0)" type="button"></td>
|
||||||
<td><input name="dot" value=" . " onclick='addDisplay(".")' type="button"></td>
|
<td><input name="pi" value=" Pi " onclick="addDisplay(Math.PI)" type="button"> </td>
|
||||||
<td><input name="division" value=" / " onclick="divideNumbers()" type="button"></td>
|
<td><input name="dot" value=" . " onclick='addDisplay(".")' type="button"></td>
|
||||||
</tr><tr align="left" valign="middle">
|
<td><input name="division" value=" / " onclick="divideNumbers()" type="button"></td>
|
||||||
<td><input name="sqareroot" value="sqrt" onclick="sqrt()" type="button"></td>
|
</tr><tr align="left" valign="middle">
|
||||||
<td><input name="squarex" value=" x^2" onclick="square()" type="button"></td>
|
<td><input name="sqareroot" value="sqrt" onclick="sqrt()" type="button"></td>
|
||||||
<td><input name="deg-rad" value="d2r " onclick="degToRad()" type="button"></td>
|
<td><input name="squarex" value=" x^2" onclick="square()" type="button"></td>
|
||||||
<td><input name="rad-deg" value="r2d " onclick="radToDeg()" type="button"></td>
|
<td><input name="deg-rad" value="d2r " onclick="degToRad()" type="button"></td>
|
||||||
</tr><tr align="left" valign="middle">
|
<td><input name="rad-deg" value="r2d " onclick="radToDeg()" type="button"></td>
|
||||||
<td><input name="sine" value=" sin " onclick="sin()" type="button"></td>
|
</tr><tr align="left" valign="middle">
|
||||||
<td><input name="arcsine" value="asin" onclick="arcSin()" type="button"></td>
|
<td><input name="sine" value=" sin " onclick="sin()" type="button"></td>
|
||||||
<td><input name="cosine" value="cos" onclick="cos()" type="button"></td>
|
<td><input name="arcsine" value="asin" onclick="arcSin()" type="button"></td>
|
||||||
<td><input name="arccosine" value="acs" onclick="arcCos()" type="button"></td>
|
<td><input name="cosine" value="cos" onclick="cos()" type="button"></td>
|
||||||
|
<td><input name="arccosine" value="acs" onclick="arcCos()" type="button"></td>
|
||||||
</tr><tr align="left" valign="middle">
|
|
||||||
<td colspan="2"><input name="clear" value=" Clear " onclick="clearDisplay()" type="button"></td>
|
</tr><tr align="left" valign="middle">
|
||||||
<td colspan="3"><input name="enter" value=" = " onclick="calculate()" type="button"></td>
|
<td colspan="2"><input name="clear" value=" Clear " onclick="clearDisplay()" type="button"></td>
|
||||||
|
<td colspan="3"><input name="enter" value=" = " onclick="calculate()" type="button"></td>
|
||||||
</tr></tbody></table>
|
|
||||||
</form>
|
</tr></tbody></table>
|
||||||
|
</form>
|
||||||
<!--
|
|
||||||
<TD VALIGN=top>
|
<!--
|
||||||
<B>NOTE:</B> All sine and cosine calculations are
|
<TD VALIGN=top>
|
||||||
<br>done in radians. Remember to convert first
|
<B>NOTE:</B> All sine and cosine calculations are
|
||||||
<br>if using degrees.
|
<br>done in radians. Remember to convert first
|
||||||
</TD>
|
<br>if using degrees.
|
||||||
-->
|
</TD>
|
||||||
|
-->
|
||||||
</td></tr></tbody></table>
|
|
||||||
|
</td></tr></tbody></table>
|
||||||
|
|
||||||
</td></tr></tbody></table>
|
|
||||||
|
</td></tr></tbody></table>
|
||||||
EOT;
|
|
||||||
return $o;
|
EOT;
|
||||||
|
return $o;
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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()) {
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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');
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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.
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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'));
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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');
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue