if (!$g_user->hasPermission('plugin_poll')) { camp_html_display_error(getGS('You do not have the right to manage polls.')); exit; } $allLanguages = Language::GetLanguages(); $f_poll_nr = Input::Get('f_poll_nr', 'int'); $f_fk_language_id = Input::Get('f_fk_language_id', 'int'); $f_from = Input::Get('f_from', 'string', false); $poll = new Poll($f_fk_language_id, $f_poll_nr); if ($poll->exists()) { // edit existing poll $parent_poll_nr = $poll->getProperty('parent_poll_nr'); $is_extended = $poll->isExtended(); $title = $poll->getProperty('title'); $question = $poll->getProperty('question'); $date_begin = $poll->getProperty('date_begin'); $date_end = $poll->getProperty('date_end'); $nr_of_answers = $poll->getProperty('nr_of_answers'); $fk_language_id = $poll->getProperty('fk_language_id'); $votes_per_user = $poll->getProperty('votes_per_user'); $poll_answers = $poll->getAnswers(); foreach ($poll_answers as $poll_answer) { $answers[$poll_answer->getProperty('nr_answer')] = $poll_answer->getProperty('answer'); }
public static function SyncNrOfAnswers($p_fk_language_id, $p_fk_poll_nr) { global $g_ado_db; $poll = new Poll($p_fk_language_id, $p_fk_poll_nr); if (count($poll->getTranslations()) > 1) { $nr_of_answers = $poll->getProperty('nr_of_answers'); $query = "DELETE FROM plugin_poll_answer WHERE fk_poll_nr = $p_fk_poll_nr AND fk_language_id = $p_fk_language_id AND nr_answer > $nr_of_answers"; $g_ado_db->execute($query); Poll::triggerStatistics($p_fk_poll_nr); } }
camp_html_display_error(getGS('You do not have the right to manage polls.')); exit; } $allLanguages = Language::GetLanguages(); $f_poll_nr = Input::Get('f_poll_nr', 'int'); $f_fk_language_id = Input::Get('f_fk_language_id', 'int'); $poll = new Poll($f_fk_language_id, $f_poll_nr); if ($poll->exists()) { foreach ($poll->getTranslations() as $translation) { $existing[$translation->getLanguageId()] = true; } $title = $poll->getProperty('title'); $question = $poll->getProperty('question'); $is_used_as_default = false; } echo camp_html_breadcrumbs(array( array(getGS('Plugins'), $Campsite['WEBSITE_URL'] . '/admin/plugins/manage.php'), array(getGS('Polls'), $Campsite['WEBSITE_URL'] . '/admin/poll/index.php'), array(getGS('Translate Poll'), ''), )); ?> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-top: 5px;"> <TR> <TD><A HREF="index.php"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/left_arrow.png" BORDER="0"></A></TD> <TD><A HREF="index.php"><B><?php putGS("Poll List"); ?></B></A></TD> </TR>
exit; } $allLanguages = Language::GetLanguages(); $f_poll_nr = Input::Get('f_poll_nr', 'int'); $f_fk_language_id = Input::Get('f_fk_language_id', 'int'); $poll = new Poll($f_fk_language_id, $f_poll_nr); if (!$poll->exists()) { camp_html_display_error(getGS('Poll does not exists.')); exit; } $title = $poll->getProperty('title'); $question = $poll->getProperty('question'); $date_begin = $poll->getProperty('date_begin'); $date_end = $poll->getProperty('date_end'); $fk_language_id = $poll->getProperty('fk_language_id'); $votes_per_user = $poll->getProperty('votes_per_user'); /* $topArray = array('Pub' => $publicationObj, 'Issue' => $issueObj, 'Section' => $sectionObj); camp_html_content_top(getGS('Add new article'), $topArray, true, false, array(getGS("Articles") => "/$ADMIN/articles/?f_publication_id=$f_publication_id&f_issue_number=$f_issue_number&f_section_number=$f_section_number&f_language_id=$f_language_id")); */ ?> <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1" class="action_buttons" style="padding-top: 5px;"> <TR> <TD><A HREF="index.php"><IMG SRC="<?php echo $Campsite["ADMIN_IMAGE_BASE_URL"]; ?>/left_arrow.png" BORDER="0"></A></TD>