Skip to content

Commit

Permalink
Upgrade helper calls to new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Apr 19, 2010
1 parent 08da059 commit 91083ee
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 55 deletions.
2 changes: 1 addition & 1 deletion lib/asset/dmChessJavascriptConfig.php
Expand Up @@ -34,7 +34,7 @@ protected function getJavascriptConfig()
) : false,
'targets' => ($this->player->isMyTurn() && $this->player->Game->isStarted) ? $this->player->getTargetKeysByPieces() : null,
'beat' => array(
'url' => $this->helper->£link('+/dmChessGame/whatsUp')->param('player', $this->player->code)->getHref(),
'url' => $this->helper->link('+/dmChessGame/whatsUp')->param('player', $this->player->code)->getHref(),
'delay' => 2000
),
'game' => array(
Expand Down
6 changes: 3 additions & 3 deletions modules/dmChessGame/actions/actions.class.php
Expand Up @@ -97,7 +97,7 @@ public function executeInviteAi(dmWebRequest $request)

dmDb::table('DmChessPlayer')->joinGameByCode($player->Game->code, array('is_ai' => true));

return $this->redirect($this->getHelper()->£link($this->getPage())->param('p', $player->code)->getHref());
return $this->redirect($this->getHelper()->link($this->getPage())->param('p', $player->code)->getHref());
}

