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


PHP Idna::decodeEmail方法代码示例

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


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

示例1: listComments

    /**
     * List a particular record
     *
     * @param array $arrRow
     *
     * @return string
     */
    public function listComments($arrRow)
    {
        $title = $GLOBALS['TL_LANG']['tl_comments'][$arrRow['source']] . ' ' . $arrRow['parent'];
        switch ($arrRow['source']) {
            case 'tl_content':
                $objParent = $this->Database->prepare("SELECT id, title FROM tl_article WHERE id=(SELECT pid FROM tl_content WHERE id=?)")->execute($arrRow['parent']);
                if ($objParent->numRows) {
                    $title .= ' (<a href="contao/main.php?do=article&amp;table=tl_content&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->title . '</a>)';
                }
                break;
            case 'tl_page':
                $objParent = $this->Database->prepare("SELECT id, title FROM tl_page WHERE id=?")->execute($arrRow['parent']);
                if ($objParent->numRows) {
                    $title .= ' (<a href="contao/main.php?do=page&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->title . '</a>)';
                }
                break;
            case 'tl_news':
                $objParent = $this->Database->prepare("SELECT id, headline FROM tl_news WHERE id=?")->execute($arrRow['parent']);
                if ($objParent->numRows) {
                    $title .= ' (<a href="contao/main.php?do=news&amp;table=tl_news&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->headline . '</a>)';
                }
                break;
            case 'tl_faq':
                $objParent = $this->Database->prepare("SELECT id, question FROM tl_faq WHERE id=?")->execute($arrRow['parent']);
                if ($objParent->numRows) {
                    $title .= ' (<a href="contao/main.php?do=faq&amp;table=tl_faq&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->question . '</a>)';
                }
                break;
            case 'tl_calendar_events':
                $objParent = $this->Database->prepare("SELECT id, title FROM tl_calendar_events WHERE id=?")->execute($arrRow['parent']);
                if ($objParent->numRows) {
                    $title .= ' (<a href="contao/main.php?do=calendar&amp;table=tl_calendar_events&amp;act=edit&amp;id=' . $objParent->id . '&amp;rt=' . REQUEST_TOKEN . '">' . $objParent->title . '</a>)';
                }
                break;
            default:
                // HOOK: support custom modules
                if (isset($GLOBALS['TL_HOOKS']['listComments']) && is_array($GLOBALS['TL_HOOKS']['listComments'])) {
                    foreach ($GLOBALS['TL_HOOKS']['listComments'] as $callback) {
                        $this->import($callback[0]);
                        if (($tmp = $this->{$callback[0]}->{$callback[1]}($arrRow)) != '') {
                            $title .= $tmp;
                            break;
                        }
                    }
                }
                break;
        }
        $key = ($arrRow['published'] ? 'published' : 'unpublished') . ($arrRow['addReply'] ? ' replied' : '');
        return '
<div class="comment_wrap">
<div class="cte_type ' . $key . '"><strong><a href="mailto:' . Idna::decodeEmail($arrRow['email']) . '" title="' . specialchars(Idna::decodeEmail($arrRow['email'])) . '">' . $arrRow['name'] . '</a></strong>' . ($arrRow['website'] != '' ? ' (<a href="' . $arrRow['website'] . '" title="' . specialchars($arrRow['website']) . '" target="_blank">' . $GLOBALS['TL_LANG']['MSC']['com_website'] . '</a>)' : '') . ' - ' . Date::parse(Config::get('datimFormat'), $arrRow['date']) . ' - IP ' . specialchars($arrRow['ip']) . '<br>' . $title . '</div>
<div class="limit_height mark_links' . (!Config::get('doNotCollapse') ? ' h52' : '') . '">
' . $arrRow['comment'] . '
</div>
</div>' . "\n    ";
    }
开发者ID:eknoes,项目名称:core,代码行数:63,代码来源:tl_comments.php

