use AJAX to dynamicall load list of all Quests for a Seminary (Issue #287)
This commit is contained in:
parent
80753aaf8c
commit
5d0d90c373
4 changed files with 130 additions and 7 deletions
37
views/ajax/quests/index.tpl
Normal file
37
views/ajax/quests/index.tpl
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
foreach($quests as &$quest)
|
||||
{
|
||||
// Questtype translation
|
||||
$questtype = $quest['questtype']['title'];
|
||||
switch($quest['questtype']['classname'])
|
||||
{
|
||||
case null: $questtype = _('Questtype Empty');
|
||||
break;
|
||||
case 'bossfight': $questtype = _('Questtype bossfight');
|
||||
break;
|
||||
case 'choiceinput': $questtype = _('Questtype choiceinput');
|
||||
break;
|
||||
case 'crossword': $questtype = _('Questtype crossword');
|
||||
break;
|
||||
case 'dragndrop': $questtype = _('Questtype dragndrop');
|
||||
break;
|
||||
case 'multiplechoice': $questtype = _('Questtype multiplechoice');
|
||||
break;
|
||||
case 'submit': $questtype = _('Questtype submit');
|
||||
break;
|
||||
case 'textinput': $questtype = _('Questtype textinput');
|
||||
break;
|
||||
}
|
||||
$quest['questtype']['title'] = $questtype;
|
||||
|
||||
// XPs translation
|
||||
$quest['xps'] = sprintf(_('%d XPs'), $quest['xps']);
|
||||
}
|
||||
|
||||
?>
|
||||
<?=json_encode(array(
|
||||
'seminary' => $seminary,
|
||||
'quests' => $quests,
|
||||
'more' => (($page*$limit) < $questsCount)
|
||||
))?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue