Changeset 88db010 in iPeer


Ignore:
Timestamp:
2013-09-04T14:53:07-07:00 (4 years ago)
Author:
Compass <pan.luo@…>
Branches:
3.1.x, dev, master
Children:
ef86d4f
Parents:
1f3fa3e
git-author:
Compass <pan.luo@…> (09/04/2013 02:52:32 PM)
git-committer:
Compass <pan.luo@…> (09/04/2013 02:53:07 PM)
Message:

Fix error when missing gettext function

Location:
app/views/surveys
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • app/views/surveys/add_question.ctp

    r1f3fa3e r88db010  
    11<div class='SurveyAddQuestion'>
    22<?php
    3 echo $this->Form->create('Question', 
     3echo $this->Form->create('Question',
    44    array('url' => '/'.$this->params['url']['url']));
    5 echo $form->input('template_id', 
     5echo $form->input('template_id',
    66    array(
    7         'empty' => _('(Select Question to Load)'),
     7        'empty' => __('(Select Question to Load)', true),
    88        'options' => $templates,
    9         'after' => $form->submit(_('Load'),
     9        'after' => $form->submit(__('Load', true),
    1010            array('div' => false, 'name' => 'load'))
    1111    )
    1212);
    13 echo $html->div('help-text', _('Load a master question as your template.'));
    14 echo $form->input('Question.master', 
     13echo $html->div('help-text', __('Load a master question as your template.', true));
     14echo $form->input('Question.master',
    1515    array('options' => array('no' => 'No', 'yes' => 'Yes')));
    16 echo $html->div('help-text', 
    17     _('Whether this question can be used as a template for new questions.'));
     16echo $html->div('help-text',
     17    __('Whether this question can be used as a template for new questions.', true));
    1818echo $form->input('Question.prompt');
    19 echo $form->input('Question.type', 
     19echo $form->input('Question.type',
    2020    array(
    2121        'options' => array(
    22             'M' => _('Multiple Choice (Single Answer)'),
    23             'C' => _('Choose Any Of... (Multiple Answers)'),
    24             'S' => _('Single Line Text Input'),
    25             'L' => _('Long Answer Text Input')
     22            'M' => __('Multiple Choice (Single Answer)', true),
     23            'C' => __('Choose Any Of... (Multiple Answers)', true),
     24            'S' => __('Single Line Text Input', true),
     25            'L' => __('Long Answer Text Input', true)
    2626        )
    2727    )
     
    3030// Response section, has to be custom due to no cakephp automagic for doing this
    3131// Most of the complication is due to the need to implement form restoration
    32 // on submit error. 
     32// on submit error.
    3333function makeResp($i, $val, $html, $form) {
    3434    // make the response text box
    35     $input = $form->text("Response.$i.response") . $html->link('X', '#', 
     35    $input = $form->text("Response.$i.response") . $html->link('X', '#',
    3636                array('onclick' => "rmResponseInput($i); return false;"));
    3737    if (isset($val['id'])) { # for editing form, need to know response id
     
    4141    return $ret;
    4242}
    43 $numResponses = 0; 
     43$numResponses = 0;
    4444$responseTemplate = makeResp(-1, array(), $html, $form);
    4545$existingResponses = $form->label('Responses') . $html->link('Add Response',
     
    4747// restore previously submitted responses, if any
    4848if (isset($this->data) && isset($this->data['Response'])) {
    49     foreach($this->data['Response'] as $key => $val) { 
     49    foreach($this->data['Response'] as $key => $val) {
    5050        $existingResponses .= makeResp($key, $val, $html, $form);
    5151        $numResponses = $key + 1;
     
    5757// Submit buttons
    5858echo $html->div('center',
    59     $form->submit(_('Save Question'), array('div' => false)) .
    60     $form->submit(_('Cancel'), array('div' => false, 'name' => 'cancel'))
     59    $form->submit(__('Save Question', true), array('div' => false)) .
     60    $form->submit(__('Cancel', true), array('div' => false, 'name' => 'cancel'))
    6161);
    6262echo $form->end();
  • app/views/surveys/questionssummary.ctp

    r1f3fa3e r88db010  
    66    echo $html->div('prompt', "$i. " . $prompt);
    77    if ($q['Question']['type'] == 'M') {
    8         echo $form->input($i, 
     8        echo $form->input($i,
    99            array(
    1010                'type' => 'radio',
    11                 'options' => $q['ResponseOptions'], 
     11                'options' => $q['ResponseOptions'],
    1212                'separator' => '<br />'
    1313            )
    1414        );
    1515    } else if ($q['Question']['type'] == 'C') {
    16         echo $form->input('blah', 
     16        echo $form->input('blah',
    1717            array(
    18                 'options' => $q['ResponseOptions'], 
     18                'options' => $q['ResponseOptions'],
    1919                'multiple' => 'checkbox',
    2020                'label' => false
     
    2929    $qId = $q['Question']['id'];
    3030    echo $html->div('Operators',
    31         $html->link(_('Edit'), "editQuestion/$qId/$survey_id",
     31        $html->link(__('Edit', true), "editQuestion/$qId/$survey_id",
    3232            array('class' => 'edit-button')).
    33         $html->link(_('Delete'), "removeQuestion/$survey_id/$qId",
     33        $html->link(__('Delete', true), "removeQuestion/$survey_id/$qId",
    3434            array('escape' => false, 'class' => 'delete-button'),
    35             _('Are you sure you want to delete') . " &ldquo;$prompt&rdquo;?").
     35            __('Are you sure you want to delete', true) . " &ldquo;$prompt&rdquo;?").
    3636        $html->div('MoveQuestion',
    37             $html->link(_('Top'), "moveQuestion/$survey_id/$qId/TOP",
     37            $html->link(__('Top', true), "moveQuestion/$survey_id/$qId/TOP",
    3838                array('escape' => false, 'class' => 'top-button')).
    39             $html->link(_('Up'), "moveQuestion/$survey_id/$qId/UP",
     39            $html->link(__('Up', true), "moveQuestion/$survey_id/$qId/UP",
    4040                array('escape' => false, 'class' => 'up-button')).
    41             $html->link(_('Down'), "moveQuestion/$survey_id/$qId/DOWN",
     41            $html->link(__('Down', true), "moveQuestion/$survey_id/$qId/DOWN",
    4242                array('escape' => false, 'class' => 'down-button')).
    43             $html->link(_('Bottom'), "moveQuestion/$survey_id/$qId/BOTTOM",
     43            $html->link(__('Bottom', true), "moveQuestion/$survey_id/$qId/BOTTOM",
    4444                array('escape' => false, 'class' => 'bottom-button'))
    4545        )
     
    4747}
    4848
    49 echo $html->div('center', 
    50     $form->button(_('Add Question'),
     49echo $html->div('center',
     50    $form->button(__('Add Question', true),
    5151       array('onclick' => "window.location='/surveys/addQuestion/$survey_id'")).
    52     $form->button(_('Done'),
     52    $form->button(__('Done', true),
    5353       array('onclick' => "window.location='/surveys/index'"))
    5454);
Note: See TracChangeset for help on using the changeset viewer.