本文整理汇总了PHP中System::getLanguages方法的典型用法代码示例。如果您正苦于以下问题:PHP System::getLanguages方法的具体用法?PHP System::getLanguages怎么用?PHP System::getLanguages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System
的用法示例。
在下文中一共展示了System::getLanguages方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run the controller and parse the login template
*/
public function run()
{
$this->Template = new BackendTemplate('be_login');
// Show a cookie warning
if (Input::get('referer', true) != '' && empty($_COOKIE)) {
$this->Template->noCookies = $GLOBALS['TL_LANG']['MSC']['noCookies'];
}
$strHeadline = sprintf($GLOBALS['TL_LANG']['MSC']['loginTo'], Config::get('websiteTitle'));
$this->Template->theme = Backend::getTheme();
$this->Template->messages = Message::generate();
$this->Template->base = Environment::get('base');
$this->Template->language = $GLOBALS['TL_LANGUAGE'];
$this->Template->languages = System::getLanguages(true);
$this->Template->title = specialchars($strHeadline);
$this->Template->charset = Config::get('characterSet');
$this->Template->action = ampersand(Environment::get('request'));
$this->Template->userLanguage = $GLOBALS['TL_LANG']['tl_user']['language'][0];
$this->Template->headline = $strHeadline;
$this->Template->curLanguage = Input::post('language') ?: str_replace('-', '_', $GLOBALS['TL_LANGUAGE']);
$this->Template->curUsername = Input::post('username') ?: '';
$this->Template->uClass = $_POST && empty($_POST['username']) ? ' class="login_error"' : '';
$this->Template->pClass = $_POST && empty($_POST['password']) ? ' class="login_error"' : '';
$this->Template->loginButton = specialchars($GLOBALS['TL_LANG']['MSC']['loginBT']);
$this->Template->username = $GLOBALS['TL_LANG']['tl_user']['username'][0];
$this->Template->password = $GLOBALS['TL_LANG']['MSC']['password'][0];
$this->Template->feLink = $GLOBALS['TL_LANG']['MSC']['feLink'];
$this->Template->frontendFile = Environment::get('base');
$this->Template->disableCron = Config::get('disableCron');
$this->Template->ie6warning = sprintf($GLOBALS['TL_LANG']['ERR']['ie6warning'], '<a href="http://ie6countdown.com">', '</a>');
$this->Template->default = $GLOBALS['TL_LANG']['MSC']['default'];
$this->Template->output();
}
示例2: generateWizardList
/**
* Generate a list for the dcaWizard displaying the languages
* @param \Database_Result
* @param string
* @return string
*/
public function generateWizardList($objRecords, $strId, $widget)
{
$strReturn = '
<table class="tl_listing showColumns">
<thead>
<td class="tl_folder_tlist">' . $GLOBALS['TL_LANG']['tl_nc_language']['language'][0] . '</td>
<td class="tl_folder_tlist">' . $GLOBALS['TL_LANG']['tl_nc_language']['fallback'][0] . '</td>
<td class="tl_folder_tlist"></td>
</thead>
<tbody>';
$arrLanguages = \System::getLanguages();
while ($objRecords->next()) {
$row = $objRecords->row();
$strReturn .= '
<tr>
<td class="tl_file_list">' . $arrLanguages[$objRecords->language] . '</td>
<td class="tl_file_list">' . ($objRecords->fallback ? '✔' : '') . '</td>
<td class="tl_file_list">' . $widget->generateRowOperation('edit', $row) . '</td>
</tr>
';
}
$strReturn .= '
</tbody>
</table>';
return $strReturn;
}
示例3: __construct
/**
* Initialize the object
* @param string
*/
public function __construct($strTable)
{
$this->import('Session');
$this->intGroupId = (int) \Session::getInstance()->get('iso_products_gid');
// Check if the group exists
if ($this->intGroupId > 0) {
$objGroup = \Isotope\Model\Group::findByPk($this->intGroupId);
if (null === $objGroup) {
if (\BackendUser::getInstance()->isAdmin || !is_array(\BackendUser::getInstance()->iso_groups)) {
$this->intGroupId = 0;
} elseif (!\BackendUser::getInstance()->isAdmin) {
$this->intGroupId = (int) \Database::getInstance()->prepare("SELECT id FROM tl_iso_group WHERE id IN ('" . implode("','", \BackendUser::getInstance()->iso_groups) . "') ORDER BY " . \Database::getInstance()->findInSet('id', \BackendUser::getInstance()->iso_groups))->limit(1)->execute()->id;
}
}
}
// Redirect if the product was not found
if (isset($_GET['id'])) {
$objProduct = \Database::getInstance()->prepare("SELECT id FROM {$strTable} WHERE id=?")->limit(1)->execute(\Input::get('id', true));
if (!$objProduct->numRows) {
\Controller::redirect(preg_replace('/(&)?id=[^&]*/i', '', \Environment::get('request')));
}
}
$arrClipboard = $this->Session->get('CLIPBOARD');
// Cut all records
if ($arrClipboard[$strTable]['mode'] == 'cutAll' && \Input::get('act') != 'cutAll') {
\Controller::redirect(\Backend::addToUrl('&act=cutAll'));
}
parent::__construct($strTable);
// Allow to customize languages via the onload_callback
if (isset($GLOBALS['TL_DCA'][$this->strTable]['config']['languages'])) {
$arrPageLanguages = $GLOBALS['TL_DCA'][$this->strTable]['config']['languages'];
} else {
$arrPageLanguages = array_map(function ($strLang) {
return str_replace('-', '_', $strLang);
}, $this->Database->execute("SELECT DISTINCT language FROM tl_page WHERE type='root' AND language!=''")->fetchEach('language'));
}
if (count($arrPageLanguages) > 1) {
$this->arrTranslationLabels = \System::getLanguages();
$this->arrTranslations = array_intersect(array_keys($this->arrTranslationLabels), $arrPageLanguages);
}
}
示例4: listRows
/**
* child_record_callback
* @param array
* @return string
*/
public function listRows($arrRow)
{
if (empty($this->arrTranslations)) {
$this->arrTranslations = \System::getLanguages();
}
if (empty($this->arrGateways)) {
$objGateways = \Database::getInstance()->execute('SELECT id,title FROM tl_nc_gateway');
while ($objGateways->next()) {
$this->arrGateways[$objGateways->id] = $objGateways->title;
}
}
$arrTranslations = \Database::getInstance()->prepare('SELECT language FROM tl_nc_language WHERE pid=?')->execute($arrRow['id'])->fetchEach('language');
$strBuffer = '
<div class="cte_type ' . ($arrRow['published'] ? 'published' : 'unpublished') . '"><strong>' . $arrRow['title'] . '</strong> - ' . $this->arrGateways[$arrRow['gateway']] . '</div>
<div>
<ul>';
foreach ($arrTranslations as $strLang) {
$strBuffer .= '<li>➤ ' . $this->arrTranslations[$strLang] . '</li>';
}
$strBuffer .= '</ul></div>';
return $strBuffer;
}
示例5: array
<?php
/**
* Contao Open Source CMS
*
* Copyright (c) 2005-2016 Leo Feyer
*
* @license LGPL-3.0+
*/
/**
* Table tl_user
*/
$GLOBALS['TL_DCA']['tl_user'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'onload_callback' => array(array('tl_user', 'checkPermission')), 'onsubmit_callback' => array(array('tl_user', 'storeDateAdded'), array('tl_user', 'checkRemoveSession')), 'ondelete_callback' => array(array('tl_user', 'removeSession')), 'sql' => array('keys' => array('id' => 'primary', 'username' => 'unique', 'email' => 'index'))), 'list' => array('sorting' => array('mode' => 2, 'fields' => array('dateAdded DESC'), 'flag' => 1, 'panelLayout' => 'filter;sort,search,limit'), 'label' => array('fields' => array('icon', 'name', 'username', 'dateAdded'), 'showColumns' => true, 'label_callback' => array('tl_user', 'addIcon')), '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_user']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif', 'button_callback' => array('tl_user', 'editUser')), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif', 'button_callback' => array('tl_user', 'copyUser')), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"', 'button_callback' => array('tl_user', 'deleteUser')), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('tl_user', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['show'], 'href' => 'act=show', 'icon' => 'show.gif'), 'su' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['su'], 'href' => 'key=su', 'icon' => 'su.gif', 'button_callback' => array('tl_user', 'switchUser')))), 'palettes' => array('__selector__' => array('inherit', 'admin'), 'login' => '{name_legend},name,email;{backend_legend},language,uploader,showHelp,thumbnails,useRTE,useCE;{session_legend},session;{theme_legend:hide},backendTheme;{password_legend},password', 'admin' => '{name_legend},username,name,email;{backend_legend:hide},language,uploader,showHelp,thumbnails,useRTE,useCE;{theme_legend:hide},backendTheme;{password_legend:hide},pwChange,password;{admin_legend},admin;{account_legend},disable,start,stop', 'default' => '{name_legend},username,name,email;{backend_legend:hide},language,uploader,showHelp,thumbnails,useRTE,useCE;{theme_legend:hide},backendTheme;{password_legend:hide},pwChange,password;{admin_legend},admin;{groups_legend},groups,inherit;{account_legend},disable,start,stop', 'group' => '{name_legend},username,name,email;{backend_legend:hide},language,uploader,showHelp,thumbnails,useRTE,useCE;{theme_legend:hide},backendTheme;{password_legend:hide},pwChange,password;{admin_legend},admin;{groups_legend},groups,inherit;{account_legend},disable,start,stop', 'extend' => '{name_legend},username,name,email;{backend_legend:hide},language,uploader,showHelp,thumbnails,useRTE,useCE;{theme_legend:hide},backendTheme;{password_legend:hide},pwChange,password;{admin_legend},admin;{groups_legend},groups,inherit;{modules_legend},modules,themes;{pagemounts_legend},pagemounts,alpty;{filemounts_legend},filemounts,fop;{forms_legend},forms,formp;{account_legend},disable,start,stop', 'custom' => '{name_legend},username,name,email;{backend_legend:hide},language,uploader,showHelp,thumbnails,useRTE,useCE;{theme_legend:hide},backendTheme;{password_legend:hide},pwChange,password;{admin_legend},admin;{groups_legend},groups,inherit;{modules_legend},modules,themes;{pagemounts_legend},pagemounts,alpty;{filemounts_legend},filemounts,fop;{forms_legend},forms,formp;{account_legend},disable,start,stop'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'username' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['username'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'rgxp' => 'extnd', 'nospace' => true, 'unique' => true, 'maxlength' => 64), 'sql' => "varchar(64) COLLATE utf8_bin NULL"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['name'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['email'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'rgxp' => 'email', 'maxlength' => 255, 'unique' => true, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'language' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['language'], 'default' => str_replace('-', '_', $GLOBALS['TL_LANGUAGE']), 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'options' => System::getLanguages(true), 'eval' => array('rgxp' => 'locale', 'tl_class' => 'w50'), 'sql' => "varchar(5) NOT NULL default ''"), 'backendTheme' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['backendTheme'], 'exclude' => true, 'inputType' => 'select', 'options' => Backend::getThemes(), 'sql' => "varchar(32) NOT NULL default ''"), 'uploader' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['uploader'], 'exclude' => true, 'inputType' => 'select', 'options' => array('DropZone', 'FileUpload'), 'reference' => &$GLOBALS['TL_LANG']['tl_user'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'showHelp' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['showHelp'], 'default' => 1, 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'thumbnails' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['thumbnails'], 'default' => 1, 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'useRTE' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['useRTE'], 'default' => 1, 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'useCE' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['useCE'], 'default' => 1, 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'password' => array('label' => &$GLOBALS['TL_LANG']['MSC']['password'], 'exclude' => true, 'inputType' => 'password', 'eval' => array('mandatory' => true, 'preserveTags' => true, 'minlength' => Config::get('minPasswordLength')), 'sql' => "varchar(128) NOT NULL default ''"), 'pwChange' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['pwChange'], 'exclude' => true, 'inputType' => 'checkbox', 'filter' => true, 'sql' => "char(1) NOT NULL default ''"), 'admin' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['admin'], 'exclude' => true, 'inputType' => 'checkbox', 'filter' => true, 'eval' => array('submitOnChange' => true), 'save_callback' => array(array('tl_user', 'checkAdminStatus')), 'sql' => "char(1) NOT NULL default ''"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['groups'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkboxWizard', 'foreignKey' => 'tl_user_group.name', 'eval' => array('multiple' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'belongsToMany', 'load' => 'lazy')), 'inherit' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['inherit'], 'exclude' => true, 'default' => 'group', 'inputType' => 'radio', 'options' => array('group', 'extend', 'custom'), 'reference' => &$GLOBALS['TL_LANG']['tl_user'], 'eval' => array('helpwizard' => true, 'submitOnChange' => true), 'sql' => "varchar(12) NOT NULL default ''"), 'modules' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['modules'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'options_callback' => array('tl_user', 'getModules'), 'reference' => &$GLOBALS['TL_LANG']['MOD'], 'eval' => array('multiple' => true, 'helpwizard' => true), 'sql' => "blob NULL"), 'themes' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['themes'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('css', 'modules', 'layout', 'image_sizes', 'theme_import', 'theme_export'), 'reference' => &$GLOBALS['TL_LANG']['MOD'], 'eval' => array('multiple' => true), 'sql' => "blob NULL"), 'pagemounts' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['pagemounts'], 'exclude' => true, 'inputType' => 'pageTree', 'eval' => array('multiple' => true, 'fieldType' => 'checkbox'), 'sql' => "blob NULL"), 'alpty' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['alpty'], 'default' => array('regular', 'redirect', 'forward'), 'exclude' => true, 'inputType' => 'checkbox', 'options' => array_keys($GLOBALS['TL_PTY']), 'reference' => &$GLOBALS['TL_LANG']['PTY'], 'eval' => array('multiple' => true, 'helpwizard' => true), 'sql' => "blob NULL"), 'filemounts' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['filemounts'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('multiple' => true, 'fieldType' => 'checkbox'), 'sql' => "blob NULL"), 'fop' => array('label' => &$GLOBALS['TL_LANG']['FOP']['fop'], 'default' => array('f1', 'f2', 'f3'), 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('f1', 'f2', 'f3', 'f4', 'f5', 'f6'), 'reference' => &$GLOBALS['TL_LANG']['FOP'], 'eval' => array('multiple' => true), 'sql' => "blob NULL"), 'forms' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['forms'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => 'tl_form.title', 'eval' => array('multiple' => true), 'sql' => "blob NULL"), 'formp' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['formp'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true), 'sql' => "blob NULL"), 'disable' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['disable'], 'exclude' => true, 'filter' => true, 'flag' => 2, 'inputType' => 'checkbox', 'save_callback' => array(array('tl_user', 'checkAdminDisable')), 'sql' => "char(1) NOT NULL default ''"), 'start' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['start'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['stop'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'session' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['session'], 'exclude' => true, 'input_field_callback' => array('tl_user', 'sessionField'), 'eval' => array('doNotShow' => true, 'doNotCopy' => true), 'sql' => "blob NULL"), 'dateAdded' => array('label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'], 'default' => time(), 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'lastLogin' => array('eval' => array('rgxp' => 'datim', 'doNotShow' => true, 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'currentLogin' => array('label' => &$GLOBALS['TL_LANG']['MSC']['lastLogin'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'loginCount' => array('default' => 3, 'eval' => array('doNotCopy' => true), 'sql' => "smallint(5) unsigned NOT NULL default '3'"), 'locked' => array('eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'")));
/**
* Provide miscellaneous methods that are used by the data configuration array.
*
* @author Leo Feyer <https://github.com/leofeyer>
*/
class tl_user extends Backend
{
/**
* Import the back end user object
*/
public function __construct()
{
parent::__construct();
$this->import('BackendUser', 'User');
}
/**
* Check permissions to edit table tl_user
*/
示例6: edit
/**
* Auto-generate a form to edit the current database record
* @param integer
* @param integer
* @return string
*/
public function edit($intID = false, $ajaxId = false)
{
if ($GLOBALS['TL_DCA'][$this->strTable]['config']['notEditable']) {
\System::log('Table ' . $this->strTable . ' is not editable', 'DC_ProductData edit()', TL_ERROR);
\Controller::redirect('contao/main.php?act=error');
}
if ($intID) {
$this->intId = $intID;
}
$return = '';
$this->values[] = $this->intId;
$this->procedure[] = 'id=?';
$this->blnCreateNewVersion = false;
$this->blnEditLanguage = false;
// Get the current record
$objRow = \Database::getInstance()->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?")->limit(1)->execute($this->intId);
// Redirect if there is no record with the given ID
if ($objRow->numRows < 1) {
\System::log('Could not load record ID "' . $this->intId . '" of table "' . $this->strTable . '"!', 'DC_ProductData edit()', TL_ERROR);
\Controller::redirect('contao/main.php?act=error');
} elseif ($objRow->language != '') {
\System::log('Cannot edit language record ID "' . $this->intId . '" of table "' . $this->strTable . '"!', 'DC_ProductData edit()', TL_ERROR);
\Controller::redirect('contao/main.php?act=error');
}
$this->objActiveRecord = $objRow;
// Load and/or change language
// Add support for i18nl10n extension
if (in_array('i18nl10n', \Config::getInstance()->getActiveModules())) {
$arrPageLanguages = array_filter(array_unique(deserialize($GLOBALS['TL_CONFIG']['i18nl10n_languages'], true)));
} else {
$arrPageLanguages = $this->Database->execute("SELECT DISTINCT language FROM tl_page WHERE type='root'")->fetchEach('language');
$arrPageLanguages = array_map(function ($strLang) {
return str_replace('-', '_', $strLang);
}, $arrPageLanguages);
}
if (count($arrPageLanguages) > 1) {
$this->arrTranslationLabels = \System::getLanguages();
$this->arrTranslations = array_intersect(array_keys($this->arrTranslationLabels), $arrPageLanguages);
if (\Input::post('FORM_SUBMIT') == 'tl_language') {
$session = $this->Session->getData();
if (in_array(\Input::post('language'), $this->arrTranslations)) {
$session['language'][$this->strTable][$this->intId] = \Input::post('language');
if (\Input::post('deleteLanguage') != '') {
$this->Database->prepare("DELETE FROM " . $this->strTable . " WHERE pid=? AND language=?")->execute($this->intId, \Input::post('language'));
unset($session['language'][$this->strTable][$this->intId]);
}
} else {
unset($session['language'][$this->strTable][$this->intId]);
}
$this->Session->setData($session);
$_SESSION['TL_INFO'] = '';
\Controller::reload();
}
if ($_SESSION['BE_DATA']['language'][$this->strTable][$this->intId] != '' && in_array($_SESSION['BE_DATA']['language'][$this->strTable][$this->intId], $this->arrTranslations)) {
$objRow = $this->Database->prepare("SELECT * FROM " . $this->strTable . " WHERE pid=? AND language=?")->execute($this->intId, $_SESSION['BE_DATA']['language'][$this->strTable][$this->intId]);
if (!$objRow->numRows) {
$intId = $this->Database->prepare("INSERT INTO " . $this->strTable . " (pid,tstamp,language) VALUES (?,?,?)")->execute($this->intId, time(), $_SESSION['BE_DATA']['language'][$this->strTable][$this->intId])->insertId;
$objRow = $this->Database->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?")->execute($intId);
}
$this->objActiveRecord = $objRow;
$this->values = array($this->intId, $_SESSION['BE_DATA']['language'][$this->strTable][$this->intId]);
$this->procedure = array('pid=?', 'language=?');
$this->blnEditLanguage = true;
}
}
$this->createInitialVersion($this->strTable, $this->objActiveRecord->id);
// Change version
if ($GLOBALS['TL_DCA'][$this->strTable]['config']['enableVersioning'] && \Input::post('FORM_SUBMIT') == 'tl_version' && \Input::post('version') != '') {
$objData = $this->Database->prepare("SELECT * FROM tl_version WHERE fromTable=? AND pid=? AND version=?")->limit(1)->execute($this->strTable, $this->objActiveRecord->id, \Input::post('version'));
if ($objData->numRows) {
$data = deserialize($objData->data);
if (is_array($data)) {
$this->Database->prepare("UPDATE " . $objData->fromTable . " %s WHERE id=?")->set($data)->execute($this->objActiveRecord->id);
$this->Database->prepare("UPDATE tl_version SET active='' WHERE pid=?")->execute($this->objActiveRecord->id);
$this->Database->prepare("UPDATE tl_version SET active=1 WHERE pid=? AND version=?")->execute($this->objActiveRecord->id, \Input::post('version'));
\System::log(sprintf('Version %s of record ID %s (table %s) has been restored', \Input::post('version'), $this->objActiveRecord->id, $this->strTable), 'DC_ProductData edit()', TL_GENERAL);
// Trigger the onrestore_callback
if (is_array($GLOBALS['TL_DCA'][$this->strTable]['config']['onrestore_callback'])) {
foreach ($GLOBALS['TL_DCA'][$this->strTable]['config']['onrestore_callback'] as $callback) {
if (is_array($callback)) {
$this->import($callback[0]);
$this->{$callback}[0]->{$callback}[1]($this->objActiveRecord->id, $this->strTable, $data, \Input::post('version'));
} elseif (is_callable($callback)) {
call_user_func($callback, $this->objActiveRecord->id, $this->strTable, $data, \Input::post('version'));
}
}
}
}
}
\Controller::reload();
}
// Build an array from boxes and rows
$this->strPalette = $this->getPalette();
$boxes = trimsplit(';', $this->strPalette);
//.........这里部分代码省略.........
示例7: array
<?php
/**
* Contao Open Source CMS
*
* Copyright (c) 2005-2016 Leo Feyer
*
* @license LGPL-3.0+
*/
/**
* Table tl_member
*/
$GLOBALS['TL_DCA']['tl_member'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'onsubmit_callback' => array(array('tl_member', 'storeDateAdded'), array('tl_member', 'checkRemoveSession')), 'ondelete_callback' => array(array('tl_member', 'removeSession')), 'sql' => array('keys' => array('id' => 'primary', 'username' => 'unique', 'email' => 'index', 'autologin' => 'unique', 'activation' => 'index'))), 'list' => array('sorting' => array('mode' => 2, 'fields' => array('dateAdded DESC'), 'flag' => 1, 'panelLayout' => 'filter;sort,search,limit'), 'label' => array('fields' => array('icon', 'firstname', 'lastname', 'username', 'dateAdded'), 'showColumns' => true, 'label_callback' => array('tl_member', 'addIcon')), '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_member']['edit'], 'href' => 'act=edit', 'icon' => 'edit.svg'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['copy'], 'href' => 'act=copy', 'icon' => 'copy.svg'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['delete'], 'href' => 'act=delete', 'icon' => 'delete.svg', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['toggle'], 'icon' => 'visible.svg', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('tl_member', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['show'], 'href' => 'act=show', 'icon' => 'show.svg'), 'su' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['su'], 'href' => 'key=su', 'icon' => 'su.svg', 'button_callback' => array('tl_member', 'switchUser')))), 'palettes' => array('__selector__' => array('login', 'assignDir'), 'default' => '{personal_legend},firstname,lastname,dateOfBirth,gender;{address_legend:hide},company,street,postal,city,state,country;{contact_legend},phone,mobile,fax,email,website,language;{groups_legend},groups;{login_legend},login;{homedir_legend:hide},assignDir;{account_legend},disable,start,stop'), 'subpalettes' => array('login' => 'username,password', 'assignDir' => 'homeDir'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'firstname' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['firstname'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'lastname' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['lastname'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'dateOfBirth' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['dateOfBirth'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50 wizard'), 'sql' => "varchar(11) NOT NULL default ''"), 'gender' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['gender'], 'exclude' => true, 'inputType' => 'select', 'options' => array('male', 'female'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('includeBlankOption' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'company' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['company'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'street' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['street'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'postal' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['postal'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 32, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'city' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['city'], 'exclude' => true, 'filter' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'state' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['state'], 'exclude' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'country' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['country'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'options_callback' => function () {
return System::getCountries();
}, 'sql' => "varchar(2) NOT NULL default ''"), 'phone' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['phone'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'mobile' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['mobile'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'fax' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['fax'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['email'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'rgxp' => 'email', 'unique' => true, 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'website' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['website'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'url', 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'language' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['language'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'rgxp' => 'locale', 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'options_callback' => function () {
return System::getLanguages();
}, 'sql' => "varchar(5) NOT NULL default ''"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['groups'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkboxWizard', 'foreignKey' => 'tl_member_group.name', 'eval' => array('multiple' => true, 'feEditable' => true, 'feGroup' => 'login'), 'sql' => "blob NULL", 'relation' => array('type' => 'belongsToMany', 'load' => 'lazy')), 'login' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['login'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'username' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['username'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'unique' => true, 'rgxp' => 'extnd', 'nospace' => true, 'maxlength' => 64, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'login'), 'sql' => "varchar(64) COLLATE utf8_bin NULL"), 'password' => array('label' => &$GLOBALS['TL_LANG']['MSC']['password'], 'exclude' => true, 'inputType' => 'password', 'eval' => array('mandatory' => true, 'preserveTags' => true, 'minlength' => Config::get('minPasswordLength'), 'feEditable' => true, 'feGroup' => 'login'), 'save_callback' => array(array('tl_member', 'setNewPassword')), 'sql' => "varchar(128) NOT NULL default ''"), 'assignDir' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['assignDir'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'homeDir' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['homeDir'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'tl_class' => 'clr'), 'sql' => "binary(16) NULL"), 'disable' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['disable'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"), 'start' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['start'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['stop'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'dateAdded' => array('label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'], 'default' => time(), 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'lastLogin' => array('label' => &$GLOBALS['TL_LANG']['MSC']['lastLogin'], 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'currentLogin' => array('label' => &$GLOBALS['TL_LANG']['MSC']['currentLogin'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'loginCount' => array('default' => 3, 'eval' => array('doNotCopy' => true), 'sql' => "smallint(5) unsigned NOT NULL default '3'"), 'locked' => array('eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'session' => array('eval' => array('doNotShow' => true, 'doNotCopy' => true), 'sql' => "blob NULL"), 'autologin' => array('default' => null, 'eval' => array('doNotCopy' => true), 'sql' => "varchar(32) NULL"), 'createdOn' => array('eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'activation' => array('eval' => array('doNotCopy' => true), 'sql' => "varchar(32) NOT NULL default ''")));
/**
* Filter disabled groups in the front end (see #6757)
*/
if (TL_MODE == 'FE') {
$GLOBALS['TL_DCA']['tl_member']['fields']['groups']['options_callback'] = array('tl_member', 'getActiveGroups');
}
/**
* Provide miscellaneous methods that are used by the data configuration array.
*
* @author Leo Feyer <https://github.com/leofeyer>
*/
class tl_member extends Backend
{
/**
示例8: array
<?php
/*
* This file is part of the Translation Fields Bundle.
*
* (c) Daniel Kiesel <https://github.com/iCodr8>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Palettes
*/
$GLOBALS['TL_DCA']['tl_settings']['palettes']['__selector__'][] = 'chooseTranslationLanguages';
$GLOBALS['TL_DCA']['tl_settings']['palettes']['default'] .= ';{translation-fields_legend},dontfillEmptyTranslationFields,chooseTranslationLanguages;';
$GLOBALS['TL_DCA']['tl_settings']['subpalettes']['chooseTranslationLanguages'] = 'translationLanguages';
/**
* Fields
*/
$GLOBALS['TL_DCA']['tl_settings']['fields']['dontfillEmptyTranslationFields'] = array('label' => &$GLOBALS['TL_LANG']['tl_settings']['dontfillEmptyTranslationFields'], 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'm12'));
$GLOBALS['TL_DCA']['tl_settings']['fields']['chooseTranslationLanguages'] = array('label' => &$GLOBALS['TL_LANG']['tl_settings']['chooseTranslationLanguages'], 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true));
$GLOBALS['TL_DCA']['tl_settings']['fields']['translationLanguages'] = array('label' => &$GLOBALS['TL_LANG']['tl_settings']['translationLanguages'], 'inputType' => 'checkboxWizard', 'options' => \System::getLanguages(), 'eval' => array('mandatory' => true, 'multiple' => true));
示例9: array
<?php
/**
* Contao Open Source CMS
*
* Copyright (c) 2005-2015 Leo Feyer
*
* @license LGPL-3.0+
*/
/**
* Table tl_member
*/
$GLOBALS['TL_DCA']['tl_member'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'onsubmit_callback' => array(array('tl_member', 'storeDateAdded'), array('tl_member', 'checkRemoveSession')), 'ondelete_callback' => array(array('tl_member', 'removeSession')), 'sql' => array('keys' => array('id' => 'primary', 'username' => 'unique', 'email' => 'index', 'autologin' => 'unique', 'activation' => 'index'))), 'list' => array('sorting' => array('mode' => 2, 'fields' => array('dateAdded DESC'), 'flag' => 1, 'panelLayout' => 'filter;sort,search,limit'), 'label' => array('fields' => array('icon', 'firstname', 'lastname', 'username', 'dateAdded'), 'showColumns' => true, 'label_callback' => array('tl_member', 'addIcon')), '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_member']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['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_member']['toggle'], 'icon' => 'visible.gif', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('tl_member', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['show'], 'href' => 'act=show', 'icon' => 'show.gif'), 'su' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['su'], 'href' => 'key=su', 'icon' => 'su.gif', 'button_callback' => array('tl_member', 'switchUser')))), 'palettes' => array('__selector__' => array('login', 'assignDir'), 'default' => '{personal_legend},firstname,lastname,dateOfBirth,gender;{address_legend:hide},company,street,postal,city,state,country;{contact_legend},phone,mobile,fax,email,website,language;{groups_legend},groups;{login_legend},login;{homedir_legend:hide},assignDir;{account_legend},disable,start,stop'), 'subpalettes' => array('login' => 'username,password', 'assignDir' => 'homeDir'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'firstname' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['firstname'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'lastname' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['lastname'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'dateOfBirth' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['dateOfBirth'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'date', 'datepicker' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50 wizard'), 'sql' => "varchar(11) NOT NULL default ''"), 'gender' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['gender'], 'exclude' => true, 'inputType' => 'select', 'options' => array('male', 'female'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('includeBlankOption' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'company' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['company'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'street' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['street'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'postal' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['postal'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 32, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'city' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['city'], 'exclude' => true, 'filter' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'state' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['state'], 'exclude' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'country' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['country'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'options' => System::getCountries(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'address', 'tl_class' => 'w50'), 'sql' => "varchar(2) NOT NULL default ''"), 'phone' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['phone'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'mobile' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['mobile'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'fax' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['fax'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'phone', 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['email'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'rgxp' => 'email', 'unique' => true, 'decodeEntities' => true, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'website' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['website'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'url', 'maxlength' => 255, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'contact', 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'language' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['language'], 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'options' => System::getLanguages(), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'rgxp' => 'locale', 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'personal', 'tl_class' => 'w50'), 'sql' => "varchar(5) NOT NULL default ''"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['groups'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkboxWizard', 'foreignKey' => 'tl_member_group.name', 'eval' => array('multiple' => true, 'feEditable' => true, 'feGroup' => 'login'), 'sql' => "blob NULL", 'relation' => array('type' => 'belongsToMany', 'load' => 'lazy')), 'login' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['login'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'username' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['username'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'unique' => true, 'nullIfEmpty' => true, 'rgxp' => 'extnd', 'nospace' => true, 'maxlength' => 64, 'feEditable' => true, 'feViewable' => true, 'feGroup' => 'login'), 'sql' => "varchar(64) COLLATE utf8_bin NULL"), 'password' => array('label' => &$GLOBALS['TL_LANG']['MSC']['password'], 'exclude' => true, 'inputType' => 'password', 'eval' => array('mandatory' => true, 'preserveTags' => true, 'minlength' => Config::get('minPasswordLength'), 'feEditable' => true, 'feGroup' => 'login'), 'save_callback' => array(array('tl_member', 'setNewPassword')), 'sql' => "varchar(128) NOT NULL default ''"), 'assignDir' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['assignDir'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''"), 'homeDir' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['homeDir'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'tl_class' => 'clr'), 'sql' => "binary(16) NULL"), 'disable' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['disable'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"), 'start' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['start'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_member']['stop'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'dateAdded' => array('label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'lastLogin' => array('label' => &$GLOBALS['TL_LANG']['MSC']['lastLogin'], 'eval' => array('rgxp' => 'datim'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'currentLogin' => array('label' => &$GLOBALS['TL_LANG']['MSC']['currentLogin'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'loginCount' => array('sql' => "smallint(5) unsigned NOT NULL default '3'"), 'locked' => array('eval' => array('rgxp' => 'datim'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'session' => array('eval' => array('doNotShow' => true), 'sql' => "blob NULL"), 'autologin' => array('default' => null, 'eval' => array('doNotCopy' => true), 'sql' => "varchar(32) NULL"), 'createdOn' => array('eval' => array('rgxp' => 'datim'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'activation' => array('eval' => array('doNotCopy' => true), 'sql' => "varchar(32) NOT NULL default ''")));
/**
* Filter disabled groups in the front end (see #6757)
*/
if (TL_MODE == 'FE') {
$GLOBALS['TL_DCA']['tl_member']['fields']['groups']['options_callback'] = array('tl_member', 'getActiveGroups');
}
/**
* Provide miscellaneous methods that are used by the data configuration array.
*
* @author Leo Feyer <https://github.com/leofeyer>
*/
class tl_member extends Backend
{
/**
* Import the back end user object
*/
public function __construct()
{
示例10: array
<?php
/*
* This file is part of the TranslationFields Bundle.
*
* (c) Daniel Kiesel <https://github.com/iCodr8>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Palettes
*/
$GLOBALS['TL_DCA']['tl_translation_fields'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'sql' => array('keys' => array('id' => 'primary', 'fid,language' => 'unique', 'fid' => 'index'))), 'list' => array('sorting' => array('mode' => 2, 'fields' => array('language'), 'panelLayout' => 'filter;sort,search'), 'label' => array('fields' => array('language', 'fid', 'content'), 'showColumns' => true), '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_content']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_content']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_content']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('default' => '{translation_legend},fid,language,content'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('inputType' => 'text', 'sql' => "int(10) unsigned NOT NULL default '0'"), 'fid' => array('label' => &$GLOBALS['TL_LANG']['tl_translation_fields']['fid'], 'exclude' => true, 'search' => true, 'sorting' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'language' => array('label' => &$GLOBALS['TL_LANG']['tl_translation_fields']['language'], 'exclude' => true, 'filter' => true, 'sorting' => true, 'inputType' => 'select', 'options' => \System::getLanguages(), 'eval' => array('chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(5) NOT NULL default ''"), 'content' => array('label' => &$GLOBALS['TL_LANG']['tl_translation_fields']['content'], 'exclude' => true, 'search' => true, 'inputType' => 'textarea', 'eval' => array('mandatory' => true), 'sql' => "text NOT NULL")));
示例11: setTranslationLanguages
private static function setTranslationLanguages()
{
// Get all languages
$arrLanguages = \System::getLanguages();
// Get all used languages
$arrLng = array();
// If languages are specified
if ($GLOBALS['TL_CONFIG']['chooseTranslationLanguages'] == '1') {
$arrTranslationLanguages = deserialize($GLOBALS['TL_CONFIG']['translationLanguages']);
if (is_array($arrTranslationLanguages) && $arrTranslationLanguages > 0) {
foreach ($arrTranslationLanguages as $strLng) {
$arrLng[$strLng] = $arrLanguages[$strLng];
}
}
} else {
$objRootPages = \TranslationFieldsPageModel::findRootPages();
if ($objRootPages !== null) {
while ($objRootPages->next()) {
$arrLng[$objRootPages->language] = $arrLanguages[$objRootPages->language];
}
}
// If langauge array is empty
if (count($arrLng) < 1) {
// Set all available languages
$arrLng = \System::getLanguages(true);
// Set the language of the user to the top
if (\BackendUser::getInstance()->language != null) {
// Get langauge value
$strLngValue = $arrLng[\BackendUser::getInstance()->language];
// Remove the current language from the array
unset($arrLng[\BackendUser::getInstance()->language]);
// Add old array to a temp array
$arrLngTemp = $arrLng;
// Generate a new array
$arrLng = array(\BackendUser::getInstance()->language => $strLngValue);
// Merge the old array into the new array
$arrLng = array_merge($arrLng, $arrLngTemp);
}
}
}
self::$arrLng = $arrLng;
}
示例12: array
<?php
/**
* Contao Open Source CMS
*
* Copyright (c) 2005-2016 Leo Feyer
*
* @license LGPL-3.0+
*/
/**
* Table tl_user
*/
$GLOBALS['TL_DCA']['tl_user'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'onload_callback' => array(array('tl_user', 'checkPermission')), 'onsubmit_callback' => array(array('tl_user', 'storeDateAdded'), array('tl_user', 'checkRemoveSession')), 'ondelete_callback' => array(array('tl_user', 'removeSession')), 'sql' => array('keys' => array('id' => 'primary', 'username' => 'unique', 'email' => 'index'))), 'list' => array('sorting' => array('mode' => 2, 'fields' => array('dateAdded DESC'), 'flag' => 1, 'panelLayout' => 'filter;sort,search,limit'), 'label' => array('fields' => array('icon', 'name', 'username', 'dateAdded'), 'showColumns' => true, 'label_callback' => array('tl_user', 'addIcon')), '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_user']['edit'], 'href' => 'act=edit', 'icon' => 'edit.svg', 'button_callback' => array('tl_user', 'editUser')), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['copy'], 'href' => 'act=copy', 'icon' => 'copy.svg', 'button_callback' => array('tl_user', 'copyUser')), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['delete'], 'href' => 'act=delete', 'icon' => 'delete.svg', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"', 'button_callback' => array('tl_user', 'deleteUser')), 'toggle' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['toggle'], 'icon' => 'visible.svg', 'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"', 'button_callback' => array('tl_user', 'toggleIcon')), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['show'], 'href' => 'act=show', 'icon' => 'show.svg'), 'su' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['su'], 'href' => 'key=su', 'icon' => 'su.svg', 'button_callback' => array('tl_user', 'switchUser')))), 'palettes' => array('__selector__' => array('inherit', 'admin'), 'login' => '{name_legend},name,email;{backend_legend},language,uploader,showHelp,thumbnails,useRTE,useCE;{session_legend},session;{theme_legend:hide},backendTheme;{password_legend},password', 'admin' => '{name_legend},username,name,email;{backend_legend:hide},language,uploader,showHelp,thumbnails,useRTE,useCE;{theme_legend:hide},backendTheme;{password_legend:hide},pwChange,password;{admin_legend},admin;{account_legend},disable,start,stop', 'default' => '{name_legend},username,name,email;{backend_legend:hide},language,uploader,showHelp,thumbnails,useRTE,useCE;{theme_legend:hide},backendTheme;{password_legend:hide},pwChange,password;{admin_legend},admin;{groups_legend},groups,inherit;{account_legend},disable,start,stop', 'group' => '{name_legend},username,name,email;{backend_legend:hide},language,uploader,showHelp,thumbnails,useRTE,useCE;{theme_legend:hide},backendTheme;{password_legend:hide},pwChange,password;{admin_legend},admin;{groups_legend},groups,inherit;{account_legend},disable,start,stop', 'extend' => '{name_legend},username,name,email;{backend_legend:hide},language,uploader,showHelp,thumbnails,useRTE,useCE;{theme_legend:hide},backendTheme;{password_legend:hide},pwChange,password;{admin_legend},admin;{groups_legend},groups,inherit;{modules_legend},modules,themes;{pagemounts_legend},pagemounts,alpty;{filemounts_legend},filemounts,fop;{imageSizes_legend},imageSizes;{forms_legend},forms,formp;{account_legend},disable,start,stop', 'custom' => '{name_legend},username,name,email;{backend_legend:hide},language,uploader,showHelp,thumbnails,useRTE,useCE;{theme_legend:hide},backendTheme;{password_legend:hide},pwChange,password;{admin_legend},admin;{groups_legend},groups,inherit;{modules_legend},modules,themes;{pagemounts_legend},pagemounts,alpty;{filemounts_legend},filemounts,fop;{imageSizes_legend},imageSizes;{forms_legend},forms,formp;{account_legend},disable,start,stop'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'username' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['username'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'rgxp' => 'extnd', 'nospace' => true, 'unique' => true, 'maxlength' => 64), 'sql' => "varchar(64) COLLATE utf8_bin NULL"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['name'], 'exclude' => true, 'search' => true, 'sorting' => true, 'flag' => 1, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'email' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['email'], 'exclude' => true, 'search' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'rgxp' => 'email', 'maxlength' => 255, 'unique' => true, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'language' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['language'], 'default' => str_replace('-', '_', $GLOBALS['TL_LANGUAGE']), 'exclude' => true, 'filter' => true, 'inputType' => 'select', 'eval' => array('rgxp' => 'locale', 'tl_class' => 'w50'), 'options_callback' => function () {
return System::getLanguages(true);
}, 'sql' => "varchar(5) NOT NULL default ''"), 'backendTheme' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['backendTheme'], 'exclude' => true, 'inputType' => 'select', 'options_callback' => function () {
return Backend::getThemes();
}, 'sql' => "varchar(32) NOT NULL default ''"), 'uploader' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['uploader'], 'exclude' => true, 'inputType' => 'select', 'options' => array('DropZone', 'FileUpload'), 'reference' => &$GLOBALS['TL_LANG']['tl_user'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'showHelp' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['showHelp'], 'default' => 1, 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'thumbnails' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['thumbnails'], 'default' => 1, 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'useRTE' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['useRTE'], 'default' => 1, 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'useCE' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['useCE'], 'default' => 1, 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'password' => array('label' => &$GLOBALS['TL_LANG']['MSC']['password'], 'exclude' => true, 'inputType' => 'password', 'eval' => array('mandatory' => true, 'preserveTags' => true, 'minlength' => Config::get('minPasswordLength')), 'sql' => "varchar(128) NOT NULL default ''"), 'pwChange' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['pwChange'], 'exclude' => true, 'inputType' => 'checkbox', 'filter' => true, 'sql' => "char(1) NOT NULL default ''"), 'admin' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['admin'], 'exclude' => true, 'inputType' => 'checkbox', 'filter' => true, 'eval' => array('submitOnChange' => true), 'save_callback' => array(array('tl_user', 'checkAdminStatus')), 'sql' => "char(1) NOT NULL default ''"), 'groups' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['groups'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkboxWizard', 'foreignKey' => 'tl_user_group.name', 'eval' => array('multiple' => true), 'sql' => "blob NULL", 'relation' => array('type' => 'belongsToMany', 'load' => 'lazy')), 'inherit' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['inherit'], 'exclude' => true, 'default' => 'group', 'inputType' => 'radio', 'options' => array('group', 'extend', 'custom'), 'reference' => &$GLOBALS['TL_LANG']['tl_user'], 'eval' => array('helpwizard' => true, 'submitOnChange' => true), 'sql' => "varchar(12) NOT NULL default ''"), 'modules' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['modules'], 'exclude' => true, 'filter' => true, 'inputType' => 'checkbox', 'options_callback' => array('tl_user', 'getModules'), 'reference' => &$GLOBALS['TL_LANG']['MOD'], 'eval' => array('multiple' => true, 'helpwizard' => true), 'sql' => "blob NULL"), 'themes' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['themes'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('css', 'modules', 'layout', 'image_sizes', 'theme_import', 'theme_export'), 'reference' => &$GLOBALS['TL_LANG']['MOD'], 'eval' => array('multiple' => true), 'sql' => "blob NULL"), 'pagemounts' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['pagemounts'], 'exclude' => true, 'inputType' => 'pageTree', 'eval' => array('multiple' => true, 'fieldType' => 'checkbox'), 'sql' => "blob NULL"), 'alpty' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['alpty'], 'default' => array('regular', 'redirect', 'forward'), 'exclude' => true, 'inputType' => 'checkbox', 'options' => array_keys($GLOBALS['TL_PTY']), 'reference' => &$GLOBALS['TL_LANG']['PTY'], 'eval' => array('multiple' => true, 'helpwizard' => true), 'sql' => "blob NULL"), 'filemounts' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['filemounts'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('multiple' => true, 'fieldType' => 'checkbox'), 'sql' => "blob NULL"), 'fop' => array('label' => &$GLOBALS['TL_LANG']['FOP']['fop'], 'default' => array('f1', 'f2', 'f3'), 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('f1', 'f2', 'f3', 'f4', 'f5', 'f6'), 'reference' => &$GLOBALS['TL_LANG']['FOP'], 'eval' => array('multiple' => true), 'sql' => "blob NULL"), 'imageSizes' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['imageSizes'], 'exclude' => true, 'inputType' => 'checkbox', 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true), 'options_callback' => function () {
return System::getContainer()->get('contao.image.image_sizes')->getAllOptions();
}, 'sql' => "blob NULL"), 'forms' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['forms'], 'exclude' => true, 'inputType' => 'checkbox', 'foreignKey' => 'tl_form.title', 'eval' => array('multiple' => true), 'sql' => "blob NULL"), 'formp' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['formp'], 'exclude' => true, 'inputType' => 'checkbox', 'options' => array('create', 'delete'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('multiple' => true), 'sql' => "blob NULL"), 'disable' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['disable'], 'exclude' => true, 'filter' => true, 'flag' => 2, 'inputType' => 'checkbox', 'save_callback' => array(array('tl_user', 'checkAdminDisable')), 'sql' => "char(1) NOT NULL default ''"), 'start' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['start'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'stop' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['stop'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'datim', 'datepicker' => true, 'tl_class' => 'w50 wizard'), 'sql' => "varchar(10) NOT NULL default ''"), 'session' => array('label' => &$GLOBALS['TL_LANG']['tl_user']['session'], 'exclude' => true, 'input_field_callback' => array('tl_user', 'sessionField'), 'eval' => array('doNotShow' => true, 'doNotCopy' => true), 'sql' => "blob NULL"), 'dateAdded' => array('label' => &$GLOBALS['TL_LANG']['MSC']['dateAdded'], 'default' => time(), 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'lastLogin' => array('eval' => array('rgxp' => 'datim', 'doNotShow' => true, 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'currentLogin' => array('label' => &$GLOBALS['TL_LANG']['MSC']['lastLogin'], 'sorting' => true, 'flag' => 6, 'eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'loginCount' => array('default' => 3, 'eval' => array('doNotCopy' => true), 'sql' => "smallint(5) unsigned NOT NULL default '3'"), 'locked' => array('eval' => array('rgxp' => 'datim', 'doNotCopy' => true), 'sql' => "int(10) unsigned NOT NULL default '0'")));
/**
* Provide miscellaneous methods that are used by the data configuration array.
*
* @author Leo Feyer <https://github.com/leofeyer>
*/
class tl_user extends Backend
{
/**
* Import the back end user object
*/
public function __construct()
{
示例13: array
<?php
/**
* notification_center extension for Contao Open Source CMS
*
* @copyright Copyright (c) 2008-2015, terminal42
* @author terminal42 gmbh <info@terminal42.ch>
* @license LGPL
*/
$this->loadDataContainer('tl_nc_gateway');
/**
* Table tl_nc_language
*/
$GLOBALS['TL_DCA']['tl_nc_language'] = array('config' => array('ptable' => 'tl_nc_message', 'dataContainer' => 'Table', 'enableVersioning' => true, 'nc_type_query' => "SELECT type FROM tl_nc_notification WHERE id=(SELECT pid FROM tl_nc_message WHERE id=(SELECT pid FROM tl_nc_language WHERE id=?))", 'oncreate_callback' => array(array('NotificationCenter\\tl_nc_language', 'insertGatewayType')), 'onload_callback' => array(array('NotificationCenter\\tl_nc_language', 'modifyPalette'), array('NotificationCenter\\AutoSuggester', 'load')), 'sql' => array('keys' => array('id' => 'primary', 'pid' => 'index', 'language' => 'index'))), 'list' => array('sorting' => array('mode' => 1, 'fields' => array('language'), 'flag' => 1), 'label' => array('fields' => array('language', 'fallback'), 'format' => '%s <span style="color:#b3b3b3; padding-left:3px;">[%s]</span>'), '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_nc_language']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('__selector__' => array('gateway_type', 'email_mode'), 'default' => '{general_legend},language,fallback', 'email' => '{general_legend},language,fallback;{meta_legend},email_sender_name,email_sender_address,recipients,email_recipient_cc,email_recipient_bcc,email_replyTo;{content_legend},email_subject,email_mode;{attachments_legend},attachments,attachment_tokens', 'file' => '{general_legend},language,fallback;{meta_legend},file_name,file_storage_mode;{content_legend},file_content', 'postmark' => '{general_legend},language,fallback;{meta_legend},email_sender_name,email_sender_address,recipients,email_recipient_cc,email_recipient_bcc,email_replyTo;{content_legend},email_subject,email_mode'), 'subpalettes' => array('email_mode_textOnly' => 'email_text', 'email_mode_textAndHtml' => 'email_text,email_html'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('foreignKey' => 'tl_nc_message.title', 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'belongsTo', 'load' => 'lazy')), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'gateway_type' => array('eval' => array('doNotShow' => true), 'sql' => &$GLOBALS['TL_DCA']['tl_nc_gateway']['fields']['type']['sql']), 'language' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['language'], 'exclude' => true, 'default' => $GLOBALS['TL_LANGUAGE'], 'inputType' => 'select', 'options' => \System::getLanguages(), 'eval' => array('mandatory' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "varchar(5) NOT NULL default ''", 'save_callback' => array(array('NotificationCenter\\tl_nc_language', 'validateLanguageField'))), 'fallback' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['fallback'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default ''", 'save_callback' => array(array('NotificationCenter\\tl_nc_language', 'validateFallbackField'))), 'recipients' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['recipients'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'nc_tokens', 'tl_class' => 'long clr', 'decodeEntities' => true, 'mandatory' => true), 'sql' => "varchar(255) NOT NULL default ''", 'save_callback' => array(array('NotificationCenter\\tl_nc_language', 'validateEmailList'))), 'attachment_tokens' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['attachment_tokens'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'nc_tokens', 'tl_class' => 'long clr', 'decodeEntities' => true), 'sql' => "varchar(255) NOT NULL default ''"), 'attachments' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['attachments'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('multiple' => true, 'fieldType' => 'checkbox', 'files' => true, 'filesOnly' => true, 'tl_class' => 'clr'), 'sql' => "blob NULL"), 'email_sender_name' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['email_sender_name'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'nc_tokens', 'decodeEntities' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'email_sender_address' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['email_sender_address'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'nc_tokens', 'maxlength' => 255, 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''", 'save_callback' => array(array('NotificationCenter\\tl_nc_language', 'validateEmailList'))), 'email_recipient_cc' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['email_recipient_cc'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('rgxp' => 'nc_tokens', 'style' => 'height:40px; width:314px', 'decodeEntities' => true, 'tl_class' => 'w50" style="height:auto'), 'sql' => "text NULL", 'save_callback' => array(array('NotificationCenter\\tl_nc_language', 'validateEmailList'))), 'email_recipient_bcc' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['email_recipient_bcc'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('rgxp' => 'nc_tokens', 'style' => 'height:40px; width:314px', 'decodeEntities' => true, 'tl_class' => 'w50" style="height:auto'), 'sql' => "text NULL", 'save_callback' => array(array('NotificationCenter\\tl_nc_language', 'validateEmailList'))), 'email_replyTo' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['email_replyTo'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'nc_tokens', 'decodeEntities' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''", 'save_callback' => array(array('NotificationCenter\\tl_nc_language', 'validateEmailList'))), 'email_subject' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['email_subject'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'nc_tokens', 'tl_class' => 'long clr', 'decodeEntities' => true, 'mandatory' => true), 'sql' => "varchar(255) NOT NULL default ''"), 'email_mode' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['email_mode'], 'exclude' => true, 'default' => 'textOnly', 'inputType' => 'radio', 'options' => array('textOnly', 'textAndHtml'), 'reference' => &$GLOBALS['TL_LANG']['tl_nc_language']['email_mode'], 'eval' => array('tl_class' => 'clr', 'submitOnChange' => true), 'sql' => "varchar(16) NOT NULL default ''"), 'email_text' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['email_text'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('rgxp' => 'nc_tokens', 'tl_class' => 'clr', 'decodeEntities' => true, 'mandatory' => true), 'sql' => "text NULL"), 'email_html' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['email_html'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('rgxp' => 'nc_tokens', 'tl_class' => 'clr', 'rte' => 'tinyMCE', 'decodeEntities' => true, 'allowHtml' => true, 'mandatory' => true), 'sql' => "text NULL"), 'file_name' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['file_name'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('rgxp' => 'nc_tokens', 'tl_class' => 'w50', 'decodeEntities' => true, 'mandatory' => true), 'sql' => "varchar(255) NOT NULL default ''"), 'file_storage_mode' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['file_storage_mode'], 'exclude' => true, 'inputType' => 'select', 'options' => array(\NotificationCenter\Gateway\File::FILE_STORAGE_OVERRIDE, \NotificationCenter\Gateway\File::FILE_STORAGE_APPEND), 'reference' => &$GLOBALS['TL_LANG']['tl_nc_language']['file_storage_mode'], 'eval' => array('includeBlankOption' => true, 'blankOptionLabel' => &$GLOBALS['TL_LANG']['tl_nc_language']['file_storage_mode']['create'], 'tl_class' => 'w50'), 'sql' => "varchar(8) NOT NULL default ''"), 'file_content' => array('label' => &$GLOBALS['TL_LANG']['tl_nc_language']['file_content'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('rgxp' => 'nc_tokens', 'tl_class' => 'clr', 'decodeEntities' => true, 'preserveTags' => true, 'mandatory' => true, 'style' => 'min-height:100px'), 'sql' => "text NULL")));
示例14: show
/**
* Override the default "show" dialog.
*
* @param $dc
*
* @return string
*/
public function show($dc)
{
$arrLanguages = \System::getLanguages();
$objForm = \Database::getInstance()->prepare("\n SELECT l.*, s.title AS form_title, f.title AS master_title, CONCAT(m.firstname, ' ', m.lastname) AS member_name\n FROM tl_lead l\n LEFT OUTER JOIN tl_form s ON l.form_id=s.id\n LEFT OUTER JOIN tl_form f ON l.master_id=f.id\n LEFT OUTER JOIN tl_member m ON l.member_id=m.id\n WHERE l.id=?\n ")->execute($dc->id);
$objData = \Database::getInstance()->prepare("\n SELECT d.*, IF(ff.label IS NULL OR ff.label='', d.name, ff.label) AS name\n FROM tl_lead_data d\n LEFT OUTER JOIN tl_form_field ff ON d.master_id=ff.id\n WHERE d.pid=?\n ORDER BY d.sorting\n ")->execute($dc->id);
$template = new \BackendTemplate('be_leads_show');
$template->recordId = $dc->id;
$template->referer = \System::getReferer(true);
$template->subheadline = sprintf($GLOBALS['TL_LANG']['MSC']['showRecord'], 'ID ' . $dc->id);
$template->createdLabel = $GLOBALS['TL_LANG']['tl_lead']['created'][0];
$template->createdValue = \Date::parse($GLOBALS['TL_CONFIG']['datimFormat'], $objForm->created);
$template->formLabel = $GLOBALS['TL_LANG']['tl_lead']['form_id'][0];
$template->formTitle = $objForm->form_title;
$template->formId = $objForm->form_id;
$template->isMasterForm = $objForm->master_id == $objForm->form_id;
$template->masterLabel = $GLOBALS['TL_LANG']['tl_lead']['master_id'][0];
$template->masterTitle = $objForm->master_title;
$template->masterId = $objForm->master_id;
$template->languageLabel = $GLOBALS['TL_LANG']['tl_lead']['language'][0];
$template->languageTrans = $arrLanguages[$objForm->language];
$template->languageValue = $objForm->language;
$template->hasMember = $objForm->member_id > 0;
$template->memberLabel = $GLOBALS['TL_LANG']['tl_lead']['member'][0];
$template->memberName = $objForm->member_name;
$template->memberId = $objForm->member_id;
$i = 0;
$rows = array();
while ($objData->next()) {
$rows[] = array('label' => $objData->name, 'value' => \Leads\Leads::formatValue($objData), 'class' => $i % 2 ? 'tl_bg' : '');
++$i;
}
$template->data = $rows;
return $template->parse();
}