Friends

No friends yet.

Send private message

You must be logged in to send a private message.

Group membership

  • Beginning Developers

    Beginning Developers

    This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking
  • Poll Plugin

    Poll Plugin

    elgg poll plugin development and discussion group

Activity

  • Rusty replied on the discussion topic Poll Plugin by iionly
    Awesome!!!  I new it had to be fairly easy...  Thank you.   view reply
  • Rusty added a new discussion topic Poll Plugin by iionly in the group Poll Plugin
    I am new to Developing here and am wondering if there is an easy way to eliminate the functionality of the user to add voting choices.  For what I am trying to do I really only want to have One Set Voting Choice (i.e. Yes).   Thanks in...
    • I think it's not very complicated. Edit mod/poll/views/default/forms/poll/edit.php:

      Replace the lines

      <div>
          <label><?php echo elgg_echo('poll:responses'); ?></label>
          <?php echo elgg_view('poll/input/choices', array('poll' => $poll)); ?>
          <?php echo elgg_view("output/longtext", array("value" => elgg_echo('poll:note_responses'), 'class' => 'elgg-subtext mts')); ?>
      </div>

      with

      <?php
          echo elgg_view('input/hidden', array('name' => "number_of_choices", 'value' => 1));
          echo elgg_view('input/hidden', array('name' => "choice_text_0", 'value' => elgg_echo('poll:settings:yes')));
      ?>

      Then it's no longer possible to add any poll choices when creating or eding a poll. Instead a single choice is added automatically. Choice text in this case would be "yes" (language string 'poll:settings:yes'). If you want another text for the poll choice (still always the same text though), you can add the text in the language file(s) and change the string in elgg_echo(). You could also add more fixed choices. Just add another line corresponding to the second elgg_view line above with the number of "choice_text_0" increased and adjust the value of number_of_choices() in the first elgg_view() call.

    • Awesome!!!  I new it had to be fairly easy...  Thank you.  

  • Rusty added a new discussion topic Set Voting Choices for Elgg Poll Plugin by iionly in the group Beginning Developers
    I am new to Developing here and am wondering if there is an easy way to eliminate the functionality of the user to add voting choices.  For what I am trying to do I really only want to have One Set Voting Choice (i.e. Yes).   Also I...
  • Rusty joined the group Beginning Developers