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 .= '' . $dt . ''; } $for_string_years = ''; foreach (array_keys($arr_years) as $year) { $for_string_years .= '' . $year . ''; } } if ($poll->getDescription() !== null && $poll->getDescription() !== '') { $description = nl2br($poll->getDescription()); } else { $description = $l->t('No description provided.'); } // init array for counting 'yes'-votes for each date $total_y = array(); $total_n = array(); for ($i = 0 ; $i < count($dates) ; $i++) { $total_y[$i] = 0; $total_n[$i] = 0; } $user_voted = array(); $pollUrl = $urlGenerator->linkToRouteAbsolute('polls.page.goto_poll', ['hash' => $poll->getHash()]); ?>
t('Already have an account?')); $loginUrl = OCP\Util::linkToAbsolute('', 'index.php' ) . '?redirect_url=' . $urlGenerator->linkToRoute('polls.page.goto_poll', ['hash' => $poll->getHash()]); ?> t('Login')); ?>

getTitle()); ?>

t('Poll')); ?>

getType() === '0') { print_unescaped(''); print_unescaped($for_string_years); print_unescaped(''); } else { print_unescaped(''); foreach ($dates as $el) { print_unescaped(''); } print_unescaped(''); } ?> getType() === '0'){ print_unescaped('' . $for_string_dates . ''); $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(''); } print_unescaped(''); } ?> getUserId()])) { $others[$vote->getUserId()] = array(); } array_push($others[$vote->getUserId()], $vote); } $userCnt = 0; foreach (array_keys($others) as $usr) { $userCnt++; if ($usr === $userId) { // if poll expired, just put current user among the others; // otherwise skip here to add current user as last row (to vote) if (!$expired) { $user_voted = $others[$usr]; continue; } } print_unescaped(''); if($userMgr->get($usr) != null && !$isAnonymous) { 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(''); } } $total_y_others = array_merge(array(), $total_y); $total_n_others = array_merge(array(), $total_n); if (!$expired) { print_unescaped(''); if (User::isLoggedIn()) { 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(''); } ?> '); } ?> getType() === '0') { print_unescaped(''); $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(''); } print_unescaped(''); print_unescaped('' . $for_string_dates . ''); } ?> getType() === '0') { print_unescaped($for_string_years); } else { print_unescaped(''); foreach ($dates as $el) { print_unescaped(''); } print_unescaped(''); } ?>
' . $l->t('All') . '' . $el->getText() . '' . $l->t('All') . '
' . $ch_obj . '
'); $avatar = $avaMgr->getAvatar($usr)->get(32); if($avatar !== false) { print_unescaped(''); } else { 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('
'); $avatar = $avaMgr->getAvatar($userId)->get(32); if($avatar !== false) { print_unescaped(''); } else { print_unescaped('
' . strtoupper($userId[0]) . '
'); } p($userMgr->get($userId)->getDisplayName()); 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')); ?>
' . $ch_obj . '' . $l->t('All') . '
' . $el->getText() . '

/>

t('Polls summary')); ?>

t('Poll expired')); ?>

t('The poll expired on %s. Voting is disabled, but you can still comment.', array(date('d.m.Y H:i', strtotime($poll->getExpire()))))); ?>

t('Comments')); ?>

t('Login')); ?> t('or')); ?> '); ?> t('Logged in as') . ' ' . $userId); ?>

' . date('d.m.Y H:i:s', strtotime($comment->getDt())) . ''); if($isAnonymous) { p('Anonymous'); } else { if($userMgr->get($comment->getUserId()) != null) { p($userMgr->get($comment->getUserId())->getDisplayName()); } else { print_unescaped(''); p($comment->getUserId()); print_unescaped(''); } } ?>
getComment()); ?>
t('No comments yet. Be the first.')); ?>