X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=calc%2Fcalc.php;h=3159bf6afccd1593b43f0f4453ca9e55f1b18635;hb=97fcee53c04345271c62df18f44e6fad948a3d0e;hp=a299d45e94b518a5f9005d75f8e2ca2f9e0b270e;hpb=d7bd2246c18f5880fc3c083bf3d698fe4f29fcb6;p=friendica-addons.git diff --git a/calc/calc.php b/calc/calc.php old mode 100755 new mode 100644 index a299d45e..3159bf6a --- a/calc/calc.php +++ b/calc/calc.php @@ -1,363 +1,362 @@ - - */ - - -function calc_install() { - register_hook('app_menu', 'addon/calc/calc.php', 'calc_app_menu'); -} - -function calc_uninstall() { - unregister_hook('app_menu', 'addon/calc/calc.php', 'calc_app_menu'); - -} - -function calc_app_menu($a,&$b) { - $b['app_menu'][] = '
Calculator
'; -} - - -function calc_module() {} - - - - -function calc_init($a) { - -$x = <<< EOT - - - -EOT; -$a->page['htmlhead'] .= $x; -} - -function calc_content($app) { - -$o = ''; - -$o .= <<< EOT - -

Calculator

-

- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - -
- -EOT; -return $o; - -} + + */ + +use Friendica\App; +use Friendica\Core\Hook; +use Friendica\DI; + +function calc_install() { + Hook::register('app_menu', 'addon/calc/calc.php', 'calc_app_menu'); +} + +function calc_app_menu(App $a, array &$b) +{ + $b['app_menu'][] = '
Calculator
'; +} + +/** + * This is a statement rather than an actual function definition. The simple + * existence of this method is checked to figure out if the addon offers a + * module. + */ +function calc_module() {} + +function calc_init(App $a) +{ + $x = <<< EOT + + + +EOT; +DI::page()['htmlhead'] .= $x; +} + +function calc_content($app) { + +$o = ''; + +$o .= <<< EOT + +

Calculator

+

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +EOT; + return $o; +}