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


PHP GeneralUtility::getURL方法代码示例

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


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

示例1: __construct

 /**
  * Analyze a given JS script
  * @param string $inputFile
  * @param bool $string
  * @param array $config
  * @internal
  */
 public function __construct($inputFile = '', $string = FALSE, $config = array())
 {
     $this->configXML = $config;
     if ($string || ($string = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($inputFile))) {
         // we just look for double quote
         $string = str_replace("'", '"', $string);
         $result = array();
         $components = array();
         if (count($this->configXML) > 0) {
             // build the components array
             foreach ($this->configXML as $group) {
                 if (count($group['files']) > 0) {
                     foreach ($group['files'] as $file) {
                         $components[$file['name']] = $file;
                         $components[$file['name']]['groupname'] = $group['name'];
                     }
                 }
             }
             // search for
             foreach ($this->configXML as $group) {
                 if (count($group['files']) > 0) {
                     foreach ($group['files'] as $file) {
                         if ($this->contains($string, $file['sources']) === TRUE) {
                             $result = array_merge($result, array($components[$file['depends']]['name'] => $components[$file['depends']]['groupname']));
                             $result = array_merge($result, array($file['name'] => $components[$file['name']]['groupname']));
                         }
                     }
                 }
             }
         }
         $this->dependencies = $result;
     }
 }
开发者ID:clews,项目名称:t3jquery,代码行数:40,代码来源:class.analyzeJqJS.php

示例2: __construct

 /**
  * The constructor for a finisher setting the component manager and the configuration.
  *
  * @param Tx_Formhandler_Component_Manager $componentManager
  * @param Tx_Formhandler_Configuration $configuration
  * @return void
  */
 public function __construct(Tx_Formhandler_Component_Manager $componentManager, Tx_Formhandler_Configuration $configuration, Tx_Formhandler_UtilityFuncs $utilityFuncs)
 {
     $this->componentManager = $componentManager;
     $this->configuration = $configuration;
     $this->templatePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('formhandler') . 'Resources/HTML/backend/';
     $this->templateFile = $this->templatePath . 'template.html';
     $this->templateCode = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($this->templateFile);
     $this->utilityFuncs = $utilityFuncs;
 }
开发者ID:woehrlag,项目名称:new.woehrl.de,代码行数:16,代码来源:Tx_Formhandler_Controller_Backend.php

