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


PHP Poll::checkMultilingual方法代码示例

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


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

示例1: getPolls

 /**
  * Get all polls and return them as array
  * @return array
  */
 public function getPolls()
 {
     $arrPolls = array();
     $objPolls = $this->Database->execute("SELECT id, title FROM tl_poll" . (\Poll::checkMultilingual() ? " WHERE lid=0" : "") . " ORDER BY title");
     while ($objPolls->next()) {
         $arrPolls[$objPolls->id] = $objPolls->title;
     }
     return $arrPolls;
 }
开发者ID:hamidabbaszadeh,项目名称:contao-polls,代码行数:13,代码来源:tl_content.php

示例2: array

 * @author  Codefog <http://codefog.pl>
 * @author  Kamil Kuzminski <kamil.kuzminski@codefog.pl>
 * @license LGPL
 */
/**
 * Load tl_module language files
 */
System::loadLanguageFile('tl_module');
/**
 * Table tl_poll
 */
$GLOBALS['TL_DCA']['tl_poll'] = array('config' => array('dataContainer' => 'Table', 'ctable' => array('tl_poll_option'), 'switchToEdit' => true, 'enableVersioning' => true, 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('sorting' => array('mode' => 1, 'fields' => array('title'), 'flag' => 1, 'panelLayout' => 'filter;search,limit'), 'label' => array('fields' => array('title'), 'format' => '%s', 'label_callback' => array('tl_poll', 'addStatus')), 'global_operations' => array('all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['edit'], 'href' => 'table=tl_poll_option', 'icon' => 'edit.gif', 'attributes' => 'class="contextmenu"'), 'editheader' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['editheader'], 'href' => 'act=edit', 'icon' => 'header.gif', 'attributes' => 'class="edit-header"'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"'), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset(); return AjaxRequest.toggleVisibility(this, %s);"', 'button_callback' => array('tl_poll', 'toggleIcon')), 'feature' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['feature'], 'icon' => 'featured.gif', 'attributes' => 'onclick="Backend.getScrollOffset(); return AjaxRequest.toggleFeatured(this, %s);"', 'button_callback' => array('tl_poll', 'iconFeatured')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('default' => '{title_legend},title,type,voteInterval,protected,featured,active_behaviorNotVoted,active_behaviorVoted,inactive_behaviorNotVoted,inactive_behaviorVoted;{redirect_legend:hide},jumpTo;{publish_legend},published,closed,activeStart,activeStop,showStart,showStop'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'lid' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'language' => array('sql' => "varchar(2) NOT NULL default ''"), 'title' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['title'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255), 'sql' => "varchar(255) NOT NULL default ''"), 'type' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['type'], 'default' => 'single', 'exclude' => true, 'inputType' => 'select', 'options' => array('single', 'multiple'), 'reference' => &$GLOBALS['TL_LANG']['tl_poll']['type'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(8) NOT NULL default ''"), 'voteInterval' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['voteInterval'], 'default' => 86400, 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'digit', 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'protected' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['protected'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'featured' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['featured'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'active_behaviorNotVoted' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['active_behaviorNotVoted'], 'default' => 'opt1', 'exclude' => true, 'inputType' => 'select', 'options' => array('opt1', 'opt2', 'opt3'), 'reference' => &$GLOBALS['TL_LANG']['tl_poll']['behaviorNotVoted'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(4) NOT NULL default ''"), 'active_behaviorVoted' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['active_behaviorVoted'], 'default' => 'opt1', 'exclude' => true, 'inputType' => 'select', 'options' => array('opt1', 'opt2', 'opt3'), 'reference' => &$GLOBALS['TL_LANG']['tl_poll']['behaviorVoted'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(4) NOT NULL default ''"), 'inactive_behaviorNotVoted' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['inactive_behaviorNotVoted'], 'default' => 'opt1', 'exclude' => true, 'inputType' => 'select', 'options' => array('opt1', 'opt2', 'opt3'), 'reference' => &$GLOBALS['TL_LANG']['tl_poll']['behaviorNotVoted'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(4) NOT NULL default ''"), 'inactive_behaviorVoted' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['inactive_behaviorVoted'], 'default' => 'opt1', 'exclude' => true, 'inputType' => 'select', 'options' => array('opt1', 'opt2', 'opt3'), 'reference' => &$GLOBALS['TL_LANG']['tl_poll']['behaviorVoted'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(4) NOT NULL default ''"), 'jumpTo' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['jumpTo'], 'exclude' => true, 'filter' => true, 'inputType' => 'pageTree', 'eval' => array('fieldType' => 'radio', 'tl_class' => 'clr'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'published' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['published'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('doNotCopy' => true, 'tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'closed' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['closed'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('doNotCopy' => true, 'tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'activeStart' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['activeStart'], 'exclude' => true, 'search' => true, 'flag' => 8, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'activeStop' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['activeStop'], 'exclude' => true, 'search' => true, 'flag' => 8, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'showStart' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['showStart'], 'exclude' => true, 'search' => true, 'flag' => 8, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'showStop' => array('label' => &$GLOBALS['TL_LANG']['tl_poll']['showStop'], 'exclude' => true, 'search' => true, 'flag' => 8, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''")));
/**
 * Provide support for DC_Multilingual
 */
if (\Poll::checkMultilingual()) {
    $GLOBALS['TL_DCA']['tl_poll']['config']['dataContainer'] = 'Multilingual';
    $GLOBALS['TL_DCA']['tl_poll']['config']['languages'] = Poll::getAvailableLanguages();
    $GLOBALS['TL_DCA']['tl_poll']['config']['pidColumn'] = 'lid';
    $GLOBALS['TL_DCA']['tl_poll']['config']['fallbackLang'] = Poll::getFallbackLanguage();
    // Make "title" field translatable
    $GLOBALS['TL_DCA']['tl_poll']['fields']['title']['eval']['translatableFor'] = '*';
}
/**
 * Provide miscellaneous methods that are used by the data configuration array.
 */
class tl_poll extends Backend
{
    /**
     * Add the poll status
     * @param array
开发者ID:hamidabbaszadeh,项目名称:contao-polls,代码行数:31,代码来源:tl_poll.php


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