示例2: generate

 /**
  * Generate the widget and return it as string
  *
  * @return string The widget markup
  */
 public function generate()
 {
     $strType = $this->hideInput ? 'password' : 'text';
     if (!$this->multiple) {
         // Hide the Punycode format (see #2750)
         if ($this->rgxp == 'url') {
             $this->value = \Idna::decode($this->value);
         } elseif ($this->rgxp == 'email' || $this->rgxp == 'friendly') {
             $this->value = \Idna::decodeEmail($this->value);
         }
         return sprintf('<input type="%s" name="%s" id="ctrl_%s" class="text%s%s" value="%s"%s%s', $strType, $this->strName, $this->strId, $this->hideInput ? ' password' : '', $this->strClass != '' ? ' ' . $this->strClass : '', specialchars($this->value), $this->getAttributes(), $this->strTagEnding) . $this->addSubmit();
     }
     // Return if field size is missing
     if (!$this->size) {
         return '';
     }
     if (!is_array($this->value)) {
         $this->value = array($this->value);
     }
     $arrFields = array();
     for ($i = 0; $i < $this->size; $i++) {
         $arrFields[] = sprintf('<input type="%s" name="%s[]" id="ctrl_%s" class="text_%s" value="%s"%s%s', $strType, $this->strName, $this->strId . '_' . $i, $this->size, specialchars(@$this->value[$i]), $this->getAttributes(), $this->strTagEnding);
     }
     return sprintf('<div id="ctrl_%s"%s>%s</div>', $this->strId, $this->strClass != '' ? ' class="' . $this->strClass . '"' : '', implode(' ', $arrFields)) . $this->addSubmit();
 }
开发者ID:alnv,项目名称:fmodul,代码行数:30,代码来源:FormTextFieldCustom.php

示例3: listRecipient

 /**
  * List a recipient
  *
  * @param array $row
  *
  * @return string
  */
 public function listRecipient($row)
 {
     $label = Idna::decodeEmail($row['email']);
     if ($row['addedOn']) {
         $label .= ' <span style="color:#b3b3b3;padding-left:3px">(' . sprintf($GLOBALS['TL_LANG']['tl_newsletter_recipients']['subscribed'], Date::parse(Config::get('datimFormat'), $row['addedOn'])) . ')</span>';
     } else {
         $label .= ' <span style="color:#b3b3b3;padding-left:3px">(' . $GLOBALS['TL_LANG']['tl_newsletter_recipients']['manually'] . ')</span>';
     }
     return sprintf('<div class="tl_content_left"><div class="list_icon" style="background-image:url(\'%ssystem/themes/%s/images/%s.gif\')" data-icon="member.gif" data-icon-disabled="member_.gif">%s</div></div>', TL_ASSETS_URL, Backend::getTheme(), $row['active'] ? 'member' : 'member_', $label) . "\n";
 }
开发者ID:eknoes,项目名称:core,代码行数:17,代码来源:tl_newsletter_recipients.php

示例4: sendPasswordLink

 /**
  * Create a new user and redirect
  *
  * @param \MemberModel $objMember
  */
 protected function sendPasswordLink($objMember)
 {
     $confirmationId = md5(uniqid(mt_rand(), true));
     // Store the confirmation ID
     $objMember = \MemberModel::findByPk($objMember->id);
     $objMember->activation = $confirmationId;
     $objMember->save();
     // Prepare the simple token data
     $arrData = $objMember->row();
     $arrData['domain'] = \Idna::decode(\Environment::get('host'));
     $arrData['link'] = \Idna::decode(\Environment::get('base')) . \Environment::get('request') . (\Config::get('disableAlias') || strpos(\Environment::get('request'), '?') !== false ? '&' : '?') . 'token=' . $confirmationId;
     // Send e-mail
     $objEmail = new \Email();
     $objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];
     $objEmail->fromName = $GLOBALS['TL_ADMIN_NAME'];
     $objEmail->subject = sprintf($GLOBALS['TL_LANG']['MSC']['passwordSubject'], \Idna::decode(\Environment::get('host')));
     $objEmail->text = \StringUtil::parseSimpleTokens($this->reg_password, $arrData);
     $objEmail->sendTo($objMember->email);
     $this->log('A new password has been requested for user ID ' . $objMember->id . ' (' . \Idna::decodeEmail($objMember->email) . ')', __METHOD__, TL_ACCESS);
     // Check whether there is a jumpTo page
     if (($objJumpTo = $this->objModel->getRelated('jumpTo')) !== null) {
         $this->jumpToOrReload($objJumpTo->row());
     }
     $this->reload();
 }