/*
Expand Down Expand Up @@ -153,7 +153,7 @@ public function executePlayWidget(dmWebRequest $request)
{
$this->forward404Unless($player = dmDb::table('DmChessPlayer')->joinGameByCode($gameCode));

return $this->redirect($this->getHelper()->£link($this->getPage())->param('p', $player->code)->getHref());
return $this->redirect($this->getHelper()->link($this->getPage())->param('p', $player->code)->getHref());
}
else
{
Expand All @@ -173,7 +173,7 @@ public function executeCreate(dmWebRequest $request)
// clean old games
dmDb::table('DmChessGame')->broom();

return $this->redirect($this->getHelper()->£link($this->getPage())->param('p', dmDb::table('DmChessPlayer')->startNewGame()->code)->getHref());
return $this->redirect($this->getHelper()->link($this->getPage())->param('p', dmDb::table('DmChessPlayer')->startNewGame()->code)->getHref());
}

public function executeGetTableFinished(dmWebRequest $request)
Expand Down
12 changes: 5 additions & 7 deletions modules/dmChessGame/templates/_board.php
Expand Up @@ -9,7 +9,7 @@

$x = $y = 1;

echo £o('div.dm_chess_board');
echo _open('div.dm_chess_board');

foreach($squares as $key => $square)
{
Expand All @@ -22,13 +22,11 @@
$squareCss .= '.check';
}

echo £('div'.$squareCss, array('style' => sprintf('top: %dpx;left: %dpx;', 64*(8-$x), 64*($y-1))),
echo _tag('div'.$squareCss, array('style' => sprintf('top: %dpx;left: %dpx;', 64*(8-$x), 64*($y-1))),

£('div.dm_chess_square_inner', '').
_tag('div.dm_chess_square_inner', '').

($piece ? £('div.dm_chess_piece.'.$piece->get('type').'.'.$piece->get('color').'#p'.$piece->get('id')) : '')

// £('span.human_pos', $square->getHumanPos())
($piece ? _tag('div.dm_chess_piece.'.$piece->get('type').'.'.$piece->get('color').'#p'.$piece->get('id')) : '')

);

Expand All @@ -38,4 +36,4 @@
}
}

echo £c('div');
echo _close('div');
12 changes: 6 additions & 6 deletions modules/dmChessGame/templates/_cemetery.php
Expand Up @@ -2,19 +2,19 @@

if (!$player)
{
echo £('div.dm_chess_cemetery.dm_chess_cemetery_'.$position);
echo _tag('div.dm_chess_cemetery.dm_chess_cemetery_'.$position);
return;
}

echo £o('div.dm_chess_cemetery.dm_chess_cemetery_'.$position.'.'.$player->color);
echo _open('div.dm_chess_cemetery.dm_chess_cemetery_'.$position.'.'.$player->color);

echo £o('ul');
echo _open('ul');

foreach($player->deadPieces as $piece)
{
echo £('li', £('div.dm_chess_piece.'.$piece->color.'.'.$piece->type));
echo _tag('li', _tag('div.dm_chess_piece.'.$piece->color.'.'.$piece->type));
}

echo £c('ul');
echo _close('ul');

echo £c('div');
echo _close('div');
4 changes: 2 additions & 2 deletions modules/dmChessGame/templates/_justInstalled.php
@@ -1,8 +1,8 @@
<?php

echo £('div.dm_chess_just_installed.clearfix',
echo _tag('div.dm_chess_just_installed.clearfix',

£media('/dmChessPlugin/images/piece/sprite.png')->set('.fleft').
_media('/dmChessPlugin/images/piece/sprite.png')->set('.fleft').

__('You just added the chess/game widget. Please reload the page to activate it, and this message will never appear again.')

Expand Down
6 changes: 3 additions & 3 deletions modules/dmChessGame/templates/_notCreated.php
@@ -1,9 +1,9 @@
<?php

echo £('div.dm_chess_not_created.clearfix',
echo _tag('div.dm_chess_not_created.clearfix',

£('noscript', __('Your browser does not support JavaScript.')).
_tag('noscript', __('Your browser does not support JavaScript.')).

£('div.yescript', __('Creating a new game...'))
_tag('div.yescript', __('Creating a new game...'))

);
6 changes: 3 additions & 3 deletions modules/dmChessGame/templates/_play.php
Expand Up @@ -13,11 +13,11 @@
return;
}

echo £('div.dm_chess_game.clearfix',
echo _tag('div.dm_chess_game.clearfix',

£('div.dm_chess_board_wrap', get_partial('dmChessGame/board', array('player' => $player))).
_tag('div.dm_chess_board_wrap', get_partial('dmChessGame/board', array('player' => $player))).

£('div.dm_chess_table_wrap',
_tag('div.dm_chess_table_wrap',

get_partial('dmChessGame/cemetery', array('player' => $player, 'position' => 'top')).

Expand Down
30 changes: 15 additions & 15 deletions modules/dmChessGame/templates/_table.php
@@ -1,35 +1,35 @@
<?php

echo £('div.dm_chess_table',
echo _tag('div.dm_chess_table',

£('div.dm_chess_oponnent', $player->Opponent->isAi
_tag('div.dm_chess_oponnent', $player->Opponent->isAi
? __('Opponent is Crafty A.I.').' '.
$player->Opponent->getLevelSelect()->render('dm_chess_level_select', $player->Opponent->aiLevel)
: __('Human opponent')
).

£('div.dm_chess_separator').
_tag('div.dm_chess_separator').

£('div.dm_chess_current_player',
£('div.player.white',
£('div.dm_chess_piece.king.white', '').
£('p', __($player->isWhite() ? 'Your turn' : 'Waiting for opponent'))
_tag('div.dm_chess_current_player',
_tag('div.player.white',
_tag('div.dm_chess_piece.king.white', '').
_tag('p', __($player->isWhite() ? 'Your turn' : 'Waiting for opponent'))
).
£('div.player.black',
£('div.dm_chess_piece.king.black', '').
£('p', __($player->isBlack() ? 'Your turn' : 'Waiting for opponent'))
_tag('div.player.black',
_tag('div.dm_chess_piece.king.black', '').
_tag('p', __($player->isBlack() ? 'Your turn' : 'Waiting for opponent'))
)
).

£('div.dm_chess_separator').
_tag('div.dm_chess_separator').

£('div.dm_chess_permalink',
_tag('div.dm_chess_permalink',
__('To continue later, use this url:').
£link($sf_request->getUri())->text($sf_request->getUri())->set('mt10')
_link($sf_request->getUri())->text($sf_request->getUri())->set('mt10')
).

£('div.dm_chess_give_up',
£link('+/dmChessGame/resign')->param('player', $player->code)->text(__('Resign'))->title(__('Resign this game'))
_tag('div.dm_chess_give_up',
_link('+/dmChessGame/resign')->param('player', $player->code)->text(__('Resign'))->title(__('Resign this game'))
)

);
18 changes: 9 additions & 9 deletions modules/dmChessGame/templates/_tableFinished.php
@@ -1,24 +1,24 @@
<?php

echo £('div.dm_chess_table.finished',
echo _tag('div.dm_chess_table.finished',

£('p.game_over', __('Game over')).
_tag('p.game_over', __('Game over')).

£('div.dm_chess_separator').
_tag('div.dm_chess_separator').

(($winner = $player->Game->Winner)
?
£('div.dm_chess_current_player',
£('div.player.clearfix',
£('div.dm_chess_piece.king.fleft.'.$winner->color, '').
£('p', __('%1% is victorious', array('%1%' => $winner->color)))
_tag('div.dm_chess_current_player',
_tag('div.player.clearfix',
_tag('div.dm_chess_piece.king.fleft.'.$winner->color, '').
_tag('p', __('%1% is victorious', array('%1%' => $winner->color)))
)
)
: ___('Draw')
).

£('div.dm_chess_separator').
_tag('div.dm_chess_separator').

£link($dm_page)->text(__('Start a new game'))->currentSpan(false)
_link($dm_page)->text(__('Start a new game'))->currentSpan(false)

);
12 changes: 6 additions & 6 deletions modules/dmChessGame/templates/_tableNotStarted.php
@@ -1,17 +1,17 @@
<?php

echo £('div.dm_chess_table',
echo _tag('div.dm_chess_table',

__('To invite someone to play, give this url:').

£('div.dm_chess_join_url',
£link($dm_page)->param('g', $player->Game->code)->getAbsoluteHref()
_tag('div.dm_chess_join_url',
_link($dm_page)->param('g', $player->Game->code)->getAbsoluteHref()
).

£('div.dm_chess_separator').
_tag('div.dm_chess_separator').

£('div.dm_chess_join_ai',
£link('+/dmChessGame/inviteAi')->param('player', $player->code)->text(__('Or challenge the Artificial Intelligence'))
_tag('div.dm_chess_join_ai',
_link('+/dmChessGame/inviteAi')->param('player', $player->code)->text(__('Or challenge the Artificial Intelligence'))
)

);

0 comments on commit 91083ee

Please sign in to comment.