Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/rbolliger/apostrophePollPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rbolliger committed Jun 24, 2012
2 parents 11c9cdb + 600d1db commit 5a4ea11
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/aPoll.yml
Expand Up @@ -31,6 +31,8 @@ all:
default_submit_action: '@a_poll_slot_submit_form'
# default template used to confirm the poll submission
default_submit_success_template: aPollSlot/default_submit_success
#default poll heading
default_heading_tag: h3

# Define here all available reports. Then you can define which ones are actually
# available for each poll using the "reports" field, which is an array. If the field is not defined,
Expand Down
4 changes: 4 additions & 0 deletions i18n/apostrophe.fr.xml
Expand Up @@ -218,6 +218,10 @@
<source>here</source>
<target>ici</target>
</trans-unit>
<trans-unit>
<source>The captcha is not valid (invalid captcha).</source>
<target>Le captcha n'est pas correct (invalid captcha).</target>
</trans-unit>
</body>
</file>
</xliff>
11 changes: 11 additions & 0 deletions lib/BaseaPollToolkit.class.php
Expand Up @@ -81,6 +81,17 @@ static function getPollSubmitAction($name) {

return self::getValueFromConf($name, 'submit_action', 'apoll_settings_view', 'default_submit_action', '@a_poll_slot_submit_form');
}


/**
* Returns the html tag that renders the poll heading.
*
* @param array() $name : the poll identifier as defined in apoll_settings_available_polls
*/
static function getPollHeadingTag($name) {

return self::getValueFromConf($name, 'heading_tag', 'apoll_settings_view', 'default_heading_tag', 'h3');
}

/**
* Returns the configuration of poll "$name" from apoll_settings_available_polls
Expand Down
4 changes: 2 additions & 2 deletions modules/aPollSlot/templates/_default_form_view.php
@@ -1,10 +1,10 @@
<?php use_helper('a', 'JavascriptBase') ?>


<div class="a-ui a-poll-slot-container">
<div class="a-poll-slot-container">

<div class="a-poll-title-bar">
<h2 class="a-poll-title"><?php echo $poll->getTitle() ?></h2>
<<?php echo $ht = aPollToolkit::getPollHeadingTag($poll->getType()); ?> class="a-poll-title"><?php echo $poll->getTitle() ?></<?php echo $ht; ?>>
</div>

<?php if ($poll->getDescription()): ?>
Expand Down

0 comments on commit 5a4ea11

Please sign in to comment.