X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=tictac%2Ftictac.php;h=fe2c5cf12d5034306159506de74fac76d0f843dc;hb=63020e48fafa677c20f13cdf511f8fffe2304e50;hp=9973784176e1ea4ecf6fb5492df3bc88cffda15a;hpb=461b3db9f449fdb1ce780a337cf2f1bb7aa35ac5;p=friendica-addons.git diff --git a/tictac/tictac.php b/tictac/tictac.php index 99737841..fe2c5cf1 100644 --- a/tictac/tictac.php +++ b/tictac/tictac.php @@ -5,19 +5,20 @@ * Version: 1.0 * Author: Mike Macgirvin */ - +use Friendica\Core\Addon; +use Friendica\Core\L10n; function tictac_install() { - register_hook('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu'); + Addon::registerHook('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu'); } function tictac_uninstall() { - unregister_hook('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu'); + Addon::unregisterHook('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu'); } function tictac_app_menu($a,&$b) { - $b['app_menu'][] = '
' . t('Three Dimensional Tic-Tac-Toe') . '
'; + $b['app_menu'][] = '
' . L10n::t('Three Dimensional Tic-Tac-Toe') . '
'; } @@ -50,17 +51,17 @@ function tictac_content(&$a) { $dimen = 3; } - $o .= '

' . t('3D Tic-Tac-Toe') . '


'; + $o .= '

' . L10n::t('3D Tic-Tac-Toe') . '


'; $t = new tictac($dimen,$handicap,$mefirst,$yours,$mine); $o .= $t->play(); - $o .= '' . t('New game') . '
'; - $o .= '' . t('New game with handicap') . '
'; - $o .= '

' . t('Three dimensional tic-tac-toe is just like the traditional game except that it is played on multiple levels simultaneously. '); - $o .= t('In this case there are three levels. You win by getting three in a row on any level, as well as up, down, and diagonally across the different levels.'); + $o .= '' . L10n::t('New game') . '
'; + $o .= '' . L10n::t('New game with handicap') . '
'; + $o .= '

' . L10n::t('Three dimensional tic-tac-toe is just like the traditional game except that it is played on multiple levels simultaneously. '); + $o .= L10n::t('In this case there are three levels. You win by getting three in a row on any level, as well as up, down, and diagonally across the different levels.'); $o .= '

'; - $o .= t('The handicap game disables the center position on the middle level because the player claiming this square often has an unfair advantage.'); + $o .= L10n::t('The handicap game disables the center position on the middle level because the player claiming this square often has an unfair advantage.'); $o .= '

'; return $o; @@ -179,24 +180,24 @@ class tictac { if($this->first_move) { if(rand(0,1) == 1) { - $o .= '
' . t('You go first...') . '

'; + $o .= '
' . L10n::t('You go first...') . '

'; $this->mefirst = 0; $o .= $this->draw_board(); return $o; } - $o .= '
' . t('I\'m going first this time...') . '

'; + $o .= '
' . L10n::t('I\'m going first this time...') . '

'; $this->mefirst = 1; } if($this->check_youwin()) { - $o .= '
' . t('You won!') . '

'; + $o .= '
' . L10n::t('You won!') . '

'; $o .= $this->draw_board(); return $o; } if($this->fullboard()) - $o .= '
' . t('"Cat" game!') . '

'; + $o .= '
' . L10n::t('"Cat" game!') . '

'; $move = $this->winning_move(); if(strlen($move)) { @@ -219,9 +220,9 @@ class tictac { } if($this->check_iwon()) - $o .= '
' . t('I won!') . '

'; + $o .= '
' . L10n::t('I won!') . '

'; if($this->fullboard()) - $o .= '
' . t('"Cat" game!') . '

'; + $o .= '
' . L10n::t('"Cat" game!') . '

'; $o .= $this->draw_board(); return $o; }