开发者ID:eknoes,项目名称:core,代码行数:30,代码来源:ModulePassword.php

示例5: activateAcount

 /**
  * Activate an account
  */
 protected function activateAcount()
 {
     $this->strTemplate = 'mod_message';
     /** @var \FrontendTemplate|object $objTemplate */
     $objTemplate = new \FrontendTemplate($this->strTemplate);
     $this->Template = $objTemplate;
     $objMember = \MemberModel::findOneByActivation(\Input::get('token'));
     if ($objMember === null) {
         $this->Template->type = 'error';
         $this->Template->message = $GLOBALS['TL_LANG']['MSC']['accountError'];
         return;
     }
     // Update the account
     $objMember->disable = '';
     $objMember->activation = '';
     $objMember->save();
     // HOOK: post activation callback
     if (isset($GLOBALS['TL_HOOKS']['activateAccount']) && is_array($GLOBALS['TL_HOOKS']['activateAccount'])) {
         foreach ($GLOBALS['TL_HOOKS']['activateAccount'] as $callback) {
             $this->import($callback[0]);
             $this->{$callback[0]}->{$callback[1]}($objMember, $this);
         }
     }
     // Log activity
     $this->log('User account ID ' . $objMember->id . ' (' . \Idna::decodeEmail($objMember->email) . ') has been activated', __METHOD__, TL_ACCESS);
     // Redirect to the jumpTo page
     if (($objTarget = $this->objModel->getRelated('reg_jumpTo')) !== null) {
         /** @var \PageModel $objTarget */
         $this->redirect($objTarget->getFrontendUrl());
     }
     // Confirm activation
     $this->Template->type = 'confirm';
     $this->Template->message = $GLOBALS['TL_LANG']['MSC']['accountActivated'];
 }
开发者ID:eknoes,项目名称:core,代码行数:37,代码来源:ModuleRegistration.php

示例6: __get

 /**
  * Return a parameter
  *
  * @param string $strKey The parameter key
  *
  * @return mixed The parameter value
  */
 public function __get($strKey)
 {
     switch ($strKey) {
         case 'value':
             // Hide the Punycode format (see #2750)
             if ($this->rgxp == 'url') {
                 return \Idna::decode($this->varValue);
             } elseif ($this->rgxp == 'email' || $this->rgxp == 'friendly') {
                 return \Idna::decodeEmail($this->varValue);
             } else {
                 return $this->varValue;
             }
             break;
         case 'type':
             if ($this->hideInput) {
                 return 'password';
             }
             // Use the HTML5 types (see #4138) but not the date, time and datetime types (see #5918)
             switch ($this->rgxp) {
                 case 'digit':
                     // Allow floats (see #7257)
                     if (!isset($this->arrAttributes['step'])) {
                         $this->addAttribute('step', 'any');
                     }
                     // NO break; here
                 // NO break; here
                 case 'natural':
                     return 'number';
                     break;
                 case 'phone':
                     return 'tel';
                     break;
                 case 'email':
                     return 'email';
                     break;
                 case 'url':
                     return 'url';
                     break;
             }
             return 'text';
             break;
         default:
             return parent::__get($strKey);
             break;
     }
 }
开发者ID:contao,项目名称:core-bundle,代码行数:53,代码来源:FormTextField.php

