mahjong/mahjong.php

43 lines
1.3 KiB
PHP

<?php
/**
* Name: A Mahjong Solitaire Game
* Description: A Mahjong Solitaire browsergame for your users as time sink. The gamy was developed by ffalt and is MIT licensed.
* Version: 1.0
* Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
*/
use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\DI;
function mahjong_install() {
Hook::register('app_menu', 'addon/mahjong/mahjong.php', 'mahjong_app_menu');
}
function mahjong_app_menu($a,&$b) {
$b['app_menu'][] = '<div class="app-title"><a href="mahjong">' . DI::l10n()->t('Mahjong Game') . '</a><
/div>';
}
function mahjong_module() {
return;
}
function mahjong_content(&$a) {
$basepath = DI::baseUrl()->get() . '/addon/mahjong';
$o = '';
$o .= <<< EOT
<app-root>
<div class="loading">
LOAD "Mah Jong",8,1<br>LOADING…<br>
<i class="icon-spin1 animate-spin"></i>
</div>
</app-root>
EOT;
DI::page()['htmlhead'] .= '<script src="'.$basepath.'/runtime.02c30728ea54f887.js" type="module"></script>';
DI::page()['htmlhead'] .= '<script src="'.$basepath.'/polyfills.3e468d5ab5f409a5.js" type="module"></script>';
DI::page()['htmlhead'] .= '<script src="'.$basepath.'/main.abbf60ddab1c39b5.js" type="module"></script>';
return $o;
}