当前位置: 首页>>代码示例>>PHP>>正文


PHP Poll::getTranslations方法代码示例

本文整理汇总了PHP中Poll::getTranslations方法的典型用法代码示例。如果您正苦于以下问题:PHP Poll::getTranslations方法的具体用法?PHP Poll::getTranslations怎么用?PHP Poll::getTranslations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Poll的用法示例。


在下文中一共展示了Poll::getTranslations方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: camp_html_breadcrumbs

    camp_html_display_error(getGS('You do not have the right to manage polls.'));
    exit;
}

$f_poll_nr = Input::Get('f_poll_nr', 'int');
$f_fk_language_id = Input::Get('f_fk_language_id', 'int');

$f_nr_answer = Input::Get('f_nr_answer', 'int');

$poll = new Poll($f_fk_language_id, $f_poll_nr);

$format = '%.2f';

$display[] = $poll;

foreach($poll->getTranslations() as $translation) {
    if ($translation->getLanguageId() != $poll->getLanguageId()) {
        $display[] = $translation;   
    }    
}

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('Result'), ''),
));
?>
<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>
开发者ID:nistormihai,项目名称:Newscoop,代码行数:31,代码来源:result.php

示例2: OnPollDelete

 /**
  * Called when poll is deleted
  *
  * @param int $p_poll_nr
  */
 public static function OnPollDelete($p_poll_nr)
 {
     if (count(Poll::getTranslations($p_poll_nr)) > 1) {
         return;   
     }
           
     foreach (PollArticle::getAssignments($p_poll_nr) as $record) {
         $record->delete();   
     }   
 }
开发者ID:nistormihai,项目名称:Newscoop,代码行数:15,代码来源:PollArticle.php

示例3: SyncNrOfAnswers

    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);
        }
    }
开发者ID:nistormihai,项目名称:Newscoop,代码行数:18,代码来源:PollAnswer.php


注:本文中的Poll::getTranslations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。