示例7: generate

 /**
  * Generate the widget and return it as string
  *
  * @return string
  */
 public function generate()
 {
     $strType = $this->hideInput ? 'password' : 'text';
     if (!$this->multiple) {
         // Hide the Punycode format (see #2750)
         if ($this->rgxp == 'url') {
             $this->varValue = \Idna::decode($this->varValue);
         } elseif ($this->rgxp == 'email' || $this->rgxp == 'friendly') {
             $this->varValue = \Idna::decodeEmail($this->varValue);
         }
         return sprintf('<input type="%s" name="%s" id="ctrl_%s" class="tl_text%s" value="%s"%s onfocus="Backend.getScrollOffset()">%s', $strType, $this->strName, $this->strId, $this->strClass != '' ? ' ' . $this->strClass : '', \StringUtil::specialchars($this->varValue), $this->getAttributes(), $this->wizard);
     }
     // Return if field size is missing
     if (!$this->size) {
         return '';
     }
     if (!is_array($this->varValue)) {
         $this->varValue = array($this->varValue);
     }
     $arrFields = array();
     for ($i = 0; $i < $this->size; $i++) {
         $arrFields[] = sprintf('<input type="%s" name="%s[]" id="ctrl_%s" class="tl_text_%s" value="%s"%s onfocus="Backend.getScrollOffset()">', $strType, $this->strName, $this->strId . '_' . $i, $this->size, \StringUtil::specialchars(@$this->varValue[$i]), $this->getAttributes());
     }
     return sprintf('<div id="ctrl_%s" class="tl_text_field%s">%s</div>%s', $this->strId, $this->strClass != '' ? ' ' . $this->strClass : '', implode(' ', $arrFields), $this->wizard);
 }
开发者ID:contao,项目名称:core-bundle,代码行数:30,代码来源:TextField.php

示例8: compile

 /**
  * Generate the module
  */
 protected function compile()
 {
     $this->import('FrontendUser', 'User');
     // Initialize the password widget
     $arrField = array('name' => 'password', 'inputType' => 'text', 'label' => $GLOBALS['TL_LANG']['MSC']['password'][0], 'eval' => array('hideInput' => true, 'mandatory' => true, 'required' => true, 'tableless' => $this->tableless));
     $objWidget = new \FormTextField(\FormTextField::getAttributesFromDca($arrField, $arrField['name']));
     $objWidget->rowClass = 'row_0 row_first even';
     // Validate widget
     if (\Input::post('FORM_SUBMIT') == 'tl_close_account') {
         $objWidget->validate();
         // Validate the password
         if (!$objWidget->hasErrors()) {
             // The password has been generated with crypt()
             if (\Encryption::test($this->User->password)) {
                 $blnAuthenticated = \Encryption::verify($objWidget->value, $this->User->password);
             } else {
                 list($strPassword, $strSalt) = explode(':', $this->User->password);
                 $blnAuthenticated = $strSalt == '' ? $strPassword === sha1($objWidget->value) : $strPassword === sha1($strSalt . $objWidget->value);
             }
             if (!$blnAuthenticated) {
                 $objWidget->value = '';
                 $objWidget->addError($GLOBALS['TL_LANG']['ERR']['invalidPass']);
             }
         }
         // Close account
         if (!$objWidget->hasErrors()) {
             // HOOK: send account ID
             if (isset($GLOBALS['TL_HOOKS']['closeAccount']) && is_array($GLOBALS['TL_HOOKS']['closeAccount'])) {
                 foreach ($GLOBALS['TL_HOOKS']['closeAccount'] as $callback) {
                     $this->import($callback[0]);
                     $this->{$callback[0]}->{$callback[1]}($this->User->id, $this->reg_close, $this);
                 }
             }
             $objMember = \MemberModel::findByPk($this->User->id);
             // Remove the account
             if ($this->reg_close == 'close_delete') {
                 $objMember->delete();
                 $this->log('User account ID ' . $this->User->id . ' (' . \Idna::decodeEmail($this->User->email) . ') has been deleted', __METHOD__, TL_ACCESS);
             } else {
                 $objMember->disable = 1;
                 $objMember->tstamp = time();
                 $objMember->save();
                 $this->log('User account ID ' . $this->User->id . ' (' . \Idna::decodeEmail($this->User->email) . ') has been deactivated', __METHOD__, TL_ACCESS);
             }
             $this->User->logout();
             // Check whether there is a jumpTo page
             if (($objJumpTo = $this->objModel->getRelated('jumpTo')) !== null) {
                 $this->jumpToOrReload($objJumpTo->row());
             }
             $this->reload();
         }
     }
     $this->Template->fields = $objWidget->parse();
     $this->Template->formId = 'tl_close_account';
     $this->Template->action = \Environment::get('indexFreeRequest');
     $this->Template->slabel = specialchars($GLOBALS['TL_LANG']['MSC']['closeAccount']);
     $this->Template->rowLast = 'row_1 row_last odd';
     $this->Template->tableless = $this->tableless;
 }