示例3: initTemplate

 /**
  * Loads a template file
  *
  * @param string  $templateFile
  * @param boolean $debug
  * @return boolean
  */
 public function initTemplate($templateFile, $debug = false)
 {
     $templateAbsPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($templateFile);
     if ($templateAbsPath !== null) {
         $this->templateContent = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($templateAbsPath);
         if ($debug === true) {
             if ($this->templateContent === null) {
                 \TYPO3\CMS\Core\Utility\DebugUtility::debug('Check the path template or the rights', 'Error');
             }
             \TYPO3\CMS\Core\Utility\DebugUtility::debug($this->templateContent, 'Content of ' . $templateFile);
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:Apen,项目名称:additional_scheduler,代码行数:23,代码来源:Templating.php

示例4: init

 public function init()
 {
     $this->data = array();
     $content = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($this->getHtmlUrl());
     switch ($this->getHtmlFetchType()) {
         case 'mailto':
             preg_match_all('|<a[^>]+href="mailto:([^"]+)"[^>]*>(.*)</a>|Ui', $content, $fetched_data);
             foreach ($fetched_data[1] as $i => $email) {
                 $this->data[] = array('email' => $email, 'name' => $fetched_data[2][$i]);
             }
             break;
         case 'regex':
         default:
             preg_match_all("|[\\.a-z0-9!#\$%&'*+-/=?^_`{\\|}]+@[a-z0-9_-][\\.a-z0-9_-]*\\.[a-z]{2,}|i", $content, $fetched_data);
             foreach ($fetched_data[0] as $address) {
                 $this->data[]['email'] = $address;
             }
     }
 }
开发者ID:siwa-pparzer,项目名称:newsletter,代码行数:19,代码来源:Html.php

示例5: getContentFromSourceFile

 /**
  * Download the content of the sourceFile
  *
  * @return bool true if the content could be downloaded successfully.
  */
 private static function getContentFromSourceFile()
 {
     $success = false;
     self::$sourceFile = self::getConfParam('sourceFile');
     if (substr(self::$sourceFile, 0, 4) !== 'http') {
         self::$sourceFile = (GeneralUtility::getIndpEnv('TYPO3_SSL') ? 'https:' : 'http:') . self::$sourceFile;
     }
     // Get file content
     self::$code = GeneralUtility::getURL(self::$sourceFile, 1, false, self::$report);
     if (self::$report['error'] === 0) {
         if (self::$report['http_code'] === '404') {
             self::setReport(true, 'getContentFromSourceFile.404', [self::linkSourceUrl()]);
         } elseif (strpos(self::$report['content_type'], 'text/javascript') !== 0) {
             self::setReport(true, 'getContentFromSourceFile.wrongType', [self::linkSourceUrl()]);
         } elseif (empty(self::$code)) {
             self::setReport(true, 'getContentFromSourceFile.emptyFile', [self::linkSourceUrl()]);
         } else {
             $success = true;
         }
     } else {
         self::setReport(true, 'getContentFromSourceFile.error', [self::linkSourceUrl(), self::$report['message']]);
     }
     return $success;
 }
开发者ID:sonority,项目名称:lib_js_analytics,代码行数:29,代码来源:Tools.php

示例6: download

 /**
  * @param string $sourceUrl
  * @param string $destFile
  * @return string HTML
  */
 protected function download($sourceUrl, $destFile)
 {
     global $LANG;
     $destDir = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('EXT:wec_map/contribJS/');
     // Get file and cancel if not existing/accessible
     $remoteFileContent = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($sourceUrl);
     if ($remoteFileContent === FALSE) {
         return $LANG->getLL('downloadError') . $sourceUrl . '<br />';
     }
     // Create dir if not existing
     if (!file_exists($destDir)) {
         mkdir($destDir);
     }
     // Write content to disk
     $handle = fopen($destDir . $destFile, 'wb');
     fwrite($handle, $remoteFileContent);
     fclose($handle);
     return $LANG->getLL('downloadSuccess') . $destFile . '<br />';
 }
开发者ID:subugoe,项目名称:typo3-wec_map,代码行数:24,代码来源:index.php

示例7: fetchTranslation

 /**
  * Fetches an extensions l10n file from the given mirror
  *
  * @param string $extensionKey Extension Key
  * @param string $language The language code of the translation to fetch
  * @param string $mirrorUrl URL of mirror to use
  * @throws \TYPO3\CMS\Lang\Exception\XmlParser
  * @return array Array containing l10n data
  */
 protected function fetchTranslation($extensionKey, $language, $mirrorUrl)
 {
     $extensionPath = GeneralUtility::strtolower($extensionKey);
     // Typical non sysext path, Hungarian:
     // http://my.mirror/ter/a/n/anextension-l10n/anextension-l10n-hu.zip
     $packageUrl = $extensionPath[0] . '/' . $extensionPath[1] . '/' . $extensionPath . '-l10n/' . $extensionPath . '-l10n-' . $language . '.zip';
     try {
         $path = ExtensionManagementUtility::extPath($extensionPath);
         if (strpos($path, '/sysext/') !== false) {
             // This is a system extension and the package URL should be adapted
             list($majorVersion, ) = explode('.', TYPO3_branch);
             // Typical non sysext path, mind the additional version part, French
             // http://my.mirror/ter/b/a/backend-l10n/backend-l10n-fr.v7.zip
             $packageUrl = $extensionPath[0] . '/' . $extensionPath[1] . '/' . $extensionPath . '-l10n/' . $extensionPath . '-l10n-' . $language . '.v' . $majorVersion . '.zip';
         }
     } catch (\BadFunctionCallException $e) {
         // Nothing to do
     }
     $l10nResponse = GeneralUtility::getURL($mirrorUrl . $packageUrl, 0, array(TYPO3_user_agent));
     if ($l10nResponse === false) {
         throw new \TYPO3\CMS\Lang\Exception\XmlParser('Error: Translation could not be fetched.', 1345736785);
     } else {
         return array($l10nResponse);
     }
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:34,代码来源:TerService.php

示例8: sendNotification

 function sendNotification(&$event, $email, $templatePath, $titleText, $unsubscribeLink, $acceptLink = '', $declineLink = '', $ics = '')
 {
     $absFile = GeneralUtility::getFileAbsFileName($templatePath);
     $template = GeneralUtility::getURL($absFile);
     $htmlTemplate = $this->cObj->getSubpart($template, '###HTML###');
     $plainTemplate = $this->cObj->getSubpart($template, '###PLAIN###');
     $switch = array();
     $rems = array();
     $wrapped = array();
     $event->getMarker($htmlTemplate, $switch, $rems, $wrapped, 'notification');
     $switch['###CURRENT_USER###'] = $this->getModifyingUser($template);
     $switch['###UNSUBSCRIBE_LINK###'] = $unsubscribeLink;
     $switch['###ACCEPT_LINK###'] = $acceptLink;
     $switch['###DECLINE_LINK###'] = $declineLink;
     $htmlTemplate = \TYPO3\CMS\Cal\Utility\Functions::substituteMarkerArrayNotCached($htmlTemplate, $switch, $rems, $wrapped);
     $switch = array();
     $rems = array();
     $wrapped = array();
     $event->getMarker($plainTemplate, $switch, $rems, $wrapped, 'notification');
     $switch['###UNSUBSCRIBE_LINK###'] = $unsubscribeLink;
     $switch['###ACCEPT_LINK###'] = $acceptLink;
     $switch['###DECLINE_LINK###'] = $declineLink;
     $plainTemplate = \TYPO3\CMS\Cal\Utility\Functions::substituteMarkerArrayNotCached($plainTemplate, $switch, $rems, $wrapped);
     $plainTemplate = $event->finish($plainTemplate);
     $htmlTemplate = $event->finish($htmlTemplate);
     $switch = array();
     $rems = array();
     $wrapped = array();
     $event->getMarker($titleText, $switch, $rems, $wrapped, 'title');
     if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 4005010) {
         $this->mailer->subject = \TYPO3\CMS\Cal\Utility\Functions::substituteMarkerArrayNotCached($titleText, $switch, $rems, $wrapped);
     } else {
         $this->mailer->setSubject(\TYPO3\CMS\Cal\Utility\Functions::substituteMarkerArrayNotCached($titleText, $switch, $rems, $wrapped));
     }
     $this->sendEmail($email, $htmlTemplate, $plainTemplate);
 }
开发者ID:ulrikkold,项目名称:cal,代码行数:36,代码来源:NotificationView.php

示例9: getURL

 /**
  * Return the content of the given URL
  * @param string $url
  * @return string
  */
 protected function getURL($url)
 {
     return \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($url);
 }
开发者ID:Easter1021,项目名称:newsletter,代码行数:9,代码来源:Validator.php

示例10: downloadLatestPiwik

 /**
  * @return string
  * @throws Exception
  */
 private function downloadLatestPiwik()
 {
     // tell installer where to grab piwik
     $settings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['piwikintegration']);
     if (array_key_exists('piwikDownloadSource', $settings) && $settings['piwikDownloadSource'] != '') {
         $downloadSource = $settings['piwikDownloadSource'];
     } else {
         $downloadSource = 'http://builds.piwik.org/latest.zip';
     }
     //download piwik into typo3temp
     $zipArchivePath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName('typo3temp/piwiklatest.zip');
     \TYPO3\CMS\Core\Utility\GeneralUtility::writeFileToTypo3tempDir($zipArchivePath, \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($downloadSource));
     if (@filesize($zipArchivePath) === FALSE) {
         throw new \Exception('Installation invalid, typo3temp ' . $zipArchivePath . ' can´t be created for some reason');
     }
     if (@filesize($zipArchivePath) < 10) {
         throw new \Exception('Installation invalid, typo3temp' . $zipArchivePath . ' is smaller than 10 bytes, download definitly failed');
     }
     return $zipArchivePath;
 }
开发者ID:heiko-hardt,项目名称:TYPO3.piwikintegration,代码行数:24,代码来源:Install.php

示例11: init

    /**
     * Initialization
     *
     * @return void
     */
    public function init()
    {
        $language = $this->getLanguageService();
        $language->includeLLFile('EXT:commerce/Resources/Private/Language/locallang_mod_statistic.xml');
        $language->includeLLFile('EXT:lang/locallang_mod_web_list.php');
        parent::init();
        $this->extConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][COMMERCE_EXTKEY]['extConf'];
        $this->excludePids = $this->extConf['excludeStatisticFolders'] != '' ? $this->extConf['excludeStatisticFolders'] : 0;
        $this->statistics = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Commerce_Utility_StatisticsUtility');
        $this->statistics->init($this->extConf['excludeStatisticFolders'] != '' ? $this->extConf['excludeStatisticFolders'] : 0);
        $this->orderPageId = current(array_unique(Tx_Commerce_Domain_Repository_FolderRepository::initFolders('Orders', 'Commerce', 0, 'Commerce')));
        /**
         * If we get an id via GP use this, else use the default id
         */
        $this->id = (int) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
        if (!$this->id) {
            $this->id = $this->orderPageId;
        }
        $this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
        $this->doc->backPath = $GLOBALS['BACK_PATH'];
        $this->doc->docType = 'xhtml_trans';
        $this->doc->setModuleTemplate(PATH_TXCOMMERCE . 'Resources/Private/Backend/mod_index.html');
        if (!$this->doc->moduleTemplate) {
            \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('cannot set moduleTemplate', 'commerce', 2, array('backpath' => $this->doc->backPath, 'filename from TBE_STYLES' => $GLOBALS['TBE_STYLES']['htmlTemplates']['mod_index.html'], 'full path' => $this->doc->backPath . $GLOBALS['TBE_STYLES']['htmlTemplates']['mod_index.html']));
            $templateFile = PATH_TXCOMMERCE_REL . 'Resources/Private/Backend/mod_index.html';
            $this->doc->moduleTemplate = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL(PATH_site . $templateFile);
        }
        $this->doc->form = '<form action="" method="POST" name="editform">';
        // JavaScript
        $this->doc->JScode = $this->doc->wrapScriptTags('
			script_ended = 0;
			function jumpToUrl(URL) {
				document.location = URL;
			}
		');
        $this->doc->postCode = $this->doc->wrapScriptTags('
			script_ended = 1;
			if (top.fsMod) {
				top.fsMod.recentIds["web"] = ' . (int) $this->id . ';
			}
		');
    }
开发者ID:AndreasA,项目名称:commerce,代码行数:47,代码来源:StatisticModuleController.php

示例12: drawIcs

    public function drawIcs(&$master_array, $getdate, $sendHeaders = true, $limitAttendeeToThisEmail = '')
    {
        $this->_init($master_array);
        $this->limitAttendeeToThisEmail = $limitAttendeeToThisEmail;
        $absFile = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($this->conf['view.']['ics.']['icsTemplate']);
        $page = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($absFile);
        if ($page == '') {
            // return '<h3>calendar: no ics template file found:</h3>'.$this->conf['view.']['ics.']['icsTemplate'];
            // falling back to default:
            $page = 'BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//TYPO3/NONSGML Calendar Base (cal) V###CAL_VERSION###//EN
METHOD:###METHOD###
<!--###EVENT### start-->
<!--###EVENT### end-->
END:VCALENDAR
			';
        }
        $ics_events = '';
        $select = 'tx_cal_event_deviation.*,tx_cal_index.start_datetime,tx_cal_index.end_datetime';
        $table = 'tx_cal_event_deviation right outer join tx_cal_index on tx_cal_event_deviation.uid = tx_cal_index.event_deviation_uid';
        $oldView = $this->conf['view'];
        $this->conf['view'] = 'single_ics';
        foreach ($this->master_array as $eventDate => $eventTimeArray) {
            if (is_subclass_of($eventTimeArray, 'TYPO3\\CMS\\Cal\\Model\\Model')) {
                $ics_events .= $eventTimeArray->renderEventFor('ics');
            } else {
                foreach ($eventTimeArray as $key => $eventArray) {
                    foreach ($eventArray as $eventUid => $event) {
                        if (is_object($event)) {
                            $ics_events .= $event->renderEventFor('ics');
                            $where = 'tx_cal_event_deviation.parentid = ' . $event->getUid() . $this->cObj->enableFields('tx_cal_event_deviation');
                            $deviationResult = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $table, $where);
                            if ($deviationResult) {
                                while ($deviationRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($deviationResult)) {
                                    $start = new \TYPO3\CMS\Cal\Model\CalDate(substr($deviationRow['start_datetime'], 0, 8));
                                    $start->setHour(substr($deviationRow['start_datetime'], 8, 2));
                                    $start->setMinute(substr($deviationRow['start_datetime'], 10, 2));
                                    $end = new \TYPO3\CMS\Cal\Model\CalDate(substr($deviationRow['end_datetime'], 0, 8));
                                    $end->setHour(substr($deviationRow['end_datetime'], 8, 2));
                                    $end->setMinute(substr($deviationRow['end_datetime'], 10, 2));
                                    unset($deviationRow['start_datetime']);
                                    unset($deviationRow['end_datetime']);
                                    $new_event = new \TYPO3\CMS\Cal\Model\EventRecDeviationModel($event, $deviationRow, $start, $end);
                                    $ics_events .= $new_event->renderEventFor('ics');
                                }
                                $GLOBALS['TYPO3_DB']->sql_free_result($deviationResult);
                            }
                        }
                    }
                }
            }
        }
        $this->conf['view'] = $oldView;
        $rems = array();
        $rems['###EVENT###'] = strip_tags($ics_events);
        $title = '';
        if (!empty($this->master_array)) {
            if (is_subclass_of($this->master_array[0], 'TYPO3\\CMS\\Cal\\Model\\Model')) {
                $title = $this->master_array[0]->getTitle();
            } else {
                $title = $this->appendCalendarTitle($title);
                $title = $this->appendCategoryTitle($title);
            }
        } else {
            $title = $this->appendCalendarTitle($title);
            $title = $this->appendCategoryTitle($title);
        }
        if ($title == '') {
            $title = $getdate;
        }
        $title .= '.ics';
        $title = strtr($title, array(' ' => '', ',' => '_'));
        if ($sendHeaders) {
            header('Expires: 0');
            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
            header('Content-Disposition: attachment; filename=' . $title);
            header('Content-Type: text/ics');
            header('Pragma: ');
            header('Cache-Control:');
        }
        include \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('cal') . 'ext_emconf.php';
        $myem_conf = array_pop($EM_CONF);
        $method = 'PUBLISH';
        if ($this->limitAttendeeToThisEmail) {
            $method = 'REQUEST';
        }
        $return = \TYPO3\CMS\Cal\Utility\Functions::substituteMarkerArrayNotCached($page, array('###CAL_VERSION###' => $myem_conf['version'], '###METHOD###' => $method, '###TIMEZONE###' => $this->cObj->cObjGetSingle($this->conf['view.']['ics.']['timezone'], $this->conf['view.']['ics.']['timezone.'])), $rems, array());
        return \TYPO3\CMS\Cal\Utility\Functions::removeEmptyLines($return);
    }
开发者ID:ulrikkold,项目名称:cal,代码行数:90,代码来源:IcsView.php

示例13: getFlexformConfiguration

 /**
  * Returns the FlexForm configuration of a grid layout.
  *
  * @param string $layoutId : The current layout ID of the grid container
  *
  * @return string
  */
 public function getFlexformConfiguration($layoutId)
 {
     $layoutSetup = $this->getLayoutSetup($layoutId);
     // Get flexform file from pi_flexform_ds if pi_flexform_ds_file not set and "FILE:" found in pi_flexform_ds for backward compatibility.
     if ($layoutSetup['pi_flexform_ds_file']) {
         $flexformConfiguration = GeneralUtility::getURL(GeneralUtility::getFileAbsFileName($layoutSetup['pi_flexform_ds_file']));
     } else {
         if (strpos($layoutSetup['pi_flexform_ds'], 'FILE:') === 0) {
             $flexformConfiguration = GeneralUtility::getURL(GeneralUtility::getFileAbsFileName(substr($layoutSetup['pi_flexform_ds'], 5)));
         } else {
             if ($layoutSetup['pi_flexform_ds']) {
                 $flexformConfiguration = $layoutSetup['pi_flexform_ds'];
             } else {
                 $flexformConfiguration = GeneralUtility::getURL(GeneralUtility::getFileAbsFileName($this->flexformConfigurationPathAndFileName));
             }
         }
     }
     return $flexformConfiguration;
 }
开发者ID:rkiciak,项目名称:gridelements,代码行数:26,代码来源:LayoutSetup.php

示例14: fetchUrlContentsForDirectMailRecord

 /**
  * Fetch content of a page (only internal and external page)
  *
  * @param array $row Directmail DB record
  * @param array $params Any default parameters (usually the ones from pageTSconfig)
  *
  * @return string Error or warning message during fetching the content
  */
 public static function fetchUrlContentsForDirectMailRecord(array $row, array $params)
 {
     $theOutput = '';
     $errorMsg = array();
     $warningMsg = array();
     $urls = self::getFullUrlsForDirectMailRecord($row);
     $plainTextUrl = $urls['plainTextUrl'];
     $htmlUrl = $urls['htmlUrl'];
     $urlBase = $urls['baseUrl'];
     // Make sure long_link_rdct_url is consistent with use_domain.
     $row['long_link_rdct_url'] = $urlBase;
     // Compile the mail
     /* @var $htmlmail Dmailer */
     $htmlmail = GeneralUtility::makeInstance('DirectMailTeam\\DirectMail\\Dmailer');
     if ($params['enable_jump_url']) {
         $htmlmail->jumperURL_prefix = $urlBase . '?id=' . $row['page'] . (intval($params['jumpurl_tracking_privacy']) ? '' : '&rid=###SYS_TABLE_NAME###_###USER_uid###') . '&mid=###SYS_MAIL_ID###' . '&aC=###SYS_AUTHCODE###' . '&jumpurl=';
         $htmlmail->jumperURL_useId = 1;
     }
     if ($params['enable_mailto_jump_url']) {
         $htmlmail->jumperURL_useMailto = 1;
     }
     $htmlmail->start();
     $htmlmail->charset = $row['charset'];
     $htmlmail->http_username = $params['http_username'];
     $htmlmail->http_password = $params['http_password'];
     $htmlmail->simulateUsergroup = $params['simulate_usergroup'];
     $htmlmail->includeMedia = $row['includeMedia'];
     if ($plainTextUrl) {
         $mailContent = GeneralUtility::getURL(self::addUserPass($plainTextUrl, $params));
         $htmlmail->addPlain($mailContent);
         if (!$mailContent || !$htmlmail->theParts['plain']['content']) {
             $errorMsg[] = $GLOBALS["LANG"]->getLL('dmail_no_plain_content');
         } elseif (!strstr($htmlmail->theParts['plain']['content'], '<!--DMAILER_SECTION_BOUNDARY')) {
             $warningMsg[] = $GLOBALS["LANG"]->getLL('dmail_no_plain_boundaries');
         }
     }
     // fetch the HTML url
     if ($htmlUrl) {
         // Username and password is added in htmlmail object
         $success = $htmlmail->addHTML(self::addUserPass($htmlUrl, $params));
         // If type = 1, we have an external page.
         if ($row['type'] == 1) {
             // Try to auto-detect the charset of the message
             $matches = array();
             $res = preg_match('/<meta[\\s]+http-equiv="Content-Type"[\\s]+content="text\\/html;[\\s]+charset=([^"]+)"/m', $htmlmail->theParts['html_content'], $matches);
             if ($res == 1) {
                 $htmlmail->charset = $matches[1];
             } elseif (isset($params['direct_mail_charset'])) {
                 $htmlmail->charset = $GLOBALS["LANG"]->csConvObj->parse_charset($params['direct_mail_charset']);
             } else {
                 $htmlmail->charset = 'iso-8859-1';
             }
         }
         if ($htmlmail->extractFramesInfo()) {
             $errorMsg[] = $GLOBALS["LANG"]->getLL('dmail_frames_not allowed');
         } elseif (!$success || !$htmlmail->theParts['html']['content']) {
             $errorMsg[] = $GLOBALS["LANG"]->getLL('dmail_no_html_content');
         } elseif (!strstr($htmlmail->theParts['html']['content'], '<!--DMAILER_SECTION_BOUNDARY')) {
             $warningMsg[] = $GLOBALS["LANG"]->getLL('dmail_no_html_boundaries');
         }
     }
     if (!count($errorMsg)) {
         // Update the record:
         $htmlmail->theParts['messageid'] = $htmlmail->messageid;
         $mailContent = base64_encode(serialize($htmlmail->theParts));
         $updateData = array('issent' => 0, 'charset' => $htmlmail->charset, 'mailContent' => $mailContent, 'renderedSize' => strlen($mailContent), 'long_link_rdct_url' => $urlBase);
         $GLOBALS['TYPO3_DB']->exec_UPDATEquery('sys_dmail', 'uid=' . intval($row['uid']), $updateData);
         if (count($warningMsg)) {
             /* @var $flashMessage FlashMessage */
             $flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', implode('<br />', $warningMsg), $GLOBALS['LANG']->getLL('dmail_warning'), FlashMessage::WARNING);
             $theOutput .= $flashMessage->render();
         }
     } else {
         /* @var $flashMessage FlashMessage */
         $flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', implode('<br />', $errorMsg), $GLOBALS['LANG']->getLL('dmail_error'), FlashMessage::ERROR);
         $theOutput .= $flashMessage->render();
     }
     return $theOutput;
 }
开发者ID:Teddytrombone,项目名称:direct_mail,代码行数:87,代码来源:DirectMailUtility.php

示例15: replaceMarkersFromMaster

 protected function replaceMarkersFromMaster()
 {
     $fieldMarkers = array();
     foreach ($this->masterTemplates as $idx => $masterTemplate) {
         $masterTemplateCode = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($this->utilityFuncs->resolvePath($masterTemplate));
         $matches = array();
         preg_match_all('/###(field|master)_([^#]*)###/', $masterTemplateCode, $matches);
         if (!empty($matches[0])) {
             $subparts = array_unique($matches[0]);
             $subpartsCodes = array();
             if (is_array($subparts)) {
                 foreach ($subparts as $index => $subpart) {
                     $subpartKey = str_replace('#', '', $subpart);
                     $code = $this->cObj->getSubpart($masterTemplateCode, $subpart);
                     if (!empty($code)) {
                         $subpartsCodes[$subpartKey] = $code;
                     }
                 }
             }
             foreach ($subpartsCodes as $subpart => $code) {
                 $matchesSlave = array();
                 preg_match_all('/###' . $subpart . '(###|_([^#]*)###)/', $this->template, $matchesSlave);
                 if (!empty($matchesSlave[0])) {
                     foreach ($matchesSlave[0] as $key => $markerName) {
                         $fieldName = $matchesSlave[2][$key];
                         $params = array();
                         if (strpos($fieldName, ';')) {
                             $parts = explode(';', $fieldName);
                             $fieldName = array_shift($parts);
                             $params = explode(',', array_shift($parts));
                         }
                         if ($fieldName) {
                             $markers = array('###fieldname###' => $fieldName, '###formValuesPrefix###' => $this->globals->getFormValuesPrefix());
                             foreach ($params as $key => $paramValue) {
                                 $markers['###param' . ++$key . '###'] = $paramValue;
                             }
                             $replacedCode = $this->cObj->substituteMarkerArray($code, $markers);
                         } else {
                             $replacedCode = $code;
                         }
                         $fieldMarkers[$markerName] = $replacedCode;
                     }
                 }
             }
         }
     }
     $this->template = $this->cObj->substituteMarkerArray($this->template, $fieldMarkers);
 }
开发者ID:mhuebe,项目名称:formhandler,代码行数:48,代码来源:Tx_Formhandler_View_Form.php


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