getIsAnonymous() && $userId != $poll->getOwner(); $notification = $_['notification']; if ($poll->getExpire() === null) { $expired = false; } else { $expired = time() > strtotime($poll->getExpire()); } if ($poll->getType() === '0') { // count how many times in each date $arr_dates = null; // will be like: [21.02] => 3 $arr_years = null; // [1992] => 6 foreach($dates as $d) { $day_month = date('d.m', strtotime($d->getDt())); $year = date('Y', strtotime($d->getDt())); if (isset($arr_dates[$day_month])) { $arr_dates[$day_month] += 1; } else { $arr_dates[$day_month] = 1; } if (isset($arr_years[$year])) { $arr_years[$year] += 1; } else { $arr_years[$year] = 1; } } $for_string_dates = ''; foreach (array_keys($arr_dates) as $dt) { $for_string_dates .= '
'); print_unescaped($for_string_years); print_unescaped(' | ' . $l->t('All') . ' | '); } else { print_unescaped(''); foreach ($dates as $el) { print_unescaped(' | ' . $el->getText() . ' | '); } print_unescaped('' . $l->t('All') . ' | '); } ?>
---|---|---|---|---|
' . $ch_obj . ' | '); } print_unescaped('||||
');
$avatar = $avaMgr->getAvatar($usr)->get(32);
if($avatar !== false) {
print_unescaped(' ' . strtoupper($usr[0]) . ' ');
}
p($userMgr->get($usr)->getDisplayName());
} else {
if($isAnonymous) {
print_unescaped(' | '); p($l->t('Participent') . ' ' . $userCnt); } else { print_unescaped(' | '. $usr); } } print_unescaped(' | '); // loop over dts $i_tot = 0; foreach($dates as $dt) { if ($poll->getType() === '0') { $date_id = strtotime($dt->getDt()); } else { $date_id = $dt->getText(); } // look what user voted for this dts $found = false; foreach ($others[$usr] as $vote) { $voteVal = null; if($poll->getType() === '0') { $voteVal = strtotime($vote->getDt()); } else { $voteVal = $vote->getText(); } if ($date_id === $voteVal) { if ($vote->getType() === '1') { $cl = 'poll-cell-is'; $total_y[$i_tot]++; } else if ($vote->getType() === '0') { $cl = 'poll-cell-not'; $total_n[$i_tot]++; } else { $cl = 'poll-cell-maybe'; } $found = true; break; } } if(!$found) { $cl = 'poll-cell-un'; } print_unescaped(''); $i_tot++; } print_unescaped(' | '); print_unescaped(' |
');
$avatar = $avaMgr->getAvatar($userId)->get(32);
if($avatar !== false) {
print_unescaped(' ' . strtoupper($userId[0]) . ' ');
}
p($userMgr->get($userId)->getDisplayName());
print_unescaped(' | ');
} else {
print_unescaped(''); } $i_tot = 0; foreach ($dates as $dt) { if ($poll->getType() === '0') { $date_id = strtotime($dt->getDt()); } else { $date_id = $dt->getText(); } // see if user already has data for this event $cl = 'poll-cell-active-un'; if (isset($user_voted)) { foreach ($user_voted as $obj) { $voteVal = null; if($poll->getType() === '0') { $voteVal = strtotime($obj->getDt()); } else { $voteVal = $obj->getText(); } if ($voteVal === $date_id) { if ($obj->getType() === '1') { $cl = 'poll-cell-active-is'; $total_y[$i_tot]++; } else if ($obj->getType() === '0') { $cl = 'poll-cell-active-not'; $total_n[$i_tot]++; } else if($obj->getType() === '2'){ $cl = 'poll-cell-active-maybe'; } break; } } } print_unescaped(' | '); $i_tot++; } print_unescaped(' | ||
t('Total')); ?> |
getType() === '0' ? strtotime($dates[$i]->getDt()) : str_replace(' ', '_', $dates[$i]->getText());
if (isset($total_y[$i])) {
$val = $total_y[$i];
} else {
$val = 0;
}
?>
>
>
|
|||
t('Best option')); ?> | '); } ?>||||
'); $prev = ""; for ($i = 0; $i < count($dates); $i++) { $c = ($prev != date('Y-m-d', strtotime($dates[$i]->getDt())) ? ' bordered' : ''); $prev = date('Y-m-d', strtotime($dates[$i]->getDt())); $ch_obj = date('H:i', strtotime($dates[$i]->getDt())); print_unescaped(' | ' . $ch_obj . ' | '); } print_unescaped('' . $l->t('All') . ' | ||
'); foreach ($dates as $el) { print_unescaped(' | ' . $el->getText() . ' | '); } print_unescaped(''); } ?> |
/>
t('The poll expired on %s. Voting is disabled, but you can still comment.', array(date('d.m.Y H:i', strtotime($poll->getExpire()))))); ?>