开发者ID:eknoes,项目名称:core,代码行数:62,代码来源:ModuleCloseAccount.php

示例9: send

    /**
     * Renturn a form to choose an existing style sheet and import it
     *
     * @param \DataContainer $dc
     *
     * @return string
     */
    public function send(\DataContainer $dc)
    {
        $objNewsletter = $this->Database->prepare("SELECT n.*, c.useSMTP, c.smtpHost, c.smtpUser, c.smtpPass, c.smtpEnc, c.smtpPort FROM tl_newsletter n LEFT JOIN tl_newsletter_channel c ON n.pid=c.id WHERE n.id=?")->limit(1)->execute($dc->id);
        // Return if there is no newsletter
        if ($objNewsletter->numRows < 1) {
            return '';
        }
        // Overwrite the SMTP configuration
        if ($objNewsletter->useSMTP) {
            \Config::set('useSMTP', true);
            \Config::set('smtpHost', $objNewsletter->smtpHost);
            \Config::set('smtpUser', $objNewsletter->smtpUser);
            \Config::set('smtpPass', $objNewsletter->smtpPass);
            \Config::set('smtpEnc', $objNewsletter->smtpEnc);
            \Config::set('smtpPort', $objNewsletter->smtpPort);
        }
        // Add default sender address
        if ($objNewsletter->sender == '') {
            list($objNewsletter->senderName, $objNewsletter->sender) = \StringUtil::splitFriendlyEmail(\Config::get('adminEmail'));
        }
        $arrAttachments = array();
        $blnAttachmentsFormatError = false;
        // Add attachments
        if ($objNewsletter->addFile) {
            $files = deserialize($objNewsletter->files);
            if (!empty($files) && is_array($files)) {
                $objFiles = \FilesModel::findMultipleByUuids($files);
                if ($objFiles === null) {
                    if (!\Validator::isUuid($files[0])) {
                        $blnAttachmentsFormatError = true;
                        \Message::addError($GLOBALS['TL_LANG']['ERR']['version2format']);
                    }
                } else {
                    while ($objFiles->next()) {
                        if (is_file(TL_ROOT . '/' . $objFiles->path)) {
                            $arrAttachments[] = $objFiles->path;
                        }
                    }
                }
            }
        }
        // Replace insert tags
        $html = $this->replaceInsertTags($objNewsletter->content, false);
        $text = $this->replaceInsertTags($objNewsletter->text, false);
        // Convert relative URLs
        if ($objNewsletter->externalImages) {
            $html = $this->convertRelativeUrls($html);
        }
        // Send newsletter
        if (!$blnAttachmentsFormatError && \Input::get('token') != '' && \Input::get('token') == $this->Session->get('tl_newsletter_send')) {
            $referer = preg_replace('/&(amp;)?(start|mpc|token|recipient|preview)=[^&]*/', '', \Environment::get('request'));
            // Preview
            if (isset($_GET['preview'])) {
                // Check the e-mail address
                if (!\Validator::isEmail(\Input::get('recipient', true))) {
                    $_SESSION['TL_PREVIEW_MAIL_ERROR'] = true;
                    $this->redirect($referer);
                }
                $arrRecipient['email'] = urldecode(\Input::get('recipient', true));
                // Send
                $objEmail = $this->generateEmailObject($objNewsletter, $arrAttachments);
                $this->sendNewsletter($objEmail, $objNewsletter, $arrRecipient, $text, $html);
                // Redirect
                \Message::addConfirmation(sprintf($GLOBALS['TL_LANG']['tl_newsletter']['confirm'], 1));
                $this->redirect($referer);
            }
            // Get the total number of recipients
            $objTotal = $this->Database->prepare("SELECT COUNT(DISTINCT email) AS count FROM tl_newsletter_recipients WHERE pid=? AND active=1")->execute($objNewsletter->pid);
            // Return if there are no recipients
            if ($objTotal->count < 1) {
                $this->Session->set('tl_newsletter_send', null);
                \Message::addError($GLOBALS['TL_LANG']['tl_newsletter']['error']);
                $this->redirect($referer);
            }
            $intTotal = $objTotal->count;
            // Get page and timeout
            $intTimeout = \Input::get('timeout') > 0 ? \Input::get('timeout') : 1;
            $intStart = \Input::get('start') ? \Input::get('start') : 0;
            $intPages = \Input::get('mpc') ? \Input::get('mpc') : 10;
            // Get recipients
            $objRecipients = $this->Database->prepare("SELECT *, r.email FROM tl_newsletter_recipients r LEFT JOIN tl_member m ON(r.email=m.email) WHERE r.pid=? AND r.active=1 GROUP BY r.email ORDER BY r.email")->limit($intPages, $intStart)->execute($objNewsletter->pid);
            echo '<div style="font-family:Verdana,sans-serif;font-size:11px;line-height:16px;margin-bottom:12px">';
            // Send newsletter
            if ($objRecipients->numRows > 0) {
                // Update status
                if ($intStart == 0) {
                    $this->Database->prepare("UPDATE tl_newsletter SET sent=1, date=? WHERE id=?")->execute(time(), $objNewsletter->id);
                    $_SESSION['REJECTED_RECIPIENTS'] = array();
                }
                while ($objRecipients->next()) {
                    $objEmail = $this->generateEmailObject($objNewsletter, $arrAttachments);
                    $this->sendNewsletter($objEmail, $objNewsletter, $objRecipients->row(), $text, $html);
                    echo 'Sending newsletter to <strong>' . \Idna::decodeEmail($objRecipients->email) . '</strong><br>';
//.........这里部分代码省略.........
开发者ID:eknoes,项目名称:core,代码行数:101,代码来源:Newsletter.php

示例10: show

    /**
     * Return all non-excluded fields of a record as HTML table
     *
     * @return string
     */
    public function show()
    {
        if (!strlen($this->intId)) {
            return '';
        }
        $objRow = $this->Database->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?")->limit(1)->execute($this->intId);
        if ($objRow->numRows < 1) {
            return '';
        }
        $count = 1;
        $return = '';
        $row = $objRow->row();
        // Get the order fields
        $objDcaExtractor = \DcaExtractor::getInstance($this->strTable);
        $arrOrder = $objDcaExtractor->getOrderFields();
        // Get all fields
        $fields = array_keys($row);
        $allowedFields = array('id', 'pid', 'sorting', 'tstamp');
        if (is_array($GLOBALS['TL_DCA'][$this->strTable]['fields'])) {
            $allowedFields = array_unique(array_merge($allowedFields, array_keys($GLOBALS['TL_DCA'][$this->strTable]['fields'])));
        }
        // Use the field order of the DCA file
        $fields = array_intersect($allowedFields, $fields);
        // Show all allowed fields
        foreach ($fields as $i) {
            if (!in_array($i, $allowedFields) || $GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['inputType'] == 'password' || $GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['eval']['doNotShow'] || $GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['eval']['hideInput']) {
                continue;
            }
            // Special treatment for table tl_undo
            if ($this->strTable == 'tl_undo' && $i == 'data') {
                continue;
            }
            $value = deserialize($row[$i]);
            // Decrypt the value
            if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['eval']['encrypt']) {
                $value = \Encryption::decrypt($value);
            }
            $class = $count++ % 2 == 0 ? ' class="tl_bg"' : '';
            // Get the field value
            if (isset($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['foreignKey'])) {
                $temp = array();
                $chunks = explode('.', $GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['foreignKey'], 2);
                foreach ((array) $value as $v) {
                    $objKey = $this->Database->prepare("SELECT " . $chunks[1] . " AS value FROM " . $chunks[0] . " WHERE id=?")->limit(1)->execute($v);
                    if ($objKey->numRows) {
                        $temp[] = $objKey->value;
                    }
                }
                $row[$i] = implode(', ', $temp);
            } elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['inputType'] == 'fileTree' || in_array($i, $arrOrder)) {
                if (is_array($value)) {
                    foreach ($value as $kk => $vv) {
                        $value[$kk] = $vv ? \StringUtil::binToUuid($vv) : '';
                    }
                    $row[$i] = implode(', ', $value);
                } else {
                    $row[$i] = $value ? \StringUtil::binToUuid($value) : '';
                }
            } elseif (is_array($value)) {
                foreach ($value as $kk => $vv) {
                    if (is_array($vv)) {
                        $vals = array_values($vv);
                        $value[$kk] = $vals[0] . ' (' . $vals[1] . ')';
                    }
                }
                $row[$i] = implode(', ', $value);
            } elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['eval']['rgxp'] == 'date') {
                $row[$i] = $value ? \Date::parse(\Config::get('dateFormat'), $value) : '-';
            } elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['eval']['rgxp'] == 'time') {
                $row[$i] = $value ? \Date::parse(\Config::get('timeFormat'), $value) : '-';
            } elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['eval']['rgxp'] == 'datim' || in_array($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['flag'], array(5, 6, 7, 8, 9, 10)) || $i == 'tstamp') {
                $row[$i] = $value ? \Date::parse(\Config::get('datimFormat'), $value) : '-';
            } elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['inputType'] == 'checkbox' && !$GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['eval']['multiple']) {
                $row[$i] = $value != '' ? $GLOBALS['TL_LANG']['MSC']['yes'] : $GLOBALS['TL_LANG']['MSC']['no'];
            } elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['eval']['rgxp'] == 'email') {
                $row[$i] = \Idna::decodeEmail($value);
            } elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['inputType'] == 'textarea' && ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['eval']['allowHtml'] || $GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['eval']['preserveTags'])) {
                $row[$i] = specialchars($value);
            } elseif (is_array($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['reference'])) {
                $row[$i] = isset($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['reference'][$row[$i]]) ? is_array($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['reference'][$row[$i]]) ? $GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['reference'][$row[$i]][0] : $GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['reference'][$row[$i]] : $row[$i];
            } elseif ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['eval']['isAssociative'] || array_is_assoc($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['options'])) {
                $row[$i] = $GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['options'][$row[$i]];
            } else {
                $row[$i] = $value;
            }
            // Label
            if (isset($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['label'])) {
                $label = is_array($GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['label']) ? $GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['label'][0] : $GLOBALS['TL_DCA'][$this->strTable]['fields'][$i]['label'];
            } else {
                $label = is_array($GLOBALS['TL_LANG']['MSC'][$i]) ? $GLOBALS['TL_LANG']['MSC'][$i][0] : $GLOBALS['TL_LANG']['MSC'][$i];
            }
            if ($label == '') {
                $label = $i;
            }
            $return .= '
//.........这里部分代码省略.........
开发者ID:eknoes,项目名称:core,代码行数:101,代码来源:DC_Table.php


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