template_preprocess_poll_results
modules/poll/poll.module, строка 711
- Версии
- 6
template_preprocess_poll_results(&$variables)
Preprocess the poll_results theme hook.
Inputs: $raw_title
, $results
, $votes
, $raw_links
, $block
, $nid
, $vote
. The
$raw_
* inputs to this are naturally unsafe; often safe versions are
made to simply overwrite the raw version, but in this case it seems likely
that the title and the links may be overridden by the theme layer, so they
are left in with a different name for that purpose.
See also
poll-results.tpl.php
@see poll-results-block.tpl.php
See also
theme_poll_results()
Код
<?php
function template_preprocess_poll_results(&$variables) {
$variables['links'] = theme('links', $variables['raw_links']);
if (isset($variables['vote']) && $variables['vote'] > -1 && user_access('cancel own vote')) {
$variables['cancel_form'] = drupal_get_form('poll_cancel_form', $variables['nid']);
}
$variables['title'] = check_plain($variables['raw_title']);
// If this is a block, allow a different tpl.php to be used.
if ($variables['block']) {
$variables['template_files'][] = 'poll-results-block';
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии